// rnx's binding of the shared runtime-delivery machinery. // // the machinery itself (hosted manifest, sha256-verified tarballs, channels, // channel resolution, and auto-update) lives in @contrast/runtime-delivery and // knows nothing about rnx. this file supplies rnx's identity, public env // overrides, and the contrast.dev/runtimes hosting layout. // // @contrast/runtime-delivery is an internal workspace package that is never // published, so both the CLI bundle and dist-lib inline it (see the `alias` // entry in scripts/build-cli.ts). pack-smoke fails the build if it ever leaks // out as a bare require. import { createRuntimeDelivery, type RuntimeProduct } from '@contrast/runtime-delivery' import { cacheDir, configFilePath, ensureRnxHome, readActiveRuntime, runtimeDir, runtimesDir, writeActiveRuntime, } from './home-paths.ts' import { rnxPublicBrand } from './public-brand.ts' export const DEFAULT_RUNTIME_CDN_ORIGIN = 'https://contrast.dev' /** the official curated changelog and the machine-readable release feed. the * rnx site is static, so its /api traffic is owned by contrast.dev. */ export const RNX_CHANGELOG_URL = `${rnxPublicBrand.origin}/changelog` export const RNX_CHANGELOG_API_URL = 'https://contrast.dev/api/changelog/sootsim' export const RNX_RUNTIME_PRODUCT: RuntimeProduct = { id: 'rnx', defaultCdnOrigin: DEFAULT_RUNTIME_CDN_ORIGIN, manifestPath: '/runtimes/manifest.json', tarballPath: (version) => `/runtimes/sootsim-runtime-${version}.tar.gz`, // the engine runtime is a static SPA: shell at the root, engine/ and // engine-tenant/ beneath it. index.html is what the daemon and the // vite/metro plugins serve, so its absence means the tarball is not one. installedMarker: 'index.html', env: { cdnOrigin: 'RNX_CDN_ORIGIN', channel: 'RNX_RUNTIME_CHANNEL', }, ensureHome: ensureRnxHome, configFile: configFilePath, runtimesDir, runtimeDir, cacheDir, readActiveRuntime, writeActiveRuntime, } export const rnxRuntime = createRuntimeDelivery(RNX_RUNTIME_PRODUCT)