@wildo-ai/wildo-cli 1.1.13 → 1.1.14

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 (473) 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/init.command.d.ts +14 -0
  27. package/dist/src/commands/init.command.d.ts.map +1 -1
  28. package/dist/src/commands/init.command.js +29 -3
  29. package/dist/src/commands/init.command.js.map +1 -1
  30. package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
  31. package/dist/src/commands/registry/repair-lockfile.command.js +1 -0
  32. package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
  33. package/dist/src/commands/registry/update.command.d.ts.map +1 -1
  34. package/dist/src/commands/registry/update.command.js +1 -0
  35. package/dist/src/commands/registry/update.command.js.map +1 -1
  36. package/dist/src/commands/seal/verify.command.d.ts +18 -0
  37. package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
  38. package/dist/src/commands/seal/verify.command.js +62 -1
  39. package/dist/src/commands/seal/verify.command.js.map +1 -1
  40. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  41. package/dist/src/services/application/provider-runtime-sync.service.js +26 -1
  42. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  43. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  44. package/dist/src/services/application/saas-skeleton.service.js +24 -2
  45. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  46. package/dist/src/services/companion/build-console.service.d.ts +39 -2
  47. package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
  48. package/dist/src/services/companion/build-console.service.js +54 -4
  49. package/dist/src/services/companion/build-console.service.js.map +1 -1
  50. package/dist/src/services/companion/creation-console.service.d.ts +6 -1
  51. package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
  52. package/dist/src/services/companion/creation-console.service.js +14 -2
  53. package/dist/src/services/companion/creation-console.service.js.map +1 -1
  54. package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
  55. package/dist/src/services/companion/creation-drive.service.js +5 -2
  56. package/dist/src/services/companion/creation-drive.service.js.map +1 -1
  57. package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
  58. package/dist/src/services/credentials/composed-provider-catalogue.js +14 -2
  59. package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
  60. package/dist/src/services/credentials/secret-requirements.service.d.ts +2 -1
  61. package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
  62. package/dist/src/services/credentials/secret-requirements.service.js +17 -1
  63. package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
  64. package/dist/src/services/deployment/application-runtime-environment.d.ts.map +1 -1
  65. package/dist/src/services/deployment/application-runtime-environment.js +3 -13
  66. package/dist/src/services/deployment/application-runtime-environment.js.map +1 -1
  67. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  68. package/dist/src/services/deployment/docker/docker-compose-generator.service.js +8 -2
  69. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  70. package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts +1 -1
  71. package/dist/src/services/deployment/host-toolchain-readiness.service.js +1 -1
  72. package/dist/src/services/deployment/host-toolchain-readiness.service.js.map +1 -1
  73. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
  74. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +3 -1
  75. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
  76. package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
  77. package/dist/src/services/deployment/local-precondition-checks.service.js +4 -2
  78. package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
  79. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  80. package/dist/src/services/environment/env-configuration-generator.service.js +8 -3
  81. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  82. package/dist/src/services/environment/environment-service-profile.utils.d.ts +8 -1
  83. package/dist/src/services/environment/environment-service-profile.utils.d.ts.map +1 -1
  84. package/dist/src/services/environment/environment-service-profile.utils.js +14 -1
  85. package/dist/src/services/environment/environment-service-profile.utils.js.map +1 -1
  86. package/dist/src/services/framework/framework-docker-publish.service.d.ts +89 -0
  87. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  88. package/dist/src/services/framework/framework-docker-publish.service.js +180 -18
  89. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  90. package/dist/src/services/framework/github-actions-annotation.d.ts +19 -0
  91. package/dist/src/services/framework/github-actions-annotation.d.ts.map +1 -0
  92. package/dist/src/services/framework/github-actions-annotation.js +25 -0
  93. package/dist/src/services/framework/github-actions-annotation.js.map +1 -0
  94. package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts +43 -0
  95. package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts.map +1 -0
  96. package/dist/src/services/framework/registry-host/registry-host-upgrade.js +117 -0
  97. package/dist/src/services/framework/registry-host/registry-host-upgrade.js.map +1 -0
  98. package/dist/src/services/framework/registry-host/registry-host.service.d.ts +1 -1
  99. package/dist/src/services/framework/registry-host/registry-host.service.d.ts.map +1 -1
  100. package/dist/src/services/framework/registry-host/registry-host.service.js +2 -0
  101. package/dist/src/services/framework/registry-host/registry-host.service.js.map +1 -1
  102. package/dist/src/services/registry/installed-file-state.utils.d.ts +8 -0
  103. package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
  104. package/dist/src/services/registry/installed-file-state.utils.js +9 -1
  105. package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
  106. package/dist/src/services/registry/module-install.service.d.ts.map +1 -1
  107. package/dist/src/services/registry/module-install.service.js +1 -0
  108. package/dist/src/services/registry/module-install.service.js.map +1 -1
  109. package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
  110. package/dist/src/services/registry/provider-module-scaffold.service.js +4 -0
  111. package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
  112. package/dist/tsconfig.build.tsbuildinfo +1 -1
  113. package/framework-root-package.json +3 -3
  114. package/package.json +22 -22
  115. package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
  116. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +17 -2
  117. package/templates/infra/registry-host/docker-compose.yml +9 -2
  118. package/templates/infra/registry-host/upgrade-image.sh +108 -0
  119. package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_ready/labels.fr.ts +22 -0
  120. package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_received/labels.fr.ts +23 -0
  121. package/templates/saas/i18n/email/resources/dataSubjectRequests/update.users-custom_extended/labels.fr.ts +23 -0
  122. package/templates/saas/i18n/email/resources/organizationSsoConfig/repairUnreadableConfiguration.organization-users/labels.fr.ts +23 -0
  123. package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.ts +28 -0
  124. package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.ts +28 -0
  125. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.en.ts +2 -1
  126. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.fr.ts +2 -1
  127. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.ts +6 -1
  128. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.ts +6 -1
  129. package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.en.ts +40 -0
  130. package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.fr.ts +40 -0
  131. package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.ts +2 -1
  132. package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.ts +2 -1
  133. package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.en.ts +2 -1
  134. package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.fr.ts +2 -1
  135. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.ts +2 -1
  136. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.ts +2 -1
  137. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.en.ts +3 -1
  138. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.fr.ts +3 -1
  139. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.en.ts +2 -1
  140. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.fr.ts +2 -1
  141. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.en.ts +3 -1
  142. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.fr.ts +4 -2
  143. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.en.ts +18 -1
  144. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.fr.ts +18 -1
  145. package/templates/saas/i18n/engine/resources/actorSystemExecutions.en.ts +10 -82
  146. package/templates/saas/i18n/engine/resources/actorSystemExecutions.fr.ts +0 -72
  147. package/templates/saas/i18n/engine/resources/actorTasks.en.ts +0 -33
  148. package/templates/saas/i18n/engine/resources/actorTasks.fr.ts +0 -33
  149. package/templates/saas/i18n/engine/resources/agentBehaviorReports.en.ts +0 -108
  150. package/templates/saas/i18n/engine/resources/agentBehaviorReports.fr.ts +0 -108
  151. package/templates/saas/i18n/engine/resources/agentOperationRecords.en.ts +8 -24
  152. package/templates/saas/i18n/engine/resources/agentOperationRecords.fr.ts +10 -26
  153. package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.en.ts +0 -12
  154. package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.fr.ts +0 -12
  155. package/templates/saas/i18n/engine/resources/anonymous_users.en.ts +8 -74
  156. package/templates/saas/i18n/engine/resources/anonymous_users.fr.ts +0 -66
  157. package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.en.ts +3 -21
  158. package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.fr.ts +0 -18
  159. package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.en.ts +3 -33
  160. package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.fr.ts +0 -30
  161. package/templates/saas/i18n/engine/resources/applicationAccessGrants.en.ts +13 -55
  162. package/templates/saas/i18n/engine/resources/applicationAccessGrants.fr.ts +0 -42
  163. package/templates/saas/i18n/engine/resources/applicationAgentPolicies.en.ts +8 -24
  164. package/templates/saas/i18n/engine/resources/applicationAgentPolicies.fr.ts +8 -24
  165. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.en.ts +0 -27
  166. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.fr.ts +0 -27
  167. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.en.ts +13 -43
  168. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.fr.ts +0 -30
  169. package/templates/saas/i18n/engine/resources/applicationApiKeys.en.ts +2 -70
  170. package/templates/saas/i18n/engine/resources/applicationApiKeys.fr.ts +2 -70
  171. package/templates/saas/i18n/engine/resources/applicationAuditLogs.en.ts +41 -94
  172. package/templates/saas/i18n/engine/resources/applicationAuditLogs.fr.ts +41 -94
  173. package/templates/saas/i18n/engine/resources/applicationDataKeys.en.ts +2 -22
  174. package/templates/saas/i18n/engine/resources/applicationDataKeys.fr.ts +2 -22
  175. package/templates/saas/i18n/engine/resources/applicationFeatures.en.ts +0 -24
  176. package/templates/saas/i18n/engine/resources/applicationFeatures.fr.ts +0 -24
  177. package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.en.ts +25 -160
  178. package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.fr.ts +25 -160
  179. package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.en.ts +6 -28
  180. package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.fr.ts +8 -30
  181. package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.en.ts +92 -23
  182. package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.fr.ts +95 -26
  183. package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.en.ts +1 -25
  184. package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.fr.ts +4 -28
  185. package/templates/saas/i18n/engine/resources/applicationMetadata.en.ts +0 -18
  186. package/templates/saas/i18n/engine/resources/applicationMetadata.fr.ts +0 -18
  187. package/templates/saas/i18n/engine/resources/applicationOAuthClients.en.ts +2 -58
  188. package/templates/saas/i18n/engine/resources/applicationOAuthClients.fr.ts +2 -58
  189. package/templates/saas/i18n/engine/resources/applicationProviderCredentials.en.ts +168 -0
  190. package/templates/saas/i18n/engine/resources/applicationProviderCredentials.fr.ts +168 -0
  191. package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.en.ts +0 -30
  192. package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.fr.ts +0 -30
  193. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.en.ts +3 -42
  194. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.fr.ts +5 -44
  195. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.en.ts +3 -30
  196. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.fr.ts +0 -27
  197. package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.en.ts +0 -24
  198. package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.fr.ts +0 -24
  199. package/templates/saas/i18n/engine/resources/applicationSsoConfig.en.ts +113 -61
  200. package/templates/saas/i18n/engine/resources/applicationSsoConfig.fr.ts +113 -61
  201. package/templates/saas/i18n/engine/resources/applicationSsoConnections.en.ts +0 -138
  202. package/templates/saas/i18n/engine/resources/applicationSsoConnections.fr.ts +0 -138
  203. package/templates/saas/i18n/engine/resources/applicationVersions.en.ts +3 -27
  204. package/templates/saas/i18n/engine/resources/applicationVersions.fr.ts +0 -24
  205. package/templates/saas/i18n/engine/resources/applicationWebhookConfig.en.ts +5 -54
  206. package/templates/saas/i18n/engine/resources/applicationWebhookConfig.fr.ts +5 -54
  207. package/templates/saas/i18n/engine/resources/applications.en.ts +39 -2177
  208. package/templates/saas/i18n/engine/resources/applications.fr.ts +39 -2177
  209. package/templates/saas/i18n/engine/resources/approvalSeals.en.ts +38 -31
  210. package/templates/saas/i18n/engine/resources/approvalSeals.fr.ts +38 -31
  211. package/templates/saas/i18n/engine/resources/auditLogs.en.ts +78 -111
  212. package/templates/saas/i18n/engine/resources/auditLogs.fr.ts +78 -111
  213. package/templates/saas/i18n/engine/resources/billingEffectOutbox.en.ts +2 -4
  214. package/templates/saas/i18n/engine/resources/billingEffectOutbox.fr.ts +2 -4
  215. package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.en.ts +8 -6
  216. package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.fr.ts +8 -6
  217. package/templates/saas/i18n/engine/resources/chatConversations.en.ts +0 -18
  218. package/templates/saas/i18n/engine/resources/chatConversations.fr.ts +0 -18
  219. package/templates/saas/i18n/engine/resources/chatIdentityLinks.en.ts +0 -44
  220. package/templates/saas/i18n/engine/resources/chatIdentityLinks.fr.ts +0 -44
  221. package/templates/saas/i18n/engine/resources/consumableTokens.en.ts +4 -43
  222. package/templates/saas/i18n/engine/resources/consumableTokens.fr.ts +4 -43
  223. package/templates/saas/i18n/engine/resources/conversationMessages.en.ts +16 -27
  224. package/templates/saas/i18n/engine/resources/conversationMessages.fr.ts +16 -27
  225. package/templates/saas/i18n/engine/resources/conversationReplyTokens.en.ts +0 -27
  226. package/templates/saas/i18n/engine/resources/conversationReplyTokens.fr.ts +0 -27
  227. package/templates/saas/i18n/engine/resources/conversationThreads.en.ts +0 -27
  228. package/templates/saas/i18n/engine/resources/conversationThreads.fr.ts +0 -27
  229. package/templates/saas/i18n/engine/resources/dataSeedRuns.en.ts +22 -17
  230. package/templates/saas/i18n/engine/resources/dataSeedRuns.fr.ts +22 -17
  231. package/templates/saas/i18n/engine/resources/dataSubjectRequests.en.ts +410 -0
  232. package/templates/saas/i18n/engine/resources/dataSubjectRequests.fr.ts +410 -0
  233. package/templates/saas/i18n/engine/resources/etlPipelineStates.en.ts +128 -146
  234. package/templates/saas/i18n/engine/resources/etlPipelineStates.fr.ts +0 -18
  235. package/templates/saas/i18n/engine/resources/evaluationDatasetExports.en.ts +13 -43
  236. package/templates/saas/i18n/engine/resources/evaluationDatasetExports.fr.ts +0 -30
  237. package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.en.ts +0 -12
  238. package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.fr.ts +0 -12
  239. package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.en.ts +0 -21
  240. package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.fr.ts +0 -21
  241. package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.en.ts +24 -45
  242. package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.fr.ts +0 -21
  243. package/templates/saas/i18n/engine/resources/externalDataPendingReferences.en.ts +0 -24
  244. package/templates/saas/i18n/engine/resources/externalDataPendingReferences.fr.ts +0 -24
  245. package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.en.ts +0 -21
  246. package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.fr.ts +0 -21
  247. package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.en.ts +8 -14
  248. package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.fr.ts +0 -6
  249. package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.en.ts +0 -24
  250. package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.fr.ts +0 -24
  251. package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.en.ts +150 -174
  252. package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.fr.ts +0 -24
  253. package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.en.ts +12 -33
  254. package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.fr.ts +0 -21
  255. package/templates/saas/i18n/engine/resources/externalEffectReservations.en.ts +147 -0
  256. package/templates/saas/i18n/engine/resources/externalEffectReservations.fr.ts +147 -0
  257. package/templates/saas/i18n/engine/resources/files.en.ts +0 -39
  258. package/templates/saas/i18n/engine/resources/files.fr.ts +0 -39
  259. package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.en.ts +0 -18
  260. package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.fr.ts +0 -18
  261. package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.en.ts +115 -0
  262. package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.fr.ts +115 -0
  263. package/templates/saas/i18n/engine/resources/inboundAddressTombstones.en.ts +0 -27
  264. package/templates/saas/i18n/engine/resources/inboundAddressTombstones.fr.ts +0 -27
  265. package/templates/saas/i18n/engine/resources/inboundContacts.en.ts +3 -30
  266. package/templates/saas/i18n/engine/resources/inboundContacts.fr.ts +0 -27
  267. package/templates/saas/i18n/engine/resources/inboundEmails.en.ts +0 -27
  268. package/templates/saas/i18n/engine/resources/inboundEmails.fr.ts +0 -27
  269. package/templates/saas/i18n/engine/resources/jobExecutions.en.ts +11 -25
  270. package/templates/saas/i18n/engine/resources/jobExecutions.fr.ts +11 -25
  271. package/templates/saas/i18n/engine/resources/jobPayloadStorage.en.ts +3 -30
  272. package/templates/saas/i18n/engine/resources/jobPayloadStorage.fr.ts +0 -27
  273. package/templates/saas/i18n/engine/resources/legalHolds.en.ts +0 -88
  274. package/templates/saas/i18n/engine/resources/legalHolds.fr.ts +0 -88
  275. package/templates/saas/i18n/engine/resources/modelCallAttributions.en.ts +16 -40
  276. package/templates/saas/i18n/engine/resources/modelCallAttributions.fr.ts +0 -24
  277. package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.en.ts +13 -37
  278. package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.fr.ts +0 -24
  279. package/templates/saas/i18n/engine/resources/oauthConsentGrants.en.ts +10 -40
  280. package/templates/saas/i18n/engine/resources/oauthConsentGrants.fr.ts +0 -30
  281. package/templates/saas/i18n/engine/resources/operationApprovalRequests.en.ts +120 -60
  282. package/templates/saas/i18n/engine/resources/operationApprovalRequests.fr.ts +120 -60
  283. package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.en.ts +3 -21
  284. package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.fr.ts +0 -18
  285. package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.en.ts +3 -33
  286. package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.fr.ts +0 -30
  287. package/templates/saas/i18n/engine/resources/organizationAgentPolicies.en.ts +0 -27
  288. package/templates/saas/i18n/engine/resources/organizationAgentPolicies.fr.ts +0 -27
  289. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.en.ts +0 -27
  290. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.fr.ts +0 -27
  291. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.en.ts +13 -43
  292. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.fr.ts +0 -30
  293. package/templates/saas/i18n/engine/resources/organizationApiKeys.en.ts +2 -79
  294. package/templates/saas/i18n/engine/resources/organizationApiKeys.fr.ts +2 -79
  295. package/templates/saas/i18n/engine/resources/organizationBillingAccounts.en.ts +0 -549
  296. package/templates/saas/i18n/engine/resources/organizationBillingAccounts.fr.ts +0 -549
  297. package/templates/saas/i18n/engine/resources/organizationChatSettings.en.ts +0 -27
  298. package/templates/saas/i18n/engine/resources/organizationChatSettings.fr.ts +0 -27
  299. package/templates/saas/i18n/engine/resources/organizationCreditPools.en.ts +13 -18
  300. package/templates/saas/i18n/engine/resources/organizationCreditPools.fr.ts +13 -18
  301. package/templates/saas/i18n/engine/resources/organizationCustomDomains.en.ts +195 -0
  302. package/templates/saas/i18n/engine/resources/organizationCustomDomains.fr.ts +195 -0
  303. package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.en.ts +153 -0
  304. package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.fr.ts +153 -0
  305. package/templates/saas/i18n/engine/resources/organizationEmailDomains.en.ts +0 -39
  306. package/templates/saas/i18n/engine/resources/organizationEmailDomains.fr.ts +0 -39
  307. package/templates/saas/i18n/engine/resources/organizationFeatures.en.ts +0 -34
  308. package/templates/saas/i18n/engine/resources/organizationFeatures.fr.ts +0 -34
  309. package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.en.ts +25 -160
  310. package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.fr.ts +25 -160
  311. package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.en.ts +6 -28
  312. package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.fr.ts +8 -30
  313. package/templates/saas/i18n/engine/resources/organizationGuidanceState.en.ts +3 -18
  314. package/templates/saas/i18n/engine/resources/organizationGuidanceState.fr.ts +0 -15
  315. package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.en.ts +95 -26
  316. package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.fr.ts +95 -26
  317. package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.en.ts +14 -45
  318. package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.fr.ts +14 -45
  319. package/templates/saas/i18n/engine/resources/organizationLifecycleState.en.ts +1 -17
  320. package/templates/saas/i18n/engine/resources/organizationLifecycleState.fr.ts +1 -17
  321. package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.en.ts +2 -26
  322. package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.fr.ts +4 -28
  323. package/templates/saas/i18n/engine/resources/organizationMembers.en.ts +2 -95
  324. package/templates/saas/i18n/engine/resources/organizationMembers.fr.ts +2 -95
  325. package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.en.ts +0 -27
  326. package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.fr.ts +0 -27
  327. package/templates/saas/i18n/engine/resources/organizationNotificationBadges.en.ts +3 -36
  328. package/templates/saas/i18n/engine/resources/organizationNotificationBadges.fr.ts +0 -33
  329. package/templates/saas/i18n/engine/resources/organizationNotifications.en.ts +0 -12
  330. package/templates/saas/i18n/engine/resources/organizationNotifications.fr.ts +0 -12
  331. package/templates/saas/i18n/engine/resources/organizationOAuthClients.en.ts +2 -67
  332. package/templates/saas/i18n/engine/resources/organizationOAuthClients.fr.ts +2 -67
  333. package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.en.ts +0 -9
  334. package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.fr.ts +0 -9
  335. package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.en.ts +0 -27
  336. package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.fr.ts +0 -27
  337. package/templates/saas/i18n/engine/resources/organizationPreferences.en.ts +0 -37
  338. package/templates/saas/i18n/engine/resources/organizationPreferences.fr.ts +0 -37
  339. package/templates/saas/i18n/engine/resources/organizationProfiles.en.ts +0 -37
  340. package/templates/saas/i18n/engine/resources/organizationProfiles.fr.ts +0 -37
  341. package/templates/saas/i18n/engine/resources/organizationProgressionState.en.ts +1 -17
  342. package/templates/saas/i18n/engine/resources/organizationProgressionState.fr.ts +1 -17
  343. package/templates/saas/i18n/engine/resources/organizationProviderCredentials.en.ts +0 -58
  344. package/templates/saas/i18n/engine/resources/organizationProviderCredentials.fr.ts +0 -58
  345. package/templates/saas/i18n/engine/resources/organizationRelationships.en.ts +0 -128
  346. package/templates/saas/i18n/engine/resources/organizationRelationships.fr.ts +0 -128
  347. package/templates/saas/i18n/engine/resources/organizationRepresentations.en.ts +0 -83
  348. package/templates/saas/i18n/engine/resources/organizationRepresentations.fr.ts +0 -83
  349. package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.en.ts +0 -43
  350. package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.fr.ts +0 -43
  351. package/templates/saas/i18n/engine/resources/organizationScimTokens.en.ts +5 -76
  352. package/templates/saas/i18n/engine/resources/organizationScimTokens.fr.ts +5 -76
  353. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.en.ts +4 -43
  354. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.fr.ts +6 -45
  355. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.en.ts +3 -30
  356. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.fr.ts +0 -27
  357. package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.en.ts +0 -37
  358. package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.fr.ts +0 -37
  359. package/templates/saas/i18n/engine/resources/organizationSsoConfig.en.ts +113 -74
  360. package/templates/saas/i18n/engine/resources/organizationSsoConfig.fr.ts +113 -74
  361. package/templates/saas/i18n/engine/resources/organizationSsoConnections.en.ts +0 -148
  362. package/templates/saas/i18n/engine/resources/organizationSsoConnections.fr.ts +0 -148
  363. package/templates/saas/i18n/engine/resources/organizationSubscriptions.en.ts +40 -78
  364. package/templates/saas/i18n/engine/resources/organizationSubscriptions.fr.ts +42 -80
  365. package/templates/saas/i18n/engine/resources/organizationUnitMembers.en.ts +2 -50
  366. package/templates/saas/i18n/engine/resources/organizationUnitMembers.fr.ts +2 -50
  367. package/templates/saas/i18n/engine/resources/organizationUnits.en.ts +0 -49
  368. package/templates/saas/i18n/engine/resources/organizationUnits.fr.ts +0 -49
  369. package/templates/saas/i18n/engine/resources/organizationUsageRecords.en.ts +13 -37
  370. package/templates/saas/i18n/engine/resources/organizationUsageRecords.fr.ts +13 -37
  371. package/templates/saas/i18n/engine/resources/organizationWebhookConfig.en.ts +5 -67
  372. package/templates/saas/i18n/engine/resources/organizationWebhookConfig.fr.ts +5 -67
  373. package/templates/saas/i18n/engine/resources/organizations.en.ts +34 -637
  374. package/templates/saas/i18n/engine/resources/organizations.fr.ts +32 -635
  375. package/templates/saas/i18n/engine/resources/platformAccessGrants.en.ts +0 -91
  376. package/templates/saas/i18n/engine/resources/platformAccessGrants.fr.ts +0 -91
  377. package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.en.ts +0 -24
  378. package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.fr.ts +0 -24
  379. package/templates/saas/i18n/engine/resources/prices.en.ts +47 -108
  380. package/templates/saas/i18n/engine/resources/prices.fr.ts +48 -109
  381. package/templates/saas/i18n/engine/resources/products.en.ts +24 -68
  382. package/templates/saas/i18n/engine/resources/products.fr.ts +24 -68
  383. package/templates/saas/i18n/engine/resources/professionalQualifications.en.ts +0 -87
  384. package/templates/saas/i18n/engine/resources/professionalQualifications.fr.ts +0 -87
  385. package/templates/saas/i18n/engine/resources/promotions.en.ts +4 -56
  386. package/templates/saas/i18n/engine/resources/promotions.fr.ts +6 -58
  387. package/templates/saas/i18n/engine/resources/providerCallRecords.en.ts +77 -101
  388. package/templates/saas/i18n/engine/resources/providerCallRecords.fr.ts +0 -24
  389. package/templates/saas/i18n/engine/resources/publishedVerificationKeys.en.ts +2 -25
  390. package/templates/saas/i18n/engine/resources/publishedVerificationKeys.fr.ts +2 -25
  391. package/templates/saas/i18n/engine/resources/referrals.en.ts +21 -18
  392. package/templates/saas/i18n/engine/resources/referrals.fr.ts +21 -18
  393. package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.en.ts +0 -80
  394. package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.fr.ts +0 -80
  395. package/templates/saas/i18n/engine/resources/relationshipInvitations.en.ts +0 -89
  396. package/templates/saas/i18n/engine/resources/relationshipInvitations.fr.ts +0 -89
  397. package/templates/saas/i18n/engine/resources/relationshipMailboxes.en.ts +0 -27
  398. package/templates/saas/i18n/engine/resources/relationshipMailboxes.fr.ts +0 -27
  399. package/templates/saas/i18n/engine/resources/representativeAssignments.en.ts +108 -112
  400. package/templates/saas/i18n/engine/resources/representativeAssignments.fr.ts +108 -112
  401. package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.en.ts +8 -21
  402. package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.fr.ts +8 -21
  403. package/templates/saas/i18n/engine/resources/signatureRequestSigners.en.ts +141 -0
  404. package/templates/saas/i18n/engine/resources/signatureRequestSigners.fr.ts +141 -0
  405. package/templates/saas/i18n/engine/resources/signatureRequests.en.ts +205 -0
  406. package/templates/saas/i18n/engine/resources/signatureRequests.fr.ts +205 -0
  407. package/templates/saas/i18n/engine/resources/smsNumberAssignments.en.ts +101 -0
  408. package/templates/saas/i18n/engine/resources/smsNumberAssignments.fr.ts +101 -0
  409. package/templates/saas/i18n/engine/resources/smsOptOuts.en.ts +166 -0
  410. package/templates/saas/i18n/engine/resources/smsOptOuts.fr.ts +166 -0
  411. package/templates/saas/i18n/engine/resources/smsProviderEvents.en.ts +195 -0
  412. package/templates/saas/i18n/engine/resources/smsProviderEvents.fr.ts +195 -0
  413. package/templates/saas/i18n/engine/resources/ssoDomainReservations.en.ts +0 -27
  414. package/templates/saas/i18n/engine/resources/ssoDomainReservations.fr.ts +0 -27
  415. package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.en.ts +3 -39
  416. package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.fr.ts +0 -36
  417. package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.en.ts +0 -3
  418. package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.fr.ts +0 -3
  419. package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.en.ts +0 -6
  420. package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.fr.ts +0 -6
  421. package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.en.ts +3 -21
  422. package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.fr.ts +0 -18
  423. package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.en.ts +3 -33
  424. package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.fr.ts +0 -30
  425. package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.en.ts +0 -27
  426. package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.fr.ts +0 -27
  427. package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.en.ts +13 -43
  428. package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.fr.ts +0 -30
  429. package/templates/saas/i18n/engine/resources/userCredentials.en.ts +3 -87
  430. package/templates/saas/i18n/engine/resources/userCredentials.fr.ts +0 -84
  431. package/templates/saas/i18n/engine/resources/userFeatures.en.ts +0 -12
  432. package/templates/saas/i18n/engine/resources/userFeatures.fr.ts +0 -12
  433. package/templates/saas/i18n/engine/resources/userFlowActorExecutions.en.ts +25 -160
  434. package/templates/saas/i18n/engine/resources/userFlowActorExecutions.fr.ts +25 -160
  435. package/templates/saas/i18n/engine/resources/userFlowActorTasks.en.ts +6 -28
  436. package/templates/saas/i18n/engine/resources/userFlowActorTasks.fr.ts +8 -30
  437. package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.en.ts +13 -18
  438. package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.fr.ts +13 -18
  439. package/templates/saas/i18n/engine/resources/userGuidanceState.en.ts +3 -18
  440. package/templates/saas/i18n/engine/resources/userGuidanceState.fr.ts +0 -15
  441. package/templates/saas/i18n/engine/resources/userIdentityLinks.en.ts +13 -40
  442. package/templates/saas/i18n/engine/resources/userIdentityLinks.fr.ts +0 -27
  443. package/templates/saas/i18n/engine/resources/userLifecycleState.en.ts +0 -15
  444. package/templates/saas/i18n/engine/resources/userLifecycleState.fr.ts +0 -15
  445. package/templates/saas/i18n/engine/resources/userNotificationBadges.en.ts +3 -36
  446. package/templates/saas/i18n/engine/resources/userNotificationBadges.fr.ts +0 -33
  447. package/templates/saas/i18n/engine/resources/userPreferences.en.ts +8 -60
  448. package/templates/saas/i18n/engine/resources/userPreferences.fr.ts +8 -60
  449. package/templates/saas/i18n/engine/resources/userProfiles.en.ts +5 -56
  450. package/templates/saas/i18n/engine/resources/userProfiles.fr.ts +0 -51
  451. package/templates/saas/i18n/engine/resources/userProgressionState.en.ts +1 -17
  452. package/templates/saas/i18n/engine/resources/userProgressionState.fr.ts +1 -17
  453. package/templates/saas/i18n/engine/resources/userProviderCredentials.en.ts +0 -52
  454. package/templates/saas/i18n/engine/resources/userProviderCredentials.fr.ts +0 -52
  455. package/templates/saas/i18n/engine/resources/userSelfPreferences.en.ts +8 -56
  456. package/templates/saas/i18n/engine/resources/userSelfPreferences.fr.ts +8 -56
  457. package/templates/saas/i18n/engine/resources/userSelfProfiles.en.ts +5 -61
  458. package/templates/saas/i18n/engine/resources/userSelfProfiles.fr.ts +0 -56
  459. package/templates/saas/i18n/engine/resources/user_self.en.ts +37 -214
  460. package/templates/saas/i18n/engine/resources/user_self.fr.ts +37 -214
  461. package/templates/saas/i18n/engine/resources/users.en.ts +53 -180
  462. package/templates/saas/i18n/engine/resources/users.fr.ts +53 -180
  463. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/Dockerfile +4 -1
  464. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +9 -1
  465. package/templates/saas/scenarios/add-website/files/website/Dockerfile +4 -1
  466. package/templates/saas/scenarios/add-website/files/website/astro.config.ts.hbs +4 -0
  467. package/templates/saas/scenarios/add-website/files/website/package.json.hbs +1 -1
  468. package/templates/saas/scenarios/add-worker-node/files/workers/__workerDir__/Dockerfile.hbs +3 -1
  469. package/templates/saas/skeleton/backend-api/Dockerfile +5 -2
  470. package/templates/saas/skeleton/frontend/Dockerfile +4 -1
  471. package/templates/saas/skeleton/frontend/vite-engine-dependency-prebundle.ts +10 -1
  472. package/templates/saas/skeleton/frontend/vite.config.ts.hbs +14 -3
  473. package/wildo-framework.info.json +1 -1
@@ -8,6 +8,8 @@
8
8
  * wildo fwk registry-host key --name release --role publish # mint a key; store it as this machine's credential
9
9
  * wildo fwk registry-host backup # run the nightly backup now, and show how it ended
10
10
  * wildo fwk registry-host restore-check # restore the latest backup aside and prove it complete
11
+ * wildo fwk registry-host upgrade --imageTag 1.1.14 # back up, then move the running image (what a release runs)
12
+ * wildo fwk registry-host authorize-ci --publicKeyFile k.pub # let the release's key run that upgrade, and only it
11
13
  *
12
14
  * Backups and monitoring are part of `deploy` when their secrets exist (`registryHostBackup` and `betterStack` in the
13
15
  * framework secrets): a daily restic backup of PostgreSQL, the object store and the host's .env to Scaleway Object
@@ -33,6 +35,7 @@
33
35
  * any public registry. The host's architecture must match (both are arm64 today); the command refuses otherwise.
34
36
  */
35
37
  import { execFileSync } from 'node:child_process';
38
+ import { readFileSync } from 'node:fs';
36
39
  import { BaseCommand } from '../../kernel/base-command.js';
37
40
  import { CommandCategory } from '../../kernel/types.js';
38
41
  import { ErrorUtils } from '../../infrastructure/errors/error.utils.js';
@@ -42,6 +45,7 @@ import { ensureRegistryHostMonitoring } from '../../services/framework/registry-
42
45
  import { FrameworkReleaseService } from '../../services/framework/framework-release.service.js';
43
46
  import { REGISTRY_HOST_DIRECTORY, buildRegistryHostEnv, buildRegistryHostKeyMintCommand, gitAdminIdentity, readRegistryHostTemplates, registryHostDomain, findUnsettledImagePackages, buildRegistryHostBackupEnv, loadFrameworkSecretsSection, loadRegistryHostConnection, registryHostObjectStoreClientImage, REGISTRY_BACKUP_SYSTEMD_UNITS, resolveRegistryHostSecrets, serializeRegistryHostEnv, } from '../../services/framework/registry-host/registry-host.service.js';
44
47
  import { runOnRegistryHost, shellQuote, streamImageToRegistryHost, writeRegistryHostFile, } from '../../services/framework/registry-host/registry-host-remote.js';
48
+ import { buildAuthorizeCiRemoteScript, buildRegistryHostCiAuthorizedKeyLine, isRegistryHostReleaseTag, parseRegistryHostInspection, REGISTRY_HOST_UPGRADE_SCRIPT, registryHostEnvKeyNames, upgradeBlockers, } from '../../services/framework/registry-host/registry-host-upgrade.js';
45
49
  /** The verb's actions — a closed vocabulary. */
46
50
  export var RegistryHostAction;
47
51
  (function (RegistryHostAction) {
@@ -50,6 +54,10 @@ export var RegistryHostAction;
50
54
  RegistryHostAction["KEY"] = "key";
51
55
  RegistryHostAction["BACKUP"] = "backup";
52
56
  RegistryHostAction["RESTORE_CHECK"] = "restore-check";
57
+ /** Move the running platform image, after a backup; the step a release runs before the provider modules (#3795). */
58
+ RegistryHostAction["UPGRADE"] = "upgrade";
59
+ /** Install (or with `--revoke`, remove) the release's deploy key, restricted to the upgrade script (#3795). */
60
+ RegistryHostAction["AUTHORIZE_CI"] = "authorize-ci";
53
61
  })(RegistryHostAction || (RegistryHostAction = {}));
54
62
  /** How long a first boot may take: image pull, INIT (database, schema, provisioning), then two health checks. */
55
63
  const REGISTRY_HOST_READY_DEADLINE_MS = 15 * 60_000;
@@ -84,12 +92,12 @@ export default class FwkRegistryHostCommand extends BaseCommand {
84
92
  name: 'fwk registry-host',
85
93
  description: 'Deploy the public module registry to its machine (moduleRegistryHost in the framework secrets), or show its state',
86
94
  category: CommandCategory.Fwk,
87
- args: [{ name: 'action', description: '`deploy`, `status`, `key`, `backup` or `restore-check`.', required: true }],
95
+ args: [{ name: 'action', description: '`deploy`, `status`, `key`, `backup`, `restore-check`, `upgrade` or `authorize-ci`.', required: true }],
88
96
  flags: {
89
- dryRun: { type: 'boolean', description: 'deploy: show the plan; touch nothing remote and store nothing', default: false },
97
+ dryRun: { type: 'boolean', description: 'deploy, upgrade: show the plan; touch nothing remote and store nothing', default: false },
90
98
  fromCheckout: { type: 'boolean', description: 'deploy: build the platform image from this checkout and stream it to the host', default: false },
91
99
  keepImage: { type: 'boolean', description: 'deploy: keep the platform image the host runs now; rewrite only configuration, backups and monitoring', default: false },
92
- imageTag: { type: 'string', description: 'deploy: the published wildoai/wildo-platform tag (default: this framework version)', default: undefined },
100
+ imageTag: { type: 'string', description: 'deploy, upgrade: the published wildoai/wildo-platform tag (default: this framework version)', default: undefined },
93
101
  adminEmail: { type: 'string', description: 'deploy: the administrator apps-manager seeds (default: stored, else git user.email)', default: undefined },
94
102
  adminFirstName: { type: 'string', description: 'deploy: the administrator\'s first name (default: stored, else git user.name)', default: undefined },
95
103
  adminLastName: { type: 'string', description: 'deploy: the administrator\'s last name (default: stored, else git user.name)', default: undefined },
@@ -97,6 +105,8 @@ export default class FwkRegistryHostCommand extends BaseCommand {
97
105
  role: { type: 'string', description: 'key: `read` or `publish`', default: undefined },
98
106
  expiresInDays: { type: 'string', description: 'key: days until it expires (default: the platform\'s)', default: undefined },
99
107
  print: { type: 'boolean', description: 'key: print the secret once instead of storing it as this machine\'s credential', default: false },
108
+ publicKeyFile: { type: 'string', description: 'authorize-ci: the deploy key\'s .pub file', default: undefined },
109
+ revoke: { type: 'boolean', description: 'authorize-ci: remove the release\'s deploy key instead', default: false },
100
110
  },
101
111
  };
102
112
  async run(ctx) {
@@ -130,6 +140,8 @@ export default class FwkRegistryHostCommand extends BaseCommand {
130
140
  case RegistryHostAction.BACKUP: return await this.runBackup(ctx, host);
131
141
  case RegistryHostAction.RESTORE_CHECK: return await this.restoreCheck(ctx, host);
132
142
  case RegistryHostAction.DEPLOY: return await this.deploy(ctx, frameworkRoot, host, config.frameworkVersion);
143
+ case RegistryHostAction.UPGRADE: return await this.upgrade(ctx, frameworkRoot, host, config.frameworkVersion);
144
+ case RegistryHostAction.AUTHORIZE_CI: return await this.authorizeCi(ctx, host);
133
145
  }
134
146
  }
135
147
  catch (error) {
@@ -211,6 +223,7 @@ export default class FwkRegistryHostCommand extends BaseCommand {
211
223
  ctx.log.info(' writing the compose project');
212
224
  await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/docker-compose.yml`, templates['docker-compose.yml'], '644');
213
225
  await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/Caddyfile`, templates.Caddyfile, '644');
226
+ await writeRegistryHostFile(host, REGISTRY_HOST_UPGRADE_SCRIPT, templates['upgrade-image.sh'], '755');
214
227
  await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/.env`, env, '600');
215
228
  const compose = `cd ${shellQuote(REGISTRY_HOST_DIRECTORY)} && docker compose`;
216
229
  ctx.log.info(' starting');
@@ -239,6 +252,68 @@ export default class FwkRegistryHostCommand extends BaseCommand {
239
252
  await this.ensureBackupsAndMonitoring(ctx, frameworkRoot, host, templates);
240
253
  return { success: true };
241
254
  }
255
+ /**
256
+ * Move the running platform image to `--imageTag` (default: this framework version), after a backup taken on the host
257
+ * (#3795). Only the image moves: when this checkout would deploy a different compose file, Caddyfile or upgrade script,
258
+ * or a `.env` variable the host lacks, it refuses and names `deploy`, because the image alone would run against a
259
+ * configuration written for another release. The host does the work in `upgrade-image.sh`, so this runs the same way
260
+ * from an operator's key and from the release's restricted one.
261
+ */
262
+ async upgrade(ctx, frameworkRoot, host, frameworkVersion) {
263
+ const dryRun = ctx.flags.dryRun === true;
264
+ const tag = ctx.flags.imageTag?.trim() || frameworkVersion;
265
+ if (!isRegistryHostReleaseTag(tag))
266
+ return { success: false, message: `--imageTag must be a release version (x.y.z), got "${tag}".` };
267
+ ctx.log.info(`[fwk registry-host] upgrade ${registryHostDomain()} to wildo-platform:${tag}${dryRun ? ' (dry run)' : ''}`);
268
+ const inspected = await runOnRegistryHost(host, `${REGISTRY_HOST_UPGRADE_SCRIPT} --inspect`);
269
+ if (inspected.code !== 0) {
270
+ return {
271
+ success: false,
272
+ message: `The host could not be inspected (${inspected.stderr.trim() || `exit ${inspected.code}`}). A host deployed before #3795 has no ${REGISTRY_HOST_UPGRADE_SCRIPT}: run \`wildo fwk registry-host deploy\` once.`,
273
+ };
274
+ }
275
+ const inspection = parseRegistryHostInspection(inspected.stdout);
276
+ const blockers = upgradeBlockers({ inspection, templates: readRegistryHostTemplates(frameworkRoot), envKeyNames: registryHostEnvKeyNames() });
277
+ ctx.log.info(` running: ${inspection.image}`);
278
+ if (blockers.length > 0) {
279
+ return {
280
+ success: false,
281
+ message: `Moving the image is not enough for this release: ${blockers.join('; ')}. Run \`wildo fwk registry-host deploy --imageTag ${tag}\` from a framework checkout holding the registry host's secrets.`,
282
+ };
283
+ }
284
+ if (dryRun) {
285
+ const already = inspection.image.endsWith(`/wildo-platform:${tag}`);
286
+ ctx.log.success(already ? ` It already runs wildo-platform:${tag}. Nothing was changed.` : ` Planned: back up, then move to wildo-platform:${tag}. Nothing was changed.`);
287
+ return { success: true };
288
+ }
289
+ const run = await runOnRegistryHost(host, `${REGISTRY_HOST_UPGRADE_SCRIPT} ${tag}`, { stream: true });
290
+ if (run.code !== 0)
291
+ return { success: false, message: 'The upgrade failed on the host (its output is above).' };
292
+ if (!(await this.checkPublic(ctx))) {
293
+ return { success: false, message: `The registry is healthy on the host but https://${registryHostDomain()}/health/ready does not answer 200.` };
294
+ }
295
+ return { success: true };
296
+ }
297
+ /**
298
+ * Install the release's deploy key, or remove it with `--revoke` (#3795). The key is restricted on the host itself
299
+ * (`command="…upgrade-image.sh",restrict`), so whoever holds it can move the registry to a published release image and
300
+ * do nothing else: no shell, no forwarding, no other file. Authorizing again replaces the key.
301
+ */
302
+ async authorizeCi(ctx, host) {
303
+ const revoke = ctx.flags.revoke === true;
304
+ const publicKeyFile = ctx.flags.publicKeyFile?.trim();
305
+ if (!revoke && !publicKeyFile)
306
+ return { success: false, message: 'authorize-ci needs --publicKeyFile <key.pub> (or --revoke).' };
307
+ const line = revoke ? '' : buildRegistryHostCiAuthorizedKeyLine(readFileSync(publicKeyFile, 'utf8'));
308
+ const result = await runOnRegistryHost(host, buildAuthorizeCiRemoteScript(revoke), revoke ? {} : { stdin: `${line}\n` });
309
+ if (result.code !== 0)
310
+ return { success: false, message: `Could not update authorized_keys on the host: ${result.stderr.trim() || `exit ${result.code}`}` };
311
+ const count = Number(result.stdout.trim().split('\n').at(-1));
312
+ if (revoke ? count !== 0 : count !== 1)
313
+ return { success: false, message: `authorized_keys holds ${count} release key line(s) after the change; expected ${revoke ? 0 : 1}.` };
314
+ ctx.log.success(revoke ? ' The release\'s deploy key is removed.' : ` The release's deploy key can run ${REGISTRY_HOST_UPGRADE_SCRIPT} and nothing else.`);
315
+ return { success: true };
316
+ }
242
317
  /**
243
318
  * Install the nightly backup and ensure its Better Stack monitoring, when both are configured. Without them the
244
319
  * registry still runs, and this says so plainly rather than pretending a backup exists.
@@ -1 +1 @@
1
- {"version":3,"file":"registry-host.command.js","sourceRoot":"","sources":["../../../../src/commands/fwk/registry-host.command.ts"],"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ent":["/**\n * `wildo fwk registry-host <deploy|status>` — deploy the public module registry to its machine (#2135).\n *\n * wildo fwk registry-host deploy --dryRun # show the plan; generate nothing durable, touch nothing remote\n * wildo fwk registry-host deploy # the published platform image for this framework version\n * wildo fwk registry-host deploy --fromCheckout # build the platform image from this checkout and ship it\n * wildo fwk registry-host status\n * wildo fwk registry-host key --name release --role publish # mint a key; store it as this machine's credential\n * wildo fwk registry-host backup # run the nightly backup now, and show how it ended\n * wildo fwk registry-host restore-check # restore the latest backup aside and prove it complete\n *\n * Backups and monitoring are part of `deploy` when their secrets exist (`registryHostBackup` and `betterStack` in the\n * framework secrets): a daily restic backup of PostgreSQL, the object store and the host's .env to Scaleway Object\n * Storage (7 daily, 4 weekly, 3 monthly), and a Better Stack uptime monitor plus the heartbeat the backup reports to.\n * See `templates/infra/registry-host/backup.sh` and `registry-host-monitoring.ts`.\n *\n * The machine is `moduleRegistryHost` in the gitignored framework secrets file (`.wildo-framework/framework-secrets/\n * secrets.json`: `{ \"moduleRegistryHost\": { \"address\": \"…\", \"sshPort\": 2725, \"sshUser\": \"root\" } }`), never the tracked\n * config, because its address is the origin behind the registry's CDN. Its public name is\n * `DEFAULT_PUBLIC_REGISTRY_URL`. What runs there is `templates/infra/registry-host/` (see its compose file), and the\n * secrets are generated once and kept in the framework secrets file (`registry-host.service.ts`).\n *\n * Every step is idempotent, so a deploy is also the upgrade and the repair: Docker is installed only if absent, files\n * are rewritten, `docker compose up -d` recreates only what changed, and apps-manager's INIT exits 0 when it has\n * already run. Data lives in named volumes and survives every redeploy.\n *\n * The published images up to 1.1.8 predate the two apps-manager changes this host needs (no `K8S_NAMESPACE` required\n * at boot outside `local`, no Kubernetes endpoints built at INIT without one), so until a release carries them a plain\n * `deploy` stops at INIT and only `--fromCheckout` works.\n *\n * `--fromCheckout` exists because the published image lags the checkout between releases: the image is built here,\n * for this machine's architecture, and streamed to the host with `docker save | ssh docker load`. Nothing is pushed to\n * any public registry. The host's architecture must match (both are arm64 today); the command refuses otherwise.\n */\nimport { execFileSync } from 'node:child_process';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport {\n DEFAULT_PUBLIC_REGISTRY_URL,\n FRAMEWORK_SECRETS_BETTER_STACK_KEY,\n FRAMEWORK_SECRETS_REGISTRY_HOST_BACKUP_KEY,\n WildoFrameworkBetterStackSchema,\n WildoFrameworkRegistryHostBackupSchema,\n RegistryKeyMintResponseSchema,\n RegistryKeyRole,\n resolveFrameworkLayout,\n type WildoFrameworkModuleRegistryHost,\n} from '@wildo-ai/platform-config-lib';\nimport { RegistryCredentialsService } from '~wildo-cli/services/registry/registry-credentials.service';\nimport { ensureRegistryHostMonitoring } from '~wildo-cli/services/framework/registry-host/registry-host-monitoring';\nimport { FrameworkReleaseService } from '~wildo-cli/services/framework/framework-release.service';\nimport {\n REGISTRY_HOST_DIRECTORY,\n buildRegistryHostEnv,\n buildRegistryHostKeyMintCommand,\n gitAdminIdentity,\n readRegistryHostTemplates,\n registryHostDomain,\n findUnsettledImagePackages,\n buildRegistryHostBackupEnv,\n loadFrameworkSecretsSection,\n loadRegistryHostConnection,\n registryHostObjectStoreClientImage,\n REGISTRY_BACKUP_SYSTEMD_UNITS,\n resolveRegistryHostSecrets,\n serializeRegistryHostEnv,\n} from '~wildo-cli/services/framework/registry-host/registry-host.service';\nimport {\n runOnRegistryHost,\n shellQuote,\n streamImageToRegistryHost,\n writeRegistryHostFile,\n} from '~wildo-cli/services/framework/registry-host/registry-host-remote';\n\n/** The verb's actions — a closed vocabulary. */\nexport enum RegistryHostAction {\n DEPLOY = 'deploy',\n STATUS = 'status',\n KEY = 'key',\n BACKUP = 'backup',\n RESTORE_CHECK = 'restore-check',\n}\n\n/** How long a first boot may take: image pull, INIT (database, schema, provisioning), then two health checks. */\nconst REGISTRY_HOST_READY_DEADLINE_MS = 15 * 60_000;\n/** How long the public name may take to answer: Caddy requests its first certificate when it starts. */\nconst PUBLIC_READY_DEADLINE_MS = 5 * 60_000;\n/**\n * One `GET /health/ready` through the public name — Cloudflare, then Caddy, then the platform. Sized for the slowest\n * single answer a healthy host gives: the request that makes Caddy complete its first ACME exchange, which takes\n * seconds rather than tens of seconds. A probe still unanswered after 15s counts as one failed attempt; the polling loop\n * (bounded by {@link PUBLIC_READY_DEADLINE_MS}) is what waits for the host as a whole.\n */\nconst PUBLIC_READY_PROBE_TIMEOUT_MS = 15_000;\n\n/**\n * Prepares a fresh Ubuntu host for Compose, idempotently. Docker's own install script rather than the distribution\n * package, which lags and ships no compose plugin (the website machine's provisioning makes the same choice), and\n * bounded json-file logs, because unbounded container logs are how a small disk fills.\n */\nconst PREPARE_HOST_SCRIPT = [\n 'set -e',\n 'if ! command -v docker >/dev/null 2>&1; then curl -fsSL https://get.docker.com | sh >/dev/null; echo \"docker installed\"; fi',\n 'systemctl enable --now docker >/dev/null 2>&1 || true',\n 'if [ ! -f /etc/docker/daemon.json ]; then',\n ' printf \\'{\"log-driver\":\"json-file\",\"log-opts\":{\"max-size\":\"10m\",\"max-file\":\"3\"}}\\\\n\\' > /etc/docker/daemon.json',\n ' systemctl restart docker',\n ' echo \"docker log rotation configured\"',\n 'fi',\n 'docker compose version >/dev/null',\n 'uname -m',\n].join('\\n');\n\nexport default class FwkRegistryHostCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'fwk registry-host',\n description: 'Deploy the public module registry to its machine (moduleRegistryHost in the framework secrets), or show its state',\n category: CommandCategory.Fwk,\n args: [{ name: 'action', description: '`deploy`, `status`, `key`, `backup` or `restore-check`.', required: true }],\n flags: {\n dryRun: { type: 'boolean', description: 'deploy: show the plan; touch nothing remote and store nothing', default: false },\n fromCheckout: { type: 'boolean', description: 'deploy: build the platform image from this checkout and stream it to the host', default: false },\n keepImage: { type: 'boolean', description: 'deploy: keep the platform image the host runs now; rewrite only configuration, backups and monitoring', default: false },\n imageTag: { type: 'string', description: 'deploy: the published wildoai/wildo-platform tag (default: this framework version)', default: undefined },\n adminEmail: { type: 'string', description: 'deploy: the administrator apps-manager seeds (default: stored, else git user.email)', default: undefined },\n adminFirstName: { type: 'string', description: 'deploy: the administrator\\'s first name (default: stored, else git user.name)', default: undefined },\n adminLastName: { type: 'string', description: 'deploy: the administrator\\'s last name (default: stored, else git user.name)', default: undefined },\n name: { type: 'string', description: 'key: the key name (lowercase, digits, \".\", \"_\", \"-\")', default: undefined },\n role: { type: 'string', description: 'key: `read` or `publish`', default: undefined },\n expiresInDays: { type: 'string', description: 'key: days until it expires (default: the platform\\'s)', default: undefined },\n print: { type: 'boolean', description: 'key: print the secret once instead of storing it as this machine\\'s credential', default: false },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const action = ctx.args.action as RegistryHostAction | undefined;\n if (!action || !Object.values(RegistryHostAction).includes(action)) {\n return { success: false, message: `action must be one of: ${Object.values(RegistryHostAction).join(', ')}.` };\n }\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (!frameworkRoot) return { success: false, message: '`wildo fwk registry-host` runs from a framework checkout, and this is not one.' };\n const config = await FrameworkReleaseService.loadFrameworkConfig(frameworkRoot);\n if (!config) return { success: false, message: `No framework config at ${FrameworkReleaseService.resolveFrameworkConfigPath(frameworkRoot)}.` };\n let host: WildoFrameworkModuleRegistryHost | null;\n try {\n host = loadRegistryHostConnection(frameworkRoot);\n } catch (error) {\n return { success: false, message: ErrorUtils.extractErrorMessage(error) };\n }\n if (!host) {\n return {\n success: false,\n message: `No moduleRegistryHost in ${FrameworkReleaseService.resolveFrameworkSecretsPath(frameworkRoot)}: add { \"moduleRegistryHost\": { \"address\": \"…\", \"sshPort\": 22, \"sshUser\": \"root\" } }.`,\n };\n }\n try {\n switch (action) {\n case RegistryHostAction.STATUS: return await this.status(ctx, host);\n case RegistryHostAction.KEY: return await this.mintKey(ctx, host);\n case RegistryHostAction.BACKUP: return await this.runBackup(ctx, host);\n case RegistryHostAction.RESTORE_CHECK: return await this.restoreCheck(ctx, host);\n case RegistryHostAction.DEPLOY: return await this.deploy(ctx, frameworkRoot, host, config.frameworkVersion);\n }\n } catch (error) {\n return { success: false, message: ErrorUtils.extractErrorMessage(error) };\n }\n }\n\n private async deploy(ctx: CommandContext, frameworkRoot: string, host: WildoFrameworkModuleRegistryHost, frameworkVersion: string): Promise<CommandResult> {\n const dryRun = ctx.flags.dryRun === true;\n const fromCheckout = ctx.flags.fromCheckout === true;\n const keepImage = ctx.flags.keepImage === true;\n if (keepImage && (fromCheckout || ctx.flags.imageTag !== undefined)) {\n return { success: false, message: '--keepImage reuses the image the host runs; it cannot be combined with --fromCheckout or --imageTag.' };\n }\n // The image the host runs now, from its own .env: what --keepImage keeps, so a configuration change (backups,\n // monitoring, a proxy setting) never swaps the running code underneath.\n const runningImage = keepImage\n ? (await runOnRegistryHost(host, `sed -n 's/^PLATFORM_IMAGE=//p' ${shellQuote(`${REGISTRY_HOST_DIRECTORY}/.env`)}`)).stdout.trim()\n : '';\n if (keepImage && !runningImage) return { success: false, message: '--keepImage: the host has no deployed .env to read its image from; deploy it first.' };\n const target = `${host.sshUser}@${host.address}:${host.sshPort}`;\n ctx.log.info(`[fwk registry-host] ${registryHostDomain()} → ${target}${dryRun ? ' (dry run)' : ''}`);\n\n // An image from the checkout ships the watchers' compiled output as it stands: refuse while any of it is unsettled,\n // before anything is generated or stored.\n const unsettled = fromCheckout ? findUnsettledImagePackages(frameworkRoot) : [];\n if (unsettled.length > 0) {\n return {\n success: false,\n message: `--fromCheckout would ship compiled output that is not settled: ${unsettled.join(', ')}. Wait for the dev watchers to settle (their record: .wildo-runtime-signals/dev-compile-status.json) and run again.`,\n };\n }\n const { secrets, generatedKeys } = resolveRegistryHostSecrets({\n frameworkRoot,\n persist: !dryRun,\n admin: {\n email: ctx.flags.adminEmail as string | undefined,\n firstName: ctx.flags.adminFirstName as string | undefined,\n lastName: ctx.flags.adminLastName as string | undefined,\n },\n fallbackAdmin: gitAdminIdentity(frameworkRoot),\n });\n if (generatedKeys.length > 0) ctx.log.info(` secrets ${dryRun ? 'that would be generated' : 'generated and stored'}: ${generatedKeys.length}`);\n\n // The image is built from the WORKING TREE (its compiled output), so a tree that differs from HEAD says so in the tag:\n // the commit alone would describe bytes the image does not hold.\n const commit = execFileSync('git', ['rev-parse', '--short=12', 'HEAD'], { cwd: frameworkRoot, encoding: 'utf8' }).trim();\n const dirty = execFileSync('git', ['status', '--porcelain', '--untracked-files=no'], { cwd: frameworkRoot, encoding: 'utf8' }).trim().length > 0;\n const platformImage = keepImage\n ? runningImage\n : fromCheckout\n ? `wildo-platform:registry-host-${commit}${dirty ? '-dirty' : ''}`\n : `docker.io/wildoai/wildo-platform:${(ctx.flags.imageTag as string | undefined)?.trim() || frameworkVersion}`;\n const env = serializeRegistryHostEnv(buildRegistryHostEnv({ platformImage, secrets }));\n const templates = readRegistryHostTemplates(frameworkRoot);\n ctx.log.info(` image: ${platformImage}${fromCheckout ? ' (built from this checkout)' : ''}`);\n ctx.log.info(` writes ${REGISTRY_HOST_DIRECTORY}/{docker-compose.yml, Caddyfile, .env (0600, ${env.split('\\n').length - 2} values)}`);\n if (dryRun) {\n ctx.log.success(' Planned. Nothing was stored, built or sent.');\n return { success: true };\n }\n\n ctx.log.info(' preparing the host (Docker, log rotation)');\n const prepared = await runOnRegistryHost(host, PREPARE_HOST_SCRIPT);\n if (prepared.code !== 0) throw new Error(`Preparing the host failed: ${prepared.stderr.trim() || prepared.stdout.trim()}`);\n const hostArch = prepared.stdout.trim().split('\\n').at(-1)!;\n for (const line of prepared.stdout.trim().split('\\n').slice(0, -1)) ctx.log.info(` ${line}`);\n\n if (fromCheckout) {\n const localArch = execFileSync('docker', ['info', '--format', '{{.Architecture}}'], { encoding: 'utf8' }).trim();\n if (normalizeArch(localArch) !== normalizeArch(hostArch)) {\n throw new Error(`--fromCheckout builds for this machine (${localArch}) and the host is ${hostArch}; deploy a published image instead.`);\n }\n const layout = resolveFrameworkLayout(frameworkRoot);\n ctx.log.info(' building the platform image from this checkout');\n execFileSync('docker', ['build', '-f', layout.platformBaseDockerfilePath, '-t', platformImage, layout.repositoryRoot], { cwd: layout.repositoryRoot, stdio: 'inherit' });\n ctx.log.info(' streaming it to the host');\n await streamImageToRegistryHost(host, platformImage);\n }\n\n ctx.log.info(' writing the compose project');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/docker-compose.yml`, templates['docker-compose.yml'], '644');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/Caddyfile`, templates.Caddyfile, '644');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/.env`, env, '600');\n\n const compose = `cd ${shellQuote(REGISTRY_HOST_DIRECTORY)} && docker compose`;\n ctx.log.info(' starting');\n // `missing`, never `always`: a checkout image exists only on the host, and pulling it again fails. Every other image\n // is pinned or deliberately a moving tag pulled once (caddy:2-alpine).\n //\n // Deliberately NOT `DockerComposeReadinessService.startAndWait`, the door every LOCAL converge goes through (#2161).\n // This project runs on a remote host over SSH, and that service drives the local Docker CLI (`docker compose ps`,\n // `docker inspect`, `docker compose logs`) to gate initializers, so routing it here would gate the wrong daemon. The\n // two halves it would add are covered differently: a failed INIT is reported by `printLogs` below with the\n // services' own logs, and readiness is `waitForRegistry`. What this lane does not have is `platform-init`'s phase\n // progress while `up` blocks on it, and a ceiling: `runOnRegistryHost` sets no deadline on the SSH session, so a\n // stuck remote init holds this command until someone interrupts it.\n const up = await runOnRegistryHost(host, `${compose} up -d --remove-orphans --pull missing`, { stream: true });\n if (up.code !== 0) {\n // `up` fails when INIT exits non-zero, before the readiness wait could print why: print it here.\n await this.printLogs(host, compose, ['platform-init', 'platform-apps-manager', 'platform-module-registry']);\n throw new Error('docker compose up failed (the services\\' logs are above).');\n }\n\n const ready = await this.waitForRegistry(ctx, host, compose);\n if (!ready) return { success: false, message: 'The registry did not become healthy; the logs above say why.' };\n if (!(await this.checkPublic(ctx))) {\n return { success: false, message: `The registry is healthy on the host but https://${registryHostDomain()}/health/ready does not answer 200.` };\n }\n await this.ensureBackupsAndMonitoring(ctx, frameworkRoot, host, templates);\n return { success: true };\n }\n\n /**\n * Install the nightly backup and ensure its Better Stack monitoring, when both are configured. Without them the\n * registry still runs, and this says so plainly rather than pretending a backup exists.\n */\n private async ensureBackupsAndMonitoring(\n ctx: CommandContext,\n frameworkRoot: string,\n host: WildoFrameworkModuleRegistryHost,\n templates: ReturnType<typeof readRegistryHostTemplates>,\n ): Promise<void> {\n const backup = loadFrameworkSecretsSection(frameworkRoot, FRAMEWORK_SECRETS_REGISTRY_HOST_BACKUP_KEY, WildoFrameworkRegistryHostBackupSchema);\n const betterStack = loadFrameworkSecretsSection(frameworkRoot, FRAMEWORK_SECRETS_BETTER_STACK_KEY, WildoFrameworkBetterStackSchema);\n if (!backup || !betterStack) {\n ctx.log.warn(` NO BACKUPS: the framework secrets have no ${!backup ? 'registryHostBackup' : ''}${!backup && !betterStack ? ' and no ' : ''}${!betterStack ? 'betterStack' : ''} section. The registry's data lives on this one host only.`);\n return;\n }\n ctx.log.info(' monitoring (Better Stack)');\n const monitoring = await ensureRegistryHostMonitoring({ apiUrl: betterStack.apiUrl, token: betterStack.uptimeApiToken, domain: registryHostDomain() });\n ctx.log.info(` uptime monitor ${monitoring.monitor.action}: ${monitoring.monitor.url}`);\n ctx.log.info(` backup heartbeat ${monitoring.heartbeat.action}`);\n\n ctx.log.info(' backups (restic to Scaleway Object Storage, daily)');\n const backupEnv = buildRegistryHostBackupEnv({\n backup,\n heartbeatUrl: monitoring.heartbeat.pingUrl,\n objectStoreClientImage: registryHostObjectStoreClientImage(templates['docker-compose.yml']),\n });\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/backup.sh`, templates['backup.sh'], '700');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/restore-check.sh`, templates['restore-check.sh'], '700');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/backup.env`, backupEnv, '600');\n for (const unit of REGISTRY_BACKUP_SYSTEMD_UNITS) await writeRegistryHostFile(host, `/etc/systemd/system/${unit}`, templates[unit], '644');\n const enabled = await runOnRegistryHost(host, 'systemctl daemon-reload && systemctl enable --now wildo-registry-backup.timer && systemctl list-timers wildo-registry-backup.timer --no-pager | sed -n 2p');\n if (enabled.code !== 0) throw new Error(`Enabling the backup timer failed: ${enabled.stderr.trim() || enabled.stdout.trim()}`);\n ctx.log.info(` timer: ${enabled.stdout.trim().replace(/\\s+/g, ' ')}`);\n }\n\n /**\n * Restore the latest backup aside (a temporary directory and a throwaway PostgreSQL, both removed) and pass only if\n * the dump loads cleanly and every published artifact comes back byte for byte. See `restore-check.sh`.\n */\n private async restoreCheck(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n ctx.log.info('[fwk registry-host] restoring the latest backup aside and checking it');\n const run = await runOnRegistryHost(host, `${REGISTRY_HOST_DIRECTORY}/restore-check.sh`, { stream: true });\n return run.code === 0 ? { success: true } : { success: false, message: 'The latest backup does not restore completely (see above).' };\n }\n\n /** Run the backup now (the same unit the timer starts) and show how it ended. */\n private async runBackup(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n ctx.log.info('[fwk registry-host] running the backup now');\n const run = await runOnRegistryHost(host, 'systemctl start wildo-registry-backup.service; code=$?; journalctl -u wildo-registry-backup.service --since \"-30min\" --no-pager -o cat | tail -40; exit $code', { stream: true });\n return run.code === 0 ? { success: true } : { success: false, message: 'The backup failed (its output is above; Better Stack has been told through the heartbeat).' };\n }\n\n /** Poll the compose project until the registry is healthy, failing fast if INIT exited non-zero. */\n private async waitForRegistry(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost, compose: string): Promise<boolean> {\n const deadline = Date.now() + REGISTRY_HOST_READY_DEADLINE_MS;\n let last = '';\n while (Date.now() < deadline) {\n const ps = await runOnRegistryHost(host, `${compose} ps -a --format '{{.Service}}|{{.State}}|{{.Health}}|{{.ExitCode}}'`);\n const services = new Map(ps.stdout.trim().split('\\n').filter(Boolean).map((line) => {\n const [service, state, health, exitCode] = line.split('|');\n return [service!, { state: state!, health: health!, exitCode: exitCode! }];\n }));\n const summary = [...services].map(([name, s]) => `${name}:${s.health || s.state}`).join(' ');\n if (summary !== last) ctx.log.info(` ${summary}`);\n last = summary;\n const init = services.get('platform-init');\n if (init?.state === 'exited' && init.exitCode !== '0') {\n await this.printLogs(host, compose, ['platform-init']);\n return false;\n }\n if (services.get('platform-module-registry')?.health === 'healthy') {\n ctx.log.success(' the registry is healthy on the host');\n return true;\n }\n await new Promise((resolve) => setTimeout(resolve, 10_000));\n }\n await this.printLogs(host, compose, ['platform-init', 'platform-apps-manager', 'platform-module-registry']);\n return false;\n }\n\n /** The public name answers through Cloudflare and Caddy; the first request also issues the certificate. */\n private async checkPublic(ctx: CommandContext): Promise<boolean> {\n const url = `https://${registryHostDomain()}/health/ready`;\n const deadline = Date.now() + PUBLIC_READY_DEADLINE_MS;\n let lastStatus = '';\n while (Date.now() < deadline) {\n try {\n const response = await fetch(url, { signal: AbortSignal.timeout(PUBLIC_READY_PROBE_TIMEOUT_MS) });\n await response.body?.cancel();\n if (response.status === 200) {\n ctx.log.success(` ${url} answers 200`);\n return true;\n }\n lastStatus = String(response.status);\n } catch (error) {\n lastStatus = ErrorUtils.extractErrorMessage(error);\n }\n await new Promise((resolve) => setTimeout(resolve, 10_000));\n }\n ctx.log.error(` ${url}: ${lastStatus}`);\n return false;\n }\n\n private async printLogs(host: WildoFrameworkModuleRegistryHost, compose: string, services: string[]): Promise<void> {\n await runOnRegistryHost(host, `${compose} logs --no-color --tail 80 ${services.join(' ')}`, { stream: true });\n }\n\n /**\n * Mint a registry key for the platform owner organization (which owns the domains this host serves), through\n * apps-manager's loopback admin door on the host. By default the secret is stored as this machine's credential for\n * the public registry, as `wildo registry login` would, and never printed; `--print` prints it once instead.\n */\n private async mintKey(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n const role = ctx.flags.role as RegistryKeyRole | undefined;\n if (!role || !Object.values(RegistryKeyRole).includes(role)) return { success: false, message: `--role must be one of: ${Object.values(RegistryKeyRole).join(', ')}.` };\n const name = ctx.flags.name as string | undefined;\n if (!name) return { success: false, message: '--name is required.' };\n const rawExpiry = ctx.flags.expiresInDays as string | undefined;\n const minted = await runOnRegistryHost(host, buildRegistryHostKeyMintCommand({ name, role, ...(rawExpiry !== undefined ? { expiresInDays: Number(rawExpiry) } : {}) } as never));\n if (minted.code !== 0) return { success: false, message: `Minting the key failed: ${minted.stdout.trim() || minted.stderr.trim() || `exit ${minted.code}`}` };\n // The admin door answers the bare object, as `AppBootstrapService.mintRegistryKey` reads it.\n const key = RegistryKeyMintResponseSchema.parse(JSON.parse(minted.stdout));\n ctx.log.success(`Registry key '${name}' (${key.role}) for organization ${key.organizationSlug}, expires ${key.expiresAt}, id ${key.apiKeyId}.`);\n if (ctx.flags.print === true) {\n ctx.log.warn('The secret below is shown ONCE and is not stored anywhere:');\n ctx.log.info(key.plainKey);\n return { success: true };\n }\n await RegistryCredentialsService.set({ registryUrl: DEFAULT_PUBLIC_REGISTRY_URL, rawToken: key.plainKey, organizationId: key.organizationId, apiKeyId: key.apiKeyId, apiKeyName: name });\n ctx.log.info(` stored as this machine's credential for ${DEFAULT_PUBLIC_REGISTRY_URL} (\\`wildo registry whoami --registry public --verify\\`)`);\n return { success: true };\n }\n\n private async status(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n const ps = await runOnRegistryHost(host, `cd ${shellQuote(REGISTRY_HOST_DIRECTORY)} 2>/dev/null && docker compose ps -a --format 'table {{.Service}}\\t{{.State}}\\t{{.Health}}\\t{{.Image}}' || echo 'not deployed'`);\n ctx.log.info(ps.stdout.trimEnd());\n return { success: await this.checkPublicOnce(ctx) };\n }\n\n private async checkPublicOnce(ctx: CommandContext): Promise<boolean> {\n const url = `https://${registryHostDomain()}/health/ready`;\n try {\n const response = await fetch(url, { signal: AbortSignal.timeout(PUBLIC_READY_PROBE_TIMEOUT_MS) });\n await response.body?.cancel();\n (response.status === 200 ? ctx.log.success : ctx.log.warn)(`${url} → ${response.status}`);\n return response.status === 200;\n } catch (error) {\n ctx.log.warn(`${url} → ${ErrorUtils.extractErrorMessage(error)}`);\n return false;\n }\n }\n}\n\n/** `uname -m` and Docker's architecture name the same machines differently (aarch64/arm64, x86_64/amd64). */\nfunction normalizeArch(arch: string): string {\n return ({ aarch64: 'arm64', x86_64: 'amd64' } as Record<string, string>)[arch] ?? arch;\n}\n"]}
1
+ {"version":3,"file":"registry-host.command.js","sourceRoot":"","sources":["../../../../src/commands/fwk/registry-host.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,0CAA0C,EAC1C,+BAA+B,EAC/B,sCAAsC,EACtC,6BAA6B,EAC7B,eAAe,EACf,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AACvG,OAAO,EAAE,4BAA4B,EAAE,MAAM,sEAAsE,CAAC;AACpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,+BAA+B,EAC/B,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,0BAA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AC,IAAI,CAAC,IAAI,IAAI,CAAC;AACzF,CAAC","sourcesContent":["/**\n * `wildo fwk registry-host <deploy|status>` — deploy the public module registry to its machine (#2135).\n *\n * wildo fwk registry-host deploy --dryRun # show the plan; generate nothing durable, touch nothing remote\n * wildo fwk registry-host deploy # the published platform image for this framework version\n * wildo fwk registry-host deploy --fromCheckout # build the platform image from this checkout and ship it\n * wildo fwk registry-host status\n * wildo fwk registry-host key --name release --role publish # mint a key; store it as this machine's credential\n * wildo fwk registry-host backup # run the nightly backup now, and show how it ended\n * wildo fwk registry-host restore-check # restore the latest backup aside and prove it complete\n * wildo fwk registry-host upgrade --imageTag 1.1.14 # back up, then move the running image (what a release runs)\n * wildo fwk registry-host authorize-ci --publicKeyFile k.pub # let the release's key run that upgrade, and only it\n *\n * Backups and monitoring are part of `deploy` when their secrets exist (`registryHostBackup` and `betterStack` in the\n * framework secrets): a daily restic backup of PostgreSQL, the object store and the host's .env to Scaleway Object\n * Storage (7 daily, 4 weekly, 3 monthly), and a Better Stack uptime monitor plus the heartbeat the backup reports to.\n * See `templates/infra/registry-host/backup.sh` and `registry-host-monitoring.ts`.\n *\n * The machine is `moduleRegistryHost` in the gitignored framework secrets file (`.wildo-framework/framework-secrets/\n * secrets.json`: `{ \"moduleRegistryHost\": { \"address\": \"…\", \"sshPort\": 2725, \"sshUser\": \"root\" } }`), never the tracked\n * config, because its address is the origin behind the registry's CDN. Its public name is\n * `DEFAULT_PUBLIC_REGISTRY_URL`. What runs there is `templates/infra/registry-host/` (see its compose file), and the\n * secrets are generated once and kept in the framework secrets file (`registry-host.service.ts`).\n *\n * Every step is idempotent, so a deploy is also the upgrade and the repair: Docker is installed only if absent, files\n * are rewritten, `docker compose up -d` recreates only what changed, and apps-manager's INIT exits 0 when it has\n * already run. Data lives in named volumes and survives every redeploy.\n *\n * The published images up to 1.1.8 predate the two apps-manager changes this host needs (no `K8S_NAMESPACE` required\n * at boot outside `local`, no Kubernetes endpoints built at INIT without one), so until a release carries them a plain\n * `deploy` stops at INIT and only `--fromCheckout` works.\n *\n * `--fromCheckout` exists because the published image lags the checkout between releases: the image is built here,\n * for this machine's architecture, and streamed to the host with `docker save | ssh docker load`. Nothing is pushed to\n * any public registry. The host's architecture must match (both are arm64 today); the command refuses otherwise.\n */\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport {\n DEFAULT_PUBLIC_REGISTRY_URL,\n FRAMEWORK_SECRETS_BETTER_STACK_KEY,\n FRAMEWORK_SECRETS_REGISTRY_HOST_BACKUP_KEY,\n WildoFrameworkBetterStackSchema,\n WildoFrameworkRegistryHostBackupSchema,\n RegistryKeyMintResponseSchema,\n RegistryKeyRole,\n resolveFrameworkLayout,\n type WildoFrameworkModuleRegistryHost,\n} from '@wildo-ai/platform-config-lib';\nimport { RegistryCredentialsService } from '~wildo-cli/services/registry/registry-credentials.service';\nimport { ensureRegistryHostMonitoring } from '~wildo-cli/services/framework/registry-host/registry-host-monitoring';\nimport { FrameworkReleaseService } from '~wildo-cli/services/framework/framework-release.service';\nimport {\n REGISTRY_HOST_DIRECTORY,\n buildRegistryHostEnv,\n buildRegistryHostKeyMintCommand,\n gitAdminIdentity,\n readRegistryHostTemplates,\n registryHostDomain,\n findUnsettledImagePackages,\n buildRegistryHostBackupEnv,\n loadFrameworkSecretsSection,\n loadRegistryHostConnection,\n registryHostObjectStoreClientImage,\n REGISTRY_BACKUP_SYSTEMD_UNITS,\n resolveRegistryHostSecrets,\n serializeRegistryHostEnv,\n} from '~wildo-cli/services/framework/registry-host/registry-host.service';\nimport {\n runOnRegistryHost,\n shellQuote,\n streamImageToRegistryHost,\n writeRegistryHostFile,\n} from '~wildo-cli/services/framework/registry-host/registry-host-remote';\nimport {\n buildAuthorizeCiRemoteScript,\n buildRegistryHostCiAuthorizedKeyLine,\n isRegistryHostReleaseTag,\n parseRegistryHostInspection,\n REGISTRY_HOST_UPGRADE_SCRIPT,\n registryHostEnvKeyNames,\n upgradeBlockers,\n} from '~wildo-cli/services/framework/registry-host/registry-host-upgrade';\n\n/** The verb's actions — a closed vocabulary. */\nexport enum RegistryHostAction {\n DEPLOY = 'deploy',\n STATUS = 'status',\n KEY = 'key',\n BACKUP = 'backup',\n RESTORE_CHECK = 'restore-check',\n /** Move the running platform image, after a backup; the step a release runs before the provider modules (#3795). */\n UPGRADE = 'upgrade',\n /** Install (or with `--revoke`, remove) the release's deploy key, restricted to the upgrade script (#3795). */\n AUTHORIZE_CI = 'authorize-ci',\n}\n\n/** How long a first boot may take: image pull, INIT (database, schema, provisioning), then two health checks. */\nconst REGISTRY_HOST_READY_DEADLINE_MS = 15 * 60_000;\n/** How long the public name may take to answer: Caddy requests its first certificate when it starts. */\nconst PUBLIC_READY_DEADLINE_MS = 5 * 60_000;\n/**\n * One `GET /health/ready` through the public name — Cloudflare, then Caddy, then the platform. Sized for the slowest\n * single answer a healthy host gives: the request that makes Caddy complete its first ACME exchange, which takes\n * seconds rather than tens of seconds. A probe still unanswered after 15s counts as one failed attempt; the polling loop\n * (bounded by {@link PUBLIC_READY_DEADLINE_MS}) is what waits for the host as a whole.\n */\nconst PUBLIC_READY_PROBE_TIMEOUT_MS = 15_000;\n\n/**\n * Prepares a fresh Ubuntu host for Compose, idempotently. Docker's own install script rather than the distribution\n * package, which lags and ships no compose plugin (the website machine's provisioning makes the same choice), and\n * bounded json-file logs, because unbounded container logs are how a small disk fills.\n */\nconst PREPARE_HOST_SCRIPT = [\n 'set -e',\n 'if ! command -v docker >/dev/null 2>&1; then curl -fsSL https://get.docker.com | sh >/dev/null; echo \"docker installed\"; fi',\n 'systemctl enable --now docker >/dev/null 2>&1 || true',\n 'if [ ! -f /etc/docker/daemon.json ]; then',\n ' printf \\'{\"log-driver\":\"json-file\",\"log-opts\":{\"max-size\":\"10m\",\"max-file\":\"3\"}}\\\\n\\' > /etc/docker/daemon.json',\n ' systemctl restart docker',\n ' echo \"docker log rotation configured\"',\n 'fi',\n 'docker compose version >/dev/null',\n 'uname -m',\n].join('\\n');\n\nexport default class FwkRegistryHostCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'fwk registry-host',\n description: 'Deploy the public module registry to its machine (moduleRegistryHost in the framework secrets), or show its state',\n category: CommandCategory.Fwk,\n args: [{ name: 'action', description: '`deploy`, `status`, `key`, `backup`, `restore-check`, `upgrade` or `authorize-ci`.', required: true }],\n flags: {\n dryRun: { type: 'boolean', description: 'deploy, upgrade: show the plan; touch nothing remote and store nothing', default: false },\n fromCheckout: { type: 'boolean', description: 'deploy: build the platform image from this checkout and stream it to the host', default: false },\n keepImage: { type: 'boolean', description: 'deploy: keep the platform image the host runs now; rewrite only configuration, backups and monitoring', default: false },\n imageTag: { type: 'string', description: 'deploy, upgrade: the published wildoai/wildo-platform tag (default: this framework version)', default: undefined },\n adminEmail: { type: 'string', description: 'deploy: the administrator apps-manager seeds (default: stored, else git user.email)', default: undefined },\n adminFirstName: { type: 'string', description: 'deploy: the administrator\\'s first name (default: stored, else git user.name)', default: undefined },\n adminLastName: { type: 'string', description: 'deploy: the administrator\\'s last name (default: stored, else git user.name)', default: undefined },\n name: { type: 'string', description: 'key: the key name (lowercase, digits, \".\", \"_\", \"-\")', default: undefined },\n role: { type: 'string', description: 'key: `read` or `publish`', default: undefined },\n expiresInDays: { type: 'string', description: 'key: days until it expires (default: the platform\\'s)', default: undefined },\n print: { type: 'boolean', description: 'key: print the secret once instead of storing it as this machine\\'s credential', default: false },\n publicKeyFile: { type: 'string', description: 'authorize-ci: the deploy key\\'s .pub file', default: undefined },\n revoke: { type: 'boolean', description: 'authorize-ci: remove the release\\'s deploy key instead', default: false },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const action = ctx.args.action as RegistryHostAction | undefined;\n if (!action || !Object.values(RegistryHostAction).includes(action)) {\n return { success: false, message: `action must be one of: ${Object.values(RegistryHostAction).join(', ')}.` };\n }\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (!frameworkRoot) return { success: false, message: '`wildo fwk registry-host` runs from a framework checkout, and this is not one.' };\n const config = await FrameworkReleaseService.loadFrameworkConfig(frameworkRoot);\n if (!config) return { success: false, message: `No framework config at ${FrameworkReleaseService.resolveFrameworkConfigPath(frameworkRoot)}.` };\n let host: WildoFrameworkModuleRegistryHost | null;\n try {\n host = loadRegistryHostConnection(frameworkRoot);\n } catch (error) {\n return { success: false, message: ErrorUtils.extractErrorMessage(error) };\n }\n if (!host) {\n return {\n success: false,\n message: `No moduleRegistryHost in ${FrameworkReleaseService.resolveFrameworkSecretsPath(frameworkRoot)}: add { \"moduleRegistryHost\": { \"address\": \"…\", \"sshPort\": 22, \"sshUser\": \"root\" } }.`,\n };\n }\n try {\n switch (action) {\n case RegistryHostAction.STATUS: return await this.status(ctx, host);\n case RegistryHostAction.KEY: return await this.mintKey(ctx, host);\n case RegistryHostAction.BACKUP: return await this.runBackup(ctx, host);\n case RegistryHostAction.RESTORE_CHECK: return await this.restoreCheck(ctx, host);\n case RegistryHostAction.DEPLOY: return await this.deploy(ctx, frameworkRoot, host, config.frameworkVersion);\n case RegistryHostAction.UPGRADE: return await this.upgrade(ctx, frameworkRoot, host, config.frameworkVersion);\n case RegistryHostAction.AUTHORIZE_CI: return await this.authorizeCi(ctx, host);\n }\n } catch (error) {\n return { success: false, message: ErrorUtils.extractErrorMessage(error) };\n }\n }\n\n private async deploy(ctx: CommandContext, frameworkRoot: string, host: WildoFrameworkModuleRegistryHost, frameworkVersion: string): Promise<CommandResult> {\n const dryRun = ctx.flags.dryRun === true;\n const fromCheckout = ctx.flags.fromCheckout === true;\n const keepImage = ctx.flags.keepImage === true;\n if (keepImage && (fromCheckout || ctx.flags.imageTag !== undefined)) {\n return { success: false, message: '--keepImage reuses the image the host runs; it cannot be combined with --fromCheckout or --imageTag.' };\n }\n // The image the host runs now, from its own .env: what --keepImage keeps, so a configuration change (backups,\n // monitoring, a proxy setting) never swaps the running code underneath.\n const runningImage = keepImage\n ? (await runOnRegistryHost(host, `sed -n 's/^PLATFORM_IMAGE=//p' ${shellQuote(`${REGISTRY_HOST_DIRECTORY}/.env`)}`)).stdout.trim()\n : '';\n if (keepImage && !runningImage) return { success: false, message: '--keepImage: the host has no deployed .env to read its image from; deploy it first.' };\n const target = `${host.sshUser}@${host.address}:${host.sshPort}`;\n ctx.log.info(`[fwk registry-host] ${registryHostDomain()} → ${target}${dryRun ? ' (dry run)' : ''}`);\n\n // An image from the checkout ships the watchers' compiled output as it stands: refuse while any of it is unsettled,\n // before anything is generated or stored.\n const unsettled = fromCheckout ? findUnsettledImagePackages(frameworkRoot) : [];\n if (unsettled.length > 0) {\n return {\n success: false,\n message: `--fromCheckout would ship compiled output that is not settled: ${unsettled.join(', ')}. Wait for the dev watchers to settle (their record: .wildo-runtime-signals/dev-compile-status.json) and run again.`,\n };\n }\n const { secrets, generatedKeys } = resolveRegistryHostSecrets({\n frameworkRoot,\n persist: !dryRun,\n admin: {\n email: ctx.flags.adminEmail as string | undefined,\n firstName: ctx.flags.adminFirstName as string | undefined,\n lastName: ctx.flags.adminLastName as string | undefined,\n },\n fallbackAdmin: gitAdminIdentity(frameworkRoot),\n });\n if (generatedKeys.length > 0) ctx.log.info(` secrets ${dryRun ? 'that would be generated' : 'generated and stored'}: ${generatedKeys.length}`);\n\n // The image is built from the WORKING TREE (its compiled output), so a tree that differs from HEAD says so in the tag:\n // the commit alone would describe bytes the image does not hold.\n const commit = execFileSync('git', ['rev-parse', '--short=12', 'HEAD'], { cwd: frameworkRoot, encoding: 'utf8' }).trim();\n const dirty = execFileSync('git', ['status', '--porcelain', '--untracked-files=no'], { cwd: frameworkRoot, encoding: 'utf8' }).trim().length > 0;\n const platformImage = keepImage\n ? runningImage\n : fromCheckout\n ? `wildo-platform:registry-host-${commit}${dirty ? '-dirty' : ''}`\n : `docker.io/wildoai/wildo-platform:${(ctx.flags.imageTag as string | undefined)?.trim() || frameworkVersion}`;\n const env = serializeRegistryHostEnv(buildRegistryHostEnv({ platformImage, secrets }));\n const templates = readRegistryHostTemplates(frameworkRoot);\n ctx.log.info(` image: ${platformImage}${fromCheckout ? ' (built from this checkout)' : ''}`);\n ctx.log.info(` writes ${REGISTRY_HOST_DIRECTORY}/{docker-compose.yml, Caddyfile, .env (0600, ${env.split('\\n').length - 2} values)}`);\n if (dryRun) {\n ctx.log.success(' Planned. Nothing was stored, built or sent.');\n return { success: true };\n }\n\n ctx.log.info(' preparing the host (Docker, log rotation)');\n const prepared = await runOnRegistryHost(host, PREPARE_HOST_SCRIPT);\n if (prepared.code !== 0) throw new Error(`Preparing the host failed: ${prepared.stderr.trim() || prepared.stdout.trim()}`);\n const hostArch = prepared.stdout.trim().split('\\n').at(-1)!;\n for (const line of prepared.stdout.trim().split('\\n').slice(0, -1)) ctx.log.info(` ${line}`);\n\n if (fromCheckout) {\n const localArch = execFileSync('docker', ['info', '--format', '{{.Architecture}}'], { encoding: 'utf8' }).trim();\n if (normalizeArch(localArch) !== normalizeArch(hostArch)) {\n throw new Error(`--fromCheckout builds for this machine (${localArch}) and the host is ${hostArch}; deploy a published image instead.`);\n }\n const layout = resolveFrameworkLayout(frameworkRoot);\n ctx.log.info(' building the platform image from this checkout');\n execFileSync('docker', ['build', '-f', layout.platformBaseDockerfilePath, '-t', platformImage, layout.repositoryRoot], { cwd: layout.repositoryRoot, stdio: 'inherit' });\n ctx.log.info(' streaming it to the host');\n await streamImageToRegistryHost(host, platformImage);\n }\n\n ctx.log.info(' writing the compose project');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/docker-compose.yml`, templates['docker-compose.yml'], '644');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/Caddyfile`, templates.Caddyfile, '644');\n await writeRegistryHostFile(host, REGISTRY_HOST_UPGRADE_SCRIPT, templates['upgrade-image.sh'], '755');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/.env`, env, '600');\n\n const compose = `cd ${shellQuote(REGISTRY_HOST_DIRECTORY)} && docker compose`;\n ctx.log.info(' starting');\n // `missing`, never `always`: a checkout image exists only on the host, and pulling it again fails. Every other image\n // is pinned or deliberately a moving tag pulled once (caddy:2-alpine).\n //\n // Deliberately NOT `DockerComposeReadinessService.startAndWait`, the door every LOCAL converge goes through (#2161).\n // This project runs on a remote host over SSH, and that service drives the local Docker CLI (`docker compose ps`,\n // `docker inspect`, `docker compose logs`) to gate initializers, so routing it here would gate the wrong daemon. The\n // two halves it would add are covered differently: a failed INIT is reported by `printLogs` below with the\n // services' own logs, and readiness is `waitForRegistry`. What this lane does not have is `platform-init`'s phase\n // progress while `up` blocks on it, and a ceiling: `runOnRegistryHost` sets no deadline on the SSH session, so a\n // stuck remote init holds this command until someone interrupts it.\n const up = await runOnRegistryHost(host, `${compose} up -d --remove-orphans --pull missing`, { stream: true });\n if (up.code !== 0) {\n // `up` fails when INIT exits non-zero, before the readiness wait could print why: print it here.\n await this.printLogs(host, compose, ['platform-init', 'platform-apps-manager', 'platform-module-registry']);\n throw new Error('docker compose up failed (the services\\' logs are above).');\n }\n\n const ready = await this.waitForRegistry(ctx, host, compose);\n if (!ready) return { success: false, message: 'The registry did not become healthy; the logs above say why.' };\n if (!(await this.checkPublic(ctx))) {\n return { success: false, message: `The registry is healthy on the host but https://${registryHostDomain()}/health/ready does not answer 200.` };\n }\n await this.ensureBackupsAndMonitoring(ctx, frameworkRoot, host, templates);\n return { success: true };\n }\n\n /**\n * Move the running platform image to `--imageTag` (default: this framework version), after a backup taken on the host\n * (#3795). Only the image moves: when this checkout would deploy a different compose file, Caddyfile or upgrade script,\n * or a `.env` variable the host lacks, it refuses and names `deploy`, because the image alone would run against a\n * configuration written for another release. The host does the work in `upgrade-image.sh`, so this runs the same way\n * from an operator's key and from the release's restricted one.\n */\n private async upgrade(ctx: CommandContext, frameworkRoot: string, host: WildoFrameworkModuleRegistryHost, frameworkVersion: string): Promise<CommandResult> {\n const dryRun = ctx.flags.dryRun === true;\n const tag = (ctx.flags.imageTag as string | undefined)?.trim() || frameworkVersion;\n if (!isRegistryHostReleaseTag(tag)) return { success: false, message: `--imageTag must be a release version (x.y.z), got \"${tag}\".` };\n ctx.log.info(`[fwk registry-host] upgrade ${registryHostDomain()} to wildo-platform:${tag}${dryRun ? ' (dry run)' : ''}`);\n\n const inspected = await runOnRegistryHost(host, `${REGISTRY_HOST_UPGRADE_SCRIPT} --inspect`);\n if (inspected.code !== 0) {\n return {\n success: false,\n message: `The host could not be inspected (${inspected.stderr.trim() || `exit ${inspected.code}`}). A host deployed before #3795 has no ${REGISTRY_HOST_UPGRADE_SCRIPT}: run \\`wildo fwk registry-host deploy\\` once.`,\n };\n }\n const inspection = parseRegistryHostInspection(inspected.stdout);\n const blockers = upgradeBlockers({ inspection, templates: readRegistryHostTemplates(frameworkRoot), envKeyNames: registryHostEnvKeyNames() });\n ctx.log.info(` running: ${inspection.image}`);\n if (blockers.length > 0) {\n return {\n success: false,\n message: `Moving the image is not enough for this release: ${blockers.join('; ')}. Run \\`wildo fwk registry-host deploy --imageTag ${tag}\\` from a framework checkout holding the registry host's secrets.`,\n };\n }\n if (dryRun) {\n const already = inspection.image.endsWith(`/wildo-platform:${tag}`);\n ctx.log.success(already ? ` It already runs wildo-platform:${tag}. Nothing was changed.` : ` Planned: back up, then move to wildo-platform:${tag}. Nothing was changed.`);\n return { success: true };\n }\n const run = await runOnRegistryHost(host, `${REGISTRY_HOST_UPGRADE_SCRIPT} ${tag}`, { stream: true });\n if (run.code !== 0) return { success: false, message: 'The upgrade failed on the host (its output is above).' };\n if (!(await this.checkPublic(ctx))) {\n return { success: false, message: `The registry is healthy on the host but https://${registryHostDomain()}/health/ready does not answer 200.` };\n }\n return { success: true };\n }\n\n /**\n * Install the release's deploy key, or remove it with `--revoke` (#3795). The key is restricted on the host itself\n * (`command=\"…upgrade-image.sh\",restrict`), so whoever holds it can move the registry to a published release image and\n * do nothing else: no shell, no forwarding, no other file. Authorizing again replaces the key.\n */\n private async authorizeCi(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n const revoke = ctx.flags.revoke === true;\n const publicKeyFile = (ctx.flags.publicKeyFile as string | undefined)?.trim();\n if (!revoke && !publicKeyFile) return { success: false, message: 'authorize-ci needs --publicKeyFile <key.pub> (or --revoke).' };\n const line = revoke ? '' : buildRegistryHostCiAuthorizedKeyLine(readFileSync(publicKeyFile!, 'utf8'));\n const result = await runOnRegistryHost(host, buildAuthorizeCiRemoteScript(revoke), revoke ? {} : { stdin: `${line}\\n` });\n if (result.code !== 0) return { success: false, message: `Could not update authorized_keys on the host: ${result.stderr.trim() || `exit ${result.code}`}` };\n const count = Number(result.stdout.trim().split('\\n').at(-1));\n if (revoke ? count !== 0 : count !== 1) return { success: false, message: `authorized_keys holds ${count} release key line(s) after the change; expected ${revoke ? 0 : 1}.` };\n ctx.log.success(revoke ? ' The release\\'s deploy key is removed.' : ` The release's deploy key can run ${REGISTRY_HOST_UPGRADE_SCRIPT} and nothing else.`);\n return { success: true };\n }\n\n /**\n * Install the nightly backup and ensure its Better Stack monitoring, when both are configured. Without them the\n * registry still runs, and this says so plainly rather than pretending a backup exists.\n */\n private async ensureBackupsAndMonitoring(\n ctx: CommandContext,\n frameworkRoot: string,\n host: WildoFrameworkModuleRegistryHost,\n templates: ReturnType<typeof readRegistryHostTemplates>,\n ): Promise<void> {\n const backup = loadFrameworkSecretsSection(frameworkRoot, FRAMEWORK_SECRETS_REGISTRY_HOST_BACKUP_KEY, WildoFrameworkRegistryHostBackupSchema);\n const betterStack = loadFrameworkSecretsSection(frameworkRoot, FRAMEWORK_SECRETS_BETTER_STACK_KEY, WildoFrameworkBetterStackSchema);\n if (!backup || !betterStack) {\n ctx.log.warn(` NO BACKUPS: the framework secrets have no ${!backup ? 'registryHostBackup' : ''}${!backup && !betterStack ? ' and no ' : ''}${!betterStack ? 'betterStack' : ''} section. The registry's data lives on this one host only.`);\n return;\n }\n ctx.log.info(' monitoring (Better Stack)');\n const monitoring = await ensureRegistryHostMonitoring({ apiUrl: betterStack.apiUrl, token: betterStack.uptimeApiToken, domain: registryHostDomain() });\n ctx.log.info(` uptime monitor ${monitoring.monitor.action}: ${monitoring.monitor.url}`);\n ctx.log.info(` backup heartbeat ${monitoring.heartbeat.action}`);\n\n ctx.log.info(' backups (restic to Scaleway Object Storage, daily)');\n const backupEnv = buildRegistryHostBackupEnv({\n backup,\n heartbeatUrl: monitoring.heartbeat.pingUrl,\n objectStoreClientImage: registryHostObjectStoreClientImage(templates['docker-compose.yml']),\n });\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/backup.sh`, templates['backup.sh'], '700');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/restore-check.sh`, templates['restore-check.sh'], '700');\n await writeRegistryHostFile(host, `${REGISTRY_HOST_DIRECTORY}/backup.env`, backupEnv, '600');\n for (const unit of REGISTRY_BACKUP_SYSTEMD_UNITS) await writeRegistryHostFile(host, `/etc/systemd/system/${unit}`, templates[unit], '644');\n const enabled = await runOnRegistryHost(host, 'systemctl daemon-reload && systemctl enable --now wildo-registry-backup.timer && systemctl list-timers wildo-registry-backup.timer --no-pager | sed -n 2p');\n if (enabled.code !== 0) throw new Error(`Enabling the backup timer failed: ${enabled.stderr.trim() || enabled.stdout.trim()}`);\n ctx.log.info(` timer: ${enabled.stdout.trim().replace(/\\s+/g, ' ')}`);\n }\n\n /**\n * Restore the latest backup aside (a temporary directory and a throwaway PostgreSQL, both removed) and pass only if\n * the dump loads cleanly and every published artifact comes back byte for byte. See `restore-check.sh`.\n */\n private async restoreCheck(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n ctx.log.info('[fwk registry-host] restoring the latest backup aside and checking it');\n const run = await runOnRegistryHost(host, `${REGISTRY_HOST_DIRECTORY}/restore-check.sh`, { stream: true });\n return run.code === 0 ? { success: true } : { success: false, message: 'The latest backup does not restore completely (see above).' };\n }\n\n /** Run the backup now (the same unit the timer starts) and show how it ended. */\n private async runBackup(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n ctx.log.info('[fwk registry-host] running the backup now');\n const run = await runOnRegistryHost(host, 'systemctl start wildo-registry-backup.service; code=$?; journalctl -u wildo-registry-backup.service --since \"-30min\" --no-pager -o cat | tail -40; exit $code', { stream: true });\n return run.code === 0 ? { success: true } : { success: false, message: 'The backup failed (its output is above; Better Stack has been told through the heartbeat).' };\n }\n\n /** Poll the compose project until the registry is healthy, failing fast if INIT exited non-zero. */\n private async waitForRegistry(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost, compose: string): Promise<boolean> {\n const deadline = Date.now() + REGISTRY_HOST_READY_DEADLINE_MS;\n let last = '';\n while (Date.now() < deadline) {\n const ps = await runOnRegistryHost(host, `${compose} ps -a --format '{{.Service}}|{{.State}}|{{.Health}}|{{.ExitCode}}'`);\n const services = new Map(ps.stdout.trim().split('\\n').filter(Boolean).map((line) => {\n const [service, state, health, exitCode] = line.split('|');\n return [service!, { state: state!, health: health!, exitCode: exitCode! }];\n }));\n const summary = [...services].map(([name, s]) => `${name}:${s.health || s.state}`).join(' ');\n if (summary !== last) ctx.log.info(` ${summary}`);\n last = summary;\n const init = services.get('platform-init');\n if (init?.state === 'exited' && init.exitCode !== '0') {\n await this.printLogs(host, compose, ['platform-init']);\n return false;\n }\n if (services.get('platform-module-registry')?.health === 'healthy') {\n ctx.log.success(' the registry is healthy on the host');\n return true;\n }\n await new Promise((resolve) => setTimeout(resolve, 10_000));\n }\n await this.printLogs(host, compose, ['platform-init', 'platform-apps-manager', 'platform-module-registry']);\n return false;\n }\n\n /** The public name answers through Cloudflare and Caddy; the first request also issues the certificate. */\n private async checkPublic(ctx: CommandContext): Promise<boolean> {\n const url = `https://${registryHostDomain()}/health/ready`;\n const deadline = Date.now() + PUBLIC_READY_DEADLINE_MS;\n let lastStatus = '';\n while (Date.now() < deadline) {\n try {\n const response = await fetch(url, { signal: AbortSignal.timeout(PUBLIC_READY_PROBE_TIMEOUT_MS) });\n await response.body?.cancel();\n if (response.status === 200) {\n ctx.log.success(` ${url} answers 200`);\n return true;\n }\n lastStatus = String(response.status);\n } catch (error) {\n lastStatus = ErrorUtils.extractErrorMessage(error);\n }\n await new Promise((resolve) => setTimeout(resolve, 10_000));\n }\n ctx.log.error(` ${url}: ${lastStatus}`);\n return false;\n }\n\n private async printLogs(host: WildoFrameworkModuleRegistryHost, compose: string, services: string[]): Promise<void> {\n await runOnRegistryHost(host, `${compose} logs --no-color --tail 80 ${services.join(' ')}`, { stream: true });\n }\n\n /**\n * Mint a registry key for the platform owner organization (which owns the domains this host serves), through\n * apps-manager's loopback admin door on the host. By default the secret is stored as this machine's credential for\n * the public registry, as `wildo registry login` would, and never printed; `--print` prints it once instead.\n */\n private async mintKey(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n const role = ctx.flags.role as RegistryKeyRole | undefined;\n if (!role || !Object.values(RegistryKeyRole).includes(role)) return { success: false, message: `--role must be one of: ${Object.values(RegistryKeyRole).join(', ')}.` };\n const name = ctx.flags.name as string | undefined;\n if (!name) return { success: false, message: '--name is required.' };\n const rawExpiry = ctx.flags.expiresInDays as string | undefined;\n const minted = await runOnRegistryHost(host, buildRegistryHostKeyMintCommand({ name, role, ...(rawExpiry !== undefined ? { expiresInDays: Number(rawExpiry) } : {}) } as never));\n if (minted.code !== 0) return { success: false, message: `Minting the key failed: ${minted.stdout.trim() || minted.stderr.trim() || `exit ${minted.code}`}` };\n // The admin door answers the bare object, as `AppBootstrapService.mintRegistryKey` reads it.\n const key = RegistryKeyMintResponseSchema.parse(JSON.parse(minted.stdout));\n ctx.log.success(`Registry key '${name}' (${key.role}) for organization ${key.organizationSlug}, expires ${key.expiresAt}, id ${key.apiKeyId}.`);\n if (ctx.flags.print === true) {\n ctx.log.warn('The secret below is shown ONCE and is not stored anywhere:');\n ctx.log.info(key.plainKey);\n return { success: true };\n }\n await RegistryCredentialsService.set({ registryUrl: DEFAULT_PUBLIC_REGISTRY_URL, rawToken: key.plainKey, organizationId: key.organizationId, apiKeyId: key.apiKeyId, apiKeyName: name });\n ctx.log.info(` stored as this machine's credential for ${DEFAULT_PUBLIC_REGISTRY_URL} (\\`wildo registry whoami --registry public --verify\\`)`);\n return { success: true };\n }\n\n private async status(ctx: CommandContext, host: WildoFrameworkModuleRegistryHost): Promise<CommandResult> {\n const ps = await runOnRegistryHost(host, `cd ${shellQuote(REGISTRY_HOST_DIRECTORY)} 2>/dev/null && docker compose ps -a --format 'table {{.Service}}\\t{{.State}}\\t{{.Health}}\\t{{.Image}}' || echo 'not deployed'`);\n ctx.log.info(ps.stdout.trimEnd());\n return { success: await this.checkPublicOnce(ctx) };\n }\n\n private async checkPublicOnce(ctx: CommandContext): Promise<boolean> {\n const url = `https://${registryHostDomain()}/health/ready`;\n try {\n const response = await fetch(url, { signal: AbortSignal.timeout(PUBLIC_READY_PROBE_TIMEOUT_MS) });\n await response.body?.cancel();\n (response.status === 200 ? ctx.log.success : ctx.log.warn)(`${url} → ${response.status}`);\n return response.status === 200;\n } catch (error) {\n ctx.log.warn(`${url} → ${ErrorUtils.extractErrorMessage(error)}`);\n return false;\n }\n }\n}\n\n/** `uname -m` and Docker's architecture name the same machines differently (aarch64/arm64, x86_64/amd64). */\nfunction normalizeArch(arch: string): string {\n return ({ aarch64: 'arm64', x86_64: 'amd64' } as Record<string, string>)[arch] ?? arch;\n}\n"]}
@@ -60,9 +60,23 @@ export declare function planInitLine(input: {
60
60
  }): (BlueprintInitPlan & {
61
61
  init: ResolvedBlueprintInitFlags;
62
62
  }) | undefined;
63
+ /**
64
+ * Why `wildo init` must not report success: the scaffold's dependencies did not install (#3934). `null` when they did,
65
+ * when nothing was scaffolded, or when the operator asked init not to install (`--skip-install`).
66
+ *
67
+ * An application whose dependencies did not install has no framework package and no framework knowledge delivered, so
68
+ * nothing the next step runs can work. Init used to end "init completed", exit 0, there (measured on a customer install
69
+ * from get.wildo.ai that had no pnpm), and every script driving init carried on into a broken application. The scaffold
70
+ * stays on disk; the message names how to finish it.
71
+ */
72
+ export declare function uninstalledScaffoldFailure(skeleton: {
73
+ readonly installed: boolean;
74
+ } | null, installSkipped: boolean): string | null;
63
75
  export default class InitCommand extends BaseCommand {
64
76
  readonly meta: CommandMeta;
65
77
  run(ctx: CommandContext): Promise<CommandResult>;
78
+ /** Did the operator ask init not to install (`--skip-install`)? Then an uninstalled scaffold is what was asked for. */
79
+ private installSkipped;
66
80
  /**
67
81
  * The AI uses that still owe a declaration, in the next steps (#2848).
68
82
  *
@@ -1 +1 @@
1
- {"version":3,"file":"init.command.d.ts","sourceRoot":"","sources":["../../../src/commands/init.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AASH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAyB,KAAK,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AAG/H,OAAO,EAAwE,KAAK,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAGxK,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAG1F,OAAO,EAOL,KAAK,0BAA0B,EAChC,MAAM,uDAAuD,CAAC;AAsL/D,oJAAoJ;AACpJ,UAAU,iBAAiB;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAC5E,QAAQ,CA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;;;;;;;;;;;OAiBG;YACW,gCAAgC;YAoChC,qBAAqB;IAuFnC;;;;;;;;;OASG;IACH,OAAO,CAAC,qBAAqB,CAAoD;IAEjF,iEAAiE;YACnD,wBAAwB;IA0BtC,0EAA0E;IAC1E,OAAO,CAAC,2BAA2B,CAAkE;IAErG,uEAAuE;YACzD,8BAA8B;IAoB5C;;;;;;;;;;OAUG;YACW,kBAAkB;IAqBhC;;;;;;;;;;;;;;;;;OAiBG;YACW,4BAA4B;IAgE1C;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAOrB,4EAA4E;IAC5E,OAAO,CAAC,oBAAoB;IAuC5B;;;;;;;;;;OAUG;IACH;;;;;;;;;;;;;;;OAeG;YACW,yBAAyB;IA2BvC;;;;OAIG;YACW,wBAAwB;YAyCxB,uBAAuB;IAwBrC;;;;;;OAMG;YACW,oBAAoB;IA8BlC;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B;IActC,8FAA8F;IAC9F,OAAO,CAAC,gBAAgB;IAWxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,OAAO,CAAC,+BAA+B;IAqDvC,OAAO,CAAC,6BAA6B;CA8BtC"}
@@ -32,7 +32,8 @@ import chalk from 'chalk';
32
32
  import { execFileSync } from 'child_process';
33
33
  import { existsSync, mkdtempSync, realpathSync, rmSync } from 'fs';
34
34
  import { tmpdir } from 'os';
35
- import { basename, dirname, join, relative, resolve as resolvePath } from 'path';
35
+ import { basename, dirname, join, resolve as resolvePath } from 'path';
36
+ import { linkableFrameworkCheckout } from '@wildo-ai/application-creation-runtime';
36
37
  import { BaseCommand } from '../kernel/base-command.js';
37
38
  import { CommandCategory } from '../kernel/types.js';
38
39
  import { ErrorUtils } from '../infrastructure/errors/error.utils.js';
@@ -206,6 +207,22 @@ export function planInitLine(input) {
206
207
  line: resolveBlueprintLine(layers),
207
208
  };
208
209
  }
210
+ /**
211
+ * Why `wildo init` must not report success: the scaffold's dependencies did not install (#3934). `null` when they did,
212
+ * when nothing was scaffolded, or when the operator asked init not to install (`--skip-install`).
213
+ *
214
+ * An application whose dependencies did not install has no framework package and no framework knowledge delivered, so
215
+ * nothing the next step runs can work. Init used to end "init completed", exit 0, there (measured on a customer install
216
+ * from get.wildo.ai that had no pnpm), and every script driving init carried on into a broken application. The scaffold
217
+ * stays on disk; the message names how to finish it.
218
+ */
219
+ export function uninstalledScaffoldFailure(skeleton, installSkipped) {
220
+ if (skeleton === null || skeleton.installed || installSkipped)
221
+ return null;
222
+ return 'the application was scaffolded, but its dependencies did not install. Install pnpm if it is missing (re-run '
223
+ + '`curl -fsSL https://get.wildo.ai/install.sh | sh`, which installs the release\'s pinned pnpm), then run '
224
+ + '`pnpm install && wildo assets sync` in the application.';
225
+ }
209
226
  export default class InitCommand extends BaseCommand {
210
227
  meta = {
211
228
  name: 'init',
@@ -566,7 +583,8 @@ export default class InitCommand extends BaseCommand {
566
583
  // guard later enforces exactly that for the companion). A framework developer scaffolding an
567
584
  // app OUTSIDE the checkout gets — correctly — an app-creator skeleton; an in-checkout scaffold
568
585
  // is framework-dev regardless of the stored preference flag.
569
- const appInsideFramework = frameworkPath !== null && !relative(frameworkPath, cwd).startsWith('..');
586
+ // One rule with every later provider link (`linkableFrameworkCheckout`, #3903), so `wildo compose` agrees with the scaffold.
587
+ const appInsideFramework = linkableFrameworkCheckout(cwd, frameworkPath) !== null;
570
588
  const skeletonMode = appInsideFramework ? SkeletonMode.FRAMEWORK_DEV : SkeletonMode.APP_CREATOR;
571
589
  /*
572
590
  * Resolved against the operator's CWD, not the app root: they typed it before the app existed,
@@ -797,7 +815,7 @@ export default class InitCommand extends BaseCommand {
797
815
  ctx.log.info(chalk.dim(` Skeleton: ${skeletonResult.filesWritten} files (mode: ${skeletonMode})`));
798
816
  ctx.log.info(chalk.dim(` Ports: backend ${skeletonResult.ports.backend} · app ${skeletonResult.ports.app} · companion ${skeletonResult.ports.companion}`));
799
817
  ctx.log.info(chalk.dim(` Companion: ${skeletonResult.companionDelivered ? 'dist delivered' : 'NOT delivered (see warning above)'}`));
800
- if (!skeletonResult.built && ctx.flags.skipInstall !== true && ctx.flags['skip-install'] !== true) {
818
+ if (!skeletonResult.built && !this.installSkipped(ctx)) {
801
819
  ctx.log.warn(' Initial build incomplete — run `pnpm install && pnpm build` in the app before `wildo setup`.');
802
820
  }
803
821
  if (initialMigration !== null) {
@@ -879,8 +897,16 @@ export default class InitCommand extends BaseCommand {
879
897
  ctx.log.info(chalk.dim(' is what authenticates here.'));
880
898
  ctx.log.info('');
881
899
  }
900
+ // An application whose dependencies did not install is not initialized (#3934).
901
+ const uninstalled = uninstalledScaffoldFailure(skeletonResult, this.installSkipped(ctx));
902
+ if (uninstalled !== null)
903
+ return { success: false, message: uninstalled };
882
904
  return { success: true };
883
905
  }
906
+ /** Did the operator ask init not to install (`--skip-install`)? Then an uninstalled scaffold is what was asked for. */
907
+ installSkipped(ctx) {
908
+ return ctx.flags.skipInstall === true || ctx.flags['skip-install'] === true;
909
+ }
884
910
  /**
885
911
  * The AI uses that still owe a declaration, in the next steps (#2848).
886
912
  *