@wildo-ai/wildo-cli 1.1.9 → 1.1.10
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/bin/wildo.js +0 -0
- package/dist/bin/wildo.js.map +1 -1
- package/dist/src/commands/acp/probe.command.d.ts.map +1 -1
- 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/align-deps.command.js.map +1 -1
- package/dist/src/commands/assets/sync.command.d.ts.map +1 -1
- 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/brand/propagate.command.js.map +1 -1
- package/dist/src/commands/build/accept.command.d.ts.map +1 -1
- package/dist/src/commands/build/accept.command.js.map +1 -1
- package/dist/src/commands/build/dispatches.command.d.ts.map +1 -1
- package/dist/src/commands/build/dispatches.command.js.map +1 -1
- package/dist/src/commands/build/next.command.d.ts.map +1 -1
- package/dist/src/commands/build/next.command.js.map +1 -1
- package/dist/src/commands/build/rearm.command.d.ts.map +1 -1
- package/dist/src/commands/build/rearm.command.js.map +1 -1
- package/dist/src/commands/build/run.command.d.ts.map +1 -1
- package/dist/src/commands/build/run.command.js.map +1 -1
- package/dist/src/commands/build/tasks.command.d.ts.map +1 -1
- package/dist/src/commands/build/tasks.command.js.map +1 -1
- package/dist/src/commands/compose.command.d.ts.map +1 -1
- package/dist/src/commands/compose.command.js.map +1 -1
- package/dist/src/commands/config/check-resources.command.d.ts +50 -0
- package/dist/src/commands/config/check-resources.command.d.ts.map +1 -0
- package/dist/src/commands/config/check-resources.command.js +121 -0
- package/dist/src/commands/config/check-resources.command.js.map +1 -0
- package/dist/src/commands/config/data-retention.command.d.ts.map +1 -1
- package/dist/src/commands/config/data-retention.command.js.map +1 -1
- package/dist/src/commands/config/document-releases.command.d.ts.map +1 -1
- package/dist/src/commands/config/document-releases.command.js.map +1 -1
- package/dist/src/commands/config/legal-notice.command.d.ts +17 -0
- package/dist/src/commands/config/legal-notice.command.d.ts.map +1 -0
- package/dist/src/commands/config/legal-notice.command.js +59 -0
- package/dist/src/commands/config/legal-notice.command.js.map +1 -0
- package/dist/src/commands/config/mutate.command.d.ts.map +1 -1
- package/dist/src/commands/config/mutate.command.js.map +1 -1
- package/dist/src/commands/config/reapply-declaration.command.d.ts.map +1 -1
- package/dist/src/commands/config/reapply-declaration.command.js.map +1 -1
- package/dist/src/commands/config/service-consent.command.d.ts.map +1 -1
- package/dist/src/commands/config/service-consent.command.js.map +1 -1
- package/dist/src/commands/config/subject-data-recipients.command.d.ts.map +1 -1
- package/dist/src/commands/config/subject-data-recipients.command.js.map +1 -1
- package/dist/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/config/validate.command.d.ts +8 -0
- package/dist/src/commands/config/validate.command.d.ts.map +1 -1
- package/dist/src/commands/config/validate.command.js +65 -4
- package/dist/src/commands/config/validate.command.js.map +1 -1
- package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -1
- package/dist/src/commands/context/assurance-basis.command.js.map +1 -1
- package/dist/src/commands/context/coherence.command.d.ts.map +1 -1
- package/dist/src/commands/context/coherence.command.js.map +1 -1
- package/dist/src/commands/context/context-command.utils.d.ts.map +1 -1
- package/dist/src/commands/context/context-command.utils.js.map +1 -1
- package/dist/src/commands/context/elements.command.d.ts.map +1 -1
- package/dist/src/commands/context/elements.command.js.map +1 -1
- package/dist/src/commands/context/health.command.d.ts.map +1 -1
- package/dist/src/commands/context/health.command.js.map +1 -1
- package/dist/src/commands/context/info.command.d.ts.map +1 -1
- package/dist/src/commands/context/info.command.js.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts +8 -2
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +102 -12
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/context/jurisdictions.command.d.ts.map +1 -1
- package/dist/src/commands/context/jurisdictions.command.js.map +1 -1
- package/dist/src/commands/context/launch-blockers.command.d.ts +2 -1
- package/dist/src/commands/context/launch-blockers.command.d.ts.map +1 -1
- package/dist/src/commands/context/launch-blockers.command.js +3 -2
- package/dist/src/commands/context/launch-blockers.command.js.map +1 -1
- package/dist/src/commands/context/list.command.d.ts.map +1 -1
- package/dist/src/commands/context/list.command.js.map +1 -1
- package/dist/src/commands/context/pipelines.command.d.ts.map +1 -1
- package/dist/src/commands/context/pipelines.command.js.map +1 -1
- package/dist/src/commands/context/workspace.command.d.ts.map +1 -1
- package/dist/src/commands/context/workspace.command.js.map +1 -1
- package/dist/src/commands/creation/accept.command.d.ts +4 -0
- package/dist/src/commands/creation/accept.command.d.ts.map +1 -1
- package/dist/src/commands/creation/accept.command.js +29 -4
- package/dist/src/commands/creation/accept.command.js.map +1 -1
- package/dist/src/commands/creation/answer.command.d.ts.map +1 -1
- package/dist/src/commands/creation/answer.command.js.map +1 -1
- package/dist/src/commands/creation/brand-logo.command.d.ts +18 -0
- package/dist/src/commands/creation/brand-logo.command.d.ts.map +1 -0
- package/dist/src/commands/creation/brand-logo.command.js +43 -0
- package/dist/src/commands/creation/brand-logo.command.js.map +1 -0
- package/dist/src/commands/creation/brief.command.d.ts.map +1 -1
- package/dist/src/commands/creation/brief.command.js.map +1 -1
- package/dist/src/commands/creation/deliberate.command.d.ts +2 -2
- package/dist/src/commands/creation/deliberate.command.d.ts.map +1 -1
- package/dist/src/commands/creation/deliberate.command.js +2 -2
- package/dist/src/commands/creation/deliberate.command.js.map +1 -1
- package/dist/src/commands/creation/depth.command.d.ts.map +1 -1
- package/dist/src/commands/creation/depth.command.js +1 -1
- package/dist/src/commands/creation/depth.command.js.map +1 -1
- package/dist/src/commands/creation/diff.command.d.ts.map +1 -1
- package/dist/src/commands/creation/diff.command.js.map +1 -1
- package/dist/src/commands/creation/feed.command.d.ts.map +1 -1
- package/dist/src/commands/creation/feed.command.js.map +1 -1
- package/dist/src/commands/creation/loop.command.d.ts.map +1 -1
- package/dist/src/commands/creation/loop.command.js.map +1 -1
- package/dist/src/commands/creation/persona.command.d.ts +3 -2
- package/dist/src/commands/creation/persona.command.d.ts.map +1 -1
- package/dist/src/commands/creation/persona.command.js +10 -3
- package/dist/src/commands/creation/persona.command.js.map +1 -1
- package/dist/src/commands/creation/preflight.command.d.ts.map +1 -1
- package/dist/src/commands/creation/preflight.command.js.map +1 -1
- package/dist/src/commands/creation/prompt-hook.command.d.ts.map +1 -1
- package/dist/src/commands/creation/prompt-hook.command.js.map +1 -1
- package/dist/src/commands/creation/propose.command.d.ts.map +1 -1
- package/dist/src/commands/creation/propose.command.js.map +1 -1
- package/dist/src/commands/creation/pulse.command.d.ts.map +1 -1
- package/dist/src/commands/creation/pulse.command.js.map +1 -1
- package/dist/src/commands/creation/questions.command.d.ts.map +1 -1
- package/dist/src/commands/creation/questions.command.js.map +1 -1
- package/dist/src/commands/creation/reason.command.d.ts.map +1 -1
- package/dist/src/commands/creation/reason.command.js.map +1 -1
- package/dist/src/commands/creation/report.command.d.ts.map +1 -1
- package/dist/src/commands/creation/report.command.js.map +1 -1
- package/dist/src/commands/creation/revert.command.d.ts.map +1 -1
- package/dist/src/commands/creation/revert.command.js.map +1 -1
- package/dist/src/commands/creation/run.command.d.ts.map +1 -1
- package/dist/src/commands/creation/run.command.js.map +1 -1
- package/dist/src/commands/creation/statusline.command.d.ts.map +1 -1
- package/dist/src/commands/creation/statusline.command.js.map +1 -1
- package/dist/src/commands/creation/watch.command.d.ts.map +1 -1
- package/dist/src/commands/creation/watch.command.js.map +1 -1
- package/dist/src/commands/creation/why.command.d.ts +3 -1
- package/dist/src/commands/creation/why.command.d.ts.map +1 -1
- package/dist/src/commands/creation/why.command.js +28 -9
- package/dist/src/commands/creation/why.command.js.map +1 -1
- package/dist/src/commands/creation/writes.command.d.ts.map +1 -1
- package/dist/src/commands/creation/writes.command.js.map +1 -1
- package/dist/src/commands/db/db-schema-plan-migration.utils.d.ts.map +1 -1
- package/dist/src/commands/db/db-schema-plan-migration.utils.js.map +1 -1
- package/dist/src/commands/db/db-schema-plan.utils.d.ts.map +1 -1
- package/dist/src/commands/db/db-schema-plan.utils.js.map +1 -1
- package/dist/src/commands/db/diff.command.d.ts.map +1 -1
- package/dist/src/commands/db/diff.command.js.map +1 -1
- package/dist/src/commands/db/generate.command.d.ts.map +1 -1
- package/dist/src/commands/db/generate.command.js.map +1 -1
- package/dist/src/commands/db/migrate.command.d.ts.map +1 -1
- package/dist/src/commands/db/migrate.command.js.map +1 -1
- package/dist/src/commands/db/resolve.command.d.ts.map +1 -1
- package/dist/src/commands/db/resolve.command.js.map +1 -1
- package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
- 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-generate.command.js.map +1 -1
- package/dist/src/commands/dev/design-tokens-init.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-init.command.js.map +1 -1
- package/dist/src/commands/dev/design-tokens-validate.command.d.ts.map +1 -1
- package/dist/src/commands/dev/design-tokens-validate.command.js.map +1 -1
- package/dist/src/commands/dev/force-stop.command.d.ts.map +1 -1
- package/dist/src/commands/dev/force-stop.command.js.map +1 -1
- package/dist/src/commands/dev/resources.command.d.ts.map +1 -1
- package/dist/src/commands/dev/resources.command.js.map +1 -1
- package/dist/src/commands/dev/start.command.d.ts.map +1 -1
- 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/stop-all.command.js.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.map +1 -1
- package/dist/src/commands/docs/publish.command.d.ts.map +1 -1
- package/dist/src/commands/docs/publish.command.js.map +1 -1
- package/dist/src/commands/frontend/publish.command.d.ts.map +1 -1
- package/dist/src/commands/frontend/publish.command.js.map +1 -1
- package/dist/src/commands/fwk/audit.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/audit.command.js.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.map +1 -1
- package/dist/src/commands/fwk/generate-docs.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/generate-docs.command.js.map +1 -1
- package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/generate-providers.command.js.map +1 -1
- package/dist/src/commands/fwk/graph.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/graph.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-docker.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-npm.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-npm.command.js.map +1 -1
- package/dist/src/commands/fwk/version-bump.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-bump.command.js.map +1 -1
- package/dist/src/commands/fwk/version-set.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-set.command.js.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.map +1 -1
- package/dist/src/commands/fwk/version-sync.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/version-sync.command.js.map +1 -1
- package/dist/src/commands/fwk/what-touches.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/what-touches.command.js.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-status.command.js.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/wt-tail.command.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.map +1 -1
- package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
- 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-status.command.js.map +1 -1
- package/dist/src/commands/generate/email-test-send.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-test-send.command.js.map +1 -1
- package/dist/src/commands/generate/email-translate.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email-translate.command.js.map +1 -1
- package/dist/src/commands/generate/email.command.d.ts.map +1 -1
- package/dist/src/commands/generate/email.command.js.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.map +1 -1
- package/dist/src/commands/generate/labels-plan.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labels-plan.command.js.map +1 -1
- package/dist/src/commands/generate/labels.command.d.ts.map +1 -1
- package/dist/src/commands/generate/labels.command.js.map +1 -1
- package/dist/src/commands/generate/translate.command.d.ts.map +1 -1
- package/dist/src/commands/generate/translate.command.js.map +1 -1
- package/dist/src/commands/help.command.d.ts.map +1 -1
- package/dist/src/commands/help.command.js.map +1 -1
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
- package/dist/src/commands/local/deregister.command.js.map +1 -1
- package/dist/src/commands/local/dev-status.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev-status.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- 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/down.command.js.map +1 -1
- package/dist/src/commands/local/init.command.d.ts.map +1 -1
- 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/logs.command.js.map +1 -1
- package/dist/src/commands/local/reinit.command.d.ts.map +1 -1
- package/dist/src/commands/local/reinit.command.js.map +1 -1
- package/dist/src/commands/local/reset.command.d.ts.map +1 -1
- package/dist/src/commands/local/reset.command.js.map +1 -1
- package/dist/src/commands/local/restore.command.d.ts.map +1 -1
- package/dist/src/commands/local/restore.command.js.map +1 -1
- package/dist/src/commands/local/smoke.command.d.ts.map +1 -1
- package/dist/src/commands/local/smoke.command.js.map +1 -1
- package/dist/src/commands/local/status.command.d.ts.map +1 -1
- package/dist/src/commands/local/status.command.js.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/local-defaults/capture.command.d.ts.map +1 -1
- package/dist/src/commands/local-defaults/capture.command.js.map +1 -1
- package/dist/src/commands/lock/check.command.d.ts.map +1 -1
- package/dist/src/commands/lock/check.command.js.map +1 -1
- package/dist/src/commands/market/generate.command.d.ts.map +1 -1
- package/dist/src/commands/market/generate.command.js.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.map +1 -1
- package/dist/src/commands/prefs/set.command.d.ts.map +1 -1
- package/dist/src/commands/prefs/set.command.js.map +1 -1
- package/dist/src/commands/providers/show.command.d.ts.map +1 -1
- package/dist/src/commands/providers/show.command.js.map +1 -1
- package/dist/src/commands/registry/add.command.d.ts.map +1 -1
- package/dist/src/commands/registry/add.command.js.map +1 -1
- package/dist/src/commands/registry/info.command.d.ts.map +1 -1
- package/dist/src/commands/registry/info.command.js.map +1 -1
- package/dist/src/commands/registry/key.command.d.ts.map +1 -1
- package/dist/src/commands/registry/key.command.js.map +1 -1
- package/dist/src/commands/registry/lockfile-smoke.command.d.ts.map +1 -1
- package/dist/src/commands/registry/lockfile-smoke.command.js.map +1 -1
- package/dist/src/commands/registry/login.command.d.ts.map +1 -1
- 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/logout.command.js.map +1 -1
- package/dist/src/commands/registry/outdated.command.d.ts.map +1 -1
- package/dist/src/commands/registry/outdated.command.js.map +1 -1
- package/dist/src/commands/registry/ping.command.d.ts.map +1 -1
- package/dist/src/commands/registry/ping.command.js.map +1 -1
- package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
- package/dist/src/commands/registry/publish.command.js.map +1 -1
- package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -1
- package/dist/src/commands/registry/registry-transport.constants.js.map +1 -1
- package/dist/src/commands/registry/remove.command.d.ts.map +1 -1
- package/dist/src/commands/registry/remove.command.js.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
- package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
- package/dist/src/commands/registry/search.command.d.ts.map +1 -1
- package/dist/src/commands/registry/search.command.js.map +1 -1
- package/dist/src/commands/registry/status.command.d.ts.map +1 -1
- package/dist/src/commands/registry/status.command.js.map +1 -1
- package/dist/src/commands/registry/update.command.d.ts.map +1 -1
- package/dist/src/commands/registry/update.command.js.map +1 -1
- package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
- package/dist/src/commands/registry/whoami.command.js.map +1 -1
- package/dist/src/commands/registry/yank.command.d.ts.map +1 -1
- package/dist/src/commands/registry/yank.command.js.map +1 -1
- package/dist/src/commands/remote/create.command.d.ts.map +1 -1
- package/dist/src/commands/remote/create.command.js.map +1 -1
- package/dist/src/commands/remote/list.command.d.ts.map +1 -1
- package/dist/src/commands/remote/list.command.js.map +1 -1
- package/dist/src/commands/remote/status.command.d.ts.map +1 -1
- package/dist/src/commands/remote/status.command.js.map +1 -1
- package/dist/src/commands/remote/sync.command.d.ts.map +1 -1
- package/dist/src/commands/remote/sync.command.js.map +1 -1
- package/dist/src/commands/secrets/github.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/github.command.js.map +1 -1
- package/dist/src/commands/secrets/list.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/list.command.js.map +1 -1
- package/dist/src/commands/secrets/set.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/set.command.js.map +1 -1
- package/dist/src/commands/secrets/unset.command.d.ts.map +1 -1
- package/dist/src/commands/secrets/unset.command.js.map +1 -1
- package/dist/src/commands/setup.command.d.ts.map +1 -1
- package/dist/src/commands/setup.command.js.map +1 -1
- package/dist/src/commands/update.command.d.ts.map +1 -1
- package/dist/src/commands/update.command.js.map +1 -1
- package/dist/src/commands/version.command.d.ts.map +1 -1
- package/dist/src/commands/version.command.js.map +1 -1
- package/dist/src/commands/website/audit.command.d.ts.map +1 -1
- package/dist/src/commands/website/audit.command.js.map +1 -1
- package/dist/src/commands/workbench/open.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/open.command.js.map +1 -1
- package/dist/src/commands/workbench/parallelism.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/parallelism.command.js.map +1 -1
- package/dist/src/commands/workbench/status.command.d.ts.map +1 -1
- package/dist/src/commands/workbench/status.command.js.map +1 -1
- package/dist/src/infrastructure/errors/error.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/errors/error.utils.js.map +1 -1
- package/dist/src/infrastructure/io/file.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/io/file.utils.js.map +1 -1
- package/dist/src/infrastructure/io/io.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/io/io.schemas.js.map +1 -1
- package/dist/src/infrastructure/io/template-processor.d.ts.map +1 -1
- package/dist/src/infrastructure/io/template-processor.js.map +1 -1
- package/dist/src/infrastructure/logger/logger.service.d.ts.map +1 -1
- package/dist/src/infrastructure/logger/logger.service.js.map +1 -1
- package/dist/src/infrastructure/process/spawn.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/process/spawn.utils.js.map +1 -1
- package/dist/src/infrastructure/ui/formatting.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/formatting.service.js.map +1 -1
- package/dist/src/infrastructure/ui/interaction-engine.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/interaction-engine.service.js.map +1 -1
- package/dist/src/infrastructure/ui/markdown-renderer.service.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/markdown-renderer.service.js.map +1 -1
- package/dist/src/infrastructure/ui/ui.schemas.d.ts.map +1 -1
- package/dist/src/infrastructure/ui/ui.schemas.js.map +1 -1
- package/dist/src/infrastructure/utils/string.utils.d.ts.map +1 -1
- package/dist/src/infrastructure/utils/string.utils.js.map +1 -1
- package/dist/src/infrastructure/validation/validator.service.d.ts.map +1 -1
- package/dist/src/infrastructure/validation/validator.service.js.map +1 -1
- package/dist/src/kernel/base-command.d.ts.map +1 -1
- package/dist/src/kernel/base-command.js.map +1 -1
- package/dist/src/kernel/bootstrap.d.ts.map +1 -1
- package/dist/src/kernel/bootstrap.js.map +1 -1
- package/dist/src/kernel/command-index-cache.d.ts.map +1 -1
- package/dist/src/kernel/command-index-cache.js.map +1 -1
- package/dist/src/kernel/command-registry.d.ts.map +1 -1
- 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-runner.js.map +1 -1
- package/dist/src/kernel/command-scope-utils.d.ts.map +1 -1
- package/dist/src/kernel/command-scope-utils.js.map +1 -1
- package/dist/src/kernel/flag-utils.d.ts.map +1 -1
- package/dist/src/kernel/flag-utils.js.map +1 -1
- package/dist/src/kernel/hooks.d.ts.map +1 -1
- package/dist/src/kernel/hooks.js.map +1 -1
- package/dist/src/kernel/logger.d.ts.map +1 -1
- package/dist/src/kernel/logger.js.map +1 -1
- package/dist/src/kernel/types.d.ts.map +1 -1
- package/dist/src/kernel/types.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/modules/domain/credentials/admin-user.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/admin-user.module.js.map +1 -1
- package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -1
- package/dist/src/modules/domain/credentials/creation-essentials.module.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/creation-essentials.module.js.map +1 -1
- package/dist/src/modules/domain/credentials/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/credentials/module.types.js.map +1 -1
- package/dist/src/modules/domain/environment/database-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/database-config.module.js.map +1 -1
- package/dist/src/modules/domain/environment/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/module.types.js.map +1 -1
- package/dist/src/modules/domain/environment/paths-config.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/paths-config.module.js.map +1 -1
- package/dist/src/modules/domain/environment/runtime-selector.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-selector.module.js.map +1 -1
- package/dist/src/modules/domain/environment/runtime-semantics.module.d.ts.map +1 -1
- package/dist/src/modules/domain/environment/runtime-semantics.module.js.map +1 -1
- package/dist/src/modules/domain/module.types.d.ts.map +1 -1
- package/dist/src/modules/domain/module.types.js.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- 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-env.service.js.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.js.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
- package/dist/src/services/application/app-schema-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-schema-bootstrap.service.js.map +1 -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.map +1 -1
- package/dist/src/services/application/application-browser-smoke.service.d.ts.map +1 -1
- package/dist/src/services/application/application-browser-smoke.service.js.map +1 -1
- package/dist/src/services/application/application-creation-readiness.service.d.ts.map +1 -1
- package/dist/src/services/application/application-creation-readiness.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-dependency-alignment.service.js.map +1 -1
- package/dist/src/services/application/application-dev-port-offsets.d.ts.map +1 -1
- package/dist/src/services/application/application-dev-port-offsets.js.map +1 -1
- package/dist/src/services/application/application-initialization-verification.service.d.ts.map +1 -1
- package/dist/src/services/application/application-initialization-verification.service.js.map +1 -1
- package/dist/src/services/application/application-root.utils.d.ts.map +1 -1
- package/dist/src/services/application/application-root.utils.js.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/backend-config.paths.d.ts.map +1 -1
- package/dist/src/services/application/backend-config.paths.js.map +1 -1
- package/dist/src/services/application/composition-provider-plan.service.d.ts.map +1 -1
- package/dist/src/services/application/composition-provider-plan.service.js.map +1 -1
- package/dist/src/services/application/creation-host-readiness.service.d.ts.map +1 -1
- package/dist/src/services/application/creation-host-readiness.service.js.map +1 -1
- package/dist/src/services/application/creation-preflight.service.d.ts.map +1 -1
- package/dist/src/services/application/creation-preflight.service.js.map +1 -1
- package/dist/src/services/application/degraded-registration-declaration-convergence.service.d.ts.map +1 -1
- package/dist/src/services/application/degraded-registration-declaration-convergence.service.js.map +1 -1
- package/dist/src/services/application/dev-orchestrator.service.d.ts.map +1 -1
- package/dist/src/services/application/dev-orchestrator.service.js.map +1 -1
- package/dist/src/services/application/dev-schema-drift.service.d.ts.map +1 -1
- package/dist/src/services/application/dev-schema-drift.service.js.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.d.ts.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.js.map +1 -1
- package/dist/src/services/application/existing-app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/existing-app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/frontend-provider-source.service.d.ts.map +1 -1
- package/dist/src/services/application/frontend-provider-source.service.js.map +1 -1
- package/dist/src/services/application/frontend-public-config-secret-screen.service.d.ts.map +1 -1
- package/dist/src/services/application/frontend-public-config-secret-screen.service.js.map +1 -1
- package/dist/src/services/application/local-app-reinit.service.d.ts.map +1 -1
- package/dist/src/services/application/local-app-reinit.service.js.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.map +1 -1
- package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-package-links.service.js.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- 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.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.map +1 -1
- package/dist/src/services/application/stored-declaration-currency.service.d.ts.map +1 -1
- package/dist/src/services/application/stored-declaration-currency.service.js.map +1 -1
- package/dist/src/services/application/systems-of-record-library.service.d.ts.map +1 -1
- package/dist/src/services/application/systems-of-record-library.service.js.map +1 -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.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.d.ts.map +1 -1
- package/dist/src/services/catalog/service-catalog.schemas.js.map +1 -1
- 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.map +1 -1
- package/dist/src/services/coding-agents/coding-agent-login.service.d.ts.map +1 -1
- package/dist/src/services/coding-agents/coding-agent-login.service.js.map +1 -1
- package/dist/src/services/companion/build-console.service.d.ts +62 -2
- package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
- package/dist/src/services/companion/build-console.service.js +70 -5
- package/dist/src/services/companion/build-console.service.js.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.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.map +1 -1
- package/dist/src/services/companion/companion-health-hint.utils.d.ts.map +1 -1
- package/dist/src/services/companion/companion-health-hint.utils.js.map +1 -1
- package/dist/src/services/companion/companion-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-lifecycle.service.js.map +1 -1
- package/dist/src/services/companion/companion-local-token.utils.d.ts.map +1 -1
- package/dist/src/services/companion/companion-local-token.utils.js.map +1 -1
- 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/console-fast-path.d.ts +21 -3
- package/dist/src/services/companion/console-fast-path.d.ts.map +1 -1
- package/dist/src/services/companion/console-fast-path.js +57 -12
- package/dist/src/services/companion/console-fast-path.js.map +1 -1
- package/dist/src/services/companion/console-verb.utils.d.ts.map +1 -1
- package/dist/src/services/companion/console-verb.utils.js.map +1 -1
- package/dist/src/services/companion/creation-console.service.d.ts +76 -0
- package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-console.service.js +124 -11
- package/dist/src/services/companion/creation-console.service.js.map +1 -1
- package/dist/src/services/companion/creation-run-report.models.d.ts.map +1 -1
- package/dist/src/services/companion/creation-run-report.models.js.map +1 -1
- package/dist/src/services/companion/git-helper.service.d.ts.map +1 -1
- package/dist/src/services/companion/git-helper.service.js.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.map +1 -1
- package/dist/src/services/companion/workbench-browser-launcher.service.d.ts.map +1 -1
- package/dist/src/services/companion/workbench-browser-launcher.service.js.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.map +1 -1
- package/dist/src/services/compliance/data-retention-schedule.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/data-retention-schedule.generator.js.map +1 -1
- package/dist/src/services/compliance/generated-compliance-module-wiring.d.ts +5 -3
- package/dist/src/services/compliance/generated-compliance-module-wiring.d.ts.map +1 -1
- package/dist/src/services/compliance/generated-compliance-module-wiring.js +4 -2
- package/dist/src/services/compliance/generated-compliance-module-wiring.js.map +1 -1
- package/dist/src/services/compliance/governed-document-releases.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/governed-document-releases.generator.js.map +1 -1
- package/dist/src/services/compliance/legal-notice.generator.d.ts +45 -0
- package/dist/src/services/compliance/legal-notice.generator.d.ts.map +1 -0
- package/dist/src/services/compliance/legal-notice.generator.js +97 -0
- package/dist/src/services/compliance/legal-notice.generator.js.map +1 -0
- package/dist/src/services/compliance/service-consent-requirement.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/service-consent-requirement.generator.js.map +1 -1
- package/dist/src/services/compliance/subject-data-recipients.generator.d.ts.map +1 -1
- package/dist/src/services/compliance/subject-data-recipients.generator.js.map +1 -1
- package/dist/src/services/context/context-manager.service.d.ts.map +1 -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/context.schemas.js.map +1 -1
- package/dist/src/services/context/machine-preferences.writer.d.ts.map +1 -1
- package/dist/src/services/context/machine-preferences.writer.js.map +1 -1
- package/dist/src/services/context/state-manager.service.d.ts.map +1 -1
- package/dist/src/services/context/state-manager.service.js.map +1 -1
- package/dist/src/services/credentials/application-secret-owners.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secret-owners.service.js.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.js.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.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
- package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- 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/credentials.service.js.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
- package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
- package/dist/src/services/credentials/local-defaults.service.d.ts.map +1 -1
- package/dist/src/services/credentials/local-defaults.service.js.map +1 -1
- package/dist/src/services/credentials/local-secrets-store.service.d.ts.map +1 -1
- package/dist/src/services/credentials/local-secrets-store.service.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/provider-secret-format.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-secret-format.js.map +1 -1
- package/dist/src/services/credentials/remote-secrets-store.service.d.ts.map +1 -1
- package/dist/src/services/credentials/remote-secrets-store.service.js.map +1 -1
- package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-provisioning.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-provisioning.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-reader.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-reader.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-rotation.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-rotation.service.js.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.js.map +1 -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.map +1 -1
- package/dist/src/services/data-services/data-services.service.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.service.js.map +1 -1
- package/dist/src/services/deployment/apps-manager-diagnostics.service.d.ts.map +1 -1
- package/dist/src/services/deployment/apps-manager-diagnostics.service.js.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.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.map +1 -1
- package/dist/src/services/deployment/docker/backing-service-health-watch.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/backing-service-health-watch.js.map +1 -1
- package/dist/src/services/deployment/docker/compose-service-health.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/compose-service-health.js.map +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.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-compose-readiness.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.schemas.js.map +1 -1
- package/dist/src/services/deployment/docker/docker.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker.service.js.map +1 -1
- package/dist/src/services/deployment/docker/local-data-adoption.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/local-data-adoption.service.js.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts.map +1 -1
- package/dist/src/services/deployment/host-toolchain-readiness.service.js.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.map +1 -1
- package/dist/src/services/deployment/k8s/cluster-controller-charts.constants.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/cluster-controller-charts.constants.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
- 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-local-infra-readiness.service.js.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.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- 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-operations.service.js.map +1 -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.map +1 -1
- package/dist/src/services/deployment/k8s/k8s.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/kind.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/kind.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-observer-lifecycle.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-observer-lifecycle.js.map +1 -1
- package/dist/src/services/deployment/local-dev-output-boundary.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-output-boundary.js.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-session-lease.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-shutdown-coordinator.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-shutdown-coordinator.js.map +1 -1
- package/dist/src/services/deployment/local-infrastructure-initialization.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-infrastructure-initialization.service.js.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.schemas.js.map +1 -1
- package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
- 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/local-runtime-process-cleanup.service.js.map +1 -1
- package/dist/src/services/deployment/platform-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-lifecycle.service.js.map +1 -1
- package/dist/src/services/deployment/platform-runtime-policy.service.d.ts.map +1 -1
- package/dist/src/services/deployment/platform-runtime-policy.service.js.map +1 -1
- package/dist/src/services/deployment/version-compare.utils.d.ts.map +1 -1
- package/dist/src/services/deployment/version-compare.utils.js.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-command.service.js.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.service.js.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-config.template.js.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-css-block.service.js.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-paths.service.js.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.constants.js.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.models.d.ts.map +1 -1
- package/dist/src/services/design-tokens/design-tokens.models.js.map +1 -1
- package/dist/src/services/environment/application-backing-service-addressing.utils.d.ts.map +1 -1
- package/dist/src/services/environment/application-backing-service-addressing.utils.js.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- 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-hydration.utils.js.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-paths.service.d.ts.map +1 -1
- 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-registry.service.js.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.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.schemas.js.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/environment/hosted-infrastructure-leftovers.service.d.ts.map +1 -1
- package/dist/src/services/environment/hosted-infrastructure-leftovers.service.js.map +1 -1
- package/dist/src/services/environment/infrastructure-host.service.d.ts.map +1 -1
- package/dist/src/services/environment/infrastructure-host.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-engine-change.utils.js.map +1 -1
- package/dist/src/services/environment/platform-runtime-state.service.d.ts.map +1 -1
- package/dist/src/services/environment/platform-runtime-state.service.js.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/environment/runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/framework/application-claude-settings.d.ts +39 -5
- package/dist/src/services/framework/application-claude-settings.d.ts.map +1 -1
- package/dist/src/services/framework/application-claude-settings.js +100 -25
- package/dist/src/services/framework/application-claude-settings.js.map +1 -1
- package/dist/src/services/framework/application-rule-imports.d.ts.map +1 -1
- package/dist/src/services/framework/application-rule-imports.js.map +1 -1
- package/dist/src/services/framework/claude-plugin-compiler.d.ts.map +1 -1
- package/dist/src/services/framework/claude-plugin-compiler.js +3 -2
- package/dist/src/services/framework/claude-plugin-compiler.js.map +1 -1
- package/dist/src/services/framework/dev-compile-status.paths.d.ts.map +1 -1
- package/dist/src/services/framework/dev-compile-status.paths.js.map +1 -1
- 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.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-application-guidance.validator.js.map +1 -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.map +1 -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.map +1 -1
- package/dist/src/services/framework/framework-knowledge-scan.constants.d.ts.map +1 -1
- package/dist/src/services/framework/framework-knowledge-scan.constants.js.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.map +1 -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.map +1 -1
- package/dist/src/services/framework/framework-release.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-release.service.js.map +1 -1
- package/dist/src/services/framework/framework-update.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-update.service.js.map +1 -1
- package/dist/src/services/framework/framework-version.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-version.service.js.map +1 -1
- package/dist/src/services/framework/frontend-component-catalog.generator.d.ts.map +1 -1
- package/dist/src/services/framework/frontend-component-catalog.generator.js.map +1 -1
- package/dist/src/services/framework/frontend-library-root-exports.d.ts.map +1 -1
- package/dist/src/services/framework/frontend-library-root-exports.js.map +1 -1
- package/dist/src/services/framework/installed-framework-assets.service.d.ts.map +1 -1
- package/dist/src/services/framework/installed-framework-assets.service.js.map +1 -1
- package/dist/src/services/framework/npm-registry-output.d.ts.map +1 -1
- package/dist/src/services/framework/npm-registry-output.js.map +1 -1
- package/dist/src/services/framework/package-install.service.d.ts.map +1 -1
- package/dist/src/services/framework/package-install.service.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/api-version-settlement.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/api-version-settlement.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/base-url-settlement.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/base-url-settlement.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-enrichment.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/openapi-source.reader.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-merge.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-merge.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/request-helper-url.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/request-helper-url.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/sim-source.reader.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/source-static-evaluator.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/source-static-evaluator.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/transposed-provider.model.js.map +1 -1
- package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts.map +1 -1
- package/dist/src/services/framework/provider-transposition/url-template.extractor.js.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.map +1 -1
- package/dist/src/services/frontend/frontend-dist-uploader.service.d.ts.map +1 -1
- package/dist/src/services/frontend/frontend-dist-uploader.service.js.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.map +1 -1
- package/dist/src/services/generation/domain-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/domain-generator.service.js.map +1 -1
- package/dist/src/services/generation/generator.schemas.d.ts.map +1 -1
- package/dist/src/services/generation/generator.schemas.js.map +1 -1
- package/dist/src/services/generation/operation-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/operation-generator.service.js.map +1 -1
- package/dist/src/services/generation/resource-generator.service.d.ts.map +1 -1
- package/dist/src/services/generation/resource-generator.service.js.map +1 -1
- package/dist/src/services/generation/template-registry.service.d.ts.map +1 -1
- package/dist/src/services/generation/template-registry.service.js.map +1 -1
- package/dist/src/services/registry/artifact-extractor.utils.d.ts.map +1 -1
- package/dist/src/services/registry/artifact-extractor.utils.js.map +1 -1
- package/dist/src/services/registry/artifact-trust.utils.d.ts.map +1 -1
- package/dist/src/services/registry/artifact-trust.utils.js.map +1 -1
- package/dist/src/services/registry/boundary-fanout.utils.d.ts.map +1 -1
- package/dist/src/services/registry/boundary-fanout.utils.js.map +1 -1
- package/dist/src/services/registry/git-ignored-paths.utils.d.ts.map +1 -1
- package/dist/src/services/registry/git-ignored-paths.utils.js.map +1 -1
- package/dist/src/services/registry/index.d.ts.map +1 -1
- package/dist/src/services/registry/index.js.map +1 -1
- package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
- package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
- package/dist/src/services/registry/local-checkout-module-source.service.d.ts.map +1 -1
- package/dist/src/services/registry/local-checkout-module-source.service.js.map +1 -1
- package/dist/src/services/registry/migration-obligation.utils.d.ts.map +1 -1
- package/dist/src/services/registry/migration-obligation.utils.js.map +1 -1
- package/dist/src/services/registry/module-acquisition.utils.d.ts.map +1 -1
- package/dist/src/services/registry/module-acquisition.utils.js.map +1 -1
- package/dist/src/services/registry/module-artifact-files.utils.d.ts.map +1 -1
- package/dist/src/services/registry/module-artifact-files.utils.js.map +1 -1
- package/dist/src/services/registry/module-registration.service.d.ts.map +1 -1
- package/dist/src/services/registry/module-registration.service.js.map +1 -1
- package/dist/src/services/registry/module-requirements.service.d.ts.map +1 -1
- package/dist/src/services/registry/module-requirements.service.js.map +1 -1
- package/dist/src/services/registry/provider-install-step.d.ts.map +1 -1
- package/dist/src/services/registry/provider-install-step.js.map +1 -1
- package/dist/src/services/registry/provider-module-checks.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-checks.service.js.map +1 -1
- package/dist/src/services/registry/provider-module-identity.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-identity.service.js.map +1 -1
- package/dist/src/services/registry/provider-wiring.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-wiring.service.js.map +1 -1
- package/dist/src/services/registry/registry-command.utils.d.ts.map +1 -1
- package/dist/src/services/registry/registry-command.utils.js.map +1 -1
- package/dist/src/services/registry/registry-config-resolver.service.d.ts.map +1 -1
- package/dist/src/services/registry/registry-config-resolver.service.js.map +1 -1
- package/dist/src/services/registry/registry-credentials.service.d.ts.map +1 -1
- package/dist/src/services/registry/registry-credentials.service.js.map +1 -1
- package/dist/src/services/registry/saas-root-required.error.d.ts.map +1 -1
- package/dist/src/services/registry/saas-root-required.error.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- 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/tools/utility-tools.service.js.map +1 -1
- package/dist/src/services/tracker/creation-run-tracker.service.d.ts.map +1 -1
- package/dist/src/services/tracker/creation-run-tracker.service.js.map +1 -1
- package/dist/src/services/website/website-label-pack-audit.service.d.ts.map +1 -1
- package/dist/src/services/website/website-label-pack-audit.service.js.map +1 -1
- 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.map +1 -1
- package/dist/src/services/website/website-workspace.service.d.ts.map +1 -1
- package/dist/src/services/website/website-workspace.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +17 -17
- package/templates/saas/i18n/email/email-template-definitions.ts +5 -1
- package/templates/saas/scenarios/add-locale/files/website/src/i18n/__localePath__.json.hbs +21 -1
- package/templates/saas/scenarios/add-locale/files/website/src/pages/__localePath__/index.astro +1 -0
- package/templates/saas/scenarios/add-marketing-page/files/website/src/pages/__pageRef__.astro.hbs +1 -0
- package/templates/saas/scenarios/add-module/scenario.json +5 -0
- package/templates/saas/scenarios/add-website/files/website/src/components/FooterComponent.tsx.hbs +14 -6
- package/templates/saas/scenarios/add-website/files/website/src/content/llms.txt.hbs +3 -3
- package/templates/saas/scenarios/add-website/files/website/src/i18n/en.json.hbs +4 -0
- package/templates/saas/scenarios/add-website/files/website/src/pages/index.astro +1 -0
- package/templates/saas/scenarios/add-website/files/website/src/pages/llms.txt.ts +3 -1
- package/templates/saas/scenarios/add-website/files/website/src/styles/website.css +14 -0
- package/templates/saas/skeleton/backend-api/src/engine/email/email-template-definitions.ts +5 -1
- package/templates/saas/skeleton/shared-lib/src/engine/roles.ts +10 -2
- package/templates/saas/skeleton/specifications/src/companion-exports.ts +28 -3
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"existing-app-bootstrap.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/existing-app-bootstrap.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GAGvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AAEnG,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Y,EAAE,OAAO,CAAC,CAAC;YAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YACnE,IAAI,UAAU,KAAK,aAAa,EAAE,CAAC;gBACjC,OAAO,gBAAgB,CAAC;YAC1B,CAAC;YAED,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC;YAClF,OAAO;gBACL,MAAM;gBACN,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,MAAM;oBACzC,CAAC,CAAC,gBAAgB,CAAC,MAAM;oBACzB,CAAC,CAAC,oBAAoB,CAAC,IAAI;aAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,iCAAiC,cAAc,yCAAyC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAC/H,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,CAAC,KAAK,CAAC,kBAAkB,CACrC,OAAe;QAEf,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAC,uBAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5F,CAAC;CACF","sourcesContent":["import * as fs from 'fs';\nimport { join } from 'path';\nimport {\n BackingServiceSource,\n DatabaseEngine,\n K8S_LOCAL_DEFAULTS,\n PUBLIC_DOMAIN_DEFAULTS,\n loadConfig,\n loadInfraEnvConfig,\n resolveAppLayout,\n WildoDeploymentRuntime,\n WORKSPACE_CONFIG_NAMES,\n type BackingServicesEnvConfig,\n type WildoSaasConfig,\n} from '@wildo-ai/platform-config-lib';\nimport { RuntimeEnvironment } from '@wildo-ai/saas-models';\nimport { EnvironmentLifecycle } from '~wildo-cli/services/environment/environment-lifecycle.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\ninterface LocalRuntimeSeed {\n runtime?: WildoDeploymentRuntime;\n runtimeEnvironment?: RuntimeEnvironment;\n database?: {\n engine: DatabaseEngine;\n source: BackingServiceSource;\n };\n /**\n * True when {@link database} came from an EXPLICIT `database` block in\n * `wildo.infra.local.config.ts`, rather than being derived from which backing services happen to\n * be declared. Provenance matters because an explicit declaration must not be second-guessed by\n * `loadAuthoritativeDatabaseSeed`, which otherwise re-derives the engine from\n * `wildo.saas.config.ts`'s `dataServices`.\n */\n databaseIsAuthored?: boolean;\n /**\n * Top-level `publicDomain` from the authored `wildo.infra.local.config.ts`.\n * Required upstream by the schema, but the seed may carry it as\n * undefined when the legacy local config has not yet been migrated;\n * the bootstrap path then falls back to\n * `PUBLIC_DOMAIN_DEFAULTS.{LOCAL_K8S | LOCAL_COMPOSE}`.\n */\n publicDomain?: string;\n kubernetes?: {\n namespace?: string;\n };\n /**\n * Authored `backingServices` block mirrored verbatim from\n * `wildo.infra.<env>.config.ts`. Threading the entire authored map into\n * the seed so the env state surfaces the same source-of-truth that the\n * docker-compose generator, env-vars builder, and address resolver all\n * read from `env.backingServices`. Without this seed, the post-Slice 4\n * default-runtime layout silently dropped any service that is GATED on\n * `env.backingServices?.[kind]?.source === SELF` (e.g. clamav — see\n * resolveIncludeLocalClamAV in docker-compose-generator.service.ts), so\n * `wildo local up` rendered a docker-compose missing the opt-in service\n * even though the operator had authored it.\n */\n backingServices?: BackingServicesEnvConfig;\n /** The resolved infrastructure host, when the local environment runs on another application's. */\n infrastructureHost?: { applicationRoot: string; infraConfigPath: string };\n}\n\n/**\n * Bootstraps the CLI environment registry for an existing checked-in app root.\n *\n * `wildo init` creates the `local` registry entry for greenfield targeted apps,\n * but real framework/example repositories already have committed app/infra\n * configs before the CLI is first run on a given machine. In that case we still\n * need a minimal `local` environment entry so commands like `config sync`,\n * `local status`, and `dev start` can operate without requiring users to\n * recreate scaffolding.\n */\nexport class ExistingAppBootstrapService {\n static async ensureLocalEnvironment(\n appRoot: string | null,\n frameworkPath: string | null,\n ): Promise<void> {\n if (!appRoot) {\n return;\n }\n\n await EnvironmentRegistry.withSaasRootOverride(appRoot, async () => {\n const appLayout = resolveAppLayout(appRoot);\n const currentEnv = EnvironmentRegistry.getCurrent();\n if (currentEnv) {\n return;\n }\n\n const existingLocal = EnvironmentRegistry.get('local');\n if (existingLocal) {\n EnvironmentRegistry.switchTo(existingLocal.name);\n return;\n }\n\n const localInfraSeed = await ExistingAppBootstrapService.loadLocalInfraSeed(appRoot);\n const hasAuthoredLocalSecrets = fs.existsSync(\n join(appLayout.authoredInfrastructureHome, 'local', 'secrets', 'secrets.json'),\n );\n const siblingSecretsRepo = frameworkPath && !hasAuthoredLocalSecrets\n ? EnvironmentPaths.detectSiblingSecretsRepo(frameworkPath)\n : null;\n const authoritativeDatabase = await ExistingAppBootstrapService.loadAuthoritativeDatabaseSeed(\n appRoot,\n localInfraSeed?.database,\n localInfraSeed?.databaseIsAuthored,\n );\n\n const seededRuntime = localInfraSeed?.runtime ?? WildoDeploymentRuntime.DOCKER_COMPOSE;\n const seededPublicDomain =\n localInfraSeed?.publicDomain\n ?? (seededRuntime === WildoDeploymentRuntime.KUBERNETES\n ? PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S\n : PUBLIC_DOMAIN_DEFAULTS.LOCAL_COMPOSE);\n\n const overrides: Partial<PlatformEnvironmentConfiguration> = {\n runtime: seededRuntime,\n runtimeEnvironment: localInfraSeed?.runtimeEnvironment ?? RuntimeEnvironment.DEVELOPMENT,\n secretsPath: siblingSecretsRepo ?? EnvironmentPaths.resolveDefaultSecretsBase(appRoot),\n configPath: siblingSecretsRepo ?? EnvironmentPaths.resolveDefaultConfigBase(appRoot),\n infraPath: EnvironmentPaths.resolveDefaultInfraBase(appRoot),\n database: authoritativeDatabase ?? {\n engine: DatabaseEngine.MONGODB,\n source: BackingServiceSource.SELF,\n },\n publicDomain: seededPublicDomain,\n backingServices: localInfraSeed?.backingServices,\n infrastructureHost: localInfraSeed?.infrastructureHost,\n };\n\n if (seededRuntime === WildoDeploymentRuntime.KUBERNETES) {\n overrides.kubernetes = {\n namespace: localInfraSeed?.kubernetes?.namespace ?? K8S_LOCAL_DEFAULTS.NAMESPACE,\n };\n }\n\n const env = EnvironmentLifecycle.initializeLocal(overrides);\n EnvironmentRegistry.switchTo(env.name);\n });\n }\n\n private static extractLocalRuntimeSeed(raw: unknown): LocalRuntimeSeed | null {\n if (typeof raw !== 'object' || raw === null) {\n return null;\n }\n\n const candidate = raw as Record<string, unknown>;\n const deployment = typeof candidate.deployment === 'object' && candidate.deployment !== null\n ? candidate.deployment as Record<string, unknown>\n : null;\n const backingServices = typeof candidate.backingServices === 'object' && candidate.backingServices !== null\n ? candidate.backingServices as Record<string, unknown>\n : null;\n const mongodb = typeof backingServices?.mongodb === 'object' && backingServices.mongodb !== null\n ? backingServices.mongodb as Record<string, unknown>\n : null;\n const postgresql = typeof backingServices?.postgresql === 'object' && backingServices.postgresql !== null\n ? backingServices.postgresql as Record<string, unknown>\n : null;\n // Slice 4.B.0 (2026-05-07): the parser accepts the post-reshape\n // `'self' | 'managed'` enum. The legacy `'atlas'` value was migrated\n // to `(source: 'managed', provider: 'atlas')` — if a stale config\n // still authors `source: 'atlas'`, fall back to SELF so the\n // bootstrap doesn't crash; the migration warning belongs to a\n // different code path (`wildo config validate`).\n const resolveSource = (value: unknown): BackingServiceSource => (\n value === BackingServiceSource.MANAGED\n ? BackingServiceSource.MANAGED\n : BackingServiceSource.SELF\n );\n const hasMongoDb = mongodb !== null;\n const hasPostgreSql = postgresql !== null;\n /**\n * The AUTHORED `database` block, when the config carries a well-formed one.\n *\n * Read defensively — this parser takes `unknown`, so only a recognised engine value is\n * honoured and a malformed block falls through to the backing-service derivation rather than\n * seeding a nonsense engine.\n */\n const authoredDatabase = ((): LocalRuntimeSeed['database'] | null => {\n const raw = typeof candidate.database === 'object' && candidate.database !== null\n ? candidate.database as Record<string, unknown>\n : null;\n if (raw?.engine === DatabaseEngine.POSTGRESQL || raw?.engine === DatabaseEngine.MONGODB) {\n return { engine: raw.engine, source: resolveSource(raw.source) };\n }\n return null;\n })();\n const seed: LocalRuntimeSeed = {\n runtime: (candidate.runtime as WildoDeploymentRuntime | undefined)\n ?? (deployment?.runtime as WildoDeploymentRuntime | undefined),\n runtimeEnvironment: candidate.runtimeEnvironment as RuntimeEnvironment | undefined,\n /**\n * An AUTHORED `database` block wins outright; the backing-service derivation below is the\n * fallback for environments that do not author one.\n *\n * The derivation cannot express a PostgreSQL platform: `hasMongoDb === hasPostgreSql` yields\n * `undefined` precisely when BOTH are declared, and a PostgreSQL platform is required to\n * declare both (the bootstrap plane is Mongo-wired). This is the same \"which services exist\"\n * standing in for \"what engine is the platform\" collapse that\n * `inferDatabaseChoiceFromInfraConfig` carries — the two are independent implementations of\n * one question, and both had to learn about the authored field.\n *\n * Read defensively (this parser takes `unknown`): only a well-formed engine value is\n * honoured, so a malformed authored block falls through to the derivation rather than\n * seeding a nonsense engine.\n */\n databaseIsAuthored: authoredDatabase !== null,\n database: ((): LocalRuntimeSeed['database'] => {\n if (authoredDatabase) {\n return authoredDatabase;\n }\n\n return hasMongoDb === hasPostgreSql\n ? undefined\n : hasPostgreSql\n ? {\n engine: DatabaseEngine.POSTGRESQL,\n source: resolveSource(postgresql.source),\n }\n : mongodb\n ? {\n engine: DatabaseEngine.MONGODB,\n source: resolveSource(mongodb.source),\n }\n : undefined;\n })(),\n publicDomain: typeof candidate.publicDomain === 'string' && candidate.publicDomain.length > 0\n ? candidate.publicDomain\n : undefined,\n kubernetes: typeof candidate.kubernetes === 'object' && candidate.kubernetes !== null\n ? {\n namespace: (candidate.kubernetes as Record<string, unknown>).namespace as string | undefined,\n }\n : undefined,\n backingServices: backingServices !== null\n ? (backingServices as unknown as BackingServicesEnvConfig)\n : undefined,\n infrastructureHost: typeof candidate.infrastructureHost === 'object' && candidate.infrastructureHost !== null\n ? candidate.infrastructureHost as LocalRuntimeSeed['infrastructureHost']\n : undefined,\n };\n if (\n !seed.runtime\n && !seed.runtimeEnvironment\n && !seed.database\n && !seed.kubernetes\n && !seed.publicDomain\n && !seed.backingServices\n ) {\n return null;\n }\n return seed;\n }\n\n private static async loadAuthoritativeDatabaseSeed(\n appRoot: string,\n fallbackDatabase: LocalRuntimeSeed['database'],\n databaseIsAuthored = false,\n ): Promise<LocalRuntimeSeed['database'] | undefined> {\n /**\n * An EXPLICIT `database` block in `wildo.infra.local.config.ts` is the authority and is never\n * re-derived here.\n *\n * The derivation below reads `wildo.saas.config.ts`'s `dataServices` — a different file\n * answering a different question (which data services the APPLICATION uses). It also carries\n * the same collapse as the other derivations: `hasMongoDb === hasPostgreSql` gives up exactly\n * when both are declared, which is the state a PostgreSQL platform is REQUIRED to be in. Left\n * unguarded, it would quietly overrule an operator who had authored the engine explicitly.\n */\n if (databaseIsAuthored && fallbackDatabase) {\n return fallbackDatabase;\n }\n\n const saasConfigPath = join(appRoot, WORKSPACE_CONFIG_NAMES.SAAS);\n if (!fs.existsSync(saasConfigPath)) {\n return fallbackDatabase;\n }\n\n try {\n const saasConfig = await loadConfig<WildoSaasConfig>(saasConfigPath);\n const hasMongoDb = Boolean(saasConfig.dataServices?.mongodb);\n const hasPostgreSql = Boolean(saasConfig.dataServices?.postgresql);\n if (hasMongoDb === hasPostgreSql) {\n return fallbackDatabase;\n }\n\n const engine = hasPostgreSql ? DatabaseEngine.POSTGRESQL : DatabaseEngine.MONGODB;\n return {\n engine,\n source: fallbackDatabase?.engine === engine\n ? fallbackDatabase.source\n : BackingServiceSource.SELF,\n };\n } catch (error) {\n throw new Error(\n `Failed to load SaaS config at ${saasConfigPath} while seeding the local environment: ${ErrorUtils.extractErrorMessage(error)}`,\n { cause: error },\n );\n }\n }\n\n /**\n * The local environment seed, read through the SHARED loader (`loadInfraEnvConfig`).\n *\n * It used to evaluate the authored file directly, which skipped the loader's environment check and —\n * the reason it mattered — its hosted-descriptor resolution: a hosted application's first seed would\n * have recorded no runtime, no platform database and no backing-service servers, since a hosted file\n * authors none of them. The seed is the registry's FIRST copy of those facts, so it must see the same\n * resolved environment every later reader sees.\n */\n private static async loadLocalInfraSeed(\n appRoot: string,\n ): Promise<LocalRuntimeSeed | null> {\n const loaded = await loadInfraEnvConfig(appRoot, 'local');\n return loaded ? ExistingAppBootstrapService.extractLocalRuntimeSeed(loaded.config) : null;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"existing-app-bootstrap.service.js","sourceRoot":"","sources":["../../../../src/services/application/existing-app-bootstrap.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GAGvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AAEnG,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AA6C1E;;;;;;;;;GASG;AACH,MAAM,OAAO,2BAA2B;IACtC,MAAM,CAAC,KAAK,CAAC,sBAAsB,CACjC,OAAsB,EACtB,aAA4B;QAE5B,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AgB,CAAC;YAC1B,CAAC;YAED,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC;YAClF,OAAO;gBACL,MAAM;gBACN,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,MAAM;oBACzC,CAAC,CAAC,gBAAgB,CAAC,MAAM;oBACzB,CAAC,CAAC,oBAAoB,CAAC,IAAI;aAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,iCAAiC,cAAc,yCAAyC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAC/H,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACK,MAAM,CAAC,KAAK,CAAC,kBAAkB,CACrC,OAAe;QAEf,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAC,uBAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5F,CAAC;CACF","sourcesContent":["import * as fs from 'fs';\nimport { join } from 'path';\nimport {\n BackingServiceSource,\n DatabaseEngine,\n K8S_LOCAL_DEFAULTS,\n PUBLIC_DOMAIN_DEFAULTS,\n loadConfig,\n loadInfraEnvConfig,\n resolveAppLayout,\n WildoDeploymentRuntime,\n WORKSPACE_CONFIG_NAMES,\n type BackingServicesEnvConfig,\n type WildoSaasConfig,\n} from '@wildo-ai/platform-config-lib';\nimport { RuntimeEnvironment } from '@wildo-ai/saas-models';\nimport { EnvironmentLifecycle } from '~wildo-cli/services/environment/environment-lifecycle.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\ninterface LocalRuntimeSeed {\n runtime?: WildoDeploymentRuntime;\n runtimeEnvironment?: RuntimeEnvironment;\n database?: {\n engine: DatabaseEngine;\n source: BackingServiceSource;\n };\n /**\n * True when {@link database} came from an EXPLICIT `database` block in\n * `wildo.infra.local.config.ts`, rather than being derived from which backing services happen to\n * be declared. Provenance matters because an explicit declaration must not be second-guessed by\n * `loadAuthoritativeDatabaseSeed`, which otherwise re-derives the engine from\n * `wildo.saas.config.ts`'s `dataServices`.\n */\n databaseIsAuthored?: boolean;\n /**\n * Top-level `publicDomain` from the authored `wildo.infra.local.config.ts`.\n * Required upstream by the schema, but the seed may carry it as\n * undefined when the legacy local config has not yet been migrated;\n * the bootstrap path then falls back to\n * `PUBLIC_DOMAIN_DEFAULTS.{LOCAL_K8S | LOCAL_COMPOSE}`.\n */\n publicDomain?: string;\n kubernetes?: {\n namespace?: string;\n };\n /**\n * Authored `backingServices` block mirrored verbatim from\n * `wildo.infra.<env>.config.ts`. Threading the entire authored map into\n * the seed so the env state surfaces the same source-of-truth that the\n * docker-compose generator, env-vars builder, and address resolver all\n * read from `env.backingServices`. Without this seed, the post-Slice 4\n * default-runtime layout silently dropped any service that is GATED on\n * `env.backingServices?.[kind]?.source === SELF` (e.g. clamav — see\n * resolveIncludeLocalClamAV in docker-compose-generator.service.ts), so\n * `wildo local up` rendered a docker-compose missing the opt-in service\n * even though the operator had authored it.\n */\n backingServices?: BackingServicesEnvConfig;\n /** The resolved infrastructure host, when the local environment runs on another application's. */\n infrastructureHost?: { applicationRoot: string; infraConfigPath: string };\n}\n\n/**\n * Bootstraps the CLI environment registry for an existing checked-in app root.\n *\n * `wildo init` creates the `local` registry entry for greenfield targeted apps,\n * but real framework/example repositories already have committed app/infra\n * configs before the CLI is first run on a given machine. In that case we still\n * need a minimal `local` environment entry so commands like `config sync`,\n * `local status`, and `dev start` can operate without requiring users to\n * recreate scaffolding.\n */\nexport class ExistingAppBootstrapService {\n static async ensureLocalEnvironment(\n appRoot: string | null,\n frameworkPath: string | null,\n ): Promise<void> {\n if (!appRoot) {\n return;\n }\n\n await EnvironmentRegistry.withSaasRootOverride(appRoot, async () => {\n const appLayout = resolveAppLayout(appRoot);\n const currentEnv = EnvironmentRegistry.getCurrent();\n if (currentEnv) {\n return;\n }\n\n const existingLocal = EnvironmentRegistry.get('local');\n if (existingLocal) {\n EnvironmentRegistry.switchTo(existingLocal.name);\n return;\n }\n\n const localInfraSeed = await ExistingAppBootstrapService.loadLocalInfraSeed(appRoot);\n const hasAuthoredLocalSecrets = fs.existsSync(\n join(appLayout.authoredInfrastructureHome, 'local', 'secrets', 'secrets.json'),\n );\n const siblingSecretsRepo = frameworkPath && !hasAuthoredLocalSecrets\n ? EnvironmentPaths.detectSiblingSecretsRepo(frameworkPath)\n : null;\n const authoritativeDatabase = await ExistingAppBootstrapService.loadAuthoritativeDatabaseSeed(\n appRoot,\n localInfraSeed?.database,\n localInfraSeed?.databaseIsAuthored,\n );\n\n const seededRuntime = localInfraSeed?.runtime ?? WildoDeploymentRuntime.DOCKER_COMPOSE;\n const seededPublicDomain =\n localInfraSeed?.publicDomain\n ?? (seededRuntime === WildoDeploymentRuntime.KUBERNETES\n ? PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S\n : PUBLIC_DOMAIN_DEFAULTS.LOCAL_COMPOSE);\n\n const overrides: Partial<PlatformEnvironmentConfiguration> = {\n runtime: seededRuntime,\n runtimeEnvironment: localInfraSeed?.runtimeEnvironment ?? RuntimeEnvironment.DEVELOPMENT,\n secretsPath: siblingSecretsRepo ?? EnvironmentPaths.resolveDefaultSecretsBase(appRoot),\n configPath: siblingSecretsRepo ?? EnvironmentPaths.resolveDefaultConfigBase(appRoot),\n infraPath: EnvironmentPaths.resolveDefaultInfraBase(appRoot),\n database: authoritativeDatabase ?? {\n engine: DatabaseEngine.MONGODB,\n source: BackingServiceSource.SELF,\n },\n publicDomain: seededPublicDomain,\n backingServices: localInfraSeed?.backingServices,\n infrastructureHost: localInfraSeed?.infrastructureHost,\n };\n\n if (seededRuntime === WildoDeploymentRuntime.KUBERNETES) {\n overrides.kubernetes = {\n namespace: localInfraSeed?.kubernetes?.namespace ?? K8S_LOCAL_DEFAULTS.NAMESPACE,\n };\n }\n\n const env = EnvironmentLifecycle.initializeLocal(overrides);\n EnvironmentRegistry.switchTo(env.name);\n });\n }\n\n private static extractLocalRuntimeSeed(raw: unknown): LocalRuntimeSeed | null {\n if (typeof raw !== 'object' || raw === null) {\n return null;\n }\n\n const candidate = raw as Record<string, unknown>;\n const deployment = typeof candidate.deployment === 'object' && candidate.deployment !== null\n ? candidate.deployment as Record<string, unknown>\n : null;\n const backingServices = typeof candidate.backingServices === 'object' && candidate.backingServices !== null\n ? candidate.backingServices as Record<string, unknown>\n : null;\n const mongodb = typeof backingServices?.mongodb === 'object' && backingServices.mongodb !== null\n ? backingServices.mongodb as Record<string, unknown>\n : null;\n const postgresql = typeof backingServices?.postgresql === 'object' && backingServices.postgresql !== null\n ? backingServices.postgresql as Record<string, unknown>\n : null;\n // Slice 4.B.0 (2026-05-07): the parser accepts the post-reshape\n // `'self' | 'managed'` enum. The legacy `'atlas'` value was migrated\n // to `(source: 'managed', provider: 'atlas')` — if a stale config\n // still authors `source: 'atlas'`, fall back to SELF so the\n // bootstrap doesn't crash; the migration warning belongs to a\n // different code path (`wildo config validate`).\n const resolveSource = (value: unknown): BackingServiceSource => (\n value === BackingServiceSource.MANAGED\n ? BackingServiceSource.MANAGED\n : BackingServiceSource.SELF\n );\n const hasMongoDb = mongodb !== null;\n const hasPostgreSql = postgresql !== null;\n /**\n * The AUTHORED `database` block, when the config carries a well-formed one.\n *\n * Read defensively — this parser takes `unknown`, so only a recognised engine value is\n * honoured and a malformed block falls through to the backing-service derivation rather than\n * seeding a nonsense engine.\n */\n const authoredDatabase = ((): LocalRuntimeSeed['database'] | null => {\n const raw = typeof candidate.database === 'object' && candidate.database !== null\n ? candidate.database as Record<string, unknown>\n : null;\n if (raw?.engine === DatabaseEngine.POSTGRESQL || raw?.engine === DatabaseEngine.MONGODB) {\n return { engine: raw.engine, source: resolveSource(raw.source) };\n }\n return null;\n })();\n const seed: LocalRuntimeSeed = {\n runtime: (candidate.runtime as WildoDeploymentRuntime | undefined)\n ?? (deployment?.runtime as WildoDeploymentRuntime | undefined),\n runtimeEnvironment: candidate.runtimeEnvironment as RuntimeEnvironment | undefined,\n /**\n * An AUTHORED `database` block wins outright; the backing-service derivation below is the\n * fallback for environments that do not author one.\n *\n * The derivation cannot express a PostgreSQL platform: `hasMongoDb === hasPostgreSql` yields\n * `undefined` precisely when BOTH are declared, and a PostgreSQL platform is required to\n * declare both (the bootstrap plane is Mongo-wired). This is the same \"which services exist\"\n * standing in for \"what engine is the platform\" collapse that\n * `inferDatabaseChoiceFromInfraConfig` carries — the two are independent implementations of\n * one question, and both had to learn about the authored field.\n *\n * Read defensively (this parser takes `unknown`): only a well-formed engine value is\n * honoured, so a malformed authored block falls through to the derivation rather than\n * seeding a nonsense engine.\n */\n databaseIsAuthored: authoredDatabase !== null,\n database: ((): LocalRuntimeSeed['database'] => {\n if (authoredDatabase) {\n return authoredDatabase;\n }\n\n return hasMongoDb === hasPostgreSql\n ? undefined\n : hasPostgreSql\n ? {\n engine: DatabaseEngine.POSTGRESQL,\n source: resolveSource(postgresql.source),\n }\n : mongodb\n ? {\n engine: DatabaseEngine.MONGODB,\n source: resolveSource(mongodb.source),\n }\n : undefined;\n })(),\n publicDomain: typeof candidate.publicDomain === 'string' && candidate.publicDomain.length > 0\n ? candidate.publicDomain\n : undefined,\n kubernetes: typeof candidate.kubernetes === 'object' && candidate.kubernetes !== null\n ? {\n namespace: (candidate.kubernetes as Record<string, unknown>).namespace as string | undefined,\n }\n : undefined,\n backingServices: backingServices !== null\n ? (backingServices as unknown as BackingServicesEnvConfig)\n : undefined,\n infrastructureHost: typeof candidate.infrastructureHost === 'object' && candidate.infrastructureHost !== null\n ? candidate.infrastructureHost as LocalRuntimeSeed['infrastructureHost']\n : undefined,\n };\n if (\n !seed.runtime\n && !seed.runtimeEnvironment\n && !seed.database\n && !seed.kubernetes\n && !seed.publicDomain\n && !seed.backingServices\n ) {\n return null;\n }\n return seed;\n }\n\n private static async loadAuthoritativeDatabaseSeed(\n appRoot: string,\n fallbackDatabase: LocalRuntimeSeed['database'],\n databaseIsAuthored = false,\n ): Promise<LocalRuntimeSeed['database'] | undefined> {\n /**\n * An EXPLICIT `database` block in `wildo.infra.local.config.ts` is the authority and is never\n * re-derived here.\n *\n * The derivation below reads `wildo.saas.config.ts`'s `dataServices` — a different file\n * answering a different question (which data services the APPLICATION uses). It also carries\n * the same collapse as the other derivations: `hasMongoDb === hasPostgreSql` gives up exactly\n * when both are declared, which is the state a PostgreSQL platform is REQUIRED to be in. Left\n * unguarded, it would quietly overrule an operator who had authored the engine explicitly.\n */\n if (databaseIsAuthored && fallbackDatabase) {\n return fallbackDatabase;\n }\n\n const saasConfigPath = join(appRoot, WORKSPACE_CONFIG_NAMES.SAAS);\n if (!fs.existsSync(saasConfigPath)) {\n return fallbackDatabase;\n }\n\n try {\n const saasConfig = await loadConfig<WildoSaasConfig>(saasConfigPath);\n const hasMongoDb = Boolean(saasConfig.dataServices?.mongodb);\n const hasPostgreSql = Boolean(saasConfig.dataServices?.postgresql);\n if (hasMongoDb === hasPostgreSql) {\n return fallbackDatabase;\n }\n\n const engine = hasPostgreSql ? DatabaseEngine.POSTGRESQL : DatabaseEngine.MONGODB;\n return {\n engine,\n source: fallbackDatabase?.engine === engine\n ? fallbackDatabase.source\n : BackingServiceSource.SELF,\n };\n } catch (error) {\n throw new Error(\n `Failed to load SaaS config at ${saasConfigPath} while seeding the local environment: ${ErrorUtils.extractErrorMessage(error)}`,\n { cause: error },\n );\n }\n }\n\n /**\n * The local environment seed, read through the SHARED loader (`loadInfraEnvConfig`).\n *\n * It used to evaluate the authored file directly, which skipped the loader's environment check and —\n * the reason it mattered — its hosted-descriptor resolution: a hosted application's first seed would\n * have recorded no runtime, no platform database and no backing-service servers, since a hosted file\n * authors none of them. The seed is the registry's FIRST copy of those facts, so it must see the same\n * resolved environment every later reader sees.\n */\n private static async loadLocalInfraSeed(\n appRoot: string,\n ): Promise<LocalRuntimeSeed | null> {\n const loaded = await loadInfraEnvConfig(appRoot, 'local');\n return loaded ? ExistingAppBootstrapService.extractLocalRuntimeSeed(loaded.config) : null;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-provider-source.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-provider-source.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/frontend-provider-source.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,uCAAuC,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAE9G,uHAAuH;AACvH,eAAO,MAAM,6BAA6B,kDAAkD,CAAC;AAC7F,uFAAuF;AACvF,eAAO,MAAM,8BAA8B,2DAA2D,CAAC;AAEvG,kIAAkI;AAClI,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,MAAM,EAAE,CAE/F;AAwGD,oHAAoH;AACpH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,eAAe,CAAC;IAC7B,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,SAAS,uCAAuC,EAAE,CAAC;CACnE,GAAG,MAAM,CA4CT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-provider-source.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/frontend-provider-source.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OA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import { existsSync, readFileSync } from 'fs';\nimport { AppFrontendType } from '@wildo-ai/saas-models';\nimport type { DiscoveredProviderCompanionContribution, WildoSaasConfig } from '@wildo-ai/platform-config-lib';\n\n/** Stable even when a service declares no providers, so removing the last provider never breaks its startup import. */\nexport const FRONTEND_PROVIDER_SOURCE_PATH = 'src/generated/frontend-providers.generated.ts';\n/** Build-time service identity stays JSON so reading it never imports browser code. */\nexport const FRONTEND_PROVIDER_SERVICE_PATH = 'src/generated/frontend-provider-service.generated.json';\n\n/** Shared by the writer and doctor: frontend source ownership follows services, not the presence of a nonempty provider scope. */\nexport function frontendProviderSourcePaths(saasRoot: string, config: WildoSaasConfig): string[] {\n return Object.values(config.services).filter(service => service.frontendType).flatMap(service => [FRONTEND_PROVIDER_SOURCE_PATH, FRONTEND_PROVIDER_SERVICE_PATH].map(path => join(saasRoot, service.path, path)));\n}\n\n/** Resolve only declared package exports from the destination; never execute browser code in config sync. */\nfunction assertDestinationImport(runtimeRoot: string, specifier: string): void {\n if (!/^(?:@[\\w.-]+\\/)?[\\w.-]+(?:\\/[\\w.-]+)*$/.test(specifier)) throw new Error(`Frontend provider import must be a package export: ${specifier}`);\n const segments = specifier.split('/');\n const packageName = segments.splice(0, specifier.startsWith('@') ? 2 : 1).join('/');\n const subpath = segments.length ? `./${segments.join('/')}` : '.';\n const ownManifest = JSON.parse(readFileSync(join(runtimeRoot, 'package.json'), 'utf8'));\n let packageRoot: string | undefined = ownManifest.name === packageName ? runtimeRoot : undefined;\n if (!packageRoot) {\n for (let current = runtimeRoot; ; current = dirname(current)) {\n const candidate = join(current, 'node_modules', packageName);\n if (existsSync(join(candidate, 'package.json'))) { packageRoot = candidate; break; }\n if (current === parse(current).root) break;\n }\n }\n if (!packageRoot) throw new Error(`Frontend ${runtimeRoot} cannot resolve ${specifier}; install it in the destination service.`);\n const manifest = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));\n const exports = manifest.exports;\n // Browser/import conditions are selected in declaration order. A missing selected file\n // MUST NOT fall back to another condition (especially a source-only development export).\n let pattern: string | undefined;\n let entry: unknown;\n if (exports && typeof exports === 'object' && !Array.isArray(exports) && Object.keys(exports).some(key => key.startsWith('.'))) {\n entry = exports[subpath];\n if (entry === undefined) {\n const key = Object.keys(exports).filter(key => key.includes('*')).sort((a, b) => b.indexOf('*') - a.indexOf('*') || b.length - a.length).find(key => {\n const [prefix, suffix] = key.split('*');\n return subpath.startsWith(prefix) && subpath.endsWith(suffix) && subpath.length >= prefix.length + suffix.length;\n });\n if (key) {\n const [prefix, suffix] = key.split('*');\n pattern = subpath.slice(prefix.length, suffix ? -suffix.length : undefined);\n entry = exports[key];\n }\n }\n } else if (subpath === '.') entry = exports;\n class InvalidExportTarget extends Error {}\n function selectTarget(value: unknown): string | null | undefined {\n if (value === null) return null;\n if (typeof value === 'string') {\n if (!value.startsWith('./') || value.split('/').includes('..')) throw new InvalidExportTarget(`Invalid package export target: ${value}`);\n return pattern === undefined ? value : value.replaceAll('*', pattern);\n }\n if (Array.isArray(value)) {\n for (const alternative of value) {\n try {\n const result = selectTarget(alternative);\n if (result !== undefined && result !== null) return result;\n } catch (error) {\n // Export arrays may skip invalid targets, but file existence is checked only\n // after selection: an absent selected file never activates a later fallback.\n if (!(error instanceof InvalidExportTarget)) throw error;\n }\n }\n return undefined;\n }\n if (!value || typeof value !== 'object') return undefined;\n for (const [condition, target] of Object.entries(value)) {\n if (condition === 'browser' || condition === 'import' || condition === 'default') {\n const result = selectTarget(target);\n if (result !== undefined) return result;\n }\n }\n return undefined;\n }\n const resolved = selectTarget(entry);\n if (!resolved || !existsSync(join(packageRoot, resolved))) throw new Error(`Frontend ${runtimeRoot} cannot resolve declared runtime export ${specifier}.`);\n}\n\n/**\n * A frontend that contributes a provider from its OWN package is addressed through source, never through its\n * own `exports`.\n *\n * The declared runtime export is a package subpath (`@<slug>/main-app/frontend-providers`), and for an EXTERNAL\n * package that is exactly right — `assertDestinationImport` below insists the selected condition names a file\n * that EXISTS, so a browser import can never resolve to a dependency's uncompiled source. Applied to the\n * frontend's own package that rule is a circle: the subpath resolves to `dist/library/...`, which is emitted by\n * the very build that compiles this generated file, so a clean checkout could not build the frontend at all\n * (#1196 — `TS2307` in CI, and the same failure inside the app image).\n *\n * The source file is compiled by that same build, so a relative specifier is both resolvable and honest here.\n * Returns undefined when the specifier belongs to another package, which keeps the external rule untouched.\n */\nfunction ownPackageSourceSpecifier(runtimeRoot: string, specifier: string): string | undefined {\n const ownManifestPath = join(runtimeRoot, 'package.json');\n if (!existsSync(ownManifestPath)) return undefined;\n const ownManifest = JSON.parse(readFileSync(ownManifestPath, 'utf8')) as { name?: string; exports?: Record<string, unknown> };\n const segments = specifier.split('/');\n const packageName = segments.splice(0, specifier.startsWith('@') ? 2 : 1).join('/');\n if (!ownManifest.name || ownManifest.name !== packageName) return undefined;\n const subpath = segments.length ? `./${segments.join('/')}` : '.';\n const entry = ownManifest.exports?.[subpath];\n const source = entry && typeof entry === 'object' && !Array.isArray(entry) ? (entry as { source?: unknown }).source : undefined;\n // No `source` condition: fall through to the package-export rule, which reports the unresolvable export.\n if (typeof source !== 'string' || !source.startsWith('./')) return undefined;\n const sourcePath = join(runtimeRoot, source);\n if (!existsSync(sourcePath)) throw new Error(`Frontend ${runtimeRoot} declares runtime export ${specifier}, whose source ${source} does not exist.`);\n const fromDirectory = dirname(join(runtimeRoot, FRONTEND_PROVIDER_SOURCE_PATH));\n const relativePath = relative(fromDirectory, sourcePath).split(sep).join('/').replace(/\\.(ts|tsx|js|jsx|mjs)$/, '');\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n}\n\n/** Render static imports selected by the exact frontend facet, never the backend/companion aggregate import map. */\nexport function renderFrontendProviderSource(input: {\n runtimeRoot: string;\n serviceType: AppFrontendType;\n providerRefs: readonly string[];\n contributions: readonly DiscoveredProviderCompanionContribution[];\n}): string {\n const facet = input.serviceType === AppFrontendType.SAAS_APP ? 'app' : input.serviceType === AppFrontendType.STATIC_WEBSITE ? 'website' : input.serviceType === AppFrontendType.TECH_DOC ? 'techdoc' : undefined;\n if (!facet) throw new Error(`Unsupported frontend provider facet: ${input.serviceType}`);\n const type = facet === 'app' ? 'GeneratedAppProviderModules' : facet === 'website' ? 'GeneratedWebsiteProviderModules' : 'GeneratedTechdocProviderModules';\n const providers = [...new Set(input.providerRefs)].sort().map(ref => {\n const matches = input.contributions.filter(c => c.ref === ref && c.runtimeTargets.some(t => t.kind === 'frontendService' && t.serviceType === input.serviceType));\n if (matches.length !== 1) throw new Error(`Frontend provider ${ref} requires exactly one ${input.serviceType} contribution; found ${matches.length}.`);\n const declared = matches[0].runtimeImportPath;\n const ownSource = ownPackageSourceSpecifier(input.runtimeRoot, declared);\n if (ownSource === undefined) assertDestinationImport(input.runtimeRoot, declared);\n return { ref, path: ownSource ?? declared };\n });\n const paths = [...new Set(providers.map(p => p.path))].sort();\n const imports = paths.map((path, index) => `import * as providerPackage${index} from ${JSON.stringify(path)};`);\n return [\n '// Generated by wildo config sync. Browser CODE only; environment DATA arrives separately.',\n `import type { ${type} } from '@wildo-ai/external-connectors-public/${facet}';`,\n ...imports,\n '',\n ...(providers.length ? [\n `type ProviderModule = ${type}[string];`,\n '/** Engine packages export registries; application packages export named modules. Identity deduplication permits registry + fragment re-exports. */',\n 'function selectProvider(namespace: Record<string, unknown>, ref: string): ProviderModule {',\n ' const matches = new Set<ProviderModule>();',\n ' const inspect = (value: unknown) => {',\n ' if (!value || typeof value !== \"object\") return;',\n ' const candidate = value as Partial<ProviderModule>;',\n ' if (candidate.metadata?.ref === ref && Array.isArray(candidate.providerCapabilities) && Array.isArray(candidate.protocols)) matches.add(candidate as ProviderModule);',\n ' };',\n ' for (const value of Object.values(namespace)) {',\n ' inspect(value);',\n ' if (value && typeof value === \"object\" && \"modules\" in value && value.modules instanceof Map) for (const module of Array.from(value.modules.values())) inspect(module);',\n ' }',\n ' if (matches.size !== 1) throw new Error(`Frontend provider ${ref}: expected one code module, found ${matches.size}. Check the declared runtime export.`);',\n ' // Docusaurus compiles spread with array assumptions; explicitly materialize this Set.',\n ' return Array.from(matches)[0]!;',\n '}',\n '',\n ] : []),\n `export const generatedFrontendProviderModules: ${type} = {`,\n ...providers.map(p => ` [${JSON.stringify(p.ref)}]: selectProvider(providerPackage${paths.indexOf(p.path)}, ${JSON.stringify(p.ref)}),`),\n '};',\n '',\n ].join('\\n');\n}\n"]}
|
|
1
|
+
{"version":3,"file":"frontend-provider-source.service.js","sourceRoot":"","sources":["../../../../src/services/application/frontend-provider-source.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,uHAAuH;AACvH,MAAM,CAAC,MAAM,6BAA6B,GAAG,+CAA+C,CAAC;AAC7F,uFAAuF;AACvF,MAAM,CAAC,MAAM,8BAA8B,GAAG,wDAAwD,CAAC;AAEvG,kIAAkI;AAClI,MAAM,UAAU,2BAA2B,CAAC,QAAgB,EAAE,MAAuB;IACnF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,6BAA6B,EAAE,8BAA8B,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACpN,CAAC;AAED,6GAA6G;AAC7G,SAAS,uBAAuB,CAAC,WAAmB,EAAE,SAAiB;IACrE,IAAI,CAAC,wCAAwC,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,MAAM,IAAI,K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I,MAAM;QAC5D,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,oCAAoC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;QACzI,IAAI;QACJ,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { dirname, join, parse, relative, sep } from 'path';\nimport { existsSync, readFileSync } from 'fs';\nimport { AppFrontendType } from '@wildo-ai/saas-models';\nimport type { DiscoveredProviderCompanionContribution, WildoSaasConfig } from '@wildo-ai/platform-config-lib';\n\n/** Stable even when a service declares no providers, so removing the last provider never breaks its startup import. */\nexport const FRONTEND_PROVIDER_SOURCE_PATH = 'src/generated/frontend-providers.generated.ts';\n/** Build-time service identity stays JSON so reading it never imports browser code. */\nexport const FRONTEND_PROVIDER_SERVICE_PATH = 'src/generated/frontend-provider-service.generated.json';\n\n/** Shared by the writer and doctor: frontend source ownership follows services, not the presence of a nonempty provider scope. */\nexport function frontendProviderSourcePaths(saasRoot: string, config: WildoSaasConfig): string[] {\n return Object.values(config.services).filter(service => service.frontendType).flatMap(service => [FRONTEND_PROVIDER_SOURCE_PATH, FRONTEND_PROVIDER_SERVICE_PATH].map(path => join(saasRoot, service.path, path)));\n}\n\n/** Resolve only declared package exports from the destination; never execute browser code in config sync. */\nfunction assertDestinationImport(runtimeRoot: string, specifier: string): void {\n if (!/^(?:@[\\w.-]+\\/)?[\\w.-]+(?:\\/[\\w.-]+)*$/.test(specifier)) throw new Error(`Frontend provider import must be a package export: ${specifier}`);\n const segments = specifier.split('/');\n const packageName = segments.splice(0, specifier.startsWith('@') ? 2 : 1).join('/');\n const subpath = segments.length ? `./${segments.join('/')}` : '.';\n const ownManifest = JSON.parse(readFileSync(join(runtimeRoot, 'package.json'), 'utf8'));\n let packageRoot: string | undefined = ownManifest.name === packageName ? runtimeRoot : undefined;\n if (!packageRoot) {\n for (let current = runtimeRoot; ; current = dirname(current)) {\n const candidate = join(current, 'node_modules', packageName);\n if (existsSync(join(candidate, 'package.json'))) { packageRoot = candidate; break; }\n if (current === parse(current).root) break;\n }\n }\n if (!packageRoot) throw new Error(`Frontend ${runtimeRoot} cannot resolve ${specifier}; install it in the destination service.`);\n const manifest = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));\n const exports = manifest.exports;\n // Browser/import conditions are selected in declaration order. A missing selected file\n // MUST NOT fall back to another condition (especially a source-only development export).\n let pattern: string | undefined;\n let entry: unknown;\n if (exports && typeof exports === 'object' && !Array.isArray(exports) && Object.keys(exports).some(key => key.startsWith('.'))) {\n entry = exports[subpath];\n if (entry === undefined) {\n const key = Object.keys(exports).filter(key => key.includes('*')).sort((a, b) => b.indexOf('*') - a.indexOf('*') || b.length - a.length).find(key => {\n const [prefix, suffix] = key.split('*');\n return subpath.startsWith(prefix) && subpath.endsWith(suffix) && subpath.length >= prefix.length + suffix.length;\n });\n if (key) {\n const [prefix, suffix] = key.split('*');\n pattern = subpath.slice(prefix.length, suffix ? -suffix.length : undefined);\n entry = exports[key];\n }\n }\n } else if (subpath === '.') entry = exports;\n class InvalidExportTarget extends Error {}\n function selectTarget(value: unknown): string | null | undefined {\n if (value === null) return null;\n if (typeof value === 'string') {\n if (!value.startsWith('./') || value.split('/').includes('..')) throw new InvalidExportTarget(`Invalid package export target: ${value}`);\n return pattern === undefined ? value : value.replaceAll('*', pattern);\n }\n if (Array.isArray(value)) {\n for (const alternative of value) {\n try {\n const result = selectTarget(alternative);\n if (result !== undefined && result !== null) return result;\n } catch (error) {\n // Export arrays may skip invalid targets, but file existence is checked only\n // after selection: an absent selected file never activates a later fallback.\n if (!(error instanceof InvalidExportTarget)) throw error;\n }\n }\n return undefined;\n }\n if (!value || typeof value !== 'object') return undefined;\n for (const [condition, target] of Object.entries(value)) {\n if (condition === 'browser' || condition === 'import' || condition === 'default') {\n const result = selectTarget(target);\n if (result !== undefined) return result;\n }\n }\n return undefined;\n }\n const resolved = selectTarget(entry);\n if (!resolved || !existsSync(join(packageRoot, resolved))) throw new Error(`Frontend ${runtimeRoot} cannot resolve declared runtime export ${specifier}.`);\n}\n\n/**\n * A frontend that contributes a provider from its OWN package is addressed through source, never through its\n * own `exports`.\n *\n * The declared runtime export is a package subpath (`@<slug>/main-app/frontend-providers`), and for an EXTERNAL\n * package that is exactly right — `assertDestinationImport` below insists the selected condition names a file\n * that EXISTS, so a browser import can never resolve to a dependency's uncompiled source. Applied to the\n * frontend's own package that rule is a circle: the subpath resolves to `dist/library/...`, which is emitted by\n * the very build that compiles this generated file, so a clean checkout could not build the frontend at all\n * (#1196 — `TS2307` in CI, and the same failure inside the app image).\n *\n * The source file is compiled by that same build, so a relative specifier is both resolvable and honest here.\n * Returns undefined when the specifier belongs to another package, which keeps the external rule untouched.\n */\nfunction ownPackageSourceSpecifier(runtimeRoot: string, specifier: string): string | undefined {\n const ownManifestPath = join(runtimeRoot, 'package.json');\n if (!existsSync(ownManifestPath)) return undefined;\n const ownManifest = JSON.parse(readFileSync(ownManifestPath, 'utf8')) as { name?: string; exports?: Record<string, unknown> };\n const segments = specifier.split('/');\n const packageName = segments.splice(0, specifier.startsWith('@') ? 2 : 1).join('/');\n if (!ownManifest.name || ownManifest.name !== packageName) return undefined;\n const subpath = segments.length ? `./${segments.join('/')}` : '.';\n const entry = ownManifest.exports?.[subpath];\n const source = entry && typeof entry === 'object' && !Array.isArray(entry) ? (entry as { source?: unknown }).source : undefined;\n // No `source` condition: fall through to the package-export rule, which reports the unresolvable export.\n if (typeof source !== 'string' || !source.startsWith('./')) return undefined;\n const sourcePath = join(runtimeRoot, source);\n if (!existsSync(sourcePath)) throw new Error(`Frontend ${runtimeRoot} declares runtime export ${specifier}, whose source ${source} does not exist.`);\n const fromDirectory = dirname(join(runtimeRoot, FRONTEND_PROVIDER_SOURCE_PATH));\n const relativePath = relative(fromDirectory, sourcePath).split(sep).join('/').replace(/\\.(ts|tsx|js|jsx|mjs)$/, '');\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n}\n\n/** Render static imports selected by the exact frontend facet, never the backend/companion aggregate import map. */\nexport function renderFrontendProviderSource(input: {\n runtimeRoot: string;\n serviceType: AppFrontendType;\n providerRefs: readonly string[];\n contributions: readonly DiscoveredProviderCompanionContribution[];\n}): string {\n const facet = input.serviceType === AppFrontendType.SAAS_APP ? 'app' : input.serviceType === AppFrontendType.STATIC_WEBSITE ? 'website' : input.serviceType === AppFrontendType.TECH_DOC ? 'techdoc' : undefined;\n if (!facet) throw new Error(`Unsupported frontend provider facet: ${input.serviceType}`);\n const type = facet === 'app' ? 'GeneratedAppProviderModules' : facet === 'website' ? 'GeneratedWebsiteProviderModules' : 'GeneratedTechdocProviderModules';\n const providers = [...new Set(input.providerRefs)].sort().map(ref => {\n const matches = input.contributions.filter(c => c.ref === ref && c.runtimeTargets.some(t => t.kind === 'frontendService' && t.serviceType === input.serviceType));\n if (matches.length !== 1) throw new Error(`Frontend provider ${ref} requires exactly one ${input.serviceType} contribution; found ${matches.length}.`);\n const declared = matches[0].runtimeImportPath;\n const ownSource = ownPackageSourceSpecifier(input.runtimeRoot, declared);\n if (ownSource === undefined) assertDestinationImport(input.runtimeRoot, declared);\n return { ref, path: ownSource ?? declared };\n });\n const paths = [...new Set(providers.map(p => p.path))].sort();\n const imports = paths.map((path, index) => `import * as providerPackage${index} from ${JSON.stringify(path)};`);\n return [\n '// Generated by wildo config sync. Browser CODE only; environment DATA arrives separately.',\n `import type { ${type} } from '@wildo-ai/external-connectors-public/${facet}';`,\n ...imports,\n '',\n ...(providers.length ? [\n `type ProviderModule = ${type}[string];`,\n '/** Engine packages export registries; application packages export named modules. Identity deduplication permits registry + fragment re-exports. */',\n 'function selectProvider(namespace: Record<string, unknown>, ref: string): ProviderModule {',\n ' const matches = new Set<ProviderModule>();',\n ' const inspect = (value: unknown) => {',\n ' if (!value || typeof value !== \"object\") return;',\n ' const candidate = value as Partial<ProviderModule>;',\n ' if (candidate.metadata?.ref === ref && Array.isArray(candidate.providerCapabilities) && Array.isArray(candidate.protocols)) matches.add(candidate as ProviderModule);',\n ' };',\n ' for (const value of Object.values(namespace)) {',\n ' inspect(value);',\n ' if (value && typeof value === \"object\" && \"modules\" in value && value.modules instanceof Map) for (const module of Array.from(value.modules.values())) inspect(module);',\n ' }',\n ' if (matches.size !== 1) throw new Error(`Frontend provider ${ref}: expected one code module, found ${matches.size}. Check the declared runtime export.`);',\n ' // Docusaurus compiles spread with array assumptions; explicitly materialize this Set.',\n ' return Array.from(matches)[0]!;',\n '}',\n '',\n ] : []),\n `export const generatedFrontendProviderModules: ${type} = {`,\n ...providers.map(p => ` [${JSON.stringify(p.ref)}]: selectProvider(providerPackage${paths.indexOf(p.path)}, ${JSON.stringify(p.ref)}),`),\n '};',\n '',\n ].join('\\n');\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-public-config-secret-screen.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"frontend-public-config-secret-screen.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/frontend-public-config-secret-screen.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,wCAAwC,EAC9C,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAI7E,OAAO,EAAuC,KAAK,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AACtJ,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAGlG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC,EAAE,SAAS,MAAM,EAUnE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;CACxE,GAAG,+BAA+B,EAAE,CAkCpC;AAKD;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAC7C,eAAe,EAAE,MAAM,EACvB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAC3D,sBAAsB,GAAG,IAAI,CAM/B;AAWD;;;;;;;;GAQG;AACH,wBAAgB,gDAAgD,CAAC,KAAK,EAAE;IACtE,QAAQ,CAAC,SAAS,EAAE,wCAAwC,CAAC,WAAW,CAAC,CAAC;IAC1E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,sBAAsB,GAAG,IAAI,CAAC;IAClF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;CACzE,GAAG,IAAI,CAyBP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend-public-config-secret-screen.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/frontend-public-config-secret-screen.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,kDAAkD,EAClD,2CAA2C,GAE5C,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,kCAAkC,EAAE,MAAM,2DAA2D,CAAC;AAC/G,OAAO,EAAE,mCAAmC,EAAsC,MAAM,6DAA6D,CAAC;AAEtJ,OAAO,EAAE,gBAAgB,EA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,KAAK,CAAC,SAAS,IAAI,mCAAmC,EAAE;SACpE,CAAC;QACF,QAAQ,EAAE,mCAAmC,KAAK,CAAC,eAAe,IAAI;KACvE,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { join } from 'node:path';\n\nimport {\n assertFrontendProviderBootstrapsCarryNoSecretValue,\n materializedArtifactsServeFrontendProviders,\n type MaterializedSaasProviderRuntimeArtifacts,\n} from '@wildo-ai/platform-config-lib';\nimport type { FrontendPublicConfigSecretValue } from '@wildo-ai/saas-models';\n\nimport { reconstructSecretsFromEnv } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport { FRAMEWORK_MANAGED_SECRET_MATERIALS } from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport { getComposedProviderSecretsCatalogue, type ProviderSecretsCatalogueEntry } from '~wildo-cli/services/credentials/composed-provider-catalogue';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\n\n/**\n * The frontend public-config SECRET SCREEN of `wildo config sync` (#1705).\n *\n * ## What it answers, and why no name rule could\n *\n * Every frontend provider's `publicConfig` is served to every browser. The guards before this one\n * matched NAMES — a key spelled like the same vendor's backend secret — and a browser-only vendor has\n * no backend secrets to spell: an Algolia admin key under `apiKey`, or a reCAPTCHA secret under\n * `siteKey`, passed all of them. So this compares VALUES: every string the environment would serve,\n * against every CONFIDENTIAL value in that environment's `secrets.json`. It asks \"is this one of our\n * secrets\", which is a question about this environment and not about spelling. Gitleaks asks the other\n * question (\"does this look like a secret\") on committed files; neither replaces the other.\n *\n * ## Which values are confidential — TOTAL over the file, with named exemptions\n *\n * Every string in `secrets.json` is confidential unless something DECLARES otherwise, so a section\n * added to the file tomorrow is screened with no edit here:\n *\n * - a framework-managed material's `identityKeys` (service usernames) — its registry says they are\n * identities, and its `secretKeys` are not exempt;\n * - a `providerEnv` value whose provider slot is marked `holdsBrowserPublicValue` or\n * `holdsDeploymentHost` in its contract (PostHog's project key, which its browser SDK is served too);\n * - the operator-typed identities {@link NON_CONFIDENTIAL_OPERATOR_SECRET_PATHS} names.\n *\n * A missing exemption costs a refusal naming the slot, which a person can read and correct. A missing\n * secret would cost nothing visible at all, which is why the default runs this way.\n *\n * ## Fail closed when the file cannot be read\n *\n * If the environment's secrets cannot be read — neither its effective `secrets.json` nor, in a deploy job,\n * the `WILDO_SECRET_*` variables the workflow publishes ({@link loadEnvironmentSecretsForScreen}) — nothing\n * can be screened, so nothing is produced. This is not a boot path and its remedy needs no running\n * companion. An application that serves no frontend provider is not asked for secrets at all.\n */\n\n/**\n * Operator-typed `secrets.json` paths that hold IDENTITIES rather than secrets — the only hand-kept\n * list here, and deliberately the exemption side: forgetting an entry refuses a value (visible),\n * never admits one. Their confidential siblings (`admin.password`, `approver.password`,\n * `atlas.apiPrivateKey`, `github.adminToken`) are screened by the total walk.\n */\nexport const NON_CONFIDENTIAL_OPERATOR_SECRET_PATHS: readonly string[] = [\n 'admin.email',\n 'admin.firstName',\n 'admin.lastName',\n 'approver.email',\n 'approver.firstName',\n 'approver.lastName',\n 'atlas.apiPublicKey',\n 'github.orgUrl',\n 'github.adminUser',\n];\n\n/**\n * Every confidential value of one environment's `secrets.json`, each with the slot it lives in.\n *\n * Pure: the catalogue is passed in so a test can state which slots its providers mark public.\n */\nexport function collectConfidentialSecretValues(input: {\n readonly secrets: PlatformEnvSecretsJson;\n readonly secretsFileLabel: string;\n readonly catalogue: ReadonlyMap<string, ProviderSecretsCatalogueEntry>;\n}): FrontendPublicConfigSecretValue[] {\n const exemptPaths = new Set<string>([\n ...NON_CONFIDENTIAL_OPERATOR_SECRET_PATHS,\n ...FRAMEWORK_MANAGED_SECRET_MATERIALS.flatMap((material) => material.identityKeys),\n ]);\n // A provider env var is exempt only when EVERY provider declaring it says so: one confidential\n // declaration of the same variable makes it confidential.\n const publicProviderEnvVars = new Set<string>();\n const confidentialProviderEnvVars = new Set<string>();\n for (const entry of input.catalogue.values()) {\n for (const secret of entry.secrets) {\n (secret.notConfidential === true ? publicProviderEnvVars : confidentialProviderEnvVars).add(secret.envVarName);\n }\n }\n for (const envVarName of publicProviderEnvVars) {\n if (!confidentialProviderEnvVars.has(envVarName)) exemptPaths.add(`providerEnv.${envVarName}`);\n }\n\n const values: FrontendPublicConfigSecretValue[] = [];\n const walk = (value: unknown, path: string): void => {\n if (typeof value === 'string') {\n if (!exemptPaths.has(path)) values.push({ slot: `${input.secretsFileLabel} → ${path}`, value });\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((item, index) => walk(item, `${path}[${index}]`));\n return;\n }\n if (typeof value === 'object' && value !== null) {\n for (const [key, item] of Object.entries(value)) walk(item, path.length > 0 ? `${path}.${key}` : key);\n }\n };\n walk(input.secrets, '');\n return values;\n}\n\n/** The prefix every CI-published secret travels under (`WILDO_SECRET_*`), whatever its section. */\nconst CI_SECRET_ENV_PREFIX = 'WILDO_SECRET_';\n\n/**\n * The environment's secrets from the source THIS process has, in the order the CLI already uses.\n *\n * On a developer machine that is the file. In a deploy job there is no file — `config sync --ci`\n * rebuilds the secrets in memory from the `WILDO_SECRET_*` variables the workflow publishes to the step\n * (`reconstructSecretsFromEnv`, the one reader of that channel) and never persists them — so reading the\n * file alone would refuse every CI deploy of an application that serves a frontend provider, on secrets\n * that were in fact present. A step given NEITHER source still refuses: absent secrets are never read as\n * \"nothing to compare against\".\n */\nexport function loadEnvironmentSecretsForScreen(\n environmentName: string,\n processEnv: Record<string, string | undefined> = process.env,\n): PlatformEnvSecretsJson | null {\n const fromFile = EnvironmentUtils.loadSecretsJson(environmentName);\n if (fromFile !== null) return fromFile;\n const carriesCiSecrets = Object.entries(processEnv)\n .some(([key, value]) => key.startsWith(CI_SECRET_ENV_PREFIX) && value !== undefined && value !== '');\n return carriesCiSecrets ? reconstructSecretsFromEnv(processEnv) : null;\n}\n\n/** Where the environment's secrets are read from, for a refusal — resolved only when one is needed. */\nfunction describeSecretsFilePath(environmentName: string): string {\n try {\n return join(EnvironmentUtils.resolveSecretsDir(environmentName), 'secrets.json');\n } catch {\n return `the secrets.json of environment \"${environmentName}\"`;\n }\n}\n\n/**\n * Screens materialized provider runtime artifacts against ONE environment's secrets before anything\n * is written. Throws, naming the served key and the secret's slot, on a match; throws, naming the\n * file, when the secrets cannot be read.\n *\n * `loadSecrets` defaults to the CLI's effective loader, which is host-aware (a hosted application's\n * view includes its host's shared credentials) and answers `null` for an absent, unreadable or invalid\n * file — every one of which refuses here.\n */\nexport function screenFrontendProviderPublicConfigForEnvironment(input: {\n readonly artifacts: MaterializedSaasProviderRuntimeArtifacts['artifacts'];\n readonly environmentName: string;\n readonly loadSecrets?: (environmentName: string) => PlatformEnvSecretsJson | null;\n readonly secretsFilePath?: string;\n readonly catalogue?: ReadonlyMap<string, ProviderSecretsCatalogueEntry>;\n}): void {\n if (!materializedArtifactsServeFrontendProviders(input.artifacts)) return;\n\n const secrets = (input.loadSecrets ?? loadEnvironmentSecretsForScreen)(input.environmentName);\n // assurance-control: WILDO.SECURITY.FAIL_CLOSED — frontend public configuration is not produced when the secrets it must be screened against cannot be read\n if (secrets === null) {\n const secretsFilePath = input.secretsFilePath ?? describeSecretsFilePath(input.environmentName);\n throw new Error(\n `Cannot produce the frontend provider configuration for environment \"${input.environmentName}\": its secrets at `\n + `${secretsFilePath} cannot be read (absent, unreadable or invalid — any reason is printed above). Every value `\n + 'a frontend provider serves is compared against those secrets before it can reach a browser, so without them '\n + 'nothing is produced. Restore the file; in a deploy job, give this step the `WILDO_SECRET_*` variables the '\n + 'generated workflow publishes (as its \"Generate deployment artifacts\" step has).',\n );\n }\n\n assertFrontendProviderBootstrapsCarryNoSecretValue({\n artifacts: input.artifacts,\n secrets: collectConfidentialSecretValues({\n secrets,\n secretsFileLabel: `secrets.json of \"${input.environmentName}\"`,\n catalogue: input.catalogue ?? getComposedProviderSecretsCatalogue(),\n }),\n producer: `wildo config sync (environment \"${input.environmentName}\")`,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"frontend-public-config-secret-screen.service.js","sourceRoot":"","sources":["../../../../src/services/application/frontend-public-config-secret-screen.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,kDAAkD,EAClD,2CAA2C,GAE5C,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,kCAAkC,EAAE,MAAM,2DAA2D,CAAC;AAC/G,OAAO,EAAE,mCAAmC,EAAsC,MAAM,6DAA6D,CAAC;AAEtJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAsB;IACvE,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAI/C;IACC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS;QAClC,GAAG,sCAAsC;QACzC,GAAG,kCAAkC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;KACnF,CAAC,CAAC;IACH,+FAA+F;IAC/F,0DAA0D;IAC1D,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;IAChD,MAAM,2BAA2B,GAAG,IAAI,GAAG,EAAU,CAAC;IACtD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;QAC7C,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACnC,CAAC,MAAM,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,qBAAq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AK,CAAC,eAAe,IAAI,uBAAuB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAChG,MAAM,IAAI,KAAK,CACb,uEAAuE,KAAK,CAAC,eAAe,oBAAoB;cAC9G,GAAG,eAAe,6FAA6F;cAC/G,8GAA8G;cAC9G,4GAA4G;cAC5G,iFAAiF,CACpF,CAAC;IACJ,CAAC;IAED,kDAAkD,CAAC;QACjD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,+BAA+B,CAAC;YACvC,OAAO;YACP,gBAAgB,EAAE,oBAAoB,KAAK,CAAC,eAAe,GAAG;YAC9D,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,mCAAmC,EAAE;SACpE,CAAC;QACF,QAAQ,EAAE,mCAAmC,KAAK,CAAC,eAAe,IAAI;KACvE,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { join } from 'node:path';\n\nimport {\n assertFrontendProviderBootstrapsCarryNoSecretValue,\n materializedArtifactsServeFrontendProviders,\n type MaterializedSaasProviderRuntimeArtifacts,\n} from '@wildo-ai/platform-config-lib';\nimport type { FrontendPublicConfigSecretValue } from '@wildo-ai/saas-models';\n\nimport { reconstructSecretsFromEnv } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport { FRAMEWORK_MANAGED_SECRET_MATERIALS } from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport { getComposedProviderSecretsCatalogue, type ProviderSecretsCatalogueEntry } from '~wildo-cli/services/credentials/composed-provider-catalogue';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\n\n/**\n * The frontend public-config SECRET SCREEN of `wildo config sync` (#1705).\n *\n * ## What it answers, and why no name rule could\n *\n * Every frontend provider's `publicConfig` is served to every browser. The guards before this one\n * matched NAMES — a key spelled like the same vendor's backend secret — and a browser-only vendor has\n * no backend secrets to spell: an Algolia admin key under `apiKey`, or a reCAPTCHA secret under\n * `siteKey`, passed all of them. So this compares VALUES: every string the environment would serve,\n * against every CONFIDENTIAL value in that environment's `secrets.json`. It asks \"is this one of our\n * secrets\", which is a question about this environment and not about spelling. Gitleaks asks the other\n * question (\"does this look like a secret\") on committed files; neither replaces the other.\n *\n * ## Which values are confidential — TOTAL over the file, with named exemptions\n *\n * Every string in `secrets.json` is confidential unless something DECLARES otherwise, so a section\n * added to the file tomorrow is screened with no edit here:\n *\n * - a framework-managed material's `identityKeys` (service usernames) — its registry says they are\n * identities, and its `secretKeys` are not exempt;\n * - a `providerEnv` value whose provider slot is marked `holdsBrowserPublicValue` or\n * `holdsDeploymentHost` in its contract (PostHog's project key, which its browser SDK is served too);\n * - the operator-typed identities {@link NON_CONFIDENTIAL_OPERATOR_SECRET_PATHS} names.\n *\n * A missing exemption costs a refusal naming the slot, which a person can read and correct. A missing\n * secret would cost nothing visible at all, which is why the default runs this way.\n *\n * ## Fail closed when the file cannot be read\n *\n * If the environment's secrets cannot be read — neither its effective `secrets.json` nor, in a deploy job,\n * the `WILDO_SECRET_*` variables the workflow publishes ({@link loadEnvironmentSecretsForScreen}) — nothing\n * can be screened, so nothing is produced. This is not a boot path and its remedy needs no running\n * companion. An application that serves no frontend provider is not asked for secrets at all.\n */\n\n/**\n * Operator-typed `secrets.json` paths that hold IDENTITIES rather than secrets — the only hand-kept\n * list here, and deliberately the exemption side: forgetting an entry refuses a value (visible),\n * never admits one. Their confidential siblings (`admin.password`, `approver.password`,\n * `atlas.apiPrivateKey`, `github.adminToken`) are screened by the total walk.\n */\nexport const NON_CONFIDENTIAL_OPERATOR_SECRET_PATHS: readonly string[] = [\n 'admin.email',\n 'admin.firstName',\n 'admin.lastName',\n 'approver.email',\n 'approver.firstName',\n 'approver.lastName',\n 'atlas.apiPublicKey',\n 'github.orgUrl',\n 'github.adminUser',\n];\n\n/**\n * Every confidential value of one environment's `secrets.json`, each with the slot it lives in.\n *\n * Pure: the catalogue is passed in so a test can state which slots its providers mark public.\n */\nexport function collectConfidentialSecretValues(input: {\n readonly secrets: PlatformEnvSecretsJson;\n readonly secretsFileLabel: string;\n readonly catalogue: ReadonlyMap<string, ProviderSecretsCatalogueEntry>;\n}): FrontendPublicConfigSecretValue[] {\n const exemptPaths = new Set<string>([\n ...NON_CONFIDENTIAL_OPERATOR_SECRET_PATHS,\n ...FRAMEWORK_MANAGED_SECRET_MATERIALS.flatMap((material) => material.identityKeys),\n ]);\n // A provider env var is exempt only when EVERY provider declaring it says so: one confidential\n // declaration of the same variable makes it confidential.\n const publicProviderEnvVars = new Set<string>();\n const confidentialProviderEnvVars = new Set<string>();\n for (const entry of input.catalogue.values()) {\n for (const secret of entry.secrets) {\n (secret.notConfidential === true ? publicProviderEnvVars : confidentialProviderEnvVars).add(secret.envVarName);\n }\n }\n for (const envVarName of publicProviderEnvVars) {\n if (!confidentialProviderEnvVars.has(envVarName)) exemptPaths.add(`providerEnv.${envVarName}`);\n }\n\n const values: FrontendPublicConfigSecretValue[] = [];\n const walk = (value: unknown, path: string): void => {\n if (typeof value === 'string') {\n if (!exemptPaths.has(path)) values.push({ slot: `${input.secretsFileLabel} → ${path}`, value });\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((item, index) => walk(item, `${path}[${index}]`));\n return;\n }\n if (typeof value === 'object' && value !== null) {\n for (const [key, item] of Object.entries(value)) walk(item, path.length > 0 ? `${path}.${key}` : key);\n }\n };\n walk(input.secrets, '');\n return values;\n}\n\n/** The prefix every CI-published secret travels under (`WILDO_SECRET_*`), whatever its section. */\nconst CI_SECRET_ENV_PREFIX = 'WILDO_SECRET_';\n\n/**\n * The environment's secrets from the source THIS process has, in the order the CLI already uses.\n *\n * On a developer machine that is the file. In a deploy job there is no file — `config sync --ci`\n * rebuilds the secrets in memory from the `WILDO_SECRET_*` variables the workflow publishes to the step\n * (`reconstructSecretsFromEnv`, the one reader of that channel) and never persists them — so reading the\n * file alone would refuse every CI deploy of an application that serves a frontend provider, on secrets\n * that were in fact present. A step given NEITHER source still refuses: absent secrets are never read as\n * \"nothing to compare against\".\n */\nexport function loadEnvironmentSecretsForScreen(\n environmentName: string,\n processEnv: Record<string, string | undefined> = process.env,\n): PlatformEnvSecretsJson | null {\n const fromFile = EnvironmentUtils.loadSecretsJson(environmentName);\n if (fromFile !== null) return fromFile;\n const carriesCiSecrets = Object.entries(processEnv)\n .some(([key, value]) => key.startsWith(CI_SECRET_ENV_PREFIX) && value !== undefined && value !== '');\n return carriesCiSecrets ? reconstructSecretsFromEnv(processEnv) : null;\n}\n\n/** Where the environment's secrets are read from, for a refusal — resolved only when one is needed. */\nfunction describeSecretsFilePath(environmentName: string): string {\n try {\n return join(EnvironmentUtils.resolveSecretsDir(environmentName), 'secrets.json');\n } catch {\n return `the secrets.json of environment \"${environmentName}\"`;\n }\n}\n\n/**\n * Screens materialized provider runtime artifacts against ONE environment's secrets before anything\n * is written. Throws, naming the served key and the secret's slot, on a match; throws, naming the\n * file, when the secrets cannot be read.\n *\n * `loadSecrets` defaults to the CLI's effective loader, which is host-aware (a hosted application's\n * view includes its host's shared credentials) and answers `null` for an absent, unreadable or invalid\n * file — every one of which refuses here.\n */\nexport function screenFrontendProviderPublicConfigForEnvironment(input: {\n readonly artifacts: MaterializedSaasProviderRuntimeArtifacts['artifacts'];\n readonly environmentName: string;\n readonly loadSecrets?: (environmentName: string) => PlatformEnvSecretsJson | null;\n readonly secretsFilePath?: string;\n readonly catalogue?: ReadonlyMap<string, ProviderSecretsCatalogueEntry>;\n}): void {\n if (!materializedArtifactsServeFrontendProviders(input.artifacts)) return;\n\n const secrets = (input.loadSecrets ?? loadEnvironmentSecretsForScreen)(input.environmentName);\n // assurance-control: WILDO.SECURITY.FAIL_CLOSED — frontend public configuration is not produced when the secrets it must be screened against cannot be read\n if (secrets === null) {\n const secretsFilePath = input.secretsFilePath ?? describeSecretsFilePath(input.environmentName);\n throw new Error(\n `Cannot produce the frontend provider configuration for environment \"${input.environmentName}\": its secrets at `\n + `${secretsFilePath} cannot be read (absent, unreadable or invalid — any reason is printed above). Every value `\n + 'a frontend provider serves is compared against those secrets before it can reach a browser, so without them '\n + 'nothing is produced. Restore the file; in a deploy job, give this step the `WILDO_SECRET_*` variables the '\n + 'generated workflow publishes (as its \"Generate deployment artifacts\" step has).',\n );\n }\n\n assertFrontendProviderBootstrapsCarryNoSecretValue({\n artifacts: input.artifacts,\n secrets: collectConfidentialSecretValues({\n secrets,\n secretsFileLabel: `secrets.json of \"${input.environmentName}\"`,\n catalogue: input.catalogue ?? getComposedProviderSecretsCatalogue(),\n }),\n producer: `wildo config sync (environment \"${input.environmentName}\")`,\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-app-reinit.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"local-app-reinit.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/local-app-reinit.service.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAOtD,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,gCAAgC,CAAC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;IAwBI;AACJ,qBAAa,qBAAqB;WACnB,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4CpE,OAAO,CAAC,MAAM,CAAC,cAAc;mBASR,gBAAgB;CAsDtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-app-reinit.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/local-app-reinit.service.ts"],"names":[],"mappings":"AA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iDAAiD,CAAC,CAAC;YAC7F,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,GAAG,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpE,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED;;;;;;;;;;WAUG;QACH,kCAAkC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE1C,gBAAgB,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1D,gBAAgB,CAAC,iCAAiC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;CAEF","sourcesContent":["import { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport {\n wipeLocalDataServiceDirsForCompose,\n wipeLocalDataVolumesForCompose,\n} from '~wildo-cli/services/deployment/docker/docker-compose-generator.service';\nimport { K8sOperations } from '~wildo-cli/services/deployment/k8s/k8s-operations.service';\nimport * as PlatformLifecycle from '~wildo-cli/services/deployment/platform-lifecycle.service';\nimport { sync as envSync } from '~wildo-cli/services/environment/env-sync.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { LocalApplicationInitializationService } from './local-application-initialization.service';\nimport { LocalRuntimeProcessCleanupService } from '~wildo-cli/services/deployment/local-runtime-process-cleanup.service';\nimport { ContextManager } from '~wildo-cli/services/context/context-manager.service';\nimport { InfrastructureHost, SharedInfrastructureAction } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport {\n K8S_LOCAL_DEFAULTS,\n KIND_CLUSTER_DEFAULTS,\n WildoDeploymentRuntime,\n} from '@wildo-ai/platform-config-lib';\n\nexport interface LocalAppReinitInput {\n env: PlatformEnvironmentConfiguration;\n frameworkPath: string;\n saasRoot: string;\n isFrameworkDeveloper: boolean;\n requestedAppSlug?: string | undefined;\n log: Logger;\n}\n\n/**\n * Destructive end-to-end reinitialization of a local app runtime.\n *\n * Slice 5 (F-15) — this service is the engine behind `wildo local reinit`\n * and is destructively equivalent to running `wildo local reset`\n * followed by `wildo local init` (the command requires framework-developer context):\n * 1. `reinitialize()` refreshes generated `.env` files for the active\n * environment (no destructive side-effect yet).\n * 2. `resetEnvironment()` WIPES every on-host bind-mount under\n * `<saas-root>/.wildo-saas/local_data/<svc>/` (Mongo journal, PG\n * datadir, ClamAV signature DB, …). For K8s it also scales workloads\n * to zero, deletes all PVCs, AND deletes the static `Retain`-policy\n * local PVs (otherwise they sit `Released` with stale `claimRef.uid`\n * and silently block the next bring-up). Fail-CLOSED — a partial\n * wipe is worse than a loud failure.\n * 3. Delegates to the same registered `LocalApplicationInitializationService`\n * as non-destructive `wildo local init`: re-render artifacts, re-apply infra,\n * wait for readiness, run platform INIT, register one application snapshot,\n * materialize every target, and verify the JWT/config postcondition.\n *\n * The pre-Slice-5 log copy referred to step 2 as \"Resetting local\n * runtime state...\", which let operators believe only platform handles\n * were being released. The log line now spells out the wipe explicitly\n * so the destructive scope is unambiguous in the live transcript.\n */\nexport class LocalAppReinitService {\n static async reinitialize(input: LocalAppReinitInput): Promise<void> {\n // Before the process sweep below, which would stop the HOST's platform tree along with everything\n // else under the framework root. The command refuses first; this keeps the service safe on its own.\n InfrastructureHost.assertOwnsSharedInfrastructure(input.env, SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA);\n const credentials = LocalAppReinitService.getCredentials(input.env.name);\n\n input.log.info('\\n Stopping graph-supervised local runtime processes...');\n const stopped = await LocalRuntimeProcessCleanupService.stop(\n [input.frameworkPath, input.saasRoot],\n input.log,\n );\n input.log.info(` Stopped ${stopped} prior local runtime process tree(s).`);\n\n input.log.info('\\n Refreshing generated local environment files...');\n await envSync(\n input.env,\n credentials,\n {\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n },\n input.log,\n );\n\n // Slice 5 (F-15) — be explicit in the transcript that this step\n // wipes ALL on-host backing-service data, not just platform handles.\n // The earlier \"Resetting local runtime state...\" line let operators\n // believe Mongo/Postgres/Valkey/RabbitMQ/MinIO/ClamAV files on disk\n // would survive — they don't.\n input.log.info('\\n Wiping local backing-service data and resetting local runtime state...');\n await LocalAppReinitService.resetEnvironment(input);\n\n input.log.info('\\n Running the registered initialization journey on the empty runtime...');\n await LocalApplicationInitializationService.initialize({\n env: input.env,\n frameworkPath: input.frameworkPath,\n saasRoot: input.saasRoot,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n requestedAppSlug: input.requestedAppSlug,\n processStateAlreadyClean: true,\n log: input.log,\n });\n }\n\n private static getCredentials(envName: string): PlatformEnvSecretsJson {\n const credentials = EnvironmentUtils.loadSecretsJson(envName);\n if (!credentials) {\n throw new Error(`No secrets for '${envName}'. Run 'wildo init' first.`);\n }\n\n return credentials;\n }\n\n private static async resetEnvironment(input: LocalAppReinitInput): Promise<void> {\n if (input.isFrameworkDeveloper) {\n try {\n await PlatformLifecycle.stop(input.env, input.log);\n } catch (error) {\n input.log.warn(\n ` Error stopping platform microservices: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n }\n\n if (input.env.runtime === WildoDeploymentRuntime.KUBERNETES) {\n const namespace = input.env.kubernetes?.namespace ?? K8S_LOCAL_DEFAULTS.NAMESPACE;\n const context = KIND_CLUSTER_DEFAULTS.KUBECTL_CONTEXT;\n const scaleResult = K8sOperations.kubectlScaleAllWorkloadsToZero(namespace, context);\n if (!scaleResult.success) {\n throw new Error(scaleResult.error ?? `Failed to scale workloads to zero in namespace \"${namespace}\"`);\n }\n const deleteResult = K8sOperations.kubectlDeleteAllPersistentVolumeClaims(namespace, context);\n if (!deleteResult.success) {\n throw new Error(deleteResult.error ?? `Failed to delete persistent volume claims in namespace \"${namespace}\"`);\n }\n // Slice 4 second-pass-3 review fix (HIGH-1) — same rationale as\n // `wildo local reset`: the static `Retain` PVs would otherwise remain in\n // `Released` with stale `claimRef.uid`, silently blocking the re-apply\n // path below. Deleting them lets `kubectl apply -f storage/` (in\n // `startEnvironment`) recreate them as Available so the new PVCs bind.\n const pvDeleteResult = K8sOperations.kubectlDeleteStaticLocalPersistentVolumes(context);\n if (!pvDeleteResult.success) {\n throw new Error(pvDeleteResult.error ?? 'Failed to delete static local PersistentVolumes');\n }\n } else {\n const infraCtx = ContextManager.resolveInfraContext(input.env.name);\n DockerUtils.runDockerCompose(infraCtx, ['down', '-v'], { inherit: true });\n }\n\n /*\n * Wipe backing-service data in BOTH places it can live, in lockstep with `wildo local reset`\n * and for both runtimes. Neither step above is sufficient on its own: compose's `down -v` drops\n * the named volumes THIS render declares and never the on-host tree, and a K8s PVC delete only\n * frees PV handles. Without both wipes a `local reinit` resurrects stale state — a corrupt\n * Mongo journal, a stale PG datadir, a half-built ClamAV signature DB.\n *\n * Both are unconditional on the environment's current `localDataStorage`, because an\n * environment re-authored from one mode to the other still holds data in the half it stopped\n * using, and the volume half has no visible directory in which to notice that. Fail-closed (D6).\n */\n wipeLocalDataServiceDirsForCompose(input.env);\n wipeLocalDataVolumesForCompose(input.env);\n\n EnvironmentUtils.clearPlatformInitialized(input.env.name);\n EnvironmentUtils.clearApplicationRuntimeIdentities(input.env.name);\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"local-app-reinit.service.js","sourceRoot":"","sources":["../../../../src/services/application/local-app-reinit.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EACL,kCAAkC,E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GAAG,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpE,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED;;;;;;;;;;WAUG;QACH,kCAAkC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,8BAA8B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE1C,gBAAgB,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1D,gBAAgB,CAAC,iCAAiC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;CAEF","sourcesContent":["import { DockerUtils } from '~wildo-cli/services/deployment/docker/docker.service';\nimport {\n wipeLocalDataServiceDirsForCompose,\n wipeLocalDataVolumesForCompose,\n} from '~wildo-cli/services/deployment/docker/docker-compose-generator.service';\nimport { K8sOperations } from '~wildo-cli/services/deployment/k8s/k8s-operations.service';\nimport * as PlatformLifecycle from '~wildo-cli/services/deployment/platform-lifecycle.service';\nimport { sync as envSync } from '~wildo-cli/services/environment/env-sync.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { LocalApplicationInitializationService } from './local-application-initialization.service';\nimport { LocalRuntimeProcessCleanupService } from '~wildo-cli/services/deployment/local-runtime-process-cleanup.service';\nimport { ContextManager } from '~wildo-cli/services/context/context-manager.service';\nimport { InfrastructureHost, SharedInfrastructureAction } from '~wildo-cli/services/environment/infrastructure-host.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport {\n K8S_LOCAL_DEFAULTS,\n KIND_CLUSTER_DEFAULTS,\n WildoDeploymentRuntime,\n} from '@wildo-ai/platform-config-lib';\n\nexport interface LocalAppReinitInput {\n env: PlatformEnvironmentConfiguration;\n frameworkPath: string;\n saasRoot: string;\n isFrameworkDeveloper: boolean;\n requestedAppSlug?: string | undefined;\n log: Logger;\n}\n\n/**\n * Destructive end-to-end reinitialization of a local app runtime.\n *\n * Slice 5 (F-15) — this service is the engine behind `wildo local reinit`\n * and is destructively equivalent to running `wildo local reset`\n * followed by `wildo local init` (the command requires framework-developer context):\n * 1. `reinitialize()` refreshes generated `.env` files for the active\n * environment (no destructive side-effect yet).\n * 2. `resetEnvironment()` WIPES every on-host bind-mount under\n * `<saas-root>/.wildo-saas/local_data/<svc>/` (Mongo journal, PG\n * datadir, ClamAV signature DB, …). For K8s it also scales workloads\n * to zero, deletes all PVCs, AND deletes the static `Retain`-policy\n * local PVs (otherwise they sit `Released` with stale `claimRef.uid`\n * and silently block the next bring-up). Fail-CLOSED — a partial\n * wipe is worse than a loud failure.\n * 3. Delegates to the same registered `LocalApplicationInitializationService`\n * as non-destructive `wildo local init`: re-render artifacts, re-apply infra,\n * wait for readiness, run platform INIT, register one application snapshot,\n * materialize every target, and verify the JWT/config postcondition.\n *\n * The pre-Slice-5 log copy referred to step 2 as \"Resetting local\n * runtime state...\", which let operators believe only platform handles\n * were being released. The log line now spells out the wipe explicitly\n * so the destructive scope is unambiguous in the live transcript.\n */\nexport class LocalAppReinitService {\n static async reinitialize(input: LocalAppReinitInput): Promise<void> {\n // Before the process sweep below, which would stop the HOST's platform tree along with everything\n // else under the framework root. The command refuses first; this keeps the service safe on its own.\n InfrastructureHost.assertOwnsSharedInfrastructure(input.env, SharedInfrastructureAction.WIPE_BACKING_SERVICE_DATA);\n const credentials = LocalAppReinitService.getCredentials(input.env.name);\n\n input.log.info('\\n Stopping graph-supervised local runtime processes...');\n const stopped = await LocalRuntimeProcessCleanupService.stop(\n [input.frameworkPath, input.saasRoot],\n input.log,\n );\n input.log.info(` Stopped ${stopped} prior local runtime process tree(s).`);\n\n input.log.info('\\n Refreshing generated local environment files...');\n await envSync(\n input.env,\n credentials,\n {\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n },\n input.log,\n );\n\n // Slice 5 (F-15) — be explicit in the transcript that this step\n // wipes ALL on-host backing-service data, not just platform handles.\n // The earlier \"Resetting local runtime state...\" line let operators\n // believe Mongo/Postgres/Valkey/RabbitMQ/MinIO/ClamAV files on disk\n // would survive — they don't.\n input.log.info('\\n Wiping local backing-service data and resetting local runtime state...');\n await LocalAppReinitService.resetEnvironment(input);\n\n input.log.info('\\n Running the registered initialization journey on the empty runtime...');\n await LocalApplicationInitializationService.initialize({\n env: input.env,\n frameworkPath: input.frameworkPath,\n saasRoot: input.saasRoot,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n requestedAppSlug: input.requestedAppSlug,\n processStateAlreadyClean: true,\n log: input.log,\n });\n }\n\n private static getCredentials(envName: string): PlatformEnvSecretsJson {\n const credentials = EnvironmentUtils.loadSecretsJson(envName);\n if (!credentials) {\n throw new Error(`No secrets for '${envName}'. Run 'wildo init' first.`);\n }\n\n return credentials;\n }\n\n private static async resetEnvironment(input: LocalAppReinitInput): Promise<void> {\n if (input.isFrameworkDeveloper) {\n try {\n await PlatformLifecycle.stop(input.env, input.log);\n } catch (error) {\n input.log.warn(\n ` Error stopping platform microservices: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n }\n\n if (input.env.runtime === WildoDeploymentRuntime.KUBERNETES) {\n const namespace = input.env.kubernetes?.namespace ?? K8S_LOCAL_DEFAULTS.NAMESPACE;\n const context = KIND_CLUSTER_DEFAULTS.KUBECTL_CONTEXT;\n const scaleResult = K8sOperations.kubectlScaleAllWorkloadsToZero(namespace, context);\n if (!scaleResult.success) {\n throw new Error(scaleResult.error ?? `Failed to scale workloads to zero in namespace \"${namespace}\"`);\n }\n const deleteResult = K8sOperations.kubectlDeleteAllPersistentVolumeClaims(namespace, context);\n if (!deleteResult.success) {\n throw new Error(deleteResult.error ?? `Failed to delete persistent volume claims in namespace \"${namespace}\"`);\n }\n // Slice 4 second-pass-3 review fix (HIGH-1) — same rationale as\n // `wildo local reset`: the static `Retain` PVs would otherwise remain in\n // `Released` with stale `claimRef.uid`, silently blocking the re-apply\n // path below. Deleting them lets `kubectl apply -f storage/` (in\n // `startEnvironment`) recreate them as Available so the new PVCs bind.\n const pvDeleteResult = K8sOperations.kubectlDeleteStaticLocalPersistentVolumes(context);\n if (!pvDeleteResult.success) {\n throw new Error(pvDeleteResult.error ?? 'Failed to delete static local PersistentVolumes');\n }\n } else {\n const infraCtx = ContextManager.resolveInfraContext(input.env.name);\n DockerUtils.runDockerCompose(infraCtx, ['down', '-v'], { inherit: true });\n }\n\n /*\n * Wipe backing-service data in BOTH places it can live, in lockstep with `wildo local reset`\n * and for both runtimes. Neither step above is sufficient on its own: compose's `down -v` drops\n * the named volumes THIS render declares and never the on-host tree, and a K8s PVC delete only\n * frees PV handles. Without both wipes a `local reinit` resurrects stale state — a corrupt\n * Mongo journal, a stale PG datadir, a half-built ClamAV signature DB.\n *\n * Both are unconditional on the environment's current `localDataStorage`, because an\n * environment re-authored from one mode to the other still holds data in the half it stopped\n * using, and the volume half has no visible directory in which to notice that. Fail-closed (D6).\n */\n wipeLocalDataServiceDirsForCompose(input.env);\n wipeLocalDataVolumesForCompose(input.env);\n\n EnvironmentUtils.clearPlatformInitialized(input.env.name);\n EnvironmentUtils.clearApplicationRuntimeIdentities(input.env.name);\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-application-initialization.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"local-application-initialization.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/local-application-initialization.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAYjG,MAAM,WAAW,mCAAmC;IAClD,GAAG,EAAE,gCAAgC,CAAC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,0GAA0G;IAC1G,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oCAAoC;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,iCAAiC,CAAC;CACvD;AAED;;;;;;;GAOG;AACH,qBAAa,qCAAqC;WACnC,UAAU,CACrB,KAAK,EAAE,mCAAmC,GACzC,OAAO,CAAC,oCAAoC,CAAC;CAuIjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-application-initialization.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/local-application-initialization.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,wCAAwC,EAAE,MAAM,4EAA4E,CAAC;AACtI,OAAO,EAAE,iCAAiC,EAAE,MAAM,sEAAsE,CAAC;AACzH,OAAO,KAAK,iBAAiB,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,iCAAiC,EAAE,MAAM,gEAAgE,CAAC;AACnH,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE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,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QACxE,CAAC;QAED,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QAClF,MAAM,kBAAkB,GAAG,MAAM,kCAAkC,CAAC,UAAU,CAAC;YAC7E,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,WAAW;YACX,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;YAChD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC,CAAC;QAEH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC;IACrD,CAAC;CACF","sourcesContent":["import type { Logger } from '~wildo-cli/kernel/types';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { ApplicationRuntimeBootstrapResult } from './application-runtime-bootstrap.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { RuntimeBootstrap } from '~wildo-cli/services/environment/runtime-bootstrap.service';\nimport { LocalInfrastructureInitializationService } from '~wildo-cli/services/deployment/local-infrastructure-initialization.service';\nimport { LocalRuntimeProcessCleanupService } from '~wildo-cli/services/deployment/local-runtime-process-cleanup.service';\nimport * as PlatformLifecycle from '~wildo-cli/services/deployment/platform-lifecycle.service';\nimport { shouldRunPlatformServicesNatively } from '~wildo-cli/services/deployment/platform-runtime-policy.service';\nimport { ApplicationRuntimeBootstrapService } from './application-runtime-bootstrap.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { readLiveLocalDevPlatformOwner } from '~wildo-cli/services/deployment/local-dev-session-lease.service';\nimport { InfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\n\nexport interface LocalApplicationInitializationInput {\n env: PlatformEnvironmentConfiguration;\n frameworkPath: string;\n saasRoot: string;\n isFrameworkDeveloper: boolean;\n requestedAppSlug?: string | undefined;\n /** Destructive reinit already reaped every process before wiping data; avoid a redundant second sweep. */\n processStateAlreadyClean?: boolean;\n /**\n * Register THIS application against an already-running platform and materialize its own runtime\n * projections — touching NO shared substrate. This is the second-app path (issue #50): no process\n * sweep, no artifact/infra convergence, no platform INIT. The control plane must already be healthy;\n * the application bootstrap fails with its own diagnostics otherwise.\n */\n registerOnly?: boolean;\n log: Logger;\n}\n\nexport interface LocalApplicationInitializationResult {\n stoppedProcessTrees: number;\n applicationRuntime: ApplicationRuntimeBootstrapResult;\n}\n\n/**\n * The registered, non-destructive local project initialization journey.\n *\n * It converges every derived layer in dependency order: authored artifacts -> backing-service readiness ->\n * platform INIT postconditions -> normal control-plane readiness -> one application registration snapshot ->\n * runtime projections -> executable JWT/config verification. It never wipes backing-service data; callers\n * needing a clean-room generation run their destructive reset first and then delegate here.\n */\nexport class LocalApplicationInitializationService {\n static async initialize(\n input: LocalApplicationInitializationInput,\n ): Promise<LocalApplicationInitializationResult> {\n /*\n * A HOSTED application's initialization IS registration: it owns no substrate to converge. It is not\n * refused as \"full init\" would be — there is nothing destructive left in it — so a hosted application\n * initializes the same way whether or not its host is running under `wildo local dev`.\n */\n const hostedBy = await InfrastructureHost.resolveAuthored(input.saasRoot, input.env.name);\n const registerOnly = input.registerOnly === true || hostedBy !== null;\n\n if (hostedBy !== null) {\n input.log.info(`\\n This application runs on the infrastructure of ${hostedBy.applicationRoot}: registering it against the host's platform.`);\n // Brings `config.json` and the registry onto the host's platform before registration reads them —\n // it renders no compose project for a hosted environment.\n await RuntimeBootstrap.ensureLocalRuntimeArtifacts({\n env: input.env,\n saasRoot: input.saasRoot,\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n log: input.log,\n });\n // `loadSecretsJson` decides whether the environment is hosted from the GENERATED `config.json`, which\n // the step above has only now pointed at the host — and it caches its answer. Loaded any earlier, an\n // application that declared `infrastructureHost` after being scaffolded as an owner reads its OWN\n // leftover `platform.adminSecret` on the first run, and apps-manager refuses it as \"Check\n // PLATFORM_ADMIN_SECRET\" (measured on scratch-1765-b, 2026-09-30: fails once, then succeeds).\n EnvironmentUtils.invalidateCache();\n }\n\n const credentials = EnvironmentUtils.loadSecretsJson(input.env.name);\n if (!credentials) {\n throw new Error(`No secrets for '${input.env.name}'. Run 'wildo setup' first.`);\n }\n\n /*\n * REFUSE full platform convergence under a live owner (issue #50). The phases below stop every\n * process tree under the framework root, rewrite the shared platform generation, recreate the\n * backing containers and run the apps-manager INIT job — each of which is an OUTAGE, not an\n * initialization, when a `wildo local dev` session is actively running the platform. It happened\n * twice on 2026-08-25 before this guard existed. The refusal names the owner and both doors.\n */\n const livePlatformOwner = readLiveLocalDevPlatformOwner(input.frameworkPath);\n if (livePlatformOwner && !registerOnly) {\n throw new Error(\n `an active \\`wildo local dev\\` session owns the shared platform (pid ${livePlatformOwner.pid}, ` +\n `app ${livePlatformOwner.appRoot}, since ${livePlatformOwner.acquiredAt}). Full initialization stops ` +\n 'every running process tree and rewrites the shared platform generation — refusing while the owner is ' +\n 'live. Either stop that session first, or run `wildo local init --register-only` to register THIS ' +\n 'application against the running platform without touching shared substrate.',\n );\n }\n\n if (registerOnly) {\n input.log.info('\\n Register-only: reconciling THIS application against the running platform (no shared substrate is touched)...');\n const applicationRuntime = await ApplicationRuntimeBootstrapService.initialize({\n env: input.env,\n credentials,\n frameworkPath: input.frameworkPath,\n saasRoot: input.saasRoot,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n requestedAppSlug: input.requestedAppSlug,\n log: input.log,\n });\n return { stoppedProcessTrees: 0, applicationRuntime };\n }\n\n let stoppedProcessTrees = 0;\n if (!input.processStateAlreadyClean) {\n input.log.info('\\n Stopping prior graph-supervised and tracked platform process trees...');\n try {\n await PlatformLifecycle.stop(input.env, input.log);\n } catch (error) {\n input.log.warn(\n ` Could not stop a tracked platform lifecycle: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n stoppedProcessTrees = await LocalRuntimeProcessCleanupService.stop(\n // The framework root only owns process trees for a framework developer; for an application\n // creator it is the installed CLI package, which runs nothing.\n input.isFrameworkDeveloper ? [input.frameworkPath, input.saasRoot] : [input.saasRoot],\n input.log,\n );\n }\n\n input.log.info('\\n Converging generated local runtime artifacts...');\n await RuntimeBootstrap.ensureLocalRuntimeArtifacts({\n env: input.env,\n saasRoot: input.saasRoot,\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n log: input.log,\n });\n\n input.log.info('\\n Starting backing services and waiting for readiness...');\n await LocalInfrastructureInitializationService.ensureReady({\n env: input.env,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n log: input.log,\n });\n\n if (shouldRunPlatformServicesNatively(input.env, input.isFrameworkDeveloper)) {\n input.log.info('\\n Reconciling platform initialization and waiting for the normal control plane...');\n await PlatformLifecycle.start(\n input.env,\n { frameworkPath: input.frameworkPath, skipInit: false },\n input.log,\n );\n } else {\n /*\n * App-creator lane: the platform services are compose services of the SAME project the\n * backing services belong to, so `ensureReady` above already started them (and `platform-init`,\n * the one-shot INIT job the compose file declares) and waited on their container health. What\n * remains is the same readiness contract the native lane holds application bootstrap to:\n * apps-manager answering `/health/ready` on its published port, bounded by the standard health\n * timeout (this command is not the long-running `local dev` loop, so an unbounded wait would be\n * a hang, not patience). Until 2026-09-06 this branch threw \"requires the registered native\n * platform lifecycle\", which left an application creator with no command that registers an\n * application.\n */\n input.log.info('\\n Waiting for the in-runtime apps-manager to answer its readiness contract...');\n await PlatformLifecycle.waitForAppsManagerReady(input.env, input.log);\n }\n\n input.log.info('\\n Reconciling the application and every runtime projection...');\n const applicationRuntime = await ApplicationRuntimeBootstrapService.initialize({\n env: input.env,\n credentials,\n frameworkPath: input.frameworkPath,\n saasRoot: input.saasRoot,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n requestedAppSlug: input.requestedAppSlug,\n log: input.log,\n });\n\n return { stoppedProcessTrees, applicationRuntime };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"local-application-initialization.service.js","sourceRoot":"","sources":["../../../../src/services/application/local-application-initialization.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,wCAAwC,EAAE,MAAM,4EAA4E,CAAC;AACtI,OAAO,EAAE,iCAAiC,EAAE,MAAM,sEAAsE,CAAC;AACzH,OAAO,KAAK,iBAAiB,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,iCAAiC,EAAE,MAAM,gEAAgE,CAAC;AACnH,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gEAAgE,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AAyBjG;;;;;;;GAOG;AACH,MAAM,OAAO,qCAAqC;IAChD,MAAM,CAAC,KAAK,CAAC,UAAU,CACrB,KAA0C;QAE1C;;;;WAIG;QACH,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,CAAC;QAEtE,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,sDAAsD,QAAQ,CAAC,eAAe,+CAA+C,CAAC,CAAC;YAC9I,kGAAkG;YAClG,0DAA0D;YAC1D,MAAM,gBAAgB,CAAC,2BAA2B,CAAC;gBACjD,GAAG,EA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AwC,CAAC,WAAW,CAAC;YACzD,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;YAChD,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC,CAAC;QAEH,IAAI,iCAAiC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;YAC7E,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAC;YACtG,MAAM,iBAAiB,CAAC,KAAK,CAC3B,KAAK,CAAC,GAAG,EACT,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,EACvD,KAAK,CAAC,GAAG,CACV,CAAC;QACJ,CAAC;aAAM,CAAC;YACN;;;;;;;;;;eAUG;YACH,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;YAClG,MAAM,iBAAiB,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QACxE,CAAC;QAED,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QAClF,MAAM,kBAAkB,GAAG,MAAM,kCAAkC,CAAC,UAAU,CAAC;YAC7E,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,WAAW;YACX,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;YAChD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC,CAAC;QAEH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC;IACrD,CAAC;CACF","sourcesContent":["import type { Logger } from '~wildo-cli/kernel/types';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { ApplicationRuntimeBootstrapResult } from './application-runtime-bootstrap.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { RuntimeBootstrap } from '~wildo-cli/services/environment/runtime-bootstrap.service';\nimport { LocalInfrastructureInitializationService } from '~wildo-cli/services/deployment/local-infrastructure-initialization.service';\nimport { LocalRuntimeProcessCleanupService } from '~wildo-cli/services/deployment/local-runtime-process-cleanup.service';\nimport * as PlatformLifecycle from '~wildo-cli/services/deployment/platform-lifecycle.service';\nimport { shouldRunPlatformServicesNatively } from '~wildo-cli/services/deployment/platform-runtime-policy.service';\nimport { ApplicationRuntimeBootstrapService } from './application-runtime-bootstrap.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { readLiveLocalDevPlatformOwner } from '~wildo-cli/services/deployment/local-dev-session-lease.service';\nimport { InfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\n\nexport interface LocalApplicationInitializationInput {\n env: PlatformEnvironmentConfiguration;\n frameworkPath: string;\n saasRoot: string;\n isFrameworkDeveloper: boolean;\n requestedAppSlug?: string | undefined;\n /** Destructive reinit already reaped every process before wiping data; avoid a redundant second sweep. */\n processStateAlreadyClean?: boolean;\n /**\n * Register THIS application against an already-running platform and materialize its own runtime\n * projections — touching NO shared substrate. This is the second-app path (issue #50): no process\n * sweep, no artifact/infra convergence, no platform INIT. The control plane must already be healthy;\n * the application bootstrap fails with its own diagnostics otherwise.\n */\n registerOnly?: boolean;\n log: Logger;\n}\n\nexport interface LocalApplicationInitializationResult {\n stoppedProcessTrees: number;\n applicationRuntime: ApplicationRuntimeBootstrapResult;\n}\n\n/**\n * The registered, non-destructive local project initialization journey.\n *\n * It converges every derived layer in dependency order: authored artifacts -> backing-service readiness ->\n * platform INIT postconditions -> normal control-plane readiness -> one application registration snapshot ->\n * runtime projections -> executable JWT/config verification. It never wipes backing-service data; callers\n * needing a clean-room generation run their destructive reset first and then delegate here.\n */\nexport class LocalApplicationInitializationService {\n static async initialize(\n input: LocalApplicationInitializationInput,\n ): Promise<LocalApplicationInitializationResult> {\n /*\n * A HOSTED application's initialization IS registration: it owns no substrate to converge. It is not\n * refused as \"full init\" would be — there is nothing destructive left in it — so a hosted application\n * initializes the same way whether or not its host is running under `wildo local dev`.\n */\n const hostedBy = await InfrastructureHost.resolveAuthored(input.saasRoot, input.env.name);\n const registerOnly = input.registerOnly === true || hostedBy !== null;\n\n if (hostedBy !== null) {\n input.log.info(`\\n This application runs on the infrastructure of ${hostedBy.applicationRoot}: registering it against the host's platform.`);\n // Brings `config.json` and the registry onto the host's platform before registration reads them —\n // it renders no compose project for a hosted environment.\n await RuntimeBootstrap.ensureLocalRuntimeArtifacts({\n env: input.env,\n saasRoot: input.saasRoot,\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n log: input.log,\n });\n // `loadSecretsJson` decides whether the environment is hosted from the GENERATED `config.json`, which\n // the step above has only now pointed at the host — and it caches its answer. Loaded any earlier, an\n // application that declared `infrastructureHost` after being scaffolded as an owner reads its OWN\n // leftover `platform.adminSecret` on the first run, and apps-manager refuses it as \"Check\n // PLATFORM_ADMIN_SECRET\" (measured on scratch-1765-b, 2026-09-30: fails once, then succeeds).\n EnvironmentUtils.invalidateCache();\n }\n\n const credentials = EnvironmentUtils.loadSecretsJson(input.env.name);\n if (!credentials) {\n throw new Error(`No secrets for '${input.env.name}'. Run 'wildo setup' first.`);\n }\n\n /*\n * REFUSE full platform convergence under a live owner (issue #50). The phases below stop every\n * process tree under the framework root, rewrite the shared platform generation, recreate the\n * backing containers and run the apps-manager INIT job — each of which is an OUTAGE, not an\n * initialization, when a `wildo local dev` session is actively running the platform. It happened\n * twice on 2026-08-25 before this guard existed. The refusal names the owner and both doors.\n */\n const livePlatformOwner = readLiveLocalDevPlatformOwner(input.frameworkPath);\n if (livePlatformOwner && !registerOnly) {\n throw new Error(\n `an active \\`wildo local dev\\` session owns the shared platform (pid ${livePlatformOwner.pid}, ` +\n `app ${livePlatformOwner.appRoot}, since ${livePlatformOwner.acquiredAt}). Full initialization stops ` +\n 'every running process tree and rewrites the shared platform generation — refusing while the owner is ' +\n 'live. Either stop that session first, or run `wildo local init --register-only` to register THIS ' +\n 'application against the running platform without touching shared substrate.',\n );\n }\n\n if (registerOnly) {\n input.log.info('\\n Register-only: reconciling THIS application against the running platform (no shared substrate is touched)...');\n const applicationRuntime = await ApplicationRuntimeBootstrapService.initialize({\n env: input.env,\n credentials,\n frameworkPath: input.frameworkPath,\n saasRoot: input.saasRoot,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n requestedAppSlug: input.requestedAppSlug,\n log: input.log,\n });\n return { stoppedProcessTrees: 0, applicationRuntime };\n }\n\n let stoppedProcessTrees = 0;\n if (!input.processStateAlreadyClean) {\n input.log.info('\\n Stopping prior graph-supervised and tracked platform process trees...');\n try {\n await PlatformLifecycle.stop(input.env, input.log);\n } catch (error) {\n input.log.warn(\n ` Could not stop a tracked platform lifecycle: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n stoppedProcessTrees = await LocalRuntimeProcessCleanupService.stop(\n // The framework root only owns process trees for a framework developer; for an application\n // creator it is the installed CLI package, which runs nothing.\n input.isFrameworkDeveloper ? [input.frameworkPath, input.saasRoot] : [input.saasRoot],\n input.log,\n );\n }\n\n input.log.info('\\n Converging generated local runtime artifacts...');\n await RuntimeBootstrap.ensureLocalRuntimeArtifacts({\n env: input.env,\n saasRoot: input.saasRoot,\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n log: input.log,\n });\n\n input.log.info('\\n Starting backing services and waiting for readiness...');\n await LocalInfrastructureInitializationService.ensureReady({\n env: input.env,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n log: input.log,\n });\n\n if (shouldRunPlatformServicesNatively(input.env, input.isFrameworkDeveloper)) {\n input.log.info('\\n Reconciling platform initialization and waiting for the normal control plane...');\n await PlatformLifecycle.start(\n input.env,\n { frameworkPath: input.frameworkPath, skipInit: false },\n input.log,\n );\n } else {\n /*\n * App-creator lane: the platform services are compose services of the SAME project the\n * backing services belong to, so `ensureReady` above already started them (and `platform-init`,\n * the one-shot INIT job the compose file declares) and waited on their container health. What\n * remains is the same readiness contract the native lane holds application bootstrap to:\n * apps-manager answering `/health/ready` on its published port, bounded by the standard health\n * timeout (this command is not the long-running `local dev` loop, so an unbounded wait would be\n * a hang, not patience). Until 2026-09-06 this branch threw \"requires the registered native\n * platform lifecycle\", which left an application creator with no command that registers an\n * application.\n */\n input.log.info('\\n Waiting for the in-runtime apps-manager to answer its readiness contract...');\n await PlatformLifecycle.waitForAppsManagerReady(input.env, input.log);\n }\n\n input.log.info('\\n Reconciling the application and every runtime projection...');\n const applicationRuntime = await ApplicationRuntimeBootstrapService.initialize({\n env: input.env,\n credentials,\n frameworkPath: input.frameworkPath,\n saasRoot: input.saasRoot,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n requestedAppSlug: input.requestedAppSlug,\n log: input.log,\n });\n\n return { stoppedProcessTrees, applicationRuntime };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-package-links.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"provider-package-links.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/provider-package-links.service.ts"],"names":[],"mappings":"AA4DA;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,sEAAsE,CAAC;AAEzH,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC1C,6FAA6F;IAC7F,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,wDAAwD;IACxD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,oGAAoG;AACpG,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IACrD,aAAa,EAAE,MAAM,CAAC,MAA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