Skip to content

feat(browser-rendering): Add Zod schemas and enhanced request options#325

Open
akinazuki wants to merge 2 commits intocloudflare:mainfrom
akinazuki:main
Open

feat(browser-rendering): Add Zod schemas and enhanced request options#325
akinazuki wants to merge 2 commits intocloudflare:mainfrom
akinazuki:main

Conversation

@akinazuki
Copy link

Summary

  • Add browserRequestZodObject Zod schema with support for authenticate, gotoOptions, cookies, userAgent, and setExtraHTTPHeaders options
  • Add screenshotRequestZodObject extending the base schema with viewport and screenshotOptions (including captureBeyondViewport, clip, encoding, fullPage, type, etc.)
  • Support returning screenshot as base64 text when screenshotOptions.encoding is set to 'base64'
  • Propagate dynamic mimeType based on screenshot type (png, jpeg, webp)

Introduce reusable Zod schemas (browserRequestZodObject and screenshotRequestZodObject) and use them to validate params for get_url_html_content, get_url_markdown and get_url_screenshot tools. Replace inline param shapes with parsed schema spreads in requests, add logging for markdown requests, and improve screenshot handling by computing mime type from screenshotOptions.type and supporting base64-encoded responses when requested. Also include richer screenshot options and defaults for viewport/goto/screenshot settings.
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