@wildo-ai/platform-config-lib 1.1.11 → 1.1.13
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/esm/_unimplemented/soft-warn.d.ts +24 -49
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.js +24 -49
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
- package/dist/esm/blueprint/anchored-region.d.ts.map +1 -1
- package/dist/esm/blueprint/anchored-region.js.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
- package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
- package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
- package/dist/esm/key-management/approval-seal-verifier.d.ts +114 -40
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.js +143 -12
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
- package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.js +20 -0
- package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
- package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
- package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/data-key.contracts.js.map +1 -1
- package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
- package/dist/esm/key-management/es256-jws.js.map +1 -1
- package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
- package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
- package/dist/esm/key-management/key-provider.spi.js.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
- package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
- package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
- package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
- package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-incremental-update.js +730 -0
- package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.js +152 -0
- package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
- package/dist/esm/key-management/qr-code.d.ts +38 -0
- package/dist/esm/key-management/qr-code.d.ts.map +1 -0
- package/dist/esm/key-management/qr-code.js +325 -0
- package/dist/esm/key-management/qr-code.js.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
- package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.js +66 -0
- package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
- package/dist/esm/lockfile/build-parallelism.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
- package/dist/esm/lockfile/canonical-json.js +1 -1
- package/dist/esm/lockfile/canonical-json.js.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.js +2 -1
- package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
- package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +6 -8
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +4 -5
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
- package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
- package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
- package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
- package/dist/esm/project-config/config-module-resolution.js +33 -0
- package/dist/esm/project-config/config-module-resolution.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +146 -55
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +124 -71
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts +26 -36
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +64 -25
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +41 -437
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +102 -94
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts +10 -20
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js +10 -12
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js +2 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +2 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +2 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
- package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
- package/dist/esm/project-config/loader-instances-zod.js +40 -0
- package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
- package/dist/esm/project-config/loader.d.ts +131 -14
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +226 -12
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
- package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
- package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
- package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +3 -1
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +52 -8
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js +77 -24
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +40 -12
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +122 -10
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +67 -38
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.js +113 -5
- package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
- package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.js +36 -20
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.js.map +1 -1
- package/dist/esm/registry/index.d.ts +2 -3
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +2 -3
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +145 -13
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-config.schemas.js.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts +81 -3
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +185 -4
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
- package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
- package/dist/esm/registry/registry-url-resolution.js.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/esm/_unimplemented/index.d.ts +0 -3
- package/dist/esm/_unimplemented/index.d.ts.map +0 -1
- package/dist/esm/_unimplemented/index.js +0 -3
- package/dist/esm/_unimplemented/index.js.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.js +0 -38
- package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../src/project-config/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,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ED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,aAAqB,EACrB,OAAqD;IAErD,MAAM,QAAQ,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC,qBAAqB,CAAC;IAC7E,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAE3C,OAAO,UAAU,CAAuB,YAAY,EAAE;QACpD,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,IAAI,EAAE,mBAAmB,CAAC,SAAS;YACnC,SAAS,EAAE,aAAa;SACzB;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createHash } from 'crypto';\nimport { existsSync, mkdirSync, readFileSync } from 'fs';\nimport { dirname, join, relative, resolve } from 'path';\nimport { fileURLToPath } from 'url';\nimport { createJiti } from 'jiti';\nimport { resolveAppLayout, resolveFrameworkLayout } from '../workspace-scope/workspace-homes.schemas';\nimport type { WildoFrameworkConfig } from './define-framework-config';\nimport type { WildoSaasConfig } from './define-saas-config';\nimport {\n isHostedInfraEnvConfig,\n WildoHostedInfraEnvConfigSchema,\n type WildoAuthoredInfraEnvConfig,\n type WildoInfraEnvConfig,\n} from './define-infra-env-config';\nimport { realpathSync } from 'fs';\nimport { resolveHostedInfraEnvConfig } from './hosted-infra-env-config';\nimport { AUTHORED_CONFIG_FILE_NAMES } from '../workspace-scope/workspace-scope.schemas';\nimport type { WildoMinionConfig } from './define-minion-config';\nimport type { WildoWorkerConfig } from './define-worker-config';\nimport {\n ConfigArtifactsZone,\n FRAMEWORK_WORKSPACE_MARKER_FILE,\n resolveConfigArtifactsBaseDir,\n type ConfigArtifactsLocationOptions,\n} from '../workspace-scope/workspace-scope.schemas';\n\nexport interface LoadConfigOptions {\n /**\n * Optional explicit owner zone for generated loader artifacts.\n * Use this when the authored config file lives outside its semantic runtime\n * owner and should still emit loader artifacts under the canonical runtime\n * home instead of beside the source file.\n */\n artifactLocation?: ConfigArtifactsLocationOptions;\n /**\n * Module-resolution strategy for jiti while evaluating the config file.\n *\n * - `package`: resolve `@wildo-ai/*` through installed package exports in\n * `node_modules`. This is the correct mode for normal app developers who\n * do not have framework sources checked out.\n * - `framework-source`: resolve framework-owned packages to monorepo source\n * files when the Wildo framework workspace is available. Intended only for\n * internal framework development and source-first companion discovery.\n *\n * When omitted, the loader auto-detects the mode: configs inside a Wildo\n * framework workspace use `framework-source`; external app repos use\n * `package`.\n */\n moduleResolution?: 'package' | 'framework-source';\n /**\n * Package-owned module aliases the loaded source needs in order to resolve\n * its own internal specifiers.\n *\n * A package may address its own modules through a compiler path alias (for\n * example `~specifications/modules/...`). Those specifiers are meaningless to\n * Node, so evaluating that package's authored source fails unless the alias is\n * supplied here. The framework aliases this loader owns are always applied;\n * these are merged on top, so a package can extend its own resolution without\n * being able to redirect a framework specifier away from the framework.\n *\n * Keys are exact specifier prefixes and values absolute paths — NOT the\n * tsconfig `\"~x/*\": [\"./src/*\"]` glob form. Callers holding tsconfig-shaped\n * declarations must normalize them first.\n */\n packageModuleAliases?: Readonly<Record<string, string>>;\n /**\n * Re-evaluate the loaded module graph on EVERY call instead of serving jiti's\n * module cache.\n *\n * jiti's module cache is effectively PROCESS-GLOBAL (the transpiled modules\n * land in the shared CJS registry), so a fresh `createJiti` per call does NOT\n * give a fresh read: a long-lived process that loaded a file once keeps\n * seeing that evaluation after the file changes on disk. Measured live on the\n * dev companion (wonder-crm, 2026-08-27): a `companion-exports.ts` slot wired\n * while the companion ran stayed invisible until restart — the J-1 \"stall B\"\n * that forced a companion restart after every landed specification family.\n *\n * Off by default: one-shot CLI processes gain nothing from re-evaluation,\n * and module identity within a single load stays shared either way. Turn it\n * on at read sites whose CONTRACT is \"the working tree as it is right now\".\n *\n * It reaches only what jiti TRANSPILES. An ESM `.js` file in a `\"type\": \"module\"`\n * package is imported natively by Node and pinned in its process-global ESM\n * registry, whatever this says — so {@link loadPackageCompanionExport} answers\n * a fresh read from the package's authored source, not its `dist`.\n */\n freshModuleCache?: boolean;\n}\n\nconst PACKAGE_COMPANION_SUBPATH = './companion';\n\n/**\n * Load and evaluate a TypeScript config file via jiti.\n * The file must `export default defineXxxConfig({...})`.\n * Zod validation runs inside the defineConfig helper at evaluation time,\n * so the returned object is guaranteed valid.\n *\n * @param filePath - Absolute path to the `.ts` config file\n * @returns The validated config object (the default export)\n * @throws If the file doesn't exist, has syntax errors, or Zod validation fails\n */\nexport async function loadConfig<T>(filePath: string, options?: LoadConfigOptions): Promise<T> {\n const { absolutePath, module } = await importConfigModule<{ default: T }>(filePath, options);\n if (!module.default) {\n throw new Error(`Config file must use \\`export default\\`: ${absolutePath}`);\n }\n return module.default;\n}\n\n/**\n * Load one NAMED export of an application-authored TypeScript module, through the same resolver\n * `loadConfig` uses — framework aliases, the application's own package, the per-file cache.\n *\n * For modules that are not configs and have no default export: the accepted brand assets\n * (`specifications/src/brand/resolved-assets.generated.ts` exports `generatedResolvedBrandAssets`)\n * are read by both the CLI's `wildo brand propagate` and the companion's logo step, and a second\n * TypeScript loader in each would resolve framework imports differently from every other config the\n * application authors. Returns `undefined` when the module does not export `exportName`.\n */\nexport async function loadConfigExport<T>(filePath: string, exportName: string, options?: LoadConfigOptions): Promise<T | undefined> {\n const { module } = await importConfigModule<Record<string, unknown>>(filePath, options);\n return module[exportName] as T | undefined;\n}\n\nasync function importConfigModule<TModule>(\n filePath: string,\n options?: LoadConfigOptions,\n): Promise<{ readonly absolutePath: string; readonly module: TModule }> {\n const absolutePath = resolve(filePath);\n if (!existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`);\n }\n const cacheBaseDir = options?.artifactLocation\n ? resolveConfigArtifactsBaseDir(options.artifactLocation)\n : resolveConfigArtifactsBaseDir(absolutePath);\n const cacheDir = join(cacheBaseDir, createHash('sha1').update(absolutePath).digest('hex'));\n mkdirSync(cacheDir, { recursive: true });\n\n const currentModuleDirectory = dirname(fileURLToPath(import.meta.url));\n const platformConfigLibEntry = resolvePlatformConfigLibEntry(currentModuleDirectory);\n const moduleResolution = options?.moduleResolution\n ?? inferConfigModuleResolution(absolutePath, currentModuleDirectory);\n const frameworkWorkspaceRoot = moduleResolution === 'framework-source'\n ? resolveLoaderWorkspaceRoot(currentModuleDirectory)\n : tryResolveLoaderWorkspaceRoot(currentModuleDirectory);\n\n const jiti = createJiti(import.meta.url, {\n fsCache: cacheDir,\n // `moduleCache: false` forces re-evaluation of the whole loaded graph — see\n // `LoadConfigOptions.freshModuleCache` for why a fresh createJiti alone is not enough.\n ...(options?.freshModuleCache === true ? { moduleCache: false } : {}),\n alias: {\n // Package-owned aliases first so framework-owned entries always win a\n // collision: a package may extend its own resolution, never redirect a\n // framework specifier away from the framework.\n ...(options?.packageModuleAliases ?? {}),\n ...buildLoaderAliases({\n frameworkWorkspaceRoot,\n moduleResolution,\n platformConfigLibEntry,\n }),\n },\n });\n\n return { absolutePath, module: await jiti.import(absolutePath) as TModule };\n}\n\n/**\n * Which file a package's companion subpath resolves to.\n *\n * Authored source wins when either option asks for it: `moduleResolution: 'framework-source'` (a package inside the\n * framework workspace), or `preferAuthoredSource` (a reader whose contract is the working tree, wherever the package\n * lives — see {@link loadPackageCompanionExport}). Otherwise the declared `exports` entry wins, and authored source\n * is only the fallback when nothing is built.\n */\nexport function resolvePackageCompanionEntryPath(\n packageRoot: string,\n subpath: string = PACKAGE_COMPANION_SUBPATH,\n options?: Pick<LoadConfigOptions, 'moduleResolution'> & { readonly preferAuthoredSource?: boolean },\n): string {\n const packageJsonPath = join(packageRoot, 'package.json');\n if (!existsSync(packageJsonPath)) {\n throw new Error(`Missing package.json for companion target at \"${packageRoot}\".`);\n }\n\n const sourceSubpath = resolveSafePackageSourceSubpath(subpath);\n const sourceCandidates = subpath === PACKAGE_COMPANION_SUBPATH\n ? [\n join(packageRoot, 'src', 'companion-exports.ts'),\n join(packageRoot, 'src', 'companion-exports.tsx'),\n join(packageRoot, 'src', 'companion-exports.js'),\n join(packageRoot, 'src', 'companion-exports.mjs'),\n ]\n : sourceSubpath\n ? [\n join(packageRoot, 'src', `${sourceSubpath}.ts`),\n join(packageRoot, 'src', `${sourceSubpath}.tsx`),\n join(packageRoot, 'src', sourceSubpath, 'index.ts'),\n join(packageRoot, 'src', sourceSubpath, 'index.tsx'),\n ]\n : [];\n const preferredSourceCandidate = sourceCandidates.find((candidate) => existsSync(candidate));\n if ((options?.moduleResolution === 'framework-source' || options?.preferAuthoredSource === true) && preferredSourceCandidate) {\n return preferredSourceCandidate;\n }\n\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as {\n exports?: Record<string, string | { import?: string; default?: string }>;\n };\n\n const subpathExport = packageJson.exports?.[subpath];\n if (typeof subpathExport === 'string') {\n const exportPath = resolve(packageRoot, subpathExport);\n if (existsSync(exportPath)) {\n return exportPath;\n }\n }\n\n if (subpathExport && typeof subpathExport === 'object') {\n const declaredEntryPath = subpathExport.import ?? subpathExport.default;\n if (typeof declaredEntryPath === 'string') {\n const exportPath = resolve(packageRoot, declaredEntryPath);\n if (existsSync(exportPath)) {\n return exportPath;\n }\n }\n }\n\n // NOTE: the authored-source fallback below is deliberate and load-bearing for\n // `loadPackageCompanionExport`, which resolves through jiti and can therefore\n // execute TypeScript. Do not make it throw here — consumers that cannot\n // execute TypeScript must reject a source entry at THEIR load boundary\n // instead (see the companion's `importCompanionModule`).\n if (preferredSourceCandidate) {\n return preferredSourceCandidate;\n }\n\n throw new Error(\n `Could not resolve companion entry for subpath \"${subpath}\" in package \"${packageRoot}\".`,\n );\n}\n\n/**\n * Translate an exported `./subpath` into a contained source candidate.\n *\n * This supports typed package-owned companion extensions such as\n * `./continuity` during framework-source development without inventing a\n * second application-specific resolver. Traversal and empty path segments are\n * rejected before any filesystem candidate is constructed.\n */\nfunction resolveSafePackageSourceSubpath(subpath: string): string | null {\n if (!subpath.startsWith('./')) {\n return null;\n }\n const sourceSubpath = subpath.slice(2);\n const segments = sourceSubpath.split('/');\n if (\n segments.length === 0\n || segments.some(\n (segment) =>\n segment.length === 0 || segment === '.' || segment === '..',\n )\n ) {\n return null;\n }\n return sourceSubpath;\n}\n\n/**\n * Normalize tsconfig-shaped compiler path aliases into the exact-prefix form\n * `LoadConfigOptions.packageModuleAliases` expects.\n *\n * tsconfig declares `{\"~x/*\": [\"./src/*\"]}`; jiti matches an alias key as a\n * specifier prefix. The trailing `/*` on both sides is therefore stripped and\n * the target resolved against the owning package root.\n *\n * Only the FIRST target of each alias is used: jiti resolves one path per\n * specifier, so a multi-target tsconfig fallback list cannot be honoured. That\n * is a deliberate narrowing rather than a silent partial behaviour — a package\n * relying on later fallback entries will fail to resolve loudly at import time\n * instead of resolving inconsistently between the compiler and the loader.\n */\nexport function normalizeCompilerPathAliasesForLoader(\n packageRoot: string,\n compilerPathAliases: Readonly<Record<string, readonly string[]>>,\n): Record<string, string> {\n const normalized: Record<string, string> = {};\n for (const [alias, targets] of Object.entries(compilerPathAliases)) {\n const firstTarget = targets[0];\n if (typeof firstTarget !== 'string') {\n continue;\n }\n const aliasPrefix = alias.endsWith('/*') ? alias.slice(0, -2) : alias;\n const targetPath = firstTarget.endsWith('/*') ? firstTarget.slice(0, -2) : firstTarget;\n // A prefix that is empty or still contains a wildcard would match far more\n // than the package declared — a bare `*` would capture EVERY specifier and\n // silently redirect unrelated imports. Prefix matching cannot express those\n // patterns, so drop them rather than approximate them.\n if (aliasPrefix.length === 0 || aliasPrefix.includes('*')) {\n continue;\n }\n normalized[aliasPrefix] = resolve(packageRoot, targetPath);\n }\n return normalized;\n}\n\nexport async function loadPackageCompanionExport<T>(\n packageRoot: string,\n subpath: string = PACKAGE_COMPANION_SUBPATH,\n options?: LoadConfigOptions,\n): Promise<T> {\n /*\n * The REAL path, as Node resolves a linked package (#2038). pnpm installs an injected or workspace package into an\n * importer's `node_modules` as a symlink to its virtual-store copy, and that copy's own dependencies sit beside it\n * there (`.pnpm/<key>/node_modules/…`), not in the importer's `node_modules`. jiti resolves a bare import from the path\n * it was handed, so the symlinked root found a dependency only when the importer happened to declare it too — the\n * catalogue's `@wildo-ai/external-connectors-public/companion` import (#1700) was the first one the backend did not,\n * and every `wildo config sync` of Wonder Todos then refused its ten catalogue providers as uncontributed.\n * A root that is not a link is its own real path, so runtime owners are unchanged.\n */\n const realPackageRoot = realpathSync(packageRoot);\n const moduleResolution = options?.moduleResolution\n ?? inferPackageCompanionModuleResolution(realPackageRoot);\n /*\n * A FRESH read evaluates the package's AUTHORED source, never its compiled `dist`, in every application.\n *\n * jiti does not transpile an ESM `.js` file in a `\"type\": \"module\"` package: it hands it to Node's native\n * `import()` (`[jiti] [native] [import]` under JITI_DEBUG), whatever `moduleCache: false` says. Node's ESM registry\n * is process-global and cannot be invalidated, so the first evaluation of `dist/esm/companion-exports.js` and of\n * every relative module it imports is the only one the process ever sees. `freshModuleCache` was therefore inert\n * for every package resolved through `exports`, which is every application OUTSIDE the framework workspace\n * (`inferPackageCompanionModuleResolution` answers `package` there). Inside the workspace, `framework-source`\n * picked `src/companion-exports.ts`, which jiti transpiles and does re-read — so the dogfood applications under\n * `examples/` showed it working and nothing else did.\n *\n * Measured 2026-10-01 on an application created with the published 1.1.8 CLI: creator answers landed in\n * `specifications/src/creator-inputs/index.ts`, the watcher rebuilt `dist` a second later, and the running\n * companion kept reading the creator-inputs it saw at startup. Every answer saved through the dossier then\n * re-landed the file from that stale read, so each save kept only its own answer, and the 16 answers written by\n * hand were invisible until a restart. Reproduced in isolation: a changed `dist` entry, loaded again with\n * `freshModuleCache: true`, returns the first evaluation; a changed `.ts` entry returns the new one.\n *\n * Reading source is also what the writers write: a landing writes `src/`, so a read-modify-write that read `dist`\n * raced the watcher even in a process with a fresh registry. Only the package's OWN modules gain this; a bare\n * import into another package (`@app/shared-lib`) still loads that package's compiled build natively. Keeping\n * that build fresh is the caller's concern: the dev companion re-tags those URLs per build\n * (`application-module-generations.companion.ts`, #2125).\n */\n const entryPath = resolvePackageCompanionEntryPath(realPackageRoot, subpath, {\n moduleResolution,\n preferAuthoredSource: options?.freshModuleCache === true,\n });\n return loadConfig<T>(entryPath, {\n ...options,\n moduleResolution,\n });\n}\n\nfunction resolvePlatformConfigLibEntry(startDirectory: string): string {\n const packageRoot = resolveCurrentPackageRoot(startDirectory);\n const configAuthoringEntry = join(packageRoot, 'src', 'config-authoring.entry.ts');\n if (existsSync(configAuthoringEntry)) {\n return configAuthoringEntry;\n }\n const sourceEntry = join(packageRoot, 'src', 'index.ts');\n if (existsSync(sourceEntry)) {\n return sourceEntry;\n }\n\n return join(packageRoot, 'dist', 'esm', 'index.js');\n}\n\nfunction resolveCurrentPackageRoot(startDirectory: string): string {\n let currentDirectory = startDirectory;\n\n while (true) {\n if (existsSync(join(currentDirectory, 'package.json'))) {\n return currentDirectory;\n }\n\n const parentDirectory = dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n break;\n }\n currentDirectory = parentDirectory;\n }\n\n return startDirectory;\n}\n\nfunction tryResolveLoaderWorkspaceRoot(startDirectory: string): string | undefined {\n let currentDirectory = startDirectory;\n\n while (true) {\n if (existsSync(join(currentDirectory, FRAMEWORK_WORKSPACE_MARKER_FILE))) {\n return currentDirectory;\n }\n\n const parentDirectory = dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n break;\n }\n currentDirectory = parentDirectory;\n }\n\n return undefined;\n}\n\n/**\n * Resolve the framework workspace root when framework-source module\n * resolution is explicitly requested.\n */\nfunction resolveLoaderWorkspaceRoot(startDirectory: string): string {\n const workspaceRoot = tryResolveLoaderWorkspaceRoot(startDirectory);\n if (workspaceRoot) {\n return workspaceRoot;\n }\n\n throw new Error(\n 'Could not locate the Wildo framework workspace root from the config loader.\\n'\n + ` Expected marker: \"${FRAMEWORK_WORKSPACE_MARKER_FILE}\"\\n`\n + ` Walked up from: \"${startDirectory}\"\\n\\n`\n + ` Fix: commit \"${FRAMEWORK_WORKSPACE_MARKER_FILE}\" at the root of the framework checkout `\n + 'that owns \"@wildo-ai/platform-config-lib\". The file is the authoritative signal '\n + 'used to anchor the loader\\'s \"~wildo-*\" jiti aliases — generic markers like '\n + '\"pnpm-workspace.yaml\" are intentionally NOT accepted because they can match an '\n + 'unrelated workspace and silently misroot alias targets.',\n );\n}\n\nfunction buildLoaderAliases(input: {\n frameworkWorkspaceRoot?: string;\n moduleResolution: NonNullable<LoadConfigOptions['moduleResolution']>;\n platformConfigLibEntry: string;\n}): Record<string, string> {\n const platformConfigLibPackageRoot = resolveCurrentPackageRoot(dirname(input.platformConfigLibEntry));\n const aliases = buildDeclaredPackageSourceAliases(\n platformConfigLibPackageRoot,\n '.',\n input.platformConfigLibEntry,\n );\n if (input.moduleResolution !== 'framework-source' || !input.frameworkWorkspaceRoot) {\n return aliases;\n }\n\n const workspaceRoot = input.frameworkWorkspaceRoot;\n return {\n ...aliases,\n '@wildo-ai/external-connectors-public/app': resolve(\n workspaceRoot,\n 'engine/external-connectors-public/src/app/index.ts',\n ),\n '@wildo-ai/external-connectors-public/techdoc': resolve(\n workspaceRoot,\n 'engine/external-connectors-public/src/techdoc/index.ts',\n ),\n '@wildo-ai/external-connectors-public/website': resolve(\n workspaceRoot,\n 'engine/external-connectors-public/src/website/index.ts',\n ),\n ...buildDeclaredPackageSourceAliases(workspaceRoot, 'engine/external-connectors-models'),\n ...buildDeclaredPackageSourceAliases(workspaceRoot, 'engine/saas-backend-lib'),\n '@wildo-ai/platform-core-shared': resolve(\n workspaceRoot,\n 'platform/platform-core/platform-core-shared/src/index.ts',\n ),\n '@wildo-ai/platform-core-backend': resolve(\n workspaceRoot,\n 'platform/platform-core/platform-core-backend/src/index.ts',\n ),\n '@wildo-ai/platform-shared-lib': resolve(\n workspaceRoot,\n 'platform/platform-back-office/platform-shared-lib/src/index.ts',\n ),\n '@wildo-ai/zod-decorators': resolve(\n workspaceRoot,\n 'engine/zod-decorators/src/index.ts',\n ),\n ...buildDeclaredPackageSourceAliases(workspaceRoot, 'engine/saas-models'),\n ...buildDeclaredPackageSourceAliases(\n workspaceRoot,\n 'engine/saas-technical-doc',\n 'engine/saas-technical-doc/src/index.ts',\n ),\n ...buildDeclaredPackageSourceAliases(\n workspaceRoot,\n 'engine/saas-website',\n 'engine/saas-website/src/config/index.ts',\n ),\n '~wildo-backend-lib': resolve(workspaceRoot, 'engine/saas-backend-lib/src'),\n '~wildo-connectors': resolve(workspaceRoot, 'engine/external-connectors/src'),\n '~wildo-connectors-models': resolve(workspaceRoot, 'engine/external-connectors-models/src'),\n '~wildo-models': resolve(workspaceRoot, 'engine/saas-models/src'),\n '~wildo-zod': resolve(workspaceRoot, 'engine/zod-decorators/src'),\n };\n}\n\n/**\n * Build source-first aliases from one framework package's declared public\n * exports.\n *\n * jiti treats alias keys as prefixes rather than Node-style exact package\n * identities. Hand-authoring only the package root therefore corrupts every\n * semantic entrypoint: `@scope/package/subpath` becomes\n * `<package>/src/index.ts/subpath`. Deriving the aliases from `exports.*.source`\n * keeps the loader aligned with the package's public contract, and sorting by\n * specificity guarantees a subpath wins before its root prefix.\n *\n * `rootSourceOverride` preserves the deliberately narrower source root used by\n * packages whose normal root is unsuitable for config evaluation. Subpaths\n * still come from their declared `source` conditions.\n */\nfunction buildDeclaredPackageSourceAliases(\n workspaceRoot: string,\n packageRelativeRoot: string,\n rootSourceOverride?: string,\n): Record<string, string> {\n const packageRoot = resolve(workspaceRoot, packageRelativeRoot);\n const packageJsonPath = join(packageRoot, 'package.json');\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as {\n name?: string;\n exports?: Record<string, string | { source?: string }>;\n };\n if (!packageJson.name) {\n throw new Error(`Framework package at \"${packageRoot}\" has no package name.`);\n }\n\n const entries: Array<readonly [string, string]> = [];\n for (const [exportKey, exportValue] of Object.entries(packageJson.exports ?? {})) {\n const declaredSource = exportValue !== null && typeof exportValue === 'object'\n ? exportValue.source\n : undefined;\n const sourcePath = exportKey === '.' && rootSourceOverride\n ? resolve(workspaceRoot, rootSourceOverride)\n : declaredSource?.startsWith('./')\n ? resolve(packageRoot, declaredSource)\n : undefined;\n if (!sourcePath) {\n continue;\n }\n if (!isPathInsideRoot(sourcePath, packageRoot)) {\n throw new Error(`Framework package source export \"${exportKey}\" escapes \"${packageRoot}\".`);\n }\n\n const specifier = exportKey === '.'\n ? packageJson.name\n : `${packageJson.name}/${exportKey.slice(2)}`;\n entries.push([specifier, sourcePath]);\n }\n\n if (rootSourceOverride && !entries.some(([specifier]) => specifier === packageJson.name)) {\n const sourcePath = resolve(workspaceRoot, rootSourceOverride);\n if (!isPathInsideRoot(sourcePath, packageRoot)) {\n throw new Error(`Framework package root override escapes \"${packageRoot}\".`);\n }\n entries.push([packageJson.name, sourcePath]);\n }\n\n entries.sort(([left], [right]) => right.length - left.length || left.localeCompare(right));\n return Object.fromEntries(entries);\n}\n\nfunction inferPackageCompanionModuleResolution(\n packageRoot: string,\n): NonNullable<LoadConfigOptions['moduleResolution']> {\n return inferConfigModuleResolution(packageRoot, dirname(fileURLToPath(import.meta.url)));\n}\n\nfunction inferConfigModuleResolution(\n targetPath: string,\n loaderModuleDirectory: string,\n): NonNullable<LoadConfigOptions['moduleResolution']> {\n const frameworkWorkspaceRoot = tryResolveLoaderWorkspaceRoot(loaderModuleDirectory);\n if (!frameworkWorkspaceRoot) {\n return 'package';\n }\n return isPathInsideRoot(targetPath, frameworkWorkspaceRoot)\n ? 'framework-source'\n : 'package';\n}\n\nfunction isPathInsideRoot(pathToCheck: string, root: string): boolean {\n const relativePath = relative(resolve(root), resolve(pathToCheck));\n return relativePath === ''\n || (!relativePath.startsWith('..') && !relativePath.startsWith(`..${requirePathSeparator()}`));\n}\n\nfunction requirePathSeparator(): string {\n return process.platform === 'win32' ? '\\\\' : '/';\n}\n\n/**\n * Load a `wildo.saas.config.ts` file.\n * Returns `null` if the file doesn't exist (non-throwing variant for optional loading).\n */\nexport async function loadSaasConfig(filePath: string, options?: LoadConfigOptions): Promise<WildoSaasConfig | null> {\n const absolutePath = resolve(filePath);\n if (!existsSync(absolutePath)) return null;\n return loadConfig<WildoSaasConfig>(absolutePath, options);\n}\n\n/**\n * Where an application authors one environment's infra config: `<infrastructure home>/<env>/wildo.infra.<local|remote>.config.ts`.\n *\n * ONE rule, shared by every reader. It lived as a private helper in the CLI and was copied twice more inside it\n * (frontend publish, CSP sync); the dev companion needs it too, to read the application's declared store, so it moved\n * here beside {@link loadSaasConfig}.\n */\nexport function resolveInfraEnvConfigPath(saasRoot: string, envName: string): string {\n return join(\n resolveAppLayout(saasRoot).authoredInfrastructureHome,\n envName,\n envName === 'local' ? 'wildo.infra.local.config.ts' : 'wildo.infra.remote.config.ts',\n );\n}\n\n/**\n * Load one environment's authored `wildo.infra.<env>.config.ts`. Returns `null` when the file does not exist.\n *\n * Refuses a file whose authored `environment` is not the directory it sits in: reading `local`'s file for `staging`\n * would hand one environment another's topology, silently.\n *\n * `freshModuleCache` re-evaluates the file instead of serving jiti's process-wide module cache. A short-lived CLI\n * does not need it; a long-lived reader whose question is \"what does the file say NOW\" does — the dev companion\n * reads the application's declared store through here, and a cached evaluation would keep answering with the\n * store the file declared when the process first read it (see {@link LoadConfigOptions.freshModuleCache}).\n */\nexport async function loadInfraEnvConfig(\n saasRoot: string,\n envName: string,\n options?: Pick<LoadConfigOptions, 'freshModuleCache'>,\n): Promise<{ path: string; config: WildoInfraEnvConfig } | null> {\n const authored = await loadAuthoredInfraEnvConfigFile(saasRoot, envName, options);\n if (authored === null) return null;\n if (!isHostedInfraEnvConfig(authored.config)) {\n return { path: authored.path, config: authored.config };\n }\n\n /*\n * VALIDATE the hosted descriptor before trusting any of it. `defineHostedInfraEnvConfig` parses it, but this\n * loader also evaluates plain `export default {…}` objects — and an unvalidated `backingServices.postgresql.host`\n * would override the HOST's server in the merge, which is precisely the divergence hosting exists to make\n * impossible. A host-owned member (`runtime`, `database`, …) is refused here too, by name, instead of being\n * silently dropped.\n */\n const hostedParse = WildoHostedInfraEnvConfigSchema.safeParse(authored.config);\n if (!hostedParse.success) {\n throw new Error(`${authored.path} is a hosted environment descriptor and is invalid:\\n`\n + hostedParse.error.issues.map((issue) => ` - ${issue.path.join('.') || '(root)'}: ${issue.message}`).join('\\n'));\n }\n const hostedDescriptor = hostedParse.data;\n\n /*\n * A HOSTED descriptor resolves here and nowhere else. This is the one function that holds both the\n * application root and the environment name, and every reader of an application's infra descriptor\n * reaches it — so the host's platform is merged in once, and no consumer can see a hosted descriptor\n * that has not been resolved.\n */\n const declaredHostRoot = hostedDescriptor.infrastructureHost.applicationRoot;\n const hostApplicationRoot = resolve(saasRoot, declaredHostRoot);\n if (isSameDirectory(hostApplicationRoot, saasRoot)) {\n throw new Error(`${authored.path} declares itself as its own infrastructureHost ('${declaredHostRoot}'). `\n + 'Remove infrastructureHost: an application that owns its infrastructure declares it standalone.');\n }\n if (!existsSync(join(hostApplicationRoot, AUTHORED_CONFIG_FILE_NAMES.SAAS))) {\n throw new Error(`${authored.path} runs on the infrastructure of '${declaredHostRoot}', which resolves to `\n + `${hostApplicationRoot} — and no Wildo application is there (no ${AUTHORED_CONFIG_FILE_NAMES.SAAS}). A hosted application `\n + 'needs its host\\'s SOURCE: check the host application out at that path, or remove infrastructureHost to run this '\n + 'application on its own infrastructure.');\n }\n const host = await loadAuthoredInfraEnvConfigFile(hostApplicationRoot, envName, options);\n if (host === null) {\n throw new Error(`${authored.path} runs on the infrastructure of ${hostApplicationRoot} for environment '${envName}', but that `\n + `application has no descriptor for it (expected ${resolveInfraEnvConfigPath(hostApplicationRoot, envName)}). The host `\n + 'owns the platform per environment, so it must describe this one.');\n }\n\n return {\n path: authored.path,\n config: resolveHostedInfraEnvConfig({\n hosted: hostedDescriptor,\n hostedConfigPath: authored.path,\n host: host.config,\n hostApplicationRoot,\n hostConfigPath: host.path,\n }),\n };\n}\n\n/**\n * Whether two paths name the same directory. Compared through `realpath` when both exist, so a symlinked\n * `applicationRoot` pointing back at the application itself is still recognised as self-hosting; falls\n * back to lexical resolution when either path does not exist yet.\n */\nfunction isSameDirectory(a: string, b: string): boolean {\n try {\n return realpathSync(a) === realpathSync(b);\n } catch {\n return resolve(a) === resolve(b);\n }\n}\n\n/**\n * Evaluate one application's descriptor AS AUTHORED — standalone or hosted, unresolved. Private: a hosted\n * descriptor is not an environment until {@link loadInfraEnvConfig} merges its host in.\n *\n * The host's file is evaluated with the HOST as artifact owner, so its jiti cache lives beside its own\n * application rather than inside the hosted one's.\n */\nasync function loadAuthoredInfraEnvConfigFile(\n saasRoot: string,\n envName: string,\n options?: Pick<LoadConfigOptions, 'freshModuleCache'>,\n): Promise<{ path: string; config: WildoAuthoredInfraEnvConfig } | null> {\n const path = resolveInfraEnvConfigPath(saasRoot, envName);\n if (!existsSync(path)) return null;\n const config = await loadConfig<WildoAuthoredInfraEnvConfig>(resolve(path), {\n artifactLocation: { zone: ConfigArtifactsZone.SAAS, ownerRoot: saasRoot },\n ...(options?.freshModuleCache === true ? { freshModuleCache: true } : {}),\n });\n if (config.environment !== envName) {\n throw new Error(`Authored env descriptor mismatch: directory '${envName}' does not match authored environment '${config.environment}'.`);\n }\n return { path, config };\n}\n\n/**\n * Per-folder file name for a minion config (`wildo.minion.config.ts`).\n *\n * Co-located inside the minion's directory referenced by\n * `wildo.saas.config.ts > minions.<key>.path` — the loader resolves\n * `<saasRoot>/<entry.path>/wildo.minion.config.ts` exactly the same\n * way the existing tech-doc / website per-service loaders resolve\n * their authoring files.\n */\nexport const MINION_CONFIG_FILENAME = 'wildo.minion.config.ts';\n\n/**\n * Per-folder file name for a worker config (`wildo.worker.config.ts`).\n */\nexport const WORKER_CONFIG_FILENAME = 'wildo.worker.config.ts';\n\n/**\n * Result entry for `loadMinionConfigs` / `loadWorkerConfigs`.\n *\n * Carries the bucket key (the name authored under\n * `wildo.saas.config.ts > minions / workers`), the absolute path the\n * config was resolved from, and the parsed value. Returning the\n * absolute path alongside the parsed config lets callers (Phase 2 /\n * Phase 3 manifest emitters) build deterministic error messages\n * without re-deriving the path themselves.\n */\nexport interface PerFolderConfigEntry<T> {\n /** Bucket key from `wildo.saas.config.ts > minions / workers`. */\n key: string;\n /** Absolute path the config was loaded from. */\n absolutePath: string;\n /** Parsed config (Zod-validated). */\n config: T;\n}\n\n/**\n * Load every `wildo.minion.config.ts` referenced by `saasConfig.minions`.\n *\n * Phase 1 contract: this returns a typed list of entries; Phase 2's\n * `start-minion-application` consumes it to build the per-minion DI\n * container and to cross-validate `resourceAccess` against the parsed\n * resource catalog (IC-2). Missing files throw with the offending\n * bucket key in the error message — silently skipping would mask a\n * mistyped `path:` field.\n */\nexport async function loadMinionConfigs(\n saasRoot: string,\n saasConfig: WildoSaasConfig,\n options?: LoadConfigOptions,\n): Promise<PerFolderConfigEntry<WildoMinionConfig>[]> {\n return loadPerFolderConfigs<WildoMinionConfig>(\n saasRoot,\n saasConfig.minions ?? {},\n MINION_CONFIG_FILENAME,\n 'minion',\n options,\n );\n}\n\n/**\n * Load every `wildo.worker.config.ts` referenced by `saasConfig.workers`.\n *\n * Phase 1 contract identical to `loadMinionConfigs` — Phase 3's K8s\n * manifest emitter consumes it to project `replicas`, `http.port`,\n * health/ready paths into Deployment + Service manifests.\n */\nexport async function loadWorkerConfigs(\n saasRoot: string,\n saasConfig: WildoSaasConfig,\n options?: LoadConfigOptions,\n): Promise<PerFolderConfigEntry<WildoWorkerConfig>[]> {\n return loadPerFolderConfigs<WildoWorkerConfig>(\n saasRoot,\n saasConfig.workers ?? {},\n WORKER_CONFIG_FILENAME,\n 'worker',\n options,\n );\n}\n\nasync function loadPerFolderConfigs<T>(\n saasRoot: string,\n bucket: Record<string, { path: string }>,\n filename: string,\n kindLabel: 'minion' | 'worker',\n options?: LoadConfigOptions,\n): Promise<PerFolderConfigEntry<T>[]> {\n const absoluteSaasRoot = resolve(saasRoot);\n const entries = Object.entries(bucket);\n\n const out: PerFolderConfigEntry<T>[] = [];\n for (const [key, ref] of entries) {\n const absolutePath = resolve(absoluteSaasRoot, ref.path, filename);\n if (!existsSync(absolutePath)) {\n throw new Error(\n `Could not find ${kindLabel} config for '${key}': ${absolutePath} does not exist.\\n`\n + ` Authored at: wildo.saas.config.ts > ${kindLabel}s.${key}.path = '${ref.path}'\\n`\n + ` Expected file: ${filename}\\n`\n + ` Either create the file or remove the bucket entry.`,\n );\n }\n const config = await loadConfig<T>(absolutePath, options);\n out.push({ key, absolutePath, config });\n }\n return out;\n}\n\n/**\n * Load the framework-scoped `wildo.framework.config.ts` file.\n * Returns `null` if the file does not exist.\n */\nexport async function loadFrameworkConfig(\n frameworkRoot: string,\n options?: Omit<LoadConfigOptions, 'artifactLocation'>,\n): Promise<WildoFrameworkConfig | null> {\n const filePath = resolveFrameworkLayout(frameworkRoot).declarationConfigPath;\n const absolutePath = resolve(filePath);\n if (!existsSync(absolutePath)) return null;\n\n return loadConfig<WildoFrameworkConfig>(absolutePath, {\n ...options,\n artifactLocation: {\n zone: ConfigArtifactsZone.FRAMEWORK,\n ownerRoot: frameworkRoot,\n },\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/project-config/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,UAAU,EAAoB,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGtG,OAAO,EACL,sBAAsB,EACtB,+BAA+B,GAGhC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,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CAAC;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAI,YAAY,EAAE,OAAO,CAAC,CAAC;QAC1D,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,aAAqB,EACrB,OAAqD;IAErD,MAAM,QAAQ,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC,qBAAqB,CAAC;IAC7E,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAE3C,OAAO,UAAU,CAAuB,YAAY,EAAE;QACpD,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,IAAI,EAAE,mBAAmB,CAAC,SAAS;YACnC,SAAS,EAAE,aAAa;SACzB;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createHash } from 'crypto';\nimport { existsSync, mkdirSync, readFileSync } from 'fs';\nimport { dirname, join, relative, resolve } from 'path';\nimport { findPackageJSON } from 'module';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport { createJiti, type JitiOptions } from 'jiti';\nimport { resolveAppLayout, resolveFrameworkLayout } from '../workspace-scope/workspace-homes.schemas';\nimport type { WildoFrameworkConfig } from './define-framework-config';\nimport type { WildoSaasConfig } from './define-saas-config';\nimport {\n isHostedInfraEnvConfig,\n WildoHostedInfraEnvConfigSchema,\n type WildoAuthoredInfraEnvConfig,\n type WildoInfraEnvConfig,\n} from './define-infra-env-config';\nimport { realpathSync } from 'fs';\nimport { resolveHostedInfraEnvConfig } from './hosted-infra-env-config';\nimport { AUTHORED_CONFIG_FILE_NAMES } from '../workspace-scope/workspace-scope.schemas';\nimport type { WildoMinionConfig } from './define-minion-config';\nimport type { WildoWorkerConfig } from './define-worker-config';\nimport {\n ConfigArtifactsZone,\n FRAMEWORK_WORKSPACE_MARKER_FILE,\n resolveConfigArtifactsBaseDir,\n type ConfigArtifactsLocationOptions,\n} from '../workspace-scope/workspace-scope.schemas';\nimport { ConfigModuleResolution } from './config-module-resolution';\n\nexport interface LoadConfigOptions {\n /**\n * Optional explicit owner zone for generated loader artifacts.\n * Use this when the authored config file lives outside its semantic runtime\n * owner and should still emit loader artifacts under the canonical runtime\n * home instead of beside the source file.\n */\n artifactLocation?: ConfigArtifactsLocationOptions;\n /**\n * Module-resolution strategy for jiti while evaluating the config file. See {@link ConfigModuleResolution} for what\n * each member means.\n *\n * When omitted, the loader auto-detects the mode: configs inside a Wildo framework workspace use\n * {@link ConfigModuleResolution.FRAMEWORK_SOURCE}; external app repos use {@link ConfigModuleResolution.PACKAGE}.\n * {@link ConfigModuleResolution.LOADER_INSTANCES} is only ever chosen explicitly.\n */\n moduleResolution?: ConfigModuleResolution;\n /**\n * Package-owned module aliases the loaded source needs in order to resolve\n * its own internal specifiers.\n *\n * A package may address its own modules through a compiler path alias (for\n * example `~specifications/modules/...`). Those specifiers are meaningless to\n * Node, so evaluating that package's authored source fails unless the alias is\n * supplied here. The framework aliases this loader owns are always applied;\n * these are merged on top, so a package can extend its own resolution without\n * being able to redirect a framework specifier away from the framework.\n *\n * Keys are exact specifier prefixes and values absolute paths — NOT the\n * tsconfig `\"~x/*\": [\"./src/*\"]` glob form. Callers holding tsconfig-shaped\n * declarations must normalize them first.\n */\n packageModuleAliases?: Readonly<Record<string, string>>;\n /**\n * Re-evaluate the loaded module graph on EVERY call instead of serving jiti's\n * module cache.\n *\n * jiti's module cache is effectively PROCESS-GLOBAL (the transpiled modules\n * land in the shared CJS registry), so a fresh `createJiti` per call does NOT\n * give a fresh read: a long-lived process that loaded a file once keeps\n * seeing that evaluation after the file changes on disk. Measured live on the\n * dev companion (wonder-crm, 2026-08-27): a `companion-exports.ts` slot wired\n * while the companion ran stayed invisible until restart — the J-1 \"stall B\"\n * that forced a companion restart after every landed specification family.\n *\n * Off by default: one-shot CLI processes gain nothing from re-evaluation,\n * and module identity within a single load stays shared either way. Turn it\n * on at read sites whose CONTRACT is \"the working tree as it is right now\".\n *\n * It reaches only what jiti TRANSPILES. An ESM `.js` file in a `\"type\": \"module\"`\n * package is imported natively by Node and pinned in its process-global ESM\n * registry, whatever this says — so {@link loadPackageCompanionExport} answers\n * a fresh read from the package's authored source, not its `dist`.\n */\n freshModuleCache?: boolean;\n /**\n * Compile JSX in the loaded graph, with the automatic runtime from `importSource` (`react` for a website). Off by\n * default: an application's specifications and configs contain no JSX. A website source module that builds JSX at\n * import time (an icon map) needs it, or it fails with \"React is not defined\".\n */\n // semantic-literal-boundary: jiti's (Babel's) own JSX runtime option, passed through as it is spelled there.\n jsx?: { readonly runtime: 'automatic'; readonly importSource: string };\n /**\n * Give each transpiled module the loaded graph reaches its OWN evaluation boundary (#3258), so a module whose body\n * throws is handed to {@link ModuleEvaluationBoundary.absorb} instead of failing the module that imported it — and,\n * through it, the whole graph. Off by default: every config and every other reader keeps the ordinary all-or-nothing\n * evaluation. See {@link ModuleEvaluationBoundary}.\n */\n moduleEvaluationBoundary?: ModuleEvaluationBoundary;\n}\n\n/**\n * What a module boundary hands its handler when a bounded module fails: the module's file, what it threw (for a\n * source that could not be transpiled, a `SyntaxError` naming the file, line and column), and its `exports` object —\n * holding whatever it assigned before the throw, for the handler to keep or reset — and every bounded module it imports,\n * directly or not, so a handler can tell a failure of its own from what a failed import did to it.\n */\nexport interface ModuleEvaluationFailure {\n readonly filename: string;\n readonly error: unknown;\n readonly moduleExports: Record<string, unknown>;\n readonly importedFilenames: readonly string[];\n}\n\n/**\n * A per-module evaluation boundary for one load (#3258).\n *\n * ## Why\n *\n * jiti evaluates a TypeScript graph as one chain of `require`/`import` calls, so a throw in any module body propagates\n * through every importer up to the entry and the load fails as a whole. For a reader whose input is MANY independent\n * authored declarations aggregated by one entry (an application's specifications package: `companion-exports.ts`\n * imports every module), that turns one broken file into \"nothing can be read\".\n *\n * ## How\n *\n * Every module jiti TRANSPILES whose file `appliesTo` accepts has its transpiled body wrapped in a `try`: a throw — or\n * a transpile failure, which jiti otherwise reports after the module returns — is given to `absorb`. When `absorb`\n * returns `true` the module completes normally with whatever its `exports` hold, and its importers carry on. When it\n * returns anything else, the error propagates exactly as it would have without a boundary. What absorbing MEANS (what\n * to record, whether the module's partial exports are kept) is entirely the handler's: the loader has no opinion.\n *\n * - **The entry is never bounded.** Its failure leaves nothing to return, so it fails the load as before.\n * - **Only transpiled modules are reached.** A module jiti hands to Node natively (an ESM `.js` file in a\n * `\"type\": \"module\"` package — a sibling package's compiled build) is not; its throw reaches the bounded module that\n * imported it, which is where it is absorbed.\n * - **The handler is per load.** It travels on the jiti options of this load (`require.options` inside a module), so\n * two overlapping loads with different handlers never reach each other's, and the wrapped code holds no reference\n * to any one load — which is what lets jiti's on-disk transpile cache keep it. Wrapped output is cached in a cache\n * directory of its own, so an unbounded load never reads a wrapped module and a bounded load never reads an\n * unwrapped one. Run without the handler (it is absent from the options), a wrapped module rethrows: identical to\n * no boundary.\n * - **Semantics inside the module are unchanged.** The body runs as the body of an inner function (async when jiti\n * evaluates the module asynchronously), so its `\"use strict\"` directive and its hoisting are what they were, and the\n * wrapper sits on the body's first line so stack frames keep their line numbers. One difference, without effect: the\n * directive no longer heads jiti's own wrapper, so the `this` handed to the body is `globalThis` rather than\n * `undefined` — but an ES module's transpiled body never reads its top-level `this` (Babel rewrites it to\n * `undefined`).\n */\nexport interface ModuleEvaluationBoundary {\n /** Whether the module at this absolute path gets a boundary. */\n readonly appliesTo: (absolutePath: string) => boolean;\n /** Handle a bounded module's failure. `true` absorbs it; anything else lets it propagate. */\n readonly absorb: (failure: ModuleEvaluationFailure) => boolean;\n}\n\n/**\n * The jiti option key the boundary's handler travels under. jiti keeps unknown option keys on the options object it\n * shares with every child instance of one load, which a transpiled module reaches as `require.options`.\n */\nconst MODULE_EVALUATION_BOUNDARY_OPTION = 'wildoModuleEvaluationBoundary';\n\n/** The marker jiti's default transform leaves in place of a module it could not transpile (read by jiti after the module returns). */\nconst JITI_TRANSFORM_ERROR_EXPORT = '__JITI_ERROR__';\n\n/**\n * The wrapper's version, part of a bounded load's transpile-cache directory. jiti's cache entry is valid while the\n * module's SOURCE is unchanged and knows nothing of the wrapper, so a change to {@link wrapModuleInEvaluationBoundary}\n * must bump this, or modules wrapped the old way keep being served from the cache.\n */\nconst MODULE_EVALUATION_BOUNDARY_WRAPPER_VERSION = 2;\n\n/** What a transpiled module's wrapper passes: {@link ModuleEvaluationFailure} before its imports are read. */\ntype WrappedModuleFailure = Omit<ModuleEvaluationFailure, 'importedFilenames'>;\n\n/** The jiti option key the import observer travels under, the way {@link MODULE_EVALUATION_BOUNDARY_OPTION} does. */\nconst MODULE_IMPORT_OBSERVER_OPTION = 'wildoModuleImportObserver';\n\n/** What a bounded module's wrapper calls for each import it evaluates: the module, the specifier, and its `require`. */\ntype ModuleImportObserver = (filename: string, specifier: unknown, resolver: { readonly resolve: (specifier: string) => string }) => void;\n\n/**\n * One load's import graph over its bounded modules. Recorded at the import, because jiti's module tree cannot answer:\n * a module already evaluated in this load is served from its cache and never becomes a child of a second importer.\n */\nfunction createModuleImportGraph(): { readonly observe: ModuleImportObserver; readonly importedBy: (filename: string) => readonly string[] } {\n const imports = new Map<string, Set<string>>();\n return {\n observe: (filename, specifier, resolver) => {\n if (typeof specifier !== 'string') return;\n try {\n const known = imports.get(filename) ?? new Set<string>();\n known.add(resolver.resolve(specifier));\n imports.set(filename, known);\n } catch {\n // A specifier that cannot be resolved is the import's own failure, which the import itself is about to raise.\n }\n },\n importedBy: (filename) => {\n const seen = new Set<string>([filename]);\n const pending = [...(imports.get(filename) ?? [])];\n for (let next = pending.pop(); next !== undefined; next = pending.pop()) {\n if (seen.has(next)) continue;\n seen.add(next);\n pending.push(...(imports.get(next) ?? []));\n }\n seen.delete(filename);\n return [...seen];\n },\n };\n}\n\n/**\n * Wrap one transpiled module body in its evaluation boundary (see {@link ModuleEvaluationBoundary}). Exported so the\n * wrapper's shape can be pinned without a jiti instance.\n */\nexport function wrapModuleInEvaluationBoundary(code: string, options: { readonly async: boolean }): string {\n // An inline source map must stay the LAST line to be honoured, so it moves after the wrapper.\n const sourceMapMatch = /\\n(\\/\\/# sourceMappingURL=[^\\n]*)\\s*$/u.exec(code);\n const body = sourceMapMatch === null ? code : code.slice(0, sourceMapMatch.index);\n const handler = `(require.options&&require.options[${JSON.stringify(MODULE_EVALUATION_BOUNDARY_OPTION)}])`;\n const absorbed = (error: string): string => `(typeof ${handler}===\"function\"&&${handler}({error:${error},filename:__filename,moduleExports:exports})===true)`;\n const observer = `(require.options&&require.options[${JSON.stringify(MODULE_IMPORT_OBSERVER_OPTION)}])`;\n // The body's own `require` and `jitiImport` are these: same functions, and each import is reported on the way through.\n const observed = (load: string): string => `(typeof ${observer}===\"function\"?new Proxy(${load},{apply:(target,self,args)=>{${observer}(__filename,args[0],require);return Reflect.apply(target,self,args);}}):${load})`;\n const invoke = options.async ? 'await (async function(jitiImport,require){' : '(function(jitiImport,require){';\n /*\n * A module jiti could not transpile is not a throw: its body is one assignment of the error to `exports`, which jiti\n * turns into a throw after the module returns. The boundary turns it into a SyntaxError here, so the handler sees it\n * as the failure of THIS module rather than of its importer, and removes the marker when the handler absorbs it.\n */\n const transformFailure = body.includes(JITI_TRANSFORM_ERROR_EXPORT)\n ? `\\nif(exports.${JITI_TRANSFORM_ERROR_EXPORT}){const __wildoTransform=exports.${JITI_TRANSFORM_ERROR_EXPORT};`\n + 'const __wildoTransformError=new SyntaxError(`${__wildoTransform.code}: ${__wildoTransform.message} (${__wildoTransform.filename}:${__wildoTransform.line}:${__wildoTransform.column})`);'\n + `if(${absorbed('__wildoTransformError')})delete exports.${JITI_TRANSFORM_ERROR_EXPORT};}`\n : '';\n return `try{${invoke}${body}\\n}).call(this,${observed('jitiImport')},${observed('require')});}catch(__wildoModuleError){if(!${absorbed('__wildoModuleError')})throw __wildoModuleError;}`\n + transformFailure\n + (sourceMapMatch === null ? '' : `\\n${sourceMapMatch[1]}`);\n}\n\n/**\n * jiti options that put every transpiled module `boundary` applies to (except the entry) behind its evaluation\n * boundary. The default transform comes from a second jiti instance with the same options and no on-disk cache: the\n * wrapping instance's own cache already stores the wrapped output, so caching the unwrapped one too would only double\n * the transpile cache for no read.\n */\nfunction buildModuleEvaluationBoundaryJitiOptions(\n boundary: ModuleEvaluationBoundary,\n entryPath: string,\n baseOptions: JitiOptions,\n): Pick<JitiOptions, 'transform'>\n & Record<typeof MODULE_EVALUATION_BOUNDARY_OPTION, (failure: WrappedModuleFailure) => boolean>\n & Record<typeof MODULE_IMPORT_OBSERVER_OPTION, ModuleImportObserver> {\n const defaultTransformer = createJiti(import.meta.url, { ...baseOptions, fsCache: false });\n const imports = createModuleImportGraph();\n return {\n [MODULE_EVALUATION_BOUNDARY_OPTION]: (failure) => boundary.absorb({ ...failure, importedFilenames: imports.importedBy(failure.filename) }),\n [MODULE_IMPORT_OBSERVER_OPTION]: imports.observe,\n transform: (transformOptions) => {\n const code = defaultTransformer.transform(transformOptions);\n const filename = transformOptions.filename;\n if (filename === undefined || resolve(filename) === entryPath || !boundary.appliesTo(resolve(filename))) return { code };\n return { code: wrapModuleInEvaluationBoundary(code, { async: transformOptions.async === true }) };\n },\n };\n}\n\nconst PACKAGE_COMPANION_SUBPATH = './companion';\n\n/**\n * Load and evaluate a TypeScript config file via jiti.\n * The file must `export default defineXxxConfig({...})`.\n * Zod validation runs inside the defineConfig helper at evaluation time,\n * so the returned object is guaranteed valid.\n *\n * @param filePath - Absolute path to the `.ts` config file\n * @returns The validated config object (the default export)\n * @throws If the file doesn't exist, has syntax errors, or Zod validation fails\n */\nexport async function loadConfig<T>(filePath: string, options?: LoadConfigOptions): Promise<T> {\n const { absolutePath, module } = await importConfigModule<{ default: T }>(filePath, options);\n if (!module.default) {\n throw new Error(`Config file must use \\`export default\\`: ${absolutePath}`);\n }\n return module.default;\n}\n\n/**\n * Load one NAMED export of an application-authored TypeScript module, through the same resolver\n * `loadConfig` uses — framework aliases, the application's own package, the per-file cache.\n *\n * For modules that are not configs and have no default export: the accepted brand assets\n * (`specifications/src/brand/resolved-assets.generated.ts` exports `generatedResolvedBrandAssets`)\n * are read by both the CLI's `wildo brand propagate` and the companion's logo step, and a second\n * TypeScript loader in each would resolve framework imports differently from every other config the\n * application authors. Returns `undefined` when the module does not export `exportName`.\n */\nexport async function loadConfigExport<T>(filePath: string, exportName: string, options?: LoadConfigOptions): Promise<T | undefined> {\n const { module } = await importConfigModule<Record<string, unknown>>(filePath, options);\n return module[exportName] as T | undefined;\n}\n\n/**\n * Load EVERY export of an application-authored TypeScript module, through the same resolver `loadConfig`\n * uses. For a reader that names the export it wants only after loading (a landed specification module).\n *\n * Exists so such a reader need not reach for `tsx`'s `tsImport`, which calls `module.register` on EVERY\n * call: each call adds a loader-thread hook chain to the process for good, after which every module\n * resolution in it is a synchronous round trip to that thread (#3208).\n */\nexport async function loadConfigModuleExports(filePath: string, options?: LoadConfigOptions): Promise<Record<string, unknown>> {\n const { module } = await importConfigModule<Record<string, unknown>>(filePath, options);\n return module;\n}\n\nasync function importConfigModule<TModule>(\n filePath: string,\n options?: LoadConfigOptions,\n): Promise<{ readonly absolutePath: string; readonly module: TModule }> {\n const absolutePath = resolve(filePath);\n if (!existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`);\n }\n const cacheBaseDir = options?.artifactLocation\n ? resolveConfigArtifactsBaseDir(options.artifactLocation)\n : resolveConfigArtifactsBaseDir(absolutePath);\n // A bounded load caches WRAPPED modules, so it keeps them apart from an unbounded load of the same entry.\n const cacheDir = join(\n cacheBaseDir,\n createHash('sha1').update(absolutePath).digest('hex')\n + (options?.moduleEvaluationBoundary === undefined ? '' : `-bounded-v${MODULE_EVALUATION_BOUNDARY_WRAPPER_VERSION}`),\n );\n mkdirSync(cacheDir, { recursive: true });\n\n const currentModuleDirectory = dirname(fileURLToPath(import.meta.url));\n const platformConfigLibEntry = resolvePlatformConfigLibEntry(currentModuleDirectory);\n const moduleResolution = options?.moduleResolution\n ?? inferConfigModuleResolution(absolutePath, currentModuleDirectory);\n const frameworkWorkspaceRoot = moduleResolution === ConfigModuleResolution.FRAMEWORK_SOURCE\n ? resolveLoaderWorkspaceRoot(currentModuleDirectory)\n : tryResolveLoaderWorkspaceRoot(currentModuleDirectory);\n\n const jitiOptions: JitiOptions = {\n fsCache: cacheDir,\n // `moduleCache: false` forces re-evaluation of the whole loaded graph — see\n // `LoadConfigOptions.freshModuleCache` for why a fresh createJiti alone is not enough.\n /*\n * A bounded load never shares jiti's module cache either, whatever `freshModuleCache` says: a module whose failure\n * the handler absorbed would otherwise sit in the process-global CommonJS registry with whatever the handler left in\n * its exports, and a later unbounded load would be served that instead of the throw it expects.\n */\n ...(options?.freshModuleCache === true || options?.moduleEvaluationBoundary !== undefined ? { moduleCache: false } : {}),\n ...(options?.jsx !== undefined ? { jsx: { runtime: options.jsx.runtime, importSource: options.jsx.importSource } } : {}),\n alias: {\n // Package-owned aliases first so framework-owned entries always win a\n // collision: a package may extend its own resolution, never redirect a\n // framework specifier away from the framework.\n ...(options?.packageModuleAliases ?? {}),\n ...buildLoaderAliases({\n frameworkWorkspaceRoot,\n moduleResolution,\n platformConfigLibEntry,\n }),\n },\n };\n const jiti = createJiti(import.meta.url, options?.moduleEvaluationBoundary === undefined\n ? jitiOptions\n : { ...jitiOptions, ...buildModuleEvaluationBoundaryJitiOptions(options.moduleEvaluationBoundary, absolutePath, jitiOptions) });\n\n return { absolutePath, module: await jiti.import(absolutePath) as TModule };\n}\n\n/**\n * Which file a package's companion subpath resolves to.\n *\n * Authored source wins when either option asks for it: {@link ConfigModuleResolution.FRAMEWORK_SOURCE} (a package inside the\n * framework workspace), or `preferAuthoredSource` (a reader whose contract is the working tree, wherever the package\n * lives — see {@link loadPackageCompanionExport}). Otherwise the declared `exports` entry wins, and authored source\n * is only the fallback when nothing is built.\n */\nexport function resolvePackageCompanionEntryPath(\n packageRoot: string,\n subpath: string = PACKAGE_COMPANION_SUBPATH,\n options?: Pick<LoadConfigOptions, 'moduleResolution'> & { readonly preferAuthoredSource?: boolean },\n): string {\n const packageJsonPath = join(packageRoot, 'package.json');\n if (!existsSync(packageJsonPath)) {\n throw new Error(`Missing package.json for companion target at \"${packageRoot}\".`);\n }\n\n const sourceSubpath = resolveSafePackageSourceSubpath(subpath);\n const sourceCandidates = subpath === PACKAGE_COMPANION_SUBPATH\n ? [\n join(packageRoot, 'src', 'companion-exports.ts'),\n join(packageRoot, 'src', 'companion-exports.tsx'),\n join(packageRoot, 'src', 'companion-exports.js'),\n join(packageRoot, 'src', 'companion-exports.mjs'),\n ]\n : sourceSubpath\n ? [\n join(packageRoot, 'src', `${sourceSubpath}.ts`),\n join(packageRoot, 'src', `${sourceSubpath}.tsx`),\n join(packageRoot, 'src', sourceSubpath, 'index.ts'),\n join(packageRoot, 'src', sourceSubpath, 'index.tsx'),\n ]\n : [];\n const preferredSourceCandidate = sourceCandidates.find((candidate) => existsSync(candidate));\n if ((options?.moduleResolution === ConfigModuleResolution.FRAMEWORK_SOURCE || options?.preferAuthoredSource === true) && preferredSourceCandidate) {\n return preferredSourceCandidate;\n }\n\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as {\n exports?: Record<string, string | { import?: string; default?: string }>;\n };\n\n const subpathExport = packageJson.exports?.[subpath];\n if (typeof subpathExport === 'string') {\n const exportPath = resolve(packageRoot, subpathExport);\n if (existsSync(exportPath)) {\n return exportPath;\n }\n }\n\n if (subpathExport && typeof subpathExport === 'object') {\n const declaredEntryPath = subpathExport.import ?? subpathExport.default;\n if (typeof declaredEntryPath === 'string') {\n const exportPath = resolve(packageRoot, declaredEntryPath);\n if (existsSync(exportPath)) {\n return exportPath;\n }\n }\n }\n\n // NOTE: the authored-source fallback below is deliberate and load-bearing for\n // `loadPackageCompanionExport`, which resolves through jiti and can therefore\n // execute TypeScript. Do not make it throw here — consumers that cannot\n // execute TypeScript must reject a source entry at THEIR load boundary\n // instead (see the companion's `importCompanionModule`).\n if (preferredSourceCandidate) {\n return preferredSourceCandidate;\n }\n\n throw new Error(\n `Could not resolve companion entry for subpath \"${subpath}\" in package \"${packageRoot}\".`,\n );\n}\n\n/**\n * Translate an exported `./subpath` into a contained source candidate.\n *\n * This supports typed package-owned companion extensions such as\n * `./continuity` during framework-source development without inventing a\n * second application-specific resolver. Traversal and empty path segments are\n * rejected before any filesystem candidate is constructed.\n */\nfunction resolveSafePackageSourceSubpath(subpath: string): string | null {\n if (!subpath.startsWith('./')) {\n return null;\n }\n const sourceSubpath = subpath.slice(2);\n const segments = sourceSubpath.split('/');\n if (\n segments.length === 0\n || segments.some(\n (segment) =>\n segment.length === 0 || segment === '.' || segment === '..',\n )\n ) {\n return null;\n }\n return sourceSubpath;\n}\n\n/**\n * Normalize tsconfig-shaped compiler path aliases into the exact-prefix form\n * `LoadConfigOptions.packageModuleAliases` expects.\n *\n * tsconfig declares `{\"~x/*\": [\"./src/*\"]}`; jiti matches an alias key as a\n * specifier prefix. The trailing `/*` on both sides is therefore stripped and\n * the target resolved against the owning package root.\n *\n * Only the FIRST target of each alias is used: jiti resolves one path per\n * specifier, so a multi-target tsconfig fallback list cannot be honoured. That\n * is a deliberate narrowing rather than a silent partial behaviour — a package\n * relying on later fallback entries will fail to resolve loudly at import time\n * instead of resolving inconsistently between the compiler and the loader.\n */\nexport function normalizeCompilerPathAliasesForLoader(\n packageRoot: string,\n compilerPathAliases: Readonly<Record<string, readonly string[]>>,\n): Record<string, string> {\n const normalized: Record<string, string> = {};\n for (const [alias, targets] of Object.entries(compilerPathAliases)) {\n const firstTarget = targets[0];\n if (typeof firstTarget !== 'string') {\n continue;\n }\n const aliasPrefix = alias.endsWith('/*') ? alias.slice(0, -2) : alias;\n const targetPath = firstTarget.endsWith('/*') ? firstTarget.slice(0, -2) : firstTarget;\n // A prefix that is empty or still contains a wildcard would match far more\n // than the package declared — a bare `*` would capture EVERY specifier and\n // silently redirect unrelated imports. Prefix matching cannot express those\n // patterns, so drop them rather than approximate them.\n if (aliasPrefix.length === 0 || aliasPrefix.includes('*')) {\n continue;\n }\n normalized[aliasPrefix] = resolve(packageRoot, targetPath);\n }\n return normalized;\n}\n\nexport async function loadPackageCompanionExport<T>(\n packageRoot: string,\n subpath: string = PACKAGE_COMPANION_SUBPATH,\n options?: LoadConfigOptions,\n): Promise<T> {\n /*\n * The REAL path, as Node resolves a linked package (#2038). pnpm installs an injected or workspace package into an\n * importer's `node_modules` as a symlink to its virtual-store copy, and that copy's own dependencies sit beside it\n * there (`.pnpm/<key>/node_modules/…`), not in the importer's `node_modules`. jiti resolves a bare import from the path\n * it was handed, so the symlinked root found a dependency only when the importer happened to declare it too — the\n * catalogue's `@wildo-ai/external-connectors-public/companion` import (#1700) was the first one the backend did not,\n * and every `wildo config sync` of Wonder Todos then refused its ten catalogue providers as uncontributed.\n * A root that is not a link is its own real path, so runtime owners are unchanged.\n */\n const realPackageRoot = realpathSync(packageRoot);\n const moduleResolution = options?.moduleResolution\n ?? inferPackageCompanionModuleResolution(realPackageRoot);\n /*\n * A FRESH read evaluates the package's AUTHORED source, never its compiled `dist`, in every application.\n *\n * jiti does not transpile an ESM `.js` file in a `\"type\": \"module\"` package: it hands it to Node's native\n * `import()` (`[jiti] [native] [import]` under JITI_DEBUG), whatever `moduleCache: false` says. Node's ESM registry\n * is process-global and cannot be invalidated, so the first evaluation of `dist/esm/companion-exports.js` and of\n * every relative module it imports is the only one the process ever sees. `freshModuleCache` was therefore inert\n * for every package resolved through `exports`, which is every application OUTSIDE the framework workspace\n * (`inferPackageCompanionModuleResolution` answers `package` there). Inside the workspace, `framework-source`\n * picked `src/companion-exports.ts`, which jiti transpiles and does re-read — so the dogfood applications under\n * `examples/` showed it working and nothing else did.\n *\n * Measured 2026-10-01 on an application created with the published 1.1.8 CLI: creator answers landed in\n * `specifications/src/creator-inputs/index.ts`, the watcher rebuilt `dist` a second later, and the running\n * companion kept reading the creator-inputs it saw at startup. Every answer saved through the dossier then\n * re-landed the file from that stale read, so each save kept only its own answer, and the 16 answers written by\n * hand were invisible until a restart. Reproduced in isolation: a changed `dist` entry, loaded again with\n * `freshModuleCache: true`, returns the first evaluation; a changed `.ts` entry returns the new one.\n *\n * Reading source is also what the writers write: a landing writes `src/`, so a read-modify-write that read `dist`\n * raced the watcher even in a process with a fresh registry. Only the package's OWN modules gain this; a bare\n * import into another package (`@app/shared-lib`) still loads that package's compiled build natively. Keeping\n * that build fresh is the caller's concern: the dev companion re-tags those URLs per build\n * (`application-module-generations.companion.ts`, #2125).\n */\n const entryPath = resolvePackageCompanionEntryPath(realPackageRoot, subpath, {\n moduleResolution,\n preferAuthoredSource: options?.freshModuleCache === true,\n });\n return loadConfig<T>(entryPath, {\n ...options,\n moduleResolution,\n });\n}\n\nfunction resolvePlatformConfigLibEntry(startDirectory: string): string {\n const packageRoot = resolveCurrentPackageRoot(startDirectory);\n const configAuthoringEntry = join(packageRoot, 'src', 'config-authoring.entry.ts');\n if (existsSync(configAuthoringEntry)) {\n return configAuthoringEntry;\n }\n const sourceEntry = join(packageRoot, 'src', 'index.ts');\n if (existsSync(sourceEntry)) {\n return sourceEntry;\n }\n\n return join(packageRoot, 'dist', 'esm', 'index.js');\n}\n\nfunction resolveCurrentPackageRoot(startDirectory: string): string {\n let currentDirectory = startDirectory;\n\n while (true) {\n if (existsSync(join(currentDirectory, 'package.json'))) {\n return currentDirectory;\n }\n\n const parentDirectory = dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n break;\n }\n currentDirectory = parentDirectory;\n }\n\n return startDirectory;\n}\n\nfunction tryResolveLoaderWorkspaceRoot(startDirectory: string): string | undefined {\n let currentDirectory = startDirectory;\n\n while (true) {\n if (existsSync(join(currentDirectory, FRAMEWORK_WORKSPACE_MARKER_FILE))) {\n return currentDirectory;\n }\n\n const parentDirectory = dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n break;\n }\n currentDirectory = parentDirectory;\n }\n\n return undefined;\n}\n\n/**\n * Resolve the framework workspace root when framework-source module\n * resolution is explicitly requested.\n */\nfunction resolveLoaderWorkspaceRoot(startDirectory: string): string {\n const workspaceRoot = tryResolveLoaderWorkspaceRoot(startDirectory);\n if (workspaceRoot) {\n return workspaceRoot;\n }\n\n throw new Error(\n 'Could not locate the Wildo framework workspace root from the config loader.\\n'\n + ` Expected marker: \"${FRAMEWORK_WORKSPACE_MARKER_FILE}\"\\n`\n + ` Walked up from: \"${startDirectory}\"\\n\\n`\n + ` Fix: commit \"${FRAMEWORK_WORKSPACE_MARKER_FILE}\" at the root of the framework checkout `\n + 'that owns \"@wildo-ai/platform-config-lib\". The file is the authoritative signal '\n + 'used to anchor the loader\\'s \"~wildo-*\" jiti aliases — generic markers like '\n + '\"pnpm-workspace.yaml\" are intentionally NOT accepted because they can match an '\n + 'unrelated workspace and silently misroot alias targets.',\n );\n}\n\nfunction buildLoaderAliases(input: {\n frameworkWorkspaceRoot?: string;\n moduleResolution: ConfigModuleResolution;\n platformConfigLibEntry: string;\n}): Record<string, string> {\n const platformConfigLibPackageRoot = resolveCurrentPackageRoot(dirname(input.platformConfigLibEntry));\n if (input.moduleResolution === ConfigModuleResolution.LOADER_INSTANCES) {\n return buildLoaderInstanceAliases(platformConfigLibPackageRoot);\n }\n const aliases = buildDeclaredPackageSourceAliases(\n platformConfigLibPackageRoot,\n '.',\n input.platformConfigLibEntry,\n );\n if (input.moduleResolution !== ConfigModuleResolution.FRAMEWORK_SOURCE || !input.frameworkWorkspaceRoot) {\n return aliases;\n }\n\n const workspaceRoot = input.frameworkWorkspaceRoot;\n return {\n ...aliases,\n '@wildo-ai/external-connectors-public/app': resolve(\n workspaceRoot,\n 'engine/external-connectors-public/src/app/index.ts',\n ),\n '@wildo-ai/external-connectors-public/techdoc': resolve(\n workspaceRoot,\n 'engine/external-connectors-public/src/techdoc/index.ts',\n ),\n '@wildo-ai/external-connectors-public/website': resolve(\n workspaceRoot,\n 'engine/external-connectors-public/src/website/index.ts',\n ),\n ...buildDeclaredPackageSourceAliases(workspaceRoot, 'engine/external-connectors-models'),\n ...buildDeclaredPackageSourceAliases(workspaceRoot, 'engine/saas-backend-lib'),\n '@wildo-ai/platform-core-shared': resolve(\n workspaceRoot,\n 'platform/platform-core/platform-core-shared/src/index.ts',\n ),\n '@wildo-ai/platform-core-backend': resolve(\n workspaceRoot,\n 'platform/platform-core/platform-core-backend/src/index.ts',\n ),\n '@wildo-ai/platform-shared-lib': resolve(\n workspaceRoot,\n 'platform/platform-back-office/platform-shared-lib/src/index.ts',\n ),\n '@wildo-ai/zod-decorators': resolve(\n workspaceRoot,\n 'engine/zod-decorators/src/index.ts',\n ),\n ...buildDeclaredPackageSourceAliases(workspaceRoot, 'engine/saas-models'),\n ...buildDeclaredPackageSourceAliases(\n workspaceRoot,\n 'engine/saas-technical-doc',\n 'engine/saas-technical-doc/src/index.ts',\n ),\n ...buildDeclaredPackageSourceAliases(\n workspaceRoot,\n 'engine/saas-website',\n 'engine/saas-website/src/config/index.ts',\n ),\n '~wildo-backend-lib': resolve(workspaceRoot, 'engine/saas-backend-lib/src'),\n '~wildo-connectors': resolve(workspaceRoot, 'engine/external-connectors/src'),\n '~wildo-connectors-models': resolve(workspaceRoot, 'engine/external-connectors-models/src'),\n '~wildo-models': resolve(workspaceRoot, 'engine/saas-models/src'),\n '~wildo-zod': resolve(workspaceRoot, 'engine/zod-decorators/src'),\n };\n}\n\n/**\n * Build source-first aliases from one framework package's declared public\n * exports.\n *\n * jiti treats alias keys as prefixes rather than Node-style exact package\n * identities. Hand-authoring only the package root therefore corrupts every\n * semantic entrypoint: `@scope/package/subpath` becomes\n * `<package>/src/index.ts/subpath`. Deriving the aliases from `exports.*.source`\n * keeps the loader aligned with the package's public contract, and sorting by\n * specificity guarantees a subpath wins before its root prefix.\n *\n * `rootSourceOverride` preserves the deliberately narrower source root used by\n * packages whose normal root is unsuitable for config evaluation. Subpaths\n * still come from their declared `source` conditions.\n */\nfunction buildDeclaredPackageSourceAliases(\n workspaceRoot: string,\n packageRelativeRoot: string,\n rootSourceOverride?: string,\n): Record<string, string> {\n const packageRoot = resolve(workspaceRoot, packageRelativeRoot);\n const packageJsonPath = join(packageRoot, 'package.json');\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as {\n name?: string;\n exports?: Record<string, string | { source?: string }>;\n };\n if (!packageJson.name) {\n throw new Error(`Framework package at \"${packageRoot}\" has no package name.`);\n }\n\n const entries: Array<readonly [string, string]> = [];\n for (const [exportKey, exportValue] of Object.entries(packageJson.exports ?? {})) {\n const declaredSource = exportValue !== null && typeof exportValue === 'object'\n ? exportValue.source\n : undefined;\n const sourcePath = exportKey === '.' && rootSourceOverride\n ? resolve(workspaceRoot, rootSourceOverride)\n : declaredSource?.startsWith('./')\n ? resolve(packageRoot, declaredSource)\n : undefined;\n if (!sourcePath) {\n continue;\n }\n if (!isPathInsideRoot(sourcePath, packageRoot)) {\n throw new Error(`Framework package source export \"${exportKey}\" escapes \"${packageRoot}\".`);\n }\n\n const specifier = exportKey === '.'\n ? packageJson.name\n : `${packageJson.name}/${exportKey.slice(2)}`;\n entries.push([specifier, sourcePath]);\n }\n\n if (rootSourceOverride && !entries.some(([specifier]) => specifier === packageJson.name)) {\n const sourcePath = resolve(workspaceRoot, rootSourceOverride);\n if (!isPathInsideRoot(sourcePath, packageRoot)) {\n throw new Error(`Framework package root override escapes \"${packageRoot}\".`);\n }\n entries.push([packageJson.name, sourcePath]);\n }\n\n entries.sort(([left], [right]) => right.length - left.length || left.localeCompare(right));\n return Object.fromEntries(entries);\n}\n\n/**\n * The aliases of {@link ConfigModuleResolution.LOADER_INSTANCES} (#3440): this package, and every `@wildo-ai/*` package it\n * depends on, mapped subpath by subpath to the built file its `import` condition names, in the copy THIS package\n * resolves. Those files are plain ES modules, which jiti hands to Node's own `import` rather than transpiling, so a\n * process that already runs this package (the CLI does) gets back the modules it holds: evaluating a configuration\n * costs only the configuration's own modules.\n *\n * ## Why it exists\n *\n * In a framework checkout `framework-source` evaluates every framework package a configuration imports from SOURCE,\n * through jiti, beside the built copy the calling process already runs. Measured on Wonder Todos (2026-11-06):\n * `wildo.saas.config.ts` imports enums from `@wildo-ai/saas-models` and `@wildo-ai/external-connectors-models`, and\n * that evaluation transpiled 533 `saas-models` modules and kept 351 MB of heap, 1.9 s, to answer which services the\n * application declares. With these aliases the same read keeps 7 MB, 0.1 s. One copy of each framework package per\n * thread is also what keeps a caller's own `instanceof` and zod schemas meeting the configuration's (#2598).\n *\n * ## What it does not cover\n *\n * - A framework package this package does not depend on (`@wildo-ai/saas-backend-lib`, imported by a backend\n * configuration) resolves from the configuration's own location, as in `package` mode: its installed build.\n * - A package with ANY declared built file absent (an unbuilt checkout, or a watcher mid-emit that has written the root\n * but not a new subpath yet) gets no alias at all, so the whole package resolves as in `package` mode. Aliasing only\n * the files that exist would be worse than none: jiti matches an alias key as a prefix at a `/`, so a missing\n * subpath would be rewritten onto the root's FILE (`…/index.js/<subpath>`) and fail as a module that does not exist.\n * - A process running this package from SOURCE (a test runner) holds the source modules, not the build these aliases\n * name, so there the configuration gets one more copy: correct, just not shared.\n *\n * Rejected: making this the default for one-shot readers. A reader that relies on `framework-source` to see a framework\n * edit before its watcher has rebuilt (the dev companion's source-first discovery) would silently read the build.\n * Choosing it is the caller's statement that the build its own process runs is the framework it means.\n *\n * Exported so the aliases can be pinned against a fixture package; nothing else should call it.\n */\nexport function buildLoaderInstanceAliases(loaderPackageRoot: string): Record<string, string> {\n const loaderPackageJsonPath = join(loaderPackageRoot, 'package.json');\n const loaderPackageJson = JSON.parse(readFileSync(loaderPackageJsonPath, 'utf8')) as {\n name?: string;\n dependencies?: Record<string, string>;\n peerDependencies?: Record<string, string>;\n };\n const packageRoots = new Map<string, string>();\n if (loaderPackageJson.name) packageRoots.set(loaderPackageJson.name, loaderPackageRoot);\n for (const dependency of Object.keys({ ...loaderPackageJson.peerDependencies, ...loaderPackageJson.dependencies })) {\n if (!dependency.startsWith(FRAMEWORK_PACKAGE_SCOPE) || packageRoots.has(dependency)) continue;\n let dependencyPackageJsonPath: string | undefined;\n try {\n // ESM resolution from this package, as its own `import` statements resolve the dependency.\n dependencyPackageJsonPath = findPackageJSON(dependency, pathToFileURL(loaderPackageJsonPath));\n } catch {\n dependencyPackageJsonPath = undefined;\n }\n if (dependencyPackageJsonPath !== undefined) packageRoots.set(dependency, dirname(dependencyPackageJsonPath));\n }\n\n const entries: Array<readonly [string, string]> = [];\n for (const [packageName, packageRoot] of packageRoots) {\n const packageJson = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8')) as {\n exports?: Record<string, string | { import?: unknown; default?: unknown }>;\n };\n const packageEntries: Array<readonly [string, string]> = [];\n let everyBuiltFileExists = true;\n for (const [exportKey, exportValue] of Object.entries(packageJson.exports ?? {})) {\n const builtFile = typeof exportValue === 'string'\n ? exportValue\n : typeof exportValue?.import === 'string'\n ? exportValue.import\n : typeof exportValue?.default === 'string' ? exportValue.default : undefined;\n if (builtFile === undefined || !builtFile.startsWith('./')) continue;\n const builtPath = resolve(packageRoot, builtFile);\n if (!isPathInsideRoot(builtPath, packageRoot)) {\n throw new Error(`Framework package export \"${exportKey}\" of \"${packageName}\" escapes \"${packageRoot}\".`);\n }\n if (!existsSync(builtPath)) {\n everyBuiltFileExists = false;\n break;\n }\n packageEntries.push([exportKey === '.' ? packageName : `${packageName}/${exportKey.slice(2)}`, builtPath]);\n }\n if (everyBuiltFileExists) entries.push(...packageEntries);\n }\n // jiti matches alias keys as prefixes, so a subpath must be tried before its package root.\n entries.sort(([left], [right]) => right.length - left.length || left.localeCompare(right));\n return Object.fromEntries(entries);\n}\n\n/** The scope every framework package is published under. */\nconst FRAMEWORK_PACKAGE_SCOPE = '@wildo-ai/';\n\nfunction inferPackageCompanionModuleResolution(\n packageRoot: string,\n): ConfigModuleResolution {\n return inferConfigModuleResolution(packageRoot, dirname(fileURLToPath(import.meta.url)));\n}\n\nfunction inferConfigModuleResolution(\n targetPath: string,\n loaderModuleDirectory: string,\n): ConfigModuleResolution {\n const frameworkWorkspaceRoot = tryResolveLoaderWorkspaceRoot(loaderModuleDirectory);\n if (!frameworkWorkspaceRoot) {\n return ConfigModuleResolution.PACKAGE;\n }\n return isPathInsideRoot(targetPath, frameworkWorkspaceRoot)\n ? ConfigModuleResolution.FRAMEWORK_SOURCE\n : ConfigModuleResolution.PACKAGE;\n}\n\nfunction isPathInsideRoot(pathToCheck: string, root: string): boolean {\n const relativePath = relative(resolve(root), resolve(pathToCheck));\n return relativePath === ''\n || (!relativePath.startsWith('..') && !relativePath.startsWith(`..${requirePathSeparator()}`));\n}\n\nfunction requirePathSeparator(): string {\n return process.platform === 'win32' ? '\\\\' : '/';\n}\n\n/**\n * Load a `wildo.saas.config.ts` file.\n * Returns `null` if the file doesn't exist (non-throwing variant for optional loading).\n */\nexport async function loadSaasConfig(filePath: string, options?: LoadConfigOptions): Promise<WildoSaasConfig | null> {\n const absolutePath = resolve(filePath);\n if (!existsSync(absolutePath)) return null;\n return loadConfig<WildoSaasConfig>(absolutePath, options);\n}\n\n/**\n * Where an application authors one environment's infra config: `<infrastructure home>/<env>/wildo.infra.<local|remote>.config.ts`.\n *\n * ONE rule, shared by every reader. It lived as a private helper in the CLI and was copied twice more inside it\n * (frontend publish, CSP sync); the dev companion needs it too, to read the application's declared store, so it moved\n * here beside {@link loadSaasConfig}.\n */\nexport function resolveInfraEnvConfigPath(saasRoot: string, envName: string): string {\n return join(\n resolveAppLayout(saasRoot).authoredInfrastructureHome,\n envName,\n envName === 'local' ? 'wildo.infra.local.config.ts' : 'wildo.infra.remote.config.ts',\n );\n}\n\n/**\n * Load one environment's authored `wildo.infra.<env>.config.ts`. Returns `null` when the file does not exist.\n *\n * Refuses a file whose authored `environment` is not the directory it sits in: reading `local`'s file for `staging`\n * would hand one environment another's topology, silently.\n *\n * `freshModuleCache` re-evaluates the file instead of serving jiti's process-wide module cache. A short-lived CLI\n * does not need it; a long-lived reader whose question is \"what does the file say NOW\" does — the dev companion\n * reads the application's declared store through here, and a cached evaluation would keep answering with the\n * store the file declared when the process first read it (see {@link LoadConfigOptions.freshModuleCache}).\n *\n * `moduleResolution` decides how the file's own imports are evaluated (see {@link LoadConfigOptions.moduleResolution}),\n * for the application's descriptor and, when it is hosted, for its host's alike. Omitted, the loader infers it.\n */\nexport async function loadInfraEnvConfig(\n saasRoot: string,\n envName: string,\n options?: Pick<LoadConfigOptions, 'freshModuleCache' | 'moduleResolution'>,\n): Promise<{ path: string; config: WildoInfraEnvConfig } | null> {\n const authored = await loadAuthoredInfraEnvConfigFile(saasRoot, envName, options);\n if (authored === null) return null;\n if (!isHostedInfraEnvConfig(authored.config)) {\n return { path: authored.path, config: authored.config };\n }\n\n /*\n * VALIDATE the hosted descriptor before trusting any of it. `defineHostedInfraEnvConfig` parses it, but this\n * loader also evaluates plain `export default {…}` objects — and an unvalidated `backingServices.postgresql.host`\n * would override the HOST's server in the merge, which is precisely the divergence hosting exists to make\n * impossible. A host-owned member (`runtime`, `database`, …) is refused here too, by name, instead of being\n * silently dropped.\n */\n const hostedParse = WildoHostedInfraEnvConfigSchema.safeParse(authored.config);\n if (!hostedParse.success) {\n throw new Error(`${authored.path} is a hosted environment descriptor and is invalid:\\n`\n + hostedParse.error.issues.map((issue) => ` - ${issue.path.join('.') || '(root)'}: ${issue.message}`).join('\\n'));\n }\n const hostedDescriptor = hostedParse.data;\n\n /*\n * A HOSTED descriptor resolves here and nowhere else. This is the one function that holds both the\n * application root and the environment name, and every reader of an application's infra descriptor\n * reaches it — so the host's platform is merged in once, and no consumer can see a hosted descriptor\n * that has not been resolved.\n */\n const declaredHostRoot = hostedDescriptor.infrastructureHost.applicationRoot;\n const hostApplicationRoot = resolve(saasRoot, declaredHostRoot);\n if (isSameDirectory(hostApplicationRoot, saasRoot)) {\n throw new Error(`${authored.path} declares itself as its own infrastructureHost ('${declaredHostRoot}'). `\n + 'Remove infrastructureHost: an application that owns its infrastructure declares it standalone.');\n }\n if (!existsSync(join(hostApplicationRoot, AUTHORED_CONFIG_FILE_NAMES.SAAS))) {\n throw new Error(`${authored.path} runs on the infrastructure of '${declaredHostRoot}', which resolves to `\n + `${hostApplicationRoot} — and no Wildo application is there (no ${AUTHORED_CONFIG_FILE_NAMES.SAAS}). A hosted application `\n + 'needs its host\\'s SOURCE: check the host application out at that path, or remove infrastructureHost to run this '\n + 'application on its own infrastructure.');\n }\n const host = await loadAuthoredInfraEnvConfigFile(hostApplicationRoot, envName, options);\n if (host === null) {\n throw new Error(`${authored.path} runs on the infrastructure of ${hostApplicationRoot} for environment '${envName}', but that `\n + `application has no descriptor for it (expected ${resolveInfraEnvConfigPath(hostApplicationRoot, envName)}). The host `\n + 'owns the platform per environment, so it must describe this one.');\n }\n\n return {\n path: authored.path,\n config: resolveHostedInfraEnvConfig({\n hosted: hostedDescriptor,\n hostedConfigPath: authored.path,\n host: host.config,\n hostApplicationRoot,\n hostConfigPath: host.path,\n }),\n };\n}\n\n/**\n * Whether two paths name the same directory. Compared through `realpath` when both exist, so a symlinked\n * `applicationRoot` pointing back at the application itself is still recognised as self-hosting; falls\n * back to lexical resolution when either path does not exist yet.\n */\nfunction isSameDirectory(a: string, b: string): boolean {\n try {\n return realpathSync(a) === realpathSync(b);\n } catch {\n return resolve(a) === resolve(b);\n }\n}\n\n/**\n * Evaluate one application's descriptor AS AUTHORED — standalone or hosted, unresolved. Private: a hosted\n * descriptor is not an environment until {@link loadInfraEnvConfig} merges its host in.\n *\n * The host's file is evaluated with the HOST as artifact owner, so its jiti cache lives beside its own\n * application rather than inside the hosted one's.\n */\nasync function loadAuthoredInfraEnvConfigFile(\n saasRoot: string,\n envName: string,\n options?: Pick<LoadConfigOptions, 'freshModuleCache' | 'moduleResolution'>,\n): Promise<{ path: string; config: WildoAuthoredInfraEnvConfig } | null> {\n const path = resolveInfraEnvConfigPath(saasRoot, envName);\n if (!existsSync(path)) return null;\n const config = await loadConfig<WildoAuthoredInfraEnvConfig>(resolve(path), {\n artifactLocation: { zone: ConfigArtifactsZone.SAAS, ownerRoot: saasRoot },\n ...(options?.freshModuleCache === true ? { freshModuleCache: true } : {}),\n ...(options?.moduleResolution === undefined ? {} : { moduleResolution: options.moduleResolution }),\n });\n if (config.environment !== envName) {\n throw new Error(`Authored env descriptor mismatch: directory '${envName}' does not match authored environment '${config.environment}'.`);\n }\n return { path, config };\n}\n\n/**\n * Per-folder file name for a minion config (`wildo.minion.config.ts`).\n *\n * Co-located inside the minion's directory referenced by\n * `wildo.saas.config.ts > minions.<key>.path` — the loader resolves\n * `<saasRoot>/<entry.path>/wildo.minion.config.ts` exactly the same\n * way the existing tech-doc / website per-service loaders resolve\n * their authoring files.\n */\nexport const MINION_CONFIG_FILENAME = 'wildo.minion.config.ts';\n\n/**\n * Per-folder file name for a worker config (`wildo.worker.config.ts`).\n */\nexport const WORKER_CONFIG_FILENAME = 'wildo.worker.config.ts';\n\n/**\n * Result entry for `loadMinionConfigs` / `loadWorkerConfigs`.\n *\n * Carries the bucket key (the name authored under\n * `wildo.saas.config.ts > minions / workers`), the absolute path the\n * config was resolved from, and the parsed value. Returning the\n * absolute path alongside the parsed config lets callers (Phase 2 /\n * Phase 3 manifest emitters) build deterministic error messages\n * without re-deriving the path themselves.\n */\nexport interface PerFolderConfigEntry<T> {\n /** Bucket key from `wildo.saas.config.ts > minions / workers`. */\n key: string;\n /** Absolute path the config was loaded from. */\n absolutePath: string;\n /** Parsed config (Zod-validated). */\n config: T;\n}\n\n/**\n * Load every `wildo.minion.config.ts` referenced by `saasConfig.minions`.\n *\n * Phase 1 contract: this returns a typed list of entries; Phase 2's\n * `start-minion-application` consumes it to build the per-minion DI\n * container and to cross-validate `resourceAccess` against the parsed\n * resource catalog (IC-2). Missing files throw with the offending\n * bucket key in the error message — silently skipping would mask a\n * mistyped `path:` field.\n */\nexport async function loadMinionConfigs(\n saasRoot: string,\n saasConfig: WildoSaasConfig,\n options?: LoadConfigOptions,\n): Promise<PerFolderConfigEntry<WildoMinionConfig>[]> {\n return loadPerFolderConfigs<WildoMinionConfig>(\n saasRoot,\n saasConfig.minions ?? {},\n MINION_CONFIG_FILENAME,\n 'minion',\n options,\n );\n}\n\n/**\n * Load every `wildo.worker.config.ts` referenced by `saasConfig.workers`.\n *\n * Phase 1 contract identical to `loadMinionConfigs` — Phase 3's K8s\n * manifest emitter consumes it to project `replicas`, `http.port`,\n * health/ready paths into Deployment + Service manifests.\n */\nexport async function loadWorkerConfigs(\n saasRoot: string,\n saasConfig: WildoSaasConfig,\n options?: LoadConfigOptions,\n): Promise<PerFolderConfigEntry<WildoWorkerConfig>[]> {\n return loadPerFolderConfigs<WildoWorkerConfig>(\n saasRoot,\n saasConfig.workers ?? {},\n WORKER_CONFIG_FILENAME,\n 'worker',\n options,\n );\n}\n\nasync function loadPerFolderConfigs<T>(\n saasRoot: string,\n bucket: Record<string, { path: string }>,\n filename: string,\n kindLabel: 'minion' | 'worker',\n options?: LoadConfigOptions,\n): Promise<PerFolderConfigEntry<T>[]> {\n const absoluteSaasRoot = resolve(saasRoot);\n const entries = Object.entries(bucket);\n\n const out: PerFolderConfigEntry<T>[] = [];\n for (const [key, ref] of entries) {\n const absolutePath = resolve(absoluteSaasRoot, ref.path, filename);\n if (!existsSync(absolutePath)) {\n throw new Error(\n `Could not find ${kindLabel} config for '${key}': ${absolutePath} does not exist.\\n`\n + ` Authored at: wildo.saas.config.ts > ${kindLabel}s.${key}.path = '${ref.path}'\\n`\n + ` Expected file: ${filename}\\n`\n + ` Either create the file or remove the bucket entry.`,\n );\n }\n const config = await loadConfig<T>(absolutePath, options);\n out.push({ key, absolutePath, config });\n }\n return out;\n}\n\n/**\n * Load the framework-scoped `wildo.framework.config.ts` file.\n * Returns `null` if the file does not exist.\n */\nexport async function loadFrameworkConfig(\n frameworkRoot: string,\n options?: Omit<LoadConfigOptions, 'artifactLocation'>,\n): Promise<WildoFrameworkConfig | null> {\n const filePath = resolveFrameworkLayout(frameworkRoot).declarationConfigPath;\n const absolutePath = resolve(filePath);\n if (!existsSync(absolutePath)) return null;\n\n return loadConfig<WildoFrameworkConfig>(absolutePath, {\n ...options,\n artifactLocation: {\n zone: ConfigArtifactsZone.FRAMEWORK,\n ownerRoot: frameworkRoot,\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type MinionLiveness } from './define-minion-config';
|
|
2
|
+
/**
|
|
3
|
+
* # Minion liveness: the ONE source both the probe and the heartbeat are derived from
|
|
4
|
+
*
|
|
5
|
+
* A minion has no inbound HTTP surface, so its Kubernetes liveness probe cannot be an `httpGet` the way a
|
|
6
|
+
* backend's `/health` or a worker's `/healthz` is. For `liveness.kind: 'file'` (the default) the contract is a
|
|
7
|
+
* HEARTBEAT FILE: the minion runtime writes it while its work loop is alive, and an `exec` probe reads it.
|
|
8
|
+
*
|
|
9
|
+
* Until #1859 the two halves had no common source and the producer did not exist at all: the schema promised
|
|
10
|
+
* the actor loop "touches" the file, the k8s renderer built a `find <file> -mmin -1.5` probe from two
|
|
11
|
+
* hard-coded fallbacks, and nothing in `@wildo-ai/saas-minions-lib` ever wrote the file. Every minion deployed
|
|
12
|
+
* from the generated manifests therefore failed its probe and was restarted by the kubelet forever. Everything
|
|
13
|
+
* the probe and the writer must agree on now lives here:
|
|
14
|
+
*
|
|
15
|
+
* | what | consumed by |
|
|
16
|
+
* |---|---|
|
|
17
|
+
* | the probe command ({@link buildMinionLivenessProbeCommand}) | the k8s `livenessProbe` / `startupProbe`, the compose `healthcheck` |
|
|
18
|
+
* | the probe cadence ({@link deriveMinionLivenessProbeTiming}) | the same three probe declarations |
|
|
19
|
+
* | the heartbeat env ({@link buildMinionLivenessHeartbeatEnv}) | the k8s `env:` block and the compose `environment:` block |
|
|
20
|
+
* | the heartbeat format ({@link encodeMinionLivenessHeartbeat}) | the writer in `@wildo-ai/saas-minions-lib` |
|
|
21
|
+
*
|
|
22
|
+
* ## Why a file the probe READS, rather than a file whose mtime it checks
|
|
23
|
+
*
|
|
24
|
+
* The heartbeat file holds the writer's own clock in whole epoch seconds, and the probe compares it with
|
|
25
|
+
* `date +%s`. The previous probe asked `find <file> -mmin -1.5`. A fractional `-mmin` is a GNU findutils
|
|
26
|
+
* feature; whether the BusyBox `find` in the `node:*-alpine` minion images accepts it was never executed
|
|
27
|
+
* (believed not to), and a probe whose meaning depends on which `find` the image ships cannot be tested off the
|
|
28
|
+
* image. `cat`, `date +%s`, `case` and POSIX `$(( ))` arithmetic are POSIX shell and utilities, which is also
|
|
29
|
+
* what lets the framework EXECUTE the rendered command in its own tests (macOS `/bin/sh`; the BusyBox `ash` run
|
|
30
|
+
* is a stack-check item on #2035).
|
|
31
|
+
*
|
|
32
|
+
* ## Why not an `httpGet` or a `tcpSocket` probe
|
|
33
|
+
*
|
|
34
|
+
* Rejected: a minion would have to open a listening port it otherwise has no reason for, and a network
|
|
35
|
+
* listener answers as long as the event loop runs, whether or not the minion can still receive work. The
|
|
36
|
+
* heartbeat is written only while the tick consumer is subscribed AND the broker connection is up (see
|
|
37
|
+
* `MinionLivenessHeartbeat` in the minion runtime), which is the thing liveness has to mean here. The
|
|
38
|
+
* `exec` kind stays available for a minion that owns a richer check.
|
|
39
|
+
*
|
|
40
|
+
* ## How the cadence relates to the heartbeat, and why a long tick is safe
|
|
41
|
+
*
|
|
42
|
+
* - `periodSeconds` IS `heartbeat.intervalSec`: probing more often than the file can change only multiplies
|
|
43
|
+
* `exec` cost; probing less often only delays detection.
|
|
44
|
+
* - the probe fails once the heartbeat is `staleAfterSec` old (the schema enforces
|
|
45
|
+
* `staleAfterSec > heartbeat.intervalSec`, so one late write never fails it);
|
|
46
|
+
* - the kubelet restarts after `failureThreshold` consecutive failures, so a stopped loop is restarted
|
|
47
|
+
* `staleAfterSec + (failureThreshold - 1) × periodSeconds` after its last heartbeat, plus at most one
|
|
48
|
+
* period of phase ({@link MinionLivenessProbeTiming.restartAfterLastHeartbeatSec}). With the defaults:
|
|
49
|
+
* 90 + 2 × 30 = 150 s.
|
|
50
|
+
* - a tick handler runs DETACHED from the broker receipt (`ScheduledExecutionRunner.launch`) and the heartbeat
|
|
51
|
+
* is a timer, so a tick that runs for hours keeps the heartbeat fresh as long as it awaits I/O. Only a
|
|
52
|
+
* handler that blocks the event loop for longer than that window is restarted, which is what a liveness
|
|
53
|
+
* probe is for.
|
|
54
|
+
* - boot (the full backend initialization, the apps-manager fetch, the broker subscription) is covered by a
|
|
55
|
+
* `startupProbe` with the same command and a {@link MINION_LIVENESS_STARTUP_BUDGET_SEC} budget, the
|
|
56
|
+
* Kubernetes mechanism for a slow start. A fixed `initialDelaySeconds` would either kill a slow boot or
|
|
57
|
+
* delay detection of every hang for the whole life of the pod.
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* The environment variables that tell the minion runtime to write its heartbeat, and where and how often.
|
|
61
|
+
*
|
|
62
|
+
* Stamped by the CONTAINER renderers only (the k8s Deployment `env:` and the compose service `environment:`),
|
|
63
|
+
* both from {@link buildMinionLivenessHeartbeatEnv}. A minion run as a host process in local development gets
|
|
64
|
+
* neither and writes nothing, which is right: there is no probe to answer, and several host minions sharing
|
|
65
|
+
* one `/tmp` path would only overwrite each other.
|
|
66
|
+
*/
|
|
67
|
+
export declare const MINION_LIVENESS_HEARTBEAT_ENV_KEYS: {
|
|
68
|
+
readonly FILE_PATH: "WILDO_MINION_HEARTBEAT_FILE";
|
|
69
|
+
readonly INTERVAL_SEC: "WILDO_MINION_HEARTBEAT_INTERVAL_SEC";
|
|
70
|
+
};
|
|
71
|
+
/** Seconds the probe command may take. `cat` and `date` finish in milliseconds; this only bounds a wedged exec. */
|
|
72
|
+
export declare const MINION_LIVENESS_PROBE_TIMEOUT_SEC = 5;
|
|
73
|
+
/**
|
|
74
|
+
* Consecutive failed probes before a restart. The Kubernetes default, kept so that one slow `exec` under
|
|
75
|
+
* memory pressure does not restart a healthy minion; the stale window itself lives in `staleAfterSec`.
|
|
76
|
+
*/
|
|
77
|
+
export declare const MINION_LIVENESS_PROBE_FAILURE_THRESHOLD = 3;
|
|
78
|
+
/**
|
|
79
|
+
* How long a minion may take from container start to its first heartbeat before the `startupProbe` gives up.
|
|
80
|
+
* A minion boots the whole backend runtime and fetches its configuration from apps-manager before it
|
|
81
|
+
* subscribes, so this is minutes rather than the 60 s `initialDelaySeconds` it replaces.
|
|
82
|
+
*/
|
|
83
|
+
export declare const MINION_LIVENESS_STARTUP_BUDGET_SEC = 300;
|
|
84
|
+
/** The probe cadence every lane declares, derived from one parsed {@link MinionLiveness}. */
|
|
85
|
+
export interface MinionLivenessProbeTiming {
|
|
86
|
+
/** = `heartbeat.intervalSec`. */
|
|
87
|
+
periodSeconds: number;
|
|
88
|
+
timeoutSeconds: number;
|
|
89
|
+
failureThreshold: number;
|
|
90
|
+
/** `startupProbe.failureThreshold`: enough periods to cover {@link MINION_LIVENESS_STARTUP_BUDGET_SEC}. */
|
|
91
|
+
startupFailureThreshold: number;
|
|
92
|
+
/** Upper bound, before phase, on the time from the last heartbeat to a restart. Documentation and tests. */
|
|
93
|
+
restartAfterLastHeartbeatSec: number;
|
|
94
|
+
}
|
|
95
|
+
/** The heartbeat the runtime is asked to write, as read back from its environment. */
|
|
96
|
+
export interface MinionLivenessHeartbeatSettings {
|
|
97
|
+
filePath: string;
|
|
98
|
+
intervalSec: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The parsed liveness contract, or the schema's own defaults when a caller has none. Never a second set of
|
|
102
|
+
* literals: a renderer reached with a partially-populated target gets exactly what an authored-nothing
|
|
103
|
+
* `wildo.minion.config.ts` would have produced.
|
|
104
|
+
*/
|
|
105
|
+
export declare function resolveMinionLiveness(liveness?: MinionLiveness): MinionLiveness;
|
|
106
|
+
/**
|
|
107
|
+
* The probe command: an argv for an `exec` probe, `exit 0` = alive.
|
|
108
|
+
*
|
|
109
|
+
* For `kind: 'file'` it succeeds only when the heartbeat file exists, holds a whole number of epoch seconds,
|
|
110
|
+
* and that number is less than `staleAfterSec` old. A missing file, an empty or half-written one, or any
|
|
111
|
+
* non-numeric content fails; the non-numeric check is load-bearing, because shell arithmetic reads an
|
|
112
|
+
* identifier as a variable that defaults to 0 instead of failing. For `kind: 'exec'` it is the authored
|
|
113
|
+
* command verbatim.
|
|
114
|
+
*/
|
|
115
|
+
export declare function buildMinionLivenessProbeCommand(input?: MinionLiveness): string[];
|
|
116
|
+
/** The cadence of the liveness probe, the startup probe and the compose healthcheck. See the module header. */
|
|
117
|
+
export declare function deriveMinionLivenessProbeTiming(input?: MinionLiveness): MinionLivenessProbeTiming;
|
|
118
|
+
/**
|
|
119
|
+
* The container environment that turns the heartbeat on. Empty for `kind: 'exec'`: that probe is the
|
|
120
|
+
* author's own, and a heartbeat nothing reads is a write for nobody.
|
|
121
|
+
*/
|
|
122
|
+
export declare function buildMinionLivenessHeartbeatEnv(input?: MinionLiveness): Record<string, string>;
|
|
123
|
+
/**
|
|
124
|
+
* Read the heartbeat settings back in the minion process. `undefined` when the file variable is absent (a
|
|
125
|
+
* host process, or an `exec`-kind minion). Throws on a present-but-malformed value: the probe would fail on it
|
|
126
|
+
* anyway, and a boot error naming the variable is far closer to the cause than a kubelet restart loop.
|
|
127
|
+
*/
|
|
128
|
+
export declare function readMinionLivenessHeartbeatEnv(env: Readonly<Record<string, string | undefined>>): MinionLivenessHeartbeatSettings | undefined;
|
|
129
|
+
/** The heartbeat file's content: the writer's clock in whole epoch seconds, the unit `date +%s` prints. */
|
|
130
|
+
export declare function encodeMinionLivenessHeartbeat(nowMs: number): string;
|
|
131
|
+
//# sourceMappingURL=minion-liveness.contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minion-liveness.contracts.d.ts","sourceRoot":"","sources":["../../../src/project-config/minion-liveness.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH;;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