From d92e92bada4a3db71a5639fb3b17e71f701e2eff Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Thu, 27 Aug 2026 23:25:52 +0800 Subject: [PATCH] feat: expose the IMF registry from interscript/ml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IMF runtime (models.yaml resolution over GitHub Releases with sha256 sidecar verification) ships in the package but was unreachable — the exports map blocks deep imports into dist/ml/imf. Consumers now get it as `import { imf } from "interscript/ml"`. --- package.json | 2 +- src/ml/index.ts | 7 +++++++ test/imf.test.ts | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c0e236..7be7734 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "interscript", - "version": "3.1.0", + "version": "3.2.0", "description": "Interscript TypeScript runtime — interoperable script conversion", "type": "module", "main": "./dist/index.js", diff --git a/src/ml/index.ts b/src/ml/index.ts index 94963f0..658b7c6 100644 --- a/src/ml/index.ts +++ b/src/ml/index.ts @@ -46,6 +46,13 @@ export { type ManifestModelEntry, } from "./provision/manifest.js" +/** + * The IMF v1 registry — models.yaml resolution over GitHub Releases + * (sha256-sidecar-verified). This is the canonical way to load models + * by id; `import { imf } from "interscript/ml"`. + */ +export * as imf from "./imf/index.js" + // Side-effect: register built-in model kinds. Adding a new model kind // = adding a new import here. Order doesn't matter. import "./models/rababa/index.js" diff --git a/test/imf.test.ts b/test/imf.test.ts index 1de48cb..e938bec 100644 --- a/test/imf.test.ts +++ b/test/imf.test.ts @@ -212,6 +212,16 @@ describe("registry", () => { await expect(resolve("nope", url)).rejects.toThrow(/index sha256/) }) }) + it("the public ./ml surface re-exports the IMF registry", async () => { + const ml = await import("../src/ml/index.js") + const imf = (ml as { imf?: Record }).imf + expect(imf).toBeDefined() + expect(typeof imf!["resolve"]).toBe("function") + expect(typeof imf!["IMFModel"]).toBe("function") + expect(imf!["DEFAULT_INDEX_URL"]).toMatch( + /github\.com\/interscript\/interscript-ml\/releases\/download\/index-v\d+\/models-index\.yaml/, + ) + }) }) const e2eZip = process.env["SECRYST_E2E_ZIP"]