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
10 changes: 9 additions & 1 deletion src/ml/imf/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ export {
} from "./registry.js"
export { pickTier, warmUp, type TierCandidate } from "./tiers.js"
export { normalizeArabicInput, repetitionGuardCut } from "./guards.js"
export { encode, decode, BYTE_OFFSET, EOS_ID, PAD_ID, UNK_ID } from "./tokens.js"
export {
encode,
decode,
firstAlternates,
BYTE_OFFSET,
EOS_ID,
PAD_ID,
UNK_ID,
} from "./tokens.js"
13 changes: 13 additions & 0 deletions test/ml/public-surface.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { describe, expect, it } from "vitest"
import * as ml from "../../src/ml/index.js"

// Public-surface guard: the decode-contract helpers must be reachable
// through the package barrel, not only via source-tree imports.
// (npm 5.8.0 shipped tokens.js with firstAlternates but the imf
// barrel never re-exported it — unreachable by any documented import.)
describe("ml public surface", () => {
it("exposes imf.firstAlternates through the barrel", () => {
expect(typeof ml.imf.firstAlternates).toBe("function")
expect(ml.imf.firstAlternates("a/b c")).toBe("a c")
})
})
Loading