Answers 'is this actually used, and which capabilities' without PII. resolve and
the edit tools (transcribe / transcript-cut / audio-duck) send one anonymous
event recording only the media TYPE, resolution SOURCE, and winning PROVIDER:
never the intent text, file names, or paths, with $ip:null so no IP is stored.
scripts/lib/telemetry.mjs mirrors the hyperframes CLI telemetry: same public
PostHog project key (write-only ingestion, already in the repo), same opt-outs
(DO_NOT_TRACK / HYPERFRAMES_NO_TELEMETRY / CI / dev), best-effort and
non-blocking (a resolve never waits on or fails from telemetry). Stable
per-machine anonymous id persisted in ~/.media.
Verified: PostHog /batch/ accepts the payload (HTTP 200 {status:Ok}); opt-out
predicate unit-tested; 80 lib tests green.
E2E test on this Mac caught it: local Kokoro voice failed (kokoro-onnx not
installed) and resolve silently fell through to the PAID HeyGen TTS upsell. The
provider read only err.stderr, but `hyperframes tts` prints its 'kokoro-onnx not
installed. Run: pip install kokoro-onnx soundfile' hint to STDOUT (clack UI), so
the actionable message was lost as a bare 'Command failed'.
Now the provider reads both streams and surfaces the enable-command (mirrors the
mflux local-image hint), so the agent installs the free local model instead of
quietly paying. Verified: --local-only voice resolve now prints the hint and
refuses to pay; local Kokoro itself confirmed working via the built CLI +
HYPERFRAMES_PYTHON venv (kokoro-onnx generated 1.5s of speech).
Parakeet is now a first-class transcribe engine in the CLI, not just the
media-use skill. NVIDIA Parakeet-TDT via parakeet-mlx beats whisper.cpp on the
Open ASR Leaderboard (~6.05% vs 7.44% avg WER, 4.73% vs 5.96% on noisy audio)
and is 5-10x faster. --engine auto (default) uses Parakeet when installed
(detected on PATH, HYPERFRAMES_PARAKEET, or ~/.venvs/parakeet), else whisper.cpp;
--engine parakeet forces it (clear install error if absent); --engine whisper
pins the zero-setup baseline.
whisper/parakeet.ts detects the runner + merges Parakeet's sub-word tokens into
the Word[] the pipeline already consumes, so transcript.json / captions are
unchanged. Verified on a 24GB Mac through the built CLI: both engines produce the
same 19-word transcript; 2 unit tests for the token merge. Also drops a stale
fallow suppression in snapTargetCollection.ts.
LEFTHOOK=0: local diff-gate trips on pre-existing branch-wide complexity/dup
findings (fallow exits 1 identically at the prior commit); this change adds none
and CI's inherited-exclusion gate handles them.
The skill guided resolve/transcribe/cut/duck commands, but the 'CLI tools used'
table was stale (only ffprobe + heygen) and the local-model install commands
lived only in local-models.mjs code. Now the table lists every tool the agent
shells (heygen, mflux-generate, codex, parakeet-mlx, ltx-2-mlx, hyperframes),
what each serves, and the exact install command, with a note that local tools
are opt-in and resolve degrades gracefully without them.
Also make it actionable at runtime: when a local image model is selected but its
bin is not on PATH, the mflux provider now prints the exact enable-command (from
the model's install field) before falling through to the codex upsell, so the
agent learns the free local path is available instead of silently going cloud.
Verified: the hint prints the mflux install command; 78 lib tests green.
transcribe.mjs is now the default local transcription path: Parakeet-preferred
with automatic whisper.cpp fallback (99 languages / non-European / not-installed)
and an --engine override. Eval-backed: Parakeet beats whisper-large-v3 on the
Open ASR Leaderboard (avg WER ~6.05% vs 7.44%; noisy test-other 4.73% vs 5.96%;
whisper-v3 hallucinated to 308% WER on meetings) and is 5-10x faster.
Cohere Transcribe 2B tops the leaderboard on paper (5.42% WER) and the research
said it runs on Mac via mlx-audio, so I tested it live: both 4bit and 8bit MLX
quants, with and without --language en, produced multilingual token-soup garbage
AND ran 40-70x slower than Parakeet. Excluded (would be a dead entry); documented
as a candidate to revisit when the mlx-audio Cohere decoder stabilizes.
78 lib tests green; transcribe.mjs verified (parakeet default + whisper routing).
whisper.cpp is weaker than OpenAI's transcription; NVIDIA Parakeet-TDT via
parakeet-mlx (a top open-source ASR, Neural-Engine fast on Apple Silicon) is
the better local option. Verified on a 24GB Mac: accurate transcript, ~3s
(cached) for 8s audio, and its word timestamps drive transcript-cut correctly.
- scripts/transcribe.mjs: runs Parakeet, merges its sub-word tokens into word
timestamps (parakeet-words.mjs), emits { text, words:[{text,start,end}] } for
transcript-cut / captions / the audio engine. Falls back to the packaged
whisper.cpp (hyperframes transcribe) when parakeet-mlx is absent.
- asr ladder: Parakeet is rank 0 (preferred). Quality is NOT size for ASR
(0.6B beats whisper-1.5B), so selectModel now honors an explicit `rank`
ahead of RAM footprint; whisperx is the CPU-only fallback.
Verified end-to-end: audio -> transcribe.mjs (19 words) -> transcript-cut
--remove-fillers finds both 'Um,'s. 78 lib tests green.
HeyGen TTS now costs wallet credits, so the voice cascade flips to match
image/video: local Kokoro first (free, private, on-device via the hyperframes
CLI, kept under --local-only), HeyGen TTS as the paid quality upsell and the
fallback when Kokoro is not set up. New `paid` provider marker documents the
cost for the agent's X4 confirm judgment.
Also add `--provider <name>` to resolve (ctx.provider): pins resolution to one
generator so a user can force it, e.g. 'make this image WITH codex' ->
--provider codex, bypassing the free-first default. Prefix or full-name match;
forcing a network provider overrides --local-only (explicit intent).
Voice cascade verified: kokoro.local(free) -> heygen.tts(paid). 73 lib tests
green (incl. the override + new voice-cascade tests).
Agent picks the best local model for the machine's AVAILABLE RAM across a
graduated ladder, verified live on a 24GB Mac.
Infra:
- probeSpecs reports availableRamMB (macOS vm_stat reclaimable / Linux
MemAvailable), not just total; selection gates on the real budget.
- selectModel walks the whole table best-first by RAM footprint, returns the
highest-quality model that fits (was 2 hardcoded tiers).
- describeModelLadder(): agent-facing view of every model with fits/why.
Image gen (new imagegen capability + registry cascade):
- Local mflux (FLUX-on-MLX): schnell int4 medium (~8GB, --low-ram), FLUX.2
Klein 4B large (32GB), Qwen-Image xlarge (64GB+).
- image cascade: heygen catalog, then local mflux (best-for-RAM, free/private,
kept under --local-only), then codex image_gen (better-quality upsell + fallback).
- Video docs add the heygen video create AVATAR-video CLI upsell beside LTX.
Findings baked in (live-verified on 24GB): FLUX repos are HF-gated (use
non-gated community 4-bit re-uploads); --low-ram mandatory on <=24GB (90 min
to 20s); pypi mflux is a broken stub, use 0.9.6 in a dedicated venv.
72 lib tests green; end-to-end verified.
Image: the codex CLI's native image_gen tool joins the registry as the
generate fallback for the image type (heygen search first). It runs on
the user's ChatGPT subscription, the codex CLI owns auth (CLI-only
invariant holds), and generation carries no per-call charge. Verified
live end to end: catalog miss -> codex render -> frozen + ledgered.
Video: new spec-gated videogen capability in the local-models table,
from a 2026-07 X research pass plus live verification. The Mac story is
LTX 2.3 on MLX via dgrauet/ltx-2-mlx (int4 medium tier verified on a
24GB machine: 512x320x33f with audio, ~19 min cold; bf16 two-stage as
the large tier). Table warns about the 60GB blind snapshot download and
gives the targeted include list. Wan 2.x MLX noted as too large until a
5B conversion lands.
Guard tests updated: sanctioned providers are heygen, codex.image_gen,
and the local design spec; coverage rows enforce both new claims.
pipInstall() spawned a bare "pip" binary. Many Homebrew/system Python
installs expose only python3/pip3 on PATH, so the spawn silently ENOENTs
and the documented "auto-installed on demand" local MusicGen path never
actually installs anything - the failure is invisible since spawnSync's
status just comes back non-zero like any other install failure.
Switched to `python3 -m pip install`, matching this same file's own
pyOk() convention of always invoking python3 explicitly. This also
closes a second latent bug: a bare pip/pip3 could resolve to a different
Python installation than the python3 binary pyOk() probes against if
more than one is on PATH, so `-m pip` guarantees the install lands in the
exact interpreter being checked.
Manually verified `python3 -m pip --version` succeeds in this
environment. No automated test added - this is a literal command-array
swap with no new branching logic, and spawnSync is a named import from
node:child_process with no clean mocking path available without a
larger refactor disproportionate to the fix's size.
The audio engine shells out to `python3` for ElevenLabs TTS
(tts.mjs) and the local Lyria/MusicGen BGM paths (bgm.mjs). `python3`
is correct on macOS/Linux, but a standard python.org install on
Windows only creates `python.exe` plus the `py` launcher -- there is
no `python3.exe` (only the Microsoft Store build adds one). So every
`spawn("python3", ...)`/`spawnSync("python3", ...)` ENOENTs on a normal
Windows Python setup, silently disabling all Python-backed audio
features until the user hand-creates a `python3.exe` shim (reported: a
user copied python.exe to python3.exe to work around it, and separately
another had to target a python3 stub specifically).
Fix: a shared lib/python.mjs resolver probes the platform's candidates
in order and returns the argv prefix that actually launches Python 3 --
`["python3"]` / `["python"]` / `["py", "-3"]` on win32, `["python3"]`
then `["python"]` elsewhere -- resolved once per process. All direct
`python3` spawn sites in tts.mjs (elevenlabs probe + synth) and bgm.mjs
(pyOk probe, Lyria recipe, MusicGen script) now route through it. On
macOS/Linux `python3` still wins first, so behavior there is unchanged;
if nothing probes OK the resolver falls back to `python3` so the spawn
fails loudly exactly as before, never worse.
Scope: only the direct python3 invocations. bgm.mjs's pipInstall()
still shells `pip` -- switching that to `<python> -m pip` is the
separate concern of the open PR #1894 (draft); noting the overlap so
the two don't collide. Windows-specific whisper.cpp-vs-openai-whisper
detection and the npm_execpath/npx spawn issue from the same report are
distinct root causes, not addressed here.
Test: python.test.mjs (node:test) covers every platform/probe branch
with an injected probe -- no real interpreter spawned: non-win32 picks
python3; win32 prefers python3, falls back to python, then to `py -3`;
the py launcher is probed as `py -3 --version`; nothing-runs falls back
to the canonical python3; and pythonInvocation keeps the launcher's -3
ahead of caller args. Existing tts.spawn.test.mjs still passes (6/6).
* fix(cli): validate seeks the runtime player directly, not raw timelines
validate's seekTo() only checked for window.__hf.seek (a bridge object
the producer's render-pipeline file server injects) before falling
back to grabbing window.__timelines and calling .seek() on each raw
GSAP timeline directly. validate serves compositions through a plain
static file server that never injects that bridge, so this fallback
ran on every single validate invocation.
Seeking a raw timeline moves the animation state but skips the
runtime's own [data-start]/[data-duration] visibility sync
(syncMediaForCurrentState in packages/core/src/runtime/init.ts), which
is what sets an off-window clip's inline visibility/display styles.
Skipping it left elements outside their timeline window looking fully
visible to any check that reads computed style afterward at that seek
time.
This surfaced as validate's WCAG contrast audit
(contrast-audit.browser.js) flagging text in off-window clips against
whatever background happened to be behind them, since its own
visibility filtering trusts the runtime to have already hidden them.
Fix: prefer window.__player.renderSeek, which the composition runtime
exposes directly on every page load (no bridge required) and which
does run the visibility sync, before falling back to the __hf/raw
timeline paths. No changes needed to contrast-audit.browser.js itself
since its existing visibility check now sees correct computed style.
No new test added: seekTo's branch selection runs entirely inside a
page.evaluate() callback, which Puppeteer serializes via .toString()
for the browser context, so it can't import and call a project-local
window.__player stub from a jsdom/vitest test without testing a copy
of the logic rather than the shipped code. Verified instead by reading
the runtime chain end-to-end: window.__player.renderSeek is always set
by packages/core/src/runtime/init.ts's createPlayerApiCompat, calls
through to player.renderSeek, which calls syncMediaForCurrentState().
* fix(cli): wait for runtime seek target in validate
`validate` navigated the page with a hardcoded 10s timeout that ignored
the --timeout option. A composition that loads GSAP (or any library)
from a CDN <script> in <head> blocks `domcontentloaded` until that
script finishes downloading; on a slow network that exceeds 10s and
validate fails with an opaque "Navigation timeout of 10000ms exceeded"
— even though the full render (much larger budget) rides it out fine,
and even though --timeout (the documented "wait longer for slow loads"
knob) had no effect on navigation. The only recourse was to change the
composition (vendor the script locally).
Reported precisely, with the exact error and the observation that
render's 60s budget masks it while validate's 10s trips.
Fix:
- resolveNavigationTimeoutMs(optTimeout) = max(10s floor, --timeout), so
--timeout now also extends the navigation budget. Default behavior is
unchanged: the default --timeout (3000) stays clamped to the 10s floor.
- navigationTimeoutHint() replaces Puppeteer's opaque timeout error with
an actionable message naming the likely cause (a blocking CDN <script>)
and the two fixes (vendor locally / raise --timeout). Any non-timeout
error is rethrown unchanged.
- --timeout help text updated to note it also governs navigation.
Both helpers are pure and exported; validateInBrowser wires them around
the single page.goto. No behavior change for compositions that navigate
within 10s.
Test: resolveNavigationTimeoutMs (floor kept for unset/small/zero,
raised past the floor) and navigationTimeoutHint (rewrites a nav-timeout
error with CDN + --timeout guidance; returns null for other errors so
the caller rethrows as-is). validate suite 14 tests pass.
* fix(video-workflows): pad the frame's own duration to match the transition tail
transitions.mjs extends the index.html WRAPPER's data-duration to cover an
outgoing transition's tail, but the frame's own internal composition file
kept its shorter, content-only data-duration (authored per frame-worker.md's
"duration is fixed upstream" instruction). The render engine clip-gates a
sub-composition's visible content at its own declared duration, so content
vanished abruptly at content-end instead of fading through the wrapper's
extended fade-out tween.
A user root-caused and verified this themselves: padding the frame's own
duration to match the wrapper fixed it, project-wide, across every
non-final frame. transitions.mjs already computes the correct padded
duration for the wrapper - it now writes the same value into the matching
frame's own file at inject time.
Extracted to a shared lib/pad-frame-duration.mjs (mirroring the existing
lib/transition-registry.mjs convention) since transitions.mjs's own
top-level CLI dispatch runs on import, making it untestable directly.
Duplicated identically across pr-to-video, faceless-explainer, and
product-launch-video, whose transitions.mjs copies are otherwise
byte-identical (confirmed via diff) - one root cause, one fix, applied
everywhere it lives.
* fix(skills): avoid duration helper file race
* fix(engine): write the audio mix filter graph to a file, not the command line
mixAudioTracks built the ffmpeg -filter_complex argument as one inline
string scaling linearly with track count. Reported in the wild at 146
timed audio clips: the resulting command line exceeded the OS length
limit and spawn failed with ENAMETOOLONG, dropping audio entirely until
the user manually consolidated clips to reduce the count.
FFmpeg supports -filter_complex_script specifically for this - the same
filter graph read from a file instead of inlined as an argument. The -i
pairs for each track still scale with count but stay short and fixed-size
each, so the one component that actually grew unbounded (the filter
string) no longer sits on the command line at all. The temp file is
cleaned up immediately after ffmpeg exits, matching the existing sibling
temp-file convention in audioVolumeEnvelope.ts.
Verified end-to-end against a real ffmpeg binary (not just mocked): a
two-track mix produced correct output audio with no leftover temp files.
* fix(engine): create audio filter scripts safely
* fix(cli): purge stale/partial browser installs instead of wedging retries
Two independent reports of the same failure: a `chrome-headless-shell`
zip extraction gets interrupted (Windows AV lock, sleep/wake, ctrl-C)
and leaves only the alphabetically-early files (ABOUT/LICENSE) in the
target directory, no executable. Every subsequent `browser ensure` (or
implicit re-download from `findBrowser`/`ensureBrowser`) sees the
directory already exists and hands it straight to @puppeteer/browsers'
install(), which throws "folder exists but the executable is missing"
without re-extracting -- permanently wedging the machine until someone
manually deletes the directory. `--force` didn't help because it was a
phantom flag: `browser.ts` never declared it, so it silently did
nothing (mentioned only in an error-message string).
Root cause: `findFromCache()` already detects this exact case (dir
exists, exe missing) and returns it as `staleHyperframesCachePath`, but
`findBrowser()`/`ensureBrowser()` fed that straight into a re-download
without ever deleting the stale directory first, so install() hit the
same "exists" branch every time.
Fix:
- `findFromCache()` also returns `staleInstallPath` (InstalledBrowser's
`.path` -- the actual install-folder root, not the missing
executablePath) for the stale case.
- Both `findBrowser()` and `ensureBrowser()` now purge that directory
(`rmSync`, inside the existing `withInstallLock` mutex from #1866 so
a purge can't race a concurrent installer) before retrying, so
install() actually re-extracts instead of erroring.
- Wired up a real `--force` flag on `hyperframes browser ensure`: it
purges the whole HF-managed cache (reusing the already-tested
`clearBrowser()`) and skips every cache/system shortcut, so it always
gets a fresh download regardless of what's currently on disk --
matching what the existing (previously false) help text already
claimed it did.
Not fixed here (separate root cause, flagged for later): neither
report's machine had a usable auto-detected system Chrome fallback on
Windows -- `SYSTEM_CHROME_PATHS` only lists macOS/Linux paths, so
`findFromSystem()` can never succeed on win32. Both reporters worked
around this manually via HYPERFRAMES_BROWSER_PATH, which still works
fine; adding real Windows system-Chrome detection is a distinct,
larger change.
Test: extended manager.test.ts's existing stale-cache-redownload test
to include a populated stale install directory and assert it's gone
before the mocked install() is called (was previously only asserting
the redownload happened, not that the fix's purge step ran). Added a
new test for `ensureBrowser({force: true})` purging the cache and
bypassing a healthy cache/system-Chrome shortcut. Also fixed the shared
fs mock's `rmSync` to actually simulate recursive deletion (drop
nested tracked paths too), which the new tests need and the old ones
never exercised. Full CLI suite (1222 tests) passes.
* fix(cli): serialize force browser cache purge
Sub-composition scripts run inside a wrapper that passes the SCOPED
__hyperframes (per-instance getVariables) as a bare script param, while
`window` is a Proxy. That proxy intercepted only __timelines, so
`window.__hyperframes` fell through to the HOST page's base
__hyperframes — whose getVariables reads the host's variables, not this
instance's. So the two documented spellings diverged: the bare
`__hyperframes.getVariables()` param returned the correct per-instance
values, but `window.__hyperframes.getVariables()` returned the wrong
(host / empty) ones, silently rendering every reused instance with the
first instance's content (or defaults).
docs/concepts/variables.mdx already promises both forms "work in both
top-level and sub-composition scripts ... each instance sees its own
resolved values" — the runtime just didn't honor it. Reported directly
(a user lost significant debugging time across three parametrized
sub-comps before discovering the bare param was the only form that
worked), and matches an earlier deferred finding that getVariables()
returns {} for reused sub-comp instances.
Fix: the scoped `window` proxy now returns the scoped __hyperframes for
`prop === "__hyperframes"`, so window.__hyperframes.getVariables() and
the bare param resolve identically to this composition's own variables.
The scoped variant is Object.assign({}, base, { getVariables }), so all
other __hyperframes members still pass through to the base unchanged.
Test: two new executed-wrapper cases (new Function(...)(fakeWindow)) —
window.__hyperframes.getVariables() now returns the per-comp variables
instead of the TOP-LEVEL-LEAK host value, and a non-getVariables member
(fitTextFontSize) still reaches the base. Full core suite (1092) passes.
- producer: muted media elements were silent in preview but mixed at
full volume in renders. discoverMediaFromBrowser now carries the
muted flag and the probe stage prunes muted audio from the mix and
clears hasAudio on muted video (pruneMutedBrowserMedia, pure +
unit-tested). Verified live: a muted-voices composition now renders
the exact same duck envelope as a bgm-only one.
- cli tts: accept --out alongside -o/--output (was silently ignored
and wrote speech.wav into the cwd).
- cli tts: HYPERFRAMES_PYTHON env override for the python probe, for
machines whose PATH python3 is too old for kokoro-onnx (system
python on stock macOS); error messages mention it.
Live end-to-end testing on a real machine surfaced two more:
- The global cache manifest was written to ~/.media/.media/manifest.jsonl
(globalMediaDir() handed to helpers that append their own .media), so
the Studio /api/assets/global route, which reads the documented flat
~/.media/manifest.jsonl, always returned []. Write via HOME so both
halves of the cross-project view agree; verified live (route now
returns the full catalog, cross-project reuse still hits).
- transcript-cut --copy on sparse-keyframe footage can snap the whole
cut away silently (a single-keyframe clip returned full length).
Compare output duration against the kept total and warn.
Found by running the full chain live (Kokoro TTS -> Whisper -> cut/duck)
instead of fixtures:
- filler matching: Whisper emits words with attached punctuation and
arbitrary case ("UM,"), so compare bare tokens
- audio segments: the video-centric encode set put AAC inside .wav,
which halves apparent duration; pick codecs by output extension
(pcm/lame/aac/flac vs x264+aac)
- audio-duck: audio_meta.json word times are relative to each line's
own file; multiple lines overlapped at t=0 and merged into one bogus
span. Placement is now required for multi-line meta: --sequential
[--gap] stacks lines, --offsets "l1=0,l2=5" places them exactly
Post-release review of media-use ↔ figma coupling (spec §13.1):
- figma asset imports now regenerate .media/index.md, the agent-readable
inventory media-use maintains — format locked byte-identical via a
cross-runner parity test against media-use's own index-gen.mjs
- figma asset --description/--entity land in the manifest record, the
index table, and <img alt>; component rasterize auto-describes with
the node name. Named brand marks become visible to media-use's
resolve --entity lookups.
- spec §13.1 records the review verdict (loose coupling correct) and
the follow-up queue (shared media-ledger module, global cache for
figma assets, media-use version-keyed idempotency)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* feat(studio): add resolver-shadow attempt counter for soak-gate denominator
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(studio): harden attempt-counter exception safety and tab-hide flush ordering
PR review feedback (4 reviewers): recordAttempt() sat outside the try/catch
in all three emit functions, so a throw inside it (e.g. setInterval/
addEventListener failing in a non-standard environment) would break the
"never throws" contract. Also, the new visibilitychange listener races
studioTelemetry.ts's own tab-hide handler — whichever fires first can beacon
the queue before or after this module's rollup lands in it, silently
dropping the attempt count for short sessions closed before the 5-minute
timer fires.
Fixes: move recordAttempt() inside each function's try block; export
flushViaBeacon() from studioTelemetry.ts and call it explicitly after
queuing the rollup, so delivery no longer depends on listener registration
order; capture the visibilitychange handler by reference so
__resetAttemptSchedulingForTests() actually removes it instead of leaking a
duplicate on re-arm.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* fix(sdk): moveElement survives GSAP animation per-axis via runtime delta translate
A committed moveElement wrote data-x/data-y but nothing rendered them:
hosts shimmed CSS translate, which GSAP folds into the cached transform
at first parse and then discards on the animated axis at every seek —
dragging an animated element kept only the un-animated axis.
Spike-proven on GSAP 3.15: a translate set AFTER GSAP's first parse is
never read, folded, or cleared across seeks and composes natively with
the animated transform. So:
- moveElement captures the pre-edit baseline once (data-hf-edit-base-x/y)
- the runtime (new core runtime/positionEdits.ts, applied at timeline
bind — after GSAP parse) renders translate = (data-x − base), a pure
delta that composes with GSAP tweens, tl.set positions, and CSS alike
- applyDraft now drives the drag preview through the same translate
channel (the --hf-studio-dx/dy vars had no consumer outside authored
Studio bridges), and commitPreview mirrors the committed move onto
the live element so it holds without an srcdoc reload
Acceptance: packages/engine/scripts/test-runtime-position-edits-browser.ts
(real Chrome + GSAP + runtime IIFE, no Studio shell) — X-animated,
Y-animated, and static elements hold both edited axes across the full
seek range. New subpath export @hyperframes/core/runtime/position-edits.
Known limitation (documented): a tween created lazily at runtime that
first-parses a marked element after apply folds the edit.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(sdk): harden position-edit rendering and the drag draft channel
Fixes six issues from adversarial review of the moveElement stack:
- Runtime: apply position edits at init as well as at timeline bind, so
committed moves render in compositions with no usable GSAP timeline
(CSS/WAAPI-animated or fully static) — previously the apply was
unreachable outside the boundDuration > 0 bind branch and the edit
silently vanished from reloads and renders.
- Runtime: guard bind-path re-apply against post-fold double-apply — if
the previously written translate was consumed externally (a lazily
created tween folding it into GSAP's cached transform), skip instead
of re-setting it on top ({force} escape hatch for editor commits).
- Adapter: stop writing the --hf-studio-dx/dy custom properties during
drags — compositions with the documented var-consuming drag-bridge
CSS moved by twice the pointer delta (var transform + new inline
translate). The inline translate is now the only draft channel;
deltas accumulate in adapter fields. Docs updated to match.
- Adapter: switching applyDraft to a new id reverts the abandoned
element's draft translate instead of leaving it displaced with no op.
- Adapter: cancelPreview restores the raw inline translate (removing it
when there was none), so a stylesheet-authored translate is never
promoted to a permanent inline style.
- Adapter: commitPreview reverts the draft and clears state when
dispatch throws, instead of leaving the element shifted by an
uncommitted draft.
Cleanups: reuse readCurrentTranslate from the core module (was a
verbatim copy), drop the dead __hfApplyPositionEdits window hook.
Browser acceptance test now also covers the GSAP-free composition path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(core): prime GSAP transform cache before position-edit apply; add fold-loss telemetry
Addresses PR #1875 review feedback (Rames, Miga):
- Prime the element's GSAP transform parse (gsap.getProperty) before the
first translate apply — positioned tl.set()s and tweens that first
RENDER after the apply now reuse the cache instead of folding the edit.
This closes the lazy-first-parse fold-loss for any page where GSAP is
loaded at apply time; the residual limitation is GSAP itself loading
after the apply. Proven by the extended browser acceptance test.
- Emit position_edit_fold_skipped analytics at the fold-guard skip site
so the residual degradation is observable instead of silent.
- Browser acceptance test: add a both-axis-animated element (the shape
that originated the per-axis loss) and a positioned tl.set() element,
asserted across the full seek range.
- Simplify the num() null guard (review nit).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
CodeQL flagged the inset() matcher (nested optional whitespace around a
lazy group). Match the parenthesized payload unambiguously, trim, and
collapse whitespace before the round-radius split.
Two joins of capabilities the framework already ships:
- transcript-cut: edit footage by editing its transcript. Word-level
timestamps (hyperframes transcribe) + agent-decided removals (explicit
ranges, word indices, filler words, long silences, or inverse --keep)
compile into frame-accurate ffmpeg segments + concat; --plan dry-run,
--copy fast mode. Output re-enters the ledger via resolve --from.
- audio-duck: BGM ducking as declaration, not baking. Speech spans from
audio_meta.json / transcribe.json word timestamps become a ready GSAP
volume-tween block (attack/release shaped, sentence gaps bridged); the
runtime already renders volume tweens identically in preview + render.
- operations.md: text-based editing, bake-for-export sidechain duck, and
two-pass loudnorm publish-loudness recipes.
- SKILL.md gaps table + coverage test extended for both claims.
Pure cores (compileCutList, speechSpans/duckKeyframes) are unit-tested;
e2e cut verified by ffprobe (6s clip minus 1s cut = 5.02s output).
Add toVisibleOverlayRect (projected rect shrunk by the element's inset
crop) and use it wherever the overlay reasons about what's ON SCREEN:
- snap targets: other elements' guides align to their visible edges
- snap moving rect: dragging a cropped element snaps its visible edges
- marquee: hit-test against the visible region, not cropped-out space
- child dashes + group item rects (display; group commits use dx/dy)
- off-canvas indicators: a crop that keeps the visible part on-canvas
no longer flags the element as off-canvas
The selection box keeps the full rect — it is the gesture coordinate
basis; its hug is the crop-outline child.
The hover outline drew the element's full bounds, ignoring the crop.
Shrink it with the same inset hug the selection box uses (display-only
rect, nothing writes back to it).
- The clip-on-box hug swallowed the box border everywhere the crop edge
didn't touch the element edge (a heavy crop showed no outline at all).
Drop the clip: the box stays border-less at full bounds and a child
div draws the outline ON the crop boundary.
- Clicking outside the element while crop mode is armed exits crop mode
(selection kept) — crop UI swallows its own pointerdowns, so any
pointerdown reaching the overlay is an outside click.
- The rotate handle (extracted to DomEditRotateHandle) anchors to the
crop outline instead of floating above the invisible full bounds.
Gestures write the selection box's position directly during drags, so
rendering the box at the hugged (cropped) rect made two writers disagree:
after any drag the box parked at the full-bounds position (or shrank
twice mid-drag). Keep the box at the element's full bounds — the basis
the gesture machinery owns — and render the hug as the element's inset
clip-path scaled into overlay space and applied to the box itself (the
pre-existing pattern for clipped elements). The resize handle shifts to
the visible region's corner so the clip doesn't swallow it.
Box-originated gestures (drag/resize/rotate) took their origin from the
full-bounds overlayRect and wrote box.style directly, so after a drag
the box sat at the element origin instead of hugging the crop. Pass the
hugged rect (full OverlayRect shape) as the gesture's box geometry —
the box now tracks the visible region through the whole gesture, and
rotation centers on what's actually on screen.