@marianmeres/motion-scenario
v0.4.0
Published
[](https://jsr.io/@marianmeres/motion-scenario) [](https://www.npmjs.com/package/@marianmeres/motion-scenario) [.Check it:
deno run -A jsr:@marianmeres/motion-scenario/cli check my-video.scenariomy-video.scenario: 0 error(s), 2 warning(s) warnings: L45 W_NEW_MOTION new motion `types ui.plantName` on `card` (FormCard) L46 W_NEW_MOTION new motion `types ui.waterEvery` on `card` (FormCard) new motions (implement these, then add them to the registry): types ui.plantName (FormCard) L45 types ui.waterEvery (FormCard) L46 timeline en — 14.50 s # beat scene start dur by mom headline 0 hook intro 0.00 3.00 words 2 Plants forget nothing. You do. 1 add workflow 3.00 2.50 words 3 Add a plant. ... running time: en 14.50 s, sk 13.50 sGive the project a config (component types, project verbs, style preset, format budgets — see
examples/sprout.config.json) and the new-motion warnings become bound verbs:deno run -A jsr:@marianmeres/motion-scenario/cli check my-video.scenario --config my.config.jsonImplement it from the resolved timeline and the words:
deno run -A jsr:@marianmeres/motion-scenario/cli resolve my-video.scenario --config my.config.json > timeline.json deno run -A jsr:@marianmeres/motion-scenario/cli words my-video.scenario > words.json deno run -A jsr:@marianmeres/motion-scenario/cli board my-video.scenario > board.md # the review artifactThe implementer's workflow, for people and agents, is in docs/implementing.md.
Library
import { analyze } from "@marianmeres/motion-scenario";
const a = analyze(text, config); // parse → check → resolve → words
if (!a.ok) throw new Error(a.errors.map((e) => `L${e.line} ${e.message}`).join("\n"));
for (const beat of a.resolved!.timelines.en.beats) {
showHeadline(beat.text?.headline, beat.textReadableAt);
for (const m of beat.moments) {
for (const d of m.directions) {
schedule(d.start, d.subject, d.motion ?? d.phrase, d.duration);
}
}
}The steps are also separate: parse(text), check(scenario, config), resolve(scenario, config),
words(scenario), and formatReport / formatBoard for the text outputs. Everything is pure and
browser-safe; only the CLI touches the file system. Full reference: API.md.
The DOM example
examples/dom/ parses, checks and resolves
sprout.scenario in the browser and plays it with
@marianmeres/vanilla and plain CSS transitions. The player
maps each resolved direction's verb to a CSS class and fires it at the resolved second; the
stylesheet is the renderer's whole "motion library". A panel shows the resolved beats and the check
report next to the stage.
deno task example # builds examples/dom/dist/bundle.js and serves http://localhost:8787/dom/Add ?autoplay (and &lang=sk) to the URL to start playing on load.
What is in the box
| | | | ---------------------------------------------- | ------------------------------------------------------------------------ | | SPEC.md | The format, normative: syntax, model, timing, checks, vocabulary, config | | docs/guide.md | Writing a scenario, for the director | | docs/implementing.md | From a scenario to code, for the implementer (human or agent) | | API.md | The library and CLI reference | | AGENTS.md | Working on this package |
What it is not
- Not an animation language: it has no numbers except holds.
- Not an interpreter of adjectives: motion character is a preset, defined once, in code.
- Not a workflow engine:
status proposedin the header is text for humans.
