@wildo-ai/platform-config-lib 1.1.10 → 1.1.12
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 +83 -0
- package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
- package/dist/esm/blueprint/anchored-region.js +263 -0
- package/dist/esm/blueprint/anchored-region.js.map +1 -0
- package/dist/esm/blueprint/blueprint.schemas.d.ts +600 -0
- package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
- package/dist/esm/blueprint/blueprint.schemas.js +638 -0
- package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
- 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.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +29 -4
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +29 -4
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +131 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +139 -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.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 +249 -0
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
- package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-topology.contracts.js.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 +51 -0
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
- package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
- package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
- 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 +20 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +20 -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 +278 -0
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal-verifier.js +355 -0
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
- package/dist/esm/key-management/approval-seal.contracts.d.ts +128 -0
- package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal.contracts.js +135 -0
- package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
- package/dist/esm/key-management/data-key.contracts.d.ts +106 -0
- package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/data-key.contracts.js +54 -0
- package/dist/esm/key-management/data-key.contracts.js.map +1 -0
- package/dist/esm/key-management/es256-jws.d.ts +60 -0
- package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
- package/dist/esm/key-management/es256-jws.js +135 -0
- package/dist/esm/key-management/es256-jws.js.map +1 -0
- package/dist/esm/key-management/key-provider.spi.d.ts +158 -0
- package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
- package/dist/esm/key-management/key-provider.spi.js +38 -0
- package/dist/esm/key-management/key-provider.spi.js.map +1 -0
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts +83 -0
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
- package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
- package/dist/esm/key-management/keyring-status.contracts.d.ts +59 -0
- package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/keyring-status.contracts.js +45 -0
- package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
- 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 +91 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.js +96 -0
- package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
- package/dist/esm/key-management/signing-log-export.contracts.d.ts +215 -0
- package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
- package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts +98 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/vault-custody.contracts.js +154 -0
- package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
- 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 +13 -17
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +29 -30
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +22 -20
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +13 -14
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +27 -249
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +28 -3
- 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 +22 -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 +26 -0
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
- package/dist/esm/project-config/application-served-public-documents.loader.js +86 -0
- package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
- 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.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +344 -69
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +194 -143
- 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 +82 -348
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +262 -103
- 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 +4 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +5 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +5 -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 +39 -16
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
- package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
- package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
- package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +16 -10
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +103 -49
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +216 -16
- 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.js.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.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 +36 -9
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +54 -11
- 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 -85
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +40 -13
- 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 +101 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +128 -9
- 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.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +2 -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 +4 -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 +24 -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 +25 -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 +276 -0
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/platform-key-management.schemas.js +296 -0
- package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
- 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.js.map +1 -1
- package/dist/esm/registry/index.d.ts +3 -3
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +3 -3
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts +22 -2
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js +66 -3
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +11 -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 +40 -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 +324 -74
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +377 -19
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts +2 -0
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js +14 -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 +103 -5
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +213 -6
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
- 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 +72 -0
- package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
- package/dist/esm/registry/registry-url-resolution.js +157 -0
- package/dist/esm/registry/registry-url-resolution.js.map +1 -0
- 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.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +48 -0
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
- 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.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +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.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.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,39 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Soft-warn utility —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `(scope, key)` pair (e.g. `('minions.marketingScrapper', 'resourceAccess.empty')`),
|
|
22
|
-
* not a dotted field path.
|
|
23
|
-
*
|
|
24
|
-
* - The dev watcher re-parses on every save, so without an in-process
|
|
25
|
-
* repeat-cap a verbose minion ACL would spam the log on every
|
|
26
|
-
* keystroke. The `@unimplemented` warner solves dedupe per parse
|
|
27
|
-
* call (a fresh `Set` is captured per `defineSaasConfig` call); the
|
|
28
|
-
* soft-warn utility solves dedupe + cap PER PROCESS so a noisy
|
|
29
|
-
* advisory does not drown the watcher even under tight save loops.
|
|
2
|
+
* @fileoverview Soft-warn utility: a noisy-yet-non-fatal `process.stderr` channel for authoring advisories — a config
|
|
3
|
+
* shape that parses but is almost certainly not what the author meant (a minion with no `resourceAccess`, an enabled
|
|
4
|
+
* FAN_OUT capability no provider serves).
|
|
5
|
+
*
|
|
6
|
+
* It used to sit beside an `@unimplemented` field warner, which reported an authored field that parsed but had no
|
|
7
|
+
* runtime consumer. That warner was removed with its last field, the config `version` (#3496): a field nothing reads is
|
|
8
|
+
* now refused by the strict schemas instead of accepted with a warning. Soft-warns are a different thing and stay —
|
|
9
|
+
* they are not bound to an unread field, but to a shape the runtime will honour in a way the author probably did not
|
|
10
|
+
* intend.
|
|
11
|
+
*
|
|
12
|
+
* Why its shape:
|
|
13
|
+
*
|
|
14
|
+
* - Advisories like "your minion's `resourceAccess` whitelist is empty — you'll get blocked at every repository
|
|
15
|
+
* call" are PER-MINION, not per-field. The natural authoring key is a `(scope, key)` pair (e.g.
|
|
16
|
+
* `('minions.marketingScrapper', 'resourceAccess.empty')`), not a dotted field path.
|
|
17
|
+
*
|
|
18
|
+
* - The dev watcher re-parses on every save, so without an in-process repeat-cap a verbose minion ACL would spam the
|
|
19
|
+
* log on every keystroke. The soft-warn utility dedupes and caps PER PROCESS so a noisy advisory does not drown
|
|
20
|
+
* the watcher even under tight save loops.
|
|
30
21
|
*
|
|
31
22
|
* Design choices (all pinned by `__tests__/soft-warn.test.ts`):
|
|
32
23
|
*
|
|
33
|
-
* - **Channel = `process.stderr.write
|
|
34
|
-
*
|
|
35
|
-
* pretty-printer hijacks `console.warn`; writing to the FD keeps
|
|
36
|
-
* the line raw and grep-friendly.
|
|
24
|
+
* - **Channel = `process.stderr.write`**. The dev watcher's pretty-printer hijacks `console.warn`; writing to the FD
|
|
25
|
+
* keeps the line raw and grep-friendly, and write order is call order.
|
|
37
26
|
*
|
|
38
27
|
* - **Dedupe = process-wide on `(scope, key)`** with a configurable
|
|
39
28
|
* repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).
|
|
@@ -44,28 +33,16 @@
|
|
|
44
33
|
* call) because the SAME advisory firing on every dev-watcher save
|
|
45
34
|
* is exactly the noise we're trying to suppress.
|
|
46
35
|
*
|
|
47
|
-
* - **Emit ordering vs `@unimplemented`** — soft-warns emit AFTER the
|
|
48
|
-
* `@unimplemented` block in `defineSaasConfig`. The order is the
|
|
49
|
-
* contract because operators read the stream top-to-bottom: the
|
|
50
|
-
* "canonical" backlog warnings come first, the "soft authoring
|
|
51
|
-
* advisory" lines come after. `__tests__/soft-warn.test.ts`
|
|
52
|
-
* captures stderr writes in order and asserts the ordering by
|
|
53
|
-
* interleaving an `@unimplemented` warning with a soft-warn and
|
|
54
|
-
* pinning the resulting message sequence.
|
|
55
|
-
*
|
|
56
36
|
* - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.
|
|
57
37
|
* The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,
|
|
58
38
|
* `'workers'`) so a reader can grep `wildo-soft-warn:minions` to
|
|
59
|
-
* isolate per-minion advisories.
|
|
60
|
-
* distinct from `[wildo-saas-config]` / `[wildo-infra-env-config]`
|
|
61
|
-
* so the two streams never collide visually in the dev watcher.
|
|
39
|
+
* isolate per-minion advisories.
|
|
62
40
|
*
|
|
63
41
|
* - **Test reset hook = `__resetSoftWarnState`** — exported strictly
|
|
64
42
|
* for test usage. The state is a module-level `Map` because the
|
|
65
43
|
* "process-wide cap" semantic requires it; tests `vi.resetModules()`
|
|
66
44
|
* is too heavy for the cross-test isolation needed in
|
|
67
|
-
* `define-saas-config.
|
|
68
|
-
* warners interleaved). The reset hook is documented as
|
|
45
|
+
* `define-saas-config.authoring.test.ts`. The reset hook is documented as
|
|
69
46
|
* test-only via the leading underscore convention used elsewhere
|
|
70
47
|
* in this package.
|
|
71
48
|
*
|
|
@@ -81,9 +58,7 @@
|
|
|
81
58
|
*
|
|
82
59
|
* Removal contract:
|
|
83
60
|
*
|
|
84
|
-
* - When
|
|
85
|
-
* become hard parse errors (or migrate into `@unimplemented`
|
|
86
|
-
* surfaces because a backlog item is on file), the corresponding
|
|
61
|
+
* - When an advisory becomes a hard parse error, the corresponding
|
|
87
62
|
* `emitSoftWarn(...)` call sites MUST be deleted in the same commit
|
|
88
63
|
* as the new behaviour. Leaving a stale soft-warn is worse than
|
|
89
64
|
* silence — operators will start ignoring the channel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soft-warn.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"soft-warn.d.ts","sourceRoot":"","sources":["../../../src/_unimplemented/soft-warn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAkCH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAmB9E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -1,39 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Soft-warn utility —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `(scope, key)` pair (e.g. `('minions.marketingScrapper', 'resourceAccess.empty')`),
|
|
22
|
-
* not a dotted field path.
|
|
23
|
-
*
|
|
24
|
-
* - The dev watcher re-parses on every save, so without an in-process
|
|
25
|
-
* repeat-cap a verbose minion ACL would spam the log on every
|
|
26
|
-
* keystroke. The `@unimplemented` warner solves dedupe per parse
|
|
27
|
-
* call (a fresh `Set` is captured per `defineSaasConfig` call); the
|
|
28
|
-
* soft-warn utility solves dedupe + cap PER PROCESS so a noisy
|
|
29
|
-
* advisory does not drown the watcher even under tight save loops.
|
|
2
|
+
* @fileoverview Soft-warn utility: a noisy-yet-non-fatal `process.stderr` channel for authoring advisories — a config
|
|
3
|
+
* shape that parses but is almost certainly not what the author meant (a minion with no `resourceAccess`, an enabled
|
|
4
|
+
* FAN_OUT capability no provider serves).
|
|
5
|
+
*
|
|
6
|
+
* It used to sit beside an `@unimplemented` field warner, which reported an authored field that parsed but had no
|
|
7
|
+
* runtime consumer. That warner was removed with its last field, the config `version` (#3496): a field nothing reads is
|
|
8
|
+
* now refused by the strict schemas instead of accepted with a warning. Soft-warns are a different thing and stay —
|
|
9
|
+
* they are not bound to an unread field, but to a shape the runtime will honour in a way the author probably did not
|
|
10
|
+
* intend.
|
|
11
|
+
*
|
|
12
|
+
* Why its shape:
|
|
13
|
+
*
|
|
14
|
+
* - Advisories like "your minion's `resourceAccess` whitelist is empty — you'll get blocked at every repository
|
|
15
|
+
* call" are PER-MINION, not per-field. The natural authoring key is a `(scope, key)` pair (e.g.
|
|
16
|
+
* `('minions.marketingScrapper', 'resourceAccess.empty')`), not a dotted field path.
|
|
17
|
+
*
|
|
18
|
+
* - The dev watcher re-parses on every save, so without an in-process repeat-cap a verbose minion ACL would spam the
|
|
19
|
+
* log on every keystroke. The soft-warn utility dedupes and caps PER PROCESS so a noisy advisory does not drown
|
|
20
|
+
* the watcher even under tight save loops.
|
|
30
21
|
*
|
|
31
22
|
* Design choices (all pinned by `__tests__/soft-warn.test.ts`):
|
|
32
23
|
*
|
|
33
|
-
* - **Channel = `process.stderr.write
|
|
34
|
-
*
|
|
35
|
-
* pretty-printer hijacks `console.warn`; writing to the FD keeps
|
|
36
|
-
* the line raw and grep-friendly.
|
|
24
|
+
* - **Channel = `process.stderr.write`**. The dev watcher's pretty-printer hijacks `console.warn`; writing to the FD
|
|
25
|
+
* keeps the line raw and grep-friendly, and write order is call order.
|
|
37
26
|
*
|
|
38
27
|
* - **Dedupe = process-wide on `(scope, key)`** with a configurable
|
|
39
28
|
* repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).
|
|
@@ -44,28 +33,16 @@
|
|
|
44
33
|
* call) because the SAME advisory firing on every dev-watcher save
|
|
45
34
|
* is exactly the noise we're trying to suppress.
|
|
46
35
|
*
|
|
47
|
-
* - **Emit ordering vs `@unimplemented`** — soft-warns emit AFTER the
|
|
48
|
-
* `@unimplemented` block in `defineSaasConfig`. The order is the
|
|
49
|
-
* contract because operators read the stream top-to-bottom: the
|
|
50
|
-
* "canonical" backlog warnings come first, the "soft authoring
|
|
51
|
-
* advisory" lines come after. `__tests__/soft-warn.test.ts`
|
|
52
|
-
* captures stderr writes in order and asserts the ordering by
|
|
53
|
-
* interleaving an `@unimplemented` warning with a soft-warn and
|
|
54
|
-
* pinning the resulting message sequence.
|
|
55
|
-
*
|
|
56
36
|
* - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.
|
|
57
37
|
* The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,
|
|
58
38
|
* `'workers'`) so a reader can grep `wildo-soft-warn:minions` to
|
|
59
|
-
* isolate per-minion advisories.
|
|
60
|
-
* distinct from `[wildo-saas-config]` / `[wildo-infra-env-config]`
|
|
61
|
-
* so the two streams never collide visually in the dev watcher.
|
|
39
|
+
* isolate per-minion advisories.
|
|
62
40
|
*
|
|
63
41
|
* - **Test reset hook = `__resetSoftWarnState`** — exported strictly
|
|
64
42
|
* for test usage. The state is a module-level `Map` because the
|
|
65
43
|
* "process-wide cap" semantic requires it; tests `vi.resetModules()`
|
|
66
44
|
* is too heavy for the cross-test isolation needed in
|
|
67
|
-
* `define-saas-config.
|
|
68
|
-
* warners interleaved). The reset hook is documented as
|
|
45
|
+
* `define-saas-config.authoring.test.ts`. The reset hook is documented as
|
|
69
46
|
* test-only via the leading underscore convention used elsewhere
|
|
70
47
|
* in this package.
|
|
71
48
|
*
|
|
@@ -81,9 +58,7 @@
|
|
|
81
58
|
*
|
|
82
59
|
* Removal contract:
|
|
83
60
|
*
|
|
84
|
-
* - When
|
|
85
|
-
* become hard parse errors (or migrate into `@unimplemented`
|
|
86
|
-
* surfaces because a backlog item is on file), the corresponding
|
|
61
|
+
* - When an advisory becomes a hard parse error, the corresponding
|
|
87
62
|
* `emitSoftWarn(...)` call sites MUST be deleted in the same commit
|
|
88
63
|
* as the new behaviour. Leaving a stale soft-warn is worse than
|
|
89
64
|
* silence — operators will start ignoring the channel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soft-warn.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"soft-warn.js","sourceRoot":"","sources":["../../../src/_unimplemented/soft-warn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEhD,SAAS,eAAe;IACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IAC9C,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,oBAAoB,CAAC;IACjE,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAC7E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,GAAW,EAAE,OAAe;IACtE,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEnD,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC;IAC1B,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEnC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,KAAK,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC;IAExE,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,oBAAoB,KAAK,KAAK,GAAG,kDAAkD,GAAG,0CAA0C,CACjI,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IAClC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC","sourcesContent":["/**\n * @fileoverview Soft-warn utility: a noisy-yet-non-fatal `process.stderr` channel for authoring advisories — a config\n * shape that parses but is almost certainly not what the author meant (a minion with no `resourceAccess`, an enabled\n * FAN_OUT capability no provider serves).\n *\n * It used to sit beside an `@unimplemented` field warner, which reported an authored field that parsed but had no\n * runtime consumer. That warner was removed with its last field, the config `version` (#3496): a field nothing reads is\n * now refused by the strict schemas instead of accepted with a warning. Soft-warns are a different thing and stay —\n * they are not bound to an unread field, but to a shape the runtime will honour in a way the author probably did not\n * intend.\n *\n * Why its shape:\n *\n * - Advisories like \"your minion's `resourceAccess` whitelist is empty — you'll get blocked at every repository\n * call\" are PER-MINION, not per-field. The natural authoring key is a `(scope, key)` pair (e.g.\n * `('minions.marketingScrapper', 'resourceAccess.empty')`), not a dotted field path.\n *\n * - The dev watcher re-parses on every save, so without an in-process repeat-cap a verbose minion ACL would spam the\n * log on every keystroke. The soft-warn utility dedupes and caps PER PROCESS so a noisy advisory does not drown\n * the watcher even under tight save loops.\n *\n * Design choices (all pinned by `__tests__/soft-warn.test.ts`):\n *\n * - **Channel = `process.stderr.write`**. The dev watcher's pretty-printer hijacks `console.warn`; writing to the FD\n * keeps the line raw and grep-friendly, and write order is call order.\n *\n * - **Dedupe = process-wide on `(scope, key)`** with a configurable\n * repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).\n * After the cap is reached the utility emits ONE final\n * `[wildo-soft-warn:<scope>] <key>: suppressed further occurrences\n * (cap reached: <N>; override via WILDO_SOFT_WARN_LIMIT).` line and\n * falls silent for that pair. The cap is per-process (not per parse\n * call) because the SAME advisory firing on every dev-watcher save\n * is exactly the noise we're trying to suppress.\n *\n * - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.\n * The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,\n * `'workers'`) so a reader can grep `wildo-soft-warn:minions` to\n * isolate per-minion advisories.\n *\n * - **Test reset hook = `__resetSoftWarnState`** — exported strictly\n * for test usage. The state is a module-level `Map` because the\n * \"process-wide cap\" semantic requires it; tests `vi.resetModules()`\n * is too heavy for the cross-test isolation needed in\n * `define-saas-config.authoring.test.ts`. The reset hook is documented as\n * test-only via the leading underscore convention used elsewhere\n * in this package.\n *\n * NOT a replacement for schema validation:\n *\n * - Soft-warns DO NOT prevent parse — they are written AFTER the\n * `WildoSaasConfigSchema.parse()` returns successfully.\n * - The utility is intentionally NOT typed against a known list of\n * `(scope, key)` pairs. The caller owns the taxonomy — adding a\n * closed enum here would force a circular dep with\n * `define-saas-config.ts` and force every new advisory to touch\n * this file.\n *\n * Removal contract:\n *\n * - When an advisory becomes a hard parse error, the corresponding\n * `emitSoftWarn(...)` call sites MUST be deleted in the same commit\n * as the new behaviour. Leaving a stale soft-warn is worse than\n * silence — operators will start ignoring the channel.\n */\n\nconst DEFAULT_REPEAT_LIMIT = 5;\n\n/**\n * Module-level state — process-wide, deliberately so the dev watcher's\n * per-save re-parses do not re-emit the same advisory on every keystroke.\n *\n * Keys are a serialized tuple `[scope, key]`, not a raw concatenated\n * string. This keeps the dedupe channel robust even when either input\n * contains punctuation like `::` — author-authored identifiers must not\n * be able to make advisory emission throw after a successful config\n * parse.\n *\n * The value is the count of actual emitted advisory lines for the pair.\n * Once the count reaches the cap, the cap-reached suppression line is\n * written exactly once.\n */\nconst softWarnState = new Map<string, number>();\n\nfunction readRepeatLimit(): number {\n const raw = process.env.WILDO_SOFT_WARN_LIMIT;\n if (raw === undefined || raw === '') return DEFAULT_REPEAT_LIMIT;\n const normalized = raw.trim();\n if (!/^[1-9]\\d*$/.test(normalized)) return DEFAULT_REPEAT_LIMIT;\n const parsed = Number(normalized);\n if (!Number.isSafeInteger(parsed) || parsed < 1) return DEFAULT_REPEAT_LIMIT;\n return parsed;\n}\n\nfunction serializeDedupeKey(scope: string, key: string): string {\n return JSON.stringify([scope, key]);\n}\n\n/**\n * Emit a single-line soft-warn to `process.stderr`.\n *\n * @param scope - Authoring scope, surfaced verbatim in the prefix\n * (e.g. `'minions.marketingScrapper'`, `'workers'`).\n * @param key - Stable advisory id within the scope\n * (e.g. `'resourceAccess.empty-write'`,\n * `'resourceAccess.unknown-resource'`).\n * @param message - Free-form advisory text. Newline appended by the\n * utility (do not include trailing `\\n` in `message`).\n *\n * Behaviour:\n *\n * - Writes the formatted line to `process.stderr.write`.\n * - Increments the per-`(scope, key)` counter.\n * - When the counter reaches the configured cap, the formatted line\n * is written normally AND followed by a single\n * `[wildo-soft-warn:<scope>] <key>: suppressed further occurrences\n * (cap reached: <N>)` line. Subsequent calls to the same\n * `(scope, key)` pair are silent.\n * - Dedupe is driven by the serialized `(scope, key)` tuple, so\n * punctuation inside either input does NOT affect correctness.\n */\nexport function emitSoftWarn(scope: string, key: string, message: string): void {\n const cap = readRepeatLimit();\n const dedupeKey = serializeDedupeKey(scope, key);\n const previous = softWarnState.get(dedupeKey) ?? 0;\n\n if (previous >= cap) {\n return;\n }\n\n const next = previous + 1;\n softWarnState.set(dedupeKey, next);\n\n process.stderr.write(`[wildo-soft-warn:${scope}] ${key}: ${message}\\n`);\n\n if (next === cap) {\n process.stderr.write(\n `[wildo-soft-warn:${scope}] ${key}: suppressed further occurrences (cap reached: ${cap}; override via WILDO_SOFT_WARN_LIMIT).\\n`,\n );\n }\n}\n\n/**\n * Test-only reset hook. Clears the process-wide `(scope, key) → count`\n * map so each test starts from a clean slate. Production call sites\n * must NEVER invoke this — the cap is the contract.\n *\n * Named with a leading underscore to match the package-wide convention\n * for \"exported strictly for test usage\" hooks.\n */\nexport function __resetSoftWarnState(): void {\n softWarnState.clear();\n}\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchor SLOTS and blueprint CONTRIBUTIONS in free text (epic #2856, #2862) — the grammar, read and write.
|
|
3
|
+
*
|
|
4
|
+
* A slot is an extension point a base file declares; a blueprint writes its text inside it as a contribution span
|
|
5
|
+
* of its own, so layers stack in order and each one's text stays identifiable:
|
|
6
|
+
*
|
|
7
|
+
* ```markdown
|
|
8
|
+
* <!-- @wildo_anchor:slot:start application.guide -->
|
|
9
|
+
* <!-- @wildo_anchor:contribution:start acme/internal-tool application.guide -->
|
|
10
|
+
* The layer's text.
|
|
11
|
+
* <!-- @wildo_anchor:contribution:end acme/internal-tool application.guide -->
|
|
12
|
+
* <!-- @wildo_anchor:slot:end application.guide -->
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Only free text needs this. A TypeScript base file exposes NAMED DECLARATIONS a blueprint sets instead
|
|
16
|
+
* (`BlueprintDeclarationFile`), which is the preferred and far more common shape: measured on Wonder Procurement
|
|
17
|
+
* (#2860), the agent guide was the one change to a base file that was not the value of a declaration.
|
|
18
|
+
*
|
|
19
|
+
* ## Strict, like the writer it is modelled on
|
|
20
|
+
*
|
|
21
|
+
* The rules are those of `rewriteNginxCspMarkerPairsString` (`project-config/shared/csp-emit.ts`): a marker is a
|
|
22
|
+
* whole line; a nested slot, an end with no start, an unclosed span, a slot declared twice, a contribution outside its
|
|
23
|
+
* slot or naming another slot all REFUSE, because a guess at a damaged boundary writes text into the wrong place. So
|
|
24
|
+
* does any other comment line opening with `@wildo_anchor:` (a third argument, text after the marker): a damaged
|
|
25
|
+
* marker never reads as plain text, while prose that only mentions the family does. In Markdown, lines inside a code fence are text, so a guide can SHOW the markers. A contribution body
|
|
26
|
+
* may not contain a marker line, and every write re-reads its own result.
|
|
27
|
+
*
|
|
28
|
+
* Indentation is kept, every line keeps its own terminator (a file mixing `\n` and `\r\n` stays mixed; added lines
|
|
29
|
+
* take the more common one), and a write that changes nothing returns the input unchanged.
|
|
30
|
+
*
|
|
31
|
+
* The marker family is deliberately not `@wildo_source`: that one is an extraction contract for framework knowledge,
|
|
32
|
+
* and a refactor of what knowledge extracts must never move a place applications are written into.
|
|
33
|
+
*/
|
|
34
|
+
/** How a file writes a whole-line comment. */
|
|
35
|
+
export declare enum AnchorCommentStyle {
|
|
36
|
+
/** Markdown and HTML: `<!-- … -->`. Survives a Handlebars render, which `{{!-- --}}` would not. */
|
|
37
|
+
HTML = "html",
|
|
38
|
+
/** TypeScript and JavaScript: `// …`. */
|
|
39
|
+
LINE_SLASH = "line-slash",
|
|
40
|
+
/** YAML, shell, Dockerfile, `.gitignore`: `# …`. */
|
|
41
|
+
HASH = "hash"
|
|
42
|
+
}
|
|
43
|
+
/** The comment style of a file, by its name. */
|
|
44
|
+
export declare function anchorCommentStyleForPath(path: string): AnchorCommentStyle;
|
|
45
|
+
/** One contribution span inside a slot. Line numbers are zero-based indexes into the file's lines. */
|
|
46
|
+
export interface AnchorContribution {
|
|
47
|
+
readonly blueprintId: string;
|
|
48
|
+
readonly startLine: number;
|
|
49
|
+
readonly endLine: number;
|
|
50
|
+
/** The span's text, markers excluded. */
|
|
51
|
+
readonly body: string;
|
|
52
|
+
}
|
|
53
|
+
/** One slot as the file holds it. */
|
|
54
|
+
export interface AnchorSlot {
|
|
55
|
+
readonly id: string;
|
|
56
|
+
readonly startLine: number;
|
|
57
|
+
readonly endLine: number;
|
|
58
|
+
readonly indent: string;
|
|
59
|
+
readonly contributions: readonly AnchorContribution[];
|
|
60
|
+
/** The slot's text OUTSIDE every contribution span — what the application wrote there itself. */
|
|
61
|
+
readonly ownText: string;
|
|
62
|
+
}
|
|
63
|
+
/** Every slot of a file, by id. Refuses a damaged structure rather than reading around it. */
|
|
64
|
+
export declare function readAnchorSlots(content: string, style: AnchorCommentStyle): ReadonlyMap<string, AnchorSlot>;
|
|
65
|
+
/**
|
|
66
|
+
* Write `body` as `blueprintId`'s contribution to `slotId`: replace its existing span, or add one just before the
|
|
67
|
+
* slot's end marker (after every earlier layer's). Refuses a slot the file does not declare. Returns the content
|
|
68
|
+
* unchanged when the span already holds exactly this body.
|
|
69
|
+
*/
|
|
70
|
+
export declare function writeAnchorContribution(content: string, style: AnchorCommentStyle, input: {
|
|
71
|
+
readonly slotId: string;
|
|
72
|
+
readonly blueprintId: string;
|
|
73
|
+
readonly body: string;
|
|
74
|
+
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* A slot's whole text with every contribution marker removed and blank lines trimmed at both ends: what a reader
|
|
77
|
+
* sees there, whoever wrote it. Two files whose slots read the same this way say the same thing, which is how an
|
|
78
|
+
* export compares the slot it reproduces with the one the defining application holds.
|
|
79
|
+
*/
|
|
80
|
+
export declare function readableAnchorSlotText(content: string, style: AnchorCommentStyle, slotId: string): string | undefined;
|
|
81
|
+
/** The file's content with every contribution marker line removed — for comparing files that differ only by them. */
|
|
82
|
+
export declare function withoutAnchorContributionMarkers(content: string, style: AnchorCommentStyle): string;
|
|
83
|
+
//# sourceMappingURL=anchored-region.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchored-region.d.ts","sourceRoot":"","sources":["../../../src/blueprint/anchored-region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,8CAA8C;AAC9C,oBAAY,kBAAkB;IAC5B,mGAAmG;IACnG,IAAI,SAAS;IACb,yCAAyC;IACzC,UAAU,eAAe;IACzB,oDAAoD;IACpD,IAAI,SAAS;CACd;AAED,gDAAgD;AAChD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAM1E;AAkED,sGAAsG;AACtG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtD,iGAAiG;IACjG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAqCD,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAsD3G;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtF,MAAM,CAwBR;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQrH;AAED,qHAAqH;AACrH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAOnG"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchor SLOTS and blueprint CONTRIBUTIONS in free text (epic #2856, #2862) — the grammar, read and write.
|
|
3
|
+
*
|
|
4
|
+
* A slot is an extension point a base file declares; a blueprint writes its text inside it as a contribution span
|
|
5
|
+
* of its own, so layers stack in order and each one's text stays identifiable:
|
|
6
|
+
*
|
|
7
|
+
* ```markdown
|
|
8
|
+
* <!-- @wildo_anchor:slot:start application.guide -->
|
|
9
|
+
* <!-- @wildo_anchor:contribution:start acme/internal-tool application.guide -->
|
|
10
|
+
* The layer's text.
|
|
11
|
+
* <!-- @wildo_anchor:contribution:end acme/internal-tool application.guide -->
|
|
12
|
+
* <!-- @wildo_anchor:slot:end application.guide -->
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Only free text needs this. A TypeScript base file exposes NAMED DECLARATIONS a blueprint sets instead
|
|
16
|
+
* (`BlueprintDeclarationFile`), which is the preferred and far more common shape: measured on Wonder Procurement
|
|
17
|
+
* (#2860), the agent guide was the one change to a base file that was not the value of a declaration.
|
|
18
|
+
*
|
|
19
|
+
* ## Strict, like the writer it is modelled on
|
|
20
|
+
*
|
|
21
|
+
* The rules are those of `rewriteNginxCspMarkerPairsString` (`project-config/shared/csp-emit.ts`): a marker is a
|
|
22
|
+
* whole line; a nested slot, an end with no start, an unclosed span, a slot declared twice, a contribution outside its
|
|
23
|
+
* slot or naming another slot all REFUSE, because a guess at a damaged boundary writes text into the wrong place. So
|
|
24
|
+
* does any other comment line opening with `@wildo_anchor:` (a third argument, text after the marker): a damaged
|
|
25
|
+
* marker never reads as plain text, while prose that only mentions the family does. In Markdown, lines inside a code fence are text, so a guide can SHOW the markers. A contribution body
|
|
26
|
+
* may not contain a marker line, and every write re-reads its own result.
|
|
27
|
+
*
|
|
28
|
+
* Indentation is kept, every line keeps its own terminator (a file mixing `\n` and `\r\n` stays mixed; added lines
|
|
29
|
+
* take the more common one), and a write that changes nothing returns the input unchanged.
|
|
30
|
+
*
|
|
31
|
+
* The marker family is deliberately not `@wildo_source`: that one is an extraction contract for framework knowledge,
|
|
32
|
+
* and a refactor of what knowledge extracts must never move a place applications are written into.
|
|
33
|
+
*/
|
|
34
|
+
/** How a file writes a whole-line comment. */
|
|
35
|
+
export var AnchorCommentStyle;
|
|
36
|
+
(function (AnchorCommentStyle) {
|
|
37
|
+
/** Markdown and HTML: `<!-- … -->`. Survives a Handlebars render, which `{{!-- --}}` would not. */
|
|
38
|
+
AnchorCommentStyle["HTML"] = "html";
|
|
39
|
+
/** TypeScript and JavaScript: `// …`. */
|
|
40
|
+
AnchorCommentStyle["LINE_SLASH"] = "line-slash";
|
|
41
|
+
/** YAML, shell, Dockerfile, `.gitignore`: `# …`. */
|
|
42
|
+
AnchorCommentStyle["HASH"] = "hash";
|
|
43
|
+
})(AnchorCommentStyle || (AnchorCommentStyle = {}));
|
|
44
|
+
/** The comment style of a file, by its name. */
|
|
45
|
+
export function anchorCommentStyleForPath(path) {
|
|
46
|
+
const name = path.split('/').pop() ?? path;
|
|
47
|
+
if (/\.(md|mdx|html?)$/i.test(name))
|
|
48
|
+
return AnchorCommentStyle.HTML;
|
|
49
|
+
if (/\.(ts|tsx|mts|cts|js|jsx|mjs|cjs)$/i.test(name))
|
|
50
|
+
return AnchorCommentStyle.LINE_SLASH;
|
|
51
|
+
if (/\.(ya?ml|sh|toml)$/i.test(name) || name === 'Dockerfile' || name.startsWith('.'))
|
|
52
|
+
return AnchorCommentStyle.HASH;
|
|
53
|
+
throw new Error(`No anchor comment style is defined for ${path}.`);
|
|
54
|
+
}
|
|
55
|
+
/** What a marker line opens or closes. */
|
|
56
|
+
var AnchorMarkerKind;
|
|
57
|
+
(function (AnchorMarkerKind) {
|
|
58
|
+
AnchorMarkerKind["SLOT"] = "slot";
|
|
59
|
+
AnchorMarkerKind["CONTRIBUTION"] = "contribution";
|
|
60
|
+
})(AnchorMarkerKind || (AnchorMarkerKind = {}));
|
|
61
|
+
/** Which end of a span a marker line is. */
|
|
62
|
+
var AnchorMarkerEdge;
|
|
63
|
+
(function (AnchorMarkerEdge) {
|
|
64
|
+
AnchorMarkerEdge["START"] = "start";
|
|
65
|
+
AnchorMarkerEdge["END"] = "end";
|
|
66
|
+
})(AnchorMarkerEdge || (AnchorMarkerEdge = {}));
|
|
67
|
+
const MARKER_BODY = '@wildo_anchor:(slot|contribution):(start|end)\\s+(\\S+(?:\\s+\\S+)?)';
|
|
68
|
+
/** The marker family, as text. A contribution body may not contain it at all. */
|
|
69
|
+
const MARKER_FAMILY = '@wildo_anchor:';
|
|
70
|
+
/**
|
|
71
|
+
* A line that OPENS a comment with the marker family — what a marker looks like. One that is not a well-formed marker
|
|
72
|
+
* refuses rather than reading as text. Prose that merely MENTIONS the family ("the `@wildo_anchor:slot` markers") is
|
|
73
|
+
* text, so a guide can talk about its own slots.
|
|
74
|
+
*/
|
|
75
|
+
const MARKER_SHAPED_LINES = {
|
|
76
|
+
[AnchorCommentStyle.HTML]: /^\s*<!--\s*@wildo_anchor:/,
|
|
77
|
+
[AnchorCommentStyle.LINE_SLASH]: /^\s*\/\/\s*@wildo_anchor:/,
|
|
78
|
+
[AnchorCommentStyle.HASH]: /^\s*#\s*@wildo_anchor:/,
|
|
79
|
+
};
|
|
80
|
+
/** A Markdown code fence: markers shown inside one are an example, not a slot. */
|
|
81
|
+
const CODE_FENCE_PATTERN = /^\s*(```|~~~)/;
|
|
82
|
+
const MARKER_PATTERNS = {
|
|
83
|
+
[AnchorCommentStyle.HTML]: new RegExp(`^(\\s*)<!--\\s*${MARKER_BODY}\\s*-->\\s*$`),
|
|
84
|
+
[AnchorCommentStyle.LINE_SLASH]: new RegExp(`^(\\s*)//\\s*${MARKER_BODY}\\s*$`),
|
|
85
|
+
[AnchorCommentStyle.HASH]: new RegExp(`^(\\s*)#\\s*${MARKER_BODY}\\s*$`),
|
|
86
|
+
};
|
|
87
|
+
function parseMarker(line, style) {
|
|
88
|
+
const match = MARKER_PATTERNS[style].exec(line);
|
|
89
|
+
if (match === null)
|
|
90
|
+
return null;
|
|
91
|
+
return {
|
|
92
|
+
kind: match[2],
|
|
93
|
+
edge: match[3],
|
|
94
|
+
args: (match[4] ?? '').split(/\s+/),
|
|
95
|
+
indent: match[1] ?? '',
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function renderMarker(style, indent, kind, edge, args) {
|
|
99
|
+
const body = `@wildo_anchor:${kind}:${edge} ${args.join(' ')}`;
|
|
100
|
+
switch (style) {
|
|
101
|
+
case AnchorCommentStyle.HTML:
|
|
102
|
+
return `${indent}<!-- ${body} -->`;
|
|
103
|
+
case AnchorCommentStyle.LINE_SLASH:
|
|
104
|
+
return `${indent}// ${body}`;
|
|
105
|
+
case AnchorCommentStyle.HASH:
|
|
106
|
+
return `${indent}# ${body}`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The file's lines, each line's own terminator (the last one's is `''`), and the terminator new lines get: the one
|
|
111
|
+
* the file uses most. Keeping each terminator is what lets a write leave every line it did not add byte-identical,
|
|
112
|
+
* even in a file that mixes `\n` and `\r\n`.
|
|
113
|
+
*/
|
|
114
|
+
function splitLines(content) {
|
|
115
|
+
const lines = [];
|
|
116
|
+
const terminators = [];
|
|
117
|
+
const pattern = /\r?\n/g;
|
|
118
|
+
let start = 0;
|
|
119
|
+
for (const match of content.matchAll(pattern)) {
|
|
120
|
+
lines.push(content.slice(start, match.index));
|
|
121
|
+
terminators.push(match[0]);
|
|
122
|
+
start = (match.index ?? 0) + match[0].length;
|
|
123
|
+
}
|
|
124
|
+
lines.push(content.slice(start));
|
|
125
|
+
terminators.push('');
|
|
126
|
+
const crlf = terminators.filter((terminator) => terminator === '\r\n').length;
|
|
127
|
+
const lf = terminators.filter((terminator) => terminator === '\n').length;
|
|
128
|
+
return { lines, terminators, eol: crlf > lf ? '\r\n' : '\n' };
|
|
129
|
+
}
|
|
130
|
+
function joinLines(lines, terminators) {
|
|
131
|
+
return lines.map((line, index) => `${line}${terminators[index] ?? ''}`).join('');
|
|
132
|
+
}
|
|
133
|
+
/** Drop blank lines at both ends of a text block. */
|
|
134
|
+
function trimBlankLines(lines) {
|
|
135
|
+
let start = 0;
|
|
136
|
+
let end = lines.length;
|
|
137
|
+
while (start < end && lines[start]?.trim() === '')
|
|
138
|
+
start += 1;
|
|
139
|
+
while (end > start && lines[end - 1]?.trim() === '')
|
|
140
|
+
end -= 1;
|
|
141
|
+
return lines.slice(start, end).join('\n');
|
|
142
|
+
}
|
|
143
|
+
/** Every slot of a file, by id. Refuses a damaged structure rather than reading around it. */
|
|
144
|
+
export function readAnchorSlots(content, style) {
|
|
145
|
+
const { lines } = splitLines(content);
|
|
146
|
+
const slots = new Map();
|
|
147
|
+
let open = null;
|
|
148
|
+
let openContribution = null;
|
|
149
|
+
let insideFence = false;
|
|
150
|
+
lines.forEach((line, index) => {
|
|
151
|
+
const where = `line ${index + 1}`;
|
|
152
|
+
if (style === AnchorCommentStyle.HTML && CODE_FENCE_PATTERN.test(line))
|
|
153
|
+
insideFence = !insideFence;
|
|
154
|
+
const marker = insideFence ? null : parseMarker(line, style);
|
|
155
|
+
if (marker === null && !insideFence && MARKER_SHAPED_LINES[style].test(line)) {
|
|
156
|
+
throw new Error(`The ${MARKER_FAMILY} line at ${where} is not a well-formed marker (a slot names one id, a contribution a blueprint and a slot, and the marker is the whole line).`);
|
|
157
|
+
}
|
|
158
|
+
if (marker === null) {
|
|
159
|
+
if (openContribution !== null)
|
|
160
|
+
openContribution.body.push(line);
|
|
161
|
+
else if (open !== null)
|
|
162
|
+
open.own.push(line);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (marker.kind === AnchorMarkerKind.SLOT) {
|
|
166
|
+
const [id] = marker.args;
|
|
167
|
+
if (marker.args.length !== 1 || id === undefined)
|
|
168
|
+
throw new Error(`Anchor slot marker at ${where} must name exactly one slot.`);
|
|
169
|
+
if (marker.edge === AnchorMarkerEdge.START) {
|
|
170
|
+
if (open !== null)
|
|
171
|
+
throw new Error(`Anchor slot '${id}' at ${where} opens inside slot '${open.id}': slots do not nest.`);
|
|
172
|
+
if (slots.has(id))
|
|
173
|
+
throw new Error(`Anchor slot '${id}' is declared twice (again at ${where}).`);
|
|
174
|
+
open = { id, startLine: index, indent: marker.indent, contributions: [], own: [] };
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (open === null || open.id !== id)
|
|
178
|
+
throw new Error(`Anchor slot end '${id}' at ${where} closes no open slot of that name.`);
|
|
179
|
+
if (openContribution !== null)
|
|
180
|
+
throw new Error(`Anchor slot '${id}' closes at ${where} inside an unclosed contribution of '${openContribution.blueprintId}'.`);
|
|
181
|
+
slots.set(id, { id, startLine: open.startLine, endLine: index, indent: open.indent, contributions: open.contributions, ownText: trimBlankLines(open.own) });
|
|
182
|
+
open = null;
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const [blueprintId, slotId] = marker.args;
|
|
186
|
+
if (marker.args.length !== 2 || blueprintId === undefined || slotId === undefined) {
|
|
187
|
+
throw new Error(`Anchor contribution marker at ${where} must name a blueprint and a slot.`);
|
|
188
|
+
}
|
|
189
|
+
if (open === null || open.id !== slotId)
|
|
190
|
+
throw new Error(`Contribution of '${blueprintId}' at ${where} names slot '${slotId}' but sits outside it.`);
|
|
191
|
+
if (marker.edge === AnchorMarkerEdge.START) {
|
|
192
|
+
if (openContribution !== null)
|
|
193
|
+
throw new Error(`Contribution of '${blueprintId}' at ${where} opens inside the contribution of '${openContribution.blueprintId}'.`);
|
|
194
|
+
if (open.contributions.some((contribution) => contribution.blueprintId === blueprintId)) {
|
|
195
|
+
throw new Error(`Blueprint '${blueprintId}' contributes to slot '${slotId}' twice (again at ${where}).`);
|
|
196
|
+
}
|
|
197
|
+
openContribution = { blueprintId, startLine: index, body: [] };
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (openContribution === null || openContribution.blueprintId !== blueprintId) {
|
|
201
|
+
throw new Error(`Contribution end of '${blueprintId}' at ${where} closes no open contribution of that blueprint.`);
|
|
202
|
+
}
|
|
203
|
+
open.contributions.push({ blueprintId, startLine: openContribution.startLine, endLine: index, body: openContribution.body.join('\n') });
|
|
204
|
+
openContribution = null;
|
|
205
|
+
});
|
|
206
|
+
if (open !== null)
|
|
207
|
+
throw new Error(`Anchor slot '${open.id}' is never closed.`);
|
|
208
|
+
return slots;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Write `body` as `blueprintId`'s contribution to `slotId`: replace its existing span, or add one just before the
|
|
212
|
+
* slot's end marker (after every earlier layer's). Refuses a slot the file does not declare. Returns the content
|
|
213
|
+
* unchanged when the span already holds exactly this body.
|
|
214
|
+
*/
|
|
215
|
+
export function writeAnchorContribution(content, style, input) {
|
|
216
|
+
const slot = readAnchorSlots(content, style).get(input.slotId);
|
|
217
|
+
if (slot === undefined)
|
|
218
|
+
throw new Error(`No anchor slot '${input.slotId}' is declared in this file.`);
|
|
219
|
+
const { lines, terminators, eol } = splitLines(content);
|
|
220
|
+
const bodyLines = input.body === '' ? [] : input.body.replace(/\r?\n$/, '').split(/\r?\n/);
|
|
221
|
+
if (bodyLines.some((line) => line.includes(MARKER_FAMILY))) {
|
|
222
|
+
throw new Error(`The contribution of '${input.blueprintId}' to slot '${input.slotId}' contains a ${MARKER_FAMILY} line, which would break the slot it is written into.`);
|
|
223
|
+
}
|
|
224
|
+
const span = [
|
|
225
|
+
renderMarker(style, slot.indent, AnchorMarkerKind.CONTRIBUTION, AnchorMarkerEdge.START, [input.blueprintId, input.slotId]),
|
|
226
|
+
...bodyLines,
|
|
227
|
+
renderMarker(style, slot.indent, AnchorMarkerKind.CONTRIBUTION, AnchorMarkerEdge.END, [input.blueprintId, input.slotId]),
|
|
228
|
+
];
|
|
229
|
+
const spanTerminators = span.map(() => eol);
|
|
230
|
+
const existing = slot.contributions.find((contribution) => contribution.blueprintId === input.blueprintId);
|
|
231
|
+
const [from, to] = existing === undefined ? [slot.endLine, slot.endLine] : [existing.startLine, existing.endLine + 1];
|
|
232
|
+
const written = joinLines([...lines.slice(0, from), ...span, ...lines.slice(to)], [...terminators.slice(0, from), ...spanTerminators, ...terminators.slice(to)]);
|
|
233
|
+
if (written === content)
|
|
234
|
+
return content;
|
|
235
|
+
// Re-read what is about to be written: a write must never leave a file the next read refuses.
|
|
236
|
+
readAnchorSlots(written, style);
|
|
237
|
+
return written;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* A slot's whole text with every contribution marker removed and blank lines trimmed at both ends: what a reader
|
|
241
|
+
* sees there, whoever wrote it. Two files whose slots read the same this way say the same thing, which is how an
|
|
242
|
+
* export compares the slot it reproduces with the one the defining application holds.
|
|
243
|
+
*/
|
|
244
|
+
export function readableAnchorSlotText(content, style, slotId) {
|
|
245
|
+
const slot = readAnchorSlots(content, style).get(slotId);
|
|
246
|
+
if (slot === undefined)
|
|
247
|
+
return undefined;
|
|
248
|
+
const { lines } = splitLines(content);
|
|
249
|
+
return trimBlankLines(lines.slice(slot.startLine + 1, slot.endLine).filter((line) => {
|
|
250
|
+
const marker = parseMarker(line, style);
|
|
251
|
+
return marker === null || marker.kind !== AnchorMarkerKind.CONTRIBUTION;
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
/** The file's content with every contribution marker line removed — for comparing files that differ only by them. */
|
|
255
|
+
export function withoutAnchorContributionMarkers(content, style) {
|
|
256
|
+
const { lines, terminators } = splitLines(content);
|
|
257
|
+
const kept = lines.map((line, index) => ({ line, terminator: terminators[index] ?? '' })).filter(({ line }) => {
|
|
258
|
+
const marker = parseMarker(line, style);
|
|
259
|
+
return marker === null || marker.kind !== AnchorMarkerKind.CONTRIBUTION;
|
|
260
|
+
});
|
|
261
|
+
return joinLines(kept.map(({ line }) => line), kept.map(({ terminator }) => terminator));
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=anchored-region.js.map
|