@modelschemas/codegen
Pull core for modelschemas build-time schema
and type generation: selection grammar
(provider[/endpointGlob][#request|#response]), conditional fetch
(ETag/304), the .manifest.json lockfile, atomic file writes, offline
build verification, and content-hash integrity checks.
Ships built ESM (.js + .d.ts). Node loads it with no TypeScript loader.
Used by @modelschemas/vite and the modelschemas CLI.
bun add @modelschemas/codegen
import { pull, verify, verifyIntegrity, checkUpdates } from '@modelschemas/codegen'
await pull({
outDir: 'src/modelschemas',
selections: ['anthropic/v1/messages#request', 'openai/chat/*'],
})
const files = await verify({ outDir: 'src/modelschemas', selections: [...] })
const integrity = await verifyIntegrity({ outDir: 'src/modelschemas', selections: [] })
Docs: modelschemas.com/docs · Source:
github.com/modelschemas/modelschemas