import type { InstalledRuntimeCapabilities } from "../contracts/runtime-capabilities.ts"; import { validateRealtimeContributions, } from "../contracts/runtime-capabilities.ts"; import { validateWebWorkerContributions } from "../contracts/web-worker.ts"; import { PRODUCT_RUNTIME_CAPABILITY_SELECTION } from "./product-capabilities.ts"; /** * §3.5. Static optional capability selection SSOT. * * Runtime Config can only disable what was selected at build time, and no * dynamic import path is ever built from a configuration string. * * 1103/09-05. The selection itself is the product's: it is declared in the * product-owned `product-capabilities.ts`, and turning the Service Worker on * edits that file. This file stays the template's and only validates and * projects it. * * Only the Service Worker is installed by a selection alone. Realtime, Web * Workers and offline commands have no runtime in the composition yet: a * selection without one makes `createOptionalRuntimeHost` refuse to compose * (09-07). * * The template ships every selection empty, matching the §25 stop conditions: * * - realtime: `NOT_SELECTED`. The RT-01..RT-04 common runtime exists and is * independently verified, but no product contribution supplies an exact * endpoint, event descriptor and recovery mode (§13.6). * - webWorkers: `NOT_SELECTED`. No profiled CPU-bound task with an owner * exists, so no production worker entry is created (§16.2). * - serviceWorker: `null`. Switching to `ACTIVE` also enables the two-pass * build in `scripts/build-frontend.ts`. * - offlineCommands: `NOT_SELECTED`. No external package declares a `KEYED` * operation with a recovery descriptor (§19.3). */ export const INSTALLED_RUNTIME_CAPABILITIES: InstalledRuntimeCapabilities = Object.freeze({ realtime: validateRealtimeContributions( PRODUCT_RUNTIME_CAPABILITY_SELECTION.realtime, ), webWorkers: validateWebWorkerContributions( PRODUCT_RUNTIME_CAPABILITY_SELECTION.webWorkers, ), serviceWorker: PRODUCT_RUNTIME_CAPABILITY_SELECTION.serviceWorker, offlineCommands: PRODUCT_RUNTIME_CAPABILITY_SELECTION.offlineCommands, });