hyperframes 0.6.70 → 0.6.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,10 @@
1
1
  FROM node:22-bookworm-slim
2
2
 
3
3
  ARG HYPERFRAMES_VERSION=latest
4
+ # Set automatically by `docker build --platform` (BuildKit); we use it to
5
+ # decide whether to install chrome-headless-shell, which only ships for
6
+ # linux64 (see https://googlechromelabs.github.io/chrome-for-testing/).
7
+ ARG TARGETARCH=amd64
4
8
 
5
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
10
  ca-certificates curl unzip ffmpeg chromium \
@@ -16,16 +20,38 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
16
20
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
17
21
  ENV CONTAINER=true
18
22
 
19
- RUN npx --yes @puppeteer/browsers install chrome-headless-shell@stable \
20
- --path /root/.cache/puppeteer
23
+ # chrome-headless-shell unlocks BeginFrame-based deterministic capture but the
24
+ # project only publishes a linux64 binary. On arm64 we skip the install and
25
+ # let the engine fall back to system chromium (set via
26
+ # PUPPETEER_EXECUTABLE_PATH above). The wrapper script below only sets
27
+ # PRODUCER_HEADLESS_SHELL_PATH when the binary is actually present.
28
+ RUN if [ "$TARGETARCH" = "amd64" ]; then \
29
+ npx --yes @puppeteer/browsers install chrome-headless-shell@stable \
30
+ --path /root/.cache/puppeteer; \
31
+ else \
32
+ echo "Skipping chrome-headless-shell install on ${TARGETARCH} (linux64-only); using system chromium."; \
33
+ fi
21
34
 
22
35
  RUN npm install -g hyperframes@${HYPERFRAMES_VERSION}
23
36
 
24
- # Wrapper script: resolves chrome-headless-shell path at build time,
25
- # sets PRODUCER_HEADLESS_SHELL_PATH at runtime so the engine uses
26
- # BeginFrame rendering instead of falling back to system Chromium.
27
- RUN SHELL_PATH=$(find /root/.cache/puppeteer/chrome-headless-shell -name "chrome-headless-shell" -type f | head -1) \
28
- && printf '#!/bin/sh\nexport PRODUCER_HEADLESS_SHELL_PATH=%s\nexec hyperframes render "$@"\n' "$SHELL_PATH" > /usr/local/bin/hf-render \
37
+ # Wrapper script: resolves chrome-headless-shell path at build time when
38
+ # available so the engine uses BeginFrame rendering. On arm64 (no
39
+ # chrome-headless-shell) it leaves PRODUCER_HEADLESS_SHELL_PATH unset, so the
40
+ # engine falls back to PUPPETEER_EXECUTABLE_PATH (system chromium).
41
+ #
42
+ # If TARGETARCH=amd64 and the binary is missing, fail the build loudly — the
43
+ # previous (pre-PR) wrapper used an `&&` chain that crashed `docker build` in
44
+ # this case, and silently downgrading to system chromium on amd64 would mask
45
+ # golden-baseline regressions.
46
+ RUN SHELL_PATH=$(find /root/.cache/puppeteer/chrome-headless-shell -name "chrome-headless-shell" -type f 2>/dev/null | head -1); \
47
+ if [ -n "$SHELL_PATH" ]; then \
48
+ printf '#!/bin/sh\nexport PRODUCER_HEADLESS_SHELL_PATH=%s\nexec hyperframes render "$@"\n' "$SHELL_PATH" > /usr/local/bin/hf-render; \
49
+ elif [ "$TARGETARCH" = "amd64" ]; then \
50
+ echo "ERROR: chrome-headless-shell binary not found on amd64 — @puppeteer/browsers install must have failed or moved its cache layout." >&2; \
51
+ exit 1; \
52
+ else \
53
+ printf '#!/bin/sh\nexec hyperframes render "$@"\n' > /usr/local/bin/hf-render; \
54
+ fi \
29
55
  && chmod +x /usr/local/bin/hf-render
30
56
 
31
57
  WORKDIR /project
@@ -24,21 +24,21 @@ For exploratory requests, consider offering 2-3 variations that differ meaningfu
24
24
 
25
25
  ### Step 1: Design system
26
26
 
27
- If `design.md` or `DESIGN.md` exists in the project, read it first (check both casings they're different files on Linux). It's the source of truth for brand colors, fonts, and constraints. Use its exact values — don't invent colors or substitute fonts. Any format works (YAML frontmatter, prose, tables — just extract the values).
27
+ If a design spec exists in the project, read it first. Look in precedence order: `frame.md` → `design.md` `DESIGN.md` (`design.md` and `DESIGN.md` are different files on Linux — check both casings; `frame.md` is always lowercase, no `FRAME.md` variant). `frame.md` is the preferred spec for video/hyperframes projects and wins if more than one exists; it uses the same format as `design.md`. It's the source of truth for brand colors, fonts, and constraints. Use its exact values — don't invent colors or substitute fonts. Any format works (YAML frontmatter, prose, tables — just extract the values).
28
28
 
29
- If it names fonts you can't find locally (no `fonts/` directory with `.woff2` files, not a built-in font), warn the user before writing HTML: "design.md specifies [font name] but no font files found. Please add .woff2 files to `fonts/` or I'll fall back to [closest built-in alternative]."
29
+ If it names fonts you can't find locally (no `fonts/` directory with `.woff2` files, not a built-in font), warn the user before writing HTML: "the spec specifies [font name] but no font files found. Please add .woff2 files to `fonts/` or I'll fall back to [closest built-in alternative]."
30
30
 
31
- If no `design.md` exists, offer the user a choice:
31
+ If no `frame.md` or `design.md` exists, offer the user a choice:
32
32
 
33
33
  1. **User named a style or mood?** → Read [visual-styles.md](./visual-styles.md) for the 8 named presets. Pick the closest match.
34
34
  2. **Want to browse options visually?** → Run the design picker: read [references/design-picker.md](references/design-picker.md) for the full workflow. This serves a visual picker page. The user configures mood, palette, typography, and motion in the browser, then copies the generated design.md and pastes it back into the conversation.
35
35
  3. **Want to skip and go fast?** → Ask: mood, light or dark, any brand colors/fonts? Then pick a palette from [house-style.md](./house-style.md).
36
36
 
37
- **design.md defines the brand. It does not define video composition rules.** Those come from [references/video-composition.md](references/video-composition.md) and [house-style.md](./house-style.md). Use brand colors at video-appropriate scale — not at web-UI opacity.
37
+ **The design spec defines the brand. It does not define video composition rules.** Those come from [references/video-composition.md](references/video-composition.md) and [house-style.md](./house-style.md). Use brand colors at video-appropriate scale — not at web-UI opacity.
38
38
 
39
39
  ### Step 2: Prompt expansion
40
40
 
41
- Always run on every composition (except single-scene pieces and trivial edits). This step grounds the user's intent against `design.md` and `house-style.md` and produces a consistent intermediate that every downstream agent reads the same way.
41
+ Always run on every composition (except single-scene pieces and trivial edits). This step grounds the user's intent against the design spec (`frame.md` or `design.md`) and `house-style.md` and produces a consistent intermediate that every downstream agent reads the same way.
42
42
 
43
43
  Read [references/prompt-expansion.md](references/prompt-expansion.md) for the full process and output format.
44
44
 
@@ -356,12 +356,12 @@ tl.from("#s2-heading", { x: -40, opacity: 0, duration: 0.6, ease: "expo.out" },
356
356
  - 60px+ headlines, 20px+ body, 16px+ data labels for rendered video
357
357
  - `font-variant-numeric: tabular-nums` on number columns
358
358
 
359
- If no `design.md` exists, follow [house-style.md](./house-style.md) for aesthetic defaults.
359
+ If no `frame.md` or `design.md` exists, follow [house-style.md](./house-style.md) for aesthetic defaults.
360
360
 
361
361
  ## Typography and Assets
362
362
 
363
363
  - **Built-in fonts:** Write the `font-family` you want in CSS — the compiler embeds supported fonts automatically.
364
- - **Custom fonts:** If design.md names a font that isn't built-in, the user must provide `.woff2` files in a `fonts/` directory. If missing, warn before writing HTML. When files exist, add `@font-face` declarations pointing to the local files.
364
+ - **Custom fonts:** If the spec (`frame.md` or `design.md`) names a font that isn't built-in, the user must provide `.woff2` files in a `fonts/` directory. If missing, warn before writing HTML. When files exist, add `@font-face` declarations pointing to the local files.
365
365
  - Add `crossorigin="anonymous"` to external media
366
366
  - For dynamic text overflow, use `window.__hyperframes.fitTextFontSize(text, { maxWidth, fontFamily, fontWeight })`
367
367
  - All files live at the project root alongside `index.html`; sub-compositions use `../`
@@ -378,7 +378,7 @@ If no `design.md` exists, follow [house-style.md](./house-style.md) for aestheti
378
378
  **Fast (run immediately, block on results):**
379
379
 
380
380
  - [ ] `npx hyperframes lint` and `npx hyperframes validate` both pass
381
- - [ ] Design adherence verified if design.md exists
381
+ - [ ] Design adherence verified if a design spec (`frame.md` or `design.md`) exists
382
382
 
383
383
  **Slow (run in parallel while presenting the preview to the user):**
384
384
 
@@ -423,18 +423,18 @@ Use `--no-contrast` to skip if iterating rapidly and you'll check later.
423
423
 
424
424
  ### Design Adherence
425
425
 
426
- If a `design.md` exists, verify the composition follows it after authoring. Read the HTML and check:
426
+ If a design spec (`frame.md` or `design.md`) exists, verify the composition follows it after authoring. Read the HTML and check:
427
427
 
428
- 1. **Colors** — every hex value in the composition appears in design.md's palette section (however the user labeled it: Colors, Palette, Theme, etc.). Flag any invented colors.
429
- 2. **Typography** — font families and weights match design.md's type spec. No substitutions.
428
+ 1. **Colors** — every hex value in the composition appears in the spec's palette section (however the user labeled it: Colors, Palette, Theme, etc.). Flag any invented colors.
429
+ 2. **Typography** — font families and weights match the spec's type spec. No substitutions.
430
430
  3. **Corners** — border-radius values match the declared corner style, if specified.
431
431
  4. **Spacing** — padding and gap values fall within the declared density range, if specified.
432
432
  5. **Depth** — shadow usage matches the declared depth level, if specified (flat = none, subtle = light, layered = glows).
433
- 6. **Avoidance rules** — if design.md has a section listing things to avoid (commonly "What NOT to Do", "Don'ts", "Anti-patterns", or "Do's and Don'ts"), verify none are present.
433
+ 6. **Avoidance rules** — if the spec has a section listing things to avoid (commonly "What NOT to Do", "Don'ts", "Anti-patterns", or "Do's and Don'ts"), verify none are present.
434
434
 
435
435
  Report violations as a checklist. Fix each one before serving.
436
436
 
437
- If no `design.md` exists (house-style-only path), verify:
437
+ If no design spec exists (house-style-only path), verify:
438
438
 
439
439
  1. **Palette consistency** — the same bg, fg, and accent colors are used across all scenes. No per-scene color invention.
440
440
  2. **No lazy defaults** — check the composition against house-style.md's "Lazy Defaults to Question" list. If any appear, they must be a deliberate choice for the content, not a default.
@@ -469,16 +469,16 @@ Skip on small edits (fixing a color, adjusting one duration). Run on new composi
469
469
  - **[references/captions.md](references/captions.md)** — Captions, subtitles, lyrics, karaoke synced to audio. Tone-adaptive style detection, per-word styling, text overflow prevention, caption exit guarantees, word grouping. Read when adding any text synced to audio timing.
470
470
  - **[references/audio-reactive.md](references/audio-reactive.md)** — Audio-reactive animation: map frequency bands and amplitude to GSAP properties. Read when visuals should respond to music, voice, or sound.
471
471
  - **[references/css-patterns.md](references/css-patterns.md)** — CSS+GSAP marker highlighting: highlight, circle, burst, scribble, sketchout. Deterministic, fully seekable. Read when adding visual emphasis to text.
472
- - **[references/video-composition.md](references/video-composition.md)** — Video-medium rules: density, color presence, scale, frame composition, design.md as brand not layout. **Always read** — these override web instincts.
472
+ - **[references/video-composition.md](references/video-composition.md)** — Video-medium rules: density, color presence, scale, frame composition, the design spec as brand not layout. **Always read** — these override web instincts.
473
473
  - **[references/beat-direction.md](references/beat-direction.md)** — Beat planning: concept, mood, choreography verbs, rhythm templates, transition decisions, depth layers. **Always read for multi-scene compositions.**
474
474
  - **[references/typography.md](references/typography.md)** — Typography: font pairing, OpenType features, dark-background adjustments, font discovery script. **Always read** — every composition has text.
475
475
  - **[references/motion-principles.md](references/motion-principles.md)** — Motion design principles, image motion treatment, load-bearing GSAP rules. **Always read** — every composition has motion.
476
476
  - **[references/techniques.md](references/techniques.md)** — 13 primitive animation techniques with code patterns: SVG drawing, Canvas 2D, CSS 3D, kinetic type, Lottie, video compositing, typing, variable fonts, MotionPath, velocity transitions, audio-reactive, clip-path reveals, WebGL shaders. Adapt the patterns — don't copy-paste. (For pre-built UI templates — terminal chrome, device mockups, moodboard layouts — see `registry/blocks/`.)
477
477
  - **[references/html-in-canvas-patterns.md](references/html-in-canvas-patterns.md)** — HTML-in-Canvas patterns: live DOM as GPU texture via `drawElementImage` + `layoutsubtree`. Shared boilerplate + ~6 effect recipes (iPhone/MacBook mockups, liquid glass, magnetic, portal, shatter, text cursor). Use for 1–3 hero beats per video.
478
478
  - **[references/narration.md](references/narration.md)** — Pacing, tone, script structure, number pronunciation, opening line patterns. Read when the composition includes voiceover or TTS.
479
- - **[references/design-picker.md](references/design-picker.md)** — Create a design.md via visual picker. Read when no design.md exists and the user wants to create one.
480
- - **[visual-styles.md](visual-styles.md)** — 8 named visual styles with hex palettes, GSAP easing signatures, and shader pairings. Read when user names a style or when generating design.md.
481
- - **[house-style.md](house-style.md)** — Default motion, sizing, and color palettes when no design.md is specified.
479
+ - **[references/design-picker.md](references/design-picker.md)** — Create a design.md via visual picker. Read when no `frame.md` or `design.md` exists and the user wants to create one.
480
+ - **[visual-styles.md](visual-styles.md)** — 8 named visual styles with hex palettes, GSAP easing signatures, and shader pairings. Read when user names a style or when generating a design spec.
481
+ - **[house-style.md](house-style.md)** — Default motion, sizing, and color palettes when no `frame.md` or `design.md` is specified.
482
482
  - **[patterns.md](patterns.md)** — PiP, title cards, slide show patterns.
483
483
  - **[data-in-motion.md](data-in-motion.md)** — Data, stats, and infographic patterns.
484
484
  - **[references/transcript-guide.md](references/transcript-guide.md)** — Caption-side transcript handling: input formats, mandatory quality check, cleaning JS, OpenAI/Groq API fallback, "if no transcript exists" flow. (For the `transcribe` CLI invocation, model selection rules, and the `.en` gotcha, see the `hyperframes-media` skill.)
@@ -1,6 +1,6 @@
1
1
  # House Style
2
2
 
3
- Creative direction for compositions when no `design.md` is provided. These are starting points — override anything that doesn't serve the content. When a `design.md` exists, its brand values take precedence; house-style fills gaps.
3
+ Creative direction for compositions when no design spec (`frame.md` or `design.md`) is provided. These are starting points — override anything that doesn't serve the content. When a spec exists, its brand values take precedence; house-style fills gaps.
4
4
 
5
5
  ## Before Writing HTML
6
6
 
@@ -44,7 +44,7 @@ Ideas (mix and match, 2-5 per scene):
44
44
 
45
45
  All decoratives should have slow ambient GSAP animation — breathing, drift, pulse. Static decoratives feel dead.
46
46
 
47
- **Decorative count vs motion count.** The "2-5 per scene" count refers to decorative _elements_. If a project's `design.md` says "single ambient motion per scene", it means one looping motion applied to these decoratives (a shared breath/drift/pulse) — not one element total. A scene with 4 decoratives sharing one breathing motion is correct; a scene with 1 decorative is under-dressed.
47
+ **Decorative count vs motion count.** The "2-5 per scene" count refers to decorative _elements_. If a project's spec (`frame.md` or `design.md`) says "single ambient motion per scene", it means one looping motion applied to these decoratives (a shared breath/drift/pulse) — not one element total. A scene with 4 decoratives sharing one breathing motion is correct; a scene with 1 decorative is under-dressed.
48
48
 
49
49
  ## Motion
50
50
 
@@ -4,7 +4,7 @@ You are here because SKILL.md told you to read this file before writing animatio
4
4
 
5
5
  ## Technique Selection by Energy
6
6
 
7
- Captions are a constrained surface — the highlight and exit technique is closely tied to how much intensity the spoken content carries. The table below is a calibration reference. If DESIGN.md or the storyboard specifies a caption style, that overrides anything here.
7
+ Captions are a constrained surface — the highlight and exit technique is closely tied to how much intensity the spoken content carries. The table below is a calibration reference. If the design spec (`frame.md` or `design.md`) or the storyboard specifies a caption style, that overrides anything here.
8
8
 
9
9
  The core principle: **all energy levels use karaoke highlight as the baseline.** The difference is intensity — not the technique type.
10
10
 
@@ -1,19 +1,19 @@
1
1
  # Prompt Expansion
2
2
 
3
- Run on every composition. Expansion is not about lengthening a short prompt — it's about grounding the user's intent against `design.md` and `house-style.md` and producing a consistent intermediate that every downstream agent reads the same way.
3
+ Run on every composition. Expansion is not about lengthening a short prompt — it's about grounding the user's intent against the design spec (`frame.md` or `design.md`) and `house-style.md` and producing a consistent intermediate that every downstream agent reads the same way.
4
4
 
5
- Runs AFTER design direction is established (Step 1). The expansion consumes design.md (if present) and produces output that cites its exact values.
5
+ Runs AFTER design direction is established (Step 1). The expansion consumes the design spec (`frame.md` or `design.md`, if present) and produces output that cites its exact values.
6
6
 
7
7
  ## Prerequisites
8
8
 
9
9
  Read before generating:
10
10
 
11
- - `DESIGN.md` (if it exists) — extract brand colors, fonts, mood, and constraints. The expansion cites these exact values (hex codes, font names); it does not invent new ones.
11
+ - the design spec — `frame.md` → `design.md` → `DESIGN.md` (prefer `frame.md` if more than one exists) — extract brand colors, fonts, mood, and constraints. The expansion cites these exact values (hex codes, font names); it does not invent new ones.
12
12
  - [beat-direction.md](beat-direction.md) — per-beat planning format (concept, mood, choreography verbs, transitions, depth layers, rhythm). The expansion outputs each scene using this format.
13
13
  - [video-composition.md](video-composition.md) — video-medium rules for density, scale, and color presence. The expansion applies these automatically.
14
14
  - [../house-style.md](../house-style.md) — its rules for Background Layer (2-5 decoratives), Color, Motion, Typography apply to every scene. The expansion writes output that conforms to them.
15
15
 
16
- If `DESIGN.md` doesn't exist yet, run Step 1 (Design system) first. Expansion without a design context produces generic scene breakdowns that later agents ignore.
16
+ If no design spec exists yet, run Step 1 (Design system) first. Expansion without a design context produces generic scene breakdowns that later agents ignore.
17
17
 
18
18
  ## Why always run it
19
19
 
@@ -26,7 +26,7 @@ Even a detailed 7-scene brief lacks things only the expansion adds:
26
26
  - **Micro-details that make a scene feel real** — registration marks, tick indicators, monospace coord labels, typographic accents, code snippets in the background, grid patterns. Things the user didn't think to request.
27
27
  - **Transition choreography at the object level** — not "crossfade" but "X expands outward and becomes Y". Specific duration, ease, and morph source/target.
28
28
  - **Pacing beats within each scene** — where tension builds, where a hold lets the viewer breathe, where the accent word lands.
29
- - **Exact hex values, typography parameters, ease choices** from design.md — no vagueness left for the scene subagent to guess.
29
+ - **Exact hex values, typography parameters, ease choices** from the spec — no vagueness left for the scene subagent to guess.
30
30
 
31
31
  Expansion's job on a detailed prompt is not to summarize or pass through — it's to **take what the user wrote and make it richer**. The user's content stays; the atmosphere, ambient motion, and micro-details are added on top. That's what makes the difference between a scene that matches the brief and a scene that feels alive.
32
32
 
@@ -38,7 +38,7 @@ The quality gap between a single-pass composition and a multi-scene-pipeline com
38
38
 
39
39
  Expand into a full production prompt with these sections:
40
40
 
41
- 1. **Title + style block** — cite design.md's exact hex values, font names, and mood. Do NOT invent a palette — quote what the design provides.
41
+ 1. **Title + style block** — cite the spec's exact hex values, font names, and mood. Do NOT invent a palette — quote what the design provides.
42
42
 
43
43
  2. **Rhythm declaration** — name the scene rhythm before detailing any scene. Example: `hook-PUNCH-breathe-CTA` or `slow-build-BUILD-PEAK-breathe-CTA`. Derive the rhythm from the brand and the storyboard's emotional arc — see [beat-direction.md](beat-direction.md) for the considerations that drive this decision.
44
44
 
@@ -53,7 +53,7 @@ Expand into a full production prompt with these sections:
53
53
 
54
54
  5. **Recurring motifs** — visual threads across scenes from the brand palette.
55
55
 
56
- 6. **Negative prompt** — what to avoid, informed by design.md's constraints if present.
56
+ 6. **Negative prompt** — what to avoid, informed by the spec's constraints if present.
57
57
 
58
58
  ## Output
59
59
 
@@ -1,12 +1,12 @@
1
1
  # Video Composition
2
2
 
3
- Video frames are not web pages. These rules apply to every composition regardless of brand, style, or design.md.
3
+ Video frames are not web pages. These rules apply to every composition regardless of brand, style, or design spec.
4
4
 
5
- ## design.md Is Brand, Not Layout
5
+ ## The Design Spec Is Brand, Not Layout
6
6
 
7
- design.md defines what the brand looks like: colors, fonts, personality, constraints. It does NOT define how to compose a video frame. Use brand colors at video-appropriate intensity — not at web-UI opacity.
7
+ The design spec (`frame.md` or `design.md`) defines what the brand looks like: colors, fonts, personality, constraints. It does NOT define how to compose a video frame. Use brand colors at video-appropriate intensity — not at web-UI opacity.
8
8
 
9
- **Strict from design.md:** hex values (including background color), font families, weight relationships, Do's and Don'ts. If the user chose a light canvas, use a light canvas. If they chose dark, use dark. Do not override their palette.
9
+ **Strict from the spec:** hex values (including background color), font families, weight relationships, Do's and Don'ts. If the user chose a light canvas, use a light canvas. If they chose dark, use dark. Do not override their palette.
10
10
 
11
11
  **Adapt for video:** type sizes, spacing, decorative opacity, border weight, component treatments. A web UI card at `border: 1px solid #e2e3e6` with `box-shadow: 0 2px 4px rgba(0,0,0,0.06)` is invisible on video. The brand color is sacred; the application is yours.
12
12