@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":"module-registration.service.js","sourceRoot":"","sources":["../../../../../../src/services/registry/module-registration.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,iCAAiC,EACjC,kCAAkC,EAClC,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,iBAAiB,GAGlB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,EAC3B,UAAU,EACV,0B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AO,EAAE,MAAM,EAAE,CAAC;IACpG,CAAC;AACH,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,2BAA2B,CAAC,QAAgB,EAAE,SAA0C;IACtG,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE;QAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnG,CAAC","sourcesContent":["/**\n * Registering an installed registry module in its host application — and unregistering it (#1755).\n *\n * `wildo registry add` copies a module's files. Registration is what makes the application KNOW the\n * module: the shared, specifications and frontend registries and `wildo.saas.config.ts >\n * applicationModules`. Without it the backend discovers `backend-api/src/modules/<dir>` by directory\n * scan while every other layer ignores the module — live on one side, unknown on the other.\n *\n * ## One source for \"how a module is registered\"\n *\n * The framework's `add-module` composition scenario already declares those edits (its `edits` block),\n * and `wildo compose add-module` applies them to a module it scaffolds. Installation reuses the SAME\n * edit steps — the application's delivered copy of the scenario, else the framework's — with the\n * scenario's CREATE steps stripped (the module's files arrive from the artifact, not from templates).\n * No second copy of the registry anchors exists here.\n *\n * ## Why the manifest carries no code\n *\n * The edits render code into the host's own files. A manifest that carried edit TEXT could append\n * anything to `wildo.saas.config.ts`. It carries only the module directory (`moduleId`), the camelCase stem the\n * scenario names entries from (`moduleCamel`) and, for a partial module, the layers it covers — the\n * identifiers restricted to identifier alphabets, and the stem the one DERIVED from the directory, so a\n * registration cannot name another module's entries. Anything else a scenario needs (the services a module\n * binds to) is derived here from those values.\n *\n * ## Derived at publish, never authored\n *\n * `wildo registry publish` plans the same edits against the PUBLISHING application. If every one is\n * already present there, the module demonstrably is registered there and the registration is\n * recorded; otherwise it is left out and the reason reported.\n *\n * ## A registration is applied only where nothing is there yet\n *\n * On a fresh install, if the host ALREADY has any of the registration's entries, the directory is the\n * host's own and install does not take it over: the module is installed and MARKED as not registered.\n * That is what keeps `remove` honest — it reverses only a registration install actually made, so it does\n * not delete an entry the application wrote itself (`application-creation-directive.md`: mark, don't\n * block).\n *\n * One exception, by design (#2014 review): a provider's SCOPE (`config-property-add`) is the application's\n * once it exists, because binding capabilities there is how an application uses the provider. A scope\n * already present never blocks an install and is left as written; `remove` takes a scope out only while it\n * still says exactly what the install writes (see `reverseEdit`).\n *\n * ## The three shapes (#1755, #1773)\n *\n * - a DOMAIN module replays `add-module` — all four layers, or a SUBSET that includes the backend or the\n * frontend: only the edits targeting its layers run, and its `applicationModules` entry is bound to\n * exactly the services its layers provide (derived here, never read from the manifest);\n * - a MINION replays `add-minion`, a WORKER `add-worker-node` — their bucket entry, provider scope and\n * pnpm workspace member. Their scenarios' other variables (package name, port, display strings) only\n * feed the files a scenario creates, which the artifact supplies instead, so the edits need the\n * directory and the stem alone.\n *\n * Anything else — a mixed artifact, a shared+specifications-only module (no service to bind it to) —\n * installs with the gap marked.\n */\n\nimport { join } from 'node:path';\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport ts from 'typescript';\nimport {\n applyCompositionScenarioPlan,\n CompositionScenarioEditKind,\n createCompositionTemplateRenderer,\n listCompositionScenarioDirectories,\n loadCompositionScenario,\n planCompositionScenario,\n removeBracedListEntry,\n readConfigObjectPropertyText,\n removeConfigObjectProperty,\n unwrapInitializer,\n type CompositionScenario,\n type CompositionScenarioEdit,\n} from '@wildo-ai/application-creation-runtime';\nimport {\n DOMAIN_MODULE_LAYERS,\n DomainModuleLayer,\n MODULE_BOUNDARY_LAYER_ROOTS,\n ModuleKind,\n ModuleRegistrationScenario,\n type ModuleBoundaryLayer,\n type ModuleManifest,\n type ModuleManifestRegistration,\n} from '@wildo-ai/platform-config-lib';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { deriveProviderWiring, providerWiringScenario } from './provider-wiring.service';\n\nconst renderer = createCompositionTemplateRenderer();\n\n/** A directory that does not exist, so a scenario plan carries its EDIT steps and no file creations. */\nconst NO_FILES_DIRECTORY = '__registry-install-edits-only__';\n\n/** The only edit kinds registration can undo — see {@link reverseEdit}. */\nconst REVERSIBLE_EDIT_KINDS: ReadonlySet<string> = new Set([\n CompositionScenarioEditKind.TS_IMPORT_ADD,\n CompositionScenarioEditKind.TS_ARRAY_APPEND,\n CompositionScenarioEditKind.TS_OBJECT_APPEND,\n CompositionScenarioEditKind.APPEND_LINE,\n // #2014: the provider wiring's dependency and scope.\n CompositionScenarioEditKind.PACKAGE_DEPENDENCY_ADD,\n CompositionScenarioEditKind.CONFIG_PROPERTY_ADD,\n]);\n\n/**\n * The service each service-bearing layer binds its module to in `applicationModules`, in the order the\n * `add-module` scenario's default writes them (`'backendApi', 'app'`) — so a whole module registered by\n * install renders the SAME entry `wildo compose` scaffolds. Shared and specifications bind no service.\n */\nconst SERVICE_BINDINGS: ReadonlyArray<readonly [DomainModuleLayer, string]> = [\n [DomainModuleLayer.BACKEND, 'backendApi'],\n [DomainModuleLayer.FRONTEND, 'app'],\n];\n\n/** The application config file, whose `applicationModules` entry every module shape is bound through. */\nconst SAAS_CONFIG_FILE = 'wildo.saas.config.ts';\n\n/** The directory of the application a domain layer's registry edits target (the `add-module` edit files). */\nconst EDIT_ROOT_OF_LAYER: Partial<Record<DomainModuleLayer, string>> = {\n [DomainModuleLayer.SHARED]: 'shared-lib/',\n [DomainModuleLayer.SPECIFICATIONS]: 'specifications/',\n [DomainModuleLayer.FRONTEND]: 'frontend/',\n};\n\n/**\n * The ONLY variables a registration supplies to each scenario, derived from the registration — never\n * read from the manifest beyond its two identifiers. A scenario reading any other is refused, because the\n * renderer would render it empty and write broken code.\n */\nfunction registrationVariables(registration: ModuleManifestRegistration): Record<string, string> {\n switch (registration.scenario) {\n case ModuleRegistrationScenario.ADD_MODULE: {\n const layers = registration.layers ?? DOMAIN_MODULE_LAYERS;\n const services = SERVICE_BINDINGS.filter(([layer]) => layers.includes(layer)).map(([, service]) => service);\n return { moduleId: registration.moduleId, moduleCamel: registration.moduleCamel, moduleServices: services.map((service) => `'${service}'`).join(', ') };\n }\n case ModuleRegistrationScenario.ADD_MINION:\n return { minionDir: registration.moduleId, minionCamel: registration.moduleCamel };\n case ModuleRegistrationScenario.ADD_WORKER_NODE:\n return { workerDir: registration.moduleId, workerCamel: registration.moduleCamel };\n case ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE:\n // Its edits are built already rendered, from the recorded wiring (`providerWiringScenario`).\n return {};\n }\n}\n\n/** The two shapes of registry anchor an entry is removed from. */\nenum RegistryAnchorShape {\n ARRAY = 'array',\n OBJECT = 'object',\n}\n\n/**\n * The registration's scenario as visible from this application, reduced to the edits the registration\n * covers and with its file-creation tree removed — the delivered copy wins over the framework's, like\n * `wildo compose`.\n *\n * FAIL-CLOSED on its edits, BEFORE anything is written: an edit kind this module cannot undo, a variable\n * a registration does not carry, or — for a layer subset — a delivered `add-module` copy whose\n * `applicationModules` entry still hard-codes both services (it predates #1773 and would bind the module\n * to a service it does not provide).\n */\nexport function loadRegistrationScenario(saasRoot: string, frameworkRoot: string | null, registration: ModuleManifestRegistration): CompositionScenario {\n if (registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE) {\n // #2014: no scenario directory — the wiring the installer recorded IS the edit list.\n return providerWiringScenario(saasRoot, registration.moduleId, registration.providerWiring!);\n }\n const ref = registration.scenario;\n const directory = listCompositionScenarioDirectories({ applicationRoot: saasRoot, frameworkRoot }).get(ref);\n if (!directory) {\n throw new Error(\n `No '${ref}' composition scenario is visible from ${saasRoot} — run the framework asset sync `\n + '(it delivers .wildo-saas/templates/scenarios) before installing or publishing a registered module.',\n );\n }\n const scenario = loadCompositionScenario(directory);\n const allowed = new Set(Object.keys(registrationVariables(registration)));\n let edits = scenario.manifest.edits ?? [];\n for (const edit of edits) {\n if (!REVERSIBLE_EDIT_KINDS.has(edit.kind)) {\n throw new Error(`The '${ref}' scenario at ${directory} uses edit kind '${edit.kind}', which registration cannot reverse.`);\n }\n for (const match of JSON.stringify(edit).matchAll(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g)) {\n if (!allowed.has(match[1]!)) {\n throw new Error(`The '${ref}' scenario at ${directory} reads variable '${match[1]}', which a registration does not carry.`);\n }\n }\n }\n if (registration.scenario === ModuleRegistrationScenario.ADD_MODULE && registration.layers !== undefined) {\n const layers = registration.layers;\n // Keep the edits of the covered layers, and the config entry (the schema guarantees a service to bind).\n edits = edits.filter((edit) => {\n const layer = DOMAIN_MODULE_LAYERS.find((candidate) => EDIT_ROOT_OF_LAYER[candidate] !== undefined && edit.file.startsWith(EDIT_ROOT_OF_LAYER[candidate]!));\n if (layer !== undefined) return layers.includes(layer);\n // Fail closed on an edit no layer owns (#1773 review): replaying it for a subset would register the\n // module in a place its files never reach. The config entry is the one such edit, and it is bound\n // to exactly the covered services.\n if (edit.file === SAAS_CONFIG_FILE) return true;\n throw new Error(\n `The '${ref}' scenario at ${directory} edits ${edit.file}, which no module layer owns, so it cannot register a module covering only ${layers.join(', ')}.`,\n );\n });\n const configEdit = edits.find((edit) => edit.kind === CompositionScenarioEditKind.TS_OBJECT_APPEND);\n if (configEdit && !JSON.stringify(configEdit).includes('moduleServices')) {\n throw new Error(\n `The '${ref}' scenario at ${directory} binds every module to both services, so it cannot register a module covering `\n + `only ${layers.join(', ')} — run the framework asset sync to deliver the current scenario.`,\n );\n }\n }\n return { ...scenario, manifest: { ...scenario.manifest, edits }, filesDirectory: join(scenario.scenarioDirectory, NO_FILES_DIRECTORY) };\n}\n\n/** The camelCase stem a scenario names entries from — derived from the directory for every shape. */\nexport function moduleCamelFromDirectory(moduleId: string): string {\n return moduleId.replace(/-([a-z0-9])/g, (_m, c: string) => c.toUpperCase());\n}\n\n/**\n * A registration must name entries for the directory it registers and no other: the stem is DERIVED from\n * the directory. Checked at install and at removal (the lockfile is hand-editable), because a mismatched\n * stem makes the edits reach entries belonging to another module.\n */\nfunction assertRegistrationIsSelfConsistent(registration: ModuleManifestRegistration): void {\n if (registration.moduleCamel !== moduleCamelFromDirectory(registration.moduleId)) {\n throw new Error(\n `Refusing registration for '${registration.moduleId}': its moduleCamel '${registration.moduleCamel}' is not the one derived `\n + `from the directory ('${moduleCamelFromDirectory(registration.moduleId)}'). Nothing was changed.`,\n );\n }\n}\n\n/** The registration shape an artifact's boundaries describe: scenario, directory and (for a subset) layers. */\nexport type RegistrationShape = Pick<ModuleManifestRegistration, 'scenario' | 'moduleId' | 'layers'>;\n\n/** The single directory `<root>/<dir>` a boundary layer names, or why it names no single one. */\nfunction singleDirectory(manifest: ModuleManifest, layer: ModuleBoundaryLayer): { dir: string } | { reason: string } {\n const entries = manifest.boundaries?.[layer] ?? [];\n const root = `${MODULE_BOUNDARY_LAYER_ROOTS[layer]}/`;\n if (entries.length !== 1 || !entries[0]!.startsWith(root) || entries[0]!.slice(root.length).includes('/')) {\n return { reason: `boundaries.${layer} must be exactly one directory \\`${root}<dir>\\` (found ${JSON.stringify(entries)})` };\n }\n return { dir: entries[0]!.slice(root.length) };\n}\n\n/**\n * The registration shape an artifact installs, read from its boundaries — or why it has none:\n * - only `minions` → a minion; only `workers` → a worker;\n * - only domain layers, each exactly one directory and all the SAME directory → a domain module\n * (`layers` set when not all four, and refused unless it includes the backend or the frontend);\n * - anything else (a mix, several directories) → no registration.\n */\nexport function registrationShapeFromBoundaries(manifest: ModuleManifest): RegistrationShape | { reason: string } {\n const present = (Object.keys(MODULE_BOUNDARY_LAYER_ROOTS) as ModuleBoundaryLayer[])\n .filter((layer) => (manifest.boundaries?.[layer] ?? []).length > 0);\n // A provider package (#2014) is never registered from its manifest: its owners are the INSTALLING\n // application's, so the installer derives its wiring (`deriveProviderRegistration`). The manifest schema\n // already refuses `providers/` beside any other layer; this keeps the rule true for an unparsed manifest.\n if (present.includes('providers')) {\n return { reason: 'a provider package is wired by each installing application, never by its publisher (#2014)' };\n }\n const packageShapes: Array<[ModuleBoundaryLayer, ModuleRegistrationScenario]> = [\n ['minions', ModuleRegistrationScenario.ADD_MINION],\n ['workers', ModuleRegistrationScenario.ADD_WORKER_NODE],\n ];\n for (const [layer, scenario] of packageShapes) {\n if (!present.includes(layer)) continue;\n if (present.length !== 1) return { reason: `a ${layer.slice(0, -1)} is registered on its own, but this artifact also covers ${present.filter((p) => p !== layer).join(', ')}` };\n const directory = singleDirectory(manifest, layer);\n return 'reason' in directory ? directory : { scenario, moduleId: directory.dir };\n }\n const layers = DOMAIN_MODULE_LAYERS.filter((layer) => present.includes(layer));\n if (layers.length === 0) return { reason: 'the artifact declares no boundaries to register' };\n const directories = new Set<string>();\n for (const layer of layers) {\n const directory = singleDirectory(manifest, layer);\n if ('reason' in directory) return directory;\n directories.add(directory.dir);\n }\n if (directories.size !== 1) return { reason: `its layers name different module directories (${[...directories].join(', ')})` };\n if (!layers.includes(DomainModuleLayer.BACKEND) && !layers.includes(DomainModuleLayer.FRONTEND)) {\n return { reason: `it covers only ${layers.join(', ')}; an application module is bound to the backend or the frontend, so there is nothing to bind it to` };\n }\n return {\n scenario: ModuleRegistrationScenario.ADD_MODULE,\n moduleId: [...directories][0]!,\n ...(layers.length < DOMAIN_MODULE_LAYERS.length ? { layers } : {}),\n };\n}\n\nfunction sameShape(a: RegistrationShape, b: RegistrationShape): boolean {\n return a.scenario === b.scenario && a.moduleId === b.moduleId && (a.layers ?? []).join(',') === (b.layers ?? []).join(',');\n}\n\n/**\n * How the host holds an object-anchor entry a registration names, judged by the entry's KEY (#1773 review).\n *\n * A bucket entry is configuration the operator is EXPECTED to edit after install: a minion is scaffolded\n * with a deny-all `resourceAccess` and no providers, so every working minion carries an entry that no\n * longer matches its rendered text. Judged by text, such an entry was a \"different value\" conflict — the\n * publisher could never record a registration and removal silently left it behind. The key is the\n * module's runtime identity (derived from its directory), and where the entry carries a `path`, that path\n * names the package the key belongs to.\n *\n * What key-only matching gives up, stated rather than implied (#1773 re-review R10): an entry with no\n * `path` — the domain module's `applicationModules` entry, `'<id>': { services: [...] }` — is judged by\n * its key alone, so publish no longer compares its `services` binding with the artifact's layers. The\n * per-layer registry edits still must all be present, which is what catches a layer mismatch; a host\n * that rebinds services after install keeps its binding, which is the point of the change.\n */\nenum KeyedEntryState {\n /** No property with the entry's key. */\n ABSENT = 'absent',\n /** The key is there and belongs to this module: its `path` (when the entry has one) names this directory. */\n HELD = 'held',\n /** The key is there and its `path` names another directory: a different package owns that identity. */\n FOREIGN = 'foreign',\n /**\n * The key is there and its `path` cannot be read without evaluating code — a shorthand property, a\n * variable, a helper call. Treated as refusal like FOREIGN (fail closed), but reported as what it is:\n * the registry cannot tell whose it is, not that it is someone else's (#1773 re-review R9).\n */\n UNDETERMINED = 'undetermined',\n}\n\n/** A property name as the key it denotes: `billing`, `'billing'` and `\"billing\"` are one key. */\nfunction propertyKey(name: ts.PropertyName): string | undefined {\n if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)) return name.text;\n return undefined;\n}\n\n/** The string value of the `path` property of an object-literal value, when it has one. */\nfunction pathOfValue(value: ts.Expression | undefined): string | undefined {\n if (!value) return undefined;\n const literal = unwrapInitializer(value);\n if (!ts.isObjectLiteralExpression(literal)) return undefined;\n for (const property of literal.properties) {\n if (ts.isPropertyAssignment(property) && propertyKey(property.name) === 'path' && ts.isStringLiteralLike(property.initializer)) {\n return property.initializer.text;\n }\n }\n return undefined;\n}\n\n/** The key (and `path`, when present) a rendered `key: value` entry declares. */\nfunction objectEntryIdentity(entryText: string): { key: string; path?: string } {\n const sourceFile = ts.createSourceFile('entry.ts', `({${entryText}})`, ts.ScriptTarget.Latest, true);\n const statement = sourceFile.statements[0];\n const literal = statement && ts.isExpressionStatement(statement) ? unwrapInitializer(statement.expression) : undefined;\n const property = literal && ts.isObjectLiteralExpression(literal) && literal.properties.length === 1 ? literal.properties[0] : undefined;\n const key = property && ts.isPropertyAssignment(property) ? propertyKey(property.name) : undefined;\n if (!property || !ts.isPropertyAssignment(property) || key === undefined) {\n throw new Error(`registration cannot identify the object entry \\`${entryText}\\` by a key`);\n }\n const path = pathOfValue(property.initializer);\n return { key, ...(path !== undefined ? { path } : {}) };\n}\n\n/** The top-level `const <variableName> = [...] | {...}` literal of a file, as a source file and literal. */\nfunction findAnchorLiteral(content: string, fileName: string, variableName: string): { sourceFile: ts.SourceFile; literal: ts.Expression } | undefined {\n const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true);\n for (const statement of sourceFile.statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === variableName && declaration.initializer) {\n return { sourceFile, literal: unwrapInitializer(declaration.initializer) };\n }\n }\n }\n return undefined;\n}\n\n/** The property of the anchor object carrying `key`, if any. */\nfunction findKeyedProperty(literal: ts.Expression, key: string): ts.ObjectLiteralElementLike | undefined {\n if (!ts.isObjectLiteralExpression(literal)) return undefined;\n return literal.properties.find((property) =>\n (ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property)) && propertyKey(property.name) === key);\n}\n\n/** How the host holds the entry an object-append `edit` would write, rendered with `variables`. */\nfunction keyedEntryState(saasRoot: string, edit: CompositionScenarioEdit, variables: Record<string, string>): { state: KeyedEntryState; label: string } {\n const targetRelative = renderer.render(edit.file, variables);\n const objectName = renderer.render(edit.exportedObject!, variables);\n const identity = objectEntryIdentity(renderer.render(edit.entry!, variables).trim());\n const label = `${targetRelative} > ${objectName}.${identity.key}`;\n let content: string;\n try {\n content = readFileSync(join(saasRoot, targetRelative), 'utf8');\n } catch {\n return { state: KeyedEntryState.ABSENT, label };\n }\n const anchor = findAnchorLiteral(content, targetRelative, objectName);\n const property = anchor ? findKeyedProperty(anchor.literal, identity.key) : undefined;\n if (!property) return { state: KeyedEntryState.ABSENT, label };\n if (identity.path === undefined) return { state: KeyedEntryState.HELD, label };\n const heldPath = ts.isPropertyAssignment(property) ? pathOfValue(property.initializer) : undefined;\n if (heldPath === undefined) return { state: KeyedEntryState.UNDETERMINED, label };\n return { state: normalisePath(heldPath) === normalisePath(identity.path) ? KeyedEntryState.HELD : KeyedEntryState.FOREIGN, label: `${label} (path '${heldPath}')` };\n}\n\nfunction normalisePath(path: string | undefined): string | undefined {\n return path?.replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\n/**\n * A `config-property-add` step's property in the host: its label, and its text when present.\n *\n * The property a provider install adds is its SCOPE (`providers.scopes.<runtime>.providers.<ref>`), and a scope is the\n * APPLICATION's once it exists (#2014 review): it is where the application binds engine capabilities, and it may\n * predate the install (an application that scoped a catalogue provider before adopting the registry copy). So an\n * install only guarantees the key is PRESENT — one already there, whatever it says, is left as it is — and a remove\n * takes it out only while it still says exactly what the install wrote.\n */\nfunction configPropertyState(saasRoot: string, edit: CompositionScenarioEdit, variables: Record<string, string>): { label: string; path: string[]; text?: string } {\n const targetRelative = renderer.render(edit.file, variables);\n const path = (edit.configPath ?? []).map((segment) => renderer.render(segment, variables));\n const label = `${targetRelative} > ${path.join('.')}`;\n let content: string;\n try {\n content = readFileSync(join(saasRoot, targetRelative), 'utf8');\n } catch {\n return { label, path };\n }\n const text = readConfigObjectPropertyText({ filePath: targetRelative, content, target: { path } });\n return text === undefined ? { label, path } : { label, path, text };\n}\n\n/**\n * The identity of one edit step, rendered: two registrations share a step exactly when they would write the same\n * thing to the same place. Used to move a provider's wiring from one derivation to the next step by step (#2014\n * review), rather than by undoing all of it and writing it again, which is what reset a bound scope to empty.\n */\nfunction editIdentity(edit: CompositionScenarioEdit, variables: Record<string, string>): string {\n const render = (value: string | undefined) => (value === undefined ? '' : renderer.render(value, variables));\n return JSON.stringify([\n edit.kind,\n render(edit.file),\n render(edit.line),\n render(edit.statement),\n render(edit.element),\n render(edit.entry),\n (edit.configPath ?? []).map(render),\n Object.entries(edit.entries ?? {}).map(([name, specifier]) => [render(name), render(specifier)]),\n ]);\n}\n\n/**\n * The registration's edits planned against the host, with every object entry the host already HOLDS by key\n * taken out of the plan (present, however it has been edited since) and every FOREIGN one reported.\n */\nfunction planRegistrationEdits(saasRoot: string, frameworkRoot: string | null, registration: ModuleManifestRegistration) {\n const scenario = loadRegistrationScenario(saasRoot, frameworkRoot, registration);\n const variables = registrationVariables(registration);\n const held: string[] = [];\n const unowned: string[] = [];\n const applicationOwned: string[] = [];\n const edits = (scenario.manifest.edits ?? []).filter((edit) => {\n if (edit.kind === CompositionScenarioEditKind.CONFIG_PROPERTY_ADD) {\n // Present, whatever it says: the application's. See `configPropertyState`.\n const { label, text } = configPropertyState(saasRoot, edit, variables);\n if (text !== undefined) applicationOwned.push(label);\n return text === undefined;\n }\n if (edit.kind !== CompositionScenarioEditKind.TS_OBJECT_APPEND) return true;\n const { state, label } = keyedEntryState(saasRoot, edit, variables);\n if (state === KeyedEntryState.HELD) held.push(label);\n if (state === KeyedEntryState.FOREIGN || state === KeyedEntryState.UNDETERMINED) unowned.push(describeUnowned(state, label));\n return state === KeyedEntryState.ABSENT;\n });\n const plan = planCompositionScenario({\n scenario: { ...scenario, manifest: { ...scenario.manifest, edits } },\n applicationRoot: saasRoot,\n variables,\n renderer,\n });\n return { plan, held, unowned, applicationOwned };\n}\n\n/** Why an entry held under this module's key is not provably this module's, in words that are true. */\nfunction describeUnowned(state: KeyedEntryState, label: string): string {\n return state === KeyedEntryState.FOREIGN\n ? `${label} names another package`\n : `${label} has a path that cannot be read without running code, so whose it is cannot be told`;\n}\n\n/**\n * Publish side: the registration to record for `manifest`, or why there is none. Registered means every\n * registry edit of its shape's scenario, rendered for this module, is ALREADY present in the publishing\n * application.\n */\nexport function deriveModuleRegistration(\n saasRoot: string,\n frameworkRoot: string | null,\n manifest: ModuleManifest,\n): { registration: ModuleManifestRegistration } | { reason: string } {\n const shape = registrationShapeFromBoundaries(manifest);\n if ('reason' in shape) return shape;\n const registration: ModuleManifestRegistration = { ...shape, moduleCamel: moduleCamelFromDirectory(shape.moduleId) };\n try {\n const { plan, unowned } = planRegistrationEdits(saasRoot, frameworkRoot, registration);\n if (unowned.length > 0) {\n return { reason: `its runtime identity is held by an entry it cannot prove is its own: ${unowned.join('; ')}` };\n }\n if (plan.edits.length > 0) {\n return { reason: `the publishing application does not register it: ${plan.edits.map((edit) => `${edit.targetRelativePath} (${edit.summary})`).join('; ')}` };\n }\n return { registration };\n } catch (error) {\n return { reason: ErrorUtils.extractErrorMessage(error) };\n }\n}\n\n/** Every file a registration touches, with its content before — enough to roll it back exactly. */\nexport type RegistrationSnapshot = ReadonlyArray<{ targetRelativePath: string; previousContent: string }>;\n\n/**\n * Install side: apply the registration's edits to the host.\n *\n * - The registration must be self-consistent and name the directory the artifact installs into.\n * - `expectNothingPresent` (a FRESH registration): if the host already has ANY of its entries, the\n * directory is the host's own — refuse, so removal can never later take the host's entries with it.\n * A provider scope already present is the exception: it is left as written and reported, never refused.\n * Re-applying a registration the module already holds (an update to the same one) passes `false` and\n * is an idempotent no-op for entries present.\n * - Atomic for the caller: a failure part-way restores every file already written before rethrowing.\n */\nexport function applyModuleRegistration(\n saasRoot: string,\n frameworkRoot: string | null,\n manifest: ModuleManifest,\n registration: ModuleManifestRegistration,\n options: {\n expectNothingPresent: boolean;\n /** Receives, on a FRESH install, a sentence for each scope already present that it left as written. */\n kept?: string[];\n /** Receives, on EVERY run, the label of each scope already present, so nothing reports it as written unbound. */\n present?: string[];\n },\n): RegistrationSnapshot {\n assertRegistrationIsSelfConsistent(registration);\n // The registration must describe exactly what the artifact installs — its scenario, directory and\n // layers — so it can never register entries for more than the files that arrive.\n const shape: RegistrationShape | { reason: string } = registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE\n ? (manifest.kind === ModuleKind.PROVIDER && manifest.provider !== undefined\n ? { scenario: registration.scenario, moduleId: manifest.provider.ref }\n : { reason: 'the artifact is not a provider module' })\n : registrationShapeFromBoundaries(manifest);\n if ('reason' in shape || !sameShape(shape, registration)) {\n throw new Error(\n `Refusing to register: the manifest's registration (${registration.scenario} '${registration.moduleId}'${registration.layers ? ` [${registration.layers.join(', ')}]` : ''}) `\n + `is not what its boundaries install (${'reason' in shape ? shape.reason : `${shape.scenario} '${shape.moduleId}'${shape.layers ? ` [${shape.layers.join(', ')}]` : ''}`}). Nothing was registered.`,\n );\n }\n const { plan, held, unowned, applicationOwned } = planRegistrationEdits(saasRoot, frameworkRoot, registration);\n if (unowned.length > 0) {\n throw new Error(`its runtime identity is held by an entry it cannot prove is its own (${unowned.join('; ')}). Nothing was registered.`);\n }\n // A scope already present never counts as \"the application registers it itself\": scoping a provider is how an\n // application uses one, before or after the registry copy arrives.\n options.present?.push(...applicationOwned);\n // Said only on a fresh install: on an update a present scope is the expected state.\n if (options.expectNothingPresent) options.kept?.push(...applicationOwned.map((label) => `${label} (already present; left as the application wrote it)`));\n if (options.expectNothingPresent && (plan.skippedEdits.length > 0 || held.length > 0)) {\n throw new Error(\n `the application already registers '${registration.moduleId}' itself (${[...plan.skippedEdits.map((edit) => edit.targetRelativePath), ...held].join(', ')}); `\n + 'the install does not take over those entries. Nothing was registered.',\n );\n }\n const snapshot = plan.edits.map((edit) => ({\n targetRelativePath: edit.targetRelativePath,\n previousContent: readFileSync(join(saasRoot, edit.targetRelativePath), 'utf8'),\n }));\n try {\n applyCompositionScenarioPlan({ plan: { ...plan, writes: [], collisions: [] }, applicationRoot: saasRoot });\n } catch (error) {\n restoreRegistrationSnapshot(saasRoot, snapshot);\n throw error;\n }\n return snapshot;\n}\n\n/** Undo a registration change from its snapshot (the rollback of a failed install / remove). */\nexport function restoreRegistrationSnapshot(saasRoot: string, snapshot: RegistrationSnapshot): void {\n for (const { targetRelativePath, previousContent } of snapshot) {\n writeFileSync(join(saasRoot, targetRelativePath), previousContent, 'utf8');\n }\n}\n\n/**\n * Remove side: delete the entries the registration's edits add — the inverse of each edit step, keyed on\n * the same rendered text. Only ever called for a registration install RECORDED as applied, and install\n * refuses to record one whose entries the host already had, so these are entries install wrote — except a\n * provider scope, which is removed only while it still says exactly what the install writes (`reverseEdit`).\n * An entry already absent is skipped (idempotent). Returns the prior content of every file changed, so a caller\n * that must roll back can restore it.\n *\n * Exact byte-for-byte restoration holds for the layout the framework scaffolds (one entry per line,\n * trailing commas, LF or CRLF); any other layout is restored to equivalent, valid source.\n */\nexport function reverseModuleRegistration(\n saasRoot: string,\n frameworkRoot: string | null,\n registration: ModuleManifestRegistration,\n options: {\n /** Reverse only the steps this selects (an update's transition); every step by default. */\n only?: (edit: CompositionScenarioEdit, variables: Record<string, string>) => boolean;\n /** Receives each application-owned property left in place because it no longer says what the install wrote. */\n kept?: string[];\n } = {},\n): RegistrationSnapshot {\n assertRegistrationIsSelfConsistent(registration);\n const scenario = loadRegistrationScenario(saasRoot, frameworkRoot, registration);\n const variables = registrationVariables(registration);\n const steps = (scenario.manifest.edits ?? []).filter((edit) => options.only?.(edit, variables) ?? true);\n // Before anything is written: an object entry whose key now names ANOTHER package is not this module's\n // to remove (#1773 review). Refused whole, so the command stops with the application untouched.\n const unowned = steps\n .filter((edit) => edit.kind === CompositionScenarioEditKind.TS_OBJECT_APPEND)\n .map((edit) => keyedEntryState(saasRoot, edit, variables))\n .filter(({ state }) => state === KeyedEntryState.FOREIGN || state === KeyedEntryState.UNDETERMINED)\n .map(({ state, label }) => describeUnowned(state, label));\n if (unowned.length > 0) {\n throw new Error(\n `Refusing to unregister '${registration.moduleId}': ${unowned.join('; ')}, and this module removes only what it wrote. Nothing was removed.`,\n );\n }\n const snapshot = new Map<string, string>();\n const collected = () => [...snapshot].map(([targetRelativePath, previousContent]) => ({ targetRelativePath, previousContent }));\n try {\n // Reverse order: the last edit applied is the first undone.\n for (const edit of [...steps].reverse()) {\n const targetRelative = renderer.render(edit.file, variables);\n const targetAbsolute = join(saasRoot, targetRelative);\n let content: string;\n try {\n content = readFileSync(targetAbsolute, 'utf8');\n } catch {\n continue;\n }\n const next = reverseEdit(edit, content, targetRelative, variables, options.kept);\n if (next !== content) {\n // First change to a file wins: that is its content before this reversal began.\n if (!snapshot.has(targetRelative)) snapshot.set(targetRelative, content);\n writeFileSync(targetAbsolute, next, 'utf8');\n }\n }\n } catch (error) {\n // Atomic, like the apply: a step that throws part-way (a manifest that is not JSON, a config that no longer walks)\n // must not leave the steps before it undone and the rest in place (#2014 review F7).\n restoreRegistrationSnapshot(saasRoot, collected());\n throw error;\n }\n return collected();\n}\n\nfunction reverseEdit(edit: CompositionScenarioEdit, content: string, targetRelative: string, variables: Record<string, string>, kept?: string[]): string {\n switch (edit.kind) {\n case CompositionScenarioEditKind.TS_IMPORT_ADD:\n return removeInsertedImport(content, renderer.render(edit.statement!, variables).trim());\n case CompositionScenarioEditKind.APPEND_LINE:\n return removeWholeLine(content, renderer.render(edit.line!, variables).replace(/\\r?\\n+$/, '').trim());\n case CompositionScenarioEditKind.TS_ARRAY_APPEND: {\n const element = renderer.render(edit.element!, variables).trim();\n return removeListEntry(content, targetRelative, renderer.render(edit.exportedArray!, variables), RegistryAnchorShape.ARRAY,\n (entry, sourceFile) => entry.getText(sourceFile).trim() === element);\n }\n case CompositionScenarioEditKind.TS_OBJECT_APPEND: {\n // By KEY, not text: the operator edits a bucket entry after install, and the edited entry is still\n // this module's (the pre-pass above refused one whose path names another package).\n const { key } = objectEntryIdentity(renderer.render(edit.entry!, variables).trim());\n return removeListEntry(content, targetRelative, renderer.render(edit.exportedObject!, variables), RegistryAnchorShape.OBJECT,\n (entry) => (ts.isPropertyAssignment(entry) || ts.isShorthandPropertyAssignment(entry)) && propertyKey(entry.name) === key);\n }\n case CompositionScenarioEditKind.PACKAGE_DEPENDENCY_ADD:\n return removeAddedDependencies(content, targetRelative, edit, variables);\n case CompositionScenarioEditKind.CONFIG_PROPERTY_ADD: {\n const path = (edit.configPath ?? []).map((segment) => renderer.render(segment, variables));\n // Absent (a parent the operator removed takes it with it): the goal state.\n const text = readConfigObjectPropertyText({ filePath: targetRelative, content, target: { path } });\n if (text === undefined) return content;\n // Changed since the install wrote it — capabilities bound, protocols listed — so it is the application's, and\n // removing it would take the application's decision with it. Kept, and said.\n //\n // Deliberate: a scope that says EXACTLY what the install writes is removed even if the application wrote it\n // before the install (the review's P4). It binds nothing, and once the provider's package is gone it would name\n // a provider no runtime contributes, which `wildo config sync` refuses; removing it is the consistent end state.\n if (text !== renderer.render(edit.valueText ?? '', variables).trim()) {\n kept?.push(`${targetRelative} > ${path.join('.')} (the application changed it since install; remove it yourself if nothing should scope this provider)`);\n return content;\n }\n return removeConfigObjectProperty({ filePath: targetRelative, content, target: { path } }).newContent;\n }\n default:\n // Unreachable: `loadRegistrationScenario` refuses any other kind before a single write.\n throw new Error(`registration cannot reverse edit kind '${edit.kind}'`);\n }\n}\n\n/**\n * The inverse of `package-dependency-add` (#2014): drop each entry the step added, but only while it still carries the\n * specifier the step wrote. A dependency the operator re-pointed since is theirs now, and is kept. Written back in\n * the step's own form (two-space JSON), so a manifest the install edited returns to the same bytes.\n */\nfunction removeAddedDependencies(content: string, targetRelative: string, edit: CompositionScenarioEdit, variables: Record<string, string>): string {\n let manifest: Record<string, unknown>;\n try {\n manifest = JSON.parse(content) as Record<string, unknown>;\n } catch {\n throw new Error(`${targetRelative} is not valid JSON, so the dependency this module added cannot be removed from it.`);\n }\n const field = edit.dependencyField ?? 'dependencies';\n const dependencies = manifest[field];\n if (dependencies === null || typeof dependencies !== 'object' || Array.isArray(dependencies)) return content;\n const next = { ...(dependencies as Record<string, unknown>) };\n let changed = false;\n for (const [nameTemplate, specifierTemplate] of Object.entries(edit.entries ?? {})) {\n const name = renderer.render(nameTemplate, variables);\n if (next[name] === renderer.render(specifierTemplate, variables)) {\n delete next[name];\n changed = true;\n }\n }\n if (!changed) return content;\n manifest[field] = next;\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\n/**\n * The inverse of `ts-import-add`, which inserts `\\n<statement>` right after the last import. Removing\n * exactly that preserves the file's own line endings (CRLF included); a statement found elsewhere is\n * removed as a whole line.\n */\nfunction removeInsertedImport(content: string, statement: string): string {\n const inserted = `\\n${statement}`;\n const at = content.indexOf(inserted);\n if (at !== -1) return content.slice(0, at) + content.slice(at + inserted.length);\n return removeWholeLine(content, statement);\n}\n\n/** Remove the one line whose trimmed text equals `line`, with its line break. */\nfunction removeWholeLine(content: string, line: string): string {\n const lines = content.split('\\n');\n const index = lines.findIndex((candidate) => candidate.trim() === line);\n if (index === -1) return content;\n lines.splice(index, 1);\n return lines.join('\\n');\n}\n\n/**\n * Remove the element / property `matches` selects from the top-level variable `variableName`'s array or object literal:\n * the inverse of the append the registration's scenario made. The removal itself is `removeBracedListEntry`, the one\n * inverse of `appendIntoBracedList` that every caller shares, so this list and a config property cannot come to\n * disagree about what an append added (#2014 review, which found this copy and the runtime's disagreeing about a\n * comment the application wrote inside a list).\n */\nfunction removeListEntry(\n content: string,\n fileName: string,\n variableName: string,\n shape: RegistryAnchorShape,\n matches: (entry: ts.Node, sourceFile: ts.SourceFile) => boolean,\n): string {\n const anchor = findAnchorLiteral(content, fileName, variableName);\n if (!anchor) return content;\n const { sourceFile, literal } = anchor;\n const entries: ts.NodeArray<ts.Node> | null = shape === RegistryAnchorShape.ARRAY && ts.isArrayLiteralExpression(literal)\n ? literal.elements\n : shape === RegistryAnchorShape.OBJECT && ts.isObjectLiteralExpression(literal) ? literal.properties : null;\n if (entries === null) return content;\n const index = entries.findIndex((candidate) => matches(candidate, sourceFile));\n if (index === -1) return content;\n return removeBracedListEntry({ content, sourceFile, entries, index, closeBracePosition: literal.end - 1 });\n}\n\nexport interface InstallRegistrationOutcome {\n /** The registration now applied to the host, to record in the lockfile entry; absent when none is. */\n registration?: ModuleManifestRegistration;\n /** Every change made, in order, for `rollbackInstallRegistration`. */\n snapshots: RegistrationSnapshot[];\n /** Set when the module ends up NOT registered — reported to the operator, never fatal. */\n notice?: string;\n /** Application-owned entries the install or update left as it found them, one sentence each, for the operator. */\n kept: string[];\n /** Labels of the provider scopes already present when this run applied the registration: it wrote none of them. */\n present: string[];\n}\n\nfunction sameRegistration(a: ModuleManifestRegistration, b: ModuleManifestRegistration): boolean {\n return sameShape(a, b) && a.moduleCamel === b.moduleCamel && JSON.stringify(a.providerWiring) === JSON.stringify(b.providerWiring);\n}\n\n/**\n * Install side, provider modules (#2014): the registration an install of `manifest` applies HERE — the wiring derived\n * from this application's own services. The lockfile records it, so `remove` reverses exactly this.\n */\nexport async function deriveProviderRegistration(saasRoot: string, manifest: ModuleManifest): Promise<ModuleManifestRegistration> {\n if (manifest.kind !== ModuleKind.PROVIDER || manifest.provider === undefined) {\n throw new Error(`${manifest.id} is not a provider module; it is registered from its manifest.`);\n }\n const ref = manifest.provider.ref;\n return {\n scenario: ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE,\n moduleId: ref,\n moduleCamel: moduleCamelFromDirectory(ref),\n providerWiring: await deriveProviderWiring(saasRoot, manifest.provider),\n };\n}\n\n/**\n * The install / update step: reverse a PREVIOUS registration the new version no longer carries, then\n * apply the new one. A module that ships no registration, or whose registration cannot be applied here (an\n * application scaffolded before the registry anchors existed, or one that registers the directory itself),\n * installs with the gap MARKED. Throws when reversing a previous registration fails, and when a provider's changed\n * wiring cannot be applied (its partial reversal undone first) — the caller rolls the whole install back for that.\n *\n * A provider's wiring that CHANGED between two derivations (a frontend service added, a facet gained) moves step by\n * step (#2014 review): only the steps the new wiring no longer has are reversed, and the new wiring is then applied\n * over what stays. Undoing all of it and writing it again removed every scope the application had bound and put it\n * back empty.\n */\nexport function registerModuleForInstall(\n saasRoot: string,\n frameworkRoot: string | null,\n manifest: ModuleManifest,\n previous: ModuleManifestRegistration | undefined,\n /** A provider module's wiring, derived by `deriveProviderRegistration` (#2014); a provider manifest carries none. */\n providerRegistration?: ModuleManifestRegistration,\n): InstallRegistrationOutcome {\n const snapshots: RegistrationSnapshot[] = [];\n const kept: string[] = [];\n const present: string[] = [];\n const next = manifest.kind === ModuleKind.PROVIDER ? providerRegistration : manifest.registration;\n const keepsPrevious = previous !== undefined && next !== undefined && sameRegistration(previous, next);\n const providerTransition = previous !== undefined && next !== undefined && !keepsPrevious\n && previous.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE && next.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE;\n if (previous && !keepsPrevious) {\n if (providerTransition) {\n const nextVariables = registrationVariables(next);\n const nextSteps = new Set((loadRegistrationScenario(saasRoot, frameworkRoot, next).manifest.edits ?? []).map((edit) => editIdentity(edit, nextVariables)));\n snapshots.push(reverseModuleRegistration(saasRoot, frameworkRoot, previous, {\n only: (edit, variables) => !nextSteps.has(editIdentity(edit, variables)),\n kept,\n }));\n } else {\n snapshots.push(reverseModuleRegistration(saasRoot, frameworkRoot, previous, { kept }));\n }\n }\n if (!next) {\n return {\n snapshots,\n kept,\n present,\n notice: 'the module ships no registration (its publisher did not register it, or it is not a shape registration covers); '\n + 'declare it in the application by hand',\n };\n }\n try {\n // A provider transition re-applies over the steps it kept, so it must not refuse what is already there.\n snapshots.push(applyModuleRegistration(saasRoot, frameworkRoot, manifest, next, { expectNothingPresent: !keepsPrevious && !providerTransition, kept, present }));\n return { registration: next, snapshots, kept, present };\n } catch (error) {\n const notice = `could not register it: ${ErrorUtils.extractErrorMessage(error)}`;\n if (providerTransition) {\n // A provider transition reversed only PART of the previous wiring and kept the rest. Neither answer that lets\n // the update go on is coherent: recording no registration leaves the kept steps with nothing able to remove them\n // (#2014 re-review H1), and recording the PREVIOUS one describes files this update is about to replace, a facet\n // it deletes included (third review F2). So the partial reversal is undone and the update FAILS; the command's\n // own catch rolls the new files back, which leaves the old files and the old wiring together.\n rollbackInstallRegistration(saasRoot, snapshots);\n throw new Error(`${notice}. The update was not applied; the installed version and its wiring are unchanged.`);\n }\n // Re-applying the SAME registration failed: its entries are still in place, so it stays recorded.\n return { ...(keepsPrevious ? { registration: previous } : {}), snapshots, kept, present, notice };\n }\n}\n\n/** Undo `registerModuleForInstall` (a failed install's rollback), latest change first. */\nexport function rollbackInstallRegistration(saasRoot: string, snapshots: readonly RegistrationSnapshot[]): void {\n for (const snapshot of [...snapshots].reverse()) restoreRegistrationSnapshot(saasRoot, snapshot);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"module-registration.service.js","sourceRoot":"","sources":["../../../../src/services/registry/module-registration.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QACjF,IAAI,kBAAkB,EAAE,CAAC;YACvB,8GAA8G;YAC9G,iHAAiH;YACjH,gHAAgH;YAChH,+GAA+G;YAC/G,8FAA8F;YAC9F,2BAA2B,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YACjD,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,mFAAmF,CAAC,CAAC;QAChH,CAAC;QACD,kGAAkG;QAClG,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACpG,CAAC;AACH,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,2BAA2B,CAAC,QAAgB,EAAE,SAA0C;IACtG,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE;QAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnG,CAAC","sourcesContent":["/**\n * Registering an installed registry module in its host application — and unregistering it (#1755).\n *\n * `wildo registry add` copies a module's files. Registration is what makes the application KNOW the\n * module: the shared, specifications and frontend registries and `wildo.saas.config.ts >\n * applicationModules`. Without it the backend discovers `backend-api/src/modules/<dir>` by directory\n * scan while every other layer ignores the module — live on one side, unknown on the other.\n *\n * ## One source for \"how a module is registered\"\n *\n * The framework's `add-module` composition scenario already declares those edits (its `edits` block),\n * and `wildo compose add-module` applies them to a module it scaffolds. Installation reuses the SAME\n * edit steps — the application's delivered copy of the scenario, else the framework's — with the\n * scenario's CREATE steps stripped (the module's files arrive from the artifact, not from templates).\n * No second copy of the registry anchors exists here.\n *\n * ## Why the manifest carries no code\n *\n * The edits render code into the host's own files. A manifest that carried edit TEXT could append\n * anything to `wildo.saas.config.ts`. It carries only the module directory (`moduleId`), the camelCase stem the\n * scenario names entries from (`moduleCamel`) and, for a partial module, the layers it covers — the\n * identifiers restricted to identifier alphabets, and the stem the one DERIVED from the directory, so a\n * registration cannot name another module's entries. Anything else a scenario needs (the services a module\n * binds to) is derived here from those values.\n *\n * ## Derived at publish, never authored\n *\n * `wildo registry publish` plans the same edits against the PUBLISHING application. If every one is\n * already present there, the module demonstrably is registered there and the registration is\n * recorded; otherwise it is left out and the reason reported.\n *\n * ## A registration is applied only where nothing is there yet\n *\n * On a fresh install, if the host ALREADY has any of the registration's entries, the directory is the\n * host's own and install does not take it over: the module is installed and MARKED as not registered.\n * That is what keeps `remove` honest — it reverses only a registration install actually made, so it does\n * not delete an entry the application wrote itself (`application-creation-directive.md`: mark, don't\n * block).\n *\n * One exception, by design (#2014 review): a provider's SCOPE (`config-property-add`) is the application's\n * once it exists, because binding capabilities there is how an application uses the provider. A scope\n * already present never blocks an install and is left as written; `remove` takes a scope out only while it\n * still says exactly what the install writes (see `reverseEdit`).\n *\n * ## The three shapes (#1755, #1773)\n *\n * - a DOMAIN module replays `add-module` — all four layers, or a SUBSET that includes the backend or the\n * frontend: only the edits targeting its layers run, and its `applicationModules` entry is bound to\n * exactly the services its layers provide (derived here, never read from the manifest);\n * - a MINION replays `add-minion`, a WORKER `add-worker-node` — their bucket entry, provider scope and\n * pnpm workspace member. Their scenarios' other variables (package name, port, display strings) only\n * feed the files a scenario creates, which the artifact supplies instead, so the edits need the\n * directory and the stem alone.\n *\n * Anything else — a mixed artifact, a shared+specifications-only module (no service to bind it to) —\n * installs with the gap marked.\n */\n\nimport { join } from 'node:path';\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport ts from 'typescript';\nimport {\n applyCompositionScenarioPlan,\n CompositionScenarioEditKind,\n createCompositionTemplateRenderer,\n listCompositionScenarioDirectories,\n loadCompositionScenario,\n planCompositionScenario,\n removeBracedListEntry,\n readConfigObjectPropertyText,\n removeConfigObjectProperty,\n unwrapInitializer,\n type CompositionScenario,\n type CompositionScenarioEdit,\n} from '@wildo-ai/application-creation-runtime';\nimport {\n DOMAIN_MODULE_LAYERS,\n DomainModuleLayer,\n MODULE_BOUNDARY_LAYER_ROOTS,\n ModuleKind,\n ModuleRegistrationScenario,\n type ModuleBoundaryLayer,\n type ModuleManifest,\n type ModuleManifestRegistration,\n} from '@wildo-ai/platform-config-lib';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { deriveProviderWiring, providerWiringScenario } from './provider-wiring.service';\n\nconst renderer = createCompositionTemplateRenderer();\n\n/** A directory that does not exist, so a scenario plan carries its EDIT steps and no file creations. */\nconst NO_FILES_DIRECTORY = '__registry-install-edits-only__';\n\n/** The only edit kinds registration can undo — see {@link reverseEdit}. */\nconst REVERSIBLE_EDIT_KINDS: ReadonlySet<string> = new Set([\n CompositionScenarioEditKind.TS_IMPORT_ADD,\n CompositionScenarioEditKind.TS_ARRAY_APPEND,\n CompositionScenarioEditKind.TS_OBJECT_APPEND,\n CompositionScenarioEditKind.APPEND_LINE,\n // #2014: the provider wiring's dependency and scope.\n CompositionScenarioEditKind.PACKAGE_DEPENDENCY_ADD,\n CompositionScenarioEditKind.CONFIG_PROPERTY_ADD,\n]);\n\n/**\n * The service each service-bearing layer binds its module to in `applicationModules`, in the order the\n * `add-module` scenario's default writes them (`'backendApi', 'app'`) — so a whole module registered by\n * install renders the SAME entry `wildo compose` scaffolds. Shared and specifications bind no service.\n */\nconst SERVICE_BINDINGS: ReadonlyArray<readonly [DomainModuleLayer, string]> = [\n [DomainModuleLayer.BACKEND, 'backendApi'],\n [DomainModuleLayer.FRONTEND, 'app'],\n];\n\n/** The application config file, whose `applicationModules` entry every module shape is bound through. */\nconst SAAS_CONFIG_FILE = 'wildo.saas.config.ts';\n\n/** The directory of the application a domain layer's registry edits target (the `add-module` edit files). */\nconst EDIT_ROOT_OF_LAYER: Partial<Record<DomainModuleLayer, string>> = {\n [DomainModuleLayer.SHARED]: 'shared-lib/',\n [DomainModuleLayer.SPECIFICATIONS]: 'specifications/',\n [DomainModuleLayer.FRONTEND]: 'frontend/',\n};\n\n/**\n * The ONLY variables a registration supplies to each scenario, derived from the registration — never\n * read from the manifest beyond its two identifiers. A scenario reading any other is refused, because the\n * renderer would render it empty and write broken code.\n */\nfunction registrationVariables(registration: ModuleManifestRegistration): Record<string, string> {\n switch (registration.scenario) {\n case ModuleRegistrationScenario.ADD_MODULE: {\n const layers = registration.layers ?? DOMAIN_MODULE_LAYERS;\n const services = SERVICE_BINDINGS.filter(([layer]) => layers.includes(layer)).map(([, service]) => service);\n return { moduleId: registration.moduleId, moduleCamel: registration.moduleCamel, moduleServices: services.map((service) => `'${service}'`).join(', ') };\n }\n case ModuleRegistrationScenario.ADD_MINION:\n return { minionDir: registration.moduleId, minionCamel: registration.moduleCamel };\n case ModuleRegistrationScenario.ADD_WORKER_NODE:\n return { workerDir: registration.moduleId, workerCamel: registration.moduleCamel };\n case ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE:\n // Its edits are built already rendered, from the recorded wiring (`providerWiringScenario`).\n return {};\n }\n}\n\n/** The two shapes of registry anchor an entry is removed from. */\nenum RegistryAnchorShape {\n ARRAY = 'array',\n OBJECT = 'object',\n}\n\n/**\n * The registration's scenario as visible from this application, reduced to the edits the registration\n * covers and with its file-creation tree removed — the delivered copy wins over the framework's, like\n * `wildo compose`.\n *\n * FAIL-CLOSED on its edits, BEFORE anything is written: an edit kind this module cannot undo, a variable\n * a registration does not carry, or — for a layer subset — a delivered `add-module` copy whose\n * `applicationModules` entry still hard-codes both services (it predates #1773 and would bind the module\n * to a service it does not provide).\n */\nexport function loadRegistrationScenario(saasRoot: string, frameworkRoot: string | null, registration: ModuleManifestRegistration): CompositionScenario {\n if (registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE) {\n // #2014: no scenario directory — the wiring the installer recorded IS the edit list.\n return providerWiringScenario(saasRoot, registration.moduleId, registration.providerWiring!);\n }\n const ref = registration.scenario;\n const directory = listCompositionScenarioDirectories({ applicationRoot: saasRoot, frameworkRoot }).get(ref);\n if (!directory) {\n throw new Error(\n `No '${ref}' composition scenario is visible from ${saasRoot} — run the framework asset sync `\n + '(it delivers .wildo-saas/templates/scenarios) before installing or publishing a registered module.',\n );\n }\n const scenario = loadCompositionScenario(directory);\n const allowed = new Set(Object.keys(registrationVariables(registration)));\n let edits = scenario.manifest.edits ?? [];\n for (const edit of edits) {\n if (!REVERSIBLE_EDIT_KINDS.has(edit.kind)) {\n throw new Error(`The '${ref}' scenario at ${directory} uses edit kind '${edit.kind}', which registration cannot reverse.`);\n }\n for (const match of JSON.stringify(edit).matchAll(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g)) {\n if (!allowed.has(match[1]!)) {\n throw new Error(`The '${ref}' scenario at ${directory} reads variable '${match[1]}', which a registration does not carry.`);\n }\n }\n }\n if (registration.scenario === ModuleRegistrationScenario.ADD_MODULE && registration.layers !== undefined) {\n const layers = registration.layers;\n // Keep the edits of the covered layers, and the config entry (the schema guarantees a service to bind).\n edits = edits.filter((edit) => {\n const layer = DOMAIN_MODULE_LAYERS.find((candidate) => EDIT_ROOT_OF_LAYER[candidate] !== undefined && edit.file.startsWith(EDIT_ROOT_OF_LAYER[candidate]!));\n if (layer !== undefined) return layers.includes(layer);\n // Fail closed on an edit no layer owns (#1773 review): replaying it for a subset would register the\n // module in a place its files never reach. The config entry is the one such edit, and it is bound\n // to exactly the covered services.\n if (edit.file === SAAS_CONFIG_FILE) return true;\n throw new Error(\n `The '${ref}' scenario at ${directory} edits ${edit.file}, which no module layer owns, so it cannot register a module covering only ${layers.join(', ')}.`,\n );\n });\n const configEdit = edits.find((edit) => edit.kind === CompositionScenarioEditKind.TS_OBJECT_APPEND);\n if (configEdit && !JSON.stringify(configEdit).includes('moduleServices')) {\n throw new Error(\n `The '${ref}' scenario at ${directory} binds every module to both services, so it cannot register a module covering `\n + `only ${layers.join(', ')} — run the framework asset sync to deliver the current scenario.`,\n );\n }\n }\n return { ...scenario, manifest: { ...scenario.manifest, edits }, filesDirectory: join(scenario.scenarioDirectory, NO_FILES_DIRECTORY) };\n}\n\n/** The camelCase stem a scenario names entries from — derived from the directory for every shape. */\nexport function moduleCamelFromDirectory(moduleId: string): string {\n return moduleId.replace(/-([a-z0-9])/g, (_m, c: string) => c.toUpperCase());\n}\n\n/**\n * A registration must name entries for the directory it registers and no other: the stem is DERIVED from\n * the directory. Checked at install and at removal (the lockfile is hand-editable), because a mismatched\n * stem makes the edits reach entries belonging to another module.\n */\nfunction assertRegistrationIsSelfConsistent(registration: ModuleManifestRegistration): void {\n if (registration.moduleCamel !== moduleCamelFromDirectory(registration.moduleId)) {\n throw new Error(\n `Refusing registration for '${registration.moduleId}': its moduleCamel '${registration.moduleCamel}' is not the one derived `\n + `from the directory ('${moduleCamelFromDirectory(registration.moduleId)}'). Nothing was changed.`,\n );\n }\n}\n\n/** The registration shape an artifact's boundaries describe: scenario, directory and (for a subset) layers. */\nexport type RegistrationShape = Pick<ModuleManifestRegistration, 'scenario' | 'moduleId' | 'layers'>;\n\n/** The single directory `<root>/<dir>` a boundary layer names, or why it names no single one. */\nfunction singleDirectory(manifest: ModuleManifest, layer: ModuleBoundaryLayer): { dir: string } | { reason: string } {\n const entries = manifest.boundaries?.[layer] ?? [];\n const root = `${MODULE_BOUNDARY_LAYER_ROOTS[layer]}/`;\n if (entries.length !== 1 || !entries[0]!.startsWith(root) || entries[0]!.slice(root.length).includes('/')) {\n return { reason: `boundaries.${layer} must be exactly one directory \\`${root}<dir>\\` (found ${JSON.stringify(entries)})` };\n }\n return { dir: entries[0]!.slice(root.length) };\n}\n\n/**\n * The registration shape an artifact installs, read from its boundaries — or why it has none:\n * - only `minions` → a minion; only `workers` → a worker;\n * - only domain layers, each exactly one directory and all the SAME directory → a domain module\n * (`layers` set when not all four, and refused unless it includes the backend or the frontend);\n * - anything else (a mix, several directories) → no registration.\n */\nexport function registrationShapeFromBoundaries(manifest: ModuleManifest): RegistrationShape | { reason: string } {\n const present = (Object.keys(MODULE_BOUNDARY_LAYER_ROOTS) as ModuleBoundaryLayer[])\n .filter((layer) => (manifest.boundaries?.[layer] ?? []).length > 0);\n // A provider package (#2014) is never registered from its manifest: its owners are the INSTALLING\n // application's, so the installer derives its wiring (`deriveProviderRegistration`). The manifest schema\n // already refuses `providers/` beside any other layer; this keeps the rule true for an unparsed manifest.\n if (present.includes('providers')) {\n return { reason: 'a provider package is wired by each installing application, never by its publisher (#2014)' };\n }\n const packageShapes: Array<[ModuleBoundaryLayer, ModuleRegistrationScenario]> = [\n ['minions', ModuleRegistrationScenario.ADD_MINION],\n ['workers', ModuleRegistrationScenario.ADD_WORKER_NODE],\n ];\n for (const [layer, scenario] of packageShapes) {\n if (!present.includes(layer)) continue;\n if (present.length !== 1) return { reason: `a ${layer.slice(0, -1)} is registered on its own, but this artifact also covers ${present.filter((p) => p !== layer).join(', ')}` };\n const directory = singleDirectory(manifest, layer);\n return 'reason' in directory ? directory : { scenario, moduleId: directory.dir };\n }\n const layers = DOMAIN_MODULE_LAYERS.filter((layer) => present.includes(layer));\n if (layers.length === 0) return { reason: 'the artifact declares no boundaries to register' };\n const directories = new Set<string>();\n for (const layer of layers) {\n const directory = singleDirectory(manifest, layer);\n if ('reason' in directory) return directory;\n directories.add(directory.dir);\n }\n if (directories.size !== 1) return { reason: `its layers name different module directories (${[...directories].join(', ')})` };\n if (!layers.includes(DomainModuleLayer.BACKEND) && !layers.includes(DomainModuleLayer.FRONTEND)) {\n return { reason: `it covers only ${layers.join(', ')}; an application module is bound to the backend or the frontend, so there is nothing to bind it to` };\n }\n return {\n scenario: ModuleRegistrationScenario.ADD_MODULE,\n moduleId: [...directories][0]!,\n ...(layers.length < DOMAIN_MODULE_LAYERS.length ? { layers } : {}),\n };\n}\n\nfunction sameShape(a: RegistrationShape, b: RegistrationShape): boolean {\n return a.scenario === b.scenario && a.moduleId === b.moduleId && (a.layers ?? []).join(',') === (b.layers ?? []).join(',');\n}\n\n/**\n * How the host holds an object-anchor entry a registration names, judged by the entry's KEY (#1773 review).\n *\n * A bucket entry is configuration the operator is EXPECTED to edit after install: a minion is scaffolded\n * with a deny-all `resourceAccess` and no providers, so every working minion carries an entry that no\n * longer matches its rendered text. Judged by text, such an entry was a \"different value\" conflict — the\n * publisher could never record a registration and removal silently left it behind. The key is the\n * module's runtime identity (derived from its directory), and where the entry carries a `path`, that path\n * names the package the key belongs to.\n *\n * What key-only matching gives up, stated rather than implied (#1773 re-review R10): an entry with no\n * `path` — the domain module's `applicationModules` entry, `'<id>': { services: [...] }` — is judged by\n * its key alone, so publish no longer compares its `services` binding with the artifact's layers. The\n * per-layer registry edits still must all be present, which is what catches a layer mismatch; a host\n * that rebinds services after install keeps its binding, which is the point of the change.\n */\nenum KeyedEntryState {\n /** No property with the entry's key. */\n ABSENT = 'absent',\n /** The key is there and belongs to this module: its `path` (when the entry has one) names this directory. */\n HELD = 'held',\n /** The key is there and its `path` names another directory: a different package owns that identity. */\n FOREIGN = 'foreign',\n /**\n * The key is there and its `path` cannot be read without evaluating code — a shorthand property, a\n * variable, a helper call. Treated as refusal like FOREIGN (fail closed), but reported as what it is:\n * the registry cannot tell whose it is, not that it is someone else's (#1773 re-review R9).\n */\n UNDETERMINED = 'undetermined',\n}\n\n/** A property name as the key it denotes: `billing`, `'billing'` and `\"billing\"` are one key. */\nfunction propertyKey(name: ts.PropertyName): string | undefined {\n if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)) return name.text;\n return undefined;\n}\n\n/** The string value of the `path` property of an object-literal value, when it has one. */\nfunction pathOfValue(value: ts.Expression | undefined): string | undefined {\n if (!value) return undefined;\n const literal = unwrapInitializer(value);\n if (!ts.isObjectLiteralExpression(literal)) return undefined;\n for (const property of literal.properties) {\n if (ts.isPropertyAssignment(property) && propertyKey(property.name) === 'path' && ts.isStringLiteralLike(property.initializer)) {\n return property.initializer.text;\n }\n }\n return undefined;\n}\n\n/** The key (and `path`, when present) a rendered `key: value` entry declares. */\nfunction objectEntryIdentity(entryText: string): { key: string; path?: string } {\n const sourceFile = ts.createSourceFile('entry.ts', `({${entryText}})`, ts.ScriptTarget.Latest, true);\n const statement = sourceFile.statements[0];\n const literal = statement && ts.isExpressionStatement(statement) ? unwrapInitializer(statement.expression) : undefined;\n const property = literal && ts.isObjectLiteralExpression(literal) && literal.properties.length === 1 ? literal.properties[0] : undefined;\n const key = property && ts.isPropertyAssignment(property) ? propertyKey(property.name) : undefined;\n if (!property || !ts.isPropertyAssignment(property) || key === undefined) {\n throw new Error(`registration cannot identify the object entry \\`${entryText}\\` by a key`);\n }\n const path = pathOfValue(property.initializer);\n return { key, ...(path !== undefined ? { path } : {}) };\n}\n\n/** The top-level `const <variableName> = [...] | {...}` literal of a file, as a source file and literal. */\nfunction findAnchorLiteral(content: string, fileName: string, variableName: string): { sourceFile: ts.SourceFile; literal: ts.Expression } | undefined {\n const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true);\n for (const statement of sourceFile.statements) {\n if (!ts.isVariableStatement(statement)) continue;\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.name.text === variableName && declaration.initializer) {\n return { sourceFile, literal: unwrapInitializer(declaration.initializer) };\n }\n }\n }\n return undefined;\n}\n\n/** The property of the anchor object carrying `key`, if any. */\nfunction findKeyedProperty(literal: ts.Expression, key: string): ts.ObjectLiteralElementLike | undefined {\n if (!ts.isObjectLiteralExpression(literal)) return undefined;\n return literal.properties.find((property) =>\n (ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property)) && propertyKey(property.name) === key);\n}\n\n/** How the host holds the entry an object-append `edit` would write, rendered with `variables`. */\nfunction keyedEntryState(saasRoot: string, edit: CompositionScenarioEdit, variables: Record<string, string>): { state: KeyedEntryState; label: string } {\n const targetRelative = renderer.render(edit.file, variables);\n const objectName = renderer.render(edit.exportedObject!, variables);\n const identity = objectEntryIdentity(renderer.render(edit.entry!, variables).trim());\n const label = `${targetRelative} > ${objectName}.${identity.key}`;\n let content: string;\n try {\n content = readFileSync(join(saasRoot, targetRelative), 'utf8');\n } catch {\n return { state: KeyedEntryState.ABSENT, label };\n }\n const anchor = findAnchorLiteral(content, targetRelative, objectName);\n const property = anchor ? findKeyedProperty(anchor.literal, identity.key) : undefined;\n if (!property) return { state: KeyedEntryState.ABSENT, label };\n if (identity.path === undefined) return { state: KeyedEntryState.HELD, label };\n const heldPath = ts.isPropertyAssignment(property) ? pathOfValue(property.initializer) : undefined;\n if (heldPath === undefined) return { state: KeyedEntryState.UNDETERMINED, label };\n return { state: normalisePath(heldPath) === normalisePath(identity.path) ? KeyedEntryState.HELD : KeyedEntryState.FOREIGN, label: `${label} (path '${heldPath}')` };\n}\n\nfunction normalisePath(path: string | undefined): string | undefined {\n return path?.replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\n/**\n * A `config-property-add` step's property in the host: its label, and its text when present.\n *\n * The property a provider install adds is its SCOPE (`providers.scopes.<runtime>.providers.<ref>`), and a scope is the\n * APPLICATION's once it exists (#2014 review): it is where the application binds engine capabilities, and it may\n * predate the install (an application that scoped a catalogue provider before adopting the registry copy). So an\n * install only guarantees the key is PRESENT — one already there, whatever it says, is left as it is — and a remove\n * takes it out only while it still says exactly what the install wrote.\n */\nfunction configPropertyState(saasRoot: string, edit: CompositionScenarioEdit, variables: Record<string, string>): { label: string; path: string[]; text?: string } {\n const targetRelative = renderer.render(edit.file, variables);\n const path = (edit.configPath ?? []).map((segment) => renderer.render(segment, variables));\n const label = `${targetRelative} > ${path.join('.')}`;\n let content: string;\n try {\n content = readFileSync(join(saasRoot, targetRelative), 'utf8');\n } catch {\n return { label, path };\n }\n const text = readConfigObjectPropertyText({ filePath: targetRelative, content, target: { path } });\n return text === undefined ? { label, path } : { label, path, text };\n}\n\n/**\n * The identity of one edit step, rendered: two registrations share a step exactly when they would write the same\n * thing to the same place. Used to move a provider's wiring from one derivation to the next step by step (#2014\n * review), rather than by undoing all of it and writing it again, which is what reset a bound scope to empty.\n */\nfunction editIdentity(edit: CompositionScenarioEdit, variables: Record<string, string>): string {\n const render = (value: string | undefined) => (value === undefined ? '' : renderer.render(value, variables));\n return JSON.stringify([\n edit.kind,\n render(edit.file),\n render(edit.line),\n render(edit.statement),\n render(edit.element),\n render(edit.entry),\n (edit.configPath ?? []).map(render),\n Object.entries(edit.entries ?? {}).map(([name, specifier]) => [render(name), render(specifier)]),\n ]);\n}\n\n/**\n * The registration's edits planned against the host, with every object entry the host already HOLDS by key\n * taken out of the plan (present, however it has been edited since) and every FOREIGN one reported.\n */\nfunction planRegistrationEdits(saasRoot: string, frameworkRoot: string | null, registration: ModuleManifestRegistration) {\n const scenario = loadRegistrationScenario(saasRoot, frameworkRoot, registration);\n const variables = registrationVariables(registration);\n const held: string[] = [];\n const unowned: string[] = [];\n const applicationOwned: string[] = [];\n const edits = (scenario.manifest.edits ?? []).filter((edit) => {\n if (edit.kind === CompositionScenarioEditKind.CONFIG_PROPERTY_ADD) {\n // Present, whatever it says: the application's. See `configPropertyState`.\n const { label, text } = configPropertyState(saasRoot, edit, variables);\n if (text !== undefined) applicationOwned.push(label);\n return text === undefined;\n }\n if (edit.kind !== CompositionScenarioEditKind.TS_OBJECT_APPEND) return true;\n const { state, label } = keyedEntryState(saasRoot, edit, variables);\n if (state === KeyedEntryState.HELD) held.push(label);\n if (state === KeyedEntryState.FOREIGN || state === KeyedEntryState.UNDETERMINED) unowned.push(describeUnowned(state, label));\n return state === KeyedEntryState.ABSENT;\n });\n const plan = planCompositionScenario({\n scenario: { ...scenario, manifest: { ...scenario.manifest, edits } },\n applicationRoot: saasRoot,\n variables,\n renderer,\n });\n return { plan, held, unowned, applicationOwned };\n}\n\n/** Why an entry held under this module's key is not provably this module's, in words that are true. */\nfunction describeUnowned(state: KeyedEntryState, label: string): string {\n return state === KeyedEntryState.FOREIGN\n ? `${label} names another package`\n : `${label} has a path that cannot be read without running code, so whose it is cannot be told`;\n}\n\n/**\n * Publish side: the registration to record for `manifest`, or why there is none. Registered means every\n * registry edit of its shape's scenario, rendered for this module, is ALREADY present in the publishing\n * application.\n */\nexport function deriveModuleRegistration(\n saasRoot: string,\n frameworkRoot: string | null,\n manifest: ModuleManifest,\n): { registration: ModuleManifestRegistration } | { reason: string } {\n const shape = registrationShapeFromBoundaries(manifest);\n if ('reason' in shape) return shape;\n const registration: ModuleManifestRegistration = { ...shape, moduleCamel: moduleCamelFromDirectory(shape.moduleId) };\n try {\n const { plan, unowned } = planRegistrationEdits(saasRoot, frameworkRoot, registration);\n if (unowned.length > 0) {\n return { reason: `its runtime identity is held by an entry it cannot prove is its own: ${unowned.join('; ')}` };\n }\n if (plan.edits.length > 0) {\n return { reason: `the publishing application does not register it: ${plan.edits.map((edit) => `${edit.targetRelativePath} (${edit.summary})`).join('; ')}` };\n }\n return { registration };\n } catch (error) {\n return { reason: ErrorUtils.extractErrorMessage(error) };\n }\n}\n\n/** Every file a registration touches, with its content before — enough to roll it back exactly. */\nexport type RegistrationSnapshot = ReadonlyArray<{ targetRelativePath: string; previousContent: string }>;\n\n/**\n * Install side: apply the registration's edits to the host.\n *\n * - The registration must be self-consistent and name the directory the artifact installs into.\n * - `expectNothingPresent` (a FRESH registration): if the host already has ANY of its entries, the\n * directory is the host's own — refuse, so removal can never later take the host's entries with it.\n * A provider scope already present is the exception: it is left as written and reported, never refused.\n * Re-applying a registration the module already holds (an update to the same one) passes `false` and\n * is an idempotent no-op for entries present.\n * - Atomic for the caller: a failure part-way restores every file already written before rethrowing.\n */\nexport function applyModuleRegistration(\n saasRoot: string,\n frameworkRoot: string | null,\n manifest: ModuleManifest,\n registration: ModuleManifestRegistration,\n options: {\n expectNothingPresent: boolean;\n /** Receives, on a FRESH install, a sentence for each scope already present that it left as written. */\n kept?: string[];\n /** Receives, on EVERY run, the label of each scope already present, so nothing reports it as written unbound. */\n present?: string[];\n },\n): RegistrationSnapshot {\n assertRegistrationIsSelfConsistent(registration);\n // The registration must describe exactly what the artifact installs — its scenario, directory and\n // layers — so it can never register entries for more than the files that arrive.\n const shape: RegistrationShape | { reason: string } = registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE\n ? (manifest.kind === ModuleKind.PROVIDER && manifest.provider !== undefined\n ? { scenario: registration.scenario, moduleId: manifest.provider.ref }\n : { reason: 'the artifact is not a provider module' })\n : registrationShapeFromBoundaries(manifest);\n if ('reason' in shape || !sameShape(shape, registration)) {\n throw new Error(\n `Refusing to register: the manifest's registration (${registration.scenario} '${registration.moduleId}'${registration.layers ? ` [${registration.layers.join(', ')}]` : ''}) `\n + `is not what its boundaries install (${'reason' in shape ? shape.reason : `${shape.scenario} '${shape.moduleId}'${shape.layers ? ` [${shape.layers.join(', ')}]` : ''}`}). Nothing was registered.`,\n );\n }\n const { plan, held, unowned, applicationOwned } = planRegistrationEdits(saasRoot, frameworkRoot, registration);\n if (unowned.length > 0) {\n throw new Error(`its runtime identity is held by an entry it cannot prove is its own (${unowned.join('; ')}). Nothing was registered.`);\n }\n // A scope already present never counts as \"the application registers it itself\": scoping a provider is how an\n // application uses one, before or after the registry copy arrives.\n options.present?.push(...applicationOwned);\n // Said only on a fresh install: on an update a present scope is the expected state.\n if (options.expectNothingPresent) options.kept?.push(...applicationOwned.map((label) => `${label} (already present; left as the application wrote it)`));\n if (options.expectNothingPresent && (plan.skippedEdits.length > 0 || held.length > 0)) {\n throw new Error(\n `the application already registers '${registration.moduleId}' itself (${[...plan.skippedEdits.map((edit) => edit.targetRelativePath), ...held].join(', ')}); `\n + 'the install does not take over those entries. Nothing was registered.',\n );\n }\n const snapshot = plan.edits.map((edit) => ({\n targetRelativePath: edit.targetRelativePath,\n previousContent: readFileSync(join(saasRoot, edit.targetRelativePath), 'utf8'),\n }));\n try {\n applyCompositionScenarioPlan({ plan: { ...plan, writes: [], collisions: [] }, applicationRoot: saasRoot });\n } catch (error) {\n restoreRegistrationSnapshot(saasRoot, snapshot);\n throw error;\n }\n return snapshot;\n}\n\n/** Undo a registration change from its snapshot (the rollback of a failed install / remove). */\nexport function restoreRegistrationSnapshot(saasRoot: string, snapshot: RegistrationSnapshot): void {\n for (const { targetRelativePath, previousContent } of snapshot) {\n writeFileSync(join(saasRoot, targetRelativePath), previousContent, 'utf8');\n }\n}\n\n/**\n * Remove side: delete the entries the registration's edits add — the inverse of each edit step, keyed on\n * the same rendered text. Only ever called for a registration install RECORDED as applied, and install\n * refuses to record one whose entries the host already had, so these are entries install wrote — except a\n * provider scope, which is removed only while it still says exactly what the install writes (`reverseEdit`).\n * An entry already absent is skipped (idempotent). Returns the prior content of every file changed, so a caller\n * that must roll back can restore it.\n *\n * Exact byte-for-byte restoration holds for the layout the framework scaffolds (one entry per line,\n * trailing commas, LF or CRLF); any other layout is restored to equivalent, valid source.\n */\nexport function reverseModuleRegistration(\n saasRoot: string,\n frameworkRoot: string | null,\n registration: ModuleManifestRegistration,\n options: {\n /** Reverse only the steps this selects (an update's transition); every step by default. */\n only?: (edit: CompositionScenarioEdit, variables: Record<string, string>) => boolean;\n /** Receives each application-owned property left in place because it no longer says what the install wrote. */\n kept?: string[];\n } = {},\n): RegistrationSnapshot {\n assertRegistrationIsSelfConsistent(registration);\n const scenario = loadRegistrationScenario(saasRoot, frameworkRoot, registration);\n const variables = registrationVariables(registration);\n const steps = (scenario.manifest.edits ?? []).filter((edit) => options.only?.(edit, variables) ?? true);\n // Before anything is written: an object entry whose key now names ANOTHER package is not this module's\n // to remove (#1773 review). Refused whole, so the command stops with the application untouched.\n const unowned = steps\n .filter((edit) => edit.kind === CompositionScenarioEditKind.TS_OBJECT_APPEND)\n .map((edit) => keyedEntryState(saasRoot, edit, variables))\n .filter(({ state }) => state === KeyedEntryState.FOREIGN || state === KeyedEntryState.UNDETERMINED)\n .map(({ state, label }) => describeUnowned(state, label));\n if (unowned.length > 0) {\n throw new Error(\n `Refusing to unregister '${registration.moduleId}': ${unowned.join('; ')}, and this module removes only what it wrote. Nothing was removed.`,\n );\n }\n const snapshot = new Map<string, string>();\n const collected = () => [...snapshot].map(([targetRelativePath, previousContent]) => ({ targetRelativePath, previousContent }));\n try {\n // Reverse order: the last edit applied is the first undone.\n for (const edit of [...steps].reverse()) {\n const targetRelative = renderer.render(edit.file, variables);\n const targetAbsolute = join(saasRoot, targetRelative);\n let content: string;\n try {\n content = readFileSync(targetAbsolute, 'utf8');\n } catch {\n continue;\n }\n const next = reverseEdit(edit, content, targetRelative, variables, options.kept);\n if (next !== content) {\n // First change to a file wins: that is its content before this reversal began.\n if (!snapshot.has(targetRelative)) snapshot.set(targetRelative, content);\n writeFileSync(targetAbsolute, next, 'utf8');\n }\n }\n } catch (error) {\n // Atomic, like the apply: a step that throws part-way (a manifest that is not JSON, a config that no longer walks)\n // must not leave the steps before it undone and the rest in place (#2014 review F7).\n restoreRegistrationSnapshot(saasRoot, collected());\n throw error;\n }\n return collected();\n}\n\nfunction reverseEdit(edit: CompositionScenarioEdit, content: string, targetRelative: string, variables: Record<string, string>, kept?: string[]): string {\n switch (edit.kind) {\n case CompositionScenarioEditKind.TS_IMPORT_ADD:\n return removeInsertedImport(content, renderer.render(edit.statement!, variables).trim());\n case CompositionScenarioEditKind.APPEND_LINE:\n return removeWholeLine(content, renderer.render(edit.line!, variables).replace(/\\r?\\n+$/, '').trim());\n case CompositionScenarioEditKind.TS_ARRAY_APPEND: {\n const element = renderer.render(edit.element!, variables).trim();\n return removeListEntry(content, targetRelative, renderer.render(edit.exportedArray!, variables), RegistryAnchorShape.ARRAY,\n (entry, sourceFile) => entry.getText(sourceFile).trim() === element);\n }\n case CompositionScenarioEditKind.TS_OBJECT_APPEND: {\n // By KEY, not text: the operator edits a bucket entry after install, and the edited entry is still\n // this module's (the pre-pass above refused one whose path names another package).\n const { key } = objectEntryIdentity(renderer.render(edit.entry!, variables).trim());\n return removeListEntry(content, targetRelative, renderer.render(edit.exportedObject!, variables), RegistryAnchorShape.OBJECT,\n (entry) => (ts.isPropertyAssignment(entry) || ts.isShorthandPropertyAssignment(entry)) && propertyKey(entry.name) === key);\n }\n case CompositionScenarioEditKind.PACKAGE_DEPENDENCY_ADD:\n return removeAddedDependencies(content, targetRelative, edit, variables);\n case CompositionScenarioEditKind.CONFIG_PROPERTY_ADD: {\n const path = (edit.configPath ?? []).map((segment) => renderer.render(segment, variables));\n // Absent (a parent the operator removed takes it with it): the goal state.\n const text = readConfigObjectPropertyText({ filePath: targetRelative, content, target: { path } });\n if (text === undefined) return content;\n // Changed since the install wrote it — capabilities bound, protocols listed — so it is the application's, and\n // removing it would take the application's decision with it. Kept, and said.\n //\n // Deliberate: a scope that says EXACTLY what the install writes is removed even if the application wrote it\n // before the install (the review's P4). It binds nothing, and once the provider's package is gone it would name\n // a provider no runtime contributes, which `wildo config sync` refuses; removing it is the consistent end state.\n if (text !== renderer.render(edit.valueText ?? '', variables).trim()) {\n kept?.push(`${targetRelative} > ${path.join('.')} (the application changed it since install; remove it yourself if nothing should scope this provider)`);\n return content;\n }\n return removeConfigObjectProperty({ filePath: targetRelative, content, target: { path } }).newContent;\n }\n default:\n // Unreachable: `loadRegistrationScenario` refuses any other kind before a single write.\n throw new Error(`registration cannot reverse edit kind '${edit.kind}'`);\n }\n}\n\n/**\n * The inverse of `package-dependency-add` (#2014): drop each entry the step added, but only while it still carries the\n * specifier the step wrote. A dependency the operator re-pointed since is theirs now, and is kept. Written back in\n * the step's own form (two-space JSON), so a manifest the install edited returns to the same bytes.\n */\nfunction removeAddedDependencies(content: string, targetRelative: string, edit: CompositionScenarioEdit, variables: Record<string, string>): string {\n let manifest: Record<string, unknown>;\n try {\n manifest = JSON.parse(content) as Record<string, unknown>;\n } catch {\n throw new Error(`${targetRelative} is not valid JSON, so the dependency this module added cannot be removed from it.`);\n }\n const field = edit.dependencyField ?? 'dependencies';\n const dependencies = manifest[field];\n if (dependencies === null || typeof dependencies !== 'object' || Array.isArray(dependencies)) return content;\n const next = { ...(dependencies as Record<string, unknown>) };\n let changed = false;\n for (const [nameTemplate, specifierTemplate] of Object.entries(edit.entries ?? {})) {\n const name = renderer.render(nameTemplate, variables);\n if (next[name] === renderer.render(specifierTemplate, variables)) {\n delete next[name];\n changed = true;\n }\n }\n if (!changed) return content;\n manifest[field] = next;\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\n/**\n * The inverse of `ts-import-add`, which inserts `\\n<statement>` right after the last import. Removing\n * exactly that preserves the file's own line endings (CRLF included); a statement found elsewhere is\n * removed as a whole line.\n */\nfunction removeInsertedImport(content: string, statement: string): string {\n const inserted = `\\n${statement}`;\n const at = content.indexOf(inserted);\n if (at !== -1) return content.slice(0, at) + content.slice(at + inserted.length);\n return removeWholeLine(content, statement);\n}\n\n/** Remove the one line whose trimmed text equals `line`, with its line break. */\nfunction removeWholeLine(content: string, line: string): string {\n const lines = content.split('\\n');\n const index = lines.findIndex((candidate) => candidate.trim() === line);\n if (index === -1) return content;\n lines.splice(index, 1);\n return lines.join('\\n');\n}\n\n/**\n * Remove the element / property `matches` selects from the top-level variable `variableName`'s array or object literal:\n * the inverse of the append the registration's scenario made. The removal itself is `removeBracedListEntry`, the one\n * inverse of `appendIntoBracedList` that every caller shares, so this list and a config property cannot come to\n * disagree about what an append added (#2014 review, which found this copy and the runtime's disagreeing about a\n * comment the application wrote inside a list).\n */\nfunction removeListEntry(\n content: string,\n fileName: string,\n variableName: string,\n shape: RegistryAnchorShape,\n matches: (entry: ts.Node, sourceFile: ts.SourceFile) => boolean,\n): string {\n const anchor = findAnchorLiteral(content, fileName, variableName);\n if (!anchor) return content;\n const { sourceFile, literal } = anchor;\n const entries: ts.NodeArray<ts.Node> | null = shape === RegistryAnchorShape.ARRAY && ts.isArrayLiteralExpression(literal)\n ? literal.elements\n : shape === RegistryAnchorShape.OBJECT && ts.isObjectLiteralExpression(literal) ? literal.properties : null;\n if (entries === null) return content;\n const index = entries.findIndex((candidate) => matches(candidate, sourceFile));\n if (index === -1) return content;\n return removeBracedListEntry({ content, sourceFile, entries, index, closeBracePosition: literal.end - 1 });\n}\n\nexport interface InstallRegistrationOutcome {\n /** The registration now applied to the host, to record in the lockfile entry; absent when none is. */\n registration?: ModuleManifestRegistration;\n /** Every change made, in order, for `rollbackInstallRegistration`. */\n snapshots: RegistrationSnapshot[];\n /** Set when the module ends up NOT registered — reported to the operator, never fatal. */\n notice?: string;\n /** Application-owned entries the install or update left as it found them, one sentence each, for the operator. */\n kept: string[];\n /** Labels of the provider scopes already present when this run applied the registration: it wrote none of them. */\n present: string[];\n}\n\nfunction sameRegistration(a: ModuleManifestRegistration, b: ModuleManifestRegistration): boolean {\n return sameShape(a, b) && a.moduleCamel === b.moduleCamel && JSON.stringify(a.providerWiring) === JSON.stringify(b.providerWiring);\n}\n\n/**\n * Install side, provider modules (#2014): the registration an install of `manifest` applies HERE — the wiring derived\n * from this application's own services. The lockfile records it, so `remove` reverses exactly this.\n */\nexport async function deriveProviderRegistration(saasRoot: string, manifest: ModuleManifest): Promise<ModuleManifestRegistration> {\n if (manifest.kind !== ModuleKind.PROVIDER || manifest.provider === undefined) {\n throw new Error(`${manifest.id} is not a provider module; it is registered from its manifest.`);\n }\n const ref = manifest.provider.ref;\n return {\n scenario: ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE,\n moduleId: ref,\n moduleCamel: moduleCamelFromDirectory(ref),\n providerWiring: await deriveProviderWiring(saasRoot, manifest.provider),\n };\n}\n\n/**\n * The install / update step: reverse a PREVIOUS registration the new version no longer carries, then\n * apply the new one. A module that ships no registration, or whose registration cannot be applied here (an\n * application scaffolded before the registry anchors existed, or one that registers the directory itself),\n * installs with the gap MARKED. Throws when reversing a previous registration fails, and when a provider's changed\n * wiring cannot be applied (its partial reversal undone first) — the caller rolls the whole install back for that.\n *\n * A provider's wiring that CHANGED between two derivations (a frontend service added, a facet gained) moves step by\n * step (#2014 review): only the steps the new wiring no longer has are reversed, and the new wiring is then applied\n * over what stays. Undoing all of it and writing it again removed every scope the application had bound and put it\n * back empty.\n */\nexport function registerModuleForInstall(\n saasRoot: string,\n frameworkRoot: string | null,\n manifest: ModuleManifest,\n previous: ModuleManifestRegistration | undefined,\n /** A provider module's wiring, derived by `deriveProviderRegistration` (#2014); a provider manifest carries none. */\n providerRegistration?: ModuleManifestRegistration,\n): InstallRegistrationOutcome {\n const snapshots: RegistrationSnapshot[] = [];\n const kept: string[] = [];\n const present: string[] = [];\n const next = manifest.kind === ModuleKind.PROVIDER ? providerRegistration : manifest.registration;\n const keepsPrevious = previous !== undefined && next !== undefined && sameRegistration(previous, next);\n const providerTransition = previous !== undefined && next !== undefined && !keepsPrevious\n && previous.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE && next.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE;\n if (previous && !keepsPrevious) {\n if (providerTransition) {\n const nextVariables = registrationVariables(next);\n const nextSteps = new Set((loadRegistrationScenario(saasRoot, frameworkRoot, next).manifest.edits ?? []).map((edit) => editIdentity(edit, nextVariables)));\n snapshots.push(reverseModuleRegistration(saasRoot, frameworkRoot, previous, {\n only: (edit, variables) => !nextSteps.has(editIdentity(edit, variables)),\n kept,\n }));\n } else {\n snapshots.push(reverseModuleRegistration(saasRoot, frameworkRoot, previous, { kept }));\n }\n }\n if (!next) {\n return {\n snapshots,\n kept,\n present,\n notice: 'the module ships no registration (its publisher did not register it, or it is not a shape registration covers); '\n + 'declare it in the application by hand',\n };\n }\n try {\n // A provider transition re-applies over the steps it kept, so it must not refuse what is already there.\n snapshots.push(applyModuleRegistration(saasRoot, frameworkRoot, manifest, next, { expectNothingPresent: !keepsPrevious && !providerTransition, kept, present }));\n return { registration: next, snapshots, kept, present };\n } catch (error) {\n const notice = `could not register it: ${ErrorUtils.extractErrorMessage(error)}`;\n if (providerTransition) {\n // A provider transition reversed only PART of the previous wiring and kept the rest. Neither answer that lets\n // the update go on is coherent: recording no registration leaves the kept steps with nothing able to remove them\n // (#2014 re-review H1), and recording the PREVIOUS one describes files this update is about to replace, a facet\n // it deletes included (third review F2). So the partial reversal is undone and the update FAILS; the command's\n // own catch rolls the new files back, which leaves the old files and the old wiring together.\n rollbackInstallRegistration(saasRoot, snapshots);\n throw new Error(`${notice}. The update was not applied; the installed version and its wiring are unchanged.`);\n }\n // Re-applying the SAME registration failed: its entries are still in place, so it stays recorded.\n return { ...(keepsPrevious ? { registration: previous } : {}), snapshots, kept, present, notice };\n }\n}\n\n/** Undo `registerModuleForInstall` (a failed install's rollback), latest change first. */\nexport function rollbackInstallRegistration(saasRoot: string, snapshots: readonly RegistrationSnapshot[]): void {\n for (const snapshot of [...snapshots].reverse()) restoreRegistrationSnapshot(saasRoot, snapshot);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-requirements.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"module-requirements.service.d.ts","sourceRoot":"","sources":["../../../../src/services/registry/module-requirements.service.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqD,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAevH,sFAAsF;AACtF,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,eAAe,EAAE,MAAM,GAAG,yBAAyB,EAAE,CA0DrG;AAMD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAsClH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-requirements.service.js","sourceRoot":"","sources":["../../../../../../src/services/registry/module-requirements.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,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,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,UAAU,QAAQ,CAAC,EAAE,uBAAuB,KAAK,uCAAuC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,KAAK,OAAO,MAAM,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QACjR,CAAC;IACH,CAAC;IACD,OAAO;QACL,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,mBAAmB,IAAI,IAAI,KAAK,EAAE,CAAC;QAClH,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,wBAAwB,IAAI,IAAI,KAAK,EAAE,CAAC;KAC5H,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,GAAG,WAAW,gIAAgI,CAAC,CAAC;AACzK,CAAC","sourcesContent":["import { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, join, resolve } from 'node:path';\nimport { globSync } from 'glob';\nimport { parse as parseYaml } from 'yaml';\nimport { satisfies, valid, validRange } from 'semver';\nimport { z } from 'zod';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport { EngineCapabilityActivationsSchema, loadSaasConfig, type ModuleManifest } from '@wildo-ai/platform-config-lib';\nimport { RegistryLockfileService } from '@wildo-ai/wildo-module-client';\n\nconst dependencyMap = z.record(z.string(), z.string()).optional();\nconst packageManifestSchema = z.object({\n name: z.string().optional(),\n version: z.string().optional(),\n dependencies: dependencyMap,\n devDependencies: dependencyMap,\n peerDependencies: dependencyMap,\n optionalDependencies: dependencyMap,\n});\nconst workspaceSchema = z.object({ packages: z.array(z.string()).default([]) });\nconst FRAMEWORK_MODELS_PACKAGE = '@wildo-ai/saas-models';\n\n/** An observed installed package, not a desired override or the CLI's own version. */\nexport interface InstalledFrameworkVersion {\n manifestPath: string;\n version: string;\n}\n\nfunction readPackage(manifestPath: string) {\n return packageManifestSchema.parse(JSON.parse(readFileSync(manifestPath, 'utf8')));\n}\n\n/**\n * Follow installed framework imports from every authored workspace package. Resolve from physical\n * package locations so pnpm's isolated copies remain distinct. Reading the package directory avoids\n * requiring a package.json public export; Node's lookup paths determine which directory is visible.\n * Workspace exclusions apply to entry roots, not to installed dependencies reached from those roots.\n */\nexport function readApplicationFrameworkVersions(applicationRoot: string): InstalledFrameworkVersion[] {\n const root = resolve(applicationRoot);\n const workspacePath = join(root, 'pnpm-workspace.yaml');\n const patterns = existsSync(workspacePath)\n ? workspaceSchema.parse(parseYaml(readFileSync(workspacePath, 'utf8'))).packages\n : [];\n const exclusions = patterns.filter((pattern) => pattern.startsWith('!')).map((pattern) => pattern.slice(1));\n const ignore = ['**/node_modules/**', '**/.git/**', '.wildo-saas/**', ...exclusions];\n const members = globSync(patterns.filter((pattern) => !pattern.startsWith('!')), { cwd: root, ignore, dot: true });\n const workspaceManifests = [root, ...members.map((member) => resolve(root, member))]\n .map((member) => join(member, 'package.json'))\n .filter(existsSync)\n .map((manifestPath) => realpathSync(manifestPath));\n const authoredWorkspaceManifests = new Set(workspaceManifests);\n const pending = [...workspaceManifests];\n const visited = new Set<string>();\n const versions: InstalledFrameworkVersion[] = [];\n\n while (pending.length) {\n const manifestPath = realpathSync(pending.pop()!);\n if (visited.has(manifestPath)) continue;\n visited.add(manifestPath);\n const manifest = readPackage(manifestPath);\n if (manifest.name === FRAMEWORK_MODELS_PACKAGE) {\n if (!manifest.version || !valid(manifest.version)) {\n throw new Error(`Cannot verify framework compatibility: ${manifestPath} has no valid installed version.`);\n }\n versions.push({ manifestPath, version: manifest.version });\n }\n const required = { ...manifest.dependencies, ...(authoredWorkspaceManifests.has(manifestPath) ? manifest.devDependencies : {}) };\n const dependencies = { ...required, ...manifest.peerDependencies, ...manifest.optionalDependencies };\n const lookup = createRequire(manifestPath);\n // Ignore process-global NODE_PATH additions (including the CLI's own installation).\n // Only package-directory ancestry establishes the receiving workspace's installed imports.\n const localLookupPaths = new Set<string>();\n let directory = dirname(manifestPath);\n for (;;) {\n localLookupPaths.add(join(directory, 'node_modules'));\n const parent = dirname(directory);\n if (parent === directory) break;\n directory = parent;\n }\n for (const name of Object.keys(dependencies).filter((name) => name.startsWith('@wildo-ai/'))) {\n const resolved = (lookup.resolve.paths(name) ?? [])\n .filter((directory) => localLookupPaths.has(directory))\n .map((directory) => join(directory, name, 'package.json'))\n .find(existsSync);\n if (resolved) {\n pending.push(resolved);\n } else if (name in required && !(name in (manifest.optionalDependencies ?? {}))) {\n throw new Error(`Cannot verify framework compatibility: ${name}, declared by ${manifestPath}, is not installed. Install application dependencies first.`);\n }\n }\n }\n if (!versions.length) {\n throw new Error(`Cannot verify framework compatibility: no installed ${FRAMEWORK_MODELS_PACKAGE} is reachable from ${root}. Install application dependencies first.`);\n }\n return versions;\n}\n\nfunction requireRange(range: string, requirement: string): void {\n if (!validRange(range)) throw new Error(`${requirement} declares invalid semver range \"${range}\". Dependency requirements must use ranges, not registry tags.`);\n}\n\n/**\n * Read-only adoption preflight. Call after verified extraction/manifest parsing and before any\n * application source or adoption-record mutation, including same-version repair. Each requirement\n * loads only the host surface it needs. A passing lockfile check proves recorded adoption; authored\n * capability activation and installed package versions do not assert a healthy running application.\n * Returned npm notices are advisory and never cause package edits or dependency installation.\n */\nexport async function checkModuleRequirements(applicationRoot: string, manifest: ModuleManifest): Promise<string[]> {\n const requirements = manifest.dependsOn;\n const moduleRequirements = Object.entries(requirements?.modules ?? {});\n if (moduleRequirements.length) {\n const installed = await RegistryLockfileService.read(applicationRoot);\n for (const [moduleId, range] of moduleRequirements) {\n requireRange(range, `Module ${moduleId}`);\n if (moduleId === manifest.id) throw new Error(`Module ${manifest.id} cannot declare itself as a prerequisite.`);\n const version = installed.installed[moduleId]?.version;\n if (!version || !satisfies(version, range)) {\n throw new Error(`Module ${manifest.id} requires ${moduleId}@${range}; recorded adoption is ${version ?? 'missing'}. Add or update that dependency first.`);\n }\n }\n }\n if (requirements?.capabilities.length) {\n const configPath = join(applicationRoot, 'wildo.saas.config.ts');\n const requiredCapabilities = z.array(z.enum(EngineCapability)).parse(requirements.capabilities);\n const config = await loadSaasConfig(configPath);\n if (!config) throw new Error(`Module ${manifest.id} requires capability activation, but ${configPath} is missing.`);\n const activations = EngineCapabilityActivationsSchema.parse(config.engineCapabilities);\n const missing = requiredCapabilities.filter((capability) => activations[capability]?.enabled !== true);\n if (missing.length) {\n throw new Error(`Module ${manifest.id} requires enabled capabilities: ${missing.join(', ')}. Configure their activation and providers in ${configPath} before adoption.`);\n }\n }\n if (manifest.engine) {\n const range = manifest.engine.framework;\n requireRange(range, `Module ${manifest.id} framework requirement`);\n const versions = readApplicationFrameworkVersions(applicationRoot);\n const incompatible = versions.filter(({ version }) => !satisfies(version, range));\n if (incompatible.length) {\n throw new Error(`Module ${manifest.id} requires framework ${range}; incompatible installed packages:\\n${incompatible.map(({ version, manifestPath }) => ` ${version} — ${manifestPath}`).join('\\n')}\\nAlign the application's installed framework packages before adoption.`);\n }\n }\n return [\n ...Object.entries(requirements?.npm.dependencies ?? {}).map(([name, range]) => `npm dependency: ${name}@${range}`),\n ...Object.entries(requirements?.npm.peerDependencies ?? {}).map(([name, range]) => `npm peer dependency: ${name}@${range}`),\n ].map((requirement) => `${requirement} — advisory: review and declare it in the consuming application package; no package.json edits or installation were performed.`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"module-requirements.service.js","sourceRoot":"","sources":["../../../../src/services/registry/module-requirements.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,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e,CAAC,CAAC;QACnE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAClF,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,UAAU,QAAQ,CAAC,EAAE,uBAAuB,KAAK,uCAAuC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,KAAK,OAAO,MAAM,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QACjR,CAAC;IACH,CAAC;IACD,OAAO;QACL,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,mBAAmB,IAAI,IAAI,KAAK,EAAE,CAAC;QAClH,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,wBAAwB,IAAI,IAAI,KAAK,EAAE,CAAC;KAC5H,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,GAAG,WAAW,gIAAgI,CAAC,CAAC;AACzK,CAAC","sourcesContent":["import { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, join, resolve } from 'node:path';\nimport { globSync } from 'glob';\nimport { parse as parseYaml } from 'yaml';\nimport { satisfies, valid, validRange } from 'semver';\nimport { z } from 'zod';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport { EngineCapabilityActivationsSchema, loadSaasConfig, type ModuleManifest } from '@wildo-ai/platform-config-lib';\nimport { RegistryLockfileService } from '@wildo-ai/wildo-module-client';\n\nconst dependencyMap = z.record(z.string(), z.string()).optional();\nconst packageManifestSchema = z.object({\n name: z.string().optional(),\n version: z.string().optional(),\n dependencies: dependencyMap,\n devDependencies: dependencyMap,\n peerDependencies: dependencyMap,\n optionalDependencies: dependencyMap,\n});\nconst workspaceSchema = z.object({ packages: z.array(z.string()).default([]) });\nconst FRAMEWORK_MODELS_PACKAGE = '@wildo-ai/saas-models';\n\n/** An observed installed package, not a desired override or the CLI's own version. */\nexport interface InstalledFrameworkVersion {\n manifestPath: string;\n version: string;\n}\n\nfunction readPackage(manifestPath: string) {\n return packageManifestSchema.parse(JSON.parse(readFileSync(manifestPath, 'utf8')));\n}\n\n/**\n * Follow installed framework imports from every authored workspace package. Resolve from physical\n * package locations so pnpm's isolated copies remain distinct. Reading the package directory avoids\n * requiring a package.json public export; Node's lookup paths determine which directory is visible.\n * Workspace exclusions apply to entry roots, not to installed dependencies reached from those roots.\n */\nexport function readApplicationFrameworkVersions(applicationRoot: string): InstalledFrameworkVersion[] {\n const root = resolve(applicationRoot);\n const workspacePath = join(root, 'pnpm-workspace.yaml');\n const patterns = existsSync(workspacePath)\n ? workspaceSchema.parse(parseYaml(readFileSync(workspacePath, 'utf8'))).packages\n : [];\n const exclusions = patterns.filter((pattern) => pattern.startsWith('!')).map((pattern) => pattern.slice(1));\n const ignore = ['**/node_modules/**', '**/.git/**', '.wildo-saas/**', ...exclusions];\n const members = globSync(patterns.filter((pattern) => !pattern.startsWith('!')), { cwd: root, ignore, dot: true });\n const workspaceManifests = [root, ...members.map((member) => resolve(root, member))]\n .map((member) => join(member, 'package.json'))\n .filter(existsSync)\n .map((manifestPath) => realpathSync(manifestPath));\n const authoredWorkspaceManifests = new Set(workspaceManifests);\n const pending = [...workspaceManifests];\n const visited = new Set<string>();\n const versions: InstalledFrameworkVersion[] = [];\n\n while (pending.length) {\n const manifestPath = realpathSync(pending.pop()!);\n if (visited.has(manifestPath)) continue;\n visited.add(manifestPath);\n const manifest = readPackage(manifestPath);\n if (manifest.name === FRAMEWORK_MODELS_PACKAGE) {\n if (!manifest.version || !valid(manifest.version)) {\n throw new Error(`Cannot verify framework compatibility: ${manifestPath} has no valid installed version.`);\n }\n versions.push({ manifestPath, version: manifest.version });\n }\n const required = { ...manifest.dependencies, ...(authoredWorkspaceManifests.has(manifestPath) ? manifest.devDependencies : {}) };\n const dependencies = { ...required, ...manifest.peerDependencies, ...manifest.optionalDependencies };\n const lookup = createRequire(manifestPath);\n // Ignore process-global NODE_PATH additions (including the CLI's own installation).\n // Only package-directory ancestry establishes the receiving workspace's installed imports.\n const localLookupPaths = new Set<string>();\n let directory = dirname(manifestPath);\n for (;;) {\n localLookupPaths.add(join(directory, 'node_modules'));\n const parent = dirname(directory);\n if (parent === directory) break;\n directory = parent;\n }\n for (const name of Object.keys(dependencies).filter((name) => name.startsWith('@wildo-ai/'))) {\n const resolved = (lookup.resolve.paths(name) ?? [])\n .filter((directory) => localLookupPaths.has(directory))\n .map((directory) => join(directory, name, 'package.json'))\n .find(existsSync);\n if (resolved) {\n pending.push(resolved);\n } else if (name in required && !(name in (manifest.optionalDependencies ?? {}))) {\n throw new Error(`Cannot verify framework compatibility: ${name}, declared by ${manifestPath}, is not installed. Install application dependencies first.`);\n }\n }\n }\n if (!versions.length) {\n throw new Error(`Cannot verify framework compatibility: no installed ${FRAMEWORK_MODELS_PACKAGE} is reachable from ${root}. Install application dependencies first.`);\n }\n return versions;\n}\n\nfunction requireRange(range: string, requirement: string): void {\n if (!validRange(range)) throw new Error(`${requirement} declares invalid semver range \"${range}\". Dependency requirements must use ranges, not registry tags.`);\n}\n\n/**\n * Read-only adoption preflight. Call after verified extraction/manifest parsing and before any\n * application source or adoption-record mutation, including same-version repair. Each requirement\n * loads only the host surface it needs. A passing lockfile check proves recorded adoption; authored\n * capability activation and installed package versions do not assert a healthy running application.\n * Returned npm notices are advisory and never cause package edits or dependency installation.\n */\nexport async function checkModuleRequirements(applicationRoot: string, manifest: ModuleManifest): Promise<string[]> {\n const requirements = manifest.dependsOn;\n const moduleRequirements = Object.entries(requirements?.modules ?? {});\n if (moduleRequirements.length) {\n const installed = await RegistryLockfileService.read(applicationRoot);\n for (const [moduleId, range] of moduleRequirements) {\n requireRange(range, `Module ${moduleId}`);\n if (moduleId === manifest.id) throw new Error(`Module ${manifest.id} cannot declare itself as a prerequisite.`);\n const version = installed.installed[moduleId]?.version;\n if (!version || !satisfies(version, range)) {\n throw new Error(`Module ${manifest.id} requires ${moduleId}@${range}; recorded adoption is ${version ?? 'missing'}. Add or update that dependency first.`);\n }\n }\n }\n if (requirements?.capabilities.length) {\n const configPath = join(applicationRoot, 'wildo.saas.config.ts');\n const requiredCapabilities = z.array(z.enum(EngineCapability)).parse(requirements.capabilities);\n const config = await loadSaasConfig(configPath);\n if (!config) throw new Error(`Module ${manifest.id} requires capability activation, but ${configPath} is missing.`);\n const activations = EngineCapabilityActivationsSchema.parse(config.engineCapabilities);\n const missing = requiredCapabilities.filter((capability) => activations[capability]?.enabled !== true);\n if (missing.length) {\n throw new Error(`Module ${manifest.id} requires enabled capabilities: ${missing.join(', ')}. Configure their activation and providers in ${configPath} before adoption.`);\n }\n }\n if (manifest.engine) {\n const range = manifest.engine.framework;\n requireRange(range, `Module ${manifest.id} framework requirement`);\n const versions = readApplicationFrameworkVersions(applicationRoot);\n const incompatible = versions.filter(({ version }) => !satisfies(version, range));\n if (incompatible.length) {\n throw new Error(`Module ${manifest.id} requires framework ${range}; incompatible installed packages:\\n${incompatible.map(({ version, manifestPath }) => ` ${version} — ${manifestPath}`).join('\\n')}\\nAlign the application's installed framework packages before adoption.`);\n }\n }\n return [\n ...Object.entries(requirements?.npm.dependencies ?? {}).map(([name, range]) => `npm dependency: ${name}@${range}`),\n ...Object.entries(requirements?.npm.peerDependencies ?? {}).map(([name, range]) => `npm peer dependency: ${name}@${range}`),\n ].map((requirement) => `${requirement} — advisory: review and declare it in the consuming application package; no package.json edits or installation were performed.`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-install-step.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"provider-install-step.d.ts","sourceRoot":"","sources":["../../../../src/services/registry/provider-install-step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,iFAAiF;AACjF,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,uHAAuH;AACvH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAE3D;AAED,wFAAwF;AACxF,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAQxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-install-step.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"provider-install-step.js","sourceRoot":"","sources":["../../../../src/services/registry/provider-install-step.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AAEvF,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,2GAA2G;CAChH,CAAC;AAEX,uHAAuH;AACvH,MAAM,UAAU,cAAc,CAAC,GAAmB;IAChD,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AACzE,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,0BAA0B,CAAC,GAAmB,EAAE,QAAgB,EAAE,QAAgB;IAChG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,2CAA2C,QAAQ,sCAAsC,QAAQ,sBAAsB,CAAC,CAAC;QACtI,OAAO;IACT,CAAC;IACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;QACvD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,QAAQ,uFAAuF,QAAQ,GAAG,CAAC,CAAC;IAChI,CAAC;AACH,CAAC","sourcesContent":["/**\n * The package install after a provider module is added, updated or removed (#2014), the way `shadcn add` installs.\n *\n * A provider brings its own SDKs as dependencies of its facet packages, and the wiring makes those packages\n * `workspace:*` dependencies of the application's runtimes. Until `pnpm install` runs, none of it resolves, and the\n * provider sync that follows cannot discover the new package. So a registry command that changed a provider runs it,\n * before that sync.\n *\n * A failed install does not undo the command: the files, the wiring and the lockfile are consistent, and re-running\n * the install is the whole remedy, so the command says so and succeeds. `--no-install` skips it for a caller that\n * batches several changes; Commander reads that flag as `install: false`.\n */\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport { runPnpmInstall } from '~wildo-cli/services/framework/package-install.service';\n\n/** The flag that skips the install; declared on `add`, `update` and `remove`. */\nexport const NO_INSTALL_FLAG = {\n type: 'boolean',\n description: 'Do not run `pnpm install` after a provider module changes; run it yourself before the application starts.',\n} as const;\n\n/** Whether the command was asked to skip the install (`--no-install`, which Commander exposes as `install: false`). */\nexport function installSkipped(ctx: CommandContext): boolean {\n return ctx.flags.install === false || ctx.flags['no-install'] === true;\n}\n\n/** Run the install for a changed provider module, or say what the operator must run. */\nexport function installAfterProviderChange(ctx: CommandContext, saasRoot: string, moduleId: string): void {\n if (installSkipped(ctx)) {\n ctx.log.info(` --no-install: run \\`pnpm install\\` in ${saasRoot} before the application starts, so ${moduleId}'s packages resolve.`);\n return;\n }\n if (!runPnpmInstall(ctx.log, 'pnpm install', saasRoot)) {\n ctx.log.warn(` ${moduleId} is in place and wired, and its packages are not installed. Run \\`pnpm install\\` in ${saasRoot}.`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-module-checks.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"provider-module-checks.service.d.ts","sourceRoot":"","sources":["../../../../src/services/registry/provider-module-checks.service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AAwCvC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,CAAA;CAAE,GAAG,MAAM,EAAE,CAyDzH;AAeD;;;;;;;;;;;;GAYG;AACH,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA2CnI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-module-checks.service.js","sourceRoot":"","sources":["../../../../../../src/services/registry/provider-module-checks.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,sCAAsC,GAEvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qCAAqC,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AAC3I,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,kHAAkH;AAClH,MAAM,yBAAyB,GAAG,CAAC,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,CAAU,CAAC;AAExG;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,CAAC,YAAY,EAAE,SAA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uF,CAAC,CAAC;IAC9J,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,QAAQ,CAAC,IAAI,CAAC,yBAAyB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,KAAK,iDAAiD,CAAC,CAAC;IACpJ,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;AACnG,CAAC","sourcesContent":["/**\n * What a PROVIDER module must be before it is published or installed (#2014, epic #2012).\n *\n * A provider module is one vendor's integration, laid out as one workspace package per FACET:\n * `providers/<ref>/backend/` and, when it has a browser part, `providers/<ref>/frontend/`. Each facet is installed\n * into the runtimes of that facet only, so the layout is what keeps a backend SDK out of a browser bundle and a\n * system of record out of the provider lane. These checks refuse the shapes that would break that, and each refusal\n * names the file to change.\n *\n * Run on the module's own directory (the one holding its facets): an application's `providers/<ref>/` when it\n * publishes, and a framework checkout's `providers-registry/<ref>/` when an application installs from it (#2015).\n *\n * The checks that need the module's CODE are {@link providerModuleCodeRefusals}: they load the backend facet, so they\n * run at publish, where the publishing application has the packages that code imports.\n */\nimport { readdirSync, readFileSync, statSync } from 'node:fs';\nimport * as path from 'node:path';\nimport {\n ProviderModuleFacet,\n loadConfigExport,\n providerModuleFacets,\n readSystemOfRecordFacetModuleSpecifier,\n type ModuleManifestProvider,\n} from '@wildo-ai/platform-config-lib';\nimport { BACKEND_PROVIDER_FRAGMENT_EXPORT_NAME, readBackendProviderFragment } from '@wildo-ai/external-connectors-private/backend-runtime';\nimport { ProviderOriginKind } from '@wildo-ai/saas-models';\n\n/** The dependency fields that put a package into a runtime's graph. `devDependencies` never reaches a runtime. */\nconst RUNTIME_DEPENDENCY_FIELDS = ['dependencies', 'peerDependencies', 'optionalDependencies'] as const;\n\n/**\n * The scripts pnpm runs for a WORKSPACE package during `pnpm install`. A provider's facets become workspace packages of\n * the application, and `registry add` runs the install itself (#2014), so one of these would run code from the copied\n * module on the developer's machine before anyone had read it. A provider needs none of them: it is TypeScript the\n * application's own watchers compile.\n */\nconst INSTALL_LIFECYCLE_SCRIPTS = ['preinstall', 'install', 'postinstall', 'preprepare', 'prepare', 'postprepare'] as const;\n\ninterface FacetManifest {\n readonly name?: unknown;\n readonly scripts?: Record<string, unknown>;\n readonly exports?: Record<string, unknown>;\n readonly dependencies?: Record<string, string>;\n readonly peerDependencies?: Record<string, string>;\n readonly optionalDependencies?: Record<string, string>;\n}\n\nfunction readFacetManifest(facetDir: string): FacetManifest | undefined {\n try {\n return JSON.parse(readFileSync(path.join(facetDir, 'package.json'), 'utf8')) as FacetManifest;\n } catch {\n return undefined;\n }\n}\n\nfunction isDirectory(candidate: string): boolean {\n try {\n return statSync(candidate).isDirectory();\n } catch {\n return false;\n }\n}\n\n/**\n * Every structural refusal for a provider module, as sentences naming the path relative to `moduleRoot`'s parent.\n * Empty means the layout is sound.\n *\n * 1. Each declared facet is a package: `<facet>/package.json` exists and names the package.\n * 2. Nothing else is a package: a directory beside the facets that carries a `package.json`, or a facet directory\n * the manifest does not declare, would be copied into the application and installed nowhere, or installed\n * everywhere.\n * 3. The browser facet does not depend on the backend facet. Isolation is a property of the dependency graph: a\n * browser package that depends on the backend one pulls the backend's SDKs and secrets handling into a bundle.\n * 4. No system-of-record content. Systems of record are their own lane (`@wildo-ai/systems-of-record`), and discovery\n * never admits a facet module from a registry provider, so shipping one would be dead code at best.\n * 5. No install lifecycle script in a facet manifest ({@link INSTALL_LIFECYCLE_SCRIPTS}).\n *\n * Run at publish (on the publishing application's copy) and at every install, on the STAGED copy, whichever origin it\n * came from (`stageModuleAcquisition`): a registry artifact is someone else's bytes, and the server runs no such check.\n */\nexport function providerModuleStructureRefusals(input: { moduleRoot: string; provider: ModuleManifestProvider }): string[] {\n const { moduleRoot, provider } = input;\n const label = (relative: string) => path.posix.join(path.basename(moduleRoot), relative);\n const refusals: string[] = [];\n const declared = new Set<string>(providerModuleFacets(provider));\n const packageNames = new Map<ProviderModuleFacet, string>();\n\n for (const facet of providerModuleFacets(provider)) {\n const facetManifest = readFacetManifest(path.join(moduleRoot, facet));\n if (facetManifest === undefined) {\n refusals.push(`${label(`${facet}/package.json`)} is missing or unreadable: the manifest declares a ${facet} facet, and each facet is its own package.`);\n continue;\n }\n if (typeof facetManifest.name !== 'string' || facetManifest.name.length === 0) {\n refusals.push(`${label(`${facet}/package.json`)} names no package.`);\n continue;\n }\n packageNames.set(facet, facetManifest.name);\n const lifecycle = INSTALL_LIFECYCLE_SCRIPTS.filter((script) => facetManifest.scripts?.[script] !== undefined);\n if (lifecycle.length > 0) {\n refusals.push(`${label(`${facet}/package.json`)} declares ${lifecycle.join(', ')}: \\`pnpm install\\` would run it on the installing machine. A provider facet runs no install script.`);\n }\n }\n\n let entries: string[] = [];\n try {\n entries = readdirSync(moduleRoot);\n } catch {\n refusals.push(`${path.basename(moduleRoot)} cannot be read.`);\n }\n for (const entry of entries.sort()) {\n if (declared.has(entry) || !isDirectory(path.join(moduleRoot, entry))) continue;\n if ((Object.values(ProviderModuleFacet) as string[]).includes(entry)) {\n refusals.push(`${label(entry)}/ is a ${entry} facet the manifest does not declare. Declare it under provider.facets, or remove the directory.`);\n } else if (readFacetManifest(path.join(moduleRoot, entry)) !== undefined) {\n refusals.push(`${label(`${entry}/package.json`)} is a package outside the declared facets (${[...declared].join(', ')}). A provider module's packages are its facets.`);\n }\n }\n\n const backendName = packageNames.get(ProviderModuleFacet.BACKEND);\n const frontendManifest = packageNames.has(ProviderModuleFacet.FRONTEND) ? readFacetManifest(path.join(moduleRoot, ProviderModuleFacet.FRONTEND)) : undefined;\n if (backendName !== undefined && frontendManifest !== undefined) {\n for (const field of RUNTIME_DEPENDENCY_FIELDS) {\n if (frontendManifest[field]?.[backendName] !== undefined) {\n refusals.push(`${label('frontend/package.json')} lists the backend facet \"${backendName}\" in ${field}: the browser package would carry the backend's code and SDKs into a bundle.`);\n }\n }\n }\n\n for (const facet of packageNames.keys()) {\n const facetModule = readSystemOfRecordFacetModuleSpecifier(path.join(moduleRoot, facet));\n if (facetModule !== undefined) {\n refusals.push(`${label(`${facet}/package.json`)} exports a system-of-record facet (${facetModule}). Systems of record are their own lane (@wildo-ai/systems-of-record); a registry provider never carries one.`);\n }\n }\n\n return refusals;\n}\n\n/** The source file a facet's `./backend` export names: its `source` condition when present, else the plain target. */\nfunction backendEntrySource(facetManifest: FacetManifest): string | undefined {\n const entry = facetManifest.exports?.['./backend'];\n if (typeof entry === 'string') return entry;\n if (entry !== null && typeof entry === 'object') {\n const conditions = entry as Record<string, unknown>;\n for (const condition of ['source', 'import', 'default']) {\n if (typeof conditions[condition] === 'string') return conditions[condition] as string;\n }\n }\n return undefined;\n}\n\n/**\n * Every refusal that needs the backend facet's CODE, the second half of the publish checks (#2014). Empty for a\n * module with no backend facet.\n *\n * 1. The module the facet ships (its `backendProviderFragment`, the export every host loads a provider by) is the one\n * the manifest describes: exactly one provider, of the manifest's ref, tier, vendor and provider capabilities.\n * Search, the tier fence and the engine capabilities derived for the listing all read the MANIFEST, so a manifest\n * that disagreed with the code would advertise a provider nobody ships.\n * 2. Its origin is APPLICATION. An installed copy is the application's; a seed carries GENERATED and must be adopted\n * before it is published.\n * 3. Every package it declares in `requiredPackages` (the SDKs it lazy-loads) is a runtime dependency of the facet,\n * because an installed copy resolves its SDKs from its own `package.json` and nothing else supplies them.\n */\nexport async function providerModuleCodeRefusals(input: { moduleRoot: string; provider: ModuleManifestProvider }): Promise<string[]> {\n const { moduleRoot, provider } = input;\n if (!providerModuleFacets(provider).includes(ProviderModuleFacet.BACKEND)) return [];\n const facetDir = path.join(moduleRoot, ProviderModuleFacet.BACKEND);\n const label = path.posix.join(path.basename(moduleRoot), 'backend');\n const facetManifest = readFacetManifest(facetDir);\n if (facetManifest === undefined) return []; // the structural checks already refused it\n const entry = backendEntrySource(facetManifest);\n if (entry === undefined) {\n return [`${label}/package.json exports no \\`./backend\\` entry, which is how every host loads a provider.`];\n }\n\n let fragment;\n try {\n const exported = await loadConfigExport<unknown>(path.resolve(facetDir, entry), BACKEND_PROVIDER_FRAGMENT_EXPORT_NAME);\n fragment = readBackendProviderFragment({ [BACKEND_PROVIDER_FRAGMENT_EXPORT_NAME]: exported }, `${label}/${entry}`);\n } catch (error) {\n return [`${label}/${entry} could not be loaded as a provider module: ${error instanceof Error ? error.message : String(error)}`];\n }\n\n const modules = [...fragment.modules.values()];\n if (modules.length !== 1) {\n return [`${label}/${entry} contributes ${modules.length} providers; a provider module ships exactly one (${provider.ref}).`];\n }\n const module = modules[0]!;\n const refusals: string[] = [];\n const says = (field: string, code: unknown, manifest: unknown) =>\n refusals.push(`the module declares ${field} ${JSON.stringify(code)}, and wildo.module.json says ${JSON.stringify(manifest)}.`);\n if (module.metadata.ref !== provider.ref) says('ref', module.metadata.ref, provider.ref);\n if (module.metadata.tier !== provider.tier) says('tier', module.metadata.tier, provider.tier);\n if (provider.vendor !== undefined && module.metadata.vendor !== provider.vendor) says('vendor', module.metadata.vendor, provider.vendor);\n const codeCapabilities = [...module.providerCapabilities].map(String).sort();\n const manifestCapabilities = [...provider.providerCapabilities].sort();\n if (JSON.stringify(codeCapabilities) !== JSON.stringify(manifestCapabilities)) says('providerCapabilities', codeCapabilities, manifestCapabilities);\n if (module.metadata.origin.kind !== ProviderOriginKind.APPLICATION) {\n refusals.push(`the module's origin is ${module.metadata.origin.kind}; a published provider is the installing application's (APPLICATION). Adopt it first.`);\n }\n const declared = new Set(RUNTIME_DEPENDENCY_FIELDS.flatMap((field) => Object.keys(facetManifest[field] ?? {})));\n const undeclared = (module.requiredPackages ?? []).filter((name) => !declared.has(name));\n if (undeclared.length > 0) {\n refusals.push(`the module lazy-loads ${undeclared.join(', ')} (requiredPackages), which ${label}/package.json does not declare as a dependency.`);\n }\n return refusals.map((refusal) => (refusal.startsWith(label) ? refusal : `${label}: ${refusal}`));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"provider-module-checks.service.js","sourceRoot":"","sources":["../../../../src/services/registry/provider-module-checks.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,sCAAsC,GAEvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qCAAqC,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AAC3I,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,kHAAkH;AAClH,MAAM,yBAAyB,GAAG,CAAC,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,CAAU,CAAC;AAExG;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAU,CAAC;AAW5H,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cA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AC,CAAC;IAChH,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,QAAQ,CAAC,IAAI,CAAC,yBAAyB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,KAAK,iDAAiD,CAAC,CAAC;IACpJ,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;AACnG,CAAC","sourcesContent":["/**\n * What a PROVIDER module must be before it is published or installed (#2014, epic #2012).\n *\n * A provider module is one vendor's integration, laid out as one workspace package per FACET:\n * `providers/<ref>/backend/` and, when it has a browser part, `providers/<ref>/frontend/`. Each facet is installed\n * into the runtimes of that facet only, so the layout is what keeps a backend SDK out of a browser bundle and a\n * system of record out of the provider lane. These checks refuse the shapes that would break that, and each refusal\n * names the file to change.\n *\n * Run on the module's own directory (the one holding its facets): an application's `providers/<ref>/` when it\n * publishes, and a framework checkout's `providers-registry/<ref>/` when an application installs from it (#2015).\n *\n * The checks that need the module's CODE are {@link providerModuleCodeRefusals}: they load the backend facet, so they\n * run at publish, where the publishing application has the packages that code imports.\n */\nimport { readdirSync, readFileSync, statSync } from 'node:fs';\nimport * as path from 'node:path';\nimport {\n ProviderModuleFacet,\n loadConfigExport,\n providerModuleFacets,\n readSystemOfRecordFacetModuleSpecifier,\n type ModuleManifestProvider,\n} from '@wildo-ai/platform-config-lib';\nimport { BACKEND_PROVIDER_FRAGMENT_EXPORT_NAME, readBackendProviderFragment } from '@wildo-ai/external-connectors-private/backend-runtime';\nimport { ProviderOriginKind } from '@wildo-ai/saas-models';\n\n/** The dependency fields that put a package into a runtime's graph. `devDependencies` never reaches a runtime. */\nconst RUNTIME_DEPENDENCY_FIELDS = ['dependencies', 'peerDependencies', 'optionalDependencies'] as const;\n\n/**\n * The scripts pnpm runs for a WORKSPACE package during `pnpm install`. A provider's facets become workspace packages of\n * the application, and `registry add` runs the install itself (#2014), so one of these would run code from the copied\n * module on the developer's machine before anyone had read it. A provider needs none of them: it is TypeScript the\n * application's own watchers compile.\n */\nconst INSTALL_LIFECYCLE_SCRIPTS = ['preinstall', 'install', 'postinstall', 'preprepare', 'prepare', 'postprepare'] as const;\n\ninterface FacetManifest {\n readonly name?: unknown;\n readonly scripts?: Record<string, unknown>;\n readonly exports?: Record<string, unknown>;\n readonly dependencies?: Record<string, string>;\n readonly peerDependencies?: Record<string, string>;\n readonly optionalDependencies?: Record<string, string>;\n}\n\nfunction readFacetManifest(facetDir: string): FacetManifest | undefined {\n try {\n return JSON.parse(readFileSync(path.join(facetDir, 'package.json'), 'utf8')) as FacetManifest;\n } catch {\n return undefined;\n }\n}\n\nfunction isDirectory(candidate: string): boolean {\n try {\n return statSync(candidate).isDirectory();\n } catch {\n return false;\n }\n}\n\n/**\n * Every structural refusal for a provider module, as sentences naming the path relative to `moduleRoot`'s parent.\n * Empty means the layout is sound.\n *\n * 1. Each declared facet is a package: `<facet>/package.json` exists and names the package.\n * 2. Nothing else is a package: a directory beside the facets that carries a `package.json`, or a facet directory\n * the manifest does not declare, would be copied into the application and installed nowhere, or installed\n * everywhere.\n * 3. The browser facet does not depend on the backend facet. Isolation is a property of the dependency graph: a\n * browser package that depends on the backend one pulls the backend's SDKs and secrets handling into a bundle.\n * 4. No system-of-record content. Systems of record are their own lane (`@wildo-ai/systems-of-record`), and discovery\n * never admits a facet module from a registry provider, so shipping one would be dead code at best.\n * 5. No install lifecycle script in a facet manifest ({@link INSTALL_LIFECYCLE_SCRIPTS}).\n *\n * Run at publish (on the publishing application's copy) and at every install, on the STAGED copy, whichever origin it\n * came from (`stageModuleAcquisition`): a registry artifact is someone else's bytes, and the server runs no such check.\n */\nexport function providerModuleStructureRefusals(input: { moduleRoot: string; provider: ModuleManifestProvider }): string[] {\n const { moduleRoot, provider } = input;\n const label = (relative: string) => path.posix.join(path.basename(moduleRoot), relative);\n const refusals: string[] = [];\n const declared = new Set<string>(providerModuleFacets(provider));\n const packageNames = new Map<ProviderModuleFacet, string>();\n\n for (const facet of providerModuleFacets(provider)) {\n const facetManifest = readFacetManifest(path.join(moduleRoot, facet));\n if (facetManifest === undefined) {\n refusals.push(`${label(`${facet}/package.json`)} is missing or unreadable: the manifest declares a ${facet} facet, and each facet is its own package.`);\n continue;\n }\n if (typeof facetManifest.name !== 'string' || facetManifest.name.length === 0) {\n refusals.push(`${label(`${facet}/package.json`)} names no package.`);\n continue;\n }\n packageNames.set(facet, facetManifest.name);\n const lifecycle = INSTALL_LIFECYCLE_SCRIPTS.filter((script) => facetManifest.scripts?.[script] !== undefined);\n if (lifecycle.length > 0) {\n refusals.push(`${label(`${facet}/package.json`)} declares ${lifecycle.join(', ')}: \\`pnpm install\\` would run it on the installing machine. A provider facet runs no install script.`);\n }\n }\n\n let entries: string[] = [];\n try {\n entries = readdirSync(moduleRoot);\n } catch {\n refusals.push(`${path.basename(moduleRoot)} cannot be read.`);\n }\n for (const entry of entries.sort()) {\n if (declared.has(entry) || !isDirectory(path.join(moduleRoot, entry))) continue;\n if ((Object.values(ProviderModuleFacet) as string[]).includes(entry)) {\n refusals.push(`${label(entry)}/ is a ${entry} facet the manifest does not declare. Declare it under provider.facets, or remove the directory.`);\n } else if (readFacetManifest(path.join(moduleRoot, entry)) !== undefined) {\n refusals.push(`${label(`${entry}/package.json`)} is a package outside the declared facets (${[...declared].join(', ')}). A provider module's packages are its facets.`);\n }\n }\n\n const backendName = packageNames.get(ProviderModuleFacet.BACKEND);\n const frontendManifest = packageNames.has(ProviderModuleFacet.FRONTEND) ? readFacetManifest(path.join(moduleRoot, ProviderModuleFacet.FRONTEND)) : undefined;\n if (backendName !== undefined && frontendManifest !== undefined) {\n for (const field of RUNTIME_DEPENDENCY_FIELDS) {\n if (frontendManifest[field]?.[backendName] !== undefined) {\n refusals.push(`${label('frontend/package.json')} lists the backend facet \"${backendName}\" in ${field}: the browser package would carry the backend's code and SDKs into a bundle.`);\n }\n }\n }\n\n for (const facet of packageNames.keys()) {\n const facetModule = readSystemOfRecordFacetModuleSpecifier(path.join(moduleRoot, facet));\n if (facetModule !== undefined) {\n refusals.push(`${label(`${facet}/package.json`)} exports a system-of-record facet (${facetModule}). Systems of record are their own lane (@wildo-ai/systems-of-record); a registry provider never carries one.`);\n }\n }\n\n return refusals;\n}\n\n/** The source file a facet's `./backend` export names: its `source` condition when present, else the plain target. */\nfunction backendEntrySource(facetManifest: FacetManifest): string | undefined {\n const entry = facetManifest.exports?.['./backend'];\n if (typeof entry === 'string') return entry;\n if (entry !== null && typeof entry === 'object') {\n const conditions = entry as Record<string, unknown>;\n for (const condition of ['source', 'import', 'default']) {\n if (typeof conditions[condition] === 'string') return conditions[condition] as string;\n }\n }\n return undefined;\n}\n\n/**\n * Every refusal that needs the backend facet's CODE, the second half of the publish checks (#2014). Empty for a\n * module with no backend facet.\n *\n * 1. The module the facet ships (its `backendProviderFragment`, the export every host loads a provider by) is the one\n * the manifest describes: exactly one provider, of the manifest's ref, tier, vendor and provider capabilities.\n * Search, the tier fence and the engine capabilities derived for the listing all read the MANIFEST, so a manifest\n * that disagreed with the code would advertise a provider nobody ships.\n * 2. Its origin is APPLICATION. An installed copy is the application's; a seed carries GENERATED and must be adopted\n * before it is published.\n * 3. Every package it declares in `requiredPackages` (the SDKs it lazy-loads) is a runtime dependency of the facet,\n * because an installed copy resolves its SDKs from its own `package.json` and nothing else supplies them.\n */\nexport async function providerModuleCodeRefusals(input: { moduleRoot: string; provider: ModuleManifestProvider }): Promise<string[]> {\n const { moduleRoot, provider } = input;\n if (!providerModuleFacets(provider).includes(ProviderModuleFacet.BACKEND)) return [];\n const facetDir = path.join(moduleRoot, ProviderModuleFacet.BACKEND);\n const label = path.posix.join(path.basename(moduleRoot), 'backend');\n const facetManifest = readFacetManifest(facetDir);\n if (facetManifest === undefined) return []; // the structural checks already refused it\n const entry = backendEntrySource(facetManifest);\n if (entry === undefined) {\n return [`${label}/package.json exports no \\`./backend\\` entry, which is how every host loads a provider.`];\n }\n\n let fragment;\n try {\n const exported = await loadConfigExport<unknown>(path.resolve(facetDir, entry), BACKEND_PROVIDER_FRAGMENT_EXPORT_NAME);\n fragment = readBackendProviderFragment({ [BACKEND_PROVIDER_FRAGMENT_EXPORT_NAME]: exported }, `${label}/${entry}`);\n } catch (error) {\n return [`${label}/${entry} could not be loaded as a provider module: ${error instanceof Error ? error.message : String(error)}`];\n }\n\n const modules = [...fragment.modules.values()];\n if (modules.length !== 1) {\n return [`${label}/${entry} contributes ${modules.length} providers; a provider module ships exactly one (${provider.ref}).`];\n }\n const module = modules[0]!;\n const refusals: string[] = [];\n const says = (field: string, code: unknown, manifest: unknown) =>\n refusals.push(`the module declares ${field} ${JSON.stringify(code)}, and wildo.module.json says ${JSON.stringify(manifest)}.`);\n if (module.metadata.ref !== provider.ref) says('ref', module.metadata.ref, provider.ref);\n if (module.metadata.tier !== provider.tier) says('tier', module.metadata.tier, provider.tier);\n if (provider.vendor !== undefined && module.metadata.vendor !== provider.vendor) says('vendor', module.metadata.vendor, provider.vendor);\n const codeCapabilities = [...module.providerCapabilities].map(String).sort();\n const manifestCapabilities = [...provider.providerCapabilities].sort();\n if (JSON.stringify(codeCapabilities) !== JSON.stringify(manifestCapabilities)) says('providerCapabilities', codeCapabilities, manifestCapabilities);\n if (module.metadata.origin.kind !== ProviderOriginKind.APPLICATION) {\n refusals.push(`the module's origin is ${module.metadata.origin.kind}; a published provider is the installing application's (APPLICATION). Adopt it first.`);\n }\n const declared = new Set(RUNTIME_DEPENDENCY_FIELDS.flatMap((field) => Object.keys(facetManifest[field] ?? {})));\n const undeclared = (module.requiredPackages ?? []).filter((name) => !declared.has(name));\n if (undeclared.length > 0) {\n refusals.push(`the module lazy-loads ${undeclared.join(', ')} (requiredPackages), which ${label}/package.json does not declare as a dependency.`);\n }\n return refusals.map((refusal) => (refusal.startsWith(label) ? refusal : `${label}: ${refusal}`));\n}\n"]}
|