@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
@@ -2,7 +2,7 @@ import { devCompanionRuntimeEndpointKey } from '../../services/environment/platf
2
2
  import { existsSync, readFileSync } from 'fs';
3
3
  import { isAbsolute, join, relative, resolve } from 'path';
4
4
  import { WildoHeaderKeys } from '@wildo-ai/saas-models';
5
- import { buildAppBootstrapCredentialsResponse, APPS_MANAGER_ADMIN_SECRET_HEADER, APPS_MANAGER_API_PREFIX, AppFrontendType, PlatformDocumentationSiteEnvKeys, ApplicationCreationVerificationEnvKey, AdminAppInitializeRequestSchema, AdminAppInitializeResponseSchema, AdminAppReapplyDeclarationRequestSchema, AdminAppReapplyDeclarationResponseSchema, buildRegistryKeyRevokePath, buildAdminKeyringRotationPath, buildAdminApplicationSigningKeyRotationPath, buildAdminApplicationSigningKeysPath, buildAdminApplicationSigningKeyPromotePath, buildAdminApplicationSigningKeyStagePath, ApplicationSigningKeyPromoteRequestSchema, ApplicationSigningKeyStageRequestSchema, ApplicationSigningKeyRotationRequestSchema, ApplicationSigningKeyRotationResponseSchema, ApplicationSigningKeysStatusSchema, buildAdminApplicationLegacyEnvelopeKeyPath, buildAdminApplicationLegacyEnvelopeKeyRestorePath, buildAdminApplicationLegacyEnvelopeKeyRetirePath, ApplicationLegacyEnvelopeKeyResponseSchema, ApplicationLegacyEnvelopeKeyRestoreRequestSchema, ApplicationLegacyEnvelopeKeyRetirementRequestSchema, ApplicationLegacyEnvelopeKeyStatusSchema, KeyringRotationRequestSchema, KeyringRotationResponseSchema, REGISTRY_KEYS_ADMIN_PATH, RegistryKeyListResponseSchema, RegistryKeyMintRequestSchema, RegistryKeyMintResponseSchema, RegistryKeyRevokeRequestSchema, AppBootstrapCredentialsResponseSchema, buildAdminInitializeApplicationPath, buildAdminReapplyDeclarationPath, buildAdminDeregisterApplicationPath, buildAdminApplicationResiduePath, buildAdminRestoreApplicationPath, buildAppBootstrapCredentialsPath, buildLocalhostApplicationRuntimeEndpoints, selectPrimaryBackendService, buildK8sApplicationRuntimeEndpoints, buildComposeApplicationRuntimeEndpoints, buildK8sApplicationIngressRoutes, buildK8sInternalUrl, APP_RUNTIME_SUBDIR_NAMES, loadConfig, resolveAppLayout, WildoDeploymentRuntime, WildoLocationType, WORKSPACE_HOME_NAMES, WORKER_CONFIG_FILENAME, MINION_CONFIG_FILENAME, WildoWorkerConfigSchema, WildoMinionConfigSchema, ApplicationRuntimePrincipalKind, buildMinionRedisKeyPrefix, registerMinionLocalProviders, buildRuntimePrincipalKey, DEVELOPMENT_COMPANION_PRINCIPAL, enumerateRuntimePrincipalsWithBootstrapSecrets, runtimeEnvironmentHostsDevelopmentCompanion, DatabaseEngine, resolveApplicationDatabaseEngine, AppDatabaseSeedingPhase, AppDatabaseSeedingOutcome, } from '@wildo-ai/platform-config-lib';
5
+ import { buildAppBootstrapCredentialsResponse, APPS_MANAGER_ADMIN_SECRET_HEADER, APPS_MANAGER_API_PREFIX, AppFrontendType, PlatformDocumentationSiteEnvKeys, ApplicationCreationVerificationEnvKey, AdminAppInitializeRequestSchema, AdminAppInitializeResponseSchema, AdminAppReapplyDeclarationRequestSchema, AdminAppReapplyDeclarationResponseSchema, buildRegistryKeyRevokePath, buildAdminKeyringRotationPath, buildAdminApplicationSigningKeyRotationPath, buildAdminApplicationSigningKeysPath, buildAdminApplicationSigningKeyPromotePath, buildAdminApplicationSigningKeyStagePath, ApplicationSigningKeyPromoteRequestSchema, ApplicationSigningKeyStageRequestSchema, ApplicationSigningKeyRotationRequestSchema, ApplicationSigningKeyRotationResponseSchema, ApplicationSigningKeysStatusSchema, buildAdminApplicationLegacyEnvelopeKeyPath, buildAdminApplicationLegacyEnvelopeKeyRestorePath, buildAdminApplicationLegacyEnvelopeKeyRetirePath, ApplicationLegacyEnvelopeKeyResponseSchema, ApplicationLegacyEnvelopeKeyRestoreRequestSchema, ApplicationLegacyEnvelopeKeyRetirementRequestSchema, ApplicationLegacyEnvelopeKeyStatusSchema, KeyringRotationRequestSchema, KeyringRotationResponseSchema, REGISTRY_KEYS_ADMIN_PATH, RegistryKeyListResponseSchema, RegistryKeyMintRequestSchema, RegistryKeyMintResponseSchema, RegistryKeyRevokeRequestSchema, AppBootstrapCredentialsResponseSchema, buildAdminInitializeApplicationPath, buildAdminReapplyDeclarationPath, buildAdminDeregisterApplicationPath, buildAdminApplicationResiduePath, buildAdminApplicationScheduledJobsPath, buildAdminApplicationScheduledJobRunPath, ApplicationScheduledJobsResponseSchema, ApplicationScheduledJobRunRequestSchema, ApplicationScheduledJobRunResponseSchema, buildAdminRestoreApplicationPath, buildAppBootstrapCredentialsPath, buildLocalhostApplicationRuntimeEndpoints, selectPrimaryBackendService, buildK8sApplicationRuntimeEndpoints, buildComposeApplicationRuntimeEndpoints, buildK8sApplicationIngressRoutes, buildK8sInternalUrl, APP_RUNTIME_SUBDIR_NAMES, ConfigModuleResolution, loadConfig, resolveAppLayout, WildoDeploymentRuntime, WildoLocationType, WORKSPACE_HOME_NAMES, WORKER_CONFIG_FILENAME, MINION_CONFIG_FILENAME, WildoWorkerConfigSchema, WildoMinionConfigSchema, ApplicationRuntimePrincipalKind, buildMinionRedisKeyPrefix, registerMinionLocalProviders, buildRuntimePrincipalKey, DEVELOPMENT_COMPANION_PRINCIPAL, enumerateRuntimePrincipalsWithBootstrapSecrets, runtimeEnvironmentHostsDevelopmentCompanion, DatabaseEngine, resolveApplicationDatabaseEngine, AppDatabaseSeedingPhase, AppDatabaseSeedingOutcome, } from '@wildo-ai/platform-config-lib';
6
6
  import { buildWorkerInternalUrl, buildWorkerLocalUrl } from '@wildo-ai/platform-core-shared';
7
7
  import { resolveApplicationBackingServiceAddressing } from '../../services/environment/application-backing-service-addressing.utils.js';
8
8
  import { ApplicationOperatorEnvFileDisposition } from '../../services/environment/env-configuration-generator.service.js';
@@ -12,6 +12,7 @@ import { ErrorUtils } from '../../infrastructure/errors/error.utils.js';
12
12
  import { EnvironmentUtils } from '../../services/environment/environment.service.js';
13
13
  import { AppRuntimeTargetsService } from './app-runtime-targets.service.js';
14
14
  import { applyAppSchemaMigrations, resolveAppMigrationsDirectory } from './app-schema-bootstrap.service.js';
15
+ import { applyTunnelToRuntimeEndpoints, readLiveApplicationTunnel } from './local-tunnel.service.js';
15
16
  /**
16
17
  * Budget for a LIGHT apps-manager call — a read, or an idempotent config re-source.
17
18
  *
@@ -218,6 +219,19 @@ async function readErrorBody(response) {
218
219
  return '';
219
220
  }
220
221
  }
222
+ /**
223
+ * How the env projection evaluates `wildo.saas.config.ts` and each minion's and worker's own configuration: FRESH (see
224
+ * `AppBootstrapService.readAuthoredConfig`) and against the CLI's own built framework packages
225
+ * ({@link ConfigModuleResolution.LOADER_INSTANCES}, #3440).
226
+ *
227
+ * These reads ask only what the files DECLARE (runtimes, their paths, access, provider scopes, isolation, liveness), the
228
+ * question the compose render asks of the same files with the same mode (#3646). A fresh read in the loader's inferred
229
+ * mode re-evaluates the framework from SOURCE every time: measured 2026-11-18 on Wonder Todos, 1.1–1.3 s per read,
230
+ * which for an application with five minions and a worker is about ten seconds added to every regeneration; with this
231
+ * mode the same fresh read took 2–23 ms. These files import framework packages and, at most, an application's role
232
+ * enums; none defines a zod schema of its own, so the decorated-zod caveat of that mode does not arise.
233
+ */
234
+ const RUNTIME_DECLARATION_EVALUATION = { moduleResolution: ConfigModuleResolution.LOADER_INSTANCES };
221
235
  export class AppBootstrapService {
222
236
  /**
223
237
  * Service keys (`config.services.<key>`) of the app's frontends that are
@@ -245,6 +259,27 @@ export class AppBootstrapService {
245
259
  .filter(([, cdnConfig]) => cdnConfig.enabled)
246
260
  .map(([serviceKey]) => serviceKey));
247
261
  }
262
+ /**
263
+ * The runtime endpoints, and the same endpoints with a live local tunnel applied (#3907). Only a LOCAL environment can
264
+ * have a tunnel; a state file whose process is not running is ignored and named, so a crash or a reboot never leaves a
265
+ * dead issuer advertised. See `local-tunnel.service.ts`.
266
+ */
267
+ static buildRuntimeEndpointsWithTunnel(runtimeTarget, env) {
268
+ const base = AppBootstrapService.buildRuntimeEndpoints(runtimeTarget, env);
269
+ if (env.locationType === WildoLocationType.REMOTE)
270
+ return { runtimeEndpoints: base, companionRuntimeEndpoints: base };
271
+ const { live, staleReason } = readLiveApplicationTunnel(runtimeTarget.appRoot);
272
+ if (staleReason) {
273
+ // eslint-disable-next-line no-console
274
+ console.warn(` ! The local tunnel state is ignored: ${staleReason}. Run \`wildo local tunnel up\` or \`wildo local tunnel down\`.`);
275
+ }
276
+ const applied = applyTunnelToRuntimeEndpoints(base, live);
277
+ if (applied.skipped) {
278
+ // eslint-disable-next-line no-console
279
+ console.warn(` ! The local tunnel is not applied: ${applied.skipped}.`);
280
+ }
281
+ return { runtimeEndpoints: applied.endpoints, companionRuntimeEndpoints: base };
282
+ }
248
283
  static buildRuntimeEndpoints(runtimeTarget, env) {
249
284
  const primaryBackend = selectPrimaryBackendService(runtimeTarget.backendServices);
250
285
  const primaryBackendPort = primaryBackend?.defaultPort;
@@ -528,7 +563,7 @@ export class AppBootstrapService {
528
563
  * principal whose own secret is not on disk THROWS, naming itself.
529
564
  */
530
565
  static async reconstructRuntimePrincipalCredentialsOffline(input) {
531
- const saasConfig = await loadConfig(input.runtimeTarget.saasConfigPath);
566
+ const saasConfig = await AppBootstrapService.readAuthoredConfig(input.runtimeTarget.saasConfigPath, RUNTIME_DECLARATION_EVALUATION);
532
567
  const entries = [];
533
568
  const unresolved = [];
534
569
  for (const principal of enumerateRuntimePrincipalsWithBootstrapSecrets(input.runtimeTarget.managedDeclaration, {
@@ -782,7 +817,7 @@ export class AppBootstrapService {
782
817
  degraded,
783
818
  declarationConvergedFields,
784
819
  bootstrapCredentials: bootstrapResponse.credentials,
785
- runtimeEndpoints: AppBootstrapService.buildRuntimeEndpoints(runtimeTarget, input.env),
820
+ ...AppBootstrapService.buildRuntimeEndpointsWithTunnel(runtimeTarget, input.env),
786
821
  runtimeEnvironment,
787
822
  runtimePrincipalCredentials,
788
823
  unresolvedPrincipals,
@@ -819,7 +854,7 @@ export class AppBootstrapService {
819
854
  if (!backendConfigPath || !existsSync(backendConfigPath)) {
820
855
  throw new Error(`Application '${runtimeTarget.appSlug}' declares bootstrap.firstAdmin.userTypes, but the authoritative backend config was not found at '${backendConfigPath ?? 'unknown'}' for service '${authoritativeBackend.serviceName}'.`);
821
856
  }
822
- const backendConfig = await loadConfig(backendConfigPath);
857
+ const backendConfig = await AppBootstrapService.readAuthoredConfig(backendConfigPath);
823
858
  const declaredBackendUserTypes = new Set(Object.keys(backendConfig.userTypes ?? {}));
824
859
  const unknownUserTypes = projectedUserTypes.filter((userType) => !declaredBackendUserTypes.has(userType));
825
860
  if (unknownUserTypes.length > 0) {
@@ -1229,6 +1264,29 @@ export class AppBootstrapService {
1229
1264
  static async inspectApplicationResidue(env, credentials, input) {
1230
1265
  return await AppBootstrapService.requestJson(env, credentials, buildAdminApplicationResiduePath(input.appSlug), { method: 'GET' });
1231
1266
  }
1267
+ /**
1268
+ * GET /admin/apps/:appSlug/scheduled-jobs (#4006) — the jobs the crontabs manager holds for this application, each with
1269
+ * the selector `wildo local jobs run` takes, beside the platform-wide total (an empty list beside a zero total says the
1270
+ * scheduler holds nothing for anyone).
1271
+ */
1272
+ static async listApplicationScheduledJobs(env, credentials, appSlug) {
1273
+ const response = await AppBootstrapService.requestJson(env, credentials, buildAdminApplicationScheduledJobsPath(appSlug), { method: 'GET' });
1274
+ return ApplicationScheduledJobsResponseSchema.parse(response);
1275
+ }
1276
+ /**
1277
+ * POST /admin/apps/:appSlug/scheduled-jobs/run (#4006) — run one of the application's jobs now, once. Not re-sent on a
1278
+ * failed answer as the signing-key doors are: a manual trigger carries no occurrence id the crontabs manager could
1279
+ * deduplicate by, so a re-send whose first attempt landed would run the job twice. One residual, stated rather than
1280
+ * hidden: `fetchWithReconnect` re-sends a request whose connection failed, and a connection that drops AFTER apps-manager
1281
+ * forwarded the trigger is such a failure, so that rare case can run the job twice (each run is an audit row).
1282
+ */
1283
+ static async runApplicationScheduledJob(env, credentials, appSlug, request) {
1284
+ const response = await AppBootstrapService.requestJson(env, credentials, buildAdminApplicationScheduledJobRunPath(appSlug), {
1285
+ method: 'POST',
1286
+ body: JSON.stringify(ApplicationScheduledJobRunRequestSchema.parse(request)),
1287
+ });
1288
+ return ApplicationScheduledJobRunResponseSchema.parse(response);
1289
+ }
1232
1290
  /**
1233
1291
  * POST /admin/apps/:appSlug/deregister
1234
1292
  *
@@ -1309,14 +1367,25 @@ export class AppBootstrapService {
1309
1367
  return Object.fromEntries(entries);
1310
1368
  }
1311
1369
  /**
1312
- * A declared runtime's own credentials, or a hard failure.
1370
+ * Read an application-authored configuration as the working tree holds it NOW: `wildo.saas.config.ts`, a minion's or
1371
+ * a worker's own configuration, the authoritative backend config.
1313
1372
  *
1314
- * Deliberately NO fallback to `prepared.bootstrapCredentials`. A fallback here
1315
- * would hand the runtime the application backend's identity and the sync would
1316
- * report success — reintroducing F11 silently, at the one seam built to close
1317
- * it. A missing entry means preparation and the declaration disagree, which is
1318
- * a bug to surface, not to paper over.
1373
+ * Every env-projection read in this service goes through here, and none through a bare `loadConfig`, because jiti's
1374
+ * module cache is PROCESS-WIDE: `wildo local dev` regenerates the runtimes' env files in its own long-lived process
1375
+ * whenever the declaration changes, and a cached read answers with the file as that process first evaluated it.
1376
+ * {@link AppRuntimeTargetsService.resolve} reads the declaration fresh (#3985), so the target, and the identities
1377
+ * apps-manager mints from it, already knew a runtime declared later; these builders did not. On reference run
1378
+ * 44255624884 five minions and a worker declared after the stack started were minted, then given no `.env`
1379
+ * ("0 worker, 0 minion target(s)"), and each minion refused its unset `APPLICATION_ENV` about 150 times.
1380
+ *
1381
+ * What a fresh read costs depends on how the file's framework imports are evaluated: see
1382
+ * {@link RUNTIME_DECLARATION_EVALUATION}, which the declaration and runtime-configuration reads pass. The backend
1383
+ * config keeps the loader's own inference (`evaluation` omitted): it may define zod schemas of its own, which is the
1384
+ * case that evaluation mode does not cover.
1319
1385
  */
1386
+ static readAuthoredConfig(filePath, evaluation = {}) {
1387
+ return loadConfig(filePath, { ...evaluation, freshModuleCache: true });
1388
+ }
1320
1389
  /**
1321
1390
  * Degraded-mode counterpart of {@link requireRuntimePrincipalCredentials}.
1322
1391
  *
@@ -1334,6 +1403,15 @@ export class AppBootstrapService {
1334
1403
  }
1335
1404
  return AppBootstrapService.requireRuntimePrincipalCredentials(prepared, principal);
1336
1405
  }
1406
+ /**
1407
+ * A declared runtime's own credentials, or a hard failure.
1408
+ *
1409
+ * Deliberately NO fallback to `prepared.bootstrapCredentials`. A fallback here
1410
+ * would hand the runtime the application backend's identity and the sync would
1411
+ * report success — reintroducing F11 silently, at the one seam built to close
1412
+ * it. A missing entry means preparation and the declaration disagree, which is
1413
+ * a bug to surface, not to paper over.
1414
+ */
1337
1415
  static requireRuntimePrincipalCredentials(prepared, principal) {
1338
1416
  const principalKey = buildRuntimePrincipalKey(principal);
1339
1417
  const credentials = prepared.runtimePrincipalCredentials[principalKey];
@@ -1457,7 +1535,8 @@ export class AppBootstrapService {
1457
1535
  if (!prepared) {
1458
1536
  return [];
1459
1537
  }
1460
- const { runtimeTarget, runtimeEndpoints } = prepared;
1538
+ // The companion's endpoints never follow a local tunnel (#3907): a tunnel coming up must not restart it mid-run.
1539
+ const { runtimeTarget, companionRuntimeEndpoints: runtimeEndpoints } = prepared;
1461
1540
  // A companion runs on a development environment only (#2941): no other platform mints it a secret.
1462
1541
  if (!AppBootstrapService.hostsDevelopmentCompanion(runtimeTarget, prepared.runtimeEnvironment)) {
1463
1542
  return [];
@@ -1494,7 +1573,7 @@ export class AppBootstrapService {
1494
1573
  }
1495
1574
  const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;
1496
1575
  const isRemote = input.env.locationType === WildoLocationType.REMOTE;
1497
- const saasConfig = await loadConfig(runtimeTarget.saasConfigPath);
1576
+ const saasConfig = await AppBootstrapService.readAuthoredConfig(runtimeTarget.saasConfigPath, RUNTIME_DECLARATION_EVALUATION);
1498
1577
  const workers = saasConfig.workers ?? {};
1499
1578
  const targets = [];
1500
1579
  for (const [workerName, workerRef] of Object.entries(workers)) {
@@ -1505,7 +1584,7 @@ export class AppBootstrapService {
1505
1584
  // from the spec (rather than re-defaulting `?? 8080` here) keeps the k8s
1506
1585
  // manifest in lockstep with the runtime contract — no drift, no second
1507
1586
  // source of the defaults, and a malformed config fails fast.
1508
- const workerConfig = WildoWorkerConfigSchema.parse(await loadConfig(join(workerRoot, WORKER_CONFIG_FILENAME)));
1587
+ const workerConfig = WildoWorkerConfigSchema.parse(await AppBootstrapService.readAuthoredConfig(join(workerRoot, WORKER_CONFIG_FILENAME), RUNTIME_DECLARATION_EVALUATION));
1509
1588
  const relativeDir = AppBootstrapService.relativeToApplicationRoot(runtimeTarget.appRoot, workerRoot, `Application worker '${workerName}'`);
1510
1589
  const workerCredentials = AppBootstrapService.resolveRuntimePrincipalCredentialsOrSkip(prepared, { kind: ApplicationRuntimePrincipalKind.WORKER, name: workerName });
1511
1590
  if (!workerCredentials)
@@ -1556,7 +1635,7 @@ export class AppBootstrapService {
1556
1635
  return [];
1557
1636
  }
1558
1637
  const { runtimeTarget, bootstrapCredentials, runtimeEndpoints } = prepared;
1559
- const saasConfig = await loadConfig(runtimeTarget.saasConfigPath);
1638
+ const saasConfig = await AppBootstrapService.readAuthoredConfig(runtimeTarget.saasConfigPath, RUNTIME_DECLARATION_EVALUATION);
1560
1639
  const minions = saasConfig.minions ?? {};
1561
1640
  const targets = [];
1562
1641
  const isRemote = input.env.locationType === WildoLocationType.REMOTE;
@@ -1567,7 +1646,7 @@ export class AppBootstrapService {
1567
1646
  // (kill_previous, file liveness at /tmp/wildo-minion-alive, staleAfterSec
1568
1647
  // 90). Derived from the spec so the k8s manifest never drifts from the
1569
1648
  // runtime contract, and a malformed minion config fails fast.
1570
- const minionConfig = WildoMinionConfigSchema.parse(await loadConfig(join(minionRoot, MINION_CONFIG_FILENAME)));
1649
+ const minionConfig = WildoMinionConfigSchema.parse(await AppBootstrapService.readAuthoredConfig(join(minionRoot, MINION_CONFIG_FILENAME), RUNTIME_DECLARATION_EVALUATION));
1571
1650
  const relativeDir = AppBootstrapService.relativeToApplicationRoot(runtimeTarget.appRoot, minionRoot, `Application minion '${minionName}'`);
1572
1651
  const minionCredentials = AppBootstrapService.resolveRuntimePrincipalCredentialsOrSkip(prepared, { kind: ApplicationRuntimePrincipalKind.MINION, name: minionName });
1573
1652
  // Degraded mode only: a principal whose own secret is not on disk is SKIPPED