@wildo-ai/wildo-cli 1.1.14 → 1.1.16

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 (211) hide show
  1. package/dist/src/commands/context/journey.command.d.ts.map +1 -1
  2. package/dist/src/commands/context/journey.command.js +12 -0
  3. package/dist/src/commands/context/journey.command.js.map +1 -1
  4. package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
  5. package/dist/src/commands/creation/drive.command.js +2 -1
  6. package/dist/src/commands/creation/drive.command.js.map +1 -1
  7. package/dist/src/commands/generate/email-command.utils.d.ts +2 -0
  8. package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
  9. package/dist/src/commands/generate/email-command.utils.js +5 -0
  10. package/dist/src/commands/generate/email-command.utils.js.map +1 -1
  11. package/dist/src/commands/init.command.d.ts.map +1 -1
  12. package/dist/src/commands/init.command.js +7 -2
  13. package/dist/src/commands/init.command.js.map +1 -1
  14. package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
  15. package/dist/src/commands/local/deregister.command.js +4 -0
  16. package/dist/src/commands/local/deregister.command.js.map +1 -1
  17. package/dist/src/commands/local/dev.command.d.ts +50 -0
  18. package/dist/src/commands/local/dev.command.d.ts.map +1 -1
  19. package/dist/src/commands/local/dev.command.js +144 -1
  20. package/dist/src/commands/local/dev.command.js.map +1 -1
  21. package/dist/src/commands/local/jobs-command.utils.d.ts +24 -0
  22. package/dist/src/commands/local/jobs-command.utils.d.ts.map +1 -0
  23. package/dist/src/commands/local/jobs-command.utils.js +44 -0
  24. package/dist/src/commands/local/jobs-command.utils.js.map +1 -0
  25. package/dist/src/commands/local/jobs-run.command.d.ts +7 -0
  26. package/dist/src/commands/local/jobs-run.command.d.ts.map +1 -0
  27. package/dist/src/commands/local/jobs-run.command.js +92 -0
  28. package/dist/src/commands/local/jobs-run.command.js.map +1 -0
  29. package/dist/src/commands/local/jobs.command.d.ts +7 -0
  30. package/dist/src/commands/local/jobs.command.d.ts.map +1 -0
  31. package/dist/src/commands/local/jobs.command.js +59 -0
  32. package/dist/src/commands/local/jobs.command.js.map +1 -0
  33. package/dist/src/commands/local/tunnel.command.d.ts +84 -0
  34. package/dist/src/commands/local/tunnel.command.d.ts.map +1 -0
  35. package/dist/src/commands/local/tunnel.command.js +274 -0
  36. package/dist/src/commands/local/tunnel.command.js.map +1 -0
  37. package/dist/src/commands/providers/grant-export.command.d.ts +16 -0
  38. package/dist/src/commands/providers/grant-export.command.d.ts.map +1 -0
  39. package/dist/src/commands/providers/grant-export.command.js +78 -0
  40. package/dist/src/commands/providers/grant-export.command.js.map +1 -0
  41. package/dist/src/commands/providers/grant-import.command.d.ts +15 -0
  42. package/dist/src/commands/providers/grant-import.command.d.ts.map +1 -0
  43. package/dist/src/commands/providers/grant-import.command.js +78 -0
  44. package/dist/src/commands/providers/grant-import.command.js.map +1 -0
  45. package/dist/src/kernel/command-runner.d.ts.map +1 -1
  46. package/dist/src/kernel/command-runner.js +4 -6
  47. package/dist/src/kernel/command-runner.js.map +1 -1
  48. package/dist/src/kernel/hooks.d.ts.map +1 -1
  49. package/dist/src/kernel/hooks.js +2 -1
  50. package/dist/src/kernel/hooks.js.map +1 -1
  51. package/dist/src/kernel/json-document-output.d.ts +7 -0
  52. package/dist/src/kernel/json-document-output.d.ts.map +1 -1
  53. package/dist/src/kernel/json-document-output.js +8 -0
  54. package/dist/src/kernel/json-document-output.js.map +1 -1
  55. package/dist/src/kernel/types.d.ts +8 -0
  56. package/dist/src/kernel/types.d.ts.map +1 -1
  57. package/dist/src/kernel/types.js.map +1 -1
  58. package/dist/src/services/application/app-bootstrap.service.d.ts +65 -7
  59. package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
  60. package/dist/src/services/application/app-bootstrap.service.js +94 -15
  61. package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
  62. package/dist/src/services/application/app-local-runtime-addresses.service.d.ts +1 -1
  63. package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
  64. package/dist/src/services/application/app-local-runtime-addresses.service.js.map +1 -1
  65. package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
  66. package/dist/src/services/application/app-runtime-targets.service.js +16 -2
  67. package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
  68. package/dist/src/services/application/application-dependency-alignment.service.d.ts +20 -0
  69. package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
  70. package/dist/src/services/application/application-dependency-alignment.service.js +32 -2
  71. package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
  72. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +13 -0
  73. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
  74. package/dist/src/services/application/application-runtime-bootstrap.service.js +32 -0
  75. package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
  76. package/dist/src/services/application/environment-provider-configurations.service.d.ts +7 -0
  77. package/dist/src/services/application/environment-provider-configurations.service.d.ts.map +1 -1
  78. package/dist/src/services/application/environment-provider-configurations.service.js +1 -1
  79. package/dist/src/services/application/environment-provider-configurations.service.js.map +1 -1
  80. package/dist/src/services/application/local-tunnel.service.d.ts +153 -0
  81. package/dist/src/services/application/local-tunnel.service.d.ts.map +1 -0
  82. package/dist/src/services/application/local-tunnel.service.js +295 -0
  83. package/dist/src/services/application/local-tunnel.service.js.map +1 -0
  84. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  85. package/dist/src/services/application/provider-runtime-sync.service.js +3 -0
  86. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  87. package/dist/src/services/application/saas-skeleton.service.d.ts +7 -0
  88. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  89. package/dist/src/services/application/saas-skeleton.service.js +2 -0
  90. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  91. package/dist/src/services/catalog/service-address-resolver.service.d.ts +7 -1
  92. package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
  93. package/dist/src/services/catalog/service-address-resolver.service.js +6 -3
  94. package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
  95. package/dist/src/services/companion/companion-client.service.d.ts +17 -0
  96. package/dist/src/services/companion/companion-client.service.d.ts.map +1 -1
  97. package/dist/src/services/companion/companion-client.service.js +21 -0
  98. package/dist/src/services/companion/companion-client.service.js.map +1 -1
  99. package/dist/src/services/companion/creation-drive.service.d.ts +18 -0
  100. package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
  101. package/dist/src/services/companion/creation-drive.service.js +70 -1
  102. package/dist/src/services/companion/creation-drive.service.js.map +1 -1
  103. package/dist/src/services/credentials/application-secrets.service.d.ts +6 -0
  104. package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
  105. package/dist/src/services/credentials/application-secrets.service.js +1 -1
  106. package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
  107. package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
  108. package/dist/src/services/credentials/provider-env-vars.utils.js +3 -1
  109. package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
  110. package/dist/src/services/credentials/secrets-writer.service.d.ts +11 -2
  111. package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
  112. package/dist/src/services/credentials/secrets-writer.service.js +12 -3
  113. package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
  114. package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
  115. package/dist/src/services/deployment/ci-deploy-generator.service.js +3 -3
  116. package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
  117. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +12 -3
  118. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  119. package/dist/src/services/deployment/docker/docker-compose-generator.service.js +40 -22
  120. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  121. package/dist/src/services/deployment/framework-pod-network-membership.d.ts +6 -0
  122. package/dist/src/services/deployment/framework-pod-network-membership.d.ts.map +1 -1
  123. package/dist/src/services/deployment/framework-pod-network-membership.js +17 -3
  124. package/dist/src/services/deployment/framework-pod-network-membership.js.map +1 -1
  125. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts +4 -1
  126. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
  127. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +17 -7
  128. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
  129. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +7 -0
  130. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
  131. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
  132. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
  133. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +15 -9
  134. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
  135. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts +43 -0
  136. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts.map +1 -0
  137. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js +12 -0
  138. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js.map +1 -0
  139. package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts +3 -1
  140. package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts.map +1 -1
  141. package/dist/src/services/deployment/k8s/off-cluster-backing-services.js.map +1 -1
  142. package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts +163 -0
  143. package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts.map +1 -0
  144. package/dist/src/services/deployment/local-dev-late-workspace-members.service.js +356 -0
  145. package/dist/src/services/deployment/local-dev-late-workspace-members.service.js.map +1 -0
  146. package/dist/src/services/environment/authored-infra-config.utils.d.ts +13 -3
  147. package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
  148. package/dist/src/services/environment/authored-infra-config.utils.js +24 -4
  149. package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
  150. package/dist/src/services/environment/container-host-gateway-listen-host.d.ts +6 -0
  151. package/dist/src/services/environment/container-host-gateway-listen-host.d.ts.map +1 -1
  152. package/dist/src/services/environment/container-host-gateway-listen-host.js +6 -0
  153. package/dist/src/services/environment/container-host-gateway-listen-host.js.map +1 -1
  154. package/dist/src/services/environment/env-configuration-generator.service.d.ts +12 -0
  155. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  156. package/dist/src/services/environment/env-configuration-generator.service.js +37 -5
  157. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  158. package/dist/src/services/environment/env-vars-builder.service.d.ts +2 -1
  159. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  160. package/dist/src/services/environment/env-vars-builder.service.js +47 -32
  161. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  162. package/dist/src/services/environment/environment-lifecycle.service.d.ts +7 -4
  163. package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
  164. package/dist/src/services/environment/environment-lifecycle.service.js +14 -18
  165. package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
  166. package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
  167. package/dist/src/services/environment/environment-setup.service.js +17 -6
  168. package/dist/src/services/environment/environment-setup.service.js.map +1 -1
  169. package/dist/src/services/environment/environment.service.d.ts +4 -3
  170. package/dist/src/services/environment/environment.service.d.ts.map +1 -1
  171. package/dist/src/services/environment/environment.service.js +0 -1
  172. package/dist/src/services/environment/environment.service.js.map +1 -1
  173. package/dist/src/services/framework/framework-docker-publish.service.d.ts +55 -15
  174. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  175. package/dist/src/services/framework/framework-docker-publish.service.js +115 -25
  176. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  177. package/dist/src/services/framework/package-install.service.d.ts +7 -0
  178. package/dist/src/services/framework/package-install.service.d.ts.map +1 -1
  179. package/dist/src/services/framework/package-install.service.js +8 -1
  180. package/dist/src/services/framework/package-install.service.js.map +1 -1
  181. package/dist/src/services/registry/application-provider-connection.service.d.ts +16 -1
  182. package/dist/src/services/registry/application-provider-connection.service.d.ts.map +1 -1
  183. package/dist/src/services/registry/application-provider-connection.service.js +23 -0
  184. package/dist/src/services/registry/application-provider-connection.service.js.map +1 -1
  185. package/dist/src/services/registry/provider-grant-transfer.service.d.ts +48 -0
  186. package/dist/src/services/registry/provider-grant-transfer.service.d.ts.map +1 -0
  187. package/dist/src/services/registry/provider-grant-transfer.service.js +144 -0
  188. package/dist/src/services/registry/provider-grant-transfer.service.js.map +1 -0
  189. package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
  190. package/dist/src/services/registry/provider-module-scaffold.service.js +10 -3
  191. package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
  192. package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
  193. package/dist/src/services/security/csp-sync.service.js +21 -2
  194. package/dist/src/services/security/csp-sync.service.js.map +1 -1
  195. package/dist/tsconfig.build.tsbuildinfo +1 -1
  196. package/package.json +19 -19
  197. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +16 -7
  198. package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +13 -0
  199. package/templates/saas/i18n/email/system/remote-agent-task-updated/labels.en.ts +11 -0
  200. package/templates/saas/i18n/email/system/remote-agent-task-updated/template.tsx +56 -0
  201. package/templates/saas/i18n/engine/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.ts +61 -0
  202. package/templates/saas/i18n/engine/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.ts +61 -0
  203. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +5 -4
  204. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/package.json.hbs +1 -1
  205. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/scripts/substitute-api-origin.mjs +97 -32
  206. package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +7 -6
  207. package/templates/saas/skeleton/.wildo-saas/wildo-dev-companion/scripts/dev-supervised.sh +18 -4
  208. package/templates/saas/skeleton/frontend/nginx-config/default.conf.hbs +1 -1
  209. package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +4 -4
  210. package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +2 -0
  211. package/wildo-framework.info.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"deregister.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/deregister.command.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM1F,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,WAAW;IAC7D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAcxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAyEtD;;;;;;;;;;;OAWG;YACW,aAAa;CA2C5B"}
1
+ {"version":3,"file":"deregister.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/deregister.command.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM1F,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,WAAW;IAC7D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAcxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IA6EtD;;;;;;;;;;;OAWG;YACW,aAAa;CA2C5B"}
@@ -97,6 +97,10 @@ export default class LocalDeregisterCommand extends BaseCommand {
97
97
  for (const entry of result.revokedCredentials) {
98
98
  ctx.log.info(` - ${entry.principalKey}${entry.service ? ` / ${entry.service}` : ''}`);
99
99
  }
100
+ // #2303 slice D: credentials on a broker the platform no longer runs. Not revoked, and not a failure: named.
101
+ for (const entry of result.unreachableCredentials ?? []) {
102
+ ctx.log.warn(` Not revoked: ${entry.principalKey}${entry.service ? ` / ${entry.service}` : ''}: ${entry.reason}`);
103
+ }
100
104
  ctx.log.info(chalk.dim(' Its database, broker vhost and cache namespace are untouched.\n'
101
105
  + ' `wildo local restore` re-mints its credentials and returns it to service; its next boot re-establishes the schedule.\n'));
102
106
  return { success: true };
@@ -1 +1 @@
1
- {"version":3,"file":"deregister.command.js","sourceRoot":"","sources":["../../../../src/commands/local/deregister.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC;AAEvG,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,WAAW;IACpD,IAAI,GAAgB;QAC3B,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,iIAAiI;QACnI,QAAQ,EAAE,eAAe,CAAC,KAAK;QAC/B,KAAK,EAAE;YACL,GAAG,EAAE,EAAE,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CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,OAAO,MAAM,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC1F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * `wildo local deregister` — withdraw this application from the platform (#1556).\n *\n * ## What it is for\n *\n * Registering an application has been a ONE-WAY DOOR. Its backend syncs a cron schedule at every\n * boot and nothing ever withdrew one, so an application that stops existing keeps being scheduled\n * forever. Measured on a live platform 2026-09-24: three dead scratch applications held 46 active\n * schedules, dispatched 2,100 executions a day at backends that were not listening, and had\n * accumulated 1,870 messages in queues nobody would ever drain.\n *\n * ## What it revokes (#1307)\n *\n * Every credential the platform minted for the application: the backend's and each minion's Redis ACL\n * user, RabbitMQ user, MongoDB user (self-hosted or Atlas, whichever the application declares) and\n * PostgreSQL login. Afterwards those servers refuse them. A withdrawal that cannot revoke one fails and\n * names what still authenticates; running it again retries.\n *\n * ## Why it needs no confirmation and no environment gate\n *\n * **It destroys no data.** The application's database, broker vhost, cache namespace and blobs are\n * exactly as they were — the backend's PostgreSQL role is disabled, not dropped, because it owns the\n * database. What goes is the SCHEDULE, derived state the application rebuilds from its own code at its\n * next boot, and the ability to authenticate. `wildo local restore` clears the mark and re-mints the\n * credentials with their recorded values; starting the application restores the schedule.\n *\n * Destroying an application's data is a different verb with different protection, and it is\n * deliberately parked (#1562). Nothing here may grow into it.\n */\nimport chalk from 'chalk';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport { AppRuntimeTargetsService } from '~wildo-cli/services/application/app-runtime-targets.service';\n\nexport default class LocalDeregisterCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'local deregister',\n description:\n 'Withdraw this application from the platform: removes its cron schedule, revokes its credentials and marks it. Destroys no data.',\n category: CommandCategory.Local,\n flags: {\n app: { type: 'string', description: 'Application slug (defaults to the single resolved app)', default: undefined },\n reason: { type: 'string', description: 'Why it is being withdrawn — recorded in the platform log', default: undefined },\n check: {\n type: 'boolean',\n description: 'Report what the platform still holds for this application and change nothing',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n ctx.log.error('`wildo local deregister` requires a targeted app root with wildo.saas.config.ts.');\n return { success: false };\n }\n\n const envName = ctx.activeEnv?.name;\n if (!envName) {\n ctx.log.error('No active environment. Run `wildo init` first.');\n return { success: false };\n }\n\n const env = EnvironmentRegistry.get(envName);\n if (!env) {\n ctx.log.error(`Environment '${envName}' not found. Run 'wildo init' first.`);\n return { success: false };\n }\n\n const credentials = EnvironmentUtils.loadSecretsJson(envName);\n if (!credentials) {\n ctx.log.error(`No secrets for '${envName}'. Run 'wildo init' first.`);\n return { success: false };\n }\n\n const requestedAppSlug = ctx.flags.app as string | undefined;\n const runtimeTarget = await AppRuntimeTargetsService.resolve(saasRoot, { environmentName: envName, requestedAppSlug });\n if (!runtimeTarget) {\n ctx.log.error(\n requestedAppSlug\n ? `Application '${requestedAppSlug}' not found under ${saasRoot}.`\n : `No application could be resolved from ${saasRoot}. Pass --app <slug> to disambiguate.`,\n );\n return { success: false };\n }\n\n const appSlug = runtimeTarget.appSlug;\n\n if (ctx.flags.check === true) {\n return await this.reportResidue(ctx, env, credentials, appSlug);\n }\n\n ctx.log.info(chalk.cyan(`\\n Withdrawing '${appSlug}' from the '${envName}' platform (no data is destroyed)...\\n`));\n\n try {\n const result = await AppBootstrapService.deregisterApplication(env, credentials, {\n appSlug,\n reason: ctx.flags.reason as string | undefined,\n });\n\n if (result.alreadyDeregistered) {\n ctx.log.info(` '${appSlug}' was already withdrawn; its schedule was re-checked.`);\n }\n ctx.log.success(\n ` Withdrew ${result.withdrawnJobs} schedule(s) and ${result.deletedExecutions} execution record(s) for '${appSlug}'.`,\n );\n ctx.log.success(` Revoked ${result.revokedCredentials.length} credential(s):`);\n for (const entry of result.revokedCredentials) {\n ctx.log.info(` - ${entry.principalKey}${entry.service ? ` / ${entry.service}` : ''}`);\n }\n ctx.log.info(\n chalk.dim(\n ' Its database, broker vhost and cache namespace are untouched.\\n'\n + ' `wildo local restore` re-mints its credentials and returns it to service; its next boot re-establishes the schedule.\\n',\n ),\n );\n return { success: true };\n } catch (error) {\n ctx.log.error(`Failed to withdraw '${appSlug}': ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n\n /**\n * `--check`: what the platform still holds for this application, changing nothing (#1556).\n *\n * It is a dry run BEFORE a withdrawal and the residue probe AFTER one, which is why it lives on\n * this verb rather than in a command of its own.\n *\n * Every number is printed beside the reason it can be believed. Two empty results nearly passed\n * for success while this lane was built — `rabbitmqctl list_queues` defaults to vhost `/`, so it\n * shows nothing for an application whose queues live in its own vhost, and a Valkey scan was\n * answering `NOAUTH` rather than \"no keys\". So \"could not ask\" is rendered as its own outcome and\n * never as a zero, and the stores this probe does not inspect are NAMED rather than omitted.\n */\n private async reportResidue(\n ctx: CommandContext,\n env: Parameters<typeof AppBootstrapService.inspectApplicationResidue>[0],\n credentials: Parameters<typeof AppBootstrapService.inspectApplicationResidue>[1],\n appSlug: string,\n ): Promise<CommandResult> {\n try {\n const report = await AppBootstrapService.inspectApplicationResidue(env, credentials, { appSlug });\n\n ctx.log.info(chalk.cyan(`\\n What the platform still holds for '${appSlug}'\\n`));\n ctx.log.info(` status: ${report.status}${report.deregisteredAt ? ` (withdrawn ${report.deregisteredAt})` : ''}`);\n\n const schedule = report.schedule;\n if (schedule.unavailableReason) {\n ctx.log.warn(` schedules: COULD NOT ASK — ${schedule.unavailableReason}`);\n } else {\n ctx.log.info(\n ` schedules: ${schedule.scheduledForApplication} for this application`\n + ` (platform total ${schedule.platformScheduledTotal}, scheduler ${schedule.schedulerRunning ? 'running' : 'NOT running'})`,\n );\n if (schedule.schedulerRunning === false) {\n // Without this the reader takes a zero as proof. A standby replica arms nothing and would\n // report zero for every application on the platform.\n ctx.log.warn(' the scheduler is not arming jobs, so a count of 0 proves nothing here');\n }\n }\n\n const broker = report.broker;\n if (broker.unavailableReason) {\n ctx.log.warn(` broker: COULD NOT ASK — ${broker.unavailableReason}`);\n } else if (broker.vhostExists === false) {\n ctx.log.info(` broker: no vhost named '${broker.vhost}' — nothing queued`);\n } else {\n ctx.log.info(` broker: vhost '${broker.vhost}' — ${broker.queueCount} queue(s), ${broker.queuedMessages} undelivered message(s)`);\n }\n\n ctx.log.info(chalk.dim(`\\n Not inspected by this probe: ${report.notInspected.join(', ')}.\\n`));\n return { success: true };\n } catch (error) {\n ctx.log.error(`Failed to inspect '${appSlug}': ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"deregister.command.js","sourceRoot":"","sources":["../../../../src/commands/local/deregister.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAA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GAAG,CAC7H,CAAC;gBACF,IAAI,QAAQ,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;oBACxC,0FAA0F;oBAC1F,qDAAqD;oBACrD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;gBAC5F,CAAC;YACH,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YAC7B,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBAC7B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACxE,CAAC;iBAAM,IAAI,MAAM,CAAC,WAAW,KAAK,KAAK,EAAE,CAAC;gBACxC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,MAAM,CAAC,KAAK,oBAAoB,CAAC,CAAC;YAC9E,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,KAAK,OAAO,MAAM,CAAC,UAAU,cAAc,MAAM,CAAC,cAAc,yBAAyB,CAAC,CAAC;YACrI,CAAC;YAED,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,OAAO,MAAM,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC1F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * `wildo local deregister` — withdraw this application from the platform (#1556).\n *\n * ## What it is for\n *\n * Registering an application has been a ONE-WAY DOOR. Its backend syncs a cron schedule at every\n * boot and nothing ever withdrew one, so an application that stops existing keeps being scheduled\n * forever. Measured on a live platform 2026-09-24: three dead scratch applications held 46 active\n * schedules, dispatched 2,100 executions a day at backends that were not listening, and had\n * accumulated 1,870 messages in queues nobody would ever drain.\n *\n * ## What it revokes (#1307)\n *\n * Every credential the platform minted for the application: the backend's and each minion's Redis ACL\n * user, RabbitMQ user, MongoDB user (self-hosted or Atlas, whichever the application declares) and\n * PostgreSQL login. Afterwards those servers refuse them. A withdrawal that cannot revoke one fails and\n * names what still authenticates; running it again retries.\n *\n * ## Why it needs no confirmation and no environment gate\n *\n * **It destroys no data.** The application's database, broker vhost, cache namespace and blobs are\n * exactly as they were — the backend's PostgreSQL role is disabled, not dropped, because it owns the\n * database. What goes is the SCHEDULE, derived state the application rebuilds from its own code at its\n * next boot, and the ability to authenticate. `wildo local restore` clears the mark and re-mints the\n * credentials with their recorded values; starting the application restores the schedule.\n *\n * Destroying an application's data is a different verb with different protection, and it is\n * deliberately parked (#1562). Nothing here may grow into it.\n */\nimport chalk from 'chalk';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport { AppRuntimeTargetsService } from '~wildo-cli/services/application/app-runtime-targets.service';\n\nexport default class LocalDeregisterCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'local deregister',\n description:\n 'Withdraw this application from the platform: removes its cron schedule, revokes its credentials and marks it. Destroys no data.',\n category: CommandCategory.Local,\n flags: {\n app: { type: 'string', description: 'Application slug (defaults to the single resolved app)', default: undefined },\n reason: { type: 'string', description: 'Why it is being withdrawn — recorded in the platform log', default: undefined },\n check: {\n type: 'boolean',\n description: 'Report what the platform still holds for this application and change nothing',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n ctx.log.error('`wildo local deregister` requires a targeted app root with wildo.saas.config.ts.');\n return { success: false };\n }\n\n const envName = ctx.activeEnv?.name;\n if (!envName) {\n ctx.log.error('No active environment. Run `wildo init` first.');\n return { success: false };\n }\n\n const env = EnvironmentRegistry.get(envName);\n if (!env) {\n ctx.log.error(`Environment '${envName}' not found. Run 'wildo init' first.`);\n return { success: false };\n }\n\n const credentials = EnvironmentUtils.loadSecretsJson(envName);\n if (!credentials) {\n ctx.log.error(`No secrets for '${envName}'. Run 'wildo init' first.`);\n return { success: false };\n }\n\n const requestedAppSlug = ctx.flags.app as string | undefined;\n const runtimeTarget = await AppRuntimeTargetsService.resolve(saasRoot, { environmentName: envName, requestedAppSlug });\n if (!runtimeTarget) {\n ctx.log.error(\n requestedAppSlug\n ? `Application '${requestedAppSlug}' not found under ${saasRoot}.`\n : `No application could be resolved from ${saasRoot}. Pass --app <slug> to disambiguate.`,\n );\n return { success: false };\n }\n\n const appSlug = runtimeTarget.appSlug;\n\n if (ctx.flags.check === true) {\n return await this.reportResidue(ctx, env, credentials, appSlug);\n }\n\n ctx.log.info(chalk.cyan(`\\n Withdrawing '${appSlug}' from the '${envName}' platform (no data is destroyed)...\\n`));\n\n try {\n const result = await AppBootstrapService.deregisterApplication(env, credentials, {\n appSlug,\n reason: ctx.flags.reason as string | undefined,\n });\n\n if (result.alreadyDeregistered) {\n ctx.log.info(` '${appSlug}' was already withdrawn; its schedule was re-checked.`);\n }\n ctx.log.success(\n ` Withdrew ${result.withdrawnJobs} schedule(s) and ${result.deletedExecutions} execution record(s) for '${appSlug}'.`,\n );\n ctx.log.success(` Revoked ${result.revokedCredentials.length} credential(s):`);\n for (const entry of result.revokedCredentials) {\n ctx.log.info(` - ${entry.principalKey}${entry.service ? ` / ${entry.service}` : ''}`);\n }\n // #2303 slice D: credentials on a broker the platform no longer runs. Not revoked, and not a failure: named.\n for (const entry of result.unreachableCredentials ?? []) {\n ctx.log.warn(` Not revoked: ${entry.principalKey}${entry.service ? ` / ${entry.service}` : ''}: ${entry.reason}`);\n }\n ctx.log.info(\n chalk.dim(\n ' Its database, broker vhost and cache namespace are untouched.\\n'\n + ' `wildo local restore` re-mints its credentials and returns it to service; its next boot re-establishes the schedule.\\n',\n ),\n );\n return { success: true };\n } catch (error) {\n ctx.log.error(`Failed to withdraw '${appSlug}': ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n\n /**\n * `--check`: what the platform still holds for this application, changing nothing (#1556).\n *\n * It is a dry run BEFORE a withdrawal and the residue probe AFTER one, which is why it lives on\n * this verb rather than in a command of its own.\n *\n * Every number is printed beside the reason it can be believed. Two empty results nearly passed\n * for success while this lane was built — `rabbitmqctl list_queues` defaults to vhost `/`, so it\n * shows nothing for an application whose queues live in its own vhost, and a Valkey scan was\n * answering `NOAUTH` rather than \"no keys\". So \"could not ask\" is rendered as its own outcome and\n * never as a zero, and the stores this probe does not inspect are NAMED rather than omitted.\n */\n private async reportResidue(\n ctx: CommandContext,\n env: Parameters<typeof AppBootstrapService.inspectApplicationResidue>[0],\n credentials: Parameters<typeof AppBootstrapService.inspectApplicationResidue>[1],\n appSlug: string,\n ): Promise<CommandResult> {\n try {\n const report = await AppBootstrapService.inspectApplicationResidue(env, credentials, { appSlug });\n\n ctx.log.info(chalk.cyan(`\\n What the platform still holds for '${appSlug}'\\n`));\n ctx.log.info(` status: ${report.status}${report.deregisteredAt ? ` (withdrawn ${report.deregisteredAt})` : ''}`);\n\n const schedule = report.schedule;\n if (schedule.unavailableReason) {\n ctx.log.warn(` schedules: COULD NOT ASK — ${schedule.unavailableReason}`);\n } else {\n ctx.log.info(\n ` schedules: ${schedule.scheduledForApplication} for this application`\n + ` (platform total ${schedule.platformScheduledTotal}, scheduler ${schedule.schedulerRunning ? 'running' : 'NOT running'})`,\n );\n if (schedule.schedulerRunning === false) {\n // Without this the reader takes a zero as proof. A standby replica arms nothing and would\n // report zero for every application on the platform.\n ctx.log.warn(' the scheduler is not arming jobs, so a count of 0 proves nothing here');\n }\n }\n\n const broker = report.broker;\n if (broker.unavailableReason) {\n ctx.log.warn(` broker: COULD NOT ASK — ${broker.unavailableReason}`);\n } else if (broker.vhostExists === false) {\n ctx.log.info(` broker: no vhost named '${broker.vhost}' — nothing queued`);\n } else {\n ctx.log.info(` broker: vhost '${broker.vhost}' — ${broker.queueCount} queue(s), ${broker.queuedMessages} undelivered message(s)`);\n }\n\n ctx.log.info(chalk.dim(`\\n Not inspected by this probe: ${report.notInspected.join(', ')}.\\n`));\n return { success: true };\n } catch (error) {\n ctx.log.error(`Failed to inspect '${appSlug}': ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n}\n"]}
@@ -72,6 +72,18 @@
72
72
  * It is what the live-stack e2e lanes boot after CI has built every dist: on a 2-vCPU hosted runner the development
73
73
  * fleet ran it out of memory, and on the QA VM it spent the first minutes recompiling what CI had just built.
74
74
  *
75
+ * # `--built-framework`: the application in development, the framework from its dists (#3961)
76
+ *
77
+ * Between the two: the application tree runs exactly as a developer's does (its watchers, companion, dev servers), and
78
+ * the framework tree starts no compiler. The root `pnpm dev` still runs, and its compile-status writer
79
+ * (`scripts/dev-orchestrator/dev-compile-status.mjs`) publishes every framework package from a validation of its BUILT
80
+ * dist, with the same file, lease and heartbeat, so the application runtimes' readiness gate keeps its meaning instead
81
+ * of being switched off. A dist that is missing, behind its source or unfinalized is published as not ready, and the
82
+ * runtimes that need it stay paused. The switch reaches both writers a stack can start, the root tree's and the one an
83
+ * application's `sync-engine.sh` starts when none is live (a hosted application), through one environment variable.
84
+ * For a run that uses the framework without editing it, after a full build: the finalization verifier, where the
85
+ * framework's thirty compilers held most of the QA VM's memory.
86
+ *
75
87
  * # Output
76
88
  *
77
89
  * All combined stdout/stderr is tee'd to
@@ -142,6 +154,38 @@ export declare function servedTreeCommand(input: {
142
154
  readonly appRoot?: string;
143
155
  readonly frontendPaths?: readonly string[];
144
156
  }): LocalDevTreeCommand;
157
+ /**
158
+ * How the framework tree's compile status is produced. The values are `dev-compile-status.mjs`'s `--compile-mode`
159
+ * vocabulary (`FrameworkCompileMode` in `scripts/dev-orchestrator/dist-backed-compile-status.mjs`); a test holds the
160
+ * two to the same members.
161
+ */
162
+ export declare enum FrameworkCompileMode {
163
+ /** The default: one `tsc --watch` per framework package. */
164
+ WATCH = "watch",
165
+ /** No compiler: each framework package published from a validation of its built dist (`--built-framework`, #3961). */
166
+ DIST_BACKED = "dist-backed"
167
+ }
168
+ /**
169
+ * The environment variable that carries the mode to every compile-status writer the stack starts — the root `pnpm dev`
170
+ * tree's and the one an application's `sync-engine.sh` starts. A copy of `FRAMEWORK_COMPILE_MODE_ENV` in the script
171
+ * module; the same test pins it.
172
+ */
173
+ export declare const FRAMEWORK_COMPILE_MODE_ENV_VAR = "WILDO_DEV_FRAMEWORK_COMPILE_MODE";
174
+ /** The module that owns the mode vocabulary, relative to the framework checkout. */
175
+ export declare const DIST_BACKED_COMPILE_STATUS_SCRIPT_PATH = "scripts/dev-orchestrator/dist-backed-compile-status.mjs";
176
+ /**
177
+ * Why a `--built-framework` request cannot be honoured, or `null` when it can.
178
+ *
179
+ * Framework-developer mode only: an application creator's engine is the published packages and its platform the
180
+ * published containers, so there is no framework compile fleet to leave out. And not with `--serve-built`, which
181
+ * already starts no compiler in either tree.
182
+ */
183
+ export declare function refuseBuiltFrameworkRequest(input: {
184
+ readonly builtFramework: boolean;
185
+ readonly serveBuilt: boolean;
186
+ readonly frameworkPath: string | null | undefined;
187
+ readonly isFrameworkDeveloper: boolean;
188
+ }): string | null;
145
189
  /**
146
190
  * Why a `--serve-built` / `--serve-frontend` request cannot be honoured, or `null` when it can.
147
191
  *
@@ -214,6 +258,12 @@ export default class LocalDevCommand extends BaseCommand {
214
258
  */
215
259
  private interactiveFrontendPaths;
216
260
  private spawnTree;
261
+ /**
262
+ * The dev process of a workspace member that joined while the stack runs (#3986), as `pnpm -r run dev` would have
263
+ * started it. It does not decide the stack's lifetime: a member whose `dev` exits is reported by the diagnostics, like
264
+ * any other one under `--no-bail`, and the rest keeps running.
265
+ */
266
+ private spawnLateWorkspaceMember;
217
267
  private spawnDiagnosticsObserver;
218
268
  /**
219
269
  * Keep every local double the environment's `providerEnv` points a provider at served for as long as this stack runs
@@ -1 +1 @@
1
- {"version":3,"file":"dev.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/dev.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AAMH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAoE1F,uGAAuG;AACvG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,8GAA8G;AAC9G,eAAO,MAAM,wBAAwB,EAAE,mBAAwD,CAAC;AAEhG;;;GAGG;AACH,oBAAY,cAAc;IACxB,wEAAwE;IACxE,QAAQ,aAAa;IACrB,6HAA6H;IAC7H,GAAG,QAAQ;CACZ;AAED,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,iDAAiD,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B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,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CACxC,GAAG,MAAM,GAAG,IAAI,CAYhB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CACxC,GAAG,MAAM,GAAG,IAAI,CAWhB;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAyCxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IA6sBtD;;;;;;;;;;;OAWG;YACW,8BAA8B;IAsB5C;;;;;;;;;;;;;;;;;;;;OAoBG;YACW,wBAAwB;IAqCtC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,0BAA0B;IAqClC;;;OAGG;YACW,wBAAwB;IAOtC,OAAO,CAAC,SAAS;IAyBjB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAehC,OAAO,CAAC,wBAAwB;IA0BhC;;;;;OAKG;YACW,yBAAyB;IAqEvC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,YAAY;IA+EpB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,oBAAoB;CAqB7B"}
@@ -72,6 +72,18 @@
72
72
  * It is what the live-stack e2e lanes boot after CI has built every dist: on a 2-vCPU hosted runner the development
73
73
  * fleet ran it out of memory, and on the QA VM it spent the first minutes recompiling what CI had just built.
74
74
  *
75
+ * # `--built-framework`: the application in development, the framework from its dists (#3961)
76
+ *
77
+ * Between the two: the application tree runs exactly as a developer's does (its watchers, companion, dev servers), and
78
+ * the framework tree starts no compiler. The root `pnpm dev` still runs, and its compile-status writer
79
+ * (`scripts/dev-orchestrator/dev-compile-status.mjs`) publishes every framework package from a validation of its BUILT
80
+ * dist, with the same file, lease and heartbeat, so the application runtimes' readiness gate keeps its meaning instead
81
+ * of being switched off. A dist that is missing, behind its source or unfinalized is published as not ready, and the
82
+ * runtimes that need it stay paused. The switch reaches both writers a stack can start, the root tree's and the one an
83
+ * application's `sync-engine.sh` starts when none is live (a hosted application), through one environment variable.
84
+ * For a run that uses the framework without editing it, after a full build: the finalization verifier, where the
85
+ * framework's thirty compilers held most of the QA VM's memory.
86
+ *
75
87
  * # Output
76
88
  *
77
89
  * All combined stdout/stderr is tee'd to
@@ -139,6 +151,7 @@ import { createLocalDevObserverLifecycle } from '../../services/deployment/local
139
151
  import { isLoopbackPortAnswering, LocalProviderDoubleEvent, planLocalProviderDoubles, resolveLocalProviderDoubleLaunch, superviseLocalProviderDouble, } from '../../services/application/local-provider-doubles.service.js';
140
152
  import { EnvironmentProviderEnvReadingKind, readEnvironmentProviderEnv } from '../../services/application/content-guardrail-classifier.service.js';
141
153
  import { LOCAL_DEV_LOG_RETENTION_DAYS, retainLocalDevLogs } from '../../services/deployment/local-dev-log-retention.service.js';
154
+ import { LATE_WORKSPACE_MEMBER_POLL_MS, createWorkspaceReconciler, initialDeclarationState, initialLateWorkspaceMemberState, syncProviderRuntimeArtifactsInChild, } from '../../services/deployment/local-dev-late-workspace-members.service.js';
142
155
  import { LocalDevOutputFlowController, LocalDevOutputBoundary, LocalDevOutputSink, LocalDevOutputStream, resolveLocalDevConsoleRendering, } from '../../services/deployment/local-dev-output-boundary.js';
143
156
  /**
144
157
  * Shared prefix for the two shutdown causes raised by a lost session lease —
@@ -179,6 +192,45 @@ export function servedTreeCommand(input) {
179
192
  }
180
193
  return { command: process.execPath, args };
181
194
  }
195
+ /**
196
+ * How the framework tree's compile status is produced. The values are `dev-compile-status.mjs`'s `--compile-mode`
197
+ * vocabulary (`FrameworkCompileMode` in `scripts/dev-orchestrator/dist-backed-compile-status.mjs`); a test holds the
198
+ * two to the same members.
199
+ */
200
+ export var FrameworkCompileMode;
201
+ (function (FrameworkCompileMode) {
202
+ /** The default: one `tsc --watch` per framework package. */
203
+ FrameworkCompileMode["WATCH"] = "watch";
204
+ /** No compiler: each framework package published from a validation of its built dist (`--built-framework`, #3961). */
205
+ FrameworkCompileMode["DIST_BACKED"] = "dist-backed";
206
+ })(FrameworkCompileMode || (FrameworkCompileMode = {}));
207
+ /**
208
+ * The environment variable that carries the mode to every compile-status writer the stack starts — the root `pnpm dev`
209
+ * tree's and the one an application's `sync-engine.sh` starts. A copy of `FRAMEWORK_COMPILE_MODE_ENV` in the script
210
+ * module; the same test pins it.
211
+ */
212
+ export const FRAMEWORK_COMPILE_MODE_ENV_VAR = 'WILDO_DEV_FRAMEWORK_COMPILE_MODE';
213
+ /** The module that owns the mode vocabulary, relative to the framework checkout. */
214
+ export const DIST_BACKED_COMPILE_STATUS_SCRIPT_PATH = 'scripts/dev-orchestrator/dist-backed-compile-status.mjs';
215
+ /**
216
+ * Why a `--built-framework` request cannot be honoured, or `null` when it can.
217
+ *
218
+ * Framework-developer mode only: an application creator's engine is the published packages and its platform the
219
+ * published containers, so there is no framework compile fleet to leave out. And not with `--serve-built`, which
220
+ * already starts no compiler in either tree.
221
+ */
222
+ export function refuseBuiltFrameworkRequest(input) {
223
+ if (!input.builtFramework)
224
+ return null;
225
+ if (input.serveBuilt) {
226
+ return '--built-framework does not combine with --serve-built: --serve-built already runs both trees from their dists, with no compiler at all.';
227
+ }
228
+ if (!input.frameworkPath || !input.isFrameworkDeveloper) {
229
+ return ('--built-framework needs a framework checkout in framework-developer mode: it publishes the checkout\'s framework packages ' +
230
+ 'from their built dists instead of compiling them. An application-creator stack compiles no framework package to begin with.');
231
+ }
232
+ return null;
233
+ }
182
234
  /**
183
235
  * Why a `--serve-built` / `--serve-frontend` request cannot be honoured, or `null` when it can.
184
236
  *
@@ -230,6 +282,11 @@ export default class LocalDevCommand extends BaseCommand {
230
282
  description: 'With --serve-built, also run the interactive frontend\'s Vite server, for scenarios that drive the browser.',
231
283
  default: false,
232
284
  },
285
+ 'built-framework': {
286
+ type: 'boolean',
287
+ description: 'Run the application in development against the BUILT framework: no framework compile watcher starts, and each framework package is published as compiled only once its dist is validated (present, current, finalized). For a run that does not edit the framework, after a full build (framework-dev mode only).',
288
+ default: false,
289
+ },
233
290
  },
234
291
  };
235
292
  async run(ctx) {
@@ -281,6 +338,18 @@ export default class LocalDevCommand extends BaseCommand {
281
338
  ctx.log.error(` ${servedStackRefusal}`);
282
339
  return { success: false };
283
340
  }
341
+ const builtFramework = ctx.flags.builtFramework === true || ctx.flags['built-framework'] === true;
342
+ const builtFrameworkRefusal = refuseBuiltFrameworkRequest({ builtFramework, serveBuilt, frameworkPath, isFrameworkDeveloper });
343
+ if (builtFrameworkRefusal) {
344
+ ctx.log.error(` ${builtFrameworkRefusal}`);
345
+ return { success: false };
346
+ }
347
+ /*
348
+ * The flag decides the mode for every compile-status writer this stack starts, in either tree, so it is written
349
+ * either way: a value left in the operator's shell must not turn a plain `wildo local dev` into one with no
350
+ * framework compiler (or the reverse).
351
+ */
352
+ process.env[FRAMEWORK_COMPILE_MODE_ENV_VAR] = builtFramework ? FrameworkCompileMode.DIST_BACKED : FrameworkCompileMode.WATCH;
284
353
  /*
285
354
  * Whose infrastructure is this? Read from the AUTHORED descriptor, before any generated artifact is
286
355
  * reconciled — a hosted application must never start the platform or converge the shared containers,
@@ -304,6 +373,8 @@ export default class LocalDevCommand extends BaseCommand {
304
373
  // its interval would otherwise outlive an early return and hold the
305
374
  // event loop open.
306
375
  let backingServiceHealthWatch = null;
376
+ // Starts the dev process of a workspace member that joins while the stack runs (#3986).
377
+ let lateWorkspaceMemberWatch = null;
307
378
  let sigintHandler = null;
308
379
  let sigtermHandler = null;
309
380
  if (!killOnly) {
@@ -575,7 +646,9 @@ export default class LocalDevCommand extends BaseCommand {
575
646
  }
576
647
  ctx.log.info(chalk.cyan(serveBuilt
577
648
  ? ' Serving the built platform services (no compile watchers)...\n'
578
- : ' Starting platform stack (apps-manager + crontabs-batches-manager + module-registry)...\n'));
649
+ : builtFramework
650
+ ? ' Starting platform stack against the built framework (no framework compile watchers; each dist validated)...\n'
651
+ : ' Starting platform stack (apps-manager + crontabs-batches-manager + module-registry)...\n'));
579
652
  children.push(this.spawnTree('platform', frameworkPath, serveBuilt ? servedTreeCommand({ frameworkRoot: frameworkPath, tree: ServedTreeKind.PLATFORM }) : DEVELOPMENT_TREE_COMMAND, logStream, chalk.blue, consoleRendering));
580
653
  }
581
654
  else if (frameworkPath && isFrameworkDeveloper) {
@@ -604,6 +677,8 @@ export default class LocalDevCommand extends BaseCommand {
604
677
  for (const supervisor of providerDoubleSupervisors)
605
678
  supervisor.stop();
606
679
  backingServiceHealthWatch?.stop();
680
+ if (lateWorkspaceMemberWatch !== null)
681
+ clearInterval(lateWorkspaceMemberWatch);
607
682
  // Name the TRIGGER, not the signal forwarded to the children. Every
608
683
  // teardown used to announce itself as "Received SIGTERM", so a stack
609
684
  // that stopped itself was indistinguishable from one another process
@@ -819,6 +894,58 @@ export default class LocalDevCommand extends BaseCommand {
819
894
  ctx.log.info(chalk.cyan(` Starting app stack from ${chalk.dim(saasRoot)}...\n`));
820
895
  }
821
896
  children.push(this.spawnTree('app', saasRoot, appTreeCommand, logStream, chalk.green, consoleRendering));
897
+ if (appTreeCommand === DEVELOPMENT_TREE_COMMAND) {
898
+ /*
899
+ * The workspace and the declared topology as they change WHILE the stack runs (#3985, #3986). `pnpm dev` starts each
900
+ * member's `dev` script once, and every runtime's `.env` was written once, above. An install that adds a member
901
+ * (`wildo registry add`, a composed website or minion) or an edit that declares a service would otherwise reach no
902
+ * process until the stack restarts, and the next runtime to start refuses the configuration. One ordered pass per
903
+ * tick, never two at once, and nothing while an install is running: first the env files, then the new members, so a
904
+ * member that is also a service starts on a `.env` that knows it.
905
+ */
906
+ const reconciler = createWorkspaceReconciler({
907
+ appRoot: saasRoot,
908
+ canRegenerate: Boolean(frameworkPath),
909
+ regenerate: async () => {
910
+ if (!frameworkPath)
911
+ return;
912
+ ctx.log.info(chalk.cyan(' wildo.saas.config.ts changed; regenerating the provider runtime artifacts and every runtime\'s env files...'));
913
+ // The provider artifacts first (they are what a runtime's providers are read from), in a child process that
914
+ // reads the declaration as it is now, then the env files through the startup bootstrap.
915
+ await syncProviderRuntimeArtifactsInChild(saasRoot, env.name);
916
+ const credentials = EnvironmentUtils.loadSecretsJson(env.name);
917
+ if (!credentials)
918
+ throw new Error(`No secrets for '${env.name}'. Run 'wildo setup' first.`);
919
+ await ApplicationRuntimeBootstrapService.initialize({ env, credentials, frameworkPath, saasRoot, isFrameworkDeveloper, log: ctx.log });
920
+ },
921
+ startMember: (member) => {
922
+ ctx.log.info(chalk.cyan(` ${member.name} joined the workspace (${member.directory}); starting its dev process.`));
923
+ const tree = this.spawnLateWorkspaceMember(saasRoot, member, logStream, consoleRendering);
924
+ children.push(tree);
925
+ // An exited member leaves the list, so shutdown never signals a reused pid.
926
+ void tree.exit.then(() => {
927
+ const index = children.indexOf(tree);
928
+ if (index >= 0)
929
+ children.splice(index, 1);
930
+ });
931
+ },
932
+ isStopping: () => shuttingDown,
933
+ reportRegenerationFailure: (error) => ctx.log.warn(` Could not regenerate the runtimes' env files: ${ErrorUtils.extractErrorMessage(error)}. A runtime that joined starts once `
934
+ + 'they are (a provider package or library does not wait); retrying in a minute, or as soon as a member that joined has '
935
+ + 'compiled. Restarting `wildo local dev` also regenerates them.'),
936
+ initial: { declaration: await initialDeclarationState(saasRoot), members: initialLateWorkspaceMemberState(saasRoot) },
937
+ });
938
+ const reconcileWorkspace = async () => {
939
+ try {
940
+ await reconciler.reconcile();
941
+ }
942
+ catch (error) {
943
+ ctx.log.warn(` Could not reconcile the workspace with the running stack: ${ErrorUtils.extractErrorMessage(error)}`);
944
+ }
945
+ };
946
+ lateWorkspaceMemberWatch = setInterval(() => void reconcileWorkspace(), LATE_WORKSPACE_MEMBER_POLL_MS);
947
+ lateWorkspaceMemberWatch.unref();
948
+ }
822
949
  // ─── Step 8: wait for any child to exit, then propagate exit ──────
823
950
  const exitCode = await Promise.race(children.filter((tree) => tree.affectsStackLifetime).map((tree) => tree.exit));
824
951
  await shutdown('SIGTERM', {
@@ -836,6 +963,8 @@ export default class LocalDevCommand extends BaseCommand {
836
963
  // event loop open and `wildo local dev` would hang instead of exiting.
837
964
  // `stop()` is idempotent, so both firing is free.
838
965
  backingServiceHealthWatch?.stop();
966
+ if (lateWorkspaceMemberWatch !== null)
967
+ clearInterval(lateWorkspaceMemberWatch);
839
968
  if (sigintHandler)
840
969
  process.removeListener('SIGINT', sigintHandler);
841
970
  if (sigtermHandler)
@@ -1003,6 +1132,20 @@ export default class LocalDevCommand extends BaseCommand {
1003
1132
  affectsStackLifetime: true,
1004
1133
  });
1005
1134
  }
1135
+ /**
1136
+ * The dev process of a workspace member that joined while the stack runs (#3986), as `pnpm -r run dev` would have
1137
+ * started it. It does not decide the stack's lifetime: a member whose `dev` exits is reported by the diagnostics, like
1138
+ * any other one under `--no-bail`, and the rest keeps running.
1139
+ */
1140
+ spawnLateWorkspaceMember(saasRoot, member, logStream, consoleRendering) {
1141
+ const child = spawn('pnpm', ['--filter', member.name, 'run', 'dev'], {
1142
+ cwd: saasRoot,
1143
+ env: { ...process.env, FORCE_COLOR: '1' },
1144
+ stdio: ['ignore', 'pipe', 'pipe'],
1145
+ detached: SpawnUtils.shouldUseProcessGroups(),
1146
+ });
1147
+ return this.observeChild({ label: `app:${member.directory}`, child, logStream, color: chalk.green, consoleRendering, affectsStackLifetime: false });
1148
+ }
1006
1149
  spawnDiagnosticsObserver(frameworkRoot, appRoot, logStream, consoleRendering) {
1007
1150
  const scriptPath = join(frameworkRoot, 'scripts/dev-orchestrator/local-dev-status.mjs');
1008
1151
  if (!existsSync(scriptPath)) {