Commit Graph
220 Commits
Author SHA1 Message Date
Miguel Angel Simon Sierra 9138190874 Merge remote-tracking branch 'origin/main' into feat/media-use-v2
# Conflicts:
#	skills-manifest.json
#	skills/media-use/audio/scripts/lib/python.mjs
#	skills/media-use/audio/scripts/lib/python.test.mjs
#	skills/media-use/audio/scripts/lib/sfx.test.mjs
#	skills/media-use/scripts/resolve.mjs
2026-07-05 21:31:45 -04:00
Miguel Angel Simon Sierra abef89ad4c feat(media-use): anonymous opt-out PostHog usage tracking
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.
2026-07-05 21:17:07 -04:00
Miguel Angel Simon Sierra 666053a39c fix(media-use): surface kokoro install hint instead of silently paying for HeyGen TTS
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).
2026-07-05 21:02:58 -04:00
Miguel Angel Simon Sierra 1d383231bb docs(media-use): complete CLI-tools table + runtime install hints so the agent knows what to run
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.
2026-07-05 20:03:32 -04:00
Miguel Angel Simon Sierra aee1fd8173 feat(media-use): parakeet is the default transcription (eval-backed); cohere tested + excluded
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).
2026-07-05 19:33:52 -04:00
Miguel Angel Simon Sierra 5c22d7d159 feat(media-use): parakeet local ASR (better than whisper.cpp) + transcribe.mjs
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.
2026-07-05 19:17:24 -04:00
Miguel Angel Simon Sierra 47b94a381c feat(media-use): voice local-first (Kokoro), HeyGen TTS paid upsell; +--provider override
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).
2026-07-05 19:00:26 -04:00
Miguel Angel Simon Sierra 6817b3fe81 feat(media-use): ram-graded local image gen (mflux/FLUX) + agent-selectable ladder
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.
2026-07-05 18:05:17 -04:00
Miguel Ángel b34e623bf8 fix(hyperframes-media): sfx offline path skips (loudly) a missing bundled file 2026-07-05 11:46:30 -07:00
Miguel Angel Simon Sierra 00972753bd feat(media-use): codex image generation fallback + spec-gated local video models
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.
2026-07-04 18:29:18 -07:00
Miguel Ángel 942080fa8e fix(hyperframes-media): install MusicGen deps via python3 -m pip, not bare pip (#1894)
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.
2026-07-04 14:18:56 -07:00
Miguel Ángel 3388635f1d fix(hyperframes-media): resolve python3 -> python/py on Windows (#1922)
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).
2026-07-04 14:08:29 -07:00
Miguel Ángel 8bc1e5d603 fix(video-workflows): pad the frame's own duration to match the transition tail (#1889)
* 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
2026-07-04 14:08:18 -07:00
Miguel Angel Simon Sierra 75bf08bcc1 fix(media-use): global manifest path + copy-mode snap warning
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.
2026-07-04 12:43:34 -07:00
Miguel Angel Simon Sierra 2b1cb8fe96 fix(media-use): real-world hardening of transcript-cut + audio-duck
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
2026-07-04 08:06:11 -07:00
Vance IngallsandClaude Fable 5 3900caaaa9 feat(core,cli): media-use interop — shared index.md regen + description/entity on figma imports (#1927)
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>
2026-07-03 22:56:43 -07:00
Miguel Angel Simon Sierra 9c97cbe08c fix(studio): remove polynomial-backtracking regexes from clip-path parsing
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.
2026-07-03 20:02:15 -07:00
Miguel Angel Simon Sierra edd437a625 feat(media-use): transcript-driven cutting + declarative auto-duck
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).
2026-07-03 19:59:28 -07:00
Miguel Angel Simon Sierra 80a819f24f refactor(media-use): drop the Iconify stub + flag-gating machinery
With fal/ElevenLabs gone and Iconify never enabled, every provider is
always-on heygen (or the local design spec) — remove the envFlag/gated
enablement layer entirely. The guard test now asserts only heygen /
design_spec providers exist.
2026-07-03 19:22:37 -07:00
Miguel Angel Simon Sierra dc8b43c74b refactor(media-use): heygen CLI only — drop fal/ElevenLabs adapters and --allow-paid
Remove the third-party CLI adapters (fal via genmedia, ElevenLabs via
elevenlabs-cli) and the paid-provider cost guard entirely; the heygen
CLI is the only external CLI media-use shells. --local-only stays. A
guard test asserts no fal/elevenlabs provider can silently return.
2026-07-03 19:22:36 -07:00
Miguel Angel Simon Sierra 1145ec5d9e docs(media-use): apply Wenbo's 06-29 review (cost + local-model stance)
- Cost: paid generation is the agent's call, no user-confirmation prompt
  (free-first still tries cache + heygen before anything paid).
- Local models: heygen free-usage is the default (TTS, bg-removal via the
  heygen CLI); local open-source is the opt-out fallback only ('if user no,
  then local'), not the headline answer. Coverage test description updated to
  match while still asserting the fallback table is populated.
2026-07-03 19:22:36 -07:00
Miguel Angel Simon Sierra 6cf8c8d8ed docs(media-use): attribute transcription + bg-removal to the hyperframes CLI
The 'When to use' line credited transcription and background removal to the
audio engine; they actually come from the hyperframes CLI (transcribe,
remove-background), as the audio-engine section already states. The engine
itself does TTS / BGM / SFX / caption timing.
2026-07-03 19:22:36 -07:00
Miguel Angel Simon Sierra 6c44b86aba fix(media-use): correct fal + ElevenLabs adapters to their real CLIs
Verified against the official docs (not guessed --help):
- fal: use the genmedia CLI (genmedia run <model> --prompt .. --download .. --json
  -> downloaded_files[].path/url), not 'fal run --input'. The pip 'fal' is the
  serverless-deploy CLI and can't run hosted models.
- ElevenLabs: the official @elevenlabs/cli is agents-only (no TTS). Use the
  community elevenlabs-cli (tts "<text>" --output <file>): positional text, file
  output. Both download a local file, returned as localPath for freezing.
SKILL providers section now names the correct binaries + install/auth. Live
generation still needs FAL_KEY / ELEVENLABS_API_KEY (absent here).
2026-07-03 19:22:36 -07:00
Miguel Angel Simon Sierra 686b0486ec docs(media-use): list voice in the resolve Types table 2026-07-03 19:22:36 -07:00
Miguel Angel Simon Sierra d9417cdd46 fix(media-use): wire HeyGen TTS to the real CLI surface (m8)
The voice provider guessed 'heygen voice tts --text', which the CLI rejects.
Real command (verified against heygen v0.1.6 --help / --response-schema):
'heygen voice speech create --text <t> --voice-id <id>' returning data.audio_url
+ data.duration. Default voice-id = first starfish-engine voice (deterministic,
overridable via ctx.voiceId). Verified live: a default voice resolve now produces
a real audio file with no --allow-paid. Registry header no longer calls fal/voice
flag-gated seams — they are live; Iconify is the only remaining gated provider.
2026-07-03 19:22:36 -07:00
Miguel Angel Simon Sierra 97bf39f022 docs(media-use): correct doc-rot surfaced by the eval
- voice cascade in SKILL now reflects free HeyGen TTS first, ElevenLabs paid fallback
- --local-only documented as 'skip every network provider', not just paid
- drop the nonexistent 'organize --promote' CLI; promotion is automatic
- point the local-model row at the actual runner (local-run.mjs) without overclaiming auto-cascade
- operations.md: clip-path crop is a composition technique, not a shipped Studio feature
- SFX library is 19 files, not 21; usage.mjs no longer claims it powers the Studio filter
- clarify the faceless/pr-to-video audio adapters intentionally reuse the product-launch model
2026-07-03 19:22:35 -07:00
Miguel Angel Simon Sierra b03c28c42e fix(media-use): stream freeze cap + SSRF guard + drop cached_path from API
M1: freezeUrl streams the body and aborts at the 256MB cap (and checks
content-length first), so a hostile URL can't buffer past the cap into memory.
m11: isDirectMediaUrl rejects loopback/private/link-local hosts on --from ingest.
m13: /assets/global projects to public fields, no absolute cached_path to the browser.
2026-07-03 19:22:35 -07:00
Miguel Angel Simon Sierra ebc1f160c0 fix(media-use): voice resolves free-first via HeyGen TTS + honor --local-only
M2: heygen.tts is free and first in the voice cascade; ElevenLabs is the
paid fallback, so voice resolves by default without --allow-paid.
M3: --local-only now skips every network provider, not just paid ones.
2026-07-03 19:22:34 -07:00
Miguel Angel Simon Sierra 39dfb4b81e feat(media-use): weakness-coverage matrix + test-enforced audit (U28)
SKILL.md gains a 'What it owns' matrix mapping each HyperFrames media gap to its
media-use entrypoint. coverage.test.mjs enforces every row — image/icon
providers, voice + audio engine, consolidated engine + bundled SFX, ops
reference, global cache + ingest, local-model tiers, every resolve type has a
provider — so a claim can't silently rot. 7 tests.
2026-07-03 19:22:34 -07:00
Miguel Angel Simon Sierra d8128be34e docs(media-use): absorb audio capabilities into SKILL (U23)
Frontmatter reframed to the full media OS (resolve/generate/operate/remember,
incl. voice + the audio engine). New Audio engine section documents
audio/scripts/audio.mjs, the request/meta contract, the auto-degrade switch, and
the relocated per-topic references (tts/bgm/sfx/transcribe/remove-background/
captions). A reader can now do everything hyperframes-media offered from
media-use alone.
2026-07-03 19:22:33 -07:00
Miguel Angel Simon Sierra ea8979a18d refactor: retire hyperframes-media skill, fold into media-use (U22)
Delete the hyperframes-media skill (engine relocated in U20). Sweep all 32
referencing files → media-use: engine paths → media-use/audio/scripts, reference
links → media-use/audio/references, skill-name/routing mentions → /media-use.
Catalog dedup: drop the duplicate audio row from README/CLAUDE/skills.mdx (the
single media-use row now covers resolve + audio), router + hyperframes-core
domain list point to media-use, skill count 19→18. Manifest regenerated (18,
hyperframes-media gone). Grep gate clean (only plan docs reference it as history).
dist/ artifacts regenerate from source on build.
2026-07-03 19:22:33 -07:00
Miguel Angel Simon Sierra 8fad6acc9b fix(skills): repoint video skills + engine docs to relocated media-use/audio (U21)
faceless-explainer / pr-to-video / product-launch-video wrappers: DEFAULT_ENGINE
→ media-use/audio/scripts/audio.mjs (engine resolves from each, verified). Fixed
the relocated engine docs' stale self-paths (tts.md) + an inaccurate attribution
comment. Grep gate: no skills/ reference to hyperframes-media/scripts remains
(except general-video doc routing, swept in U22).
2026-07-03 19:22:32 -07:00
Miguel Angel Simon Sierra 6ef5e4e96b refactor(media-use): relocate audio engine from hyperframes-media (U20)
Move the audio engine (audio.mjs + lib + heygen-tts + wait-bgm + lyria-recipe +
bundled SFX + references) as a self-contained subtree into skills/media-use/audio/
via git mv — zero internal path edits (HERE/../assets/sfx + lyria offsets
preserved). CLI primitives still wrapped, not moved. Smoke test proves the
bundled SFX library resolves from the new location. hyperframes-media now holds
only SKILL.md (retired in U22).
2026-07-03 19:22:32 -07:00
Miguel Angel Simon Sierra deb19bdf84 feat(media-use): enable fal + ElevenLabs (Bin approved) + cost guard
Premise: Bin approved B-Q1 (voice/TTS) + B-Q2 (third-party CLIs). fal (bgm/sfx/
image generate) and voice (ElevenLabs + heygen tts) flip from gated to live,
marked paid. Cost guard (X4) ships with them: runProviders skips paid providers
unless ctx.allowPaid; resolve gains --allow-paid (opt-in) + --local-only (block).
Free heygen catalog stays first. Iconify stays gated (not named). SKILL providers
table + flags documented. Tests updated (43 green). Skill consolidation/deletion
(rest of #15) deliberately NOT done — separate, not implied by approval.
2026-07-03 19:22:31 -07:00
Miguel Angel Simon Sierra 9cf3edeb61 feat(media-use): media-ops guidance + process transforms (#12, #7)
references/operations.md: local-tool recipes (ffmpeg cut/reframe/montage,
auto-editor, scenedetect) + local-vs-HeyGen transform table (bg-removal/upscale/
lipsync/translate) with side-by-side guidance. Outputs register via --from
(auto-promoted). Per OP1, media-use guides to the tools rather than re-wrapping
ffmpeg/heygen as bespoke verbs.
2026-07-03 19:22:30 -07:00
Miguel Angel Simon Sierra c5556898e0 feat(media-use): ingest --from + brand upsell (#9, #10)
resolve --from <file|direct-url> freezes a user-supplied asset + registers +
auto-promotes it. isDirectMediaUrl rejects platform pages (no yt-dlp). brand
resolve with no frame.md/design.md now upsells the HyperFrames design flow
instead of a generic miss.
2026-07-03 19:22:30 -07:00
Miguel Angel Simon Sierra bc946e531b feat(media-use): auto-promote + global cache + search + in-use detection (#11, #16)
Auto-promote every fetched asset into the global content-addressed cache so it's
reusable across all hyperframes projects (cachePut now dedups by sha; resolve
promotes on register, non-fatal). search.mjs: paginated text search (no vector
DB). usage.mjs: tag/partition assets by in-use vs unused (scans compositions) —
powers the Studio Asset-tab filter.
2026-07-03 19:22:30 -07:00
Miguel Angel Simon Sierra ff86a811c6 feat(media-use): local-model runner (#4)
runLocalModel(capability) picks the best tier for the machine (selectModel),
checks the tool is on PATH, fills + runs its invoke template, returns the output
path — or a clear install/CLI recommendation when not runnable. Injectable
which/exec; never throws. Consumed by the process verb.
2026-07-03 19:22:30 -07:00
Miguel Angel Simon Sierra bff2343ed9 feat(media-use): flip-to-enable fal + voice adapters (#5)
fal aggregator + ElevenLabs/HeyGen-TTS voice providers built as real CLI
adapters, registered default-OFF and flipped on by env flag (MEDIA_USE_ENABLE_*)
read at call time. Bin's answer becomes a flag, not a code change. Tests prove
off-by-default + flip-on ordering (heygen stays first).
2026-07-03 19:22:30 -07:00
Miguel Angel Simon Sierra 675c892c84 feat(media-use): spec-gated local-model runtime (U2)
specs.mjs probes CPU/RAM/GPU/VRAM (Apple Silicon unified memory + nvidia-smi),
injectable for tests. local-models.mjs is a declarative table of user-installed
models per capability+tier (tts/asr/upscale) with size/needs/install/invoke;
selectModel picks the highest runnable tier or recommends the CLI path. No
license gate — models are user-installed, local-use-only.
2026-07-03 19:22:30 -07:00
Miguel Angel Simon Sierra a6ff74caf3 feat(media-use): provider registry contract (U1)
Ordered, capability-based registry — search/generate/process slots, tried
deterministically with heygen-CLI first. Disabled slots (fal aggregator,
Iconify, voice TTS, local) carry their gate reason (B-Q1/B-Q2/U2) so enabling
them later is a flag flip, not a refactor. resolve cascade now registry-driven;
providers.mjs kept as a back-compat shim. Regenerated skills-manifest.
2026-07-03 19:22:29 -07:00
Vance IngallsandClaude Fable 5 566d49382c feat(skills): reroute /figma by capability - REST/CLI for phases 1-3, MCP for 4-5 (M4) (#1873)
* feat(skills): reroute /figma by capability - REST/CLI for phases 1-3, MCP for 4-5 (M4)

Rewrites the skill from MCP-first to the spec 2 split: asset/tokens/
component route through the hyperframes figma CLI (FIGMA_TOKEN), motion/
shaders stay agent-driven over MCP (no REST equivalent). Adds two-
credential guidance, Starter rate-limit tactics (recursive:true, raw-
response cache, opt-in screenshots), the 7.1 binding flow (tokens before
components, one ask per unknown library, never value matching), and the
shader manual-export default. Catalog blurbs updated in lockstep.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(cli): register figma component subcommand

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(skills): add storyboard-to-animatic guidance to /figma

Field-tested against a real 26-scene storyboard section: the parsing
grammar (frame-sized nodes incl. loose rectangles = scenes, x-order =
time order, TEXT below the strip = director notes paired by x-overlap),
batched still export (chunk ~4 ids per render call - big frames timeout
past ~12), a note-verb -> transition vocabulary (EXPLOSION/SLIDE/MORPH/
CYCLE), and the stills-vs-component routing rule for within-scene motion
notes. Catalog blurbs updated in lockstep.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(skills): storyboard frames are keyframes, not slides

Field-tested against a second real storyboard section: frames sharing an
element (matched by name, else geometry similarity) define that element's
states through time - tween the element between states, crossfade only
when pixels genuinely differ, enter/exit unmatched children, tween frame
backgrounds as a color track. Stills demoted to fallback for frames that
don't decompose. Validated live: a 4-frame logo-rise reconstructed as one
element with four keyframes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(figma): self-explanatory first-run experience + mintlify guide

- NO_TOKEN/BAD_TOKEN errors now carry the full one-time setup (mint URL,
  read-only scope checklist, persist hint) instead of a bare pointer
- figma subcommands print clean guidance on typed client errors, not a
  stack trace (shared withFigmaErrors boundary)
- CLI help gains component subcommand, FIRST-TIME SETUP and WHAT TO
  EXPECT blocks
- /figma skill: preflight the token before the first CLI call and walk
  the user through setup up front; narrate landed-artifact + next action
  at every step
- new docs/guides/figma.mdx (setup, per-phase walkthroughs, provenance,
  troubleshooting table) wired into docs.json nav

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(figma): review fixes — missing withFigmaErrors imports, 401/403 semantics, docs accuracy

- tokens.ts/component.ts called withFigmaErrors without importing it
  (tsup doesn't typecheck, so every invocation shipped as an immediate
  ReferenceError); imports added, tsc --noEmit now clean
- error boundary widened to all Errors so bad-ref/bad-format input
  errors print their message instead of a stack trace
- 401 no longer claims 'missing scopes' (figma signals that as 403);
  new FORBIDDEN code maps non-variables 403 to scope/access guidance
- docs: asset/component refs require a node id (bare fileKey is
  tokens-only), example snippet matches real output, FORBIDDEN row
- skill: preflight counts a project-.env token as configured (CLI
  auto-loads it); BAD_TOKEN/FORBIDDEN guidance split

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(cli): present figma errors via standard errorBox

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 19:13:08 -07:00
Vance IngallsandClaude Fable 5 e92700acde feat(core): figma motion → GSAP translator + /figma skill v1 (#1869)
* feat(core): add figma motion easing mapping

* feat(core): translate figma motion doc to gsap timeline spec

* feat(core): emit paused GSAP timeline script from figma motion spec

* fix(core): restore type exports dropped from figma barrel in Task 8

* feat(skills): add /figma import skill + catalog wiring

Add the agent-facing /figma skill (asset + Figma Motion import via the
Figma MCP connector, built on @hyperframes/core/figma) and wire it into
the skill catalog across CLAUDE.md, README.md, docs/guides/skills.mdx,
and the hyperframes router's capability map. Bumps the skill count from
19 to 20 in CLAUDE.md and README.md.

* fix(core): use replaceAll for figma node-id dash-to-colon conversion

* style: format skills catalog tables

oxfmt-align the README and router SKILL.md tables after the /figma +
/hyperframes-keyframes merge left uneven column padding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(cli): add missing cache fields to telemetry test fixture

ExtractionPhaseBreakdown gained cachePublishFailures/cacheGcEvictions/
cacheGcBytesFreed/cacheAgedPartialsCleared; the studioRenderTelemetry
test fixture was never updated, breaking Typecheck on main and every PR
based on it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:45:07 -07:00
Miguel Ángel 3b67918242 fix(hyperframes-media): npx spawn without shell:true fails silently on Windows (#1845)
* fix(hyperframes-media): npx spawn without shell:true fails silently on Windows

Two independent user reports of Kokoro TTS silently failing on Windows,
both naming the same site: lib/tts.mjs synthesizeOne() spawns "npx" via
plain spawn(cmd, args). On Windows npx resolves to npx.cmd, which Node's
spawn() cannot exec without shell:true — it fails ENOENT, and spawnP's
"error" listener turns that into a plain ok:false ("TTS failed") with no
indication of the real cause.

Scope the fix to the npx call specifically (python3/ffmpeg are real
binaries and don't need it), with the platform/spawn function injectable
so the win32 branch is testable without mocking node:child_process (its
ESM exports are non-configurable, so mock.method can't patch it) or the
real process.platform.

* fix(hyperframes-media): avoid shell true for windows npx
2026-07-02 18:04:14 -07:00
Miguel Ángel e2b43583fc fix(hyperframes-media): fall back to ffmpeg when ffprobe is missing (#1877)
* fix(hyperframes-media): fall back to ffmpeg when ffprobe is missing

ffprobeDuration() returned NaN whenever the ffprobe spawn failed for any
reason, conflating "ffprobe binary not installed" with "file is corrupt".
Some ffmpeg-only distributions (common in curated Windows installs) ship
ffmpeg.exe without ffprobe.exe, so every TTS line hit the missing-binary
case and audio.mjs read the NaN as a bad WAV, silently dropping an already
successfully synthesized line. Now falls back to parsing ffmpeg's own
`Duration:` stderr banner when ffprobe specifically ENOENTs, and only
returns NaN when the file itself can't be probed by either tool.

* fix(hyperframes-media): update skills manifest for ffprobe fallback
2026-07-02 17:57:24 -07:00
Miguel Ángel 2e9a33ca71 fix(hyperframes-media): cap TTS synthesis concurrency instead of firing every line at once (#1862)
Two independent post-release feedback reports of the same mechanism from
two different skills (both delegate to this one shared engine): audio.mjs
fired every line's Kokoro TTS + whisper-transcribe subprocess concurrently
via a bare Promise.all with no cap.

- One OOM'd 12/13 lines on a resource-constrained laptop (32GB total, ~7GB
  free), requiring a manual patch to a sequential for-loop.
- The other saw 7/8 lines fail on first run, then pass on retry once the
  model was cached — concurrent cold-start model loads overwhelming the
  machine, not a real synthesis failure.

Kokoro/Whisper each load their own local model per subprocess, so firing
every line at once multiplies that cost by the line count. Extracted the
concurrency cap into lib/concurrency.mjs (audio.mjs is a script — it runs
CLI/exit side effects on import, so it can't be unit-tested directly;
the cap is small enough to pull out and test in isolation). Default 4,
overridable via HYPERFRAMES_TTS_CONCURRENCY, floored at 1 (matching one
report's own manual workaround).

hyperframes-media/scripts/audio.mjs is the single canonical engine per its
own header comment; product-launch-video, faceless-explainer, and
pr-to-video each carry a thin wrapper that spawns this file as a
subprocess (confirmed via their DEFAULT_ENGINE path), so this one fix
covers all four skills without touching the other three.

Tests: 4 new cases for mapWithConcurrency (order preserved regardless of
completion order, cap actually enforced, limit > item count doesn't hang,
empty input). Full skills test suite (514 tests) shows no new failures —
the 444 pre-existing failures are environment-dependent and reproduce
identically on unmodified main.
2026-07-02 17:46:18 -07:00
Vance Ingalls a7c3cc7d68 fix(slideshow): make presenter mode work over Google Meet/Zoom screen share
Fix slideshow presenter mode for screen-share workflows by opening the audience view as a regular noopener tab, preserving audience query construction across fragments, and keeping iframe keyboard forwarding diagnosable.
2026-07-02 10:07:35 -07:00
Miguel Ángel a908af11a8 feat(cli): keyframes command (surface GSAP/CSS/Anime keyframes + 3D onion-skin --shot) (#1603)
Renames the motion-surfacing tool from `hyperframes keyframes` to `hyperframes motion`,
renames the implementation from keyframes*.ts to motion*.ts (keeping the keyframe data
model name where still accurate), and renames the shipped skill from
hyperframes-keyframes to hyperframes-motion. Expands the skill from a command
reference into a full motion-design workflow: reading motion, 3D angle verification,
layered GSAP motion, one-shot reference reproduction, diagnostic checks, and
eval-derived craft guidance.
2026-07-01 19:51:55 -07:00
James RussoandClaude Sonnet 5 24edb15095 fix(runtime): auto-infer composition duration for CSS/WAAPI/Lottie so data-duration is optional (#1830)
* fix(runtime): auto-infer composition duration for CSS/WAAPI/Lottie so data-duration is optional

The #2 render failure bucket ("Composition has zero duration") accounts for
~27K errors / ~7K affected users over 30 days (PostHog project 356858). Root
cause: only GSAP timelines got their duration auto-detected — CSS, WAAPI, and
Lottie compositions had no source of truth for total duration unless the
author remembered to set data-duration on the root element, and the render
engine hard-failed capture when neither was present.

Adds getInferredDurationSeconds() to the CSS, WAAPI, and Lottie runtime
adapters (packages/core/src/runtime/adapters/*.ts) — each reports the longest
finite end time it can discover from its own animations (CSS: computed
timing offset by data-start; WAAPI: effect.getComputedTiming().endTime;
Lottie: totalFrames/frameRate or the player's own duration). Infinite/
unbounded animations correctly return null and still require data-duration.
Wires this into the runtime's existing duration-floor resolution
(resolveAdapterDurationFloorSeconds in runtime/init.ts), alongside the
existing media-duration and authored-composition floors, so
window.__hf.duration becomes positive without any author action for
finite-duration non-GSAP compositions. Three.js is unchanged — no
AnimationClip/AnimationMixer inspection exists in that adapter, so
data-duration remains required there.

Tightens frameCapture.ts's zero-duration fast-fail gate to also check
hf.duration directly (not just the two authored signals), so a composition
mid-inference isn't fast-failed before its adapter-derived duration lands.

Adds a new lint rule (root_composition_missing_duration_source) that errors
only on genuinely non-inferable cases: no animation signal at all, Three.js
without data-duration, or an infinite/unbounded CSS or WAAPI animation
without data-duration. Deliberately silent on finite CSS/WAAPI/Lottie
animations, since the runtime now infers those — an autofix that "inserts
the inferred value" was considered and rejected: every case the rule flags
has no derivable value (an infinite spinner has no finite end time; a
duration-less Three.js scene has nothing to measure), so any autofix would
have to fabricate a placeholder, trading a loud correct failure for a silent
wrong-length render.

Updates the CSS/WAAPI/Lottie/Three adapter skill docs and the
hyperframes-core determinism-rules/data-attributes references to document
the new optionality and the runtime mechanism backing it.

Verified end-to-end against the real render pipeline (not just unit tests):
a CSS-only composition with a finite 3s animation, no GSAP timeline, and no
data-duration now renders a correct 3.000s MP4 via `hyperframes render`
(previously: "Composition has zero duration" failure). The infinite-CSS
negative control still fails fast with a clear diagnostic, matching the new
lint rule.

Adds a file-level fallow health exemption for lottie.ts's pre-existing
`seek` handler — unrelated to this change, but its line numbers shifted when
new functions were added earlier in the file, tripping fallow's
inherited-finding fingerprint (documented pattern already used elsewhere in
.fallowrc.jsonc for the same reason).

Known limitation: the static WAAPI usage detector in the lint rule
(/\.animate\(\s*[\[$A-Za-z_]/) can miss unusual call shapes; it only affects
whether the "no signal at all" branch fires, and errs toward NOT flagging
(reducing false positives) rather than over-flagging.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(lint): close 3 correctness gaps in root_composition_missing_duration_source

- Strip JS/CSS comments before scanning for GSAP/WAAPI/Three/Lottie/CSS
  animation signals, so a commented-out `.animate()` call or a commented
  `animation: ... infinite` rule can no longer satisfy the "has a duration
  source" check and mask a real zero-duration render failure.
- Broaden the WAAPI detection regex to also match the object-literal
  (PropertyIndexedKeyframes) form of `.animate()`, e.g.
  `el.animate({ opacity: [0,1] }, { duration: 2000 })`, which the previous
  character class silently missed. Corrected the adjacent comment that
  incorrectly claimed this shape "can't be a false negative".
- Fix hasInfiniteCssAnimation to stop false-positiving on animation NAMEs
  that merely contain the substring "infinite" (e.g. `infinite-spin`) by
  anchoring the `infinite` keyword with hyphen-aware boundaries instead of
  a bare `\b`. Also makes the longhand `animation-name` + separately
  declared `animation-iteration-count: infinite` pattern detected
  consistently.

Adds targeted unit tests for each fixed false-positive/false-negative.

* fix(runtime): keep finite duration signal when an unbounded animation coexists

getInferredDurationSeconds in the CSS and WAAPI adapters returned null
outright whenever any animation on the composition was unbounded
(infinite iteration count), even when other finite animations on the
same composition could still supply a valid duration. This disagreed
with the new root_composition_missing_duration_source lint rule, which
treats any animation-name as sufficient — so a composition mixing a
finite fadeIn with a decorative infinite spin passed lint but still
failed at render with "zero duration".

Unbounded animations are now skipped when computing the max end time
instead of short-circuiting the whole calculation. null is only
returned when every animation on the composition is unbounded, i.e.
there is no finite signal to fall back on at all.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(skills): fix table separator width in data-attributes.md

oxfmt flagged the merged Composition Root table from the post-rebase
merge of the auto-infer-duration docs onto main's reformatted table —
the separator row was one dash short of the header width.

* fix(lint): keep infinite-CSS duration rule strict but make its message honest

Post-review (Vance): after the finite+infinite adapter fix, the runtime infers
a length for a mixed finite+infinite CSS composition, but this lint rule still
(intentionally) errors on it — an unbounded animation makes the intended total
length ambiguous, so we require explicit data-duration. Keep that strictness
(lint is advisory by default; it only blocks under --strict, and data-duration
is the one duration signal guaranteed correct across every adapter, known and
future). But the message wrongly claimed the render "will fail" — false for the
mixed case, where the runtime falls back to the finite animation. Rewrite it to
describe the ambiguity honestly, correct the rule's block comment, and add a
mixed finite+infinite test asserting it still errors with an honest message.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 14:28:16 -07:00
WaterrrForeverandClaude Opus 4.8 535297280a fix(skills): clear two Snyk Fails and harden the network + supply-chain surface (#1804)
* fix(skills): clear Snyk findings and harden supply-chain surface

Address the security-audit findings on the published skills with no change to
any skill's behaviour.

- media-use: resolve.test.mjs runs resolve.mjs via execFileSync with an argv
  array instead of execSync(`node … "${tmp}" …`), removing the command-injection
  (CWE-78) sink that drove the Snyk Fail.
- music-to-video: replace dynamic `element.innerHTML = <var>` with a setSvg()
  helper (DOMParser image/svg+xml + importNode, text fallback) in the
  intro-kinetic-cascade and logo-split-lockup-pulse frame templates, clearing the
  DOM-XSS (CWE-79) Snyk Fail. Renders identical SVG.
- pr-to-video: fetch-people-avatars.mjs refuses any avatar URL that is not https
  on a GitHub avatar host (SSRF guard) and only writes under the project dir
  (path-traversal guard); best-effort, always-exit-0 behaviour is unchanged.
- embedded-captions: pin `uvx --from whisperx==3.8.6` (overridable via
  $WHISPERX_VERSION) so transcription no longer resolves "latest" at runtime.
- gsap: add Subresource Integrity (integrity + crossorigin) to the 8 render-time
  CDN GSAP <script> tags across embedded-captions, music-to-video,
  faceless-explainer, pr-to-video and product-launch-video.
- hyperframes-animation / hyperframes-creative: document package-loader's
  defense-in-depth and note that the installLine strings are display-only.

Verified: media-use resolve (12/12), probe injection (1/1) and manifest (19/19)
tests pass; avatar host-allowlist checks pass; all changed JS passes node --check
and oxfmt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(skills): clarify product-launch-video vs website-to-video routing

Sharpen the router's product-vs-site decision in hyperframes/SKILL.md: the
split is now "is the site selling a product?" — yes (SaaS / app / product /
company site) → /product-launch-video (a promo; the default for any commercial
URL, even if the site is only named); no, or the user just wants the site shown
as-is (portfolio / blog / docs / personal / event) → /website-to-video (a tour).
Updates the workflow table, the disambiguation bullet, and both workflows'
Input/Output blurbs to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* style(skills): satisfy oxfmt in the two music-to-video templates

The CI Format job runs `oxfmt --check .`, which also formats embedded <script> in .html. Reflow the setSvg() blocks added for the DOM-XSS fix to oxfmt's wrapping — no logic change. Regenerate the music-to-video manifest hash to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(skills): sanitize SVG in music-to-video templates (real CWE-79 fix)

Addresses @Magi's review: the previous setSvg() only swapped the sink
(innerHTML → DOMParser + importNode) but did NOT sanitize, so active SVG
content still executed on insertion into the live document. Verified in
headless Chrome that the old shape fired both an svg `onload` handler and an
inline `<script>`.

setSvg() now runs a default-deny cleanSvg() over the parsed tree before it ever
enters the document: only an allow-list of inert drawing elements
(svg/g/path/line/rect/circle/… ) and presentation attributes
(d/fill/stroke/viewBox/…) survives. Every other element (`<script>`, `<image>`,
`<use>`, `<foreignObject>`, `<a>`, `<animate>`, …), every `on*` handler, and
href/xlink:href/style are stripped — on the root node too. Non-SVG or malformed
input still falls back to textContent.

Trusted content (the bundled icon library + the default spark/cloud marks)
renders byte-identically; only hostile markup in vars.icon / leftMark / rightMark
is neutralized.

Browser-verified (headless Chrome, both templates' helper):
  old setSvg → fired ["script","onload"]
  new setSvg → fired []  · trusted icon still renders · 0 danger nodes · 0 on* attrs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 12:39:42 +08:00