* fix(core): stop audio automation from crashing the preview renderer Bent automation segments were booked with setValueCurveAtTime. When the audio thread is mid-render and a curve's start lands after currentTime but before the next render quantum, Chromium moves the curve's start to that quantum but leaves its end marker where it was. The curve then runs past the next event, and if that event sits inside the same quantum, AudioParamHandler::ValuesForFrameRangeImpl fails CHECK_GE(fill_to_frame, write_index) and the renderer aborts. Every segment is now a setValueAtTime at its start and linear ramps through the same sampled points. A value curve interpolates linearly between its points, so the values are the same. With no curves left, the refused-curve fallback (emitRamps) and the curve-overlap tests go. The set at each segment's start also fixes straight segments ahead of the playhead: they ramped from the moment playback started instead of holding the first point's value until the clip reached it. * test(core): keep the clamping tests, aimed at ramp-only automation The branch deleted audioFxAutomation.clamping.test.ts, which the no-deletions check refuses. Its two cases still matter with ramps: a lane booked behind the audio clock finishes at its last value, and one booked ahead of it books no value curve. * test(engine): the browser automation test expects the bend the lane draws The scheduledAt=0.024 case expected a straight 0.5 to 0.7 line after the playhead. That was the old fallback: Chrome refused the clamped value curves and they were rebuilt as one ramp per segment, flattening the bend. With ramps through the sampled points the bend is kept, and the rendered output matches those points within the same 0.000001 tolerance. Against the scheduler on main the updated case fails by 0.0685 (the flattened bend); here it passes three runs in a row.
@hyperframes/core
Types, parsers, generators, compiler, linter, runtime, and frame adapters for the Hyperframes video framework.
Install
npm install @hyperframes/core
Most users don't need to install core directly — the CLI, producer, and studio packages depend on it internally.
What's inside
| Module | Description |
|---|---|
| Types | TimelineElement, CompositionSpec, Asset, canvas dimensions, defaults |
| Parsers | parseHtml — extract timeline elements from HTML; parseGsapScript — parse GSAP animations |
| Generators | generateHyperframesHtml — produce valid Hyperframes HTML from a composition spec |
| Compiler | compileTimingAttrs — resolve data-start / data-duration into absolute times |
| Linter | lintHyperframeHtml — validate Hyperframes HTML (missing attributes, overlapping tracks, etc.) |
| Runtime | IIFE script injected into the browser — manages seek, media playback, and the window.__hf protocol |
| Frame Adapters | Pluggable animation drivers (GSAP, Lottie, CSS, or custom) |
Generated composition trust
Composition generators require trusted authors for code-bearing inputs. styles and
generateHyperframesStyles preserve authored CSS, which can load external resources.
animations may contain __raw: values that are emitted as JavaScript;
includeScripts: true includes executable timeline code. serializeGsapAnimations
also accepts raw preamble, postamble, and a code-bearing timelineVar. Never fill
these inputs with untrusted data. Attribute encoding and closing-tag containment
are not a sandbox; render untrusted compositions in an appropriately isolated
execution environment and never serve them on a privileged origin.
Text content retains the supported inline-formatting sanitizer contract. The clip parser intentionally flattens inner formatting to text, so parse/generate is not a lossless replacement for editing the source HTML.
Frame Adapters
A frame adapter tells the engine how to seek your animation to a specific frame:
import { createGSAPFrameAdapter } from "@hyperframes/core";
const adapter = createGSAPFrameAdapter({
getTimeline: () => gsap.timeline(),
compositionId: "my-video",
});
Implement FrameAdapter for custom animation runtimes:
import type { FrameAdapter } from "@hyperframes/core";
const myAdapter: FrameAdapter = {
id: "my-adapter",
getDurationFrames: () => 300,
seekFrame: (frame) => {
/* seek your animation */
},
};
Parsing and generating HTML
import { parseHtml, generateHyperframesHtml } from "@hyperframes/core";
const { elements, metadata } = parseHtml(htmlString);
const html = generateHyperframesHtml(spec);
Linting
import { lintHyperframeHtml } from "@hyperframes/core/lint";
const result = lintHyperframeHtml(htmlString);
// result.findings: { severity, message, elementId }[]
Documentation
Full documentation: hyperframes.heygen.com/packages/core
Related packages
@hyperframes/engine— rendering engine that drives the browser@hyperframes/producer— full render pipeline (capture + encode)hyperframes— CLI