@wildo-ai/platform-config-lib 1.0.1 → 1.1.0
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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/_unimplemented/index.d.ts +3 -0
- package/dist/esm/_unimplemented/index.d.ts.map +1 -0
- package/dist/esm/_unimplemented/index.js +3 -0
- package/dist/esm/_unimplemented/index.js.map +1 -0
- package/dist/esm/_unimplemented/soft-warn.d.ts +124 -0
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -0
- package/dist/esm/_unimplemented/soft-warn.js +170 -0
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +137 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +153 -0
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -0
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js +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 +13 -0
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js +14 -0
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -0
- package/dist/esm/bootstrap/bootstrap-planner.d.ts +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts +141 -37
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +104 -18
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +430 -421
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +383 -21
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +213 -8
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +230 -5
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +79 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.js +83 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -0
- package/dist/esm/bootstrap/runtime-network-policy.d.ts +63 -0
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-network-policy.js +104 -0
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -0
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +78 -0
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-network-topology.js +134 -0
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -0
- package/dist/esm/bootstrap/runtime-platform-access.d.ts +67 -0
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-platform-access.js +57 -0
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +173 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.js +218 -0
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +112 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js +141 -8
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts +3 -0
- package/dist/esm/config-authoring.entry.d.ts.map +1 -0
- package/dist/esm/config-authoring.entry.js +5 -0
- package/dist/esm/config-authoring.entry.js.map +1 -0
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +30 -15
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +16 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts +41 -0
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -0
- package/dist/esm/lockfile/canonical-json.js +56 -0
- package/dist/esm/lockfile/canonical-json.js.map +1 -0
- package/dist/esm/lockfile/lockfile-io.d.ts +231 -0
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -0
- package/dist/esm/lockfile/lockfile-io.js +303 -0
- package/dist/esm/lockfile/lockfile-io.js.map +1 -0
- package/dist/esm/lockfile/materialize-infra-section.d.ts +99 -0
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -0
- package/dist/esm/lockfile/materialize-infra-section.js +153 -0
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +522 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +116 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts +36 -10
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js +67 -3
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +570 -0
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -0
- package/dist/esm/project-config/define-infra-env-config.js +726 -0
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -0
- package/dist/esm/project-config/define-minion-config.d.ts +221 -23
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +228 -11
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +427 -218
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +704 -75
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts +106 -10
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js +99 -9
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +28 -21
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +14 -7
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts +120 -10
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +290 -38
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.d.ts +69 -0
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -0
- package/dist/esm/project-config/minion-local-provider-registration.js +72 -0
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.d.ts +12 -0
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.js +49 -0
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -0
- package/dist/esm/project-config/provider-companion-discovery.d.ts +24 -0
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -0
- package/dist/esm/project-config/provider-companion-discovery.js +244 -0
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -0
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +297 -0
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -0
- package/dist/esm/project-config/provider-runtime-artifacts.js +860 -0
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +18 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js +25 -0
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts +10 -2
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js +12 -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 +2 -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 +6 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +102 -0
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/auth.schemas.js +100 -0
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +316 -39
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +359 -24
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts +14 -0
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -0
- package/dist/esm/project-config/shared/cdn.example.js +38 -0
- package/dist/esm/project-config/shared/cdn.example.js.map +1 -0
- package/dist/esm/project-config/shared/cdn.schemas.d.ts +182 -0
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/cdn.schemas.js +151 -0
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/csp-defaults.d.ts +92 -0
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -0
- package/dist/esm/project-config/shared/csp-defaults.js +195 -0
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -0
- package/dist/esm/project-config/shared/csp-emit.d.ts +106 -0
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -0
- package/dist/esm/project-config/shared/csp-emit.js +305 -0
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -0
- package/dist/esm/project-config/shared/csp.schemas.d.ts +266 -0
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/csp.schemas.js +281 -0
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/data-services.schemas.d.ts +45 -9
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js +45 -9
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts +0 -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 +1 -2
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +134 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +185 -2
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +779 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.js +210 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts +18 -0
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/infra-service.schemas.js +16 -0
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +83 -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 +99 -2
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts +51 -7
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js +59 -12
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +31 -0
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -0
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +32 -0
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +142 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +159 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts +100 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.js +130 -0
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts +9 -14
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js +13 -9
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts +15 -0
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/schema-version.schemas.js +40 -0
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +283 -8
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js +325 -8
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts +54 -0
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -0
- package/dist/esm/registry/artifact-domain.schemas.js +40 -0
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -0
- package/dist/esm/registry/companion-api.schemas.d.ts +176 -0
- package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -0
- package/dist/esm/registry/companion-api.schemas.js +165 -0
- package/dist/esm/registry/companion-api.schemas.js.map +1 -0
- package/dist/esm/registry/digest.schemas.d.ts +20 -0
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -0
- package/dist/esm/registry/digest.schemas.js +21 -0
- package/dist/esm/registry/digest.schemas.js.map +1 -0
- package/dist/esm/registry/index.d.ts +33 -0
- package/dist/esm/registry/index.d.ts.map +1 -0
- package/dist/esm/registry/index.js +33 -0
- package/dist/esm/registry/index.js.map +1 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +107 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.js +67 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -0
- package/dist/esm/registry/module-artifact.schemas.d.ts +94 -0
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -0
- package/dist/esm/registry/module-artifact.schemas.js +69 -0
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -0
- package/dist/esm/registry/module-manifest.schemas.d.ts +134 -0
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -0
- package/dist/esm/registry/module-manifest.schemas.js +155 -0
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -0
- package/dist/esm/registry/registry-config.schemas.d.ts +31 -0
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -0
- package/dist/esm/registry/registry-config.schemas.js +24 -0
- package/dist/esm/registry/registry-config.schemas.js.map +1 -0
- package/dist/esm/registry/registry-defaults.constants.d.ts +37 -0
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -0
- package/dist/esm/registry/registry-defaults.constants.js +37 -0
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -0
- package/dist/esm/registry/registry-errors.d.ts +109 -0
- package/dist/esm/registry/registry-errors.d.ts.map +1 -0
- package/dist/esm/registry/registry-errors.js +185 -0
- package/dist/esm/registry/registry-errors.js.map +1 -0
- package/dist/esm/registry/registry-section-schemas.constants.d.ts +39 -0
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -0
- package/dist/esm/registry/registry-section-schemas.constants.js +22 -0
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -0
- package/dist/esm/release/framework-release.constants.d.ts +26 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js +27 -2
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +5 -5
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +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 +11 -2
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +7 -7
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js +17 -2
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts +12 -13
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js +15 -3
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts +26 -0
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -0
- package/dist/esm/workspace-scope/application-subject-manifest.js +43 -0
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -0
- package/dist/esm/workspace-scope/index.d.ts +5 -2
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js +4 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts +20 -0
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -0
- package/dist/esm/workspace-scope/resolve-homes.js +62 -0
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +211 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.js +113 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -0
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts +10 -5
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js +22 -36
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +147 -58
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js +174 -78
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +31 -17
- package/dist/esm/credentials/credentials-provisioner.service.d.ts +0 -190
- package/dist/esm/credentials/credentials-provisioner.service.d.ts.map +0 -1
- package/dist/esm/credentials/credentials-provisioner.service.js +0 -278
- package/dist/esm/credentials/credentials-provisioner.service.js.map +0 -1
- package/dist/esm/infra-managers/infra-manager.models.d.ts +0 -146
- package/dist/esm/infra-managers/infra-manager.models.d.ts.map +0 -1
- package/dist/esm/infra-managers/infra-manager.models.js +0 -2
- package/dist/esm/infra-managers/infra-manager.models.js.map +0 -1
- package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts +0 -64
- package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/mongo-atlas-manager.service.js +0 -307
- package/dist/esm/infra-managers/mongo-atlas-manager.service.js.map +0 -1
- package/dist/esm/infra-managers/postgresql-manager.service.d.ts +0 -115
- package/dist/esm/infra-managers/postgresql-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/postgresql-manager.service.js +0 -403
- package/dist/esm/infra-managers/postgresql-manager.service.js.map +0 -1
- package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts +0 -64
- package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/rabbitmq-manager.service.js +0 -288
- package/dist/esm/infra-managers/rabbitmq-manager.service.js.map +0 -1
- package/dist/esm/infra-managers/redis-manager.service.d.ts +0 -78
- package/dist/esm/infra-managers/redis-manager.service.d.ts.map +0 -1
- package/dist/esm/infra-managers/redis-manager.service.js +0 -326
- package/dist/esm/infra-managers/redis-manager.service.js.map +0 -1
- package/dist/esm/project-config/define-infra-config.d.ts +0 -128
- package/dist/esm/project-config/define-infra-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-infra-config.js +0 -87
- package/dist/esm/project-config/define-infra-config.js.map +0 -1
- package/dist/esm/project-config/define-platform-config.d.ts +0 -65
- package/dist/esm/project-config/define-platform-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-platform-config.js +0 -22
- package/dist/esm/project-config/define-platform-config.js.map +0 -1
- package/dist/esm/project-config/define-platform-env-config.d.ts +0 -41
- package/dist/esm/project-config/define-platform-env-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-platform-env-config.js +0 -45
- package/dist/esm/project-config/define-platform-env-config.js.map +0 -1
- package/dist/esm/project-config/define-project-config.d.ts +0 -38
- package/dist/esm/project-config/define-project-config.d.ts.map +0 -1
- package/dist/esm/project-config/define-project-config.js +0 -57
- package/dist/esm/project-config/define-project-config.js.map +0 -1
- package/dist/esm/project-config/define-sharing-policy.d.ts +0 -35
- package/dist/esm/project-config/define-sharing-policy.d.ts.map +0 -1
- package/dist/esm/project-config/define-sharing-policy.js +0 -30
- package/dist/esm/project-config/define-sharing-policy.js.map +0 -1
- package/dist/esm/project-config/sharing-policy-validation.d.ts +0 -40
- package/dist/esm/project-config/sharing-policy-validation.d.ts.map +0 -1
- package/dist/esm/project-config/sharing-policy-validation.js +0 -143
- package/dist/esm/project-config/sharing-policy-validation.js.map +0 -1
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts +0 -23
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts.map +0 -1
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js +0 -13
- package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js.map +0 -1
- package/src/bootstrap/application-backend-env.contracts.ts +0 -17
- package/src/bootstrap/bootstrap-planner.ts +0 -46
- package/src/bootstrap/bootstrap.contracts.ts +0 -251
- package/src/bootstrap/bootstrap.schemas.ts +0 -164
- package/src/bootstrap/platform-runtime-env.contracts.ts +0 -99
- package/src/bootstrap/runtime-topology.contracts.ts +0 -102
- package/src/credentials/credential-generator.service.ts +0 -39
- package/src/index.ts +0 -16
- package/src/project-config/__tests__/application-modules.utils.test.ts +0 -53
- package/src/project-config/__tests__/define-framework-config.test.ts +0 -43
- package/src/project-config/__tests__/define-saas-config.test.ts +0 -210
- package/src/project-config/__tests__/loader.test.ts +0 -100
- package/src/project-config/define-framework-config.ts +0 -44
- package/src/project-config/define-infra-config.ts +0 -168
- package/src/project-config/define-minion-config.ts +0 -27
- package/src/project-config/define-platform-config.ts +0 -28
- package/src/project-config/define-platform-env-config.ts +0 -59
- package/src/project-config/define-project-config.ts +0 -63
- package/src/project-config/define-saas-config.ts +0 -171
- package/src/project-config/define-sharing-policy.ts +0 -36
- package/src/project-config/define-worker-config.ts +0 -27
- package/src/project-config/index.ts +0 -23
- package/src/project-config/loader.ts +0 -220
- package/src/project-config/shared/application-modules.schemas.ts +0 -12
- package/src/project-config/shared/application-modules.utils.ts +0 -65
- package/src/project-config/shared/backing-services.schemas.ts +0 -59
- package/src/project-config/shared/data-services.schemas.ts +0 -58
- package/src/project-config/shared/env-example-defaults.ts +0 -50
- package/src/project-config/shared/environment.schemas.ts +0 -136
- package/src/project-config/shared/infrastructure-defaults.schemas.ts +0 -47
- package/src/project-config/shared/k8s-utils.ts +0 -56
- package/src/project-config/shared/platform-services.schemas.ts +0 -33
- package/src/project-config/shared/service-definitions.schemas.ts +0 -38
- package/src/project-config/sharing-policy-validation.ts +0 -159
- package/src/release/framework-release.constants.ts +0 -2
- package/src/schemas/__tests__/platform-config.schemas.test.ts +0 -90
- package/src/schemas/framework-info.schemas.ts +0 -13
- package/src/schemas/framework-secrets.schemas.ts +0 -19
- package/src/schemas/platform-application-config.schemas.ts +0 -25
- package/src/schemas/platform-application-secrets.schemas.ts +0 -78
- package/src/schemas/platform-config.schemas.ts +0 -45
- package/src/workspace-scope/index.ts +0 -2
- package/src/workspace-scope/workspace-scope-detector.ts +0 -98
- package/src/workspace-scope/workspace-scope.schemas.ts +0 -224
|
@@ -1,56 +1,165 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';
|
|
2
|
+
import { MinionPlatformAccessScope } from './shared/minion-platform-access.vocabulary.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
+
import { findMinionResourceAccessViolations } from './shared/minion-resource-access.validation.js';
|
|
5
|
+
import { AppFrontendType, ApplicationAiUsePostureSchema, ApplicationClientStorageInventorySchema, ApplicationOperatorComplianceIdentitySchema, ApplicationProviderComplianceChoicesSchema, ApplicationRetentionScheduleSchema, EngineCapability, EngineCapabilityResolutionMode, getEngineCapabilityResolutionMode, } from '@wildo-ai/saas-models';
|
|
6
|
+
import { BUILTIN_PROVIDER_CAPABILITY, BUILTIN_PROVIDER_PROTOCOL, } from '@wildo-ai/saas-models/public-runtime';
|
|
7
|
+
import { buildMinionServiceName, buildWorkerServiceName, normalizeServiceKeyToDnsName } from '@wildo-ai/platform-core-shared';
|
|
8
|
+
// Phase 0 of the provider-registration refactor — see
|
|
9
|
+
// `.cursor/plans/provider-registration-refactor-implementation-plan.md`
|
|
10
|
+
// §Phase 0.13. Imports are `import type` so the schema-only authoring
|
|
11
|
+
// in Phase 0 does not pull runtime code from the new packages.
|
|
12
|
+
import { UnimplementedFieldSource, createUnimplementedFieldWarner, } from '../_unimplemented/unimplemented-field-warning.js';
|
|
13
|
+
import { emitSoftWarn } from '../_unimplemented/soft-warn.js';
|
|
14
|
+
import { RegistryConfigSchema } from '../registry/registry-config.schemas.js';
|
|
4
15
|
import { AppDataServicesSchema } from './shared/data-services.schemas.js';
|
|
5
16
|
import { ApplicationModulesSchema } from './shared/application-modules.schemas.js';
|
|
6
|
-
import {
|
|
17
|
+
import { WildoSchemaVersionSchema } from './shared/schema-version.schemas.js';
|
|
18
|
+
import { AppLibraryDefinitionSchema, AppRefSchema, AppServiceDefinitionSchema, } from './shared/service-definitions.schemas.js';
|
|
7
19
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
+
* Per-minion resource access whitelist (KD-11 in
|
|
21
|
+
* `.cursor/plans/minions-and-workers-implementation.md`).
|
|
22
|
+
*
|
|
23
|
+
* Authored at the SaaS-config level (NOT inside `wildo.minion.config.ts`)
|
|
24
|
+
* because the resource catalog is owned by the application's
|
|
25
|
+
* `specifications` block — keeping the whitelist here ensures the
|
|
26
|
+
* single authoring surface for "what can each minion read / write?"
|
|
27
|
+
* lives next to "what services exist in this app?".
|
|
28
|
+
*
|
|
29
|
+
* Default semantics:
|
|
30
|
+
* - Field omitted → minion gets NO repository access (fail-closed).
|
|
31
|
+
* - `read: []` / `write: []` → explicit "no access" (same effect as omission,
|
|
32
|
+
* but documents intent).
|
|
33
|
+
* - `read: ['*']` → all readable resources (escape hatch — Phase 2's
|
|
34
|
+
* `MinionScopedServicesRegistryHandlerBackendService` recognises the
|
|
35
|
+
* wildcard sentinel).
|
|
36
|
+
* - Resource names are validated cross-config in Phase 2 against the
|
|
37
|
+
* parsed resource catalog (`start-minion-application` per IC-2);
|
|
38
|
+
* Phase 1 only validates SHAPE, not membership.
|
|
39
|
+
*
|
|
40
|
+
* The bucket value is the existing `AppRefSchema` shape (strict,
|
|
41
|
+
* `path` only) extended with the optional `resourceAccess` block —
|
|
42
|
+
* extending `AppRefSchema.extend()` keeps the strict-key invariant
|
|
43
|
+
* so an unknown key on a minion entry still parses to a clear error.
|
|
20
44
|
*/
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
export const MinionResourceAccessSchema = z.strictObject({
|
|
46
|
+
read: z.array(z.string().min(1)).default([]),
|
|
47
|
+
write: z.array(z.string().min(1)).default([]),
|
|
48
|
+
}).superRefine((resourceAccess, ctx) => {
|
|
49
|
+
// Enforced at PARSE time, not at grant-derivation time, and the difference is
|
|
50
|
+
// the point: this is the declaration an author writes, so the error belongs
|
|
51
|
+
// where they can see the line that caused it. By the time apps-manager derives
|
|
52
|
+
// grants the config is long gone, and the failure would surface as a database
|
|
53
|
+
// privilege nobody asked for.
|
|
54
|
+
for (const violation of findMinionResourceAccessViolations(resourceAccess)) {
|
|
55
|
+
ctx.addIssue({
|
|
56
|
+
code: 'custom',
|
|
57
|
+
path: [violation.axis],
|
|
58
|
+
message: violation.message,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* The authored PLATFORM-ACCESS declaration, as one named schema.
|
|
64
|
+
*
|
|
65
|
+
* Extracted from the inline literal it started as because the axis has to be
|
|
66
|
+
* declared at every hop between `wildo.saas.config.ts` and the apps-manager
|
|
67
|
+
* door — the managed declaration, its Zod schema, the bootstrap-config response,
|
|
68
|
+
* the strict application-config object, and the engine's loader mirror. Six
|
|
69
|
+
* hand-written copies of `{ scopes: z.array(...) }` is six chances for one of
|
|
70
|
+
* them to disagree, and a hop that disagrees STRIPS the axis silently.
|
|
71
|
+
*
|
|
72
|
+
* Mirrors {@link MinionPlatformAccessDeclaration}, which is the type the
|
|
73
|
+
* derivation (`buildOwnCronRecordFilter`) consumes.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Reconciled 2026-08-18. Two parallel workstreams briefly declared this axis in
|
|
77
|
+
* this file with different shapes — a flat capability array and this scoped
|
|
78
|
+
* object — which is a duplicate `const`, a PARSE error, and took the whole file
|
|
79
|
+
* (and `wildo config sync`) down. A third party then renamed one of them apart
|
|
80
|
+
* to unblock the parse, which left the other's five call sites dangling.
|
|
81
|
+
*
|
|
82
|
+
* The scoped shape SURVIVED, by agreement with its author; the flat one and its
|
|
83
|
+
* vocabulary are deleted. The name is back to the one those call sites already
|
|
84
|
+
* use, so no consumer carries the scar of the collision.
|
|
85
|
+
*/
|
|
86
|
+
export const MinionPlatformAccessSchema = z.strictObject({
|
|
87
|
+
scopes: z.array(z.enum(MinionPlatformAccessScope)).optional(),
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* The same axis as it TRAVELS, typed structurally.
|
|
91
|
+
*
|
|
92
|
+
* ## Why the carried type is not the authored one
|
|
93
|
+
*
|
|
94
|
+
* `MinionPlatformAccessSchema` infers `{ scopes?: MinionPlatformAccessScope[] }`,
|
|
95
|
+
* and a TypeScript enum is a NOMINAL type. Every hop between the author and the
|
|
96
|
+
* apps-manager door is re-declared in a package that would then have to NAME that
|
|
97
|
+
* enum through a public specifier — and the engine's `AppConfiguration` cannot,
|
|
98
|
+
* so `tsc` refuses the whole application-config schema:
|
|
99
|
+
*
|
|
100
|
+
* TS2742 The inferred type of 'Wildo_Application_ResolvedConfig_Schema'
|
|
101
|
+
* cannot be named without a reference to '…/node_modules/@wildo-ai/saas-models/src'
|
|
102
|
+
* TS7056 The inferred type of this node exceeds the maximum length the compiler will serialize
|
|
103
|
+
*
|
|
104
|
+
* Measured, not guessed: reverting only the engine-side field removes both
|
|
105
|
+
* errors, and re-adding it structurally keeps them away. See
|
|
106
|
+
* `.claude/rules/package-public-entrypoints.md` for the general mechanism.
|
|
107
|
+
*
|
|
108
|
+
* ## Why this loses nothing
|
|
109
|
+
*
|
|
110
|
+
* The vocabulary is enforced where enforcement belongs — at AUTHORING, by
|
|
111
|
+
* `MinionPlatformAccessSchema` above, on the line the author wrote; and at the
|
|
112
|
+
* DOOR, where apps-manager drops any scope this engine cannot name before it
|
|
113
|
+
* mints an attestation. The hops in between are transport. Typing transported
|
|
114
|
+
* data as the closed vocabulary would claim a guarantee the wire cannot give:
|
|
115
|
+
* these values arrive from a stored declaration that some other engine revision
|
|
116
|
+
* may have written.
|
|
117
|
+
*/
|
|
118
|
+
export const MinionPlatformAccessCarriedSchema = z.strictObject({
|
|
119
|
+
scopes: z.array(z.string().min(1)).optional(),
|
|
120
|
+
});
|
|
121
|
+
const MinionBucketEntrySchema = AppRefSchema.extend({
|
|
122
|
+
resourceAccess: MinionResourceAccessSchema.optional(),
|
|
33
123
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
124
|
+
* Whether this minion needs a route to the public internet (Step 5-egress).
|
|
125
|
+
*
|
|
126
|
+
* ## Why it is AUTHORED and defaults to false
|
|
127
|
+
*
|
|
128
|
+
* Network segmentation marks the backing-service networks `internal`, but
|
|
129
|
+
* attachment to ANY non-internal network restores NAT — so "may this runtime
|
|
130
|
+
* reach the internet?" is decided by one declaration and nowhere else. Marking
|
|
131
|
+
* the data networks internal is necessary and not sufficient.
|
|
132
|
+
*
|
|
133
|
+
* It is NOT inferred from `resourceAccess`. A scraper legitimately reaches the
|
|
134
|
+
* internet, and it is tempting to grant egress to any minion that touches data
|
|
135
|
+
* — but declaring `read: ['todos']` is not a statement about the internet, and
|
|
136
|
+
* conflating them would make egress universal for every data-touching minion,
|
|
137
|
+
* which is precisely the "everything can reach everything" posture this removes.
|
|
138
|
+
*
|
|
139
|
+
* The point is not to refuse egress. It is to stop it being universal and
|
|
140
|
+
* unstated, so a reviewer can see which minions leave the cluster and ask why.
|
|
141
|
+
*
|
|
142
|
+
* Default `false`, deliberately: the safe posture is the one an author gets by
|
|
143
|
+
* not thinking about it. A minion that genuinely needs the internet says so in
|
|
144
|
+
* one line, and that line is the thing a security review reads.
|
|
39
145
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
146
|
+
requiresInternetEgress: z.boolean().optional().default(false),
|
|
147
|
+
/**
|
|
148
|
+
* PLATFORM-level access — what this minion may see of the platform's record OF
|
|
149
|
+
* ITSELF (R4 / R5). Today: its own cron/schedule entries.
|
|
150
|
+
*
|
|
151
|
+
* **Independent of `resourceAccess` by requirement, not by accident (R5).**
|
|
152
|
+
* Neither implies the other, and nothing in the derivation of either consults
|
|
153
|
+
* the other. A minion that works on todos and never inspects its schedule is a
|
|
154
|
+
* normal shape; so is a health-reporting minion that reads its tick history and
|
|
155
|
+
* touches no application data.
|
|
156
|
+
*
|
|
157
|
+
* The scope vocabulary has ONE member on purpose. There is no
|
|
158
|
+
* `ALL_CRON_RECORDS`: a scope that could name another minion is a scope
|
|
159
|
+
* somebody eventually grants, and R4 requires a cross-minion read to be
|
|
160
|
+
* INEXPRESSIBLE rather than refused.
|
|
161
|
+
*/
|
|
162
|
+
platformAccess: MinionPlatformAccessSchema.optional(),
|
|
54
163
|
});
|
|
55
164
|
const BootstrapFirstAdminSeedSchema = z.object({
|
|
56
165
|
userTypes: z.array(z.string().min(1)).min(1),
|
|
@@ -58,8 +167,106 @@ const BootstrapFirstAdminSeedSchema = z.object({
|
|
|
58
167
|
const AppBootstrapSchema = z.object({
|
|
59
168
|
firstAdmin: BootstrapFirstAdminSeedSchema.optional(),
|
|
60
169
|
});
|
|
61
|
-
|
|
62
|
-
|
|
170
|
+
/**
|
|
171
|
+
* Per-runtime provider visibility authored at the application level.
|
|
172
|
+
*
|
|
173
|
+
* `defineSaaSProviders({ scopes })` is the canonical app-side provider
|
|
174
|
+
* graph. Tooling materializes this declaration into runtime-specific
|
|
175
|
+
* artifacts; runtime packages should consume those artifacts instead of
|
|
176
|
+
* importing `wildo.saas.config.ts`.
|
|
177
|
+
*/
|
|
178
|
+
export const EngineCapabilityActivationSchema = z.strictObject({
|
|
179
|
+
enabled: z.boolean(),
|
|
180
|
+
required: z.boolean().optional(),
|
|
181
|
+
});
|
|
182
|
+
export const EngineCapabilityActivationsSchema = z.partialRecord(z.enum(EngineCapability), EngineCapabilityActivationSchema).default({});
|
|
183
|
+
export const ProviderConfigurationsSchema = z.record(z.string().min(1), z.record(z.string().min(1), z.unknown()).optional()).default(() => ({}));
|
|
184
|
+
const BUILTIN_PROVIDER_CAPABILITY_VALUES = new Set(Object.values(BUILTIN_PROVIDER_CAPABILITY));
|
|
185
|
+
const CUSTOM_PROVIDER_CAPABILITY_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
186
|
+
export const ProviderCapabilitySelectorSchema = z.string().min(1).refine((value) => BUILTIN_PROVIDER_CAPABILITY_VALUES.has(value) || CUSTOM_PROVIDER_CAPABILITY_PATTERN.test(value), {
|
|
187
|
+
message: 'Provider capabilities must be a built-in ProviderCapability or app custom kebab-case capability.',
|
|
188
|
+
});
|
|
189
|
+
const KNOWN_PROVIDER_PROTOCOLS = new Set([
|
|
190
|
+
...Object.values(ExternalProvider_ExchangeProtocol_Kind),
|
|
191
|
+
...Object.values(BUILTIN_PROVIDER_PROTOCOL),
|
|
192
|
+
]);
|
|
193
|
+
export const ProviderProtocolSelectorSchema = z.string().min(1).refine((value) => KNOWN_PROVIDER_PROTOCOLS.has(value), { message: 'protocols must use known external protocol literals.' });
|
|
194
|
+
export const SaasProviderScopeSelectionSchema = z.strictObject({
|
|
195
|
+
engineCapabilities: z.array(z.enum(EngineCapability)).default([]),
|
|
196
|
+
providerCapabilities: z.array(ProviderCapabilitySelectorSchema).default([]),
|
|
197
|
+
protocols: z.array(ProviderProtocolSelectorSchema).default([]),
|
|
198
|
+
});
|
|
199
|
+
export const SaasProviderSelectionPolicySchema = z.strictObject({
|
|
200
|
+
primary: z.string().min(1),
|
|
201
|
+
fallbacks: z.array(z.string().min(1)).default([]),
|
|
202
|
+
});
|
|
203
|
+
const SaasProviderRuntimeScopeSchema = z.strictObject({
|
|
204
|
+
providers: z.record(z.string().min(1), SaasProviderScopeSelectionSchema).default({}),
|
|
205
|
+
selection: z.partialRecord(z.enum(EngineCapability), SaasProviderSelectionPolicySchema).optional(),
|
|
206
|
+
}).superRefine((scope, ctx) => {
|
|
207
|
+
const providerRefs = new Set(Object.keys(scope.providers));
|
|
208
|
+
for (const [capability, policy] of Object.entries(scope.selection ?? {})) {
|
|
209
|
+
for (const providerRef of [policy.primary, ...(policy.fallbacks ?? [])]) {
|
|
210
|
+
if (!providerRefs.has(providerRef)) {
|
|
211
|
+
ctx.addIssue({
|
|
212
|
+
code: 'custom',
|
|
213
|
+
path: ['selection', capability],
|
|
214
|
+
message: `Provider selection for ${capability} references "${providerRef}" but it is not declared in this scope.`,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
export const SaasProvidersScopesSchema = z.strictObject({
|
|
221
|
+
backend: SaasProviderRuntimeScopeSchema.optional(),
|
|
222
|
+
companion: SaasProviderRuntimeScopeSchema.optional(),
|
|
223
|
+
frontendServices: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),
|
|
224
|
+
minions: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),
|
|
225
|
+
workers: z.record(z.string().min(1), SaasProviderRuntimeScopeSchema).optional(),
|
|
226
|
+
});
|
|
227
|
+
export const SaasConfigProvidersBlockSchema = z.strictObject({
|
|
228
|
+
scopes: SaasProvidersScopesSchema,
|
|
229
|
+
}).default(() => ({ scopes: {} }));
|
|
230
|
+
export function defineSaaSProviders(providers) {
|
|
231
|
+
return SaasConfigProvidersBlockSchema.parse(providers);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @wildo_source:part:start platform.config.saas facet:layer:platform facet:family:bootstrap
|
|
235
|
+
*
|
|
236
|
+
* Root `wildo.saas.config.ts` application declaration: services, modules,
|
|
237
|
+
* engine capabilities, provider scopes, provider configurations and data
|
|
238
|
+
* services. Import `defineSaasConfig` from `@wildo-ai/platform-config-lib` and
|
|
239
|
+
* keep cross-service choices here rather than scattering them through runtime
|
|
240
|
+
* source files.
|
|
241
|
+
*/
|
|
242
|
+
/**
|
|
243
|
+
* The root schema is `z.strictObject` (not `z.object`) so that authoring an
|
|
244
|
+
* unknown top-level key surfaces as a
|
|
245
|
+
* Zod parse error at `defineSaasConfig` time instead of being silently
|
|
246
|
+
* dropped. A typoed `dataServises:` block (or a removed-then-re-introduced
|
|
247
|
+
* `secretsSharingPolicy`) would otherwise compile cleanly, parse cleanly,
|
|
248
|
+
* and produce no runtime warning — exactly the failure mode the
|
|
249
|
+
* `@unimplemented` machinery exists to prevent. The fail-closed posture
|
|
250
|
+
* trades a slightly louder authoring boundary for a guarantee that every
|
|
251
|
+
* authored top-level concern is either consumed or explicitly rejected.
|
|
252
|
+
*/
|
|
253
|
+
export const WildoSaasConfigSchema = z.strictObject({
|
|
254
|
+
/**
|
|
255
|
+
* Authored schema-format version for this `wildo.saas.config.ts`,
|
|
256
|
+
* expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,
|
|
257
|
+
* `'2.3.1-rc.1'`, `'1.0.0+build.42'`).
|
|
258
|
+
*
|
|
259
|
+
* SemVer (not a bare integer) keeps MAJOR-vs-MINOR-vs-PATCH meaning explicit
|
|
260
|
+
* for future configuration evolution — bare integers conflate "breaking", "feature
|
|
261
|
+
* add" and "bug-fix" into a single dimension and force every bump to
|
|
262
|
+
* look like a breaking change.
|
|
263
|
+
*
|
|
264
|
+
* The field is intentionally optional (no Zod default) so unauthored
|
|
265
|
+
* configurations stay silent. Version-based migration enforcement is not
|
|
266
|
+
* available yet; an authored value records intent but does not itself perform
|
|
267
|
+
* a migration or authorize an incompatible configuration.
|
|
268
|
+
*/
|
|
269
|
+
version: WildoSchemaVersionSchema.optional(),
|
|
63
270
|
name: z.string().min(1),
|
|
64
271
|
slug: z.string().min(1).regex(/^[a-z0-9-]+$/, 'slug must be lowercase alphanumeric with hyphens'),
|
|
65
272
|
displayName: z.string().min(1),
|
|
@@ -67,40 +274,329 @@ export const WildoSaasConfigSchema = z.object({
|
|
|
67
274
|
type: z.literal('saas'),
|
|
68
275
|
services: z.record(z.string(), AppServiceDefinitionSchema),
|
|
69
276
|
modules: ApplicationModulesSchema,
|
|
70
|
-
|
|
71
|
-
|
|
277
|
+
libraries: z.record(z.string(), AppLibraryDefinitionSchema).optional(),
|
|
278
|
+
specifications: AppRefSchema.optional(),
|
|
279
|
+
/**
|
|
280
|
+
* Long-running "minion" actor hosts (scheduled or always-up).
|
|
281
|
+
*
|
|
282
|
+
* Each entry can declare a `resourceAccess` read/write whitelist. The
|
|
283
|
+
* current configuration parser accepts the declaration, but a minion runtime
|
|
284
|
+
* does not consume or enforce it yet. Do not rely on this field as an access
|
|
285
|
+
* control until the installed runtime exposes that capability.
|
|
286
|
+
*/
|
|
287
|
+
minions: z.record(z.string(), MinionBucketEntrySchema).optional(),
|
|
72
288
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
289
|
+
* HTTP-only "worker" subprocesses (compute-heavy, often Rust/Go).
|
|
290
|
+
*
|
|
291
|
+
* The current configuration parser accepts these declarations, but a worker
|
|
292
|
+
* runtime is not available yet. Workers have no `resourceAccess` field
|
|
293
|
+
* because they do not receive database access by default; a resource
|
|
294
|
+
* whitelist would therefore be misleading.
|
|
75
295
|
*/
|
|
76
|
-
|
|
296
|
+
workers: z.record(z.string(), AppRefSchema).optional(),
|
|
297
|
+
engineCapabilities: EngineCapabilityActivationsSchema,
|
|
298
|
+
providerConfigurations: ProviderConfigurationsSchema,
|
|
77
299
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
300
|
+
* Per-facet provider registries.
|
|
301
|
+
*
|
|
302
|
+
* Authored as a `z.custom` because the value is a constructed object
|
|
303
|
+
* (registry instances carry methods like `getProviderByRef`); strict
|
|
304
|
+
* runtime parsing of method-bearing values is intentionally skipped
|
|
305
|
+
* — the application/provider composition boundary enforces the registry
|
|
306
|
+
* invariants.
|
|
307
|
+
*
|
|
308
|
+
* See the `SaasConfigProvidersBlock` JSDoc above for the role of each
|
|
309
|
+
* registry facet.
|
|
80
310
|
*/
|
|
81
|
-
|
|
82
|
-
features: AppFeaturesSchema,
|
|
311
|
+
providers: SaasConfigProvidersBlockSchema,
|
|
83
312
|
bootstrap: AppBootstrapSchema.optional(),
|
|
84
313
|
dataServices: AppDataServicesSchema,
|
|
314
|
+
/**
|
|
315
|
+
* How long this application keeps each class of data, and why.
|
|
316
|
+
*
|
|
317
|
+
* Declared HERE, beside `dataServices`, because the two describe the same thing from opposite ends:
|
|
318
|
+
* `dataServices` says which stores exist, and this says how long what is in them is kept. Both are
|
|
319
|
+
* application-wide operator decisions rather than per-resource authoring.
|
|
320
|
+
*
|
|
321
|
+
* Optional as a whole, and partial within itself. An application that has decided nothing omits it;
|
|
322
|
+
* one that has decided only its customer-data period declares only that. Absence is never read as
|
|
323
|
+
* "kept forever" — a compliance document states the classes that ARE declared and marks the rest as
|
|
324
|
+
* needing an operator decision, which is what lets the document be produced today rather than
|
|
325
|
+
* waiting on a number nobody has yet.
|
|
326
|
+
*
|
|
327
|
+
* Two consumers, and the second is why the classes are the STORES: a privacy notice's retention
|
|
328
|
+
* paragraph (issue #89, which is why this exists), and the backup-and-restore inventory a remote
|
|
329
|
+
* environment still has none of (issue #8) — one declaration answers both instead of two that drift.
|
|
330
|
+
*/
|
|
331
|
+
dataRetention: ApplicationRetentionScheduleSchema.optional(),
|
|
332
|
+
/**
|
|
333
|
+
* Whether each AI capability this application enables DECIDES something about a person, and who
|
|
334
|
+
* reviews it if so.
|
|
335
|
+
*
|
|
336
|
+
* A capability establishes that AI is in use and for what function; it cannot establish consequence,
|
|
337
|
+
* because the same `AI_LLM` backs a summariser that decides nothing and a screener that decides a
|
|
338
|
+
* great deal (issue #92).
|
|
339
|
+
*
|
|
340
|
+
* Optional and partial, like `dataRetention` — but the silence here is the more dangerous one. A
|
|
341
|
+
* notice describing AI use without addressing consequence does not read as "unknown", it reads as
|
|
342
|
+
* "nothing significant happens", which silently claims an exemption. So an enabled AI capability with
|
|
343
|
+
* no entry is REPORTED as outstanding rather than assumed harmless.
|
|
344
|
+
*/
|
|
345
|
+
aiUsePosture: ApplicationAiUsePostureSchema.optional(),
|
|
346
|
+
/**
|
|
347
|
+
* What this application stores in a visitor's browser, per FRONTEND SURFACE — the itemised table a
|
|
348
|
+
* cookie notice IS (issue #91).
|
|
349
|
+
*
|
|
350
|
+
* Per surface because a public marketing site and the authenticated application set different things,
|
|
351
|
+
* and one merged list would be wrong for both. The FRAMEWORK's own cookies are not declared here:
|
|
352
|
+
* every application inherits them and none authored them, so they are answered by
|
|
353
|
+
* `ENGINE_CLIENT_STORAGE_ENTRIES` and reported separately.
|
|
354
|
+
*
|
|
355
|
+
* Optional and partial. A surface with no entry has not been inventoried and is reported as such; an
|
|
356
|
+
* empty ARRAY is the different, positive answer — this surface sets nothing of its own.
|
|
357
|
+
*/
|
|
358
|
+
clientStorage: ApplicationClientStorageInventorySchema.optional(),
|
|
359
|
+
operatorComplianceIdentity: ApplicationOperatorComplianceIdentitySchema.optional(),
|
|
360
|
+
providerComplianceChoices: ApplicationProviderComplianceChoicesSchema.optional(),
|
|
361
|
+
/**
|
|
362
|
+
* Module registries the app pulls modules from. Each entry pairs a
|
|
363
|
+
* stable id (used by lockfile entries + the `--registry <id>` CLI
|
|
364
|
+
* flag) with a registry HTTP origin. Optional — when omitted, CLI
|
|
365
|
+
* commands fall back to alias resolution (`local` / `public`) or
|
|
366
|
+
* the env-policy default (`WILDO_FRAMEWORK_DEVELOPER` → local;
|
|
367
|
+
* else public).
|
|
368
|
+
*
|
|
369
|
+
* Example: `[{ id: 'wildo', url: 'https://registry.wildo.ai' }]`
|
|
370
|
+
*
|
|
371
|
+
* Credentials never live here — they live per-machine under
|
|
372
|
+
* the local Wildo credential store. This config only points at endpoints.
|
|
373
|
+
*/
|
|
374
|
+
moduleRegistries: RegistryConfigSchema.optional(),
|
|
375
|
+
// Technical-documentation and marketing-website configuration belong in
|
|
376
|
+
// their respective service folders as
|
|
377
|
+
// `wildo.tech-doc.config.ts` and `wildo.website.config.ts`,
|
|
378
|
+
// co-located with the public packages that own their semantics
|
|
379
|
+
// (`@wildo-ai/saas-technical-doc` and `@wildo-ai/saas-website`). The
|
|
380
|
+
// schemas, types, `defineXxxConfig` helpers, and (for website) the
|
|
381
|
+
// jiti-backed loader now live entirely in those packages.
|
|
382
|
+
// The dev companion / Astro build discover and load each per-service
|
|
383
|
+
// file via the unique service of the matching `frontendType`. The
|
|
384
|
+
// single-frontend-per-kind constraint enforced by the `superRefine`
|
|
385
|
+
// below guarantees that "the TECH_DOC service folder" and "the
|
|
386
|
+
// STATIC_WEBSITE service folder" are unambiguous.
|
|
85
387
|
}).superRefine((config, ctx) => {
|
|
86
388
|
const availableServiceKeys = new Set(Object.keys(config.services));
|
|
389
|
+
const frontendServiceKeys = new Set(Object.entries(config.services)
|
|
390
|
+
.filter(([, definition]) => definition.frontendType !== undefined)
|
|
391
|
+
.map(([serviceKey]) => serviceKey));
|
|
87
392
|
for (const [moduleId, moduleBinding] of Object.entries(config.modules ?? {})) {
|
|
88
393
|
for (const serviceKey of moduleBinding.services) {
|
|
89
394
|
if (availableServiceKeys.has(serviceKey)) {
|
|
90
395
|
continue;
|
|
91
396
|
}
|
|
92
397
|
ctx.addIssue({
|
|
93
|
-
code:
|
|
398
|
+
code: 'custom',
|
|
94
399
|
path: ['modules', moduleId, 'services'],
|
|
95
400
|
message: `Module "${moduleId}" references unknown service "${serviceKey}".`,
|
|
96
401
|
});
|
|
97
402
|
}
|
|
98
403
|
}
|
|
404
|
+
// Minion/worker bucket keys are RFC1123-normalized (via `buildMinionServiceName`
|
|
405
|
+
// / `buildWorkerServiceName`) into the k8s object / built image / compose service
|
|
406
|
+
// / worker dispatch-host DNS name at deploy time. camelCase keys are ACCEPTED and
|
|
407
|
+
// normalized — matching the `services.<key>` convention and the existing
|
|
408
|
+
// `WILDO_WORKER_<NAME>_URL` env-key normalization — but two keys that COLLAPSE to
|
|
409
|
+
// the same DNS name would silently deploy as ONE Service/image, and a key that
|
|
410
|
+
// normalizes to EMPTY (all-symbol) would emit an invalid trailing-hyphen name.
|
|
411
|
+
// Fail fast at authoring on either, independently per background-runtime map.
|
|
412
|
+
// The full generated deploy name is `{slug}-{minion|worker}-{dnsName}`. It is
|
|
413
|
+
// used as the k8s Service `metadata.name` AND the `app.kubernetes.io/name` label
|
|
414
|
+
// value — both bounded by the RFC1123 label limit of 63 chars. A longer name is
|
|
415
|
+
// rejected by kubectl at deploy time (and by Docker for the image tag), so fail
|
|
416
|
+
// fast at authoring rather than let CI/deploy blow up. Truncating instead would
|
|
417
|
+
// be a silent "trick" that risks a collision with a sibling key — rejected.
|
|
418
|
+
const K8S_LABEL_MAX_LENGTH = 63;
|
|
419
|
+
for (const [mapLabel, bucket, buildServiceName] of [
|
|
420
|
+
['minions', config.minions, buildMinionServiceName],
|
|
421
|
+
['workers', config.workers, buildWorkerServiceName],
|
|
422
|
+
]) {
|
|
423
|
+
if (!bucket)
|
|
424
|
+
continue;
|
|
425
|
+
const dnsNameToKey = new Map();
|
|
426
|
+
for (const bucketKey of Object.keys(bucket)) {
|
|
427
|
+
const dnsName = normalizeServiceKeyToDnsName(bucketKey);
|
|
428
|
+
if (dnsName.length === 0) {
|
|
429
|
+
ctx.addIssue({
|
|
430
|
+
code: 'custom',
|
|
431
|
+
path: [mapLabel, bucketKey],
|
|
432
|
+
message: `${mapLabel} key "${bucketKey}" normalizes to an empty DNS name — it must contain at least ` +
|
|
433
|
+
`one [a-z0-9] character so the deployed k8s Service / image name is valid (e.g. "market-scraper").`,
|
|
434
|
+
});
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
const serviceName = buildServiceName(config.slug, bucketKey);
|
|
438
|
+
if (serviceName.length > K8S_LABEL_MAX_LENGTH) {
|
|
439
|
+
ctx.addIssue({
|
|
440
|
+
code: 'custom',
|
|
441
|
+
path: [mapLabel, bucketKey],
|
|
442
|
+
message: `${mapLabel} key "${bucketKey}" generates the deploy name "${serviceName}" ` +
|
|
443
|
+
`(${serviceName.length} chars), exceeding the ${K8S_LABEL_MAX_LENGTH}-char RFC1123 limit for a ` +
|
|
444
|
+
`k8s Service / label name. Shorten the ${mapLabel.slice(0, -1)} key or the app slug ("${config.slug}").`,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
const existing = dnsNameToKey.get(dnsName);
|
|
448
|
+
if (existing !== undefined) {
|
|
449
|
+
ctx.addIssue({
|
|
450
|
+
code: 'custom',
|
|
451
|
+
path: [mapLabel, bucketKey],
|
|
452
|
+
message: `${mapLabel} keys "${existing}" and "${bucketKey}" both normalize to the DNS name "${dnsName}" — ` +
|
|
453
|
+
`they would deploy as the SAME k8s Service / image / compose service. Rename one so the normalized names differ.`,
|
|
454
|
+
});
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
dnsNameToKey.set(dnsName, bucketKey);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
const scopeBuckets = {
|
|
461
|
+
services: availableServiceKeys,
|
|
462
|
+
minions: new Set(Object.keys(config.minions ?? {})),
|
|
463
|
+
workers: new Set(Object.keys(config.workers ?? {})),
|
|
464
|
+
};
|
|
465
|
+
const validateProviderScope = (scopePath, scope) => {
|
|
466
|
+
if (!scope)
|
|
467
|
+
return;
|
|
468
|
+
for (const [providerRef, selection] of Object.entries(scope.providers)) {
|
|
469
|
+
for (const capability of selection.engineCapabilities) {
|
|
470
|
+
if (config.engineCapabilities?.[capability]?.enabled !== true) {
|
|
471
|
+
ctx.addIssue({
|
|
472
|
+
code: 'custom',
|
|
473
|
+
path: [...scopePath, 'providers', providerRef, 'engineCapabilities'],
|
|
474
|
+
message: `Provider "${providerRef}" selects disabled or unauthored engine capability "${capability}".`,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
for (const [capability, policy] of Object.entries(scope.selection ?? {})) {
|
|
480
|
+
// A FAN_OUT capability (e.g. COMPLIANCE_AUDIT_TRAIL) writes to EVERY declared
|
|
481
|
+
// provider — a `selection` (primary + failover) is meaningless for it. Reject
|
|
482
|
+
// it; declaring the providers is enough (all are active).
|
|
483
|
+
if (getEngineCapabilityResolutionMode(capability)
|
|
484
|
+
=== EngineCapabilityResolutionMode.FAN_OUT) {
|
|
485
|
+
ctx.addIssue({
|
|
486
|
+
code: 'custom',
|
|
487
|
+
path: [...scopePath, 'selection', capability],
|
|
488
|
+
message: `"${capability}" is a FAN_OUT capability — every declared provider is active (no primary/failover). Remove its \`selection\` entry; declaring the providers is enough.`,
|
|
489
|
+
});
|
|
490
|
+
continue;
|
|
491
|
+
}
|
|
492
|
+
for (const providerRef of [policy.primary, ...(policy.fallbacks ?? [])]) {
|
|
493
|
+
const providerSelection = scope.providers[providerRef];
|
|
494
|
+
if (providerSelection && !providerSelection.engineCapabilities.includes(capability)) {
|
|
495
|
+
ctx.addIssue({
|
|
496
|
+
code: 'custom',
|
|
497
|
+
path: [...scopePath, 'selection', capability],
|
|
498
|
+
message: `Provider selection for "${capability}" references provider "${providerRef}" that does not declare engineCapabilities including ${capability}.`,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
validateProviderScope(['providers', 'scopes', 'backend'], config.providers?.scopes.backend);
|
|
505
|
+
validateProviderScope(['providers', 'scopes', 'companion'], config.providers?.scopes.companion);
|
|
506
|
+
for (const [serviceKey, scope] of Object.entries(config.providers?.scopes.frontendServices ?? {})) {
|
|
507
|
+
if (!availableServiceKeys.has(serviceKey)) {
|
|
508
|
+
ctx.addIssue({
|
|
509
|
+
code: 'custom',
|
|
510
|
+
path: ['providers', 'scopes', 'frontendServices', serviceKey],
|
|
511
|
+
message: `Provider scope references unknown frontend service "${serviceKey}".`,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
else if (!frontendServiceKeys.has(serviceKey)) {
|
|
515
|
+
ctx.addIssue({
|
|
516
|
+
code: 'custom',
|
|
517
|
+
path: ['providers', 'scopes', 'frontendServices', serviceKey],
|
|
518
|
+
message: `Provider scope references non-frontend service "${serviceKey}". ` +
|
|
519
|
+
'Only services with a frontendType may appear under providers.scopes.frontendServices.',
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
validateProviderScope(['providers', 'scopes', 'frontendServices', serviceKey], scope);
|
|
523
|
+
}
|
|
524
|
+
for (const [minionKey, scope] of Object.entries(config.providers?.scopes.minions ?? {})) {
|
|
525
|
+
if (!scopeBuckets.minions.has(minionKey)) {
|
|
526
|
+
ctx.addIssue({
|
|
527
|
+
code: 'custom',
|
|
528
|
+
path: ['providers', 'scopes', 'minions', minionKey],
|
|
529
|
+
message: `Provider scope references unknown minion "${minionKey}".`,
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
validateProviderScope(['providers', 'scopes', 'minions', minionKey], scope);
|
|
533
|
+
}
|
|
534
|
+
for (const [workerKey, scope] of Object.entries(config.providers?.scopes.workers ?? {})) {
|
|
535
|
+
if (!scopeBuckets.workers.has(workerKey)) {
|
|
536
|
+
ctx.addIssue({
|
|
537
|
+
code: 'custom',
|
|
538
|
+
path: ['providers', 'scopes', 'workers', workerKey],
|
|
539
|
+
message: `Provider scope references unknown worker "${workerKey}".`,
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
validateProviderScope(['providers', 'scopes', 'workers', workerKey], scope);
|
|
543
|
+
}
|
|
544
|
+
// At most one service may use each "single-instance" frontend kind.
|
|
545
|
+
//
|
|
546
|
+
// `TECH_DOC` and `STATIC_WEBSITE` are framework-managed singletons:
|
|
547
|
+
// a SaaS app has at most one technical-documentation site and at
|
|
548
|
+
// most one marketing/landing site. The per-service config files
|
|
549
|
+
// (`wildo.tech-doc.config.ts` for `TECH_DOC`, `wildo.website.config.ts`
|
|
550
|
+
// for `STATIC_WEBSITE`) are discovered by the companion / Astro
|
|
551
|
+
// build through the unique service of the matching `frontendType`.
|
|
552
|
+
// If the schema allowed two `TECH_DOC` services, the companion
|
|
553
|
+
// would have no deterministic way to project the OpenAPI YAMLs to
|
|
554
|
+
// "the" docs root — every consumer would need a "which docs
|
|
555
|
+
// service?" indirection for no real-world payoff (multi-doc-site
|
|
556
|
+
// / multi-marketing-site SaaS apps are not a use case we have
|
|
557
|
+
// ever needed to support).
|
|
558
|
+
//
|
|
559
|
+
// The constraint is enforced at parse time so the failure surfaces
|
|
560
|
+
// at `defineSaasConfig` (CLI parse, dev watcher reload) rather than
|
|
561
|
+
// at first companion-driven OpenAPI publish — the latter would be
|
|
562
|
+
// a confusing "your second docs service was silently picked over
|
|
563
|
+
// the first" type of failure.
|
|
564
|
+
//
|
|
565
|
+
// `SAAS_APP` is intentionally NOT constrained here: a single repo
|
|
566
|
+
// can ship multiple SaaS-app frontends (e.g. a customer surface and
|
|
567
|
+
// an internal admin), each owning its own session, and the
|
|
568
|
+
// cross-frontend handoff already handles that fan-out via
|
|
569
|
+
// `runtime.endPoints[*].publicUrl`. The session-owning role does not
|
|
570
|
+
// create a unique-receiver assumption the way the docs / website
|
|
571
|
+
// frontends do.
|
|
572
|
+
const singletonFrontends = [
|
|
573
|
+
AppFrontendType.TECH_DOC,
|
|
574
|
+
AppFrontendType.STATIC_WEBSITE,
|
|
575
|
+
];
|
|
576
|
+
for (const kind of singletonFrontends) {
|
|
577
|
+
const matchingServiceKeys = Object.entries(config.services)
|
|
578
|
+
.filter(([, def]) => def.frontendType === kind)
|
|
579
|
+
.map(([key]) => key);
|
|
580
|
+
if (matchingServiceKeys.length > 1) {
|
|
581
|
+
for (const offendingKey of matchingServiceKeys) {
|
|
582
|
+
ctx.addIssue({
|
|
583
|
+
code: 'custom',
|
|
584
|
+
path: ['services', offendingKey, 'frontendType'],
|
|
585
|
+
message: `frontendType='${kind}' may be declared on at most one service ` +
|
|
586
|
+
`per SaaS app (found ${matchingServiceKeys.length}: ${matchingServiceKeys.join(', ')}). ` +
|
|
587
|
+
`${kind} is a framework-managed singleton — the companion / build ` +
|
|
588
|
+
`pipeline addresses it as "the ${kind} service" with no disambiguator. ` +
|
|
589
|
+
`Collapse the duplicates into a single service or split them into separate apps.`,
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
99
594
|
});
|
|
595
|
+
/** @wildo_source:part:end platform.config.saas */
|
|
100
596
|
/**
|
|
101
597
|
* Define a SaaS application configuration.
|
|
102
|
-
* Provides full IDE autocompletion for capabilities
|
|
103
|
-
*
|
|
598
|
+
* Provides full IDE autocompletion for engine capabilities, provider scopes,
|
|
599
|
+
* services, modules, and data services.
|
|
104
600
|
*
|
|
105
601
|
* @example
|
|
106
602
|
* ```ts
|
|
@@ -108,30 +604,163 @@ export const WildoSaasConfigSchema = z.object({
|
|
|
108
604
|
* import { EngineCapability } from '@wildo-ai/saas-models';
|
|
109
605
|
*
|
|
110
606
|
* export default defineSaasConfig({
|
|
111
|
-
* version: 1,
|
|
112
607
|
* name: 'wonder-todos',
|
|
113
608
|
* slug: 'wonder-todos',
|
|
114
609
|
* displayName: 'Wonder Todos',
|
|
115
610
|
* type: 'saas',
|
|
116
|
-
*
|
|
117
|
-
* [EngineCapability.EMAIL_TRANSACTIONAL]: {
|
|
118
|
-
* enabled: true,
|
|
119
|
-
* runtime: true, // optional, defaults to false
|
|
120
|
-
* provider: 'resend',
|
|
121
|
-
* },
|
|
611
|
+
* engineCapabilities: {
|
|
612
|
+
* [EngineCapability.EMAIL_TRANSACTIONAL]: { enabled: true },
|
|
122
613
|
* [EngineCapability.SMS]: { enabled: false },
|
|
123
|
-
* [EngineCapability.AI_LLM]: {
|
|
124
|
-
* enabled: true,
|
|
125
|
-
* runtime: true,
|
|
126
|
-
* tooling: true, // optional, defaults to false
|
|
127
|
-
* providers: ['openai', 'anthropic'],
|
|
128
|
-
* },
|
|
614
|
+
* [EngineCapability.AI_LLM]: { enabled: true },
|
|
129
615
|
* },
|
|
616
|
+
* providerConfigurations: {},
|
|
617
|
+
* providers: defineSaaSProviders({
|
|
618
|
+
* scopes: {
|
|
619
|
+
* backend: {
|
|
620
|
+
* providers: {
|
|
621
|
+
* resend: {
|
|
622
|
+
* engineCapabilities: [EngineCapability.EMAIL_TRANSACTIONAL],
|
|
623
|
+
* providerCapabilities: ['EMAIL_TRANSACTIONAL'],
|
|
624
|
+
* protocols: ['EMAIL_PROVIDER'],
|
|
625
|
+
* },
|
|
626
|
+
* },
|
|
627
|
+
* },
|
|
628
|
+
* },
|
|
629
|
+
* }),
|
|
130
630
|
* // ...
|
|
131
631
|
* });
|
|
132
632
|
* ```
|
|
133
633
|
*/
|
|
134
634
|
export function defineSaasConfig(config) {
|
|
135
|
-
|
|
635
|
+
const parsed = WildoSaasConfigSchema.parse(config);
|
|
636
|
+
emitUnimplementedRuntimeWarnings(parsed);
|
|
637
|
+
return parsed;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Emit `@unimplemented` parse-time warnings for every authored field that
|
|
641
|
+
* has no runtime consumer yet (Slice 3.4 contract — see
|
|
642
|
+
* `_unimplemented/unimplemented-field-warning.ts` JSDoc for the full
|
|
643
|
+
* design rationale and the per-call dedupe semantics).
|
|
644
|
+
*
|
|
645
|
+
* The full surface and the matching deferred-backlog IDs are documented
|
|
646
|
+
* once in `.cursor/context/cli-dx.md` ("Schema fields with `@unimplemented`
|
|
647
|
+
* runtime contract"). When a deferred slice ships, the matching `if`
|
|
648
|
+
* branch below MUST be removed in the same commit as the runtime wiring
|
|
649
|
+
* — leaving a stale warning is worse than silence because authors will
|
|
650
|
+
* start ignoring the channel.
|
|
651
|
+
*
|
|
652
|
+
* Surfaces today:
|
|
653
|
+
*
|
|
654
|
+
* - `version` (!== undefined) → `D-5`
|
|
655
|
+
*
|
|
656
|
+
* The `minions` / `workers` `@unimplemented` branches were REMOVED
|
|
657
|
+
* 2026-05-05 with the close of D-1 once the runtime path landed
|
|
658
|
+
* end-to-end (publisher → per-minion queue → minion consumer →
|
|
659
|
+
* onTick handler / worker host with HTTP+JWT verifier + apps-manager
|
|
660
|
+
* deploy orchestration). See the close-out note in
|
|
661
|
+
* `.claude/plans/minions-and-workers-implementation.md` Phase 4. The
|
|
662
|
+
* per-entry `resourceAccess` soft-warns below stay — those are
|
|
663
|
+
* advisories about the authoring contract, not "runtime missing"
|
|
664
|
+
* markers.
|
|
665
|
+
*
|
|
666
|
+
* Provider activation and product feature modeling no longer warn here:
|
|
667
|
+
* `engineCapabilities` and `providers` are active runtime inputs, while
|
|
668
|
+
* entitlement/product features live in the feature system.
|
|
669
|
+
*
|
|
670
|
+
* The `csp?` placeholder warning that previously lived here moved to
|
|
671
|
+
* `engine/saas-technical-doc/src/config/define-tech-doc-config.ts`
|
|
672
|
+
* along with the rest of `WildoTechnicalDocConfigSchema` (Step 7.5
|
|
673
|
+
* refactor, saas-technical-doc.md). The `wildo.tech-doc.config.ts`
|
|
674
|
+
* loader emits `[wildo-tech-doc-config] @unimplemented field 'csp'
|
|
675
|
+
* authored — runtime support tracked under D-CSP` whenever a value
|
|
676
|
+
* is authored.
|
|
677
|
+
*
|
|
678
|
+
* For `version` the test is `!== undefined` because the field is
|
|
679
|
+
* `.optional()` (no default) — the warning fires iff the author wrote
|
|
680
|
+
* `version: <n>` in their config. See the JSDoc on the schema field
|
|
681
|
+
* above for the rationale.
|
|
682
|
+
*/
|
|
683
|
+
function emitUnimplementedRuntimeWarnings(config) {
|
|
684
|
+
const warn = createUnimplementedFieldWarner(UnimplementedFieldSource.SAAS_CONFIG);
|
|
685
|
+
if (config.version !== undefined) {
|
|
686
|
+
warn('version', 'D-5');
|
|
687
|
+
}
|
|
688
|
+
// H-3 (`minions-and-workers-implementation.md` Phase 1): per-minion
|
|
689
|
+
// soft-warns covering the KD-11 `resourceAccess` authoring posture.
|
|
690
|
+
// These fire AFTER the `@unimplemented` block per the IC-1 emit-
|
|
691
|
+
// ordering contract; the `emitSoftWarn` utility caps repeats
|
|
692
|
+
// process-wide so the dev watcher's per-save re-parses do not spam.
|
|
693
|
+
//
|
|
694
|
+
// Three advisory shapes today (the per-resource membership check
|
|
695
|
+
// against the parsed catalog runs in Phase 2 from
|
|
696
|
+
// `start-minion-application` per IC-2 — Phase 1 only validates
|
|
697
|
+
// STRUCTURAL shape):
|
|
698
|
+
//
|
|
699
|
+
// 1. `resourceAccess.missing` — entry omits the block entirely
|
|
700
|
+
// (fail-closed default; advisory
|
|
701
|
+
// so a forgotten whitelist is
|
|
702
|
+
// visible without blocking dev).
|
|
703
|
+
// 2. `resourceAccess.empty` — both `read` and `write` are
|
|
704
|
+
// empty arrays (intent-equivalent
|
|
705
|
+
// to omission, but flagged so the
|
|
706
|
+
// author knows the minion will be
|
|
707
|
+
// blocked at every repository call).
|
|
708
|
+
// 3. `resourceAccess.read-only` / `resourceAccess.write-only` —
|
|
709
|
+
// one side is empty; flagged so
|
|
710
|
+
// asymmetric whitelists are not
|
|
711
|
+
// accidental typos.
|
|
712
|
+
for (const [minionKey, entry] of Object.entries(config.minions ?? {})) {
|
|
713
|
+
const scope = `minions.${minionKey}`;
|
|
714
|
+
if (!entry.resourceAccess) {
|
|
715
|
+
emitSoftWarn(scope, 'resourceAccess.missing', 'no resourceAccess block authored — the v1 minion runtime will deny every repository call by default (KD-11 fail-closed). Author { read: [...], write: [...] } in wildo.saas.config.ts > minions to opt-in.');
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
const { read, write } = entry.resourceAccess;
|
|
719
|
+
if (read.length === 0 && write.length === 0) {
|
|
720
|
+
emitSoftWarn(scope, 'resourceAccess.empty', 'resourceAccess block is present but both `read` and `write` are empty arrays — equivalent to omitting the block. Author at least one resource name to grant access.');
|
|
721
|
+
}
|
|
722
|
+
else if (read.length === 0) {
|
|
723
|
+
emitSoftWarn(scope, 'resourceAccess.write-only', 'resourceAccess.read is empty while resourceAccess.write is non-empty — every write will succeed but no repository read will. If this is intentional (write-only sink) keep as-is; otherwise add the resources you intend to read.');
|
|
724
|
+
}
|
|
725
|
+
else if (write.length === 0) {
|
|
726
|
+
emitSoftWarn(scope, 'resourceAccess.read-only', 'resourceAccess.write is empty while resourceAccess.read is non-empty — the minion will only be able to read. If this is intentional (read-only scraper) keep as-is; otherwise add the resources you intend to write.');
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
// M1 (audit-logging Phase 1+2 hardening) — coherence advisory: an ENABLED
|
|
730
|
+
// capability whose resolution mode is FAN_OUT (e.g. COMPLIANCE_AUDIT_TRAIL)
|
|
731
|
+
// writes to EVERY declared provider, so with ZERO providers declaring it the
|
|
732
|
+
// fan-out is a SILENT no-op — the exact compliance hole (an "enabled" audit
|
|
733
|
+
// trail that reaches nothing) a config check should surface. The inverse (a
|
|
734
|
+
// provider declaring a non-`enabled` capability) is already a HARD error in the
|
|
735
|
+
// provider-scope refinement, so only this enabled-but-unserved direction needs
|
|
736
|
+
// an advisory. Soft-warn (not fail-closed) so the enable-first-then-wire
|
|
737
|
+
// authoring order isn't blocked.
|
|
738
|
+
const capabilitiesDeclaredByAnyProvider = new Set();
|
|
739
|
+
const allProviderScopes = [
|
|
740
|
+
config.providers?.scopes.backend,
|
|
741
|
+
config.providers?.scopes.companion,
|
|
742
|
+
...Object.values(config.providers?.scopes.frontendServices ?? {}),
|
|
743
|
+
...Object.values(config.providers?.scopes.minions ?? {}),
|
|
744
|
+
...Object.values(config.providers?.scopes.workers ?? {}),
|
|
745
|
+
];
|
|
746
|
+
for (const scope of allProviderScopes) {
|
|
747
|
+
if (!scope)
|
|
748
|
+
continue;
|
|
749
|
+
for (const providerSelection of Object.values(scope.providers)) {
|
|
750
|
+
for (const capability of providerSelection.engineCapabilities) {
|
|
751
|
+
capabilitiesDeclaredByAnyProvider.add(capability);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
for (const [capabilityKey, activation] of Object.entries(config.engineCapabilities ?? {})) {
|
|
756
|
+
if (activation?.enabled !== true)
|
|
757
|
+
continue;
|
|
758
|
+
const capability = capabilityKey;
|
|
759
|
+
if (getEngineCapabilityResolutionMode(capability) !== EngineCapabilityResolutionMode.FAN_OUT)
|
|
760
|
+
continue;
|
|
761
|
+
if (!capabilitiesDeclaredByAnyProvider.has(capability)) {
|
|
762
|
+
emitSoftWarn('providers.engineCapabilities', `fanout-no-provider:${capability}`, `capability "${capability}" is enabled and FAN_OUT (every declared provider receives every emission), but NO provider in any scope declares it — its fan-out (e.g. the compliance audit trail) is a SILENT no-op. Declare at least one provider with engineCapabilities: ['${capability}'], or disable the capability.`);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
136
765
|
}
|
|
137
|
-
//# sourceMappingURL=define-saas-config.js.map
|
|
766
|
+
//# sourceMappingURL=define-saas-config.js.map
|