mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
93a4d29c032bec4726372e9db4a1ffff96462fac
358
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b4acc1a1da | fix(studio-server): a project file is never served as a service worker's script (#8064) | ||
|
|
d317abcdba |
fix(cli): cloud render --json reports re-encode progress and times out a stalled cache check (#7755)
* fix(cli): cloud render --json reports re-encode progress and times out a stalled cache check * refactor(parsers): share the ffmpeg progress reader from ff-binaries The reader lived in a new studio-server entry point, which pushed its packed size over budget and left package.json out of step with package-subpaths.json. Both callers already depend on parsers. The re-encode now gets a progress callback only when someone listens. * style(cli): format the offload test |
||
|
|
fe93f9cd47 |
fix: refuse media paths that ffmpeg's image2 demuxer would read as a pattern (#8047)
* fix: refuse media paths that ffmpeg's image2 demuxer would read as a pattern ffmpeg's image2 demuxer reads %d, %03d, %% and a % before a wildcard in an input path as a pattern of other files, folders included. Every project, private-file and received-file check approves the literal path, so a composition could name a placeholder whose pattern reaches images outside the project and get them back as video frames. Every ffmpeg and ffprobe input built from a project file now goes through assertLiteralMediaInput, which refuses such a local path before ffmpeg runs. The engine's urlInputArgs, the parsers' mediaInputFormatArgs and the studio-server's new mediaInputArgs all take the input path, so the CLI snapshot and cloud offload, lint, core grade analysis and studio-server callers are covered too. URLs and other percent signs, such as %20, are read as before. * build(parsers): declare the literal-media-input subpath * build: raise the parsers packed-size budget for the literal-media-input subpath The new subpath adds its own built entry, type file and export map rows, about 2.7 KB packed. It is a separate module so test suites that mock ff-binaries still run the real path check. * test(parsers): a harmless name shaped like a pattern is refused too |
||
|
|
70820b386f |
fix(studio-server): cache reads never follow a link the project ships (#8039)
* fix(studio-server): cache reads never follow a link the project ships The waveform and peaks caches, the thumbnail cache, the stored preview documents and the preview proxy copies all live in folders inside the project, which its author controls. Their reads opened entries with link-following calls, so a project could ship a link at a predictable cache name and have Studio return the file it pointed at. Each of these reads now goes through readProjectCacheFile or isProjectCacheFile: the entry must be a plain file, reached with no link from the project folder down, and is opened without following links. Anything else is a miss, and the entry is rebuilt. - Waveform and peaks entries must also parse as an array of numbers. - A proxy copy, its fast and content index files, and the pieces of a chunked copy count only as plain files. - Stored preview documents carry an HMAC under the user's private preview token, so a document the project shipped is never served. Without a token, nothing is stored. * fix(studio-server): the proxy copy lock treats a link at the copy name as not made The copy lock tested "the copy already exists" with a link-following check, and the transcoder returned the copy path unchecked when the lock said another process had made it. A link at the copy name was then served. - acquireCopyLock takes the caller's "copy made" test; the transcoder passes isProjectCacheFile and re-checks the path before returning it. - Copy index files are written by rename, so a link at an index name is replaced instead of written through. - Chunk pieces are checked from the project folder down, like every other cache entry. - A cache entry with more than one name (a hard link) is a miss. |
||
|
|
5fcce21a64 |
fix(engine): check proxied download hosts; keep raw GIF downloads private (#8040)
* fix(engine): check proxied download hosts against local DNS; keep raw GIF downloads private Behind an env proxy (HTTPS_PROXY with NODE_USE_ENV_PROXY=1 or --use-env-proxy), composition downloads skipped the resolved-address check and relied on the literal-host check alone. An internal DNS name passed, and NO_PROXY hosts were dialled directly. Now the downloader resolves the host on this machine first and refuses it when any answer is non-public. A name this machine cannot resolve is still left to the proxy, so proxy-only networks keep working. Studio's remote GIF prep now picks only URLs whose path ends in .gif, discards a downloaded body that does not start with a GIF signature, and the raw downloads folder is no longer served to the page; only the converted output is. * fix(cli): read the downloaded GIF's header through a bounded read stream CodeQL read the openSync call as a temp-file creation. The file sits in the project's .hyperframes folder and is only read, but a six-byte read stream does the same check without a file descriptor of our own. |
||
|
|
f5bb3e5519 |
fix: a received-files record follows Studio renames, moves and deletes, and a nested record can't be moved out of reach (#7989)
* fix(cli): a received folder's record is read wherever Studio moves it The search for received-files records now walks every folder a render, preview or publish can load files from, including renders/, dist/, .next/, coverage/ and Studio's own folders in the project's .hyperframes/. A received folder moved there by Studio keeps its files received. Studio's folder delete and move also refuse a folder holding a received-files record that lists a file outside its own folder, since that file would stay behind with no record. A received folder whose record lists only its own files can still be deleted or moved. * fix(cli): a renamed or moved received file stays listed under its new name The CLI-hosted Studio now follows every rename, move or delete it completes in the received-files records, whichever client sent it. A renamed file, or every file in a moved folder, stays listed under its new path; a file moved out of a received folder is listed in the project's own record. Changes are made under the record's lock, and a record that cannot be changed is left as it was. The per-file readers used by publish, cloud render, feedback and add now count every file as received when a record lists a file that is no longer on disk, since that file may be there under another name. This matches the local render check. Projects with no record are unaffected. * fix(cli): received content that leaves the record still counts as received When a Studio rename, move or delete takes a received file off a listed path, the sha256 of its content is kept in .hyperframes/received-content.json, the file and format the desktop app uses; other keys in it are kept. A file holding the same bytes counts as received for publish, cloud render, feedback, add and the local render check, so content brought back by undo or renamed outside Studio stays received. Studio's own backups do not count. A listed file that is gone from disk now makes only pages, stylesheets, scripts, SVG and links out of the project count as received, and the upload warning names the gone file. The record follows a request spelled in another letter case or Unicode form by matching the name the disk holds, and waits for the record's lock without blocking the server. Studio's folder delete and move no longer refuse a folder whose record lists a file outside it; that file's content is kept as received instead. * fix(cli): a folder delete or move keeps what a record inside it lists elsewhere Before Studio deletes or moves a folder, every file that a received-files record inside the folder lists outside it is listed in the project's own record by its path from the project folder. Such a file stays received after it is edited, and a listed link stays received too. When the project's record cannot be written, the delete or move is refused. Received content that cannot be read is never written over, so the desktop app's keys in it are kept. The warning about a listed file that is gone now says how to clear it. * fix(cli): received-content checks skip large non-code files and name a skipped search A file larger than 16 MB that is not a page, stylesheet, script or SVG is no longer read to compare its content with received content, so a large archive is not read on every check. When the project has too many folders to search for received-files records, the upload warning now says so. The case-matching publish test now expects the gone-file rule on a disk that tells letter case apart, and a comment no longer names a file path. * fix(cli): name a gone received file from the project folder on every system The gone-file note now names the file from the same project path the record search starts at. On Windows, a short (8.3) folder name in the temp path made the two spellings differ, so the note showed a long relative path instead of the file's name. Content hashing opens a file once, checks it through that handle and reads from the same handle, and the received-content file is read before it is classified, so nothing is checked by path and then used by path. * fix(cli): received files stay received through undo, saves, and partial folder deletes An undo, redo or restore lists again every file it writes that holds received content, and a Studio save lists such a file before it changes it. So a Studio delete followed by an undo and an edit leaves the file received. A Studio rename, move or delete now records the received side first, under the record's lock, and is refused when that fails: the content leaving listed paths is kept, a renamed file is listed under its new path, and every line of a record inside a moved or deleted folder is copied into the project's record. Once the files have moved, only lines whose file was there and whose content was kept are taken off. Lines at a rename's destination and lines whose file was already gone stay. The search for records inside the folder has no size limit, and nothing is locked when nothing is listed. * fix(cli): unreadable received content counts every file as received The readers treat a received-content file they cannot read the way they treat an unreadable received-files record: every file counts as received, and the local render check names the file it could not read. A record line that points outside the project is ignored, so a record in a received folder cannot make the readers look at or report files outside the project. * fix(cli): the CLI's own history undo and restore keep received files listed `hyperframes history undo` and `restore` with no Studio running now list again every file they write that holds received content, the same way Studio's history routes do. A delete in Studio, then an undo or restore from the CLI, then an edit, leaves the file received. A Studio edit that names its file in the request body, such as a freeze-frame edit, now lists that file first when it holds received content. |
||
|
|
b6e1e8dda9 |
fix(studio-server): a loopback page with no fetch metadata is marked unless the app framed it (#8017)
* test(studio-server): a loopback page with no fetch metadata is marked unless it is the app's own * fix(studio-server): a loopback page with no fetch metadata is marked unless the app framed it * test(studio-server): a page marked by its Referer names Referer in Vary * fix(studio-server): a page marked by its Referer tells caches it varies by Referer |
||
|
|
19743ea094 |
fix(studio): the copied render command carries no composition text a shell can run (#8012)
* fix(studio): the copied render command carries no composition text a shell can run The Variables panel's "Copy render command" put every variable value inline, quoted for POSIX shells only. A shared project's author chooses those values, so in PowerShell, cmd.exe (including npx.cmd's re-parse) or fish a default such as `x'; calc.exe; '` ran as commands when the command was pasted. The command is now fixed text: `npx hyperframes render -c <composition> --variables-file .hyperframes/render-variables.json`. Copying it saves the previewed values to that file through a new PUT /projects/:id/render-variables route, which refuses a link standing in for .hyperframes and replaces, rather than writes through, a link at the file itself. A composition path that is not one plain word in every shell (letters, digits, `_ . / -`) gets no command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(scripts): the comment checker skips a template nested in a substitution stripLiterals ended a template literal at the first backtick, including one that opens a nested template inside `${...}`. On a line such as `'${value.replace(/'/g, `'\\''`)}'` that left a backtick unmatched, so scanCLike read the rest of the file as one template and counted none of its comments. The ratchet then measured VariablesPanel.tsx on main at 1 comment line instead of 31 and failed any change that removed that line. A `${...}` is now scanned as code: strings, regexes and templates inside it are skipped, and its closing brace returns to the outer template. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(studio-server): read the replaced render-variables record through one no-follow descriptor The link test checked the record with lstat and then read it by path, two lookups CodeQL reports as a file-system race. Opening it once with O_NOFOLLOW fails if a link is still there and reads the file that open checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5f6995fe77 |
fix(studio-server): audio decodes are bounded, stop when nobody waits, and their cache is capped (#7991)
* fix(studio-server): audio decodes are bounded, stop when nobody waits, and their cache is capped The waveform and peaks routes each started a full-file ffmpeg decode per request, with no limit on how many ran at once, no sharing on the waveform route, and no way to stop one after its request went away. Their cache folder also grew without end. - Both routes now decode through one shared queue of 4 slots, one decode per cache entry, shared by every request that wants it. When the last request waiting on a decode leaves, its ffmpeg is killed (or it leaves the queue). - `.waveform-cache` keeps at most 500 entries; a write past that drops the oldest. — Rames Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): trim comments to the package's comment share Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(studio-server): raise the packed size budget for the audio decode limits The bounded decode queue, the abort when nobody waits and the capped cache add about 485 bytes to the packed tarball. Main had already reached 178,489 bytes against a 178,000 budget, so together they pass the 1% tolerance (179,877 bytes). The new budget is the measured size plus the script's 5% headroom. — Rames Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): waveform decodes keep a fixed-size peak buffer, time out, and the cache is byte-capped LRU - decodeAudioPeaks streams samples into a 65536-entry max-abs buffer that merges neighbouring runs when full, instead of buffering and concatenating the whole decode. - A shared decode is stopped after 10 minutes and its slot freed. - .waveform-cache is capped at 256 MB as well as 500 entries; a cache hit marks its entry used, so eviction drops the least recently used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(studio-server): raise the unpacked size budget after rebasing onto main Measured with pnpm pack after the rebase: 697160 unpacked bytes, over the 690000 budget by more than 1%. The new budget is the measured size plus 5%. — Rames Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
22b615f1a7 |
fix(cli): files from outside the project are uploaded only once approved (#7995)
* fix(cli): files from outside the project are uploaded only once approved publish, cloud render and feedback --file-issue copied every image, video, audio, font and CSS file a composition named from outside the project folder, and every project file that links outside it, and only listed them. A project that came from someone else could pull a file from anywhere on the uploader's disk into an upload. Now each such file needs approval. In a terminal the command lists them and asks, defaulting to no; a yes is remembered per project in the CLI's config folder (~/.hyperframes/outside-files.json), never in the project. --yes, --json, --dry-run and unattended runs leave them out with a warning naming each file and saying how to include it. --include-outside-files uploads them without asking. — Rames Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): check the approvals file mode only where files have POSIX modes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
bffe8d5985 |
fix(studio-server): bound preview stills and keep proxy work to the Studio's own pages (#8007)
* fix(studio-server): bound preview stills and keep proxy work to the Studio's own pages - Queue at most 16 stills behind the 4 being made; past that, answer 503 with Retry-After. - Refuse a still past the end of the source before starting ffmpeg (404). - Refuse a ?hf-proxy request on a plain preview path when another site asks for it. The Studio's own opaque frames already load through the frame-token path, and sandboxed thumbnail captures now do too. — Rames Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(studio-server): raise packed size budget for the still-queue and cross-site checks The bounded still queue, the past-end refusal and the cross-site proxy check add about 2.2 KB to the packed studio-server (180252 bytes in CI). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
581a43bb6a |
fix(producer): local renders leave out scripts from outside the project unless included (#7998)
A local render brought in .js and .mjs files that markup or a project link reached outside the project, so an imported composition could copy a script from elsewhere on disk into the page it runs and read it. Images, video, audio, fonts and CSS still come in. Scripts are left out with a warning that names each one and how to include it: move it into the project, or pass the new --include-outside-files to hyperframes render. The policy covers the compiler's outside-asset copy, the file server's linked files and the distributed plan's project copy. — Rames Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
32fe10a8b3 |
fix(studio-server): history writes and claims follow Studio's write rule (#7988)
History undo, restore and Cmd+Z now leave alone every file that Studio's file routes refuse to write. This covers tool-trusted, private, hidden and node_modules paths, and scripts the project's package.json runs. Cmd+Z passes over an edit that only changed such files. A claim no longer takes such a file's pending change. A claim's `overwrote` version now counts only when the server itself saw that version at that path. A version stored for another file can no longer become a file's earlier state. The write rule also refuses more files that tools and agents load on their own: opencode and crush settings, compose override files, Dockerfile.* and Containerfile, every lefthook spelling, mise, nodemon, devbox, wrangler, vercel and netlify settings, *.config.jsonc, tsconfig.*.json, Taskfile.dist, simple-git-hooks, Ruby build files, and .nix and .fish scripts. |
||
|
|
c68c78445d |
fix: hidden and credential files stay out of Studio, history and lint (#7979)
* fix: hidden and credential files stay out of Studio, history and lint - The private-file rule now refuses every hidden file or folder in a project, except Studio's own files, the root .media folder, and pictures, video, sound, fonts, stylesheets and scripts a page can load. It also refuses Terraform state and variable files and more key-store types. - Project history never tracks, lists or serves a private file, and the blob route serves only bytes a listed file had, so copies kept by an older version are no longer readable. - Lint reads a linked stylesheet, script, import map or sub-composition only when the private-file rule allows it and the file is the kind its link names, so no finding quotes a private file. - The rule moves to @hyperframes/parsers/private-path so lint can use it; @hyperframes/core/safe-path re-exports it unchanged. * fix(studio-server): a refused history blob reads as not a history blob * fix(core): keep realpath in core, so its file-system callers and tests see one module |
||
|
|
2a28e43685 |
fix(studio-server): no write route touches files other tools run or trust (#7964)
* fix(studio-server): no write route touches files other tools run or trust A composition previewed in Studio runs same-origin with the API, and the write rule refused only private paths, node_modules and hidden names. Its script could create, overwrite, rename or delete package.json, lock files, agent instruction files and scripts, which a package manager, build tool or coding agent then runs with the developer's rights. Core now names these files in one predicate, toolTrustedFileKind, read in every spelling a case-insensitive file system or Windows opens. Studio's write rule and the registry installer's target rule both use it, so every write route (PUT, POST, PATCH, DELETE, upload, duplicate-file, file-mutations and gsap-mutations) refuses such a target. Deleting or moving a folder that holds one is refused too. Ordinary composition, stylesheet, script-asset and media writes still succeed. * fix(core): fold look-alike letters before matching files other tools trust A case-insensitive macOS volume opens "AGENTſ.md" (long s) as AGENTS.md and "Makefile" (fi ligature) as Makefile, but lower-casing alone does not map either letter. Project path segments now fold names the way such a volume does: NFKC, upper-then-lower case, and invisible characters dropped. Every rule built on the segments gets the fold. Also: - name JSON, YAML and TOML tool config, compose files, turbo.json, nx.json, pyproject.toml and gulp or grunt files - treat a ~N name as a short name only when it has the 8.3 shape and an extension a trusted file's could shorten to, so take~2.mp4 stays writable - refuse to delete or move a folder holding node_modules or .git, walking it without the listing's ignore rules - report an upload refused by the write rule in `skipped` |
||
|
|
e8f1fff5fd |
fix(studio-server): a host that built a page on the build worker can exit (#7939)
* fix(studio-server): a host that built a page on the build worker can exit * test(studio-server): a dead build worker's exit code is left to the platform * refactor(studio-server): every build-worker queue change sets its ref in one place |
||
|
|
d5f0b1a5bf |
fix: nested .hyperframes stays private, capture page server checks Host, project manifests pin no CLI (#7927)
* fix(core): a .hyperframes folder in a subfolder stays private too The private-file rule treated .hyperframes as the app's records folder only at the project root. A project copied into a subfolder keeps its own .hyperframes/, and its chat history, hand-off and other records there were listed in the file tree and served by Studio's file and preview routes and by the other file servers that share the rule. A .hyperframes segment at any depth is now private, in every spelling Windows opens. Studio's own files and the prepared-assets and requests folders stay servable only at the root, the one place Studio reads and writes them. The file tree also skips .hyperframes/backup at any depth. * fix(cli): the capture --local-file page server answers only its own host The page server that capture --local-file starts on a loopback port answered a request whatever its Host header said. A site whose name resolves to 127.0.0.1 could then read the files it serves from the browser. The server now refuses, before any file lookup, a request whose Host is not its own loopback name and port, with the same isOwnLoopbackHost rule the static project server and the engine file server use. Every response carries X-Content-Type-Options: nosniff. The capture browser loads the page by 127.0.0.1 and its port, and fetchLocalPageUrl reads from disk, so both work as before. * fix(skills): a plugin manifest in the project pins no CLI release The skills launcher read a plugin manifest from the folder above skills/ wherever the skills were installed. For a project-level install that folder is the project itself or its .agents or .claude folder, so a plugin.json shipped with a project could pin an old hyperframes release and turn off update checks and standalone skill refreshes. The launcher now reads a manifest only from a bundle of its own: a folder whose name does not start with a dot and that is neither the folder the CLI works in nor one that contains it. Plugin managers install bundles into their own folders, so those keep their pin. A manifest anywhere else leaves the call the same as with no manifest. A manifest that pins a release older than 0.9.34, the launcher's floor, is refused. The agent-facing plugin rules and the skills guide say the same. * fix(skills): a plugin bundle inside the working folder pins only behind a dot folder A package inside a monorepo could still pin the CLI: with the agent working at the monorepo root, <mono>/packages/video/plugin.json sat beside a skills folder the launcher took for a bundle. The launcher now also refuses a bundle inside the working folder unless a folder whose name starts with a dot lies between them, as .claude does in ~/.claude/plugins/cache when the agent works in the home folder. Bundles in ~/.claude/plugins, ~/.cursor/plugins and ~/.gemini/extensions keep their pin from the home folder or a project. The plugin rules and the skills guide now state the three conditions the launcher checks. * docs(cli): a .hyperframes folder in a subfolder is left out and not served The private-file rule now treats a .hyperframes/ folder at any depth as the app's records. Files stored in one inside a subfolder, assets included, stay out of uploads and are not served by Studio, preview or render. The cloud render section now says so beside the rule it already describes. * fix(cli): capture pages keep loading scripts with no or unlisted extensions With nosniff on every response, a script the capture page server did not know the type of (a .cjs file, or a file with no extension) was served as application/octet-stream, and the browser refused to run it. The server now names .cjs, .wasm, .xml, source maps, web manifests, CSV, WebVTT, glTF and more audio, video and image types. A file whose type is still unlisted is served without nosniff, so the browser sniffs it as it did before and such a script runs. Every listed type and every empty error response keeps nosniff. * fix(share): sync and share leave out a .hyperframes folder below the root The .hyperframes rules in the source path policy matched only at the project root, so a copy's records in a subfolder, such as sub/.hyperframes/agent-runs.jsonl, fell through to the default rule and travelled with share and sync. A new nested-hyperframes-state rule leaves out a .hyperframes folder at any depth below the root. It sits before the first allow rule, as the contract's rule order requires. The root folder's Studio files and other portable files travel as before. Stored snapshot reads skip the new rule through stored_manifest.legacy_rule_regexes, the shape the server and Desktop copies already use, so snapshots and bindings captured earlier still read. |
||
|
|
d159ec51c0 |
fix(studio-server): sub-composition previews build off the request thread within a deadline (#7857)
* test(studio-server): a sub-composition build past its deadline is refused off the request thread * fix(studio-server): sub-composition previews build off the request thread within a deadline * fix(studio-server): every parse of a sub-composition page runs on the build worker * test(studio-server): a page built inside its deadline keeps the request thread free * test(studio-server): a refused page leaves the next one built whole, hf-ids and all * chore(studio-server): the build worker's comments fit its package's share |
||
|
|
2be03408db |
fix(studio): recovery drafts are kept by each project's own server, never the browser (#7904)
* fix(studio): recovery drafts are kept by each project's own server, never the browser * fix(studio): a restored draft stays offered when Studio settles which composition is open * fix(studio): a draft read never waits on a pipe or loads an oversized record * test(studio): the draft read's child fixture is an entry point, and its note sits in the test * chore(studio-server): size budget covers the recovery-draft route * chore(cli): unpacked size budget covers the recovery-draft route |
||
|
|
9b5a3ce74a |
fix(cli,studio-server): no lookup of another computer's share path before refusing it (#7914)
On Windows even a stat or realpath of a \\host\share path connects to that host and signs in as the current user. Three readers looked such paths up before refusing them: - `hyperframes compositions` resolved a data-composition-src with path.resolve, so an absolute or share src reached readProjectFile. It now uses resolveCompositionSrc, the resolver preview and render use. - The timeline reader (`timeline`, `audio`, measure) realpath'd a sub-composition before its containment check. It now refuses a path on another network root first. - Artifact bookkeeping for render, check and snapshot looked up the paths recorded in .hyperframes/video-state.json. A recorded path must now be spelled inside a .hyperframes/artifacts/<kind> folder on the project's own root before cleanup looks at it, and a record naming another share counts as gone without a lookup. |
||
|
|
478313ba0e |
fix(studio-server): history restores stay inside the project and use only intact copies (#7902)
* fix(studio-server): history restores stay inside the project and use only intact copies * fix(studio-server): a history path's trailing dots and spaces are trimmed by a scan, not a regex |
||
|
|
014326b40b |
fix: every composition file server refuses credential and tool-state files (#7889)
* wip: paused before review * test: cover credential files on the preview routes and the deploy notice * refactor: name the inspector's file lookup for what it serves * fix(cli): a link to a private file outside the project keeps its own left-out reason * fix: escape the upload notice and skip private files from old manifests |
||
|
|
bbac8900ea |
fix(studio-server): other sites cannot start lint or probe work (#7894)
* wip: paused before review * fix(studio-server): key shared lint runs on project content; test cross-site refusals |
||
|
|
6efa6b6353 |
fix(cli): history turn ids from the project folder are checked and sent encoded (#7883)
* fix(cli): history turn ids from the project folder are checked and sent encoded * test(cli): history turn fixtures use the id shape the CLI mints * fix(cli): a turn's label and agent name are kept as written; only ids are checked * style(cli): format the turn reader * refactor(cli): the turn reader checks a marker through small predicates |
||
|
|
ceb969dbac |
fix(studio-server): sub-composition head and root tag scans take linear time (#7866)
rootHeadContent and tagRootCompositionFile ran an opener, then [^>]* or a lazy run, then a required literal, over the project's own HTML. When the literal never came, each opener rescanned to the end of the page: about 10 s for 250 KB of "<head" or of "<a". Both are now plain scans that give the same results: only the first <head can match, and each start tag is checked up to its own > once. |
||
|
|
c030e3193d |
fix(cli): publish and cloud render staging skip other computers' network shares (#7858)
* fix(cli): never open another computer's share while staging an upload publish and cloud render now leave out a reference to another computer's network share or a Windows device path before any file-system call on it, and report it as left out with the network_share reason. A page that came in with an imported project has its outside references left out before the files they name are checked. * test(cli): the Windows staging test's lstat mock honours throwIfNoEntry |
||
|
|
ae5829db7e | fix(studio-server): a sealed preview's wait for a video's proxy copy passes its preflight (#7856) | ||
|
|
a2f9267089 |
fix: snapshot escapes composition text in its output; stills sweep the transcode cache (#7832)
* fix(cli): snapshot shows control characters in composition text as escapes * fix(studio-server): making or serving a still sweeps the transcode cache |
||
|
|
88ffe087ca |
feat(studio-server): an opaque preview loads its images, media and fetched files (#7806)
* feat(studio-server): an opaque preview loads its images, media and fetched files * refactor(studio-server): the fetch grant's reach is named, not commented * test(studio-server): the main preview loads under the frame-token path |
||
|
|
2ceb682f92 |
fix: LAN-host previews and play pages refuse other sites without fetch metadata (#7836)
* fix(studio-server): previews with no fetch metadata on a LAN host count as another site Browsers send no Sec-Fetch-Site header over plain HTTP to a non-loopback name, such as a LAN address used with HYPERFRAMES_PREVIEW_HOST. The preview guards now count such a request as the Studio's own page only when its Referer names the same host. Otherwise the preview is marked and sandboxed, its validators are dropped, and the thumbnail, waveform, peaks and frame-token routes refuse it. * fix(cli): play marks and sandboxes compositions another site loads The play server's /composition/* route now applies the same another-site decision as the Studio preview. A load from another site comes back with the sandbox CSP and without validators, and its HTML carries the hyperframes-preview-for-another-site mark, so the runtime offers that site no editing port. The play page's own player is unchanged. * fix(player): send a same-origin Referer from the composition frame The player's composition iframe used no-referrer, so on a plain-HTTP LAN host its own composition load carried neither Sec-Fetch-Site nor Referer and the Studio and play servers sandboxed it as another site's load. same-origin sends the host page's URL only to a composition on the same origin, so another origin still learns nothing about the embedding page. |
||
|
|
04202e8a4c |
fix(cli): uploads leave out outside scripts; .ts counts as video only when it is one (#7818)
* fix(cli): uploads leave out outside scripts; .ts counts as video only when it is one * chore(studio-server): raise unpacked size budget for the upload file-type rule * fix(studio-server): transport stream check never waits on a pipe and needs binary bytes |
||
|
|
ac02474105 |
fix(cli): play and present check the Host like preview; local render leaves out outside files for a received composition (#7792)
* fix(cli): a subfolder of an imported project keeps its received-files record Publish, cloud render and feedback now read the received-files record at the nearest folder at or above the one they stage, so staging a subfolder of an imported project still leaves out the outside files its received files reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a received file counts under any spelling of the same file on disk The received-files lookup now also matches a project file that is the same file on disk as a listed path, so a name respelled in letter case on a case-insensitive disk keeps its received status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): cloud render prepares only the GIFs staging kept The entry GIF prep before a cloud render upload now reads only the staged copies it is handed. An image whose source staging left out keeps its reference as written and is never read from disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): never hand a playlist named as media to ffmpeg A media file whose first bytes are an HLS playlist, an XML manifest or a concat script now stays out of ffprobe and ffmpeg: cloud render leaves it in the zip as authored, the media probe reports it as not media, and the proxy copy refuses it. Real media never starts with these bytes, so it probes and transcodes as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): catch playlists with control bytes, and keep them from stills and audio probes A text playlist or concat script is detected whatever bytes follow its first line; only markup must be all text. A still frame and the audio probe behind waveforms, peaks and loudness now refuse a file the probe reads as not media, as the proxy copy already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a parent folder's state the CLI cannot read never marks a project received The walk up for a received-files record now skips a parent whose record cannot be reached. Only a record file that is there but cannot be read or parsed counts every file as received. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a drive that reports no file ids matches no received file by identity Some network and virtual drives report a file id of 0 for every file, so the same-file match now gives such a file no identity instead of matching it to every listed file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(studio-server): read a media file's first bytes with a read stream The playlist check reads the first 64 bytes through a bounded read stream instead of a raw file descriptor, and the audio-track probe's doc comment sits on its function again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(studio-server): raise the packed size budget for the media playlist check Main packs @hyperframes/studio-server close to the 1% tolerance on the 168500 budget, and the playlist check adds about 320 bytes, which put the Build over. Set the budget to 172000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): open media only through self-contained media demuxers Every ffprobe and ffmpeg input that cloud render offload, the publish proxy bake and Studio's media helpers open now carries a demuxer whitelist built from the supported media extensions: MP4/MOV/M4A/AVIF, Matroska/WebM, MXF, AVI, MPEG-PS/TS, FLV, ASF, Ogg, WAV, MP3, AAC, FLAC, AIFF and the still-image formats. Playlist, manifest and concat demuxers can no longer open, whatever a file's bytes say. The proxy's own concat step is left as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): keep media probe argv flat, and expect the demuxer list in loudness args Two probe argv literals built from nested spreads are flat again, so "--" stays the visible second-to-last entry the argv contract checks. The normalize-audio test expects the demuxer list before the input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): play and present answer only local host names and allowed hosts play and present listen on every interface. Each request now passes the same Host check preview uses: localhost, loopback addresses and this machine's own addresses and names are answered, and any other host name gets a 403 naming HYPERFRAMES_PREVIEW_ALLOWED_HOSTS until it is listed there. Phones and other machines on the network still open them by LAN address or .local name. * fix(cli): a local render of a received composition leaves out files outside the project When the composition a local render opens is listed in the project's received-files record, hyperframes render (full and range) no longer brings in files outside the project. It prints one line naming the references it leaves out and why. An unreadable record counts as received. A project whose entry is the person's own, or that has no record, renders exactly as before. * fix(cli): received-render scan reads safely and treats an unreadable record as unknown The scan behind the received-composition notice skips a file it cannot read, finds url() references with a linear forward scan, and reads at most 2 MB of each file. An unreadable received-files record no longer counts as everything received for local render: the render keeps outside files and names the record it could not read. Publish and cloud upload still treat it as received. The notice now says the render stops on a sub-composition outside the project rather than leaving it out. * fix(cli): the studio render of a received composition leaves out files outside the project The Studio render route applies the same rule as hyperframes render: when the composition it renders is listed in the received-files record, the job does not bring in files outside the project, and the server log names the references it refuses. * chore(cli): name the unreadable received-files record helper without a comment * fix(cli): local render refuses outside files when any composition it plays was received The received-file rule for local render (CLI and Studio) now checks every page and stylesheet the render pulls in, not only the entry, so an own index.html that plays a received scene also reads nothing outside the project, and the notice names the received file. An unreadable, truncated or empty received-files record refuses outside files too, as publish and cloud upload do, and the notice names the record it could not read. * fix(cli): decide a received render from the files the compiler reads Local render (CLI and Studio) now leaves outside-file handling as it is for a project with no received-files record or an empty one, without scanning anything. When the record lists files, the compiler's own read list for the composition decides: the bundler runs out of process with a deadline and reports every project file it reads, so stylesheet imports and files past any scan limit count. A received file in that list, a build that fails or runs past its deadline, or an unreadable record refuses outside files. The scan that names refused references in the notice is advisory only: it guards every file system call, tracks visited files by real path, and caps the files and bytes it reads. * fix(cli,producer): decide a received render with the render compiler's own composition traversal The producer exports renderCompositionFiles, which walks data-composition-src with the same resolution, normalization and private file rules the render's sub-composition pass uses; that pass now calls the same helper. The received-render decision adds those files to the bundler's read list, so leading-slash and percent-encoded references the render reads count. The advisory scan resolves compositions the same way and reads template contents. * fix(cli): refuse outside files in a local render whenever the project has received files A local render (CLI and Studio) reads nothing outside the project when the project's received-files record lists any file, or cannot be read. No static list matches what a render consumes: the page loads its stylesheets and scripts through the browser at capture time, and scripts can load more, so the decision no longer depends on one. The reference scan stays only to name what the notice says is left out. This drops the out-of-process bundler read list and the producer composition walk added for that decision. * fix(cli): refuse outside files only when a received file can load other files A local render (CLI and Studio) reads nothing outside the project when the received-files record cannot be read, or lists a received file that can reference others: an .html, .htm, .css, .js, .mjs, .cjs or .svg name, or content that reads as HTML, SVG or CSS. A project that only received images, video, audio or fonts keeps bringing in outside files as before. * fix(cli): keep outside files only when every received file is positively media, a font or an image A local render keeps bringing in outside files only when each file the received-files record lists has a known media, font or image extension and starts with that type's signature bytes. Any other received file, a listed file that is missing or unreadable, or a mismatch between name and content refuses outside files. An ancestor record's entries now match a subfolder whose name is spelled in another Unicode form; the entry keeps its own spelling on disk. * fix(producer,core): a sub-composition must be an .html file The render compiler and the runtime load a data-composition-src only when it names an .html or .htm file. Any other file, such as an image or video, is refused as a page: render stops naming it, and the runtime reports the load failure without fetching it. * fix(producer,cli): the render and static file servers forbid type sniffing Both servers send X-Content-Type-Options: nosniff with every response, so the browser loads a file only as the type its extension names: an image or video cannot run as a script or apply as a stylesheet. .cjs is served as JavaScript. * test(cli): a received media file in a composition slot is refused as a page * test(cli): an empty nested received-files record cannot hide an outer record's received page * fix(cli): a received media file reached under another name refuses outside files The received-render decision now compares file identities, not names. It walks the project once, bounded by entry count and time, and refuses outside files when a hardlink or a symlink with a name that is not media reaches a received file, or when the walk cannot finish. A received file with no identity matches nothing, as in the received files check. * fix(cli): compare received files by link target and keep outside files for an empty record A received media file and every other project name are now compared by the identity of the file they reach with links followed. A linked folder that leads outside the project, or a file whose identity cannot be read, counts as unchecked and refuses outside files. An empty received-files record keeps outside files without walking the project. * chore: raise the producer unpacked size budget for the composition file checks --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c4d60c347f |
fix: Studio media routes refuse cross-site load, CLI escapes terminal text, batch outputs stay in their folder (#7779)
* fix(cli): batch render outputs stay inside the --output folder A row value may still name a subfolder of the folder written before the template's first placeholder, but a value that resolves outside it stops the batch before any folder is made or file is written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): project text shows control characters as visible escapes compositions, lint, snapshot and info --media print composition ids, sources, element ids, lint messages and media paths through one helper that writes C0, DEL and C1 control characters out as \xNN, so they reach the terminal as text. The CLI's own colors are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): waveform and peaks key one cache entry per file and refuse other sites Both caches are keyed on the resolved project-relative path, so another spelling of the same file (a doubled or trailing slash) reads the cached peaks instead of decoding again. Waveform and peaks requests that another site makes are refused the way thumbnail requests already are; the Studio page asks for both as itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): preview stills run at most four at a time A video's stand-in still is made through a small job queue: four at once, 32 more waiting, and a 503 with Retry-After beyond that. A waiting request whose client goes away leaves the queue without starting ffmpeg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): batch output folder check keeps backslash names and row-named paths A trailing backslash counts as a separator only where it is one, and the check compares path segments. A template that starts with a placeholder names no folder, so each row's value is the whole output path as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): lint header shows control characters in file names as escapes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): a finished or in-progress still never waits for a still slot Only a still that is neither on disk nor already being made takes one of the four slots, through a hook resolveStill gives the route. Waiters queue without a cap and nothing answers 503, since a poster is never asked for again. A waiter whose client leaves still never starts ffmpeg; a request that shared that waiter's still tries again on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: raise the studio-server packed budget to 172000 main already packs about 170 KB against a 168500 budget; the request guards, still slots and cache-key change here add about 550 bytes. * fix(core,studio-server): a preview served to another site offers no editing port When the Studio server answers a preview document to another site's request, it now marks the document, and the runtime's editing agent ignores every connect in a marked document. The Studio's own frames, which load the preview from the same origin, keep the editing port. The marked copy carries no ETag, so it is never revalidated in place of the unmarked one. * fix(studio-server): a media still stops when no request waits on it Each still job now counts the requests waiting on it. A request whose connection closes leaves the job, and when the last one leaves, the job's ffmpeg is killed and the job is forgotten, so the next request starts afresh. A caller that passes no signal keeps the job running, and a request that has already closed starts nothing. * test(studio-server): group the still cancellation tests after the real-ffmpeg still test * fix(studio-server): a preview framed by another site is never revalidated A frame load of a preview from another site now drops If-None-Match and If-Modified-Since before the route answers, so it always gets a fresh, marked document instead of a 304 that could reuse the unmarked copy a browser cached for the Studio's own page on the same site. Subresource loads keep their validators. * fix(cli): check findings and keyframes headers show control characters as escapes check prints each finding's message, source file, selector and fix hint, and keyframes prints each composition's name and source, through terminalText. * test(studio-server): a request sharing an abandoned still waiter gets its still * chore(studio-server): raise the unpacked size budget for the still job slots and cross-site guards * fix(cli): layout and contrast lines in check show control characters as escapes --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0248ea033c |
fix(studio-server): history lock records are replaced, never written through links (#7821)
* fix(studio-server): replace lock start records by rename The owner lock's start records (owner.pid.start, owner.pid.evict.start) and the daily prune stamp are written through replaceFileAtomically: an exclusive temp sibling renamed over the name. A symlink, hard link or other entry already at that name is replaced rather than written through. Lock files (owner.pid, its start record, owner-url.json) are read with O_NOFOLLOW and O_NONBLOCK and only when they are regular files, so a link is not followed and a FIFO is not waited on. * fix(studio-server): clear lock records before replacing them The start records and the daily prune stamp are removed before the rename, so a symlink to a read-only file or a read-only file at that name no longer fails the write. The prune stamp is read without following links or waiting on a FIFO, like the other lock files. |
||
|
|
477a3aea13 |
fix(cli): upload archives always leave out env files and private records (#7796)
publish, cloud render and feedback --file-issue build their archive from a walk of the project folder that only consulted .hyperframesignore, so a rule re-including dotfiles also uploaded .env files. The walk now leaves out env files, Git data and Studio's private records whatever the ignore rules say, and reports each one as left out with the reason "private". Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
870b1fa4dc |
fix(cli,studio-server): received-file guard covers subfolders and spellings; playlists named as media never reach ffmpeg (#7771)
* fix(cli): a subfolder of an imported project keeps its received-files record Publish, cloud render and feedback now read the received-files record at the nearest folder at or above the one they stage, so staging a subfolder of an imported project still leaves out the outside files its received files reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a received file counts under any spelling of the same file on disk The received-files lookup now also matches a project file that is the same file on disk as a listed path, so a name respelled in letter case on a case-insensitive disk keeps its received status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): cloud render prepares only the GIFs staging kept The entry GIF prep before a cloud render upload now reads only the staged copies it is handed. An image whose source staging left out keeps its reference as written and is never read from disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): never hand a playlist named as media to ffmpeg A media file whose first bytes are an HLS playlist, an XML manifest or a concat script now stays out of ffprobe and ffmpeg: cloud render leaves it in the zip as authored, the media probe reports it as not media, and the proxy copy refuses it. Real media never starts with these bytes, so it probes and transcodes as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): catch playlists with control bytes, and keep them from stills and audio probes A text playlist or concat script is detected whatever bytes follow its first line; only markup must be all text. A still frame and the audio probe behind waveforms, peaks and loudness now refuse a file the probe reads as not media, as the proxy copy already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a parent folder's state the CLI cannot read never marks a project received The walk up for a received-files record now skips a parent whose record cannot be reached. Only a record file that is there but cannot be read or parsed counts every file as received. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a drive that reports no file ids matches no received file by identity Some network and virtual drives report a file id of 0 for every file, so the same-file match now gives such a file no identity instead of matching it to every listed file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(studio-server): read a media file's first bytes with a read stream The playlist check reads the first 64 bytes through a bounded read stream instead of a raw file descriptor, and the audio-track probe's doc comment sits on its function again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(studio-server): raise the packed size budget for the media playlist check Main packs @hyperframes/studio-server close to the 1% tolerance on the 168500 budget, and the playlist check adds about 320 bytes, which put the Build over. Set the budget to 172000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): open media only through self-contained media demuxers Every ffprobe and ffmpeg input that cloud render offload, the publish proxy bake and Studio's media helpers open now carries a demuxer whitelist built from the supported media extensions: MP4/MOV/M4A/AVIF, Matroska/WebM, MXF, AVI, MPEG-PS/TS, FLV, ASF, Ogg, WAV, MP3, AAC, FLAC, AIFF and the still-image formats. Playlist, manifest and concat demuxers can no longer open, whatever a file's bytes say. The proxy's own concat step is left as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): keep media probe argv flat, and expect the demuxer list in loudness args Two probe argv literals built from nested spreads are flat again, so "--" stays the visible second-to-last entry the argv contract checks. The normalize-audio test expects the demuxer list before the input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a92498b903 |
fix(studio-server): save an edit Windows briefly holds without freezing the app (#7744)
* fix(studio-server): save an edit Windows briefly holds without freezing the app * fix(studio-server): keep later edits behind a held one, one backup per replay * fix(studio-server): send a held cut again, and keep the sync retry for rollbacks |
||
|
|
b746a0ee13 |
fix: check, render and downloads work on a drive without hard links (#7737)
* fix(studio-server): check and render keep their history on a drive without hard links The history lock had its own list of the errors that mean a drive cannot hard-link, and it lacked EISDIR, which Windows returns on a Google Drive folder. Every check report and render record there failed. The lock now uses core's list, the one owner, which also gains ENOSYS from the lock. * fix(engine): downloads and plan blobs publish on a drive without hard links The producer's plan publisher kept a third list of no-hard-link errors without EISDIR, and the downloader had no fallback, so both failed on a Google Drive folder. Both now use core's cannotHardLink; the downloader copies into an exclusively created file, so it still never overwrites. * fix(engine): a download on a drive without hard links publishes atomically Instead of copying into an exclusively created file, the fallback renames the staged download into place under the cache path lock when nothing is there yet, so a killed run never leaves a truncated file to reuse. |
||
|
|
b5e9bc6893 |
fix(studio-server): an edit to a read-only project file is refused and leaves it unchanged (#7731)
* fix(studio-server): an edit to a read-only project file is refused and leaves it unchanged * test(core): read the refused file without a stat check first |
||
|
|
2c2b399bfa |
fix(producer): local renders bring in only media, font, CSS and JS from outside the project (#7647)
* fix(producer): local renders bring in only media, font, CSS and JS from outside the project Local renders (`render`, range render, `benchmark`, the Studio server and the Vite Studio adapter) run with allowOutsideProjectAssets, which copied every existing file that markup named outside the project into compiled/hf-ext, of any type and from any folder, and served project links that lead outside without looking at where they lead. Publish already applies a policy here: outside references are kept, private locations are left out, and only image, video, audio, font, CSS and JS files are copied. Local renders now follow the same policy. The publish predicates (private location, copied file type, left-out wording) move from the CLI to a new `@hyperframes/studio-server/outside-file` subpath, since the producer cannot import the CLI and already depends on studio-server. The CLI re-exports them, so publish behaves as before. The media extension sets move with them because the copied-type list includes them. The producer decides with one predicate, `outsideAssetRefusal` in utils/paths.ts, and applies it wherever allowOutsideProjectAssets lets an outside file in, so no entry point can skip it: - collectExternalAssets: src/href/url() references, which covers <a href> and <link href> - dropMediaOutsideProject: video/audio/image sources in any spelling the media resolver accepts (file: URLs, percent-encoding), so nothing probes or extracts them - the render file server: project links that lead outside - the distributed plan's project copy: the same links (range render) - GIF/HEIC prep and sub-composition links: private locations only, since those inputs are converted or compiled rather than copied as they are Each left-out file logs the publish wording with "left out of the render". To reproduce on main: a project whose index.html references ../../.ssh/id_key through <link href>, <a href> and url(), with a project link to a file in .ssh, rendered locally, gets those files copied into compiled/hf-ext and served. Comment lines: the four in studio-server's outsideFile.ts moved verbatim from the CLI files they replace. Two are new, in utils/paths.ts. The one on outsideAssetRefusal states the policy once, so its six call sites carry no comment. The one on refusesOutsideLink says its boolean means "refused, and already warned", which the name alone does not say. Comment ratchet is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep outsideFileType as a re-export of the shared module The base repository's deletion guard rejects removing a file that exists on main unless git pairs it as a rename. outsideFileType.ts moved into studio-server/outside-file with enough added around it that git no longer pairs the two, so CI's "Reject accidental file deletions" step failed. The file stays as a two-name re-export and publish keeps importing from it, so publishProject.ts and its file-type test are back to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(producer): raise the unpacked size budgets for the outside-file policy CI's packed-manifest check measured @hyperframes/producer at 3,244,665 bytes unpacked (budget 3,210,000) and @hyperframes/studio-server at 653,506 (budget 646,000), both just past the 1% tolerance. Both packages were already at the edge on main. Measured locally with npm pack --dry-run, main is 3,237,162 for producer and 652,502 for studio-server, so studio-server on main is already at its ceiling. This branch adds about 7.9 KB unpacked to producer, because the new checks sit in the compiler, render stages and file server, which each producer entry bundles. It adds about 5.5 KB to studio-server for the new outside-file entry and its declarations. No source maps, tests or assets were added to either tarball. The budgets go to 3,245,000 and 654,000, just above CI's measurements, the same way #7579 raised producer's budget for the project-folder checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(producer): apply the outside-file policy to embedded local fonts A project font file that links outside the project is now left out of font embedding with the same warning the file server gives, instead of being inlined into the compiled HTML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0bce3315e6 |
fix(studio): a file held open or read-only answers 423 or 403 with a reason, not 404 or 500 (#7649)
* fix(studio): a file held open or read-only answers 423 or 403 with a reason, not 404 or 500 * fix(studio): valid workflow name for the Windows held-file test * test(studio): release the held file before the held-file test removes its folder * fix(studio): the code editor's save toast names a held or read-only file |
||
|
|
89a7aa3004 |
fix(cli): copy only media, font, CSS and JS files from outside the project (#7636)
* fix(cli): copy only media, font, CSS and JS files from outside the project Publish, cloud render and feedback now copy an outside reference into _ext/ only when its extension is an image, video, audio, font, CSS or JS type, taken from studio-server's MIME map (new ./mime subpath; .avif added). Anything else outside the project is left out with a warning and a left_out entry whose reason is file_type; telemetry counts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep the new outside-type file under its package's comment share Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): copy the outside media cloud render re-encodes or converts The outside allowlist now also takes the video, audio and still-image extensions cloud render re-encodes or converts (.avi, .ogv, .aiff, .tif, .bmp and the rest), from one shared list offload imports too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4fad43db20 |
feat(studio): record the layer name on each history entry's target (#7586)
* feat(studio): record the layer name on each history entry's target * feat(studio): record the clip's name on timeline move and resize entries * chore(studio): drop doc comments the names already carry |
||
|
|
2a70733c15 |
fix: track local Studio sharing CTA interactions (#7566)
* fix: track local Studio sharing CTA intent * fix: tag local Studio and CLI share upgrade links with where they came from The local Studio share modal's Upgrade to Pro link opens /pricing?from=cli&entry=local_studio_share, and hyperframes share's source-files notice links /pricing?from=cli&entry=cli_share, so the pricing page can tell which link a visit came from and return the visitor to their terminal. The modal accepts its own pricing page with any query, still only on hyperframes.dev's two origins. share_upgrade_clicked carries cta=share_modal_upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: name the local Studio upgrade CTA and drop the explaining comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep the local Studio upgrade link's return page unchanged Only entry=local_studio_share is added to the local Studio share window's Upgrade to Pro link. from=cli would have told these buyers to go back to their terminal after checkout, but they return to a browser tab. hyperframes share's link keeps from=cli, as the CLI's other upgrade links do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a243169f8a |
fix: keep private project files out of preview bundles and local sharing (#7563)
* fix(core): keep git metadata and env files out of bundled HTML The bundler now checks every file it reads against the project's private paths (git metadata and env files, spelled directly or through a link) and leaves a refused reference as authored instead of inlining it. Bundle options gain a canRead predicate; Studio's preview passes its own private-file rule so the preview document matches what the file routes serve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): check capture read grants against the decoded path A capture page's read grant now looks at the path the way the static preview route decodes it, including encoded separators, so a URL that resolves to a dotfile or into a dot-folder gets no CORS grant. Ordinary project files keep loading in thumbnails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): accept local share requests only from loopback connections The local share routes already require loopback Host and same-origin headers. They now also require the connection itself to come from this machine, so a Studio bound to a network address still keeps sharing local to the person running it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): ask the bundler for Studio's private-file rule as plain data The preview route passed a fresh `canRead` callback on every build. A host that builds on a worker thread cannot send a function across, so it built on its own thread, and it could no longer share one build between two same-content requests. The bundler now takes `privateFiles: "studio"`, a plain string, and applies Studio's private-file rule itself. That rule (git metadata, env files, and the app's records under `.hyperframes/`) now lives in `@hyperframes/core/safe-path`, and studio-server reuses it. The `canRead` option is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): do not serve a preview main file linked to a private file When index.html (or <id>.html) is a link to an env file or into git metadata, the bundler refuses it and the route falls back to reading the main file from disk. That fallback now skips a candidate that is a private project file, by the same rule the file routes use. A main file linked from outside the project is still served. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(producer): never inline git or env files as render sub-compositions The render compiler resolved data-composition-src and inlined the file it named, so `data-composition-src=".env"` put the env file's text into the render page. It now refuses git metadata and env files with the same shared rule the bundler uses. The pre-render check names the refused reference and stops the render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: raise the inspector unpacked size budget to 3,722,000 bytes The inspector already sat about 36.8 KB over its 3,684,092 budget, just inside the 1% tolerance. Moving Studio's private-file rule into core added a few hundred bytes to the bundles it ships, which pushed it to 3,721,419 bytes and over the tolerance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ffb13c3b62 |
fix(studio-server): load fonts and modules only in the Studio's own preview frames (#7553)
* fix(studio-server): let opaque preview frames load project fonts and module scripts A preview framed with an opaque origin, such as the Compositions hover preview, makes its font and module-script loads in CORS mode with `Origin: null`. Without a CORS grant they failed: the frame fell back to a system font and module scripts never ran. The preview asset route now answers those two loads with `Access-Control-Allow-Origin: null`, `Vary: Origin` and `X-Content-Type-Options: nosniff`. The grant is chosen by `Sec-Fetch-Dest`, which the browser sets and page script cannot: `font` for a font file and `script` for a .js/.mjs file, served with the matching content type. A page's own `fetch()` is always `empty`, so it still gets no grant and composition script still cannot read project files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(studio-server): keep opaque-frame grant comments within the package share Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): let opaque preview frames load project fonts Narrow the opaque-frame grant to fonts. Every sandboxed frame sends the same `Origin: null` and fetch metadata, so a CORS grant for module scripts could not be limited to frames the Studio itself serves. Module scripts stay unloaded in the hover preview for now; fonts keep their grant, and `Sec-Fetch-Dest: script` loads of .js/.mjs get none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): load fonts and modules only in the Studio's own preview frames A CORS grant to `Origin: null` reaches every sandboxed frame, whichever page it sits in. The grant now lives on a per-project path instead: `/projects/:id/preview/~<token>/...` serves exactly what `/preview/...` serves, and only there do font loads (`Sec-Fetch-Dest: font`, a font file served as `font/*`) and module-script loads (`script`, a .js/.mjs file served as `text/javascript`) from an opaque frame get `Access-Control-Allow-Origin: null`. The plain path gets no grant. The token is an HMAC-SHA256 of the project id under a random per-server secret, compared in constant time. The Studio reads it from `/projects/:id/frame-token`, which refuses cross-site and same-site requests, and the Compositions hover preview frames its composition at the token path. Documents served there are re-based under the token and carry `Referrer-Policy: no-referrer`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(studio-server): raise the packed size budget for the preview frame tokens The per-project frame-token path adds server code to the package, and the packed tarball measured 166941 bytes in CI against a 164800 budget. Set the budget to the measured size plus about 1% headroom. — Rames Jusso Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
84799bdc59 |
fix: take helper programs only from install locations, never the project folder (#7524)
* fix(cli,parsers): take helper programs only from install locations, never the project folder FFmpeg, FFprobe, whisper-cli, parakeet-mlx, Python and system Chrome are now found through one shared rule: an absolute PATH entry outside the working directory, or a fixed install dir. A relative PATH entry and any folder inside the working directory are skipped, on every platform. Windows walks PATH itself instead of asking `where`, which lists the working directory first. FFmpeg discovery no longer falls back to `.hyperframes/bin` or to an installer package in the project's node_modules; an installer package installed next to HyperFrames still works. The env overrides are unchanged. The CLI skill reference stops suggesting the project-local folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): give the PATH-lookup tests a fixed PATH on Windows Windows now walks PATH instead of running `where`, so tests that faked `where` output found the runner's real python and cmake. Both tests now set PATH to a temp folder holding only the programs they expect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: report a missing helper program instead of running it by bare name When no trusted FFmpeg or FFprobe is found, the engine, the producer's probes and Studio's waveform, peak and audio-track helpers now report "not found" with the HYPERFRAMES_FFMPEG_PATH / HYPERFRAMES_FFPROBE_PATH hint instead of handing the bare name to the OS lookup. Callers that degraded on a missing binary still do: runFfmpeg returns a spawn_error result, the GPU and version probes report none, and Studio's audio helpers fail soft. The Lambda handler names its bundled ffmpeg and ffprobe by path, since they live under the task root, which is the working directory. brew, git and cmake for the whisper.cpp install, and the clipboard tool for `hyperframes add`, run by the absolute path the trusted lookup approved. The media-use engine gets a PATH holding only trusted folders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(engine): fail a missing FFmpeg the way a failed spawn always has Throwing from getFfmpegBinary turned every caller's missing-binary path into a synchronous throw: the streaming encoder's "failure result, not a throw" contract broke, and unit lanes that run without FFmpeg crashed at module load. With no trusted copy the getters now return an absolute path inside HyperFrames' own install that is never created, named for the override to set. Spawning it fails with ENOENT exactly as before, and the OS still never looks the bare name up. The call-site guards and fixture changes that the throw needed are reverted. The whisper install tests match git and cmake by name and skip the brew case on Windows, where the lookup walks the real PATH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(engine): pin the found FFmpeg before the HDR test looks it up as macOS on Windows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f36463e292 |
fix(core): fall back to a direct write when link() is denied with EACCES (#7474)
* fix(core): fall back to a direct write when link() is denied with EACCES On Android app data (Termux, SELinux enforcing), link(2) fails with EACCES in a folder the temp file was just written to. createFileAtomically() and the studio history owner lock treated that as fatal, so `hyperframes init` left a half-scaffolded project and every render logged a recordRenderSuccess failure. Both now take their existing exclusive direct-write path, as they already do for EPERM. Fixes #7473 * fix(share): treat EACCES as no hard links in the project share lock Same Termux/SELinux link() denial as core and the studio history lock: the share lock's link-then-exclusive-create fallback now covers it too. Folds the Android note into the existing comment so no file's comment share rises. |
||
|
|
b96c82b785 |
fix(cli,studio-server): limit registry installs and Studio file writes to project content folders (#7523)
* fix(cli,studio-server): limit registry installs and Studio file writes to project content folders Registry blocks and components now install only into the project's compositions, components and assets folders (plus models/ and lib/, which the catalog uses, and notes at the root). node_modules, agent instruction files and programs or scripts are refused at any depth, matched case-insensitively with either separator, and checked again on the path the project's own links lead to. Studio's file routes never read or write git metadata or env files, and every route that writes, renames, deletes, copies or uploads a request-named path refuses the project folder itself, node_modules and hidden files or folders other than .hyperframes/ and .media/, on both the spelled and the link-resolved path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(cli,studio-server): trim comments added by the write allowlist Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli,studio-server): trim path segments in linear time The trailing dot/space and :stream trims used anchored regexes that backtrack quadratically on long runs of spaces, dots or colons in a request path. Trim with a plain scan instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): refuse example dependencies in add and allow only TEMPLATE.md at the root - addToProject now refuses a block or component that depends on an example, not only an example asked for by name. The installer lets an example write at the project root, so a dependency must not carry that through. - The only file a block may write at the project root is TEMPLATE.md, the catalog's usage note. Any other .md or .txt name could be one a tool loads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
80cda85d76 |
fix(studio-server): run thumbnail captures in an opaque origin (#7528)
* fix(studio-server): run thumbnail captures in an opaque origin The thumbnail renderer loads each composition as a top-level page, so its scripts ran on the Studio's origin. The capture document (`?hf-capture`) now carries `Content-Security-Policy: sandbox allow-scripts`, so those scripts get an opaque origin. An opaque page's CORS-mode loads fail without a CORS header. The renderer that opened the page is trusted, so it adds `Access-Control-Allow-Origin: null` itself, over that page's own DevTools session, to the loads a frame needs: - fonts, module scripts and images; - the `.html` scenes, `.json` and `.cube` files the runtime fetches. Only GETs of the project's preview files qualify, matched by file type. Both thumbnail renderers do this: the CLI's and the Vite dev server's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): let an opaque capture wait for a video's preview copy A video the browser cannot decode is drawn from its `?hf-proxy=` copy. The runtime waits for that copy with a ranged fetch, preflighted when it carries the priority header. In the opaque capture page both failed, so each such thumbnail fell back to a still after about five seconds of retries. The renderer now answers that preflight itself. It also exposes the copy's status headers to the wait, for video files under the preview path only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(studio-server): keep capture-load comments within the package share Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): keep video pixels and project fetches in opaque thumbnail captures - Media loads: the renderer now grants them, and a capture document loads the project's own videos with `crossorigin="anonymous"`. Color grading and shader textures can then read their pixels. - Fetches: every GET of the project's preview files is granted, except a dotfile or dot-folder path such as `.env` or `.git/`. This covers the models and fonts that registry blocks fetch at runtime. - Opt-in: the capture sandbox is now a `createStudioApi` option, `sandboxThumbnailCaptures`, off by default. The CLI Studio server and the Vite dev server turn it on, because their thumbnail renderers install the grant. Another app keeps its current capture documents until its renderer does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(shader-transitions): prepare transitions when IndexedDB is denied An opaque-origin document, such as a sandboxed preview or thumbnail capture, has no IndexedDB, and opening it throws. The snapshot cache now treats that as no cache, so the transitions still prepare and draw. Thumbnail captures also grant a CORS read of a missing preview file, so a fetch() sees its status as a same-origin page would. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(studio-server): leave a video with another host's <source> out of capture CORS A video whose <source> child points to another host now keeps its plain load in a thumbnail capture. Adding crossorigin to it would make a CDN that sends no CORS headers refuse the video, leaving the clip blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |