Files
hyperframes/packages/core
Miguel Ángel 630409ca19 feat(studio): long audio keeps its fx and beats, read from the server, no page OOM (#8622)
* fix(core): decode whole audio files only up to ten minutes

* test: give the header stub only to tests with a DOM

* refactor(core): one header stub for both test setups, length check as its own step

* refactor(core): one decode gate for failed and too-long sources

* feat(studio): long audio keeps its fx and beats, read from the server as PCM

* fix(core): carve and levels read the same span of audio at any sample rate

* test(studio): beat analysis test waits for its read to start

* test(studio): beat analysis tests run on an idle timeline

* fix(studio): the clip menu's duck passes its carve rate too

* fix(core): publish the audio-decode subpath

* refactor(studio-server): the PCM route registers with the waveform routes

* fix(studio-server): the PCM route checks the file without blocking the server

* chore(skills): media-use's carve copy picks up the time-sized analysis window

* chore(skills): the skills manifest records media-use's new carve copy

* fix(studio): the PCM route refuses other sites, shares the decode slots and keeps stereo for beats

* fix(core): a short file whose length can't be read decodes again, judged by its size

* refactor(core): one window level and Hann helper, PCM route and decode split into steps

* chore(skills): the skills manifest records media-use with main's change and this branch's carve copy

* fix(studio-server): the PCM route answers not found for a request path it can't read

* chore(skills): the carve copy and skills manifest regenerate over main's carve change

* chore(skills): the skills manifest regenerates over main's media-use change
2026-11-24 19:30:50 +00:00
..

@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