export declare const ENGINE_RUNTIME_SLUG = "humanoid-character"; export declare const DEFAULT_RUNTIME_RANGE = "^0.3"; /** The CDN answers a bare client with 403; a browser UA is what the live web runtime sends. */ export declare const RUNTIME_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0 Safari/537.36 helix-cli"; /** The runtime exports the instrument needs. Checked after import so a renamed export fails loudly, not as NaN. */ export declare const REQUIRED_RUNTIME_EXPORTS: readonly ["SYSTEM_VERSION", "vehiclePackageToTuning", "measureVehicle", "measureBraking", "SharedPhysicsWorld", "EmitterVehicleController", "suspensionRestReach"]; export type FetchLike = (url: string, init?: { redirect?: 'manual' | 'follow'; headers?: Record; }) => Promise<{ status: number; ok: boolean; headers: { get(name: string): string | null; }; arrayBuffer(): Promise; }>; export interface RuntimeInfo { slug: string; range: string; /** SYSTEM_VERSION of the bundle that ran. */ version: string; sha256: string; /** `live` = fetched now; `cache` = cached bytes matched the live sha; `cache (offline fallback: …)`; `file`. */ source: string; apiUrl?: string; codeUrl?: string; fetchedAt?: string; /** What the engine version's envelope declares vs what this CLI loaded it with. */ three: { declared?: string; loaded: string; }; rapier: { declared?: string; loaded: string; }; warnings: string[]; } /** Engine module namespace (only what the instrument touches is typed loosely). */ export type EngineRuntime = Record; export interface LoadedRuntime { info: RuntimeInfo; engine: EngineRuntime; } export interface RuntimeOptions { apiUrl: string; range?: string; /** Use the last cached bundle; never touch the network. */ offline?: boolean; /** A local bundle file or an explicit URL (testing a candidate engine). */ runtime?: string; cacheDir?: string; fetchImpl?: FetchLike; } export declare function runtimeCacheDir(): string; /** `SYSTEM_VERSION = "0.3.180"` in the bundle source (the header can be absent on a direct CDN url). */ export declare function bundleVersion(source: string): string | undefined; /** * Point the bundle's bare module specifiers at concrete file URLs. Static `import … from "x"`, side-effect * `import "x"` and dynamic `import("x")` are rewritten; anything else that merely looks like `from "…"` inside a * string is left alone because only specifiers in `map` are touched. Throws when a bare static import remains * that the map cannot satisfy — that is a runtime this CLI cannot load, and it must say so rather than half-run. */ export declare function rewriteBareSpecifiers(source: string, map: Record): { code: string; rewritten: Record; }; /** The three / rapier this CLI loads the runtime with, as file URLs (rapier copied to `.mjs` so Node needs no type sniffing). */ export declare function localEngineDeps(cacheDir: string): { map: Record; three: string; rapier: string; }; /** Fetch (or reuse) the runtime bundle and import it. One import per sha per process. */ export declare function loadEngineRuntime(opts: RuntimeOptions): Promise;