Skip to content

feat(export): export a session as one self-contained HTML file#227

Open
tridha643 wants to merge 2 commits into
mainfrom
stitch-html-snippets-issue
Open

feat(export): export a session as one self-contained HTML file#227
tridha643 wants to merge 2 commits into
mainfrom
stitch-html-snippets-issue

Conversation

@tridha643

Copy link
Copy Markdown
Contributor

A session can now be saved and shared as one self-contained HTML file: GET /api/sessions/:id/export and the new sideshow export CLI command render every post into the viewer's card column, with each surface still embedded as a sandboxed srcdoc iframe so the core isolation rule holds inside the saved file. The /s/:id renderers and the export now share a single renderSurfaceDocument dispatch, so the two paths can't drift when a surface kind or renderer option changes. Image surfaces are inlined as data URIs (allowlisted raster types only, 32 MB per export, shared via INLINE_IMAGE_TYPES in types.ts), sessions over 4 MB of surface text get a 413 instead of an unloadable file, and ?theme=/?mode=/?download=1 pin the look or force an attachment download. Export never creates a session, and there's deliberately no MCP tool — MCP agents use the HTTP route. Covered by unit tests (test/export.test.ts, CLI tests) and a new Playwright spec (e2e/export.spec.ts); the agent guide documents the workflow.


Compound Engineering
Claude Code

tridha643 and others added 2 commits July 21, 2026 14:54
GET /api/sessions/:id/export and the new `sideshow export` command render
a whole session into a single shareable HTML file styled like the viewer's
card column. Every surface that becomes HTML is embedded as a sandboxed
srcdoc iframe via the same renderSurfaceDocument dispatch /s/:id uses, so
the isolation rule holds inside the saved file. Image surfaces inline as
data URIs (allowlisted raster types, 32 MB cap per export); sessions over
4 MB of surface text are rejected with a 413.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
npm audit's high gate started failing on GHSA-h67p-54hq-rp68 /
GHSA-52cp-r559-cp3m (js-yaml merge-key DoS), pulled in transitively by
@changesets/cli. Bump the in-range copy to the patched 4.3.0 and override
read-yaml-file to ^2.1.0 (same API, depends on js-yaml ^4) since every
3.x js-yaml is vulnerable with no patched release. Also picks up the
in-range hono and body-parser advisory fixes.

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

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedhono@​4.12.31991009796100

View full report

@tridha643

Copy link
Copy Markdown
Contributor Author

@greptile

@tridha643
tridha643 requested a review from benvinegar July 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant