@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":"secret-requirements.service.js","sourceRoot":"","sources":["../../../../../../src/services/credentials/secret-requirements.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,0CAA0C,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnI,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EACL,gBAAgB,EAChB,qCAAqC,EACrC,8BAA8B,EAC9B,oCAAoC,EACpC,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,GAGrC,MAAM,mEAAmE,CAAC;AAE3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAsC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AC/C,QAAgB,EAChB,eAA8E;IAE9E,MAAM,OAAO,GAAG,MAAM,oCAAoC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpG,MAAM,OAAO,GAAG,+BAA+B,CAAC,QAAQ,CAAC,CAAC;IAC1D,OAAO;QACL,eAAe,EAAE,OAAO,CAAC,OAAO;QAChC,mBAAmB,EAAE,OAAO,CAAC,YAAY;QACzC,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;KAC3D,CAAC;AACJ,CAAC;AAED,4GAA4G;AAC5G,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAM5C;IACC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,2BAA2B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjF,OAAO,wBAAwB,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EAAE,CAAC,CAAC;AACrJ,CAAC","sourcesContent":["/**\n * Which secrets an application NEEDS, derived from what it declares — never from a list.\n *\n * ## Why a derivation, and why here\n *\n * Secrets used to be asked up front: `wildo setup` offered every provider in the catalogue, whatever\n * the application enabled, while the one key a new application cannot work without — its LLM — was\n * asked nowhere (#1637). The fix is to ask for a secret when something needs it, which requires one\n * answer to \"what needs it\". Three surfaces read this function and must agree: `wildo init`/`setup`\n * (the creation essentials), `wildo secrets list` and the workbench's secrets section.\n *\n * The predicate is the runtime's own, as `application-creation-readiness.service.ts` established for\n * two capabilities: a capability is usable when ONE provider scoped by the application and declaring\n * it has every required secret (`ExternalProvidersRegistry.isProviderEnabled` asks about one ref).\n * Required secrets come from each discovered contribution's `secretsContractShape`, so a provider\n * added tomorrow is evaluated without this file naming it.\n *\n * ## Three kinds of secret, one derivation\n *\n * Beside the providers' secrets, an application holds the credentials of its SYSTEMS OF RECORD (#1055) and\n * the verification secrets of its INBOUND ENDPOINTS (#1596) — each in its own `secrets.json` section, each\n * read by the backend alone. They are listed here too, so the workbench's secrets section is where ALL of an\n * application's secrets are provided (`ApplicationSecretKind`). What owns them is read the way the backend\n * reads it (`application-secret-owners.service.ts`).\n *\n * And a key stored but CONSUMED by nothing is listed as `UNUSED` — the keys the env builder warns about on\n * every regeneration — so it can be removed from where it is seen instead of from a JSON file. Removing one\n * still regenerates the runtimes that receive it: see `receivingRuntimesOfUnused`.\n */\nimport { discoverSaasProviderCompanionContributions, loadSaasConfig, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\nimport { ApplicationSecretKind, ApplicationSecretStanding } from '@wildo-ai/platform-core-shared';\nimport {\n EngineCapability,\n deriveInboundEndpointSecretEnvVarName,\n deriveSystemOfRecordEnvVarName,\n parseInboundEndpointSecretEnvVarName,\n parseSystemOfRecordEnvVarName,\n} from '@wildo-ai/saas-models';\nimport { join } from 'path';\n\nimport {\n readDeclaredInboundEndpointKeys,\n resolveDeclaredSystemOfRecordSecrets,\n type DeclaredSystemOfRecordSecrets,\n type SystemOfRecordDeclarationForSecrets,\n} from '~wildo-cli/services/credentials/application-secret-owners.service';\nimport type { ApplicationCiSecretKey } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport { getProviderSensitiveEnvKeys } from '~wildo-cli/services/credentials/provider-env-vars.utils';\n\n\nexport interface SecretRequirement {\n /** The environment variable the runtime reads, and the key in the `secrets.json` section its {@link kind} names. */\n readonly envVarName: string;\n /** What it belongs to, and so where it is stored and how it travels to a remote deploy. */\n readonly kind: ApplicationSecretKind;\n /**\n * WHICH one, in its kind's vocabulary: the provider ref, the system-of-record instance name, the inbound\n * endpoint key. `null` only for an UNUSED key that names no owner: a provider key no provider declares,\n * or a system-of-record or inbound name that does not parse.\n */\n readonly ownerRef: string | null;\n readonly description: string | null;\n /**\n * Whether its owner's own contract marks it required: the provider's secrets contract, the credential\n * kind's slot (with the vendor's offer applied), and always for an inbound endpoint, whose route is\n * withheld without it.\n */\n readonly required: boolean;\n /** The ENABLED capabilities a provider serves for the application. Empty for the other kinds. */\n readonly capabilities: readonly EngineCapability[];\n /**\n * The runtimes that RECEIVE the key in their environment — the processes a change regenerates and\n * restarts — as their scope path. For an UNUSED key that is where it is carried, not where it is used:\n * `backend`, `companion`, `minions.<key>`, `workers.<key>`, `frontendServices.<key>`.\n */\n readonly runtimes: readonly string[];\n readonly standing: ApplicationSecretStanding;\n /**\n * Part of the CREATION ESSENTIALS: the companion's LLM. The creation chat, labelling, logo\n * generation and every composing playbook run on it, so `wildo init`/`setup` ask for it — and for\n * nothing else — while every other NEEDED secret is asked when its feature is first used.\n */\n readonly creationEssential: boolean;\n}\n\n/** The capability whose provider the creation journey itself runs on, in the companion. */\nconst CREATION_ESSENTIAL_CAPABILITY = EngineCapability.AI_LLM;\nconst COMPANION_RUNTIME = 'companion';\n/** The one runtime that reads a system-of-record credential or an inbound endpoint secret (the env builder strips both from every other). */\nconst BACKEND_RUNTIME = 'backend';\n\n/** The authored `providers.scopes` shape (`SaasProvidersScopesSchema`): two single runtimes and three keyed families. */\nexport interface SaasProviderScopesShape {\n readonly backend?: { providers?: Record<string, unknown> };\n readonly companion?: { providers?: Record<string, unknown> };\n readonly frontendServices?: Record<string, { providers?: Record<string, unknown> }>;\n readonly minions?: Record<string, { providers?: Record<string, unknown> }>;\n readonly workers?: Record<string, { providers?: Record<string, unknown> }>;\n}\n\n/** The keyed scope families, each naming one runtime per key. */\nconst KEYED_SCOPE_FAMILIES = ['frontendServices', 'minions', 'workers'] as const;\n\n/** Every scoped runtime with the provider refs it declares, as `backend`, `companion` or `<family>.<key>`. */\nexport function flattenProviderScopes(scopes: SaasProviderScopesShape): Array<{ runtime: string; providers: string[] }> {\n const runtimes: Array<{ runtime: string; providers: string[] }> = [];\n for (const single of ['backend', 'companion'] as const) {\n const providers = Object.keys(scopes[single]?.providers ?? {});\n if (providers.length > 0) runtimes.push({ runtime: single, providers });\n }\n for (const family of KEYED_SCOPE_FAMILIES) {\n for (const [key, scope] of Object.entries(scopes[family] ?? {})) {\n const providers = Object.keys(scope?.providers ?? {});\n if (providers.length > 0) runtimes.push({ runtime: `${family}.${key}`, providers });\n }\n }\n return runtimes;\n}\n\n/** The discovered-contribution fields the derivation reads. */\nexport interface SecretRequirementContribution {\n readonly ref: string;\n readonly engineCapabilities: readonly string[];\n readonly secretsContractShape?: ReadonlyArray<{ slug?: string; envVarName: string; required?: boolean; description?: string }>;\n /** The slots holding the provider's connected-account OAuth2 client (#1725) — see the companion contribution. */\n readonly oauth2ClientSlotSlugs?: readonly string[];\n}\n\n/** The `providers.sharedConnections` shape this derivation reads (#1725). */\nexport type SecretRequirementSharedConnections = Readonly<Record<string, { readonly refs: readonly string[]; readonly sharedWithSignIn?: boolean }>>;\n\n/**\n * The client slots a generated catalogue ref declares when its contribution predates `oauth2ClientSlotSlugs` —\n * the transposer's fixed convention for an OAuth2 vendor's registration (`clientId` / `clientSecret`).\n */\nconst TRANSPOSED_OAUTH2_CLIENT_SLOT_SLUGS: readonly string[] = ['clientId', 'clientSecret'];\n\n/**\n * Whether a declared shared connection changes what one slot REQUIRES (#1725): a member's own OAuth2 client slots\n * are inert — the base's client connects and refreshes the one grant — so they are never required; the base's\n * connected-account client slots are required, whatever its own contract marks, because the connection cannot be\n * made without them (unless the connection uses the base's sign-in registration). `undefined` leaves the contract's\n * own answer.\n */\nfunction sharedConnectionRequiredOverride(\n contribution: SecretRequirementContribution,\n slug: string | undefined,\n sharedConnections: SecretRequirementSharedConnections | undefined,\n): { required: boolean; note: string } | undefined {\n if (sharedConnections === undefined || slug === undefined) return undefined;\n const asBase = sharedConnections[contribution.ref];\n if (asBase !== undefined && asBase.sharedWithSignIn !== true && (contribution.oauth2ClientSlotSlugs ?? []).includes(slug)) {\n return { required: true, note: `the client of the shared connection \"${contribution.ref}\"` };\n }\n const baseRef = Object.entries(sharedConnections).find(([, connection]) => connection.refs.includes(contribution.ref))?.[0];\n if (baseRef !== undefined && (contribution.oauth2ClientSlotSlugs ?? TRANSPOSED_OAUTH2_CLIENT_SLOT_SLUGS).includes(slug)) {\n return { required: false, note: `inert while \"${contribution.ref}\" is a member of the shared connection \"${baseRef}\"` };\n }\n return undefined;\n}\n\n/** What one environment holds: the names that have a value, per kind (values never enter the derivation). */\nexport type StoredApplicationSecrets = Readonly<Record<ApplicationSecretKind, ReadonlySet<string>>>;\n\n/** A stored-nothing value, for a caller that only asks what is NEEDED. */\nexport const NO_STORED_APPLICATION_SECRETS: StoredApplicationSecrets = {\n [ApplicationSecretKind.PROVIDER]: new Set(),\n [ApplicationSecretKind.SYSTEM_OF_RECORD]: new Set(),\n [ApplicationSecretKind.INBOUND_ENDPOINT]: new Set(),\n};\n\n/**\n * How one environment addresses a declared system of record: `ADDRESSED` (it has an address block), `ABSENT`\n * (it says `enabled: false` — reads refuse with a named code and the backend boots), or missing from the map\n * when the environment says nothing, which the backend refuses at boot.\n */\nexport enum SystemOfRecordEnvironmentPresence {\n ADDRESSED = 'addressed',\n ABSENT = 'absent',\n}\n\n/**\n * The presence of each system of record an environment's `systemsOfRecord` names: an entry carrying `enabled`\n * is the `enabled: false` form (the schema admits no other value there), anything else is an address block.\n * Read from the GENERATED config by `wildo secrets` and from the AUTHORED infra config by the deploy workflow\n * generator — the same field, before and after generation.\n */\nexport function systemOfRecordPresenceOf(\n addressed: Readonly<Record<string, object>> | undefined,\n): Readonly<Record<string, SystemOfRecordEnvironmentPresence>> {\n return Object.fromEntries(Object.entries(addressed ?? {}).map(([name, entry]) => [\n name,\n 'enabled' in entry ? SystemOfRecordEnvironmentPresence.ABSENT : SystemOfRecordEnvironmentPresence.ADDRESSED,\n ]));\n}\n\n/**\n * The non-provider owners, read once per application (`loadApplicationSecretOwners`). Absent from the inputs\n * of a caller that asks only about providers — the creation essentials of `wildo init`, which runs before a\n * backend is built — and then those two kinds are simply not derived.\n */\nexport interface ApplicationSecretOwners {\n readonly systemsOfRecord: readonly DeclaredSystemOfRecordSecrets[];\n /** `null` when the backend's endpoints could not be read; `incomplete` then says why. */\n readonly inboundEndpointKeys: readonly string[] | null;\n /**\n * Whether a provider-section key belongs to SOME provider the CLI can see — the env builder's own test for\n * a provider secret (`getProviderSensitiveEnvKeys`), so UNUSED names exactly the keys it warns about.\n */\n readonly isProviderSecretKey: (envVarName: string) => boolean;\n /** What could not be read, each saying why. Carried into every report, so a partial listing says it is partial. */\n readonly incomplete: readonly string[];\n}\n\n/**\n * The pure derivation: one row per secret the application needs or holds, in one environment.\n *\n * PROVIDERS: one row per secret a SCOPED provider declares. A provider the application does not scope\n * contributes nothing — its keys would be dropped by the env builder anyway (`filterProviderEnvToScope`), so\n * offering them is the catalogue noise this replaced.\n *\n * SYSTEMS OF RECORD and INBOUND ENDPOINTS, when `owners` is given: one row per credential slot of each declared\n * instance, and one per declared application endpoint. Then one UNUSED row per stored key nothing consumes.\n */\nexport function deriveSecretRequirements(input: {\n readonly enabledCapabilities: ReadonlySet<string>;\n readonly scopes: SaasProviderScopesShape;\n readonly contributions: readonly SecretRequirementContribution[];\n readonly stored: StoredApplicationSecrets;\n /** Every key each section holds, an empty value included — what UNUSED is read from. Defaults to `stored`. */\n readonly present?: StoredApplicationSecrets;\n readonly owners?: ApplicationSecretOwners;\n /** The environment's `systemsOfRecord` presence per instance; `null` when its generated config could not be read. */\n readonly systemOfRecordPresence?: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null;\n /** `providers.sharedConnections` (#1725): a member's client slots stop being required and the base's start. */\n readonly sharedConnections?: SecretRequirementSharedConnections;\n}): SecretRequirement[] {\n const isSet = (kind: ApplicationSecretKind, envVarName: string): boolean => input.stored[kind].has(envVarName);\n const rows = [\n ...deriveProviderRequirements(input, (envVarName) => isSet(ApplicationSecretKind.PROVIDER, envVarName)),\n ...(input.owners ? deriveSystemOfRecordRequirements(input.owners, input.systemOfRecordPresence ?? null, isSet) : []),\n ...(input.owners ? deriveInboundEndpointRequirements(input.owners, isSet) : []),\n ];\n if (input.owners) rows.push(...deriveUnusedSecrets(input.owners, input.present ?? input.stored, input.systemOfRecordPresence ?? null, rows));\n return rows.sort((a, b) => a.kind.localeCompare(b.kind) || (a.ownerRef ?? '').localeCompare(b.ownerRef ?? '') || a.envVarName.localeCompare(b.envVarName));\n}\n\nfunction deriveProviderRequirements(\n input: {\n readonly enabledCapabilities: ReadonlySet<string>;\n readonly scopes: SaasProviderScopesShape;\n readonly contributions: readonly SecretRequirementContribution[];\n readonly sharedConnections?: SecretRequirementSharedConnections;\n },\n isSet: (envVarName: string) => boolean,\n): SecretRequirement[] {\n const runtimesByRef = new Map<string, string[]>();\n for (const { runtime, providers } of flattenProviderScopes(input.scopes)) {\n for (const ref of providers) runtimesByRef.set(ref, [...(runtimesByRef.get(ref) ?? []), runtime]);\n }\n const scoped = input.contributions.filter((contribution) => runtimesByRef.has(contribution.ref));\n const requiredOf = (contribution: SecretRequirementContribution, entry: { slug?: string; required?: boolean }): boolean =>\n sharedConnectionRequiredOverride(contribution, entry.slug, input.sharedConnections)?.required ?? entry.required === true;\n const missingRequired = (contribution: SecretRequirementContribution): boolean =>\n (contribution.secretsContractShape ?? []).some((entry) => requiredOf(contribution, entry) && !isSet(entry.envVarName));\n const servesEnabled = (contribution: SecretRequirementContribution): EngineCapability[] =>\n contribution.engineCapabilities.filter((capability) => input.enabledCapabilities.has(capability)) as EngineCapability[];\n /** Is this capability served by some scoped provider OTHER than `ref` whose required secrets are all set? */\n const coveredElsewhere = (capability: string, ref: string): boolean =>\n scoped.some((other) => other.ref !== ref && other.engineCapabilities.includes(capability) && !missingRequired(other));\n\n const rows: SecretRequirement[] = [];\n for (const contribution of scoped) {\n const capabilities = servesEnabled(contribution);\n const runtimes = runtimesByRef.get(contribution.ref) ?? [];\n for (const entry of contribution.secretsContractShape ?? []) {\n const override = sharedConnectionRequiredOverride(contribution, entry.slug, input.sharedConnections);\n const required = override?.required ?? entry.required === true;\n const set = isSet(entry.envVarName);\n /*\n * Unset and required: NEEDED unless every enabled capability the provider serves is already\n * served by another ready provider. A scoped provider serving NO enabled capability is still\n * needed — the application scoped it on purpose (a webhook, an integration), and nothing\n * else stands in for it.\n */\n const needed = !set && required\n && (capabilities.length === 0 || capabilities.some((capability) => !coveredElsewhere(capability, contribution.ref)));\n rows.push({\n envVarName: entry.envVarName,\n kind: ApplicationSecretKind.PROVIDER,\n ownerRef: contribution.ref,\n description: override === undefined ? entry.description ?? null : `${entry.description ?? entry.envVarName} (${override.note})`,\n required,\n capabilities,\n runtimes,\n standing: set ? ApplicationSecretStanding.SET : needed ? ApplicationSecretStanding.NEEDED : ApplicationSecretStanding.AVAILABLE,\n creationEssential: capabilities.includes(CREATION_ESSENTIAL_CAPABILITY) && runtimes.includes(COMPANION_RUNTIME),\n });\n }\n }\n return rows;\n}\n\n/** A row of a kind no capability, companion or creation essential applies to. */\nfunction backendOnlyRow(\n row: Pick<SecretRequirement, 'envVarName' | 'kind' | 'ownerRef' | 'description' | 'required' | 'standing'>,\n): SecretRequirement {\n return { ...row, capabilities: [], runtimes: [BACKEND_RUNTIME], creationEssential: false };\n}\n\n/**\n * One row per credential slot of each declared system of record. An environment that declares the instance\n * ABSENT (`enabled: false`) waits for nothing, so an unset slot there is AVAILABLE; everywhere else a required\n * unset slot is NEEDED — including an environment that does not mention the instance, where the backend\n * refuses to boot until it is addressed and credentialed (the address half is `wildo config validate`'s).\n */\nfunction deriveSystemOfRecordRequirements(\n owners: Pick<ApplicationSecretOwners, 'systemsOfRecord'>,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n isSet: (kind: ApplicationSecretKind, envVarName: string) => boolean,\n): SecretRequirement[] {\n const rows: SecretRequirement[] = [];\n for (const system of owners.systemsOfRecord) {\n const absentHere = presence?.[system.name] === SystemOfRecordEnvironmentPresence.ABSENT;\n for (const slot of system.secretSlots ?? []) {\n const envVarName = deriveSystemOfRecordEnvVarName(system.name, slot.slug);\n const set = isSet(ApplicationSecretKind.SYSTEM_OF_RECORD, envVarName);\n rows.push(backendOnlyRow({\n envVarName,\n kind: ApplicationSecretKind.SYSTEM_OF_RECORD,\n ownerRef: system.name,\n description: slot.description ?? null,\n required: slot.required,\n standing: set\n ? ApplicationSecretStanding.SET\n : slot.required && !absentHere ? ApplicationSecretStanding.NEEDED : ApplicationSecretStanding.AVAILABLE,\n }));\n }\n }\n return rows;\n}\n\n/**\n * One row per declared application endpoint: its route is withheld until the secret exists, so an unset one\n * is always NEEDED. When the endpoints could not be read, a secret already stored for a well-formed key is\n * still listed as SET — it can be replaced or removed, and nothing here can prove it unused.\n */\nfunction deriveInboundEndpointRequirements(\n owners: Pick<ApplicationSecretOwners, 'inboundEndpointKeys'>,\n isSet: (kind: ApplicationSecretKind, envVarName: string) => boolean,\n): SecretRequirement[] {\n return (owners.inboundEndpointKeys ?? []).map((endpointKey) => {\n const envVarName = deriveInboundEndpointSecretEnvVarName(endpointKey);\n return backendOnlyRow({\n envVarName,\n kind: ApplicationSecretKind.INBOUND_ENDPOINT,\n ownerRef: endpointKey,\n description: `Verifies the deliveries to POST /webhooks/app/${endpointKey}. Its route is not mounted until this is set.`,\n required: true,\n standing: isSet(ApplicationSecretKind.INBOUND_ENDPOINT, envVarName) ? ApplicationSecretStanding.SET : ApplicationSecretStanding.NEEDED,\n });\n });\n}\n\n/**\n * The system-of-record credentials and inbound endpoint secrets an environment's deploy job must receive (#1650):\n * one per credential slot of each declared system of record, and one per declared application endpoint — the\n * rows `wildo secrets` lists for the same environment, so the workflow forwards exactly what the listing asks for.\n *\n * A key is REQUIRED when the deploy cannot do without it: an endpoint's secret always (its route is withheld\n * otherwise), a required slot unless the environment declares the instance absent. Everything else is forwarded\n * as optional, so a secret set later still reaches the job without regenerating the workflow.\n */\nexport function deriveDeployForwardedSecretKeys(\n owners: Pick<ApplicationSecretOwners, 'systemsOfRecord' | 'inboundEndpointKeys'>,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n): ApplicationCiSecretKey[] {\n const nothingSet = (): boolean => false;\n return [\n ...deriveSystemOfRecordRequirements(owners, presence, nothingSet),\n ...deriveInboundEndpointRequirements(owners, nothingSet),\n ].map((row) => ({ kind: row.kind, envVarName: row.envVarName, required: row.standing === ApplicationSecretStanding.NEEDED }));\n}\n\n/**\n * Stored keys no row claims. Each is UNUSED when nothing CONSUMES it — by the SAME test the env builder drops\n * or ignores it with — and otherwise SET under the owner its name points at, because nothing here can prove it\n * unused:\n *\n * - a provider key belonging to no provider the CLI can see (a key of an UNSCOPED provider is neither: it is\n * not listed at all, as before);\n * - a system-of-record key that does not parse, names an undeclared instance, or names neither a secret nor an\n * address slot of it (only when the slots are known). An ADDRESS slot stored as a secret is not unused: the\n * env builder writes the secrets after the address block, so it overrides the address the backend reads;\n * - an inbound key that does not parse, or names an endpoint the backend does not declare (only when the\n * endpoints are known).\n *\n * UNCONSUMED IS NOT UNDELIVERED, and an unused row names the runtimes that still RECEIVE it, so removing it\n * regenerates their `.env` files and restarts them like any other change ({@link receivingRuntimesOfUnused}).\n * The first cut gave every unused row no runtimes, so removing one left the value in the companion's `.env`\n * and in the running process after the person was told it was gone (#1637 review, H1).\n *\n * `present` is every key the section holds, an empty value included: an orphan stored as `\"\"` still makes the\n * env builder warn, so it must be listed to be removable.\n */\nfunction deriveUnusedSecrets(\n owners: ApplicationSecretOwners,\n present: StoredApplicationSecrets,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n claimed: readonly SecretRequirement[],\n): SecretRequirement[] {\n const claimedKeys = new Set(claimed.map((row) => `${row.kind}:${row.envVarName}`));\n const unclaimed = (kind: ApplicationSecretKind): string[] => [...present[kind]].filter((envVarName) => !claimedKeys.has(`${kind}:${envVarName}`));\n const unused = (kind: ApplicationSecretKind, envVarName: string, ownerRef: string | null): SecretRequirement => ({\n envVarName, kind, ownerRef, description: null, required: false, capabilities: [],\n runtimes: receivingRuntimesOfUnused(kind, envVarName, presence), standing: ApplicationSecretStanding.UNUSED, creationEssential: false,\n });\n const rows: SecretRequirement[] = [];\n\n for (const envVarName of unclaimed(ApplicationSecretKind.PROVIDER)) {\n if (!owners.isProviderSecretKey(envVarName)) rows.push(unused(ApplicationSecretKind.PROVIDER, envVarName, null));\n }\n\n const systems = new Map(owners.systemsOfRecord.map((system) => [system.name, system]));\n for (const envVarName of unclaimed(ApplicationSecretKind.SYSTEM_OF_RECORD)) {\n const parts = parseSystemOfRecordEnvVarName(envVarName);\n const system = parts ? systems.get(parts.instanceName) : undefined;\n const overridesAddress = system?.addressSlots?.find((slot) => slot.slug === parts?.slotSlug);\n if (parts && system && (system.secretSlots === null || system.addressSlots === null || overridesAddress)) {\n rows.push(backendOnlyRow({\n envVarName,\n kind: ApplicationSecretKind.SYSTEM_OF_RECORD,\n ownerRef: system.name,\n description: overridesAddress\n ? `Overrides the '${overridesAddress.slug}' address authored in this environment's config, which the backend then reads from here.`\n : null,\n required: false,\n standing: ApplicationSecretStanding.SET,\n }));\n } else {\n rows.push(unused(ApplicationSecretKind.SYSTEM_OF_RECORD, envVarName, parts?.instanceName ?? null));\n }\n }\n\n for (const envVarName of unclaimed(ApplicationSecretKind.INBOUND_ENDPOINT)) {\n const parts = parseInboundEndpointSecretEnvVarName(envVarName);\n if (parts && owners.inboundEndpointKeys === null) {\n rows.push(backendOnlyRow({ envVarName, kind: ApplicationSecretKind.INBOUND_ENDPOINT, ownerRef: parts.endpointKey, description: null, required: false, standing: ApplicationSecretStanding.SET }));\n } else {\n rows.push(unused(ApplicationSecretKind.INBOUND_ENDPOINT, envVarName, parts?.endpointKey ?? null));\n }\n }\n return rows;\n}\n\n/**\n * The runtimes whose generated `.env` still carries an unused key — read off the env builder's own delivery\n * rules, since they are what put it there:\n *\n * - a PROVIDER key reaches the dev companion, whose scope is every provider (`PLATFORM_TIER_ALL_PROVIDERS`,\n * never filtered), whatever provider it belongs to or does not;\n * - a SYSTEM-OF-RECORD key reaches the backend when this environment's config names its instance (addressed\n * or declared absent) — the builder checks the instance, never the slot. With no readable config it is\n * assumed delivered, the direction in which regenerating costs a restart and not a leftover credential;\n * - an INBOUND key reaches the backend when it is a well-formed name, whatever endpoint it names.\n *\n * A name that does not parse reaches nothing.\n */\nfunction receivingRuntimesOfUnused(\n kind: ApplicationSecretKind,\n envVarName: string,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n): readonly string[] {\n switch (kind) {\n case ApplicationSecretKind.PROVIDER:\n return [COMPANION_RUNTIME];\n case ApplicationSecretKind.SYSTEM_OF_RECORD: {\n const parts = parseSystemOfRecordEnvVarName(envVarName);\n if (!parts) return [];\n return presence === null || presence[parts.instanceName] !== undefined ? [BACKEND_RUNTIME] : [];\n }\n case ApplicationSecretKind.INBOUND_ENDPOINT:\n return parseInboundEndpointSecretEnvVarName(envVarName) ? [BACKEND_RUNTIME] : [];\n }\n}\n\n/**\n * Whether the creation essentials are met: some companion-scoped LLM provider has every required\n * secret. When they are not, `candidates` are the providers `wildo init`/`setup` offer, in the\n * application's declared order, each with the keys it still lacks.\n */\nexport function creationEssentialsGap(requirements: readonly SecretRequirement[]): {\n readonly satisfied: boolean;\n readonly candidates: ReadonlyArray<{ providerRef: string; missing: readonly SecretRequirement[] }>;\n} {\n const essential = requirements.filter((row) => row.creationEssential && row.ownerRef !== null);\n const byProvider = new Map<string, SecretRequirement[]>();\n for (const row of essential) byProvider.set(row.ownerRef!, [...(byProvider.get(row.ownerRef!) ?? []), row]);\n const candidates = [...byProvider.entries()].map(([providerRef, rows]) => ({\n providerRef,\n missing: rows.filter((row) => row.required && row.standing !== ApplicationSecretStanding.SET),\n }));\n return { satisfied: candidates.some((candidate) => candidate.missing.length === 0), candidates };\n}\n\n/**\n * What the derivation reads from the application — its enabled capabilities, its provider scopes and the\n * discovered provider contributions — loaded ONCE. Loading bundles `wildo.saas.config.ts` and imports every\n * provider package's companion barrel, which is most of what `wildo secrets list` costs, and it does not\n * depend on the environment: `--all` derives every environment from one load rather than repeating it per\n * environment (#1637; measured 86 s for one environment on a loaded machine, with 14 s of CPU).\n *\n * `owners` is loaded with `withOwners` — every surface that LISTS or CHANGES secrets. The creation essentials\n * leave it out: they ask about one provider key, before any backend is built.\n */\nexport interface SecretRequirementInputs {\n readonly enabledCapabilities: ReadonlySet<string>;\n readonly scopes: SaasProviderScopesShape;\n readonly contributions: readonly SecretRequirementContribution[];\n readonly owners?: ApplicationSecretOwners;\n readonly sharedConnections?: SecretRequirementSharedConnections;\n}\n\nexport async function loadSecretRequirementInputs(saasRoot: string, options: { readonly withOwners?: boolean } = {}): Promise<SecretRequirementInputs> {\n const saasConfig = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS));\n const { contributions } = await discoverSaasProviderCompanionContributions({ saasRoot, saasConfig: saasConfig as never });\n const declared = saasConfig as {\n engineCapabilities?: Record<string, { enabled?: boolean }>;\n providers?: { scopes?: SaasProviderScopesShape; sharedConnections?: SecretRequirementSharedConnections };\n systemsOfRecord?: Record<string, SystemOfRecordDeclarationForSecrets>;\n };\n const typedContributions = contributions as unknown as SecretRequirementContribution[];\n return {\n enabledCapabilities: new Set(\n Object.entries(declared.engineCapabilities ?? {}).filter(([, value]) => value?.enabled === true).map(([capability]) => capability),\n ),\n scopes: declared.providers?.scopes ?? {},\n contributions: typedContributions,\n ...(declared.providers?.sharedConnections === undefined ? {} : { sharedConnections: declared.providers.sharedConnections }),\n owners: options.withOwners ? await loadApplicationSecretOwners(saasRoot, declared.systemsOfRecord ?? {}, typedContributions) : undefined,\n };\n}\n\n/**\n * Read what owns the non-provider secrets, and which provider keys belong to a provider at all.\n *\n * The provider test unions the engine tier (`getProviderSensitiveEnvKeys`, which the env builder reads after\n * registering discovery) with this application's discovered contracts, rather than registering them here:\n * registration warns for every engine-owned ref it meets, and a listing is not the place for that noise.\n * The union is EXACT, not an approximation: the builder also attributes each provider's protocol BINDINGS,\n * but a contribution-sourced provider enters the composed catalogue with `protocolBindings: []`\n * (`composed-provider-catalogue.ts`), so for a discovered provider its contract is the whole of what the\n * builder attributes, and the engine tier's bindings are inside `getProviderSensitiveEnvKeys` already.\n */\nasync function loadApplicationSecretOwners(\n saasRoot: string,\n declaredSystems: Readonly<Record<string, SystemOfRecordDeclarationForSecrets>>,\n contributions: readonly SecretRequirementContribution[],\n): Promise<ApplicationSecretOwners> {\n const owners = await loadNonProviderSecretOwners(saasRoot, declaredSystems);\n const discoveredKeys = new Set(contributions.flatMap((contribution) => (contribution.secretsContractShape ?? []).map((entry) => entry.envVarName)));\n const engineKeys = getProviderSensitiveEnvKeys();\n return {\n ...owners,\n isProviderSecretKey: (envVarName) => discoveredKeys.has(envVarName) || engineKeys.has(envVarName),\n };\n}\n\n/**\n * What owns the system-of-record and inbound endpoint secrets: the declared instances' credential slots (read\n * through the facets the backend resolves) and the endpoints the BUILT backend declares. Shared by `wildo secrets`\n * and the deploy workflow generator, so the two cannot disagree about which secrets exist.\n */\nexport async function loadNonProviderSecretOwners(\n saasRoot: string,\n declaredSystems: Readonly<Record<string, SystemOfRecordDeclarationForSecrets>>,\n): Promise<Pick<ApplicationSecretOwners, 'systemsOfRecord' | 'inboundEndpointKeys' | 'incomplete'>> {\n const systems = await resolveDeclaredSystemOfRecordSecrets({ saasRoot, declared: declaredSystems });\n const inbound = readDeclaredInboundEndpointKeys(saasRoot);\n return {\n systemsOfRecord: systems.systems,\n inboundEndpointKeys: inbound.endpointKeys,\n incomplete: [...systems.incomplete, ...inbound.incomplete],\n };\n}\n\n/** Derive an application's requirements in one environment, loading its inputs unless they are supplied. */\nexport async function loadSecretRequirements(input: {\n readonly saasRoot: string;\n readonly stored: StoredApplicationSecrets;\n readonly present?: StoredApplicationSecrets;\n readonly systemOfRecordPresence?: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null;\n readonly inputs?: SecretRequirementInputs;\n}): Promise<SecretRequirement[]> {\n const inputs = input.inputs ?? await loadSecretRequirementInputs(input.saasRoot);\n return deriveSecretRequirements({ ...inputs, stored: input.stored, present: input.present, systemOfRecordPresence: input.systemOfRecordPresence });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"secret-requirements.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/secret-requirements.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,0CAA0C,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnI,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EACL,gBAAgB,EAChB,qCAAqC,EACrC,8BAA8B,EAC9B,oCAAoC,EACpC,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,GAGrC,MAAM,mEAAmE,CAAC;AAE3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAsCtG,2FAA2F;AAC3F,MAAM,6BAA6B,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAC9D,MAAM,iBAAiB,GAAG,WAAW,CAAC;AACtC,6IAA6I;AAC7I,MAAM,eAAe,GAAG,SAAS,CAAC;AAWlC,iEAAiE;AACjE,MAAM,oBAAoB,GAAG,CAAC,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAEjF,8GAA8G;AAC9G,MAAM,UAAU,qBAAqB,CAAC,MAA+B;IACnE,MAAM,QAAQ,GAAoD,EAAE,CAAC;IACrE,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,EAAE,WAAW,CAAU,EAAE,CAAC;QACvD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;QAC/D,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,EA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,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EAAE,CAAC,CAAC;AACrJ,CAAC","sourcesContent":["/**\n * Which secrets an application NEEDS, derived from what it declares — never from a list.\n *\n * ## Why a derivation, and why here\n *\n * Secrets used to be asked up front: `wildo setup` offered every provider in the catalogue, whatever\n * the application enabled, while the one key a new application cannot work without — its LLM — was\n * asked nowhere (#1637). The fix is to ask for a secret when something needs it, which requires one\n * answer to \"what needs it\". Three surfaces read this function and must agree: `wildo init`/`setup`\n * (the creation essentials), `wildo secrets list` and the workbench's secrets section.\n *\n * The predicate is the runtime's own, as `application-creation-readiness.service.ts` established for\n * two capabilities: a capability is usable when ONE provider scoped by the application and declaring\n * it has every required secret (`ExternalProvidersRegistry.isProviderEnabled` asks about one ref).\n * Required secrets come from each discovered contribution's `secretsContractShape`, so a provider\n * added tomorrow is evaluated without this file naming it.\n *\n * ## Three kinds of secret, one derivation\n *\n * Beside the providers' secrets, an application holds the credentials of its SYSTEMS OF RECORD (#1055) and\n * the verification secrets of its INBOUND ENDPOINTS (#1596) — each in its own `secrets.json` section, each\n * read by the backend alone. They are listed here too, so the workbench's secrets section is where ALL of an\n * application's secrets are provided (`ApplicationSecretKind`). What owns them is read the way the backend\n * reads it (`application-secret-owners.service.ts`).\n *\n * And a key stored but CONSUMED by nothing is listed as `UNUSED` — the keys the env builder warns about on\n * every regeneration — so it can be removed from where it is seen instead of from a JSON file. Removing one\n * still regenerates the runtimes that receive it: see `receivingRuntimesOfUnused`.\n */\nimport { discoverSaasProviderCompanionContributions, loadSaasConfig, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\nimport { ApplicationSecretKind, ApplicationSecretStanding } from '@wildo-ai/platform-core-shared';\nimport {\n EngineCapability,\n deriveInboundEndpointSecretEnvVarName,\n deriveSystemOfRecordEnvVarName,\n parseInboundEndpointSecretEnvVarName,\n parseSystemOfRecordEnvVarName,\n} from '@wildo-ai/saas-models';\nimport { join } from 'path';\n\nimport {\n readDeclaredInboundEndpointKeys,\n resolveDeclaredSystemOfRecordSecrets,\n type DeclaredSystemOfRecordSecrets,\n type SystemOfRecordDeclarationForSecrets,\n} from '~wildo-cli/services/credentials/application-secret-owners.service';\nimport type { ApplicationCiSecretKey } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport { getProviderSensitiveEnvKeys } from '~wildo-cli/services/credentials/provider-env-vars.utils';\n\n\nexport interface SecretRequirement {\n /** The environment variable the runtime reads, and the key in the `secrets.json` section its {@link kind} names. */\n readonly envVarName: string;\n /** What it belongs to, and so where it is stored and how it travels to a remote deploy. */\n readonly kind: ApplicationSecretKind;\n /**\n * WHICH one, in its kind's vocabulary: the provider ref, the system-of-record instance name, the inbound\n * endpoint key. `null` only for an UNUSED key that names no owner: a provider key no provider declares,\n * or a system-of-record or inbound name that does not parse.\n */\n readonly ownerRef: string | null;\n readonly description: string | null;\n /**\n * Whether its owner's own contract marks it required: the provider's secrets contract, the credential\n * kind's slot (with the vendor's offer applied), and always for an inbound endpoint, whose route is\n * withheld without it.\n */\n readonly required: boolean;\n /** The ENABLED capabilities a provider serves for the application. Empty for the other kinds. */\n readonly capabilities: readonly EngineCapability[];\n /**\n * The runtimes that RECEIVE the key in their environment — the processes a change regenerates and\n * restarts — as their scope path. For an UNUSED key that is where it is carried, not where it is used:\n * `backend`, `companion`, `minions.<key>`, `workers.<key>`, `frontendServices.<key>`.\n */\n readonly runtimes: readonly string[];\n readonly standing: ApplicationSecretStanding;\n /**\n * Part of the CREATION ESSENTIALS: the companion's LLM. The creation chat, labelling, logo\n * generation and every composing playbook run on it, so `wildo init`/`setup` ask for it — and for\n * nothing else — while every other NEEDED secret is asked when its feature is first used.\n */\n readonly creationEssential: boolean;\n}\n\n/** The capability whose provider the creation journey itself runs on, in the companion. */\nconst CREATION_ESSENTIAL_CAPABILITY = EngineCapability.AI_LLM;\nconst COMPANION_RUNTIME = 'companion';\n/** The one runtime that reads a system-of-record credential or an inbound endpoint secret (the env builder strips both from every other). */\nconst BACKEND_RUNTIME = 'backend';\n\n/** The authored `providers.scopes` shape (`SaasProvidersScopesSchema`): two single runtimes and three keyed families. */\nexport interface SaasProviderScopesShape {\n readonly backend?: { providers?: Record<string, unknown> };\n readonly companion?: { providers?: Record<string, unknown> };\n readonly frontendServices?: Record<string, { providers?: Record<string, unknown> }>;\n readonly minions?: Record<string, { providers?: Record<string, unknown> }>;\n readonly workers?: Record<string, { providers?: Record<string, unknown> }>;\n}\n\n/** The keyed scope families, each naming one runtime per key. */\nconst KEYED_SCOPE_FAMILIES = ['frontendServices', 'minions', 'workers'] as const;\n\n/** Every scoped runtime with the provider refs it declares, as `backend`, `companion` or `<family>.<key>`. */\nexport function flattenProviderScopes(scopes: SaasProviderScopesShape): Array<{ runtime: string; providers: string[] }> {\n const runtimes: Array<{ runtime: string; providers: string[] }> = [];\n for (const single of ['backend', 'companion'] as const) {\n const providers = Object.keys(scopes[single]?.providers ?? {});\n if (providers.length > 0) runtimes.push({ runtime: single, providers });\n }\n for (const family of KEYED_SCOPE_FAMILIES) {\n for (const [key, scope] of Object.entries(scopes[family] ?? {})) {\n const providers = Object.keys(scope?.providers ?? {});\n if (providers.length > 0) runtimes.push({ runtime: `${family}.${key}`, providers });\n }\n }\n return runtimes;\n}\n\n/** The discovered-contribution fields the derivation reads. */\nexport interface SecretRequirementContribution {\n readonly ref: string;\n readonly engineCapabilities: readonly string[];\n readonly secretsContractShape?: ReadonlyArray<{ slug?: string; envVarName: string; required?: boolean; description?: string }>;\n /** The slots holding the provider's connected-account OAuth2 client (#1725) — see the companion contribution. */\n readonly oauth2ClientSlotSlugs?: readonly string[];\n}\n\n/** The `providers.sharedConnections` shape this derivation reads (#1725). */\nexport type SecretRequirementSharedConnections = Readonly<Record<string, { readonly refs: readonly string[]; readonly sharedWithSignIn?: boolean }>>;\n\n/**\n * The client slots a generated catalogue ref declares when its contribution predates `oauth2ClientSlotSlugs` —\n * the transposer's fixed convention for an OAuth2 vendor's registration (`clientId` / `clientSecret`).\n */\nconst TRANSPOSED_OAUTH2_CLIENT_SLOT_SLUGS: readonly string[] = ['clientId', 'clientSecret'];\n\n/**\n * Whether a declared shared connection changes what one slot REQUIRES (#1725): a member's own OAuth2 client slots\n * are inert — the base's client connects and refreshes the one grant — so they are never required; the base's\n * connected-account client slots are required, whatever its own contract marks, because the connection cannot be\n * made without them (unless the connection uses the base's sign-in registration). `undefined` leaves the contract's\n * own answer.\n */\nfunction sharedConnectionRequiredOverride(\n contribution: SecretRequirementContribution,\n slug: string | undefined,\n sharedConnections: SecretRequirementSharedConnections | undefined,\n): { required: boolean; note: string } | undefined {\n if (sharedConnections === undefined || slug === undefined) return undefined;\n const asBase = sharedConnections[contribution.ref];\n if (asBase !== undefined && asBase.sharedWithSignIn !== true && (contribution.oauth2ClientSlotSlugs ?? []).includes(slug)) {\n return { required: true, note: `the client of the shared connection \"${contribution.ref}\"` };\n }\n const baseRef = Object.entries(sharedConnections).find(([, connection]) => connection.refs.includes(contribution.ref))?.[0];\n if (baseRef !== undefined && (contribution.oauth2ClientSlotSlugs ?? TRANSPOSED_OAUTH2_CLIENT_SLOT_SLUGS).includes(slug)) {\n return { required: false, note: `inert while \"${contribution.ref}\" is a member of the shared connection \"${baseRef}\"` };\n }\n return undefined;\n}\n\n/** What one environment holds: the names that have a value, per kind (values never enter the derivation). */\nexport type StoredApplicationSecrets = Readonly<Record<ApplicationSecretKind, ReadonlySet<string>>>;\n\n/** A stored-nothing value, for a caller that only asks what is NEEDED. */\nexport const NO_STORED_APPLICATION_SECRETS: StoredApplicationSecrets = {\n [ApplicationSecretKind.PROVIDER]: new Set(),\n [ApplicationSecretKind.SYSTEM_OF_RECORD]: new Set(),\n [ApplicationSecretKind.INBOUND_ENDPOINT]: new Set(),\n};\n\n/**\n * How one environment addresses a declared system of record: `ADDRESSED` (it has an address block), `ABSENT`\n * (it says `enabled: false` — reads refuse with a named code and the backend boots), or missing from the map\n * when the environment says nothing, which the backend refuses at boot.\n */\nexport enum SystemOfRecordEnvironmentPresence {\n ADDRESSED = 'addressed',\n ABSENT = 'absent',\n}\n\n/**\n * The presence of each system of record an environment's `systemsOfRecord` names: an entry carrying `enabled`\n * is the `enabled: false` form (the schema admits no other value there), anything else is an address block.\n * Read from the GENERATED config by `wildo secrets` and from the AUTHORED infra config by the deploy workflow\n * generator — the same field, before and after generation.\n */\nexport function systemOfRecordPresenceOf(\n addressed: Readonly<Record<string, object>> | undefined,\n): Readonly<Record<string, SystemOfRecordEnvironmentPresence>> {\n return Object.fromEntries(Object.entries(addressed ?? {}).map(([name, entry]) => [\n name,\n 'enabled' in entry ? SystemOfRecordEnvironmentPresence.ABSENT : SystemOfRecordEnvironmentPresence.ADDRESSED,\n ]));\n}\n\n/**\n * The non-provider owners, read once per application (`loadApplicationSecretOwners`). Absent from the inputs\n * of a caller that asks only about providers — the creation essentials of `wildo init`, which runs before a\n * backend is built — and then those two kinds are simply not derived.\n */\nexport interface ApplicationSecretOwners {\n readonly systemsOfRecord: readonly DeclaredSystemOfRecordSecrets[];\n /** `null` when the backend's endpoints could not be read; `incomplete` then says why. */\n readonly inboundEndpointKeys: readonly string[] | null;\n /**\n * Whether a provider-section key belongs to SOME provider the CLI can see — the env builder's own test for\n * a provider secret (`getProviderSensitiveEnvKeys`), so UNUSED names exactly the keys it warns about.\n */\n readonly isProviderSecretKey: (envVarName: string) => boolean;\n /** What could not be read, each saying why. Carried into every report, so a partial listing says it is partial. */\n readonly incomplete: readonly string[];\n}\n\n/**\n * The pure derivation: one row per secret the application needs or holds, in one environment.\n *\n * PROVIDERS: one row per secret a SCOPED provider declares. A provider the application does not scope\n * contributes nothing — its keys would be dropped by the env builder anyway (`filterProviderEnvToScope`), so\n * offering them is the catalogue noise this replaced.\n *\n * SYSTEMS OF RECORD and INBOUND ENDPOINTS, when `owners` is given: one row per credential slot of each declared\n * instance, and one per declared application endpoint. Then one UNUSED row per stored key nothing consumes.\n */\nexport function deriveSecretRequirements(input: {\n readonly enabledCapabilities: ReadonlySet<string>;\n readonly scopes: SaasProviderScopesShape;\n readonly contributions: readonly SecretRequirementContribution[];\n readonly stored: StoredApplicationSecrets;\n /** Every key each section holds, an empty value included — what UNUSED is read from. Defaults to `stored`. */\n readonly present?: StoredApplicationSecrets;\n readonly owners?: ApplicationSecretOwners;\n /** The environment's `systemsOfRecord` presence per instance; `null` when its generated config could not be read. */\n readonly systemOfRecordPresence?: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null;\n /** `providers.sharedConnections` (#1725): a member's client slots stop being required and the base's start. */\n readonly sharedConnections?: SecretRequirementSharedConnections;\n}): SecretRequirement[] {\n const isSet = (kind: ApplicationSecretKind, envVarName: string): boolean => input.stored[kind].has(envVarName);\n const rows = [\n ...deriveProviderRequirements(input, (envVarName) => isSet(ApplicationSecretKind.PROVIDER, envVarName)),\n ...(input.owners ? deriveSystemOfRecordRequirements(input.owners, input.systemOfRecordPresence ?? null, isSet) : []),\n ...(input.owners ? deriveInboundEndpointRequirements(input.owners, isSet) : []),\n ];\n if (input.owners) rows.push(...deriveUnusedSecrets(input.owners, input.present ?? input.stored, input.systemOfRecordPresence ?? null, rows));\n return rows.sort((a, b) => a.kind.localeCompare(b.kind) || (a.ownerRef ?? '').localeCompare(b.ownerRef ?? '') || a.envVarName.localeCompare(b.envVarName));\n}\n\nfunction deriveProviderRequirements(\n input: {\n readonly enabledCapabilities: ReadonlySet<string>;\n readonly scopes: SaasProviderScopesShape;\n readonly contributions: readonly SecretRequirementContribution[];\n readonly sharedConnections?: SecretRequirementSharedConnections;\n },\n isSet: (envVarName: string) => boolean,\n): SecretRequirement[] {\n const runtimesByRef = new Map<string, string[]>();\n for (const { runtime, providers } of flattenProviderScopes(input.scopes)) {\n for (const ref of providers) runtimesByRef.set(ref, [...(runtimesByRef.get(ref) ?? []), runtime]);\n }\n const scoped = input.contributions.filter((contribution) => runtimesByRef.has(contribution.ref));\n const requiredOf = (contribution: SecretRequirementContribution, entry: { slug?: string; required?: boolean }): boolean =>\n sharedConnectionRequiredOverride(contribution, entry.slug, input.sharedConnections)?.required ?? entry.required === true;\n const missingRequired = (contribution: SecretRequirementContribution): boolean =>\n (contribution.secretsContractShape ?? []).some((entry) => requiredOf(contribution, entry) && !isSet(entry.envVarName));\n const servesEnabled = (contribution: SecretRequirementContribution): EngineCapability[] =>\n contribution.engineCapabilities.filter((capability) => input.enabledCapabilities.has(capability)) as EngineCapability[];\n /** Is this capability served by some scoped provider OTHER than `ref` whose required secrets are all set? */\n const coveredElsewhere = (capability: string, ref: string): boolean =>\n scoped.some((other) => other.ref !== ref && other.engineCapabilities.includes(capability) && !missingRequired(other));\n\n const rows: SecretRequirement[] = [];\n for (const contribution of scoped) {\n const capabilities = servesEnabled(contribution);\n const runtimes = runtimesByRef.get(contribution.ref) ?? [];\n for (const entry of contribution.secretsContractShape ?? []) {\n const override = sharedConnectionRequiredOverride(contribution, entry.slug, input.sharedConnections);\n const required = override?.required ?? entry.required === true;\n const set = isSet(entry.envVarName);\n /*\n * Unset and required: NEEDED unless every enabled capability the provider serves is already\n * served by another ready provider. A scoped provider serving NO enabled capability is still\n * needed — the application scoped it on purpose (a webhook, an integration), and nothing\n * else stands in for it.\n */\n const needed = !set && required\n && (capabilities.length === 0 || capabilities.some((capability) => !coveredElsewhere(capability, contribution.ref)));\n rows.push({\n envVarName: entry.envVarName,\n kind: ApplicationSecretKind.PROVIDER,\n ownerRef: contribution.ref,\n description: override === undefined ? entry.description ?? null : `${entry.description ?? entry.envVarName} (${override.note})`,\n required,\n capabilities,\n runtimes,\n standing: set ? ApplicationSecretStanding.SET : needed ? ApplicationSecretStanding.NEEDED : ApplicationSecretStanding.AVAILABLE,\n creationEssential: capabilities.includes(CREATION_ESSENTIAL_CAPABILITY) && runtimes.includes(COMPANION_RUNTIME),\n });\n }\n }\n return rows;\n}\n\n/** A row of a kind no capability, companion or creation essential applies to. */\nfunction backendOnlyRow(\n row: Pick<SecretRequirement, 'envVarName' | 'kind' | 'ownerRef' | 'description' | 'required' | 'standing'>,\n): SecretRequirement {\n return { ...row, capabilities: [], runtimes: [BACKEND_RUNTIME], creationEssential: false };\n}\n\n/**\n * One row per credential slot of each declared system of record. An environment that declares the instance\n * ABSENT (`enabled: false`) waits for nothing, so an unset slot there is AVAILABLE; everywhere else a required\n * unset slot is NEEDED — including an environment that does not mention the instance, where the backend\n * refuses to boot until it is addressed and credentialed (the address half is `wildo config validate`'s).\n */\nfunction deriveSystemOfRecordRequirements(\n owners: Pick<ApplicationSecretOwners, 'systemsOfRecord'>,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n isSet: (kind: ApplicationSecretKind, envVarName: string) => boolean,\n): SecretRequirement[] {\n const rows: SecretRequirement[] = [];\n for (const system of owners.systemsOfRecord) {\n const absentHere = presence?.[system.name] === SystemOfRecordEnvironmentPresence.ABSENT;\n for (const slot of system.secretSlots ?? []) {\n const envVarName = deriveSystemOfRecordEnvVarName(system.name, slot.slug);\n const set = isSet(ApplicationSecretKind.SYSTEM_OF_RECORD, envVarName);\n rows.push(backendOnlyRow({\n envVarName,\n kind: ApplicationSecretKind.SYSTEM_OF_RECORD,\n ownerRef: system.name,\n description: slot.description ?? null,\n required: slot.required,\n standing: set\n ? ApplicationSecretStanding.SET\n : slot.required && !absentHere ? ApplicationSecretStanding.NEEDED : ApplicationSecretStanding.AVAILABLE,\n }));\n }\n }\n return rows;\n}\n\n/**\n * One row per declared application endpoint: its route is withheld until the secret exists, so an unset one\n * is always NEEDED. When the endpoints could not be read, a secret already stored for a well-formed key is\n * still listed as SET — it can be replaced or removed, and nothing here can prove it unused.\n */\nfunction deriveInboundEndpointRequirements(\n owners: Pick<ApplicationSecretOwners, 'inboundEndpointKeys'>,\n isSet: (kind: ApplicationSecretKind, envVarName: string) => boolean,\n): SecretRequirement[] {\n return (owners.inboundEndpointKeys ?? []).map((endpointKey) => {\n const envVarName = deriveInboundEndpointSecretEnvVarName(endpointKey);\n return backendOnlyRow({\n envVarName,\n kind: ApplicationSecretKind.INBOUND_ENDPOINT,\n ownerRef: endpointKey,\n description: `Verifies the deliveries to POST /webhooks/app/${endpointKey}. Its route is not mounted until this is set.`,\n required: true,\n standing: isSet(ApplicationSecretKind.INBOUND_ENDPOINT, envVarName) ? ApplicationSecretStanding.SET : ApplicationSecretStanding.NEEDED,\n });\n });\n}\n\n/**\n * The system-of-record credentials and inbound endpoint secrets an environment's deploy job must receive (#1650):\n * one per credential slot of each declared system of record, and one per declared application endpoint — the\n * rows `wildo secrets` lists for the same environment, so the workflow forwards exactly what the listing asks for.\n *\n * A key is REQUIRED when the deploy cannot do without it: an endpoint's secret always (its route is withheld\n * otherwise), a required slot unless the environment declares the instance absent. Everything else is forwarded\n * as optional, so a secret set later still reaches the job without regenerating the workflow.\n */\nexport function deriveDeployForwardedSecretKeys(\n owners: Pick<ApplicationSecretOwners, 'systemsOfRecord' | 'inboundEndpointKeys'>,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n): ApplicationCiSecretKey[] {\n const nothingSet = (): boolean => false;\n return [\n ...deriveSystemOfRecordRequirements(owners, presence, nothingSet),\n ...deriveInboundEndpointRequirements(owners, nothingSet),\n ].map((row) => ({ kind: row.kind, envVarName: row.envVarName, required: row.standing === ApplicationSecretStanding.NEEDED }));\n}\n\n/**\n * Stored keys no row claims. Each is UNUSED when nothing CONSUMES it — by the SAME test the env builder drops\n * or ignores it with — and otherwise SET under the owner its name points at, because nothing here can prove it\n * unused:\n *\n * - a provider key belonging to no provider the CLI can see (a key of an UNSCOPED provider is neither: it is\n * not listed at all, as before);\n * - a system-of-record key that does not parse, names an undeclared instance, or names neither a secret nor an\n * address slot of it (only when the slots are known). An ADDRESS slot stored as a secret is not unused: the\n * env builder writes the secrets after the address block, so it overrides the address the backend reads;\n * - an inbound key that does not parse, or names an endpoint the backend does not declare (only when the\n * endpoints are known).\n *\n * UNCONSUMED IS NOT UNDELIVERED, and an unused row names the runtimes that still RECEIVE it, so removing it\n * regenerates their `.env` files and restarts them like any other change ({@link receivingRuntimesOfUnused}).\n * The first cut gave every unused row no runtimes, so removing one left the value in the companion's `.env`\n * and in the running process after the person was told it was gone (#1637 review, H1).\n *\n * `present` is every key the section holds, an empty value included: an orphan stored as `\"\"` still makes the\n * env builder warn, so it must be listed to be removable.\n */\nfunction deriveUnusedSecrets(\n owners: ApplicationSecretOwners,\n present: StoredApplicationSecrets,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n claimed: readonly SecretRequirement[],\n): SecretRequirement[] {\n const claimedKeys = new Set(claimed.map((row) => `${row.kind}:${row.envVarName}`));\n const unclaimed = (kind: ApplicationSecretKind): string[] => [...present[kind]].filter((envVarName) => !claimedKeys.has(`${kind}:${envVarName}`));\n const unused = (kind: ApplicationSecretKind, envVarName: string, ownerRef: string | null): SecretRequirement => ({\n envVarName, kind, ownerRef, description: null, required: false, capabilities: [],\n runtimes: receivingRuntimesOfUnused(kind, envVarName, presence), standing: ApplicationSecretStanding.UNUSED, creationEssential: false,\n });\n const rows: SecretRequirement[] = [];\n\n for (const envVarName of unclaimed(ApplicationSecretKind.PROVIDER)) {\n if (!owners.isProviderSecretKey(envVarName)) rows.push(unused(ApplicationSecretKind.PROVIDER, envVarName, null));\n }\n\n const systems = new Map(owners.systemsOfRecord.map((system) => [system.name, system]));\n for (const envVarName of unclaimed(ApplicationSecretKind.SYSTEM_OF_RECORD)) {\n const parts = parseSystemOfRecordEnvVarName(envVarName);\n const system = parts ? systems.get(parts.instanceName) : undefined;\n const overridesAddress = system?.addressSlots?.find((slot) => slot.slug === parts?.slotSlug);\n if (parts && system && (system.secretSlots === null || system.addressSlots === null || overridesAddress)) {\n rows.push(backendOnlyRow({\n envVarName,\n kind: ApplicationSecretKind.SYSTEM_OF_RECORD,\n ownerRef: system.name,\n description: overridesAddress\n ? `Overrides the '${overridesAddress.slug}' address authored in this environment's config, which the backend then reads from here.`\n : null,\n required: false,\n standing: ApplicationSecretStanding.SET,\n }));\n } else {\n rows.push(unused(ApplicationSecretKind.SYSTEM_OF_RECORD, envVarName, parts?.instanceName ?? null));\n }\n }\n\n for (const envVarName of unclaimed(ApplicationSecretKind.INBOUND_ENDPOINT)) {\n const parts = parseInboundEndpointSecretEnvVarName(envVarName);\n if (parts && owners.inboundEndpointKeys === null) {\n rows.push(backendOnlyRow({ envVarName, kind: ApplicationSecretKind.INBOUND_ENDPOINT, ownerRef: parts.endpointKey, description: null, required: false, standing: ApplicationSecretStanding.SET }));\n } else {\n rows.push(unused(ApplicationSecretKind.INBOUND_ENDPOINT, envVarName, parts?.endpointKey ?? null));\n }\n }\n return rows;\n}\n\n/**\n * The runtimes whose generated `.env` still carries an unused key — read off the env builder's own delivery\n * rules, since they are what put it there:\n *\n * - a PROVIDER key reaches the dev companion, whose scope is every provider (`PLATFORM_TIER_ALL_PROVIDERS`,\n * never filtered), whatever provider it belongs to or does not;\n * - a SYSTEM-OF-RECORD key reaches the backend when this environment's config names its instance (addressed\n * or declared absent) — the builder checks the instance, never the slot. With no readable config it is\n * assumed delivered, the direction in which regenerating costs a restart and not a leftover credential;\n * - an INBOUND key reaches the backend when it is a well-formed name, whatever endpoint it names.\n *\n * A name that does not parse reaches nothing.\n */\nfunction receivingRuntimesOfUnused(\n kind: ApplicationSecretKind,\n envVarName: string,\n presence: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null,\n): readonly string[] {\n switch (kind) {\n case ApplicationSecretKind.PROVIDER:\n return [COMPANION_RUNTIME];\n case ApplicationSecretKind.SYSTEM_OF_RECORD: {\n const parts = parseSystemOfRecordEnvVarName(envVarName);\n if (!parts) return [];\n return presence === null || presence[parts.instanceName] !== undefined ? [BACKEND_RUNTIME] : [];\n }\n case ApplicationSecretKind.INBOUND_ENDPOINT:\n return parseInboundEndpointSecretEnvVarName(envVarName) ? [BACKEND_RUNTIME] : [];\n }\n}\n\n/**\n * Whether the creation essentials are met: some companion-scoped LLM provider has every required\n * secret. When they are not, `candidates` are the providers `wildo init`/`setup` offer, in the\n * application's declared order, each with the keys it still lacks.\n */\nexport function creationEssentialsGap(requirements: readonly SecretRequirement[]): {\n readonly satisfied: boolean;\n readonly candidates: ReadonlyArray<{ providerRef: string; missing: readonly SecretRequirement[] }>;\n} {\n const essential = requirements.filter((row) => row.creationEssential && row.ownerRef !== null);\n const byProvider = new Map<string, SecretRequirement[]>();\n for (const row of essential) byProvider.set(row.ownerRef!, [...(byProvider.get(row.ownerRef!) ?? []), row]);\n const candidates = [...byProvider.entries()].map(([providerRef, rows]) => ({\n providerRef,\n missing: rows.filter((row) => row.required && row.standing !== ApplicationSecretStanding.SET),\n }));\n return { satisfied: candidates.some((candidate) => candidate.missing.length === 0), candidates };\n}\n\n/**\n * What the derivation reads from the application — its enabled capabilities, its provider scopes and the\n * discovered provider contributions — loaded ONCE. Loading bundles `wildo.saas.config.ts` and imports every\n * provider package's companion barrel, which is most of what `wildo secrets list` costs, and it does not\n * depend on the environment: `--all` derives every environment from one load rather than repeating it per\n * environment (#1637; measured 86 s for one environment on a loaded machine, with 14 s of CPU).\n *\n * `owners` is loaded with `withOwners` — every surface that LISTS or CHANGES secrets. The creation essentials\n * leave it out: they ask about one provider key, before any backend is built.\n */\nexport interface SecretRequirementInputs {\n readonly enabledCapabilities: ReadonlySet<string>;\n readonly scopes: SaasProviderScopesShape;\n readonly contributions: readonly SecretRequirementContribution[];\n readonly owners?: ApplicationSecretOwners;\n readonly sharedConnections?: SecretRequirementSharedConnections;\n}\n\nexport async function loadSecretRequirementInputs(saasRoot: string, options: { readonly withOwners?: boolean } = {}): Promise<SecretRequirementInputs> {\n const saasConfig = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS));\n const { contributions } = await discoverSaasProviderCompanionContributions({ saasRoot, saasConfig: saasConfig as never });\n const declared = saasConfig as {\n engineCapabilities?: Record<string, { enabled?: boolean }>;\n providers?: { scopes?: SaasProviderScopesShape; sharedConnections?: SecretRequirementSharedConnections };\n systemsOfRecord?: Record<string, SystemOfRecordDeclarationForSecrets>;\n };\n const typedContributions = contributions as unknown as SecretRequirementContribution[];\n return {\n enabledCapabilities: new Set(\n Object.entries(declared.engineCapabilities ?? {}).filter(([, value]) => value?.enabled === true).map(([capability]) => capability),\n ),\n scopes: declared.providers?.scopes ?? {},\n contributions: typedContributions,\n ...(declared.providers?.sharedConnections === undefined ? {} : { sharedConnections: declared.providers.sharedConnections }),\n owners: options.withOwners ? await loadApplicationSecretOwners(saasRoot, declared.systemsOfRecord ?? {}, typedContributions) : undefined,\n };\n}\n\n/**\n * Read what owns the non-provider secrets, and which provider keys belong to a provider at all.\n *\n * The provider test unions the engine tier (`getProviderSensitiveEnvKeys`, which the env builder reads after\n * registering discovery) with this application's discovered contracts, rather than registering them here:\n * registration warns for every engine-owned ref it meets, and a listing is not the place for that noise.\n * The union is EXACT, not an approximation: the builder also attributes each provider's protocol BINDINGS,\n * but a contribution-sourced provider enters the composed catalogue with `protocolBindings: []`\n * (`composed-provider-catalogue.ts`), so for a discovered provider its contract is the whole of what the\n * builder attributes, and the engine tier's bindings are inside `getProviderSensitiveEnvKeys` already.\n */\nasync function loadApplicationSecretOwners(\n saasRoot: string,\n declaredSystems: Readonly<Record<string, SystemOfRecordDeclarationForSecrets>>,\n contributions: readonly SecretRequirementContribution[],\n): Promise<ApplicationSecretOwners> {\n const owners = await loadNonProviderSecretOwners(saasRoot, declaredSystems);\n const discoveredKeys = new Set(contributions.flatMap((contribution) => (contribution.secretsContractShape ?? []).map((entry) => entry.envVarName)));\n const engineKeys = getProviderSensitiveEnvKeys();\n return {\n ...owners,\n isProviderSecretKey: (envVarName) => discoveredKeys.has(envVarName) || engineKeys.has(envVarName),\n };\n}\n\n/**\n * What owns the system-of-record and inbound endpoint secrets: the declared instances' credential slots (read\n * through the facets the backend resolves) and the endpoints the BUILT backend declares. Shared by `wildo secrets`\n * and the deploy workflow generator, so the two cannot disagree about which secrets exist.\n */\nexport async function loadNonProviderSecretOwners(\n saasRoot: string,\n declaredSystems: Readonly<Record<string, SystemOfRecordDeclarationForSecrets>>,\n): Promise<Pick<ApplicationSecretOwners, 'systemsOfRecord' | 'inboundEndpointKeys' | 'incomplete'>> {\n const systems = await resolveDeclaredSystemOfRecordSecrets({ saasRoot, declared: declaredSystems });\n const inbound = readDeclaredInboundEndpointKeys(saasRoot);\n return {\n systemsOfRecord: systems.systems,\n inboundEndpointKeys: inbound.endpointKeys,\n incomplete: [...systems.incomplete, ...inbound.incomplete],\n };\n}\n\n/** Derive an application's requirements in one environment, loading its inputs unless they are supplied. */\nexport async function loadSecretRequirements(input: {\n readonly saasRoot: string;\n readonly stored: StoredApplicationSecrets;\n readonly present?: StoredApplicationSecrets;\n readonly systemOfRecordPresence?: Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null;\n readonly inputs?: SecretRequirementInputs;\n}): Promise<SecretRequirement[]> {\n const inputs = input.inputs ?? await loadSecretRequirementInputs(input.saasRoot);\n return deriveSecretRequirements({ ...inputs, stored: input.stored, present: input.present, systemOfRecordPresence: input.systemOfRecordPresence });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-provisioning.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-provisioning.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-provisioning.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC7B,MAAM,2DAA2D,CAAC;AAKnE,wEAAwE;AACxE,oBAAY,yBAAyB;IACnC,oEAAoE;IACpE,WAAW,gBAAgB;IAC3B,8EAA8E;IAC9E,gBAAgB,qBAAqB;IACrC;;;;;;;;OAQG;IACH,OAAO,YAAY;IACnB;;;;OAIG;IACH,eAAe,oBAAoB;CACpC;AAED,oEAAoE;AACpE,MAAM,WAAW,0BAA0B;IACzC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC;AAED,MAAM,MAAM,0BAA0B,GAClC;IACE,MAAM,EAAE,yBAAyB,CAAC,WAAW,CAAC;IAC9C,0EAA0E;IAC1E,UAAU,EAAE,iCAAiC,EAAE,CAAC;IAChD,4EAA4E;IAC5E,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,GACD;IACE,MAAM,EAAE,yBAAyB,CAAC,OAAO,CAAC;IAC1C,sFAAsF;IACtF,UAAU,EAAE,iCAAiC,EAAE,CAAC;IAChD,4EAA4E;IAC5E,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,GACD;IAAE,MAAM,EAAE,yBAAyB,CAAC,gBAAgB,CAAA;CAAE,GACtD;IAAE,MAAM,EAAE,yBAAyB,CAAC,eAAe,CAAA;CAAE,CAAC;AAE1D,qBAAa,mBAAmB;IAE9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,oBAAoB,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,0BAA0B,GACnC,0BAA0B;CAiC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-provisioning.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-provisioning.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-provisioning.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EACL,gCAAgC,GAGjC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AAEjG,wEAAwE;AACxE,MAAM,CAAN,IAAY,yBAqBX;AArBD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AK,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,MAAM,EAAE,yBAAyB,CAAC,gBAAgB,EAAE,CAAC;QAChE,CAAC;QAED,kBAAkB,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,EAAE,MAAM,EAAE,yBAAyB,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACnF,CAAC;CACF","sourcesContent":["/**\n * secrets-provisioning — persist the idempotent framework-managed-secret backfill for one\n * environment.\n *\n * This is the disk-facing half of `framework-managed-secrets.ts`: load the environment's\n * `secrets.json`, mint whatever framework-generated material is missing, and write it back\n * ONLY when something actually changed. With an operator-authored draft it also CREATES the\n * file for an environment that has none — the `wildo init` path (issue #155).\n *\n * WHY it must run outside `wildo setup`. Framework-generated material used to reach an\n * environment exactly once — at interactive setup. Any material introduced afterwards\n * (the crontabs-batches-manager P2P signing keypair, the immudb state-signing keypair)\n * therefore never reached an environment created before it, and the resulting degradation\n * was silent-by-design: crontabs fell back to an unusable signing key, and the audit\n * store's immudb ran without `--signingKey` so the client reported \"state-signature\n * pinning is OFF\". Running this on the paths that already regenerate derived artifacts\n * turns \"material added to the framework\" into \"material live in every environment on the\n * next command\", with no per-material migration to remember.\n *\n * Safety contract. Provisioning is ADDITIVE — it mints only absent/blank material and\n * never rewrites a value a running deployment already depends on. That is what separates\n * it from rotation (`wildo config sync --rotate-secrets`), which is destructive and stays\n * behind an explicit operator opt-in.\n *\n * Not for CI. A CI lane reconstructs `secrets.json` from published env vars\n * (`reconstructSecretsFromEnv`) and has no file to persist to; minting there would create\n * material that exists only for the length of the process and disagrees with what the\n * deployed services hold. Callers gate on `!isCi` — see the call sites in\n * `config sync` and `RuntimeBootstrap.ensureLocalRuntimeArtifacts`.\n */\n\nimport { ConfigSecretsUtils } from '~wildo-cli/services/credentials/credentials.service';\nimport {\n provisionFrameworkManagedSecrets,\n type FrameworkManagedSecretMaterialRef,\n type PlatformEnvSecretsDraft,\n} from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { SecretOwner } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { InfrastructureHost } from '~wildo-cli/services/environment/infrastructure-host.service';\n\n/** Outcome kind of {@link SecretsProvisioning.ensureForEnvironment}. */\nexport enum SecretsProvisioningStatus {\n /** Missing material was minted and `secrets.json` was rewritten. */\n PROVISIONED = 'provisioned',\n /** Every framework-managed material was already present — nothing written. */\n ALREADY_COMPLETE = 'already-complete',\n /**\n * No `secrets.json` existed and the caller supplied an operator-authored draft, so the\n * file was CREATED — every framework-managed material minted in one pass.\n *\n * Distinct from {@link PROVISIONED} on purpose: that one BACKFILLS gaps in a file a\n * running deployment may already depend on, this one brings an environment into\n * existence. Only a caller that owns the operator-typed half (`wildo init`, which has\n * just scaffolded the app and resolved its administrator) may ask for it.\n */\n CREATED = 'created',\n /**\n * No readable `secrets.json` for this environment. NOT an error here: the env may be\n * CI/remote-reconstructed, or genuinely un-set-up — in which case the downstream step\n * that actually needs secrets fails loudly with its own actionable message.\n */\n NO_SECRETS_FILE = 'no-secrets-file',\n}\n\n/** Options for {@link SecretsProvisioning.ensureForEnvironment}. */\nexport interface SecretsProvisioningOptions {\n /**\n * Operator-typed half of `secrets.json` (the admin identity, and optionally provider /\n * atlas / github material) used to CREATE the file when none exists.\n *\n * Omitted by every self-heal caller — a hot path that has no operator present must\n * report {@link SecretsProvisioningStatus.NO_SECRETS_FILE} and let the step that\n * genuinely needs secrets fail with its own actionable message, exactly as before.\n */\n createWith?: PlatformEnvSecretsDraft;\n}\n\nexport type SecretsProvisioningOutcome =\n | {\n status: SecretsProvisioningStatus.PROVISIONED;\n /** Materials that were absent and have just been minted (never empty). */\n mintedRefs: FrameworkManagedSecretMaterialRef[];\n /** Flattened `secrets.json` keys written, for operator-facing reporting. */\n mintedKeys: string[];\n }\n | {\n status: SecretsProvisioningStatus.CREATED;\n /** Every framework-managed material — a created file starts empty, so all of them. */\n mintedRefs: FrameworkManagedSecretMaterialRef[];\n /** Flattened `secrets.json` keys written, for operator-facing reporting. */\n mintedKeys: string[];\n }\n | { status: SecretsProvisioningStatus.ALREADY_COMPLETE }\n | { status: SecretsProvisioningStatus.NO_SECRETS_FILE };\n\nexport class SecretsProvisioning {\n\n /**\n * Bring `<env>/secrets.json` up to date: mint and persist every framework-managed\n * credential material it is missing, and — only when `options.createWith` is supplied —\n * CREATE the file when it does not exist yet.\n *\n * Idempotent in BOTH shapes, which is the whole point. A second call against a complete\n * environment returns {@link SecretsProvisioningStatus.ALREADY_COMPLETE} and writes\n * nothing, so it can sit on a hot path (every `wildo local dev`, every `wildo init`\n * re-run) without churning the file's mtime, rotating a credential a running deployment\n * already holds, or churning the git status of an environment whose secrets are tracked.\n * That is guaranteed upstream rather than here: `provisionFrameworkManagedSecrets` is\n * additive by construction and never touches material that is present.\n *\n * Note the asymmetry between the two branches, which is deliberate. The CREATE branch\n * seeds the draft from the caller's operator-typed material and mints the rest; the\n * BACKFILL branch seeds it from what is already ON DISK. Passing `createWith` to an\n * environment that already has a file would therefore be meaningless — the disk always\n * wins — so the option is read only when there is nothing to lose.\n *\n * Fail-soft on a missing/unreadable secrets file when no draft is offered — see\n * {@link SecretsProvisioningStatus.NO_SECRETS_FILE}.\n */\n static ensureForEnvironment(\n envName: string,\n options?: SecretsProvisioningOptions,\n ): SecretsProvisioningOutcome {\n /*\n * A HOSTED environment mints only its own materials. Its shared credentials are its host's, minted by\n * the host; minting them here would produce values no running container holds (and the writer would\n * drop them anyway, so every run would \"provision\" them again).\n */\n const scope = InfrastructureHost.resolveByName(envName) !== null\n ? { owners: new Set([SecretOwner.APPLICATION]) }\n : undefined;\n const secrets = EnvironmentUtils.loadSecretsJson(envName);\n if (!secrets) {\n const draft = options?.createWith;\n if (!draft) {\n return { status: SecretsProvisioningStatus.NO_SECRETS_FILE };\n }\n\n const created = provisionFrameworkManagedSecrets(draft, scope);\n ConfigSecretsUtils.writeSecretsJson(envName, created.secrets);\n return {\n status: SecretsProvisioningStatus.CREATED,\n mintedRefs: created.mintedRefs,\n mintedKeys: created.mintedKeys,\n };\n }\n\n const { mintedRefs, mintedKeys } = provisionFrameworkManagedSecrets(secrets, scope);\n if (mintedRefs.length === 0) {\n return { status: SecretsProvisioningStatus.ALREADY_COMPLETE };\n }\n\n ConfigSecretsUtils.writeSecretsJson(envName, secrets);\n return { status: SecretsProvisioningStatus.PROVISIONED, mintedRefs, mintedKeys };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-reader.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-reader.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-reader.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAKlG,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,oBAAY,cAAc;IACxB,kEAAkE;IAClE,OAAO,YAAY;IACnB,wEAAwE;IACxE,MAAM,WAAW;IACjB,sEAAsE;IACtE,UAAU,eAAe;IACzB,2EAA2E;IAC3E,QAAQ,aAAa;IACrB,yCAAyC;IACzC,OAAO,YAAY;IACnB,qFAAqF;IACrF,QAAQ,aAAa;IACrB,8FAA8F;IAC9F,KAAK,UAAU;IACf;;;;;OAKG;IACH,WAAW,gBAAgB;IAC3B,uFAAuF;IACvF,YAAY,gBAAgB;IAC5B;;;;;;;;OAQG;IACH,qBAAqB,uBAAuB;IAC5C;;;OAGG;IACH,oBAAoB,uBAAuB;IAC3C,qFAAqF;IACrF,KAAK,UAAU;IACf,6EAA6E;IAC7E,MAAM,WAAW;IACjB;;;;OAIG;IACH,MAAM,WAAW;IACjB,uEAAuE;IACvE,MAAM,WAAW;CAClB;AAmDD,qBAAa,aAAa;IAExB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,sBAAsB,GAAG,IAAI;IAInE,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,EAAE;IA4BlE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAMlC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAUjF,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAmBrF,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,gBAAgB;IAuDlE,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5C,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAOzC;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-reader.service.js","sourceRoot":"","sources":["../../../../../../src/services/credentials/secrets-reader.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAS7F;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,cAmDX;AAnDD,WAAY,cAAc;IACxB,kEAAkE;IAClE,qCAAmB,CAAA;IACnB,wEAAwE;IACxE,mC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C/E,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,GAAW;QAChC,OAAO,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,GAAW;QAC5B,IAAI,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC;eACxD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;CAEF","sourcesContent":["import type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { FRAMEWORK_MANAGED_SECRET_KEYS } from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\n\nexport interface FlattenedSecret {\n key: string;\n value: string;\n category: SecretCategory;\n autoGenerated: boolean;\n}\n\n/**\n * The top-level sections of `secrets.json`, as a named vocabulary.\n *\n * Each member is one section of the secrets file and carries a distinct provenance —\n * which is exactly what an anonymous literal union could not say, and why this became an\n * enum when `MONGOT` was added rather than a twelfth alternative in a bare union.\n *\n * The values ARE the JSON keys: `flatten` reads a section name off the parsed file and\n * classifies it by this vocabulary, so the member's value and the on-disk key are one\n * thing, not two that could drift.\n */\nexport enum SecretCategory {\n /** Root credential of the self-hosted MongoDB backing service. */\n MONGODB = 'mongodb',\n /** Admin credential of the self-hosted Valkey/Redis backing service. */\n VALKEY = 'valkey',\n /** Admin credential of the self-hosted PostgreSQL backing service. */\n POSTGRESQL = 'postgresql',\n /** Admin credential + Erlang cookie of the self-hosted RabbitMQ broker. */\n RABBITMQ = 'rabbitmq',\n /** MinIO/S3 access + secret key pair. */\n STORAGE = 'storage',\n /** Platform-service material: primary/admin secrets and the P2P signing keypairs. */\n PLATFORM = 'platform',\n /** The seeded platform admin user (operator-authored identity, framework-minted password). */\n ADMIN = 'admin',\n /**\n * The APPLICATION's own operator-door secret (#586) — a section of its own, not a key under\n * {@link SecretCategory.PLATFORM}, because it is the one admin secret that must REACH an\n * application runtime, and the platform-credential confinement guard refuses to emit anything\n * filed under `platform` into an application-tier env.\n */\n APPLICATION = 'application',\n /** Operator-supplied provider API keys, already keyed by their target env-var name. */\n PROVIDER_ENV = 'providerEnv',\n /**\n * Operator-supplied system-of-record credentials, keyed by their DERIVED env-var name\n * (`WILDO_SOR_<NAME>__<SLOT>`, #1055).\n *\n * A category of its own rather than a key under {@link SecretCategory.PROVIDER_ENV}, because the\n * two are attributed differently: a `providerEnv` key belongs to a PROVIDER's secrets contract and\n * is scoped by `filterProviderEnvToScope`, which would silently drop a system of record's key the\n * moment its vendor left `providers.scopes`. Nothing here is a provider (D10).\n */\n SYSTEMS_OF_RECORD_ENV = 'systemsOfRecordEnv',\n /**\n * Verification secrets of the application's inbound endpoints, keyed by their DERIVED env-var name\n * (`WILDO_INBOUND_<ENDPOINT_KEY>__SECRET`, #1596). Not a provider's, for the same reason as the line above.\n */\n INBOUND_ENDPOINT_ENV = 'inboundEndpointEnv',\n /** MongoDB Atlas API credentials — present only for an Atlas-sourced environment. */\n ATLAS = 'atlas',\n /** immudb state-signing keypair (the audit store's substitution defense). */\n IMMUDB = 'immudb',\n /**\n * Issue #74 — the `mongot` sync-source SCRAM password. A category of its own rather than\n * a key under MONGODB, because it is a different service's identity and rotating it must\n * not re-mint the mongod root credential a running stack authenticates with.\n */\n MONGOT = 'mongot',\n /** GitHub organization + admin token used by the app-creation lane. */\n GITHUB = 'github',\n}\n\n/**\n * Every generated-secret key, DERIVED from the single `FRAMEWORK_MANAGED_SECRET_MATERIALS`\n * registry that also mints and rotates them. Hand-listing this set is how it silently fell\n * out of sync with what is actually generated (the crontabs-batches-manager signing keypair\n * was minted but never classified as auto-generated, so the CLI displayed it unmasked and\n * omitted it from rotation reports).\n */\nconst AUTO_GENERATED_KEYS = new Set<string>(FRAMEWORK_MANAGED_SECRET_KEYS);\n\n/**\n * Operationally required even though the Zod schema marks mongodb/valkey as\n * `.optional()`. Every category here is backed by a framework-managed material, so\n * provisioning (at setup or via the idempotent self-heal) always produces them.\n */\nconst REQUIRED_CATEGORIES: SecretCategory[] = [\n SecretCategory.MONGODB,\n SecretCategory.VALKEY,\n SecretCategory.POSTGRESQL,\n SecretCategory.RABBITMQ,\n SecretCategory.STORAGE,\n SecretCategory.PLATFORM,\n SecretCategory.ADMIN,\n];\n\n// Keyed by `string`, not by SecretCategory: `platform.appsManager` is a DOTTED PATH into a\n// section, not a section — so the key space here is deliberately wider than the vocabulary.\nconst EXPECTED_KEYS_BY_CATEGORY: Record<string, string[]> = {\n [SecretCategory.MONGODB]: ['rootUser', 'rootPassword'],\n [SecretCategory.VALKEY]: ['adminUser', 'adminPassword'],\n [SecretCategory.POSTGRESQL]: ['adminUser', 'adminPassword'],\n [SecretCategory.RABBITMQ]: ['adminUsername', 'adminPassword', 'erlangCookie'],\n [SecretCategory.STORAGE]: ['accessKey', 'secretKey'],\n 'platform.appsManager': ['privateKey', 'publicKey'],\n [SecretCategory.PLATFORM]: ['primarySecret', 'adminSecret'],\n [SecretCategory.ADMIN]: ['email', 'password', 'firstName', 'lastName'],\n // Display/expected keys only — immudb is intentionally NOT in REQUIRED_CATEGORIES.\n // File-backed environments always carry it (the self-heal provisioning mints it), but a\n // CI-reconstructed secrets.json legitimately has none: `reconstructSecretsFromEnv` maps\n // only the env vars CI publishes, and immudb signing material is not among them.\n // Requiring it would fail validation on exactly the lane that cannot supply it.\n [SecretCategory.IMMUDB]: ['stateSigningPrivateKey', 'stateSigningPublicKey', 'adminPassword'],\n // Issue #74 — same reasoning as immudb, and for the same lane: display/expected keys only,\n // deliberately NOT in REQUIRED_CATEGORIES. `reconstructSecretsFromEnv` publishes no mongot\n // material, so requiring it would fail validation on CI, which is precisely the lane that\n // cannot supply it. A file-backed environment always carries it after the self-heal.\n [SecretCategory.MONGOT]: ['syncSourcePassword'],\n};\n\n\nexport class SecretsReader {\n\n static loadSecrets(envName?: string): PlatformEnvSecretsJson | null {\n return EnvironmentRegistry.loadSecretsJson(envName, EnvironmentPaths.resolveSecretsDir(envName));\n }\n\n static flatten(secrets: PlatformEnvSecretsJson): FlattenedSecret[] {\n const result: FlattenedSecret[] = [];\n\n const walk = (obj: Record<string, unknown>, prefix: string, category: SecretCategory) => {\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n if (value !== null && value !== undefined && typeof value === 'object' && !Array.isArray(value)) {\n walk(value as Record<string, unknown>, fullKey, category);\n } else if (typeof value === 'string') {\n result.push({\n key: fullKey,\n value,\n category,\n autoGenerated: AUTO_GENERATED_KEYS.has(fullKey),\n });\n }\n }\n };\n\n for (const [topKey, section] of Object.entries(secrets)) {\n if (section !== null && section !== undefined && typeof section === 'object') {\n walk(section as Record<string, unknown>, topKey, topKey as SecretCategory);\n }\n }\n\n return result;\n }\n\n static mask(value: string): string {\n if (value.length <= 6) return '****';\n if (value.includes('\\n')) return '****[multiline]';\n return value.slice(0, 3) + '****' + value.slice(-3);\n }\n\n static getByKey(secrets: PlatformEnvSecretsJson, key: string): string | undefined {\n const parts = key.split('.');\n let current: unknown = secrets;\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return typeof current === 'string' ? current : undefined;\n }\n\n static setByKey(secrets: PlatformEnvSecretsJson, key: string, value: string): boolean {\n const parts = key.split('.');\n if (parts.length < 2) return false;\n\n let current: unknown = secrets;\n for (let i = 0; i < parts.length - 1; i++) {\n if (current === null || current === undefined || typeof current !== 'object') return false;\n const next = (current as Record<string, unknown>)[parts[i]];\n if (next === undefined || next === null) {\n (current as Record<string, unknown>)[parts[i]] = {};\n }\n current = (current as Record<string, unknown>)[parts[i]];\n }\n\n if (current === null || current === undefined || typeof current !== 'object') return false;\n (current as Record<string, unknown>)[parts[parts.length - 1]] = value;\n return true;\n }\n\n static validate(secrets: PlatformEnvSecretsJson): ValidationResult {\n const missing: string[] = [];\n const empty: string[] = [];\n\n for (const category of REQUIRED_CATEGORIES) {\n const section = (secrets as Record<string, unknown>)[category];\n if (!section || typeof section !== 'object') {\n missing.push(category);\n continue;\n }\n\n if (category === 'platform') {\n const plat = section as Record<string, unknown>;\n if (plat.primarySecret === undefined || plat.primarySecret === null) {\n missing.push('platform.primarySecret');\n } else if (typeof plat.primarySecret === 'string' && plat.primarySecret.length === 0) {\n empty.push('platform.primarySecret');\n }\n if (plat.adminSecret === undefined || plat.adminSecret === null) {\n missing.push('platform.adminSecret');\n } else if (typeof plat.adminSecret === 'string' && plat.adminSecret.length === 0) {\n empty.push('platform.adminSecret');\n }\n const am = plat.appsManager;\n if (!am || typeof am !== 'object') {\n missing.push('platform.appsManager');\n } else {\n for (const k of EXPECTED_KEYS_BY_CATEGORY['platform.appsManager']) {\n const val = (am as Record<string, unknown>)[k];\n if (val === undefined || val === null) {\n missing.push(`platform.appsManager.${k}`);\n } else if (typeof val === 'string' && val.length === 0) {\n empty.push(`platform.appsManager.${k}`);\n }\n }\n }\n continue;\n }\n\n const expectedKeys = EXPECTED_KEYS_BY_CATEGORY[category];\n if (!expectedKeys) continue;\n\n for (const k of expectedKeys) {\n const val = (section as Record<string, unknown>)[k];\n if (val === undefined || val === null) {\n missing.push(`${category}.${k}`);\n } else if (typeof val === 'string' && val.length === 0) {\n empty.push(`${category}.${k}`);\n }\n }\n }\n\n return { valid: missing.length === 0 && empty.length === 0, missing, empty };\n }\n\n static isAutoGenerated(key: string): boolean {\n return AUTO_GENERATED_KEYS.has(key);\n }\n\n static isSensitive(key: string): boolean {\n if (AUTO_GENERATED_KEYS.has(key)) return true;\n const lower = key.toLowerCase();\n return lower.includes('password') || lower.includes('secret')\n || lower.includes('key') || lower.includes('token');\n }\n\n}\n\n\nexport interface ValidationResult {\n valid: boolean;\n missing: string[];\n empty: string[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"secrets-reader.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-reader.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAS7F;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,cAmDX;AAnDD,WAAY,cAAc;IACxB,kEAAkE;IAClE,qCAAmB,CAAA;IACnB,wEAAwE;IACxE,mCAAiB,CAAA;IACjB,sEAAsE;IACtE,2CAAyB,CAAA;IACzB,2EAA2E;IAC3E,uCAAqB,CAAA;IACrB,yCAAyC;IACzC,qCAAmB,CAAA;IACnB,qFAAqF;IACrF,uCAAqB,CAAA;IACrB,8FAA8F;IAC9F,iCAAe,CAAA;IACf;;;;;OAKG;IACH,6CAA2B,CAAA;IAC3B,uFAAuF;IACvF,8CAA4B,CAAA;IAC5B;;;;;;;;OAQG;IACH,8DAA4C,CAAA;IAC5C;;;OAGG;IACH,6DAA2C,CAAA;IAC3C,qFAAqF;IACrF,iCAAe,CAAA;IACf,6EAA6E;IAC7E,mCAAiB,CAAA;IACjB;;;;OAIG;IACH,mCAAiB,CAAA;IACjB,uEAAuE;IACvE,mCAAiB,CAAA;AACnB,CAAC,EAnDW,cAAc,KAAd,cAAc,QAmDzB;AAED;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,6BAA6B,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,mBAAmB,GAAqB;IAC5C,cAAc,CAAC,OAAO;IACtB,cAAc,CAAC,MAAM;IACrB,cAAc,CAAC,UAAU;IACzB,cAAc,CA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AC,CAAC,CAAC;gBACpD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;oBACtC,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAC;gBACnC,CAAC;qBAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACvD,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,GAAW;QAChC,OAAO,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,GAAW;QAC5B,IAAI,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC;eACxD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;CAEF","sourcesContent":["import type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { FRAMEWORK_MANAGED_SECRET_KEYS } from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\n\nexport interface FlattenedSecret {\n key: string;\n value: string;\n category: SecretCategory;\n autoGenerated: boolean;\n}\n\n/**\n * The top-level sections of `secrets.json`, as a named vocabulary.\n *\n * Each member is one section of the secrets file and carries a distinct provenance —\n * which is exactly what an anonymous literal union could not say, and why this became an\n * enum when `MONGOT` was added rather than a twelfth alternative in a bare union.\n *\n * The values ARE the JSON keys: `flatten` reads a section name off the parsed file and\n * classifies it by this vocabulary, so the member's value and the on-disk key are one\n * thing, not two that could drift.\n */\nexport enum SecretCategory {\n /** Root credential of the self-hosted MongoDB backing service. */\n MONGODB = 'mongodb',\n /** Admin credential of the self-hosted Valkey/Redis backing service. */\n VALKEY = 'valkey',\n /** Admin credential of the self-hosted PostgreSQL backing service. */\n POSTGRESQL = 'postgresql',\n /** Admin credential + Erlang cookie of the self-hosted RabbitMQ broker. */\n RABBITMQ = 'rabbitmq',\n /** MinIO/S3 access + secret key pair. */\n STORAGE = 'storage',\n /** Platform-service material: primary/admin secrets and the P2P signing keypairs. */\n PLATFORM = 'platform',\n /** The seeded platform admin user (operator-authored identity, framework-minted password). */\n ADMIN = 'admin',\n /**\n * The APPLICATION's own operator-door secret (#586) — a section of its own, not a key under\n * {@link SecretCategory.PLATFORM}, because it is the one admin secret that must REACH an\n * application runtime, and the platform-credential confinement guard refuses to emit anything\n * filed under `platform` into an application-tier env.\n */\n APPLICATION = 'application',\n /** Operator-supplied provider API keys, already keyed by their target env-var name. */\n PROVIDER_ENV = 'providerEnv',\n /**\n * Operator-supplied system-of-record credentials, keyed by their DERIVED env-var name\n * (`WILDO_SOR_<NAME>__<SLOT>`, #1055).\n *\n * A category of its own rather than a key under {@link SecretCategory.PROVIDER_ENV}, because the\n * two are attributed differently: a `providerEnv` key belongs to a PROVIDER's secrets contract and\n * is scoped by `filterProviderEnvToScope`, which would silently drop a system of record's key the\n * moment its vendor left `providers.scopes`. Nothing here is a provider (D10).\n */\n SYSTEMS_OF_RECORD_ENV = 'systemsOfRecordEnv',\n /**\n * Verification secrets of the application's inbound endpoints, keyed by their DERIVED env-var name\n * (`WILDO_INBOUND_<ENDPOINT_KEY>__SECRET`, #1596). Not a provider's, for the same reason as the line above.\n */\n INBOUND_ENDPOINT_ENV = 'inboundEndpointEnv',\n /** MongoDB Atlas API credentials — present only for an Atlas-sourced environment. */\n ATLAS = 'atlas',\n /** immudb state-signing keypair (the audit store's substitution defense). */\n IMMUDB = 'immudb',\n /**\n * Issue #74 — the `mongot` sync-source SCRAM password. A category of its own rather than\n * a key under MONGODB, because it is a different service's identity and rotating it must\n * not re-mint the mongod root credential a running stack authenticates with.\n */\n MONGOT = 'mongot',\n /** GitHub organization + admin token used by the app-creation lane. */\n GITHUB = 'github',\n}\n\n/**\n * Every generated-secret key, DERIVED from the single `FRAMEWORK_MANAGED_SECRET_MATERIALS`\n * registry that also mints and rotates them. Hand-listing this set is how it silently fell\n * out of sync with what is actually generated (the crontabs-batches-manager signing keypair\n * was minted but never classified as auto-generated, so the CLI displayed it unmasked and\n * omitted it from rotation reports).\n */\nconst AUTO_GENERATED_KEYS = new Set<string>(FRAMEWORK_MANAGED_SECRET_KEYS);\n\n/**\n * Operationally required even though the Zod schema marks mongodb/valkey as\n * `.optional()`. Every category here is backed by a framework-managed material, so\n * provisioning (at setup or via the idempotent self-heal) always produces them.\n */\nconst REQUIRED_CATEGORIES: SecretCategory[] = [\n SecretCategory.MONGODB,\n SecretCategory.VALKEY,\n SecretCategory.POSTGRESQL,\n SecretCategory.RABBITMQ,\n SecretCategory.STORAGE,\n SecretCategory.PLATFORM,\n SecretCategory.ADMIN,\n];\n\n// Keyed by `string`, not by SecretCategory: `platform.appsManager` is a DOTTED PATH into a\n// section, not a section — so the key space here is deliberately wider than the vocabulary.\nconst EXPECTED_KEYS_BY_CATEGORY: Record<string, string[]> = {\n [SecretCategory.MONGODB]: ['rootUser', 'rootPassword'],\n [SecretCategory.VALKEY]: ['adminUser', 'adminPassword'],\n [SecretCategory.POSTGRESQL]: ['adminUser', 'adminPassword'],\n [SecretCategory.RABBITMQ]: ['adminUsername', 'adminPassword', 'erlangCookie'],\n [SecretCategory.STORAGE]: ['accessKey', 'secretKey'],\n 'platform.appsManager': ['privateKey', 'publicKey'],\n [SecretCategory.PLATFORM]: ['primarySecret', 'adminSecret'],\n [SecretCategory.ADMIN]: ['email', 'password', 'firstName', 'lastName'],\n // Display/expected keys only — immudb is intentionally NOT in REQUIRED_CATEGORIES.\n // File-backed environments always carry it (the self-heal provisioning mints it), but a\n // CI-reconstructed secrets.json legitimately has none: `reconstructSecretsFromEnv` maps\n // only the env vars CI publishes, and immudb signing material is not among them.\n // Requiring it would fail validation on exactly the lane that cannot supply it.\n [SecretCategory.IMMUDB]: ['stateSigningPrivateKey', 'stateSigningPublicKey', 'adminPassword'],\n // Issue #74 — same reasoning as immudb, and for the same lane: display/expected keys only,\n // deliberately NOT in REQUIRED_CATEGORIES. `reconstructSecretsFromEnv` publishes no mongot\n // material, so requiring it would fail validation on CI, which is precisely the lane that\n // cannot supply it. A file-backed environment always carries it after the self-heal.\n [SecretCategory.MONGOT]: ['syncSourcePassword'],\n};\n\n\nexport class SecretsReader {\n\n static loadSecrets(envName?: string): PlatformEnvSecretsJson | null {\n return EnvironmentRegistry.loadSecretsJson(envName, EnvironmentPaths.resolveSecretsDir(envName));\n }\n\n static flatten(secrets: PlatformEnvSecretsJson): FlattenedSecret[] {\n const result: FlattenedSecret[] = [];\n\n const walk = (obj: Record<string, unknown>, prefix: string, category: SecretCategory) => {\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n if (value !== null && value !== undefined && typeof value === 'object' && !Array.isArray(value)) {\n walk(value as Record<string, unknown>, fullKey, category);\n } else if (typeof value === 'string') {\n result.push({\n key: fullKey,\n value,\n category,\n autoGenerated: AUTO_GENERATED_KEYS.has(fullKey),\n });\n }\n }\n };\n\n for (const [topKey, section] of Object.entries(secrets)) {\n if (section !== null && section !== undefined && typeof section === 'object') {\n walk(section as Record<string, unknown>, topKey, topKey as SecretCategory);\n }\n }\n\n return result;\n }\n\n static mask(value: string): string {\n if (value.length <= 6) return '****';\n if (value.includes('\\n')) return '****[multiline]';\n return value.slice(0, 3) + '****' + value.slice(-3);\n }\n\n static getByKey(secrets: PlatformEnvSecretsJson, key: string): string | undefined {\n const parts = key.split('.');\n let current: unknown = secrets;\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return typeof current === 'string' ? current : undefined;\n }\n\n static setByKey(secrets: PlatformEnvSecretsJson, key: string, value: string): boolean {\n const parts = key.split('.');\n if (parts.length < 2) return false;\n\n let current: unknown = secrets;\n for (let i = 0; i < parts.length - 1; i++) {\n if (current === null || current === undefined || typeof current !== 'object') return false;\n const next = (current as Record<string, unknown>)[parts[i]];\n if (next === undefined || next === null) {\n (current as Record<string, unknown>)[parts[i]] = {};\n }\n current = (current as Record<string, unknown>)[parts[i]];\n }\n\n if (current === null || current === undefined || typeof current !== 'object') return false;\n (current as Record<string, unknown>)[parts[parts.length - 1]] = value;\n return true;\n }\n\n static validate(secrets: PlatformEnvSecretsJson): ValidationResult {\n const missing: string[] = [];\n const empty: string[] = [];\n\n for (const category of REQUIRED_CATEGORIES) {\n const section = (secrets as Record<string, unknown>)[category];\n if (!section || typeof section !== 'object') {\n missing.push(category);\n continue;\n }\n\n if (category === 'platform') {\n const plat = section as Record<string, unknown>;\n if (plat.primarySecret === undefined || plat.primarySecret === null) {\n missing.push('platform.primarySecret');\n } else if (typeof plat.primarySecret === 'string' && plat.primarySecret.length === 0) {\n empty.push('platform.primarySecret');\n }\n if (plat.adminSecret === undefined || plat.adminSecret === null) {\n missing.push('platform.adminSecret');\n } else if (typeof plat.adminSecret === 'string' && plat.adminSecret.length === 0) {\n empty.push('platform.adminSecret');\n }\n const am = plat.appsManager;\n if (!am || typeof am !== 'object') {\n missing.push('platform.appsManager');\n } else {\n for (const k of EXPECTED_KEYS_BY_CATEGORY['platform.appsManager']) {\n const val = (am as Record<string, unknown>)[k];\n if (val === undefined || val === null) {\n missing.push(`platform.appsManager.${k}`);\n } else if (typeof val === 'string' && val.length === 0) {\n empty.push(`platform.appsManager.${k}`);\n }\n }\n }\n continue;\n }\n\n const expectedKeys = EXPECTED_KEYS_BY_CATEGORY[category];\n if (!expectedKeys) continue;\n\n for (const k of expectedKeys) {\n const val = (section as Record<string, unknown>)[k];\n if (val === undefined || val === null) {\n missing.push(`${category}.${k}`);\n } else if (typeof val === 'string' && val.length === 0) {\n empty.push(`${category}.${k}`);\n }\n }\n }\n\n return { valid: missing.length === 0 && empty.length === 0, missing, empty };\n }\n\n static isAutoGenerated(key: string): boolean {\n return AUTO_GENERATED_KEYS.has(key);\n }\n\n static isSensitive(key: string): boolean {\n if (AUTO_GENERATED_KEYS.has(key)) return true;\n const lower = key.toLowerCase();\n return lower.includes('password') || lower.includes('secret')\n || lower.includes('key') || lower.includes('token');\n }\n\n}\n\n\nexport interface ValidationResult {\n valid: boolean;\n missing: string[];\n empty: string[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-rotation.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-rotation.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-rotation.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAClG,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,2DAA2D,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAE1B,sGAAsG;IACtG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,CAAC,EAAE,4BAA4B,GAAG,cAAc;CAgBrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-rotation.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-rotation.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-rotation.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,GAE9B,MAAM,2DAA2D,CAAC;AAOnE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,eAAe;IAE1B,sGAAsG;IACtG,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,KAAoC;QACjF,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,6BAA6B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAE7F,MAAM,WAAW,GAAG,CAAC,GAAG,qBAAqB,CAAC,CAAC;QAC/C,oFAAoF;QACpF,8EAA8E;QAC9E,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;QACrE,IAAI,OAAO,CAAC,KAAK;YAAE,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,OAAO,CAAC,MAAM;YAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,OAAO,CAAC,WAAW;YAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,kBAAkB;YAAE,WAAW,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACzE,wFAAwF;QACxF,IAAI,OAAO,CAAC,kBAAkB;YAAE,WAAW,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAEzE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IACtC,CAAC;CACF","sourcesContent":["import type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport {\n rotateFrameworkManagedSecrets,\n type FrameworkManagedSecretsScope,\n} from '~wildo-cli/services/credentials/framework-managed-secrets';\n\nexport interface RotationResult {\n rotatedKeys: string[];\n skippedKeys: string[];\n}\n\n/**\n * Regenerates every framework-generated credential field. User-provided values (admin\n * identity, provider API keys, GitHub tokens, Atlas API keys) are preserved, as are the\n * non-secret identity halves of generated materials (service usernames).\n *\n * The set of rotatable fields is DERIVED from the single\n * `FRAMEWORK_MANAGED_SECRET_MATERIALS` registry rather than hand-listed here. When it was\n * hand-listed, it drifted from what `buildCredentials` actually minted: the\n * crontabs-batches-manager and immudb signing keypairs were never rotated because nobody\n * remembered to add them, so an operator running `--rotate-secrets` to remediate got a\n * silently incomplete rotation. Deriving removes the possibility.\n */\nexport class SecretsRotation {\n\n /** `scope` restricts the rotation to some owners' materials — a hosted application passes its own. */\n static rotate(secrets: PlatformEnvSecretsJson, scope?: FrameworkManagedSecretsScope): RotationResult {\n const { rotatedKeys, preservedIdentityKeys } = rotateFrameworkManagedSecrets(secrets, scope);\n\n const skippedKeys = [...preservedIdentityKeys];\n // Operator-typed material — outside the framework-managed registry by construction,\n // reported here so the operator sees what a rotation deliberately left alone.\n skippedKeys.push('admin.email', 'admin.firstName', 'admin.lastName');\n if (secrets.atlas) skippedKeys.push('atlas.*');\n if (secrets.github) skippedKeys.push('github.*');\n if (secrets.providerEnv) skippedKeys.push('providerEnv.*');\n if (secrets.systemsOfRecordEnv) skippedKeys.push('systemsOfRecordEnv.*');\n // The sender holds the same secret; rotating it here alone would refuse every delivery.\n if (secrets.inboundEndpointEnv) skippedKeys.push('inboundEndpointEnv.*');\n\n return { rotatedKeys, skippedKeys };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-writer.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-writer.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-writer.service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAC5G,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAC;AAC7G,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAC3G,OAAO,EAAE,sBAAsB,EAAiC,MAAM,qDAAqD,CAAC;AAO5H,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAmB7F;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,cAAc,EAC5B,SAAS,EAAE,2BAA2B,EACtC,eAAe,EAAE,iBAAiB,EAClC,eAAe,EAAE,cAAc,GAAG,SAAS,EAC3C,eAAe,CAAC,EAAE,sBAAsB,GACvC,sBAAsB,CAoCxB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,gCAAgC,EACrC,WAAW,EAAE,sBAAsB,EACnC,SAAS,EAAE,2BAA2B,EACtC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-writer.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"secrets-writer.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/secrets-writer.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EAA0B,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAC5H,OAAO,EACL,gCAAgC,GAEjC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAGrE;;;;;GAKG;AACH,MAAM,UAAU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,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC3D,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,YAAY,UAAU,CAAC,CAAC,CAAC;IAEnE,kBAAkB,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACnD,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,WAAW,UAAU,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import chalk from 'chalk';\nimport { lstatSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { AdminUserInput, ProviderKeysInput } from '~wildo-cli/services/credentials/credentials.schemas';\nimport type { DatabaseInitializationInput } from '~wildo-cli/services/data-services/data-services.schemas';\nimport { PlatformEnvSecretsJson, PlatformEnvSecretsJson_Schema } from '~wildo-cli/services/credentials/credentials.schemas';\nimport {\n provisionFrameworkManagedSecrets,\n type PlatformEnvSecretsDraft,\n} from '~wildo-cli/services/credentials/framework-managed-secrets';\nimport { ConfigSecretsUtils } from '~wildo-cli/services/credentials/credentials.service';\nimport { FILE_NAMES } from '~wildo-cli/infrastructure/io/io.schemas';\nimport type { Logger } from '~wildo-cli/kernel/types';\n\n/**\n * Setup must distinguish an absent store from an unreadable or invalid existing store.\n * This deliberately bypasses the permissive environment registry cache, whose null result\n * cannot authorize creating replacement credentials. Only an absent directory entry permits\n * creation; a dangling symlink, read failure or malformed existing file is never absence.\n */\nexport function readSetupSecrets(secretsDirectory: string): PlatformEnvSecretsJson | undefined {\n const filePath = join(secretsDirectory, FILE_NAMES.SECRETS_JSON);\n try {\n lstatSync(filePath);\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return undefined;\n throw new Error(`Cannot inspect existing secrets at ${filePath}. Restore access before running setup; no credentials were replaced.`);\n }\n let value: unknown;\n try {\n value = JSON.parse(readFileSync(filePath, 'utf8'));\n } catch {\n throw new Error(`Cannot read valid JSON from existing secrets at ${filePath}. Repair or restore that file before running setup; no credentials were replaced.`);\n }\n const parsed = PlatformEnvSecretsJson_Schema.safeParse(value);\n if (!parsed.success) {\n throw new Error(`Existing secrets at ${filePath} failed schema validation. Repair or restore that file before running setup; no credentials were replaced.`);\n }\n return parsed.data;\n}\n\n/**\n * Assemble the full credentials object from Phase 1 prompt answers.\n * Existing credentials are retained during setup reconfiguration; only missing generated material\n * is added. Explicit provider/Atlas answers may update those operator-owned settings. Administrator\n * and approver identities/passwords are never rotated by setup, even with --force.\n * Pure computation — no persistence side effects.\n *\n * Split of responsibility. This function owns ONLY the operator-typed half of\n * `secrets.json` — the admin identity, provider API keys, Atlas API keys, GitHub\n * credentials. Every framework-GENERATED credential (service passwords, platform\n * secrets, the apps-manager / crontabs / immudb signing keypairs) is minted by\n * {@link provisionFrameworkManagedSecrets} from the single registry in\n * `framework-managed-secrets.ts`.\n *\n * That split is the root fix for a recurring class of silent degradation: when minting\n * lived inline here, a newly-introduced material reached ONLY brand-new environments —\n * every existing one stayed permanently without it (the crontabs P2P keypair\n * dead-lettering every scheduled tick, the immudb state-signing keypair leaving the\n * audit store's substitution defense off). Sharing one registry with the idempotent\n * self-heal path means a material declared once is live everywhere.\n */\nexport function buildCredentials(\n adminAnswers: AdminUserInput,\n dbAnswers: DatabaseInitializationInput,\n providerAnswers: ProviderKeysInput,\n approverAnswers: AdminUserInput | undefined,\n existingSecrets?: PlatformEnvSecretsJson,\n): PlatformEnvSecretsJson {\n // Every provider secret arrives already keyed by its exact env-var name from\n // the registry-derived setup selection — there is no per-provider convenience\n // field to fold in anymore.\n const providerEnv = Object.fromEntries(\n Object.entries(providerAnswers.providerEnv ?? {}).filter(([, secretValue]) => Boolean(secretValue)),\n );\n\n // Operator-typed material only. `admin.password` is passed through ONLY when the\n // operator supplied one — otherwise the ADMIN_PASSWORD material generates it, so the\n // \"who minted this?\" answer stays in one place.\n const operatorAuthored: PlatformEnvSecretsDraft = {\n ...existingSecrets,\n admin: existingSecrets?.admin ?? {\n email: adminAnswers.email,\n firstName: adminAnswers.firstName,\n lastName: adminAnswers.lastName,\n ...(adminAnswers.password ? { password: adminAnswers.password } : {}),\n },\n approver: existingSecrets?.approver ?? approverAnswers,\n atlas: dbAnswers.atlasApiPublicKey\n ? { apiPublicKey: dbAnswers.atlasApiPublicKey, apiPrivateKey: dbAnswers.atlasApiPrivateKey! }\n : existingSecrets?.atlas,\n providerEnv: Object.keys(providerEnv).length > 0\n ? { ...existingSecrets?.providerEnv, ...providerEnv }\n : existingSecrets?.providerEnv,\n github: providerAnswers.githubOrgUrl\n ? {\n orgUrl: providerAnswers.githubOrgUrl,\n adminUser: providerAnswers.githubAdminUser,\n adminToken: providerAnswers.githubAdminToken,\n }\n : existingSecrets?.github,\n };\n\n return provisionFrameworkManagedSecrets(operatorAuthored).secrets;\n}\n\n/**\n * Phase 2 — secrets/config write.\n */\nexport async function runSecretsWrite(\n env: PlatformEnvironmentConfiguration,\n credentials: PlatformEnvSecretsJson,\n dbAnswers: DatabaseInitializationInput,\n log: Logger,\n): Promise<void> {\n ConfigSecretsUtils.writeSecretsJson(env.name, credentials);\n log.success(chalk.green(` ✓ ${FILE_NAMES.SECRETS_JSON} written`));\n\n ConfigSecretsUtils.writeConfigJson(env, dbAnswers);\n log.success(chalk.green(` ✓ ${FILE_NAMES.CONFIG_JSON} written`));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-services.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"data-services.schemas.d.ts","sourceRoot":"","sources":["../../../../src/services/data-services/data-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG1F;;;GAGG;AACH,oBAAY,oBAAoB;IAC9B,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AAoB,GAAG,SAAS,CAAC;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,sBAAsB,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-services.schemas.js","sourceRoot":"","sources":["../../../../../../src/services/data-services/data-services.schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAN,IAAY,oBA0BX;AA1BD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,qDAA6B,CAAA;IAC7B,yCAAiB,CAAA;IACjB,6CAAqB,CAAA;IACrB,uCAAe,CAAA;IACf,iDAAyB,CAAA;IACzB,iDAAyB,CAAA;IACzB,oEAAoE;IACpE,yEAAyE;IACzE,yEAAyE;IACzE,qEAAqE;IACrE,yCAAiB,CAAA;IACjB,yEAAyE;IACzE,gFAAgF;IAChF,0EAA0E;IAC1E,yCAAiB,CAAA;IACjB,8EAA8E;IAC9E,wEAAwE;IACxE,+EAA+E;IAC/E,gFAAgF;IAChF,iFAAiF;IACjF,mFAAmF;IACnF,8EAA8E;IAC9E,2DAA2D;IAC3D,yCAAiB,CAAA;AACnB,CAAC,EA1BW,oBAAoB,KAApB,oBAAoB,QA0B/B;AAED,+EAA+E;AAC/E,6CAA6C;AAC7C,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,4CAAqB,CA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AAM,EAAE;QACN,cAAc,EAAE,uBAAuB;QACvC;;;;;WAKG;QACH,iBAAiB,EAAE,0BAA0B;KAC9C;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,iBAAiB;QAC3B;;;;WAIG;QACH,IAAI,EAAE,aAAa;QACnB;;;;;;WAMG;QACH,SAAS,EAAE,kBAAkB;QAC7B;;;;;WAKG;QACH,gBAAgB,EAAE,yBAAyB;KAC5C;CACO,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mCAAmC,CAAC;AAEpF,+EAA+E;AAC/E,8CAA8C;AAC9C,+EAA+E;AAE/E,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,YAAY,EAAE,cAAc;IAC5B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACN,CAAC;AAIX,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACvD,QAAQ,EAAE,gBAAgB;IAC1B,QAAQ,EAAE,SAAS;CACX,CAAC;AAGX,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,oBAAoB,EAAE,UAAU;IAChC,oBAAoB,EAAE,0CAA0C;CACxD,CAAC;AAEX,+EAA+E;AAC/E,kCAAkC;AAClC,+EAA+E;AAE/E,MAAM,CAAC,MAAM,8CAA8C,GAAG;IAC5D,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,gBAAgB;IAC5B,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,OAAO;CACZ,CAAC;AAGX,MAAM,CAAC,MAAM,2CAA2C,GAAG;IACzD,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;IACnC,MAAM,EAAE,gBAAgB,CAAC,MAAM;CACvB,CAAC","sourcesContent":["import type { BackingServiceSource, DatabaseEngine } from '@wildo-ai/platform-config-lib';\nimport { STORAGE_DEFAULTS } from '@wildo-ai/platform-config-lib';\n\n/**\n * Platform data services that support the platform.\n * Deployed via Docker Compose (local) or K8s manifests (cluster).\n */\nexport enum PlatformDataServices {\n MONGODB = 'mongodb',\n MONGODB_INIT = 'mongodb-init',\n VALKEY = 'valkey',\n RABBITMQ = 'rabbitmq',\n MINIO = 'minio',\n MINIO_INIT = 'minio-init',\n POSTGRESQL = 'postgresql',\n // Slice 4 (4.8) — ClamAV is now a first-class self-deployable infra\n // service (was previously hand-rolled in the static docker-compose.yml).\n // STATEFUL because it must persist its ~500 MB virus signature DB across\n // restarts; otherwise every `up` triggers a full freshclam download.\n CLAMAV = 'clamav',\n // Audit Phase 2 — immudb is the self-deployable tamper-evident audit-log\n // store (the COMPLIANCE_AUDIT_TRAIL provider backend). STATEFUL: an append-only\n // DB whose history MUST persist across restarts, in both Compose and K8s.\n IMMUDB = 'immudb',\n // Issue #74 — `mongot` is the separate MongoDB Search / Vector Search process\n // that MongoDB 8.2 Community requires beside `mongod` for `$search` and\n // `$vectorSearch`. It is NOT an author-configurable backing service: it has no\n // `BackingServiceKind`, no managed variant, and no independent source. It is an\n // ATTACHMENT to a self-hosted mongod, deployed exactly when one is, which is why\n // both lanes gate it on the same `needsLocalMongoDB(env)` predicate rather than on\n // a second author switch. STATEFUL: mongot keeps its Lucene index on disk and\n // rebuilding it means re-reading every indexed collection.\n MONGOT = 'mongot',\n}\n\n// ============================================================================\n// Infrastructure service deployment metadata\n// ============================================================================\n\n/**\n * Whether a service requires persistent storage.\n * Runtime-agnostic: Docker Compose uses named volumes, K8s uses StatefulSets + PVCs.\n */\nexport enum InfraDeploymentType {\n STATEFUL = 'stateful',\n STATELESS = 'stateless',\n}\n\n// Infrastructure service catalog (with deployment type, ports, container names)\n// is defined in service-catalog.schemas.ts — the single source of truth.\n// STATEFUL_INFRA_SERVICES and ALL_SERVICE_CONTAINER_NAMES are derived there.\n\n// ============================================================================\n// Infra service container env var keys\n// ============================================================================\n// These are the env var names each container image reads for its own credentials.\n// Runtime-agnostic: injected via Docker Compose env_file or K8s Secret.\n\n/**\n * MongoDB container env var keys.\n *\n * - `MONGO_INITDB_ROOT_USERNAME` / `MONGO_INITDB_ROOT_PASSWORD` are the\n * well-known names the official `mongo:8.2` entrypoint reads to seed the\n * root user on first boot (re-verified 2026-08-27 on `mongo:8.2` — its\n * `docker-entrypoint.sh` still reads exactly these two, and a probe container\n * authenticated with the seeded root user). We deliberately export the long form (not\n * the legacy `MONGO_ROOT_USER` shorthand used by the Compose env file)\n * because the K8s secret is consumed directly by the StatefulSet —\n * there is no env-file translation layer.\n * - The Compose template still reads `MONGO_ROOT_USER` / `MONGO_ROOT_PASSWORD`\n * from `mongo.env` then injects them into `MONGO_INITDB_ROOT_*` at\n * container start; the K8s path skips that hop and binds the secret keys\n * directly to the env vars the image reads.\n */\nexport const MONGODB_CREDENTIAL_ENV_KEYS = {\n ROOT_USER: 'MONGO_INITDB_ROOT_USERNAME',\n ROOT_PASSWORD: 'MONGO_INITDB_ROOT_PASSWORD',\n} as const;\n\n/**\n * `mongot` sync-source identity — issue #74.\n *\n * mongot reads NO environment variables for its credential. It is configured entirely\n * from a file (`/mongot-community/config.default.yml`) whose `syncSource.replicaSet.scramAuth`\n * block names a username, an `authSource`, and a **passwordFile path** — never a password.\n * That is why this constant block has no `*_ENV_KEYS` sibling: the shape of the contract is\n * a file, not an env var, and pretending otherwise would put the password in a process\n * environment where every `docker inspect` reader can see it.\n *\n * Two facts here are load-bearing and were both measured, not read:\n *\n * - **`PASSWORD_FILE_MODE` is `0400` and mongot ENFORCES it.** A more permissive file is\n * refused at startup with `Secret file /passwordFile permissions are too permissive (must\n * only be readable by owner)` and the process exits 1 — so a 0644 file (the mode the\n * immudb signing key deliberately uses, because that container's UID differs) would make\n * the sidecar crash-loop. mongot's image runs as root, so root reads the file whoever owns\n * it; the mode is the only thing that matters, and it is checked.\n * - **`searchCoordinator` is a BUILT-IN role on 8.2** (`db.createUser({roles:['searchCoordinator']})`\n * succeeded against `mongo:8.2` / 8.2.12), so nothing needs to define it.\n *\n * The username is a framework-owned service identity, so it is a constant rather than an\n * authored value — exactly like the other internal service usernames.\n */\nexport const MONGOT_SYNC_SOURCE = {\n /** The `searchCoordinator`-roled user mongot authenticates to mongod as. */\n USERNAME: 'wildoMongotSyncSource',\n /** SCRAM auth database for that user. */\n AUTH_SOURCE: 'admin',\n /** Absolute in-container path both lanes mount the password file at. */\n PASSWORD_FILE_PATH: '/mongot-password',\n /** Owner-read-only. mongot refuses anything more permissive — see above. */\n PASSWORD_FILE_MODE: 0o400,\n /**\n * The mode the generator widens an EXISTING password file to just before rewriting it.\n *\n * `PASSWORD_FILE_MODE` is owner-READ-only, and `writeFileSync` opens for WRITE — so re-rendering\n * over a file the generator itself wrote fails `EACCES`. This is the transient mode held only\n * across the rewrite, never the mode mongot sees: the generator re-narrows to\n * `PASSWORD_FILE_MODE` immediately afterwards, and mongot exits 1 on anything more permissive.\n */\n PASSWORD_FILE_REWRITE_MODE: 0o600,\n /** In-container path of mongot's own configuration file (fixed by the image's CMD). */\n CONFIG_FILE_PATH: '/mongot-community/config.default.yml',\n /** In-container path of mongot's Lucene index storage (`storage.dataPath`). */\n DATA_PATH: '/data/mongot',\n} as const;\n\nexport const VALKEY_CREDENTIAL_ENV_KEYS = {\n PASSWORD: 'VALKEY_PASSWORD',\n} as const;\n\nexport const RABBITMQ_CREDENTIAL_ENV_KEYS = {\n DEFAULT_USER: 'RABBITMQ_DEFAULT_USER',\n DEFAULT_PASS: 'RABBITMQ_DEFAULT_PASS',\n ERLANG_COOKIE: 'RABBITMQ_ERLANG_COOKIE',\n} as const;\n\nexport const MINIO_CREDENTIAL_ENV_KEYS = {\n ROOT_USER: 'MINIO_ROOT_USER',\n ROOT_PASSWORD: 'MINIO_ROOT_PASSWORD',\n} as const;\n\nexport const POSTGRESQL_CREDENTIAL_ENV_KEYS = {\n ADMIN_USER: 'POSTGRES_ADMIN_USER',\n ADMIN_PASSWORD: 'POSTGRES_ADMIN_PASSWORD',\n ADMIN_DATABASE: 'POSTGRES_ADMIN_DATABASE',\n} as const;\n\n/**\n * Env-var keys for the self-hosted immudb audit store (Audit Phase 2, #1696).\n *\n * A SELF-hosted immudb's credentials are MINTED, never authored (#1696). The server's built-in `immudb` sysadmin\n * password is framework-managed platform material (`credentials.immudb.adminPassword`); apps-manager alone holds it\n * and uses it to give each application its OWN database and its OWN `READ_WRITE` user, which reach the application\n * in its platform secrets (`database.immudb.*`) and win over anything in `providerEnv`.\n *\n * Until #1696 the server's admin password was COPIED from `providerEnv.IMMUDB_PASSWORD`, the credential every\n * application's audit sink connected with — one shared sysadmin over every application's audit data. The operator\n * keys (`IMMUDB_USER` / `IMMUDB_PASSWORD` / `IMMUDB_DATABASE`) now matter only for a MANAGED immudb.\n *\n * - `SERVER.ADMIN_PASSWORD` — the immudb SERVER env var that sets the built-in `immudb` sysadmin's initial password\n * on a fresh data dir. The K8s `immudb-secret` binds this key; the StatefulSet reads it via `secretKeyRef`\n * (optional); the compose service renders it from the same material.\n * - `PROVIDER.PASSWORD` — the audit-sink provider's operator-authored connection password inside\n * `credentials.providerEnv` (a MANAGED immudb's credential). Mirrors the immudb backend provider's\n * `secretsContract.password.envVarName` in `external-connectors-private`.\n */\nexport const IMMUDB_CREDENTIAL_ENV_KEYS = {\n SERVER: {\n ADMIN_PASSWORD: 'IMMUDB_ADMIN_PASSWORD',\n /**\n * SEC1 EC PRIVATE KEY PEM the SELF-hosted immudb server signs its state with\n * (`--signingKey`). Rides the k8s `immudb-secret` (mounted as a file) / the compose\n * local-data key file. SERVER-side ONLY — the whole-server-substitution defense collapses\n * if this ever reaches an app pod, so it is NEVER placed in `providerEnv`.\n */\n STATE_SIGNING_KEY: 'IMMUDB_STATE_SIGNING_KEY',\n },\n PROVIDER: {\n PASSWORD: 'IMMUDB_PASSWORD',\n /**\n * The audit-sink provider's immudb host. Its presence in `credentials.providerEnv` is the\n * signal that the immudb audit provider is configured for this env — used to gate injection\n * of the generated `STATE_PUBLIC_KEY` (don't emit pinning material for an unused provider).\n */\n HOST: 'IMMUDB_HOST',\n /**\n * Durable trust-anchor directory the audit client persists its last-verified immudb state root\n * in (`external-connectors-private` immudb provider `secretsContract.stateDir`). Its VALUE is\n * runtime-topology, not a secret: LOCAL uses a host `local_data` path (env-configuration-generator),\n * while REMOTE containers use the fixed in-container mount path below, backed by a durable volume\n * (a PVC in k8s, a named volume in compose — provisioned by the manifest generators).\n */\n STATE_DIR: 'IMMUDB_STATE_DIR',\n /**\n * Pinned immudb state-signing PUBLIC key (SPKI PEM). Injected into every backend runtime's\n * `providerEnv` from the generated `credentials.immudb.stateSigningPublicKey`; the audit\n * client (`external-connectors-private` immudb provider `secretsContract.statePublicKeyPem`)\n * verifies the server's signed state against it. Public material — safe in every app pod.\n */\n STATE_PUBLIC_KEY: 'IMMUDB_STATE_PUBLIC_KEY',\n },\n} as const;\n\n/**\n * Fixed in-CONTAINER mount path for the immudb audit trust anchor in REMOTE deployments (k8s + compose).\n *\n * The anchor is the audit client's cross-restart tamper-evidence store; it MUST live on a durable,\n * access-protected volume (a PVC in k8s, a named volume in compose), never the pod/container's ephemeral\n * filesystem — otherwise a cross-restart rollback of the tamper-evident ledger is silently re-adopted, and\n * state-signature pinning does NOT catch it (immudb re-signs its current state; only the anchor remembers\n * tx N). Both remote runtimes mount their durable volume AT this path and set `IMMUDB_STATE_DIR` to it, so\n * the value is shared here to keep the env and the mount in lockstep. LOCAL uses a host `local_data` path\n * instead (a container mount path is meaningless without a container).\n */\nexport const IMMUDB_AUDIT_STATE_CONTAINER_DIR = '/var/lib/wildo/immudb-audit-state';\n\n// ============================================================================\n// Platform data services provider identifiers\n// ============================================================================\n\nexport const PLATFORM_DATA_SERVICES_PROVIDER = {\n SELF_MANAGED: 'self-managed',\n VALKEY_SELF: 'valkey-self',\n MINIO: 'minio',\n ATLAS: 'atlas',\n} as const;\n\n\n\nexport const DEFAULT_PLATFORM_POSTGRESQL_CONFIGURATION = {\n DATABASE: 'wildo_platform',\n SSL_MODE: 'disable',\n} as const;\n\n\n// ============================================================================\n// Atlas defaults\n// ============================================================================\n\nexport const DEFAULT_PLATFORM_ATLAS_CONFIGURATION = {\n DEFAULT_CLUSTER_NAME: 'Cluster0',\n DEFAULT_API_BASE_URL: 'https://cloud.mongodb.com/api/atlas/v1.0',\n} as const;\n\n// ============================================================================\n// MongoDB connection URL template\n// ============================================================================\n\nexport const DEFAULT_PLATFORM_MONGO_CONNECTION_URL_TEMPLATE = {\n SCHEME: 'mongodb://',\n SRV_SCHEME: 'mongodb+srv://',\n REPLICA_SET: 'rs0',\n AUTH_SOURCE: 'admin',\n} as const;\n\n\nexport const DEFAULT_PLATFORM_FILE_STORAGE_CONFIGURATION = {\n PROVIDER: STORAGE_DEFAULTS.PROVIDER,\n BUCKET: STORAGE_DEFAULTS.BUCKET,\n} as const;\n\n\n/**\n * Database structural choice stored in environments.json.\n * Contains NO credentials — just which engine, source, and (for\n * managed sources, post-Slice-4.B.0) brand.\n */\nexport interface PlatformDatabaseChoice {\n engine: DatabaseEngine;\n source?: BackingServiceSource | undefined;\n /**\n * Managed-brand identifier when `source === MANAGED`. For Mongo\n * this is `'atlas'`; for Postgres one of `'aws-rds' |\n * 'gcp-cloud-sql' | 'azure-database' | 'supabase' | 'neon' |\n * 'render'`. Slice 4.B.0 (2026-05-07) generalized the source/brand\n * split — pre-reshape Atlas was a `source` value, now it's a\n * `provider` brand under `source: MANAGED`.\n */\n provider?: string;\n}\n\nexport interface DatabaseInitializationInput {\n database: PlatformDatabaseChoice;\n atlasConnectionUrl?: string;\n atlasProjectId?: string;\n atlasApiPublicKey?: string;\n atlasApiPrivateKey?: string;\n atlasClusterName?: string;\n atlasApiBaseUrl?: string;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"data-services.schemas.js","sourceRoot":"","sources":["../../../../src/services/data-services/data-services.schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAN,IAAY,oBA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,EAAE,gBAAgB;IAC1B,QAAQ,EAAE,SAAS;CACX,CAAC;AAGX,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,oBAAoB,EAAE,UAAU;IAChC,oBAAoB,EAAE,0CAA0C;CACxD,CAAC;AAEX,+EAA+E;AAC/E,kCAAkC;AAClC,+EAA+E;AAE/E,MAAM,CAAC,MAAM,8CAA8C,GAAG;IAC5D,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,gBAAgB;IAC5B,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,OAAO;CACZ,CAAC;AAGX,MAAM,CAAC,MAAM,2CAA2C,GAAG;IACzD,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;IACnC,MAAM,EAAE,gBAAgB,CAAC,MAAM;CACvB,CAAC","sourcesContent":["import type { BackingServiceSource, DatabaseEngine } from '@wildo-ai/platform-config-lib';\nimport { STORAGE_DEFAULTS } from '@wildo-ai/platform-config-lib';\n\n/**\n * Platform data services that support the platform.\n * Deployed via Docker Compose (local) or K8s manifests (cluster).\n */\nexport enum PlatformDataServices {\n MONGODB = 'mongodb',\n MONGODB_INIT = 'mongodb-init',\n VALKEY = 'valkey',\n RABBITMQ = 'rabbitmq',\n MINIO = 'minio',\n MINIO_INIT = 'minio-init',\n POSTGRESQL = 'postgresql',\n // Slice 4 (4.8) — ClamAV is now a first-class self-deployable infra\n // service (was previously hand-rolled in the static docker-compose.yml).\n // STATEFUL because it must persist its ~500 MB virus signature DB across\n // restarts; otherwise every `up` triggers a full freshclam download.\n CLAMAV = 'clamav',\n // Audit Phase 2 — immudb is the self-deployable tamper-evident audit-log\n // store (the COMPLIANCE_AUDIT_TRAIL provider backend). STATEFUL: an append-only\n // DB whose history MUST persist across restarts, in both Compose and K8s.\n IMMUDB = 'immudb',\n // Issue #74 — `mongot` is the separate MongoDB Search / Vector Search process\n // that MongoDB 8.2 Community requires beside `mongod` for `$search` and\n // `$vectorSearch`. It is NOT an author-configurable backing service: it has no\n // `BackingServiceKind`, no managed variant, and no independent source. It is an\n // ATTACHMENT to a self-hosted mongod, deployed exactly when one is, which is why\n // both lanes gate it on the same `needsLocalMongoDB(env)` predicate rather than on\n // a second author switch. STATEFUL: mongot keeps its Lucene index on disk and\n // rebuilding it means re-reading every indexed collection.\n MONGOT = 'mongot',\n}\n\n// ============================================================================\n// Infrastructure service deployment metadata\n// ============================================================================\n\n/**\n * Whether a service requires persistent storage.\n * Runtime-agnostic: Docker Compose uses named volumes, K8s uses StatefulSets + PVCs.\n */\nexport enum InfraDeploymentType {\n STATEFUL = 'stateful',\n STATELESS = 'stateless',\n}\n\n// Infrastructure service catalog (with deployment type, ports, container names)\n// is defined in service-catalog.schemas.ts — the single source of truth.\n// STATEFUL_INFRA_SERVICES and ALL_SERVICE_CONTAINER_NAMES are derived there.\n\n// ============================================================================\n// Infra service container env var keys\n// ============================================================================\n// These are the env var names each container image reads for its own credentials.\n// Runtime-agnostic: injected via Docker Compose env_file or K8s Secret.\n\n/**\n * MongoDB container env var keys.\n *\n * - `MONGO_INITDB_ROOT_USERNAME` / `MONGO_INITDB_ROOT_PASSWORD` are the\n * well-known names the official `mongo:8.2` entrypoint reads to seed the\n * root user on first boot (re-verified 2026-08-27 on `mongo:8.2` — its\n * `docker-entrypoint.sh` still reads exactly these two, and a probe container\n * authenticated with the seeded root user). We deliberately export the long form (not\n * the legacy `MONGO_ROOT_USER` shorthand used by the Compose env file)\n * because the K8s secret is consumed directly by the StatefulSet —\n * there is no env-file translation layer.\n * - The Compose template still reads `MONGO_ROOT_USER` / `MONGO_ROOT_PASSWORD`\n * from `mongo.env` then injects them into `MONGO_INITDB_ROOT_*` at\n * container start; the K8s path skips that hop and binds the secret keys\n * directly to the env vars the image reads.\n */\nexport const MONGODB_CREDENTIAL_ENV_KEYS = {\n ROOT_USER: 'MONGO_INITDB_ROOT_USERNAME',\n ROOT_PASSWORD: 'MONGO_INITDB_ROOT_PASSWORD',\n} as const;\n\n/**\n * `mongot` sync-source identity — issue #74.\n *\n * mongot reads NO environment variables for its credential. It is configured entirely\n * from a file (`/mongot-community/config.default.yml`) whose `syncSource.replicaSet.scramAuth`\n * block names a username, an `authSource`, and a **passwordFile path** — never a password.\n * That is why this constant block has no `*_ENV_KEYS` sibling: the shape of the contract is\n * a file, not an env var, and pretending otherwise would put the password in a process\n * environment where every `docker inspect` reader can see it.\n *\n * Two facts here are load-bearing and were both measured, not read:\n *\n * - **`PASSWORD_FILE_MODE` is `0400` and mongot ENFORCES it.** A more permissive file is\n * refused at startup with `Secret file /passwordFile permissions are too permissive (must\n * only be readable by owner)` and the process exits 1 — so a 0644 file (the mode the\n * immudb signing key deliberately uses, because that container's UID differs) would make\n * the sidecar crash-loop. mongot's image runs as root, so root reads the file whoever owns\n * it; the mode is the only thing that matters, and it is checked.\n * - **`searchCoordinator` is a BUILT-IN role on 8.2** (`db.createUser({roles:['searchCoordinator']})`\n * succeeded against `mongo:8.2` / 8.2.12), so nothing needs to define it.\n *\n * The username is a framework-owned service identity, so it is a constant rather than an\n * authored value — exactly like the other internal service usernames.\n */\nexport const MONGOT_SYNC_SOURCE = {\n /** The `searchCoordinator`-roled user mongot authenticates to mongod as. */\n USERNAME: 'wildoMongotSyncSource',\n /** SCRAM auth database for that user. */\n AUTH_SOURCE: 'admin',\n /** Absolute in-container path both lanes mount the password file at. */\n PASSWORD_FILE_PATH: '/mongot-password',\n /** Owner-read-only. mongot refuses anything more permissive — see above. */\n PASSWORD_FILE_MODE: 0o400,\n /**\n * The mode the generator widens an EXISTING password file to just before rewriting it.\n *\n * `PASSWORD_FILE_MODE` is owner-READ-only, and `writeFileSync` opens for WRITE — so re-rendering\n * over a file the generator itself wrote fails `EACCES`. This is the transient mode held only\n * across the rewrite, never the mode mongot sees: the generator re-narrows to\n * `PASSWORD_FILE_MODE` immediately afterwards, and mongot exits 1 on anything more permissive.\n */\n PASSWORD_FILE_REWRITE_MODE: 0o600,\n /** In-container path of mongot's own configuration file (fixed by the image's CMD). */\n CONFIG_FILE_PATH: '/mongot-community/config.default.yml',\n /** In-container path of mongot's Lucene index storage (`storage.dataPath`). */\n DATA_PATH: '/data/mongot',\n} as const;\n\nexport const VALKEY_CREDENTIAL_ENV_KEYS = {\n PASSWORD: 'VALKEY_PASSWORD',\n} as const;\n\nexport const RABBITMQ_CREDENTIAL_ENV_KEYS = {\n DEFAULT_USER: 'RABBITMQ_DEFAULT_USER',\n DEFAULT_PASS: 'RABBITMQ_DEFAULT_PASS',\n ERLANG_COOKIE: 'RABBITMQ_ERLANG_COOKIE',\n} as const;\n\nexport const MINIO_CREDENTIAL_ENV_KEYS = {\n ROOT_USER: 'MINIO_ROOT_USER',\n ROOT_PASSWORD: 'MINIO_ROOT_PASSWORD',\n} as const;\n\nexport const POSTGRESQL_CREDENTIAL_ENV_KEYS = {\n ADMIN_USER: 'POSTGRES_ADMIN_USER',\n ADMIN_PASSWORD: 'POSTGRES_ADMIN_PASSWORD',\n ADMIN_DATABASE: 'POSTGRES_ADMIN_DATABASE',\n} as const;\n\n/**\n * Env-var keys for the self-hosted immudb audit store (Audit Phase 2, #1696).\n *\n * A SELF-hosted immudb's credentials are MINTED, never authored (#1696). The server's built-in `immudb` sysadmin\n * password is framework-managed platform material (`credentials.immudb.adminPassword`); apps-manager alone holds it\n * and uses it to give each application its OWN database and its OWN `READ_WRITE` user, which reach the application\n * in its platform secrets (`database.immudb.*`) and win over anything in `providerEnv`.\n *\n * Until #1696 the server's admin password was COPIED from `providerEnv.IMMUDB_PASSWORD`, the credential every\n * application's audit sink connected with — one shared sysadmin over every application's audit data. The operator\n * keys (`IMMUDB_USER` / `IMMUDB_PASSWORD` / `IMMUDB_DATABASE`) now matter only for a MANAGED immudb.\n *\n * - `SERVER.ADMIN_PASSWORD` — the immudb SERVER env var that sets the built-in `immudb` sysadmin's initial password\n * on a fresh data dir. The K8s `immudb-secret` binds this key; the StatefulSet reads it via `secretKeyRef`\n * (optional); the compose service renders it from the same material.\n * - `PROVIDER.PASSWORD` — the audit-sink provider's operator-authored connection password inside\n * `credentials.providerEnv` (a MANAGED immudb's credential). Mirrors the immudb backend provider's\n * `secretsContract.password.envVarName` in `external-connectors-private`.\n */\nexport const IMMUDB_CREDENTIAL_ENV_KEYS = {\n SERVER: {\n ADMIN_PASSWORD: 'IMMUDB_ADMIN_PASSWORD',\n /**\n * SEC1 EC PRIVATE KEY PEM the SELF-hosted immudb server signs its state with\n * (`--signingKey`). Rides the k8s `immudb-secret` (mounted as a file) / the compose\n * local-data key file. SERVER-side ONLY — the whole-server-substitution defense collapses\n * if this ever reaches an app pod, so it is NEVER placed in `providerEnv`.\n */\n STATE_SIGNING_KEY: 'IMMUDB_STATE_SIGNING_KEY',\n },\n PROVIDER: {\n PASSWORD: 'IMMUDB_PASSWORD',\n /**\n * The audit-sink provider's immudb host. Its presence in `credentials.providerEnv` is the\n * signal that the immudb audit provider is configured for this env — used to gate injection\n * of the generated `STATE_PUBLIC_KEY` (don't emit pinning material for an unused provider).\n */\n HOST: 'IMMUDB_HOST',\n /**\n * Durable trust-anchor directory the audit client persists its last-verified immudb state root\n * in (`external-connectors-private` immudb provider `secretsContract.stateDir`). Its VALUE is\n * runtime-topology, not a secret: LOCAL uses a host `local_data` path (env-configuration-generator),\n * while REMOTE containers use the fixed in-container mount path below, backed by a durable volume\n * (a PVC in k8s, a named volume in compose — provisioned by the manifest generators).\n */\n STATE_DIR: 'IMMUDB_STATE_DIR',\n /**\n * Pinned immudb state-signing PUBLIC key (SPKI PEM). Injected into every backend runtime's\n * `providerEnv` from the generated `credentials.immudb.stateSigningPublicKey`; the audit\n * client (`external-connectors-private` immudb provider `secretsContract.statePublicKeyPem`)\n * verifies the server's signed state against it. Public material — safe in every app pod.\n */\n STATE_PUBLIC_KEY: 'IMMUDB_STATE_PUBLIC_KEY',\n },\n} as const;\n\n/**\n * Fixed in-CONTAINER mount path for the immudb audit trust anchor in REMOTE deployments (k8s + compose).\n *\n * The anchor is the audit client's cross-restart tamper-evidence store; it MUST live on a durable,\n * access-protected volume (a PVC in k8s, a named volume in compose), never the pod/container's ephemeral\n * filesystem — otherwise a cross-restart rollback of the tamper-evident ledger is silently re-adopted, and\n * state-signature pinning does NOT catch it (immudb re-signs its current state; only the anchor remembers\n * tx N). Both remote runtimes mount their durable volume AT this path and set `IMMUDB_STATE_DIR` to it, so\n * the value is shared here to keep the env and the mount in lockstep. LOCAL uses a host `local_data` path\n * instead (a container mount path is meaningless without a container).\n */\nexport const IMMUDB_AUDIT_STATE_CONTAINER_DIR = '/var/lib/wildo/immudb-audit-state';\n\n// ============================================================================\n// Platform data services provider identifiers\n// ============================================================================\n\nexport const PLATFORM_DATA_SERVICES_PROVIDER = {\n SELF_MANAGED: 'self-managed',\n VALKEY_SELF: 'valkey-self',\n MINIO: 'minio',\n ATLAS: 'atlas',\n} as const;\n\n\n\nexport const DEFAULT_PLATFORM_POSTGRESQL_CONFIGURATION = {\n DATABASE: 'wildo_platform',\n SSL_MODE: 'disable',\n} as const;\n\n\n// ============================================================================\n// Atlas defaults\n// ============================================================================\n\nexport const DEFAULT_PLATFORM_ATLAS_CONFIGURATION = {\n DEFAULT_CLUSTER_NAME: 'Cluster0',\n DEFAULT_API_BASE_URL: 'https://cloud.mongodb.com/api/atlas/v1.0',\n} as const;\n\n// ============================================================================\n// MongoDB connection URL template\n// ============================================================================\n\nexport const DEFAULT_PLATFORM_MONGO_CONNECTION_URL_TEMPLATE = {\n SCHEME: 'mongodb://',\n SRV_SCHEME: 'mongodb+srv://',\n REPLICA_SET: 'rs0',\n AUTH_SOURCE: 'admin',\n} as const;\n\n\nexport const DEFAULT_PLATFORM_FILE_STORAGE_CONFIGURATION = {\n PROVIDER: STORAGE_DEFAULTS.PROVIDER,\n BUCKET: STORAGE_DEFAULTS.BUCKET,\n} as const;\n\n\n/**\n * Database structural choice stored in environments.json.\n * Contains NO credentials — just which engine, source, and (for\n * managed sources, post-Slice-4.B.0) brand.\n */\nexport interface PlatformDatabaseChoice {\n engine: DatabaseEngine;\n source?: BackingServiceSource | undefined;\n /**\n * Managed-brand identifier when `source === MANAGED`. For Mongo\n * this is `'atlas'`; for Postgres one of `'aws-rds' |\n * 'gcp-cloud-sql' | 'azure-database' | 'supabase' | 'neon' |\n * 'render'`. Slice 4.B.0 (2026-05-07) generalized the source/brand\n * split — pre-reshape Atlas was a `source` value, now it's a\n * `provider` brand under `source: MANAGED`.\n */\n provider?: string;\n}\n\nexport interface DatabaseInitializationInput {\n database: PlatformDatabaseChoice;\n atlasConnectionUrl?: string;\n atlasProjectId?: string;\n atlasApiPublicKey?: string;\n atlasApiPrivateKey?: string;\n atlasClusterName?: string;\n atlasApiBaseUrl?: string;\n}\n\n"]}
|