@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":"application-runtime-bootstrap.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/application-runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAE5F,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAC3G,OAAO,EAAE,4CAA4C,EAAE,MAAM,mDAAmD,CAAC;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CAAC,eAAe,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;cACzF,8FAA8F;cAC9F,qFAAqF;cACrF,6EAA6E,CAChF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * Canonical application-runtime bootstrap orchestration.\n *\n * This service is the single local lifecycle seam that turns an authored SaaS\n * application declaration into runnable process configuration:\n *\n * apps-manager registration by stable slug\n * -> bootstrap credential fetch\n * -> derived APPLICATION_ID persistence\n * -> backend/companion/frontend/worker/minion target projection\n * -> generated env materialization\n * -> declaration convergence, when registration degraded and so did not apply it\n * -> postcondition: JWT door + stored config compared against the declaration\n *\n * Callers must make apps-manager ready before entering this service. Keeping\n * that boundary explicit prevents application processes from racing the\n * database-owned identity/config/secrets records they consume at startup.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { sync as envSync } from '~wildo-cli/services/environment/env-sync.service';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { hydrateEnvironmentFromConfig } from '~wildo-cli/services/environment/environment-hydration.utils';\nimport { ApplicationInitializationVerificationService } from './application-initialization-verification.service';\nimport { DegradedRegistrationDeclarationConvergenceService } from './degraded-registration-declaration-convergence.service';\n\nexport interface ApplicationRuntimeBootstrapInput {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n frameworkPath: string;\n saasRoot: string;\n isFrameworkDeveloper: boolean;\n requestedAppSlug?: string | undefined;\n log: Logger;\n}\n\nexport interface ApplicationRuntimeBootstrapResult {\n backendCount: number;\n companionCount: number;\n frontendCount: number;\n workerCount: number;\n minionCount: number;\n}\n\nexport class ApplicationRuntimeBootstrapService {\n static async initialize(\n input: ApplicationRuntimeBootstrapInput,\n ): Promise<ApplicationRuntimeBootstrapResult> {\n const config = EnvironmentUtils.loadConfigJson(input.env.name);\n if (!config) {\n throw new Error(`No config for '${input.env.name}'. Run 'wildo setup' first.`);\n }\n\n /**\n * Reconcile the caller's environment record against `config.json` before any target is\n * projected from it. The record is a registry CACHE that persists only a subset of the\n * authored environment, so an identity field authored since the last write reads as\n * `undefined` here and every generator silently takes its default — see the contract on\n * {@link hydrateEnvironmentFromConfig} for what that cost when the default was `http`\n * against a TLS dev edge.\n */\n const resolvedEnv = hydrateEnvironmentFromConfig(input.env, config);\n\n const registeredTargetInput = {\n env: resolvedEnv,\n credentials: input.credentials,\n saasRoot: input.saasRoot,\n config,\n requestedAppSlug: input.requestedAppSlug,\n };\n\n input.log.info(' Registering application once and materializing every runtime target from one snapshot...');\n\n const prepared = await AppBootstrapService.prepareApplicationEnvTargets(registeredTargetInput);\n if (!prepared) {\n throw new Error(\n 'Application bootstrap resolved no application target. Check wildo.saas.config.ts and the selected application slug.',\n );\n }\n const projectionInput = { ...registeredTargetInput, prepared };\n\n // These builders are projections over the same prepared registration/credential generation. They no\n // longer make independent initialize + credential-fetch requests, so a single logical bootstrap cannot\n // mix observations from multiple control-plane generations.\n const applicationBackends = await AppBootstrapService.buildApplicationBackendTargets(\n projectionInput,\n );\n const companionApis = await AppBootstrapService.buildApplicationCompanionTargets(\n projectionInput,\n );\n const applicationWorkers = await AppBootstrapService.buildApplicationWorkerTargets(\n projectionInput,\n );\n const applicationMinions = await AppBootstrapService.buildApplicationMinionTargets(\n projectionInput,\n );\n const applicationFrontends = await AppBootstrapService.buildApplicationFrontendTargets({\n saasRoot: input.saasRoot,\n requestedAppSlug: input.requestedAppSlug,\n prepared,\n });\n\n const result: ApplicationRuntimeBootstrapResult = {\n backendCount: applicationBackends.length,\n companionCount: companionApis.length,\n frontendCount: applicationFrontends.length,\n workerCount: applicationWorkers.length,\n minionCount: applicationMinions.length,\n };\n const targetCount = Object.values(result).reduce((total, count) => total + count, 0);\n if (targetCount === 0) {\n throw new Error(\n 'Application bootstrap resolved no runtime targets. Check wildo.saas.config.ts and the selected application slug.',\n );\n }\n\n await envSync(\n resolvedEnv,\n input.credentials,\n {\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n // Without it the foreign-owner skip in `envSync` can never apply, so `--register-only` — whose contract is\n // \"no shared substrate is touched\" — rewrote every platform service's env from THIS application (#1112).\n invokingAppRoot: input.saasRoot,\n applicationBackends,\n companionApis,\n applicationFrontends,\n applicationWorkers,\n applicationMinions,\n },\n input.log,\n );\n\n /*\n * Converge, then verify. A non-degraded registration has already applied the declaration through\n * `/initialize`; a DEGRADED one never called it, so the postcondition below would report the\n * author's own edit as drift. Apply the missing step first — see the service for exactly what it\n * will and will not apply unattended.\n */\n // Name what registration applied, so an edited declaration is never applied silently.\n if (prepared.declarationConvergedFields !== undefined && prepared.declarationConvergedFields.length > 0) {\n input.log.info(\n ` Applied wildo.saas.config.ts to the stored config of '${prepared.runtimeTarget.appSlug}' `\n + `— ${prepared.declarationConvergedFields.length} slice(s):`,\n );\n for (const field of prepared.declarationConvergedFields) {\n input.log.info(` • ${field}`);\n }\n }\n if (prepared.degraded) {\n await DegradedRegistrationDeclarationConvergenceService.converge({\n env: resolvedEnv,\n credentials: input.credentials,\n appSlug: prepared.runtimeTarget.appSlug,\n managedDeclaration: prepared.runtimeTarget.managedDeclaration,\n log: input.log,\n });\n }\n\n input.log.info(' Verifying the registered platform JWT door and managed application config...');\n await ApplicationInitializationVerificationService.assertCoherent({\n env: resolvedEnv,\n credentials: input.credentials,\n appSlug: prepared.runtimeTarget.appSlug,\n // The declaration this run initialized against — what makes the postcondition a COMPARISON\n // rather than an existence assertion (issue #97).\n managedDeclaration: prepared.runtimeTarget.managedDeclaration,\n });\n\n /*\n * The claim below says \"materialized\". Make it TRUE rather than hopeful.\n *\n * Every target here is a process that reads its `.env` at startup and fails without it, so\n * \"materialized\" has to mean the file is on disk — not that a writer was invoked. Until\n * 2026-09-10 it meant the second: the application env writes were gated on framework-developer\n * mode, so an app-creator application was told \"1 backend, 1 companion, 1 frontend materialized\"\n * with zero `.env` files written, and the failure surfaced much later and somewhere else — the\n * companion dying on `APPLICATION_ID ... undefined` inside `pnpm --parallel`, which took the\n * rest of the stack down with it and named nothing.\n *\n * A postcondition here is worth more than a checker: it fires in the run that caused it, names\n * the files, and cannot be true-by-accident. It also guards the reverse direction — a project\n * that never completed `wildo local init` now says so here instead of compiling happily and\n * running nothing.\n */\n ApplicationRuntimeBootstrapService.assertRuntimeEnvOnDisk(\n [...applicationBackends, ...companionApis, ...applicationFrontends,\n ...applicationWorkers, ...applicationMinions],\n input.log,\n );\n\n input.log.success(\n ` Application runtime materialized: ${result.backendCount} backend, `\n + `${result.companionCount} companion, ${result.frontendCount} frontend, `\n + `${result.workerCount} worker, ${result.minionCount} minion target(s).`,\n );\n return result;\n }\n\n /**\n * Refuse to report materialization for a target whose `.env` is not on disk.\n *\n * @see the note at the call site for the defect this exists to prevent.\n */\n private static assertRuntimeEnvOnDisk(\n targets: readonly { applicationRoot: string; relativeDir: string }[],\n log: Logger,\n ): void {\n /*\n * Only targets that actually carry both path fields are checkable. The type requires them, so a\n * target without them is a test double rather than a real runtime target — this postcondition\n * must not turn a partial mock into a crash (`join(undefined, ...)` throws a TypeError that\n * reads as a bug in the thing being verified). Anything skipped is REPORTED rather than hidden,\n * so a real target that somehow lost its anchor is still visible.\n */\n const checkable = targets.filter(\n (target) => typeof target?.applicationRoot === 'string' && typeof target?.relativeDir === 'string',\n );\n const skipped = targets.length - checkable.length;\n const missing = checkable\n .map((target) => join(target.applicationRoot, target.relativeDir, FILE_NAMES.DOT_ENV))\n .filter((path) => !existsSync(path));\n\n if (missing.length === 0) {\n log.info(\n ` Runtime env verified on disk for ${checkable.length} target(s).`\n + (skipped > 0 ? ` (${skipped} target(s) carried no path anchor and were not checkable.)` : ''),\n );\n return;\n }\n\n const applicationRoot = targets[0]?.applicationRoot ?? process.cwd();\n throw new Error(\n `Application runtime env is missing for ${missing.length} of ${targets.length} target(s):\\n`\n + `${missing.map((path) => ` - ${relative(applicationRoot, path) || path}`).join('\\n')}\\n`\n + 'Each of these is read at process startup, so the application would compile and then fail to '\n + 'run with an unrelated-looking validation error. Re-run `wildo local init` for this '\n + 'application; if it persists, the env generator did not receive this target.',\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"application-runtime-bootstrap.service.js","sourceRoot":"","sources":["../../../../src/services/application/application-runtime-bootstrap.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAE5F,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAC3G,OAAO,EAAE,4CAA4C,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,iDAAiD,EAAE,MAAM,yDAAyD,CAAC;AAoB5H,MAAM,OAAO,kCAAkC;IAC7C,MAAM,CAAC,KAAK,CAAC,UAAU,CACrB,KAAuC;QAEvC,MAAM,MAAM,GAAG,gBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,GAAG,CAAC,IAAI,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Q,IAAI,OAAO,MAAM,EAAE,WAAW,KAAK,QAAQ,CACnG,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;QAClD,MAAM,OAAO,GAAG,SAAS;aACtB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;aACrF,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAEvC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,GAAG,CAAC,IAAI,CACN,sCAAsC,SAAS,CAAC,MAAM,aAAa;kBACjE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,4DAA4D,CAAC,CAAC,CAAC,EAAE,CAAC,CAChG,CAAC;YACF,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACrE,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,CAAC,MAAM,OAAO,OAAO,CAAC,MAAM,eAAe;cAC1F,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;cACzF,8FAA8F;cAC9F,qFAAqF;cACrF,6EAA6E,CAChF,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * Canonical application-runtime bootstrap orchestration.\n *\n * This service is the single local lifecycle seam that turns an authored SaaS\n * application declaration into runnable process configuration:\n *\n * apps-manager registration by stable slug\n * -> bootstrap credential fetch\n * -> derived APPLICATION_ID persistence\n * -> backend/companion/frontend/worker/minion target projection\n * -> generated env materialization\n * -> declaration convergence, when registration degraded and so did not apply it\n * -> postcondition: JWT door + stored config compared against the declaration\n *\n * Callers must make apps-manager ready before entering this service. Keeping\n * that boundary explicit prevents application processes from racing the\n * database-owned identity/config/secrets records they consume at startup.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { sync as envSync } from '~wildo-cli/services/environment/env-sync.service';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { hydrateEnvironmentFromConfig } from '~wildo-cli/services/environment/environment-hydration.utils';\nimport { ApplicationInitializationVerificationService } from './application-initialization-verification.service';\nimport { DegradedRegistrationDeclarationConvergenceService } from './degraded-registration-declaration-convergence.service';\n\nexport interface ApplicationRuntimeBootstrapInput {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n frameworkPath: string;\n saasRoot: string;\n isFrameworkDeveloper: boolean;\n requestedAppSlug?: string | undefined;\n log: Logger;\n}\n\nexport interface ApplicationRuntimeBootstrapResult {\n backendCount: number;\n companionCount: number;\n frontendCount: number;\n workerCount: number;\n minionCount: number;\n}\n\nexport class ApplicationRuntimeBootstrapService {\n static async initialize(\n input: ApplicationRuntimeBootstrapInput,\n ): Promise<ApplicationRuntimeBootstrapResult> {\n const config = EnvironmentUtils.loadConfigJson(input.env.name);\n if (!config) {\n throw new Error(`No config for '${input.env.name}'. Run 'wildo setup' first.`);\n }\n\n /**\n * Reconcile the caller's environment record against `config.json` before any target is\n * projected from it. The record is a registry CACHE that persists only a subset of the\n * authored environment, so an identity field authored since the last write reads as\n * `undefined` here and every generator silently takes its default — see the contract on\n * {@link hydrateEnvironmentFromConfig} for what that cost when the default was `http`\n * against a TLS dev edge.\n */\n const resolvedEnv = hydrateEnvironmentFromConfig(input.env, config);\n\n const registeredTargetInput = {\n env: resolvedEnv,\n credentials: input.credentials,\n saasRoot: input.saasRoot,\n config,\n requestedAppSlug: input.requestedAppSlug,\n };\n\n input.log.info(' Registering application once and materializing every runtime target from one snapshot...');\n\n const prepared = await AppBootstrapService.prepareApplicationEnvTargets(registeredTargetInput);\n if (!prepared) {\n throw new Error(\n 'Application bootstrap resolved no application target. Check wildo.saas.config.ts and the selected application slug.',\n );\n }\n const projectionInput = { ...registeredTargetInput, prepared };\n\n // These builders are projections over the same prepared registration/credential generation. They no\n // longer make independent initialize + credential-fetch requests, so a single logical bootstrap cannot\n // mix observations from multiple control-plane generations.\n const applicationBackends = await AppBootstrapService.buildApplicationBackendTargets(\n projectionInput,\n );\n const companionApis = await AppBootstrapService.buildApplicationCompanionTargets(\n projectionInput,\n );\n const applicationWorkers = await AppBootstrapService.buildApplicationWorkerTargets(\n projectionInput,\n );\n const applicationMinions = await AppBootstrapService.buildApplicationMinionTargets(\n projectionInput,\n );\n const applicationFrontends = await AppBootstrapService.buildApplicationFrontendTargets({\n saasRoot: input.saasRoot,\n requestedAppSlug: input.requestedAppSlug,\n prepared,\n });\n\n const result: ApplicationRuntimeBootstrapResult = {\n backendCount: applicationBackends.length,\n companionCount: companionApis.length,\n frontendCount: applicationFrontends.length,\n workerCount: applicationWorkers.length,\n minionCount: applicationMinions.length,\n };\n const targetCount = Object.values(result).reduce((total, count) => total + count, 0);\n if (targetCount === 0) {\n throw new Error(\n 'Application bootstrap resolved no runtime targets. Check wildo.saas.config.ts and the selected application slug.',\n );\n }\n\n await envSync(\n resolvedEnv,\n input.credentials,\n {\n frameworkPath: input.frameworkPath,\n isFrameworkDeveloper: input.isFrameworkDeveloper,\n // Without it the foreign-owner skip in `envSync` can never apply, so `--register-only` — whose contract is\n // \"no shared substrate is touched\" — rewrote every platform service's env from THIS application (#1112).\n invokingAppRoot: input.saasRoot,\n applicationBackends,\n companionApis,\n applicationFrontends,\n applicationWorkers,\n applicationMinions,\n },\n input.log,\n );\n\n /*\n * Converge, then verify. A non-degraded registration has already applied the declaration through\n * `/initialize`; a DEGRADED one never called it, so the postcondition below would report the\n * author's own edit as drift. Apply the missing step first — see the service for exactly what it\n * will and will not apply unattended.\n */\n // Name what registration applied, so an edited declaration is never applied silently.\n if (prepared.declarationConvergedFields !== undefined && prepared.declarationConvergedFields.length > 0) {\n input.log.info(\n ` Applied wildo.saas.config.ts to the stored config of '${prepared.runtimeTarget.appSlug}' `\n + `— ${prepared.declarationConvergedFields.length} slice(s):`,\n );\n for (const field of prepared.declarationConvergedFields) {\n input.log.info(` • ${field}`);\n }\n }\n if (prepared.degraded) {\n await DegradedRegistrationDeclarationConvergenceService.converge({\n env: resolvedEnv,\n credentials: input.credentials,\n appSlug: prepared.runtimeTarget.appSlug,\n managedDeclaration: prepared.runtimeTarget.managedDeclaration,\n log: input.log,\n });\n }\n\n input.log.info(' Verifying the registered platform JWT door and managed application config...');\n await ApplicationInitializationVerificationService.assertCoherent({\n env: resolvedEnv,\n credentials: input.credentials,\n appSlug: prepared.runtimeTarget.appSlug,\n // The declaration this run initialized against — what makes the postcondition a COMPARISON\n // rather than an existence assertion (issue #97).\n managedDeclaration: prepared.runtimeTarget.managedDeclaration,\n });\n\n /*\n * The claim below says \"materialized\". Make it TRUE rather than hopeful.\n *\n * Every target here is a process that reads its `.env` at startup and fails without it, so\n * \"materialized\" has to mean the file is on disk — not that a writer was invoked. Until\n * 2026-09-10 it meant the second: the application env writes were gated on framework-developer\n * mode, so an app-creator application was told \"1 backend, 1 companion, 1 frontend materialized\"\n * with zero `.env` files written, and the failure surfaced much later and somewhere else — the\n * companion dying on `APPLICATION_ID ... undefined` inside `pnpm --parallel`, which took the\n * rest of the stack down with it and named nothing.\n *\n * A postcondition here is worth more than a checker: it fires in the run that caused it, names\n * the files, and cannot be true-by-accident. It also guards the reverse direction — a project\n * that never completed `wildo local init` now says so here instead of compiling happily and\n * running nothing.\n */\n ApplicationRuntimeBootstrapService.assertRuntimeEnvOnDisk(\n [...applicationBackends, ...companionApis, ...applicationFrontends,\n ...applicationWorkers, ...applicationMinions],\n input.log,\n );\n\n input.log.success(\n ` Application runtime materialized: ${result.backendCount} backend, `\n + `${result.companionCount} companion, ${result.frontendCount} frontend, `\n + `${result.workerCount} worker, ${result.minionCount} minion target(s).`,\n );\n return result;\n }\n\n /**\n * Refuse to report materialization for a target whose `.env` is not on disk.\n *\n * @see the note at the call site for the defect this exists to prevent.\n */\n private static assertRuntimeEnvOnDisk(\n targets: readonly { applicationRoot: string; relativeDir: string }[],\n log: Logger,\n ): void {\n /*\n * Only targets that actually carry both path fields are checkable. The type requires them, so a\n * target without them is a test double rather than a real runtime target — this postcondition\n * must not turn a partial mock into a crash (`join(undefined, ...)` throws a TypeError that\n * reads as a bug in the thing being verified). Anything skipped is REPORTED rather than hidden,\n * so a real target that somehow lost its anchor is still visible.\n */\n const checkable = targets.filter(\n (target) => typeof target?.applicationRoot === 'string' && typeof target?.relativeDir === 'string',\n );\n const skipped = targets.length - checkable.length;\n const missing = checkable\n .map((target) => join(target.applicationRoot, target.relativeDir, FILE_NAMES.DOT_ENV))\n .filter((path) => !existsSync(path));\n\n if (missing.length === 0) {\n log.info(\n ` Runtime env verified on disk for ${checkable.length} target(s).`\n + (skipped > 0 ? ` (${skipped} target(s) carried no path anchor and were not checkable.)` : ''),\n );\n return;\n }\n\n const applicationRoot = targets[0]?.applicationRoot ?? process.cwd();\n throw new Error(\n `Application runtime env is missing for ${missing.length} of ${targets.length} target(s):\\n`\n + `${missing.map((path) => ` - ${relative(applicationRoot, path) || path}`).join('\\n')}\\n`\n + 'Each of these is read at process startup, so the application would compile and then fail to '\n + 'run with an unrelated-looking validation error. Re-run `wildo local init` for this '\n + 'application; if it persists, the env generator did not receive this target.',\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend-config.paths.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"backend-config.paths.d.ts","sourceRoot":"","sources":["../../../../src/services/application/backend-config.paths.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,QAAuD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend-config.paths.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"backend-config.paths.js","sourceRoot":"","sources":["../../../../src/services/application/backend-config.paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import { join } from 'path';\n\n/**\n * The application backend's configuration — the object it boots with — relative to the application root.\n *\n * A module of its own so a reader that only needs the PATH (the creation preflight, on every `wildo creation run`)\n * does not load the compliance wiring and the `tsx` loader it imports.\n */\nexport const BACKEND_CONFIG_RELATIVE_PATH = join('backend-api', 'src', 'saas-config.backend.ts');\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-provider-plan.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"composition-provider-plan.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/composition-provider-plan.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,wCAAwC,CAAC;AAGhD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,IAAI,EAAE,4BAA4B,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAAG,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;CAC3E,GAAG,4BAA4B,CAiD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-provider-plan.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"composition-provider-plan.service.js","sourceRoot":"","sources":["../../../../src/services/application/composition-provider-plan.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,yCAAyC,EACzC,kCAAkC,GAEnC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAK5C;IACC,MAAM,kBAAkB,GAAG,cAAc,CAAC;IAC1C,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,KAAK,kBAAkB,CAAC,CAAC;IACjH,4FAA4F;IAC5F,yFAAyF;IACzF,IAAI,YAAY,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,KAAK,kBAAkB,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IACxJ,4FAA4F;IAC5F,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,kBAAkB,IAAI,CAAC,YAAY,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IAC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kipReason,\n CompositionScenarioDerivedEditKind,\n type CompositionScenarioApplyPlan,\n} from \"@wildo-ai/application-creation-runtime\";\nimport { ProviderPackageLinksService } from \"./provider-package-links.service\";\n\n/**\n * Finish the CLI's composition preview against prospective file contents. Provider resolution sees\n * newly created packages and workspace declarations without writing a temporary application tree.\n * Fold the resulting root manifest into every planned writer of that path; the sequential apply\n * must never overwrite a computed override with an earlier authored-edit snapshot. The companion\n * does not run this CLI-owned provider reconciliation; shared peer expansion lives in core planning.\n */\nexport function planCompositionProviderLinks(input: {\n plan: CompositionScenarioApplyPlan;\n applicationRoot: string;\n frameworkPath: string | null;\n log: { info: (message: string) => void; warn: (message: string) => void };\n}): CompositionScenarioApplyPlan {\n const targetRelativePath = \"package.json\";\n const rootTemplate = input.plan.templateWrites?.find((write) => write.targetRelativePath === targetRelativePath);\n // A declared edit reads an existing file. Do not fold that application-owned input into the\n // expected bytes of a root template, even when the edit reports it is already satisfied.\n if (rootTemplate && [...input.plan.edits, ...input.plan.skippedEdits].some((edit) => edit.targetRelativePath === targetRelativePath)) return input.plan;\n // Only the root template can gain provider bytes here. Every other collision still refuses.\n if (input.plan.collisions.some((path) => path !== targetRelativePath || !rootTemplate)) return input.plan;\n const plannedContents = new Map<string, string>();\n for (const write of input.plan.writes) plannedContents.set(join(input.applicationRoot, write.targetRelativePath), write.content.toString(\"utf8\"));\n for (const edit of input.plan.edits) plannedContents.set(join(input.applicationRoot, edit.targetRelativePath), edit.newContent);\n // Expected root comes from the template, never from an existing (possibly user-edited) root.\n if (rootTemplate) plannedContents.set(join(input.applicationRoot, targetRelativePath), rootTemplate.content.toString(\"utf8\"));\n const result = ProviderPackageLinksService.reconcileAndReport({ ...input, plannedContents, write: false });\n const content = result.rootManifestContent;\n if (content === undefined) return input.plan;\n const summary = `derived pnpm.overrides: ${result.added.map(({ packageName, overrideValue }) => `${packageName}=${overrideValue}`).join(\", \")}`;\n if (rootTemplate) {\n const rootPath = join(input.applicationRoot, targetRelativePath);\n const expected = Buffer.from(content);\n const exists = existsSync(rootPath);\n const identical = exists && readFileSync(rootPath).equals(expected);\n return {\n ...input.plan,\n writes: [\n ...input.plan.writes.filter((write) => write.targetRelativePath !== targetRelativePath),\n ...(exists ? [] : [{ ...rootTemplate, content: expected, summary: [rootTemplate.summary, summary].filter(Boolean).join(\"; \") }]),\n ],\n skipped: [\n ...input.plan.skipped.filter((write) => write.targetRelativePath !== targetRelativePath),\n ...(identical ? [{ targetRelativePath, reason: CompositionScenarioPlannedWriteSkipReason.EXISTING_IDENTICAL }] : []),\n ],\n collisions: [...input.plan.collisions.filter((path) => path !== targetRelativePath), ...(exists && !identical ? [targetRelativePath] : [])],\n };\n }\n const rootWrite = input.plan.writes.some((write) => write.targetRelativePath === targetRelativePath);\n return {\n ...input.plan,\n writes: input.plan.writes.map((write) =>\n write.targetRelativePath === targetRelativePath\n ? { ...write, content: Buffer.from(content), summary: [write.summary, summary].filter(Boolean).join(\"; \") }\n : write,\n ),\n edits: [\n ...input.plan.edits.map((edit) => (edit.targetRelativePath === targetRelativePath ? { ...edit, newContent: content } : edit)),\n ...(rootWrite ? [] : [{ targetRelativePath, kind: CompositionScenarioDerivedEditKind.PROVIDER_OVERRIDES, newContent: content, summary }]),\n ],\n skipped: input.plan.skipped.filter((write) => write.targetRelativePath !== targetRelativePath),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-host-readiness.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"creation-host-readiness.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/creation-host-readiness.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kEAAkE,CAAC;AAGrH,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,MAAM,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,SAAS,WAAW,EAAE,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;CAC5B;AAkCD,eAAO,MAAM,kBAAkB,EAAE,SAahC,CAAC;AAWF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,SAA8B,GAAG,4BAA4B,CA4BpG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,KAAK,GAAE,SAA8B,EACrC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,4BAA4B,CA2C9B;AAED,6DAA6D;AAC7D,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG,4BAA4B,EAAE,CAMjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-host-readiness.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/creation-host-readiness.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAA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,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5L,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,oCAAoC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACxG,CAAC;IACF,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,4BAA4B,CAAC,IAAI;QACzC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wGAAwG;QACrI,GAAG,EAAE,6GAA6G;cAC9G,2DAA2D;KAChE,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,yBAAyB,CAAC,KAIzC;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,IAAI,kBAAkB,CAAC;IAC/C,wGAAwG;IACxG,IAAI,KAAoE,CAAC;IACzE,MAAM,KAAK,GAAc,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACrG,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAC9G,CAAC","sourcesContent":["/**\n * Is THIS MACHINE in a state to carry a creation run — the half of the creation preflight that reads the host\n * rather than the application (#2229).\n *\n * Both checks WARN and never FAIL. Neither mirrors a refusal: nothing in the runtime refuses to start on a busy\n * machine or beside a framework watcher. They are here because run 004 lost time to both — a machine overloaded by\n * other processes, and framework watchers whose rebuilds respawned the application's processes mid-run — and both\n * are conditions an operator may legitimately choose to live with. A WARN reports; it must not stop a run.\n */\n\nimport { execFileSync } from 'child_process';\nimport { readFileSync } from 'fs';\nimport { availableParallelism, cpus, loadavg } from 'os';\nimport { join } from 'path';\n\nimport { LocalPreconditionCheckStatus } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport type { LocalPreconditionCheckResult } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport { DEV_COMPILE_STATUS_RELATIVE } from '~wildo-cli/services/framework/dev-compile-status.paths';\n\n/** One running process, as `ps` reports it. */\nexport interface HostProcess {\n readonly pid: number;\n readonly cpuPercent: number;\n readonly command: string;\n}\n\n/**\n * The host facts these checks read, injectable so a test never probes the machine it runs on.\n *\n * `processes` is `null` when the process table could not be read (no `ps`, or Windows); the checks then say so\n * rather than reporting an empty table as \"nothing is running\".\n */\nexport interface HostProbe {\n readonly platform: NodeJS.Platform;\n readonly loadAverageOneMinute: () => number;\n readonly coreCount: () => number;\n readonly processes: () => readonly HostProcess[] | null;\n readonly readFile: (path: string) => string | null;\n readonly now: () => number;\n}\n\n/** How many processes the load warning names: enough to find the culprit, short enough to read. */\nconst TOP_PROCESS_COUNT = 5;\n\n/**\n * How old the compile-status heartbeat may be and still mean an orchestrator is running.\n *\n * `dev-compile-status.mjs` rewrites it every 5 s; a file whose heartbeat is minutes old is the record of a session\n * that ended without cleaning up, and reporting it as live watchers would send the operator after nothing.\n */\nconst COMPILE_STATUS_HEARTBEAT_FRESH_MS = 30_000;\n\n/**\n * Command-line fragments that identify a compile watcher. `tsc-watch` drives every package's watcher, and\n * `wildo-compiler-runner` is the lane wrapper it runs. A match counts as a FRAMEWORK watcher only when its command\n * names the framework root and does not name the application's root: the dogfood applications live INSIDE the\n * framework root (`examples/…`), so the root alone would count their own `wildo local dev` watchers too.\n */\nconst FRAMEWORK_WATCHER_COMMAND_MARKERS: readonly string[] = ['tsc-watch', 'wildo-compiler-runner'];\n\nfunction readProcessTable(): readonly HostProcess[] | null {\n try {\n // `-A` every process, `=` suppresses headers; `args` keeps the full command line, which the watcher check needs.\n const output = execFileSync('ps', ['-Ao', 'pid=,pcpu=,args='], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });\n return output.split('\\n').flatMap((line) => {\n const match = /^\\s*(\\d+)\\s+([\\d.]+)\\s+(.*)$/.exec(line);\n return match ? [{ pid: Number(match[1]), cpuPercent: Number(match[2]), command: match[3] }] : [];\n });\n } catch {\n return null;\n }\n}\n\nexport const DEFAULT_HOST_PROBE: HostProbe = {\n platform: process.platform,\n loadAverageOneMinute: () => loadavg()[0],\n coreCount: () => (typeof availableParallelism === 'function' ? availableParallelism() : cpus().length),\n processes: () => (process.platform === 'win32' ? null : readProcessTable()),\n readFile: (path) => {\n try {\n return readFileSync(path, 'utf8');\n } catch {\n return null;\n }\n },\n now: () => Date.now(),\n};\n\n/** The executable a command line starts with, shortened to its basename, for a line an operator reads. */\nfunction describeCommand(command: string): string {\n const executable = command.split(/\\s+/)[0] ?? command;\n const basename = executable.split('/').pop() ?? executable;\n const rest = command.slice(executable.length).trim();\n const shortRest = rest.length > 60 ? `${rest.slice(0, 57)}...` : rest;\n return shortRest.length > 0 ? `${basename} ${shortRest}` : basename;\n}\n\n/**\n * WARN when the 1-minute load average exceeds the core count, naming the processes using the most CPU.\n *\n * Load above the core count means runnable work is queueing, which is what makes a model call's client or a coding\n * agent's subprocess miss its own deadline. Naming the processes is the point: \"the machine is busy\" sends the\n * operator to Activity Monitor, the names send them to the process.\n *\n * Windows reports a load average of 0 always (Node documents it), so there the check says it measured nothing\n * rather than passing a machine it cannot see.\n */\nexport function checkMachineLoad(probe: HostProbe = DEFAULT_HOST_PROBE): LocalPreconditionCheckResult {\n const name = 'creation host: machine load';\n if (probe.platform === 'win32') {\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: 'Not measured: Windows reports no load average.' };\n }\n const load = probe.loadAverageOneMinute();\n const cores = probe.coreCount();\n const summary = `1-minute load ${load.toFixed(2)} on ${cores} core(s)`;\n if (load <= cores) {\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: `${summary}.` };\n }\n\n const processes = probe.processes();\n const top = processes === null\n ? 'the process table could not be read'\n : [...processes]\n .filter((entry) => entry.cpuPercent > 0)\n .sort((left, right) => right.cpuPercent - left.cpuPercent)\n .slice(0, TOP_PROCESS_COUNT)\n .map((entry) => `${describeCommand(entry.command)} (pid ${entry.pid}, ${entry.cpuPercent.toFixed(0)}%)`)\n .join('; ') || 'no single process stands out';\n return {\n name,\n status: LocalPreconditionCheckStatus.WARN,\n detail: `${summary} — runnable work is queueing. Top CPU: ${top}.`,\n fix: 'Stop or wait for the processes named above before starting a run; model calls and coding agents on a '\n + 'saturated machine run slower and miss their deadlines.',\n };\n}\n\n/**\n * WARN when framework-development watchers run beside an application run.\n *\n * Two signals, because each misses a case the other sees: the compile-status heartbeat says a framework dev\n * orchestrator is alive (and is written only by one), and the process table finds `tsc-watch` processes under the\n * framework root even when the orchestrator that started them is gone. An application built from this checkout\n * consumes the engine through `file:` links, so a framework rebuild lands in its injected packages and its\n * supervised processes restart — mid-run.\n *\n * No framework checkout (an application installed from published packages) has nothing to report.\n */\nexport function checkFrameworkWatchers(\n frameworkRoot: string | null | undefined,\n probe: HostProbe = DEFAULT_HOST_PROBE,\n applicationRoot?: string | null,\n): LocalPreconditionCheckResult {\n const name = 'creation host: framework watchers';\n if (!frameworkRoot) {\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: 'No framework checkout is configured on this machine.' };\n }\n\n const statusText = probe.readFile(join(frameworkRoot, DEV_COMPILE_STATUS_RELATIVE));\n let heartbeatAgeMs: number | null = null;\n let orchestratorPid: number | null = null;\n if (statusText !== null) {\n try {\n const status = JSON.parse(statusText) as { heartbeatAt?: string; orchestratorPid?: number };\n const heartbeatMs = Date.parse(status.heartbeatAt ?? '');\n if (Number.isFinite(heartbeatMs)) heartbeatAgeMs = probe.now() - heartbeatMs;\n orchestratorPid = typeof status.orchestratorPid === 'number' ? status.orchestratorPid : null;\n } catch {\n heartbeatAgeMs = null;\n }\n }\n const orchestratorLive = heartbeatAgeMs !== null && heartbeatAgeMs <= COMPILE_STATUS_HEARTBEAT_FRESH_MS;\n\n const processes = probe.processes();\n const applicationPrefix = applicationRoot ? `${applicationRoot.replace(/\\/+$/u, '')}/` : null;\n const watchers = (processes ?? []).filter((entry) => entry.command.includes(frameworkRoot)\n && !(applicationPrefix !== null && entry.command.includes(applicationPrefix))\n && FRAMEWORK_WATCHER_COMMAND_MARKERS.some((marker) => entry.command.includes(marker)));\n\n if (!orchestratorLive && watchers.length === 0) {\n const tableNote = processes === null ? ' (the process table could not be read, so only the heartbeat was asked)' : '';\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: `No framework watchers are running${tableNote}.` };\n }\n\n const signals = [\n ...(orchestratorLive ? [`the framework dev orchestrator${orchestratorPid === null ? '' : ` (pid ${orchestratorPid})`} heartbeat is ${Math.round((heartbeatAgeMs ?? 0) / 1000)} s old`] : []),\n ...(watchers.length > 0 ? [`${watchers.length} tsc-watch process(es) run under ${frameworkRoot}`] : []),\n ];\n return {\n name,\n status: LocalPreconditionCheckStatus.WARN,\n detail: `${signals.join('; ')}. A framework rebuild reaches this application's injected packages and restarts its processes mid-run.`,\n fix: 'Stop the framework dev session before a long run — or keep it, knowing a framework edit by another session '\n + 'will interrupt the application while the run is using it.',\n };\n}\n\n/** Both host checks, in the order an operator reads them. */\nexport function collectCreationHostChecks(input: {\n frameworkRoot: string | null | undefined;\n applicationRoot?: string | null;\n probe?: HostProbe;\n}): LocalPreconditionCheckResult[] {\n const base = input.probe ?? DEFAULT_HOST_PROBE;\n // Both checks read the process table; one `ps` serves both, so the two lines describe the same instant.\n let table: { readonly value: readonly HostProcess[] | null } | undefined;\n const probe: HostProbe = { ...base, processes: () => (table ??= { value: base.processes() }).value };\n return [checkMachineLoad(probe), checkFrameworkWatchers(input.frameworkRoot, probe, input.applicationRoot)];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"creation-host-readiness.service.js","sourceRoot":"","sources":["../../../../src/services/application/creation-host-readiness.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC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,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5L,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,oCAAoC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACxG,CAAC;IACF,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,4BAA4B,CAAC,IAAI;QACzC,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wGAAwG;QACrI,GAAG,EAAE,6GAA6G;cAC9G,2DAA2D;KAChE,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,yBAAyB,CAAC,KAIzC;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,IAAI,kBAAkB,CAAC;IAC/C,wGAAwG;IACxG,IAAI,KAAoE,CAAC;IACzE,MAAM,KAAK,GAAc,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACrG,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAC9G,CAAC","sourcesContent":["/**\n * Is THIS MACHINE in a state to carry a creation run — the half of the creation preflight that reads the host\n * rather than the application (#2229).\n *\n * Both checks WARN and never FAIL. Neither mirrors a refusal: nothing in the runtime refuses to start on a busy\n * machine or beside a framework watcher. They are here because run 004 lost time to both — a machine overloaded by\n * other processes, and framework watchers whose rebuilds respawned the application's processes mid-run — and both\n * are conditions an operator may legitimately choose to live with. A WARN reports; it must not stop a run.\n */\n\nimport { execFileSync } from 'child_process';\nimport { readFileSync } from 'fs';\nimport { availableParallelism, cpus, loadavg } from 'os';\nimport { join } from 'path';\n\nimport { LocalPreconditionCheckStatus } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport type { LocalPreconditionCheckResult } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport { DEV_COMPILE_STATUS_RELATIVE } from '~wildo-cli/services/framework/dev-compile-status.paths';\n\n/** One running process, as `ps` reports it. */\nexport interface HostProcess {\n readonly pid: number;\n readonly cpuPercent: number;\n readonly command: string;\n}\n\n/**\n * The host facts these checks read, injectable so a test never probes the machine it runs on.\n *\n * `processes` is `null` when the process table could not be read (no `ps`, or Windows); the checks then say so\n * rather than reporting an empty table as \"nothing is running\".\n */\nexport interface HostProbe {\n readonly platform: NodeJS.Platform;\n readonly loadAverageOneMinute: () => number;\n readonly coreCount: () => number;\n readonly processes: () => readonly HostProcess[] | null;\n readonly readFile: (path: string) => string | null;\n readonly now: () => number;\n}\n\n/** How many processes the load warning names: enough to find the culprit, short enough to read. */\nconst TOP_PROCESS_COUNT = 5;\n\n/**\n * How old the compile-status heartbeat may be and still mean an orchestrator is running.\n *\n * `dev-compile-status.mjs` rewrites it every 5 s; a file whose heartbeat is minutes old is the record of a session\n * that ended without cleaning up, and reporting it as live watchers would send the operator after nothing.\n */\nconst COMPILE_STATUS_HEARTBEAT_FRESH_MS = 30_000;\n\n/**\n * Command-line fragments that identify a compile watcher. `tsc-watch` drives every package's watcher, and\n * `wildo-compiler-runner` is the lane wrapper it runs. A match counts as a FRAMEWORK watcher only when its command\n * names the framework root and does not name the application's root: the dogfood applications live INSIDE the\n * framework root (`examples/…`), so the root alone would count their own `wildo local dev` watchers too.\n */\nconst FRAMEWORK_WATCHER_COMMAND_MARKERS: readonly string[] = ['tsc-watch', 'wildo-compiler-runner'];\n\nfunction readProcessTable(): readonly HostProcess[] | null {\n try {\n // `-A` every process, `=` suppresses headers; `args` keeps the full command line, which the watcher check needs.\n const output = execFileSync('ps', ['-Ao', 'pid=,pcpu=,args='], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });\n return output.split('\\n').flatMap((line) => {\n const match = /^\\s*(\\d+)\\s+([\\d.]+)\\s+(.*)$/.exec(line);\n return match ? [{ pid: Number(match[1]), cpuPercent: Number(match[2]), command: match[3] }] : [];\n });\n } catch {\n return null;\n }\n}\n\nexport const DEFAULT_HOST_PROBE: HostProbe = {\n platform: process.platform,\n loadAverageOneMinute: () => loadavg()[0],\n coreCount: () => (typeof availableParallelism === 'function' ? availableParallelism() : cpus().length),\n processes: () => (process.platform === 'win32' ? null : readProcessTable()),\n readFile: (path) => {\n try {\n return readFileSync(path, 'utf8');\n } catch {\n return null;\n }\n },\n now: () => Date.now(),\n};\n\n/** The executable a command line starts with, shortened to its basename, for a line an operator reads. */\nfunction describeCommand(command: string): string {\n const executable = command.split(/\\s+/)[0] ?? command;\n const basename = executable.split('/').pop() ?? executable;\n const rest = command.slice(executable.length).trim();\n const shortRest = rest.length > 60 ? `${rest.slice(0, 57)}...` : rest;\n return shortRest.length > 0 ? `${basename} ${shortRest}` : basename;\n}\n\n/**\n * WARN when the 1-minute load average exceeds the core count, naming the processes using the most CPU.\n *\n * Load above the core count means runnable work is queueing, which is what makes a model call's client or a coding\n * agent's subprocess miss its own deadline. Naming the processes is the point: \"the machine is busy\" sends the\n * operator to Activity Monitor, the names send them to the process.\n *\n * Windows reports a load average of 0 always (Node documents it), so there the check says it measured nothing\n * rather than passing a machine it cannot see.\n */\nexport function checkMachineLoad(probe: HostProbe = DEFAULT_HOST_PROBE): LocalPreconditionCheckResult {\n const name = 'creation host: machine load';\n if (probe.platform === 'win32') {\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: 'Not measured: Windows reports no load average.' };\n }\n const load = probe.loadAverageOneMinute();\n const cores = probe.coreCount();\n const summary = `1-minute load ${load.toFixed(2)} on ${cores} core(s)`;\n if (load <= cores) {\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: `${summary}.` };\n }\n\n const processes = probe.processes();\n const top = processes === null\n ? 'the process table could not be read'\n : [...processes]\n .filter((entry) => entry.cpuPercent > 0)\n .sort((left, right) => right.cpuPercent - left.cpuPercent)\n .slice(0, TOP_PROCESS_COUNT)\n .map((entry) => `${describeCommand(entry.command)} (pid ${entry.pid}, ${entry.cpuPercent.toFixed(0)}%)`)\n .join('; ') || 'no single process stands out';\n return {\n name,\n status: LocalPreconditionCheckStatus.WARN,\n detail: `${summary} — runnable work is queueing. Top CPU: ${top}.`,\n fix: 'Stop or wait for the processes named above before starting a run; model calls and coding agents on a '\n + 'saturated machine run slower and miss their deadlines.',\n };\n}\n\n/**\n * WARN when framework-development watchers run beside an application run.\n *\n * Two signals, because each misses a case the other sees: the compile-status heartbeat says a framework dev\n * orchestrator is alive (and is written only by one), and the process table finds `tsc-watch` processes under the\n * framework root even when the orchestrator that started them is gone. An application built from this checkout\n * consumes the engine through `file:` links, so a framework rebuild lands in its injected packages and its\n * supervised processes restart — mid-run.\n *\n * No framework checkout (an application installed from published packages) has nothing to report.\n */\nexport function checkFrameworkWatchers(\n frameworkRoot: string | null | undefined,\n probe: HostProbe = DEFAULT_HOST_PROBE,\n applicationRoot?: string | null,\n): LocalPreconditionCheckResult {\n const name = 'creation host: framework watchers';\n if (!frameworkRoot) {\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: 'No framework checkout is configured on this machine.' };\n }\n\n const statusText = probe.readFile(join(frameworkRoot, DEV_COMPILE_STATUS_RELATIVE));\n let heartbeatAgeMs: number | null = null;\n let orchestratorPid: number | null = null;\n if (statusText !== null) {\n try {\n const status = JSON.parse(statusText) as { heartbeatAt?: string; orchestratorPid?: number };\n const heartbeatMs = Date.parse(status.heartbeatAt ?? '');\n if (Number.isFinite(heartbeatMs)) heartbeatAgeMs = probe.now() - heartbeatMs;\n orchestratorPid = typeof status.orchestratorPid === 'number' ? status.orchestratorPid : null;\n } catch {\n heartbeatAgeMs = null;\n }\n }\n const orchestratorLive = heartbeatAgeMs !== null && heartbeatAgeMs <= COMPILE_STATUS_HEARTBEAT_FRESH_MS;\n\n const processes = probe.processes();\n const applicationPrefix = applicationRoot ? `${applicationRoot.replace(/\\/+$/u, '')}/` : null;\n const watchers = (processes ?? []).filter((entry) => entry.command.includes(frameworkRoot)\n && !(applicationPrefix !== null && entry.command.includes(applicationPrefix))\n && FRAMEWORK_WATCHER_COMMAND_MARKERS.some((marker) => entry.command.includes(marker)));\n\n if (!orchestratorLive && watchers.length === 0) {\n const tableNote = processes === null ? ' (the process table could not be read, so only the heartbeat was asked)' : '';\n return { name, status: LocalPreconditionCheckStatus.PASS, detail: `No framework watchers are running${tableNote}.` };\n }\n\n const signals = [\n ...(orchestratorLive ? [`the framework dev orchestrator${orchestratorPid === null ? '' : ` (pid ${orchestratorPid})`} heartbeat is ${Math.round((heartbeatAgeMs ?? 0) / 1000)} s old`] : []),\n ...(watchers.length > 0 ? [`${watchers.length} tsc-watch process(es) run under ${frameworkRoot}`] : []),\n ];\n return {\n name,\n status: LocalPreconditionCheckStatus.WARN,\n detail: `${signals.join('; ')}. A framework rebuild reaches this application's injected packages and restarts its processes mid-run.`,\n fix: 'Stop the framework dev session before a long run — or keep it, knowing a framework edit by another session '\n + 'will interrupt the application while the run is using it.',\n };\n}\n\n/** Both host checks, in the order an operator reads them. */\nexport function collectCreationHostChecks(input: {\n frameworkRoot: string | null | undefined;\n applicationRoot?: string | null;\n probe?: HostProbe;\n}): LocalPreconditionCheckResult[] {\n const base = input.probe ?? DEFAULT_HOST_PROBE;\n // Both checks read the process table; one `ps` serves both, so the two lines describe the same instant.\n let table: { readonly value: readonly HostProcess[] | null } | undefined;\n const probe: HostProbe = { ...base, processes: () => (table ??= { value: base.processes() }).value };\n return [checkMachineLoad(probe), checkFrameworkWatchers(input.frameworkRoot, probe, input.applicationRoot)];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-preflight.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"creation-preflight.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/creation-preflight.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kEAAkE,CAAC;AAGrH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iEAAiE,CAAC;AACjG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,wBAAsB,8BAA8B,CAAC,KAAK,EAAE;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,OAAO,CAAC,4BAA4B,EAAE,CAAC,CAK1C;AAED,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B/H;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,4BAA4B,EAAE,GAAG,OAAO,CAE7F;AAQD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,4BAA4B,EAAE,GAAG,MAAM,EAAE,CAK/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-preflight.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"creation-preflight.service.js","sourceRoot":"","sources":["../../../../src/services/application/creation-preflight.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kEAAkE,CAAC;AAEhH,OAAO,EAAE,yCAAyC,EAAE,MAAM,wEAAwE,CAAC;AACnI,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C,MAAM,EAAE,EAAE,CAAC;QACjC,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;QAC7F,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,4BAA4B,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACnH,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * The creation preflight (#2229): can a creation run that starts now FINISH — one function, read by every surface\n * that asks.\n *\n * | surface | what it does with the result |\n * |---|---|\n * | `wildo creation preflight` | prints it, exits non-zero on a FAIL |\n * | `wildo local doctor` | prints it beside the stack checks |\n * | `wildo creation run`, `wildo creation loop` | refuses BEFORE contacting the companion on a FAIL, so nothing is spent |\n *\n * One collector is what keeps them from drifting: a check added here is asked by all three, and none of them can\n * hold a private list. The checks themselves live in two families by what they read — the application's declared\n * configuration (`application-creation-readiness.service.ts`, each mirroring a runtime refusal and able to FAIL)\n * and the host (`creation-host-readiness.service.ts`, advisory and only ever WARN).\n */\n\nimport chalk from 'chalk';\n\nimport { LocalPreconditionCheckStatus } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport type { LocalPreconditionCheckResult } from '~wildo-cli/services/deployment/local-precondition-checks.schemas';\nimport { collectApplicationCreationReadinessChecks } from '~wildo-cli/services/application/application-creation-readiness.service';\nimport { collectCreationHostChecks } from '~wildo-cli/services/application/creation-host-readiness.service';\nimport type { HostProbe } from '~wildo-cli/services/application/creation-host-readiness.service';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\n\nexport async function collectCreationPreflightChecks(input: {\n saasRoot: string;\n envName: string;\n frameworkRoot: string | null | undefined;\n hostProbe?: HostProbe;\n}): Promise<LocalPreconditionCheckResult[]> {\n return [\n ...await collectApplicationCreationReadinessChecks({ saasRoot: input.saasRoot, envName: input.envName }),\n ...collectCreationHostChecks({ frameworkRoot: input.frameworkRoot, applicationRoot: input.saasRoot, probe: input.hostProbe }),\n ];\n}\n\n/** The flag that lets an operator past a FAIL, on the two verbs that start a run. */\nexport const SKIP_PREFLIGHT_FLAG = 'skip-preflight';\n\n/**\n * Run the preflight before a verb that STARTS a creation run, and say whether the run may start.\n *\n * Called before the verb contacts the companion, so a refusal spends nothing: no brief is composed, no model is\n * called. A WARN never stops a run — it is printed and the run goes on.\n *\n * The refusal has a door, `--skip-preflight`, for the case the preflight cannot see: a key held somewhere it does\n * not look, or a run that deliberately exercises one step whose providers are fine while another step's are not.\n * The door is explicit and per invocation, and the run it lets through is still refused by the runtime at the step\n * that genuinely lacks its provider — skipping the preflight moves the refusal, it never removes it.\n */\nexport async function admitCreationRunAfterPreflight(ctx: CommandContext, verb: string, hostProbe?: HostProbe): Promise<boolean> {\n if (ctx.flags[SKIP_PREFLIGHT_FLAG] === true) {\n ctx.log.warn(`Creation preflight skipped (--${SKIP_PREFLIGHT_FLAG}); a missing provider will be refused at the step that needs it.`);\n return true;\n }\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n const envName = ctx.activeEnv?.name;\n if (!saasRoot || !envName) {\n ctx.log.error(`${verb} needs an application with an active environment to check before it starts. Run \\`wildo init\\` first.`);\n return false;\n }\n const results = await collectCreationPreflightChecks({\n saasRoot,\n envName,\n frameworkRoot: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n hostProbe,\n });\n const blocking = results.filter((result) => result.status !== LocalPreconditionCheckStatus.PASS);\n if (!hasPreflightFailure(results)) {\n for (const line of renderPreflightLines(blocking)) ctx.log.warn(line);\n return true;\n }\n ctx.log.error(`${verb} refused before starting: the creation preflight found what would stop this run.`);\n for (const line of renderPreflightLines(blocking)) ctx.log.info(line);\n ctx.log.info(chalk.dim(` Fix the FAIL lines, or pass --${SKIP_PREFLIGHT_FLAG} to start anyway. Full report: wildo creation preflight`));\n return false;\n}\n\nexport function hasPreflightFailure(results: readonly LocalPreconditionCheckResult[]): boolean {\n return results.some((result) => result.status === LocalPreconditionCheckStatus.FAIL);\n}\n\nconst STATUS_LABEL: Readonly<Record<LocalPreconditionCheckStatus, string>> = {\n [LocalPreconditionCheckStatus.PASS]: chalk.green('PASS'),\n [LocalPreconditionCheckStatus.WARN]: chalk.yellow('WARN'),\n [LocalPreconditionCheckStatus.FAIL]: chalk.red('FAIL'),\n};\n\n/**\n * One line per check — `PASS|WARN|FAIL name — detail` — and the remedy under every line that is not a PASS.\n *\n * Lines, not a table: the remedy is a sentence, and a table column wide enough for it is unreadable at 80 columns.\n */\nexport function renderPreflightLines(results: readonly LocalPreconditionCheckResult[]): string[] {\n return results.flatMap((result) => [\n `${STATUS_LABEL[result.status]} ${result.name}${result.detail ? ` — ${result.detail}` : ''}`,\n ...(result.status !== LocalPreconditionCheckStatus.PASS && result.fix ? [chalk.dim(` → ${result.fix}`)] : []),\n ]);\n}\n"]}
|
package/dist/src/services/application/degraded-registration-declaration-convergence.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"degraded-registration-declaration-convergence.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"degraded-registration-declaration-convergence.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/degraded-registration-declaration-convergence.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAClG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,EAAE,WAAW,CAAC,MAAM,CAAmC,CAAC;AAEzG,MAAM,WAAW,+CAA+C;IAC9D,GAAG,EAAE,gCAAgC,CAAC;IACtC,WAAW,EAAE,sBAAsB,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,0BAA0B,CAAC;IAC/C,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,iDAAiD;IAC5D;;;;;;OAMG;WACU,QAAQ,CAAC,KAAK,EAAE,+CAA+C,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAgDhG;;;;OAIG;mBACkB,QAAQ;CAU9B"}
|
package/dist/src/services/application/degraded-registration-declaration-convergence.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"degraded-registration-declaration-convergence.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/degraded-registration-declaration-convergence.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAG1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAI5F;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAUzG,MAAM,OAAO,iDAAiD;IAC5D;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAsD;QAC1E,IAAI,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,iDAAiD,CAAC,QAAQ,C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MAAM,YAAY,CACtG,CAAC;QACF,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YAC1C,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,OAAO,CAAC,aAAa,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAI,IAAY,EAAE,OAAe,EAAE,IAAsB;QACpF,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,EAAE,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,oBAAoB,OAAO,0EAA0E;kBACnG,mCAAmC,IAAI,YAAY,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAC7F,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * Converge the stored declaration when THIS run's registration could not.\n *\n * `POST /admin/apps/:slug/initialize` reapplies `wildo.saas.config.ts` onto the stored application\n * config on every call (`convergeStoredConfigOntoDeclaration` in apps-manager), and the bootstrap\n * postcondition (`ApplicationInitializationVerificationService`) relies on that: after a successful\n * registration, any drift is a convergence that failed to hold, and it stops the run.\n *\n * A DEGRADED registration breaks that premise. When the registration POST cannot reach\n * apps-manager the bootstrap writes runtime env from the credentials already on disk and never\n * calls `/initialize`, so nothing applied the authored declaration. The postcondition then reported\n * an ordinary edit — flipping one `engineCapabilities` boolean — as \"out of generation\" and tore down\n * `wildo local dev` (measured 2026-10-01 on app-creation-test-004, 6 of 9 starts degraded). The drift\n * was not a defect; the step that removes it had simply not run.\n *\n * So this runs the missing step, and only that step. It is the SAME projection `/initialize` would\n * have applied — `reapplyManagedDeclaration`, the one owner of the declaration projection — never a\n * second comparison. It is not a relaxation of the postcondition, which still runs afterwards and\n * still fails on anything this did not converge.\n *\n * Three refusals keep it to the case that is safe to do unattended:\n *\n * - **A non-local environment** is left alone. Applying a declaration there is a deployment act with\n * its own lane (`wildo config reapply-declaration --ci`), not a side effect of starting a process.\n * - **A slice that carries runtime principals** (`minions`, `workers`) refuses, for two different\n * reasons. A changed `minions` set makes the reapply reconcile those minions' backing-service\n * credentials (mint a new one's, revoke a removed one's), while this run has ALREADY written their\n * env from the credentials on disk — so a minion would be left holding a revoked secret, or none.\n * A new WORKER's secret is minted only by registration, which this run did not reach, so a reapply\n * could not give it one at all. Both need a start that reaches apps-manager from the beginning.\n * - **Anything else** (identity display fields, frontend services, engine capabilities, providers,\n * provider configurations, organization types, systems of record) is declaration-only: it changes\n * no credential and no infrastructure, which is the contract `config reapply-declaration` states.\n *\n * Rejected alternatives, so they are not re-derived:\n * - *Make the postcondition apply instead of preview.* It is pinned as a preview on purpose: a check\n * that repairs what it reports can never fail twice.\n * - *Prompt, or add a `--reapply-declaration` flag.* `/initialize` already applies the declaration\n * unconditionally on every non-degraded start, so asking here would make the degraded start the only\n * one that needs consent for the same write.\n * - *Retry the whole registration.* The env is already written from offline credentials by the time\n * apps-manager is seen answering; re-registering would mint a second credential generation behind it.\n */\n\nimport { WildoLocationType } from '@wildo-ai/platform-config-lib';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { AdminAppManagedDeclaration } from '@wildo-ai/platform-config-lib';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n/**\n * Stale slices whose reapply reconciles runtime-principal credentials.\n *\n * semantic-literal-boundary: these are apps-manager's `updatedFields` wire values (the declaration\n * slice names `reapplyManagedDeclaration` reports), which the response schema types as open strings.\n * They name the two declaration branches `enumerateDeclaredRuntimePrincipals` derives principals from.\n */\nexport const RUNTIME_PRINCIPAL_DECLARATION_SLICES: ReadonlySet<string> = new Set(['minions', 'workers']);\n\nexport interface DegradedRegistrationDeclarationConvergenceInput {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n appSlug: string;\n managedDeclaration: AdminAppManagedDeclaration;\n log: Logger;\n}\n\nexport class DegradedRegistrationDeclarationConvergenceService {\n /**\n * Apply the declaration-only slices a degraded registration left stale. Returns the slices applied\n * (empty when the stored config already matched, or when the environment is not local).\n *\n * @throws when a stale slice carries runtime principals — see the class JSDoc for why that cannot\n * be applied after this run's env was written.\n */\n static async converge(input: DegradedRegistrationDeclarationConvergenceInput): Promise<string[]> {\n if (input.env.locationType !== WildoLocationType.LOCAL) {\n return [];\n }\n\n const preview = await DegradedRegistrationDeclarationConvergenceService.withStep(\n 'compare it with the stored config',\n input.appSlug,\n () => AppBootstrapService.reapplyApplicationDeclaration(input.env, input.credentials, {\n appSlug: input.appSlug,\n managedDeclaration: input.managedDeclaration,\n dryRun: true,\n }),\n );\n if (preview.updatedFields.length === 0) {\n return [];\n }\n\n const principalSlices = preview.updatedFields.filter((field) => RUNTIME_PRINCIPAL_DECLARATION_SLICES.has(field));\n if (principalSlices.length > 0) {\n throw new Error(\n `The stored config for '${input.appSlug}' is behind wildo.saas.config.ts on `\n + `${preview.updatedFields.join(', ')}, and this run's registration did not reach apps-manager, so `\n + `nothing applied it. ${principalSlices.join(' and ')} change runtime principals, whose credentials `\n + 'are minted and revoked by registration — and this run has already written their env from the '\n + 'credentials on disk, so it cannot apply them. Start again with `wildo local dev` once apps-manager '\n + 'answers: registration applies the declaration and mints those credentials in the same step.',\n );\n }\n\n const applied = await DegradedRegistrationDeclarationConvergenceService.withStep(\n 'apply it to the stored config',\n input.appSlug,\n () => AppBootstrapService.reapplyApplicationDeclaration(input.env, input.credentials, {\n appSlug: input.appSlug,\n managedDeclaration: input.managedDeclaration,\n }),\n );\n input.log.info(\n ` Applied wildo.saas.config.ts to the stored config of '${input.appSlug}' (registration did not reach `\n + `apps-manager, so it had not been applied in this run) — ${applied.updatedFields.length} slice(s):`,\n );\n for (const field of applied.updatedFields) {\n input.log.info(` • ${field}`);\n }\n return applied.updatedFields;\n }\n\n /**\n * Name the step a failure came from. Before this service existed, the postcondition made the first\n * apps-manager call after a degraded registration and wrapped its error; a raw \"Unable to reach\n * apps-manager\" from here would no longer say what the start was doing when it stopped.\n */\n private static async withStep<T>(step: string, appSlug: string, call: () => Promise<T>): Promise<T> {\n try {\n return await call();\n } catch (error) {\n throw new Error(\n `Registration of '${appSlug}' did not reach apps-manager, so wildo.saas.config.ts had to be applied `\n + `separately — and the attempt to ${step} failed: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"degraded-registration-declaration-convergence.service.js","sourceRoot":"","sources":["../../../../src/services/application/degraded-registration-declaration-convergence.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAG1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAI5F;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAUzG,MAAM,OAAO,iDAAiD;IAC5D;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAsD;QAC1E,IAAI,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;YACvD,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,iDAAiD,CAAC,QAAQ,CAC9E,mCAAmC,EACnC,KAAK,CAAC,OAAO,EACb,GAAG,EAAE,CAAC,mBAAmB,CAAC,6BAA6B,CAAC,KAAK,CAAC,GAAG,E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AAC,IAAI,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,OAAO,CAAC,aAAa,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAI,IAAY,EAAE,OAAe,EAAE,IAAsB;QACpF,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,EAAE,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,oBAAoB,OAAO,0EAA0E;kBACnG,mCAAmC,IAAI,YAAY,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAC7F,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * Converge the stored declaration when THIS run's registration could not.\n *\n * `POST /admin/apps/:slug/initialize` reapplies `wildo.saas.config.ts` onto the stored application\n * config on every call (`convergeStoredConfigOntoDeclaration` in apps-manager), and the bootstrap\n * postcondition (`ApplicationInitializationVerificationService`) relies on that: after a successful\n * registration, any drift is a convergence that failed to hold, and it stops the run.\n *\n * A DEGRADED registration breaks that premise. When the registration POST cannot reach\n * apps-manager the bootstrap writes runtime env from the credentials already on disk and never\n * calls `/initialize`, so nothing applied the authored declaration. The postcondition then reported\n * an ordinary edit — flipping one `engineCapabilities` boolean — as \"out of generation\" and tore down\n * `wildo local dev` (measured 2026-10-01 on app-creation-test-004, 6 of 9 starts degraded). The drift\n * was not a defect; the step that removes it had simply not run.\n *\n * So this runs the missing step, and only that step. It is the SAME projection `/initialize` would\n * have applied — `reapplyManagedDeclaration`, the one owner of the declaration projection — never a\n * second comparison. It is not a relaxation of the postcondition, which still runs afterwards and\n * still fails on anything this did not converge.\n *\n * Three refusals keep it to the case that is safe to do unattended:\n *\n * - **A non-local environment** is left alone. Applying a declaration there is a deployment act with\n * its own lane (`wildo config reapply-declaration --ci`), not a side effect of starting a process.\n * - **A slice that carries runtime principals** (`minions`, `workers`) refuses, for two different\n * reasons. A changed `minions` set makes the reapply reconcile those minions' backing-service\n * credentials (mint a new one's, revoke a removed one's), while this run has ALREADY written their\n * env from the credentials on disk — so a minion would be left holding a revoked secret, or none.\n * A new WORKER's secret is minted only by registration, which this run did not reach, so a reapply\n * could not give it one at all. Both need a start that reaches apps-manager from the beginning.\n * - **Anything else** (identity display fields, frontend services, engine capabilities, providers,\n * provider configurations, organization types, systems of record) is declaration-only: it changes\n * no credential and no infrastructure, which is the contract `config reapply-declaration` states.\n *\n * Rejected alternatives, so they are not re-derived:\n * - *Make the postcondition apply instead of preview.* It is pinned as a preview on purpose: a check\n * that repairs what it reports can never fail twice.\n * - *Prompt, or add a `--reapply-declaration` flag.* `/initialize` already applies the declaration\n * unconditionally on every non-degraded start, so asking here would make the degraded start the only\n * one that needs consent for the same write.\n * - *Retry the whole registration.* The env is already written from offline credentials by the time\n * apps-manager is seen answering; re-registering would mint a second credential generation behind it.\n */\n\nimport { WildoLocationType } from '@wildo-ai/platform-config-lib';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { AdminAppManagedDeclaration } from '@wildo-ai/platform-config-lib';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n/**\n * Stale slices whose reapply reconciles runtime-principal credentials.\n *\n * semantic-literal-boundary: these are apps-manager's `updatedFields` wire values (the declaration\n * slice names `reapplyManagedDeclaration` reports), which the response schema types as open strings.\n * They name the two declaration branches `enumerateDeclaredRuntimePrincipals` derives principals from.\n */\nexport const RUNTIME_PRINCIPAL_DECLARATION_SLICES: ReadonlySet<string> = new Set(['minions', 'workers']);\n\nexport interface DegradedRegistrationDeclarationConvergenceInput {\n env: PlatformEnvironmentConfiguration;\n credentials: PlatformEnvSecretsJson;\n appSlug: string;\n managedDeclaration: AdminAppManagedDeclaration;\n log: Logger;\n}\n\nexport class DegradedRegistrationDeclarationConvergenceService {\n /**\n * Apply the declaration-only slices a degraded registration left stale. Returns the slices applied\n * (empty when the stored config already matched, or when the environment is not local).\n *\n * @throws when a stale slice carries runtime principals — see the class JSDoc for why that cannot\n * be applied after this run's env was written.\n */\n static async converge(input: DegradedRegistrationDeclarationConvergenceInput): Promise<string[]> {\n if (input.env.locationType !== WildoLocationType.LOCAL) {\n return [];\n }\n\n const preview = await DegradedRegistrationDeclarationConvergenceService.withStep(\n 'compare it with the stored config',\n input.appSlug,\n () => AppBootstrapService.reapplyApplicationDeclaration(input.env, input.credentials, {\n appSlug: input.appSlug,\n managedDeclaration: input.managedDeclaration,\n dryRun: true,\n }),\n );\n if (preview.updatedFields.length === 0) {\n return [];\n }\n\n const principalSlices = preview.updatedFields.filter((field) => RUNTIME_PRINCIPAL_DECLARATION_SLICES.has(field));\n if (principalSlices.length > 0) {\n throw new Error(\n `The stored config for '${input.appSlug}' is behind wildo.saas.config.ts on `\n + `${preview.updatedFields.join(', ')}, and this run's registration did not reach apps-manager, so `\n + `nothing applied it. ${principalSlices.join(' and ')} change runtime principals, whose credentials `\n + 'are minted and revoked by registration — and this run has already written their env from the '\n + 'credentials on disk, so it cannot apply them. Start again with `wildo local dev` once apps-manager '\n + 'answers: registration applies the declaration and mints those credentials in the same step.',\n );\n }\n\n const applied = await DegradedRegistrationDeclarationConvergenceService.withStep(\n 'apply it to the stored config',\n input.appSlug,\n () => AppBootstrapService.reapplyApplicationDeclaration(input.env, input.credentials, {\n appSlug: input.appSlug,\n managedDeclaration: input.managedDeclaration,\n }),\n );\n input.log.info(\n ` Applied wildo.saas.config.ts to the stored config of '${input.appSlug}' (registration did not reach `\n + `apps-manager, so it had not been applied in this run) — ${applied.updatedFields.length} slice(s):`,\n );\n for (const field of applied.updatedFields) {\n input.log.info(` • ${field}`);\n }\n return applied.updatedFields;\n }\n\n /**\n * Name the step a failure came from. Before this service existed, the postcondition made the first\n * apps-manager call after a degraded registration and wrapped its error; a raw \"Unable to reach\n * apps-manager\" from here would no longer say what the start was doing when it stopped.\n */\n private static async withStep<T>(step: string, appSlug: string, call: () => Promise<T>): Promise<T> {\n try {\n return await call();\n } catch (error) {\n throw new Error(\n `Registration of '${appSlug}' did not reach apps-manager, so wildo.saas.config.ts had to be applied `\n + `separately — and the attempt to ${step} failed: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-orchestrator.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"dev-orchestrator.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/dev-orchestrator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAqBD,eAAO,MAAM,sBAAsB;mCACF,MAAM,mBAAmB,MAAM,GAAG,MAAM;0BAkBjD,MAAM,GAAG,SAAS;qBAYjB,MAAM,OAAO,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;oBA4BvC,MAAM,WAAW,aAAa,OAAO,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAmGpF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-orchestrator.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/dev-orchestrator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,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AAe,KAAK,QAAQ,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC;oBAClE,OAAO,CAAC,GAAG,CAAC,CAAC;oBACb,OAAO;gBACT,CAAC;gBAED,IAAI,eAAe,KAAK,SAAS,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC;oBACnE,OAAO,CAAC,GAAG,CAAC,CAAC;oBACb,OAAO;gBACT,CAAC;gBAED,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACxB,OAAO,CAAC,GAAG,CAAC,CAAC;oBACb,OAAO;gBACT,CAAC;gBAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,OAAO,CAAC,GAAG,CAAC,CAAC;oBACb,OAAO;gBACT,CAAC;gBAED,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxB,qBAAqB,EAAE,CAAC;gBACxB,IAAI,UAAU,CAAC,OAAO,CAAC;oBAAE,UAAU,CAAC,OAAO,CAAC,CAAC;gBAC7C,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC","sourcesContent":["/**\n * DevOrchestratorService — spawn and track the local dev process.\n *\n * Current scope:\n * - resolve the runnable script from a package.json in the chosen working directory\n * - start the process with inherited stdio\n * - track the PID from the resolved scoped root so stop commands can target the\n * same app/workspace anchor that launched the dev process\n *\n * This service does NOT yet perform preflight orchestration like env sync or app registration.\n * Those steps belong to higher-level command orchestration.\n */\n\nimport { existsSync, readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { SpawnUtils } from '~wildo-cli/infrastructure/process/spawn.utils';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\n\nexport interface DevRunOptions {\n envName?: string;\n /** Directory from which the dev command should be executed. Defaults to the scoped root. */\n workingDirectory?: string;\n /** Explicit script override. When absent, package.json scripts.dev is used if available. */\n script?: string;\n}\n\nexport interface DevStatus {\n running: boolean;\n pid?: number;\n}\n\nfunction getPidPath(scopedRoot: string): string {\n return EnvironmentPaths.devPidPath(scopedRoot);\n}\n\nfunction sanitizeNodeOptionsForChildRuntime(\n current: string | undefined,\n): string | undefined {\n if (!current) {\n return undefined;\n }\n\n const sanitized = current\n .replace(/(^|\\s)--conditions(?:=|\\s+)source(?=\\s|$)/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return sanitized.length > 0 ? sanitized : '';\n}\n\nexport const DevOrchestratorService = {\n getDevScript(workingDirectory: string, explicitScript?: string): string {\n if (explicitScript) {\n return explicitScript;\n }\n\n const pkgPath = join(workingDirectory, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const dev = pkg.scripts?.dev;\n if (typeof dev === 'string') return dev;\n } catch {\n // fall through\n }\n }\n return 'pnpm dev';\n },\n\n getStatus(scopedRoot: string): DevStatus {\n const pidPath = getPidPath(scopedRoot);\n if (!existsSync(pidPath)) return { running: false };\n try {\n const pid = parseInt(readFileSync(pidPath, 'utf-8').trim(), 10);\n if (Number.isNaN(pid)) return { running: false };\n return { running: SpawnUtils.isProcessRunning(pid), pid };\n } catch {\n return { running: false };\n }\n },\n\n async stop(scopedRoot: string, log: Logger): Promise<boolean> {\n const status = DevOrchestratorService.getStatus(scopedRoot);\n const pidPath = getPidPath(scopedRoot);\n if (!status.running || status.pid === undefined) {\n if (existsSync(pidPath)) unlinkSync(pidPath);\n log.info('Dev process is not running');\n return true;\n }\n try {\n await SpawnUtils.terminateProcessTree(status.pid, {\n gracefulSignal: 'SIGTERM',\n forceSignal: 'SIGKILL',\n timeoutMs: 10_000,\n });\n if (existsSync(pidPath)) unlinkSync(pidPath);\n log.success('Dev process stopped');\n return true;\n } catch (err) {\n if (!SpawnUtils.isProcessRunning(status.pid)) {\n if (existsSync(pidPath)) unlinkSync(pidPath);\n log.info('Dev process was not running (stale PID file removed)');\n return true;\n }\n log.error(`Failed to stop: ${ErrorUtils.extractErrorMessage(err)}`);\n return false;\n }\n },\n\n async run(scopedRoot: string, options: DevRunOptions, log: Logger): Promise<number> {\n const workingDirectory = options.workingDirectory ?? scopedRoot;\n const script = DevOrchestratorService.getDevScript(workingDirectory, options.script);\n log.info(` Running: ${script}\\n`);\n\n const parts = script.split(/\\s+/);\n const cmd = parts[0] ?? 'pnpm';\n const args = parts.slice(1);\n const finalArgs = args.length > 0 ? args : (cmd === 'pnpm' ? ['dev'] : cmd === 'npm' ? ['run', 'dev'] : []);\n\n const needsShell = script.includes('*') || script.includes('||') || script.includes('&&');\n const sanitizedNodeOptions = sanitizeNodeOptionsForChildRuntime(process.env.NODE_OPTIONS);\n const envOverrides =\n sanitizedNodeOptions !== process.env.NODE_OPTIONS\n ? { NODE_OPTIONS: sanitizedNodeOptions ?? '' }\n : undefined;\n const child = SpawnUtils.spawnWithEnv(cmd, finalArgs, {\n cwd: workingDirectory,\n env: envOverrides,\n inheritStdio: true,\n shell: needsShell,\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n const pidPath = getPidPath(scopedRoot);\n const pidDir = dirname(pidPath);\n if (child.pid) {\n if (!existsSync(pidDir)) mkdirSync(pidDir, { recursive: true });\n writeFileSync(pidPath, String(child.pid), 'utf-8');\n }\n\n return new Promise<number>((resolve, reject) => {\n let forwardedSignal: NodeJS.Signals | null = null;\n let isForwardingShutdown = false;\n\n const cleanupSignalHandlers = (): void => {\n process.off('SIGINT', onSigint);\n process.off('SIGTERM', onSigterm);\n };\n\n const forwardShutdown = (signal: NodeJS.Signals): void => {\n if (isForwardingShutdown || !child.pid) {\n return;\n }\n\n isForwardingShutdown = true;\n forwardedSignal = signal;\n void SpawnUtils.terminateProcessTree(child.pid, {\n gracefulSignal: signal,\n forceSignal: 'SIGKILL',\n timeoutMs: 10_000,\n }).catch(() => {\n // The close/error handlers below remain the source of truth for completion.\n });\n };\n\n const onSigint = (): void => {\n forwardShutdown('SIGINT');\n };\n\n const onSigterm = (): void => {\n forwardShutdown('SIGTERM');\n };\n\n process.on('SIGINT', onSigint);\n process.on('SIGTERM', onSigterm);\n\n child.on('close', (code, signal) => {\n cleanupSignalHandlers();\n if (existsSync(pidPath)) unlinkSync(pidPath);\n if (forwardedSignal === 'SIGINT' && (code === null || code === 0)) {\n resolve(130);\n return;\n }\n\n if (forwardedSignal === 'SIGTERM' && (code === null || code === 0)) {\n resolve(143);\n return;\n }\n\n if (signal === 'SIGINT') {\n resolve(130);\n return;\n }\n\n if (signal === 'SIGTERM') {\n resolve(143);\n return;\n }\n\n resolve(code ?? 0);\n });\n child.on('error', (err) => {\n cleanupSignalHandlers();\n if (existsSync(pidPath)) unlinkSync(pidPath);\n reject(err);\n });\n });\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"dev-orchestrator.service.js","sourceRoot":"","sources":["../../../../src/services/application/dev-orchestrator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAe7F,SAAS,UAAU,CAAC,UAAkB;IACpC,OAAO,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACjD,C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AAC;oBACb,OAAO;gBACT,CAAC;gBAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,OAAO,CAAC,GAAG,CAAC,CAAC;oBACb,OAAO;gBACT,CAAC;gBAED,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxB,qBAAqB,EAAE,CAAC;gBACxB,IAAI,UAAU,CAAC,OAAO,CAAC;oBAAE,UAAU,CAAC,OAAO,CAAC,CAAC;gBAC7C,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC","sourcesContent":["/**\n * DevOrchestratorService — spawn and track the local dev process.\n *\n * Current scope:\n * - resolve the runnable script from a package.json in the chosen working directory\n * - start the process with inherited stdio\n * - track the PID from the resolved scoped root so stop commands can target the\n * same app/workspace anchor that launched the dev process\n *\n * This service does NOT yet perform preflight orchestration like env sync or app registration.\n * Those steps belong to higher-level command orchestration.\n */\n\nimport { existsSync, readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { SpawnUtils } from '~wildo-cli/infrastructure/process/spawn.utils';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { Logger } from '~wildo-cli/kernel/types';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\n\nexport interface DevRunOptions {\n envName?: string;\n /** Directory from which the dev command should be executed. Defaults to the scoped root. */\n workingDirectory?: string;\n /** Explicit script override. When absent, package.json scripts.dev is used if available. */\n script?: string;\n}\n\nexport interface DevStatus {\n running: boolean;\n pid?: number;\n}\n\nfunction getPidPath(scopedRoot: string): string {\n return EnvironmentPaths.devPidPath(scopedRoot);\n}\n\nfunction sanitizeNodeOptionsForChildRuntime(\n current: string | undefined,\n): string | undefined {\n if (!current) {\n return undefined;\n }\n\n const sanitized = current\n .replace(/(^|\\s)--conditions(?:=|\\s+)source(?=\\s|$)/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n return sanitized.length > 0 ? sanitized : '';\n}\n\nexport const DevOrchestratorService = {\n getDevScript(workingDirectory: string, explicitScript?: string): string {\n if (explicitScript) {\n return explicitScript;\n }\n\n const pkgPath = join(workingDirectory, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const dev = pkg.scripts?.dev;\n if (typeof dev === 'string') return dev;\n } catch {\n // fall through\n }\n }\n return 'pnpm dev';\n },\n\n getStatus(scopedRoot: string): DevStatus {\n const pidPath = getPidPath(scopedRoot);\n if (!existsSync(pidPath)) return { running: false };\n try {\n const pid = parseInt(readFileSync(pidPath, 'utf-8').trim(), 10);\n if (Number.isNaN(pid)) return { running: false };\n return { running: SpawnUtils.isProcessRunning(pid), pid };\n } catch {\n return { running: false };\n }\n },\n\n async stop(scopedRoot: string, log: Logger): Promise<boolean> {\n const status = DevOrchestratorService.getStatus(scopedRoot);\n const pidPath = getPidPath(scopedRoot);\n if (!status.running || status.pid === undefined) {\n if (existsSync(pidPath)) unlinkSync(pidPath);\n log.info('Dev process is not running');\n return true;\n }\n try {\n await SpawnUtils.terminateProcessTree(status.pid, {\n gracefulSignal: 'SIGTERM',\n forceSignal: 'SIGKILL',\n timeoutMs: 10_000,\n });\n if (existsSync(pidPath)) unlinkSync(pidPath);\n log.success('Dev process stopped');\n return true;\n } catch (err) {\n if (!SpawnUtils.isProcessRunning(status.pid)) {\n if (existsSync(pidPath)) unlinkSync(pidPath);\n log.info('Dev process was not running (stale PID file removed)');\n return true;\n }\n log.error(`Failed to stop: ${ErrorUtils.extractErrorMessage(err)}`);\n return false;\n }\n },\n\n async run(scopedRoot: string, options: DevRunOptions, log: Logger): Promise<number> {\n const workingDirectory = options.workingDirectory ?? scopedRoot;\n const script = DevOrchestratorService.getDevScript(workingDirectory, options.script);\n log.info(` Running: ${script}\\n`);\n\n const parts = script.split(/\\s+/);\n const cmd = parts[0] ?? 'pnpm';\n const args = parts.slice(1);\n const finalArgs = args.length > 0 ? args : (cmd === 'pnpm' ? ['dev'] : cmd === 'npm' ? ['run', 'dev'] : []);\n\n const needsShell = script.includes('*') || script.includes('||') || script.includes('&&');\n const sanitizedNodeOptions = sanitizeNodeOptionsForChildRuntime(process.env.NODE_OPTIONS);\n const envOverrides =\n sanitizedNodeOptions !== process.env.NODE_OPTIONS\n ? { NODE_OPTIONS: sanitizedNodeOptions ?? '' }\n : undefined;\n const child = SpawnUtils.spawnWithEnv(cmd, finalArgs, {\n cwd: workingDirectory,\n env: envOverrides,\n inheritStdio: true,\n shell: needsShell,\n detached: SpawnUtils.shouldUseProcessGroups(),\n });\n\n const pidPath = getPidPath(scopedRoot);\n const pidDir = dirname(pidPath);\n if (child.pid) {\n if (!existsSync(pidDir)) mkdirSync(pidDir, { recursive: true });\n writeFileSync(pidPath, String(child.pid), 'utf-8');\n }\n\n return new Promise<number>((resolve, reject) => {\n let forwardedSignal: NodeJS.Signals | null = null;\n let isForwardingShutdown = false;\n\n const cleanupSignalHandlers = (): void => {\n process.off('SIGINT', onSigint);\n process.off('SIGTERM', onSigterm);\n };\n\n const forwardShutdown = (signal: NodeJS.Signals): void => {\n if (isForwardingShutdown || !child.pid) {\n return;\n }\n\n isForwardingShutdown = true;\n forwardedSignal = signal;\n void SpawnUtils.terminateProcessTree(child.pid, {\n gracefulSignal: signal,\n forceSignal: 'SIGKILL',\n timeoutMs: 10_000,\n }).catch(() => {\n // The close/error handlers below remain the source of truth for completion.\n });\n };\n\n const onSigint = (): void => {\n forwardShutdown('SIGINT');\n };\n\n const onSigterm = (): void => {\n forwardShutdown('SIGTERM');\n };\n\n process.on('SIGINT', onSigint);\n process.on('SIGTERM', onSigterm);\n\n child.on('close', (code, signal) => {\n cleanupSignalHandlers();\n if (existsSync(pidPath)) unlinkSync(pidPath);\n if (forwardedSignal === 'SIGINT' && (code === null || code === 0)) {\n resolve(130);\n return;\n }\n\n if (forwardedSignal === 'SIGTERM' && (code === null || code === 0)) {\n resolve(143);\n return;\n }\n\n if (signal === 'SIGINT') {\n resolve(130);\n return;\n }\n\n if (signal === 'SIGTERM') {\n resolve(143);\n return;\n }\n\n resolve(code ?? 0);\n });\n child.on('error', (err) => {\n cleanupSignalHandlers();\n if (existsSync(pidPath)) unlinkSync(pidPath);\n reject(err);\n });\n });\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-schema-drift.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"dev-schema-drift.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/dev-schema-drift.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAaH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAS9D,iFAAiF;AACjF,oBAAY,qBAAqB;IAC/B,sGAAsG;IACtG,WAAW,gBAAgB;IAC3B,gGAAgG;IAChG,OAAO,YAAY;IACnB,sGAAsG;IACtG,mBAAmB,wBAAwB;IAC3C,8EAA8E;IAC9E,yBAAyB,8BAA8B;IACvD,qFAAqF;IACrF,qBAAqB,0BAA0B;IAC/C,qGAAqG;IACrG,sBAAsB,2BAA2B;IACjD,0EAA0E;IAC1E,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAcD;;;;;;;GAOG;AACH,wBAAsB,+BAA+B,CAAC,KAAK,EAAE;IAC3D,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAuGhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-schema-drift.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/dev-schema-drift.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AAExG,iFAAiF;AACjF,MAAM,CAAN,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B,sGAAsG;IACtG,oDAA2B,CAAA;IAC3B,gGAAgG;IAChG,4CAAmB,CAAA;IACnB,sGAAsG;IACtG,oEAA2C,CAAA;IAC3C,8EAA8E;IAC9E,gFAAuD,CAAA;IACvD,qFAAqF;IACrF,wEAA+C,CAAA;IAC/C,qGAAqG;IACrG,0EAAiD,CAAA;IACjD,0EAA0E;IAC1E,4CAAmB,CAAA;AACrB,CAAC,EAfW,qBAAqB,KAArB,qBAAqB,QAehC;AAWD,sGAAsG;AACtG,SAAS,kBAAkB,CAAC,GAAS;IACnC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAA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E,eAAe,CAAC,KAAK,OAAO,CAAC,MAAM,mBAAmB;cAC3G,eAAe,MAAM,CAAC,YAAY,uEAAuE;KAC9G,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The DEVELOPMENT door of the migration system: notice schema drift while a human is present.\n *\n * ## The gap this closes\n *\n * Applying migrations has always been automatic — `applyStartupPostgresMigrations` runs at every\n * boot, and `applyAppSchemaMigrations` covers the first install. GENERATING them was CLI-only, and\n * nothing in the local loop ever ran it. So adding a resource produced this sequence: the developer\n * starts the stack, every service comes up, and the backend then dies at the physical-schema gate\n * with `table \"…\" does not exist (no migration has created it)` — an accurate message that names\n * neither `wildo db generate` nor the fact that a migration was ever owed. Measured 2026-08-28 on\n * `knowledgeDocuments`; the diagnosis cost far more than the fix.\n *\n * ## Why this is not simply \"generate at startup\"\n *\n * Two reasons the door is narrow rather than automatic-in-all-cases:\n *\n * 1. **The model is a BUILD ARTIFACT.** The plan is computed by importing\n * `backend-api/dist/modules-registry.backend.js`, and under `wildo local dev` the watchers that\n * maintain it have not started yet. Generating from a stale dist would author a migration for a\n * model nobody has — silently, into the source tree, and then apply it. A wrong migration applied\n * is strictly worse than the crash this exists to prevent, so a stale artifact SKIPS\n * (see `.claude/rules/staleness-presents-as-a-logic-defect.md`).\n * 2. **Only a SAFE change set may be applied unattended.** A `DESTRUCTIVE` change destroys rows and\n * the runner refuses it without a written acknowledgement; a `REQUIRES_DATA_MIGRATION` change is\n * a generated SKELETON whose own comments say it needs review. Applying either on the developer's\n * behalf would make this door the thing that loses their data. Those sets are still GENERATED —\n * having the draft is the useful half — and the start then stops so a human reads it.\n *\n * This mirrors what the ecosystem settled on: a development-only generate-and-apply step, run from\n * the tooling, that stops and asks whenever the change set is not trivially safe. Production keeps\n * the apply-only boot door, and nothing here ever runs there.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { join } from 'path';\nimport {\n diffSchemaPlanLockfiles,\n parseSchemaPlanLockfile,\n renderMigrationSql,\n SchemaPlanChangeRisk,\n type SchemaPlanChange,\n type SchemaPlanLockfile,\n} from '@wildo-ai/saas-backend-lib';\nimport { describeCaughtError } from '@wildo-ai/saas-models';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport {\n assessCompiledModelCurrency,\n computeCurrentLockfileJson,\n LOCKFILE_RELATIVE_PATH,\n MIGRATIONS_RELATIVE_DIR,\n} from '~wildo-cli/commands/db/db-schema-plan.utils';\nimport { applyAppSchemaMigrations } from '~wildo-cli/services/application/app-schema-bootstrap.service';\n\n/** What the door decided. Every value is reported; only some stop the caller. */\nexport enum DevSchemaDriftOutcome {\n /** No migrations directory or no committed lockfile — this application has not adopted migrations. */\n NOT_ADOPTED = 'NOT_ADOPTED',\n /** The model matches the accepted plan. The overwhelmingly common case, and it says nothing. */\n IN_SYNC = 'IN_SYNC',\n /** The compiled model is older than its sources; generating from it would author yesterday's plan. */\n SKIPPED_STALE_MODEL = 'SKIPPED_STALE_MODEL',\n /** The model could not be computed at all (no dist, or the runner failed). */\n SKIPPED_MODEL_UNAVAILABLE = 'SKIPPED_MODEL_UNAVAILABLE',\n /** Drift exists, every change is SAFE, and the migration was written AND applied. */\n GENERATED_AND_APPLIED = 'GENERATED_AND_APPLIED',\n /** The draft was written, and deliberately NOT applied — it needs a human before it touches data. */\n GENERATED_NEEDS_REVIEW = 'GENERATED_NEEDS_REVIEW',\n /** Nothing was written: the change set is one only a human may author. */\n REFUSED = 'REFUSED',\n}\n\nexport interface DevSchemaDriftReport {\n outcome: DevSchemaDriftOutcome;\n /** One sentence for the operator. Empty for {@link DevSchemaDriftOutcome.IN_SYNC}. */\n message: string;\n /** The migration folder written, when one was. */\n migrationFolder?: string;\n changeCount?: number;\n}\n\n/** `20260828T145718` — the same spelling `wildo db generate` uses, so the two doors sort together. */\nfunction migrationTimestamp(now: Date): string {\n return now.toISOString().replace(/[-:]/g, '').replace(/\\..+$/, '');\n}\n\nfunction summarizeRisk(changes: readonly SchemaPlanChange[]): { destructive: number; dataMigration: number } {\n return {\n destructive: changes.filter((change) => change.risk === SchemaPlanChangeRisk.DESTRUCTIVE).length,\n dataMigration: changes.filter((change) => change.risk === SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION).length,\n };\n}\n\n/**\n * Reconcile the application's PostgreSQL schema with its model, for a LOCAL development start.\n *\n * Never throws for a drift decision — every outcome is reported, and the caller decides which ones\n * stop the start. Throwing would make an advisory check able to break a stack over a diagnosis.\n *\n * @param appliedBy recorded in the migration ledger; forensic value only.\n */\nexport async function reconcileDevelopmentSchemaDrift(input: {\n ctx: CommandContext;\n saasRoot: string;\n envName: string;\n appliedBy: string;\n log?: (message: string) => void;\n}): Promise<DevSchemaDriftReport> {\n const { ctx, saasRoot } = input;\n\n const migrationsDirectory = join(saasRoot, MIGRATIONS_RELATIVE_DIR);\n const lockfilePath = join(saasRoot, LOCKFILE_RELATIVE_PATH);\n if (!existsSync(migrationsDirectory) || !existsSync(lockfilePath)) {\n return { outcome: DevSchemaDriftOutcome.NOT_ADOPTED, message: '' };\n }\n\n if (!assessCompiledModelCurrency(saasRoot).current) {\n return {\n outcome: DevSchemaDriftOutcome.SKIPPED_STALE_MODEL,\n message:\n 'Schema-drift check SKIPPED: backend-api/dist is older than the sources it is built from, so the model '\n + 'it describes is not the one you edited. Nothing was generated — a migration authored from a stale '\n + 'artifact is worse than none. Once the watchers have caught up, run `wildo db diff` to check.',\n };\n }\n\n const currentJson = computeCurrentLockfileJson(ctx, saasRoot);\n if (currentJson === undefined) {\n return {\n outcome: DevSchemaDriftOutcome.SKIPPED_MODEL_UNAVAILABLE,\n message: 'Schema-drift check SKIPPED: the current schema plan could not be computed (see the error above).',\n };\n }\n\n // `parseSchemaPlanLockfile` is a STRICT parse over the JSON TEXT — an unknown key anywhere\n // refuses, which is what stops a hand-edited lockfile from silently widening the accepted plan.\n const current: SchemaPlanLockfile = parseSchemaPlanLockfile(currentJson);\n const accepted: SchemaPlanLockfile = parseSchemaPlanLockfile(readFileSync(lockfilePath, 'utf-8'));\n\n /**\n * An ENGINE upgrade, not application drift — the mapping rules changed, so the diff is full of\n * changes nobody authored. `wildo db generate` has a deliberate door for it\n * (`--accept-planner-contract`) precisely because a human must choose between realizing the\n * physical consequences and absorbing a baseline. This door does not get to choose for them.\n */\n if (accepted.plannerContractVersion !== current.plannerContractVersion) {\n return {\n outcome: DevSchemaDriftOutcome.REFUSED,\n message:\n `Planner contract mismatch (lockfile ${accepted.plannerContractVersion}, engine ${current.plannerContractVersion}) — `\n + 'an ENGINE upgrade event, not application drift, and the choice between realizing it as a migration and '\n + 'absorbing the baseline is yours. Run `wildo db generate --accept-planner-contract --name engine-upgrade`, '\n + 'or `wildo db diff --update-lockfile` if the bump changed nothing physical for this application.',\n };\n }\n\n const changes = diffSchemaPlanLockfiles(accepted, current);\n if (changes.length === 0) return { outcome: DevSchemaDriftOutcome.IN_SYNC, message: '' };\n\n let migrationSql: string;\n try {\n migrationSql = renderMigrationSql({ changes, previous: accepted, next: current });\n } catch (error) {\n // A primary-key MOVE or DROP. The renderer's own reasoning is the remedy — surface it verbatim.\n return {\n outcome: DevSchemaDriftOutcome.REFUSED,\n message: `${describeCaughtError(error)}\\n Nothing was written.`,\n changeCount: changes.length,\n };\n }\n\n const folderName = `${migrationTimestamp(new Date())}_dev-auto`;\n const migrationDir = join(migrationsDirectory, folderName);\n mkdirSync(migrationDir, { recursive: true });\n writeFileSync(join(migrationDir, 'migration.sql'), migrationSql);\n // Written in the SAME step, exactly as `wildo db generate` does: a migration without the advanced\n // lockfile (or the reverse) is the two-artifact drift the whole design exists to prevent.\n writeFileSync(lockfilePath, currentJson);\n\n const relativeFolder = join(MIGRATIONS_RELATIVE_DIR, folderName);\n const { destructive, dataMigration } = summarizeRisk(changes);\n if (destructive > 0 || dataMigration > 0) {\n return {\n outcome: DevSchemaDriftOutcome.GENERATED_NEEDS_REVIEW,\n migrationFolder: relativeFolder,\n changeCount: changes.length,\n message:\n `Wrote ${join(relativeFolder, 'migration.sql')} (${changes.length} change(s)) and did NOT apply it: `\n + `${destructive} destructive and ${dataMigration} data-migration change(s) need you to read them first. `\n + 'A destructive migration also needs its acknowledgement annotation (the instructions are in the file). '\n + 'Review it, then `wildo db migrate`.',\n };\n }\n\n const report = await applyAppSchemaMigrations({\n envName: input.envName,\n saasRoot,\n appliedBy: input.appliedBy,\n reportMissing: (message) => input.log?.(` ${message}`),\n log: input.log,\n });\n\n return {\n outcome: DevSchemaDriftOutcome.GENERATED_AND_APPLIED,\n migrationFolder: relativeFolder,\n changeCount: changes.length,\n message:\n `Schema drift reconciled: wrote ${join(relativeFolder, 'migration.sql')} (${changes.length} SAFE change(s)) `\n + `and applied ${report.appliedCount} migration(s). Commit the migration folder AND the lockfile together.`,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dev-schema-drift.service.js","sourceRoot":"","sources":["../../../../src/services/application/dev-schema-drift.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AAExG,iFAAiF;AACjF,MAAM,CAAN,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B,sGAAsG;IACtG,oDAA2B,CAAA;IAC3B,gGAAgG;IAChG,4CAAmB,CAAA;IACnB,sGAAsG;IACtG,oEAA2C,CAAA;IAC3C,8EAA8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E,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;QACvD,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,qBAAqB,CAAC,qBAAqB;QACpD,eAAe,EAAE,cAAc;QAC/B,WAAW,EAAE,OAAO,CAAC,MAAM;QAC3B,OAAO,EACL,kCAAkC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,KAAK,OAAO,CAAC,MAAM,mBAAmB;cAC3G,eAAe,MAAM,CAAC,YAAY,uEAAuE;KAC9G,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The DEVELOPMENT door of the migration system: notice schema drift while a human is present.\n *\n * ## The gap this closes\n *\n * Applying migrations has always been automatic — `applyStartupPostgresMigrations` runs at every\n * boot, and `applyAppSchemaMigrations` covers the first install. GENERATING them was CLI-only, and\n * nothing in the local loop ever ran it. So adding a resource produced this sequence: the developer\n * starts the stack, every service comes up, and the backend then dies at the physical-schema gate\n * with `table \"…\" does not exist (no migration has created it)` — an accurate message that names\n * neither `wildo db generate` nor the fact that a migration was ever owed. Measured 2026-08-28 on\n * `knowledgeDocuments`; the diagnosis cost far more than the fix.\n *\n * ## Why this is not simply \"generate at startup\"\n *\n * Two reasons the door is narrow rather than automatic-in-all-cases:\n *\n * 1. **The model is a BUILD ARTIFACT.** The plan is computed by importing\n * `backend-api/dist/modules-registry.backend.js`, and under `wildo local dev` the watchers that\n * maintain it have not started yet. Generating from a stale dist would author a migration for a\n * model nobody has — silently, into the source tree, and then apply it. A wrong migration applied\n * is strictly worse than the crash this exists to prevent, so a stale artifact SKIPS\n * (see `.claude/rules/staleness-presents-as-a-logic-defect.md`).\n * 2. **Only a SAFE change set may be applied unattended.** A `DESTRUCTIVE` change destroys rows and\n * the runner refuses it without a written acknowledgement; a `REQUIRES_DATA_MIGRATION` change is\n * a generated SKELETON whose own comments say it needs review. Applying either on the developer's\n * behalf would make this door the thing that loses their data. Those sets are still GENERATED —\n * having the draft is the useful half — and the start then stops so a human reads it.\n *\n * This mirrors what the ecosystem settled on: a development-only generate-and-apply step, run from\n * the tooling, that stops and asks whenever the change set is not trivially safe. Production keeps\n * the apply-only boot door, and nothing here ever runs there.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { join } from 'path';\nimport {\n diffSchemaPlanLockfiles,\n parseSchemaPlanLockfile,\n renderMigrationSql,\n SchemaPlanChangeRisk,\n type SchemaPlanChange,\n type SchemaPlanLockfile,\n} from '@wildo-ai/saas-backend-lib';\nimport { describeCaughtError } from '@wildo-ai/saas-models';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport {\n assessCompiledModelCurrency,\n computeCurrentLockfileJson,\n LOCKFILE_RELATIVE_PATH,\n MIGRATIONS_RELATIVE_DIR,\n} from '~wildo-cli/commands/db/db-schema-plan.utils';\nimport { applyAppSchemaMigrations } from '~wildo-cli/services/application/app-schema-bootstrap.service';\n\n/** What the door decided. Every value is reported; only some stop the caller. */\nexport enum DevSchemaDriftOutcome {\n /** No migrations directory or no committed lockfile — this application has not adopted migrations. */\n NOT_ADOPTED = 'NOT_ADOPTED',\n /** The model matches the accepted plan. The overwhelmingly common case, and it says nothing. */\n IN_SYNC = 'IN_SYNC',\n /** The compiled model is older than its sources; generating from it would author yesterday's plan. */\n SKIPPED_STALE_MODEL = 'SKIPPED_STALE_MODEL',\n /** The model could not be computed at all (no dist, or the runner failed). */\n SKIPPED_MODEL_UNAVAILABLE = 'SKIPPED_MODEL_UNAVAILABLE',\n /** Drift exists, every change is SAFE, and the migration was written AND applied. */\n GENERATED_AND_APPLIED = 'GENERATED_AND_APPLIED',\n /** The draft was written, and deliberately NOT applied — it needs a human before it touches data. */\n GENERATED_NEEDS_REVIEW = 'GENERATED_NEEDS_REVIEW',\n /** Nothing was written: the change set is one only a human may author. */\n REFUSED = 'REFUSED',\n}\n\nexport interface DevSchemaDriftReport {\n outcome: DevSchemaDriftOutcome;\n /** One sentence for the operator. Empty for {@link DevSchemaDriftOutcome.IN_SYNC}. */\n message: string;\n /** The migration folder written, when one was. */\n migrationFolder?: string;\n changeCount?: number;\n}\n\n/** `20260828T145718` — the same spelling `wildo db generate` uses, so the two doors sort together. */\nfunction migrationTimestamp(now: Date): string {\n return now.toISOString().replace(/[-:]/g, '').replace(/\\..+$/, '');\n}\n\nfunction summarizeRisk(changes: readonly SchemaPlanChange[]): { destructive: number; dataMigration: number } {\n return {\n destructive: changes.filter((change) => change.risk === SchemaPlanChangeRisk.DESTRUCTIVE).length,\n dataMigration: changes.filter((change) => change.risk === SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION).length,\n };\n}\n\n/**\n * Reconcile the application's PostgreSQL schema with its model, for a LOCAL development start.\n *\n * Never throws for a drift decision — every outcome is reported, and the caller decides which ones\n * stop the start. Throwing would make an advisory check able to break a stack over a diagnosis.\n *\n * @param appliedBy recorded in the migration ledger; forensic value only.\n */\nexport async function reconcileDevelopmentSchemaDrift(input: {\n ctx: CommandContext;\n saasRoot: string;\n envName: string;\n appliedBy: string;\n log?: (message: string) => void;\n}): Promise<DevSchemaDriftReport> {\n const { ctx, saasRoot } = input;\n\n const migrationsDirectory = join(saasRoot, MIGRATIONS_RELATIVE_DIR);\n const lockfilePath = join(saasRoot, LOCKFILE_RELATIVE_PATH);\n if (!existsSync(migrationsDirectory) || !existsSync(lockfilePath)) {\n return { outcome: DevSchemaDriftOutcome.NOT_ADOPTED, message: '' };\n }\n\n if (!assessCompiledModelCurrency(saasRoot).current) {\n return {\n outcome: DevSchemaDriftOutcome.SKIPPED_STALE_MODEL,\n message:\n 'Schema-drift check SKIPPED: backend-api/dist is older than the sources it is built from, so the model '\n + 'it describes is not the one you edited. Nothing was generated — a migration authored from a stale '\n + 'artifact is worse than none. Once the watchers have caught up, run `wildo db diff` to check.',\n };\n }\n\n const currentJson = computeCurrentLockfileJson(ctx, saasRoot);\n if (currentJson === undefined) {\n return {\n outcome: DevSchemaDriftOutcome.SKIPPED_MODEL_UNAVAILABLE,\n message: 'Schema-drift check SKIPPED: the current schema plan could not be computed (see the error above).',\n };\n }\n\n // `parseSchemaPlanLockfile` is a STRICT parse over the JSON TEXT — an unknown key anywhere\n // refuses, which is what stops a hand-edited lockfile from silently widening the accepted plan.\n const current: SchemaPlanLockfile = parseSchemaPlanLockfile(currentJson);\n const accepted: SchemaPlanLockfile = parseSchemaPlanLockfile(readFileSync(lockfilePath, 'utf-8'));\n\n /**\n * An ENGINE upgrade, not application drift — the mapping rules changed, so the diff is full of\n * changes nobody authored. `wildo db generate` has a deliberate door for it\n * (`--accept-planner-contract`) precisely because a human must choose between realizing the\n * physical consequences and absorbing a baseline. This door does not get to choose for them.\n */\n if (accepted.plannerContractVersion !== current.plannerContractVersion) {\n return {\n outcome: DevSchemaDriftOutcome.REFUSED,\n message:\n `Planner contract mismatch (lockfile ${accepted.plannerContractVersion}, engine ${current.plannerContractVersion}) — `\n + 'an ENGINE upgrade event, not application drift, and the choice between realizing it as a migration and '\n + 'absorbing the baseline is yours. Run `wildo db generate --accept-planner-contract --name engine-upgrade`, '\n + 'or `wildo db diff --update-lockfile` if the bump changed nothing physical for this application.',\n };\n }\n\n const changes = diffSchemaPlanLockfiles(accepted, current);\n if (changes.length === 0) return { outcome: DevSchemaDriftOutcome.IN_SYNC, message: '' };\n\n let migrationSql: string;\n try {\n migrationSql = renderMigrationSql({ changes, previous: accepted, next: current });\n } catch (error) {\n // A primary-key MOVE or DROP. The renderer's own reasoning is the remedy — surface it verbatim.\n return {\n outcome: DevSchemaDriftOutcome.REFUSED,\n message: `${describeCaughtError(error)}\\n Nothing was written.`,\n changeCount: changes.length,\n };\n }\n\n const folderName = `${migrationTimestamp(new Date())}_dev-auto`;\n const migrationDir = join(migrationsDirectory, folderName);\n mkdirSync(migrationDir, { recursive: true });\n writeFileSync(join(migrationDir, 'migration.sql'), migrationSql);\n // Written in the SAME step, exactly as `wildo db generate` does: a migration without the advanced\n // lockfile (or the reverse) is the two-artifact drift the whole design exists to prevent.\n writeFileSync(lockfilePath, currentJson);\n\n const relativeFolder = join(MIGRATIONS_RELATIVE_DIR, folderName);\n const { destructive, dataMigration } = summarizeRisk(changes);\n if (destructive > 0 || dataMigration > 0) {\n return {\n outcome: DevSchemaDriftOutcome.GENERATED_NEEDS_REVIEW,\n migrationFolder: relativeFolder,\n changeCount: changes.length,\n message:\n `Wrote ${join(relativeFolder, 'migration.sql')} (${changes.length} change(s)) and did NOT apply it: `\n + `${destructive} destructive and ${dataMigration} data-migration change(s) need you to read them first. `\n + 'A destructive migration also needs its acknowledgement annotation (the instructions are in the file). '\n + 'Review it, then `wildo db migrate`.',\n };\n }\n\n const report = await applyAppSchemaMigrations({\n envName: input.envName,\n saasRoot,\n appliedBy: input.appliedBy,\n reportMissing: (message) => input.log?.(` ${message}`),\n log: input.log,\n });\n\n return {\n outcome: DevSchemaDriftOutcome.GENERATED_AND_APPLIED,\n migrationFolder: relativeFolder,\n changeCount: changes.length,\n message:\n `Schema drift reconciled: wrote ${join(relativeFolder, 'migration.sql')} (${changes.length} SAFE change(s)) `\n + `and applied ${report.appliedCount} migration(s). Commit the migration folder AND the lockfile together.`,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-provider-configurations.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"environment-provider-configurations.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/environment-provider-configurations.service.ts"],"names":[],"mappings":"AAIA,KAAK,2BAA2B,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;AAE3G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,wCAAwC,CAAC,KAAK,EAAE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAC3E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,CAU/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-provider-configurations.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"environment-provider-configurations.service.js","sourceRoot":"","sources":["../../../../src/services/application/environment-provider-configurations.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AAIzG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAAC,KAI9D;IACC,0BAA0B,CAAC,KAAK,CAAC,iCAAiC,EAAE,sBAAsB,CAAC,CAAC;IAC5F,IAAI,KAAK,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;QACnC,OAAO,wCAAwC,CAAC,KAAK,CAAC,iCAAiC,EAAE,SAAS,CAAC,CAAC;IACtG,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzF,MAAM,iCAAiC,GAAG,QAAQ,EAAE,MAAM,CAAC,sBAAsB,CAAC;IAClF,0BAA0B,CAAC,iCAAiC,EAAE,QAAQ,EAAE,IAAI,IAAI,kBAAkB,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IAC3H,OAAO,wCAAwC,CAAC,KAAK,CAAC,iCAAiC,EAAE,iCAAiC,CAAC,CAAC;AAC9H,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,0BAA0B,CAAC,KAA8C,EAAE,MAAc;IAChG,K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wildo-ai/platform-config-lib';\nimport { getComposedProviderEntry } from '~wildo-cli/services/credentials/composed-provider-catalogue';\nimport { loadAuthoredInfraEnvConfig } from '~wildo-cli/services/environment/authored-infra-config.utils';\n\ntype ProviderConfigurationsLayer = Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n\n/**\n * The provider configuration an application runs with IN ONE ENVIRONMENT — the single door both environment-aware\n * producers go through.\n *\n * Two things carry a provider configuration out of the CLI, and before this existed both used\n * `wildo.saas.config.ts > providerConfigurations` verbatim, so every environment received one environment's values:\n *\n * | producer | consumer |\n * |---|---|\n * | the managed declaration (`AppRuntimeTargetsService.resolve`) | each environment's apps-manager, then the backend: OAuth2 client IDs, email/SMS senders, the provider registry |\n * | the provider runtime artifacts (`syncProviderRuntimeArtifactsForApp`) | baked into builds: frontend `publicConfig`, the backend's generated provider module |\n *\n * Both call this with the environment they are producing for, so the two cannot disagree about which value an\n * environment has.\n *\n * `environmentName: null` is a deliberate answer, not an omission: the caller produces nothing environment-bound (a\n * validation that reads only the services list). It yields the application layer alone.\n *\n * An environment with no authored `wildo.infra.<env>.config.ts` states no override, so it runs with the application\n * layer — the same reading every other per-environment block gets when absent.\n */\nexport async function resolveEnvironmentProviderConfigurations(input: {\n saasRoot: string;\n applicationProviderConfigurations: ProviderConfigurationsLayer | undefined;\n environmentName: string | null;\n}): Promise<Record<string, Record<string, unknown> | undefined>> {\n assertNoProviderSecretKeys(input.applicationProviderConfigurations, 'wildo.saas.config.ts');\n if (input.environmentName === null) {\n return overlayEnvironmentProviderConfigurations(input.applicationProviderConfigurations, undefined);\n }\n\n const authored = await loadAuthoredInfraEnvConfig(input.environmentName, input.saasRoot);\n const environmentProviderConfigurations = authored?.config.providerConfigurations;\n assertNoProviderSecretKeys(environmentProviderConfigurations, authored?.path ?? `infrastructure/${input.environmentName}`);\n return overlayEnvironmentProviderConfigurations(input.applicationProviderConfigurations, environmentProviderConfigurations);\n}\n\n/**\n * Refuse a provider configuration key named like one of that provider's declared secrets.\n *\n * Both files carrying provider configuration are committed, and the key a leak would use is exactly the one an author\n * reaches for when a client ID and its client secret sit side by side in the vendor console\n * (`GOOGLE_OAUTH2_CLIENT_ID` → `GOOGLE_OAUTH2_CLIENT_SECRET`). The secret has one home, `secrets.json → providerEnv`,\n * and a value written here would be committed while the runtime kept reading the env var — a leak that also does\n * nothing.\n *\n * Matched on the secret's ENVIRONMENT-VARIABLE name only, from the composed provider catalogue — the same authority\n * the env writers use. Not on its contract slug: slugs are generic (`apiKey`), and a frontend SDK legitimately takes a\n * PUBLIC key under that same name (PostHog's `phc_` project key in `frontend_sdk.apiKey`), so a slug match would refuse\n * a correct configuration. The env-var name is the precise signal: it is exactly what an author copies out of the\n * secrets file. A provider the catalogue does not yet know (an application-owned package before discovery) is checked\n * on the call that runs after discovery — `syncProviderRuntimeArtifactsForApp` registers contributions before it\n * resolves — so `wildo config sync` covers it.\n */\nfunction assertNoProviderSecretKeys(layer: ProviderConfigurationsLayer | undefined, source: string): void {\n for (const [providerRef, protocols] of Object.entries(layer ?? {})) {\n const secrets = getComposedProviderEntry(providerRef)?.secrets ?? [];\n if (secrets.length === 0 || !protocols) continue;\n const secretNames = new Set(secrets.map((secret) => secret.envVarName));\n for (const [protocolKind, values] of Object.entries(protocols)) {\n if (!values || typeof values !== 'object' || Array.isArray(values)) continue;\n const leaked = Object.keys(values).filter((key) => secretNames.has(key));\n if (leaked.length > 0) {\n throw new Error(\n `${source}: providerConfigurations.${providerRef}.${protocolKind} names ${leaked.map((key) => `\"${key}\"`).join(', ')}, `\n + `which ${leaked.length === 1 ? 'is a secret' : 'are secrets'} of provider \"${providerRef}\". Secrets belong in `\n + '`infrastructure/<env>/secrets/secrets.json → providerEnv`, never in a committed configuration file.',\n );\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"existing-app-bootstrap.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"existing-app-bootstrap.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/existing-app-bootstrap.service.ts"],"names":[],"mappings":"AAiEA;;;;;;;;;GASG;AACH,qBAAa,2BAA2B;WACzB,sBAAsB,CACjC,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,OAAO,CAAC,IAAI,CAAC;IAgEhB,OAAO,CAAC,MAAM,CAAC,uBAAuB;mBAkHjB,6BAA6B;IA+ClD;;;;;;;;OAQG;mBACkB,kBAAkB;CAMxC"}
|