feat(types): add the extended Browser Run snapshot formats #8676
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 244 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8676"
general
weight: 0.35
NuroDev
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.