Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions src/ml/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions test/imf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown> }).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"]
Expand Down
Loading