@wildo-ai/platform-config-lib 1.1.13 → 1.1.15

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.
Files changed (60) hide show
  1. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.d.ts +187 -0
  2. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.d.ts.map +1 -0
  3. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.js +250 -0
  4. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.js.map +1 -0
  5. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.d.ts +41 -0
  6. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.d.ts.map +1 -0
  7. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.js +53 -0
  8. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.js.map +1 -0
  9. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -0
  10. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  13. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +64 -0
  14. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +49 -0
  16. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -1
  17. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +23 -2
  18. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/runtime-backing-service-access.js +23 -4
  20. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  21. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +14 -0
  22. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/runtime-topology.contracts.js +24 -0
  24. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  25. package/dist/esm/index.d.ts +2 -0
  26. package/dist/esm/index.d.ts.map +1 -1
  27. package/dist/esm/index.js +2 -0
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/key-management/approval-seal-verifier.d.ts +72 -2
  30. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
  31. package/dist/esm/key-management/approval-seal-verifier.js +102 -0
  32. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
  33. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +1 -1
  34. package/dist/esm/pnpm-settings/application-pnpm-settings.js +1 -1
  35. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -1
  36. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  37. package/dist/esm/project-config/define-infra-env-config.js +12 -1
  38. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  39. package/dist/esm/project-config/hosted-infra-env-config.js +8 -1
  40. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  41. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  42. package/dist/esm/project-config/provider-companion-discovery.js +1 -0
  43. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  44. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +23 -0
  45. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  46. package/dist/esm/project-config/provider-runtime-artifacts.js +68 -5
  47. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  48. package/dist/esm/project-config/shared/csp-defaults.d.ts +7 -3
  49. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  50. package/dist/esm/project-config/shared/csp-defaults.js +10 -4
  51. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  52. package/dist/esm/project-config/shared/environment.schemas.d.ts +52 -6
  53. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  54. package/dist/esm/project-config/shared/environment.schemas.js +80 -6
  55. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  56. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +8 -0
  57. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  58. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  59. package/dist/tsconfig.build.tsbuildinfo +1 -1
  60. package/package.json +8 -8
@@ -158,4 +158,18 @@ export declare function buildK8sApplicationRuntimeEndpoints(input: K8sApplicatio
158
158
  * NOT localhost — the remote compose stack must not advertise localhost topology.
159
159
  */
160
160
  export declare function buildComposeApplicationRuntimeEndpoints(input: ComposeApplicationRuntimeEndpointsInput): Record<string, RuntimeEndpointUrls>;
161
+ /** Loopback hostnames a host process advertises; inside a container each names the container itself. */
162
+ export declare const LOOPBACK_HOSTNAMES: ReadonlySet<string>;
163
+ /**
164
+ * An internal URL as a container sees it, when the URL may name a process on the HOST (#3382, #2303): a loopback host
165
+ * is re-pointed at the container's host gateway (`host.docker.internal` in compose), keeping scheme, port, path, query
166
+ * and fragment. Any other host is returned unchanged; so is every URL when `hostGatewayHostname` is undefined, the
167
+ * caller then running where loopback already means the host.
168
+ *
169
+ * The one derivation both of its callers run: the CLI handing a compose minion or worker its runtime endpoints, and
170
+ * the platform scheduler reaching an application backend that runs on the host. Rebuilt from the PARSED parts rather
171
+ * than by searching the string for the host, because `URL` normalizes the host (case, default port). A bare `/` path
172
+ * is dropped when the original had none, so `http://localhost:4241` becomes `http://host.docker.internal:4241`.
173
+ */
174
+ export declare function toHostGatewayUrl(url: string, hostGatewayHostname: string | undefined): string;
161
175
  //# sourceMappingURL=runtime-topology.contracts.d.ts.map
@@ -1 +1 @@
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,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,SAAS,CAAC;IACjD;;;;OAIG;IACH,SAAS,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACpD,sFAAsF;IACtF,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,gGAAgG;IAChG,gCAAgC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,mCAAoC,SAAQ,uCAAuC;IAClG,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;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
+ {"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,CA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,MAAM,GAAG,SAAS,CAAC;IAC9C,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,mCAAoC,SAAQ,uCAAuC;IAClG,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;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;AAED,wGAAwG;AACxG,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAuD,CAAC;AAE3G;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ7F"}
@@ -213,4 +213,28 @@ export function buildK8sApplicationRuntimeEndpoints(input) {
213
213
  export function buildComposeApplicationRuntimeEndpoints(input) {
214
214
  return buildRemoteApplicationRuntimeEndpoints(input, (port) => `http://${input.appServiceName}:${port}`);
215
215
  }
216
+ /** Loopback hostnames a host process advertises; inside a container each names the container itself. */
217
+ export const LOOPBACK_HOSTNAMES = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);
218
+ /**
219
+ * An internal URL as a container sees it, when the URL may name a process on the HOST (#3382, #2303): a loopback host
220
+ * is re-pointed at the container's host gateway (`host.docker.internal` in compose), keeping scheme, port, path, query
221
+ * and fragment. Any other host is returned unchanged; so is every URL when `hostGatewayHostname` is undefined, the
222
+ * caller then running where loopback already means the host.
223
+ *
224
+ * The one derivation both of its callers run: the CLI handing a compose minion or worker its runtime endpoints, and
225
+ * the platform scheduler reaching an application backend that runs on the host. Rebuilt from the PARSED parts rather
226
+ * than by searching the string for the host, because `URL` normalizes the host (case, default port). A bare `/` path
227
+ * is dropped when the original had none, so `http://localhost:4241` becomes `http://host.docker.internal:4241`.
228
+ */
229
+ export function toHostGatewayUrl(url, hostGatewayHostname) {
230
+ if (hostGatewayHostname === undefined)
231
+ return url;
232
+ const parsed = new URL(url);
233
+ if (!LOOPBACK_HOSTNAMES.has(parsed.hostname))
234
+ return url;
235
+ const hadPath = /^[a-z][a-z0-9+.-]*:\/\/[^/?#]*[/]/i.test(url);
236
+ const path = parsed.pathname === '/' && !hadPath ? '' : parsed.pathname;
237
+ const port = parsed.port === '' ? '' : `:${parsed.port}`;
238
+ return `${parsed.protocol}//${hostGatewayHostname}${port}${path}${parsed.search}${parsed.hash}`;
239
+ }
216
240
  //# sourceMappingURL=runtime-topology.contracts.js.map
@@ -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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AE,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE;YAC1G,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,YAAY;YACd,CAAC,CAAC;gBACE,sBAAsB,EAAE;oBACtB,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC;oBACvC,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","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,cAAc,EAAE,QAAQ,CAAC,sBAAsB,CAAC,eAAe,CAAC;KACjE,CAAC,CAAC;AACL,CAAC;AAUD,MAAM,UAAU,yCAAyC,CACvD,KAAgD;IAEhD,MAAM,IAAI,GAAG,K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AC,MAAM,CAAC,QAAQ,CAAC;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;IACzD,OAAO,GAAG,MAAM,CAAC,QAAQ,KAAK,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;AAClG,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\n/** Loopback hostnames a host process advertises; inside a container each names the container itself. */\nexport const LOOPBACK_HOSTNAMES: ReadonlySet<string> = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);\n\n/**\n * An internal URL as a container sees it, when the URL may name a process on the HOST (#3382, #2303): a loopback host\n * is re-pointed at the container's host gateway (`host.docker.internal` in compose), keeping scheme, port, path, query\n * and fragment. Any other host is returned unchanged; so is every URL when `hostGatewayHostname` is undefined, the\n * caller then running where loopback already means the host.\n *\n * The one derivation both of its callers run: the CLI handing a compose minion or worker its runtime endpoints, and\n * the platform scheduler reaching an application backend that runs on the host. Rebuilt from the PARSED parts rather\n * than by searching the string for the host, because `URL` normalizes the host (case, default port). A bare `/` path\n * is dropped when the original had none, so `http://localhost:4241` becomes `http://host.docker.internal:4241`.\n */\nexport function toHostGatewayUrl(url: string, hostGatewayHostname: string | undefined): string {\n if (hostGatewayHostname === undefined) return url;\n const parsed = new URL(url);\n if (!LOOPBACK_HOSTNAMES.has(parsed.hostname)) return url;\n const hadPath = /^[a-z][a-z0-9+.-]*:\\/\\/[^/?#]*[/]/i.test(url);\n const path = parsed.pathname === '/' && !hadPath ? '' : parsed.pathname;\n const port = parsed.port === '' ? '' : `:${parsed.port}`;\n return `${parsed.protocol}//${hostGatewayHostname}${port}${path}${parsed.search}${parsed.hash}`;\n}\n"]}
@@ -9,6 +9,7 @@ export * from './schemas/framework-secrets.schemas';
9
9
  export * from './release/framework-release.constants';
10
10
  export * from './bootstrap/bootstrap.schemas';
11
11
  export * from './bootstrap/bootstrap.contracts';
12
+ export * from './bootstrap/application-scheduled-jobs.contracts';
12
13
  export * from './bootstrap/bootstrap-planner';
13
14
  export * from './bootstrap/application-backend-env.contracts';
14
15
  export * from './bootstrap/wildo-owner-organization.contracts';
@@ -18,6 +19,7 @@ export * from './bootstrap/runtime-secret-env.contracts';
18
19
  export * from './bootstrap/runtime-topology.contracts';
19
20
  export * from './bootstrap/runtime-principal.contracts';
20
21
  export * from './bootstrap/postgresql-owed-grants.contracts';
22
+ export * from './bootstrap/minion-database-queue-confinement.contracts';
21
23
  export * from './bootstrap/runtime-response-integrity';
22
24
  export * from './key-management/es256-jws';
23
25
  export * from './key-management/data-key.contracts';
@@ -1 +1 @@
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;AACh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,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
package/dist/esm/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './schemas/framework-secrets.schemas.js';
9
9
  export * from './release/framework-release.constants.js';
10
10
  export * from './bootstrap/bootstrap.schemas.js';
11
11
  export * from './bootstrap/bootstrap.contracts.js';
12
+ export * from './bootstrap/application-scheduled-jobs.contracts.js';
12
13
  export * from './bootstrap/bootstrap-planner.js';
13
14
  export * from './bootstrap/application-backend-env.contracts.js';
14
15
  export * from './bootstrap/wildo-owner-organization.contracts.js';
@@ -18,6 +19,7 @@ export * from './bootstrap/runtime-secret-env.contracts.js';
18
19
  export * from './bootstrap/runtime-topology.contracts.js';
19
20
  export * from './bootstrap/runtime-principal.contracts.js';
20
21
  export * from './bootstrap/postgresql-owed-grants.contracts.js';
22
+ export * from './bootstrap/minion-database-queue-confinement.contracts.js';
21
23
  export * from './bootstrap/runtime-response-integrity.js';
22
24
  export * from './key-management/es256-jws.js';
23
25
  export * from './key-management/data-key.contracts.js';
@@ -1 +1 @@
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,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,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,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,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-secret-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/postgresql-owed-grants.contracts';\nexport * from './bootstrap/runtime-response-integrity';\nexport * from './key-management/es256-jws';\nexport * from './key-management/data-key.contracts';\nexport * from './key-management/key-provider.spi';\nexport * from './key-management/application-signing-key-rotation.contracts';\nexport * from './key-management/application-legacy-envelope-key.contracts';\nexport * from './key-management/keyring-rotation.contracts';\nexport * from './key-management/keyring-status.contracts';\nexport * from './key-management/signature-request.contracts';\nexport * from './key-management/approval-seal.contracts';\nexport * from './key-management/approval-seal-verifier';\nexport * from './key-management/approval-seal-manifested-copy';\nexport * from './key-management/signing-log-export.contracts';\nexport * from './key-management/vault-custody.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 './canonical-json/rfc8785-canonical-json';\nexport * from './registry';\nexport * from './pnpm-settings/application-pnpm-settings';\nexport * from './blueprint/blueprint.schemas';\nexport * from './blueprint/anchored-region';\n"]}
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,kDAAkD,CAAC;AACjE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yDAAyD,CAAC;AACxE,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,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,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,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/application-scheduled-jobs.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-secret-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/postgresql-owed-grants.contracts';\nexport * from './bootstrap/minion-database-queue-confinement.contracts';\nexport * from './bootstrap/runtime-response-integrity';\nexport * from './key-management/es256-jws';\nexport * from './key-management/data-key.contracts';\nexport * from './key-management/key-provider.spi';\nexport * from './key-management/application-signing-key-rotation.contracts';\nexport * from './key-management/application-legacy-envelope-key.contracts';\nexport * from './key-management/keyring-rotation.contracts';\nexport * from './key-management/keyring-status.contracts';\nexport * from './key-management/signature-request.contracts';\nexport * from './key-management/approval-seal.contracts';\nexport * from './key-management/approval-seal-verifier';\nexport * from './key-management/approval-seal-manifested-copy';\nexport * from './key-management/signing-log-export.contracts';\nexport * from './key-management/vault-custody.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 './canonical-json/rfc8785-canonical-json';\nexport * from './registry';\nexport * from './pnpm-settings/application-pnpm-settings';\nexport * from './blueprint/blueprint.schemas';\nexport * from './blueprint/anchored-region';\n"]}
@@ -60,6 +60,13 @@ export interface ApprovalSealVerificationInput {
60
60
  readonly contentErased?: boolean;
61
61
  readonly bytes?: Uint8Array;
62
62
  };
63
+ /**
64
+ * The copies an electronic-signature vendor returned of that deliverable (#2293, #2907): each derived from the approved
65
+ * original as a `VENDOR_SIGNED_COPY`. The host names each one (`fileId`), states which file its row says it was derived
66
+ * from (`derivedFromFileId`) and the hash its row recorded (`contentSha256`), all read as statements, never as proof;
67
+ * whoever holds the file gives its BYTES (`wildo seal verify --vendor-signed-copy`). See {@link ApprovalSealVendorSignedCopyInput}.
68
+ */
69
+ readonly vendorSignedCopies?: readonly ApprovalSealVendorSignedCopyInput[];
63
70
  /**
64
71
  * The record the approval is about, as it is NOW (#2914): its fields as an export of the record states them, or null
65
72
  * for a record that is gone. Compared with the sealed field set the disclosed presentation carries
@@ -79,6 +86,31 @@ export interface ApprovalSealVerificationInput {
79
86
  readonly pins?: CryptoKeyPinSet;
80
87
  };
81
88
  }
89
+ /**
90
+ * One vendor-signed copy of the approved deliverable, as the verifier is given it (#2907's document chain).
91
+ *
92
+ * The chain is: the frozen original the seal binds → its manifested copy (this seal's approval page appended), and the
93
+ * same original → each vendor-signed copy (the vendor's signature appended as an incremental update, which the request's
94
+ * PAdES validation required: its signed revision starts with exactly the bytes sent). So a vendor-signed copy is tied to
95
+ * the approval by its FIRST REVISION: a prefix of the copy, ending at a `%%EOF` marker, must open the seal's commitment to
96
+ * the original (`approvalSealFileCommitmentOf(salt, sha256(prefix))`). That needs the disclosed presentation and the
97
+ * deliverable's salt, exactly like the deliverable itself.
98
+ *
99
+ * What this does NOT check: the vendor's signature over the copy. That was validated at receipt by the engine (chain to the
100
+ * vendor's pinned anchors, revocation data, byte range), and its evidence is the request's `validationEvidence` file. The
101
+ * offline verifier answers the question the seal can answer: does this copy start with the approved file. Whether what
102
+ * follows is the vendor's validated signature is the HOST's record, which is why a copy the host recorded (named, with
103
+ * the hash its row kept, and these bytes) is reported apart from one the host does not record (`recordedByHost`).
104
+ */
105
+ export interface ApprovalSealVendorSignedCopyInput {
106
+ /** The copy's file id, as the host names it. */
107
+ readonly fileId?: string;
108
+ /** The file the host's row says this copy was derived from. When it is not the deliverable the seal binds, it is refused. */
109
+ readonly derivedFromFileId?: string;
110
+ /** The copy's SHA-256 as its file row recorded it: given bytes that do not hash to it are refused. */
111
+ readonly contentSha256?: string;
112
+ readonly bytes?: Uint8Array;
113
+ }
82
114
  /** What corroborated a seal under a compromised key. */
83
115
  export declare enum ApprovalSealCorroborationSource {
84
116
  /** The decision's payload digest, recorded outside the application before the compromise. */
@@ -115,7 +147,13 @@ export declare enum ApprovalSealVerificationFailure {
115
147
  * A manifested copy was given and is not this seal's (#2907): its approval page, its attached JWS or its page tree is
116
148
  * not what the seal rebuilds, or what precedes them is not the file the seal binds.
117
149
  */
118
- MANIFESTED_COPY_MISMATCH = "manifested_copy_mismatch"
150
+ MANIFESTED_COPY_MISMATCH = "manifested_copy_mismatch",
151
+ /**
152
+ * A vendor-signed copy was given or named and is not derived from the file this seal binds (#2907): no prefix of it
153
+ * ending at a `%%EOF` is the approved file, its bytes are not the ones its row recorded, or the host states it was
154
+ * derived from another file.
155
+ */
156
+ VENDOR_SIGNED_COPY_MISMATCH = "vendor_signed_copy_mismatch"
119
157
  }
120
158
  /** What the seal says about the file deliverable it attests (#2904). */
121
159
  export declare enum ApprovalSealDeliverableFileStanding {
@@ -135,7 +173,12 @@ export declare enum ApprovalSealDeliverableFileStanding {
135
173
  * name in clear and a file cannot be scrubbed, so it went; the seal and the original still prove the approval, and the
136
174
  * copy can be rebuilt from both should the name ever lawfully be needed again.
137
175
  */
138
- CONTENT_ERASED = "content_erased"
176
+ CONTENT_ERASED = "content_erased",
177
+ /**
178
+ * A vendor-signed copy (#2907) only: the host's own row says it was derived from another file than the one this seal
179
+ * binds. The copy belongs to another original, whatever its bytes; the seal does not verify with it.
180
+ */
181
+ DERIVED_FROM_ANOTHER_FILE = "derived_from_another_file"
139
182
  }
140
183
  /**
141
184
  * What the seal says about one committed disclosure: a person's (approver, requester), what they were shown, what they
@@ -212,6 +255,28 @@ export interface ApprovalSealVerification {
212
255
  readonly locale?: string;
213
256
  readonly verificationUrl?: string;
214
257
  };
258
+ /**
259
+ * Each vendor-signed copy named or given (#2907), in the order given: MATCHES (its first revision is the file the seal
260
+ * binds, `derivesFromFileId` naming it, `originalLength` where it ends), CHANGED, DERIVED_FROM_ANOTHER_FILE, NOT_GIVEN
261
+ * or NOT_COMMITTED (the presentation or the deliverable's salt is not disclosed, so there is nothing to tie it to).
262
+ */
263
+ readonly vendorSignedCopies?: ReadonlyArray<{
264
+ readonly fileId?: string;
265
+ readonly standing: ApprovalSealDeliverableFileStanding;
266
+ /** The approved original this copy derives from: the deliverable the seal binds, when the copy MATCHES it. */
267
+ readonly derivesFromFileId?: string;
268
+ /** The original's length in bytes: what follows it is what the vendor appended. */
269
+ readonly originalLength?: number;
270
+ /** What the host stated the copy derives from, when that is another file. */
271
+ readonly statedDerivedFromFileId?: string;
272
+ /**
273
+ * On MATCHES: whether the host RECORDS this exact copy (it named the copy and the bytes are the ones its file row
274
+ * hashed), so the copy is the signed document a request validated at receipt. False for a copy the host names
275
+ * without a recorded hash, or does not name: its first revision is the approved file, and nothing here says what
276
+ * follows it is a vendor's signature.
277
+ */
278
+ readonly recordedByHost?: boolean;
279
+ }>;
215
280
  /**
216
281
  * Whether the approval is still current over its record (#2914), when the record was given: CURRENT,
217
282
  * NO_LONGER_CURRENT (never a failure), SUBJECT_GONE, or NO_SEALED_FIELD_SET when the presentation is not disclosed or
@@ -285,6 +350,11 @@ export declare const ApprovalSealVerificationBundleSchema: z.ZodObject<{
285
350
  contentSha256: z.ZodOptional<z.ZodString>;
286
351
  contentErased: z.ZodOptional<z.ZodLiteral<true>>;
287
352
  }, z.core.$strip>>;
353
+ vendorSignedCopies: z.ZodOptional<z.ZodArray<z.ZodObject<{
354
+ fileId: z.ZodString;
355
+ derivedFromFileId: z.ZodOptional<z.ZodString>;
356
+ contentSha256: z.ZodOptional<z.ZodString>;
357
+ }, z.core.$strip>>>;
288
358
  }, z.core.$strip>;
289
359
  export type ApprovalSealVerificationBundle = z.infer<typeof ApprovalSealVerificationBundleSchema>;
290
360
  //# sourceMappingURL=approval-seal-verifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval-seal-verifier.d.ts","sourceRoot":"","sources":["../../../src/key-management/approval-seal-verifier.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmF,KAAK,qCAAqC,EAAqB,eAAe,EAAE,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACtP,OAAO,EAAE,mBAAmB,EAAgC,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAIpG,OAAO,EAEL,2BAA2B,EAG3B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AAQnC,8GAA8G;AAC9G,MAAM,WAAW,2BAA2B;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CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;KACnC,CAAC;IACF;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,aAAa,CAAC;QAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,QAAQ,EAAE,mCAAmC,CAAC;QACvD,8GAA8G;QAC9G,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QACpC,mFAAmF;QACnF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QACjC,6EAA6E;QAC7E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;QAC1C;;;;;WAKG;QACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;KACnC,CAAC,CAAC;IACH;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,qCAAqC,CAAC;CACxE;AA8MD,+CAA+C;AAC/C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,6BAA6B,GAAG,wBAAwB,CA+EjG;AAED,qHAAqH;AACrH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;iBAA8B,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,+BAA+B;;;iBAAwF,CAAC;AAErI;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6B/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
@@ -95,6 +95,12 @@ export var ApprovalSealVerificationFailure;
95
95
  * not what the seal rebuilds, or what precedes them is not the file the seal binds.
96
96
  */
97
97
  ApprovalSealVerificationFailure["MANIFESTED_COPY_MISMATCH"] = "manifested_copy_mismatch";
98
+ /**
99
+ * A vendor-signed copy was given or named and is not derived from the file this seal binds (#2907): no prefix of it
100
+ * ending at a `%%EOF` is the approved file, its bytes are not the ones its row recorded, or the host states it was
101
+ * derived from another file.
102
+ */
103
+ ApprovalSealVerificationFailure["VENDOR_SIGNED_COPY_MISMATCH"] = "vendor_signed_copy_mismatch";
98
104
  })(ApprovalSealVerificationFailure || (ApprovalSealVerificationFailure = {}));
99
105
  /** What the seal says about the file deliverable it attests (#2904). */
100
106
  export var ApprovalSealDeliverableFileStanding;
@@ -116,6 +122,11 @@ export var ApprovalSealDeliverableFileStanding;
116
122
  * copy can be rebuilt from both should the name ever lawfully be needed again.
117
123
  */
118
124
  ApprovalSealDeliverableFileStanding["CONTENT_ERASED"] = "content_erased";
125
+ /**
126
+ * A vendor-signed copy (#2907) only: the host's own row says it was derived from another file than the one this seal
127
+ * binds. The copy belongs to another original, whatever its bytes; the seal does not verify with it.
128
+ */
129
+ ApprovalSealDeliverableFileStanding["DERIVED_FROM_ANOTHER_FILE"] = "derived_from_another_file";
119
130
  })(ApprovalSealDeliverableFileStanding || (ApprovalSealDeliverableFileStanding = {}));
120
131
  /**
121
132
  * What the seal says about one committed disclosure: a person's (approver, requester), what they were shown, what they
@@ -214,6 +225,85 @@ function manifestedCopyStandingOf(input, approver, presentation, failures) {
214
225
  }
215
226
  return { ...named, standing: ApprovalSealDeliverableFileStanding.MATCHES, ...printed, ...stated };
216
227
  }
228
+ /**
229
+ * The lengths at which a PDF's revisions end: just past each `%%EOF` marker, and past its end-of-line when one follows
230
+ * (a file may end either way), ascending. An incremental update appends after one of them, so the original a later
231
+ * revision was appended to is one of these prefixes. Read as Latin-1, so a byte offset in the text is a byte offset in
232
+ * the file.
233
+ */
234
+ function pdfRevisionEndsOf(bytes) {
235
+ const text = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('latin1');
236
+ const ends = [];
237
+ for (let index = text.indexOf('%%EOF'); index >= 0; index = text.indexOf('%%EOF', index + 1)) {
238
+ const end = index + 5;
239
+ ends.push(end);
240
+ if (text[end] === '\r' && text[end + 1] === '\n')
241
+ ends.push(end + 2);
242
+ else if (text[end] === '\n' || text[end] === '\r')
243
+ ends.push(end + 1);
244
+ }
245
+ return ends;
246
+ }
247
+ /**
248
+ * The first revision end at which the prefix's SHA-256 satisfies `opens`, or undefined. Hashed INCREMENTALLY, one
249
+ * running digest extended from one candidate end to the next and copied to read it, so a file carrying many `%%EOF`
250
+ * markers costs one pass over its bytes rather than one per marker.
251
+ */
252
+ function firstPrefixOpening(bytes, opens) {
253
+ const running = createHash('sha256');
254
+ let hashedTo = 0;
255
+ for (const end of pdfRevisionEndsOf(bytes)) {
256
+ running.update(bytes.subarray(hashedTo, end));
257
+ hashedTo = end;
258
+ if (opens(running.copy().digest('hex')))
259
+ return end;
260
+ }
261
+ return undefined;
262
+ }
263
+ /**
264
+ * Each vendor-signed copy against the seal (#2907's document chain): its first revision opened against the commitment the
265
+ * disclosed presentation binds the deliverable by. See {@link ApprovalSealVendorSignedCopyInput}. A copy the host states
266
+ * was derived from another file, one whose bytes are not its recorded hash, or one with no prefix that is the approved
267
+ * file, is a failure.
268
+ */
269
+ function vendorSignedCopyStandingsOf(input, presentation, failures) {
270
+ const copies = input.vendorSignedCopies;
271
+ if (!copies || copies.length === 0)
272
+ return undefined;
273
+ const deliverable = input.deliverableFile;
274
+ const bound = deliverable && presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED
275
+ ? humanDecisionBoundDeliverableOf(presentation.value, deliverable.fileId)
276
+ : undefined;
277
+ let mismatched = false;
278
+ const standings = copies.map((copy) => {
279
+ const named = copy.fileId ? { fileId: copy.fileId } : {};
280
+ // The host's own row names another original: the copy is not this approval's, whatever its bytes (refused before they
281
+ // are read, so a copy built to open the commitment cannot pass under another file's lineage either).
282
+ if (deliverable && copy.derivedFromFileId !== undefined && copy.derivedFromFileId !== deliverable.fileId) {
283
+ mismatched = true;
284
+ return { ...named, standing: ApprovalSealDeliverableFileStanding.DERIVED_FROM_ANOTHER_FILE, statedDerivedFromFileId: copy.derivedFromFileId };
285
+ }
286
+ if (!copy.bytes)
287
+ return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_GIVEN };
288
+ if (copy.contentSha256 !== undefined && createHash('sha256').update(copy.bytes).digest('hex') !== copy.contentSha256) {
289
+ mismatched = true;
290
+ return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };
291
+ }
292
+ if (!deliverable || !bound)
293
+ return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };
294
+ const originalLength = firstPrefixOpening(copy.bytes, (prefixSha256) => approvalSealFileCommitmentOf(deliverable.salt, prefixSha256) === bound.commitment);
295
+ if (originalLength === undefined) {
296
+ mismatched = true;
297
+ return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };
298
+ }
299
+ // `contentSha256` was compared with these bytes above, so a named copy carrying one is the copy the host recorded.
300
+ const recordedByHost = copy.fileId !== undefined && copy.contentSha256 !== undefined;
301
+ return { ...named, standing: ApprovalSealDeliverableFileStanding.MATCHES, derivesFromFileId: deliverable.fileId, originalLength, recordedByHost };
302
+ });
303
+ if (mismatched)
304
+ failures.push(ApprovalSealVerificationFailure.VENDOR_SIGNED_COPY_MISMATCH);
305
+ return standings;
306
+ }
217
307
  /**
218
308
  * What corroborates a seal under a compromised key, if anything: evidence of its payload recorded before the compromise,
219
309
  * or a kept export signed before the compromise that lists this exact seal (its issuer, its key, its signed claims).
@@ -297,6 +387,7 @@ export function verifyApprovalSeal(input) {
297
387
  const statement = disclosureStanding(ApprovalSealDisclosureClaim.STATEMENT, claims.statementDigest, disclosures, erased, failures);
298
388
  const deliverableFile = deliverableFileStandingOf(input.deliverableFile, presentation, failures);
299
389
  const manifestedCopy = manifestedCopyStandingOf(input, approver, presentation, failures);
390
+ const vendorSignedCopies = vendorSignedCopyStandingsOf(input, presentation, failures);
300
391
  // #2914: never a failure; the presentation counts only when it opened its commitment.
301
392
  const subjectRecordCurrency = input.subjectRecord !== undefined
302
393
  ? approvalSealSubjectCurrencyOf(presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? presentation.value : undefined, input.subjectRecord)
@@ -324,6 +415,7 @@ export function verifyApprovalSeal(input) {
324
415
  ...(statement ? { statement } : {}),
325
416
  ...(deliverableFile ? { deliverableFile } : {}),
326
417
  ...(manifestedCopy ? { manifestedCopy } : {}),
418
+ ...(vendorSignedCopies ? { vendorSignedCopies } : {}),
327
419
  ...(subjectRecordCurrency ? { subjectRecordCurrency } : {}),
328
420
  };
329
421
  }
@@ -360,5 +452,15 @@ export const ApprovalSealVerificationBundleSchema = z.object({
360
452
  manifestedCopy: z.object({ fileId: z.string().min(1).optional(), contentSha256: z.string().regex(/^[0-9a-f]{64}$/).optional(), contentErased: z.literal(true).optional() })
361
453
  .refine((copy) => (copy.fileId === undefined) !== (copy.contentErased === undefined), { message: 'A manifested copy is named by its file id, or stated erased: exactly one of the two' })
362
454
  .optional(),
455
+ /**
456
+ * The document chain's other branch (#2907): the copies an electronic-signature vendor returned of the deliverable, each
457
+ * with the file its row says it was derived from and the hash its row recorded. Never their bytes, which the verifier is
458
+ * given from the files themselves (`--vendor-signed-copy`).
459
+ */
460
+ vendorSignedCopies: z.array(z.object({
461
+ fileId: z.string().min(1),
462
+ derivedFromFileId: z.string().min(1).optional(),
463
+ contentSha256: z.string().regex(/^[0-9a-f]{64}$/).optional(),
464
+ })).optional(),
363
465
  });
364
466
  //# sourceMappingURL=approval-seal-verifier.js.map