@wildo-ai/wildo-cli 1.1.2 → 1.1.4
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.
- package/dist/bin/wildo.d.ts.map +1 -1
- package/dist/src/__tests__/sandbox-dependencies.test-helpers.d.ts.map +1 -1
- package/dist/src/commands/acp/probe.command.d.ts.map +1 -1
- package/dist/src/commands/acp/probe.command.js +13 -0
- package/dist/src/commands/acp/probe.command.js.map +1 -1
- package/dist/src/commands/align-deps.command.d.ts.map +1 -1
- package/dist/src/commands/assets/sync.command.d.ts +6 -0
- package/dist/src/commands/assets/sync.command.d.ts.map +1 -1
- package/dist/src/commands/assets/sync.command.js +13 -3
- package/dist/src/commands/assets/sync.command.js.map +1 -1
- package/dist/src/commands/brand/propagate.command.d.ts.map +1 -1
- package/dist/src/commands/compose.command.d.ts.map +1 -1
- package/dist/src/commands/compose.command.js +16 -0
- package/dist/src/commands/compose.command.js.map +1 -1
- package/dist/src/commands/config/__tests__/reapply-declaration.command.test.d.ts.map +1 -1
- package/dist/src/commands/config/__tests__/reapply-declaration.command.test.js +1 -1
- package/dist/src/commands/config/__tests__/reapply-declaration.command.test.js.map +1 -1
- package/dist/src/commands/config/__tests__/sync.command.test.d.ts.map +1 -1
- package/dist/src/commands/config/__tests__/sync.command.test.js +115 -8
- package/dist/src/commands/config/__tests__/sync.command.test.js.map +1 -1
- package/dist/src/commands/config/__tests__/validate.command.test.d.ts.map +1 -1
- package/dist/src/commands/config/mutate.command.d.ts.map +1 -1
- package/dist/src/commands/config/reapply-declaration.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.d.ts +36 -0
- package/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js +61 -7
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/config/validate.command.d.ts.map +1 -1
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts +2 -0
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.d.ts.map +1 -0
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.js +63 -0
- package/dist/src/commands/context/__tests__/assurance-basis.command.test.js.map +1 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.d.ts +19 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.d.ts.map +1 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.js +106 -0
- package/dist/src/commands/context/__tests__/jurisdictions.command.test.js.map +1 -0
- package/dist/src/commands/context/assurance-basis.command.d.ts +61 -0
- package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -0
- package/dist/src/commands/context/assurance-basis.command.js +166 -0
- package/dist/src/commands/context/assurance-basis.command.js.map +1 -0
- package/dist/src/commands/context/coherence.command.d.ts.map +1 -1
- package/dist/src/commands/context/context-command.utils.d.ts.map +1 -1
- package/dist/src/commands/context/health.command.d.ts.map +1 -1
- package/dist/src/commands/context/info.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts +6 -2
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +8 -4
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/context/jurisdictions.command.d.ts +36 -0
- package/dist/src/commands/context/jurisdictions.command.d.ts.map +1 -0
- package/dist/src/commands/context/jurisdictions.command.js +115 -0
- package/dist/src/commands/context/jurisdictions.command.js.map +1 -0
- package/dist/src/commands/context/list.command.d.ts.map +1 -1
- package/dist/src/commands/db/db-schema-plan.utils.d.ts.map +1 -1
- package/dist/src/commands/db/diff.command.d.ts.map +1 -1
- package/dist/src/commands/db/generate.command.d.ts.map +1 -1
- package/dist/src/commands/db/migrate.command.d.ts.map +1 -1
- package/dist/src/commands/db/resolve.command.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/design-tokens.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/start.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/start.command.test.js +6 -6
- package/dist/src/commands/dev/__tests__/start.command.test.js.map +1 -1
- package/dist/src/commands/dev/__tests__/stop.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/sync-csp.command.test.d.ts.map +1 -1
- package/dist/src/commands/dev/__tests__/sync-csp.command.test.js +71 -0
- package/dist/src/commands/dev/__tests__/sync-csp.command.test.js.map +1 -1
- package/dist/src/commands/dev/charts-audit.command.d.ts +5 -3
- package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
- package/dist/src/commands/dev/charts-audit.command.js +36 -7
- package/dist/src/commands/dev/charts-audit.command.js.map +1 -1
- package/dist/src/commands/dev/design-tokens-generate.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-init.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-validate.command.d.ts.map +1 -1
- package/dist/src/commands/dev/force-stop.command.d.ts.map +1 -1
- package/dist/src/commands/dev/resources.command.d.ts.map +1 -1
- package/dist/src/commands/dev/start.command.d.ts.map +1 -1
- package/dist/src/commands/dev/start.command.js +8 -7
- package/dist/src/commands/dev/start.command.js.map +1 -1
- package/dist/src/commands/dev/stop-all.command.d.ts.map +1 -1
- package/dist/src/commands/dev/sync-csp.command.d.ts.map +1 -1
- package/dist/src/commands/dev/sync-csp.command.js +35 -7
- package/dist/src/commands/dev/sync-csp.command.js.map +1 -1
- package/dist/src/commands/docs/__tests__/publish.command.test.d.ts +2 -0
- package/dist/src/commands/docs/__tests__/publish.command.test.d.ts.map +1 -0
- package/dist/src/commands/docs/__tests__/publish.command.test.js +101 -0
- package/dist/src/commands/docs/__tests__/publish.command.test.js.map +1 -0
- package/dist/src/commands/docs/publish.command.d.ts +29 -0
- package/dist/src/commands/docs/publish.command.d.ts.map +1 -0
- package/dist/src/commands/docs/publish.command.js +82 -0
- package/dist/src/commands/docs/publish.command.js.map +1 -0
- package/dist/src/commands/frontend/publish.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/__tests__/dev-skills.command.test.d.ts.map +1 -1
- package/dist/src/commands/fwk/__tests__/generate-docs.command.test.d.ts.map +1 -1
- package/dist/src/commands/fwk/__tests__/generate-docs.command.test.js.map +1 -1
- package/dist/src/commands/fwk/audit.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/dev-skills.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/dev-skills.command.js +12 -0
- package/dist/src/commands/fwk/dev-skills.command.js.map +1 -1
- package/dist/src/commands/fwk/generate-docs.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/generate-providers.command.d.ts +21 -0
- package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -0
- package/dist/src/commands/fwk/generate-providers.command.js +325 -0
- package/dist/src/commands/fwk/generate-providers.command.js.map +1 -0
- package/dist/src/commands/fwk/graph.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-npm.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-bump.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-set.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-show.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-show.command.js +9 -1
- package/dist/src/commands/fwk/version-show.command.js.map +1 -1
- package/dist/src/commands/fwk/version-sync.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/what-touches.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.d.ts +13 -4
- package/dist/src/commands/fwk/wt-status.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.js +34 -5
- package/dist/src/commands/fwk/wt-status.command.js.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.d.ts +12 -6
- package/dist/src/commands/fwk/wt-tail.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.js +40 -10
- package/dist/src/commands/fwk/wt-tail.command.js.map +1 -1
- package/dist/src/commands/generate/__tests__/email-command.utils.test.d.ts.map +1 -1
- package/dist/src/commands/generate/__tests__/email-command.utils.test.js +0 -1
- package/dist/src/commands/generate/__tests__/email-command.utils.test.js.map +1 -1
- package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/email-command.utils.js +1 -0
- package/dist/src/commands/generate/email-command.utils.js.map +1 -1
- package/dist/src/commands/generate/email-preview.command.d.ts +8 -0
- package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-preview.command.js +57 -0
- package/dist/src/commands/generate/email-preview.command.js.map +1 -1
- package/dist/src/commands/generate/email-status.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-test-send.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-translate.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labelling-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/labelling-command.utils.js +1 -0
- package/dist/src/commands/generate/labelling-command.utils.js.map +1 -1
- package/dist/src/commands/generate/labels-plan.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labels.command.d.ts.map +1 -1
- package/dist/src/commands/generate/translate.command.d.ts.map +1 -1
- package/dist/src/commands/help.command.d.ts.map +1 -1
- package/dist/src/commands/help.command.js +2 -0
- package/dist/src/commands/help.command.js.map +1 -1
- package/dist/src/commands/init.command.d.ts +17 -0
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js +89 -4
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/__tests__/dev-status.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/dev.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/dev.command.test.js +60 -0
- package/dist/src/commands/local/__tests__/dev.command.test.js.map +1 -1
- package/dist/src/commands/local/__tests__/doctor.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/doctor.command.test.js +16 -2
- package/dist/src/commands/local/__tests__/doctor.command.test.js.map +1 -1
- package/dist/src/commands/local/__tests__/init.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/init.command.test.js +28 -1
- package/dist/src/commands/local/__tests__/init.command.test.js.map +1 -1
- package/dist/src/commands/local/__tests__/reinit.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/reset.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/up.command.test.d.ts.map +1 -1
- package/dist/src/commands/local/__tests__/up.command.test.js +7 -0
- package/dist/src/commands/local/__tests__/up.command.test.js.map +1 -1
- package/dist/src/commands/local/dev-status.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +6 -3
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +13 -4
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts +9 -0
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- package/dist/src/commands/local/doctor.command.js +24 -6
- package/dist/src/commands/local/doctor.command.js.map +1 -1
- package/dist/src/commands/local/down.command.d.ts.map +1 -1
- package/dist/src/commands/local/init.command.d.ts.map +1 -1
- package/dist/src/commands/local/init.command.js +11 -2
- package/dist/src/commands/local/init.command.js.map +1 -1
- package/dist/src/commands/local/logs.command.d.ts.map +1 -1
- package/dist/src/commands/local/reinit.command.d.ts.map +1 -1
- package/dist/src/commands/local/reset.command.d.ts.map +1 -1
- package/dist/src/commands/local/status.command.d.ts.map +1 -1
- package/dist/src/commands/local/up.command.d.ts.map +1 -1
- package/dist/src/commands/local/up.command.js.map +1 -1
- package/dist/src/commands/lock/__tests__/check.command.test.d.ts.map +1 -1
- package/dist/src/commands/lock/__tests__/check.live.contract.test.d.ts.map +1 -1
- package/dist/src/commands/lock/check.command.d.ts.map +1 -1
- package/dist/src/commands/lock/check.command.js +4 -10
- package/dist/src/commands/lock/check.command.js.map +1 -1
- package/dist/src/commands/market/__tests__/generate.command.test.d.ts.map +1 -1
- package/dist/src/commands/market/__tests__/market-command.utils.test.d.ts.map +1 -1
- package/dist/src/commands/market/__tests__/market-command.utils.test.js +0 -1
- package/dist/src/commands/market/__tests__/market-command.utils.test.js.map +1 -1
- package/dist/src/commands/market/generate.command.d.ts.map +1 -1
- package/dist/src/commands/market/market-command.utils.d.ts.map +1 -1
- package/dist/src/commands/market/market-command.utils.js +1 -0
- package/dist/src/commands/market/market-command.utils.js.map +1 -1
- package/dist/src/commands/providers/__tests__/required-inputs.test.d.ts +2 -0
- package/dist/src/commands/providers/__tests__/required-inputs.test.d.ts.map +1 -0
- package/dist/src/commands/providers/__tests__/required-inputs.test.js +35 -0
- package/dist/src/commands/providers/__tests__/required-inputs.test.js.map +1 -0
- package/dist/src/commands/providers/show.command.d.ts +51 -0
- package/dist/src/commands/providers/show.command.d.ts.map +1 -0
- package/dist/src/commands/providers/show.command.js +152 -0
- package/dist/src/commands/providers/show.command.js.map +1 -0
- package/dist/src/commands/registry/add.command.d.ts.map +1 -1
- package/dist/src/commands/registry/info.command.d.ts.map +1 -1
- package/dist/src/commands/registry/lockfile-smoke.command.d.ts.map +1 -1
- package/dist/src/commands/registry/login.command.d.ts.map +1 -1
- package/dist/src/commands/registry/login.command.js +2 -0
- package/dist/src/commands/registry/login.command.js.map +1 -1
- package/dist/src/commands/registry/logout.command.d.ts.map +1 -1
- package/dist/src/commands/registry/ping.command.d.ts.map +1 -1
- package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
- package/dist/src/commands/registry/publish.command.js +2 -0
- package/dist/src/commands/registry/publish.command.js.map +1 -1
- package/dist/src/commands/registry/registry-transport.constants.d.ts +33 -0
- package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -0
- package/dist/src/commands/registry/registry-transport.constants.js +33 -0
- package/dist/src/commands/registry/registry-transport.constants.js.map +1 -0
- package/dist/src/commands/registry/remove.command.d.ts.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
- package/dist/src/commands/registry/search.command.d.ts.map +1 -1
- package/dist/src/commands/registry/update.command.d.ts.map +1 -1
- package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
- package/dist/src/commands/registry/whoami.command.js +2 -0
- package/dist/src/commands/registry/whoami.command.js.map +1 -1
- package/dist/src/commands/remote/__tests__/remote-commands.test.d.ts.map +1 -1
- package/dist/src/commands/remote/create.command.d.ts.map +1 -1
- package/dist/src/commands/remote/list.command.d.ts.map +1 -1
- package/dist/src/commands/remote/status.command.d.ts.map +1 -1
- package/dist/src/commands/remote/sync.command.d.ts.map +1 -1
- package/dist/src/commands/setup.command.d.ts.map +1 -1
- package/dist/src/commands/version.command.d.ts.map +1 -1
- package/dist/src/commands/website/__tests__/audit.command.test.d.ts.map +1 -1
- package/dist/src/commands/website/audit.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/__tests__/workbench.commands.test.d.ts.map +1 -1
- package/dist/src/commands/workbench/open.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/status.command.d.ts.map +1 -1
- package/dist/src/infrastructure/errors/error.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/io/file.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/io/io.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/io/template-processor.d.ts.map +1 -1
- package/dist/src/infrastructure/logger/logger.service.d.ts.map +1 -1
- package/dist/src/infrastructure/process/__tests__/spawn.utils.test.d.ts.map +1 -1
- package/dist/src/infrastructure/process/spawn.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/formatting.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/interaction-engine.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/markdown-renderer.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/ui.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/utils/string.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/validation/validator.service.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/bootstrap.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/command-registry.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/command-registry.test.js +9 -0
- package/dist/src/kernel/__tests__/command-registry.test.js.map +1 -1
- package/dist/src/kernel/__tests__/command-runner.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/command-scope-utils.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/flag-utils.test.d.ts.map +1 -1
- package/dist/src/kernel/__tests__/hooks.test.d.ts.map +1 -1
- package/dist/src/kernel/base-command.d.ts.map +1 -1
- package/dist/src/kernel/bootstrap.d.ts.map +1 -1
- package/dist/src/kernel/command-registry.d.ts.map +1 -1
- package/dist/src/kernel/command-registry.js +6 -0
- package/dist/src/kernel/command-registry.js.map +1 -1
- package/dist/src/kernel/command-runner.d.ts.map +1 -1
- package/dist/src/kernel/command-scope-utils.d.ts.map +1 -1
- package/dist/src/kernel/flag-utils.d.ts.map +1 -1
- package/dist/src/kernel/hooks.d.ts.map +1 -1
- package/dist/src/kernel/logger.d.ts.map +1 -1
- package/dist/src/kernel/types.d.ts +17 -1
- package/dist/src/kernel/types.d.ts.map +1 -1
- package/dist/src/kernel/types.js +16 -0
- package/dist/src/kernel/types.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/__tests__/admin-user.module.test.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts +2 -0
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.d.ts.map +1 -0
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js +146 -0
- package/dist/src/modules/domain/credentials/__tests__/approver-user.module.test.js.map +1 -0
- package/dist/src/modules/domain/credentials/__tests__/providers-config.module.test.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/__tests__/providers-config.module.test.js +2 -2
- package/dist/src/modules/domain/credentials/__tests__/providers-config.module.test.js.map +1 -1
- package/dist/src/modules/domain/credentials/admin-user.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/approver-user.module.d.ts +85 -0
- package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -0
- package/dist/src/modules/domain/credentials/approver-user.module.js +92 -0
- package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -0
- package/dist/src/modules/domain/credentials/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/providers-config.module.d.ts +17 -9
- package/dist/src/modules/domain/credentials/providers-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/providers-config.module.js +18 -10
- package/dist/src/modules/domain/credentials/providers-config.module.js.map +1 -1
- package/dist/src/modules/domain/environment/__tests__/database-config.module.test.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/database-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/paths-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-selector.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-semantics.module.d.ts.map +1 -1
- package/dist/src/modules/domain/module.types.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts +2 -0
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.d.ts.map +1 -0
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js +111 -0
- package/dist/src/services/application/__tests__/app-bootstrap.approving-administrator.test.js.map +1 -0
- package/dist/src/services/application/__tests__/app-bootstrap.service.apps-manager-reconnect.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.degraded-env.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.operation-timeout.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.operation-timeout.test.js +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.operation-timeout.test.js.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.service.test.js +22 -29
- package/dist/src/services/application/__tests__/app-bootstrap.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.two-phase-seeding.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.two-phase-seeding.test.js +1 -1
- package/dist/src/services/application/__tests__/app-bootstrap.two-phase-seeding.test.js.map +1 -1
- package/dist/src/services/application/__tests__/app-runtime-targets.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/app-runtime-targets.service.test.js +2 -2
- package/dist/src/services/application/__tests__/app-runtime-targets.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/application-assets-delivery.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/application-assets-delivery.service.test.js +19 -0
- package/dist/src/services/application/__tests__/application-assets-delivery.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/application-dependency-alignment.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/application-initialization-verification.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/application-runtime-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/apps-manager-unavailable-classification.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/apps-manager-unavailable-classification.test.js.map +1 -1
- package/dist/src/services/application/__tests__/audit-provider-immudb-backing.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/dev-orchestrator.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/dev-schema-drift.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/existing-app-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/existing-app-bootstrap.service.test.js +0 -1
- package/dist/src/services/application/__tests__/existing-app-bootstrap.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/local-app-reinit.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/local-app-reinit.service.test.js +8 -1
- package/dist/src/services/application/__tests__/local-app-reinit.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/local-application-initialization.guard.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/local-application-initialization.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/local-application-initialization.service.test.js +35 -0
- package/dist/src/services/application/__tests__/local-application-initialization.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/provider-package-links.service.test.d.ts +2 -0
- package/dist/src/services/application/__tests__/provider-package-links.service.test.d.ts.map +1 -0
- package/dist/src/services/application/__tests__/provider-package-links.service.test.js +224 -0
- package/dist/src/services/application/__tests__/provider-package-links.service.test.js.map +1 -0
- package/dist/src/services/application/__tests__/provider-runtime-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/provider-runtime-sync.service.test.js +28 -0
- package/dist/src/services/application/__tests__/provider-runtime-sync.service.test.js.map +1 -1
- package/dist/src/services/application/__tests__/saas-and-infra-contracts.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/saas-and-infra-contracts.test.js +0 -1
- package/dist/src/services/application/__tests__/saas-and-infra-contracts.test.js.map +1 -1
- package/dist/src/services/application/__tests__/saas-scaffold.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/saas-skeleton.service.test.d.ts.map +1 -1
- package/dist/src/services/application/__tests__/saas-skeleton.service.test.js.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts +43 -10
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.js +92 -49
- package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/app-env.service.d.ts.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-schema-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-assets-delivery.service.d.ts +22 -1
- package/dist/src/services/application/application-assets-delivery.service.d.ts.map +1 -1
- package/dist/src/services/application/application-assets-delivery.service.js +35 -7
- package/dist/src/services/application/application-assets-delivery.service.js.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
- package/dist/src/services/application/application-dev-port-offsets.d.ts.map +1 -1
- package/dist/src/services/application/application-initialization-verification.service.d.ts.map +1 -1
- package/dist/src/services/application/application-root.utils.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +6 -0
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.js +41 -2
- package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/dev-orchestrator.service.d.ts.map +1 -1
- package/dist/src/services/application/dev-schema-drift.service.d.ts.map +1 -1
- package/dist/src/services/application/existing-app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/local-app-reinit.service.d.ts.map +1 -1
- package/dist/src/services/application/local-application-initialization.service.d.ts.map +1 -1
- package/dist/src/services/application/local-application-initialization.service.js +22 -6
- package/dist/src/services/application/local-application-initialization.service.js.map +1 -1
- package/dist/src/services/application/provider-package-links.service.d.ts +160 -0
- package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -0
- package/dist/src/services/application/provider-package-links.service.js +312 -0
- package/dist/src/services/application/provider-package-links.service.js.map +1 -0
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js +7 -20
- package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
- package/dist/src/services/application/saas-scaffold.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-scaffold.service.js +11 -2
- package/dist/src/services/application/saas-scaffold.service.js.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.js +46 -26
- package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
- package/dist/src/services/brand/__tests__/brand-asset-delivery.test.d.ts.map +1 -1
- package/dist/src/services/brand/brand-asset-projection.d.ts.map +1 -1
- package/dist/src/services/brand/brand-destination-utils.d.ts.map +1 -1
- package/dist/src/services/brand/brand-propagation.types.d.ts.map +1 -1
- package/dist/src/services/brand/brand-ssot-reader.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/app-public.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/runtime-app-config.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/technical-doc-static.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/website-og.destination.d.ts.map +1 -1
- package/dist/src/services/brand/destinations/website-public.destination.d.ts.map +1 -1
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.d.ts +2 -0
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.d.ts.map +1 -0
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.js +93 -0
- package/dist/src/services/catalog/__tests__/durable-state-classification.test.js.map +1 -0
- package/dist/src/services/catalog/__tests__/service-address-resolver.service.test.d.ts.map +1 -1
- package/dist/src/services/catalog/__tests__/service-address-resolver.service.test.js +25 -5
- package/dist/src/services/catalog/__tests__/service-address-resolver.service.test.js.map +1 -1
- package/dist/src/services/catalog/__tests__/service-catalog.schemas.test.d.ts.map +1 -1
- package/dist/src/services/catalog/__tests__/service-catalog.schemas.test.js +109 -51
- package/dist/src/services/catalog/__tests__/service-catalog.schemas.test.js.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts +0 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.js +23 -7
- package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.d.ts +148 -51
- package/dist/src/services/catalog/service-catalog.schemas.d.ts.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.js +230 -78
- package/dist/src/services/catalog/service-catalog.schemas.js.map +1 -1
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.d.ts +2 -0
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.d.ts.map +1 -0
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.js +110 -0
- package/dist/src/services/coding-agents/__tests__/acp-conformance-probe.service.test.js.map +1 -0
- package/dist/src/services/coding-agents/acp-conformance-probe.service.d.ts +32 -0
- package/dist/src/services/coding-agents/acp-conformance-probe.service.d.ts.map +1 -1
- package/dist/src/services/coding-agents/acp-conformance-probe.service.js +165 -7
- package/dist/src/services/coding-agents/acp-conformance-probe.service.js.map +1 -1
- package/dist/src/services/companion/__tests__/companion-client.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/__tests__/companion-client.service.test.js +96 -0
- package/dist/src/services/companion/__tests__/companion-client.service.test.js.map +1 -1
- package/dist/src/services/companion/__tests__/companion-lifecycle.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/__tests__/workbench-browser-launcher.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/__tests__/workbench-cli.service.test.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client-options.utils.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client-options.utils.js +6 -0
- package/dist/src/services/companion/companion-client-options.utils.js.map +1 -1
- package/dist/src/services/companion/companion-client.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client.service.js +34 -0
- package/dist/src/services/companion/companion-client.service.js.map +1 -1
- package/dist/src/services/companion/companion-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-local-token.utils.d.ts +20 -0
- package/dist/src/services/companion/companion-local-token.utils.d.ts.map +1 -0
- package/dist/src/services/companion/companion-local-token.utils.js +62 -0
- package/dist/src/services/companion/companion-local-token.utils.js.map +1 -0
- package/dist/src/services/companion/companion.schemas.d.ts +12 -0
- package/dist/src/services/companion/companion.schemas.d.ts.map +1 -1
- package/dist/src/services/companion/companion.schemas.js.map +1 -1
- package/dist/src/services/companion/git-helper.service.d.ts.map +1 -1
- package/dist/src/services/companion/local-companion-authority.service.d.ts.map +1 -1
- package/dist/src/services/companion/local-companion-authority.service.js +9 -30
- package/dist/src/services/companion/local-companion-authority.service.js.map +1 -1
- package/dist/src/services/companion/workbench-browser-launcher.service.d.ts.map +1 -1
- package/dist/src/services/companion/workbench-cli.service.d.ts.map +1 -1
- package/dist/src/services/companion/workbench-cli.service.js +10 -1
- package/dist/src/services/companion/workbench-cli.service.js.map +1 -1
- package/dist/src/services/context/__tests__/context-manager.installed-assets.test.d.ts.map +1 -1
- package/dist/src/services/context/__tests__/context-manager.installed-assets.test.js +7 -0
- package/dist/src/services/context/__tests__/context-manager.installed-assets.test.js.map +1 -1
- package/dist/src/services/context/__tests__/context-manager.service.test.d.ts.map +1 -1
- package/dist/src/services/context/context-manager.service.d.ts +9 -0
- package/dist/src/services/context/context-manager.service.d.ts.map +1 -1
- package/dist/src/services/context/context-manager.service.js +13 -1
- package/dist/src/services/context/context-manager.service.js.map +1 -1
- package/dist/src/services/context/context.schemas.d.ts.map +1 -1
- package/dist/src/services/context/state-manager.service.d.ts.map +1 -1
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.d.ts +28 -0
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.d.ts.map +1 -0
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.js +197 -0
- package/dist/src/services/credentials/__tests__/ci-secrets-mapping.test.js.map +1 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.d.ts +2 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.d.ts.map +1 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.js +327 -0
- package/dist/src/services/credentials/__tests__/composed-provider-secrets.guard.test.js.map +1 -0
- package/dist/src/services/credentials/__tests__/framework-managed-secrets.test.d.ts.map +1 -1
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts +2 -0
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.d.ts.map +1 -0
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js +94 -0
- package/dist/src/services/credentials/__tests__/provider-contribution-registration.guard.test.js.map +1 -0
- package/dist/src/services/credentials/__tests__/secrets-contracts.test.d.ts.map +1 -1
- package/dist/src/services/credentials/ci-secrets-adapter.service.d.ts.map +1 -1
- package/dist/src/services/credentials/ci-secrets-adapter.service.js +114 -37
- package/dist/src/services/credentials/ci-secrets-adapter.service.js.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts +209 -0
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -0
- package/dist/src/services/credentials/composed-provider-catalogue.js +263 -0
- package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -0
- package/dist/src/services/credentials/credentials.schemas.d.ts +29 -22
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.js +67 -5
- package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
- package/dist/src/services/credentials/credentials.service.d.ts.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.d.ts +105 -1
- package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.js +51 -8
- package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts +127 -7
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +189 -45
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/secrets-provisioning.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-reader.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-rotation.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts +0 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.js +0 -1
- package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
- package/dist/src/services/data-services/data-services.service.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/apps-manager-diagnostics.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/ci-deploy-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/ci-deploy-generator.service.test.js +91 -1
- package/dist/src/services/deployment/__tests__/ci-deploy-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/ci-workflow-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/deployment-template-contracts.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/deployment-template-contracts.test.js +45 -15
- package/dist/src/services/deployment/__tests__/deployment-template-contracts.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/host-toolchain-readiness.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/host-toolchain-readiness.service.test.js +33 -1
- package/dist/src/services/deployment/__tests__/host-toolchain-readiness.service.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/infra-templates-render-smoke.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-observer-lifecycle.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-output-boundary.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-session-lease.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-dev-shutdown-coordinator.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-precondition-checks.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/local-precondition-checks.service.test.js +44 -1
- package/dist/src/services/deployment/__tests__/local-precondition-checks.service.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/local-runtime-process-cleanup.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/parity.compose-vs-k8s.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/parity.compose-vs-k8s.test.js +82 -87
- package/dist/src/services/deployment/__tests__/parity.compose-vs-k8s.test.js.map +1 -1
- package/dist/src/services/deployment/__tests__/platform-lifecycle.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/__tests__/platform-runtime-policy.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/apps-manager-diagnostics.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js +11 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
- package/dist/src/services/deployment/ci-workflow-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-workflow-generator.service.js +23 -4
- package/dist/src/services/deployment/ci-workflow-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/compose-env-value-encoding.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/compose-host-mounted-artifact.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/docker-compose-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/docker-compose-generator.service.test.js +150 -7
- package/dist/src/services/deployment/docker/__tests__/docker-compose-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/docker/__tests__/docker-compose-readiness.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +60 -12
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.service.d.ts.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/infra-writer.service.d.ts.map +1 -1
- package/dist/src/services/deployment/infra-writer.service.js +34 -7
- package/dist/src/services/deployment/infra-writer.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js +45 -2
- package/dist/src/services/deployment/k8s/__tests__/k8s-bootstrap.service.test.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-manifest-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-manifest-generator.service.test.js +110 -9
- package/dist/src/services/deployment/k8s/__tests__/k8s-manifest-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-operations.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.d.ts +2 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.d.ts.map +1 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.js +226 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-runtime-env-secrets.test.js.map +1 -0
- package/dist/src/services/deployment/k8s/__tests__/k8s-secrets-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/k8s-secrets-generator.service.test.js +132 -12
- package/dist/src/services/deployment/k8s/__tests__/k8s-secrets-generator.service.test.js.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/kind.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/__tests__/local-k8s-application-pruning.service.test.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts +23 -0
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js +52 -6
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-local-infra-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +45 -9
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +4 -3
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js +0 -4
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-operations.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts +10 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +193 -33
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/kind.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-observer-lifecycle.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-output-boundary.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-shutdown-coordinator.d.ts.map +1 -1
- package/dist/src/services/deployment/local-infrastructure-initialization.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts +28 -17
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.js +83 -3
- package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
- package/dist/src/services/deployment/local-runtime-process-cleanup.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-runtime-policy.service.d.ts.map +1 -1
- package/dist/src/services/deployment/version-compare.utils.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-command.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-config.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-config.template.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-css-block.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens-paths.service.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.constants.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.models.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/compose-converge-args.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/config-hydration-seam.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-configuration-generator.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-configuration-generator.service.test.js +36 -20
- package/dist/src/services/environment/__tests__/env-configuration-generator.service.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/env-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-sync.service.test.js +6 -4
- package/dist/src/services/environment/__tests__/env-sync.service.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/env-vars-builder.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/env-vars-builder.service.test.js +89 -8
- package/dist/src/services/environment/__tests__/env-vars-builder.service.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/environment-hydration.utils.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-lifecycle.needs-local-mongodb.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-lifecycle.needs-local-postgresql.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.d.ts +2 -0
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.d.ts.map +1 -0
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.js +136 -0
- package/dist/src/services/environment/__tests__/environment-lifecycle.self-hosts-backing-service.test.js.map +1 -0
- package/dist/src/services/environment/__tests__/environment-paths.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-registry.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-setup.non-interactive.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/environment-setup.non-interactive.test.js +23 -0
- package/dist/src/services/environment/__tests__/environment-setup.non-interactive.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/platform-engine-change.utils.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/platform-image-ref.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/platform-image-ref.test.js.map +1 -1
- package/dist/src/services/environment/__tests__/platform-runtime-state.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/provider-secrets-env.service.test.d.ts.map +1 -1
- package/dist/src/services/environment/__tests__/runtime-bootstrap.authored-database-refresh.test.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts +52 -14
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +41 -38
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-sync.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-sync.service.js +13 -13
- package/dist/src/services/environment/env-sync.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +28 -0
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +188 -41
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts +53 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js +65 -1
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-paths.service.d.ts +2 -1
- package/dist/src/services/environment/environment-paths.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-paths.service.js +5 -3
- package/dist/src/services/environment/environment-paths.service.js.map +1 -1
- package/dist/src/services/environment/environment-registry.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.js +23 -9
- package/dist/src/services/environment/environment-setup.service.js.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts +6 -1
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js +2 -0
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/environment/platform-engine-change.utils.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime-state.service.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime.schemas.js.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/application-rule-imports.test.d.ts +2 -0
- package/dist/src/services/framework/__tests__/application-rule-imports.test.d.ts.map +1 -0
- package/dist/src/services/framework/__tests__/application-rule-imports.test.js +58 -0
- package/dist/src/services/framework/__tests__/application-rule-imports.test.js.map +1 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.d.ts +2 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.d.ts.map +1 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js +55 -0
- package/dist/src/services/framework/__tests__/engine-provider-specifications.reconciliation.test.js.map +1 -0
- package/dist/src/services/framework/__tests__/fixtures/framework-knowledge-package-only.fixture.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/fixtures/framework-knowledge-package-only.fixture.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.installed-package.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.installed-package.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.package-only.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-development-skills-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-docker-publish.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-docker-publish.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-application-guidance.validator.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js +17 -0
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.live.contract.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js +101 -0
- package/dist/src/services/framework/__tests__/framework-knowledge-audit.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-generation.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-knowledge-generation.service.test.js +4 -70
- package/dist/src/services/framework/__tests__/framework-knowledge-generation.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-npm-publish.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-npm-publish.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-publish-manifest.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-publish-manifest.service.test.js +78 -6
- package/dist/src/services/framework/__tests__/framework-publish-manifest.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-release.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-release.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/framework-secrets-writer.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-version.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/__tests__/framework-version.service.test.js.map +1 -1
- package/dist/src/services/framework/__tests__/installed-framework-assets.service.test.d.ts.map +1 -1
- package/dist/src/services/framework/application-rule-imports.d.ts +36 -0
- package/dist/src/services/framework/application-rule-imports.d.ts.map +1 -0
- package/dist/src/services/framework/application-rule-imports.js +77 -0
- package/dist/src/services/framework/application-rule-imports.js.map +1 -0
- package/dist/src/services/framework/framework-development-skills-sync.service.d.ts +23 -0
- package/dist/src/services/framework/framework-development-skills-sync.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-development-skills-sync.service.js +51 -0
- package/dist/src/services/framework/framework-development-skills-sync.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/framework/framework-knowledge-application-guidance.validator.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.d.ts +86 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.js +212 -1
- package/dist/src/services/framework/framework-knowledge-audit.service.js.map +1 -1
- package/dist/src/services/framework/framework-knowledge-generation.service.d.ts +0 -1
- package/dist/src/services/framework/framework-knowledge-generation.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-generation.service.js +29 -215
- package/dist/src/services/framework/framework-knowledge-generation.service.js.map +1 -1
- package/dist/src/services/framework/framework-knowledge-scan.constants.d.ts.map +1 -1
- package/dist/src/services/framework/framework-npm-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-npm-publish.service.js +7 -3
- package/dist/src/services/framework/framework-npm-publish.service.js.map +1 -1
- package/dist/src/services/framework/framework-publish-manifest.service.d.ts +44 -1
- package/dist/src/services/framework/framework-publish-manifest.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-publish-manifest.service.js +79 -4
- package/dist/src/services/framework/framework-publish-manifest.service.js.map +1 -1
- package/dist/src/services/framework/framework-release.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-version.service.d.ts +13 -0
- package/dist/src/services/framework/framework-version.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-version.service.js +23 -24
- package/dist/src/services/framework/framework-version.service.js.map +1 -1
- package/dist/src/services/framework/installed-framework-assets.service.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js +100 -0
- package/dist/src/services/framework/provider-transposition/__tests__/base-url-is-a-declared-env-slot.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.js +92 -0
- package/dist/src/services/framework/provider-transposition/__tests__/client-and-schema-agree.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.js +83 -0
- package/dist/src/services/framework/provider-transposition/__tests__/decision-projection.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js +219 -0
- package/dist/src/services/framework/provider-transposition/__tests__/plan-matches-emit.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.js +372 -0
- package/dist/src/services/framework/provider-transposition/__tests__/provider-catalogue-record.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.d.ts +2 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.js +794 -0
- package/dist/src/services/framework/provider-transposition/__tests__/transposition-contract.test.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts +14 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js +1047 -0
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts +26 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.js +57 -0
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts +35 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.js +204 -0
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts +410 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js +434 -0
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.d.ts +39 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.js +274 -0
- package/dist/src/services/framework/provider-transposition/provider-merge.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts +139 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.js +1586 -0
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts +35 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.js +527 -0
- package/dist/src/services/framework/provider-transposition/sim-source.reader.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts +229 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.js +96 -0
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.js.map +1 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts +55 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts.map +1 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.js +196 -0
- package/dist/src/services/framework/provider-transposition/url-template.extractor.js.map +1 -0
- package/dist/src/services/frontend/__tests__/cloudflare-cdn.service.test.d.ts.map +1 -1
- package/dist/src/services/frontend/__tests__/frontend-dist-uploader.service.test.d.ts.map +1 -1
- package/dist/src/services/frontend/__tests__/frontend-publish.service.test.d.ts.map +1 -1
- package/dist/src/services/frontend/cloudflare-cdn.service.d.ts.map +1 -1
- package/dist/src/services/frontend/cloudflare-cdn.service.js +33 -2
- package/dist/src/services/frontend/cloudflare-cdn.service.js.map +1 -1
- package/dist/src/services/frontend/frontend-dist-uploader.service.d.ts.map +1 -1
- package/dist/src/services/frontend/frontend-publish.service.d.ts.map +1 -1
- package/dist/src/services/frontend/frontend-publish.service.js +1 -1
- package/dist/src/services/frontend/frontend-publish.service.js.map +1 -1
- package/dist/src/services/generation/domain-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/generator.schemas.d.ts.map +1 -1
- package/dist/src/services/generation/operation-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/resource-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/template-registry.service.d.ts.map +1 -1
- package/dist/src/services/registry/artifact-extractor.utils.d.ts.map +1 -1
- package/dist/src/services/registry/boundary-fanout.utils.d.ts.map +1 -1
- package/dist/src/services/registry/index.d.ts.map +1 -1
- package/dist/src/services/registry/registry-command.utils.d.ts.map +1 -1
- package/dist/src/services/registry/registry-config-resolver.service.d.ts.map +1 -1
- package/dist/src/services/registry/registry-credentials.service.d.ts.map +1 -1
- package/dist/src/services/registry/saas-root-required.error.d.ts.map +1 -1
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.d.ts +67 -0
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.d.ts.map +1 -0
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.js +212 -0
- package/dist/src/services/security/__tests__/csp-artifact-currency.live.contract.test.js.map +1 -0
- package/dist/src/services/security/__tests__/csp-boundary.test.d.ts.map +1 -1
- package/dist/src/services/security/__tests__/csp-sync.service.test.d.ts.map +1 -1
- package/dist/src/services/security/__tests__/csp-sync.service.test.js +411 -5
- package/dist/src/services/security/__tests__/csp-sync.service.test.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts +27 -5
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- package/dist/src/services/security/csp-sync.service.js +204 -16
- package/dist/src/services/security/csp-sync.service.js.map +1 -1
- package/dist/src/services/tools/utility-tools.service.d.ts.map +1 -1
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.d.ts +2 -0
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.d.ts.map +1 -0
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.js +94 -0
- package/dist/src/services/website/__tests__/website-structured-data-audit.adapter-seam.test.js.map +1 -0
- package/dist/src/services/website/website-structured-data-audit.service.d.ts +9 -0
- package/dist/src/services/website/website-structured-data-audit.service.d.ts.map +1 -1
- package/dist/src/services/website/website-structured-data-audit.service.js +72 -11
- package/dist/src/services/website/website-structured-data-audit.service.js.map +1 -1
- package/dist/src/test-utils/resolved-homes.test.utils.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/framework-root-package.json +2 -0
- package/package.json +19 -17
- package/scripts/app-dependency-alignment/propagated-engine-overrides.json +15 -0
- package/templates/infra/ci/deploy-docker-compose.yml.hbs +1 -1
- package/templates/infra/ci/deploy-k8s.yml.hbs +1 -1
- package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +394 -90
- package/templates/infra/docker-images/backend/Dockerfile.backend-base +7 -1
- package/templates/infra/docker-images/backend/Dockerfile.backend-base-java +7 -1
- package/templates/infra/docker-images/platform/Dockerfile.platform-base.dockerignore +23 -0
- package/templates/infra/k8s/applications/wildo-ai-application/backend.deployment.yaml.hbs +8 -5
- package/templates/infra/k8s/applications/wildo-ai-application/ingress.yaml.hbs +3 -2
- package/templates/infra/k8s/applications/wildo-ai-application/minion.deployment.yaml.hbs +22 -6
- package/templates/infra/k8s/applications/wildo-ai-application/worker.deployment.yaml.hbs +17 -13
- package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +11 -0
- package/templates/infra/k8s/storage/local/persistent-volumes.yaml.hbs +18 -4
- package/templates/saas/engine-peer-closure.json +12 -0
- package/templates/saas/i18n/email/components/EmailHeader.tsx +9 -0
- package/templates/saas/i18n/email/components/EmailLayout.tsx +14 -0
- package/templates/saas/i18n/email/resources/applicationApiKeys/create.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/deactivate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/reactivate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/regenerate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationApiKeys/rotate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationOAuthClients/create.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationOAuthClients/regenerate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationOAuthClients/rotate.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/deprecate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/promote.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applicationVersions/rollback.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/create.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/delete.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/transfer.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/transfer.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/update.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/applications/update.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/create.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/deactivate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/deactivate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/delete.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/reactivate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/reactivate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/regenerate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/regenerate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/rotate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationApiKeys/rotate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/disable_feature.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/enable_feature.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/reset_features.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationFeatures/update.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/create.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/delete.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/grantOwnership.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/reactivate.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/reactivate.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/resend.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/revoke.user-self_admin/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/revoke.user-self_invitee/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/suspend.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/suspend.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationMembers/update.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/create.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/delete.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/regenerate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/regenerate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/rotate.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationOAuthClients/rotate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/archive.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/create.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/delete.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/move.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/restore.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizationUnits/update.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/activate.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/create.admin.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/create.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/request_deletion.admin.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/request_deletion.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/restore.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/suspend.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/update.admin.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/organizations/update.organization-administrative/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/platformAccessGrants/requestAccess.organization-users/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/user_self/deactivate_account.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/user_self/reactivate_account.user-self/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/assign_roles.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/create.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/delete.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/force_password_reset.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/revoke_roles.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/send_invitation.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/suspend_user.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/unsuspend_user.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/resources/users/update.application-administrator/template.tsx +1 -1
- package/templates/saas/i18n/email/system/email-otp/template.tsx +1 -0
- package/templates/saas/i18n/email/system/email-verification/template.tsx +1 -1
- package/templates/saas/i18n/email/system/magic-link/template.tsx +1 -1
- package/templates/saas/i18n/email/system/new-device-login/template.tsx +1 -1
- package/templates/saas/i18n/email/system/organization-invitation/template.tsx +1 -0
- package/templates/saas/i18n/email/system/organization-member-removed/template.tsx +1 -0
- package/templates/saas/i18n/email/system/password-reset/template.tsx +1 -1
- package/templates/saas/i18n/email/system/payment-failed/template.tsx +1 -1
- package/templates/saas/i18n/email/system/security-alert/template.tsx +1 -0
- package/templates/saas/i18n/email/system/subscription-cancelled/template.tsx +1 -1
- package/templates/saas/i18n/email/system/subscription-confirmation/template.tsx +1 -0
- package/templates/saas/i18n/email/system/welcome-email/template.tsx +1 -1
- package/templates/saas/scenarios/add-file-picker-provider/files/frontend/src/engine/providers/__providerRef__.frontend-app.module.ts.hbs +10 -4
- package/templates/saas/scenarios/add-minion/files/minions/__minionDir__/src/index.ts.hbs +9 -5
- package/templates/saas/scenarios/add-module/scenario.json +3 -3
- package/templates/saas/scenarios/add-provider/scenario.json +36 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +52 -2
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/csp.config.ts +20 -3
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/pages/auth/exchange.tsx +75 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/pages/search.tsx.hbs +47 -3
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/theme/Root.tsx +46 -4
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/favicon.svg +5 -4
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/logo.svg +11 -5
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/wildo.tech-doc.config.ts.hbs +18 -7
- package/templates/saas/scenarios/add-website/files/website/src/app-origin.ts.hbs +32 -16
- package/templates/saas/scenarios/add-website/files/website/src/components/HeaderComponent.tsx +2 -2
- package/templates/saas/scenarios/add-website/files/website/src/pages/index.astro +1 -0
- package/templates/saas/scenarios/add-website/files/website/src/sections/landing.sections.tsx +2 -2
- package/templates/saas/scenarios/add-worker-node/files/workers/__workerDir__/src/index.ts.hbs +9 -5
- package/templates/saas/skeleton/.wildo-saas/dev-framework-scripts/sync-engine.sh +46 -14
- package/templates/saas/skeleton/CLAUDE.md.hbs +12 -0
- package/templates/saas/skeleton/backend-api/package.json.hbs +1 -1
- package/templates/saas/skeleton/backend-api/src/companion-exports.ts +13 -2
- package/templates/saas/skeleton/backend-api/src/index.ts +16 -0
- package/templates/saas/skeleton/frontend/src/config/settings-hub.config.ts +11 -5
- package/templates/saas/skeleton/frontend/src/engine/app-level-views/app-level-views.definitions.module.frontend.ts +1 -1
- package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +17 -0
- package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +19 -0
- package/templates/saas/skeleton/wildo.saas.config.ts.init.hbs +59 -2
- package/wildo-framework.info.json +1 -1
- package/templates/infra/k8s/internal/gotenberg/deployment.yaml.hbs +0 -46
- package/templates/infra/k8s/internal/gotenberg/service.yaml.hbs +0 -19
- package/templates/infra/k8s/middleware.yaml.hbs +0 -101
- package/templates/saas/scenarios/add-backend-provider/scenario.json +0 -17
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/favicon.png +0 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/static/img/logo.png +0 -0
- package/templates/saas/skeleton/backend-api/src/provider-contributions.ts +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { closeSync, constants as fsConstants, existsSync, fchmodSync, fstatSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, unlinkSync, writeFileSync, writeSync, } from 'fs';
|
|
2
|
-
import { dirname,
|
|
2
|
+
import { dirname, join, resolve } from 'path';
|
|
3
3
|
import { resolveFrameworkLayout, BOOTSTRAP_PLATFORM_SERVICES, ApplicationCreationVerificationEnvKey, WildoLocationType, } from '@wildo-ai/platform-config-lib';
|
|
4
4
|
import { EnvironmentUtils } from '../../services/environment/environment.service.js';
|
|
5
5
|
import { EnvironmentPaths } from '../../services/environment/environment-paths.service.js';
|
|
@@ -134,7 +134,7 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
134
134
|
}
|
|
135
135
|
if (applicationOperators?.length) {
|
|
136
136
|
for (const operator of applicationOperators) {
|
|
137
|
-
applyApplicationOperatorEnvTarget(
|
|
137
|
+
applyApplicationOperatorEnvTarget(operator);
|
|
138
138
|
}
|
|
139
139
|
log.success(` Reconciled .env files for ${applicationOperators.length} application operator root(s)`);
|
|
140
140
|
}
|
|
@@ -144,7 +144,7 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
144
144
|
assertNoApplicationBackendReservedEnvOverrides(app.extraEnv, `application backend ${app.serviceName}`);
|
|
145
145
|
const appEnv = {
|
|
146
146
|
...PlatformEnvVarsBuilder.buildApplicationBackendEnv(app.bootstrapCredentials, app.serviceName, credentials, addresses, config, env.name, declaredProviderScope(app.scopedProviderRefs), {
|
|
147
|
-
serviceVersion: readHostVersion(
|
|
147
|
+
serviceVersion: readHostVersion(app.applicationRoot, app.relativeDir),
|
|
148
148
|
appDatabaseName: app.appDatabaseName,
|
|
149
149
|
redisKeyPrefix: app.redisKeyPrefix,
|
|
150
150
|
storageBucketPrefix: app.storageBucketPrefix,
|
|
@@ -154,6 +154,17 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
154
154
|
: undefined,
|
|
155
155
|
mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,
|
|
156
156
|
runtimeEndpoints: app.runtimeEndpoints,
|
|
157
|
+
/*
|
|
158
|
+
* Backend→worker dispatch URLs (#426). The target has carried these since G-8 and this
|
|
159
|
+
* writer did not forward them, so `WILDO_WORKER_<NAME>_URL` reached the k8s render and
|
|
160
|
+
* never reached a developer's `backend-api/.env` — the second site of the same invariant,
|
|
161
|
+
* and the reason the chain was unreachable in the only environment anyone could try it in.
|
|
162
|
+
*
|
|
163
|
+
* Forwarded unconditionally: whether a LOCAL target HAS a URL is decided once, in
|
|
164
|
+
* `buildApplicationWorkerDispatchUrls`, and re-deciding it here would be a second opinion
|
|
165
|
+
* about the same question.
|
|
166
|
+
*/
|
|
167
|
+
workerUrls: app.workerUrls,
|
|
157
168
|
}),
|
|
158
169
|
...(app.extraEnv ?? {}),
|
|
159
170
|
};
|
|
@@ -171,11 +182,9 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
171
182
|
if (env.locationType === WildoLocationType.LOCAL &&
|
|
172
183
|
credentials.providerEnv?.IMMUDB_HOST &&
|
|
173
184
|
!appEnv['IMMUDB_STATE_DIR']) {
|
|
174
|
-
|
|
175
|
-
const appSaasRoot = join(frameworkLayout.repositoryRoot, dirname(app.relativeDir));
|
|
176
|
-
appEnv['IMMUDB_STATE_DIR'] = EnvironmentPaths.resolveScopedLocalDataServiceDir(appSaasRoot, 'immudb-audit-state');
|
|
185
|
+
appEnv['IMMUDB_STATE_DIR'] = EnvironmentPaths.resolveScopedLocalDataServiceDir(app.applicationRoot, 'immudb-audit-state');
|
|
177
186
|
}
|
|
178
|
-
writeEnvFile(join(
|
|
187
|
+
writeEnvFile(join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV), appEnv);
|
|
179
188
|
appCount++;
|
|
180
189
|
}
|
|
181
190
|
log.success(` Generated .env files for ${appCount} application backend(s)`);
|
|
@@ -187,9 +196,9 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
187
196
|
runtimeEndpoints: companion.runtimeEndpoints,
|
|
188
197
|
host: companion.extraEnv?.HOST,
|
|
189
198
|
port: companion.extraEnv?.PORT ? Number(companion.extraEnv.PORT) : undefined,
|
|
190
|
-
serviceVersion: readHostVersion(
|
|
199
|
+
serviceVersion: readHostVersion(companion.applicationRoot, companion.relativeDir),
|
|
191
200
|
});
|
|
192
|
-
writeEnvFile(join(
|
|
201
|
+
writeEnvFile(join(companion.applicationRoot, companion.relativeDir, FILE_NAMES.DOT_ENV), companionEnv);
|
|
193
202
|
companionCount++;
|
|
194
203
|
}
|
|
195
204
|
log.success(` Generated .env files for ${companionCount} companion API service(s)`);
|
|
@@ -214,7 +223,7 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
214
223
|
// and is not generated — the supported seam for that, rather than editing a derived file.
|
|
215
224
|
//
|
|
216
225
|
// `.env.example` is still written, unchanged, as the committed reference for a fresh clone.
|
|
217
|
-
const frontendDirectory = join(
|
|
226
|
+
const frontendDirectory = join(frontend.applicationRoot, frontend.relativeDir);
|
|
218
227
|
writeEnvFile(join(frontendDirectory, '.env.example'), frontend.envExample);
|
|
219
228
|
writeEnvFile(join(frontendDirectory, FILE_NAMES.DOT_ENV), frontend.envExample);
|
|
220
229
|
frontendCount++;
|
|
@@ -230,12 +239,12 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
230
239
|
// default-applied from `wildo.worker.config.ts > http` and shared
|
|
231
240
|
// with the REMOTE k8s render) into the worker `.env`.
|
|
232
241
|
http: worker.http,
|
|
233
|
-
serviceVersion: readHostVersion(
|
|
242
|
+
serviceVersion: readHostVersion(worker.applicationRoot, worker.relativeDir),
|
|
234
243
|
runtimeEndpoints: worker.runtimeEndpoints,
|
|
235
244
|
}),
|
|
236
245
|
...(worker.extraEnv ?? {}),
|
|
237
246
|
};
|
|
238
|
-
writeEnvFile(join(
|
|
247
|
+
writeEnvFile(join(worker.applicationRoot, worker.relativeDir, FILE_NAMES.DOT_ENV), workerEnv);
|
|
239
248
|
workerCount++;
|
|
240
249
|
}
|
|
241
250
|
log.success(` Generated .env files for ${workerCount} application worker(s)`);
|
|
@@ -255,11 +264,11 @@ export function generatePlatformServiceEnvFiles(env, frameworkPath, credentials,
|
|
|
255
264
|
: undefined,
|
|
256
265
|
mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,
|
|
257
266
|
runtimeEndpoints: minion.runtimeEndpoints,
|
|
258
|
-
serviceVersion: readHostVersion(
|
|
267
|
+
serviceVersion: readHostVersion(minion.applicationRoot, minion.relativeDir),
|
|
259
268
|
}),
|
|
260
269
|
...(minion.extraEnv ?? {}),
|
|
261
270
|
};
|
|
262
|
-
writeEnvFile(join(
|
|
271
|
+
writeEnvFile(join(minion.applicationRoot, minion.relativeDir, FILE_NAMES.DOT_ENV), minionEnv);
|
|
263
272
|
minionCount++;
|
|
264
273
|
}
|
|
265
274
|
log.success(` Generated .env files for ${minionCount} application minion(s)`);
|
|
@@ -421,11 +430,11 @@ const APPLICATION_OPERATOR_WRITABLE_ENV_KEYS = [
|
|
|
421
430
|
* actively mutating same-UID process; the final file itself is opened with
|
|
422
431
|
* `O_NOFOLLOW` and rechecked against its pathname identity.
|
|
423
432
|
*/
|
|
424
|
-
function applyApplicationOperatorEnvTarget(
|
|
425
|
-
const applicationRoot = resolveCanonicalApplicationOperatorRoot(
|
|
433
|
+
function applyApplicationOperatorEnvTarget(target) {
|
|
434
|
+
const applicationRoot = resolveCanonicalApplicationOperatorRoot(target.applicationRoot);
|
|
426
435
|
const filePath = join(applicationRoot, FILE_NAMES.DOT_ENV);
|
|
427
436
|
if (target.disposition === ApplicationOperatorEnvFileDisposition.REMOVE) {
|
|
428
|
-
removeOwnedApplicationOperatorEnvFile(filePath
|
|
437
|
+
removeOwnedApplicationOperatorEnvFile(filePath);
|
|
429
438
|
return;
|
|
430
439
|
}
|
|
431
440
|
const suppliedKeys = Object.keys(target.env).sort();
|
|
@@ -482,7 +491,7 @@ function applyApplicationOperatorEnvTarget(repositoryRoot, target) {
|
|
|
482
491
|
closeSync(descriptor);
|
|
483
492
|
}
|
|
484
493
|
}
|
|
485
|
-
function removeOwnedApplicationOperatorEnvFile(filePath
|
|
494
|
+
function removeOwnedApplicationOperatorEnvFile(filePath) {
|
|
486
495
|
try {
|
|
487
496
|
lstatSync(filePath);
|
|
488
497
|
}
|
|
@@ -491,7 +500,6 @@ function removeOwnedApplicationOperatorEnvFile(filePath, repositoryRoot, relativ
|
|
|
491
500
|
return;
|
|
492
501
|
throw error;
|
|
493
502
|
}
|
|
494
|
-
resolveCanonicalApplicationOperatorRoot(repositoryRoot, relativeDir);
|
|
495
503
|
const descriptor = openSync(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
|
|
496
504
|
try {
|
|
497
505
|
const opened = fstatSync(descriptor);
|
|
@@ -536,25 +544,20 @@ function assertCurrentUserSingleLinkFile(status, filePath, operation) {
|
|
|
536
544
|
throw new Error(`Application operator environment ${operation} requires a current-user-owned single-link file: ${filePath}.`);
|
|
537
545
|
}
|
|
538
546
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
cursor = join(cursor, segment);
|
|
553
|
-
const status = lstatSync(cursor);
|
|
554
|
-
if (status.isSymbolicLink() || !status.isDirectory() || realpathSync(cursor) !== cursor) {
|
|
555
|
-
throw new Error(`Application operator environment crosses a non-canonical directory: ${cursor}.`);
|
|
556
|
-
}
|
|
547
|
+
/**
|
|
548
|
+
* The canonical directory the operator `.env` is written into: the application root, symlinks
|
|
549
|
+
* resolved, and proven to be a real directory. Until 2026-09-06 this walked every path segment
|
|
550
|
+
* from the FRAMEWORK repository root down to the application and refused anything that was not
|
|
551
|
+
* strictly below it — an application was assumed to live under `examples/` of a checkout. An
|
|
552
|
+
* app-creator application lives wherever its author put it, so the anchor is the application
|
|
553
|
+
* root itself; the write below still opens the file `O_NOFOLLOW` and re-checks its identity.
|
|
554
|
+
*/
|
|
555
|
+
function resolveCanonicalApplicationOperatorRoot(applicationRoot) {
|
|
556
|
+
const lexicalApplicationRoot = resolve(applicationRoot);
|
|
557
|
+
const status = lstatSync(lexicalApplicationRoot);
|
|
558
|
+
if (!status.isDirectory()) {
|
|
559
|
+
throw new Error(`Application operator environment root is not a directory: ${lexicalApplicationRoot}.`);
|
|
557
560
|
}
|
|
558
|
-
return
|
|
561
|
+
return realpathSync(lexicalApplicationRoot);
|
|
559
562
|
}
|
|
560
563
|
//# sourceMappingURL=env-configuration-generator.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-configuration-generator.service.js","sourceRoot":"","sources":["../../../../../../src/services/environment/env-configuration-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,UAAU,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MAAM,CAAC,WAAW,EAAE,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,MAAM,EAAE,CAAC;YACxF,MAAM,IAAI,KAAK,CAAC,uEAAuE,MAAM,GAAG,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import {\n closeSync,\n constants as fsConstants,\n existsSync,\n fchmodSync,\n fstatSync,\n ftruncateSync,\n lstatSync,\n mkdirSync,\n openSync,\n readFileSync,\n realpathSync,\n unlinkSync,\n writeFileSync,\n writeSync,\n} from 'fs';\nimport { dirname, isAbsolute, join, relative, resolve, sep } from 'path';\nimport {\n resolveFrameworkLayout,\n type AppBootstrapCredentials,\n type K8sIngressRoute,\n BOOTSTRAP_PLATFORM_SERVICES,\n ApplicationCreationVerificationEnvKey,\n WildoLocationType,\n type RuntimeAccessDeclaration,\n} from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvConfigJson, PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { PlatformWildoServices } from '@wildo-ai/platform-config-lib';\nimport { PLATFORM_SERVICE_CATALOG } from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport { FILE_NAMES, GENERATED_FILE_HEADER } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { ServiceAddressResolver, AddressPerspective } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { PlatformEnvVarsBuilder } from '~wildo-cli/services/environment/env-vars-builder.service';\nimport { declaredProviderScope } from '~wildo-cli/services/credentials/provider-env-vars.utils';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { APPLICATION_BACKEND_ENV_KEY_LIST } from '@wildo-ai/platform-core-shared';\n\nconst APPLICATION_BACKEND_RESERVED_ENV_KEYS = new Set<string>(APPLICATION_BACKEND_ENV_KEY_LIST);\n\nfunction assertNoApplicationBackendReservedEnvOverrides(extraEnv: Readonly<Record<string, string>> | undefined, targetDescription: string): void {\n const overriddenKeys = Object.keys(extraEnv ?? {}).filter((key) => APPLICATION_BACKEND_RESERVED_ENV_KEYS.has(key)).sort();\n if (overriddenKeys.length > 0) {\n throw new Error(`${targetDescription} extraEnv cannot override canonical application-backend environment keys: ${overriddenKeys.join(', ')}`);\n }\n}\n\n/**\n * Read a host package.json `version` for OTel `service.version` (audit A-10). Returns undefined\n * when the file or field is absent — `service.version` is then simply omitted (graceful).\n */\nfunction readHostVersion(repositoryRoot: string, relativeDir: string): string | undefined {\n try {\n const pkg = JSON.parse(\n readFileSync(join(repositoryRoot, relativeDir, 'package.json'), 'utf8'),\n ) as { version?: unknown };\n return typeof pkg.version === 'string' ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Hydrate the infra `logging` / `observability` posture onto a freshly-loaded `config.json` from the\n * registry `env` (refreshed from authored infra by `RuntimeBootstrap.refreshEnvFromAuthored`).\n *\n * The setup-time `config.json` (`credentials.service.ts`) OMITS these blocks, and `ensureConfigJson`\n * only self-heals a MISSING file — so a config.json authored before those blocks existed never gains\n * them. The registry `env` is the live TRUTH and must WIN over a (possibly stale) block in config.json\n * (audit A-6 — `env.x ?? config.x`, not `config.x ?? env.x`: authored changes always propagate, while\n * an env that genuinely lacks the block still falls back to config.json). Without this hydration,\n * `emitLoggingEnv` / `emitObservabilityEnv` silently drop `LOG_LEVEL` / `OTEL_*` (Slice 2 Phase 5b).\n *\n * Shared by BOTH `buildPlatformServiceEnvMap` (platform hosts: apps-manager, crontabs, registry) and\n * `generatePlatformServiceEnvFiles` (app hosts). The platform hosts run the same\n * `--import @wildo-ai/saas-backend-lib/otel-preload` and MUST enable OTel identically, so a single\n * shared hydration keeps every host in lockstep — a prior split left the platform-service env map\n * (built from a SEPARATE un-hydrated config load) with no `OTEL_*` while the app hosts had it.\n */\nfunction hydrateInfraPostureFromEnv(\n config: PlatformEnvConfigJson,\n env: PlatformEnvironmentConfiguration,\n): void {\n config.logging = env.logging ?? config.logging;\n config.observability = env.observability ?? config.observability;\n config.providerSelection = env.providerSelection ?? config.providerSelection;\n}\n\n/**\n * The SINGLE seam every env-emitting path uses to obtain the config that feeds an `emit*Env`\n * builder — the local `.env` files AND every deploy generator (compose, k8s, CI). The on-disk\n * config.json is a FROZEN setup snapshot (written by `credentials.service.ts`) that OMITS the\n * infra-posture blocks (`logging`/`observability`/`providerSelection`); those are authored on the\n * infra config and kept fresh only in the registry `env`. Any builder that reads config.json raw\n * therefore emits no `OTEL_*`/`LOG_LEVEL`/provider-selection (the `emit*Env` builders early-return\n * on the absent block). Centralising the load+hydrate here makes that invariant UNBYPASSABLE: no\n * emit path constructs its own un-hydrated config. `providedConfig` covers the deploy callers that\n * already hold a config object (k8s/CI receive it through their options).\n */\nexport function loadInfraHydratedConfig(\n env: PlatformEnvironmentConfiguration,\n providedConfig?: PlatformEnvConfigJson | null,\n): PlatformEnvConfigJson {\n const config = providedConfig ?? EnvironmentUtils.loadConfigJson(env.name);\n if (!config) {\n throw new Error(`config.json not found for env '${env.name}' — run setup first`);\n }\n hydrateInfraPostureFromEnv(config, env);\n return config;\n}\n\n/**\n * A single container/Service port on the single-pod app deployment. `name` is a\n * K8s-valid port name (lowercase, `[a-z0-9-]`, ≤15 chars); `containerPort` is the\n * authored/derived port the app process listens on.\n */\nexport interface K8sPodPort {\n name: string;\n containerPort: number;\n}\n\nexport interface ApplicationBackendEnvTarget {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /** Relative path from framework root to the backend-api directory (e.g., \"examples/wonder-todos/backend-api\") */\n relativeDir: string;\n /** Absolute app-layout authority shared by every local backend/minion and the companion, independent of service nesting depth. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix` (Slice 3.6).\n * Emitted as `REDIS_KEY_PREFIX` in the per-app `.env` and consumed by\n * `RedisService` as the canonical app-level Redis key namespace.\n */\n redisKeyPrefix?: string;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix` (Slice 3.6).\n * Emitted as `STORAGE_BUCKET_PREFIX` in the per-app `.env` and prepended\n * to every application object key by `WildoManagedStorageProvider`.\n */\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * App-level deploy context (identical across a given app's backend targets,\n * like {@link runtimeEndpoints}): the app slug + serviceHosts-driven ingress\n * routes (each targeting a per-service Service) the CI render path emits for\n * the k8s ingress / compose Traefik lane. Populated for REMOTE only.\n */\n appName?: string;\n ingressRoutes?: K8sIngressRoute[];\n /**\n * Per-service model: the BACKEND pod's ports (NOT the whole app) — the primary\n * backend + its internal-only API siblings (`health`/`webhook`/`oauth`/`mcp` =\n * `mainBackendApiPort - 1..-4`, mirroring `buildK8sApplicationRuntimeEndpoints`).\n * Frontends are separate nginx Deployments ({@link frontends}), not folded in\n * here. The internal siblings must be Service-exposed too — other in-cluster\n * pods reach them via cluster-DNS on those ports. REMOTE only.\n */\n podPorts?: K8sPodPort[];\n /** Primary-backend health port (`mainBackendApiPort - 1`); drives the backend's k8s probes. Remote only. */\n healthPort?: number;\n /**\n * Per-service model: the app's public frontends, each deploying as its OWN\n * nginx Deployment + Service. `serviceName` is the k8s object + built image\n * name; `port` is the authored `defaultPort` the frontend Service exposes\n * (→ nginx :80). Same value across a given app's backend targets. REMOTE only.\n */\n frontends?: Array<{\n serviceName: string;\n port: number;\n /** Effective isolation for this frontend's nginx pod — see {@link ApplicationBackendEnvTarget.isolation}. */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n }>;\n /**\n * Effective container isolation for the BACKEND pod, already resolved through\n * `resolveAppServiceIsolation` — the authored block merged with the\n * kind-correct defaults, never the raw authored value.\n *\n * Resolved once at the config boundary rather than at each renderer because\n * two renderers consume it (k8s manifests, the compose app lane) and a\n * per-renderer fallback is how the same service row ends up running as\n * different users in two lanes.\n *\n * Carries only the authorable knobs. The floor — non-root, read-only rootfs,\n * dropped capabilities, seccomp, no service-account token — is emitted\n * unconditionally by both renderers and is deliberately not representable\n * here, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n /**\n * Backend→worker dispatch URLs (G-8 / MW4), keyed by the worker's\n * `wildo.saas.config.ts` bucket name → `http://{appSlug}-worker-{name}:{port}`.\n * Emitted into the backend env as `WILDO_WORKER_<NAME>_URL` so the backend's\n * `WorkerRemoteClientFactory` can reach each declared worker's per-app k8s\n * Service. Populated for REMOTE only (no k8s Services locally). Same value\n * across a given app's backend targets, like {@link runtimeEndpoints}.\n */\n workerUrls?: Record<string, string>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface CompanionPlatformEnvTarget {\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /** Relative path from framework root to the generated companion package */\n relativeDir: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface ApplicationFrontendEnvExampleTarget {\n serviceName: string;\n /** Relative path from framework root to the frontend directory */\n relativeDir: string;\n envExample: Record<string, string>;\n}\n\n/**\n * App-root operator environment generated from authored infra configuration.\n * This target is deliberately distinct from backend/frontend runtime targets:\n * it serves local developer tools and must never carry deployment secrets.\n */\nexport enum ApplicationOperatorEnvFileDisposition {\n WRITE = 'WRITE',\n REMOVE = 'REMOVE',\n}\n\ninterface ApplicationOperatorEnvTargetBase {\n /** Relative path from framework root to the SaaS application root. */\n relativeDir: string;\n}\n\nexport type ApplicationOperatorEnvTarget = ApplicationOperatorEnvTargetBase & (\n | {\n disposition: ApplicationOperatorEnvFileDisposition.WRITE;\n env: {\n [ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY]: string;\n [ApplicationCreationVerificationEnvKey.SILENT]: string;\n };\n }\n | {\n disposition: ApplicationOperatorEnvFileDisposition.REMOVE;\n }\n);\n\nexport interface ApplicationWorkerEnvTarget {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n workerName: string;\n serviceName: string;\n /** Relative path from framework root to the worker directory */\n relativeDir: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n /**\n * Authored `wildo.worker.config.ts > http`, default-applied (WorkerHttpSchema:\n * port 8080, healthPath /healthz, readyPath /readyz). Nested `http` object\n * (structurally a `WorkerHttp`) populated for every env — projected into the\n * worker `.env` (WORKER_HTTP_PORT/…) AND, for REMOTE, driving the per-worker\n * k8s Deployment container port + probes (shared by env-gen and k8s render).\n */\n http?: { port: number; healthPath: string; readyPath: string; metricsPath?: string };\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this worker belongs to\n * plus the authored `replicas`. Drives the per-worker Deployment + ClusterIP\n * Service render. Populated for REMOTE only.\n */\n appName?: string;\n replicas?: number;\n /**\n * Authored `wildo.worker.config.ts > isolation`, schema-defaulted. Same shape,\n * same floor/authorable split and same two-renderer consumption as the minion\n * field below — see its JSDoc for why the floor is absent from this type.\n *\n * `runAsUser` genuinely varies per worker image and is why the uid stays\n * authorable at all: Wonder Todos' Node worker runs as `USER node` (1000)\n * while its Rust worker is distroless `nonroot` (65532). A single hardcoded\n * uid would make one of the two unable to read its own image layers.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n}\n\n/**\n * Minions run the full backend pipeline (headless mode), so their env\n * contract mirrors ApplicationBackendEnvTarget: same data-service keys,\n * same bootstrap identity, same runtime topology. The `minionName` field\n * carries the authored bucket key from `wildo.saas.config.ts > minions`\n * for logging and error messages; it is deliberately NOT emitted as an\n * `APP_OWNED_SERVICE_NAME` env var. The Node minion runtime sources its\n * identity from its compiled-in `defineMinionInit({ minionName })` config\n * (cross-validated against the fetched `appConfig.minions[name]`), so an\n * env identity would be a second, drift-prone authority. See the\n * `BackgroundRuntimeType` model JSDoc in `@wildo-ai/saas-models` for the\n * worker (env-read) vs minion (compiled-in) identity distinction.\n */\nexport interface ApplicationMinionEnvTarget {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n /**\n * What this minion DECLARED about its access — forwarded to the env builder,\n * which withholds a backing service's topology from a runtime that may not\n * reach it (Step 5-egress / R-COHERENCE). Required, because an omitted\n * declaration and a declaration of nothing are different statements.\n */\n accessDeclaration: RuntimeAccessDeclaration;\n bootstrapCredentials: AppBootstrapCredentials;\n minionName: string;\n serviceName: string;\n /** Relative path from framework root to the minion directory */\n relativeDir: string;\n /** Absolute app-layout authority shared with the companion; never derive it from the minion directory. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n redisKeyPrefix?: string;\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * Authored `wildo.minion.config.ts > isolation`, schema-defaulted. Consumed by\n * BOTH deploy renderers (k8s securityContext + volumes; compose\n * `user`/`read_only`/`tmpfs`/`pids_limit`), which is why it is not confined to\n * the REMOTE-only fields below.\n *\n * Carries only the authorable knobs. The security floor — non-root, read-only\n * root filesystem, dropped capabilities, seccomp, no service-account token —\n * is emitted unconditionally by the renderers and is deliberately absent from\n * this shape, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n extraEnv?: Record<string, string>;\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this minion belongs to\n * plus the authored `wildo.minion.config.ts > reinstantiation` + `liveness`.\n * The render maps `reinstantiationPolicy` → K8s strategy\n * (`kill_previous`→Recreate, `let_run`→RollingUpdate) and builds the liveness\n * `exec` command from the liveness spec. Populated for REMOTE only.\n */\n appName?: string;\n reinstantiationPolicy?: 'kill_previous' | 'let_run';\n gracePeriodSec?: number;\n liveness?: {\n kind: 'file' | 'exec';\n filePath?: string;\n staleAfterSec?: number;\n execCommand?: string[];\n };\n}\n\nexport function buildPlatformServiceEnvMap(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n frameworkPath: string,\n): Record<string, Record<string, string>> {\n // Single load+hydrate seam (loadInfraHydratedConfig): the setup-time config.json omits the\n // infra-posture blocks, so the platform hosts (same otel-preload `--import` + flush logic) would\n // emit no OTEL_*/LOG_LEVEL without this. Reached from BOTH `local up` (platform-lifecycle) and the\n // env-file wrapper below.\n const config = loadInfraHydratedConfig(env);\n\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n // Each platform host tags its OTel `service.version` from its OWN package.json version (audit A-10\n // parity with the app hosts). Resolved here because this is where the framework repository root is\n // available; the pure env-map builders receive the already-read version string.\n const repositoryRoot = resolveFrameworkLayout(frameworkPath).repositoryRoot;\n\n const envByDir: Record<string, Record<string, string>> = {\n [PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir]:\n PlatformEnvVarsBuilder.buildAppsManagerFullEnv(credentials, addresses, config, env, {\n serviceVersion: readHostVersion(\n repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n ),\n }),\n };\n\n for (const service of BOOTSTRAP_PLATFORM_SERVICES) {\n envByDir[PLATFORM_SERVICE_CATALOG[service].sourceDir] = PlatformEnvVarsBuilder.buildBootstrapEnv(\n service,\n credentials,\n addresses,\n config,\n env,\n readHostVersion(repositoryRoot, PLATFORM_SERVICE_CATALOG[service].sourceDir),\n );\n }\n\n return envByDir;\n}\n\nexport function generatePlatformServiceEnvFiles(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string,\n credentials: PlatformEnvSecretsJson,\n log: Logger,\n applicationBackends?: ApplicationBackendEnvTarget[],\n companionApis?: CompanionPlatformEnvTarget[],\n applicationFrontends?: ApplicationFrontendEnvExampleTarget[],\n applicationWorkers?: ApplicationWorkerEnvTarget[],\n applicationMinions?: ApplicationMinionEnvTarget[],\n applicationOperators?: ApplicationOperatorEnvTarget[],\n writePolicy?: {\n /**\n * Skip the SHARED platform-service `.env` writes (apps-manager, module-registry, crontabs) while\n * still writing the invoking application's own targets. Set by `env-sync` when a FOREIGN\n * `wildo local dev` session owns the platform (issue #50): those files carry the running\n * platform's credential basis and are the owner's to regenerate.\n */\n skipPlatformServiceEnvs?: boolean;\n },\n): void {\n const platformServiceEnvs = buildPlatformServiceEnvMap(env, credentials, frameworkPath);\n // Single load+hydrate seam (loadInfraHydratedConfig) for the app-host loops below; the platform\n // hosts are hydrated the same way inside buildPlatformServiceEnvMap above.\n const config = loadInfraHydratedConfig(env);\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n const frameworkLayout = resolveFrameworkLayout(frameworkPath);\n let serviceCount = 0;\n\n // Provider-secrets sink (LOCAL only). Written here — the SOLE writer of every\n // Wildo non-compose `.env` — so it is present exactly whenever the backend\n // `.env` is, after `wildo config sync` AND after the `wildo local dev`\n // bootstrap, for out-of-band consumers (framework-dev test harnesses).\n const providerSecretsEnvPath = generateProviderSecretsEnvFile(env, credentials);\n if (providerSecretsEnvPath) {\n log.success(` Generated provider-secrets env file: ${providerSecretsEnvPath}`);\n }\n\n if (writePolicy?.skipPlatformServiceEnvs !== true) {\n writeEnvFile(\n join(\n frameworkLayout.repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n FILE_NAMES.DOT_ENV,\n ),\n platformServiceEnvs[PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir],\n );\n serviceCount++;\n\n for (const [dir, serviceEnv] of Object.entries(platformServiceEnvs)) {\n if (dir === PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir) {\n continue;\n }\n writeEnvFile(join(frameworkLayout.repositoryRoot, dir, FILE_NAMES.DOT_ENV), serviceEnv);\n serviceCount++;\n }\n\n log.success(` Generated .env files for ${serviceCount} platform services`);\n }\n\n if (applicationOperators?.length) {\n for (const operator of applicationOperators) {\n applyApplicationOperatorEnvTarget(frameworkLayout.repositoryRoot, operator);\n }\n log.success(` Reconciled .env files for ${applicationOperators.length} application operator root(s)`);\n }\n\n if (applicationBackends?.length) {\n let appCount = 0;\n for (const app of applicationBackends) {\n assertNoApplicationBackendReservedEnvOverrides(app.extraEnv, `application backend ${app.serviceName}`);\n const appEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationBackendEnv(\n app.bootstrapCredentials,\n app.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(app.scopedProviderRefs),\n {\n serviceVersion: readHostVersion(frameworkLayout.repositoryRoot, app.relativeDir),\n appDatabaseName: app.appDatabaseName,\n redisKeyPrefix: app.redisKeyPrefix,\n storageBucketPrefix: app.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? app.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: app.runtimeEndpoints,\n },\n ),\n ...(app.extraEnv ?? {}),\n };\n // LOCAL-lane durable trust-anchor dir for the immudb audit provider (cross-restart tamper-evidence).\n // Provision it ONLY when immudb audit is configured (its connection secret is present) and not\n // already pinned by the operator. The value is a host absolute path under the durable local_data\n // tier — preserved by `wildo local down`, wiped by `reset` (on reset immudb re-provisions with a\n // new uuid, so a lingering anchor safely re-bootstraps rather than false-alarming). This is the\n // LOCAL mechanism ONLY: a host path is meaningless inside a container. REMOTE (staging/production)\n // provisions the anchor on a durable IN-CONTAINER volume instead — the k8s app-backend Deployment\n // mounts a PVC and sets IMMUDB_STATE_DIR (`K8sManifestGenerator.buildForApplication` /\n // `renderApplicationForTarget` + `backend.immudb-audit-state.pvc.yaml.hbs`), and the compose app\n // backend mounts a named volume and sets IMMUDB_STATE_DIR (`docker-compose.app.yml.hbs`, wired in\n // `generateCiDeployArtifacts`). Both use `IMMUDB_AUDIT_STATE_CONTAINER_DIR`.\n if (\n env.locationType === WildoLocationType.LOCAL &&\n credentials.providerEnv?.IMMUDB_HOST &&\n !appEnv['IMMUDB_STATE_DIR']\n ) {\n // Standard Wildo app layout: the backend-api dir sits directly under the app's saas root.\n const appSaasRoot = join(frameworkLayout.repositoryRoot, dirname(app.relativeDir));\n appEnv['IMMUDB_STATE_DIR'] = EnvironmentPaths.resolveScopedLocalDataServiceDir(appSaasRoot, 'immudb-audit-state');\n }\n writeEnvFile(join(frameworkLayout.repositoryRoot, app.relativeDir, FILE_NAMES.DOT_ENV), appEnv);\n appCount++;\n }\n log.success(` Generated .env files for ${appCount} application backend(s)`);\n }\n\n if (companionApis?.length) {\n let companionCount = 0;\n for (const companion of companionApis) {\n const companionEnv = PlatformEnvVarsBuilder.buildCompanionPlatformEnv(\n companion.bootstrapCredentials,\n companion.serviceName,\n credentials,\n addresses,\n config,\n env,\n {\n runtimeEndpoints: companion.runtimeEndpoints,\n host: companion.extraEnv?.HOST,\n port: companion.extraEnv?.PORT ? Number(companion.extraEnv.PORT) : undefined,\n serviceVersion: readHostVersion(frameworkLayout.repositoryRoot, companion.relativeDir),\n },\n );\n writeEnvFile(\n join(frameworkLayout.repositoryRoot, companion.relativeDir, FILE_NAMES.DOT_ENV),\n companionEnv,\n );\n companionCount++;\n }\n log.success(` Generated .env files for ${companionCount} companion API service(s)`);\n }\n\n if (applicationFrontends?.length) {\n let frontendCount = 0;\n for (const frontend of applicationFrontends) {\n // BOTH files, and `.env` is the one that matters.\n //\n // Every other service kind here writes `FILE_NAMES.DOT_ENV`. Frontends stopped at\n // `.env.example`, which Vite's `loadEnv` never reads — so the file the dev server actually\n // consumes was generated by nobody and maintained by hand. That is not a cosmetic gap:\n // `environment-hydration.utils.ts` records what it cost on 2026-08-13. Sync reconciled an\n // edge scheme into `.env.example` and `APPLICATION_RUNTIME_ENDPOINTS`, the hand-written\n // `app/.env` kept its older value, the browser sent an `Origin` the backend did not expect,\n // and `_validateFrontendAppOrigin` refused every `POST /auth/identify` with a 403. Login was\n // completely broken and nothing in any log named the cause.\n //\n // Generating `.env` makes the frontend match every sibling: the file the runtime reads is the\n // file this generator owns, so it cannot drift from the topology it was derived from. A\n // developer who needs a local override still has Vite's `.env.local`, which takes precedence\n // and is not generated — the supported seam for that, rather than editing a derived file.\n //\n // `.env.example` is still written, unchanged, as the committed reference for a fresh clone.\n const frontendDirectory = join(frameworkLayout.repositoryRoot, frontend.relativeDir);\n writeEnvFile(join(frontendDirectory, '.env.example'), frontend.envExample);\n writeEnvFile(join(frontendDirectory, FILE_NAMES.DOT_ENV), frontend.envExample);\n frontendCount++;\n }\n log.success(` Generated .env and .env.example files for ${frontendCount} application frontend(s)`);\n }\n\n if (applicationWorkers?.length) {\n let workerCount = 0;\n for (const worker of applicationWorkers) {\n const workerEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationWorkerEnv(\n worker.bootstrapCredentials,\n worker.workerName,\n worker.serviceName,\n credentials,\n config,\n env.name,\n declaredProviderScope(worker.scopedProviderRefs),\n {\n // Project the authored HTTP surface (carried on the target,\n // default-applied from `wildo.worker.config.ts > http` and shared\n // with the REMOTE k8s render) into the worker `.env`.\n http: worker.http,\n serviceVersion: readHostVersion(frameworkLayout.repositoryRoot, worker.relativeDir),\n runtimeEndpoints: worker.runtimeEndpoints,\n },\n ),\n ...(worker.extraEnv ?? {}),\n };\n writeEnvFile(join(frameworkLayout.repositoryRoot, worker.relativeDir, FILE_NAMES.DOT_ENV), workerEnv);\n workerCount++;\n }\n log.success(` Generated .env files for ${workerCount} application worker(s)`);\n }\n\n if (applicationMinions?.length) {\n let minionCount = 0;\n for (const minion of applicationMinions) {\n assertNoApplicationBackendReservedEnvOverrides(minion.extraEnv, `application minion ${minion.serviceName}`);\n const minionEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationMinionEnv(\n minion.bootstrapCredentials,\n minion.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(minion.scopedProviderRefs),\n minion.accessDeclaration,\n {\n appDatabaseName: minion.appDatabaseName,\n redisKeyPrefix: minion.redisKeyPrefix,\n storageBucketPrefix: minion.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? minion.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: minion.runtimeEndpoints,\n serviceVersion: readHostVersion(frameworkLayout.repositoryRoot, minion.relativeDir),\n },\n ),\n ...(minion.extraEnv ?? {}),\n };\n writeEnvFile(join(frameworkLayout.repositoryRoot, minion.relativeDir, FILE_NAMES.DOT_ENV), minionEnv);\n minionCount++;\n }\n log.success(` Generated .env files for ${minionCount} application minion(s)`);\n }\n}\n\n/**\n * Emit the per-env provider-SECRETS env file — the exact runtime provider env\n * (`PlatformEnvVarsBuilder.buildRuntimeProviderEnv`: authored `providerEnv` +\n * framework-injected immudb state key) the backend/companion/worker receive,\n * projected as a standalone `.env` for out-of-band consumers that are NOT\n * launched by `wildo local dev` (framework-dev integration test harnesses,\n * ad-hoc scripts). Carries the SAME provider VALUES as the backend `.env` (one\n * authority — `buildRuntimeProviderEnv`), so it never drifts.\n *\n * Serialized with dotenv double-quote escaping (see {@link encodeDotenvValue}),\n * NOT the raw `writeEnvFile` used for the backend `.env`: the framework-injected\n * `IMMUDB_STATE_PUBLIC_KEY` is a MULTI-LINE SPKI PEM, and a bare `key=value`\n * would split it across physical lines and break the harness loader. Escaping\n * keeps every value on one physical line and round-trips through the matched\n * loader (`engine-behavior-e2e/src/provider-env.ts`) and a standard `.env`\n * parser. Single-line values (API keys) are emitted bare, unchanged.\n *\n * DISTINCT from the runtime-SCOPE `.wildo-providers.env`\n * (`PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME`), which carries the provider\n * allow-list artifact PATH, not secret values. Never conflate them.\n *\n * LOCAL-only: remote/CI provider secrets are delivered via k8s `providers-secret`,\n * never a local plaintext file. Returns the written path, or `null` when skipped\n * (non-local env, or zero provider secrets to emit).\n */\nexport function generateProviderSecretsEnvFile(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n): string | null {\n if (env.locationType !== WildoLocationType.LOCAL) return null;\n const providerEnv = PlatformEnvVarsBuilder.buildRuntimeProviderEnv(credentials);\n if (Object.keys(providerEnv).length === 0) return null;\n const filePath = join(\n EnvironmentPaths.resolveGeneratedProvidersDir(env.name),\n FILE_NAMES.PROVIDER_SECRETS_ENV,\n );\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n const content = Object.entries(providerEnv)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n writeFileSync(filePath, `${GENERATED_FILE_HEADER}\\n\\n${content}\\n`);\n return filePath;\n}\n\n/**\n * dotenv encoding — the single escaping authority for EVERY `.env` this module writes\n * (the per-service files via {@link writeEnvFile} and the provider-secrets sink).\n *\n * ## What the reader actually does\n *\n * These files are read by Node processes through the `dotenv` package, whose quoting rules are\n * asymmetric and are the whole reason this function is not a one-liner:\n *\n * | Form | dotenv behaviour |\n * |-----------------|-----------------------------------------------------------------------|\n * | bare | verbatim to end of line, but TRIMMED and truncated at an inline `#` |\n * | `\"…\"` | quotes stripped, `\\n` / `\\r` EXPANDED — but `\\\"` and `\\\\` are NOT unescaped |\n * | `'…'` | quotes stripped, contents fully VERBATIM (real newlines included) |\n * | `` `…` `` | same as single quotes, verbatim |\n *\n * The double-quoted row is the trap. Escaping `\"` as `\\\"` (the JSON/shell reflex) is silently\n * LOSSY here: dotenv hands the consumer the literal backslashes. That is exactly how every\n * JSON-valued var — `APPLICATION_RUNTIME_ENDPOINTS`, `WILDO_PROVIDER_SELECTION_OVERRIDES`,\n * `WILDO_SERVICE_HOSTS` — reached `JSON.parse` as `{\\\"k\\\":…}` and threw\n * `Expected property name or '}' at position 1`, crash-looping backend-api, every minion and the\n * dev companion at startup while the error surfaced as an env *validation* failure. The same\n * lossiness applies to `\\\\`, so a value containing a real backslash was corrupted too.\n *\n * ## The encoding chosen here\n *\n * Escape only what the reader unescapes, and otherwise quote VERBATIM:\n *\n * 1. bare — for clean single-line values (API keys, URLs, ports), keeping files readable/diff-stable;\n * 2. double quotes with `\\n` / `\\r` escaped — the ONLY branch that escapes anything, and it is\n * entered only when the value has no `\"` and no `\\`, so nothing lossy can be emitted. This keeps\n * a multi-line SPKI PEM (`IMMUDB_STATE_PUBLIC_KEY`) on ONE physical line exactly as before;\n * 3. single quotes, verbatim — carries `\"` and `\\` (the JSON case) losslessly;\n * 4. backticks, verbatim — for a value carrying `'` as well;\n * 5. throw — a value carrying all three quote characters has no lossless dotenv form. Fail closed\n * at generation time rather than write config that silently misparses at startup.\n *\n * Builders hand us RAW values by contract (see the value-contract note in\n * `env-vars-builder.service.ts`) — never pre-quoted — so encoding happens exactly once, here.\n *\n * This is the LOCAL dotenv sink only. The compose (`encodeComposeEnvValue`), CI (`formatEnvFile`)\n * and k8s (raw base64) sinks have different readers and therefore different contracts — do not\n * unify them, and do not push encoding back onto the builders.\n */\nfunction encodeDotenvValue(key: string, value: string): string {\n const hasNewline = /[\\n\\r]/.test(value);\n const hasDoubleQuote = value.includes('\"');\n const hasSingleQuote = value.includes(\"'\");\n const hasBacktick = value.includes('`');\n const hasBackslash = value.includes('\\\\');\n\n if (\n !hasNewline &&\n !hasDoubleQuote &&\n !hasSingleQuote &&\n !hasBacktick &&\n !value.includes('#') &&\n value !== '' &&\n value === value.trim()\n ) {\n return value;\n }\n\n // Safe ONLY without `\"` / `\\`, the two characters dotenv refuses to unescape.\n if (!hasDoubleQuote && !hasBackslash) {\n return `\"${value.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')}\"`;\n }\n\n if (!hasSingleQuote) return `'${value}'`;\n\n if (!hasBacktick) return `\\`${value}\\``;\n\n throw new Error(\n `Cannot encode env var \"${key}\" for a dotenv file: its value contains a double quote, a single quote and a backtick, ` +\n `so no dotenv quoting form can carry it without corruption. Reshape the value at its builder.`,\n );\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Write one generated `.env`, serializing every value through {@link encodeDotenvValue}.\n *\n * These files are loaded by Node processes through the `dotenv` package. That reader — not any\n * general notion of \"escaped\" — is the contract {@link encodeDotenvValue} is written against.\n *\n * Two defects came from ignoring it, in opposite directions, and both are pinned by tests:\n * - a bare `key=value` silently BROKE every multi-line value: the immudb `IMMUDB_STATE_PUBLIC_KEY`\n * SPKI PEM spilled across four physical lines and dotenv kept only `-----BEGIN PUBLIC KEY-----`,\n * so the audit client could not parse its pinned key and fail-closed into a FALSE\n * \"immudb audit store TAMPER DETECTED\";\n * - the escaping added to fix that then over-reached and escaped `\"` as `\\\"`, which dotenv does NOT\n * unescape, so every JSON-valued var (`APPLICATION_RUNTIME_ENDPOINTS`, …) reached `JSON.parse`\n * with literal backslashes and crash-looped backend-api, the minions and the companion.\n *\n * Encoding is the serializer's job — do not push it back onto the builders (the k8s and compose\n * sinks have different readers and would then receive literal quotes).\n */\nfunction writeEnvFile(filePath: string, env: Record<string, string>): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const content = Object.entries(env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n\n writeFileSync(filePath, GENERATED_FILE_HEADER + '\\n\\n' + content + '\\n');\n}\n\nconst APPLICATION_OPERATOR_ENV_HEADER = `${GENERATED_FILE_HEADER}\\n# application-creation-verification operator environment`;\nconst APPLICATION_OPERATOR_WRITABLE_ENV_KEYS = [\n ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY,\n ApplicationCreationVerificationEnvKey.SILENT,\n] as const;\n\n/**\n * Reconcile the CLI-owned app-root operator env without following symlinks.\n *\n * The component checks cover hostile state that already exists when sync owns\n * the path. Descriptor-relative publication is not available through Node's\n * portable filesystem API, so this does not claim race freedom against an\n * actively mutating same-UID process; the final file itself is opened with\n * `O_NOFOLLOW` and rechecked against its pathname identity.\n */\nfunction applyApplicationOperatorEnvTarget(repositoryRoot: string, target: ApplicationOperatorEnvTarget): void {\n const applicationRoot = resolveCanonicalApplicationOperatorRoot(repositoryRoot, target.relativeDir);\n const filePath = join(applicationRoot, FILE_NAMES.DOT_ENV);\n\n if (target.disposition === ApplicationOperatorEnvFileDisposition.REMOVE) {\n removeOwnedApplicationOperatorEnvFile(filePath, repositoryRoot, target.relativeDir);\n return;\n }\n\n const suppliedKeys = Object.keys(target.env).sort();\n const expectedKeys = [...APPLICATION_OPERATOR_WRITABLE_ENV_KEYS].sort();\n if (suppliedKeys.length !== expectedKeys.length || suppliedKeys.some((key, index) => key !== expectedKeys[index])) {\n throw new Error(`Application operator environment must contain exactly: ${expectedKeys.join(', ')}.`);\n }\n\n const content = Object.entries(target.env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n let created = false;\n let descriptor: number;\n try {\n descriptor = openSync(\n filePath,\n fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_EXCL | fsConstants.O_NOFOLLOW,\n 0o600,\n );\n created = true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error;\n descriptor = openSync(filePath, fsConstants.O_RDWR | fsConstants.O_NOFOLLOW);\n }\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (!created && !readFileSync(descriptor, 'utf8').startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to overwrite an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n fchmodSync(descriptor, 0o600);\n ftruncateSync(descriptor, 0);\n // ⚠️ Written at an EXPLICIT position 0, not via `writeFileSync(fd, …)`.\n //\n // The ownership check above calls `readFileSync(descriptor)`, which ADVANCES\n // the descriptor's file position to EOF. `ftruncateSync` resets the file's\n // LENGTH but not that position, so a positionless write lands at the old\n // offset and the kernel fills the gap with NUL bytes.\n //\n // The failure is self-inflicting and delayed, which is what made it hard to\n // see: the write SUCCEEDS and the file reads correctly to a human (the NULs\n // are invisible in most editors), but the header no longer sits at byte 0 —\n // so the NEXT sync fails the `startsWith(HEADER)` check and refuses to\n // overwrite a file the framework itself had just written. Observed on Wonder\n // Todos as exactly 240 NUL bytes in front of 240 bytes of correct content.\n writeSync(descriptor, `${APPLICATION_OPERATOR_ENV_HEADER}\\n\\n${content}\\n`, 0, 'utf8');\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed during publication: ${filePath}.`);\n }\n } finally {\n closeSync(descriptor);\n }\n}\n\nfunction removeOwnedApplicationOperatorEnvFile(filePath: string, repositoryRoot: string, relativeDir: string): void {\n try {\n lstatSync(filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return;\n throw error;\n }\n resolveCanonicalApplicationOperatorRoot(repositoryRoot, relativeDir);\n\n const descriptor = openSync(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment removal target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n const content = readFileSync(descriptor, 'utf8');\n if (!content.startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to remove an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed before removal: ${filePath}.`);\n }\n unlinkSync(filePath);\n } finally {\n closeSync(descriptor);\n }\n}\n\n/**\n * Which side of the operator-environment file lifecycle a single-link assertion is guarding.\n *\n * The member VALUES are interpolated verbatim into the thrown messages (\"… environment publication\n * requires …\"), so they read as prose while still being a closed two-member vocabulary rather than\n * a free-form string an caller could mistype into an incoherent error.\n */\nenum ApplicationOperatorEnvironmentFileOperation {\n /** Writing the operator environment file. */\n PUBLICATION = 'publication',\n /** Unlinking the operator environment file. */\n REMOVAL = 'removal',\n}\n\nfunction assertCurrentUserSingleLinkFile(\n status: { uid: number; nlink: number },\n filePath: string,\n operation: ApplicationOperatorEnvironmentFileOperation,\n): void {\n if (typeof process.getuid !== 'function') {\n throw new Error(`Application operator environment ${operation} cannot establish current-user ownership on this platform: ${filePath}.`);\n }\n if (status.uid !== process.getuid() || status.nlink !== 1) {\n throw new Error(`Application operator environment ${operation} requires a current-user-owned single-link file: ${filePath}.`);\n }\n}\n\nfunction resolveCanonicalApplicationOperatorRoot(repositoryRoot: string, relativeDir: string): string {\n const lexicalRepositoryRoot = resolve(repositoryRoot);\n const canonicalRepositoryRoot = realpathSync(lexicalRepositoryRoot);\n const applicationRoot = resolve(canonicalRepositoryRoot, relativeDir);\n const relativeApplicationRoot = relative(canonicalRepositoryRoot, applicationRoot);\n if (\n relativeApplicationRoot === ''\n || relativeApplicationRoot === '..'\n || relativeApplicationRoot.startsWith(`..${sep}`)\n || isAbsolute(relativeApplicationRoot)\n ) {\n throw new Error('Application operator environment target must remain below the framework repository root.');\n }\n\n let cursor = canonicalRepositoryRoot;\n for (const segment of relativeApplicationRoot.split(sep)) {\n cursor = join(cursor, segment);\n const status = lstatSync(cursor);\n if (status.isSymbolicLink() || !status.isDirectory() || realpathSync(cursor) !== cursor) {\n throw new Error(`Application operator environment crosses a non-canonical directory: ${cursor}.`);\n }\n }\n return applicationRoot;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"env-configuration-generator.service.js","sourceRoot":"","sources":["../../../../src/services/environment/env-configuration-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,GACV,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EACL,sBAAsB,EAGtB,2BAA2B,EAC3B,qCAAqC,EACrC,iBAAiB,GAElB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;A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ACD,OAAO,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import {\n closeSync,\n constants as fsConstants,\n existsSync,\n fchmodSync,\n fstatSync,\n ftruncateSync,\n lstatSync,\n mkdirSync,\n openSync,\n readFileSync,\n realpathSync,\n unlinkSync,\n writeFileSync,\n writeSync,\n} from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport {\n resolveFrameworkLayout,\n type AppBootstrapCredentials,\n type K8sIngressRoute,\n BOOTSTRAP_PLATFORM_SERVICES,\n ApplicationCreationVerificationEnvKey,\n WildoLocationType,\n type RuntimeAccessDeclaration,\n} from '@wildo-ai/platform-config-lib';\nimport type { PlatformEnvConfigJson, PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { PlatformWildoServices } from '@wildo-ai/platform-config-lib';\nimport { PLATFORM_SERVICE_CATALOG } from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport { FILE_NAMES, GENERATED_FILE_HEADER } from '~wildo-cli/infrastructure/io/io.schemas';\nimport { ServiceAddressResolver, AddressPerspective } from '~wildo-cli/services/catalog/service-address-resolver.service';\nimport { PlatformEnvVarsBuilder } from '~wildo-cli/services/environment/env-vars-builder.service';\nimport { declaredProviderScope } from '~wildo-cli/services/credentials/provider-env-vars.utils';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { APPLICATION_BACKEND_ENV_KEY_LIST } from '@wildo-ai/platform-core-shared';\n\nconst APPLICATION_BACKEND_RESERVED_ENV_KEYS = new Set<string>(APPLICATION_BACKEND_ENV_KEY_LIST);\n\nfunction assertNoApplicationBackendReservedEnvOverrides(extraEnv: Readonly<Record<string, string>> | undefined, targetDescription: string): void {\n const overriddenKeys = Object.keys(extraEnv ?? {}).filter((key) => APPLICATION_BACKEND_RESERVED_ENV_KEYS.has(key)).sort();\n if (overriddenKeys.length > 0) {\n throw new Error(`${targetDescription} extraEnv cannot override canonical application-backend environment keys: ${overriddenKeys.join(', ')}`);\n }\n}\n\n/**\n * Read a host package.json `version` for OTel `service.version` (audit A-10). Returns undefined\n * when the file or field is absent — `service.version` is then simply omitted (graceful).\n */\nfunction readHostVersion(repositoryRoot: string, relativeDir: string): string | undefined {\n try {\n const pkg = JSON.parse(\n readFileSync(join(repositoryRoot, relativeDir, 'package.json'), 'utf8'),\n ) as { version?: unknown };\n return typeof pkg.version === 'string' ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Hydrate the infra `logging` / `observability` posture onto a freshly-loaded `config.json` from the\n * registry `env` (refreshed from authored infra by `RuntimeBootstrap.refreshEnvFromAuthored`).\n *\n * The setup-time `config.json` (`credentials.service.ts`) OMITS these blocks, and `ensureConfigJson`\n * only self-heals a MISSING file — so a config.json authored before those blocks existed never gains\n * them. The registry `env` is the live TRUTH and must WIN over a (possibly stale) block in config.json\n * (audit A-6 — `env.x ?? config.x`, not `config.x ?? env.x`: authored changes always propagate, while\n * an env that genuinely lacks the block still falls back to config.json). Without this hydration,\n * `emitLoggingEnv` / `emitObservabilityEnv` silently drop `LOG_LEVEL` / `OTEL_*` (Slice 2 Phase 5b).\n *\n * Shared by BOTH `buildPlatformServiceEnvMap` (platform hosts: apps-manager, crontabs, registry) and\n * `generatePlatformServiceEnvFiles` (app hosts). The platform hosts run the same\n * `--import @wildo-ai/saas-backend-lib/otel-preload` and MUST enable OTel identically, so a single\n * shared hydration keeps every host in lockstep — a prior split left the platform-service env map\n * (built from a SEPARATE un-hydrated config load) with no `OTEL_*` while the app hosts had it.\n */\nfunction hydrateInfraPostureFromEnv(\n config: PlatformEnvConfigJson,\n env: PlatformEnvironmentConfiguration,\n): void {\n config.logging = env.logging ?? config.logging;\n config.observability = env.observability ?? config.observability;\n config.providerSelection = env.providerSelection ?? config.providerSelection;\n}\n\n/**\n * The SINGLE seam every env-emitting path uses to obtain the config that feeds an `emit*Env`\n * builder — the local `.env` files AND every deploy generator (compose, k8s, CI). The on-disk\n * config.json is a FROZEN setup snapshot (written by `credentials.service.ts`) that OMITS the\n * infra-posture blocks (`logging`/`observability`/`providerSelection`); those are authored on the\n * infra config and kept fresh only in the registry `env`. Any builder that reads config.json raw\n * therefore emits no `OTEL_*`/`LOG_LEVEL`/provider-selection (the `emit*Env` builders early-return\n * on the absent block). Centralising the load+hydrate here makes that invariant UNBYPASSABLE: no\n * emit path constructs its own un-hydrated config. `providedConfig` covers the deploy callers that\n * already hold a config object (k8s/CI receive it through their options).\n */\nexport function loadInfraHydratedConfig(\n env: PlatformEnvironmentConfiguration,\n providedConfig?: PlatformEnvConfigJson | null,\n): PlatformEnvConfigJson {\n const config = providedConfig ?? EnvironmentUtils.loadConfigJson(env.name);\n if (!config) {\n throw new Error(`config.json not found for env '${env.name}' — run setup first`);\n }\n hydrateInfraPostureFromEnv(config, env);\n return config;\n}\n\n/**\n * A single container/Service port on the single-pod app deployment. `name` is a\n * K8s-valid port name (lowercase, `[a-z0-9-]`, ≤15 chars); `containerPort` is the\n * authored/derived port the app process listens on.\n */\nexport interface K8sPodPort {\n name: string;\n containerPort: number;\n}\n\n/**\n * ## Where an application's runtime targets are anchored\n *\n * Every application runtime target — backend, companion, frontend, worker, minion, and the operator\n * `.env` at the application root — carries the APPLICATION root (absolute) and a path relative to\n * it. Writers join the two; nothing about a target refers to the framework.\n *\n * Until 2026-09-06 `relativeDir` was relative to the FRAMEWORK repository root and every writer\n * joined it onto the framework path (`examples/wonder-todos/backend-api`). That assumed an\n * application lives under `examples/` of a checkout, which is true of the framework-developer lane\n * and of nothing else: an app-creator application (npm-installed CLI, application at `~/my-app`)\n * resolved every target as \"outside the framework root\" and could never receive a `.env`, so it\n * could bring the platform up and never register against it. The framework root is not a property\n * of an application; the application root is, and the framework-developer paths are unchanged by\n * the move (`<checkout>/examples/wonder-todos` + `backend-api` is the same file as before).\n */\nexport interface ApplicationRuntimeTargetAnchor {\n /** The application root (absolute): the directory holding `wildo.saas.config.ts`. */\n applicationRoot: string;\n /** Path from {@link applicationRoot} to the target's own directory. */\n relativeDir: string;\n}\n\nexport interface ApplicationBackendEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /**\n * The APPLICATION root (absolute) every target of this application is anchored on — the\n * directory holding `wildo.saas.config.ts`. See {@link ApplicationRuntimeTargetAnchor}.\n */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the backend-api directory (e.g. `backend-api`). */\n relativeDir: string;\n /** Absolute app-layout authority shared by every local backend/minion and the companion, independent of service nesting depth. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix` (Slice 3.6).\n * Emitted as `REDIS_KEY_PREFIX` in the per-app `.env` and consumed by\n * `RedisService` as the canonical app-level Redis key namespace.\n */\n redisKeyPrefix?: string;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix` (Slice 3.6).\n * Emitted as `STORAGE_BUCKET_PREFIX` in the per-app `.env` and prepended\n * to every application object key by `WildoManagedStorageProvider`.\n */\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * App-level deploy context (identical across a given app's backend targets,\n * like {@link runtimeEndpoints}): the app slug + serviceHosts-driven ingress\n * routes (each targeting a per-service Service) the CI render path emits for\n * the k8s ingress / compose Traefik lane. Populated for REMOTE only.\n */\n appName?: string;\n ingressRoutes?: K8sIngressRoute[];\n /**\n * Per-service model: the BACKEND pod's ports (NOT the whole app) — the primary\n * backend + its internal-only API siblings (`health`/`webhook`/`oauth`/`mcp` =\n * `mainBackendApiPort - 1..-4`, mirroring `buildK8sApplicationRuntimeEndpoints`).\n * Frontends are separate nginx Deployments ({@link frontends}), not folded in\n * here. The internal siblings must be Service-exposed too — other in-cluster\n * pods reach them via cluster-DNS on those ports. REMOTE only.\n */\n podPorts?: K8sPodPort[];\n /** Primary-backend health port (`mainBackendApiPort - 1`); drives the backend's k8s probes. Remote only. */\n healthPort?: number;\n /**\n * Per-service model: the app's public frontends, each deploying as its OWN\n * nginx Deployment + Service. `serviceName` is the k8s object + built image\n * name; `port` is the authored `defaultPort` the frontend Service exposes\n * (→ nginx :80). Same value across a given app's backend targets. REMOTE only.\n */\n frontends?: Array<{\n serviceName: string;\n port: number;\n /** Effective isolation for this frontend's nginx pod — see {@link ApplicationBackendEnvTarget.isolation}. */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n }>;\n /**\n * Effective container isolation for the BACKEND pod, already resolved through\n * `resolveAppServiceIsolation` — the authored block merged with the\n * kind-correct defaults, never the raw authored value.\n *\n * Resolved once at the config boundary rather than at each renderer because\n * two renderers consume it (k8s manifests, the compose app lane) and a\n * per-renderer fallback is how the same service row ends up running as\n * different users in two lanes.\n *\n * Carries only the authorable knobs. The floor — non-root, read-only rootfs,\n * dropped capabilities, seccomp, no service-account token — is emitted\n * unconditionally by both renderers and is deliberately not representable\n * here, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser: number; runAsGroup: number; writablePaths: string[] };\n /**\n * Backend→worker dispatch URLs (G-8 / MW4), keyed by the worker's\n * `wildo.saas.config.ts` bucket name → `http://{appSlug}-worker-{name}:{port}`.\n * Emitted into the backend env as `WILDO_WORKER_<NAME>_URL` so the backend's\n * `WorkerRemoteClientFactory` can reach each declared worker's per-app k8s\n * Service — or, for LOCAL, the supervised worker process on loopback at its\n * authored port. Populated for BOTH location types since #426: it was REMOTE\n * only, which left the dispatch address absent in the one environment where\n * anyone could exercise the chain, so nobody ever had. Same value across a\n * given app's backend targets, like {@link runtimeEndpoints}.\n */\n workerUrls?: Record<string, string>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface CompanionPlatformEnvTarget extends ApplicationRuntimeTargetAnchor {\n bootstrapCredentials: AppBootstrapCredentials;\n serviceName: string;\n /** The application root the companion belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the generated companion package (`.wildo-saas/wildo-dev-companion`). */\n relativeDir: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n}\n\nexport interface ApplicationFrontendEnvExampleTarget extends ApplicationRuntimeTargetAnchor {\n serviceName: string;\n /** The application root the frontend belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the frontend directory (e.g. `frontend`). */\n relativeDir: string;\n envExample: Record<string, string>;\n}\n\n/**\n * App-root operator environment generated from authored infra configuration.\n * This target is deliberately distinct from backend/frontend runtime targets:\n * it serves local developer tools and must never carry deployment secrets.\n */\nexport enum ApplicationOperatorEnvFileDisposition {\n WRITE = 'WRITE',\n REMOVE = 'REMOVE',\n}\n\ninterface ApplicationOperatorEnvTargetBase {\n /** The SaaS application root (absolute) whose `.env` this target owns — the anchor of {@link ApplicationRuntimeTargetAnchor}, with no `relativeDir` because the target IS the root. */\n applicationRoot: string;\n}\n\nexport type ApplicationOperatorEnvTarget = ApplicationOperatorEnvTargetBase & (\n | {\n disposition: ApplicationOperatorEnvFileDisposition.WRITE;\n env: {\n [ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY]: string;\n [ApplicationCreationVerificationEnvKey.SILENT]: string;\n };\n }\n | {\n disposition: ApplicationOperatorEnvFileDisposition.REMOVE;\n }\n);\n\nexport interface ApplicationWorkerEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n bootstrapCredentials: AppBootstrapCredentials;\n workerName: string;\n serviceName: string;\n /** The application root the worker belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the worker directory (e.g. `workers/my-rust-worker`). */\n relativeDir: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n extraEnv?: Record<string, string>;\n /**\n * Authored `wildo.worker.config.ts > http`, default-applied (WorkerHttpSchema:\n * port 8080, healthPath /healthz, readyPath /readyz). Nested `http` object\n * (structurally a `WorkerHttp`) populated for every env — projected into the\n * worker `.env` (WORKER_HTTP_PORT/…) AND, for REMOTE, driving the per-worker\n * k8s Deployment container port + probes (shared by env-gen and k8s render).\n */\n http?: { port: number; healthPath: string; readyPath: string; metricsPath?: string };\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this worker belongs to\n * plus the authored `replicas`. Drives the per-worker Deployment + ClusterIP\n * Service render. Populated for REMOTE only.\n */\n appName?: string;\n replicas?: number;\n /**\n * Authored `wildo.worker.config.ts > isolation`, schema-defaulted. Same shape,\n * same floor/authorable split and same two-renderer consumption as the minion\n * field below — see its JSDoc for why the floor is absent from this type.\n *\n * `runAsUser` genuinely varies per worker image and is why the uid stays\n * authorable at all: Wonder Todos' Node worker runs as `USER node` (1000)\n * while its Rust worker is distroless `nonroot` (65532). A single hardcoded\n * uid would make one of the two unable to read its own image layers.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n}\n\n/**\n * Minions run the full backend pipeline (headless mode), so their env\n * contract mirrors ApplicationBackendEnvTarget: same data-service keys,\n * same bootstrap identity, same runtime topology. The `minionName` field\n * carries the authored bucket key from `wildo.saas.config.ts > minions`\n * for logging and error messages; it is deliberately NOT emitted as an\n * `APP_OWNED_SERVICE_NAME` env var. The Node minion runtime sources its\n * identity from its compiled-in `defineMinionInit({ minionName })` config\n * (cross-validated against the fetched `appConfig.minions[name]`), so an\n * env identity would be a second, drift-prone authority. See the\n * `BackgroundRuntimeType` model JSDoc in `@wildo-ai/saas-models` for the\n * worker (env-read) vs minion (compiled-in) identity distinction.\n */\nexport interface ApplicationMinionEnvTarget extends ApplicationRuntimeTargetAnchor {\n /**\n * Provider refs this runtime's `providers.scopes.*` declares.\n *\n * Threaded so the env builder can drop every provider secret outside the\n * declared scope. Previously the whole `providerEnv` bag was copied into every\n * application runtime, so a minion scoped to `openai` still received the\n * application's `STRIPE_SECRET_KEY` — an authored boundary the credential\n * layer never read.\n */\n scopedProviderRefs: readonly string[];\n /**\n * What this minion DECLARED about its access — forwarded to the env builder,\n * which withholds a backing service's topology from a runtime that may not\n * reach it (Step 5-egress / R-COHERENCE). Required, because an omitted\n * declaration and a declaration of nothing are different statements.\n */\n accessDeclaration: RuntimeAccessDeclaration;\n bootstrapCredentials: AppBootstrapCredentials;\n minionName: string;\n serviceName: string;\n /** The application root the minion belongs to (absolute). See {@link ApplicationRuntimeTargetAnchor}. */\n applicationRoot: string;\n /** Relative path from {@link applicationRoot} to the minion directory (e.g. `services/minions/marketing-scrapper`). */\n relativeDir: string;\n /** Absolute app-layout authority shared with the companion; never derive it from the minion directory. */\n applicationRuntimeSignalsHome: string;\n appDatabaseName?: string;\n redisKeyPrefix?: string;\n storageBucketPrefix?: string;\n runtimeEndpoints?: Record<string, { publicUrl: string; internalUrl: string }>;\n /**\n * Authored `wildo.minion.config.ts > isolation`, schema-defaulted. Consumed by\n * BOTH deploy renderers (k8s securityContext + volumes; compose\n * `user`/`read_only`/`tmpfs`/`pids_limit`), which is why it is not confined to\n * the REMOTE-only fields below.\n *\n * Carries only the authorable knobs. The security floor — non-root, read-only\n * root filesystem, dropped capabilities, seccomp, no service-account token —\n * is emitted unconditionally by the renderers and is deliberately absent from\n * this shape, so no caller can hand a value that lowers it.\n */\n isolation?: { runAsUser?: number; runAsGroup?: number; writablePaths?: string[]; pidsLimit?: number };\n extraEnv?: Record<string, string>;\n /**\n * REMOTE k8s deploy context (Phase 8) — the app slug this minion belongs to\n * plus the authored `wildo.minion.config.ts > reinstantiation` + `liveness`.\n * The render maps `reinstantiationPolicy` → K8s strategy\n * (`kill_previous`→Recreate, `let_run`→RollingUpdate) and builds the liveness\n * `exec` command from the liveness spec. Populated for REMOTE only.\n */\n appName?: string;\n reinstantiationPolicy?: 'kill_previous' | 'let_run';\n gracePeriodSec?: number;\n liveness?: {\n kind: 'file' | 'exec';\n filePath?: string;\n staleAfterSec?: number;\n execCommand?: string[];\n };\n}\n\nexport function buildPlatformServiceEnvMap(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n frameworkPath: string,\n): Record<string, Record<string, string>> {\n // Single load+hydrate seam (loadInfraHydratedConfig): the setup-time config.json omits the\n // infra-posture blocks, so the platform hosts (same otel-preload `--import` + flush logic) would\n // emit no OTEL_*/LOG_LEVEL without this. Reached from BOTH `local up` (platform-lifecycle) and the\n // env-file wrapper below.\n const config = loadInfraHydratedConfig(env);\n\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n // Each platform host tags its OTel `service.version` from its OWN package.json version (audit A-10\n // parity with the app hosts). Resolved here because this is where the framework repository root is\n // available; the pure env-map builders receive the already-read version string.\n const repositoryRoot = resolveFrameworkLayout(frameworkPath).repositoryRoot;\n\n const envByDir: Record<string, Record<string, string>> = {\n [PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir]:\n PlatformEnvVarsBuilder.buildAppsManagerFullEnv(credentials, addresses, config, env, {\n serviceVersion: readHostVersion(\n repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n ),\n }),\n };\n\n for (const service of BOOTSTRAP_PLATFORM_SERVICES) {\n envByDir[PLATFORM_SERVICE_CATALOG[service].sourceDir] = PlatformEnvVarsBuilder.buildBootstrapEnv(\n service,\n credentials,\n addresses,\n config,\n env,\n readHostVersion(repositoryRoot, PLATFORM_SERVICE_CATALOG[service].sourceDir),\n );\n }\n\n return envByDir;\n}\n\nexport function generatePlatformServiceEnvFiles(\n env: PlatformEnvironmentConfiguration,\n frameworkPath: string,\n credentials: PlatformEnvSecretsJson,\n log: Logger,\n applicationBackends?: ApplicationBackendEnvTarget[],\n companionApis?: CompanionPlatformEnvTarget[],\n applicationFrontends?: ApplicationFrontendEnvExampleTarget[],\n applicationWorkers?: ApplicationWorkerEnvTarget[],\n applicationMinions?: ApplicationMinionEnvTarget[],\n applicationOperators?: ApplicationOperatorEnvTarget[],\n writePolicy?: {\n /**\n * Skip the SHARED platform-service `.env` writes (apps-manager, module-registry, crontabs) while\n * still writing the invoking application's own targets. Set by `env-sync` when a FOREIGN\n * `wildo local dev` session owns the platform (issue #50): those files carry the running\n * platform's credential basis and are the owner's to regenerate.\n */\n skipPlatformServiceEnvs?: boolean;\n },\n): void {\n const platformServiceEnvs = buildPlatformServiceEnvMap(env, credentials, frameworkPath);\n // Single load+hydrate seam (loadInfraHydratedConfig) for the app-host loops below; the platform\n // hosts are hydrated the same way inside buildPlatformServiceEnvMap above.\n const config = loadInfraHydratedConfig(env);\n const addressCtx = ServiceAddressResolver.fromEnvironment(env, AddressPerspective.HOST_FACING);\n const addresses = ServiceAddressResolver.resolve(addressCtx);\n const frameworkLayout = resolveFrameworkLayout(frameworkPath);\n let serviceCount = 0;\n\n // Provider-secrets sink (LOCAL only). Written here — the SOLE writer of every\n // Wildo non-compose `.env` — so it is present exactly whenever the backend\n // `.env` is, after `wildo config sync` AND after the `wildo local dev`\n // bootstrap, for out-of-band consumers (framework-dev test harnesses).\n const providerSecretsEnvPath = generateProviderSecretsEnvFile(env, credentials);\n if (providerSecretsEnvPath) {\n log.success(` Generated provider-secrets env file: ${providerSecretsEnvPath}`);\n }\n\n if (writePolicy?.skipPlatformServiceEnvs !== true) {\n writeEnvFile(\n join(\n frameworkLayout.repositoryRoot,\n PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir,\n FILE_NAMES.DOT_ENV,\n ),\n platformServiceEnvs[PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir],\n );\n serviceCount++;\n\n for (const [dir, serviceEnv] of Object.entries(platformServiceEnvs)) {\n if (dir === PLATFORM_SERVICE_CATALOG[PlatformWildoServices.APPS_MANAGER].sourceDir) {\n continue;\n }\n writeEnvFile(join(frameworkLayout.repositoryRoot, dir, FILE_NAMES.DOT_ENV), serviceEnv);\n serviceCount++;\n }\n\n log.success(` Generated .env files for ${serviceCount} platform services`);\n }\n\n if (applicationOperators?.length) {\n for (const operator of applicationOperators) {\n applyApplicationOperatorEnvTarget(operator);\n }\n log.success(` Reconciled .env files for ${applicationOperators.length} application operator root(s)`);\n }\n\n if (applicationBackends?.length) {\n let appCount = 0;\n for (const app of applicationBackends) {\n assertNoApplicationBackendReservedEnvOverrides(app.extraEnv, `application backend ${app.serviceName}`);\n const appEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationBackendEnv(\n app.bootstrapCredentials,\n app.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(app.scopedProviderRefs),\n {\n serviceVersion: readHostVersion(app.applicationRoot, app.relativeDir),\n appDatabaseName: app.appDatabaseName,\n redisKeyPrefix: app.redisKeyPrefix,\n storageBucketPrefix: app.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? app.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: app.runtimeEndpoints,\n /*\n * Backend→worker dispatch URLs (#426). The target has carried these since G-8 and this\n * writer did not forward them, so `WILDO_WORKER_<NAME>_URL` reached the k8s render and\n * never reached a developer's `backend-api/.env` — the second site of the same invariant,\n * and the reason the chain was unreachable in the only environment anyone could try it in.\n *\n * Forwarded unconditionally: whether a LOCAL target HAS a URL is decided once, in\n * `buildApplicationWorkerDispatchUrls`, and re-deciding it here would be a second opinion\n * about the same question.\n */\n workerUrls: app.workerUrls,\n },\n ),\n ...(app.extraEnv ?? {}),\n };\n // LOCAL-lane durable trust-anchor dir for the immudb audit provider (cross-restart tamper-evidence).\n // Provision it ONLY when immudb audit is configured (its connection secret is present) and not\n // already pinned by the operator. The value is a host absolute path under the durable local_data\n // tier — preserved by `wildo local down`, wiped by `reset` (on reset immudb re-provisions with a\n // new uuid, so a lingering anchor safely re-bootstraps rather than false-alarming). This is the\n // LOCAL mechanism ONLY: a host path is meaningless inside a container. REMOTE (staging/production)\n // provisions the anchor on a durable IN-CONTAINER volume instead — the k8s app-backend Deployment\n // mounts a PVC and sets IMMUDB_STATE_DIR (`K8sManifestGenerator.buildForApplication` /\n // `renderApplicationForTarget` + `backend.immudb-audit-state.pvc.yaml.hbs`), and the compose app\n // backend mounts a named volume and sets IMMUDB_STATE_DIR (`docker-compose.app.yml.hbs`, wired in\n // `generateCiDeployArtifacts`). Both use `IMMUDB_AUDIT_STATE_CONTAINER_DIR`.\n if (\n env.locationType === WildoLocationType.LOCAL &&\n credentials.providerEnv?.IMMUDB_HOST &&\n !appEnv['IMMUDB_STATE_DIR']\n ) {\n appEnv['IMMUDB_STATE_DIR'] = EnvironmentPaths.resolveScopedLocalDataServiceDir(app.applicationRoot, 'immudb-audit-state');\n }\n writeEnvFile(join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV), appEnv);\n appCount++;\n }\n log.success(` Generated .env files for ${appCount} application backend(s)`);\n }\n\n if (companionApis?.length) {\n let companionCount = 0;\n for (const companion of companionApis) {\n const companionEnv = PlatformEnvVarsBuilder.buildCompanionPlatformEnv(\n companion.bootstrapCredentials,\n companion.serviceName,\n credentials,\n addresses,\n config,\n env,\n {\n runtimeEndpoints: companion.runtimeEndpoints,\n host: companion.extraEnv?.HOST,\n port: companion.extraEnv?.PORT ? Number(companion.extraEnv.PORT) : undefined,\n serviceVersion: readHostVersion(companion.applicationRoot, companion.relativeDir),\n },\n );\n writeEnvFile(\n join(companion.applicationRoot, companion.relativeDir, FILE_NAMES.DOT_ENV),\n companionEnv,\n );\n companionCount++;\n }\n log.success(` Generated .env files for ${companionCount} companion API service(s)`);\n }\n\n if (applicationFrontends?.length) {\n let frontendCount = 0;\n for (const frontend of applicationFrontends) {\n // BOTH files, and `.env` is the one that matters.\n //\n // Every other service kind here writes `FILE_NAMES.DOT_ENV`. Frontends stopped at\n // `.env.example`, which Vite's `loadEnv` never reads — so the file the dev server actually\n // consumes was generated by nobody and maintained by hand. That is not a cosmetic gap:\n // `environment-hydration.utils.ts` records what it cost on 2026-08-13. Sync reconciled an\n // edge scheme into `.env.example` and `APPLICATION_RUNTIME_ENDPOINTS`, the hand-written\n // `app/.env` kept its older value, the browser sent an `Origin` the backend did not expect,\n // and `_validateFrontendAppOrigin` refused every `POST /auth/identify` with a 403. Login was\n // completely broken and nothing in any log named the cause.\n //\n // Generating `.env` makes the frontend match every sibling: the file the runtime reads is the\n // file this generator owns, so it cannot drift from the topology it was derived from. A\n // developer who needs a local override still has Vite's `.env.local`, which takes precedence\n // and is not generated — the supported seam for that, rather than editing a derived file.\n //\n // `.env.example` is still written, unchanged, as the committed reference for a fresh clone.\n const frontendDirectory = join(frontend.applicationRoot, frontend.relativeDir);\n writeEnvFile(join(frontendDirectory, '.env.example'), frontend.envExample);\n writeEnvFile(join(frontendDirectory, FILE_NAMES.DOT_ENV), frontend.envExample);\n frontendCount++;\n }\n log.success(` Generated .env and .env.example files for ${frontendCount} application frontend(s)`);\n }\n\n if (applicationWorkers?.length) {\n let workerCount = 0;\n for (const worker of applicationWorkers) {\n const workerEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationWorkerEnv(\n worker.bootstrapCredentials,\n worker.workerName,\n worker.serviceName,\n credentials,\n config,\n env.name,\n declaredProviderScope(worker.scopedProviderRefs),\n {\n // Project the authored HTTP surface (carried on the target,\n // default-applied from `wildo.worker.config.ts > http` and shared\n // with the REMOTE k8s render) into the worker `.env`.\n http: worker.http,\n serviceVersion: readHostVersion(worker.applicationRoot, worker.relativeDir),\n runtimeEndpoints: worker.runtimeEndpoints,\n },\n ),\n ...(worker.extraEnv ?? {}),\n };\n writeEnvFile(join(worker.applicationRoot, worker.relativeDir, FILE_NAMES.DOT_ENV), workerEnv);\n workerCount++;\n }\n log.success(` Generated .env files for ${workerCount} application worker(s)`);\n }\n\n if (applicationMinions?.length) {\n let minionCount = 0;\n for (const minion of applicationMinions) {\n assertNoApplicationBackendReservedEnvOverrides(minion.extraEnv, `application minion ${minion.serviceName}`);\n const minionEnv = {\n ...PlatformEnvVarsBuilder.buildApplicationMinionEnv(\n minion.bootstrapCredentials,\n minion.serviceName,\n credentials,\n addresses,\n config,\n env.name,\n declaredProviderScope(minion.scopedProviderRefs),\n minion.accessDeclaration,\n {\n appDatabaseName: minion.appDatabaseName,\n redisKeyPrefix: minion.redisKeyPrefix,\n storageBucketPrefix: minion.storageBucketPrefix,\n deploymentLocationType: env.locationType,\n runtimeSignalsHome: env.locationType === WildoLocationType.LOCAL\n ? minion.applicationRuntimeSignalsHome\n : undefined,\n mongodbDirectConnection: env.locationType === WildoLocationType.LOCAL,\n runtimeEndpoints: minion.runtimeEndpoints,\n serviceVersion: readHostVersion(minion.applicationRoot, minion.relativeDir),\n },\n ),\n ...(minion.extraEnv ?? {}),\n };\n writeEnvFile(join(minion.applicationRoot, minion.relativeDir, FILE_NAMES.DOT_ENV), minionEnv);\n minionCount++;\n }\n log.success(` Generated .env files for ${minionCount} application minion(s)`);\n }\n}\n\n/**\n * Emit the per-env provider-SECRETS env file — the exact runtime provider env\n * (`PlatformEnvVarsBuilder.buildRuntimeProviderEnv`: authored `providerEnv` +\n * framework-injected immudb state key) the backend/companion/worker receive,\n * projected as a standalone `.env` for out-of-band consumers that are NOT\n * launched by `wildo local dev` (framework-dev integration test harnesses,\n * ad-hoc scripts). Carries the SAME provider VALUES as the backend `.env` (one\n * authority — `buildRuntimeProviderEnv`), so it never drifts.\n *\n * Serialized with dotenv double-quote escaping (see {@link encodeDotenvValue}),\n * NOT the raw `writeEnvFile` used for the backend `.env`: the framework-injected\n * `IMMUDB_STATE_PUBLIC_KEY` is a MULTI-LINE SPKI PEM, and a bare `key=value`\n * would split it across physical lines and break the harness loader. Escaping\n * keeps every value on one physical line and round-trips through the matched\n * loader (`engine-behavior-e2e/src/provider-env.ts`) and a standard `.env`\n * parser. Single-line values (API keys) are emitted bare, unchanged.\n *\n * DISTINCT from the runtime-SCOPE `.wildo-providers.env`\n * (`PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME`), which carries the provider\n * allow-list artifact PATH, not secret values. Never conflate them.\n *\n * LOCAL-only: remote/CI provider secrets are delivered via k8s `providers-secret`,\n * never a local plaintext file. Returns the written path, or `null` when skipped\n * (non-local env, or zero provider secrets to emit).\n */\nexport function generateProviderSecretsEnvFile(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n): string | null {\n if (env.locationType !== WildoLocationType.LOCAL) return null;\n const providerEnv = PlatformEnvVarsBuilder.buildRuntimeProviderEnv(credentials);\n if (Object.keys(providerEnv).length === 0) return null;\n const filePath = join(\n EnvironmentPaths.resolveGeneratedProvidersDir(env.name),\n FILE_NAMES.PROVIDER_SECRETS_ENV,\n );\n const dir = dirname(filePath);\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n const content = Object.entries(providerEnv)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n writeFileSync(filePath, `${GENERATED_FILE_HEADER}\\n\\n${content}\\n`);\n return filePath;\n}\n\n/**\n * dotenv encoding — the single escaping authority for EVERY `.env` this module writes\n * (the per-service files via {@link writeEnvFile} and the provider-secrets sink).\n *\n * ## What the reader actually does\n *\n * These files are read by Node processes through the `dotenv` package, whose quoting rules are\n * asymmetric and are the whole reason this function is not a one-liner:\n *\n * | Form | dotenv behaviour |\n * |-----------------|-----------------------------------------------------------------------|\n * | bare | verbatim to end of line, but TRIMMED and truncated at an inline `#` |\n * | `\"…\"` | quotes stripped, `\\n` / `\\r` EXPANDED — but `\\\"` and `\\\\` are NOT unescaped |\n * | `'…'` | quotes stripped, contents fully VERBATIM (real newlines included) |\n * | `` `…` `` | same as single quotes, verbatim |\n *\n * The double-quoted row is the trap. Escaping `\"` as `\\\"` (the JSON/shell reflex) is silently\n * LOSSY here: dotenv hands the consumer the literal backslashes. That is exactly how every\n * JSON-valued var — `APPLICATION_RUNTIME_ENDPOINTS`, `WILDO_PROVIDER_SELECTION_OVERRIDES`,\n * `WILDO_SERVICE_HOSTS` — reached `JSON.parse` as `{\\\"k\\\":…}` and threw\n * `Expected property name or '}' at position 1`, crash-looping backend-api, every minion and the\n * dev companion at startup while the error surfaced as an env *validation* failure. The same\n * lossiness applies to `\\\\`, so a value containing a real backslash was corrupted too.\n *\n * ## The encoding chosen here\n *\n * Escape only what the reader unescapes, and otherwise quote VERBATIM:\n *\n * 1. bare — for clean single-line values (API keys, URLs, ports), keeping files readable/diff-stable;\n * 2. double quotes with `\\n` / `\\r` escaped — the ONLY branch that escapes anything, and it is\n * entered only when the value has no `\"` and no `\\`, so nothing lossy can be emitted. This keeps\n * a multi-line SPKI PEM (`IMMUDB_STATE_PUBLIC_KEY`) on ONE physical line exactly as before;\n * 3. single quotes, verbatim — carries `\"` and `\\` (the JSON case) losslessly;\n * 4. backticks, verbatim — for a value carrying `'` as well;\n * 5. throw — a value carrying all three quote characters has no lossless dotenv form. Fail closed\n * at generation time rather than write config that silently misparses at startup.\n *\n * Builders hand us RAW values by contract (see the value-contract note in\n * `env-vars-builder.service.ts`) — never pre-quoted — so encoding happens exactly once, here.\n *\n * This is the LOCAL dotenv sink only. The compose (`encodeComposeEnvValue`), CI (`formatEnvFile`)\n * and k8s (raw base64) sinks have different readers and therefore different contracts — do not\n * unify them, and do not push encoding back onto the builders.\n */\nfunction encodeDotenvValue(key: string, value: string): string {\n const hasNewline = /[\\n\\r]/.test(value);\n const hasDoubleQuote = value.includes('\"');\n const hasSingleQuote = value.includes(\"'\");\n const hasBacktick = value.includes('`');\n const hasBackslash = value.includes('\\\\');\n\n if (\n !hasNewline &&\n !hasDoubleQuote &&\n !hasSingleQuote &&\n !hasBacktick &&\n !value.includes('#') &&\n value !== '' &&\n value === value.trim()\n ) {\n return value;\n }\n\n // Safe ONLY without `\"` / `\\`, the two characters dotenv refuses to unescape.\n if (!hasDoubleQuote && !hasBackslash) {\n return `\"${value.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')}\"`;\n }\n\n if (!hasSingleQuote) return `'${value}'`;\n\n if (!hasBacktick) return `\\`${value}\\``;\n\n throw new Error(\n `Cannot encode env var \"${key}\" for a dotenv file: its value contains a double quote, a single quote and a backtick, ` +\n `so no dotenv quoting form can carry it without corruption. Reshape the value at its builder.`,\n );\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/**\n * Write one generated `.env`, serializing every value through {@link encodeDotenvValue}.\n *\n * These files are loaded by Node processes through the `dotenv` package. That reader — not any\n * general notion of \"escaped\" — is the contract {@link encodeDotenvValue} is written against.\n *\n * Two defects came from ignoring it, in opposite directions, and both are pinned by tests:\n * - a bare `key=value` silently BROKE every multi-line value: the immudb `IMMUDB_STATE_PUBLIC_KEY`\n * SPKI PEM spilled across four physical lines and dotenv kept only `-----BEGIN PUBLIC KEY-----`,\n * so the audit client could not parse its pinned key and fail-closed into a FALSE\n * \"immudb audit store TAMPER DETECTED\";\n * - the escaping added to fix that then over-reached and escaped `\"` as `\\\"`, which dotenv does NOT\n * unescape, so every JSON-valued var (`APPLICATION_RUNTIME_ENDPOINTS`, …) reached `JSON.parse`\n * with literal backslashes and crash-looped backend-api, the minions and the companion.\n *\n * Encoding is the serializer's job — do not push it back onto the builders (the k8s and compose\n * sinks have different readers and would then receive literal quotes).\n */\nfunction writeEnvFile(filePath: string, env: Record<string, string>): void {\n const dir = dirname(filePath);\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n\n const content = Object.entries(env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n\n writeFileSync(filePath, GENERATED_FILE_HEADER + '\\n\\n' + content + '\\n');\n}\n\nconst APPLICATION_OPERATOR_ENV_HEADER = `${GENERATED_FILE_HEADER}\\n# application-creation-verification operator environment`;\nconst APPLICATION_OPERATOR_WRITABLE_ENV_KEYS = [\n ApplicationCreationVerificationEnvKey.EVIDENCE_DIRECTORY,\n ApplicationCreationVerificationEnvKey.SILENT,\n] as const;\n\n/**\n * Reconcile the CLI-owned app-root operator env without following symlinks.\n *\n * The component checks cover hostile state that already exists when sync owns\n * the path. Descriptor-relative publication is not available through Node's\n * portable filesystem API, so this does not claim race freedom against an\n * actively mutating same-UID process; the final file itself is opened with\n * `O_NOFOLLOW` and rechecked against its pathname identity.\n */\nfunction applyApplicationOperatorEnvTarget(target: ApplicationOperatorEnvTarget): void {\n const applicationRoot = resolveCanonicalApplicationOperatorRoot(target.applicationRoot);\n const filePath = join(applicationRoot, FILE_NAMES.DOT_ENV);\n\n if (target.disposition === ApplicationOperatorEnvFileDisposition.REMOVE) {\n removeOwnedApplicationOperatorEnvFile(filePath);\n return;\n }\n\n const suppliedKeys = Object.keys(target.env).sort();\n const expectedKeys = [...APPLICATION_OPERATOR_WRITABLE_ENV_KEYS].sort();\n if (suppliedKeys.length !== expectedKeys.length || suppliedKeys.some((key, index) => key !== expectedKeys[index])) {\n throw new Error(`Application operator environment must contain exactly: ${expectedKeys.join(', ')}.`);\n }\n\n const content = Object.entries(target.env)\n .map(([key, value]) => `${key}=${encodeDotenvValue(key, value)}`)\n .join('\\n');\n let created = false;\n let descriptor: number;\n try {\n descriptor = openSync(\n filePath,\n fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_EXCL | fsConstants.O_NOFOLLOW,\n 0o600,\n );\n created = true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error;\n descriptor = openSync(filePath, fsConstants.O_RDWR | fsConstants.O_NOFOLLOW);\n }\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (!created && !readFileSync(descriptor, 'utf8').startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to overwrite an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n fchmodSync(descriptor, 0o600);\n ftruncateSync(descriptor, 0);\n // ⚠️ Written at an EXPLICIT position 0, not via `writeFileSync(fd, …)`.\n //\n // The ownership check above calls `readFileSync(descriptor)`, which ADVANCES\n // the descriptor's file position to EOF. `ftruncateSync` resets the file's\n // LENGTH but not that position, so a positionless write lands at the old\n // offset and the kernel fills the gap with NUL bytes.\n //\n // The failure is self-inflicting and delayed, which is what made it hard to\n // see: the write SUCCEEDS and the file reads correctly to a human (the NULs\n // are invisible in most editors), but the header no longer sits at byte 0 —\n // so the NEXT sync fails the `startsWith(HEADER)` check and refuses to\n // overwrite a file the framework itself had just written. Observed on Wonder\n // Todos as exactly 240 NUL bytes in front of 240 bytes of correct content.\n writeSync(descriptor, `${APPLICATION_OPERATOR_ENV_HEADER}\\n\\n${content}\\n`, 0, 'utf8');\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.PUBLICATION);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed during publication: ${filePath}.`);\n }\n } finally {\n closeSync(descriptor);\n }\n}\n\nfunction removeOwnedApplicationOperatorEnvFile(filePath: string): void {\n try {\n lstatSync(filePath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return;\n throw error;\n }\n\n const descriptor = openSync(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);\n try {\n const opened = fstatSync(descriptor);\n if (!opened.isFile()) {\n throw new Error(`Application operator environment removal target is not a regular file: ${filePath}.`);\n }\n assertCurrentUserSingleLinkFile(opened, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n const content = readFileSync(descriptor, 'utf8');\n if (!content.startsWith(`${APPLICATION_OPERATOR_ENV_HEADER}\\n`)) {\n throw new Error(`Refusing to remove an app-root .env file not owned by application-creation verification: ${filePath}.`);\n }\n const current = lstatSync(filePath);\n assertCurrentUserSingleLinkFile(current, filePath, ApplicationOperatorEnvironmentFileOperation.REMOVAL);\n if (current.isSymbolicLink() || current.dev !== opened.dev || current.ino !== opened.ino) {\n throw new Error(`Application operator environment pathname identity changed before removal: ${filePath}.`);\n }\n unlinkSync(filePath);\n } finally {\n closeSync(descriptor);\n }\n}\n\n/**\n * Which side of the operator-environment file lifecycle a single-link assertion is guarding.\n *\n * The member VALUES are interpolated verbatim into the thrown messages (\"… environment publication\n * requires …\"), so they read as prose while still being a closed two-member vocabulary rather than\n * a free-form string an caller could mistype into an incoherent error.\n */\nenum ApplicationOperatorEnvironmentFileOperation {\n /** Writing the operator environment file. */\n PUBLICATION = 'publication',\n /** Unlinking the operator environment file. */\n REMOVAL = 'removal',\n}\n\nfunction assertCurrentUserSingleLinkFile(\n status: { uid: number; nlink: number },\n filePath: string,\n operation: ApplicationOperatorEnvironmentFileOperation,\n): void {\n if (typeof process.getuid !== 'function') {\n throw new Error(`Application operator environment ${operation} cannot establish current-user ownership on this platform: ${filePath}.`);\n }\n if (status.uid !== process.getuid() || status.nlink !== 1) {\n throw new Error(`Application operator environment ${operation} requires a current-user-owned single-link file: ${filePath}.`);\n }\n}\n\n/**\n * The canonical directory the operator `.env` is written into: the application root, symlinks\n * resolved, and proven to be a real directory. Until 2026-09-06 this walked every path segment\n * from the FRAMEWORK repository root down to the application and refused anything that was not\n * strictly below it — an application was assumed to live under `examples/` of a checkout. An\n * app-creator application lives wherever its author put it, so the anchor is the application\n * root itself; the write below still opens the file `O_NOFOLLOW` and re-checks its identity.\n */\nfunction resolveCanonicalApplicationOperatorRoot(applicationRoot: string): string {\n const lexicalApplicationRoot = resolve(applicationRoot);\n const status = lstatSync(lexicalApplicationRoot);\n if (!status.isDirectory()) {\n throw new Error(`Application operator environment root is not a directory: ${lexicalApplicationRoot}.`);\n }\n return realpathSync(lexicalApplicationRoot);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-sync.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"env-sync.service.d.ts","sourceRoot":"","sources":["../../../../src/services/environment/env-sync.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAK5G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAKlG,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EAClC,MAAM,qEAAqE,CAAC;AAG7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mHAAmH;IACnH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,2BAA2B,EAAE,CAAC;IACpD,aAAa,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAC7C,oBAAoB,CAAC,EAAE,mCAAmC,EAAE,CAAC;IAC7D,kBAAkB,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAClD,kBAAkB,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAClD,oBAAoB,CAAC,EAAE,4BAA4B,EAAE,CAAC;CACvD;AAOD;;GAEG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,gCAAgC,EACrC,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,OAAO,EAC7B,mBAAmB,CAAC,EAAE,2BAA2B,EAAE,EACnD,aAAa,CAAC,EAAE,0BAA0B,EAAE,EAC5C,oBAAoB,CAAC,EAAE,mCAAmC,EAAE,EAC5D,kBAAkB,CAAC,EAAE,0BAA0B,EAAE,EACjD,kBAAkB,CAAC,EAAE,0BAA0B,EAAE,EACjD,oBAAoB,CAAC,EAAE,4BAA4B,EAAE,GACpD,MAAM,EAAE,CAmEV;AAED;;;GAGG;AACH,wBAAsB,IAAI,CACxB,GAAG,EAAE,gCAAgC,EACrC,WAAW,EAAE,sBAAsB,EACnC,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,aAAa,CAAC,CA4FxB"}
|
|
@@ -43,14 +43,14 @@ export function checkExisting(env, frameworkPath, isFrameworkDeveloper, applicat
|
|
|
43
43
|
}
|
|
44
44
|
if (applicationBackends?.length) {
|
|
45
45
|
for (const app of applicationBackends) {
|
|
46
|
-
const envPath = join(
|
|
46
|
+
const envPath = join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV);
|
|
47
47
|
if (existsSync(envPath))
|
|
48
48
|
existing.push(envPath);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
if (companionApis?.length) {
|
|
52
52
|
for (const companion of companionApis) {
|
|
53
|
-
const envPath = join(
|
|
53
|
+
const envPath = join(companion.applicationRoot, companion.relativeDir, FILE_NAMES.DOT_ENV);
|
|
54
54
|
if (existsSync(envPath))
|
|
55
55
|
existing.push(envPath);
|
|
56
56
|
}
|
|
@@ -60,7 +60,7 @@ export function checkExisting(env, frameworkPath, isFrameworkDeveloper, applicat
|
|
|
60
60
|
// that saw only `.env.example` would omit the one whose loss or overwrite a developer notices.
|
|
61
61
|
for (const app of applicationFrontends) {
|
|
62
62
|
for (const fileName of ['.env.example', FILE_NAMES.DOT_ENV]) {
|
|
63
|
-
const envPath = join(
|
|
63
|
+
const envPath = join(app.applicationRoot, app.relativeDir, fileName);
|
|
64
64
|
if (existsSync(envPath))
|
|
65
65
|
existing.push(envPath);
|
|
66
66
|
}
|
|
@@ -68,21 +68,21 @@ export function checkExisting(env, frameworkPath, isFrameworkDeveloper, applicat
|
|
|
68
68
|
}
|
|
69
69
|
if (applicationWorkers?.length) {
|
|
70
70
|
for (const worker of applicationWorkers) {
|
|
71
|
-
const envPath = join(
|
|
71
|
+
const envPath = join(worker.applicationRoot, worker.relativeDir, FILE_NAMES.DOT_ENV);
|
|
72
72
|
if (existsSync(envPath))
|
|
73
73
|
existing.push(envPath);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
if (applicationMinions?.length) {
|
|
77
77
|
for (const minion of applicationMinions) {
|
|
78
|
-
const envPath = join(
|
|
78
|
+
const envPath = join(minion.applicationRoot, minion.relativeDir, FILE_NAMES.DOT_ENV);
|
|
79
79
|
if (existsSync(envPath))
|
|
80
80
|
existing.push(envPath);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (applicationOperators?.length) {
|
|
84
84
|
for (const operator of applicationOperators) {
|
|
85
|
-
const envPath = join(
|
|
85
|
+
const envPath = join(operator.applicationRoot, FILE_NAMES.DOT_ENV);
|
|
86
86
|
if (existsSync(envPath))
|
|
87
87
|
existing.push(envPath);
|
|
88
88
|
}
|
|
@@ -131,33 +131,33 @@ export async function sync(env, credentials, options, log) {
|
|
|
131
131
|
}
|
|
132
132
|
if (options.applicationBackends?.length) {
|
|
133
133
|
for (const app of options.applicationBackends) {
|
|
134
|
-
updated.push(join(
|
|
134
|
+
updated.push(join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV));
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
if (options.companionApis?.length) {
|
|
138
138
|
for (const companion of options.companionApis) {
|
|
139
|
-
updated.push(join(
|
|
139
|
+
updated.push(join(companion.applicationRoot, companion.relativeDir, FILE_NAMES.DOT_ENV));
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
if (options.applicationFrontends?.length) {
|
|
143
143
|
for (const app of options.applicationFrontends) {
|
|
144
|
-
updated.push(join(
|
|
145
|
-
updated.push(join(
|
|
144
|
+
updated.push(join(app.applicationRoot, app.relativeDir, '.env.example'));
|
|
145
|
+
updated.push(join(app.applicationRoot, app.relativeDir, FILE_NAMES.DOT_ENV));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
if (options.applicationWorkers?.length) {
|
|
149
149
|
for (const worker of options.applicationWorkers) {
|
|
150
|
-
updated.push(join(
|
|
150
|
+
updated.push(join(worker.applicationRoot, worker.relativeDir, FILE_NAMES.DOT_ENV));
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
if (options.applicationMinions?.length) {
|
|
154
154
|
for (const minion of options.applicationMinions) {
|
|
155
|
-
updated.push(join(
|
|
155
|
+
updated.push(join(minion.applicationRoot, minion.relativeDir, FILE_NAMES.DOT_ENV));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
if (options.applicationOperators?.length) {
|
|
159
159
|
for (const operator of options.applicationOperators) {
|
|
160
|
-
updated.push(join(
|
|
160
|
+
updated.push(join(operator.applicationRoot, FILE_NAMES.DOT_ENV));
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}
|