Files
hyperframes/packages
Michael WangandClaude Opus 5.5 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>
2026-11-11 19:31:24 +00:00
..
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00
2026-11-11 16:46:12 +00:00