@wildo-ai/wildo-cli 1.1.13 → 1.1.15

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 (589) hide show
  1. package/dist/src/commands/build/approve.command.d.ts +4 -0
  2. package/dist/src/commands/build/approve.command.d.ts.map +1 -1
  3. package/dist/src/commands/build/approve.command.js +14 -3
  4. package/dist/src/commands/build/approve.command.js.map +1 -1
  5. package/dist/src/commands/build/close.command.d.ts +4 -0
  6. package/dist/src/commands/build/close.command.d.ts.map +1 -1
  7. package/dist/src/commands/build/close.command.js +17 -3
  8. package/dist/src/commands/build/close.command.js.map +1 -1
  9. package/dist/src/commands/config/sync.command.d.ts.map +1 -1
  10. package/dist/src/commands/config/sync.command.js +21 -1
  11. package/dist/src/commands/config/sync.command.js.map +1 -1
  12. package/dist/src/commands/creation/feed.command.d.ts.map +1 -1
  13. package/dist/src/commands/creation/feed.command.js +6 -3
  14. package/dist/src/commands/creation/feed.command.js.map +1 -1
  15. package/dist/src/commands/fwk/publish-all.command.d.ts +13 -0
  16. package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
  17. package/dist/src/commands/fwk/publish-all.command.js +57 -3
  18. package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
  19. package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
  20. package/dist/src/commands/fwk/publish-docker.command.js +16 -1
  21. package/dist/src/commands/fwk/publish-docker.command.js.map +1 -1
  22. package/dist/src/commands/fwk/registry-host.command.d.ts +19 -1
  23. package/dist/src/commands/fwk/registry-host.command.d.ts.map +1 -1
  24. package/dist/src/commands/fwk/registry-host.command.js +78 -3
  25. package/dist/src/commands/fwk/registry-host.command.js.map +1 -1
  26. package/dist/src/commands/generate/email-command.utils.d.ts +2 -0
  27. package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
  28. package/dist/src/commands/generate/email-command.utils.js +5 -0
  29. package/dist/src/commands/generate/email-command.utils.js.map +1 -1
  30. package/dist/src/commands/init.command.d.ts +14 -0
  31. package/dist/src/commands/init.command.d.ts.map +1 -1
  32. package/dist/src/commands/init.command.js +36 -5
  33. package/dist/src/commands/init.command.js.map +1 -1
  34. package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
  35. package/dist/src/commands/local/deregister.command.js +4 -0
  36. package/dist/src/commands/local/deregister.command.js.map +1 -1
  37. package/dist/src/commands/local/dev.command.d.ts +6 -0
  38. package/dist/src/commands/local/dev.command.d.ts.map +1 -1
  39. package/dist/src/commands/local/dev.command.js +72 -0
  40. package/dist/src/commands/local/dev.command.js.map +1 -1
  41. package/dist/src/commands/local/jobs-command.utils.d.ts +24 -0
  42. package/dist/src/commands/local/jobs-command.utils.d.ts.map +1 -0
  43. package/dist/src/commands/local/jobs-command.utils.js +44 -0
  44. package/dist/src/commands/local/jobs-command.utils.js.map +1 -0
  45. package/dist/src/commands/local/jobs-run.command.d.ts +7 -0
  46. package/dist/src/commands/local/jobs-run.command.d.ts.map +1 -0
  47. package/dist/src/commands/local/jobs-run.command.js +92 -0
  48. package/dist/src/commands/local/jobs-run.command.js.map +1 -0
  49. package/dist/src/commands/local/jobs.command.d.ts +7 -0
  50. package/dist/src/commands/local/jobs.command.d.ts.map +1 -0
  51. package/dist/src/commands/local/jobs.command.js +59 -0
  52. package/dist/src/commands/local/jobs.command.js.map +1 -0
  53. package/dist/src/commands/local/tunnel.command.d.ts +84 -0
  54. package/dist/src/commands/local/tunnel.command.d.ts.map +1 -0
  55. package/dist/src/commands/local/tunnel.command.js +274 -0
  56. package/dist/src/commands/local/tunnel.command.js.map +1 -0
  57. package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
  58. package/dist/src/commands/registry/repair-lockfile.command.js +1 -0
  59. package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
  60. package/dist/src/commands/registry/update.command.d.ts.map +1 -1
  61. package/dist/src/commands/registry/update.command.js +1 -0
  62. package/dist/src/commands/registry/update.command.js.map +1 -1
  63. package/dist/src/commands/seal/verify.command.d.ts +18 -0
  64. package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
  65. package/dist/src/commands/seal/verify.command.js +62 -1
  66. package/dist/src/commands/seal/verify.command.js.map +1 -1
  67. package/dist/src/services/application/app-bootstrap.service.d.ts +41 -1
  68. package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
  69. package/dist/src/services/application/app-bootstrap.service.js +49 -3
  70. package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
  71. package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
  72. package/dist/src/services/application/app-runtime-targets.service.js +9 -1
  73. package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
  74. package/dist/src/services/application/application-dependency-alignment.service.d.ts +20 -0
  75. package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
  76. package/dist/src/services/application/application-dependency-alignment.service.js +32 -2
  77. package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
  78. package/dist/src/services/application/local-tunnel.service.d.ts +153 -0
  79. package/dist/src/services/application/local-tunnel.service.d.ts.map +1 -0
  80. package/dist/src/services/application/local-tunnel.service.js +294 -0
  81. package/dist/src/services/application/local-tunnel.service.js.map +1 -0
  82. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  83. package/dist/src/services/application/provider-runtime-sync.service.js +29 -1
  84. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  85. package/dist/src/services/application/saas-skeleton.service.d.ts +7 -0
  86. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  87. package/dist/src/services/application/saas-skeleton.service.js +26 -2
  88. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  89. package/dist/src/services/catalog/service-address-resolver.service.d.ts +7 -1
  90. package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
  91. package/dist/src/services/catalog/service-address-resolver.service.js +6 -3
  92. package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
  93. package/dist/src/services/companion/build-console.service.d.ts +39 -2
  94. package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
  95. package/dist/src/services/companion/build-console.service.js +54 -4
  96. package/dist/src/services/companion/build-console.service.js.map +1 -1
  97. package/dist/src/services/companion/creation-console.service.d.ts +6 -1
  98. package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
  99. package/dist/src/services/companion/creation-console.service.js +14 -2
  100. package/dist/src/services/companion/creation-console.service.js.map +1 -1
  101. package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
  102. package/dist/src/services/companion/creation-drive.service.js +5 -2
  103. package/dist/src/services/companion/creation-drive.service.js.map +1 -1
  104. package/dist/src/services/credentials/application-secrets.service.d.ts +6 -0
  105. package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
  106. package/dist/src/services/credentials/application-secrets.service.js +1 -1
  107. package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
  108. package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
  109. package/dist/src/services/credentials/composed-provider-catalogue.js +14 -2
  110. package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
  111. package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
  112. package/dist/src/services/credentials/provider-env-vars.utils.js +3 -1
  113. package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
  114. package/dist/src/services/credentials/secret-requirements.service.d.ts +2 -1
  115. package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
  116. package/dist/src/services/credentials/secret-requirements.service.js +17 -1
  117. package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
  118. package/dist/src/services/credentials/secrets-writer.service.d.ts +11 -2
  119. package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
  120. package/dist/src/services/credentials/secrets-writer.service.js +12 -3
  121. package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
  122. package/dist/src/services/deployment/application-runtime-environment.d.ts.map +1 -1
  123. package/dist/src/services/deployment/application-runtime-environment.js +3 -13
  124. package/dist/src/services/deployment/application-runtime-environment.js.map +1 -1
  125. package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
  126. package/dist/src/services/deployment/ci-deploy-generator.service.js +3 -3
  127. package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
  128. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +3 -3
  129. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  130. package/dist/src/services/deployment/docker/docker-compose-generator.service.js +24 -14
  131. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  132. package/dist/src/services/deployment/framework-pod-network-membership.d.ts +6 -0
  133. package/dist/src/services/deployment/framework-pod-network-membership.d.ts.map +1 -1
  134. package/dist/src/services/deployment/framework-pod-network-membership.js +12 -3
  135. package/dist/src/services/deployment/framework-pod-network-membership.js.map +1 -1
  136. package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts +1 -1
  137. package/dist/src/services/deployment/host-toolchain-readiness.service.js +1 -1
  138. package/dist/src/services/deployment/host-toolchain-readiness.service.js.map +1 -1
  139. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts +4 -1
  140. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
  141. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +20 -8
  142. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
  143. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +7 -0
  144. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
  145. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
  146. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
  147. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +15 -9
  148. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
  149. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts +43 -0
  150. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts.map +1 -0
  151. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js +12 -0
  152. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js.map +1 -0
  153. package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts +3 -1
  154. package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts.map +1 -1
  155. package/dist/src/services/deployment/k8s/off-cluster-backing-services.js.map +1 -1
  156. package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts +124 -0
  157. package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts.map +1 -0
  158. package/dist/src/services/deployment/local-dev-late-workspace-members.service.js +249 -0
  159. package/dist/src/services/deployment/local-dev-late-workspace-members.service.js.map +1 -0
  160. package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
  161. package/dist/src/services/deployment/local-precondition-checks.service.js +4 -2
  162. package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
  163. package/dist/src/services/environment/authored-infra-config.utils.d.ts +9 -0
  164. package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
  165. package/dist/src/services/environment/authored-infra-config.utils.js +20 -1
  166. package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
  167. package/dist/src/services/environment/container-host-gateway-listen-host.d.ts +6 -0
  168. package/dist/src/services/environment/container-host-gateway-listen-host.d.ts.map +1 -1
  169. package/dist/src/services/environment/container-host-gateway-listen-host.js +6 -0
  170. package/dist/src/services/environment/container-host-gateway-listen-host.js.map +1 -1
  171. package/dist/src/services/environment/env-configuration-generator.service.d.ts +12 -0
  172. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  173. package/dist/src/services/environment/env-configuration-generator.service.js +45 -8
  174. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  175. package/dist/src/services/environment/env-vars-builder.service.d.ts +2 -1
  176. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  177. package/dist/src/services/environment/env-vars-builder.service.js +47 -32
  178. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  179. package/dist/src/services/environment/environment-lifecycle.service.d.ts +7 -4
  180. package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
  181. package/dist/src/services/environment/environment-lifecycle.service.js +14 -18
  182. package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
  183. package/dist/src/services/environment/environment-service-profile.utils.d.ts +8 -1
  184. package/dist/src/services/environment/environment-service-profile.utils.d.ts.map +1 -1
  185. package/dist/src/services/environment/environment-service-profile.utils.js +14 -1
  186. package/dist/src/services/environment/environment-service-profile.utils.js.map +1 -1
  187. package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
  188. package/dist/src/services/environment/environment-setup.service.js +17 -6
  189. package/dist/src/services/environment/environment-setup.service.js.map +1 -1
  190. package/dist/src/services/environment/environment.service.d.ts +4 -3
  191. package/dist/src/services/environment/environment.service.d.ts.map +1 -1
  192. package/dist/src/services/environment/environment.service.js +0 -1
  193. package/dist/src/services/environment/environment.service.js.map +1 -1
  194. package/dist/src/services/framework/framework-docker-publish.service.d.ts +129 -0
  195. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  196. package/dist/src/services/framework/framework-docker-publish.service.js +271 -19
  197. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  198. package/dist/src/services/framework/github-actions-annotation.d.ts +19 -0
  199. package/dist/src/services/framework/github-actions-annotation.d.ts.map +1 -0
  200. package/dist/src/services/framework/github-actions-annotation.js +25 -0
  201. package/dist/src/services/framework/github-actions-annotation.js.map +1 -0
  202. package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts +43 -0
  203. package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts.map +1 -0
  204. package/dist/src/services/framework/registry-host/registry-host-upgrade.js +117 -0
  205. package/dist/src/services/framework/registry-host/registry-host-upgrade.js.map +1 -0
  206. package/dist/src/services/framework/registry-host/registry-host.service.d.ts +1 -1
  207. package/dist/src/services/framework/registry-host/registry-host.service.d.ts.map +1 -1
  208. package/dist/src/services/framework/registry-host/registry-host.service.js +2 -0
  209. package/dist/src/services/framework/registry-host/registry-host.service.js.map +1 -1
  210. package/dist/src/services/registry/installed-file-state.utils.d.ts +8 -0
  211. package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
  212. package/dist/src/services/registry/installed-file-state.utils.js +9 -1
  213. package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
  214. package/dist/src/services/registry/module-install.service.d.ts.map +1 -1
  215. package/dist/src/services/registry/module-install.service.js +1 -0
  216. package/dist/src/services/registry/module-install.service.js.map +1 -1
  217. package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
  218. package/dist/src/services/registry/provider-module-scaffold.service.js +4 -0
  219. package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
  220. package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
  221. package/dist/src/services/security/csp-sync.service.js +21 -2
  222. package/dist/src/services/security/csp-sync.service.js.map +1 -1
  223. package/dist/tsconfig.build.tsbuildinfo +1 -1
  224. package/framework-root-package.json +3 -3
  225. package/package.json +23 -23
  226. package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
  227. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +31 -9
  228. package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +13 -0
  229. package/templates/infra/registry-host/docker-compose.yml +9 -2
  230. package/templates/infra/registry-host/upgrade-image.sh +108 -0
  231. package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_ready/labels.fr.ts +22 -0
  232. package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_received/labels.fr.ts +23 -0
  233. package/templates/saas/i18n/email/resources/dataSubjectRequests/update.users-custom_extended/labels.fr.ts +23 -0
  234. package/templates/saas/i18n/email/resources/organizationSsoConfig/repairUnreadableConfiguration.organization-users/labels.fr.ts +23 -0
  235. package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.ts +28 -0
  236. package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.ts +28 -0
  237. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.en.ts +2 -1
  238. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.fr.ts +2 -1
  239. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.ts +6 -1
  240. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.ts +6 -1
  241. package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.en.ts +40 -0
  242. package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.fr.ts +40 -0
  243. package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.ts +2 -1
  244. package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.ts +2 -1
  245. package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.en.ts +2 -1
  246. package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.fr.ts +2 -1
  247. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.ts +2 -1
  248. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.ts +2 -1
  249. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.en.ts +3 -1
  250. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.fr.ts +3 -1
  251. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.en.ts +2 -1
  252. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.fr.ts +2 -1
  253. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.en.ts +3 -1
  254. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.fr.ts +4 -2
  255. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.en.ts +18 -1
  256. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.fr.ts +18 -1
  257. package/templates/saas/i18n/engine/resources/actorSystemExecutions.en.ts +10 -82
  258. package/templates/saas/i18n/engine/resources/actorSystemExecutions.fr.ts +0 -72
  259. package/templates/saas/i18n/engine/resources/actorTasks.en.ts +0 -33
  260. package/templates/saas/i18n/engine/resources/actorTasks.fr.ts +0 -33
  261. package/templates/saas/i18n/engine/resources/agentBehaviorReports.en.ts +0 -108
  262. package/templates/saas/i18n/engine/resources/agentBehaviorReports.fr.ts +0 -108
  263. package/templates/saas/i18n/engine/resources/agentOperationRecords.en.ts +8 -24
  264. package/templates/saas/i18n/engine/resources/agentOperationRecords.fr.ts +10 -26
  265. package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.en.ts +0 -12
  266. package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.fr.ts +0 -12
  267. package/templates/saas/i18n/engine/resources/anonymous_users.en.ts +8 -74
  268. package/templates/saas/i18n/engine/resources/anonymous_users.fr.ts +0 -66
  269. package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.en.ts +3 -21
  270. package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.fr.ts +0 -18
  271. package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.en.ts +3 -33
  272. package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.fr.ts +0 -30
  273. package/templates/saas/i18n/engine/resources/applicationAccessGrants.en.ts +13 -55
  274. package/templates/saas/i18n/engine/resources/applicationAccessGrants.fr.ts +0 -42
  275. package/templates/saas/i18n/engine/resources/applicationAgentPolicies.en.ts +8 -24
  276. package/templates/saas/i18n/engine/resources/applicationAgentPolicies.fr.ts +8 -24
  277. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.en.ts +0 -27
  278. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.fr.ts +0 -27
  279. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.en.ts +13 -43
  280. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.fr.ts +0 -30
  281. package/templates/saas/i18n/engine/resources/applicationApiKeys.en.ts +2 -70
  282. package/templates/saas/i18n/engine/resources/applicationApiKeys.fr.ts +2 -70
  283. package/templates/saas/i18n/engine/resources/applicationAuditLogs.en.ts +41 -94
  284. package/templates/saas/i18n/engine/resources/applicationAuditLogs.fr.ts +41 -94
  285. package/templates/saas/i18n/engine/resources/applicationDataKeys.en.ts +2 -22
  286. package/templates/saas/i18n/engine/resources/applicationDataKeys.fr.ts +2 -22
  287. package/templates/saas/i18n/engine/resources/applicationFeatures.en.ts +0 -24
  288. package/templates/saas/i18n/engine/resources/applicationFeatures.fr.ts +0 -24
  289. package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.en.ts +25 -160
  290. package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.fr.ts +25 -160
  291. package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.en.ts +6 -28
  292. package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.fr.ts +8 -30
  293. package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.en.ts +92 -23
  294. package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.fr.ts +95 -26
  295. package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.en.ts +1 -25
  296. package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.fr.ts +4 -28
  297. package/templates/saas/i18n/engine/resources/applicationMetadata.en.ts +0 -18
  298. package/templates/saas/i18n/engine/resources/applicationMetadata.fr.ts +0 -18
  299. package/templates/saas/i18n/engine/resources/applicationOAuthClients.en.ts +2 -58
  300. package/templates/saas/i18n/engine/resources/applicationOAuthClients.fr.ts +2 -58
  301. package/templates/saas/i18n/engine/resources/applicationProviderCredentials.en.ts +168 -0
  302. package/templates/saas/i18n/engine/resources/applicationProviderCredentials.fr.ts +168 -0
  303. package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.en.ts +0 -30
  304. package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.fr.ts +0 -30
  305. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.en.ts +3 -42
  306. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.fr.ts +5 -44
  307. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.en.ts +3 -30
  308. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.fr.ts +0 -27
  309. package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.en.ts +0 -24
  310. package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.fr.ts +0 -24
  311. package/templates/saas/i18n/engine/resources/applicationSsoConfig.en.ts +113 -61
  312. package/templates/saas/i18n/engine/resources/applicationSsoConfig.fr.ts +113 -61
  313. package/templates/saas/i18n/engine/resources/applicationSsoConnections.en.ts +0 -138
  314. package/templates/saas/i18n/engine/resources/applicationSsoConnections.fr.ts +0 -138
  315. package/templates/saas/i18n/engine/resources/applicationVersions.en.ts +3 -27
  316. package/templates/saas/i18n/engine/resources/applicationVersions.fr.ts +0 -24
  317. package/templates/saas/i18n/engine/resources/applicationWebhookConfig.en.ts +5 -54
  318. package/templates/saas/i18n/engine/resources/applicationWebhookConfig.fr.ts +5 -54
  319. package/templates/saas/i18n/engine/resources/applications.en.ts +39 -2177
  320. package/templates/saas/i18n/engine/resources/applications.fr.ts +39 -2177
  321. package/templates/saas/i18n/engine/resources/approvalSeals.en.ts +38 -31
  322. package/templates/saas/i18n/engine/resources/approvalSeals.fr.ts +38 -31
  323. package/templates/saas/i18n/engine/resources/auditLogs.en.ts +78 -111
  324. package/templates/saas/i18n/engine/resources/auditLogs.fr.ts +78 -111
  325. package/templates/saas/i18n/engine/resources/billingEffectOutbox.en.ts +2 -4
  326. package/templates/saas/i18n/engine/resources/billingEffectOutbox.fr.ts +2 -4
  327. package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.en.ts +8 -6
  328. package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.fr.ts +8 -6
  329. package/templates/saas/i18n/engine/resources/chatConversations.en.ts +0 -18
  330. package/templates/saas/i18n/engine/resources/chatConversations.fr.ts +0 -18
  331. package/templates/saas/i18n/engine/resources/chatIdentityLinks.en.ts +0 -44
  332. package/templates/saas/i18n/engine/resources/chatIdentityLinks.fr.ts +0 -44
  333. package/templates/saas/i18n/engine/resources/consumableTokens.en.ts +4 -43
  334. package/templates/saas/i18n/engine/resources/consumableTokens.fr.ts +4 -43
  335. package/templates/saas/i18n/engine/resources/conversationMessages.en.ts +16 -27
  336. package/templates/saas/i18n/engine/resources/conversationMessages.fr.ts +16 -27
  337. package/templates/saas/i18n/engine/resources/conversationReplyTokens.en.ts +0 -27
  338. package/templates/saas/i18n/engine/resources/conversationReplyTokens.fr.ts +0 -27
  339. package/templates/saas/i18n/engine/resources/conversationThreads.en.ts +0 -27
  340. package/templates/saas/i18n/engine/resources/conversationThreads.fr.ts +0 -27
  341. package/templates/saas/i18n/engine/resources/dataSeedRuns.en.ts +22 -17
  342. package/templates/saas/i18n/engine/resources/dataSeedRuns.fr.ts +22 -17
  343. package/templates/saas/i18n/engine/resources/dataSubjectRequests.en.ts +410 -0
  344. package/templates/saas/i18n/engine/resources/dataSubjectRequests.fr.ts +410 -0
  345. package/templates/saas/i18n/engine/resources/etlPipelineStates.en.ts +128 -146
  346. package/templates/saas/i18n/engine/resources/etlPipelineStates.fr.ts +0 -18
  347. package/templates/saas/i18n/engine/resources/evaluationDatasetExports.en.ts +13 -43
  348. package/templates/saas/i18n/engine/resources/evaluationDatasetExports.fr.ts +0 -30
  349. package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.en.ts +0 -12
  350. package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.fr.ts +0 -12
  351. package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.en.ts +0 -21
  352. package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.fr.ts +0 -21
  353. package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.en.ts +24 -45
  354. package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.fr.ts +0 -21
  355. package/templates/saas/i18n/engine/resources/externalDataPendingReferences.en.ts +0 -24
  356. package/templates/saas/i18n/engine/resources/externalDataPendingReferences.fr.ts +0 -24
  357. package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.en.ts +0 -21
  358. package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.fr.ts +0 -21
  359. package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.en.ts +8 -14
  360. package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.fr.ts +0 -6
  361. package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.en.ts +0 -24
  362. package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.fr.ts +0 -24
  363. package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.en.ts +150 -174
  364. package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.fr.ts +0 -24
  365. package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.en.ts +12 -33
  366. package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.fr.ts +0 -21
  367. package/templates/saas/i18n/engine/resources/externalEffectReservations.en.ts +147 -0
  368. package/templates/saas/i18n/engine/resources/externalEffectReservations.fr.ts +147 -0
  369. package/templates/saas/i18n/engine/resources/files.en.ts +0 -39
  370. package/templates/saas/i18n/engine/resources/files.fr.ts +0 -39
  371. package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.en.ts +0 -18
  372. package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.fr.ts +0 -18
  373. package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.en.ts +115 -0
  374. package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.fr.ts +115 -0
  375. package/templates/saas/i18n/engine/resources/inboundAddressTombstones.en.ts +0 -27
  376. package/templates/saas/i18n/engine/resources/inboundAddressTombstones.fr.ts +0 -27
  377. package/templates/saas/i18n/engine/resources/inboundContacts.en.ts +3 -30
  378. package/templates/saas/i18n/engine/resources/inboundContacts.fr.ts +0 -27
  379. package/templates/saas/i18n/engine/resources/inboundEmails.en.ts +0 -27
  380. package/templates/saas/i18n/engine/resources/inboundEmails.fr.ts +0 -27
  381. package/templates/saas/i18n/engine/resources/jobExecutions.en.ts +11 -25
  382. package/templates/saas/i18n/engine/resources/jobExecutions.fr.ts +11 -25
  383. package/templates/saas/i18n/engine/resources/jobPayloadStorage.en.ts +3 -30
  384. package/templates/saas/i18n/engine/resources/jobPayloadStorage.fr.ts +0 -27
  385. package/templates/saas/i18n/engine/resources/legalHolds.en.ts +0 -88
  386. package/templates/saas/i18n/engine/resources/legalHolds.fr.ts +0 -88
  387. package/templates/saas/i18n/engine/resources/modelCallAttributions.en.ts +16 -40
  388. package/templates/saas/i18n/engine/resources/modelCallAttributions.fr.ts +0 -24
  389. package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.en.ts +13 -37
  390. package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.fr.ts +0 -24
  391. package/templates/saas/i18n/engine/resources/oauthConsentGrants.en.ts +10 -40
  392. package/templates/saas/i18n/engine/resources/oauthConsentGrants.fr.ts +0 -30
  393. package/templates/saas/i18n/engine/resources/operationApprovalRequests.en.ts +120 -60
  394. package/templates/saas/i18n/engine/resources/operationApprovalRequests.fr.ts +120 -60
  395. package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.en.ts +3 -21
  396. package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.fr.ts +0 -18
  397. package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.en.ts +3 -33
  398. package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.fr.ts +0 -30
  399. package/templates/saas/i18n/engine/resources/organizationAgentPolicies.en.ts +0 -27
  400. package/templates/saas/i18n/engine/resources/organizationAgentPolicies.fr.ts +0 -27
  401. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.en.ts +0 -27
  402. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.fr.ts +0 -27
  403. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.en.ts +13 -43
  404. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.fr.ts +0 -30
  405. package/templates/saas/i18n/engine/resources/organizationApiKeys.en.ts +2 -79
  406. package/templates/saas/i18n/engine/resources/organizationApiKeys.fr.ts +2 -79
  407. package/templates/saas/i18n/engine/resources/organizationBillingAccounts.en.ts +0 -549
  408. package/templates/saas/i18n/engine/resources/organizationBillingAccounts.fr.ts +0 -549
  409. package/templates/saas/i18n/engine/resources/organizationChatSettings.en.ts +0 -27
  410. package/templates/saas/i18n/engine/resources/organizationChatSettings.fr.ts +0 -27
  411. package/templates/saas/i18n/engine/resources/organizationCreditPools.en.ts +13 -18
  412. package/templates/saas/i18n/engine/resources/organizationCreditPools.fr.ts +13 -18
  413. package/templates/saas/i18n/engine/resources/organizationCustomDomains.en.ts +195 -0
  414. package/templates/saas/i18n/engine/resources/organizationCustomDomains.fr.ts +195 -0
  415. package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.en.ts +153 -0
  416. package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.fr.ts +153 -0
  417. package/templates/saas/i18n/engine/resources/organizationEmailDomains.en.ts +0 -39
  418. package/templates/saas/i18n/engine/resources/organizationEmailDomains.fr.ts +0 -39
  419. package/templates/saas/i18n/engine/resources/organizationFeatures.en.ts +0 -34
  420. package/templates/saas/i18n/engine/resources/organizationFeatures.fr.ts +0 -34
  421. package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.en.ts +25 -160
  422. package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.fr.ts +25 -160
  423. package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.en.ts +6 -28
  424. package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.fr.ts +8 -30
  425. package/templates/saas/i18n/engine/resources/organizationGuidanceState.en.ts +3 -18
  426. package/templates/saas/i18n/engine/resources/organizationGuidanceState.fr.ts +0 -15
  427. package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.en.ts +95 -26
  428. package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.fr.ts +95 -26
  429. package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.en.ts +14 -45
  430. package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.fr.ts +14 -45
  431. package/templates/saas/i18n/engine/resources/organizationLifecycleState.en.ts +1 -17
  432. package/templates/saas/i18n/engine/resources/organizationLifecycleState.fr.ts +1 -17
  433. package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.en.ts +2 -26
  434. package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.fr.ts +4 -28
  435. package/templates/saas/i18n/engine/resources/organizationMembers.en.ts +2 -95
  436. package/templates/saas/i18n/engine/resources/organizationMembers.fr.ts +2 -95
  437. package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.en.ts +0 -27
  438. package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.fr.ts +0 -27
  439. package/templates/saas/i18n/engine/resources/organizationNotificationBadges.en.ts +3 -36
  440. package/templates/saas/i18n/engine/resources/organizationNotificationBadges.fr.ts +0 -33
  441. package/templates/saas/i18n/engine/resources/organizationNotifications.en.ts +0 -12
  442. package/templates/saas/i18n/engine/resources/organizationNotifications.fr.ts +0 -12
  443. package/templates/saas/i18n/engine/resources/organizationOAuthClients.en.ts +2 -67
  444. package/templates/saas/i18n/engine/resources/organizationOAuthClients.fr.ts +2 -67
  445. package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.en.ts +0 -9
  446. package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.fr.ts +0 -9
  447. package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.en.ts +0 -27
  448. package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.fr.ts +0 -27
  449. package/templates/saas/i18n/engine/resources/organizationPreferences.en.ts +0 -37
  450. package/templates/saas/i18n/engine/resources/organizationPreferences.fr.ts +0 -37
  451. package/templates/saas/i18n/engine/resources/organizationProfiles.en.ts +0 -37
  452. package/templates/saas/i18n/engine/resources/organizationProfiles.fr.ts +0 -37
  453. package/templates/saas/i18n/engine/resources/organizationProgressionState.en.ts +1 -17
  454. package/templates/saas/i18n/engine/resources/organizationProgressionState.fr.ts +1 -17
  455. package/templates/saas/i18n/engine/resources/organizationProviderCredentials.en.ts +0 -58
  456. package/templates/saas/i18n/engine/resources/organizationProviderCredentials.fr.ts +0 -58
  457. package/templates/saas/i18n/engine/resources/organizationRelationships.en.ts +0 -128
  458. package/templates/saas/i18n/engine/resources/organizationRelationships.fr.ts +0 -128
  459. package/templates/saas/i18n/engine/resources/organizationRepresentations.en.ts +0 -83
  460. package/templates/saas/i18n/engine/resources/organizationRepresentations.fr.ts +0 -83
  461. package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.en.ts +0 -43
  462. package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.fr.ts +0 -43
  463. package/templates/saas/i18n/engine/resources/organizationScimTokens.en.ts +5 -76
  464. package/templates/saas/i18n/engine/resources/organizationScimTokens.fr.ts +5 -76
  465. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.en.ts +4 -43
  466. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.fr.ts +6 -45
  467. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.en.ts +3 -30
  468. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.fr.ts +0 -27
  469. package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.en.ts +0 -37
  470. package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.fr.ts +0 -37
  471. package/templates/saas/i18n/engine/resources/organizationSsoConfig.en.ts +113 -74
  472. package/templates/saas/i18n/engine/resources/organizationSsoConfig.fr.ts +113 -74
  473. package/templates/saas/i18n/engine/resources/organizationSsoConnections.en.ts +0 -148
  474. package/templates/saas/i18n/engine/resources/organizationSsoConnections.fr.ts +0 -148
  475. package/templates/saas/i18n/engine/resources/organizationSubscriptions.en.ts +40 -78
  476. package/templates/saas/i18n/engine/resources/organizationSubscriptions.fr.ts +42 -80
  477. package/templates/saas/i18n/engine/resources/organizationUnitMembers.en.ts +2 -50
  478. package/templates/saas/i18n/engine/resources/organizationUnitMembers.fr.ts +2 -50
  479. package/templates/saas/i18n/engine/resources/organizationUnits.en.ts +0 -49
  480. package/templates/saas/i18n/engine/resources/organizationUnits.fr.ts +0 -49
  481. package/templates/saas/i18n/engine/resources/organizationUsageRecords.en.ts +13 -37
  482. package/templates/saas/i18n/engine/resources/organizationUsageRecords.fr.ts +13 -37
  483. package/templates/saas/i18n/engine/resources/organizationWebhookConfig.en.ts +5 -67
  484. package/templates/saas/i18n/engine/resources/organizationWebhookConfig.fr.ts +5 -67
  485. package/templates/saas/i18n/engine/resources/organizations.en.ts +34 -637
  486. package/templates/saas/i18n/engine/resources/organizations.fr.ts +32 -635
  487. package/templates/saas/i18n/engine/resources/platformAccessGrants.en.ts +0 -91
  488. package/templates/saas/i18n/engine/resources/platformAccessGrants.fr.ts +0 -91
  489. package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.en.ts +0 -24
  490. package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.fr.ts +0 -24
  491. package/templates/saas/i18n/engine/resources/prices.en.ts +47 -108
  492. package/templates/saas/i18n/engine/resources/prices.fr.ts +48 -109
  493. package/templates/saas/i18n/engine/resources/products.en.ts +24 -68
  494. package/templates/saas/i18n/engine/resources/products.fr.ts +24 -68
  495. package/templates/saas/i18n/engine/resources/professionalQualifications.en.ts +0 -87
  496. package/templates/saas/i18n/engine/resources/professionalQualifications.fr.ts +0 -87
  497. package/templates/saas/i18n/engine/resources/promotions.en.ts +4 -56
  498. package/templates/saas/i18n/engine/resources/promotions.fr.ts +6 -58
  499. package/templates/saas/i18n/engine/resources/providerCallRecords.en.ts +77 -101
  500. package/templates/saas/i18n/engine/resources/providerCallRecords.fr.ts +0 -24
  501. package/templates/saas/i18n/engine/resources/publishedVerificationKeys.en.ts +2 -25
  502. package/templates/saas/i18n/engine/resources/publishedVerificationKeys.fr.ts +2 -25
  503. package/templates/saas/i18n/engine/resources/referrals.en.ts +21 -18
  504. package/templates/saas/i18n/engine/resources/referrals.fr.ts +21 -18
  505. package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.en.ts +0 -80
  506. package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.fr.ts +0 -80
  507. package/templates/saas/i18n/engine/resources/relationshipInvitations.en.ts +0 -89
  508. package/templates/saas/i18n/engine/resources/relationshipInvitations.fr.ts +0 -89
  509. package/templates/saas/i18n/engine/resources/relationshipMailboxes.en.ts +0 -27
  510. package/templates/saas/i18n/engine/resources/relationshipMailboxes.fr.ts +0 -27
  511. package/templates/saas/i18n/engine/resources/representativeAssignments.en.ts +108 -112
  512. package/templates/saas/i18n/engine/resources/representativeAssignments.fr.ts +108 -112
  513. package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.en.ts +8 -21
  514. package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.fr.ts +8 -21
  515. package/templates/saas/i18n/engine/resources/signatureRequestSigners.en.ts +141 -0
  516. package/templates/saas/i18n/engine/resources/signatureRequestSigners.fr.ts +141 -0
  517. package/templates/saas/i18n/engine/resources/signatureRequests.en.ts +205 -0
  518. package/templates/saas/i18n/engine/resources/signatureRequests.fr.ts +205 -0
  519. package/templates/saas/i18n/engine/resources/smsNumberAssignments.en.ts +101 -0
  520. package/templates/saas/i18n/engine/resources/smsNumberAssignments.fr.ts +101 -0
  521. package/templates/saas/i18n/engine/resources/smsOptOuts.en.ts +166 -0
  522. package/templates/saas/i18n/engine/resources/smsOptOuts.fr.ts +166 -0
  523. package/templates/saas/i18n/engine/resources/smsProviderEvents.en.ts +195 -0
  524. package/templates/saas/i18n/engine/resources/smsProviderEvents.fr.ts +195 -0
  525. package/templates/saas/i18n/engine/resources/ssoDomainReservations.en.ts +0 -27
  526. package/templates/saas/i18n/engine/resources/ssoDomainReservations.fr.ts +0 -27
  527. package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.en.ts +3 -39
  528. package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.fr.ts +0 -36
  529. package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.en.ts +0 -3
  530. package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.fr.ts +0 -3
  531. package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.en.ts +0 -6
  532. package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.fr.ts +0 -6
  533. package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.en.ts +3 -21
  534. package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.fr.ts +0 -18
  535. package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.en.ts +3 -33
  536. package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.fr.ts +0 -30
  537. package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.en.ts +0 -27
  538. package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.fr.ts +0 -27
  539. package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.en.ts +13 -43
  540. package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.fr.ts +0 -30
  541. package/templates/saas/i18n/engine/resources/userCredentials.en.ts +3 -87
  542. package/templates/saas/i18n/engine/resources/userCredentials.fr.ts +0 -84
  543. package/templates/saas/i18n/engine/resources/userFeatures.en.ts +0 -12
  544. package/templates/saas/i18n/engine/resources/userFeatures.fr.ts +0 -12
  545. package/templates/saas/i18n/engine/resources/userFlowActorExecutions.en.ts +25 -160
  546. package/templates/saas/i18n/engine/resources/userFlowActorExecutions.fr.ts +25 -160
  547. package/templates/saas/i18n/engine/resources/userFlowActorTasks.en.ts +6 -28
  548. package/templates/saas/i18n/engine/resources/userFlowActorTasks.fr.ts +8 -30
  549. package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.en.ts +13 -18
  550. package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.fr.ts +13 -18
  551. package/templates/saas/i18n/engine/resources/userGuidanceState.en.ts +3 -18
  552. package/templates/saas/i18n/engine/resources/userGuidanceState.fr.ts +0 -15
  553. package/templates/saas/i18n/engine/resources/userIdentityLinks.en.ts +13 -40
  554. package/templates/saas/i18n/engine/resources/userIdentityLinks.fr.ts +0 -27
  555. package/templates/saas/i18n/engine/resources/userLifecycleState.en.ts +0 -15
  556. package/templates/saas/i18n/engine/resources/userLifecycleState.fr.ts +0 -15
  557. package/templates/saas/i18n/engine/resources/userNotificationBadges.en.ts +3 -36
  558. package/templates/saas/i18n/engine/resources/userNotificationBadges.fr.ts +0 -33
  559. package/templates/saas/i18n/engine/resources/userPreferences.en.ts +8 -60
  560. package/templates/saas/i18n/engine/resources/userPreferences.fr.ts +8 -60
  561. package/templates/saas/i18n/engine/resources/userProfiles.en.ts +5 -56
  562. package/templates/saas/i18n/engine/resources/userProfiles.fr.ts +0 -51
  563. package/templates/saas/i18n/engine/resources/userProgressionState.en.ts +1 -17
  564. package/templates/saas/i18n/engine/resources/userProgressionState.fr.ts +1 -17
  565. package/templates/saas/i18n/engine/resources/userProviderCredentials.en.ts +0 -52
  566. package/templates/saas/i18n/engine/resources/userProviderCredentials.fr.ts +0 -52
  567. package/templates/saas/i18n/engine/resources/userSelfPreferences.en.ts +8 -56
  568. package/templates/saas/i18n/engine/resources/userSelfPreferences.fr.ts +8 -56
  569. package/templates/saas/i18n/engine/resources/userSelfProfiles.en.ts +5 -61
  570. package/templates/saas/i18n/engine/resources/userSelfProfiles.fr.ts +0 -56
  571. package/templates/saas/i18n/engine/resources/user_self.en.ts +37 -214
  572. package/templates/saas/i18n/engine/resources/user_self.fr.ts +37 -214
  573. package/templates/saas/i18n/engine/resources/users.en.ts +53 -180
  574. package/templates/saas/i18n/engine/resources/users.fr.ts +53 -180
  575. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/Dockerfile +4 -1
  576. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +9 -1
  577. package/templates/saas/scenarios/add-website/files/website/Dockerfile +4 -1
  578. package/templates/saas/scenarios/add-website/files/website/astro.config.ts.hbs +4 -0
  579. package/templates/saas/scenarios/add-website/files/website/package.json.hbs +1 -1
  580. package/templates/saas/scenarios/add-worker-node/files/workers/__workerDir__/Dockerfile.hbs +3 -1
  581. package/templates/saas/skeleton/.wildo-saas/wildo-dev-companion/scripts/dev-supervised.sh +18 -4
  582. package/templates/saas/skeleton/backend-api/Dockerfile +5 -2
  583. package/templates/saas/skeleton/frontend/Dockerfile +4 -1
  584. package/templates/saas/skeleton/frontend/nginx-config/default.conf.hbs +1 -1
  585. package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +4 -4
  586. package/templates/saas/skeleton/frontend/vite-engine-dependency-prebundle.ts +10 -1
  587. package/templates/saas/skeleton/frontend/vite.config.ts.hbs +14 -3
  588. package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +2 -0
  589. package/wildo-framework.info.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"creation-drive.service.js","sourceRoot":"","sources":["../../../../src/services/companion/creation-drive.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,4BAA4B,GAK7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mCAAmC,EAAoC,mBAAmB,EAAE,MAA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,CAAC;YAC9D,wBAAwB,IAAI,CAAC,CAAC;YAC9B,IAAI,wBAAwB,IAAI,gDAAgD,EAAE,CAAC;gBACjF,OAAO,MAAM,CAAC,qBAAqB,CAAC,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,IAAI,kCAAkC,CAAC,CAAC;YACnI,CAAC;YACD,QAAQ,GAAG,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,wBAAwB,GAAG,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * # `wildo creation drive --until stuck` — the unattended creation driver (#2233)\n *\n * A full creation still needed a person, or a hand-written script, to move it from one round to the next: in run 004\n * (`app-creation-test-004`) the driving session ran the umbrella or a build wave, accepted what landed, restarted the\n * companion when it fell over, and stopped on the first real blocker. That loop is the shape of \"run a creation\", and\n * it lived outside the framework. `wildo creation loop` covered one piece of it (a model chooses each round) and none of\n * the rest: it stopped at 20 rounds, never accepted, died with the companion and stopped only when the model did.\n *\n * ## The shape\n *\n * Each step reads the companion's durable state (the creation FEED: what Home shows, holds included; and the drive\n * STATUS: what still runs), decides ONE of three things with {@link decideCreationDriveStep}, and does it:\n *\n * - **run** a bounded `wildo creation loop` (up to its 20-round ceiling): the companion gates, a model chooses, the\n * chosen lanes run, the build lane among them;\n * - **wait**: something still runs (a loop, a wave, a lane the usage-limit resume relaunched), the coding agent's usage\n * limit holds until its stated reset, the connectivity hold waits on the network, or the companion is down;\n * - **stop**, naming the rule that fired and what it waits for.\n *\n * The loop's model choosing to stop is not the goal reached: the drive then asks where the application stands against its\n * own requirements (`GET /creation/requirements/standing`, #3701), and calls the goal reached only when no requirement\n * carries an open item.\n *\n * After every loop, it accepts what the autonomy posture says the SYSTEM accepts (`POST /creation/drive/accept`, never\n * inside a live coding run), and stops when the posture leaves acceptance to a person: a marked critical gate, armed.\n *\n * ## Why in the CLI and not in the companion\n *\n * A companion restart ends every request it holds and every in-process timer. The driver lives in another process, so a\n * restart is a WAIT: it polls until the companion answers again and reads the same durable rows (the loop's state is\n * the working tree; the run records survive). The restart itself is on the intervention ledger when the companion\n * booted with runs in flight (#2231), and the driver also counts the restarts it saw, from the companion's start time.\n *\n * ## Holds it respects\n *\n * - a person's `wildo build stop` (#3206) is a STOP: a stopped build is never resumed unattended;\n * - the coding agent's usage limit (#2388) is a WAIT until it lifts; the companion's own resume relaunches what it\n * paused (#2463), and the driver waits for that run to drain before choosing again;\n * - the connectivity hold (#3236, #3262) is a WAIT until the agent's API answers.\n *\n * Ceilings are the person's, like `loop`'s iteration ceiling: a wall clock and a spend in US dollars, both required.\n * The spend is the run report's measured total since the drive began (#2231, #2232), a floor wherever a run reported no\n * cost.\n */\nimport {\n CreationDriveAcceptDisposition,\n WorkbenchCreationHomeLineKind,\n WorkbenchCreationHomeSection,\n type CreationConsole_Feed,\n type CreationDrive_AcceptOutcome,\n type CreationDrive_RequirementsStanding,\n type CreationDrive_Status,\n} from '@wildo-ai/platform-core-shared';\nimport { describeModelProviderAccountRefusal, type ModelProviderAccountRefusal, describeCaughtError } from '@wildo-ai/saas-models';\n\nimport type { ConsoleLoopResult } from './creation-console.service';\n\n/** The only drive mode: run until a stop rule fires. Named so `--until` is a closed vocabulary. */\nexport enum CreationDriveUntil {\n STUCK = 'stuck',\n}\n\n/** Why the driver stopped. Every exit is one of these, and the report names it with what it waits for. */\nexport enum CreationDriveStopRule {\n /**\n * The loop's selector chose to stop with nothing running and nothing asked, AND the application's requirements carry no\n * open item (#3701): the goal is reached by measurement, never by the model's judgement alone.\n */\n GOAL_REACHED = 'goal-reached',\n /**\n * The loop's selector chose to stop, and the application's own requirements still carry open items (#3701): a reported\n * gap, a configuration that does not meet one, one nothing addresses or with no build work landed. The model judged the\n * creation done and the measurement says it is not, so the drive stops and names them: each is closed by the task named\n * beside it, or by a person who starts refinement or decides the requirement is out of scope.\n */\n REQUIREMENTS_OPEN = 'requirements-open',\n /**\n * The loop's selector chose to stop, and where the application stands against its requirements could not be read\n * (#3701): whether the goal is reached is unknown, so the drive says that rather than claim it.\n */\n GOAL_UNMEASURED = 'goal-unmeasured',\n /** Nothing is eligible to run, nothing runs, nothing is asked. */\n NOTHING_LEFT = 'nothing-left',\n /**\n * A question only the creator can answer: a playbook's clarification, a coding run parked on a question, or an interview\n * whose answer would date work the next round could run (#3361).\n */\n WAITING_ON_CREATOR = 'waiting-on-creator',\n /** The build plan can run nothing until the creator unblocks it (a task that cannot land, retired after its attempts). */\n PLAN_BLOCKED = 'plan-blocked',\n /** A person's `wildo build stop` holds the build; only a person starts it again. */\n BUILD_STOPPED_BY_PERSON = 'build-stopped-by-person',\n /** The build lane holds dispatch because a backend does not run the current tree (#3215). */\n BUILD_HELD = 'build-held',\n /** Every lane of a loop round failed: choosing again over the same state would spend without progressing. */\n LANES_FAILED = 'lanes-failed',\n /** The companion refused to run the loop (a preflight failure, a refusal whose remedy is a decision). */\n LOOP_REFUSED = 'loop-refused',\n /** The autonomy posture leaves acceptance to a person: a marked critical gate is armed. */\n ACCEPTANCE_HELD_FOR_PERSON = 'acceptance-held-for-person',\n /** The creation preflight found what would stop the run, before the first round. */\n PREFLIGHT_FAILED = 'preflight-failed',\n /** The person's wall-clock ceiling. */\n WALL_CLOCK_CEILING = 'wall-clock-ceiling',\n /** The person's spend ceiling. */\n SPEND_CEILING = 'spend-ceiling',\n /** The environment stopped the loop on consecutive rounds, past the loop's own recovery wait (#3235). */\n ENVIRONMENT_INTERRUPTED = 'environment-interrupted',\n /** The companion did not answer for {@link CREATION_DRIVE_COMPANION_DOWN_LIMIT_MS}. */\n COMPANION_UNREACHABLE = 'companion-unreachable',\n /**\n * The coding agent's API has not answered along its route for {@link CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS}: nothing\n * can be built, and the wait has outlived what a network blip is. The person checks the network, or ends the hold.\n */\n NETWORK_LOST = 'network-lost',\n /**\n * A model provider's ACCOUNT refused the companion's or the coding agent's call (#3204): no credits left, a spend or\n * usage limit, billing. The ENVIRONMENT's condition, never the application's: nothing the creation did caused it, and\n * nothing it can do lifts it. A person adds credits or raises the limit in that provider's console, then runs the drive\n * again. Stopped on at once, never after consecutive loops: a loop run again is refused identically.\n */\n PROVIDER_ACCOUNT_REFUSED = 'provider-account-refused',\n /**\n * A verification check cannot be asked for a host cause (#3423, #3432): `wildo` is not on the companion's PATH, or the\n * installed one lacks the verb a check asks, or one check failed the same way on two tasks. Every build task's check\n * would fail the same way, so the companion admits no coding turn. The host's condition: a person repairs it (the next\n * admission asks first), then runs the drive again.\n */\n VERIFICATION_TOOL_UNAVAILABLE = 'verification-tool-unavailable',\n}\n\n/** What the driver waits for when it waits. */\nexport enum CreationDriveWaitReason {\n /** A loop or a detached run (a wave, a lane, a usage-limit resume) still runs in the companion. */\n RUNS_IN_FLIGHT = 'runs-in-flight',\n /** The coding agent's account usage limit holds the build until its stated reset (#2388). */\n CODING_AGENT_USAGE_LIMIT = 'coding-agent-usage-limit',\n /** A coding run lost the network; no coding turn starts until the agent's API answers (#3236, #3262). */\n CODING_AGENT_CONNECTIVITY = 'coding-agent-connectivity',\n /** The companion does not answer (a restart, a crash). */\n COMPANION_DOWN = 'companion-down',\n}\n\n/** How long one wait lasts before the driver reads the state again. */\nexport const CREATION_DRIVE_POLL_INTERVAL_MS = 30_000;\n/** How long the companion may stay unreachable before the drive stops. A restart takes seconds to a few minutes. */\nexport const CREATION_DRIVE_COMPANION_DOWN_LIMIT_MS = 15 * 60 * 1000;\n/**\n * How long the drive waits on the coding agent's network before it stops {@link CreationDriveStopRule.NETWORK_LOST}: three\n * times the coding admission's own twenty-minute bound, so an outage of an hour (app-creation-test-007 measured 35 min)\n * is waited through, and a five-hour one is the person's to see.\n */\nexport const CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS = 60 * 60 * 1000;\n/** The loop's own ceiling per request (`POST /playbooks/loop` caps it at 20). */\nexport const CREATION_DRIVE_ROUNDS_PER_LOOP = 20;\n/** Consecutive loops the environment interrupted before the drive stops (each already waited up to 10 minutes, #3235). */\nexport const CREATION_DRIVE_MAXIMUM_CONSECUTIVE_INTERRUPTIONS = 3;\n/** The ASKED kinds that stop a run until the creator acts. A governance document's fact does not: it blocks no run. */\nconst ASKED_KINDS_THAT_STOP: ReadonlyMap<WorkbenchCreationHomeLineKind, CreationDriveStopRule> = new Map([\n [WorkbenchCreationHomeLineKind.CLARIFICATION, CreationDriveStopRule.WAITING_ON_CREATOR],\n [WorkbenchCreationHomeLineKind.PARKED_QUESTION, CreationDriveStopRule.WAITING_ON_CREATOR],\n /*\n * An interview whose answer would date work the next round could run (#3361). The round withholds that work, so the\n * drive stops and names the interview, as for a clarification, rather than run on without it.\n */\n [WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK, CreationDriveStopRule.WAITING_ON_CREATOR],\n [WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN, CreationDriveStopRule.PLAN_BLOCKED],\n [WorkbenchCreationHomeLineKind.UNBLOCK_THE_PLAN, CreationDriveStopRule.PLAN_BLOCKED],\n]);\n\n/** What the driver knows when it decides its next step. */\nexport interface CreationDriveObservation {\n readonly feed: CreationConsole_Feed;\n readonly status: CreationDrive_Status;\n readonly elapsedMs: number;\n readonly maximumMs: number;\n /** Measured spend since the drive began, USD; undefined when the report could not be read. */\n readonly spentUsd: number | undefined;\n readonly maximumUsd: number;\n /** How the last loop ended, and whether the driver waited on anything since (which makes running again worth it). */\n readonly lastLoop?: { readonly stoppedBecause: string; readonly stopRationale?: string; readonly waitedSince: boolean };\n /**\n * Where the application stands against its own requirements (#3701), read once the last loop chose to stop: the\n * `standing`, or why it could not be read. Absent when it was not asked.\n */\n readonly requirements?: { readonly standing: CreationDrive_RequirementsStanding } | { readonly unreadBecause: string };\n /** Since when the drive has waited on the coding agent's network without a break (ms on the drive's clock). */\n readonly networkWaitSinceMs?: number;\n readonly nowMs?: number;\n}\n\nexport type CreationDriveDecision =\n | { readonly action: CreationDriveAction.RUN_LOOP }\n | { readonly action: CreationDriveAction.WAIT; readonly reason: CreationDriveWaitReason; readonly detail: string }\n | { readonly action: CreationDriveAction.STOP; readonly rule: CreationDriveStopRule; readonly waitingFor: string; readonly providerAccountRefusal?: ModelProviderAccountRefusal };\n\nexport enum CreationDriveAction {\n RUN_LOOP = 'run-loop',\n WAIT = 'wait',\n STOP = 'stop',\n}\n\n/**\n * The next step, from what the companion's durable rows say now. Order is the rule:\n * a person's stop first (it is theirs); the person's ceilings; anything still running (never start a loop over a\n * running one); what waits on the creator; a backend that does not boot; the holds only a person lifts (a refused\n * provider account, a build check's command missing from PATH); the holds that lift on their own; then the last loop's\n * own verdict when nothing happened since; else run.\n */\nexport function decideCreationDriveStep(observation: CreationDriveObservation): CreationDriveDecision {\n const { feed, status } = observation;\n // Read live from the status first: the feed may be an earlier snapshot, and a stop asked a moment ago holds now.\n const stoppedSince = status.buildStoppedSince ?? feed.buildPreparation?.heldByStopSince ?? null;\n if (stoppedSince !== null) {\n return stop(CreationDriveStopRule.BUILD_STOPPED_BY_PERSON, `a person stopped the build at ${stoppedSince}; start it again with: wildo build run`);\n }\n if (observation.elapsedMs >= observation.maximumMs) {\n return stop(CreationDriveStopRule.WALL_CLOCK_CEILING, `the drive's wall-clock ceiling (${formatHours(observation.maximumMs)}); run it again to continue`);\n }\n if (observation.spentUsd !== undefined && observation.spentUsd >= observation.maximumUsd) {\n return stop(CreationDriveStopRule.SPEND_CEILING, `the drive's spend ceiling (USD ${observation.maximumUsd}; measured USD ${observation.spentUsd.toFixed(2)})`);\n }\n if (status.loopsInFlight > 0 || status.detachedRunsInFlight > 0 || (status.executionsInFlight ?? 0) > 0) {\n return wait(CreationDriveWaitReason.RUNS_IN_FLIGHT, `${status.loopsInFlight} loop(s), ${status.detachedRunsInFlight} detached run(s) and ${status.executionsInFlight ?? 0} playbook execution(s) still running`);\n }\n for (const line of feed.lines) {\n if (line.section !== WorkbenchCreationHomeSection.ASKED) continue;\n const rule = ASKED_KINDS_THAT_STOP.get(line.kind);\n if (rule !== undefined) return stop(rule, describeAskedLine(line.kind, line.taskRef ?? line.playbookRef ?? line.subject ?? line.targetResourceId, line.subject));\n }\n const bootFailures = feed.buildHold?.bootFailures ?? [];\n /*\n * Not while the build lane still owes the repair of a start the application's own code refused (#3204): the lane runs\n * it, bounded per round, and only once it is spent does the hold need a person. Reference run 42696531261 stopped here\n * on two refusals a build task's code caused, with nothing having tried to repair them.\n */\n if (bootFailures.length > 0 && feed.buildHold?.startupRepairOwed !== true) {\n return stop(CreationDriveStopRule.BUILD_HELD, bootFailures.map((failure) => `${failure.serviceIdentifier} does not start: ${failure.remedy}`).join('; '));\n }\n /*\n * The coding agent's provider ACCOUNT refused its turn (#3204). The companion holds the build and re-asks the account\n * every thirty minutes, so a person who adds credits loses nothing; but nothing ever lifts it on its own, so an\n * unattended drive stops here rather than wait for a \"resume\" that only re-asks. Read from the live status first (a\n * pending resume beside it is that re-ask, never a reset), else from the feed's own line.\n */\n const accountRefusal = status.codingAgentAccountRefusal;\n const refusedLine = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.CODING_AGENT_ACCOUNT_REFUSED);\n if (accountRefusal !== undefined || refusedLine !== undefined) {\n const sentence = accountRefusal !== undefined ? describeModelProviderAccountRefusal(accountRefusal) : refusedLine?.subject ?? 'the coding agent\\'s provider account refused to work';\n return {\n action: CreationDriveAction.STOP,\n rule: CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED,\n waitingFor: `the coding agent's provider account: ${sentence} The build re-asks it every 30 minutes; run the drive again once it is fixed.`,\n ...(accountRefusal !== undefined ? { providerAccountRefusal: accountRefusal } : {}),\n };\n }\n /*\n * A build check cannot be asked for a host cause (#3423, #3432): a command not on PATH, one lacking the verb, the same\n * failure on two tasks. Nothing the drive does lifts it, so it stops; the line's subject is the cause and its remedy.\n */\n const toolUnavailable = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.VERIFICATION_TOOL_UNAVAILABLE);\n if (toolUnavailable !== undefined) {\n return stop(CreationDriveStopRule.VERIFICATION_TOOL_UNAVAILABLE,\n `the build's checks, which cannot run (met by build task ${toolUnavailable.taskRef ?? toolUnavailable.targetResourceId}), so no coding turn starts: `\n + `${toolUnavailable.subject ?? 'a command the checks run is unavailable.'} Then run the drive again.`);\n }\n const usageLimit = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.CODING_AGENT_USAGE_LIMITED);\n if (usageLimit !== undefined || status.pendingBuildResume !== undefined) {\n const resumesAt = status.pendingBuildResume?.resumesAt ?? usageLimit?.subject ?? 'its reset';\n return wait(CreationDriveWaitReason.CODING_AGENT_USAGE_LIMIT, `the coding agent's usage limit; the build resumes on its own at ${resumesAt}`);\n }\n /*\n * Waited on only when the hold has a ROUTE: its background probe ends it when the network returns. A hold with no route\n * (an agent with no known API host, a proxy it cannot use) is ended only by the next coding admission, so waiting on it\n * would wait forever; the loop runs, and its build's next turn is the check (review of 6fe527ed3).\n */\n const connectivity = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.CODING_AGENT_CONNECTIVITY_LOST && line.subject !== null);\n if (connectivity !== undefined) {\n if (observation.networkWaitSinceMs !== undefined && observation.nowMs !== undefined && observation.nowMs - observation.networkWaitSinceMs >= CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS) {\n return stop(CreationDriveStopRule.NETWORK_LOST, `the coding agent's API (${connectivity.subject}) has not answered for ${formatHours(CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS)}; once the network is back: wildo build rearm ${connectivity.taskRef ?? '<task>'} --reason environment`);\n }\n return wait(CreationDriveWaitReason.CODING_AGENT_CONNECTIVITY, `the coding agent's network; waiting for ${connectivity.subject} to answer`);\n }\n const last = observation.lastLoop;\n if (last !== undefined && !last.waitedSince) {\n // The loop chose to stop, or found nothing eligible, and nothing ran or lifted since: asking again is the same answer.\n if (last.stoppedBecause === LOOP_CHOSE_TO_STOP) return judgeChosenStop(last.stopRationale ?? 'the loop chose to stop', observation.requirements);\n if (last.stoppedBecause === LOOP_NOTHING_ELIGIBLE) return stop(CreationDriveStopRule.NOTHING_LEFT, 'nothing is eligible to run');\n }\n return { action: CreationDriveAction.RUN_LOOP };\n}\n\n// semantic-literal-boundary: `PlaybookLoopStopReason` values as the companion's loop document carries them; the CLI reads them as wire values.\nconst LOOP_CHOSE_TO_STOP = 'CHOSE_TO_STOP';\nconst LOOP_NOTHING_ELIGIBLE = 'NOTHING_ELIGIBLE';\nconst LOOP_ALL_LANES_FAILED = 'ALL_LANES_FAILED';\nconst LOOP_INTERRUPTED_BY_ENVIRONMENT = 'INTERRUPTED_BY_ENVIRONMENT';\n\n/** How many open items a stop names in words; the rest are counted. */\nconst OPEN_ITEMS_NAMED = 5;\n\n/**\n * The loop chose to stop: whether the goal is reached is the REQUIREMENTS' answer, not the model's (#3701). Goal reached\n * only when the standing was read and carries no open item; open items stop the drive on a rule that names them;\n * an unread standing is said to be unread. Run 42886943490 stopped \"goal-reached\" with 16 of 24 requirements partly met.\n */\nfunction judgeChosenStop(rationale: string, requirements: CreationDriveObservation['requirements']): CreationDriveDecision {\n const standing = requirements !== undefined && 'standing' in requirements ? requirements.standing : undefined;\n if (standing === undefined) {\n const why = requirements !== undefined && 'unreadBecause' in requirements ? requirements.unreadBecause : 'it was not read';\n return stop(CreationDriveStopRule.GOAL_UNMEASURED, `${rationale} — but where the application stands against its requirements could not be read (${why}): wildo creation drive again, or wildo context journey`);\n }\n if (standing.openItems.length === 0) {\n return stop(CreationDriveStopRule.GOAL_REACHED, `${rationale} Every one of the ${standing.requirementCount} requirement(s) is met by what the reading measures (stage ${standing.stage}).`);\n }\n const requirementsWithItems = new Set(standing.openItems.map((item) => item.requirementRef)).size;\n const named = standing.openItems.slice(0, OPEN_ITEMS_NAMED)\n .map((item) => `${item.requirementRef}: ${item.detail}${item.closedByTaskRef === null ? '' : ` (closed by ${item.closedByTaskRef})`}`);\n const rest = standing.openItems.length - named.length;\n return stop(CreationDriveStopRule.REQUIREMENTS_OPEN,\n `the loop chose to stop (${rationale}) while ${requirementsWithItems} of ${standing.requirementCount} requirement(s) carry ${standing.openItems.length} open item(s): `\n + `${named.join('; ')}${rest > 0 ? `; and ${rest} more` : ''}. Start refinement on them, or decide they are out of scope: wildo creation feed`);\n}\n\nfunction stop(rule: CreationDriveStopRule, waitingFor: string): CreationDriveDecision {\n return { action: CreationDriveAction.STOP, rule, waitingFor };\n}\n\nfunction wait(reason: CreationDriveWaitReason, detail: string): CreationDriveDecision {\n return { action: CreationDriveAction.WAIT, reason, detail };\n}\n\nfunction formatHours(ms: number): string {\n return `${Math.round((ms / 3_600_000) * 10) / 10} h`;\n}\n\nfunction describeAskedLine(kind: WorkbenchCreationHomeLineKind, subject: string, lineSubject?: string | null): string {\n switch (kind) {\n case WorkbenchCreationHomeLineKind.CLARIFICATION: return `playbook ${subject} asks a question only you can answer: wildo creation questions`;\n case WorkbenchCreationHomeLineKind.PARKED_QUESTION: return `the coding run for ${subject} is parked on a question: wildo creation questions`;\n // #3361: the line's own subject names the steps held until the interview is answered.\n case WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK:\n return `playbook ${subject}'s interview: ${lineSubject ?? 'the next steps'} read its answer, so they wait for it rather than be derived twice: wildo creation questions`;\n case WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN: return `specifications module ${subject} does not evaluate, so the plan has nothing to run and is not finished: wildo creation feed`;\n default: return `the build plan cannot run ${subject} until you act: wildo build dispatches`;\n }\n}\n\n/** What the drive talks to: the companion's routes, the clock, and where its progress goes. A port, so it is testable. */\nexport interface CreationDrivePort {\n readonly readFeed: () => Promise<CreationConsole_Feed>;\n readonly readStatus: () => Promise<CreationDrive_Status>;\n /** Where the application stands against its requirements, derived live (#3701). Asked only once a loop chose to stop. */\n readonly readRequirementsStanding: () => Promise<CreationDrive_RequirementsStanding>;\n /** The run report's measured total, USD; undefined when it reports none or cannot be read. */\n readonly readSpentUsd: () => Promise<number | undefined>;\n readonly runLoop: (request: { readonly goal: string; readonly maximumIterations: number; readonly fanOut?: number; readonly skipPreflight?: boolean }) => Promise<ConsoleLoopResult & {\n readonly interruption?: { readonly failure: string; readonly providerAccountRefusal?: ModelProviderAccountRefusal };\n }>;\n readonly accept: () => Promise<CreationDrive_AcceptOutcome>;\n /** Did this error mean the companion is not answering (as opposed to answering no)? */\n readonly isCompanionUnreachable: (error: unknown) => boolean;\n /** Did the CLIENT stop waiting while the companion goes on (the loop continues there), or a read is not ready yet? */\n readonly isClientTimeout: (error: unknown) => boolean;\n /** The companion answered \"not now\" (503: a derivation still in progress, as after a restart). A wait, never an error. */\n readonly isNotReadyYet: (error: unknown) => boolean;\n /** The companion refused because a loop or composite already runs (409). */\n readonly isAlreadyRunning: (error: unknown) => boolean;\n /** The provider account's refusal (#3204) the companion ANSWERED with (a model call outside the loop's own steps), or `undefined`. */\n readonly readProviderAccountRefusal: (error: unknown) => ModelProviderAccountRefusal | undefined;\n readonly now: () => number;\n readonly sleep: (ms: number) => Promise<void>;\n readonly progress: (line: string) => void;\n}\n\nexport interface CreationDriveResult {\n readonly stoppedBy: CreationDriveStopRule;\n readonly waitingFor: string;\n readonly loops: number;\n readonly rounds: number;\n readonly accepted: number;\n /** Companion restarts the drive saw: a changed start time, or an outage it waited through. */\n readonly companionRestarts: number;\n readonly elapsedMs: number;\n readonly spentUsd: number | undefined;\n /**\n * False when the spend ceiling could not be applied: the run report could not be read, or reported no USD figure.\n * The ceiling is then not enforced, and the result says so rather than implying it held.\n */\n readonly spendMeasured: boolean;\n /** Present exactly when the drive stopped {@link CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED}: which account, why, and its own words. */\n readonly providerAccountRefusal?: ModelProviderAccountRefusal;\n}\n\n/**\n * Drive the creation until a stop rule fires (#2233). The preflight is the command's, run before this; everything here\n * talks to the companion through `port`.\n */\nexport async function runCreationDrive(port: CreationDrivePort, options: {\n readonly goal: string;\n readonly maximumMs: number;\n readonly maximumUsd: number;\n readonly fanOut?: number;\n readonly skipPreflight?: boolean;\n}): Promise<CreationDriveResult> {\n const startedAt = port.now();\n let loops = 0;\n let rounds = 0;\n let accepted = 0;\n let companionRestarts = 0;\n let consecutiveInterruptions = 0;\n let companionStartedAt: string | undefined;\n let unreachableSince: number | undefined;\n let spentAtStart: number | undefined;\n let spentUsd: number | undefined;\n let lastLoop: CreationDriveObservation['lastLoop'];\n let networkWaitSinceMs: number | undefined;\n /** The standing read for the last loop's chosen stop (#3701); cleared when a loop runs, so a stale one never judges. */\n let requirements: CreationDriveObservation['requirements'];\n const finish = (rule: CreationDriveStopRule, waitingFor: string, providerAccountRefusal?: ModelProviderAccountRefusal): CreationDriveResult => {\n port.progress(`Stopped: ${rule} — ${waitingFor}`);\n return {\n stoppedBy: rule, waitingFor, loops, rounds, accepted, companionRestarts, elapsedMs: port.now() - startedAt, spentUsd, spendMeasured: spentUsd !== undefined,\n ...(providerAccountRefusal !== undefined ? { providerAccountRefusal } : {}),\n };\n };\n /** The account refusal's stop (#3204): the provider, what is wrong, where to fix it, in its own words. */\n const refusedByProviderAccount = (refusal: ModelProviderAccountRefusal): CreationDriveResult =>\n finish(CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED, `${describeModelProviderAccountRefusal(refusal)} Then run the drive again.`, refusal);\n const ACCEPTANCE_IS_YOURS = 'the autonomy posture leaves acceptance to you: wildo creation writes, then wildo creation accept <run>';\n /**\n * The posture's accept. `true` when the posture leaves acceptance to a person (a marked critical gate, armed). A live\n * coding run defers it to the next baseline; a failed or timed-out accept is reported and left to the next loop's, never\n * the drive's end (review of 6fe527ed3): the pending runs stay pending, which is what they were.\n */\n const acceptPending = async (): Promise<boolean> => {\n let outcome: CreationDrive_AcceptOutcome;\n try {\n outcome = await port.accept();\n } catch (error) {\n port.progress(`Could not accept the pending playbook runs now (${describeCaughtError(error)}); the next loop asks again`);\n return false;\n }\n if (outcome.disposition === CreationDriveAcceptDisposition.HELD_FOR_PERSON) return true;\n if (outcome.disposition === CreationDriveAcceptDisposition.ACCEPTED) {\n accepted += outcome.accepted ?? 0;\n if ((outcome.accepted ?? 0) > 0) port.progress(`Accepted ${outcome.accepted} playbook run(s) under the autonomy posture`);\n }\n return false;\n };\n /** Wait one poll interval, marking that the drive waited since its last loop. */\n const pause = async (): Promise<void> => {\n if (lastLoop) lastLoop = { ...lastLoop, waitedSince: true };\n await port.sleep(CREATION_DRIVE_POLL_INTERVAL_MS);\n };\n\n for (;;) {\n let feed: CreationConsole_Feed;\n let status: CreationDrive_Status;\n try {\n [feed, status] = await Promise.all([port.readFeed(), port.readStatus()]);\n } catch (error) {\n /*\n * A companion that does not answer, answers \"not yet\" (503: after a restart its first feed derivation is still\n * running), or answers late is a WAIT, bounded; anything else is a defect worth surfacing (review of 6fe527ed3).\n */\n if (!port.isCompanionUnreachable(error) && !port.isNotReadyYet(error) && !port.isClientTimeout(error)) throw error;\n unreachableSince ??= port.now();\n if (port.now() - unreachableSince >= CREATION_DRIVE_COMPANION_DOWN_LIMIT_MS) {\n return finish(CreationDriveStopRule.COMPANION_UNREACHABLE, `the companion has not answered since ${new Date(unreachableSince).toISOString()}: wildo local dev`);\n }\n port.progress(`Waiting: ${CreationDriveWaitReason.COMPANION_DOWN} — the companion does not answer yet; asking again`);\n await pause();\n continue;\n }\n if (unreachableSince !== undefined) {\n unreachableSince = undefined;\n // A restart only when the companion's start time moved: a slow answer or a cold derivation is no restart.\n if (companionStartedAt !== undefined && status.companionStartedAt !== companionStartedAt) {\n companionRestarts += 1;\n port.progress(`The companion restarted (now since ${status.companionStartedAt}); re-reading its state`);\n }\n } else if (companionStartedAt !== undefined && status.companionStartedAt !== companionStartedAt) {\n companionRestarts += 1;\n port.progress(`The companion restarted (now since ${status.companionStartedAt}); re-reading its state`);\n }\n companionStartedAt = status.companionStartedAt;\n /*\n * The goal is the requirements' to call (#3701): once the last loop chose to stop with nothing since, read where the\n * application stands, once for that loop. It derives the reading, so it is never read on a poll.\n */\n if (requirements === undefined && lastLoop?.stoppedBecause === LOOP_CHOSE_TO_STOP && !lastLoop.waitedSince) {\n try {\n requirements = { standing: await port.readRequirementsStanding() };\n } catch (error) {\n requirements = { unreadBecause: describeCaughtError(error) };\n }\n }\n const decide = () => decideCreationDriveStep({\n feed, status, elapsedMs: port.now() - startedAt, maximumMs: options.maximumMs, spentUsd, maximumUsd: options.maximumUsd,\n nowMs: port.now(), ...(networkWaitSinceMs === undefined ? {} : { networkWaitSinceMs }), ...(lastLoop ? { lastLoop } : {}),\n ...(requirements === undefined ? {} : { requirements }),\n });\n let decision = decide();\n /*\n * The spend is read from the run report, which derives from every row and the git history: read before a loop would\n * start (where the ceiling decides) and at the first step (the baseline), never on every poll of a long wait. The\n * ceilings are checked BETWEEN loops: a loop in flight is not cut, so one loop may overshoot them. A spend the report\n * cannot state (unreadable, or no USD figure) leaves the ceiling unenforced, and the result says so (`spendMeasured`).\n */\n if (spentAtStart === undefined || decision.action === CreationDriveAction.RUN_LOOP) {\n const total = await port.readSpentUsd().catch(() => undefined);\n spentAtStart ??= total;\n spentUsd = total === undefined || spentAtStart === undefined ? spentUsd : total - spentAtStart;\n decision = decide();\n }\n if (decision.action === CreationDriveAction.STOP) {\n /*\n * Whatever the system may accept is accepted before the drive stops, so a stop never leaves its work uncommitted.\n * The rule that fired stays the stop's; a posture that leaves acceptance to the person adds to what it waits for.\n */\n if (status.loopsInFlight === 0 && status.detachedRunsInFlight === 0 && (status.executionsInFlight ?? 0) === 0 && await acceptPending()) {\n return finish(decision.rule, `${decision.waitingFor}; and ${ACCEPTANCE_IS_YOURS}`, decision.providerAccountRefusal);\n }\n return finish(decision.rule, decision.waitingFor, decision.providerAccountRefusal);\n }\n if (decision.action === CreationDriveAction.WAIT) {\n networkWaitSinceMs = decision.reason === CreationDriveWaitReason.CODING_AGENT_CONNECTIVITY ? (networkWaitSinceMs ?? port.now()) : undefined;\n port.progress(`Waiting: ${decision.reason} — ${decision.detail}`);\n await pause();\n continue;\n }\n networkWaitSinceMs = undefined;\n\n loops += 1;\n requirements = undefined;\n port.progress(`Loop ${loops}: up to ${CREATION_DRIVE_ROUNDS_PER_LOOP} rounds toward the goal`);\n let result: Awaited<ReturnType<CreationDrivePort['runLoop']>>;\n try {\n result = await port.runLoop({\n goal: options.goal,\n maximumIterations: CREATION_DRIVE_ROUNDS_PER_LOOP,\n ...(options.fanOut !== undefined ? { fanOut: options.fanOut } : {}),\n ...(options.skipPreflight === true ? { skipPreflight: true } : {}),\n });\n } catch (error) {\n // The companion went away under the loop, the client stopped waiting while it goes on, or another loop holds the\n // subject: the next read decides (a restart is a wait, a running loop is a wait). Anything else is its refusal.\n if (port.isCompanionUnreachable(error) || port.isClientTimeout(error) || port.isAlreadyRunning(error) || port.isNotReadyYet(error)) {\n lastLoop = undefined;\n // Never straight back: a loop another process holds answers 409 at once, and asking again at once would spin.\n await port.sleep(CREATION_DRIVE_POLL_INTERVAL_MS);\n continue;\n }\n // A provider account's refusal answered as an error (a model call outside the loop's steps, #3204): the environment's, not a refusal of the loop.\n const accountRefusal = port.readProviderAccountRefusal(error);\n if (accountRefusal !== undefined) return refusedByProviderAccount(accountRefusal);\n return finish(CreationDriveStopRule.LOOP_REFUSED, describeCaughtError(error));\n }\n rounds += result.steps.length;\n lastLoop = { stoppedBecause: result.stoppedBecause, waitedSince: false, ...(result.steps.at(-1)?.stopRationale ? { stopRationale: result.steps.at(-1)!.stopRationale! } : {}) };\n port.progress(`Loop ${loops} ran ${result.steps.length} round(s) and stopped: ${result.stoppedBecause}`);\n // A provider account's refusal (#3204) keeps its own rule even where the posture leaves acceptance to a person: it is stopped on at once, since the next loop is refused identically.\n if (result.stoppedBecause === LOOP_INTERRUPTED_BY_ENVIRONMENT && result.interruption?.providerAccountRefusal !== undefined) {\n if (await acceptPending()) return finish(CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED, `${describeModelProviderAccountRefusal(result.interruption.providerAccountRefusal)} Then run the drive again; and ${ACCEPTANCE_IS_YOURS}`, result.interruption.providerAccountRefusal);\n return refusedByProviderAccount(result.interruption.providerAccountRefusal);\n }\n if (await acceptPending()) return finish(CreationDriveStopRule.ACCEPTANCE_HELD_FOR_PERSON, ACCEPTANCE_IS_YOURS);\n if (result.stoppedBecause === LOOP_ALL_LANES_FAILED) {\n const failures = result.steps.at(-1)?.lanes.filter((lane) => lane.failure).map((lane) => `${lane.playbookRef}: ${lane.failure}`) ?? [];\n return finish(CreationDriveStopRule.LANES_FAILED, failures.join('; ') || 'every lane of the last round failed');\n }\n if (result.stoppedBecause === LOOP_INTERRUPTED_BY_ENVIRONMENT) {\n consecutiveInterruptions += 1;\n if (consecutiveInterruptions >= CREATION_DRIVE_MAXIMUM_CONSECUTIVE_INTERRUPTIONS) {\n return finish(CreationDriveStopRule.ENVIRONMENT_INTERRUPTED, result.interruption?.failure ?? 'the environment stopped the loop');\n }\n lastLoop = { ...lastLoop, waitedSince: true };\n } else {\n consecutiveInterruptions = 0;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"creation-drive.service.js","sourceRoot":"","sources":["../../../../src/services/companion/creation-drive.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,4BAA4B,GAK7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mCAAmC,EAAoC,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAInI,mGAAmG;AACnG,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;AACjB,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B;AAED,0GAA0G;AAC1G,MAAM,CAAN,IAAY,qBAkEX;AAlED,WAAY,qBAAqB;IAC/B;;;OAGG;IACH,sDAA6B,CAAA;IAC7B;;;;;OAKG;IACH,gEAAuC,CAAA;IACvC;;;OAGG;IACH,4DAAmC,CAAA;IACnC,kEAAkE;IAClE,sDAA6B,CA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B,IAAI,CAAC,CAAC;YAC9B,IAAI,wBAAwB,IAAI,gDAAgD,EAAE,CAAC;gBACjF,OAAO,MAAM,CAAC,qBAAqB,CAAC,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,IAAI,kCAAkC,CAAC,CAAC;YACnI,CAAC;YACD,QAAQ,GAAG,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,wBAAwB,GAAG,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * # `wildo creation drive --until stuck` — the unattended creation driver (#2233)\n *\n * A full creation still needed a person, or a hand-written script, to move it from one round to the next: in run 004\n * (`app-creation-test-004`) the driving session ran the umbrella or a build wave, accepted what landed, restarted the\n * companion when it fell over, and stopped on the first real blocker. That loop is the shape of \"run a creation\", and\n * it lived outside the framework. `wildo creation loop` covered one piece of it (a model chooses each round) and none of\n * the rest: it stopped at 20 rounds, never accepted, died with the companion and stopped only when the model did.\n *\n * ## The shape\n *\n * Each step reads the companion's durable state (the creation FEED: what Home shows, holds included; and the drive\n * STATUS: what still runs), decides ONE of three things with {@link decideCreationDriveStep}, and does it:\n *\n * - **run** a bounded `wildo creation loop` (up to its 20-round ceiling): the companion gates, a model chooses, the\n * chosen lanes run, the build lane among them;\n * - **wait**: something still runs (a loop, a wave, a lane the usage-limit resume relaunched), the coding agent's usage\n * limit holds until its stated reset, the connectivity hold waits on the network, or the companion is down;\n * - **stop**, naming the rule that fired and what it waits for.\n *\n * The loop's model choosing to stop is not the goal reached: the drive then asks where the application stands against its\n * own requirements (`GET /creation/requirements/standing`, #3701), and calls the goal reached only when no requirement\n * carries an open item.\n *\n * After every loop, it accepts what the autonomy posture says the SYSTEM accepts (`POST /creation/drive/accept`, never\n * inside a live coding run), and stops when the posture leaves acceptance to a person: a marked critical gate, armed.\n *\n * ## Why in the CLI and not in the companion\n *\n * A companion restart ends every request it holds and every in-process timer. The driver lives in another process, so a\n * restart is a WAIT: it polls until the companion answers again and reads the same durable rows (the loop's state is\n * the working tree; the run records survive). The restart itself is on the intervention ledger when the companion\n * booted with runs in flight (#2231), and the driver also counts the restarts it saw, from the companion's start time.\n *\n * ## Holds it respects\n *\n * - a person's `wildo build stop` (#3206) is a STOP: a stopped build is never resumed unattended;\n * - the coding agent's usage limit (#2388) is a WAIT until it lifts; the companion's own resume relaunches what it\n * paused (#2463), and the driver waits for that run to drain before choosing again;\n * - the connectivity hold (#3236, #3262) is a WAIT until the agent's API answers.\n *\n * Ceilings are the person's, like `loop`'s iteration ceiling: a wall clock and a spend in US dollars, both required.\n * The spend is the run report's measured total since the drive began (#2231, #2232), a floor wherever a run reported no\n * cost.\n */\nimport {\n CreationDriveAcceptDisposition,\n WorkbenchCreationHomeLineKind,\n WorkbenchCreationHomeSection,\n type CreationConsole_Feed,\n type CreationDrive_AcceptOutcome,\n type CreationDrive_RequirementsStanding,\n type CreationDrive_Status,\n} from '@wildo-ai/platform-core-shared';\nimport { describeModelProviderAccountRefusal, type ModelProviderAccountRefusal, describeCaughtError } from '@wildo-ai/saas-models';\n\nimport type { ConsoleLoopResult } from './creation-console.service';\n\n/** The only drive mode: run until a stop rule fires. Named so `--until` is a closed vocabulary. */\nexport enum CreationDriveUntil {\n STUCK = 'stuck',\n}\n\n/** Why the driver stopped. Every exit is one of these, and the report names it with what it waits for. */\nexport enum CreationDriveStopRule {\n /**\n * The loop's selector chose to stop with nothing running and nothing asked, AND the application's requirements carry no\n * open item (#3701): the goal is reached by measurement, never by the model's judgement alone.\n */\n GOAL_REACHED = 'goal-reached',\n /**\n * The loop's selector chose to stop, and the application's own requirements still carry open items (#3701): a reported\n * gap, a configuration that does not meet one, one nothing addresses or with no build work landed. The model judged the\n * creation done and the measurement says it is not, so the drive stops and names them: each is closed by the task named\n * beside it, or by a person who starts refinement or decides the requirement is out of scope.\n */\n REQUIREMENTS_OPEN = 'requirements-open',\n /**\n * The loop's selector chose to stop, and where the application stands against its requirements could not be read\n * (#3701): whether the goal is reached is unknown, so the drive says that rather than claim it.\n */\n GOAL_UNMEASURED = 'goal-unmeasured',\n /** Nothing is eligible to run, nothing runs, nothing is asked. */\n NOTHING_LEFT = 'nothing-left',\n /**\n * A question only the creator can answer: a playbook's clarification, a coding run parked on a question, or an interview\n * whose answer would date work the next round could run (#3361).\n */\n WAITING_ON_CREATOR = 'waiting-on-creator',\n /** The build plan can run nothing until the creator unblocks it (a task that cannot land, retired after its attempts). */\n PLAN_BLOCKED = 'plan-blocked',\n /** A person's `wildo build stop` holds the build; only a person starts it again. */\n BUILD_STOPPED_BY_PERSON = 'build-stopped-by-person',\n /** The build lane holds dispatch because a backend does not run the current tree (#3215). */\n BUILD_HELD = 'build-held',\n /** Every lane of a loop round failed: choosing again over the same state would spend without progressing. */\n LANES_FAILED = 'lanes-failed',\n /** The companion refused to run the loop (a preflight failure, a refusal whose remedy is a decision). */\n LOOP_REFUSED = 'loop-refused',\n /** The autonomy posture leaves acceptance to a person: a marked critical gate is armed. */\n ACCEPTANCE_HELD_FOR_PERSON = 'acceptance-held-for-person',\n /** The creation preflight found what would stop the run, before the first round. */\n PREFLIGHT_FAILED = 'preflight-failed',\n /** The person's wall-clock ceiling. */\n WALL_CLOCK_CEILING = 'wall-clock-ceiling',\n /** The person's spend ceiling. */\n SPEND_CEILING = 'spend-ceiling',\n /** The environment stopped the loop on consecutive rounds, past the loop's own recovery wait (#3235). */\n ENVIRONMENT_INTERRUPTED = 'environment-interrupted',\n /** The companion did not answer for {@link CREATION_DRIVE_COMPANION_DOWN_LIMIT_MS}. */\n COMPANION_UNREACHABLE = 'companion-unreachable',\n /**\n * The coding agent's API has not answered along its route for {@link CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS}: nothing\n * can be built, and the wait has outlived what a network blip is. The person checks the network, or ends the hold.\n */\n NETWORK_LOST = 'network-lost',\n /**\n * A model provider's ACCOUNT refused the companion's or the coding agent's call (#3204): no credits left, a spend or\n * usage limit, billing. The ENVIRONMENT's condition, never the application's: nothing the creation did caused it, and\n * nothing it can do lifts it. A person adds credits or raises the limit in that provider's console, then runs the drive\n * again. Stopped on at once, never after consecutive loops: a loop run again is refused identically.\n */\n PROVIDER_ACCOUNT_REFUSED = 'provider-account-refused',\n /**\n * A verification check cannot be asked for a host cause (#3423, #3432): `wildo` is not on the companion's PATH, or the\n * installed one lacks the verb a check asks, or one check failed the same way on two tasks. Every build task's check\n * would fail the same way, so the companion admits no coding turn. The host's condition: a person repairs it (the next\n * admission asks first), then runs the drive again.\n */\n VERIFICATION_TOOL_UNAVAILABLE = 'verification-tool-unavailable',\n}\n\n/** What the driver waits for when it waits. */\nexport enum CreationDriveWaitReason {\n /** A loop or a detached run (a wave, a lane, a usage-limit resume) still runs in the companion. */\n RUNS_IN_FLIGHT = 'runs-in-flight',\n /** The coding agent's account usage limit holds the build until its stated reset (#2388). */\n CODING_AGENT_USAGE_LIMIT = 'coding-agent-usage-limit',\n /** A coding run lost the network; no coding turn starts until the agent's API answers (#3236, #3262). */\n CODING_AGENT_CONNECTIVITY = 'coding-agent-connectivity',\n /** The companion does not answer (a restart, a crash). */\n COMPANION_DOWN = 'companion-down',\n}\n\n/** How long one wait lasts before the driver reads the state again. */\nexport const CREATION_DRIVE_POLL_INTERVAL_MS = 30_000;\n/** How long the companion may stay unreachable before the drive stops. A restart takes seconds to a few minutes. */\nexport const CREATION_DRIVE_COMPANION_DOWN_LIMIT_MS = 15 * 60 * 1000;\n/**\n * How long the drive waits on the coding agent's network before it stops {@link CreationDriveStopRule.NETWORK_LOST}: three\n * times the coding admission's own twenty-minute bound, so an outage of an hour (app-creation-test-007 measured 35 min)\n * is waited through, and a five-hour one is the person's to see.\n */\nexport const CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS = 60 * 60 * 1000;\n/** The loop's own ceiling per request (`POST /playbooks/loop` caps it at 20). */\nexport const CREATION_DRIVE_ROUNDS_PER_LOOP = 20;\n/** Consecutive loops the environment interrupted before the drive stops (each already waited up to 10 minutes, #3235). */\nexport const CREATION_DRIVE_MAXIMUM_CONSECUTIVE_INTERRUPTIONS = 3;\n/** The ASKED kinds that stop a run until the creator acts. A governance document's fact does not: it blocks no run. */\nconst ASKED_KINDS_THAT_STOP: ReadonlyMap<WorkbenchCreationHomeLineKind, CreationDriveStopRule> = new Map([\n [WorkbenchCreationHomeLineKind.CLARIFICATION, CreationDriveStopRule.WAITING_ON_CREATOR],\n [WorkbenchCreationHomeLineKind.PARKED_QUESTION, CreationDriveStopRule.WAITING_ON_CREATOR],\n /*\n * An interview whose answer would date work the next round could run (#3361). The round withholds that work, so the\n * drive stops and names the interview, as for a clarification, rather than run on without it.\n */\n [WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK, CreationDriveStopRule.WAITING_ON_CREATOR],\n [WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN, CreationDriveStopRule.PLAN_BLOCKED],\n [WorkbenchCreationHomeLineKind.UNBLOCK_THE_PLAN, CreationDriveStopRule.PLAN_BLOCKED],\n]);\n\n/** What the driver knows when it decides its next step. */\nexport interface CreationDriveObservation {\n readonly feed: CreationConsole_Feed;\n readonly status: CreationDrive_Status;\n readonly elapsedMs: number;\n readonly maximumMs: number;\n /** Measured spend since the drive began, USD; undefined when the report could not be read. */\n readonly spentUsd: number | undefined;\n readonly maximumUsd: number;\n /** How the last loop ended, and whether the driver waited on anything since (which makes running again worth it). */\n readonly lastLoop?: { readonly stoppedBecause: string; readonly stopRationale?: string; readonly waitedSince: boolean };\n /**\n * Where the application stands against its own requirements (#3701), read once the last loop chose to stop: the\n * `standing`, or why it could not be read. Absent when it was not asked.\n */\n readonly requirements?: { readonly standing: CreationDrive_RequirementsStanding } | { readonly unreadBecause: string };\n /** Since when the drive has waited on the coding agent's network without a break (ms on the drive's clock). */\n readonly networkWaitSinceMs?: number;\n readonly nowMs?: number;\n}\n\nexport type CreationDriveDecision =\n | { readonly action: CreationDriveAction.RUN_LOOP }\n | { readonly action: CreationDriveAction.WAIT; readonly reason: CreationDriveWaitReason; readonly detail: string }\n | { readonly action: CreationDriveAction.STOP; readonly rule: CreationDriveStopRule; readonly waitingFor: string; readonly providerAccountRefusal?: ModelProviderAccountRefusal };\n\nexport enum CreationDriveAction {\n RUN_LOOP = 'run-loop',\n WAIT = 'wait',\n STOP = 'stop',\n}\n\n/**\n * The next step, from what the companion's durable rows say now. Order is the rule:\n * a person's stop first (it is theirs); the person's ceilings; anything still running (never start a loop over a\n * running one); what waits on the creator; a backend that does not boot; the holds only a person lifts (a refused\n * provider account, a build check's command missing from PATH); the holds that lift on their own; then the last loop's\n * own verdict when nothing happened since; else run.\n */\nexport function decideCreationDriveStep(observation: CreationDriveObservation): CreationDriveDecision {\n const { feed, status } = observation;\n // Read live from the status first: the feed may be an earlier snapshot, and a stop asked a moment ago holds now.\n const stoppedSince = status.buildStoppedSince ?? feed.buildPreparation?.heldByStopSince ?? null;\n if (stoppedSince !== null) {\n return stop(CreationDriveStopRule.BUILD_STOPPED_BY_PERSON, `a person stopped the build at ${stoppedSince}; start it again with: wildo build run`);\n }\n if (observation.elapsedMs >= observation.maximumMs) {\n return stop(CreationDriveStopRule.WALL_CLOCK_CEILING, `the drive's wall-clock ceiling (${formatHours(observation.maximumMs)}); run it again to continue`);\n }\n if (observation.spentUsd !== undefined && observation.spentUsd >= observation.maximumUsd) {\n return stop(CreationDriveStopRule.SPEND_CEILING, `the drive's spend ceiling (USD ${observation.maximumUsd}; measured USD ${observation.spentUsd.toFixed(2)})`);\n }\n if (status.loopsInFlight > 0 || status.detachedRunsInFlight > 0 || (status.executionsInFlight ?? 0) > 0) {\n return wait(CreationDriveWaitReason.RUNS_IN_FLIGHT, `${status.loopsInFlight} loop(s), ${status.detachedRunsInFlight} detached run(s) and ${status.executionsInFlight ?? 0} playbook execution(s) still running`);\n }\n for (const line of feed.lines) {\n if (line.section !== WorkbenchCreationHomeSection.ASKED) continue;\n const rule = ASKED_KINDS_THAT_STOP.get(line.kind);\n if (rule !== undefined) return stop(rule, describeAskedLine(line.kind, line.taskRef ?? line.playbookRef ?? line.subject ?? line.targetResourceId, line.subject));\n }\n const bootFailures = feed.buildHold?.bootFailures ?? [];\n /*\n * Not while the build lane still owes the repair of a start the application's own code refused (#3204): the lane runs\n * it, bounded per round, and only once it is spent does the hold need a person. Reference run 42696531261 stopped here\n * on two refusals a build task's code caused, with nothing having tried to repair them.\n */\n if (bootFailures.length > 0 && feed.buildHold?.startupRepairOwed !== true) {\n return stop(CreationDriveStopRule.BUILD_HELD, bootFailures.map((failure) => `${failure.serviceIdentifier} does not start: ${failure.remedy}`).join('; '));\n }\n /*\n * The coding agent's provider ACCOUNT refused its turn (#3204). The companion holds the build and re-asks the account\n * every thirty minutes, so a person who adds credits loses nothing; but nothing ever lifts it on its own, so an\n * unattended drive stops here rather than wait for a \"resume\" that only re-asks. Read from the live status first (a\n * pending resume beside it is that re-ask, never a reset), else from the feed's own line.\n */\n const accountRefusal = status.codingAgentAccountRefusal;\n const refusedLine = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.CODING_AGENT_ACCOUNT_REFUSED);\n if (accountRefusal !== undefined || refusedLine !== undefined) {\n const sentence = accountRefusal !== undefined ? describeModelProviderAccountRefusal(accountRefusal) : refusedLine?.subject ?? 'the coding agent\\'s provider account refused to work';\n return {\n action: CreationDriveAction.STOP,\n rule: CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED,\n waitingFor: `the coding agent's provider account: ${sentence} The build re-asks it every 30 minutes; run the drive again once it is fixed.`,\n ...(accountRefusal !== undefined ? { providerAccountRefusal: accountRefusal } : {}),\n };\n }\n /*\n * A build check cannot be asked for a host cause (#3423, #3432): a command not on PATH, one lacking the verb, the same\n * failure on two tasks. Nothing the drive does lifts it, so it stops; the line's subject is the cause and its remedy.\n */\n const toolUnavailable = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.VERIFICATION_TOOL_UNAVAILABLE);\n if (toolUnavailable !== undefined) {\n return stop(CreationDriveStopRule.VERIFICATION_TOOL_UNAVAILABLE,\n `the build's checks, which cannot run (met by build task ${toolUnavailable.taskRef ?? toolUnavailable.targetResourceId}), so no coding turn starts: `\n + `${toolUnavailable.subject ?? 'a command the checks run is unavailable.'} Then run the drive again.`);\n }\n const usageLimit = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.CODING_AGENT_USAGE_LIMITED);\n if (usageLimit !== undefined || status.pendingBuildResume !== undefined) {\n const resumesAt = status.pendingBuildResume?.resumesAt ?? usageLimit?.subject ?? 'its reset';\n return wait(CreationDriveWaitReason.CODING_AGENT_USAGE_LIMIT, `the coding agent's usage limit; the build resumes on its own at ${resumesAt}`);\n }\n /*\n * Waited on only when the hold has a ROUTE: its background probe ends it when the network returns. A hold with no route\n * (an agent with no known API host, a proxy it cannot use) is ended only by the next coding admission, so waiting on it\n * would wait forever; the loop runs, and its build's next turn is the check (review of 6fe527ed3).\n */\n const connectivity = feed.lines.find((line) => line.kind === WorkbenchCreationHomeLineKind.CODING_AGENT_CONNECTIVITY_LOST && line.subject !== null);\n if (connectivity !== undefined) {\n if (observation.networkWaitSinceMs !== undefined && observation.nowMs !== undefined && observation.nowMs - observation.networkWaitSinceMs >= CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS) {\n return stop(CreationDriveStopRule.NETWORK_LOST, `the coding agent's API (${connectivity.subject}) has not answered for ${formatHours(CREATION_DRIVE_NETWORK_WAIT_LIMIT_MS)}; once the network is back: wildo build rearm ${connectivity.taskRef ?? '<task>'} --reason environment`);\n }\n return wait(CreationDriveWaitReason.CODING_AGENT_CONNECTIVITY, `the coding agent's network; waiting for ${connectivity.subject} to answer`);\n }\n const last = observation.lastLoop;\n if (last !== undefined && !last.waitedSince) {\n // The loop chose to stop, or found nothing eligible, and nothing ran or lifted since: asking again is the same answer.\n if (last.stoppedBecause === LOOP_CHOSE_TO_STOP) return judgeChosenStop(last.stopRationale ?? 'the loop chose to stop', observation.requirements);\n if (last.stoppedBecause === LOOP_NOTHING_ELIGIBLE) return stop(CreationDriveStopRule.NOTHING_LEFT, 'nothing is eligible to run');\n }\n return { action: CreationDriveAction.RUN_LOOP };\n}\n\n// semantic-literal-boundary: `PlaybookLoopStopReason` values as the companion's loop document carries them; the CLI reads them as wire values.\nconst LOOP_CHOSE_TO_STOP = 'CHOSE_TO_STOP';\nconst LOOP_NOTHING_ELIGIBLE = 'NOTHING_ELIGIBLE';\nconst LOOP_ALL_LANES_FAILED = 'ALL_LANES_FAILED';\nconst LOOP_INTERRUPTED_BY_ENVIRONMENT = 'INTERRUPTED_BY_ENVIRONMENT';\n\n/** How many open items a stop names in words; the rest are counted. */\nconst OPEN_ITEMS_NAMED = 5;\n\n/**\n * The loop chose to stop: whether the goal is reached is the REQUIREMENTS' answer, not the model's (#3701). Goal reached\n * only when the standing was read and carries no open item; open items stop the drive on a rule that names them;\n * an unread standing is said to be unread. Run 42886943490 stopped \"goal-reached\" with 16 of 24 requirements partly met.\n */\nfunction judgeChosenStop(rationale: string, requirements: CreationDriveObservation['requirements']): CreationDriveDecision {\n const standing = requirements !== undefined && 'standing' in requirements ? requirements.standing : undefined;\n if (standing === undefined) {\n const why = requirements !== undefined && 'unreadBecause' in requirements ? requirements.unreadBecause : 'it was not read';\n return stop(CreationDriveStopRule.GOAL_UNMEASURED, `${rationale} — but where the application stands against its requirements could not be read (${why}): wildo creation drive again, or wildo context journey`);\n }\n if (standing.openItems.length === 0) {\n return stop(CreationDriveStopRule.GOAL_REACHED, `${rationale} Every one of the ${standing.requirementCount} requirement(s) is met by what the reading measures (stage ${standing.stage}).`);\n }\n const requirementsWithItems = new Set(standing.openItems.map((item) => item.requirementRef)).size;\n const named = standing.openItems.slice(0, OPEN_ITEMS_NAMED)\n .map((item) => `${item.requirementRef}: ${item.detail}${item.closedByTaskRef === null ? '' : ` (closed by ${item.closedByTaskRef})`}`);\n const rest = standing.openItems.length - named.length;\n return stop(CreationDriveStopRule.REQUIREMENTS_OPEN,\n `the loop chose to stop (${rationale}) while ${requirementsWithItems} of ${standing.requirementCount} requirement(s) carry ${standing.openItems.length} open item(s): `\n + `${named.join('; ')}${rest > 0 ? `; and ${rest} more` : ''}. Start refinement on them, or decide they are out of scope: wildo creation feed`);\n}\n\nfunction stop(rule: CreationDriveStopRule, waitingFor: string): CreationDriveDecision {\n return { action: CreationDriveAction.STOP, rule, waitingFor };\n}\n\nfunction wait(reason: CreationDriveWaitReason, detail: string): CreationDriveDecision {\n return { action: CreationDriveAction.WAIT, reason, detail };\n}\n\nfunction formatHours(ms: number): string {\n return `${Math.round((ms / 3_600_000) * 10) / 10} h`;\n}\n\nfunction describeAskedLine(kind: WorkbenchCreationHomeLineKind, subject: string, lineSubject?: string | null): string {\n switch (kind) {\n case WorkbenchCreationHomeLineKind.CLARIFICATION: return `playbook ${subject} asks a question only you can answer: wildo creation questions`;\n case WorkbenchCreationHomeLineKind.PARKED_QUESTION: return `the coding run for ${subject} is parked on a question: wildo creation questions`;\n // #3361: the line's own subject names the steps held until the interview is answered.\n case WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK:\n return `playbook ${subject}'s interview: ${lineSubject ?? 'the next steps'} read its answer, so they wait for it rather than be derived twice: wildo creation questions`;\n case WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN: return `specifications module ${subject} does not evaluate, so the plan has nothing to run and is not finished: wildo creation feed`;\n default: return `the build plan cannot run ${subject} until you act: wildo build dispatches`;\n }\n}\n\n/** What the drive talks to: the companion's routes, the clock, and where its progress goes. A port, so it is testable. */\nexport interface CreationDrivePort {\n readonly readFeed: () => Promise<CreationConsole_Feed>;\n readonly readStatus: () => Promise<CreationDrive_Status>;\n /** Where the application stands against its requirements, derived live (#3701). Asked only once a loop chose to stop. */\n readonly readRequirementsStanding: () => Promise<CreationDrive_RequirementsStanding>;\n /** The run report's measured total, USD; undefined when it reports none or cannot be read. */\n readonly readSpentUsd: () => Promise<number | undefined>;\n readonly runLoop: (request: { readonly goal: string; readonly maximumIterations: number; readonly fanOut?: number; readonly skipPreflight?: boolean }) => Promise<ConsoleLoopResult & {\n readonly interruption?: { readonly failure: string; readonly providerAccountRefusal?: ModelProviderAccountRefusal };\n }>;\n readonly accept: () => Promise<CreationDrive_AcceptOutcome>;\n /** Did this error mean the companion is not answering (as opposed to answering no)? */\n readonly isCompanionUnreachable: (error: unknown) => boolean;\n /** Did the CLIENT stop waiting while the companion goes on (the loop continues there), or a read is not ready yet? */\n readonly isClientTimeout: (error: unknown) => boolean;\n /** The companion answered \"not now\" (503: a derivation still in progress, as after a restart). A wait, never an error. */\n readonly isNotReadyYet: (error: unknown) => boolean;\n /** The companion refused because a loop or composite already runs (409). */\n readonly isAlreadyRunning: (error: unknown) => boolean;\n /** The provider account's refusal (#3204) the companion ANSWERED with (a model call outside the loop's own steps), or `undefined`. */\n readonly readProviderAccountRefusal: (error: unknown) => ModelProviderAccountRefusal | undefined;\n readonly now: () => number;\n readonly sleep: (ms: number) => Promise<void>;\n readonly progress: (line: string) => void;\n}\n\nexport interface CreationDriveResult {\n readonly stoppedBy: CreationDriveStopRule;\n readonly waitingFor: string;\n readonly loops: number;\n readonly rounds: number;\n readonly accepted: number;\n /** Companion restarts the drive saw: a changed start time, or an outage it waited through. */\n readonly companionRestarts: number;\n readonly elapsedMs: number;\n readonly spentUsd: number | undefined;\n /**\n * False when the spend ceiling could not be applied: the run report could not be read, or reported no USD figure.\n * The ceiling is then not enforced, and the result says so rather than implying it held.\n */\n readonly spendMeasured: boolean;\n /** Present exactly when the drive stopped {@link CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED}: which account, why, and its own words. */\n readonly providerAccountRefusal?: ModelProviderAccountRefusal;\n}\n\n/**\n * Drive the creation until a stop rule fires (#2233). The preflight is the command's, run before this; everything here\n * talks to the companion through `port`.\n */\nexport async function runCreationDrive(port: CreationDrivePort, options: {\n readonly goal: string;\n readonly maximumMs: number;\n readonly maximumUsd: number;\n readonly fanOut?: number;\n readonly skipPreflight?: boolean;\n}): Promise<CreationDriveResult> {\n const startedAt = port.now();\n let loops = 0;\n let rounds = 0;\n let accepted = 0;\n let companionRestarts = 0;\n let consecutiveInterruptions = 0;\n let companionStartedAt: string | undefined;\n let unreachableSince: number | undefined;\n let spentAtStart: number | undefined;\n let spentUsd: number | undefined;\n let lastLoop: CreationDriveObservation['lastLoop'];\n let networkWaitSinceMs: number | undefined;\n /** The standing read for the last loop's chosen stop (#3701); cleared when a loop runs, so a stale one never judges. */\n let requirements: CreationDriveObservation['requirements'];\n const finish = (rule: CreationDriveStopRule, waitingFor: string, providerAccountRefusal?: ModelProviderAccountRefusal): CreationDriveResult => {\n port.progress(`Stopped: ${rule} — ${waitingFor}`);\n return {\n stoppedBy: rule, waitingFor, loops, rounds, accepted, companionRestarts, elapsedMs: port.now() - startedAt, spentUsd, spendMeasured: spentUsd !== undefined,\n ...(providerAccountRefusal !== undefined ? { providerAccountRefusal } : {}),\n };\n };\n /** The account refusal's stop (#3204): the provider, what is wrong, where to fix it, in its own words. */\n const refusedByProviderAccount = (refusal: ModelProviderAccountRefusal): CreationDriveResult =>\n finish(CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED, `${describeModelProviderAccountRefusal(refusal)} Then run the drive again.`, refusal);\n const ACCEPTANCE_IS_YOURS = 'the autonomy posture leaves acceptance to you: wildo creation writes, then wildo creation accept <run>';\n /**\n * The posture's accept. `true` when the posture leaves acceptance to a person (a marked critical gate, armed). A live\n * coding run defers it to the next baseline; a failed or timed-out accept is reported and left to the next loop's, never\n * the drive's end (review of 6fe527ed3): the pending runs stay pending, which is what they were.\n */\n const acceptPending = async (): Promise<boolean> => {\n let outcome: CreationDrive_AcceptOutcome;\n try {\n outcome = await port.accept();\n } catch (error) {\n port.progress(`Could not accept the pending playbook runs now (${describeCaughtError(error)}); the next loop asks again`);\n return false;\n }\n if (outcome.disposition === CreationDriveAcceptDisposition.HELD_FOR_PERSON) return true;\n if (outcome.disposition === CreationDriveAcceptDisposition.ACCEPTED) {\n accepted += outcome.accepted ?? 0;\n if ((outcome.accepted ?? 0) > 0) port.progress(`Accepted ${outcome.accepted} playbook run(s) under the autonomy posture`);\n }\n return false;\n };\n /** Wait one poll interval, marking that the drive waited since its last loop. */\n const pause = async (): Promise<void> => {\n if (lastLoop) lastLoop = { ...lastLoop, waitedSince: true };\n await port.sleep(CREATION_DRIVE_POLL_INTERVAL_MS);\n };\n\n for (;;) {\n let feed: CreationConsole_Feed;\n let status: CreationDrive_Status;\n try {\n [feed, status] = await Promise.all([port.readFeed(), port.readStatus()]);\n } catch (error) {\n /*\n * A companion that does not answer, answers \"not yet\" (503: after a restart its first feed derivation is still\n * running), or answers late is a WAIT, bounded; anything else is a defect worth surfacing (review of 6fe527ed3).\n */\n if (!port.isCompanionUnreachable(error) && !port.isNotReadyYet(error) && !port.isClientTimeout(error)) throw error;\n unreachableSince ??= port.now();\n if (port.now() - unreachableSince >= CREATION_DRIVE_COMPANION_DOWN_LIMIT_MS) {\n return finish(CreationDriveStopRule.COMPANION_UNREACHABLE, `the companion has not answered since ${new Date(unreachableSince).toISOString()}: wildo local dev`);\n }\n port.progress(`Waiting: ${CreationDriveWaitReason.COMPANION_DOWN} — the companion does not answer yet; asking again`);\n await pause();\n continue;\n }\n if (unreachableSince !== undefined) {\n unreachableSince = undefined;\n // A restart only when the companion's start time moved: a slow answer or a cold derivation is no restart.\n if (companionStartedAt !== undefined && status.companionStartedAt !== companionStartedAt) {\n companionRestarts += 1;\n port.progress(`The companion restarted (now since ${status.companionStartedAt}); re-reading its state`);\n }\n } else if (companionStartedAt !== undefined && status.companionStartedAt !== companionStartedAt) {\n companionRestarts += 1;\n port.progress(`The companion restarted (now since ${status.companionStartedAt}); re-reading its state`);\n }\n companionStartedAt = status.companionStartedAt;\n /*\n * The goal is the requirements' to call (#3701): once the last loop chose to stop with nothing since, read where the\n * application stands, once for that loop. It derives the reading, so it is never read on a poll.\n */\n if (requirements === undefined && lastLoop?.stoppedBecause === LOOP_CHOSE_TO_STOP && !lastLoop.waitedSince) {\n try {\n requirements = { standing: await port.readRequirementsStanding() };\n } catch (error) {\n requirements = { unreadBecause: describeCaughtError(error) };\n }\n }\n const decide = () => decideCreationDriveStep({\n feed, status, elapsedMs: port.now() - startedAt, maximumMs: options.maximumMs, spentUsd, maximumUsd: options.maximumUsd,\n nowMs: port.now(), ...(networkWaitSinceMs === undefined ? {} : { networkWaitSinceMs }), ...(lastLoop ? { lastLoop } : {}),\n ...(requirements === undefined ? {} : { requirements }),\n });\n let decision = decide();\n /*\n * The spend is read from the run report, which derives from every row and the git history: read before a loop would\n * start (where the ceiling decides) and at the first step (the baseline), never on every poll of a long wait. The\n * ceilings are checked BETWEEN loops: a loop in flight is not cut, so one loop may overshoot them. A spend the report\n * cannot state (unreadable, or no USD figure) leaves the ceiling unenforced, and the result says so (`spendMeasured`).\n */\n if (spentAtStart === undefined || decision.action === CreationDriveAction.RUN_LOOP) {\n const total = await port.readSpentUsd().catch(() => undefined);\n spentAtStart ??= total;\n spentUsd = total === undefined || spentAtStart === undefined ? spentUsd : total - spentAtStart;\n decision = decide();\n }\n if (decision.action === CreationDriveAction.STOP) {\n /*\n * Whatever the system may accept is accepted before the drive stops, so a stop never leaves its work uncommitted.\n * The rule that fired stays the stop's; a posture that leaves acceptance to the person adds to what it waits for.\n */\n if (status.loopsInFlight === 0 && status.detachedRunsInFlight === 0 && (status.executionsInFlight ?? 0) === 0 && await acceptPending()) {\n return finish(decision.rule, `${decision.waitingFor}; and ${ACCEPTANCE_IS_YOURS}`, decision.providerAccountRefusal);\n }\n return finish(decision.rule, decision.waitingFor, decision.providerAccountRefusal);\n }\n if (decision.action === CreationDriveAction.WAIT) {\n networkWaitSinceMs = decision.reason === CreationDriveWaitReason.CODING_AGENT_CONNECTIVITY ? (networkWaitSinceMs ?? port.now()) : undefined;\n port.progress(`Waiting: ${decision.reason} — ${decision.detail}`);\n await pause();\n continue;\n }\n networkWaitSinceMs = undefined;\n\n loops += 1;\n requirements = undefined;\n port.progress(`Loop ${loops}: up to ${CREATION_DRIVE_ROUNDS_PER_LOOP} rounds toward the goal`);\n let result: Awaited<ReturnType<CreationDrivePort['runLoop']>>;\n try {\n result = await port.runLoop({\n goal: options.goal,\n maximumIterations: CREATION_DRIVE_ROUNDS_PER_LOOP,\n ...(options.fanOut !== undefined ? { fanOut: options.fanOut } : {}),\n ...(options.skipPreflight === true ? { skipPreflight: true } : {}),\n });\n } catch (error) {\n // The companion went away under the loop, the client stopped waiting while it goes on, or another loop holds the\n // subject: the next read decides (a restart is a wait, a running loop is a wait). Anything else is its refusal.\n if (port.isCompanionUnreachable(error) || port.isClientTimeout(error) || port.isAlreadyRunning(error) || port.isNotReadyYet(error)) {\n lastLoop = undefined;\n // Never straight back: a loop another process holds answers 409 at once, and asking again at once would spin.\n await port.sleep(CREATION_DRIVE_POLL_INTERVAL_MS);\n continue;\n }\n // A provider account's refusal answered as an error (a model call outside the loop's steps, #3204): the environment's, not a refusal of the loop.\n const accountRefusal = port.readProviderAccountRefusal(error);\n if (accountRefusal !== undefined) return refusedByProviderAccount(accountRefusal);\n return finish(CreationDriveStopRule.LOOP_REFUSED, describeCaughtError(error));\n }\n // A wait while lanes ran is not a round of work (#3848): it started nothing.\n rounds += result.steps.filter((step) => step.waitRationale === undefined).length;\n lastLoop = { stoppedBecause: result.stoppedBecause, waitedSince: false, ...(result.steps.at(-1)?.stopRationale ? { stopRationale: result.steps.at(-1)!.stopRationale! } : {}) };\n port.progress(`Loop ${loops} ran ${result.steps.length} round(s) and stopped: ${result.stoppedBecause}`);\n // A provider account's refusal (#3204) keeps its own rule even where the posture leaves acceptance to a person: it is stopped on at once, since the next loop is refused identically.\n if (result.stoppedBecause === LOOP_INTERRUPTED_BY_ENVIRONMENT && result.interruption?.providerAccountRefusal !== undefined) {\n if (await acceptPending()) return finish(CreationDriveStopRule.PROVIDER_ACCOUNT_REFUSED, `${describeModelProviderAccountRefusal(result.interruption.providerAccountRefusal)} Then run the drive again; and ${ACCEPTANCE_IS_YOURS}`, result.interruption.providerAccountRefusal);\n return refusedByProviderAccount(result.interruption.providerAccountRefusal);\n }\n if (await acceptPending()) return finish(CreationDriveStopRule.ACCEPTANCE_HELD_FOR_PERSON, ACCEPTANCE_IS_YOURS);\n if (result.stoppedBecause === LOOP_ALL_LANES_FAILED) {\n // The step that stopped it, named by the loop (#3848): steps settle out of order, so the last one may be another.\n const failedStep = result.stoppedAtIteration !== undefined ? result.steps.find((step) => step.iteration === result.stoppedAtIteration) : result.steps.at(-1);\n const failures = failedStep?.lanes.filter((lane) => lane.failure).map((lane) => `${lane.playbookRef}: ${lane.failure}`) ?? [];\n return finish(CreationDriveStopRule.LANES_FAILED, failures.join('; ') || 'every lane of the last round failed');\n }\n if (result.stoppedBecause === LOOP_INTERRUPTED_BY_ENVIRONMENT) {\n consecutiveInterruptions += 1;\n if (consecutiveInterruptions >= CREATION_DRIVE_MAXIMUM_CONSECUTIVE_INTERRUPTIONS) {\n return finish(CreationDriveStopRule.ENVIRONMENT_INTERRUPTED, result.interruption?.failure ?? 'the environment stopped the loop');\n }\n lastLoop = { ...lastLoop, waitedSince: true };\n } else {\n consecutiveInterruptions = 0;\n }\n }\n}\n"]}
@@ -75,6 +75,12 @@ export interface SecretChangeOptions {
75
75
  */
76
76
  readonly restartCompanion?: boolean;
77
77
  }
78
+ /**
79
+ * The signal file whose touch restarts a supervised runtime, per scope path (`backend`, `companion`,
80
+ * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its
81
+ * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.
82
+ */
83
+ export declare function runtimeSignalFiles(saasRoot: string, runtimes: readonly string[]): Promise<Map<string, string>>;
78
84
  /**
79
85
  * Run this CLI's own `config sync --domain <domain>` for one environment, as one child run. A failure is
80
86
  * REPORTED, never swallowed: the value is already in `secrets.json`, and without the regeneration nothing
@@ -1 +1 @@
1
- {"version":3,"file":"application-secrets.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets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B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
1
+ {"version":3,"file":"application-secrets.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAkB,iBAAiB,EAA0B,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAA6B,KAAK,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAYrI,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAE7B,MAAM,6DAA6D,CAAC;AAYrE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,iBAAiB,GAAG;QAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,4BAA4B,CAAA;KAAE,CAAC,EAAE,CAAC;IAChH;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAM7E;AAmCD;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAwBvJ;AA8CD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sGAAsG;IACtG,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrD,uEAAuE;IACvE,QAAQ,CAAC,mBAAmB,EAAE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G;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAiB9B;AAED,4GAA4G;AAC5G,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
@@ -213,7 +213,7 @@ function liveSupervisorSignalFile(saasRoot, folder) {
213
213
  * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its
214
214
  * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.
215
215
  */
216
- async function runtimeSignalFiles(saasRoot, runtimes) {
216
+ export async function runtimeSignalFiles(saasRoot, runtimes) {
217
217
  const config = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS));
218
218
  const byFolder = new Map();
219
219
  const add = (folder) => {
@@ -1 +1 @@
1
- {"version":3,"file":"application-secrets.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAqC,MAAM,gCAAgC,CAAC;AACrI,OAAO,EAAE,oCAAoC,EAAE,6BA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AO,EAAE,MAAM,CAAC,EAAE,CAAC;AAClJ,CAAC","sourcesContent":["/**\n * An application's secrets per environment — provider secrets, system-of-record credentials and inbound\n * endpoint secrets (`ApplicationSecretKind`) — what it needs, what is set, and how to change one, for\n * `wildo secrets` and, through it, the workbench's secrets section (#1637).\n *\n * Local environments keep values in `infrastructure/<env>/secrets/secrets.json`, one section per kind; a\n * change is written there, the runtimes' `.env` files are regenerated, and only the runtimes that read the\n * key are restarted. Remote environments keep them as GitHub Actions secrets, written through the operator's\n * own `gh` login (`remote-secrets-store.service.ts`).\n *\n * A value never leaves this module except to the store that holds it: every report carries names and\n * standings, never a value, so a listing can be printed, logged or shown in a browser.\n */\nimport { spawnSync } from 'child_process';\nimport { existsSync, readFileSync, realpathSync, utimesSync } from 'fs';\nimport { basename, isAbsolute, join, relative, resolve } from 'path';\n\nimport { loadSaasConfig, WildoLocationType, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\nimport { ApplicationSecretKind, ApplicationSecretStanding, type ApplicationSecretRemoteLevel } from '@wildo-ai/platform-core-shared';\nimport { parseInboundEndpointSecretEnvVarName, parseSystemOfRecordEnvVarName } from '@wildo-ai/saas-models';\n\nimport { readLocalApplicationSecretPresence, updateLocalApplicationSecrets } from '~wildo-cli/services/credentials/local-secrets-store.service';\nimport { describeSecretValueProblem } from '~wildo-cli/services/credentials/provider-secret-format';\nimport { normalizePotentialMultilineSecret } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport {\n describeDeployWorkflowGap,\n listRemoteApplicationSecrets,\n setRemoteApplicationSecret,\n unsetRemoteApplicationSecret,\n} from '~wildo-cli/services/credentials/remote-secrets-store.service';\nimport {\n loadSecretRequirementInputs,\n loadSecretRequirements,\n SystemOfRecordEnvironmentPresence,\n systemOfRecordPresenceOf,\n type SecretRequirement,\n type SecretRequirementInputs,\n type StoredApplicationSecrets,\n} from '~wildo-cli/services/credentials/secret-requirements.service';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport {\n COMPANION_UNREACHABLE_EXIT_CODE,\n CompanionClient,\n CompanionRefusalError,\n companionFailureExitCode,\n} from '~wildo-cli/services/companion/companion-client.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\nexport interface EnvironmentSecretsReport {\n readonly envName: string;\n readonly locationType: WildoLocationType;\n readonly requirements: readonly (SecretRequirement & { readonly remoteLevel?: ApplicationSecretRemoteLevel })[];\n /**\n * What this listing could not derive, each saying why — a backend not built (its inbound endpoints are then\n * unknown), a vendor facet that could not be read. Empty when the listing is whole.\n */\n readonly incomplete: readonly string[];\n}\n\n/** An environment's location, refused when the environment is not registered. */\nexport function resolveEnvironmentLocation(envName: string): WildoLocationType {\n const environment = EnvironmentUtils.get(envName);\n if (!environment) {\n throw new Error(`No environment '${envName}'. Registered: ${EnvironmentUtils.listNames().join(', ') || 'none'}.`);\n }\n return environment.locationType;\n}\n\nconst APPLICATION_SECRET_KINDS = Object.values(ApplicationSecretKind);\n\n/**\n * A LOCAL environment's `secrets.json`, per kind: the names with a value (`stored`), and every name the section\n * holds, an empty value included (`present`). A key stored as `\"\"` is not set, but it is still there to remove.\n */\nfunction readLocalStoredSecrets(envName: string): { readonly stored: StoredApplicationSecrets; readonly present: StoredApplicationSecrets } {\n // Names only: the report says what is set, so no value is read into it.\n const sections = APPLICATION_SECRET_KINDS.map((kind) => [kind, readLocalApplicationSecretPresence(envName, kind)] as const);\n return {\n stored: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.stored)])) as unknown as StoredApplicationSecrets,\n present: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.present)])) as unknown as StoredApplicationSecrets,\n };\n}\n\n/**\n * How the environment addresses each system of record, from its GENERATED config — the file the env builder\n * reads to decide what reaches the backend — or `null` when it cannot be read.\n */\nfunction readSystemOfRecordPresence(envName: string): Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null {\n let config: PlatformEnvConfigJson | null;\n try {\n config = EnvironmentUtils.loadConfigJson(envName);\n } catch {\n return null;\n }\n if (!config) return null;\n return systemOfRecordPresenceOf(config.systemsOfRecord);\n}\n\n/** One secret's identity across kinds: a name is unique per `secrets.json` section, not across them. */\nconst secretKey = (kind: ApplicationSecretKind, envVarName: string): string => `${kind}:${envVarName}`;\n\n/**\n * What the application needs in one environment, and what is set there. Pass `inputs` when describing\n * several environments, so the application is loaded once (`loadSecretRequirementInputs` with its owners).\n */\nexport async function describeEnvironmentSecrets(saasRoot: string, envName: string, inputs?: SecretRequirementInputs): Promise<EnvironmentSecretsReport> {\n const locationType = resolveEnvironmentLocation(envName);\n const loaded = inputs ?? await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const incomplete = loaded.owners?.incomplete ?? [];\n const systemOfRecordPresence = readSystemOfRecordPresence(envName);\n if (locationType === WildoLocationType.LOCAL) {\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, ...readLocalStoredSecrets(envName), systemOfRecordPresence });\n return { envName, locationType, requirements, incomplete };\n }\n const remote = new Map(listRemoteApplicationSecrets(envName, saasRoot).map((secret) => [secretKey(secret.kind, secret.envVarName), secret]));\n const stored = Object.fromEntries(APPLICATION_SECRET_KINDS.map((kind) => [\n kind,\n new Set([...remote.values()].filter((secret) => secret.kind === kind).map((secret) => secret.envVarName)),\n ])) as unknown as StoredApplicationSecrets;\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, stored, systemOfRecordPresence });\n return {\n envName,\n locationType,\n requirements: requirements.map((row) => {\n const held = remote.get(secretKey(row.kind, row.envVarName));\n return held ? { ...row, remoteLevel: held.level } : row;\n }),\n incomplete,\n };\n}\n\n/**\n * The requirement a name refers to, refused when nothing the application declares reads it — a key no\n * runtime would receive is a typo or a stale name.\n *\n * A NAME is not an identity: each kind is its own `secrets.json` section, and a migration can leave one key in\n * two (an Odoo credential still in `providerEnv` beside its `systemsOfRecordEnv` copy). So `kind` narrows the\n * match, and a name matching in two kinds without one is refused, naming both, rather than resolved to\n * whichever sorted first — which set or removed the other copy than the one the person meant.\n *\n * One exception, for a name whose OWNER exists but could not be enumerated: an inbound endpoint secret when\n * the backend's endpoints could not be read (it is not built), and a system-of-record slot when its vendor's\n * facet could not be. A well-formed name for such an owner is admitted, because refusing it would make the\n * secret impossible to provide until something unrelated is fixed — the env builder delivers any well-formed\n * name, and the backend is where an endpoint without its secret is reported.\n */\nfunction requirementFor(report: EnvironmentSecretsReport, inputs: SecretRequirementInputs, envVarName: string, kind?: ApplicationSecretKind): SecretRequirement {\n const matches = report.requirements\n .filter((candidate) => candidate.envVarName === envVarName && (kind === undefined || candidate.kind === kind))\n .sort((left, right) => left.kind.localeCompare(right.kind));\n if (matches.length > 1) {\n throw new Error(`${envVarName} is in more than one section of this environment's secrets (${matches.map((row) => `${row.kind}: ${row.standing}`).join(', ')}). `\n + `Name the one you mean with --kind ${matches.map((row) => row.kind).join(' | ')}.`);\n }\n if (matches[0]) return matches[0];\n const owners = inputs.owners;\n const endpoint = kind === undefined || kind === ApplicationSecretKind.INBOUND_ENDPOINT ? parseInboundEndpointSecretEnvVarName(envVarName) : null;\n if (endpoint && owners?.inboundEndpointKeys === null) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.INBOUND_ENDPOINT, endpoint.endpointKey);\n }\n const slot = kind === undefined || kind === ApplicationSecretKind.SYSTEM_OF_RECORD ? parseSystemOfRecordEnvVarName(envVarName) : null;\n if (slot && owners?.systemsOfRecord.some((system) => system.name === slot.instanceName && system.secretSlots === null)) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.SYSTEM_OF_RECORD, slot.instanceName);\n }\n const known = [...new Set(report.requirements.filter((candidate) => kind === undefined || candidate.kind === kind).map((candidate) => candidate.envVarName))];\n throw new Error(`Nothing this application declares reads ${envVarName}${kind === undefined ? '' : ` as a ${kind} secret`}. Known here: ${known.join(', ') || 'none'}.`);\n}\n\nfunction unenumeratedOwnerRow(envVarName: string, kind: ApplicationSecretKind, ownerRef: string): SecretRequirement {\n return {\n envVarName, kind, ownerRef, description: null, required: true, capabilities: [], runtimes: ['backend'],\n standing: ApplicationSecretStanding.NEEDED, creationEssential: false,\n };\n}\n\nexport interface SecretChangeOutcome {\n readonly envVarName: string;\n /** Which `secrets.json` section (or, remotely, which GitHub secret prefix) the change was made in. */\n readonly kind: ApplicationSecretKind;\n readonly envName: string;\n /**\n * Local only: the runtimes asked to restart to read the change — those that read the key AND run under\n * a LIVE supervisor of `wildo local dev`. A signal file outlives the stack, so its existence alone is\n * not a restart; a runtime nobody supervises reads the key at its next start.\n */\n readonly restartSignalledRuntimes: readonly string[];\n /** Local only: whether the runtimes' `.env` files were regenerated. */\n readonly envFilesRegenerated: boolean;\n /** Local only: why the `.env` files could not be regenerated, with what to run; `null` otherwise. */\n readonly envFilesRegenerationFailure: string | null;\n /**\n * Local only: the companion reads this key and was NOT asked to restart, because the caller said it\n * applies the change itself (`--no-companion-restart`). The workbench does, in-process: restarting\n * the companion from inside a request would end the process serving it and any run in flight.\n */\n readonly companionAppliesChange: boolean;\n /**\n * Local only: the RUNNING companion loaded the change in place, through `POST /api/companion/runtime/env/apply`,\n * so it was not restarted and no run in flight was ended. False when it reads no such key, is not running,\n * or the caller applies the change itself.\n */\n readonly companionLoadedInProcess: boolean;\n /**\n * Local only: the companion is running and reads this key, but could not be made to load it — with what to\n * do. `null` when nothing failed. Distinct from the workbench's `companionApplyFailure`, which the COMPANION\n * sets about its own in-process apply.\n */\n readonly companionLoadFailure: string | null;\n /**\n * The environment's rows AFTER the change, re-derived from the same application inputs the change was\n * checked against (#1782). One change can move OTHER rows too: setting one LLM provider's key can make a\n * competing provider's key no longer needed. A caller holding a listing replaces that environment's rows\n * with these instead of re-listing, which re-loads the application and takes tens of seconds.\n *\n * `null` when they could not be read after the change was MADE — for a remote environment that is one\n * more `gh` listing, which a network error, a rate limit or an expired token can fail. The change itself\n * stands, and a caller holding a listing drops it instead of patching it.\n */\n readonly environmentAfterChange: EnvironmentSecretsReport | null;\n}\n\n/**\n * The environment's rows after a change that has ALREADY been written. A failure here must never turn the\n * completed change into a reported failure: the person would be told \"not changed\" about a secret that was.\n */\nasync function describeAfterChange(saasRoot: string, envName: string, inputs: SecretRequirementInputs): Promise<EnvironmentSecretsReport | null> {\n try {\n return await describeEnvironmentSecrets(saasRoot, envName, inputs);\n } catch {\n return null;\n }\n}\n\n/** Options every change takes. */\nexport interface SecretChangeOptions {\n /** Which `secrets.json` section the name is in — needed only when it is in more than one (see `requirementFor`). */\n readonly kind?: ApplicationSecretKind;\n /**\n * Whether a change the companion reads restarts it (default). The workbench passes `false` and applies\n * the change in-process — see {@link SecretChangeOutcome.companionAppliesChange}.\n */\n readonly restartCompanion?: boolean;\n}\n\n/** The scope path the dev companion is read under (`providers.scopes.companion`). */\nconst COMPANION_RUNTIME = 'companion';\n\n/** The companion's folder under `.wildo-saas/`, which names its supervisor signal file. */\nconst COMPANION_SIGNAL_FOLDER = 'wildo-dev-companion';\n\n/** Is the pid alive (EPERM means alive and someone else's)? */\nfunction isProcessAlive(pid: unknown): boolean {\n if (typeof pid !== 'number' || !Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The restart signal of the runtime a LIVE `wildo local dev` supervisor runs under this label, or `null`.\n *\n * Its published observation (`runtime-signals/supervisors/<label>.json`, label = the runtime's folder) must name a\n * producer that is alive, and the file must exist. Which file: the one the record DECLARES (`signalFilePath`) — the\n * monorepo's `runtime-supervisor.mjs` and `wildo-dev-runtime serve` (since #2134, which is what brings a changed key to a\n * created application's backend) each declare theirs. A record declaring `null` honours no request, so nothing is\n * touched: the app-creator companion's supervisor declares `null` (#2149), since that companion loads the key in place. A record with no such field (a writer predating it) falls back to the conventional\n * `runtime-signals/<label>.signal`. A declared path outside the application's runtime-signals home is ignored: the CLI\n * touches only files of that home.\n */\nfunction liveSupervisorSignalFile(saasRoot: string, folder: string): string | null {\n const signalDir = join(saasRoot, '.wildo-saas', 'runtime-signals');\n let observation: { producerPid?: unknown; signalFilePath?: unknown };\n try {\n observation = JSON.parse(readFileSync(join(signalDir, 'supervisors', `${folder}.json`), 'utf8')) as typeof observation;\n } catch {\n return null;\n }\n if (!isProcessAlive(observation.producerPid)) return null;\n if (observation.signalFilePath === null) return null;\n if (typeof observation.signalFilePath !== 'string' || observation.signalFilePath.length === 0) {\n const conventional = join(signalDir, `${folder}.signal`);\n return existsSync(conventional) ? conventional : null;\n }\n const declared = resolve(saasRoot, observation.signalFilePath);\n // Compared as REAL paths, so a symlinked application root and a symlink inside the home pointing out are both judged by\n // where the file really is. A file that vanishes while it is read is no signal: the change is already written, and\n // must not be reported as failed.\n let within: string;\n try {\n within = relative(realpathSync(signalDir), realpathSync(declared));\n } catch {\n return null;\n }\n if (within.length === 0 || within.startsWith('..') || isAbsolute(within)) return null;\n return declared;\n}\n\n/**\n * The signal file whose touch restarts a supervised runtime, per scope path (`backend`, `companion`,\n * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its\n * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.\n */\nasync function runtimeSignalFiles(saasRoot: string, runtimes: readonly string[]): Promise<Map<string, string>> {\n const config = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS)) as {\n services?: Record<string, { path?: string; frontendType?: unknown }>;\n minions?: Record<string, { path?: string }>;\n workers?: Record<string, { path?: string }>;\n };\n const byFolder = new Map<string, string>();\n const add = (folder: string | undefined): void => {\n if (!folder) return;\n const name = basename(folder);\n const file = liveSupervisorSignalFile(saasRoot, name);\n if (file !== null) byFolder.set(name, file);\n };\n for (const runtime of runtimes) {\n if (runtime === COMPANION_RUNTIME) add(COMPANION_SIGNAL_FOLDER);\n else if (runtime === 'backend') {\n for (const service of Object.values(config.services ?? {})) if (service.frontendType === undefined) add(service.path);\n } else {\n const [family, key] = runtime.split('.') as [string, string];\n const source = family === 'minions' ? config.minions : family === 'workers' ? config.workers : config.services;\n add(source?.[key]?.path);\n }\n }\n return byFolder;\n}\n\n/**\n * Run this CLI's own `config sync --domain <domain>` for one environment, as one child run. A failure is\n * REPORTED, never swallowed: the value is already in `secrets.json`, and without the regeneration nothing\n * can read it, which the person must be told along with what to run.\n */\nexport function runConfigSyncDomain(\n saasRoot: string,\n envName: string,\n domain: 'env-files' | 'manifest',\n): { readonly regenerated: boolean; readonly failure: string | null } {\n /*\n * `--force` is required, not a convenience. Without it a non-interactive `config sync` finds the\n * existing files, prints \"Skipping env-files regeneration in non-interactive mode\" and EXITS 0 — so\n * every local change reported `envFilesRegenerated: true` and restarted its runtimes on the OLD `.env`\n * (measured 2026-09-26: a key set from the workbench reached `secrets.json` and no `.env`). The prompt\n * that skip replaces asks \"overwrite the existing env files?\", and changing a secret is a request to\n * do exactly that. `--force` skips confirmations only; secret rotation needs `--rotate-secrets`.\n */\n const args = ['config', 'sync', '--domain', domain, '--env', envName, '--non-interactive', '--force'];\n const result = spawnSync(process.execPath, [process.argv[1]!, ...args], { cwd: saasRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });\n if (result.status === 0) return { regenerated: true, failure: null };\n const lastLine = `${result.stderr ?? ''}\\n${result.stdout ?? ''}`\n .split('\\n')\n .map((line) => line.replace(/\\u001b\\[[0-9;]*m/g, '').trim())\n .filter((line) => line.length > 0)\n .at(-1);\n const what = domain === 'env-files' ? \"the runtimes' .env files were\" : 'the deployment manifests were';\n return {\n regenerated: false,\n failure: `The value is saved, but ${what} not regenerated${lastLine ? ` (${lastLine})` : ''}. Run \\`wildo ${args.join(' ')}\\`, then restart what reads it.`,\n };\n}\n\n/** Regenerate the local runtimes' `.env` files — what every application runtime reads. */\nexport function regenerateEnvFiles(saasRoot: string, envName: string): { readonly regenerated: boolean; readonly failure: string | null } {\n return runConfigSyncDomain(saasRoot, envName, 'env-files');\n}\n\n/** The companion route that loads named variables of its regenerated `.env` into the running process. */\nexport const COMPANION_RUNTIME_ENV_APPLY_PATH = '/api/companion/runtime/env/apply';\n\n/** Long enough for a registry refresh on a loaded machine; short enough that a hung companion does not hold `set`. */\nconst COMPANION_ENV_APPLY_TIMEOUT_MS = 20_000;\n\n/** What asking the running companion to load a changed variable came to. */\ntype CompanionLoadResult =\n | { readonly kind: 'loaded' }\n | { readonly kind: 'not-running' }\n | { readonly kind: 'failed'; readonly failure: string };\n\n/**\n * Ask the RUNNING companion to load one changed variable from the `.env` just regenerated (#1637).\n *\n * The answer to a key that \"is set\" and still refused: the companion reads its `.env` once, at boot, and in\n * a created application nothing supervises it (it runs as plain `node --env-file-if-exists=.env` under\n * `pnpm -r run dev`), so there is no signal file to touch and no restart to ask for. Loading in place works\n * whether or not a supervisor exists, and it spares every run in flight, which a restart would end.\n *\n * Only the NAME is sent; the companion reads the value from its own `.env`.\n *\n * Unreachable (refused connection, no token because it never booted) is `not-running`: it then reads the key\n * at its next start, which is what would happen anyway. Anything else is `failed`, including a 404 from a\n * companion older than this route and a timeout.\n */\nasync function loadInRunningCompanion(saasRoot: string, envVarName: string): Promise<CompanionLoadResult> {\n const addresses = await loadAppLocalRuntimeServiceAddresses(saasRoot).catch(() => null);\n const options = {\n appRoot: saasRoot,\n baseUrl: addresses?.devCompanion?.url,\n port: addresses?.devCompanion?.port,\n timeoutMs: COMPANION_ENV_APPLY_TIMEOUT_MS,\n };\n try {\n await CompanionClient.post(COMPANION_RUNTIME_ENV_APPLY_PATH, { envVarNames: [envVarName] }, options);\n return { kind: 'loaded' };\n } catch (error) {\n /*\n * \"Not running\" is exactly what the client already calls UNREACHABLE — a refused or reset connection, or\n * no token because the companion never booted — so the one classifier decides both. Anything else (a\n * timeout, a hung companion, an unreadable token) is a companion that may hold the old value: a failure.\n */\n if (companionFailureExitCode(error) === COMPANION_UNREACHABLE_EXIT_CODE) return { kind: 'not-running' };\n const restart = `restart \\`wildo local dev\\` so it reads the new value.`;\n if (error instanceof CompanionRefusalError && error.status === 404) {\n return { kind: 'failed', failure: `The running companion is older than this CLI and cannot load ${envVarName} in place; ${restart}` };\n }\n return { kind: 'failed', failure: `The running companion could not load ${envVarName} (${ErrorUtils.extractErrorMessage(error)}); ${restart}` };\n }\n}\n\n/**\n * Regenerate the `.env` files and bring the change to the runtimes that receive the key. ALWAYS regenerated,\n * an UNUSED key included: unconsumed is not undelivered (the companion's `.env` carries every provider key),\n * and a removal that skipped this left the value on disk and in the running process (#1637 review, H1).\n *\n * The companion is asked to LOAD the key in place first; only when it is not running, or could not, is it\n * signalled to restart like the other runtimes. Every other runtime is restarted through its supervisor's\n * signal file.\n */\nasync function applyLocalChange(saasRoot: string, envName: string, row: SecretRequirement, options: SecretChangeOptions): Promise<Omit<SecretChangeOutcome, 'environmentAfterChange'>> {\n const restartCompanion = options.restartCompanion !== false;\n const readsKey = row.runtimes.includes(COMPANION_RUNTIME);\n const companionAppliesChange = !restartCompanion && readsKey;\n const identity = { envVarName: row.envVarName, kind: row.kind, envName };\n const regeneration = regenerateEnvFiles(saasRoot, envName);\n const signalled: string[] = [];\n let companionLoad: CompanionLoadResult | null = null;\n if (regeneration.regenerated) {\n if (restartCompanion && readsKey) companionLoad = await loadInRunningCompanion(saasRoot, row.envVarName);\n const companionHandled = !restartCompanion || companionLoad?.kind === 'loaded';\n const now = new Date();\n const runtimes = row.runtimes.filter((runtime) => !companionHandled || runtime !== COMPANION_RUNTIME);\n for (const [folder, file] of await runtimeSignalFiles(saasRoot, runtimes)) {\n utimesSync(file, now, now);\n signalled.push(folder);\n }\n }\n return {\n ...identity,\n restartSignalledRuntimes: signalled,\n envFilesRegenerated: regeneration.regenerated,\n envFilesRegenerationFailure: regeneration.failure,\n companionAppliesChange,\n companionLoadedInProcess: companionLoad?.kind === 'loaded',\n // A supervised companion restarted instead has received the change, so the failure is not worth saying.\n companionLoadFailure: companionLoad?.kind === 'failed' && !signalled.includes(COMPANION_SIGNAL_FOLDER) ? companionLoad.failure : null,\n };\n}\n\nconst REMOTE_OUTCOME = {\n restartSignalledRuntimes: [],\n envFilesRegenerated: false,\n envFilesRegenerationFailure: null,\n companionAppliesChange: false,\n companionLoadedInProcess: false,\n companionLoadFailure: null,\n} as const;\n\n/**\n * Set one secret in one environment, in the section its kind names. The value is validated, never logged.\n *\n * A key holding a PEM (`…PRIVATE_KEY`, `…CERTIFICATE`, a system of record's `certificatePem`) pasted on one\n * line with literal `\\n` is turned into real line breaks locally, exactly as the CI adapter does when it reads\n * the same secret remotely (`normalizePotentialMultilineSecret`), so both lanes hand a runtime the same\n * bytes. A remote value is stored as given, because that adapter normalizes it on the way out.\n *\n * An UNUSED key is refused: nothing consumes it, so a new value would change nothing a runtime does.\n */\nexport async function setApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n value: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (row.standing === ApplicationSecretStanding.UNUSED) {\n throw new Error(`Nothing consumes ${envVarName}, so setting it would change nothing. Remove it with \\`wildo secrets unset ${envVarName}\\`.`);\n }\n const problem = describeSecretValueProblem(envVarName, value, true);\n if (problem) throw new Error(problem);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { set: { [envVarName]: normalizePotentialMultilineSecret(envVarName, value.trim()) } });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n const gap = describeDeployWorkflowGap(envName, row.kind, envVarName, saasRoot);\n if (gap) throw new Error(gap);\n setRemoteApplicationSecret(envName, row.kind, envVarName, value.trim(), saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n\n/** Remove one secret from one environment — including an UNUSED one, which is what that standing is for. */\nexport async function unsetApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { unset: [envVarName] });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n unsetRemoteApplicationSecret(envName, row.kind, envVarName, saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n"]}
1
+ {"version":3,"file":"application-secrets.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAqC,MAAM,gCAAgC,CAAC;AACrI,OAAO,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE5G,OAAO,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAChJ,OAAO,EAAE,0BAA0B,EAAE,MAAM,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mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;AAClJ,CAAC;AAED,4GAA4G;AAC5G,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,QAAgB,EAChB,OAAe,EACf,UAAkB,EAClB,UAA+B,EAAE;IAEjC,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3E,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QACpD,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC1E,OAAO,EAAE,GAAG,CAAC,MAAM,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACxJ,CAAC;IACD,4BAA4B,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;AAClJ,CAAC","sourcesContent":["/**\n * An application's secrets per environment — provider secrets, system-of-record credentials and inbound\n * endpoint secrets (`ApplicationSecretKind`) — what it needs, what is set, and how to change one, for\n * `wildo secrets` and, through it, the workbench's secrets section (#1637).\n *\n * Local environments keep values in `infrastructure/<env>/secrets/secrets.json`, one section per kind; a\n * change is written there, the runtimes' `.env` files are regenerated, and only the runtimes that read the\n * key are restarted. Remote environments keep them as GitHub Actions secrets, written through the operator's\n * own `gh` login (`remote-secrets-store.service.ts`).\n *\n * A value never leaves this module except to the store that holds it: every report carries names and\n * standings, never a value, so a listing can be printed, logged or shown in a browser.\n */\nimport { spawnSync } from 'child_process';\nimport { existsSync, readFileSync, realpathSync, utimesSync } from 'fs';\nimport { basename, isAbsolute, join, relative, resolve } from 'path';\n\nimport { loadSaasConfig, WildoLocationType, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\nimport { ApplicationSecretKind, ApplicationSecretStanding, type ApplicationSecretRemoteLevel } from '@wildo-ai/platform-core-shared';\nimport { parseInboundEndpointSecretEnvVarName, parseSystemOfRecordEnvVarName } from '@wildo-ai/saas-models';\n\nimport { readLocalApplicationSecretPresence, updateLocalApplicationSecrets } from '~wildo-cli/services/credentials/local-secrets-store.service';\nimport { describeSecretValueProblem } from '~wildo-cli/services/credentials/provider-secret-format';\nimport { normalizePotentialMultilineSecret } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport {\n describeDeployWorkflowGap,\n listRemoteApplicationSecrets,\n setRemoteApplicationSecret,\n unsetRemoteApplicationSecret,\n} from '~wildo-cli/services/credentials/remote-secrets-store.service';\nimport {\n loadSecretRequirementInputs,\n loadSecretRequirements,\n SystemOfRecordEnvironmentPresence,\n systemOfRecordPresenceOf,\n type SecretRequirement,\n type SecretRequirementInputs,\n type StoredApplicationSecrets,\n} from '~wildo-cli/services/credentials/secret-requirements.service';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport {\n COMPANION_UNREACHABLE_EXIT_CODE,\n CompanionClient,\n CompanionRefusalError,\n companionFailureExitCode,\n} from '~wildo-cli/services/companion/companion-client.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\nexport interface EnvironmentSecretsReport {\n readonly envName: string;\n readonly locationType: WildoLocationType;\n readonly requirements: readonly (SecretRequirement & { readonly remoteLevel?: ApplicationSecretRemoteLevel })[];\n /**\n * What this listing could not derive, each saying why — a backend not built (its inbound endpoints are then\n * unknown), a vendor facet that could not be read. Empty when the listing is whole.\n */\n readonly incomplete: readonly string[];\n}\n\n/** An environment's location, refused when the environment is not registered. */\nexport function resolveEnvironmentLocation(envName: string): WildoLocationType {\n const environment = EnvironmentUtils.get(envName);\n if (!environment) {\n throw new Error(`No environment '${envName}'. Registered: ${EnvironmentUtils.listNames().join(', ') || 'none'}.`);\n }\n return environment.locationType;\n}\n\nconst APPLICATION_SECRET_KINDS = Object.values(ApplicationSecretKind);\n\n/**\n * A LOCAL environment's `secrets.json`, per kind: the names with a value (`stored`), and every name the section\n * holds, an empty value included (`present`). A key stored as `\"\"` is not set, but it is still there to remove.\n */\nfunction readLocalStoredSecrets(envName: string): { readonly stored: StoredApplicationSecrets; readonly present: StoredApplicationSecrets } {\n // Names only: the report says what is set, so no value is read into it.\n const sections = APPLICATION_SECRET_KINDS.map((kind) => [kind, readLocalApplicationSecretPresence(envName, kind)] as const);\n return {\n stored: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.stored)])) as unknown as StoredApplicationSecrets,\n present: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.present)])) as unknown as StoredApplicationSecrets,\n };\n}\n\n/**\n * How the environment addresses each system of record, from its GENERATED config — the file the env builder\n * reads to decide what reaches the backend — or `null` when it cannot be read.\n */\nfunction readSystemOfRecordPresence(envName: string): Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null {\n let config: PlatformEnvConfigJson | null;\n try {\n config = EnvironmentUtils.loadConfigJson(envName);\n } catch {\n return null;\n }\n if (!config) return null;\n return systemOfRecordPresenceOf(config.systemsOfRecord);\n}\n\n/** One secret's identity across kinds: a name is unique per `secrets.json` section, not across them. */\nconst secretKey = (kind: ApplicationSecretKind, envVarName: string): string => `${kind}:${envVarName}`;\n\n/**\n * What the application needs in one environment, and what is set there. Pass `inputs` when describing\n * several environments, so the application is loaded once (`loadSecretRequirementInputs` with its owners).\n */\nexport async function describeEnvironmentSecrets(saasRoot: string, envName: string, inputs?: SecretRequirementInputs): Promise<EnvironmentSecretsReport> {\n const locationType = resolveEnvironmentLocation(envName);\n const loaded = inputs ?? await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const incomplete = loaded.owners?.incomplete ?? [];\n const systemOfRecordPresence = readSystemOfRecordPresence(envName);\n if (locationType === WildoLocationType.LOCAL) {\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, ...readLocalStoredSecrets(envName), systemOfRecordPresence });\n return { envName, locationType, requirements, incomplete };\n }\n const remote = new Map(listRemoteApplicationSecrets(envName, saasRoot).map((secret) => [secretKey(secret.kind, secret.envVarName), secret]));\n const stored = Object.fromEntries(APPLICATION_SECRET_KINDS.map((kind) => [\n kind,\n new Set([...remote.values()].filter((secret) => secret.kind === kind).map((secret) => secret.envVarName)),\n ])) as unknown as StoredApplicationSecrets;\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, stored, systemOfRecordPresence });\n return {\n envName,\n locationType,\n requirements: requirements.map((row) => {\n const held = remote.get(secretKey(row.kind, row.envVarName));\n return held ? { ...row, remoteLevel: held.level } : row;\n }),\n incomplete,\n };\n}\n\n/**\n * The requirement a name refers to, refused when nothing the application declares reads it — a key no\n * runtime would receive is a typo or a stale name.\n *\n * A NAME is not an identity: each kind is its own `secrets.json` section, and a migration can leave one key in\n * two (an Odoo credential still in `providerEnv` beside its `systemsOfRecordEnv` copy). So `kind` narrows the\n * match, and a name matching in two kinds without one is refused, naming both, rather than resolved to\n * whichever sorted first — which set or removed the other copy than the one the person meant.\n *\n * One exception, for a name whose OWNER exists but could not be enumerated: an inbound endpoint secret when\n * the backend's endpoints could not be read (it is not built), and a system-of-record slot when its vendor's\n * facet could not be. A well-formed name for such an owner is admitted, because refusing it would make the\n * secret impossible to provide until something unrelated is fixed — the env builder delivers any well-formed\n * name, and the backend is where an endpoint without its secret is reported.\n */\nfunction requirementFor(report: EnvironmentSecretsReport, inputs: SecretRequirementInputs, envVarName: string, kind?: ApplicationSecretKind): SecretRequirement {\n const matches = report.requirements\n .filter((candidate) => candidate.envVarName === envVarName && (kind === undefined || candidate.kind === kind))\n .sort((left, right) => left.kind.localeCompare(right.kind));\n if (matches.length > 1) {\n throw new Error(`${envVarName} is in more than one section of this environment's secrets (${matches.map((row) => `${row.kind}: ${row.standing}`).join(', ')}). `\n + `Name the one you mean with --kind ${matches.map((row) => row.kind).join(' | ')}.`);\n }\n if (matches[0]) return matches[0];\n const owners = inputs.owners;\n const endpoint = kind === undefined || kind === ApplicationSecretKind.INBOUND_ENDPOINT ? parseInboundEndpointSecretEnvVarName(envVarName) : null;\n if (endpoint && owners?.inboundEndpointKeys === null) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.INBOUND_ENDPOINT, endpoint.endpointKey);\n }\n const slot = kind === undefined || kind === ApplicationSecretKind.SYSTEM_OF_RECORD ? parseSystemOfRecordEnvVarName(envVarName) : null;\n if (slot && owners?.systemsOfRecord.some((system) => system.name === slot.instanceName && system.secretSlots === null)) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.SYSTEM_OF_RECORD, slot.instanceName);\n }\n const known = [...new Set(report.requirements.filter((candidate) => kind === undefined || candidate.kind === kind).map((candidate) => candidate.envVarName))];\n throw new Error(`Nothing this application declares reads ${envVarName}${kind === undefined ? '' : ` as a ${kind} secret`}. Known here: ${known.join(', ') || 'none'}.`);\n}\n\nfunction unenumeratedOwnerRow(envVarName: string, kind: ApplicationSecretKind, ownerRef: string): SecretRequirement {\n return {\n envVarName, kind, ownerRef, description: null, required: true, capabilities: [], runtimes: ['backend'],\n standing: ApplicationSecretStanding.NEEDED, creationEssential: false,\n };\n}\n\nexport interface SecretChangeOutcome {\n readonly envVarName: string;\n /** Which `secrets.json` section (or, remotely, which GitHub secret prefix) the change was made in. */\n readonly kind: ApplicationSecretKind;\n readonly envName: string;\n /**\n * Local only: the runtimes asked to restart to read the change — those that read the key AND run under\n * a LIVE supervisor of `wildo local dev`. A signal file outlives the stack, so its existence alone is\n * not a restart; a runtime nobody supervises reads the key at its next start.\n */\n readonly restartSignalledRuntimes: readonly string[];\n /** Local only: whether the runtimes' `.env` files were regenerated. */\n readonly envFilesRegenerated: boolean;\n /** Local only: why the `.env` files could not be regenerated, with what to run; `null` otherwise. */\n readonly envFilesRegenerationFailure: string | null;\n /**\n * Local only: the companion reads this key and was NOT asked to restart, because the caller said it\n * applies the change itself (`--no-companion-restart`). The workbench does, in-process: restarting\n * the companion from inside a request would end the process serving it and any run in flight.\n */\n readonly companionAppliesChange: boolean;\n /**\n * Local only: the RUNNING companion loaded the change in place, through `POST /api/companion/runtime/env/apply`,\n * so it was not restarted and no run in flight was ended. False when it reads no such key, is not running,\n * or the caller applies the change itself.\n */\n readonly companionLoadedInProcess: boolean;\n /**\n * Local only: the companion is running and reads this key, but could not be made to load it — with what to\n * do. `null` when nothing failed. Distinct from the workbench's `companionApplyFailure`, which the COMPANION\n * sets about its own in-process apply.\n */\n readonly companionLoadFailure: string | null;\n /**\n * The environment's rows AFTER the change, re-derived from the same application inputs the change was\n * checked against (#1782). One change can move OTHER rows too: setting one LLM provider's key can make a\n * competing provider's key no longer needed. A caller holding a listing replaces that environment's rows\n * with these instead of re-listing, which re-loads the application and takes tens of seconds.\n *\n * `null` when they could not be read after the change was MADE — for a remote environment that is one\n * more `gh` listing, which a network error, a rate limit or an expired token can fail. The change itself\n * stands, and a caller holding a listing drops it instead of patching it.\n */\n readonly environmentAfterChange: EnvironmentSecretsReport | null;\n}\n\n/**\n * The environment's rows after a change that has ALREADY been written. A failure here must never turn the\n * completed change into a reported failure: the person would be told \"not changed\" about a secret that was.\n */\nasync function describeAfterChange(saasRoot: string, envName: string, inputs: SecretRequirementInputs): Promise<EnvironmentSecretsReport | null> {\n try {\n return await describeEnvironmentSecrets(saasRoot, envName, inputs);\n } catch {\n return null;\n }\n}\n\n/** Options every change takes. */\nexport interface SecretChangeOptions {\n /** Which `secrets.json` section the name is in — needed only when it is in more than one (see `requirementFor`). */\n readonly kind?: ApplicationSecretKind;\n /**\n * Whether a change the companion reads restarts it (default). The workbench passes `false` and applies\n * the change in-process — see {@link SecretChangeOutcome.companionAppliesChange}.\n */\n readonly restartCompanion?: boolean;\n}\n\n/** The scope path the dev companion is read under (`providers.scopes.companion`). */\nconst COMPANION_RUNTIME = 'companion';\n\n/** The companion's folder under `.wildo-saas/`, which names its supervisor signal file. */\nconst COMPANION_SIGNAL_FOLDER = 'wildo-dev-companion';\n\n/** Is the pid alive (EPERM means alive and someone else's)? */\nfunction isProcessAlive(pid: unknown): boolean {\n if (typeof pid !== 'number' || !Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The restart signal of the runtime a LIVE `wildo local dev` supervisor runs under this label, or `null`.\n *\n * Its published observation (`runtime-signals/supervisors/<label>.json`, label = the runtime's folder) must name a\n * producer that is alive, and the file must exist. Which file: the one the record DECLARES (`signalFilePath`) — the\n * monorepo's `runtime-supervisor.mjs` and `wildo-dev-runtime serve` (since #2134, which is what brings a changed key to a\n * created application's backend) each declare theirs. A record declaring `null` honours no request, so nothing is\n * touched: the app-creator companion's supervisor declares `null` (#2149), since that companion loads the key in place. A record with no such field (a writer predating it) falls back to the conventional\n * `runtime-signals/<label>.signal`. A declared path outside the application's runtime-signals home is ignored: the CLI\n * touches only files of that home.\n */\nfunction liveSupervisorSignalFile(saasRoot: string, folder: string): string | null {\n const signalDir = join(saasRoot, '.wildo-saas', 'runtime-signals');\n let observation: { producerPid?: unknown; signalFilePath?: unknown };\n try {\n observation = JSON.parse(readFileSync(join(signalDir, 'supervisors', `${folder}.json`), 'utf8')) as typeof observation;\n } catch {\n return null;\n }\n if (!isProcessAlive(observation.producerPid)) return null;\n if (observation.signalFilePath === null) return null;\n if (typeof observation.signalFilePath !== 'string' || observation.signalFilePath.length === 0) {\n const conventional = join(signalDir, `${folder}.signal`);\n return existsSync(conventional) ? conventional : null;\n }\n const declared = resolve(saasRoot, observation.signalFilePath);\n // Compared as REAL paths, so a symlinked application root and a symlink inside the home pointing out are both judged by\n // where the file really is. A file that vanishes while it is read is no signal: the change is already written, and\n // must not be reported as failed.\n let within: string;\n try {\n within = relative(realpathSync(signalDir), realpathSync(declared));\n } catch {\n return null;\n }\n if (within.length === 0 || within.startsWith('..') || isAbsolute(within)) return null;\n return declared;\n}\n\n/**\n * The signal file whose touch restarts a supervised runtime, per scope path (`backend`, `companion`,\n * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its\n * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.\n */\nexport async function runtimeSignalFiles(saasRoot: string, runtimes: readonly string[]): Promise<Map<string, string>> {\n const config = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS)) as {\n services?: Record<string, { path?: string; frontendType?: unknown }>;\n minions?: Record<string, { path?: string }>;\n workers?: Record<string, { path?: string }>;\n };\n const byFolder = new Map<string, string>();\n const add = (folder: string | undefined): void => {\n if (!folder) return;\n const name = basename(folder);\n const file = liveSupervisorSignalFile(saasRoot, name);\n if (file !== null) byFolder.set(name, file);\n };\n for (const runtime of runtimes) {\n if (runtime === COMPANION_RUNTIME) add(COMPANION_SIGNAL_FOLDER);\n else if (runtime === 'backend') {\n for (const service of Object.values(config.services ?? {})) if (service.frontendType === undefined) add(service.path);\n } else {\n const [family, key] = runtime.split('.') as [string, string];\n const source = family === 'minions' ? config.minions : family === 'workers' ? config.workers : config.services;\n add(source?.[key]?.path);\n }\n }\n return byFolder;\n}\n\n/**\n * Run this CLI's own `config sync --domain <domain>` for one environment, as one child run. A failure is\n * REPORTED, never swallowed: the value is already in `secrets.json`, and without the regeneration nothing\n * can read it, which the person must be told along with what to run.\n */\nexport function runConfigSyncDomain(\n saasRoot: string,\n envName: string,\n domain: 'env-files' | 'manifest',\n): { readonly regenerated: boolean; readonly failure: string | null } {\n /*\n * `--force` is required, not a convenience. Without it a non-interactive `config sync` finds the\n * existing files, prints \"Skipping env-files regeneration in non-interactive mode\" and EXITS 0 — so\n * every local change reported `envFilesRegenerated: true` and restarted its runtimes on the OLD `.env`\n * (measured 2026-09-26: a key set from the workbench reached `secrets.json` and no `.env`). The prompt\n * that skip replaces asks \"overwrite the existing env files?\", and changing a secret is a request to\n * do exactly that. `--force` skips confirmations only; secret rotation needs `--rotate-secrets`.\n */\n const args = ['config', 'sync', '--domain', domain, '--env', envName, '--non-interactive', '--force'];\n const result = spawnSync(process.execPath, [process.argv[1]!, ...args], { cwd: saasRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });\n if (result.status === 0) return { regenerated: true, failure: null };\n const lastLine = `${result.stderr ?? ''}\\n${result.stdout ?? ''}`\n .split('\\n')\n .map((line) => line.replace(/\\u001b\\[[0-9;]*m/g, '').trim())\n .filter((line) => line.length > 0)\n .at(-1);\n const what = domain === 'env-files' ? \"the runtimes' .env files were\" : 'the deployment manifests were';\n return {\n regenerated: false,\n failure: `The value is saved, but ${what} not regenerated${lastLine ? ` (${lastLine})` : ''}. Run \\`wildo ${args.join(' ')}\\`, then restart what reads it.`,\n };\n}\n\n/** Regenerate the local runtimes' `.env` files — what every application runtime reads. */\nexport function regenerateEnvFiles(saasRoot: string, envName: string): { readonly regenerated: boolean; readonly failure: string | null } {\n return runConfigSyncDomain(saasRoot, envName, 'env-files');\n}\n\n/** The companion route that loads named variables of its regenerated `.env` into the running process. */\nexport const COMPANION_RUNTIME_ENV_APPLY_PATH = '/api/companion/runtime/env/apply';\n\n/** Long enough for a registry refresh on a loaded machine; short enough that a hung companion does not hold `set`. */\nconst COMPANION_ENV_APPLY_TIMEOUT_MS = 20_000;\n\n/** What asking the running companion to load a changed variable came to. */\ntype CompanionLoadResult =\n | { readonly kind: 'loaded' }\n | { readonly kind: 'not-running' }\n | { readonly kind: 'failed'; readonly failure: string };\n\n/**\n * Ask the RUNNING companion to load one changed variable from the `.env` just regenerated (#1637).\n *\n * The answer to a key that \"is set\" and still refused: the companion reads its `.env` once, at boot, and in\n * a created application nothing supervises it (it runs as plain `node --env-file-if-exists=.env` under\n * `pnpm -r run dev`), so there is no signal file to touch and no restart to ask for. Loading in place works\n * whether or not a supervisor exists, and it spares every run in flight, which a restart would end.\n *\n * Only the NAME is sent; the companion reads the value from its own `.env`.\n *\n * Unreachable (refused connection, no token because it never booted) is `not-running`: it then reads the key\n * at its next start, which is what would happen anyway. Anything else is `failed`, including a 404 from a\n * companion older than this route and a timeout.\n */\nasync function loadInRunningCompanion(saasRoot: string, envVarName: string): Promise<CompanionLoadResult> {\n const addresses = await loadAppLocalRuntimeServiceAddresses(saasRoot).catch(() => null);\n const options = {\n appRoot: saasRoot,\n baseUrl: addresses?.devCompanion?.url,\n port: addresses?.devCompanion?.port,\n timeoutMs: COMPANION_ENV_APPLY_TIMEOUT_MS,\n };\n try {\n await CompanionClient.post(COMPANION_RUNTIME_ENV_APPLY_PATH, { envVarNames: [envVarName] }, options);\n return { kind: 'loaded' };\n } catch (error) {\n /*\n * \"Not running\" is exactly what the client already calls UNREACHABLE — a refused or reset connection, or\n * no token because the companion never booted — so the one classifier decides both. Anything else (a\n * timeout, a hung companion, an unreadable token) is a companion that may hold the old value: a failure.\n */\n if (companionFailureExitCode(error) === COMPANION_UNREACHABLE_EXIT_CODE) return { kind: 'not-running' };\n const restart = `restart \\`wildo local dev\\` so it reads the new value.`;\n if (error instanceof CompanionRefusalError && error.status === 404) {\n return { kind: 'failed', failure: `The running companion is older than this CLI and cannot load ${envVarName} in place; ${restart}` };\n }\n return { kind: 'failed', failure: `The running companion could not load ${envVarName} (${ErrorUtils.extractErrorMessage(error)}); ${restart}` };\n }\n}\n\n/**\n * Regenerate the `.env` files and bring the change to the runtimes that receive the key. ALWAYS regenerated,\n * an UNUSED key included: unconsumed is not undelivered (the companion's `.env` carries every provider key),\n * and a removal that skipped this left the value on disk and in the running process (#1637 review, H1).\n *\n * The companion is asked to LOAD the key in place first; only when it is not running, or could not, is it\n * signalled to restart like the other runtimes. Every other runtime is restarted through its supervisor's\n * signal file.\n */\nasync function applyLocalChange(saasRoot: string, envName: string, row: SecretRequirement, options: SecretChangeOptions): Promise<Omit<SecretChangeOutcome, 'environmentAfterChange'>> {\n const restartCompanion = options.restartCompanion !== false;\n const readsKey = row.runtimes.includes(COMPANION_RUNTIME);\n const companionAppliesChange = !restartCompanion && readsKey;\n const identity = { envVarName: row.envVarName, kind: row.kind, envName };\n const regeneration = regenerateEnvFiles(saasRoot, envName);\n const signalled: string[] = [];\n let companionLoad: CompanionLoadResult | null = null;\n if (regeneration.regenerated) {\n if (restartCompanion && readsKey) companionLoad = await loadInRunningCompanion(saasRoot, row.envVarName);\n const companionHandled = !restartCompanion || companionLoad?.kind === 'loaded';\n const now = new Date();\n const runtimes = row.runtimes.filter((runtime) => !companionHandled || runtime !== COMPANION_RUNTIME);\n for (const [folder, file] of await runtimeSignalFiles(saasRoot, runtimes)) {\n utimesSync(file, now, now);\n signalled.push(folder);\n }\n }\n return {\n ...identity,\n restartSignalledRuntimes: signalled,\n envFilesRegenerated: regeneration.regenerated,\n envFilesRegenerationFailure: regeneration.failure,\n companionAppliesChange,\n companionLoadedInProcess: companionLoad?.kind === 'loaded',\n // A supervised companion restarted instead has received the change, so the failure is not worth saying.\n companionLoadFailure: companionLoad?.kind === 'failed' && !signalled.includes(COMPANION_SIGNAL_FOLDER) ? companionLoad.failure : null,\n };\n}\n\nconst REMOTE_OUTCOME = {\n restartSignalledRuntimes: [],\n envFilesRegenerated: false,\n envFilesRegenerationFailure: null,\n companionAppliesChange: false,\n companionLoadedInProcess: false,\n companionLoadFailure: null,\n} as const;\n\n/**\n * Set one secret in one environment, in the section its kind names. The value is validated, never logged.\n *\n * A key holding a PEM (`…PRIVATE_KEY`, `…CERTIFICATE`, a system of record's `certificatePem`) pasted on one\n * line with literal `\\n` is turned into real line breaks locally, exactly as the CI adapter does when it reads\n * the same secret remotely (`normalizePotentialMultilineSecret`), so both lanes hand a runtime the same\n * bytes. A remote value is stored as given, because that adapter normalizes it on the way out.\n *\n * An UNUSED key is refused: nothing consumes it, so a new value would change nothing a runtime does.\n */\nexport async function setApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n value: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (row.standing === ApplicationSecretStanding.UNUSED) {\n throw new Error(`Nothing consumes ${envVarName}, so setting it would change nothing. Remove it with \\`wildo secrets unset ${envVarName}\\`.`);\n }\n const problem = describeSecretValueProblem(envVarName, value, true);\n if (problem) throw new Error(problem);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { set: { [envVarName]: normalizePotentialMultilineSecret(envVarName, value.trim()) } });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n const gap = describeDeployWorkflowGap(envName, row.kind, envVarName, saasRoot);\n if (gap) throw new Error(gap);\n setRemoteApplicationSecret(envName, row.kind, envVarName, value.trim(), saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n\n/** Remove one secret from one environment — including an UNUSED one, which is what that standing is for. */\nexport async function unsetApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { unset: [envVarName] });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n unsetRemoteApplicationSecret(envName, row.kind, envVarName, saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"composed-provider-catalogue.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/composed-provider-catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/F,+FAA+F;AAC/F,MAAM,WAAW,uBAAuB;IACtC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB;AAED;;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;;;;GAKG;AACH,wBAAgB,oCAAoC,IAAI,IAAI,CAI3D;AAoED;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAexG;AAED,4FAA4F;AAC5F,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,6BAA6B,GAAG,SAAS,CAEvG;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAUjE;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAc,YAAW,WAAW,CAAC,MAAM,CAAC;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC;IAE/D,IAAI,IAAI,IAAI,MAAM,CAAgC;IAClD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IACzB,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAM7G,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnD,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;CAC7E"}
1
+ {"version":3,"file":"composed-provider-catalogue.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/composed-provider-catalogue.ts"],"names":[],"mappings":"AAAA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,GAAG,EAAE,MAAM,GAAG,OAAO;IACzB,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAM7G,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnD,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;CAC7E"}
@@ -111,10 +111,23 @@ export function registerDiscoveredProviderContributions(contributions) {
111
111
  }
112
112
  continue;
113
113
  }
114
+ // One provider is discovered once per FACET (#2272): PostHog's backend module, then its browser module once per
115
+ // frontend service that declares it. A browser facet owns no server secret (`secretsContractShape: []` by
116
+ // construction), so it may never REPLACE a backend facet's entry: the last-registered facet used to win, which left
117
+ // a provider with a browser facet holding no secret slot at all. Every one of its keys was then dropped from every
118
+ // runtime's environment as "belonging to no provider", and its browser-public key was screened as a secret.
119
+ const registered = discoveredContributions.get(contribution.ref);
120
+ if (registered !== undefined && isFrontendOnlyContribution(contribution) && !isFrontendOnlyContribution(registered))
121
+ continue;
114
122
  discoveredContributions.set(contribution.ref, contribution);
115
123
  }
116
124
  catalogueGeneration += 1;
117
125
  }
126
+ /** Whether every runtime target of a contribution is a frontend service: a browser facet, which declares no secret. */
127
+ function isFrontendOnlyContribution(contribution) {
128
+ const targets = contribution.runtimeTargets ?? [];
129
+ return targets.length > 0 && targets.every((target) => target.kind === 'frontendService');
130
+ }
118
131
  /**
119
132
  * Fields discovery itself writes onto a contribution, so they cannot tell the engine's record from an override: the
120
133
  * runtime targets an application's own `providers.scopes` imply (`resolveScopeImpliedRuntimeTargets` replaces the
@@ -146,8 +159,7 @@ function canonicalContractOf(contribution) {
146
159
  * layer's, and the CLI does not load the frontend provider registries.
147
160
  */
148
161
  export function isEngineOwnContribution(contribution) {
149
- const targets = contribution.runtimeTargets ?? [];
150
- if (targets.length > 0 && targets.every((target) => target.kind === 'frontendService')) {
162
+ if (isFrontendOnlyContribution(contribution)) {
151
163
  return (contribution.secretsContractShape ?? []).length === 0 && contribution.otlpAuth === undefined;
152
164
  }
153
165
  engineOwnBackendContributionsByRef ??= new Map(engineBackendProviderContributions.map((own) => [own.ref, canonicalContractOf(own)]));