posecode-parser
v0.1.0
Published
Parse the .posecode kinematic motion DSL into a validated, ROM-clamped intermediate representation.
Maintainers
Readme
posecode-parser
Parses .posecode, a small text language for describing human movement, into
a validated, range-of-motion-clamped intermediate representation (IR).
Part of Posecode: a kinematic-motion protocol LLMs can write, rendered as an animated 3D figure in the browser. See the language spec for the full grammar.
Install
npm install posecode-parserUsage
import { parse } from "posecode-parser";
const { ir, warnings, errors } = parse(`
posecode exercise "Body-weight squat"
rig humanoid
pose start = standing
step "Descend" 1.6s ease-in-out:
hips: flex 80
knees: flex 95
ground-lock: feet
repeat 8
`);
if (errors.length === 0 && ir) {
// Pass `ir` to posecode-render to animate it, or inspect it directly.
}parse() never throws — malformed or out-of-range documents come back as
structured errors/warnings instead. Every joint angle in ir is hard-clamped
to a healthy range of motion, so a hallucinated knee: flex 200 renders at its
safe ceiling with a warning, never an anatomically impossible joint.
License
MIT
