Repository navigation
feat(cli): hyperframes narration list, init and check - #8940
Open
DhanushMurugesanG wants to merge 3 commits into
Open
DhanushMurugesanG wants to merge 3 commits into
DhanushMurugesanG wants to merge 3 commits into
Conversation
Adds two subpaths that later narration work builds on. No behaviour changes: nothing imports them yet. - @hyperframes/parsers/narration: reads, checks and writes narration.json, the script of a narrated project (each line's text, voice, audio file and what it was last voiced from), keeping unknown keys. Lengths and word timings are not copied into it: narrationTimingsOf() reads them from media-use's audio_meta.json by line id. - @hyperframes/parsers/caption-array: finds const/let/var `script` and `TRANSCRIPT` caption arrays in HTML, reads their words, and splices or shifts words while every other element stays byte-identical. Refs heygen-com#6708
A project with narration.json now gets a warning when a line's text, voice or WAV changed since it was voiced, when a line has no linked clip or its clip is the wrong length, and when the caption words that show it no longer match its voice. Captions that read differently from the script get an info. No manifest, no findings, and nothing blocks a render. Lengths and word timings come from media-use's audio_meta.json by line id. Without it, the length isn't checked and a line's captions only need to fall inside its clip. Refs heygen-com#6708
- init writes narration.json for a project voiced before it existed: from media-use's audio_meta.json and audio_request.json, or from clips already tagged with data-narration-line and the caption words inside them. It tags each line's clip, as one history entry. Lengths and word timings stay in audio_meta.json. - list shows each line, its length from audio_meta.json and its narration findings, or "in sync". - check prints the narration findings from lint and exits 1 while any warning remains. Every subcommand takes --dir and --json and answers the same with --json before or after it. A refusal (no narration.json, nothing to adopt) exits 2 with its message. Refs heygen-com#6708
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This was referenced Nov 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 4 for linked narration (#6708). Builds on #8938 and #8939: until they merge, this PR also shows their commits. Only the last commit (
feat(cli): hyperframes narration list, init and check) is new here.What
A
narrationcommand with three subcommands:hyperframes narration init: writesnarration.jsonfor a project voiced before it existed. It reads media-use'saudio_meta.jsonandaudio_request.json(the text comes from the request), or else clips already taggeddata-narration-lineand the caption words inside them. It tags each line's clip, all as onehistoryentry.--forcereplaces an existing file.hyperframes narration list: each line, its length (fromaudio_meta.json) and its findings, or "in sync".hyperframes narration check: the narration findings from lint; exits 1 while any warning remains.All take
--dirand--json. A refusal (nonarration.json, nothing to adopt, a file already there) exits 2 with its message.Why
Lint (#8939) needs a
narration.jsonto compare against, and nobody should have to write one by hand for a project media-use already voiced.Related work
Refs #6708. Follows #8938 and #8939. Next is
narration set.How
packages/cli/src/commands/narration.ts: citty subcommands with lazy imports, liketimeline. Printed text goes throughterminalLines, and JSON answers the same with--jsonbefore or after the subcommand (cli.jsonFlag.test.tslists the new leaves).narration/init.tswrites the script only. Lengths and word timings stay inaudio_meta.json. Clip tagging goes throughapplyFileMutationswithexpectedVersion, andnarration/history.tsfiles it as one history entry (or joins a turn that's already open).narration/status.tsruns the samelintProjectpass and groups findings by line.narration_manifest_invalidhint now mentionsnarration init.Test plan
narration/init.test.ts. Adopt a media-use project (text from the request, clips tagged, no timings copied, lint clean); refuse to replace unless--force; adopt tagged clips with no media-use; refuse a project with nothing to adopt;listwith and withoutaudio_meta.json;checkexit codes 0, 1 and 2 through the command.bun run --filter @hyperframes/cli test: the narration tests,cli.jsonFlag.test.tsandprintedFailureText.wiring.test.tspass. 5 other files fail on my Mac for local reasons (Homebrew whisper, the local ffmpeg build, macOS file-name normalisation, a file-watcher timing test); none of them touch narration.node scripts/check-docs-cli-commands.mjspasses.narrationsection indocs/packages/cli.mdx.