@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
@@ -1 +1 @@
1
- {"version":3,"file":"repair-lockfile.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/registry/repair-lockfile.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAkG1F,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,WAAW;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAexB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;YAgIxC,WAAW;IAsDzB;;;OAGG;YACW,sBAAsB;CAsErC"}
1
+ {"version":3,"file":"repair-lockfile.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/registry/repair-lockfile.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAkG1F,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,WAAW;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAexB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;YAgIxC,WAAW;IAuDzB;;;OAGG;YACW,sBAAsB;CAsErC"}
@@ -254,6 +254,7 @@ export default class RegistryRepairLockfileCommand extends BaseCommand {
254
254
  // it used to re-apply every file and silently replace local edits.
255
255
  const writePlan = await planProtectedWrite({
256
256
  saasRoot,
257
+ extractDir: paths.extractDir,
257
258
  moduleId: entry.moduleId,
258
259
  stagedPaths: await validatedStagedAppFiles({ saasRoot, extractDir: paths.extractDir, manifest: stagedManifest }),
259
260
  recorded: entry,
@@ -1 +1 @@
1
- {"version":3,"file":"repair-lockfile.command.js","sourceRoot":"","sources":["../../../../src/commands/registry/repair-lockfile.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;A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,IAAI,KAAK,CACb,6BAA6B,OAAO,oCAAoC,KAAK,CAAC,OAAO,6CAA6C,CACnI,CAAC;QACJ,CAAC;QACD,2FAA2F;QAC3F,6FAA6F;QAC7F,mFAAmF;QACnF,4BAA4B,CAAC;YAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO;YACP,YAAY;YACZ,YAAY,EAAE,cAAc;SAC7B,CAAC,CAAC;QAEH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,aAAa,EAAE;YACnE,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO;YACP,cAAc,EAAE,YAAY;SAC7B,CAAC,CAAC;QACH,IAAI,UAAU;YAAE,MAAM,0BAA0B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACpE,OAAO;YACL,YAAY,EAAE,kBAAkB,CAAC,QAAQ;YACzC,OAAO;YACP,cAAc,EAAE,YAAY;YAC5B,KAAK;YACL,QAAQ,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE;SAC/C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * `wildo registry repair-lockfile` — diagnose + (optionally) auto-fix\n * the `sections.modules` lockfile state.\n *\n * Read mode (default): runs `LockfileRepairService.inspect(saasRoot)`, which reads the application's effective pnpm\n * settings through the shared pnpm-settings helper (#2808), and renders every finding. Exit 0 when no `severity: 'error'`\n * findings; exit 1 otherwise.\n *\n * `--fix`: attempts auto-repair for the fixable finding kinds:\n * - `module-file-missing` → re-fetch the artifact via the recorded\n * registry URL + lockfile entry. Calls `RegistryServerClient.resolve`\n * against the stored exact version, REFUSES when the registry now\n * serves a different digest than the lockfile pins, downloads against\n * the PINNED digest, and re-extracts into the staging dir + re-fans-out\n * onto the SaaS source. The pin is never rewritten.\n * - `vendor-pin-missing` → write the recorded pin back into the overrides in\n * `pnpm-workspace.yaml` (#2789, #2808).\n * - `only-built-missing` → write the recorded install-script name back into\n * `onlyBuiltDependencies` in `pnpm-workspace.yaml`, then `pnpm rebuild -r` every\n * restored name (#2809): adding a name runs nothing for a package already installed.\n * `only-built-blocked` (a `neverBuiltDependencies` list names the package, or the\n * application declares both kinds of list, which pnpm refuses) is reported and\n * never written, as the install refuses it (#2801).\n * Both writes go through the pnpm-settings helper, which moves a copy an older\n * application keeps in `package.json` → `pnpm` into the workspace file (pnpm 10\n * would read that copy instead, and pnpm 11 reads none).\n *\n * `envelope-malformed` / `modules-section-malformed` are NOT\n * auto-fixable — those require manual correction. Repair can replace\n * local module source files and does not back up operator edits.\n */\n\nimport { existsSync } from 'node:fs';\nimport * as path from 'node:path';\nimport { checkModuleRequirements } from '~wildo-cli/services/registry/module-requirements.service';\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 {\n ApplicationInstallScriptPolicy,\n LockfileRepairService,\n RegistryLockfileService,\n RegistryServerClient,\n type LockfileRepairFinding,\n} from '@wildo-ai/wildo-module-client';\nimport {\n PROVIDER_WORKSPACE_FILE,\n PnpmSettingsFormatError,\n readApplicationPnpmSettings,\n writeApplicationPnpmSettings,\n localCheckoutProvenanceOf,\n ModuleDistribution,\n registryProvenanceOf,\n type RegistryModulesLockEntry,\n} from '@wildo-ai/platform-config-lib';\nimport { RegistryCredentialsService } from '~wildo-cli/services/registry/registry-credentials.service';\nimport { requireSaasRoot, resolveLockedRegistry, withRegistryWorkspaceMutationLock } from '~wildo-cli/services/registry/registry-command.utils';\nimport { fanOutToSaasSource, readStagedManifest, validatedStagedAppFiles } from '~wildo-cli/services/registry/boundary-fanout.utils';\nimport {\n describeProtectedFile,\n nextInstalledFileHashes,\n planProtectedWrite,\n registryForceBackupDirectory,\n} from '~wildo-cli/services/registry/installed-file-state.utils';\nimport { moduleArtifactPaths } from '~wildo-cli/services/registry/module-artifact-files.utils';\nimport { syncSkillsAfterProviderChange } from '~wildo-cli/services/registry/provider-install-step';\nimport { runPnpmRebuild } from '~wildo-cli/services/framework/package-install.service';\nimport { resolveLocalCheckoutModule } from '~wildo-cli/services/registry/local-checkout-module-source.service';\nimport {\n describeAcquisition,\n lockEntryProvenance,\n moduleRequirementsOriginOf,\n stageModuleAcquisition,\n type ModuleAcquisition,\n} from '~wildo-cli/services/registry/module-acquisition.utils';\nimport {\n assertServedDigestMatchesPin,\n assertStagedManifestMatchesRequest,\n} from '~wildo-cli/services/registry/artifact-trust.utils';\n\n\n\nfunction renderFinding(f: LockfileRepairFinding): string {\n const sev = f.severity.toUpperCase();\n switch (f.kind) {\n case 'envelope-malformed':\n case 'modules-section-malformed':\n return `[${sev}] ${f.kind}: ${f.message}${f.detail ? ` — ${f.detail}` : ''}`;\n case 'module-file-missing':\n return `[${sev}] ${f.kind}: ${f.moduleId} → missing file ${f.filePath}`;\n case 'vendor-pin-missing':\n return `[${sev}] ${f.kind}: ${f.moduleId} → its vendor pin ${f.name}@${f.version} is gone from the overrides in ${PROVIDER_WORKSPACE_FILE} (--fix restores it)`;\n case 'vendor-pin-moved':\n return `[${sev}] ${f.kind}: ${f.moduleId} pins ${f.name}@${f.version}, and the application moved it to ${f.found}; left as the application set it`;\n case 'only-built-missing':\n return `[${sev}] ${f.kind}: ${f.moduleId} → its vendor package ${f.name} runs an install script, and onlyBuiltDependencies in ${PROVIDER_WORKSPACE_FILE} no longer allows it (--fix restores it and rebuilds ${f.name})`;\n case 'only-built-blocked':\n return `[${sev}] ${f.kind}: ${f.moduleId} → its vendor package ${f.name} runs an install script, and ${describeBlockingPolicy(f.policy, f.name)}`;\n }\n}\n\n/** Where the application's own policy stops the script, and what the operator does about it. `--fix` writes nothing here (#2801). */\nfunction describeBlockingPolicy(policy: ApplicationInstallScriptPolicy, name: string): string {\n switch (policy) {\n case ApplicationInstallScriptPolicy.NEVER_BUILT_LIST:\n return `the application's neverBuiltDependencies lists it. Nothing is written: pnpm refuses to install with both an onlyBuiltDependencies and a `\n + `neverBuiltDependencies list. Take ${name} out of neverBuiltDependencies, then run \\`pnpm rebuild -r ${name}\\`.`;\n case ApplicationInstallScriptPolicy.CONFLICTING_LISTS:\n return `the application declares both an onlyBuiltDependencies and a neverBuiltDependencies list, and pnpm refuses to install with both. `\n + `Nothing is written. Keep one list, with ${name} allowed by it, then run \\`pnpm install\\` and \\`pnpm rebuild -r ${name}\\`.`;\n }\n}\n\n/**\n * Write each missing install-script name back into the application's `onlyBuiltDependencies` (#2809), in\n * `pnpm-workspace.yaml` through the pnpm-settings helper (#2808), as the install writes it. Starts from the effective list,\n * so a list an older application keeps in `package.json` is moved, not replaced. Called only for `only-built-missing`,\n * so the list is the one pnpm reads or there is no list anywhere (see `collectOnlyBuiltFindings`). A file the helper\n * cannot read faithfully refuses, with its line, and nothing is written.\n */\nfunction restoreOnlyBuiltDependencies(saasRoot: string, names: readonly string[]): void {\n const current = readApplicationPnpmSettings(saasRoot).onlyBuiltDependencies ?? [];\n writeApplicationPnpmSettings(saasRoot, { onlyBuiltDependencies: [...current, ...names.filter((name) => !current.includes(name))] });\n}\n\n/**\n * Write each missing vendor pin back into the application's overrides (#2789), in `pnpm-workspace.yaml` (#2808). A pin\n * present at another version is never touched: the application set it.\n */\nfunction restoreVendorPins(saasRoot: string, pins: ReadonlyArray<{ name: string; version: string }>): void {\n const overrides: Record<string, string> = { ...(readApplicationPnpmSettings(saasRoot).overrides ?? {}) };\n for (const { name, version } of pins) if (!Object.hasOwn(overrides, name)) overrides[name] = version;\n writeApplicationPnpmSettings(saasRoot, { overrides });\n}\n\nexport default class RegistryRepairLockfileCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'registry repair-lockfile',\n description: 'Diagnose (and optionally auto-fix) the modules lockfile section.',\n category: CommandCategory.Registry,\n aliases: ['repair-lockfile'],\n flags: {\n fix: {\n type: 'boolean',\n description: 'Re-fetch modules with missing recorded files, restore missing provider vendor pins and install-script allow-list entries (and rebuild those packages). Malformed records, including invalid digests, require manual correction.',\n },\n force: {\n type: 'boolean',\n description: 'With --fix, also overwrite files you changed since install (a backup is kept under .wildo-saas/tmp/registry-backups/).',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = requireSaasRoot(ctx, 'repair-lockfile');\n const fixMode = !!ctx.flags.fix;\n\n let report: Awaited<ReturnType<typeof LockfileRepairService.inspect>>;\n try {\n report = await LockfileRepairService.inspect(saasRoot);\n } catch (error) {\n if (!(error instanceof Error) || error.name !== PnpmSettingsFormatError.name) throw error;\n // The application's pnpm settings cannot be read faithfully (#2808): nothing can be compared, nothing is written.\n ctx.log.error(` ${error.message}`);\n return { success: false, message: `${error.message} Nothing was compared and nothing was written.` };\n }\n ctx.log.info(`[repair-lockfile] ${report.lockfilePath}`);\n if (report.findings.length === 0) {\n ctx.log.success(' no findings — lockfile is healthy.');\n return { success: true, message: 'Lockfile healthy.' };\n }\n for (const f of report.findings) {\n ctx.log.info(` ${renderFinding(f)}`);\n }\n\n if (!fixMode) {\n const errs = report.findings.filter((f) => f.severity === 'error').length;\n const warns = report.findings.filter((f) => f.severity === 'warn').length;\n return {\n success: report.ok,\n message: `${errs} error(s), ${warns} warning(s). Use \\`--fix\\` for missing files, provider vendor pins and install-script allow-list entries; `\n + 'restore malformed records from a trusted lockfile revision.',\n };\n }\n\n // ---------- auto-fix path ----------\n // A missing vendor pin needs no download: written back from what the lockfile records (#2789).\n const missingPins = report.findings.flatMap((f) => (f.kind === 'vendor-pin-missing' ? [{ moduleId: f.moduleId, name: f.name, version: f.version }] : []));\n if (missingPins.length > 0) {\n await withRegistryWorkspaceMutationLock(saasRoot, async () => restoreVendorPins(saasRoot, missingPins));\n for (const pin of missingPins) ctx.log.success(` restored ${pin.name}@${pin.version} (${pin.moduleId}) in ${PROVIDER_WORKSPACE_FILE}`);\n ctx.log.info(' run `pnpm install` so the lockfile resolves the restored pins.');\n }\n // A missing install-script name is restored the same way, then its package rebuilt: this command runs no install, and with\n // none pnpm runs an already-installed package's script only on a rebuild (#2801; measured on 10.6.4 and 10.34.9 in\n // #3014, where a later install did not run it again). EVERY restored name is rebuilt: whether pnpm skipped\n // it cannot be read reliably (`.modules.yaml` → `ignoredBuilds` covers only the latest install that changed the graph,\n // measured in #2809's review), and a script run twice costs time where a script never run is a wrong result. No\n // `node_modules` → nothing is installed yet, and the next `pnpm install` runs the script of every allowed package.\n const missingBuilt = report.findings.flatMap((f) => (f.kind === 'only-built-missing' ? [{ moduleId: f.moduleId, name: f.name }] : []));\n const builtNames = [...new Set(missingBuilt.map((entry) => entry.name))];\n let rebuildFailed = false;\n // A refused restore fails the run, and does not stop the rest of the repair: a missing module file has nothing to do\n // with the allow-list (#2809 review R-L1).\n let restoreRefusal: string | undefined;\n if (builtNames.length > 0) {\n try {\n await withRegistryWorkspaceMutationLock(saasRoot, async () => restoreOnlyBuiltDependencies(saasRoot, builtNames));\n } catch (error) {\n restoreRefusal = (error as Error).message;\n ctx.log.error(` ${restoreRefusal}`);\n }\n }\n if (builtNames.length > 0 && restoreRefusal === undefined) {\n for (const name of builtNames) {\n const modules = missingBuilt.filter((entry) => entry.name === name).map((entry) => entry.moduleId);\n ctx.log.success(` allowed ${name}'s install script again (${modules.join(', ')}) in ${PROVIDER_WORKSPACE_FILE}`);\n }\n if (!existsSync(path.join(saasRoot, 'node_modules'))) {\n ctx.log.info(` nothing is installed yet: \\`pnpm install\\` runs ${builtNames.join(', ')}'s install script${builtNames.length === 1 ? '' : 's'}.`);\n } else if (!runPnpmRebuild(ctx.log, builtNames, saasRoot)) {\n ctx.log.warn(` ${builtNames.join(', ')} ${builtNames.length === 1 ? 'is' : 'are'} allowed again and did not run ${builtNames.length === 1 ? 'its install script' : 'their install scripts'}. Run \\`pnpm rebuild -r ${builtNames.join(' ')}\\` in ${saasRoot}.`);\n rebuildFailed = true;\n }\n }\n const rebuildNote = (rebuildFailed ? ' The rebuild of the allowed packages failed; see above.' : '')\n + (restoreRefusal === undefined ? '' : ` The install-script allow-list could not be restored: ${restoreRefusal}`);\n const allowListFailed = rebuildFailed || restoreRefusal !== undefined;\n const fixable = report.findings.filter(\n (f) => f.kind === 'module-file-missing',\n );\n if (fixable.length === 0) {\n const restored = [\n ...(missingPins.length > 0 ? [`${missingPins.length} vendor pin(s)`] : []),\n ...(builtNames.length > 0 && restoreRefusal === undefined ? [`${builtNames.length} install-script allow-list entr${builtNames.length === 1 ? 'y' : 'ies'}`] : []),\n ];\n return {\n success: report.ok && !allowListFailed,\n message: (restored.length > 0\n ? `Restored ${restored.join(' and ')}; no module file was missing.`\n : 'No auto-fixable findings (envelope/section errors require manual repair).') + rebuildNote,\n };\n }\n\n let fixed = 0;\n let failed = 0;\n /** A repaired provider that ships skills (#2026): its restored skill files reach `.claude/skills/` only through the sync. */\n let restoredProviderSkills = false;\n\n // The entries are read UNDER the lock: another registry command may have changed them since\n // the inspection above, and a repair must restore what the lockfile records now. Holding the lock\n // across each entry's download is accepted here (repair is a rare, operator-run recovery), unlike\n // add/update, which download before taking it.\n await withRegistryWorkspaceMutationLock(saasRoot, async () => {\n const section = await RegistryLockfileService.read(saasRoot);\n for (const f of fixable) {\n if (f.kind !== 'module-file-missing') continue;\n const entry = section.installed[f.moduleId];\n if (!entry) {\n ctx.log.warn(` skip ${f.moduleId} — no lockfile entry.`);\n continue;\n }\n try {\n await this.repairEntry(ctx, saasRoot, entry);\n ctx.log.success(` repaired ${f.moduleId}@${entry.version}`);\n if ((entry.files ?? []).some((file) => /^providers\\/[^/]+\\/skills\\//.test(file))) restoredProviderSkills = true;\n fixed += 1;\n } catch (err) {\n ctx.log.error(` ${f.moduleId} → ${(err as Error).message}`);\n failed += 1;\n }\n }\n });\n if (restoredProviderSkills) syncSkillsAfterProviderChange(ctx, saasRoot, 'the repaired providers');\n\n return {\n success: failed === 0 && !allowListFailed,\n message: `Repaired ${fixed} entry/entries; ${failed} failure(s).${rebuildNote}`,\n };\n }\n\n private async repairEntry(\n ctx: CommandContext,\n saasRoot: string,\n entry: RegistryModulesLockEntry,\n ): Promise<void> {\n const acquisition = await this.acquireRecordedVersion(ctx, saasRoot, entry);\n\n const paths = moduleArtifactPaths(saasRoot, entry.domain, entry.moduleId, acquisition.version);\n await stageModuleAcquisition(acquisition, paths, saasRoot);\n\n const stagedManifest = await readStagedManifest(paths.extractDir);\n assertStagedManifestMatchesRequest(stagedManifest, { moduleId: entry.moduleId, version: acquisition.version });\n for (const notice of await checkModuleRequirements(saasRoot, stagedManifest, moduleRequirementsOriginOf(acquisition))) ctx.log.warn(notice);\n // Repair restores what is MISSING (that is what it is for) and keeps what you changed (#2016):\n // it used to re-apply every file and silently replace local edits.\n const writePlan = await planProtectedWrite({\n saasRoot,\n moduleId: entry.moduleId,\n stagedPaths: await validatedStagedAppFiles({ saasRoot, extractDir: paths.extractDir, manifest: stagedManifest }),\n recorded: entry,\n force: ctx.flags.force === true,\n restoreMissing: true,\n backupDirectory: registryForceBackupDirectory(saasRoot, entry.moduleId),\n findOtherOwners: (candidates) => RegistryLockfileService.findFileOwners({ saasRoot, paths: candidates, excludeModuleId: entry.moduleId }),\n });\n for (const kept of writePlan.kept) ctx.log.warn(` ${describeProtectedFile(kept.path, kept.state, 'restored')}`);\n for (const forced of writePlan.forced) ctx.log.warn(` overwrote ${forced.path} (--force); your version is at ${forced.backup}`);\n // Surface placement overlaps just as add/update do.\n const fanOut = await fanOutToSaasSource({\n saasRoot,\n extractDir: paths.extractDir,\n manifest: stagedManifest,\n moduleId: entry.moduleId,\n skipPaths: writePlan.skip,\n });\n\n for (const warning of fanOut.overlapWarnings) {\n ctx.log.warn(` [overlap] \"${warning.path}\" was also claimed by \"${warning.otherModuleId}\" — overwritten by ${entry.moduleId}.`);\n }\n\n // Refresh the lockfile entry's file list. For a registry entry the provenance is the pin, unchanged\n // (verified in `acquireRecordedVersion`). For a checkout entry it is re-recorded: the bytes now come\n // from the checkout as it stands, and the entry must say which commit that is.\n // Preserves `installedAt` so the audit trail keeps the original install timestamp and source\n // field. A same-version source reapplication that keeps local edits (#2016).\n await RegistryLockfileService.upsertEntry(saasRoot, {\n ...entry,\n ...lockEntryProvenance(acquisition),\n files: fanOut.ownedFiles,\n installedFileHashes: await nextInstalledFileHashes({ saasRoot, ownedFiles: fanOut.ownedFiles, skipped: writePlan.skip, previous: entry }),\n });\n ctx.log.info(` restored ${describeAcquisition(entry.moduleId, acquisition)}`);\n }\n\n /**\n * The version the entry RECORDS, from where it was recorded: the pinned artifact from its registry, or\n * the checkout. Never a different version: a repair restores the recorded state.\n */\n private async acquireRecordedVersion(\n ctx: CommandContext,\n saasRoot: string,\n entry: RegistryModulesLockEntry,\n ): Promise<ModuleAcquisition> {\n if (entry.distribution === ModuleDistribution.LOCAL_CHECKOUT) {\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (!frameworkRoot) {\n throw new Error('it was installed from the framework checkout, and this command is not running inside one. Nothing was repaired.');\n }\n const recorded = localCheckoutProvenanceOf(entry);\n const local = await resolveLocalCheckoutModule({ frameworkRoot, domain: entry.domain, moduleId: entry.moduleId, range: 'latest' });\n if (local.version !== entry.version) {\n throw new Error(\n `the checkout now holds ${local.version}, not the recorded ${entry.version}; a repair restores the recorded version. `\n + `Use \\`wildo registry update ${entry.moduleId}\\` to move to ${local.version}.`,\n );\n }\n if (local.checkoutCommit !== recorded.checkoutCommit) {\n ctx.log.warn(` ${entry.moduleId}: restoring from checkout ${local.checkoutCommit.slice(0, 12)}; it was installed from ${recorded.checkoutCommit.slice(0, 12)}.`);\n }\n return { distribution: ModuleDistribution.LOCAL_CHECKOUT, version: local.version, local };\n }\n\n const { registryId, artifactDigest: pinnedDigest } = registryProvenanceOf(entry);\n const { url: registryUrl } = await resolveLockedRegistry(ctx, saasRoot, entry);\n const credential = await RegistryCredentialsService.get(registryUrl);\n const clientOptions = { baseUrl: registryUrl, authToken: credential?.rawToken };\n\n // Resolve against the recorded exact version so the registry hands\n // us back the same artifact the lockfile expects.\n const { version, artifactDigest, yanked } = await RegistryServerClient.resolve(clientOptions, {\n domain: entry.domain,\n moduleId: entry.moduleId,\n range: entry.version,\n });\n if (yanked) {\n // Only an exact pin reaches a yanked release (#1758); install it, but say so.\n ctx.log.warn(` ${entry.moduleId}@${version} is YANKED (${yanked.yankedAt}${yanked.reason ? `: ${yanked.reason}` : ''}). Installing the pinned release; pick a live one with a range.`);\n }\n if (version !== entry.version) {\n throw new Error(\n `Registry returned version ${version} for an exact-version request of ${entry.version}; refusing to overwrite the lockfile entry.`,\n );\n }\n // Repair restores what the lockfile PINS. It used to download against the server's current\n // digest and write that over the pin — so a registry that swapped a version's bytes had them\n // installed and re-pinned by the very command meant to restore the recorded state.\n assertServedDigestMatchesPin({\n moduleId: entry.moduleId,\n version,\n pinnedDigest,\n servedDigest: artifactDigest,\n });\n\n const { bytes } = await RegistryServerClient.download(clientOptions, {\n domain: entry.domain,\n moduleId: entry.moduleId,\n version,\n expectedDigest: pinnedDigest,\n });\n if (credential) await RegistryCredentialsService.touch(registryUrl);\n return {\n distribution: ModuleDistribution.REGISTRY,\n version,\n artifactDigest: pinnedDigest,\n bytes,\n registry: { url: registryUrl, id: registryId },\n };\n }\n}\n"]}
1
+ {"version":3,"file":"repair-lockfile.command.js","sourceRoot":"","sources":["../../../../src/commands/registry/repair-lockfile.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GAErB,MAAM,+BAA+B,C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YAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO;YACP,YAAY;YACZ,YAAY,EAAE,cAAc;SAC7B,CAAC,CAAC;QAEH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,aAAa,EAAE;YACnE,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO;YACP,cAAc,EAAE,YAAY;SAC7B,CAAC,CAAC;QACH,IAAI,UAAU;YAAE,MAAM,0BAA0B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACpE,OAAO;YACL,YAAY,EAAE,kBAAkB,CAAC,QAAQ;YACzC,OAAO;YACP,cAAc,EAAE,YAAY;YAC5B,KAAK;YACL,QAAQ,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE;SAC/C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * `wildo registry repair-lockfile` — diagnose + (optionally) auto-fix\n * the `sections.modules` lockfile state.\n *\n * Read mode (default): runs `LockfileRepairService.inspect(saasRoot)`, which reads the application's effective pnpm\n * settings through the shared pnpm-settings helper (#2808), and renders every finding. Exit 0 when no `severity: 'error'`\n * findings; exit 1 otherwise.\n *\n * `--fix`: attempts auto-repair for the fixable finding kinds:\n * - `module-file-missing` → re-fetch the artifact via the recorded\n * registry URL + lockfile entry. Calls `RegistryServerClient.resolve`\n * against the stored exact version, REFUSES when the registry now\n * serves a different digest than the lockfile pins, downloads against\n * the PINNED digest, and re-extracts into the staging dir + re-fans-out\n * onto the SaaS source. The pin is never rewritten.\n * - `vendor-pin-missing` → write the recorded pin back into the overrides in\n * `pnpm-workspace.yaml` (#2789, #2808).\n * - `only-built-missing` → write the recorded install-script name back into\n * `onlyBuiltDependencies` in `pnpm-workspace.yaml`, then `pnpm rebuild -r` every\n * restored name (#2809): adding a name runs nothing for a package already installed.\n * `only-built-blocked` (a `neverBuiltDependencies` list names the package, or the\n * application declares both kinds of list, which pnpm refuses) is reported and\n * never written, as the install refuses it (#2801).\n * Both writes go through the pnpm-settings helper, which moves a copy an older\n * application keeps in `package.json` → `pnpm` into the workspace file (pnpm 10\n * would read that copy instead, and pnpm 11 reads none).\n *\n * `envelope-malformed` / `modules-section-malformed` are NOT\n * auto-fixable — those require manual correction. Repair can replace\n * local module source files and does not back up operator edits.\n */\n\nimport { existsSync } from 'node:fs';\nimport * as path from 'node:path';\nimport { checkModuleRequirements } from '~wildo-cli/services/registry/module-requirements.service';\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 {\n ApplicationInstallScriptPolicy,\n LockfileRepairService,\n RegistryLockfileService,\n RegistryServerClient,\n type LockfileRepairFinding,\n} from '@wildo-ai/wildo-module-client';\nimport {\n PROVIDER_WORKSPACE_FILE,\n PnpmSettingsFormatError,\n readApplicationPnpmSettings,\n writeApplicationPnpmSettings,\n localCheckoutProvenanceOf,\n ModuleDistribution,\n registryProvenanceOf,\n type RegistryModulesLockEntry,\n} from '@wildo-ai/platform-config-lib';\nimport { RegistryCredentialsService } from '~wildo-cli/services/registry/registry-credentials.service';\nimport { requireSaasRoot, resolveLockedRegistry, withRegistryWorkspaceMutationLock } from '~wildo-cli/services/registry/registry-command.utils';\nimport { fanOutToSaasSource, readStagedManifest, validatedStagedAppFiles } from '~wildo-cli/services/registry/boundary-fanout.utils';\nimport {\n describeProtectedFile,\n nextInstalledFileHashes,\n planProtectedWrite,\n registryForceBackupDirectory,\n} from '~wildo-cli/services/registry/installed-file-state.utils';\nimport { moduleArtifactPaths } from '~wildo-cli/services/registry/module-artifact-files.utils';\nimport { syncSkillsAfterProviderChange } from '~wildo-cli/services/registry/provider-install-step';\nimport { runPnpmRebuild } from '~wildo-cli/services/framework/package-install.service';\nimport { resolveLocalCheckoutModule } from '~wildo-cli/services/registry/local-checkout-module-source.service';\nimport {\n describeAcquisition,\n lockEntryProvenance,\n moduleRequirementsOriginOf,\n stageModuleAcquisition,\n type ModuleAcquisition,\n} from '~wildo-cli/services/registry/module-acquisition.utils';\nimport {\n assertServedDigestMatchesPin,\n assertStagedManifestMatchesRequest,\n} from '~wildo-cli/services/registry/artifact-trust.utils';\n\n\n\nfunction renderFinding(f: LockfileRepairFinding): string {\n const sev = f.severity.toUpperCase();\n switch (f.kind) {\n case 'envelope-malformed':\n case 'modules-section-malformed':\n return `[${sev}] ${f.kind}: ${f.message}${f.detail ? ` — ${f.detail}` : ''}`;\n case 'module-file-missing':\n return `[${sev}] ${f.kind}: ${f.moduleId} → missing file ${f.filePath}`;\n case 'vendor-pin-missing':\n return `[${sev}] ${f.kind}: ${f.moduleId} → its vendor pin ${f.name}@${f.version} is gone from the overrides in ${PROVIDER_WORKSPACE_FILE} (--fix restores it)`;\n case 'vendor-pin-moved':\n return `[${sev}] ${f.kind}: ${f.moduleId} pins ${f.name}@${f.version}, and the application moved it to ${f.found}; left as the application set it`;\n case 'only-built-missing':\n return `[${sev}] ${f.kind}: ${f.moduleId} → its vendor package ${f.name} runs an install script, and onlyBuiltDependencies in ${PROVIDER_WORKSPACE_FILE} no longer allows it (--fix restores it and rebuilds ${f.name})`;\n case 'only-built-blocked':\n return `[${sev}] ${f.kind}: ${f.moduleId} → its vendor package ${f.name} runs an install script, and ${describeBlockingPolicy(f.policy, f.name)}`;\n }\n}\n\n/** Where the application's own policy stops the script, and what the operator does about it. `--fix` writes nothing here (#2801). */\nfunction describeBlockingPolicy(policy: ApplicationInstallScriptPolicy, name: string): string {\n switch (policy) {\n case ApplicationInstallScriptPolicy.NEVER_BUILT_LIST:\n return `the application's neverBuiltDependencies lists it. Nothing is written: pnpm refuses to install with both an onlyBuiltDependencies and a `\n + `neverBuiltDependencies list. Take ${name} out of neverBuiltDependencies, then run \\`pnpm rebuild -r ${name}\\`.`;\n case ApplicationInstallScriptPolicy.CONFLICTING_LISTS:\n return `the application declares both an onlyBuiltDependencies and a neverBuiltDependencies list, and pnpm refuses to install with both. `\n + `Nothing is written. Keep one list, with ${name} allowed by it, then run \\`pnpm install\\` and \\`pnpm rebuild -r ${name}\\`.`;\n }\n}\n\n/**\n * Write each missing install-script name back into the application's `onlyBuiltDependencies` (#2809), in\n * `pnpm-workspace.yaml` through the pnpm-settings helper (#2808), as the install writes it. Starts from the effective list,\n * so a list an older application keeps in `package.json` is moved, not replaced. Called only for `only-built-missing`,\n * so the list is the one pnpm reads or there is no list anywhere (see `collectOnlyBuiltFindings`). A file the helper\n * cannot read faithfully refuses, with its line, and nothing is written.\n */\nfunction restoreOnlyBuiltDependencies(saasRoot: string, names: readonly string[]): void {\n const current = readApplicationPnpmSettings(saasRoot).onlyBuiltDependencies ?? [];\n writeApplicationPnpmSettings(saasRoot, { onlyBuiltDependencies: [...current, ...names.filter((name) => !current.includes(name))] });\n}\n\n/**\n * Write each missing vendor pin back into the application's overrides (#2789), in `pnpm-workspace.yaml` (#2808). A pin\n * present at another version is never touched: the application set it.\n */\nfunction restoreVendorPins(saasRoot: string, pins: ReadonlyArray<{ name: string; version: string }>): void {\n const overrides: Record<string, string> = { ...(readApplicationPnpmSettings(saasRoot).overrides ?? {}) };\n for (const { name, version } of pins) if (!Object.hasOwn(overrides, name)) overrides[name] = version;\n writeApplicationPnpmSettings(saasRoot, { overrides });\n}\n\nexport default class RegistryRepairLockfileCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'registry repair-lockfile',\n description: 'Diagnose (and optionally auto-fix) the modules lockfile section.',\n category: CommandCategory.Registry,\n aliases: ['repair-lockfile'],\n flags: {\n fix: {\n type: 'boolean',\n description: 'Re-fetch modules with missing recorded files, restore missing provider vendor pins and install-script allow-list entries (and rebuild those packages). Malformed records, including invalid digests, require manual correction.',\n },\n force: {\n type: 'boolean',\n description: 'With --fix, also overwrite files you changed since install (a backup is kept under .wildo-saas/tmp/registry-backups/).',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = requireSaasRoot(ctx, 'repair-lockfile');\n const fixMode = !!ctx.flags.fix;\n\n let report: Awaited<ReturnType<typeof LockfileRepairService.inspect>>;\n try {\n report = await LockfileRepairService.inspect(saasRoot);\n } catch (error) {\n if (!(error instanceof Error) || error.name !== PnpmSettingsFormatError.name) throw error;\n // The application's pnpm settings cannot be read faithfully (#2808): nothing can be compared, nothing is written.\n ctx.log.error(` ${error.message}`);\n return { success: false, message: `${error.message} Nothing was compared and nothing was written.` };\n }\n ctx.log.info(`[repair-lockfile] ${report.lockfilePath}`);\n if (report.findings.length === 0) {\n ctx.log.success(' no findings — lockfile is healthy.');\n return { success: true, message: 'Lockfile healthy.' };\n }\n for (const f of report.findings) {\n ctx.log.info(` ${renderFinding(f)}`);\n }\n\n if (!fixMode) {\n const errs = report.findings.filter((f) => f.severity === 'error').length;\n const warns = report.findings.filter((f) => f.severity === 'warn').length;\n return {\n success: report.ok,\n message: `${errs} error(s), ${warns} warning(s). Use \\`--fix\\` for missing files, provider vendor pins and install-script allow-list entries; `\n + 'restore malformed records from a trusted lockfile revision.',\n };\n }\n\n // ---------- auto-fix path ----------\n // A missing vendor pin needs no download: written back from what the lockfile records (#2789).\n const missingPins = report.findings.flatMap((f) => (f.kind === 'vendor-pin-missing' ? [{ moduleId: f.moduleId, name: f.name, version: f.version }] : []));\n if (missingPins.length > 0) {\n await withRegistryWorkspaceMutationLock(saasRoot, async () => restoreVendorPins(saasRoot, missingPins));\n for (const pin of missingPins) ctx.log.success(` restored ${pin.name}@${pin.version} (${pin.moduleId}) in ${PROVIDER_WORKSPACE_FILE}`);\n ctx.log.info(' run `pnpm install` so the lockfile resolves the restored pins.');\n }\n // A missing install-script name is restored the same way, then its package rebuilt: this command runs no install, and with\n // none pnpm runs an already-installed package's script only on a rebuild (#2801; measured on 10.6.4 and 10.34.9 in\n // #3014, where a later install did not run it again). EVERY restored name is rebuilt: whether pnpm skipped\n // it cannot be read reliably (`.modules.yaml` → `ignoredBuilds` covers only the latest install that changed the graph,\n // measured in #2809's review), and a script run twice costs time where a script never run is a wrong result. No\n // `node_modules` → nothing is installed yet, and the next `pnpm install` runs the script of every allowed package.\n const missingBuilt = report.findings.flatMap((f) => (f.kind === 'only-built-missing' ? [{ moduleId: f.moduleId, name: f.name }] : []));\n const builtNames = [...new Set(missingBuilt.map((entry) => entry.name))];\n let rebuildFailed = false;\n // A refused restore fails the run, and does not stop the rest of the repair: a missing module file has nothing to do\n // with the allow-list (#2809 review R-L1).\n let restoreRefusal: string | undefined;\n if (builtNames.length > 0) {\n try {\n await withRegistryWorkspaceMutationLock(saasRoot, async () => restoreOnlyBuiltDependencies(saasRoot, builtNames));\n } catch (error) {\n restoreRefusal = (error as Error).message;\n ctx.log.error(` ${restoreRefusal}`);\n }\n }\n if (builtNames.length > 0 && restoreRefusal === undefined) {\n for (const name of builtNames) {\n const modules = missingBuilt.filter((entry) => entry.name === name).map((entry) => entry.moduleId);\n ctx.log.success(` allowed ${name}'s install script again (${modules.join(', ')}) in ${PROVIDER_WORKSPACE_FILE}`);\n }\n if (!existsSync(path.join(saasRoot, 'node_modules'))) {\n ctx.log.info(` nothing is installed yet: \\`pnpm install\\` runs ${builtNames.join(', ')}'s install script${builtNames.length === 1 ? '' : 's'}.`);\n } else if (!runPnpmRebuild(ctx.log, builtNames, saasRoot)) {\n ctx.log.warn(` ${builtNames.join(', ')} ${builtNames.length === 1 ? 'is' : 'are'} allowed again and did not run ${builtNames.length === 1 ? 'its install script' : 'their install scripts'}. Run \\`pnpm rebuild -r ${builtNames.join(' ')}\\` in ${saasRoot}.`);\n rebuildFailed = true;\n }\n }\n const rebuildNote = (rebuildFailed ? ' The rebuild of the allowed packages failed; see above.' : '')\n + (restoreRefusal === undefined ? '' : ` The install-script allow-list could not be restored: ${restoreRefusal}`);\n const allowListFailed = rebuildFailed || restoreRefusal !== undefined;\n const fixable = report.findings.filter(\n (f) => f.kind === 'module-file-missing',\n );\n if (fixable.length === 0) {\n const restored = [\n ...(missingPins.length > 0 ? [`${missingPins.length} vendor pin(s)`] : []),\n ...(builtNames.length > 0 && restoreRefusal === undefined ? [`${builtNames.length} install-script allow-list entr${builtNames.length === 1 ? 'y' : 'ies'}`] : []),\n ];\n return {\n success: report.ok && !allowListFailed,\n message: (restored.length > 0\n ? `Restored ${restored.join(' and ')}; no module file was missing.`\n : 'No auto-fixable findings (envelope/section errors require manual repair).') + rebuildNote,\n };\n }\n\n let fixed = 0;\n let failed = 0;\n /** A repaired provider that ships skills (#2026): its restored skill files reach `.claude/skills/` only through the sync. */\n let restoredProviderSkills = false;\n\n // The entries are read UNDER the lock: another registry command may have changed them since\n // the inspection above, and a repair must restore what the lockfile records now. Holding the lock\n // across each entry's download is accepted here (repair is a rare, operator-run recovery), unlike\n // add/update, which download before taking it.\n await withRegistryWorkspaceMutationLock(saasRoot, async () => {\n const section = await RegistryLockfileService.read(saasRoot);\n for (const f of fixable) {\n if (f.kind !== 'module-file-missing') continue;\n const entry = section.installed[f.moduleId];\n if (!entry) {\n ctx.log.warn(` skip ${f.moduleId} — no lockfile entry.`);\n continue;\n }\n try {\n await this.repairEntry(ctx, saasRoot, entry);\n ctx.log.success(` repaired ${f.moduleId}@${entry.version}`);\n if ((entry.files ?? []).some((file) => /^providers\\/[^/]+\\/skills\\//.test(file))) restoredProviderSkills = true;\n fixed += 1;\n } catch (err) {\n ctx.log.error(` ${f.moduleId} → ${(err as Error).message}`);\n failed += 1;\n }\n }\n });\n if (restoredProviderSkills) syncSkillsAfterProviderChange(ctx, saasRoot, 'the repaired providers');\n\n return {\n success: failed === 0 && !allowListFailed,\n message: `Repaired ${fixed} entry/entries; ${failed} failure(s).${rebuildNote}`,\n };\n }\n\n private async repairEntry(\n ctx: CommandContext,\n saasRoot: string,\n entry: RegistryModulesLockEntry,\n ): Promise<void> {\n const acquisition = await this.acquireRecordedVersion(ctx, saasRoot, entry);\n\n const paths = moduleArtifactPaths(saasRoot, entry.domain, entry.moduleId, acquisition.version);\n await stageModuleAcquisition(acquisition, paths, saasRoot);\n\n const stagedManifest = await readStagedManifest(paths.extractDir);\n assertStagedManifestMatchesRequest(stagedManifest, { moduleId: entry.moduleId, version: acquisition.version });\n for (const notice of await checkModuleRequirements(saasRoot, stagedManifest, moduleRequirementsOriginOf(acquisition))) ctx.log.warn(notice);\n // Repair restores what is MISSING (that is what it is for) and keeps what you changed (#2016):\n // it used to re-apply every file and silently replace local edits.\n const writePlan = await planProtectedWrite({\n saasRoot,\n extractDir: paths.extractDir,\n moduleId: entry.moduleId,\n stagedPaths: await validatedStagedAppFiles({ saasRoot, extractDir: paths.extractDir, manifest: stagedManifest }),\n recorded: entry,\n force: ctx.flags.force === true,\n restoreMissing: true,\n backupDirectory: registryForceBackupDirectory(saasRoot, entry.moduleId),\n findOtherOwners: (candidates) => RegistryLockfileService.findFileOwners({ saasRoot, paths: candidates, excludeModuleId: entry.moduleId }),\n });\n for (const kept of writePlan.kept) ctx.log.warn(` ${describeProtectedFile(kept.path, kept.state, 'restored')}`);\n for (const forced of writePlan.forced) ctx.log.warn(` overwrote ${forced.path} (--force); your version is at ${forced.backup}`);\n // Surface placement overlaps just as add/update do.\n const fanOut = await fanOutToSaasSource({\n saasRoot,\n extractDir: paths.extractDir,\n manifest: stagedManifest,\n moduleId: entry.moduleId,\n skipPaths: writePlan.skip,\n });\n\n for (const warning of fanOut.overlapWarnings) {\n ctx.log.warn(` [overlap] \"${warning.path}\" was also claimed by \"${warning.otherModuleId}\" — overwritten by ${entry.moduleId}.`);\n }\n\n // Refresh the lockfile entry's file list. For a registry entry the provenance is the pin, unchanged\n // (verified in `acquireRecordedVersion`). For a checkout entry it is re-recorded: the bytes now come\n // from the checkout as it stands, and the entry must say which commit that is.\n // Preserves `installedAt` so the audit trail keeps the original install timestamp and source\n // field. A same-version source reapplication that keeps local edits (#2016).\n await RegistryLockfileService.upsertEntry(saasRoot, {\n ...entry,\n ...lockEntryProvenance(acquisition),\n files: fanOut.ownedFiles,\n installedFileHashes: await nextInstalledFileHashes({ saasRoot, ownedFiles: fanOut.ownedFiles, skipped: writePlan.skip, previous: entry }),\n });\n ctx.log.info(` restored ${describeAcquisition(entry.moduleId, acquisition)}`);\n }\n\n /**\n * The version the entry RECORDS, from where it was recorded: the pinned artifact from its registry, or\n * the checkout. Never a different version: a repair restores the recorded state.\n */\n private async acquireRecordedVersion(\n ctx: CommandContext,\n saasRoot: string,\n entry: RegistryModulesLockEntry,\n ): Promise<ModuleAcquisition> {\n if (entry.distribution === ModuleDistribution.LOCAL_CHECKOUT) {\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (!frameworkRoot) {\n throw new Error('it was installed from the framework checkout, and this command is not running inside one. Nothing was repaired.');\n }\n const recorded = localCheckoutProvenanceOf(entry);\n const local = await resolveLocalCheckoutModule({ frameworkRoot, domain: entry.domain, moduleId: entry.moduleId, range: 'latest' });\n if (local.version !== entry.version) {\n throw new Error(\n `the checkout now holds ${local.version}, not the recorded ${entry.version}; a repair restores the recorded version. `\n + `Use \\`wildo registry update ${entry.moduleId}\\` to move to ${local.version}.`,\n );\n }\n if (local.checkoutCommit !== recorded.checkoutCommit) {\n ctx.log.warn(` ${entry.moduleId}: restoring from checkout ${local.checkoutCommit.slice(0, 12)}; it was installed from ${recorded.checkoutCommit.slice(0, 12)}.`);\n }\n return { distribution: ModuleDistribution.LOCAL_CHECKOUT, version: local.version, local };\n }\n\n const { registryId, artifactDigest: pinnedDigest } = registryProvenanceOf(entry);\n const { url: registryUrl } = await resolveLockedRegistry(ctx, saasRoot, entry);\n const credential = await RegistryCredentialsService.get(registryUrl);\n const clientOptions = { baseUrl: registryUrl, authToken: credential?.rawToken };\n\n // Resolve against the recorded exact version so the registry hands\n // us back the same artifact the lockfile expects.\n const { version, artifactDigest, yanked } = await RegistryServerClient.resolve(clientOptions, {\n domain: entry.domain,\n moduleId: entry.moduleId,\n range: entry.version,\n });\n if (yanked) {\n // Only an exact pin reaches a yanked release (#1758); install it, but say so.\n ctx.log.warn(` ${entry.moduleId}@${version} is YANKED (${yanked.yankedAt}${yanked.reason ? `: ${yanked.reason}` : ''}). Installing the pinned release; pick a live one with a range.`);\n }\n if (version !== entry.version) {\n throw new Error(\n `Registry returned version ${version} for an exact-version request of ${entry.version}; refusing to overwrite the lockfile entry.`,\n );\n }\n // Repair restores what the lockfile PINS. It used to download against the server's current\n // digest and write that over the pin — so a registry that swapped a version's bytes had them\n // installed and re-pinned by the very command meant to restore the recorded state.\n assertServedDigestMatchesPin({\n moduleId: entry.moduleId,\n version,\n pinnedDigest,\n servedDigest: artifactDigest,\n });\n\n const { bytes } = await RegistryServerClient.download(clientOptions, {\n domain: entry.domain,\n moduleId: entry.moduleId,\n version,\n expectedDigest: pinnedDigest,\n });\n if (credential) await RegistryCredentialsService.touch(registryUrl);\n return {\n distribution: ModuleDistribution.REGISTRY,\n version,\n artifactDigest: pinnedDigest,\n bytes,\n registry: { url: registryUrl, id: registryId },\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"update.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/registry/update.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA6F1F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,WAAW;IAC5D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAsBxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAwXvD"}
1
+ {"version":3,"file":"update.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/registry/update.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA6F1F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,WAAW;IAC5D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAsBxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAyXvD"}
@@ -221,6 +221,7 @@ export default class RegistryUpdateCommand extends BaseCommand {
221
221
  const forceBackupDirectory = registryForceBackupDirectory(saasRoot, parsed.moduleId);
222
222
  const writePlan = await planProtectedWrite({
223
223
  saasRoot,
224
+ extractDir: paths.extractDir,
224
225
  moduleId: parsed.moduleId,
225
226
  stagedPaths: await validatedStagedAppFiles({ saasRoot, extractDir: paths.extractDir, manifest: stagedManifest }),
226
227
  recorded: existing,
@@ -1 +1 @@
1
- {"version":3,"file":"update.command.js","sourceRoot":"","sources":["../../../../src/commands/registry/update.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EAEpB,UAAU,GACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AACvG,OAAO,EACL,eAA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AAG,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA4B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,WAAW,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,MAAM,OAAO,GAAG;SACzE,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * `wildo registry update <moduleId>[@<range>]` — refresh an\n * already-installed module to the latest (or specified) version.\n *\n * NOT aliased as `wildo update`: that name belongs to the framework update (`update.command.ts`),\n * which moves the CLI and the application to a published framework release. A module update is a\n * registry verb and is always spelled `wildo registry update`.\n *\n * Pipeline:\n * 1. Look up the existing lockfile entry for `<moduleId>` to\n * recover the registry id + domain that recorded the original\n * install (no need for the user to re-state them).\n * 2. Resolve the registry URL via `resolveRegistryUrl` — the\n * explicit `--registry` flag still wins; otherwise the entry's\n * `registryUrl` is used (or the resolver's fallback policy if\n * the entry's URL is no longer reachable).\n * 3. `RegistryServerClient.resolve` against the requested range\n * (default: `latest`).\n * 4. If the resolved version equals the lockfile's current version\n * AND the integrity digest matches, exit success without\n * re-downloading.\n * 5. Else download (sha256-verified), persist, update the lockfile\n * entry with `source: 'update'` + new `installedAt` timestamp,\n * run provider-sync.\n *\n * Refuses to operate on modules not present in the lockfile —\n * `wildo registry add` is the path to install something new.\n */\n\nimport { checkModuleRequirements } from '~wildo-cli/services/registry/module-requirements.service';\nimport { promises as fs } from 'node:fs';\nimport * as path from 'node:path';\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 {\n RegistryServerClient,\n RegistryLockfileService,\n runProviderSync,\n} from '@wildo-ai/wildo-module-client';\nimport {\n localCheckoutProvenanceOf,\n ModuleDistribution,\n registryProvenanceOf,\n type RegistryModulesLockEntry,\n ModuleKind,\n} from '@wildo-ai/platform-config-lib';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { RegistryCredentialsService } from '~wildo-cli/services/registry/registry-credentials.service';\nimport {\n requireSaasRoot,\n asRegistryLogger,\n resolveLockedRegistry,\n resolveRegistryUrlForCommand,\n withRegistryWorkspaceMutationLock,\n assertModuleEntryUnchangedUnderLock,\n} from '~wildo-cli/services/registry/registry-command.utils';\nimport {\n fanOutToSaasSource,\n validatedStagedAppFiles,\n pruneEmptiedModuleDirectories,\n readStagedManifest,\n resolveRecordedModuleFile,\n rollbackFanOut,\n} from '~wildo-cli/services/registry/boundary-fanout.utils';\nimport {\n deriveMigrationObligation,\n describeMigrationObligation,\n findResourceConfigurationFiles,\n} from '~wildo-cli/services/registry/migration-obligation.utils';\nimport {\n registerModuleForInstall,\n rollbackInstallRegistration,\n deriveProviderRegistration,\n} from '~wildo-cli/services/registry/module-registration.service';\nimport { reportRegistrationOutcome } from '~wildo-cli/services/registry/provider-wiring.service';\nimport { installAfterProviderChange, NO_INSTALL_FLAG, syncSkillsAfterProviderChange } from '~wildo-cli/services/registry/provider-install-step';\nimport { moduleArtifactPaths } from '~wildo-cli/services/registry/module-artifact-files.utils';\nimport { resolveLocalCheckoutModule } from '~wildo-cli/services/registry/local-checkout-module-source.service';\nimport {\n describeProtectedFile,\n nextInstalledFileHashes,\n planProtectedRemoval,\n planProtectedWrite,\n registryForceBackupDirectory,\n} from '~wildo-cli/services/registry/installed-file-state.utils';\nimport {\n describeAcquisition,\n lockEntryProvenance,\n moduleRequirementsOriginOf,\n stageModuleAcquisition,\n type ModuleAcquisition,\n} from '~wildo-cli/services/registry/module-acquisition.utils';\nimport { DEFAULT_REGISTRY_ID } from '@wildo-ai/platform-config-lib';\nimport {\n assertServedDigestMatchesPin,\n assertStagedManifestMatchesRequest,\n} from '~wildo-cli/services/registry/artifact-trust.utils';\n\ninterface ParsedSpec {\n moduleId: string;\n range: string;\n}\n\n/**\n * Range-suffix shape: `@` followed by a semver-ish token. Mirrors\n * `add.command.ts`'s parser so `@<scope>/<name>` (npm scope, no range)\n * isn't mis-parsed.\n */\nconst RANGE_SUFFIX_RE = /@([\\^~]?\\d|>=?|<=?|\\*|x|latest|next|canary|beta|alpha|rc)/i;\n\nfunction parseSpec(spec: string): ParsedSpec {\n const rangeMatch = spec.match(RANGE_SUFFIX_RE);\n const hasRange = rangeMatch !== null && rangeMatch.index !== undefined && rangeMatch.index > 0;\n const moduleId = hasRange ? spec.slice(0, rangeMatch!.index) : spec;\n const range = hasRange ? spec.slice(rangeMatch!.index! + 1) : 'latest';\n if (!moduleId.includes('/')) {\n throw new Error(\n `Invalid module spec \"${spec}\". moduleId must be \"<scope>/<name>\" (e.g. \"acme/billing\").`,\n );\n }\n return { moduleId, range };\n}\n\n\n\n\nexport default class RegistryUpdateCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'registry update',\n description: 'Update an installed module to the latest (or specified) version.',\n category: CommandCategory.Registry,\n args: [\n {\n name: 'spec',\n description: 'Module spec — `<moduleId>[@<range>]` (e.g. `acme/billing@^1.3.0`).',\n required: true,\n },\n ],\n flags: {\n 'no-install': NO_INSTALL_FLAG,\n registry: {\n type: 'string',\n description: 'Override the registry id/URL/alias. Default: the lockfile entry\\'s recorded registry.',\n },\n force: {\n type: 'boolean',\n description: 'Overwrite (or delete) files you changed since install, and files no module installed (a backup is kept under .wildo-saas/tmp/registry-backups/).',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = requireSaasRoot(ctx, 'update');\n const specInput = ctx.args.spec;\n if (!specInput) {\n return { success: false, message: '`spec` argument is required.' };\n }\n const parsed = parseSpec(specInput);\n\n const section = await RegistryLockfileService.read(saasRoot);\n const existing = section.installed[parsed.moduleId];\n if (!existing) {\n return {\n success: false,\n message:\n `\"${parsed.moduleId}\" is not installed. Use \\`wildo add <domain>/${parsed.moduleId}@${parsed.range}\\` instead.`,\n };\n }\n\n const flag = ctx.flags.registry as string | undefined;\n // #2015: an update keeps the module's RECORDED origin. A checkout install updates from the checkout and\n // a registry install from its registry; only an explicit `--registry` moves a module to a registry.\n let acquisition: ModuleAcquisition;\n let credentialUrl: string | undefined;\n if (flag === undefined && existing.distribution === ModuleDistribution.LOCAL_CHECKOUT) {\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (!frameworkRoot) {\n return {\n success: false,\n message:\n `\"${parsed.moduleId}\" was installed from the framework checkout, and this command is not running inside one. `\n + 'Run it inside the checkout, or pass `--registry <id|url|alias>` to move the module to a registry release.',\n };\n }\n const recorded = localCheckoutProvenanceOf(existing);\n const local = await resolveLocalCheckoutModule({ frameworkRoot, domain: existing.domain, moduleId: parsed.moduleId, range: parsed.range });\n ctx.log.info(`[registry update] ${parsed.moduleId} (${existing.version} → @${parsed.range}) from the framework checkout`);\n // Nothing to do only when the version, the commit and a clean source all agree: a dirty source at\n // either end means the commit does not describe the bytes, so it is staged again.\n if (local.version === existing.version && local.checkoutCommit === recorded.checkoutCommit && !local.checkoutDirty && !recorded.checkoutDirty) {\n ctx.log.success(` already at ${local.version} from checkout ${local.checkoutCommit.slice(0, 12)} — no files changed; host requirements were not revalidated.`);\n return { success: true, message: `Up to date (${local.version}).` };\n }\n acquisition = { distribution: ModuleDistribution.LOCAL_CHECKOUT, version: local.version, local };\n } else {\n // When no `--registry` is supplied, recover the registry binding recorded at install time.\n const resolved: { url: string; id?: string } = flag\n ? await resolveRegistryUrlForCommand(ctx, { flag, saasRoot })\n : await resolveLockedRegistry(ctx, saasRoot, existing);\n ctx.log.info(\n `[registry update] ${parsed.moduleId} (${existing.version} → @${parsed.range}) on ${resolved.url}`,\n );\n\n const credential = await RegistryCredentialsService.get(resolved.url);\n const clientOptions = { baseUrl: resolved.url, authToken: credential?.rawToken };\n if (credential) credentialUrl = resolved.url;\n\n // Resolve the target version + digest.\n const { version, artifactDigest, yanked } = await RegistryServerClient.resolve(clientOptions, {\n domain: existing.domain,\n moduleId: parsed.moduleId,\n range: parsed.range,\n });\n if (yanked) {\n // Only an exact pin reaches a yanked release (#1758); install it, but say so.\n ctx.log.warn(` ${parsed.moduleId}@${version} is YANKED (${yanked.yankedAt}${yanked.reason ? `: ${yanked.reason}` : ''}). Installing the pinned release; pick a live one with a range.`);\n }\n\n // The pinned version's bytes never change: the same version under a different digest is refused,\n // not re-installed (it used to fall through to a silent reinstall of the new bytes). A pin exists only\n // on a registry entry; a checkout entry moving to a registry has none to hold.\n const pinnedDigest = existing.distribution === ModuleDistribution.REGISTRY ? registryProvenanceOf(existing).artifactDigest : undefined;\n if (pinnedDigest !== undefined && version === existing.version) {\n assertServedDigestMatchesPin({\n moduleId: parsed.moduleId,\n version,\n pinnedDigest,\n servedDigest: artifactDigest,\n });\n }\n // No-op short-circuit: same version + same digest = nothing to do.\n if (version === existing.version && artifactDigest === pinnedDigest) {\n ctx.log.success(` already at ${version} with matching integrity — no files changed; host requirements were not revalidated.`);\n return { success: true, message: `Up to date (${version}).` };\n }\n\n const { bytes } = await RegistryServerClient.download(clientOptions, {\n domain: existing.domain,\n moduleId: parsed.moduleId,\n version,\n expectedDigest: artifactDigest,\n });\n ctx.log.info(` downloaded → ${bytes.byteLength} bytes`);\n acquisition = {\n distribution: ModuleDistribution.REGISTRY,\n version,\n artifactDigest,\n bytes,\n registry: { url: resolved.url, id: resolved.id ?? (existing.registryId ?? DEFAULT_REGISTRY_ID) },\n };\n }\n const version = acquisition.version;\n ctx.log.info(` resolved → ${describeAcquisition(parsed.moduleId, acquisition)}`);\n\n let resourceConfigurationFiles: string[] = [];\n let changedProvider = false;\n /** The install-script names this run newly allowed (#2801), rebuilt after the install. */\n let allowedInstallScripts: readonly string[] = [];\n /** Whether the provider ships skills (#2026), before or after this change: then its skills are synced too. */\n let carriesSkills = false;\n await withRegistryWorkspaceMutationLock(saasRoot, async () => {\n // `existing` (its pin and its file set, which the shrink below deletes from) was read before the\n // lock; re-confirmed under it.\n await assertModuleEntryUnchangedUnderLock(saasRoot, parsed.moduleId, existing);\n const paths = moduleArtifactPaths(saasRoot, existing.domain, parsed.moduleId, version);\n const stagedCount = await stageModuleAcquisition(acquisition, paths, saasRoot);\n ctx.log.success(` staged ${stagedCount} file(s) → ${path.relative(saasRoot, paths.extractDir)}/`);\n\n // Boundary-enforced fan-out → record the new SaaS-source paths.\n // M9: snapshot pre-existing destinations so a partial-failure\n // mid-fan-out (or a lockfile-write failure right after) can roll\n // back the SaaS source to the pre-update state. M10: cross-module\n // overlap warnings for any path another module also claims.\n const stagedManifest = await readStagedManifest(paths.extractDir);\n assertStagedManifestMatchesRequest(stagedManifest, { moduleId: parsed.moduleId, version });\n // #2861: a blueprint is applied by `wildo init --blueprint`, never installed into an existing application. Its\n // staged copy can never become an install, so it does not stay in the application's generated tree.\n if (stagedManifest.kind === ModuleKind.BLUEPRINT) {\n await fs.rm(paths.extractDir, { recursive: true, force: true });\n await fs.rm(paths.zip, { force: true });\n throw new Error(`${stagedManifest.id} is a blueprint: it starts a new application with \\`wildo init --blueprint\\` and is never installed into an existing one.`);\n }\n for (const notice of await checkModuleRequirements(saasRoot, stagedManifest, moduleRequirementsOriginOf(acquisition))) ctx.log.warn(notice);\n // #2014: a provider module is wired into THIS application's own runtimes. Derived before a single file is\n // written, so a refusal (no backend service to own a backend facet) leaves the application untouched.\n const providerRegistration = stagedManifest.kind === ModuleKind.PROVIDER ? await deriveProviderRegistration(saasRoot, stagedManifest) : undefined;\n changedProvider = providerRegistration !== undefined;\n carriesSkills = (stagedManifest.provider?.skills?.length ?? 0) > 0 || (existing.files ?? []).some((file) => /^providers\\/[^/]+\\/skills\\//.test(file));\n await fs.rm(paths.backupDir, { recursive: true, force: true });\n // #2016: a file the application changed since install is kept, not overwritten, unless --force.\n const force = ctx.flags.force === true;\n const forceBackupDirectory = registryForceBackupDirectory(saasRoot, parsed.moduleId);\n const writePlan = await planProtectedWrite({\n saasRoot,\n moduleId: parsed.moduleId,\n stagedPaths: await validatedStagedAppFiles({ saasRoot, extractDir: paths.extractDir, manifest: stagedManifest }),\n recorded: existing,\n force,\n restoreMissing: false,\n backupDirectory: forceBackupDirectory,\n findOtherOwners: (candidates) => RegistryLockfileService.findFileOwners({ saasRoot, paths: candidates, excludeModuleId: parsed.moduleId }),\n });\n for (const kept of writePlan.kept) ctx.log.warn(` ${describeProtectedFile(kept.path, kept.state, 'overwritten')}`);\n for (const missing of writePlan.notRestored) ctx.log.warn(` not recreated ${missing}: you deleted it since it was installed. \\`wildo registry repair-lockfile --fix\\` restores it.`);\n for (const forced of writePlan.forced) ctx.log.warn(` overwrote ${forced.path} (--force); your version is at ${path.relative(saasRoot, forced.backup)}`);\n const fanOut = await fanOutToSaasSource({\n saasRoot,\n extractDir: paths.extractDir,\n manifest: stagedManifest,\n moduleId: parsed.moduleId,\n backupDir: paths.backupDir,\n skipPaths: writePlan.skip,\n });\n ctx.log.success(` wrote ${fanOut.writtenFiles.length} app source file(s) per manifest.boundaries`);\n if (fanOut.overlapWarnings.length > 0) {\n for (const w of fanOut.overlapWarnings) {\n ctx.log.warn(` [overlap] \"${w.path}\" was also claimed by \"${w.otherModuleId}\" — overwritten by ${parsed.moduleId}.`);\n }\n }\n\n // #1755: register the new version (reversing the previous registration first if it changed),\n // or mark why it is not registered.\n // Reversing the previous registration can throw, and so can applying a provider's CHANGED wiring (after\n // undoing its own partial reversal, #2014); the new files are already in place, so either failure rolls the\n // fan-out back like a lockfile failure does, leaving the installed version and its wiring as they were.\n let registrationOutcome: ReturnType<typeof registerModuleForInstall>;\n try {\n registrationOutcome = registerModuleForInstall(\n saasRoot,\n ctx.cliContext.resolvedHomes.framework.repositoryRoot ?? null,\n stagedManifest,\n existing.registration,\n providerRegistration,\n );\n } catch (registrationError) {\n await rollbackFanOut({ saasRoot, result: fanOut }).catch(() => {});\n await fs.rm(paths.backupDir, { recursive: true, force: true }).catch(() => {});\n throw registrationError;\n }\n reportRegistrationOutcome(ctx.log, registrationOutcome, saasRoot);\n allowedInstallScripts = registrationOutcome.allowedInstallScripts;\n\n // M9 (4th-pass review): shrink-cleanup is reordered to AFTER the\n // lockfile upsert. Previously it ran before, and a subsequent\n // lockfile-write failure left an unrecoverable state:\n // lockfile = OLD version, source = missing files-only-in-OLD.\n // The fix sequences the steps so each failure mode has a clean\n // recovery:\n // 1. fan-out (with backup snapshot)\n // 2. lockfile upsert → on failure, rollback fan-out cleanly\n // (no shrink-deletes have happened yet)\n // 3. shrink-cleanup → on failure, lockfile already records the\n // new version; operator re-runs `update`\n // or `repair-lockfile` to clean up.\n //\n // 5th-pass K-L2 — concurrent-repair safety: the window between\n // step 2 (lockfile records new version, files[] = NEW set) and\n // step 3 (shrink-deletes old-only files) leaves orphan files on\n // disk that AREN'T in `entry.files`. `repair-lockfile`'s\n // `module-file-missing` finding only fires for files IN\n // `entry.files` and absent from disk — orphan old-only files are\n // outside its purview, so a concurrent repair run cannot\n // mistakenly re-fetch the new version because of them. Verified\n // safe via `LockfileRepairService.collectEntryFindings`.\n // The previous origin's provenance is dropped whole, so a module that moved origin never carries\n // both kinds of fields (the lockfile schema refuses that).\n const {\n registration: _previousRegistration,\n distribution: _previousDistribution,\n registryId: _previousRegistryId,\n registryUrl: _previousRegistryUrl,\n artifactDigest: _previousArtifactDigest,\n checkoutCommit: _previousCheckoutCommit,\n checkoutDirty: _previousCheckoutDirty,\n ...existingWithoutOrigin\n } = existing;\n const entry: RegistryModulesLockEntry = {\n ...existingWithoutOrigin,\n ...(registrationOutcome.registration ? { registration: registrationOutcome.registration } : {}),\n ...lockEntryProvenance(acquisition),\n version,\n requestedRange: parsed.range,\n installedAt: new Date().toISOString(),\n files: fanOut.ownedFiles,\n installedFileHashes: await nextInstalledFileHashes({ saasRoot, ownedFiles: fanOut.ownedFiles, skipped: writePlan.skip, previous: existing }),\n source: 'update',\n };\n try {\n await RegistryLockfileService.upsertEntry(saasRoot, entry);\n } catch (lockErr) {\n ctx.log.error(` lockfile write failed — rolling back ${fanOut.writtenFiles.length} fan-out file(s).`);\n // M8 + 5th-pass K-L1: rollback wrapping is belt-and-suspenders\n // (`rollbackFanOut` swallows per-file FS errors internally —\n // unreachable on POSIX today). Kept against future changes that\n // let those errors propagate, AND so a rollback-side error\n // doesn't mask the original `lockErr`. See `add.command.ts` for\n // the same pattern + rationale.\n try {\n rollbackInstallRegistration(saasRoot, registrationOutcome.snapshots);\n await rollbackFanOut({ saasRoot, result: fanOut });\n } catch (rbErr) {\n ctx.log.error(\n ` rollback failed: ${ErrorUtils.extractErrorMessage(rbErr)} — SaaS source may be in a partially-applied state.`,\n );\n }\n // 7th-pass K-L1: same swallow rationale as `add.command.ts` — a\n // cleanup failure must NOT mask the original `lockErr`. Best-\n // effort `.catch(() => {})` is intentional.\n await fs.rm(paths.backupDir, { recursive: true, force: true }).catch(() => {});\n throw lockErr;\n }\n await fs.rm(paths.backupDir, { recursive: true, force: true }).catch(() => {});\n ctx.log.success(' lockfile updated');\n if (registrationOutcome.registration) {\n ctx.log.success(` registered in the application's module registries (${registrationOutcome.registration.moduleId})`);\n }\n\n // Clean up files that existed in the OLD version but no longer\n // exist in the new one. Files present in both are simply\n // overwritten by `fanOutToSaasSource`. This is the \"shrink\"\n // direction of update — the inverse of \"remove\".\n //\n // Cross-module file-overlap guard: if another lockfile entry\n // claims any of the about-to-be-deleted paths, skip them — that\n // module still owns the file. This prevents `update` from silently\n // pulling files out from under sibling modules that share a barrel\n // / generated index.\n //\n // Failure tolerance: if a shrink-unlink throws (other than ENOENT),\n // we log + continue rather than abort. The lockfile already\n // records the new version, so the operator can re-run `update` or\n // `wildo registry repair-lockfile` to converge.\n // Asked BEFORE the shrink deletes the old-only files: a resource the new version dropped still owes a migration.\n resourceConfigurationFiles = await findResourceConfigurationFiles(saasRoot, [...new Set([...fanOut.writtenFiles, ...existing.files])]);\n // The files that leave the module are those it no longer OWNS, not those it did not write: a file\n // kept because you edited it is still owned (#2016), and deleting it here would destroy exactly\n // what the write step protected.\n const newOwnedSet = new Set(fanOut.ownedFiles);\n const candidates = existing.files.filter((p) => !newOwnedSet.has(p));\n const claimedBy = await RegistryLockfileService.findFileOwners({\n saasRoot,\n paths: candidates,\n excludeModuleId: parsed.moduleId,\n });\n let removedCount = 0;\n let skippedCount = 0;\n let failedCount = 0;\n const unlinked: string[] = [];\n const unclaimed: string[] = [];\n for (const oldRel of candidates) {\n const owners = claimedBy.get(oldRel) ?? [];\n if (owners.length > 0) {\n ctx.log.warn(` keep ${oldRel} — also owned by ${owners.join(', ')}`);\n skippedCount += 1;\n continue;\n }\n unclaimed.push(oldRel);\n }\n const removalPlan = await planProtectedRemoval({ saasRoot, entry: existing, paths: unclaimed, force, backupDirectory: forceBackupDirectory });\n for (const kept of removalPlan.kept) {\n ctx.log.warn(` ${describeProtectedFile(kept.path, kept.state, 'deleted')} ${version} no longer ships it, so it is now the application's own file.`);\n }\n for (const forced of removalPlan.forced) ctx.log.warn(` deleted ${forced.path} (--force); your version is at ${path.relative(saasRoot, forced.backup)}`);\n for (const oldRel of removalPlan.remove) {\n try {\n const oldAbs = resolveRecordedModuleFile(saasRoot, oldRel);\n await fs.unlink(oldAbs);\n removedCount += 1;\n unlinked.push(oldRel);\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') continue;\n ctx.log.warn(\n ` shrink-unlink failed for ${oldRel}: ${ErrorUtils.extractErrorMessage(err)} (non-fatal — re-run \\`wildo registry repair-lockfile\\` to converge).`,\n );\n failedCount += 1;\n }\n }\n if (removedCount > 0) {\n // A directory the previous version had and this one does not goes with its last file.\n await pruneEmptiedModuleDirectories(saasRoot, unlinked);\n ctx.log.info(` removed ${removedCount} file(s) no longer present in ${version}`);\n }\n if (skippedCount > 0) {\n ctx.log.info(` skipped ${skippedCount} file(s) claimed by other modules`);\n }\n if (failedCount > 0) {\n ctx.log.warn(` shrink-cleanup left ${failedCount} stale file(s) on disk`);\n }\n });\n\n // #1757: a module that declares resources leaves a migration owed on an application that has\n // adopted migrations. Marked here, after the lock — the plan cannot be computed until the backend\n // is rebuilt with the module in it.\n const migrationObligation = deriveMigrationObligation({ saasRoot, moduleId: parsed.moduleId, verb: 'update', resourceConfigurationFiles });\n if (migrationObligation) for (const line of describeMigrationObligation(migrationObligation)) ctx.log.warn(line);\n\n if (credentialUrl !== undefined) await RegistryCredentialsService.touch(credentialUrl);\n\n // #2014: a provider's packages must resolve before the sync can discover them.\n if (changedProvider) installAfterProviderChange(ctx, saasRoot, parsed.moduleId, { rebuild: allowedInstallScripts });\n // #2026: the provider's skills follow it into (or out of) `.claude/skills/`.\n if (changedProvider && carriesSkills) syncSkillsAfterProviderChange(ctx, saasRoot, parsed.moduleId);\n\n // K-L2 (4th-pass review) + 5th-pass K-L3 — provider-sync soft-success\n // waiver: see `add.command.ts` for the full rationale. Same\n // semantic here: the lockfile + SaaS source are consistent before\n // this step; provider-sync is a downstream materialization that\n // operators can re-run independently with `wildo config sync\n // --domain config`. CI users grep stderr for `provider-sync failed`\n // or run `wildo config sync` as a separate post-step.\n try {\n await runProviderSync({\n saasRoot,\n reason: 'update',\n dryRun: false,\n log: asRegistryLogger(ctx),\n });\n ctx.log.success(' provider-sync OK');\n } catch (err) {\n ctx.log.warn(` provider-sync failed: ${(err as Error).message}`);\n }\n\n return {\n success: true,\n message: `Updated ${parsed.moduleId}: ${existing.version} → ${version}.`,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"update.command.js","sourceRoot":"","sources":["../../../../src/commands/registry/update.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAChB,MAA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IAAI,CAAC;YACH,MAAM,eAAe,CAAC;gBACpB,QAAQ;gBACR,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC;aAC3B,CAAC,CAAC;YACH,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACxC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA4B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,WAAW,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,MAAM,OAAO,GAAG;SACzE,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * `wildo registry update <moduleId>[@<range>]` — refresh an\n * already-installed module to the latest (or specified) version.\n *\n * NOT aliased as `wildo update`: that name belongs to the framework update (`update.command.ts`),\n * which moves the CLI and the application to a published framework release. A module update is a\n * registry verb and is always spelled `wildo registry update`.\n *\n * Pipeline:\n * 1. Look up the existing lockfile entry for `<moduleId>` to\n * recover the registry id + domain that recorded the original\n * install (no need for the user to re-state them).\n * 2. Resolve the registry URL via `resolveRegistryUrl` — the\n * explicit `--registry` flag still wins; otherwise the entry's\n * `registryUrl` is used (or the resolver's fallback policy if\n * the entry's URL is no longer reachable).\n * 3. `RegistryServerClient.resolve` against the requested range\n * (default: `latest`).\n * 4. If the resolved version equals the lockfile's current version\n * AND the integrity digest matches, exit success without\n * re-downloading.\n * 5. Else download (sha256-verified), persist, update the lockfile\n * entry with `source: 'update'` + new `installedAt` timestamp,\n * run provider-sync.\n *\n * Refuses to operate on modules not present in the lockfile —\n * `wildo registry add` is the path to install something new.\n */\n\nimport { checkModuleRequirements } from '~wildo-cli/services/registry/module-requirements.service';\nimport { promises as fs } from 'node:fs';\nimport * as path from 'node:path';\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 {\n RegistryServerClient,\n RegistryLockfileService,\n runProviderSync,\n} from '@wildo-ai/wildo-module-client';\nimport {\n localCheckoutProvenanceOf,\n ModuleDistribution,\n registryProvenanceOf,\n type RegistryModulesLockEntry,\n ModuleKind,\n} from '@wildo-ai/platform-config-lib';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { RegistryCredentialsService } from '~wildo-cli/services/registry/registry-credentials.service';\nimport {\n requireSaasRoot,\n asRegistryLogger,\n resolveLockedRegistry,\n resolveRegistryUrlForCommand,\n withRegistryWorkspaceMutationLock,\n assertModuleEntryUnchangedUnderLock,\n} from '~wildo-cli/services/registry/registry-command.utils';\nimport {\n fanOutToSaasSource,\n validatedStagedAppFiles,\n pruneEmptiedModuleDirectories,\n readStagedManifest,\n resolveRecordedModuleFile,\n rollbackFanOut,\n} from '~wildo-cli/services/registry/boundary-fanout.utils';\nimport {\n deriveMigrationObligation,\n describeMigrationObligation,\n findResourceConfigurationFiles,\n} from '~wildo-cli/services/registry/migration-obligation.utils';\nimport {\n registerModuleForInstall,\n rollbackInstallRegistration,\n deriveProviderRegistration,\n} from '~wildo-cli/services/registry/module-registration.service';\nimport { reportRegistrationOutcome } from '~wildo-cli/services/registry/provider-wiring.service';\nimport { installAfterProviderChange, NO_INSTALL_FLAG, syncSkillsAfterProviderChange } from '~wildo-cli/services/registry/provider-install-step';\nimport { moduleArtifactPaths } from '~wildo-cli/services/registry/module-artifact-files.utils';\nimport { resolveLocalCheckoutModule } from '~wildo-cli/services/registry/local-checkout-module-source.service';\nimport {\n describeProtectedFile,\n nextInstalledFileHashes,\n planProtectedRemoval,\n planProtectedWrite,\n registryForceBackupDirectory,\n} from '~wildo-cli/services/registry/installed-file-state.utils';\nimport {\n describeAcquisition,\n lockEntryProvenance,\n moduleRequirementsOriginOf,\n stageModuleAcquisition,\n type ModuleAcquisition,\n} from '~wildo-cli/services/registry/module-acquisition.utils';\nimport { DEFAULT_REGISTRY_ID } from '@wildo-ai/platform-config-lib';\nimport {\n assertServedDigestMatchesPin,\n assertStagedManifestMatchesRequest,\n} from '~wildo-cli/services/registry/artifact-trust.utils';\n\ninterface ParsedSpec {\n moduleId: string;\n range: string;\n}\n\n/**\n * Range-suffix shape: `@` followed by a semver-ish token. Mirrors\n * `add.command.ts`'s parser so `@<scope>/<name>` (npm scope, no range)\n * isn't mis-parsed.\n */\nconst RANGE_SUFFIX_RE = /@([\\^~]?\\d|>=?|<=?|\\*|x|latest|next|canary|beta|alpha|rc)/i;\n\nfunction parseSpec(spec: string): ParsedSpec {\n const rangeMatch = spec.match(RANGE_SUFFIX_RE);\n const hasRange = rangeMatch !== null && rangeMatch.index !== undefined && rangeMatch.index > 0;\n const moduleId = hasRange ? spec.slice(0, rangeMatch!.index) : spec;\n const range = hasRange ? spec.slice(rangeMatch!.index! + 1) : 'latest';\n if (!moduleId.includes('/')) {\n throw new Error(\n `Invalid module spec \"${spec}\". moduleId must be \"<scope>/<name>\" (e.g. \"acme/billing\").`,\n );\n }\n return { moduleId, range };\n}\n\n\n\n\nexport default class RegistryUpdateCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'registry update',\n description: 'Update an installed module to the latest (or specified) version.',\n category: CommandCategory.Registry,\n args: [\n {\n name: 'spec',\n description: 'Module spec — `<moduleId>[@<range>]` (e.g. `acme/billing@^1.3.0`).',\n required: true,\n },\n ],\n flags: {\n 'no-install': NO_INSTALL_FLAG,\n registry: {\n type: 'string',\n description: 'Override the registry id/URL/alias. Default: the lockfile entry\\'s recorded registry.',\n },\n force: {\n type: 'boolean',\n description: 'Overwrite (or delete) files you changed since install, and files no module installed (a backup is kept under .wildo-saas/tmp/registry-backups/).',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = requireSaasRoot(ctx, 'update');\n const specInput = ctx.args.spec;\n if (!specInput) {\n return { success: false, message: '`spec` argument is required.' };\n }\n const parsed = parseSpec(specInput);\n\n const section = await RegistryLockfileService.read(saasRoot);\n const existing = section.installed[parsed.moduleId];\n if (!existing) {\n return {\n success: false,\n message:\n `\"${parsed.moduleId}\" is not installed. Use \\`wildo add <domain>/${parsed.moduleId}@${parsed.range}\\` instead.`,\n };\n }\n\n const flag = ctx.flags.registry as string | undefined;\n // #2015: an update keeps the module's RECORDED origin. A checkout install updates from the checkout and\n // a registry install from its registry; only an explicit `--registry` moves a module to a registry.\n let acquisition: ModuleAcquisition;\n let credentialUrl: string | undefined;\n if (flag === undefined && existing.distribution === ModuleDistribution.LOCAL_CHECKOUT) {\n const frameworkRoot = ctx.cliContext.resolvedHomes.framework.repositoryRoot;\n if (!frameworkRoot) {\n return {\n success: false,\n message:\n `\"${parsed.moduleId}\" was installed from the framework checkout, and this command is not running inside one. `\n + 'Run it inside the checkout, or pass `--registry <id|url|alias>` to move the module to a registry release.',\n };\n }\n const recorded = localCheckoutProvenanceOf(existing);\n const local = await resolveLocalCheckoutModule({ frameworkRoot, domain: existing.domain, moduleId: parsed.moduleId, range: parsed.range });\n ctx.log.info(`[registry update] ${parsed.moduleId} (${existing.version} → @${parsed.range}) from the framework checkout`);\n // Nothing to do only when the version, the commit and a clean source all agree: a dirty source at\n // either end means the commit does not describe the bytes, so it is staged again.\n if (local.version === existing.version && local.checkoutCommit === recorded.checkoutCommit && !local.checkoutDirty && !recorded.checkoutDirty) {\n ctx.log.success(` already at ${local.version} from checkout ${local.checkoutCommit.slice(0, 12)} — no files changed; host requirements were not revalidated.`);\n return { success: true, message: `Up to date (${local.version}).` };\n }\n acquisition = { distribution: ModuleDistribution.LOCAL_CHECKOUT, version: local.version, local };\n } else {\n // When no `--registry` is supplied, recover the registry binding recorded at install time.\n const resolved: { url: string; id?: string } = flag\n ? await resolveRegistryUrlForCommand(ctx, { flag, saasRoot })\n : await resolveLockedRegistry(ctx, saasRoot, existing);\n ctx.log.info(\n `[registry update] ${parsed.moduleId} (${existing.version} → @${parsed.range}) on ${resolved.url}`,\n );\n\n const credential = await RegistryCredentialsService.get(resolved.url);\n const clientOptions = { baseUrl: resolved.url, authToken: credential?.rawToken };\n if (credential) credentialUrl = resolved.url;\n\n // Resolve the target version + digest.\n const { version, artifactDigest, yanked } = await RegistryServerClient.resolve(clientOptions, {\n domain: existing.domain,\n moduleId: parsed.moduleId,\n range: parsed.range,\n });\n if (yanked) {\n // Only an exact pin reaches a yanked release (#1758); install it, but say so.\n ctx.log.warn(` ${parsed.moduleId}@${version} is YANKED (${yanked.yankedAt}${yanked.reason ? `: ${yanked.reason}` : ''}). Installing the pinned release; pick a live one with a range.`);\n }\n\n // The pinned version's bytes never change: the same version under a different digest is refused,\n // not re-installed (it used to fall through to a silent reinstall of the new bytes). A pin exists only\n // on a registry entry; a checkout entry moving to a registry has none to hold.\n const pinnedDigest = existing.distribution === ModuleDistribution.REGISTRY ? registryProvenanceOf(existing).artifactDigest : undefined;\n if (pinnedDigest !== undefined && version === existing.version) {\n assertServedDigestMatchesPin({\n moduleId: parsed.moduleId,\n version,\n pinnedDigest,\n servedDigest: artifactDigest,\n });\n }\n // No-op short-circuit: same version + same digest = nothing to do.\n if (version === existing.version && artifactDigest === pinnedDigest) {\n ctx.log.success(` already at ${version} with matching integrity — no files changed; host requirements were not revalidated.`);\n return { success: true, message: `Up to date (${version}).` };\n }\n\n const { bytes } = await RegistryServerClient.download(clientOptions, {\n domain: existing.domain,\n moduleId: parsed.moduleId,\n version,\n expectedDigest: artifactDigest,\n });\n ctx.log.info(` downloaded → ${bytes.byteLength} bytes`);\n acquisition = {\n distribution: ModuleDistribution.REGISTRY,\n version,\n artifactDigest,\n bytes,\n registry: { url: resolved.url, id: resolved.id ?? (existing.registryId ?? DEFAULT_REGISTRY_ID) },\n };\n }\n const version = acquisition.version;\n ctx.log.info(` resolved → ${describeAcquisition(parsed.moduleId, acquisition)}`);\n\n let resourceConfigurationFiles: string[] = [];\n let changedProvider = false;\n /** The install-script names this run newly allowed (#2801), rebuilt after the install. */\n let allowedInstallScripts: readonly string[] = [];\n /** Whether the provider ships skills (#2026), before or after this change: then its skills are synced too. */\n let carriesSkills = false;\n await withRegistryWorkspaceMutationLock(saasRoot, async () => {\n // `existing` (its pin and its file set, which the shrink below deletes from) was read before the\n // lock; re-confirmed under it.\n await assertModuleEntryUnchangedUnderLock(saasRoot, parsed.moduleId, existing);\n const paths = moduleArtifactPaths(saasRoot, existing.domain, parsed.moduleId, version);\n const stagedCount = await stageModuleAcquisition(acquisition, paths, saasRoot);\n ctx.log.success(` staged ${stagedCount} file(s) → ${path.relative(saasRoot, paths.extractDir)}/`);\n\n // Boundary-enforced fan-out → record the new SaaS-source paths.\n // M9: snapshot pre-existing destinations so a partial-failure\n // mid-fan-out (or a lockfile-write failure right after) can roll\n // back the SaaS source to the pre-update state. M10: cross-module\n // overlap warnings for any path another module also claims.\n const stagedManifest = await readStagedManifest(paths.extractDir);\n assertStagedManifestMatchesRequest(stagedManifest, { moduleId: parsed.moduleId, version });\n // #2861: a blueprint is applied by `wildo init --blueprint`, never installed into an existing application. Its\n // staged copy can never become an install, so it does not stay in the application's generated tree.\n if (stagedManifest.kind === ModuleKind.BLUEPRINT) {\n await fs.rm(paths.extractDir, { recursive: true, force: true });\n await fs.rm(paths.zip, { force: true });\n throw new Error(`${stagedManifest.id} is a blueprint: it starts a new application with \\`wildo init --blueprint\\` and is never installed into an existing one.`);\n }\n for (const notice of await checkModuleRequirements(saasRoot, stagedManifest, moduleRequirementsOriginOf(acquisition))) ctx.log.warn(notice);\n // #2014: a provider module is wired into THIS application's own runtimes. Derived before a single file is\n // written, so a refusal (no backend service to own a backend facet) leaves the application untouched.\n const providerRegistration = stagedManifest.kind === ModuleKind.PROVIDER ? await deriveProviderRegistration(saasRoot, stagedManifest) : undefined;\n changedProvider = providerRegistration !== undefined;\n carriesSkills = (stagedManifest.provider?.skills?.length ?? 0) > 0 || (existing.files ?? []).some((file) => /^providers\\/[^/]+\\/skills\\//.test(file));\n await fs.rm(paths.backupDir, { recursive: true, force: true });\n // #2016: a file the application changed since install is kept, not overwritten, unless --force.\n const force = ctx.flags.force === true;\n const forceBackupDirectory = registryForceBackupDirectory(saasRoot, parsed.moduleId);\n const writePlan = await planProtectedWrite({\n saasRoot,\n extractDir: paths.extractDir,\n moduleId: parsed.moduleId,\n stagedPaths: await validatedStagedAppFiles({ saasRoot, extractDir: paths.extractDir, manifest: stagedManifest }),\n recorded: existing,\n force,\n restoreMissing: false,\n backupDirectory: forceBackupDirectory,\n findOtherOwners: (candidates) => RegistryLockfileService.findFileOwners({ saasRoot, paths: candidates, excludeModuleId: parsed.moduleId }),\n });\n for (const kept of writePlan.kept) ctx.log.warn(` ${describeProtectedFile(kept.path, kept.state, 'overwritten')}`);\n for (const missing of writePlan.notRestored) ctx.log.warn(` not recreated ${missing}: you deleted it since it was installed. \\`wildo registry repair-lockfile --fix\\` restores it.`);\n for (const forced of writePlan.forced) ctx.log.warn(` overwrote ${forced.path} (--force); your version is at ${path.relative(saasRoot, forced.backup)}`);\n const fanOut = await fanOutToSaasSource({\n saasRoot,\n extractDir: paths.extractDir,\n manifest: stagedManifest,\n moduleId: parsed.moduleId,\n backupDir: paths.backupDir,\n skipPaths: writePlan.skip,\n });\n ctx.log.success(` wrote ${fanOut.writtenFiles.length} app source file(s) per manifest.boundaries`);\n if (fanOut.overlapWarnings.length > 0) {\n for (const w of fanOut.overlapWarnings) {\n ctx.log.warn(` [overlap] \"${w.path}\" was also claimed by \"${w.otherModuleId}\" — overwritten by ${parsed.moduleId}.`);\n }\n }\n\n // #1755: register the new version (reversing the previous registration first if it changed),\n // or mark why it is not registered.\n // Reversing the previous registration can throw, and so can applying a provider's CHANGED wiring (after\n // undoing its own partial reversal, #2014); the new files are already in place, so either failure rolls the\n // fan-out back like a lockfile failure does, leaving the installed version and its wiring as they were.\n let registrationOutcome: ReturnType<typeof registerModuleForInstall>;\n try {\n registrationOutcome = registerModuleForInstall(\n saasRoot,\n ctx.cliContext.resolvedHomes.framework.repositoryRoot ?? null,\n stagedManifest,\n existing.registration,\n providerRegistration,\n );\n } catch (registrationError) {\n await rollbackFanOut({ saasRoot, result: fanOut }).catch(() => {});\n await fs.rm(paths.backupDir, { recursive: true, force: true }).catch(() => {});\n throw registrationError;\n }\n reportRegistrationOutcome(ctx.log, registrationOutcome, saasRoot);\n allowedInstallScripts = registrationOutcome.allowedInstallScripts;\n\n // M9 (4th-pass review): shrink-cleanup is reordered to AFTER the\n // lockfile upsert. Previously it ran before, and a subsequent\n // lockfile-write failure left an unrecoverable state:\n // lockfile = OLD version, source = missing files-only-in-OLD.\n // The fix sequences the steps so each failure mode has a clean\n // recovery:\n // 1. fan-out (with backup snapshot)\n // 2. lockfile upsert → on failure, rollback fan-out cleanly\n // (no shrink-deletes have happened yet)\n // 3. shrink-cleanup → on failure, lockfile already records the\n // new version; operator re-runs `update`\n // or `repair-lockfile` to clean up.\n //\n // 5th-pass K-L2 — concurrent-repair safety: the window between\n // step 2 (lockfile records new version, files[] = NEW set) and\n // step 3 (shrink-deletes old-only files) leaves orphan files on\n // disk that AREN'T in `entry.files`. `repair-lockfile`'s\n // `module-file-missing` finding only fires for files IN\n // `entry.files` and absent from disk — orphan old-only files are\n // outside its purview, so a concurrent repair run cannot\n // mistakenly re-fetch the new version because of them. Verified\n // safe via `LockfileRepairService.collectEntryFindings`.\n // The previous origin's provenance is dropped whole, so a module that moved origin never carries\n // both kinds of fields (the lockfile schema refuses that).\n const {\n registration: _previousRegistration,\n distribution: _previousDistribution,\n registryId: _previousRegistryId,\n registryUrl: _previousRegistryUrl,\n artifactDigest: _previousArtifactDigest,\n checkoutCommit: _previousCheckoutCommit,\n checkoutDirty: _previousCheckoutDirty,\n ...existingWithoutOrigin\n } = existing;\n const entry: RegistryModulesLockEntry = {\n ...existingWithoutOrigin,\n ...(registrationOutcome.registration ? { registration: registrationOutcome.registration } : {}),\n ...lockEntryProvenance(acquisition),\n version,\n requestedRange: parsed.range,\n installedAt: new Date().toISOString(),\n files: fanOut.ownedFiles,\n installedFileHashes: await nextInstalledFileHashes({ saasRoot, ownedFiles: fanOut.ownedFiles, skipped: writePlan.skip, previous: existing }),\n source: 'update',\n };\n try {\n await RegistryLockfileService.upsertEntry(saasRoot, entry);\n } catch (lockErr) {\n ctx.log.error(` lockfile write failed — rolling back ${fanOut.writtenFiles.length} fan-out file(s).`);\n // M8 + 5th-pass K-L1: rollback wrapping is belt-and-suspenders\n // (`rollbackFanOut` swallows per-file FS errors internally —\n // unreachable on POSIX today). Kept against future changes that\n // let those errors propagate, AND so a rollback-side error\n // doesn't mask the original `lockErr`. See `add.command.ts` for\n // the same pattern + rationale.\n try {\n rollbackInstallRegistration(saasRoot, registrationOutcome.snapshots);\n await rollbackFanOut({ saasRoot, result: fanOut });\n } catch (rbErr) {\n ctx.log.error(\n ` rollback failed: ${ErrorUtils.extractErrorMessage(rbErr)} — SaaS source may be in a partially-applied state.`,\n );\n }\n // 7th-pass K-L1: same swallow rationale as `add.command.ts` — a\n // cleanup failure must NOT mask the original `lockErr`. Best-\n // effort `.catch(() => {})` is intentional.\n await fs.rm(paths.backupDir, { recursive: true, force: true }).catch(() => {});\n throw lockErr;\n }\n await fs.rm(paths.backupDir, { recursive: true, force: true }).catch(() => {});\n ctx.log.success(' lockfile updated');\n if (registrationOutcome.registration) {\n ctx.log.success(` registered in the application's module registries (${registrationOutcome.registration.moduleId})`);\n }\n\n // Clean up files that existed in the OLD version but no longer\n // exist in the new one. Files present in both are simply\n // overwritten by `fanOutToSaasSource`. This is the \"shrink\"\n // direction of update — the inverse of \"remove\".\n //\n // Cross-module file-overlap guard: if another lockfile entry\n // claims any of the about-to-be-deleted paths, skip them — that\n // module still owns the file. This prevents `update` from silently\n // pulling files out from under sibling modules that share a barrel\n // / generated index.\n //\n // Failure tolerance: if a shrink-unlink throws (other than ENOENT),\n // we log + continue rather than abort. The lockfile already\n // records the new version, so the operator can re-run `update` or\n // `wildo registry repair-lockfile` to converge.\n // Asked BEFORE the shrink deletes the old-only files: a resource the new version dropped still owes a migration.\n resourceConfigurationFiles = await findResourceConfigurationFiles(saasRoot, [...new Set([...fanOut.writtenFiles, ...existing.files])]);\n // The files that leave the module are those it no longer OWNS, not those it did not write: a file\n // kept because you edited it is still owned (#2016), and deleting it here would destroy exactly\n // what the write step protected.\n const newOwnedSet = new Set(fanOut.ownedFiles);\n const candidates = existing.files.filter((p) => !newOwnedSet.has(p));\n const claimedBy = await RegistryLockfileService.findFileOwners({\n saasRoot,\n paths: candidates,\n excludeModuleId: parsed.moduleId,\n });\n let removedCount = 0;\n let skippedCount = 0;\n let failedCount = 0;\n const unlinked: string[] = [];\n const unclaimed: string[] = [];\n for (const oldRel of candidates) {\n const owners = claimedBy.get(oldRel) ?? [];\n if (owners.length > 0) {\n ctx.log.warn(` keep ${oldRel} — also owned by ${owners.join(', ')}`);\n skippedCount += 1;\n continue;\n }\n unclaimed.push(oldRel);\n }\n const removalPlan = await planProtectedRemoval({ saasRoot, entry: existing, paths: unclaimed, force, backupDirectory: forceBackupDirectory });\n for (const kept of removalPlan.kept) {\n ctx.log.warn(` ${describeProtectedFile(kept.path, kept.state, 'deleted')} ${version} no longer ships it, so it is now the application's own file.`);\n }\n for (const forced of removalPlan.forced) ctx.log.warn(` deleted ${forced.path} (--force); your version is at ${path.relative(saasRoot, forced.backup)}`);\n for (const oldRel of removalPlan.remove) {\n try {\n const oldAbs = resolveRecordedModuleFile(saasRoot, oldRel);\n await fs.unlink(oldAbs);\n removedCount += 1;\n unlinked.push(oldRel);\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') continue;\n ctx.log.warn(\n ` shrink-unlink failed for ${oldRel}: ${ErrorUtils.extractErrorMessage(err)} (non-fatal — re-run \\`wildo registry repair-lockfile\\` to converge).`,\n );\n failedCount += 1;\n }\n }\n if (removedCount > 0) {\n // A directory the previous version had and this one does not goes with its last file.\n await pruneEmptiedModuleDirectories(saasRoot, unlinked);\n ctx.log.info(` removed ${removedCount} file(s) no longer present in ${version}`);\n }\n if (skippedCount > 0) {\n ctx.log.info(` skipped ${skippedCount} file(s) claimed by other modules`);\n }\n if (failedCount > 0) {\n ctx.log.warn(` shrink-cleanup left ${failedCount} stale file(s) on disk`);\n }\n });\n\n // #1757: a module that declares resources leaves a migration owed on an application that has\n // adopted migrations. Marked here, after the lock — the plan cannot be computed until the backend\n // is rebuilt with the module in it.\n const migrationObligation = deriveMigrationObligation({ saasRoot, moduleId: parsed.moduleId, verb: 'update', resourceConfigurationFiles });\n if (migrationObligation) for (const line of describeMigrationObligation(migrationObligation)) ctx.log.warn(line);\n\n if (credentialUrl !== undefined) await RegistryCredentialsService.touch(credentialUrl);\n\n // #2014: a provider's packages must resolve before the sync can discover them.\n if (changedProvider) installAfterProviderChange(ctx, saasRoot, parsed.moduleId, { rebuild: allowedInstallScripts });\n // #2026: the provider's skills follow it into (or out of) `.claude/skills/`.\n if (changedProvider && carriesSkills) syncSkillsAfterProviderChange(ctx, saasRoot, parsed.moduleId);\n\n // K-L2 (4th-pass review) + 5th-pass K-L3 — provider-sync soft-success\n // waiver: see `add.command.ts` for the full rationale. Same\n // semantic here: the lockfile + SaaS source are consistent before\n // this step; provider-sync is a downstream materialization that\n // operators can re-run independently with `wildo config sync\n // --domain config`. CI users grep stderr for `provider-sync failed`\n // or run `wildo config sync` as a separate post-step.\n try {\n await runProviderSync({\n saasRoot,\n reason: 'update',\n dryRun: false,\n log: asRegistryLogger(ctx),\n });\n ctx.log.success(' provider-sync OK');\n } catch (err) {\n ctx.log.warn(` provider-sync failed: ${(err as Error).message}`);\n }\n\n return {\n success: true,\n message: `Updated ${parsed.moduleId}: ${existing.version} → ${version}.`,\n };\n }\n}\n"]}
@@ -1,5 +1,15 @@
1
+ import { type ApprovalSealVerificationBundle, type ApprovalSealVerificationInput } from '@wildo-ai/platform-config-lib';
1
2
  import { BaseCommand } from '../../kernel/base-command';
2
3
  import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/types';
4
+ /**
5
+ * The vendor-signed copies to verify (#2907): each given file paired with the bundle entry whose recorded hash it has,
6
+ * so the entry's stated lineage is checked with it and the verifier can say the host records that exact copy. A host
7
+ * whose file row for a copy is gone names it with no hash: when exactly one such entry and exactly one unpaired file
8
+ * remain, they are paired, so the entry's lineage is still checked (the copy is then reported not recorded, since no
9
+ * hash ties those bytes to the row). Any other given file is checked from its bytes alone and reported with no file id
10
+ * and not recorded. Every named entry no file was paired with is passed as it is, and reported not given.
11
+ */
12
+ export declare function vendorSignedCopyInputsOf(named: NonNullable<ApprovalSealVerificationBundle['vendorSignedCopies']>, given: readonly Buffer[]): NonNullable<ApprovalSealVerificationInput['vendorSignedCopies']>;
3
13
  /**
4
14
  * `wildo seal verify <bundle.json>` — verify one approval seal OFFLINE (#2903): the bundle carries the compact JWS, the
5
15
  * stored records of the keys that may have signed it (scope and issuer included, as an export carries them), and
@@ -20,6 +30,14 @@ import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/ty
20
30
  * name, then its prefix opened against the seal's commitment. One changed byte in the approval page and the seal does
21
31
  * not verify. A copy the approver's erasure deleted is reported as erased content, never as missing.
22
32
  *
33
+ * The same original may also have VENDOR-SIGNED COPIES (#2907's document chain, #2293): the bundle names each with the
34
+ * file its row says it derives from. `--vendor-signed-copy <path>` (repeatable) checks one: its first revision, ending at
35
+ * a `%%EOF`, must be the approved file, and the command reports which original it derives from. A copy whose row names
36
+ * another original, whose bytes are not the ones its row hashed, or that does not start with the approved file, fails
37
+ * the seal. Only a copy the host RECORDS (named, with these exact bytes) is reported as the signed copy whose vendor
38
+ * signature was validated at receipt (that evidence is the signature request's, not the seal's); a copy the host does
39
+ * not record is reported as starting with the approved file, and nothing more.
40
+ *
23
41
  * Whether the approval is still CURRENT over its record (#2914): `--subject-record <record.json>` gives the record as it
24
42
  * is now (its fields, as an export of the record states them; `null` for a record that is gone). The values of the
25
43
  * fields the approval covers, as the disclosed presentation carries them, are compared with it. A record changed since
@@ -1 +1 @@
1
- {"version":3,"file":"verify.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/verify.command.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK1F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAcxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA4IvD"}
1
+ {"version":3,"file":"verify.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/verify.command.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACnC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK1F;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,WAAW,CAAC,8BAA8B,CAAC,oBAAoB,CAAC,CAAC,EACxE,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,WAAW,CAAC,6BAA6B,CAAC,oBAAoB,CAAC,CAAC,CAgBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAexB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAoKvD"}
@@ -1,3 +1,4 @@
1
+ import { createHash } from 'node:crypto';
1
2
  import { readFileSync } from 'node:fs';
2
3
  import { resolve } from 'node:path';
3
4
  import chalk from 'chalk';
@@ -9,6 +10,32 @@ import { CommandCategory } from '../../kernel/types.js';
9
10
  import { ErrorUtils } from '../../infrastructure/errors/error.utils.js';
10
11
  import { parseCsvFlag } from '../../kernel/flag-utils.js';
11
12
  import { readPinSetsFile, readSigningLogExportFile } from './signing-log-files.utils.js';
13
+ /**
14
+ * The vendor-signed copies to verify (#2907): each given file paired with the bundle entry whose recorded hash it has,
15
+ * so the entry's stated lineage is checked with it and the verifier can say the host records that exact copy. A host
16
+ * whose file row for a copy is gone names it with no hash: when exactly one such entry and exactly one unpaired file
17
+ * remain, they are paired, so the entry's lineage is still checked (the copy is then reported not recorded, since no
18
+ * hash ties those bytes to the row). Any other given file is checked from its bytes alone and reported with no file id
19
+ * and not recorded. Every named entry no file was paired with is passed as it is, and reported not given.
20
+ */
21
+ export function vendorSignedCopyInputsOf(named, given) {
22
+ const used = new Set();
23
+ const pairedWith = given.map((bytes) => {
24
+ const hash = createHash('sha256').update(bytes).digest('hex');
25
+ const index = named.findIndex((entry, at) => !used.has(at) && entry.contentSha256 === hash);
26
+ if (index >= 0)
27
+ used.add(index);
28
+ return index;
29
+ });
30
+ const unpairedFiles = pairedWith.flatMap((index, at) => (index < 0 ? [at] : []));
31
+ const hashlessEntries = named.flatMap((entry, at) => (!used.has(at) && entry.contentSha256 === undefined ? [at] : []));
32
+ if (unpairedFiles.length === 1 && hashlessEntries.length === 1) {
33
+ pairedWith[unpairedFiles[0]] = hashlessEntries[0];
34
+ used.add(hashlessEntries[0]);
35
+ }
36
+ const inputs = given.map((bytes, at) => (pairedWith[at] >= 0 ? { ...named[pairedWith[at]], bytes } : { bytes }));
37
+ return [...inputs, ...named.filter((_, at) => !used.has(at))];
38
+ }
12
39
  /**
13
40
  * `wildo seal verify <bundle.json>` — verify one approval seal OFFLINE (#2903): the bundle carries the compact JWS, the
14
41
  * stored records of the keys that may have signed it (scope and issuer included, as an export carries them), and
@@ -29,6 +56,14 @@ import { readPinSetsFile, readSigningLogExportFile } from './signing-log-files.u
29
56
  * name, then its prefix opened against the seal's commitment. One changed byte in the approval page and the seal does
30
57
  * not verify. A copy the approver's erasure deleted is reported as erased content, never as missing.
31
58
  *
59
+ * The same original may also have VENDOR-SIGNED COPIES (#2907's document chain, #2293): the bundle names each with the
60
+ * file its row says it derives from. `--vendor-signed-copy <path>` (repeatable) checks one: its first revision, ending at
61
+ * a `%%EOF`, must be the approved file, and the command reports which original it derives from. A copy whose row names
62
+ * another original, whose bytes are not the ones its row hashed, or that does not start with the approved file, fails
63
+ * the seal. Only a copy the host RECORDS (named, with these exact bytes) is reported as the signed copy whose vendor
64
+ * signature was validated at receipt (that evidence is the signature request's, not the seal's); a copy the host does
65
+ * not record is reported as starting with the approved file, and nothing more.
66
+ *
32
67
  * Whether the approval is still CURRENT over its record (#2914): `--subject-record <record.json>` gives the record as it
33
68
  * is now (its fields, as an export of the record states them; `null` for a record that is gone). The values of the
34
69
  * fields the approval covers, as the disclosed presentation carries them, are compared with it. A record changed since
@@ -37,7 +72,7 @@ import { readPinSetsFile, readSigningLogExportFile } from './signing-log-files.u
37
72
  export default class SealVerifyCommand extends BaseCommand {
38
73
  meta = {
39
74
  name: 'seal verify',
40
- description: 'Verify one approval seal offline from a bundle file ({ jws, keys, expectedIssuer?, disclosures?, erasedClaims?, deliverableFile?, manifestedCopy? }), with your own pins, kept exports, corroboration, the approved file and its manifested copy.',
75
+ description: 'Verify one approval seal offline from a bundle file ({ jws, keys, expectedIssuer?, disclosures?, erasedClaims?, deliverableFile?, manifestedCopy?, vendorSignedCopies? }), with your own pins, kept exports, corroboration, the approved file, its manifested copy and its vendor-signed copies.',
41
76
  category: CommandCategory.Core,
42
77
  args: [{ name: 'bundle', description: 'Path to the JSON bundle.', required: true }],
43
78
  flags: {
@@ -47,6 +82,7 @@ export default class SealVerifyCommand extends BaseCommand {
47
82
  'signing-log-exports': { type: 'string[]', description: 'Signing-log exports the operator kept (`wildo seal log-export`), to corroborate a seal under a compromised key.' },
48
83
  deliverable: { type: 'string', description: 'The file the seal attests as the approved deliverable (#2904): its bytes are checked against the seal\'s commitment.' },
49
84
  'manifested-copy': { type: 'string', description: 'The approved deliverable\'s manifested copy (#2907): its approval page and attached seal are rebuilt and compared, and what precedes them checked against the seal\'s commitment.' },
85
+ 'vendor-signed-copy': { type: 'string[]', description: 'Copies of the approved deliverable an electronic-signature vendor signed (#2907): each one\'s first revision is checked against the seal\'s commitment, and the original it derives from is reported.' },
50
86
  'subject-record': { type: 'string', description: 'The record the approval is about, as it is now (a JSON object of its fields, or null when gone) (#2914): reports whether the approval is still current over it.' },
51
87
  },
52
88
  };
@@ -99,6 +135,14 @@ export default class SealVerifyCommand extends BaseCommand {
99
135
  }
100
136
  input = { ...input, manifestedCopy: { ...(bundle.manifestedCopy ?? {}), bytes: readFileSync(resolve(process.cwd(), ctx.flags['manifested-copy'])) } };
101
137
  }
138
+ const vendorCopyPaths = parseCsvFlag(ctx.flags['vendor-signed-copy']);
139
+ if (vendorCopyPaths) {
140
+ if (!bundle.deliverableFile) {
141
+ ctx.log.error('The bundle names no file deliverable: this seal attests no file a vendor could have signed a copy of.');
142
+ return { success: false };
143
+ }
144
+ input = { ...input, vendorSignedCopies: vendorSignedCopyInputsOf(bundle.vendorSignedCopies ?? [], vendorCopyPaths.map((copyPath) => readFileSync(resolve(process.cwd(), copyPath)))) };
145
+ }
102
146
  if (typeof ctx.flags['subject-record'] === 'string') {
103
147
  const record = JSON.parse(readFileSync(resolve(process.cwd(), ctx.flags['subject-record']), 'utf8'));
104
148
  if (record !== null && (typeof record !== 'object' || Array.isArray(record))) {
@@ -130,6 +174,14 @@ export default class SealVerifyCommand extends BaseCommand {
130
174
  if (result.manifestedCopy?.standing === ApprovalSealDeliverableFileStanding.CHANGED) {
131
175
  ctx.log.error(' manifested copy: the given file is NOT this seal\'s copy of the approved file (its approval page, attached seal or original differs)');
132
176
  }
177
+ for (const copy of result.vendorSignedCopies ?? []) {
178
+ if (copy.standing === ApprovalSealDeliverableFileStanding.DERIVED_FROM_ANOTHER_FILE) {
179
+ ctx.log.error(` vendor-signed copy${copy.fileId ? ` ${copy.fileId}` : ''}: derived from ${copy.statedDerivedFromFileId}, NOT from the file this seal approved`);
180
+ }
181
+ else if (copy.standing === ApprovalSealDeliverableFileStanding.CHANGED) {
182
+ ctx.log.error(` vendor-signed copy${copy.fileId ? ` ${copy.fileId}` : ''}: does NOT start with the approved file (or is not the file its record names)`);
183
+ }
184
+ }
133
185
  return { success: false };
134
186
  }
135
187
  const claims = result.claims;
@@ -169,6 +221,15 @@ export default class SealVerifyCommand extends BaseCommand {
169
221
  : chalk.dim('nothing to compare with: the approver, the presentation or the deliverable\'s salt is not disclosed');
170
222
  ctx.log.info(` manifested copy${result.manifestedCopy.fileId ? ` ${result.manifestedCopy.fileId}` : ''}: ${described}`);
171
223
  }
224
+ for (const copy of result.vendorSignedCopies ?? []) {
225
+ const described = copy.standing === ApprovalSealDeliverableFileStanding.MATCHES
226
+ ? copy.recordedByHost
227
+ ? chalk.green(`derived from the approved file ${copy.derivesFromFileId}: its first ${copy.originalLength} bytes are that file, and it is the signed copy the host recorded (the vendor's signature was validated at receipt; see the signature request's validation evidence)`)
228
+ : chalk.yellow(`starts with the approved file ${copy.derivesFromFileId} (its first ${copy.originalLength} bytes), but the host records no such copy: nothing here says what follows is a vendor's signature`)
229
+ : copy.standing === ApprovalSealDeliverableFileStanding.NOT_GIVEN ? chalk.yellow('not given (pass --vendor-signed-copy <file>)')
230
+ : chalk.dim('nothing to compare with: the presentation or the deliverable\'s salt is not disclosed');
231
+ ctx.log.info(` vendor-signed copy${copy.fileId ? ` ${copy.fileId}` : ''}: ${described}`);
232
+ }
172
233
  if (result.subjectRecordCurrency) {
173
234
  const currency = result.subjectRecordCurrency;
174
235
  const record = currency.subject ? ` ${currency.subject.resourceType}/${currency.subject.resourceId}` : '';