Repository navigation
feat(types): add the extended Browser Run snapshot formats - #8676
Merged
harrishancock merged 2 commits intoNov 23, 2026
Merged
Conversation
|
This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting |
The `/snapshot` quick action now returns PDFs, links, scraped elements, and AI-extracted JSON alongside HTML, screenshots, Markdown, and the accessibility tree. Add the four formats to `BrowserRunSnapshotFormat` and the options each one uses to `BrowserRunSnapshotOptions`, reusing the per-action option types so the shapes cannot drift from the standalone actions. `BrowserRunSnapshotSuccessResponse` gains `pdf`, `links`, `scrape`, and `json`. Regenerate `generated-snapshot/` and cover the new formats and the internal `crawl` format in the type tests.
BernardoPe
force-pushed
the
browser-run-snapshot-formats
branch
from
November 19, 2026 15:58
ee245e2 to
e56a2ad
Compare
petebacondarwin
approved these changes
Nov 19, 2026
NuroDev
approved these changes
Nov 20, 2026
jasnell
enabled auto-merge
November 20, 2026 17:38
The extended snapshot formats were hand-edited into types/generated-snapshot, so the snapshot kept two blank lines per declaration boundary and the .ts copies declared BrowserRunSnapshotOptions without `export`. `just generate-types` does not emit either, which failed the check-snapshot job. Apply the diff produced by the generator so the committed snapshot matches bazel-bin/types/definitions.
auto-merge was automatically disabled
November 21, 2026 03:47
Head branch was pushed to by a user without write access
harrishancock
approved these changes
Nov 23, 2026
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.
The Browser Run
/snapshotquick action now returns four more formats from a single page load:pdf,links,scrape, andjson. The binding types still only allowcontent,screenshot,markdown, andaccessibilityTree, so TypeScript rejects valid calls.What changed
BrowserRunSnapshotFormatgainspdf,links,scrape, andjson.BrowserRunSnapshotOptionsgains the options those formats use, reusing the per-action types (BrowserRunScrapeOptions['elements'],BrowserRunPDFOptions['pdfOptions'],BrowserRunLinksOptions['visibleLinksOnly' | 'excludeExternalLinks'],BrowserRunAccessibilityTreeOptions['interestingOnly' | 'root']) plusprompt/response_formatandcustom_aifromBrowserRunJsonBaseOptions, so the shapes cannot drift from the standalone actions.BrowserRunSnapshotSuccessResponsegainspdf,links,scrape, andjson.elementsandprompt/response_formatstay optional and are documented as required only whenformatsrequests the matching format, since the requirement depends on the array contents and cannot be expressed in the type.Tests
types/test/types/browser-run.ts: a snapshot call using all four new formats and their options, a response-shape check, and a@ts-expect-errorproving the internalcrawlformat is still rejected.Notes
generated-snapshot/was updated by re-running the printer and prettier steps over the edited defines rather thanjust generate-types, since this checkout has no bazel build. The diff is confined to the Browser Run block, but CI's snapshot check is the authoritative confirmation.accessibilityTreeis declared non-nullable although the API returnsnullwhenrootmatches nothing, and scrapetext/width/heightare declared required although SVG elements omit them. Both are separate follow-ups.