mcap-ssot
v0.4.2
Published
Generated MCAP SSOT contract for TypeScript consumers (Model / Cap / Variable enums + per-modality model groupings).
Downloads
870
Readme
mcap-ssot
TypeScript bindings for the MCAP SSOT — model ids, cap keys, and
request/response variable names. Generated from config/ssot/*.yaml
in the mcap repository and
published from CI on every SSOT regen.
Why
Three downstream Rust / TypeScript / Python projects hard-code MCAP identifiers (model wire ids, cap keys, JSON field names). Without a shared source they drift; a typo on Lark or a SKU rename breaks every consumer until each one is patched by hand.
This package is the TypeScript half of the answer. It re-exports
the same identifiers MCAP's Rust Model, Spec and cap registry
already use, so any rename in SSOT becomes a TS compile error in
every consumer that imports the constant.
Usage
import {
Cap,
Model,
RequestVar,
VIDEO_MODELS,
} from "mcap-ssot"
// Cap key as the harness task `kind`:
batchTasks.push({
kind: Cap.PromptToImage, // "prompt_to_image"
payload: {
model: Model.Sora_2_2025_12_08, // "sora_2_2025_12_08"
[RequestVar.PROMPT]: "a cat",
[RequestVar.ASPECT_RATIO]: "16:9",
},
})
// Or as a zod allowlist for a tool's input schema:
import { z } from "zod"
const inputSchema = z.object({
model: z.enum(VIDEO_MODELS).optional(),
})What's exported
Cap— everycapabilities.yamlrow's key, indexed by PascalCase identifier.Model— everyfunctions.yamlrow's wire id, indexed by the SSOT enum-variant name (matches RustModel::*).IMAGE_MODELS/VIDEO_MODELS/MUSIC_MODELS/TTS_MODELS/ASR_MODELS/CHAT_MODELS— model id tuples grouped by primary response modality, for use withz.enum(...).RequestVar— request-side variables, indexed by SSOTrust_const; values are wire-level JSON keys.ResponseVar— same shape, response side.
Regenerating
From the mcap repository root:
npm --prefix packages/mcap-ssot run generate # rewrite src/*.ts from yaml
npm --prefix packages/mcap-ssot run build # tsc -> dist/Both run automatically on npm publish via prepublishOnly.
