@wildo-ai/wildo-cli 1.1.12 → 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 (548) 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 +22 -1
  11. package/dist/src/commands/config/sync.command.js.map +1 -1
  12. package/dist/src/commands/context/journey.command.d.ts.map +1 -1
  13. package/dist/src/commands/context/journey.command.js +8 -0
  14. package/dist/src/commands/context/journey.command.js.map +1 -1
  15. package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
  16. package/dist/src/commands/creation/drive.command.js +2 -0
  17. package/dist/src/commands/creation/drive.command.js.map +1 -1
  18. package/dist/src/commands/creation/feed.command.d.ts.map +1 -1
  19. package/dist/src/commands/creation/feed.command.js +6 -3
  20. package/dist/src/commands/creation/feed.command.js.map +1 -1
  21. package/dist/src/commands/fwk/publish-all.command.d.ts +13 -0
  22. package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
  23. package/dist/src/commands/fwk/publish-all.command.js +64 -2
  24. package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
  25. package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
  26. package/dist/src/commands/fwk/publish-docker.command.js +16 -1
  27. package/dist/src/commands/fwk/publish-docker.command.js.map +1 -1
  28. package/dist/src/commands/fwk/registry-host.command.d.ts +19 -1
  29. package/dist/src/commands/fwk/registry-host.command.d.ts.map +1 -1
  30. package/dist/src/commands/fwk/registry-host.command.js +78 -3
  31. package/dist/src/commands/fwk/registry-host.command.js.map +1 -1
  32. package/dist/src/commands/init.command.d.ts +14 -0
  33. package/dist/src/commands/init.command.d.ts.map +1 -1
  34. package/dist/src/commands/init.command.js +29 -3
  35. package/dist/src/commands/init.command.js.map +1 -1
  36. package/dist/src/commands/local/dev.command.d.ts +68 -0
  37. package/dist/src/commands/local/dev.command.d.ts.map +1 -1
  38. package/dist/src/commands/local/dev.command.js +216 -8
  39. package/dist/src/commands/local/dev.command.js.map +1 -1
  40. package/dist/src/commands/local/doctor.command.d.ts +22 -9
  41. package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
  42. package/dist/src/commands/local/doctor.command.js +45 -42
  43. package/dist/src/commands/local/doctor.command.js.map +1 -1
  44. package/dist/src/commands/providers/connect.command.d.ts.map +1 -1
  45. package/dist/src/commands/providers/connect.command.js +11 -1
  46. package/dist/src/commands/providers/connect.command.js.map +1 -1
  47. package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
  48. package/dist/src/commands/registry/repair-lockfile.command.js +1 -0
  49. package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
  50. package/dist/src/commands/registry/update.command.d.ts.map +1 -1
  51. package/dist/src/commands/registry/update.command.js +1 -0
  52. package/dist/src/commands/registry/update.command.js.map +1 -1
  53. package/dist/src/commands/seal/currency.command.d.ts +13 -0
  54. package/dist/src/commands/seal/currency.command.d.ts.map +1 -0
  55. package/dist/src/commands/seal/currency.command.js +52 -0
  56. package/dist/src/commands/seal/currency.command.js.map +1 -0
  57. package/dist/src/commands/seal/seal-admin-door.utils.d.ts.map +1 -1
  58. package/dist/src/commands/seal/seal-admin-door.utils.js +2 -0
  59. package/dist/src/commands/seal/seal-admin-door.utils.js.map +1 -1
  60. package/dist/src/commands/seal/verify.command.d.ts +23 -0
  61. package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
  62. package/dist/src/commands/seal/verify.command.js +88 -3
  63. package/dist/src/commands/seal/verify.command.js.map +1 -1
  64. package/dist/src/services/application/content-guardrail-classifier.service.d.ts +19 -0
  65. package/dist/src/services/application/content-guardrail-classifier.service.d.ts.map +1 -1
  66. package/dist/src/services/application/content-guardrail-classifier.service.js +75 -11
  67. package/dist/src/services/application/content-guardrail-classifier.service.js.map +1 -1
  68. package/dist/src/services/application/local-provider-doubles.service.d.ts +98 -0
  69. package/dist/src/services/application/local-provider-doubles.service.d.ts.map +1 -0
  70. package/dist/src/services/application/local-provider-doubles.service.js +214 -0
  71. package/dist/src/services/application/local-provider-doubles.service.js.map +1 -0
  72. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  73. package/dist/src/services/application/provider-runtime-sync.service.js +26 -1
  74. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  75. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  76. package/dist/src/services/application/saas-skeleton.service.js +24 -2
  77. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  78. package/dist/src/services/application/system-of-record-simulators.service.d.ts +21 -2
  79. package/dist/src/services/application/system-of-record-simulators.service.d.ts.map +1 -1
  80. package/dist/src/services/application/system-of-record-simulators.service.js +21 -12
  81. package/dist/src/services/application/system-of-record-simulators.service.js.map +1 -1
  82. package/dist/src/services/companion/build-console.service.d.ts +39 -2
  83. package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
  84. package/dist/src/services/companion/build-console.service.js +54 -4
  85. package/dist/src/services/companion/build-console.service.js.map +1 -1
  86. package/dist/src/services/companion/creation-console.service.d.ts +6 -1
  87. package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
  88. package/dist/src/services/companion/creation-console.service.js +14 -2
  89. package/dist/src/services/companion/creation-console.service.js.map +1 -1
  90. package/dist/src/services/companion/creation-drive.service.d.ts +32 -2
  91. package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
  92. package/dist/src/services/companion/creation-drive.service.js +66 -6
  93. package/dist/src/services/companion/creation-drive.service.js.map +1 -1
  94. package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
  95. package/dist/src/services/credentials/composed-provider-catalogue.js +14 -2
  96. package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
  97. package/dist/src/services/credentials/credentials.schemas.d.ts +6 -0
  98. package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
  99. package/dist/src/services/credentials/credentials.schemas.js +7 -1
  100. package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
  101. package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
  102. package/dist/src/services/credentials/provider-env-vars.utils.js +11 -3
  103. package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
  104. package/dist/src/services/credentials/secret-requirements.service.d.ts +2 -1
  105. package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
  106. package/dist/src/services/credentials/secret-requirements.service.js +17 -1
  107. package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
  108. package/dist/src/services/data-services/data-services.schemas.d.ts +9 -0
  109. package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
  110. package/dist/src/services/data-services/data-services.schemas.js +9 -0
  111. package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
  112. package/dist/src/services/deployment/application-runtime-environment.d.ts.map +1 -1
  113. package/dist/src/services/deployment/application-runtime-environment.js +3 -13
  114. package/dist/src/services/deployment/application-runtime-environment.js.map +1 -1
  115. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  116. package/dist/src/services/deployment/docker/docker-compose-generator.service.js +15 -4
  117. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  118. package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts +1 -1
  119. package/dist/src/services/deployment/host-toolchain-readiness.service.js +1 -1
  120. package/dist/src/services/deployment/host-toolchain-readiness.service.js.map +1 -1
  121. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
  122. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +3 -1
  123. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
  124. package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
  125. package/dist/src/services/deployment/local-dev-session-lease.service.js +22 -1
  126. package/dist/src/services/deployment/local-dev-session-lease.service.js.map +1 -1
  127. package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
  128. package/dist/src/services/deployment/local-precondition-checks.service.js +4 -2
  129. package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
  130. package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
  131. package/dist/src/services/environment/authored-infra-config.utils.js +1 -0
  132. package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
  133. package/dist/src/services/environment/authored-infra-member-authority.d.ts.map +1 -1
  134. package/dist/src/services/environment/authored-infra-member-authority.js +5 -0
  135. package/dist/src/services/environment/authored-infra-member-authority.js.map +1 -1
  136. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  137. package/dist/src/services/environment/env-configuration-generator.service.js +14 -6
  138. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  139. package/dist/src/services/environment/env-vars-builder.service.d.ts +6 -0
  140. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  141. package/dist/src/services/environment/env-vars-builder.service.js +24 -1
  142. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  143. package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
  144. package/dist/src/services/environment/environment-hydration.utils.js +1 -0
  145. package/dist/src/services/environment/environment-hydration.utils.js.map +1 -1
  146. package/dist/src/services/environment/environment-service-profile.utils.d.ts +8 -1
  147. package/dist/src/services/environment/environment-service-profile.utils.d.ts.map +1 -1
  148. package/dist/src/services/environment/environment-service-profile.utils.js +14 -1
  149. package/dist/src/services/environment/environment-service-profile.utils.js.map +1 -1
  150. package/dist/src/services/environment/environment.schemas.d.ts +7 -1
  151. package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
  152. package/dist/src/services/environment/environment.schemas.js.map +1 -1
  153. package/dist/src/services/environment/runtime-bootstrap.service.d.ts +2 -0
  154. package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
  155. package/dist/src/services/environment/runtime-bootstrap.service.js +4 -0
  156. package/dist/src/services/environment/runtime-bootstrap.service.js.map +1 -1
  157. package/dist/src/services/framework/framework-docker-publish.service.d.ts +102 -0
  158. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  159. package/dist/src/services/framework/framework-docker-publish.service.js +204 -25
  160. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  161. package/dist/src/services/framework/github-actions-annotation.d.ts +19 -0
  162. package/dist/src/services/framework/github-actions-annotation.d.ts.map +1 -0
  163. package/dist/src/services/framework/github-actions-annotation.js +25 -0
  164. package/dist/src/services/framework/github-actions-annotation.js.map +1 -0
  165. package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts +43 -0
  166. package/dist/src/services/framework/registry-host/registry-host-upgrade.d.ts.map +1 -0
  167. package/dist/src/services/framework/registry-host/registry-host-upgrade.js +117 -0
  168. package/dist/src/services/framework/registry-host/registry-host-upgrade.js.map +1 -0
  169. package/dist/src/services/framework/registry-host/registry-host.service.d.ts +1 -1
  170. package/dist/src/services/framework/registry-host/registry-host.service.d.ts.map +1 -1
  171. package/dist/src/services/framework/registry-host/registry-host.service.js +2 -0
  172. package/dist/src/services/framework/registry-host/registry-host.service.js.map +1 -1
  173. package/dist/src/services/registry/installed-file-state.utils.d.ts +8 -0
  174. package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
  175. package/dist/src/services/registry/installed-file-state.utils.js +9 -1
  176. package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
  177. package/dist/src/services/registry/module-install.service.d.ts.map +1 -1
  178. package/dist/src/services/registry/module-install.service.js +1 -0
  179. package/dist/src/services/registry/module-install.service.js.map +1 -1
  180. package/dist/src/services/registry/provider-connect.service.d.ts +57 -1
  181. package/dist/src/services/registry/provider-connect.service.d.ts.map +1 -1
  182. package/dist/src/services/registry/provider-connect.service.js +63 -2
  183. package/dist/src/services/registry/provider-connect.service.js.map +1 -1
  184. package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
  185. package/dist/src/services/registry/provider-module-scaffold.service.js +4 -0
  186. package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
  187. package/dist/tsconfig.build.tsbuildinfo +1 -1
  188. package/framework-root-package.json +3 -3
  189. package/package.json +22 -22
  190. package/scripts/app-dependency-alignment/propagated-engine-overrides.json +2 -2
  191. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +17 -2
  192. package/templates/infra/registry-host/docker-compose.yml +9 -2
  193. package/templates/infra/registry-host/upgrade-image.sh +108 -0
  194. package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_ready/labels.fr.ts +22 -0
  195. package/templates/saas/i18n/email/resources/dataSubjectRequests/create.users-custom_received/labels.fr.ts +23 -0
  196. package/templates/saas/i18n/email/resources/dataSubjectRequests/update.users-custom_extended/labels.fr.ts +23 -0
  197. package/templates/saas/i18n/email/resources/organizationSsoConfig/repairUnreadableConfiguration.organization-users/labels.fr.ts +23 -0
  198. package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.en.ts +28 -0
  199. package/templates/saas/i18n/engine/components/HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR.fr.ts +28 -0
  200. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.en.ts +2 -1
  201. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_APPROVAL.fr.ts +2 -1
  202. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.en.ts +6 -1
  203. package/templates/saas/i18n/engine/components/LOW_LEVEL_AI_CONVERSATION_THREAD.fr.ts +6 -1
  204. package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.en.ts +40 -0
  205. package/templates/saas/i18n/engine/components/LOW_LEVEL_APPROVAL_SEAL.fr.ts +40 -0
  206. package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.en.ts +2 -1
  207. package/templates/saas/i18n/engine/components/LOW_LEVEL_CONTENT_SECTION_CONTAINER.fr.ts +2 -1
  208. package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.en.ts +2 -1
  209. package/templates/saas/i18n/engine/components/LOW_LEVEL_FORM_FIELD_STRING.fr.ts +2 -1
  210. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.en.ts +2 -1
  211. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_MFA_CHALLENGE.fr.ts +2 -1
  212. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.en.ts +3 -1
  213. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_TERMS.fr.ts +3 -1
  214. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.en.ts +2 -1
  215. package/templates/saas/i18n/engine/components/PUBLIC_LAYOUTS_USER_AUTH.fr.ts +2 -1
  216. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.en.ts +3 -1
  217. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_FILTERS.fr.ts +4 -2
  218. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.en.ts +18 -1
  219. package/templates/saas/i18n/engine/components/RESOURCES_LAYOUTS_LIST.fr.ts +18 -1
  220. package/templates/saas/i18n/engine/resources/actorSystemExecutions.en.ts +10 -82
  221. package/templates/saas/i18n/engine/resources/actorSystemExecutions.fr.ts +0 -72
  222. package/templates/saas/i18n/engine/resources/actorTasks.en.ts +0 -33
  223. package/templates/saas/i18n/engine/resources/actorTasks.fr.ts +0 -33
  224. package/templates/saas/i18n/engine/resources/agentBehaviorReports.en.ts +0 -108
  225. package/templates/saas/i18n/engine/resources/agentBehaviorReports.fr.ts +0 -108
  226. package/templates/saas/i18n/engine/resources/agentOperationRecords.en.ts +8 -24
  227. package/templates/saas/i18n/engine/resources/agentOperationRecords.fr.ts +10 -26
  228. package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.en.ts +0 -12
  229. package/templates/saas/i18n/engine/resources/agentWorkCaptureSettings.fr.ts +0 -12
  230. package/templates/saas/i18n/engine/resources/anonymous_users.en.ts +8 -74
  231. package/templates/saas/i18n/engine/resources/anonymous_users.fr.ts +0 -66
  232. package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.en.ts +3 -21
  233. package/templates/saas/i18n/engine/resources/applicationA2aPushDeliveryLog.fr.ts +0 -18
  234. package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.en.ts +3 -33
  235. package/templates/saas/i18n/engine/resources/applicationA2aTokenBudgetState.fr.ts +0 -30
  236. package/templates/saas/i18n/engine/resources/applicationAccessGrants.en.ts +13 -55
  237. package/templates/saas/i18n/engine/resources/applicationAccessGrants.fr.ts +0 -42
  238. package/templates/saas/i18n/engine/resources/applicationAgentPolicies.en.ts +8 -24
  239. package/templates/saas/i18n/engine/resources/applicationAgentPolicies.fr.ts +8 -24
  240. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.en.ts +0 -27
  241. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisionContents.fr.ts +0 -27
  242. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.en.ts +13 -43
  243. package/templates/saas/i18n/engine/resources/applicationAgentWorkDecisions.fr.ts +0 -30
  244. package/templates/saas/i18n/engine/resources/applicationApiKeys.en.ts +2 -70
  245. package/templates/saas/i18n/engine/resources/applicationApiKeys.fr.ts +2 -70
  246. package/templates/saas/i18n/engine/resources/applicationAuditLogs.en.ts +41 -94
  247. package/templates/saas/i18n/engine/resources/applicationAuditLogs.fr.ts +41 -94
  248. package/templates/saas/i18n/engine/resources/applicationDataKeys.en.ts +2 -22
  249. package/templates/saas/i18n/engine/resources/applicationDataKeys.fr.ts +2 -22
  250. package/templates/saas/i18n/engine/resources/applicationFeatures.en.ts +0 -24
  251. package/templates/saas/i18n/engine/resources/applicationFeatures.fr.ts +0 -24
  252. package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.en.ts +25 -160
  253. package/templates/saas/i18n/engine/resources/applicationFlowActorExecutions.fr.ts +25 -160
  254. package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.en.ts +6 -28
  255. package/templates/saas/i18n/engine/resources/applicationFlowActorTasks.fr.ts +8 -30
  256. package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.en.ts +92 -23
  257. package/templates/saas/i18n/engine/resources/applicationInboundDeliveries.fr.ts +95 -26
  258. package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.en.ts +1 -25
  259. package/templates/saas/i18n/engine/resources/applicationM2mWebhookDeliveryLog.fr.ts +4 -28
  260. package/templates/saas/i18n/engine/resources/applicationMetadata.en.ts +0 -18
  261. package/templates/saas/i18n/engine/resources/applicationMetadata.fr.ts +0 -18
  262. package/templates/saas/i18n/engine/resources/applicationOAuthClients.en.ts +2 -58
  263. package/templates/saas/i18n/engine/resources/applicationOAuthClients.fr.ts +2 -58
  264. package/templates/saas/i18n/engine/resources/applicationProviderCredentials.en.ts +168 -0
  265. package/templates/saas/i18n/engine/resources/applicationProviderCredentials.fr.ts +168 -0
  266. package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.en.ts +0 -30
  267. package/templates/saas/i18n/engine/resources/applicationScimProvisioningConfig.fr.ts +0 -30
  268. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.en.ts +3 -42
  269. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryDlq.fr.ts +5 -44
  270. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.en.ts +3 -30
  271. package/templates/saas/i18n/engine/resources/applicationSiemDeliveryOutbox.fr.ts +0 -27
  272. package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.en.ts +0 -24
  273. package/templates/saas/i18n/engine/resources/applicationSiemExportConfig.fr.ts +0 -24
  274. package/templates/saas/i18n/engine/resources/applicationSsoConfig.en.ts +113 -61
  275. package/templates/saas/i18n/engine/resources/applicationSsoConfig.fr.ts +113 -61
  276. package/templates/saas/i18n/engine/resources/applicationSsoConnections.en.ts +0 -138
  277. package/templates/saas/i18n/engine/resources/applicationSsoConnections.fr.ts +0 -138
  278. package/templates/saas/i18n/engine/resources/applicationVersions.en.ts +3 -27
  279. package/templates/saas/i18n/engine/resources/applicationVersions.fr.ts +0 -24
  280. package/templates/saas/i18n/engine/resources/applicationWebhookConfig.en.ts +5 -54
  281. package/templates/saas/i18n/engine/resources/applicationWebhookConfig.fr.ts +5 -54
  282. package/templates/saas/i18n/engine/resources/applications.en.ts +39 -2177
  283. package/templates/saas/i18n/engine/resources/applications.fr.ts +39 -2177
  284. package/templates/saas/i18n/engine/resources/approvalSeals.en.ts +38 -31
  285. package/templates/saas/i18n/engine/resources/approvalSeals.fr.ts +38 -31
  286. package/templates/saas/i18n/engine/resources/auditLogs.en.ts +78 -111
  287. package/templates/saas/i18n/engine/resources/auditLogs.fr.ts +78 -111
  288. package/templates/saas/i18n/engine/resources/billingEffectOutbox.en.ts +2 -4
  289. package/templates/saas/i18n/engine/resources/billingEffectOutbox.fr.ts +2 -4
  290. package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.en.ts +8 -6
  291. package/templates/saas/i18n/engine/resources/billingSubscriptionMutationIntents.fr.ts +8 -6
  292. package/templates/saas/i18n/engine/resources/chatConversations.en.ts +0 -18
  293. package/templates/saas/i18n/engine/resources/chatConversations.fr.ts +0 -18
  294. package/templates/saas/i18n/engine/resources/chatIdentityLinks.en.ts +0 -44
  295. package/templates/saas/i18n/engine/resources/chatIdentityLinks.fr.ts +0 -44
  296. package/templates/saas/i18n/engine/resources/consumableTokens.en.ts +4 -43
  297. package/templates/saas/i18n/engine/resources/consumableTokens.fr.ts +4 -43
  298. package/templates/saas/i18n/engine/resources/conversationMessages.en.ts +16 -27
  299. package/templates/saas/i18n/engine/resources/conversationMessages.fr.ts +16 -27
  300. package/templates/saas/i18n/engine/resources/conversationReplyTokens.en.ts +0 -27
  301. package/templates/saas/i18n/engine/resources/conversationReplyTokens.fr.ts +0 -27
  302. package/templates/saas/i18n/engine/resources/conversationThreads.en.ts +0 -27
  303. package/templates/saas/i18n/engine/resources/conversationThreads.fr.ts +0 -27
  304. package/templates/saas/i18n/engine/resources/dataSeedRuns.en.ts +22 -17
  305. package/templates/saas/i18n/engine/resources/dataSeedRuns.fr.ts +22 -17
  306. package/templates/saas/i18n/engine/resources/dataSubjectRequests.en.ts +410 -0
  307. package/templates/saas/i18n/engine/resources/dataSubjectRequests.fr.ts +410 -0
  308. package/templates/saas/i18n/engine/resources/etlPipelineStates.en.ts +128 -146
  309. package/templates/saas/i18n/engine/resources/etlPipelineStates.fr.ts +0 -18
  310. package/templates/saas/i18n/engine/resources/evaluationDatasetExports.en.ts +13 -43
  311. package/templates/saas/i18n/engine/resources/evaluationDatasetExports.fr.ts +0 -30
  312. package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.en.ts +0 -12
  313. package/templates/saas/i18n/engine/resources/evaluationExportAuthorizations.fr.ts +0 -12
  314. package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.en.ts +0 -21
  315. package/templates/saas/i18n/engine/resources/externalDataErasureSuppressions.fr.ts +0 -21
  316. package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.en.ts +24 -45
  317. package/templates/saas/i18n/engine/resources/externalDataOutboundChanges.fr.ts +0 -21
  318. package/templates/saas/i18n/engine/resources/externalDataPendingReferences.en.ts +0 -24
  319. package/templates/saas/i18n/engine/resources/externalDataPendingReferences.fr.ts +0 -24
  320. package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.en.ts +0 -21
  321. package/templates/saas/i18n/engine/resources/externalDataPipelineMembershipKeys.fr.ts +0 -21
  322. package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.en.ts +8 -14
  323. package/templates/saas/i18n/engine/resources/externalDataPipelineMemberships.fr.ts +0 -6
  324. package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.en.ts +0 -24
  325. package/templates/saas/i18n/engine/resources/externalDataPipelineRequestedKeys.fr.ts +0 -24
  326. package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.en.ts +150 -174
  327. package/templates/saas/i18n/engine/resources/externalDataPipelineRunRecords.fr.ts +0 -24
  328. package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.en.ts +12 -33
  329. package/templates/saas/i18n/engine/resources/externalDataRemoteVersions.fr.ts +0 -21
  330. package/templates/saas/i18n/engine/resources/externalEffectReservations.en.ts +147 -0
  331. package/templates/saas/i18n/engine/resources/externalEffectReservations.fr.ts +147 -0
  332. package/templates/saas/i18n/engine/resources/files.en.ts +0 -39
  333. package/templates/saas/i18n/engine/resources/files.fr.ts +0 -39
  334. package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.en.ts +0 -18
  335. package/templates/saas/i18n/engine/resources/humanDecisionNoticeStays.fr.ts +0 -18
  336. package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.en.ts +115 -0
  337. package/templates/saas/i18n/engine/resources/idempotentRequestOutcomes.fr.ts +115 -0
  338. package/templates/saas/i18n/engine/resources/inboundAddressTombstones.en.ts +0 -27
  339. package/templates/saas/i18n/engine/resources/inboundAddressTombstones.fr.ts +0 -27
  340. package/templates/saas/i18n/engine/resources/inboundContacts.en.ts +3 -30
  341. package/templates/saas/i18n/engine/resources/inboundContacts.fr.ts +0 -27
  342. package/templates/saas/i18n/engine/resources/inboundEmails.en.ts +0 -27
  343. package/templates/saas/i18n/engine/resources/inboundEmails.fr.ts +0 -27
  344. package/templates/saas/i18n/engine/resources/jobExecutions.en.ts +11 -25
  345. package/templates/saas/i18n/engine/resources/jobExecutions.fr.ts +11 -25
  346. package/templates/saas/i18n/engine/resources/jobPayloadStorage.en.ts +3 -30
  347. package/templates/saas/i18n/engine/resources/jobPayloadStorage.fr.ts +0 -27
  348. package/templates/saas/i18n/engine/resources/legalHolds.en.ts +0 -88
  349. package/templates/saas/i18n/engine/resources/legalHolds.fr.ts +0 -88
  350. package/templates/saas/i18n/engine/resources/modelCallAttributions.en.ts +16 -40
  351. package/templates/saas/i18n/engine/resources/modelCallAttributions.fr.ts +0 -24
  352. package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.en.ts +13 -37
  353. package/templates/saas/i18n/engine/resources/modelCostPeriodAggregates.fr.ts +0 -24
  354. package/templates/saas/i18n/engine/resources/oauthConsentGrants.en.ts +10 -40
  355. package/templates/saas/i18n/engine/resources/oauthConsentGrants.fr.ts +0 -30
  356. package/templates/saas/i18n/engine/resources/operationApprovalRequests.en.ts +120 -60
  357. package/templates/saas/i18n/engine/resources/operationApprovalRequests.fr.ts +120 -60
  358. package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.en.ts +3 -21
  359. package/templates/saas/i18n/engine/resources/organizationA2aPushDeliveryLog.fr.ts +0 -18
  360. package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.en.ts +3 -33
  361. package/templates/saas/i18n/engine/resources/organizationA2aTokenBudgetState.fr.ts +0 -30
  362. package/templates/saas/i18n/engine/resources/organizationAgentPolicies.en.ts +0 -27
  363. package/templates/saas/i18n/engine/resources/organizationAgentPolicies.fr.ts +0 -27
  364. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.en.ts +0 -27
  365. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisionContents.fr.ts +0 -27
  366. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.en.ts +13 -43
  367. package/templates/saas/i18n/engine/resources/organizationAgentWorkDecisions.fr.ts +0 -30
  368. package/templates/saas/i18n/engine/resources/organizationApiKeys.en.ts +2 -79
  369. package/templates/saas/i18n/engine/resources/organizationApiKeys.fr.ts +2 -79
  370. package/templates/saas/i18n/engine/resources/organizationBillingAccounts.en.ts +0 -549
  371. package/templates/saas/i18n/engine/resources/organizationBillingAccounts.fr.ts +0 -549
  372. package/templates/saas/i18n/engine/resources/organizationChatSettings.en.ts +0 -27
  373. package/templates/saas/i18n/engine/resources/organizationChatSettings.fr.ts +0 -27
  374. package/templates/saas/i18n/engine/resources/organizationCreditPools.en.ts +13 -18
  375. package/templates/saas/i18n/engine/resources/organizationCreditPools.fr.ts +13 -18
  376. package/templates/saas/i18n/engine/resources/organizationCustomDomains.en.ts +195 -0
  377. package/templates/saas/i18n/engine/resources/organizationCustomDomains.fr.ts +195 -0
  378. package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.en.ts +153 -0
  379. package/templates/saas/i18n/engine/resources/organizationDashboardLayouts.fr.ts +153 -0
  380. package/templates/saas/i18n/engine/resources/organizationEmailDomains.en.ts +0 -39
  381. package/templates/saas/i18n/engine/resources/organizationEmailDomains.fr.ts +0 -39
  382. package/templates/saas/i18n/engine/resources/organizationFeatures.en.ts +0 -34
  383. package/templates/saas/i18n/engine/resources/organizationFeatures.fr.ts +0 -34
  384. package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.en.ts +25 -160
  385. package/templates/saas/i18n/engine/resources/organizationFlowActorExecutions.fr.ts +25 -160
  386. package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.en.ts +6 -28
  387. package/templates/saas/i18n/engine/resources/organizationFlowActorTasks.fr.ts +8 -30
  388. package/templates/saas/i18n/engine/resources/organizationGuidanceState.en.ts +3 -18
  389. package/templates/saas/i18n/engine/resources/organizationGuidanceState.fr.ts +0 -15
  390. package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.en.ts +95 -26
  391. package/templates/saas/i18n/engine/resources/organizationInboundDeliveries.fr.ts +95 -26
  392. package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.en.ts +14 -45
  393. package/templates/saas/i18n/engine/resources/organizationInvoiceRefs.fr.ts +14 -45
  394. package/templates/saas/i18n/engine/resources/organizationLifecycleState.en.ts +1 -17
  395. package/templates/saas/i18n/engine/resources/organizationLifecycleState.fr.ts +1 -17
  396. package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.en.ts +2 -26
  397. package/templates/saas/i18n/engine/resources/organizationM2mWebhookDeliveryLog.fr.ts +4 -28
  398. package/templates/saas/i18n/engine/resources/organizationMembers.en.ts +2 -95
  399. package/templates/saas/i18n/engine/resources/organizationMembers.fr.ts +2 -95
  400. package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.en.ts +0 -27
  401. package/templates/saas/i18n/engine/resources/organizationModelUsageCeilingState.fr.ts +0 -27
  402. package/templates/saas/i18n/engine/resources/organizationNotificationBadges.en.ts +3 -36
  403. package/templates/saas/i18n/engine/resources/organizationNotificationBadges.fr.ts +0 -33
  404. package/templates/saas/i18n/engine/resources/organizationNotifications.en.ts +0 -12
  405. package/templates/saas/i18n/engine/resources/organizationNotifications.fr.ts +0 -12
  406. package/templates/saas/i18n/engine/resources/organizationOAuthClients.en.ts +2 -67
  407. package/templates/saas/i18n/engine/resources/organizationOAuthClients.fr.ts +2 -67
  408. package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.en.ts +0 -9
  409. package/templates/saas/i18n/engine/resources/organizationOnboardingOperations.fr.ts +0 -9
  410. package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.en.ts +0 -27
  411. package/templates/saas/i18n/engine/resources/organizationPersonTokenCeilingState.fr.ts +0 -27
  412. package/templates/saas/i18n/engine/resources/organizationPreferences.en.ts +0 -37
  413. package/templates/saas/i18n/engine/resources/organizationPreferences.fr.ts +0 -37
  414. package/templates/saas/i18n/engine/resources/organizationProfiles.en.ts +0 -37
  415. package/templates/saas/i18n/engine/resources/organizationProfiles.fr.ts +0 -37
  416. package/templates/saas/i18n/engine/resources/organizationProgressionState.en.ts +1 -17
  417. package/templates/saas/i18n/engine/resources/organizationProgressionState.fr.ts +1 -17
  418. package/templates/saas/i18n/engine/resources/organizationProviderCredentials.en.ts +0 -58
  419. package/templates/saas/i18n/engine/resources/organizationProviderCredentials.fr.ts +0 -58
  420. package/templates/saas/i18n/engine/resources/organizationRelationships.en.ts +0 -128
  421. package/templates/saas/i18n/engine/resources/organizationRelationships.fr.ts +0 -128
  422. package/templates/saas/i18n/engine/resources/organizationRepresentations.en.ts +0 -83
  423. package/templates/saas/i18n/engine/resources/organizationRepresentations.fr.ts +0 -83
  424. package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.en.ts +0 -43
  425. package/templates/saas/i18n/engine/resources/organizationScimProvisioningConfig.fr.ts +0 -43
  426. package/templates/saas/i18n/engine/resources/organizationScimTokens.en.ts +5 -76
  427. package/templates/saas/i18n/engine/resources/organizationScimTokens.fr.ts +5 -76
  428. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.en.ts +4 -43
  429. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryDlq.fr.ts +6 -45
  430. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.en.ts +3 -30
  431. package/templates/saas/i18n/engine/resources/organizationSiemDeliveryOutbox.fr.ts +0 -27
  432. package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.en.ts +0 -37
  433. package/templates/saas/i18n/engine/resources/organizationSiemExportConfig.fr.ts +0 -37
  434. package/templates/saas/i18n/engine/resources/organizationSsoConfig.en.ts +113 -74
  435. package/templates/saas/i18n/engine/resources/organizationSsoConfig.fr.ts +113 -74
  436. package/templates/saas/i18n/engine/resources/organizationSsoConnections.en.ts +0 -148
  437. package/templates/saas/i18n/engine/resources/organizationSsoConnections.fr.ts +0 -148
  438. package/templates/saas/i18n/engine/resources/organizationSubscriptions.en.ts +40 -78
  439. package/templates/saas/i18n/engine/resources/organizationSubscriptions.fr.ts +42 -80
  440. package/templates/saas/i18n/engine/resources/organizationUnitMembers.en.ts +2 -50
  441. package/templates/saas/i18n/engine/resources/organizationUnitMembers.fr.ts +2 -50
  442. package/templates/saas/i18n/engine/resources/organizationUnits.en.ts +0 -49
  443. package/templates/saas/i18n/engine/resources/organizationUnits.fr.ts +0 -49
  444. package/templates/saas/i18n/engine/resources/organizationUsageRecords.en.ts +13 -37
  445. package/templates/saas/i18n/engine/resources/organizationUsageRecords.fr.ts +13 -37
  446. package/templates/saas/i18n/engine/resources/organizationWebhookConfig.en.ts +5 -67
  447. package/templates/saas/i18n/engine/resources/organizationWebhookConfig.fr.ts +5 -67
  448. package/templates/saas/i18n/engine/resources/organizations.en.ts +34 -637
  449. package/templates/saas/i18n/engine/resources/organizations.fr.ts +32 -635
  450. package/templates/saas/i18n/engine/resources/platformAccessGrants.en.ts +0 -91
  451. package/templates/saas/i18n/engine/resources/platformAccessGrants.fr.ts +0 -91
  452. package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.en.ts +0 -24
  453. package/templates/saas/i18n/engine/resources/postCommitEffectOutbox.fr.ts +0 -24
  454. package/templates/saas/i18n/engine/resources/prices.en.ts +47 -108
  455. package/templates/saas/i18n/engine/resources/prices.fr.ts +48 -109
  456. package/templates/saas/i18n/engine/resources/products.en.ts +24 -68
  457. package/templates/saas/i18n/engine/resources/products.fr.ts +24 -68
  458. package/templates/saas/i18n/engine/resources/professionalQualifications.en.ts +0 -87
  459. package/templates/saas/i18n/engine/resources/professionalQualifications.fr.ts +0 -87
  460. package/templates/saas/i18n/engine/resources/promotions.en.ts +4 -56
  461. package/templates/saas/i18n/engine/resources/promotions.fr.ts +6 -58
  462. package/templates/saas/i18n/engine/resources/providerCallRecords.en.ts +77 -101
  463. package/templates/saas/i18n/engine/resources/providerCallRecords.fr.ts +0 -24
  464. package/templates/saas/i18n/engine/resources/publishedVerificationKeys.en.ts +2 -25
  465. package/templates/saas/i18n/engine/resources/publishedVerificationKeys.fr.ts +2 -25
  466. package/templates/saas/i18n/engine/resources/referrals.en.ts +21 -18
  467. package/templates/saas/i18n/engine/resources/referrals.fr.ts +21 -18
  468. package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.en.ts +0 -80
  469. package/templates/saas/i18n/engine/resources/relationshipCapabilityGrants.fr.ts +0 -80
  470. package/templates/saas/i18n/engine/resources/relationshipInvitations.en.ts +0 -89
  471. package/templates/saas/i18n/engine/resources/relationshipInvitations.fr.ts +0 -89
  472. package/templates/saas/i18n/engine/resources/relationshipMailboxes.en.ts +0 -27
  473. package/templates/saas/i18n/engine/resources/relationshipMailboxes.fr.ts +0 -27
  474. package/templates/saas/i18n/engine/resources/representativeAssignments.en.ts +108 -112
  475. package/templates/saas/i18n/engine/resources/representativeAssignments.fr.ts +108 -112
  476. package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.en.ts +8 -21
  477. package/templates/saas/i18n/engine/resources/retentionEnforcementRecords.fr.ts +8 -21
  478. package/templates/saas/i18n/engine/resources/signatureRequestSigners.en.ts +141 -0
  479. package/templates/saas/i18n/engine/resources/signatureRequestSigners.fr.ts +141 -0
  480. package/templates/saas/i18n/engine/resources/signatureRequests.en.ts +205 -0
  481. package/templates/saas/i18n/engine/resources/signatureRequests.fr.ts +205 -0
  482. package/templates/saas/i18n/engine/resources/smsNumberAssignments.en.ts +101 -0
  483. package/templates/saas/i18n/engine/resources/smsNumberAssignments.fr.ts +101 -0
  484. package/templates/saas/i18n/engine/resources/smsOptOuts.en.ts +166 -0
  485. package/templates/saas/i18n/engine/resources/smsOptOuts.fr.ts +166 -0
  486. package/templates/saas/i18n/engine/resources/smsProviderEvents.en.ts +195 -0
  487. package/templates/saas/i18n/engine/resources/smsProviderEvents.fr.ts +195 -0
  488. package/templates/saas/i18n/engine/resources/ssoDomainReservations.en.ts +0 -27
  489. package/templates/saas/i18n/engine/resources/ssoDomainReservations.fr.ts +0 -27
  490. package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.en.ts +3 -39
  491. package/templates/saas/i18n/engine/resources/systemOfRecordPartitionAssignments.fr.ts +0 -36
  492. package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.en.ts +0 -3
  493. package/templates/saas/i18n/engine/resources/systemOfRecordWriteAdmissions.fr.ts +0 -3
  494. package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.en.ts +0 -6
  495. package/templates/saas/i18n/engine/resources/transactionalCommitReceipts.fr.ts +0 -6
  496. package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.en.ts +3 -21
  497. package/templates/saas/i18n/engine/resources/userA2aPushDeliveryLog.fr.ts +0 -18
  498. package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.en.ts +3 -33
  499. package/templates/saas/i18n/engine/resources/userA2aTokenBudgetState.fr.ts +0 -30
  500. package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.en.ts +0 -27
  501. package/templates/saas/i18n/engine/resources/userAgentWorkDecisionContents.fr.ts +0 -27
  502. package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.en.ts +13 -43
  503. package/templates/saas/i18n/engine/resources/userAgentWorkDecisions.fr.ts +0 -30
  504. package/templates/saas/i18n/engine/resources/userCredentials.en.ts +3 -87
  505. package/templates/saas/i18n/engine/resources/userCredentials.fr.ts +0 -84
  506. package/templates/saas/i18n/engine/resources/userFeatures.en.ts +0 -12
  507. package/templates/saas/i18n/engine/resources/userFeatures.fr.ts +0 -12
  508. package/templates/saas/i18n/engine/resources/userFlowActorExecutions.en.ts +25 -160
  509. package/templates/saas/i18n/engine/resources/userFlowActorExecutions.fr.ts +25 -160
  510. package/templates/saas/i18n/engine/resources/userFlowActorTasks.en.ts +6 -28
  511. package/templates/saas/i18n/engine/resources/userFlowActorTasks.fr.ts +8 -30
  512. package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.en.ts +13 -18
  513. package/templates/saas/i18n/engine/resources/userGovernedDocumentAcceptances.fr.ts +13 -18
  514. package/templates/saas/i18n/engine/resources/userGuidanceState.en.ts +3 -18
  515. package/templates/saas/i18n/engine/resources/userGuidanceState.fr.ts +0 -15
  516. package/templates/saas/i18n/engine/resources/userIdentityLinks.en.ts +13 -40
  517. package/templates/saas/i18n/engine/resources/userIdentityLinks.fr.ts +0 -27
  518. package/templates/saas/i18n/engine/resources/userLifecycleState.en.ts +0 -15
  519. package/templates/saas/i18n/engine/resources/userLifecycleState.fr.ts +0 -15
  520. package/templates/saas/i18n/engine/resources/userNotificationBadges.en.ts +3 -36
  521. package/templates/saas/i18n/engine/resources/userNotificationBadges.fr.ts +0 -33
  522. package/templates/saas/i18n/engine/resources/userPreferences.en.ts +8 -60
  523. package/templates/saas/i18n/engine/resources/userPreferences.fr.ts +8 -60
  524. package/templates/saas/i18n/engine/resources/userProfiles.en.ts +5 -56
  525. package/templates/saas/i18n/engine/resources/userProfiles.fr.ts +0 -51
  526. package/templates/saas/i18n/engine/resources/userProgressionState.en.ts +1 -17
  527. package/templates/saas/i18n/engine/resources/userProgressionState.fr.ts +1 -17
  528. package/templates/saas/i18n/engine/resources/userProviderCredentials.en.ts +0 -52
  529. package/templates/saas/i18n/engine/resources/userProviderCredentials.fr.ts +0 -52
  530. package/templates/saas/i18n/engine/resources/userSelfPreferences.en.ts +8 -56
  531. package/templates/saas/i18n/engine/resources/userSelfPreferences.fr.ts +8 -56
  532. package/templates/saas/i18n/engine/resources/userSelfProfiles.en.ts +5 -61
  533. package/templates/saas/i18n/engine/resources/userSelfProfiles.fr.ts +0 -56
  534. package/templates/saas/i18n/engine/resources/user_self.en.ts +37 -214
  535. package/templates/saas/i18n/engine/resources/user_self.fr.ts +37 -214
  536. package/templates/saas/i18n/engine/resources/users.en.ts +53 -180
  537. package/templates/saas/i18n/engine/resources/users.fr.ts +53 -180
  538. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/Dockerfile +4 -1
  539. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +9 -1
  540. package/templates/saas/scenarios/add-website/files/website/Dockerfile +4 -1
  541. package/templates/saas/scenarios/add-website/files/website/astro.config.ts.hbs +4 -0
  542. package/templates/saas/scenarios/add-website/files/website/package.json.hbs +1 -1
  543. package/templates/saas/scenarios/add-worker-node/files/workers/__workerDir__/Dockerfile.hbs +3 -1
  544. package/templates/saas/skeleton/backend-api/Dockerfile +5 -2
  545. package/templates/saas/skeleton/frontend/Dockerfile +4 -1
  546. package/templates/saas/skeleton/frontend/vite-engine-dependency-prebundle.ts +10 -1
  547. package/templates/saas/skeleton/frontend/vite.config.ts.hbs +14 -3
  548. package/wildo-framework.info.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"connect.command.js","sourceRoot":"","sources":["../../../../src/commands/providers/connect.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,2CAA2C,EAC3C,gCAAgC,GACjC,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,mCAAmC,EAAE,yCAAyC,EAAE,MAAM,oEAAoE,CAAC;AAEpK,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,SAAS,GAAG,MA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EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,EAAE,OAAO,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;CACF","sourcesContent":["import * as path from 'node:path';\n\nimport { input, password } from '@inquirer/prompts';\nimport { MODULE_BOUNDARY_LAYER_ROOTS, ProviderModuleFacet } from '@wildo-ai/platform-config-lib';\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { parseCsvFlag } from '~wildo-cli/kernel/flag-utils';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\nimport {\n PROVIDER_CONNECT_DEFAULT_PORT,\n PROVIDERS_REGISTRY_HOME,\n ProviderConnectRedirectHost,\n connectProviderOAuth2,\n connectProviderSlots,\n loadProviderConnectSubject,\n openInBrowser,\n providerConnectRunsOAuth2Consent,\n resolveProviderModuleDir,\n type ProviderConnectPrompts,\n} from '~wildo-cli/services/registry/provider-connect.service';\nimport {\n ProviderProbeCredentialStore,\n assertProviderProbeCredentialStoreIsIgnored,\n providerProbeCredentialStorePath,\n} from '~wildo-cli/services/registry/provider-probe-credentials.service';\nimport { readDeclaredProcessingRegions } from '~wildo-cli/services/registry/provider-probe.service';\nimport type { ApplicationProviderConnectionClient } from '~wildo-cli/services/registry/application-provider-connection.service';\nimport { APPLICATION_CONNECTION_TARGET_FLAGS, openApplicationConnectionSessionFromFlags } from '~wildo-cli/commands/providers/application-connection-session.utils';\n\nconst FLAG_MODULE = 'module';\nconst FLAG_PARAM = 'param';\nconst FLAG_PORT = 'port';\nconst FLAG_REDIRECT_HOST = 'redirect-host';\nconst FLAG_SLOTS = 'slots';\nconst FLAG_PROCESSING_REGION = 'processing-region';\nconst FLAG_APPLICATION = 'application';\nconst FLAG_SCOPES = 'scopes';\nconst FLAG_PRINT_URL = 'print-url';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_APPLICATION]: {\n type: 'boolean',\n description:\n 'Connect the RUNNING application\\'s own vendor account instead (#3579): sign in to it as its local administrator, start the '\n + 'connection with an application target, and open the vendor\\'s consent. The browser must be signed in to the application '\n + 'as the same administrator: the application completes the connection there and stores the grant itself. Run from the '\n + 'application root, or name a deployed one with --api-url. See `wildo providers connections --application` and '\n + '`wildo providers disconnect <ref> --application`.',\n default: false,\n },\n [FLAG_SCOPES]: {\n type: 'string[]',\n description: 'With --application: the scopes to request, a subset of those the provider declares. Default: all of them.',\n },\n [FLAG_PRINT_URL]: {\n type: 'boolean',\n description: 'With --application: do not open the consent URL in the default browser (it is always printed).',\n default: false,\n },\n ...APPLICATION_CONNECTION_TARGET_FLAGS,\n [FLAG_MODULE]: {\n type: 'string',\n description: 'The module directory (`providers-registry/<ref>` or an application\\'s `providers/<ref>`). Defaults to the framework checkout\\'s, then the current application\\'s.',\n },\n [FLAG_PARAM]: {\n type: 'string[]',\n description: 'A connection parameter the vendor\\'s sign-in needs, `name=value` (`--param subdomain=acme`). Asked for when absent.',\n },\n [FLAG_PORT]: {\n type: 'number',\n description: `The loopback port the consent returns to. Register \\`http://localhost:<port>/callback\\` at the vendor. Default ${PROVIDER_CONNECT_DEFAULT_PORT}.`,\n },\n [FLAG_REDIRECT_HOST]: {\n type: 'string',\n description: 'The redirect URI\\'s host: `localhost` (default, what most vendor consoles accept) or `127.0.0.1`.',\n },\n [FLAG_PROCESSING_REGION]: {\n type: 'string',\n description:\n 'The processing region an application would declare for this provider (`providerComplianceChoices.<ref>.processingRegion`). '\n + 'The module is bound to it as a host binds it at startup, so the consent and the stored host answers are that region\\'s: an endpoint region\\'s host, its account host answer, or its request parameter. '\n + 'A region the provider cannot be reached in is refused. Default: run from an application root, the region it declares '\n + '(a flag naming another is refused); elsewhere, the module as declared (its default host).',\n },\n [FLAG_SLOTS]: {\n type: 'string[]',\n description: 'For a module with no OAuth2 consent (or whose application connection mints its token from client credentials): the slots to type, by env var name or slug. Default: its credential and host slots.',\n },\n};\n\n/**\n * A variadic flag's values as given, NOT split on commas (`parseCsvFlag` would): a value may hold one (`--param\n * name=a,b`).\n */\nfunction flagValues(value: unknown): string[] {\n return (Array.isArray(value) ? value : value === undefined ? [] : [value]).filter((entry): entry is string => typeof entry === 'string');\n}\n\n/** `name=value` pairs, refused when one has no `=`. */\nfunction parseNameValuePairs(values: readonly string[], flag: string): Record<string, string> {\n const pairs: Record<string, string> = {};\n for (const entry of values) {\n const separator = entry.indexOf('=');\n if (separator <= 0) throw new Error(`--${flag} takes name=value; '${entry}' is not.`);\n pairs[entry.slice(0, separator)] = entry.slice(separator + 1);\n }\n return pairs;\n}\n\n/**\n * Obtains a provider module's credential for its live proof and keeps it in the local probe credential store (#2518).\n *\n * The person creates the vendor account and clicks the consent; everything else is this command. A secret is only\n * ever TYPED into a hidden prompt or returned by the vendor's token endpoint, is stored in a gitignored 0600 file, and is\n * never printed. See `provider-connect.service.ts` for the flow and `provider-probe-credentials.service.ts` for the store.\n */\nexport default class ProvidersConnectCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'providers connect',\n description:\n 'Obtain a provider module\\'s credential for `wildo providers probe`, or with --application connect the running application\\'s own account: run its OAuth2 consent from the terminal (a loopback '\n + 'redirect, the engine\\'s own authorize URL and code exchange), or, for an API-key or EXTENSION module, ask for its '\n + 'slots in a hidden prompt. Stores them in a local gitignored file (mode 0600) beside the module; never prints a secret. '\n + 'The environment still wins over the store.',\n category: CommandCategory.Core,\n args: [{ name: 'ref', description: 'Provider ref (`hubspot`).', required: true }],\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const ref = ctx.args.ref;\n if (!ref) {\n ctx.log.error('Which provider? `wildo providers connect <ref>`.');\n return { success: false };\n }\n if (ctx.flags[FLAG_APPLICATION] === true) return this.connectApplication(ctx, ref);\n const moduleDir = resolveProviderModuleDir({\n frameworkRoot: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n ref,\n explicit: ctx.flags[FLAG_MODULE] as string | undefined,\n });\n if (moduleDir === undefined) {\n ctx.log.error(`No provider module '${ref}': looked in the framework checkout's ${PROVIDERS_REGISTRY_HOME}/ and this application's ${MODULE_BOUNDARY_LAYER_ROOTS.providers}/. Pass --module <dir>.`);\n return { success: false };\n }\n\n const nonInteractive = ctx.globalFlags.nonInteractive;\n const refuseNonInteractive = (what: string): never => {\n throw new Error(`${what} is needed and --non-interactive is set. Export it, or run the command in a terminal.`);\n };\n const prompts: ProviderConnectPrompts = {\n visible: async (message, defaultValue) => nonInteractive\n ? (defaultValue ?? refuseNonInteractive(message))\n : await input({ message, ...(defaultValue === undefined ? {} : { default: defaultValue }) }),\n // No mask: nothing is echoed, not even its length.\n // A secret is typed by a PERSON at a terminal (secret policy A). Piped stdin (a script, an agent) is refused, naming\n // the environment variable to export instead, so a value can never be fed in by something reading the screen (F5).\n hidden: async (message) => {\n if (nonInteractive) return refuseNonInteractive(message);\n if (process.stdin.isTTY !== true) throw new Error(`${message} must be typed at a terminal; stdin is not one. Export it in the environment instead.`);\n return await password({ message });\n },\n proceed: async (message) => {\n if (!nonInteractive) await input({ message });\n },\n };\n\n try {\n const storePath = providerProbeCredentialStorePath(moduleDir);\n const ignored = assertProviderProbeCredentialStoreIsIgnored(storePath);\n if (ignored.note !== undefined) ctx.log.warn(ignored.note);\n const store = new ProviderProbeCredentialStore(storePath);\n // Refuses a store others can read before anything is asked.\n store.read();\n\n const processingRegion = ctx.flags[FLAG_PROCESSING_REGION] as string | undefined;\n const declaredProcessingRegions = await readDeclaredProcessingRegions(process.cwd());\n const subject = await loadProviderConnectSubject(path.join(moduleDir, ProviderModuleFacet.BACKEND), {\n ...(processingRegion === undefined ? {} : { processingRegion }),\n ...(declaredProcessingRegions === undefined ? {} : { declaredProcessingRegions }),\n });\n const via = subject.probed.augments === undefined ? '' : ` through ${subject.probed.augments}'s OAuth2 client`;\n ctx.log.info(chalk.bold(`${ref}${via} — ${path.relative(process.cwd(), moduleDir) || '.'}`));\n\n if (subject.contract?.oauth2 !== undefined && !providerConnectRunsOAuth2Consent(subject)) {\n ctx.log.info('Its application connection mints a token from the server app\\'s client credentials, so no consent is run: type those slots.');\n }\n if (providerConnectRunsOAuth2Consent(subject)) {\n const redirectHost = (ctx.flags[FLAG_REDIRECT_HOST] as string | undefined) ?? ProviderConnectRedirectHost.LOCALHOST;\n if (!Object.values<string>(ProviderConnectRedirectHost).includes(redirectHost)) {\n ctx.log.error(`--redirect-host is ${Object.values(ProviderConnectRedirectHost).join(' or ')}.`);\n return { success: false };\n }\n const result = await connectProviderOAuth2({\n moduleRef: ref,\n subject,\n store,\n prompts,\n parameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n port: (ctx.flags[FLAG_PORT] as number | undefined) ?? PROVIDER_CONNECT_DEFAULT_PORT,\n redirectHost: redirectHost as ProviderConnectRedirectHost,\n openAuthorizeUrl: openInBrowser,\n report: (line) => ctx.log.info(line),\n });\n ctx.log.success(`Connected. Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n if (result.accountRef !== undefined) ctx.log.info(`Account: ${result.accountRef}`);\n ctx.log.info(`Granted (${result.grantedScopes.length}): ${result.grantedScopes.join(' ') || '(the vendor reported none)'}`);\n if (result.missingScopes.length > 0) ctx.log.warn(`Requested and not reported as granted: ${result.missingScopes.join(' ')}. An operation needing one may be refused.`);\n ctx.log.info(result.refreshable\n ? `The token renews itself when a probe finds it expired${result.accessTokenExpiresAt === undefined ? '' : ` (it expires ${result.accessTokenExpiresAt})`}.`\n : `The vendor issued no refresh token${result.accessTokenExpiresAt === undefined ? '' : `; the token expires ${result.accessTokenExpiresAt}, then connect again`}.`);\n return { success: true };\n }\n\n const result = await connectProviderSlots({\n moduleRef: ref,\n subject,\n store,\n prompts,\n ...(parseCsvFlag(ctx.flags[FLAG_SLOTS]) === undefined ? {} : { chosen: parseCsvFlag(ctx.flags[FLAG_SLOTS])! }),\n report: (line) => ctx.log.warn(line),\n });\n if (result.fromEnvironment.length > 0) ctx.log.info(`Already set in the environment (which wins over the store): ${result.fromEnvironment.join(', ')}.`);\n if (result.storedNames.length === 0) {\n ctx.log.warn('Nothing was stored.');\n return { success: result.fromEnvironment.length > 0 };\n }\n ctx.log.success(`Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n }\n }\n\n /**\n * `--application` (#3579): the running application connects its OWN vendor account. Nothing is stored locally and no\n * token reaches the terminal; see `application-provider-connection.service.ts`.\n */\n private async connectApplication(ctx: CommandContext, ref: string): Promise<CommandResult> {\n let session: ApplicationProviderConnectionClient | undefined;\n try {\n session = await openApplicationConnectionSessionFromFlags(ctx);\n const scopes = parseCsvFlag(ctx.flags[FLAG_SCOPES]);\n const authorizeUrl = await session.startConnection(ref, {\n ...(scopes === undefined ? {} : { scopes }),\n connectionParameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n });\n // Always printed: the opener does nothing on Windows and can fail silently on a headless machine.\n ctx.log.info(`Consent at the vendor:\\n${authorizeUrl}`);\n if (ctx.flags[FLAG_PRINT_URL] !== true) openInBrowser(authorizeUrl);\n ctx.log.success(`Started connecting the application's own '${ref}' account, signed in as ${session.email ?? 'the local administrator'}.`);\n ctx.log.info(\n `Consent at the vendor in a browser signed in to ${session.frontendUrl} as that same administrator: the application completes the connection there `\n + 'and stores the grant. The attempt expires after ten minutes.',\n );\n ctx.log.info('Then check it: `wildo providers connections --application`.');\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n } finally {\n await session?.signOut();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"connect.command.js","sourceRoot":"","sources":["../../../../src/commands/providers/connect.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,2CAA2C,EAC3C,gCAAgC,GACjC,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,mCAAmC,EAAE,yCAAyC,EAAE,MAAM,oEAAoE,CAAC;AAEpK,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,gBAAgB,GAAG,aAAa,CAAC;AACvC,MAAM,WAAW,GAAG,QA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AAC;YACpE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,6CAA6C,GAAG,2BAA2B,OAAO,CAAC,KAAK,IAAI,yBAAyB,GAAG,CAAC,CAAC;YAC1I,GAAG,CAAC,GAAG,CAAC,IAAI,CACV,mDAAmD,OAAO,CAAC,WAAW,8EAA8E;kBAClJ,8DAA8D,CACjE,CAAC;YACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;YAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,EAAE,OAAO,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;CACF","sourcesContent":["import * as path from 'node:path';\n\nimport { input, password } from '@inquirer/prompts';\nimport { MODULE_BOUNDARY_LAYER_ROOTS, ProviderModuleFacet } from '@wildo-ai/platform-config-lib';\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { parseCsvFlag } from '~wildo-cli/kernel/flag-utils';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\nimport {\n PROVIDER_CONNECT_DEFAULT_PORT,\n PROVIDERS_REGISTRY_HOME,\n ProviderConnectRedirectHost,\n connectProviderOAuth2,\n connectProviderSlots,\n loadProviderConnectSubject,\n openInBrowser,\n providerConnectRunsOAuth2Consent,\n resolveProviderModuleDir,\n type ProviderConnectPrompts,\n} from '~wildo-cli/services/registry/provider-connect.service';\nimport {\n ProviderProbeCredentialStore,\n assertProviderProbeCredentialStoreIsIgnored,\n providerProbeCredentialStorePath,\n} from '~wildo-cli/services/registry/provider-probe-credentials.service';\nimport { readDeclaredProcessingRegions } from '~wildo-cli/services/registry/provider-probe.service';\nimport type { ApplicationProviderConnectionClient } from '~wildo-cli/services/registry/application-provider-connection.service';\nimport { APPLICATION_CONNECTION_TARGET_FLAGS, openApplicationConnectionSessionFromFlags } from '~wildo-cli/commands/providers/application-connection-session.utils';\n\nconst FLAG_MODULE = 'module';\nconst FLAG_PARAM = 'param';\nconst FLAG_PORT = 'port';\nconst FLAG_REDIRECT_HOST = 'redirect-host';\nconst FLAG_SLOTS = 'slots';\nconst FLAG_PROCESSING_REGION = 'processing-region';\nconst FLAG_APPLICATION = 'application';\nconst FLAG_SCOPES = 'scopes';\nconst FLAG_PRINT_URL = 'print-url';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_APPLICATION]: {\n type: 'boolean',\n description:\n 'Connect the RUNNING application\\'s own vendor account instead (#3579): sign in to it as its local administrator, start the '\n + 'connection with an application target, and open the vendor\\'s consent. The browser must be signed in to the application '\n + 'as the same administrator: the application completes the connection there and stores the grant itself. Run from the '\n + 'application root, or name a deployed one with --api-url. See `wildo providers connections --application` and '\n + '`wildo providers disconnect <ref> --application`.',\n default: false,\n },\n [FLAG_SCOPES]: {\n type: 'string[]',\n description: 'With --application: the scopes to request, a subset of those the provider declares. Default: all of them.',\n },\n [FLAG_PRINT_URL]: {\n type: 'boolean',\n description: 'With --application: do not open the consent URL in the default browser (it is always printed).',\n default: false,\n },\n ...APPLICATION_CONNECTION_TARGET_FLAGS,\n [FLAG_MODULE]: {\n type: 'string',\n description: 'The module directory (`providers-registry/<ref>` or an application\\'s `providers/<ref>`). Defaults to the framework checkout\\'s, then the current application\\'s.',\n },\n [FLAG_PARAM]: {\n type: 'string[]',\n description: 'A connection parameter the vendor\\'s sign-in needs, `name=value` (`--param subdomain=acme`). Asked for when absent.',\n },\n [FLAG_PORT]: {\n type: 'number',\n description: `The loopback port the consent returns to. Register \\`http://localhost:<port>/callback\\` at the vendor. Default ${PROVIDER_CONNECT_DEFAULT_PORT}.`,\n },\n [FLAG_REDIRECT_HOST]: {\n type: 'string',\n description: 'The redirect URI\\'s host: `localhost` (default, what most vendor consoles accept) or `127.0.0.1`.',\n },\n [FLAG_PROCESSING_REGION]: {\n type: 'string',\n description:\n 'The processing region an application would declare for this provider (`providerComplianceChoices.<ref>.processingRegion`). '\n + 'The module is bound to it as a host binds it at startup, so the consent and the stored host answers are that region\\'s: an endpoint region\\'s host, its account host answer, or its request parameter. '\n + 'A region the provider cannot be reached in is refused. Default: run from an application root, the region it declares '\n + '(a flag naming another is refused); elsewhere, the module as declared (its default host).',\n },\n [FLAG_SLOTS]: {\n type: 'string[]',\n description: 'For a module with no OAuth2 consent (or whose application connection mints its token from client credentials): the slots to type, by env var name or slug. Default: its credential and host slots.',\n },\n};\n\n/**\n * A variadic flag's values as given, NOT split on commas (`parseCsvFlag` would): a value may hold one (`--param\n * name=a,b`).\n */\nfunction flagValues(value: unknown): string[] {\n return (Array.isArray(value) ? value : value === undefined ? [] : [value]).filter((entry): entry is string => typeof entry === 'string');\n}\n\n/** `name=value` pairs, refused when one has no `=`. */\nfunction parseNameValuePairs(values: readonly string[], flag: string): Record<string, string> {\n const pairs: Record<string, string> = {};\n for (const entry of values) {\n const separator = entry.indexOf('=');\n if (separator <= 0) throw new Error(`--${flag} takes name=value; '${entry}' is not.`);\n pairs[entry.slice(0, separator)] = entry.slice(separator + 1);\n }\n return pairs;\n}\n\n/**\n * Obtains a provider module's credential for its live proof and keeps it in the local probe credential store (#2518).\n *\n * The person creates the vendor account and clicks the consent; everything else is this command. A secret is only\n * ever TYPED into a hidden prompt or returned by the vendor's token endpoint, is stored in a gitignored 0600 file, and is\n * never printed. See `provider-connect.service.ts` for the flow and `provider-probe-credentials.service.ts` for the store.\n */\nexport default class ProvidersConnectCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'providers connect',\n description:\n 'Obtain a provider module\\'s credential for `wildo providers probe`, or with --application connect the running application\\'s own account: run its OAuth2 consent from the terminal (a loopback '\n + 'redirect, the engine\\'s own authorize URL and code exchange), or, for an API-key or EXTENSION module, ask for its '\n + 'slots in a hidden prompt. Stores them in a local gitignored file (mode 0600) beside the module; never prints a secret. '\n + 'The environment still wins over the store.',\n category: CommandCategory.Core,\n args: [{ name: 'ref', description: 'Provider ref (`hubspot`).', required: true }],\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const ref = ctx.args.ref;\n if (!ref) {\n ctx.log.error('Which provider? `wildo providers connect <ref>`.');\n return { success: false };\n }\n if (ctx.flags[FLAG_APPLICATION] === true) return this.connectApplication(ctx, ref);\n const moduleDir = resolveProviderModuleDir({\n frameworkRoot: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n ref,\n explicit: ctx.flags[FLAG_MODULE] as string | undefined,\n });\n if (moduleDir === undefined) {\n ctx.log.error(`No provider module '${ref}': looked in the framework checkout's ${PROVIDERS_REGISTRY_HOME}/ and this application's ${MODULE_BOUNDARY_LAYER_ROOTS.providers}/. Pass --module <dir>.`);\n return { success: false };\n }\n\n const nonInteractive = ctx.globalFlags.nonInteractive;\n const refuseNonInteractive = (what: string): never => {\n throw new Error(`${what} is needed and --non-interactive is set. Export it, or run the command in a terminal.`);\n };\n const prompts: ProviderConnectPrompts = {\n visible: async (message, defaultValue) => nonInteractive\n ? (defaultValue ?? refuseNonInteractive(message))\n : await input({ message, ...(defaultValue === undefined ? {} : { default: defaultValue }) }),\n // No mask: nothing is echoed, not even its length.\n // A secret is typed by a PERSON at a terminal (secret policy A). Piped stdin (a script, an agent) is refused, naming\n // the environment variable to export instead, so a value can never be fed in by something reading the screen (F5).\n hidden: async (message) => {\n if (nonInteractive) return refuseNonInteractive(message);\n if (process.stdin.isTTY !== true) throw new Error(`${message} must be typed at a terminal; stdin is not one. Export it in the environment instead.`);\n return await password({ message });\n },\n proceed: async (message) => {\n if (!nonInteractive) await input({ message });\n },\n };\n\n try {\n const storePath = providerProbeCredentialStorePath(moduleDir);\n const ignored = assertProviderProbeCredentialStoreIsIgnored(storePath);\n if (ignored.note !== undefined) ctx.log.warn(ignored.note);\n const store = new ProviderProbeCredentialStore(storePath);\n // Refuses a store others can read before anything is asked.\n store.read();\n\n const processingRegion = ctx.flags[FLAG_PROCESSING_REGION] as string | undefined;\n const declaredProcessingRegions = await readDeclaredProcessingRegions(process.cwd());\n const subject = await loadProviderConnectSubject(path.join(moduleDir, ProviderModuleFacet.BACKEND), {\n ...(processingRegion === undefined ? {} : { processingRegion }),\n ...(declaredProcessingRegions === undefined ? {} : { declaredProcessingRegions }),\n });\n const via = subject.probed.augments === undefined ? '' : ` through ${subject.probed.augments}'s OAuth2 client`;\n ctx.log.info(chalk.bold(`${ref}${via} — ${path.relative(process.cwd(), moduleDir) || '.'}`));\n\n if (subject.contract?.oauth2 !== undefined && !providerConnectRunsOAuth2Consent(subject)) {\n ctx.log.info('Its application connection mints a token from the server app\\'s client credentials, so no consent is run: type those slots.');\n }\n if (providerConnectRunsOAuth2Consent(subject)) {\n const redirectHost = (ctx.flags[FLAG_REDIRECT_HOST] as string | undefined) ?? ProviderConnectRedirectHost.LOCALHOST;\n if (!Object.values<string>(ProviderConnectRedirectHost).includes(redirectHost)) {\n ctx.log.error(`--redirect-host is ${Object.values(ProviderConnectRedirectHost).join(' or ')}.`);\n return { success: false };\n }\n const result = await connectProviderOAuth2({\n moduleRef: ref,\n subject,\n store,\n prompts,\n parameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n port: (ctx.flags[FLAG_PORT] as number | undefined) ?? PROVIDER_CONNECT_DEFAULT_PORT,\n redirectHost: redirectHost as ProviderConnectRedirectHost,\n openAuthorizeUrl: openInBrowser,\n report: (line) => ctx.log.info(line),\n });\n ctx.log.success(`Connected. Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n if (result.accountRef !== undefined) ctx.log.info(`Account: ${result.accountRef}`);\n ctx.log.info(`Granted to '${ref}' (${result.grantedScopes.length}): ${result.grantedScopes.join(' ') || '(the vendor reported none)'}`);\n // The store keys a grant by MODULE ref, so an augmentation's consent never replaces its base's or a sibling's: each\n // keeps its own token, read by `probe <ref>`. Said here because the line above was read as the base's whole grant.\n if (subject.probed.augments !== undefined) {\n ctx.log.info(`This grant is '${ref}'s own record. Other modules connected through ${subject.probed.augments}'s client keep theirs; \\`providers probe ${ref}\\` reads this one.`);\n }\n if (result.missingScopes.length > 0) ctx.log.warn(`Requested and not reported as granted: ${result.missingScopes.join(' ')}. An operation needing one may be refused.`);\n // Static consent grants what the app registration lists, so these are the registration's gaps (or a granted answer\n // spelled differently from the operation's declaration, which an application's scope check would refuse too).\n if (result.staticConsentScopesNotGranted.length > 0) {\n ctx.log.warn(`Needed by an operation, registered for static consent, and not reported as granted: ${result.staticConsentScopesNotGranted.join(' ')}. Add them to the app registration (with admin consent where required) and connect again.`);\n }\n ctx.log.info(result.refreshable\n ? `The token renews itself when a probe finds it expired${result.accessTokenExpiresAt === undefined ? '' : ` (it expires ${result.accessTokenExpiresAt})`}.`\n : `The vendor issued no refresh token${result.accessTokenExpiresAt === undefined ? '' : `; the token expires ${result.accessTokenExpiresAt}, then connect again`}.`);\n return { success: true };\n }\n\n const result = await connectProviderSlots({\n moduleRef: ref,\n subject,\n store,\n prompts,\n ...(parseCsvFlag(ctx.flags[FLAG_SLOTS]) === undefined ? {} : { chosen: parseCsvFlag(ctx.flags[FLAG_SLOTS])! }),\n report: (line) => ctx.log.warn(line),\n });\n if (result.fromEnvironment.length > 0) ctx.log.info(`Already set in the environment (which wins over the store): ${result.fromEnvironment.join(', ')}.`);\n if (result.storedNames.length === 0) {\n ctx.log.warn('Nothing was stored.');\n return { success: result.fromEnvironment.length > 0 };\n }\n ctx.log.success(`Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n }\n }\n\n /**\n * `--application` (#3579): the running application connects its OWN vendor account. Nothing is stored locally and no\n * token reaches the terminal; see `application-provider-connection.service.ts`.\n */\n private async connectApplication(ctx: CommandContext, ref: string): Promise<CommandResult> {\n let session: ApplicationProviderConnectionClient | undefined;\n try {\n session = await openApplicationConnectionSessionFromFlags(ctx);\n const scopes = parseCsvFlag(ctx.flags[FLAG_SCOPES]);\n const authorizeUrl = await session.startConnection(ref, {\n ...(scopes === undefined ? {} : { scopes }),\n connectionParameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n });\n // Always printed: the opener does nothing on Windows and can fail silently on a headless machine.\n ctx.log.info(`Consent at the vendor:\\n${authorizeUrl}`);\n if (ctx.flags[FLAG_PRINT_URL] !== true) openInBrowser(authorizeUrl);\n ctx.log.success(`Started connecting the application's own '${ref}' account, signed in as ${session.email ?? 'the local administrator'}.`);\n ctx.log.info(\n `Consent at the vendor in a browser signed in to ${session.frontendUrl} as that same administrator: the application completes the connection there `\n + 'and stores the grant. The attempt expires after ten minutes.',\n );\n ctx.log.info('Then check it: `wildo providers connections --application`.');\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n } finally {\n await session?.signOut();\n }\n }\n}\n"]}
@@ -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;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,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AA6F;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,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,kBAAkB,EAClB,oBA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AM,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,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,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AAE,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,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EAEpB,UAAU,GACX,MAAM,+BAA+B,CAAC;AACvC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AE,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"]}
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../kernel/base-command';
2
+ import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/types';
3
+ /**
4
+ * `wildo seal currency <sealId>` — whether one approval is still CURRENT over the record it is about (#2914), asked of the
5
+ * locally-running application: the values of the fields the approval covers (its tool's `sealedRecordFields`), as the
6
+ * seal's presentation carries them, against the record as it is now. Exits 0 only when CURRENT, so a script can gate on
7
+ * it. Names which fields moved, never a value.
8
+ */
9
+ export default class SealCurrencyCommand extends BaseCommand {
10
+ readonly meta: CommandMeta;
11
+ run(ctx: CommandContext): Promise<CommandResult>;
12
+ }
13
+ //# sourceMappingURL=currency.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/currency.command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG1F;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,WAAW;IAC1D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAQxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAsBvD"}