// Runtime loader for the vendored model catalog (src/models.json, generated by scripts/sync-models.ts). // // Deliberately NOT a static `import ... from "./models.json"`: hosts that embed pi extensions through // a transpiling loader (e.g. Oh My Pi's legacy-pi compat layer) run every statically imported file // under the extension directory through a TS/JS parser, which rejects JSON modules and silently kills // the whole extension. A plain fs read at module init is loader-proof and works everywhere. import { readFileSync } from "node:fs"; import type { ModelsFile } from "./config.ts"; // Vendored build artifact — the shape is enforced at generation time by scripts/sync-models.ts, // and test/models.test.ts re-checks the RawModel contract on every run. export const models = JSON.parse(readFileSync(new URL("./models.json", import.meta.url), "utf8")) as ModelsFile;