@wildo-ai/platform-config-lib 1.1.7 → 1.1.9
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/index.d.ts.map +1 -1
- package/dist/esm/_unimplemented/index.js.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +12 -5
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +21 -5
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
- package/dist/esm/lockfile/build-parallelism.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
- package/dist/esm/lockfile/canonical-json.js.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.d.ts +87 -0
- package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -0
- package/dist/esm/lockfile/file-lock-hold.js +279 -0
- package/dist/esm/lockfile/file-lock-hold.js.map +1 -0
- package/dist/esm/lockfile/lockfile-io.d.ts +21 -3
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +8 -16
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts +16 -1
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +35 -1
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +1 -0
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +13 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- 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-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- 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.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.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.js.map +1 -1
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts.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.map +1 -1
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EACL,kCAAkC,GAEnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,mBA0BX;AA1BD,WAAY,mBAAmB;IAC7B,sFAAsF;IACtF,0CAAmB,CAAA;IACnB;;;;OAIG;IACH,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,8DAAuC,CAAA;IACvC,8FA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AA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,kDAAkD;IAClD,EAAE;IACF,6EAA6E;IAC7E,gFAAgF;IAChF,+EAA+E;IAC/E,+EAA+E;IAC/E,qCAAqC;IACrC,IAAI,SAAS;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE1D,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,OAAO;YAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,4EAA4E;IAC5E,+EAA+E;IAC/E,2EAA2E;IAC3E,qEAAqE;IACrE,IAAI,OAAO,EAAE,UAAU;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEhE,+DAA+D;IAC/D,IAAI,MAAM,CAAC,sBAAsB;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5E,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,OAAO,OAAO,KAAK,mBAAmB,CAAC,IAAI,IAAI,OAAO,KAAK,mBAAmB,CAAC,MAAM,CAAC;AACxF,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport {\n resolveRuntimeBackingServiceAccess,\n type RuntimeAccessDeclaration,\n} from './runtime-backing-service-access';\n\n/**\n * The network segments a Wildo deployment is divided into (Step 5-egress).\n *\n * Docker Compose has no `NetworkPolicy` object, but it has the mechanism that\n * matters for the destination half: membership of user-defined bridge networks,\n * with per-network embedded DNS. A container not attached to a network can\n * neither resolve nor route to the services on it — deny-by-default at the\n * network level. Kubernetes expresses the same division as `NetworkPolicy`\n * egress rules. Both renderers derive from THIS enum so they cannot describe\n * different topologies.\n */\nexport enum WildoRuntimeNetwork {\n /** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */\n EDGE = 'wildo-edge',\n /**\n * The control plane — apps-manager, module-registry, crontabs — plus every\n * runtime that must fetch its secrets and configuration. Internal: nothing here\n * needs a route off the host.\n */\n PLATFORM = 'wildo-platform',\n DATA_MONGO = 'wildo-data-mongo',\n DATA_POSTGRES = 'wildo-data-postgres',\n DATA_REDIS = 'wildo-data-redis',\n DATA_RABBIT = 'wildo-data-rabbit',\n DATA_OBJECTS = 'wildo-data-objects',\n DATA_ANTIVIRUS = 'wildo-data-antivirus',\n /** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */\n DATA_AUDIT = 'wildo-data-audit',\n /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */\n DATA_TELEMETRY = 'wildo-data-telemetry',\n /**\n * The ONLY non-internal network below the edge. Attachment to any non-internal\n * network restores NAT, so \"can this runtime reach the internet?\" is decided\n * here and nowhere else — marking the data networks internal is necessary but\n * not sufficient.\n */\n EGRESS = 'wildo-egress',\n}\n\n/**\n * Which network serves each backing-service capability.\n *\n * A total `Record`, deliberately: adding a member to {@link InfraCapability}\n * becomes a COMPILE ERROR here rather than a capability that silently reaches no\n * network — or worse, one whose runtimes silently keep the flat-network\n * reachability this segmentation exists to remove. `null` means the capability\n * needs no network of its own, and every `null` states why.\n */\nexport const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null> = {\n [InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,\n [InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,\n [InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,\n [InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,\n [InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,\n [InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,\n // ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning\n // that measurement disproved while building the 5B service table:\n //\n // - AUDIT_LOG_STORAGE was \"served BY the document/relational database\". It is\n // not: `immudb` is a service of its own, with its own container, and a\n // runtime that writes audit records dials IT rather than a database table.\n // - METRICS_TELEMETRY was \"no application runtime dials them directly today\".\n // Also false — runtimes emit spans and metrics to the collector, and that\n // traffic is live in development. A `null` here would have cut tracing for\n // every runtime the moment segmentation was enforced, with NO readiness\n // check covering it: a first-use failure, silent until someone noticed spans\n // had stopped.\n [InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,\n [InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,\n // Backup remains genuinely operator-side: no application runtime dials it, and\n // the backup tooling runs outside the application's network entirely.\n [InfraCapability.BACKUP_MANAGER]: null,\n};\n\n/**\n * The networks a runtime's container joins.\n *\n * Derived from the SAME declaration as its credentials and its environment\n * topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole\n * point: a runtime kept off a service's network must also not hold that service's\n * credential nor receive its connect URL, and the only way three enforcement\n * points stay in agreement is by not deriving the answer three times.\n *\n * `PLATFORM` is unconditional. Every runtime — including a worker, which holds no\n * backing-service credentials at all — must reach apps-manager to fetch its own\n * bootstrap material. Withholding it would strand every runtime at boot, and it\n * grants no application data.\n */\nexport function resolveRuntimeNetworkMembership(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n options?: { readonly servesHttp?: boolean },\n): ReadonlySet<WildoRuntimeNetwork> {\n const access = resolveRuntimeBackingServiceAccess(principal, declaration);\n const networks = new Set<WildoRuntimeNetwork>();\n\n // PLATFORM is for runtimes that FETCH their own bootstrap material — every\n // runtime principal does, including a worker that holds no backing-service\n // credentials at all. A caller with NO principal is not a runtime principal:\n // today that is the static frontend, an nginx container that authenticates to\n // nothing and has no bootstrap material to fetch.\n //\n // This was previously unconditional, which put that frontend on the platform\n // segment. Harmless — the segment carries no application data and the container\n // could not authenticate anyway — but it is reachability nobody asked for, and\n // \"unconditional because every case so far needed it\" is exactly the default a\n // later reader assumes was measured.\n if (principal) networks.add(WildoRuntimeNetwork.PLATFORM);\n\n for (const capability of access.capabilities) {\n const network = NETWORK_FOR_CAPABILITY[capability];\n if (network) networks.add(network);\n }\n\n // Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),\n // not of what the runtime declared, so it arrives separately rather than being\n // inferred from the principal kind — an application backend that serves no\n // public route should not be on the edge merely for being a backend.\n if (options?.servesHttp) networks.add(WildoRuntimeNetwork.EDGE);\n\n // Authored, never inferred. See `RuntimeBackingServiceAccess`.\n if (access.requiresInternetEgress) networks.add(WildoRuntimeNetwork.EGRESS);\n\n return networks;\n}\n\n/**\n * Networks that must be declared `internal: true`.\n *\n * Derived by EXCLUSION from the two that legitimately carry a route off the host,\n * so a network added to the enum is internal by default. The safe posture is the\n * one you get by not thinking about it.\n */\nexport function isInternalNetwork(network: WildoRuntimeNetwork): boolean {\n return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-platform-access.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"runtime-platform-access.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAGlH,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAEvG;;;;;;;;;;;;;;;GAeG;AAGH,kEAAkE;AAClE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,EAAE,+BAA+B,GAAG,SAAS,GACvD;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-platform-access.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"runtime-platform-access.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAoC,MAAM,+BAA+B,CAAC;AAClH,+EAA+E;AAC/E,8DAA8D;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAyBvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAAkD,EAClD,WAAwD;IAExD,2EAA2E;IAC3E,+EAA+E;IAC/E,6EAA6E;IAC7E,YAAY;IACZ,IAAI,SAAS,EAAE,IAAI,KAAK,+BAA+B,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5F,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { ApplicationRuntimePrincipalKind, type ApplicationRuntimePrincipal } from './runtime-principal.contracts';\n// Declared under `project-config` so an authored config can NAME it — see that\n// file for why the authoring entry cannot reach `bootstrap/`.\nimport { MinionPlatformAccessScope } from '../project-config/shared/minion-platform-access.vocabulary';\n\n/**\n * The PLATFORM-ACCESS axis (Step 3 / R4 / R5) — a minion reading its own\n * platform-level records, today its cron/schedule entries.\n *\n * ## Why this is a SECOND axis and not part of `resourceAccess`\n *\n * `resourceAccess` answers \"which of the APPLICATION's resources may this minion\n * touch?\". This answers \"may it see the PLATFORM's record OF ITSELF?\" — a\n * different subject, a different store, and a different blast radius. R5 requires\n * the two be separately declarable with neither implying the other, so nothing\n * here consults `resourceAccess` and nothing there consults this.\n *\n * A minion that declares data access but no platform access is a normal shape\n * (it works on todos, never inspects its own schedule). So is the reverse (a\n * health-reporting minion that reads its tick history and touches no app data).\n */\n\n\n/** The authored declaration — optional, and absent means none. */\nexport interface MinionPlatformAccessDeclaration {\n readonly scopes?: readonly MinionPlatformAccessScope[];\n}\n\n/**\n * A filter that can ONLY ever address the caller's own records.\n *\n * ## Scoped-to-self BY SHAPE, which is the whole point of R4\n *\n * The obvious implementation takes a minion NAME and refuses when it does not\n * match the caller. That is scoped-to-self by CHECK, and it fails the way every\n * check fails: someone adds an admin path, or an internal caller passes the name\n * it was given, and the refusal is one conditional away from gone.\n *\n * This takes **no target parameter at all**. The subject is derived from the\n * PRINCIPAL, so \"read minion B's schedule\" is not a request that gets refused —\n * it is a request that cannot be expressed. A future caller wanting cross-minion\n * reads must add a new function, which is a reviewable act, rather than passing a\n * different string to this one, which is not.\n *\n * Returns `null` when the principal may not read platform records at all, so the\n * caller has nothing to query WITH — the same fail-closed shape as\n * `deriveMinionResourceGrants` returning `null`.\n *\n * ## ⚠️ PRECONDITION: `principal` must be VERIFIED, not self-asserted\n *\n * The by-shape property above is real and it is CONDITIONAL. This function makes a\n * cross-minion read inexpressible *given a trustworthy principal* — it says\n * nothing about where the principal came from, and a caller that accepts a\n * self-asserted one has a hole this signature cannot close.\n *\n * That is not hypothetical. A minion is delivered the application's\n * `APPLICATION_PLATFORM_REQUEST` **private** key: the delivery projection strips\n * per-app CREDENTIAL paths (`database.*`) and the JWT material is not among them,\n * so it survives in the base blob. A minion can therefore sign a token naming a\n * sibling minion or the application backend, and a by-shape endpoint would\n * satisfy \"no selector exists\" while still failing R4's acceptance criterion.\n *\n * So a caller MUST obtain the principal from a party that learns it from the\n * secret PRESENTED rather than one asserted in a claim — today that is\n * apps-manager, which resolves it by matching the presenting secret against the\n * minted per-principal set. Found by the `Minion Scope` session while building the\n * transport for this axis; recorded here because the precondition belongs with the\n * contract, not only in the transport that happens to satisfy it.\n */\nexport function buildOwnCronRecordFilter(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: MinionPlatformAccessDeclaration | undefined,\n): { readonly minionName: string } | null {\n // Only a MINION has cron records of its own. The application backend reads\n // schedules through its own authority, and a worker has none — so neither is a\n // subject here, and granting them a filter would invent a record that has no\n // referent.\n if (principal?.kind !== ApplicationRuntimePrincipalKind.MINION || !principal.name) return null;\n if (!declaration?.scopes?.includes(MinionPlatformAccessScope.OWN_CRON_RECORDS)) return null;\n return { minionName: principal.name };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-principal.contracts.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"runtime-principal.contracts.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-principal.contracts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oBAAY,+BAA+B;IACzC;;;;;OAKG;IACH,mBAAmB,wBAAwB;IAC3C,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,qBAAqB,GACjC,+BAA+B,CAOjC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,+BAA+B,CAAC;IACtC,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,4EAA4E;AAC5E,eAAO,MAAM,6BAA6B,EAAE,2BAE3C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,2BAA2B,GAAG,MAAM,CAIvF;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,2BAA2B,GAAG,IAAI,CAaxF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kCAAkC,CAAC,WAAW,EAAE;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/C,GAAG,2BAA2B,EAAE,CAYhC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sCAAsC,CACpD,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,+BAA+B,GAAG,SAAS,CAW7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,+BAA+B,GAAG,SAAS,EAC1D,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAQpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-principal.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-principal.contracts.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yDAAyD;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAN,IAAY,+BAUX;AAVD,WAAY,+BAA+B;IACzC;;;;;OAKG;IACH,8EAA2C,CAAA;IAC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CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iCAAiC,CAC/C,aAA0D,EAC1D,aAAiC;IAEjC,IAAI,CAAC,aAAa,IAAI,aAAa,KAAK,+BAA+B,CAAC,mBAAmB,EAAE,CAAC;QAC5F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IAC9E,gFAAgF;IAChF,MAAM,SAAS,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC","sourcesContent":["// Root barrel, matching the sibling bootstrap files: `BackgroundRuntimeType`\n// lives in the decorator-bound graph, not the browser-safe `/public-runtime`\n// atom subset. This module is platform/CLI-side only and never reaches a\n// browser bundle, so the root import costs nothing here.\nimport { BackgroundRuntimeType } from '@wildo-ai/saas-models';\n\n/**\n * WHOSE credentials are these? — the credential-principal axis.\n *\n * Wildo now has three runtime-identity vocabularies and they answer three\n * different questions. They are deliberately NOT collapsed, even where their\n * members currently coincide:\n *\n * - `BackgroundRuntimeType` (`MINION | WORKER`) — *what kind of deployable is\n * this?* A compose service, a K8s workload, a provider-runtime scope. It has\n * no application-backend member because the backend is not a background\n * runtime.\n * - `ApplicationRuntimeProfile` (`APPLICATION_BACKEND | MINION`) — *does this\n * boot assertion apply to me?* Inside a single process. It has no worker\n * member because workers never boot that lifecycle.\n * - **This enum** (`APPLICATION_BACKEND | MINION | WORKER`) — *which principal\n * is authenticating, and whose secrets may it receive?* It is the only one of\n * the three that spans every runtime capable of presenting a credential, which\n * is exactly why it cannot be expressed as either neighbour.\n *\n * Merging any pair would be convenient and wrong: a future runtime that boots no\n * lifecycle but does hold credentials (or the reverse) would silently inherit a\n * decision made for a different question.\n *\n * @see BackgroundRuntimeType — the deployable-kind axis this maps FROM\n */\nexport enum ApplicationRuntimePrincipalKind {\n /**\n * The application's own backend service. Historically the ONLY principal:\n * before per-runtime identity, one `primarySecret` per application was held\n * identically by the backend and by every minion and worker, so at the\n * apps-manager door they were indistinguishable.\n */\n APPLICATION_BACKEND = 'application_backend',\n MINION = 'minion',\n WORKER = 'worker',\n}\n\n/**\n * Map a deployable background-runtime kind onto its credential principal.\n *\n * The one place the two vocabularies meet. Keeping the translation in a single\n * exhaustive switch means adding a member to `BackgroundRuntimeType` is a\n * COMPILE error here rather than a silent gap at whichever call site happened to\n * assume a mapping.\n */\nexport function principalKindForBackgroundRuntime(\n runtimeType: BackgroundRuntimeType,\n): ApplicationRuntimePrincipalKind {\n switch (runtimeType) {\n case BackgroundRuntimeType.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case BackgroundRuntimeType.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n }\n}\n\n/**\n * A runtime principal's stable identity within one application.\n *\n * `name` is the `wildo.saas.config.ts` bucket key (`marketingScrapper`,\n * `myNodeWorker`) — the SAME identity axis the deploy path already carries as\n * `wildo.ai/owned-service-name` and `APP_OWNED_SERVICE_NAME`. Reusing the bucket\n * key rather than the `serviceName` matters: the bucket key is what the\n * declaration, the config lookup and the pod label all agree on, while\n * `serviceName` is a rendering concern that is normalised for DNS.\n *\n * The backend principal carries no name — an application has exactly one, so a\n * name would be a second way to say `APPLICATION_BACKEND`.\n */\nexport interface ApplicationRuntimePrincipal {\n kind: ApplicationRuntimePrincipalKind;\n /** Absent for {@link ApplicationRuntimePrincipalKind.APPLICATION_BACKEND}. */\n name?: string | undefined;\n}\n\n/** The canonical backend principal — one per application, by definition. */\nexport const APPLICATION_BACKEND_PRINCIPAL: ApplicationRuntimePrincipal = {\n kind: ApplicationRuntimePrincipalKind.APPLICATION_BACKEND,\n};\n\n/**\n * Render a principal as a single stable string.\n *\n * Used as the stored key for a principal's secret, as the URL segment when the\n * CLI asks for a named principal's bootstrap credentials, and in log/audit\n * fields. ONE renderer so those three never drift into three spellings of the\n * same identity.\n *\n * `:` is the separator because neither half can contain it — the kinds are a\n * closed enum, and a bucket key is a TypeScript object key in\n * `wildo.saas.config.ts`. {@link parseRuntimePrincipalKey} rejects anything that\n * does not round-trip, so a key that ever gains a colon fails loudly at the\n * boundary rather than resolving to the wrong principal.\n */\nexport function buildRuntimePrincipalKey(principal: ApplicationRuntimePrincipal): string {\n return principal.kind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND\n ? ApplicationRuntimePrincipalKind.APPLICATION_BACKEND\n : `${principal.kind}:${principal.name ?? ''}`;\n}\n\n/**\n * Inverse of {@link buildRuntimePrincipalKey}. Returns `null` for anything\n * malformed — an unknown kind, a missing name on a named kind, or a name\n * containing the separator.\n *\n * Fail-closed by returning `null` rather than throwing OR guessing: this parses\n * values that reach the system from a URL segment and from stored rows, and a\n * lenient parse there is how one principal's key resolves to another's secret.\n */\nexport function parseRuntimePrincipalKey(key: string): ApplicationRuntimePrincipal | null {\n if (key === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return APPLICATION_BACKEND_PRINCIPAL;\n }\n const separatorIndex = key.indexOf(':');\n if (separatorIndex <= 0) return null;\n const kind = key.slice(0, separatorIndex);\n const name = key.slice(separatorIndex + 1);\n if (name.length === 0 || name.includes(':')) return null;\n if (kind !== ApplicationRuntimePrincipalKind.MINION && kind !== ApplicationRuntimePrincipalKind.WORKER) {\n return null;\n }\n return { kind, name };\n}\n\n/**\n * Every principal an application declares: its backend, plus one per declared\n * minion and worker.\n *\n * Derived from the managed declaration — the same input the config seed already\n * consumes — so the credential set and the deployed runtime set cannot diverge.\n * That is also what makes revocation fall out for free: a runtime removed from\n * `wildo.saas.config.ts` simply stops appearing here, and the mint step prunes\n * any stored secret whose key is no longer in this list (R15).\n *\n * The backend is ALWAYS included, including for an application that declares no\n * minions and no workers — it is the principal that must never be absent.\n */\nexport function enumerateDeclaredRuntimePrincipals(declaration: {\n minions?: Record<string, unknown> | undefined;\n workers?: Record<string, unknown> | undefined;\n}): ApplicationRuntimePrincipal[] {\n return [\n APPLICATION_BACKEND_PRINCIPAL,\n ...Object.keys(declaration.minions ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.MINION,\n name,\n })),\n ...Object.keys(declaration.workers ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.WORKER,\n name,\n })),\n ];\n}\n\n/**\n * The Redis key namespace a MINION owns (D20).\n *\n * `<appSlug>:minions:<name>:` — a strict extension of the application's own\n * `<appSlug>:` prefix, which is what lets `RedisService` keep enforcing \"an\n * authored prefix must start with `<appSlug>:`\" unchanged.\n *\n * ## One derivation, deliberately, because it is a COUPLED PAIR\n *\n * Two places consume this and they must agree exactly: the Redis ACL key pattern\n * apps-manager grants the minion's user, and the `REDIS_KEY_PREFIX` the CLI\n * writes into that minion's environment. If they disagree by even a character,\n * every Redis operation the minion performs is DENIED — and the error names an\n * ACL, not the mismatch, so nothing in the minion's own configuration explains\n * it. Deriving both from this function is what makes that class of failure\n * unrepresentable rather than merely unlikely.\n *\n * Based on `appSlug` rather than an authored `dataServices.redis.keyPrefix`\n * because the ACL pattern already is (`RedisSelfInfraProviderModule`), and one\n * inconsistency is better than two competing bases. An application that authors\n * a custom prefix therefore has a PRE-EXISTING mismatch with its own ACL; that\n * gap is older than per-principal credentials and is not narrowed here.\n */\nexport function buildMinionRedisKeyPrefix(appSlug: string, minionName: string): string {\n return `${appSlug}:minions:${minionName}:`;\n}\n\n/**\n * Map an `ApplicationRuntimeProfile` value onto the credential-principal axis.\n *\n * The two vocabularies are deliberately SEPARATE — a runtime profile answers\n * \"which declaration class am I?\", a principal kind answers \"whose credential do\n * I hold?\" — but their string values coincide today. A consumer that relies on\n * that coincidence by comparing raw strings has made the coupling invisible; this\n * function is where the crossing is allowed to happen, once.\n *\n * Fail-closed: an unrecognised profile returns `undefined` rather than a\n * plausible default, because every caller uses the result to decide how narrowly\n * a runtime is confined, and guessing there widens confinement silently.\n */\nexport function runtimePrincipalKindFromRuntimeProfile(\n runtimeProfile: string | undefined,\n): ApplicationRuntimePrincipalKind | undefined {\n switch (runtimeProfile) {\n case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:\n return ApplicationRuntimePrincipalKind.APPLICATION_BACKEND;\n case ApplicationRuntimePrincipalKind.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case ApplicationRuntimePrincipalKind.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n default:\n return undefined;\n }\n}\n\n/**\n * The principal segment embedded in a runtime's RPC reply-queue name.\n *\n * ## Why this exists — the same reason as {@link buildMinionRedisKeyPrefix}\n *\n * Two places consume this and they must agree EXACTLY: the broker permission\n * pattern apps-manager grants a minion's user, and the reply-queue name the\n * minion's own AMQP adapter declares and consumes. If they disagree by even a\n * character the minion's every reply is refused with `403 ACCESS_REFUSED`, and\n * the error names a permission rather than the mismatch — so nothing in the\n * minion's own configuration explains it.\n *\n * It previously WAS derived twice: the adapter sanitised its runtime key while\n * the permission builder escaped the raw minion name, coupled only by a comment\n * saying the two \"mirror\" each other. They agreed for `marketingScrapper` and\n * would have diverged for any name containing a character sanitisation rewrites\n * (`marketing.scrapper` → `marketing-scrapper` on one side, `marketing.scrapper`\n * on the other). A comment describing what the other side must do is not a site\n * that upholds an invariant; deriving both from here makes the divergence\n * unrepresentable instead of merely unlikely.\n *\n * Returns `undefined` for the APPLICATION BACKEND, which keeps the historical\n * segment-less reply-queue layout — that is what stops a minion's permission\n * from ever matching the backend's replies.\n */\nexport function buildRuntimePrincipalQueueSegment(\n principalKind: ApplicationRuntimePrincipalKind | undefined,\n principalName: string | undefined,\n): string | undefined {\n if (!principalKind || principalKind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return undefined;\n }\n // Sanitised for the same reason the ACL usernames are: a principal name comes\n // from a TypeScript object key and may hold characters a queue name should not.\n const sanitized = (principalName ?? '').replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n return sanitized ? `${principalKind}-${sanitized}` : undefined;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-principal.contracts.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-principal.contracts.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yDAAyD;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAN,IAAY,+BAUX;AAVD,WAAY,+BAA+B;IACzC;;;;;OAKG;IACH,8EAA2C,CAAA;IAC3C,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;AACnB,CAAC,EAVW,+BAA+B,KAA/B,+BAA+B,QAU1C;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iCAAiC,CAC/C,WAAkC;IAElC,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,qBAAqB,CAAC,MAAM;YAC/B,OAAO,+BAA+B,CAAC,MAAM,CAAC;QAChD,KAAK,qBAAqB,CAAC,MAAM;YAC/B,OAAO,+BAA+B,CAAC,MAAM,CAAC;IAClD,CAAC;AACH,CAAC;AAqBD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,6BAA6B,GAAgC;IACxE,IAAI,EAAE,+BAA+B,CAAC,mBAAmB;CAC1D,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAsC;IAC7E,OAAO,SAAS,CAAC,IAAI,KAAK,+BAA+B,CAAC,mBAAmB;QAC3E,CAAC,CAAC,+BAA+B,CAAC,mBAAmB;QACrD,CAAC,CAAC,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,IAAI,GAAG,KAAK,+BAA+B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AC3E,OAAO,GAAG,OAAO,YAAY,UAAU,GAAG,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,sCAAsC,CACpD,cAAkC;IAElC,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,+BAA+B,CAAC,mBAAmB;YACtD,OAAO,+BAA+B,CAAC,mBAAmB,CAAC;QAC7D,KAAK,+BAA+B,CAAC,MAAM;YACzC,OAAO,+BAA+B,CAAC,MAAM,CAAC;QAChD,KAAK,+BAA+B,CAAC,MAAM;YACzC,OAAO,+BAA+B,CAAC,MAAM,CAAC;QAChD;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iCAAiC,CAC/C,aAA0D,EAC1D,aAAiC;IAEjC,IAAI,CAAC,aAAa,IAAI,aAAa,KAAK,+BAA+B,CAAC,mBAAmB,EAAE,CAAC;QAC5F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IAC9E,gFAAgF;IAChF,MAAM,SAAS,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC","sourcesContent":["// Root barrel, matching the sibling bootstrap files: `BackgroundRuntimeType`\n// lives in the decorator-bound graph, not the browser-safe `/public-runtime`\n// atom subset. This module is platform/CLI-side only and never reaches a\n// browser bundle, so the root import costs nothing here.\nimport { BackgroundRuntimeType } from '@wildo-ai/saas-models';\n\n/**\n * WHOSE credentials are these? — the credential-principal axis.\n *\n * Wildo now has three runtime-identity vocabularies and they answer three\n * different questions. They are deliberately NOT collapsed, even where their\n * members currently coincide:\n *\n * - `BackgroundRuntimeType` (`MINION | WORKER`) — *what kind of deployable is\n * this?* A compose service, a K8s workload, a provider-runtime scope. It has\n * no application-backend member because the backend is not a background\n * runtime.\n * - `ApplicationRuntimeProfile` (`APPLICATION_BACKEND | MINION`) — *does this\n * boot assertion apply to me?* Inside a single process. It has no worker\n * member because workers never boot that lifecycle.\n * - **This enum** (`APPLICATION_BACKEND | MINION | WORKER`) — *which principal\n * is authenticating, and whose secrets may it receive?* It is the only one of\n * the three that spans every runtime capable of presenting a credential, which\n * is exactly why it cannot be expressed as either neighbour.\n *\n * Merging any pair would be convenient and wrong: a future runtime that boots no\n * lifecycle but does hold credentials (or the reverse) would silently inherit a\n * decision made for a different question.\n *\n * @see BackgroundRuntimeType — the deployable-kind axis this maps FROM\n */\nexport enum ApplicationRuntimePrincipalKind {\n /**\n * The application's own backend service. Historically the ONLY principal:\n * before per-runtime identity, one `primarySecret` per application was held\n * identically by the backend and by every minion and worker, so at the\n * apps-manager door they were indistinguishable.\n */\n APPLICATION_BACKEND = 'application_backend',\n MINION = 'minion',\n WORKER = 'worker',\n}\n\n/**\n * Map a deployable background-runtime kind onto its credential principal.\n *\n * The one place the two vocabularies meet. Keeping the translation in a single\n * exhaustive switch means adding a member to `BackgroundRuntimeType` is a\n * COMPILE error here rather than a silent gap at whichever call site happened to\n * assume a mapping.\n */\nexport function principalKindForBackgroundRuntime(\n runtimeType: BackgroundRuntimeType,\n): ApplicationRuntimePrincipalKind {\n switch (runtimeType) {\n case BackgroundRuntimeType.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case BackgroundRuntimeType.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n }\n}\n\n/**\n * A runtime principal's stable identity within one application.\n *\n * `name` is the `wildo.saas.config.ts` bucket key (`marketingScrapper`,\n * `myNodeWorker`) — the SAME identity axis the deploy path already carries as\n * `wildo.ai/owned-service-name` and `APP_OWNED_SERVICE_NAME`. Reusing the bucket\n * key rather than the `serviceName` matters: the bucket key is what the\n * declaration, the config lookup and the pod label all agree on, while\n * `serviceName` is a rendering concern that is normalised for DNS.\n *\n * The backend principal carries no name — an application has exactly one, so a\n * name would be a second way to say `APPLICATION_BACKEND`.\n */\nexport interface ApplicationRuntimePrincipal {\n kind: ApplicationRuntimePrincipalKind;\n /** Absent for {@link ApplicationRuntimePrincipalKind.APPLICATION_BACKEND}. */\n name?: string | undefined;\n}\n\n/** The canonical backend principal — one per application, by definition. */\nexport const APPLICATION_BACKEND_PRINCIPAL: ApplicationRuntimePrincipal = {\n kind: ApplicationRuntimePrincipalKind.APPLICATION_BACKEND,\n};\n\n/**\n * Render a principal as a single stable string.\n *\n * Used as the stored key for a principal's secret, as the URL segment when the\n * CLI asks for a named principal's bootstrap credentials, and in log/audit\n * fields. ONE renderer so those three never drift into three spellings of the\n * same identity.\n *\n * `:` is the separator because neither half can contain it — the kinds are a\n * closed enum, and a bucket key is a TypeScript object key in\n * `wildo.saas.config.ts`. {@link parseRuntimePrincipalKey} rejects anything that\n * does not round-trip, so a key that ever gains a colon fails loudly at the\n * boundary rather than resolving to the wrong principal.\n */\nexport function buildRuntimePrincipalKey(principal: ApplicationRuntimePrincipal): string {\n return principal.kind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND\n ? ApplicationRuntimePrincipalKind.APPLICATION_BACKEND\n : `${principal.kind}:${principal.name ?? ''}`;\n}\n\n/**\n * Inverse of {@link buildRuntimePrincipalKey}. Returns `null` for anything\n * malformed — an unknown kind, a missing name on a named kind, or a name\n * containing the separator.\n *\n * Fail-closed by returning `null` rather than throwing OR guessing: this parses\n * values that reach the system from a URL segment and from stored rows, and a\n * lenient parse there is how one principal's key resolves to another's secret.\n */\nexport function parseRuntimePrincipalKey(key: string): ApplicationRuntimePrincipal | null {\n if (key === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return APPLICATION_BACKEND_PRINCIPAL;\n }\n const separatorIndex = key.indexOf(':');\n if (separatorIndex <= 0) return null;\n const kind = key.slice(0, separatorIndex);\n const name = key.slice(separatorIndex + 1);\n if (name.length === 0 || name.includes(':')) return null;\n if (kind !== ApplicationRuntimePrincipalKind.MINION && kind !== ApplicationRuntimePrincipalKind.WORKER) {\n return null;\n }\n return { kind, name };\n}\n\n/**\n * Every principal an application declares: its backend, plus one per declared\n * minion and worker.\n *\n * Derived from the managed declaration — the same input the config seed already\n * consumes — so the credential set and the deployed runtime set cannot diverge.\n * That is also what makes revocation fall out for free: a runtime removed from\n * `wildo.saas.config.ts` simply stops appearing here, and the mint step prunes\n * any stored secret whose key is no longer in this list (R15).\n *\n * The backend is ALWAYS included, including for an application that declares no\n * minions and no workers — it is the principal that must never be absent.\n */\nexport function enumerateDeclaredRuntimePrincipals(declaration: {\n minions?: Record<string, unknown> | undefined;\n workers?: Record<string, unknown> | undefined;\n}): ApplicationRuntimePrincipal[] {\n return [\n APPLICATION_BACKEND_PRINCIPAL,\n ...Object.keys(declaration.minions ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.MINION,\n name,\n })),\n ...Object.keys(declaration.workers ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.WORKER,\n name,\n })),\n ];\n}\n\n/**\n * The Redis key namespace a MINION owns (D20).\n *\n * `<appSlug>:minions:<name>:` — a strict extension of the application's own\n * `<appSlug>:` prefix, which is what lets `RedisService` keep enforcing \"an\n * authored prefix must start with `<appSlug>:`\" unchanged.\n *\n * ## One derivation, deliberately, because it is a COUPLED PAIR\n *\n * Two places consume this and they must agree exactly: the Redis ACL key pattern\n * apps-manager grants the minion's user, and the `REDIS_KEY_PREFIX` the CLI\n * writes into that minion's environment. If they disagree by even a character,\n * every Redis operation the minion performs is DENIED — and the error names an\n * ACL, not the mismatch, so nothing in the minion's own configuration explains\n * it. Deriving both from this function is what makes that class of failure\n * unrepresentable rather than merely unlikely.\n *\n * Based on `appSlug` rather than an authored `dataServices.redis.keyPrefix`\n * because the ACL pattern already is (`RedisSelfInfraProviderModule`), and one\n * inconsistency is better than two competing bases. An application that authors\n * a custom prefix therefore has a PRE-EXISTING mismatch with its own ACL; that\n * gap is older than per-principal credentials and is not narrowed here.\n */\nexport function buildMinionRedisKeyPrefix(appSlug: string, minionName: string): string {\n return `${appSlug}:minions:${minionName}:`;\n}\n\n/**\n * Map an `ApplicationRuntimeProfile` value onto the credential-principal axis.\n *\n * The two vocabularies are deliberately SEPARATE — a runtime profile answers\n * \"which declaration class am I?\", a principal kind answers \"whose credential do\n * I hold?\" — but their string values coincide today. A consumer that relies on\n * that coincidence by comparing raw strings has made the coupling invisible; this\n * function is where the crossing is allowed to happen, once.\n *\n * Fail-closed: an unrecognised profile returns `undefined` rather than a\n * plausible default, because every caller uses the result to decide how narrowly\n * a runtime is confined, and guessing there widens confinement silently.\n */\nexport function runtimePrincipalKindFromRuntimeProfile(\n runtimeProfile: string | undefined,\n): ApplicationRuntimePrincipalKind | undefined {\n switch (runtimeProfile) {\n case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:\n return ApplicationRuntimePrincipalKind.APPLICATION_BACKEND;\n case ApplicationRuntimePrincipalKind.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case ApplicationRuntimePrincipalKind.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n default:\n return undefined;\n }\n}\n\n/**\n * The principal segment embedded in a runtime's RPC reply-queue name.\n *\n * ## Why this exists — the same reason as {@link buildMinionRedisKeyPrefix}\n *\n * Two places consume this and they must agree EXACTLY: the broker permission\n * pattern apps-manager grants a minion's user, and the reply-queue name the\n * minion's own AMQP adapter declares and consumes. If they disagree by even a\n * character the minion's every reply is refused with `403 ACCESS_REFUSED`, and\n * the error names a permission rather than the mismatch — so nothing in the\n * minion's own configuration explains it.\n *\n * It previously WAS derived twice: the adapter sanitised its runtime key while\n * the permission builder escaped the raw minion name, coupled only by a comment\n * saying the two \"mirror\" each other. They agreed for `marketingScrapper` and\n * would have diverged for any name containing a character sanitisation rewrites\n * (`marketing.scrapper` → `marketing-scrapper` on one side, `marketing.scrapper`\n * on the other). A comment describing what the other side must do is not a site\n * that upholds an invariant; deriving both from here makes the divergence\n * unrepresentable instead of merely unlikely.\n *\n * Returns `undefined` for the APPLICATION BACKEND, which keeps the historical\n * segment-less reply-queue layout — that is what stops a minion's permission\n * from ever matching the backend's replies.\n */\nexport function buildRuntimePrincipalQueueSegment(\n principalKind: ApplicationRuntimePrincipalKind | undefined,\n principalName: string | undefined,\n): string | undefined {\n if (!principalKind || principalKind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return undefined;\n }\n // Sanitised for the same reason the ACL usernames are: a principal name comes\n // from a TypeScript object key and may hold characters a queue name should not.\n const sanitized = (principalName ?? '').replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n return sanitized ? `${principalKind}-${sanitized}` : undefined;\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-topology.contracts.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"runtime-topology.contracts.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-topology.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AASxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAEjG,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,sCAAsC,CACpD,IAAI,GAAE,MAAoB,GACzB,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAWrC;AAED,MAAM,WAAW,yCAAyC;IACxD,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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;CACxB;AAED,MAAM,WAAW,uCAAwC,SAAQ,uCAAuC;IACtG;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AA+DD;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,mCAAmC,GACzC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAIrC;AAED;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,uCAAuC,GAC7C,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAErC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-topology.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-topology.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAE9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGvE,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AAQxC,MAAM,UAAU,sCAAsC,CACpD,OAAe,WAAW;IAE1B,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAuB,EAAE,CAAC,CAAC;QACvD,SAAS,EAAE,UAAU,IAAI,IAAI,IAAI,EAAE;QACnC,WAAW,EAAE,UAAU,IAAI,IAAI,IAAI,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO,6BAA6B,CAAC;QACnC,WAAW,EAAE,QAAQ,CAAC,sBAAsB,CAAC,YAAY,CAAC;QAC1D,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB,CAAC,wBAAwB,CAAC;QACjF,c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C,WAAW,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC;iBACzC;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,wBAAwB,KAAK,SAAS,IAAI,kBAAkB,KAAK,SAAS;YAC5E,CAAC,CAAC;gBACE,cAAc,EAAE;oBACd,SAAS,EAAE,GAAG,CAAC,wBAAwB,CAAC;oBACxC,WAAW,EAAE,QAAQ,CAAC,kBAAkB,CAAC;iBAC1C;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mCAAmC,CACjD,KAA0C;IAE1C,OAAO,sCAAsC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAC5D,mBAAmB,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CACjE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uCAAuC,CACrD,KAA8C;IAE9C,OAAO,sCAAsC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,KAAK,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC,CAAC;AAC3G,CAAC","sourcesContent":["import {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n type RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\nimport {\n buildK8sInternalUrl,\n buildK8sPublicUrl,\n buildServicePublicHost,\n buildServicePublicUrl,\n} from '../project-config/shared/k8s-utils';\nimport { PLATFORM_DEFAULT_PORTS } from '../project-config/shared/infrastructure-defaults.schemas';\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { AppServiceDefinition } from '../project-config/shared/service-definitions.schemas';\n\nexport {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n parseRuntimeEndpointsRecord,\n PlatformApplicationType,\n PlatformRuntimeEndpointKey,\n serializeRuntimeEndpointsRecord,\n} from '@wildo-ai/platform-core-shared';\n\nexport type {\n ApplicationRuntimeEndpointsInput,\n PlatformRuntimeEndpointsInput,\n RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\n\nexport function buildLocalhostPlatformRuntimeEndpoints(\n host: string = 'localhost',\n): Record<string, RuntimeEndpointUrls> {\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildPlatformRuntimeEndpoints({\n appsManager: buildUrl(PLATFORM_DEFAULT_PORTS.APPS_MANAGER),\n crontabsBatchesManager: buildUrl(PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER),\n moduleRegistry: buildUrl(PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY),\n });\n}\n\nexport interface LocalhostApplicationRuntimeEndpointsInput {\n mainBackendApiPort?: number | undefined;\n frontendApplicationPorts?: Record<string, number> | undefined;\n websitePort?: number | undefined;\n technicalDocumentationPort?: number | undefined;\n host?: string | undefined;\n}\n\nexport function buildLocalhostApplicationRuntimeEndpoints(\n input: LocalhostApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n const host = input.host ?? 'localhost';\n /**\n * Local endpoints are plain http, publicly and internally, and there is no knob.\n *\n * A configurable local scheme existed until 2026-08-14 and was removed: it applied ONE scheme to\n * EVERY endpoint's own port, which is only correct when a single ingress fronts them all. Local\n * Docker Compose has none, so declaring https made `main_backend_api.publicUrl` name a port that\n * held no certificate, and every browser session died on its WebSocket readiness poll.\n *\n * Remote is unaffected and always was: `buildServicePublicUrl` hardcodes `https://` because TLS\n * terminates at Traefik/nginx in front of one origin, where a single scheme IS true for every\n * endpoint. That is the only place the question has a well-defined answer, and it never consulted\n * this input.\n */\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications: input.frontendApplicationPorts\n ? Object.fromEntries(\n Object.entries(input.frontendApplicationPorts).map(([frontendServiceName, port]) => [\n frontendServiceName,\n buildUrl(port),\n ]),\n )\n : undefined,\n ...(input.websitePort ? { website: buildUrl(input.websitePort) } : {}),\n ...(input.technicalDocumentationPort\n ? { technicalDocumentation: buildUrl(input.technicalDocumentationPort) }\n : {}),\n ...(input.mainBackendApiPort\n ? {\n mainBackendApi: buildUrl(input.mainBackendApiPort),\n }\n : {}),\n });\n}\n\n/**\n * Which backend is an application's MAIN backend API — the one its browser-facing\n * surfaces call. The `backendApi` service key when declared, else the first backend\n * row. One rule, used by the CLI's endpoint and ingress derivation and by the public\n * website's local origins, so the three cannot name different backends.\n */\nexport function selectPrimaryBackendService<TService extends { readonly key: string }>(\n backendServices: readonly TService[],\n): TService | undefined {\n return backendServices.find((backend) => backend.key === 'backendApi') ?? backendServices[0];\n}\n\n/** The origins a locally-running application serves its app and its main API on. */\nexport interface LocalhostApplicationOrigins {\n /** The `SAAS_APP` frontend, when one declares a port. */\n readonly app?: string | undefined;\n /** The main backend API ({@link selectPrimaryBackendService}), when it declares a port. */\n readonly api?: string | undefined;\n}\n\n/**\n * The local-development origins of an application's product and API, derived from\n * the `defaultPort` each service already declares in `wildo.saas.config.ts` — the\n * same ports, host and plain-http scheme {@link buildLocalhostApplicationRuntimeEndpoints}\n * advertises, so a local surface that links into the product reaches the process\n * `wildo local dev` actually started.\n *\n * It exists for the public website, which is a separate origin from the product:\n * its CTAs and capture forms must reach `http://localhost:<appPort>` and\n * `http://localhost:<backendPort>` under `astro dev`. Before this, the API origin\n * was a port hardcoded into each site and the app origin had no local form at all,\n * so every \"Start free\" in local development pointed at a production-shaped host\n * that resolves to nothing.\n */\nexport function resolveLocalhostApplicationOrigins(\n services: Readonly<Record<string, Pick<AppServiceDefinition, 'defaultPort' | 'frontendType'>>>,\n host = 'localhost',\n): LocalhostApplicationOrigins {\n const rows = Object.entries(services).map(([key, service]) => ({ key, ...service }));\n const primaryBackend = selectPrimaryBackendService(rows.filter((row) => row.frontendType === undefined));\n const saasApp = rows.find((row) => row.frontendType === AppFrontendType.SAAS_APP);\n const originOf = (port: number | undefined): string | undefined => (port === undefined ? undefined : `http://${host}:${port}`);\n return { app: originOf(saasApp?.defaultPort), api: originOf(primaryBackend?.defaultPort) };\n}\n\nexport function buildK8sPlatformRuntimeEndpoints(input: {\n publicDomain: string;\n namespace: string;\n}): Record<string, RuntimeEndpointUrls> {\n return buildPlatformRuntimeEndpoints({\n appsManager: {\n publicUrl: buildK8sPublicUrl('platform-apps-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-apps-manager', PLATFORM_DEFAULT_PORTS.APPS_MANAGER, input.namespace),\n },\n crontabsBatchesManager: {\n publicUrl: buildK8sPublicUrl('platform-crontabs-batches-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-crontabs-batches-manager', PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER, input.namespace),\n },\n moduleRegistry: {\n publicUrl: buildK8sPublicUrl('platform-module-registry', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-module-registry', PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY, input.namespace),\n },\n });\n}\n\nexport interface K8sIngressRoute {\n /** Public hostname Traefik/ingress routes on (from the serviceHosts resolver). */\n host: string;\n /**\n * Per-service k8s Service NAME this host routes to. In the per-service deploy\n * model each service is its OWN Deployment+Service, so the route target is the\n * service's `serviceName` (e.g. `wonder-todos-backend-api`, `wonder-todos-app`)\n * — NOT one shared app Service. This is the value stamped into the ingress\n * rule's `backend.service.name`.\n */\n serviceName: string;\n /** Port on that per-service Service to route this host to. */\n port: number;\n}\n\n/**\n * One public frontend in the app's service topology. `serviceName` and\n * `serviceKey` are DECOUPLED on purpose:\n * - `serviceName` — the `runtime.endPoints` map key (the consumer contract:\n * `lookupFrontendPublicUrl` / X-Frontend-Service-Name key by serviceName).\n * - `serviceKey` — the `config.services.<key>`, which is the serviceHosts\n * authoring key. The public HOST resolves from THIS, never from serviceName.\n * Conflating them silently ignores authored `serviceHosts` (the serviceName\n * `wonder-todos-app` misses the authored `app` entry).\n */\nexport interface ApplicationPublicFrontend {\n serviceName: string;\n serviceKey: string;\n port: number;\n}\n\nexport interface K8sApplicationIngressRoutesInput {\n publicDomain: string;\n serviceHosts: Record<string, string> | undefined;\n /** Public frontends. Host resolves from `serviceKey` (config key); route target is the frontend's own `serviceName`. */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API per-service k8s Service name (the ingress route target). */\n mainBackendApiServiceName?: string | undefined;\n /** Backend API Service port. */\n mainBackendApiPort?: number | undefined;\n}\n\n/**\n * Ingress routes for the app's PUBLIC services (every frontend + the main\n * backend API), serviceHosts-driven. Every host resolves from the service's\n * `config.services.<key>` (`serviceKey`) — so GIVEN THE SAME frontends/keys,\n * the routes match the `runtime.endPoints.publicUrl` that\n * {@link buildK8sApplicationRuntimeEndpoints} produces (both key public hosts on\n * `serviceKey`). Coherence is a property of feeding both the SAME `serviceKey`s,\n * not automatic — see the divergence guards in the domain plan. Health, webhooks,\n * the OAuth provider and MCP are routes on the backend's own port, so they reach\n * the public host through the backend API route like any other path (#1783).\n */\nexport function buildK8sApplicationIngressRoutes(\n input: K8sApplicationIngressRoutesInput,\n): K8sIngressRoute[] {\n const host = (serviceKey: string): string =>\n buildServicePublicHost({ serviceKey, serviceHosts: input.serviceHosts, publicDomain: input.publicDomain });\n\n const entries: Array<{ serviceKey: string; serviceName: string; host: string; port: number }> =\n input.frontends.map((f) => ({\n serviceKey: f.serviceKey,\n serviceName: f.serviceName,\n host: host(f.serviceKey),\n port: f.port,\n }));\n if (\n input.mainBackendApiServiceKey !== undefined &&\n input.mainBackendApiServiceName !== undefined &&\n input.mainBackendApiPort !== undefined\n ) {\n entries.push({\n serviceKey: input.mainBackendApiServiceKey,\n serviceName: input.mainBackendApiServiceName,\n host: host(input.mainBackendApiServiceKey),\n port: input.mainBackendApiPort,\n });\n }\n\n // Fail-closed host-uniqueness guard: each public host routes entirely to ONE\n // service:port (no path-based sharing), so two distinct services resolving to\n // the same host — e.g. both authored to the apex (`''`), or an unauthored key\n // that collides with an authored subdomain — is an ambiguous, silently-broken\n // ingress. Reject it at build time with the colliding keys named, rather than\n // emitting a manifest whose routing is undefined.\n const claimedBy = new Map<string, string>();\n for (const entry of entries) {\n const existing = claimedBy.get(entry.host);\n if (existing !== undefined && existing !== entry.serviceKey) {\n throw new Error(\n `serviceHosts collision: services '${existing}' and '${entry.serviceKey}' both resolve to public host '${entry.host}'. ` +\n `Each service needs a distinct 'serviceHosts' subdomain (only one service may map to the apex '').`,\n );\n }\n claimedBy.set(entry.host, entry.serviceKey);\n }\n\n return entries.map(({ host: h, serviceName, port }) => ({ host: h, serviceName, port }));\n}\n\n/**\n * Fields shared by every REMOTE runtime-endpoints builder (k8s + compose). The\n * PUBLIC side (serviceHosts resolution) is runtime-agnostic; only the INTERNAL\n * URL form differs, injected via the `internalUrlFor` callback of the core\n * builder ({@link buildRemoteApplicationRuntimeEndpoints}).\n */\nexport interface RemoteApplicationRuntimeEndpointsCommon {\n /** Operator's public domain (`WildoInfraEnvConfig.publicDomain`). */\n publicDomain: string;\n /** Authored per-service subdomain map (`wildo.infra.<env>.config.ts`). */\n serviceHosts: Record<string, string> | undefined;\n /**\n * Public frontends. The `runtime.endPoints` map is keyed by each frontend's\n * `serviceName` (consumer contract); the public HOST resolves from its\n * `serviceKey` (config key / serviceHosts key). See {@link ApplicationPublicFrontend}.\n */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** `serviceKey` of the STATIC_WEBSITE frontend (feeds the fixed website endpoint). */\n websiteServiceKey?: string | undefined;\n /** `serviceKey` of the TECH_DOC frontend (feeds the fixed technical-documentation endpoint). */\n technicalDocumentationServiceKey?: string | undefined;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API container port — the one port the backend process binds (its internal URL). */\n mainBackendApiPort?: number | undefined;\n}\n\nexport interface K8sApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /** K8s namespace for cluster-internal service DNS. */\n namespace: string;\n /**\n * K8s Service name for cluster-internal URLs. Single Service per app (all\n * frontends + APIs ride it on different ports), so this is the app's own\n * service name (= its slug).\n */\n appServiceName: string;\n}\n\nexport interface ComposeApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /**\n * Compose service (container) name for internal URLs. Single container per\n * app serving all frontends + APIs on their ports, reachable by other\n * containers on the shared network as `http://<appServiceName>:<port>`.\n */\n appServiceName: string;\n}\n\n/**\n * Core REMOTE application runtime-endpoints assembly, shared by the k8s and\n * compose builders so their public-URL semantics never drift. PUBLIC URLs come\n * from {@link buildServicePublicUrl} (so ingress hosts, `runtime.endPoints.publicUrl`,\n * and CORS all agree — greenfield, no multi-tenant fan-out). INTERNAL URLs are\n * supplied by `internalUrlFor` (cluster-DNS for k8s, container DNS for compose).\n * The backend declares ONE endpoint: health, webhooks, the OAuth provider and MCP\n * are routes on its port, not sibling listeners (#1783).\n */\nfunction buildRemoteApplicationRuntimeEndpoints(\n input: RemoteApplicationRuntimeEndpointsCommon,\n internalUrlFor: (port: number) => string,\n): Record<string, RuntimeEndpointUrls> {\n const { publicDomain, serviceHosts } = input;\n const pub = (serviceKey: string): string =>\n buildServicePublicUrl({ serviceKey, serviceHosts, publicDomain });\n const internal = internalUrlFor;\n\n // Map key = serviceName (consumer contract: lookupFrontendPublicUrl keys by\n // serviceName); public host = serviceKey (serviceHosts key). Decoupled.\n const frontendApplications = input.frontends.length > 0\n ? Object.fromEntries(\n input.frontends.map((f) => [\n f.serviceName,\n { publicUrl: pub(f.serviceKey), internalUrl: internal(f.port) },\n ]),\n )\n : undefined;\n\n const websiteFrontend = input.websiteServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.websiteServiceKey)\n : undefined;\n const docsFrontend = input.technicalDocumentationServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.technicalDocumentationServiceKey)\n : undefined;\n const { mainBackendApiServiceKey, mainBackendApiPort } = input;\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications,\n ...(websiteFrontend\n ? { website: { publicUrl: pub(websiteFrontend.serviceKey), internalUrl: internal(websiteFrontend.port) } }\n : {}),\n ...(docsFrontend\n ? {\n technicalDocumentation: {\n publicUrl: pub(docsFrontend.serviceKey),\n internalUrl: internal(docsFrontend.port),\n },\n }\n : {}),\n ...(mainBackendApiServiceKey !== undefined && mainBackendApiPort !== undefined\n ? {\n mainBackendApi: {\n publicUrl: pub(mainBackendApiServiceKey),\n internalUrl: internal(mainBackendApiPort),\n },\n }\n : {}),\n });\n}\n\n/**\n * Build K8s application runtime endpoints — the self-hosted, single-app,\n * `serviceHosts`-driven counterpart to {@link buildLocalhostApplicationRuntimeEndpoints}.\n * INTERNAL URLs are the app's own cluster-DNS Service on each port.\n */\nexport function buildK8sApplicationRuntimeEndpoints(\n input: K8sApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) =>\n buildK8sInternalUrl(input.appServiceName, port, input.namespace),\n );\n}\n\n/**\n * Build Docker-Compose application runtime endpoints — the compose counterpart\n * of {@link buildK8sApplicationRuntimeEndpoints}. PUBLIC URLs are IDENTICAL\n * (serviceHosts-driven, so the Traefik ingress routes and `runtime.endPoints`\n * agree — the CORS invariant holds for compose too). INTERNAL URLs are the app\n * container's own name on the shared compose network (`http://<appServiceName>:<port>`),\n * NOT localhost — the remote compose stack must not advertise localhost topology.\n */\nexport function buildComposeApplicationRuntimeEndpoints(\n input: ComposeApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) => `http://${input.appServiceName}:${port}`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-topology.contracts.js","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ACjD,KAA0C;IAE1C,OAAO,sCAAsC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAC5D,mBAAmB,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CACjE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uCAAuC,CACrD,KAA8C;IAE9C,OAAO,sCAAsC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,KAAK,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC,CAAC;AAC3G,CAAC","sourcesContent":["import {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n type RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\nimport {\n buildK8sInternalUrl,\n buildK8sPublicUrl,\n buildServicePublicHost,\n buildServicePublicUrl,\n} from '../project-config/shared/k8s-utils';\nimport { PLATFORM_DEFAULT_PORTS } from '../project-config/shared/infrastructure-defaults.schemas';\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { AppServiceDefinition } from '../project-config/shared/service-definitions.schemas';\n\nexport {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n parseRuntimeEndpointsRecord,\n PlatformApplicationType,\n PlatformRuntimeEndpointKey,\n serializeRuntimeEndpointsRecord,\n} from '@wildo-ai/platform-core-shared';\n\nexport type {\n ApplicationRuntimeEndpointsInput,\n PlatformRuntimeEndpointsInput,\n RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\n\nexport function buildLocalhostPlatformRuntimeEndpoints(\n host: string = 'localhost',\n): Record<string, RuntimeEndpointUrls> {\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildPlatformRuntimeEndpoints({\n appsManager: buildUrl(PLATFORM_DEFAULT_PORTS.APPS_MANAGER),\n crontabsBatchesManager: buildUrl(PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER),\n moduleRegistry: buildUrl(PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY),\n });\n}\n\nexport interface LocalhostApplicationRuntimeEndpointsInput {\n mainBackendApiPort?: number | undefined;\n frontendApplicationPorts?: Record<string, number> | undefined;\n websitePort?: number | undefined;\n technicalDocumentationPort?: number | undefined;\n host?: string | undefined;\n}\n\nexport function buildLocalhostApplicationRuntimeEndpoints(\n input: LocalhostApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n const host = input.host ?? 'localhost';\n /**\n * Local endpoints are plain http, publicly and internally, and there is no knob.\n *\n * A configurable local scheme existed until 2026-08-14 and was removed: it applied ONE scheme to\n * EVERY endpoint's own port, which is only correct when a single ingress fronts them all. Local\n * Docker Compose has none, so declaring https made `main_backend_api.publicUrl` name a port that\n * held no certificate, and every browser session died on its WebSocket readiness poll.\n *\n * Remote is unaffected and always was: `buildServicePublicUrl` hardcodes `https://` because TLS\n * terminates at Traefik/nginx in front of one origin, where a single scheme IS true for every\n * endpoint. That is the only place the question has a well-defined answer, and it never consulted\n * this input.\n */\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications: input.frontendApplicationPorts\n ? Object.fromEntries(\n Object.entries(input.frontendApplicationPorts).map(([frontendServiceName, port]) => [\n frontendServiceName,\n buildUrl(port),\n ]),\n )\n : undefined,\n ...(input.websitePort ? { website: buildUrl(input.websitePort) } : {}),\n ...(input.technicalDocumentationPort\n ? { technicalDocumentation: buildUrl(input.technicalDocumentationPort) }\n : {}),\n ...(input.mainBackendApiPort\n ? {\n mainBackendApi: buildUrl(input.mainBackendApiPort),\n }\n : {}),\n });\n}\n\n/**\n * Which backend is an application's MAIN backend API — the one its browser-facing\n * surfaces call. The `backendApi` service key when declared, else the first backend\n * row. One rule, used by the CLI's endpoint and ingress derivation and by the public\n * website's local origins, so the three cannot name different backends.\n */\nexport function selectPrimaryBackendService<TService extends { readonly key: string }>(\n backendServices: readonly TService[],\n): TService | undefined {\n return backendServices.find((backend) => backend.key === 'backendApi') ?? backendServices[0];\n}\n\n/** The origins a locally-running application serves its app and its main API on. */\nexport interface LocalhostApplicationOrigins {\n /** The `SAAS_APP` frontend, when one declares a port. */\n readonly app?: string | undefined;\n /** The main backend API ({@link selectPrimaryBackendService}), when it declares a port. */\n readonly api?: string | undefined;\n}\n\n/**\n * The local-development origins of an application's product and API, derived from\n * the `defaultPort` each service already declares in `wildo.saas.config.ts` — the\n * same ports, host and plain-http scheme {@link buildLocalhostApplicationRuntimeEndpoints}\n * advertises, so a local surface that links into the product reaches the process\n * `wildo local dev` actually started.\n *\n * It exists for the public website, which is a separate origin from the product:\n * its CTAs and capture forms must reach `http://localhost:<appPort>` and\n * `http://localhost:<backendPort>` under `astro dev`. Before this, the API origin\n * was a port hardcoded into each site and the app origin had no local form at all,\n * so every \"Start free\" in local development pointed at a production-shaped host\n * that resolves to nothing.\n */\nexport function resolveLocalhostApplicationOrigins(\n services: Readonly<Record<string, Pick<AppServiceDefinition, 'defaultPort' | 'frontendType'>>>,\n host = 'localhost',\n): LocalhostApplicationOrigins {\n const rows = Object.entries(services).map(([key, service]) => ({ key, ...service }));\n const primaryBackend = selectPrimaryBackendService(rows.filter((row) => row.frontendType === undefined));\n const saasApp = rows.find((row) => row.frontendType === AppFrontendType.SAAS_APP);\n const originOf = (port: number | undefined): string | undefined => (port === undefined ? undefined : `http://${host}:${port}`);\n return { app: originOf(saasApp?.defaultPort), api: originOf(primaryBackend?.defaultPort) };\n}\n\nexport function buildK8sPlatformRuntimeEndpoints(input: {\n publicDomain: string;\n namespace: string;\n}): Record<string, RuntimeEndpointUrls> {\n return buildPlatformRuntimeEndpoints({\n appsManager: {\n publicUrl: buildK8sPublicUrl('platform-apps-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-apps-manager', PLATFORM_DEFAULT_PORTS.APPS_MANAGER, input.namespace),\n },\n crontabsBatchesManager: {\n publicUrl: buildK8sPublicUrl('platform-crontabs-batches-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-crontabs-batches-manager', PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER, input.namespace),\n },\n moduleRegistry: {\n publicUrl: buildK8sPublicUrl('platform-module-registry', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-module-registry', PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY, input.namespace),\n },\n });\n}\n\nexport interface K8sIngressRoute {\n /** Public hostname Traefik/ingress routes on (from the serviceHosts resolver). */\n host: string;\n /**\n * Per-service k8s Service NAME this host routes to. In the per-service deploy\n * model each service is its OWN Deployment+Service, so the route target is the\n * service's `serviceName` (e.g. `wonder-todos-backend-api`, `wonder-todos-app`)\n * — NOT one shared app Service. This is the value stamped into the ingress\n * rule's `backend.service.name`.\n */\n serviceName: string;\n /** Port on that per-service Service to route this host to. */\n port: number;\n}\n\n/**\n * One public frontend in the app's service topology. `serviceName` and\n * `serviceKey` are DECOUPLED on purpose:\n * - `serviceName` — the `runtime.endPoints` map key (the consumer contract:\n * `lookupFrontendPublicUrl` / X-Frontend-Service-Name key by serviceName).\n * - `serviceKey` — the `config.services.<key>`, which is the serviceHosts\n * authoring key. The public HOST resolves from THIS, never from serviceName.\n * Conflating them silently ignores authored `serviceHosts` (the serviceName\n * `wonder-todos-app` misses the authored `app` entry).\n */\nexport interface ApplicationPublicFrontend {\n serviceName: string;\n serviceKey: string;\n port: number;\n}\n\nexport interface K8sApplicationIngressRoutesInput {\n publicDomain: string;\n serviceHosts: Record<string, string> | undefined;\n /** Public frontends. Host resolves from `serviceKey` (config key); route target is the frontend's own `serviceName`. */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API per-service k8s Service name (the ingress route target). */\n mainBackendApiServiceName?: string | undefined;\n /** Backend API Service port. */\n mainBackendApiPort?: number | undefined;\n}\n\n/**\n * Ingress routes for the app's PUBLIC services (every frontend + the main\n * backend API), serviceHosts-driven. Every host resolves from the service's\n * `config.services.<key>` (`serviceKey`) — so GIVEN THE SAME frontends/keys,\n * the routes match the `runtime.endPoints.publicUrl` that\n * {@link buildK8sApplicationRuntimeEndpoints} produces (both key public hosts on\n * `serviceKey`). Coherence is a property of feeding both the SAME `serviceKey`s,\n * not automatic — see the divergence guards in the domain plan. Health, webhooks,\n * the OAuth provider and MCP are routes on the backend's own port, so they reach\n * the public host through the backend API route like any other path (#1783).\n */\nexport function buildK8sApplicationIngressRoutes(\n input: K8sApplicationIngressRoutesInput,\n): K8sIngressRoute[] {\n const host = (serviceKey: string): string =>\n buildServicePublicHost({ serviceKey, serviceHosts: input.serviceHosts, publicDomain: input.publicDomain });\n\n const entries: Array<{ serviceKey: string; serviceName: string; host: string; port: number }> =\n input.frontends.map((f) => ({\n serviceKey: f.serviceKey,\n serviceName: f.serviceName,\n host: host(f.serviceKey),\n port: f.port,\n }));\n if (\n input.mainBackendApiServiceKey !== undefined &&\n input.mainBackendApiServiceName !== undefined &&\n input.mainBackendApiPort !== undefined\n ) {\n entries.push({\n serviceKey: input.mainBackendApiServiceKey,\n serviceName: input.mainBackendApiServiceName,\n host: host(input.mainBackendApiServiceKey),\n port: input.mainBackendApiPort,\n });\n }\n\n // Fail-closed host-uniqueness guard: each public host routes entirely to ONE\n // service:port (no path-based sharing), so two distinct services resolving to\n // the same host — e.g. both authored to the apex (`''`), or an unauthored key\n // that collides with an authored subdomain — is an ambiguous, silently-broken\n // ingress. Reject it at build time with the colliding keys named, rather than\n // emitting a manifest whose routing is undefined.\n const claimedBy = new Map<string, string>();\n for (const entry of entries) {\n const existing = claimedBy.get(entry.host);\n if (existing !== undefined && existing !== entry.serviceKey) {\n throw new Error(\n `serviceHosts collision: services '${existing}' and '${entry.serviceKey}' both resolve to public host '${entry.host}'. ` +\n `Each service needs a distinct 'serviceHosts' subdomain (only one service may map to the apex '').`,\n );\n }\n claimedBy.set(entry.host, entry.serviceKey);\n }\n\n return entries.map(({ host: h, serviceName, port }) => ({ host: h, serviceName, port }));\n}\n\n/**\n * Fields shared by every REMOTE runtime-endpoints builder (k8s + compose). The\n * PUBLIC side (serviceHosts resolution) is runtime-agnostic; only the INTERNAL\n * URL form differs, injected via the `internalUrlFor` callback of the core\n * builder ({@link buildRemoteApplicationRuntimeEndpoints}).\n */\nexport interface RemoteApplicationRuntimeEndpointsCommon {\n /** Operator's public domain (`WildoInfraEnvConfig.publicDomain`). */\n publicDomain: string;\n /** Authored per-service subdomain map (`wildo.infra.<env>.config.ts`). */\n serviceHosts: Record<string, string> | undefined;\n /**\n * Public frontends. The `runtime.endPoints` map is keyed by each frontend's\n * `serviceName` (consumer contract); the public HOST resolves from its\n * `serviceKey` (config key / serviceHosts key). See {@link ApplicationPublicFrontend}.\n */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** `serviceKey` of the STATIC_WEBSITE frontend (feeds the fixed website endpoint). */\n websiteServiceKey?: string | undefined;\n /** `serviceKey` of the TECH_DOC frontend (feeds the fixed technical-documentation endpoint). */\n technicalDocumentationServiceKey?: string | undefined;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API container port — the one port the backend process binds (its internal URL). */\n mainBackendApiPort?: number | undefined;\n}\n\nexport interface K8sApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /** K8s namespace for cluster-internal service DNS. */\n namespace: string;\n /**\n * K8s Service name for cluster-internal URLs. Single Service per app (all\n * frontends + APIs ride it on different ports), so this is the app's own\n * service name (= its slug).\n */\n appServiceName: string;\n}\n\nexport interface ComposeApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /**\n * Compose service (container) name for internal URLs. Single container per\n * app serving all frontends + APIs on their ports, reachable by other\n * containers on the shared network as `http://<appServiceName>:<port>`.\n */\n appServiceName: string;\n}\n\n/**\n * Core REMOTE application runtime-endpoints assembly, shared by the k8s and\n * compose builders so their public-URL semantics never drift. PUBLIC URLs come\n * from {@link buildServicePublicUrl} (so ingress hosts, `runtime.endPoints.publicUrl`,\n * and CORS all agree — greenfield, no multi-tenant fan-out). INTERNAL URLs are\n * supplied by `internalUrlFor` (cluster-DNS for k8s, container DNS for compose).\n * The backend declares ONE endpoint: health, webhooks, the OAuth provider and MCP\n * are routes on its port, not sibling listeners (#1783).\n */\nfunction buildRemoteApplicationRuntimeEndpoints(\n input: RemoteApplicationRuntimeEndpointsCommon,\n internalUrlFor: (port: number) => string,\n): Record<string, RuntimeEndpointUrls> {\n const { publicDomain, serviceHosts } = input;\n const pub = (serviceKey: string): string =>\n buildServicePublicUrl({ serviceKey, serviceHosts, publicDomain });\n const internal = internalUrlFor;\n\n // Map key = serviceName (consumer contract: lookupFrontendPublicUrl keys by\n // serviceName); public host = serviceKey (serviceHosts key). Decoupled.\n const frontendApplications = input.frontends.length > 0\n ? Object.fromEntries(\n input.frontends.map((f) => [\n f.serviceName,\n { publicUrl: pub(f.serviceKey), internalUrl: internal(f.port) },\n ]),\n )\n : undefined;\n\n const websiteFrontend = input.websiteServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.websiteServiceKey)\n : undefined;\n const docsFrontend = input.technicalDocumentationServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.technicalDocumentationServiceKey)\n : undefined;\n const { mainBackendApiServiceKey, mainBackendApiPort } = input;\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications,\n ...(websiteFrontend\n ? { website: { publicUrl: pub(websiteFrontend.serviceKey), internalUrl: internal(websiteFrontend.port) } }\n : {}),\n ...(docsFrontend\n ? {\n technicalDocumentation: {\n publicUrl: pub(docsFrontend.serviceKey),\n internalUrl: internal(docsFrontend.port),\n },\n }\n : {}),\n ...(mainBackendApiServiceKey !== undefined && mainBackendApiPort !== undefined\n ? {\n mainBackendApi: {\n publicUrl: pub(mainBackendApiServiceKey),\n internalUrl: internal(mainBackendApiPort),\n },\n }\n : {}),\n });\n}\n\n/**\n * Build K8s application runtime endpoints — the self-hosted, single-app,\n * `serviceHosts`-driven counterpart to {@link buildLocalhostApplicationRuntimeEndpoints}.\n * INTERNAL URLs are the app's own cluster-DNS Service on each port.\n */\nexport function buildK8sApplicationRuntimeEndpoints(\n input: K8sApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) =>\n buildK8sInternalUrl(input.appServiceName, port, input.namespace),\n );\n}\n\n/**\n * Build Docker-Compose application runtime endpoints — the compose counterpart\n * of {@link buildK8sApplicationRuntimeEndpoints}. PUBLIC URLs are IDENTICAL\n * (serviceHosts-driven, so the Traefik ingress routes and `runtime.endPoints`\n * agree — the CORS invariant holds for compose too). INTERNAL URLs are the app\n * container's own name on the shared compose network (`http://<appServiceName>:<port>`),\n * NOT localhost — the remote compose stack must not advertise localhost topology.\n */\nexport function buildComposeApplicationRuntimeEndpoints(\n input: ComposeApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) => `http://${input.appServiceName}:${port}`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wildo-owner-organization.contracts.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"wildo-owner-organization.contracts.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/wildo-owner-organization.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8D,KAAK,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEvJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,WAAW,8BAA8B;IAC7C,mFAAmF;IACnF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,QAAQ,CAAC,IAAI,EAAE,OAAO,gCAAgC,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,WAAW,CAAC;AAExD,eAAO,MAAM,yBAAyB,EAAE,eAIvC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,sBAAsB,CAAC;AAEpE,eAAO,MAAM,iCAAiC,EAAE,uBAO/C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,8BAItC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wildo-owner-organization.contracts.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"wildo-owner-organization.contracts.js","sourceRoot":"","sources":["../../../../src/bootstrap/wildo-owner-organization.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAwB,EAAsD,MAAM,uBAAuB,CAAC;AAuDvJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,QAAQ,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAoB;IACxD,CAAC,+BAA+B,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC;QAChE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,EAAE;KAC5D,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;AAEpE,MAAM,CAAC,MAAM,iCAAiC,GAA4B;IACxE,CAAC,gCAAgC,CAAC,EAAE;QAClC,SAAS,EAAE,CAAC,+BAA+B,CAAC;QAC5C,iBAAiB,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC;QAClG,iBAAiB,EAAE,cAAc,CAAC,UAAU;QAC5C,aAAa,EAAE,SAAS;KACzB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAmC;IACtE,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,gCAAgC;CACvC,CAAC","sourcesContent":["import { CORE_ORG_ROLES, RegistrationMode, UserTypeDefinitionSchema, type OrganizationTypesConfig, type UserTypesConfig } from '@wildo-ai/saas-models';\n\n/**\n * The ONE identity of the organization that owns Wildo's own applications.\n *\n * ## Why this constant exists\n *\n * This identity used to be hardcoded FOUR times, in two files, as TWO DIFFERENT VALUES — and the\n * result was a platform carrying two organizations, neither of them a customer:\n *\n * | declared in | value |\n * |---|---|\n * | `init-mode-startup.apps-manager.service.ts` (twice) | `wildo-platform` / `Wildo Platform` |\n * | `maintenance/services/app-initialization.service.ts` (twice) | `wildo` / `Wildo` |\n *\n * The two paths provision different things, so ownership split along them. Measured on the dogfood\n * platform (2026-09-01): `wildo-ai-application` — the bootstrap row — was owned by `wildo-platform`,\n * while `wonder-crm`, `wonder-todos` and `secrets-proof` were owned by `wildo`. Worse, OPERATOR\n * REACH followed the same split: the admin seeded by INIT was `ORG_ADMIN` of BOTH organizations,\n * while an admin seeded later by the maintenance path was a member of `wildo` ONLY. Nothing declared\n * that they should differ; it was decided by which code path happened to run.\n *\n * The bootstrap organization is also `ACTIVE` and authority-conferring, so everything that\n * ENUMERATES tenants — an organization switcher, the owner-floor boot report, a cross-tenant audit,\n * a subject-erasure sweep — counted a bootstrap artifact as a real tenant.\n *\n * ## Why ONE organization rather than two declared ones\n *\n * The second organization was never a design. `seedBootstrapApplicationRecord` needs *an* owner for\n * the minimal APPLICATION row it seeds to break a chicken-and-egg (an APPLICATION-primary-scoped\n * execution context resolves its `applicationId` by READING that row). It needs an owner; it never\n * needed a DIFFERENT one. Wildo owning all Wildo applications — including its own — is the coherent\n * reading, and it is what the duplication suggests was intended before the two literals drifted.\n *\n * If a future decision genuinely wants the platform's own application in a separate tenant, that is\n * a SECOND named constant here plus an explicit statement of which consumers must tell them apart —\n * not a second literal at a call site.\n *\n * ## What this does NOT do\n *\n * It does not retrofit an existing platform. Both bootstrap seeding arms look a row up by business\n * key and insert ONLY when absent, and the registration path prefers an existing application's\n * recorded `ownerOrganizationId` over the seeded id — so an installation that already carries two\n * organizations keeps both, with its existing linkage untouched. Only a FRESH platform gets one.\n * Merging the two on an existing installation is a migration with its own decision.\n */\nexport interface WildoOwnerOrganizationIdentity {\n /** Business key. Both provisioning paths upsert the organization by THIS field. */\n readonly slug: string;\n /** Display name written on first seed. */\n readonly name: string;\n /** The organization type written on first seed — a key of {@link WILDO_PLATFORM_ORGANIZATION_TYPES}. */\n readonly type: typeof WILDO_PLATFORM_ORGANIZATION_TYPE;\n}\n\n/**\n * The user type the platform seeds its first administrator with, and the one its organization type grants.\n *\n * Declared because it was already HELD: the platform's INIT seed gave its first administrator `member` long before\n * the platform declared any user type, and nothing checked the pair until organization types — whose granted user\n * types must be declared — became mandatory (#1032). Registration is DISABLED: a platform user exists because the\n * platform seeded them, never because someone signed up.\n */\nexport const WILDO_PLATFORM_MEMBER_USER_TYPE = 'member';\n\nexport const WILDO_PLATFORM_USER_TYPES: UserTypesConfig = {\n [WILDO_PLATFORM_MEMBER_USER_TYPE]: UserTypeDefinitionSchema.parse({\n auth: { registration: { mode: RegistrationMode.DISABLED } },\n }),\n};\n\n/**\n * The ONE organization type the platform's own tenancy declares (#1032, decided 2026-09-14).\n *\n * Every organization carries a type that names a declared organization type, because a member of an\n * organization whose type resolves to nothing cannot sign in. An application declares its types in\n * `wildo.saas.config.ts`; the platform has no such file, so its declaration lives here, beside the\n * identity of the organization it types. Before this, the platform seeded its organizations with no\n * type at all, and `wildo_platform` held two of them.\n *\n * It grants {@link WILDO_PLATFORM_MEMBER_USER_TYPE}, the user type the platform's INIT seeds its first administrator\n * with, so the platform's own first-organization derivation resolves to this type rather than refusing — and a\n * configuration carrying this map must carry {@link WILDO_PLATFORM_USER_TYPES} beside it, or its granted user type\n * is undeclared.\n */\nexport const WILDO_PLATFORM_ORGANIZATION_TYPE = 'platform-operator';\n\nexport const WILDO_PLATFORM_ORGANIZATION_TYPES: OrganizationTypesConfig = {\n [WILDO_PLATFORM_ORGANIZATION_TYPE]: {\n userTypes: [WILDO_PLATFORM_MEMBER_USER_TYPE],\n availableOrgRoles: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_MEMBER],\n defaultMemberRole: CORE_ORG_ROLES.ORG_MEMBER,\n authOverrides: undefined,\n },\n};\n\nexport const WILDO_OWNER_ORGANIZATION: WildoOwnerOrganizationIdentity = {\n slug: 'wildo',\n name: 'Wildo',\n type: WILDO_PLATFORM_ORGANIZATION_TYPE,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-authoring.entry.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"config-authoring.entry.d.ts","sourceRoot":"","sources":["../../../src/config-authoring.entry.ts"],"names":[],"mappings":"AAsCA,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-authoring.entry.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"config-authoring.entry.js","sourceRoot":"","sources":["../../../src/config-authoring.entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,EAAE,CAAC;AAEpB,cAAc,SAAS,CAAC","sourcesContent":["/**\n * What `@wildo-ai/platform-config-lib` resolves to while the CONFIG LOADER evaluates a configuration\n * file from source (`loader.ts` → `resolvePlatformConfigLibEntry`).\n *\n * It is the package root plus one side effect: the Zod decorators are initialized before any schema\n * module in the evaluated graph runs, because a config file's own schemas may be authored with them\n * and the loader owns no other moment to do it.\n *\n * ## It re-exports the WHOLE root, and that is the point\n *\n * Until 2026-09-09 this entry exported `./project-config` and `./workspace-scope` and nothing else,\n * and the narrowing was never a boundary — it was a trap that fired twice, the same way both times.\n * The loader substitutes this file for the package specifier in EVERY module of the evaluated\n * graph, and that graph is not only the authored config: `wildo.saas.config.ts` and the backend\n * config import `@wildo-ai/saas-backend-lib`, which the loader also aliases to source, and the\n * engine's own modules import `@wildo-ai/platform-config-lib` expecting the root. A symbol the\n * root exports but this entry did not was not refused — under jiti it arrived as `undefined`, at\n * the first module-eval use:\n *\n * - `MinionPlatformAccessScope`: an app config importing it beside `AppFrontendType`, same\n * package, same statement, got one and `undefined` for the other. The symptom was answered by\n * moving the enum out of `bootstrap/` into `project-config/` (`minion-platform-access.vocabulary.ts`).\n * - `AdminAppManagedMinionsSchema` / `AdminAppManagedWorkersSchema`: the engine's configuration\n * loader began composing its wire schema from these at module load (removing a hand copy that\n * had silently stripped fields twice). Under the loader it threw\n * \"Cannot read properties of undefined (reading 'optional')\" and `wildo local dev` shut the\n * whole stack down at \"Registering application once and materializing every runtime target\".\n *\n * Moving symbols around cures one name at a time and teaches nothing; an entry that carries the\n * root's value surface cannot have this defect. Nothing in the root is unsafe here — the loader\n * runs under Node, and the root's Node-only modules (lockfile IO, credential generation) are\n * exactly what a Node process may load. If a module ever becomes unsuitable for config evaluation,\n * exclude THAT module from the root, explicitly, with its reason — never narrow this file again.\n */\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators();\n\nexport * from './index';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-generator.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"credential-generator.service.d.ts","sourceRoot":"","sources":["../../../../src/credentials/credential-generator.service.ts"],"names":[],"mappings":"AAMA,qBAAa,mBAAmB;IAE9B,MAAM,CAAC,iBAAiB,IAAI;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;IASrE,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM;IAIpD,MAAM,CAAC,cAAc,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM;IAIlD,MAAM,CAAC,oBAAoB,IAAI,MAAM;IAIrC,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;CASpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-generator.service.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"credential-generator.service.js","sourceRoot":"","sources":["../../../../src/credentials/credential-generator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1D,MAAM,YAAY,GAAG,gEAAgE,CAAC;AACtF,MAAM,cAAc,GAAG,YAAY,GAAG,KAAK,CAAC;AAG5C,MAAM,OAAO,mBAAmB;IAE9B,MAAM,CAAC,iBAAiB;QACtB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,mBAAmB,CAAC,IAAI,EAAE;YAC1D,UAAU,EAAE,YAAY;YACxB,iBAAiB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;YAClD,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;SACpD,CAAC,CAAC;QACH,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;IACxE,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAiB,EAAE;QACzC,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,SAAiB,EAAE;QACvC,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,oBAAoB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,MAAc,EAAE,OAAe;QACxD,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CAEF","sourcesContent":["import { generateKeyPairSync, randomBytes } from 'crypto';\n\nconst ALPHANUMERIC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\nconst PASSWORD_CHARS = ALPHANUMERIC + '_+-';\n\n\nexport class CredentialGenerator {\n\n static generateECKeyPair(): { privateKey: string; publicKey: string } {\n const { publicKey, privateKey } = generateKeyPairSync('ec', {\n namedCurve: 'prime256v1',\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'sec1', format: 'pem' },\n });\n return { privateKey: privateKey.trim(), publicKey: publicKey.trim() };\n }\n\n static generatePassword(length: number = 24): string {\n return this.generateFromCharset(length, PASSWORD_CHARS);\n }\n\n static generateSecret(length: number = 48): string {\n return this.generateFromCharset(length, ALPHANUMERIC);\n }\n\n static generateErlangCookie(): string {\n return this.generateFromCharset(32, ALPHANUMERIC);\n }\n\n static generateFromCharset(length: number, charset: string): string {\n const bytes = randomBytes(length);\n let result = '';\n for (let i = 0; i < length; i++) {\n result += charset[bytes[i] % charset.length];\n }\n return result;\n }\n\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './project-config/shared/minion-resource-access.validation';
|
|
|
26
26
|
export * from './project-config/shared/object-storage-session-policy';
|
|
27
27
|
export * from './lockfile/wildo-saas-lock.shared.schemas';
|
|
28
28
|
export * from './lockfile/lockfile-io';
|
|
29
|
+
export * from './lockfile/file-lock-hold';
|
|
29
30
|
export * from './lockfile/build-parallelism';
|
|
30
31
|
export * from './lockfile/materialize-infra-section';
|
|
31
32
|
export * from './lockfile/canonical-json';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export * from './project-config/shared/minion-resource-access.validation.js';
|
|
|
26
26
|
export * from './project-config/shared/object-storage-session-policy.js';
|
|
27
27
|
export * from './lockfile/wildo-saas-lock.shared.schemas.js';
|
|
28
28
|
export * from './lockfile/lockfile-io.js';
|
|
29
|
+
export * from './lockfile/file-lock-hold.js';
|
|
29
30
|
export * from './lockfile/build-parallelism.js';
|
|
30
31
|
export * from './lockfile/materialize-infra-section.js';
|
|
31
32
|
export * from './lockfile/canonical-json.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './project-config';\nexport * from './workspace-scope';\nexport * from './credentials/credential-generator.service';\n\nexport * from './schemas/platform-application-config.schemas';\nexport * from './schemas/platform-application-secrets.schemas';\nexport * from './schemas/platform-config.schemas';\nexport * from './schemas/framework-info.schemas';\nexport * from './schemas/framework-secrets.schemas';\nexport * from './release/framework-release.constants';\nexport * from './bootstrap/bootstrap.schemas';\nexport * from './bootstrap/bootstrap.contracts';\nexport * from './bootstrap/bootstrap-planner';\nexport * from './bootstrap/application-backend-env.contracts';\nexport * from './bootstrap/wildo-owner-organization.contracts';\nexport * from './bootstrap/application-creation-verification-env.contracts';\nexport * from './bootstrap/platform-runtime-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/runtime-backing-service-access';\nexport * from './bootstrap/platform-store-preconnect';\nexport * from './bootstrap/runtime-network-topology';\nexport * from './bootstrap/runtime-network-policy';\nexport * from './bootstrap/runtime-platform-access';\nexport * from './project-config/minion-local-provider-registration';\nexport * from './project-config/shared/minion-resource-access.validation';\nexport * from './project-config/shared/object-storage-session-policy';\nexport * from './lockfile/wildo-saas-lock.shared.schemas';\nexport * from './lockfile/lockfile-io';\nexport * from './lockfile/file-lock-hold';\nexport * from './lockfile/build-parallelism';\nexport * from './lockfile/materialize-infra-section';\nexport * from './lockfile/canonical-json';\nexport * from './registry';\nexport * from './_unimplemented';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"build-parallelism.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAmD,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGhE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-parallelism.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"build-parallelism.js","sourceRoot":"","sources":["../../../../src/lockfile/build-parallelism.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAW,0CAA0C,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5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U,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5H,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\n/**\n * How many build-plan coding tasks the creation lane may run AT ONCE in one application (#1528).\n *\n * An OPERATIONAL setting, not product truth: it decides how fast the build spends, never what it\n * builds, so it lives in the application's machine-local state beside the workspace-mutation lock and\n * is safe to delete. The companion reads it at every wave, so it changes without a restart; the CLI\n * writes it (`wildo workbench parallelism <n>`).\n *\n * Absent means {@link DEFAULT_BUILD_PARALLELISM}. `1` is the lane's single-flight behaviour, and remains\n * one command away. Parallel runs share ONE worktree by decision (Paul, 2026-09-24): concurrent agents\n * editing the same tree reconcile fine in practice, so the lane detects and repairs interference instead\n * of preventing it.\n */\nexport const BUILD_PARALLELISM_RELATIVE_PATH: string = '.wildo-saas/state/build-parallelism.json';\n\n/**\n * Five runs at once, by decision (Paul, 2026-09-24): parallel is the lane's normal mode, not an opt-in.\n *\n * Five rather than more because each slot is a live agent spending on its own, and the wave is already\n * measured to cut wall-clock by more than three at four runs (a live wave of four real agents: 28 s\n * against 86 s of combined run time). It sits under the ACP provider's own limit of ten concurrent\n * sessions, so the setting — not the provider — is what decides the width.\n */\nexport const DEFAULT_BUILD_PARALLELISM = 5;\n\n/**\n * A breaker, not a budget. Each slot is a live coding agent spending on its own, so the ceiling stops\n * a typo (`100`) from becoming a hundred concurrent agents; any value up to it is the operator's call.\n */\nexport const MAXIMUM_BUILD_PARALLELISM = 16;\n\n/** Absolute path of an application's build-parallelism setting. */\nexport function getBuildParallelismPath(saasRoot: string): string {\n return path.join(saasRoot, BUILD_PARALLELISM_RELATIVE_PATH);\n}\n\n/** Clamp a requested degree into `[1, MAXIMUM_BUILD_PARALLELISM]`; anything unreadable is the default. */\nexport function normalizeBuildParallelism(value: unknown): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return DEFAULT_BUILD_PARALLELISM;\n return Math.min(MAXIMUM_BUILD_PARALLELISM, Math.max(1, Math.floor(value)));\n}\n\n/**\n * The application's build parallelism. Never throws: an absent, unreadable or malformed file reads as\n * the default, because a throughput knob that cannot be read must not stop the build.\n */\nexport function readBuildParallelism(saasRoot: string): number {\n const filePath = getBuildParallelismPath(saasRoot);\n if (!existsSync(filePath)) return DEFAULT_BUILD_PARALLELISM;\n try {\n return normalizeBuildParallelism((JSON.parse(readFileSync(filePath, 'utf8')) as { degree?: unknown }).degree);\n } catch {\n return DEFAULT_BUILD_PARALLELISM;\n }\n}\n\n/** Record the application's build parallelism, clamped. Returns the degree actually recorded. */\nexport function writeBuildParallelism(saasRoot: string, degree: number): number {\n const recorded = normalizeBuildParallelism(degree);\n const filePath = getBuildParallelismPath(saasRoot);\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${JSON.stringify({ degree: recorded, recordedAt: new Date().toISOString() }, null, 2)}\\n`, 'utf8');\n return recorded;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAW1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"canonical-json.js","sourceRoot":"","sources":["../../../../src/lockfile/canonical-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtC,MAAM,CAAC,CAAC,CAAC,GAAI,CAA6B,CAAC,CAAC,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Canonical JSON serialization helpers shared by lockfile writers and\n * lockfile readers (Slice 4.A.1 / H2 of `infra-provider-planner.md`).\n *\n * `JSON.stringify`'s built-in second argument can either filter+order\n * top-level keys (when given an array) or transform values (when given\n * a function). To get a *recursive* canonical serialization — the\n * SAME byte output for two semantically equal inputs regardless of\n * property-insertion order at any nesting level — we need a transform\n * that returns a new object with sorted keys at every layer.\n *\n * The legacy in-line implementation in `materialize-infra-section.ts`\n * sorted only top-level keys. That meant nested objects (e.g.\n * `MongoBackingService.options: {retryWrites, w, authSource}`) drifted\n * across editor saves that re-ordered the nested keys, falsely\n * triggering lockfile-drift CI failures.\n *\n * This helper is the canonical fix.\n */\n\nimport { createHash } from 'node:crypto';\n\n/**\n * `JSON.stringify` with sorted keys at every nesting level. Stable\n * across platforms, editor save formats, and Node versions.\n *\n * Special-cases:\n * - Arrays preserve order (semantic — array order is meaningful).\n * - Objects sort their own keys (lexicographic).\n * - Primitives pass through.\n * - `undefined` values are dropped (matches `JSON.stringify` default).\n */\nexport function stableJsonStringify(value: unknown): string {\n return JSON.stringify(value, (_key, v) => {\n if (v && typeof v === 'object' && !Array.isArray(v)) {\n const sorted: Record<string, unknown> = {};\n for (const k of Object.keys(v).sort()) {\n sorted[k] = (v as Record<string, unknown>)[k];\n }\n return sorted;\n }\n return v;\n });\n}\n\n/**\n * Stable sha256 digest of any JSON-serializable value. Output format:\n * `sha256:<hex>` (matches the digest convention used elsewhere in the\n * lockfile envelope, e.g. provider-runtime artifacts).\n *\n * Two inputs with the same canonical serialization (per\n * `stableJsonStringify`) produce the same digest regardless of\n * property-insertion order at any nesting level.\n */\nexport function stableSha256Digest(value: unknown): string {\n const canonical = stableJsonStringify(value);\n return `sha256:${createHash('sha256').update(canonical).digest('hex')}`;\n}\n"]}
|