feat(aistudio): add AI Studio provider (network-first GenerateContent parsing + DOM fallback)#41
Open
w-winter wants to merge 1 commit intonicobailon:mainfrom
Open
feat(aistudio): add AI Studio provider (network-first GenerateContent parsing + DOM fallback)#41w-winter wants to merge 1 commit intonicobailon:mainfrom
w-winter wants to merge 1 commit intonicobailon:mainfrom
Conversation
… parsing + DOM fallback)
w-winter
commented
Feb 15, 2026
| ```bash | ||
| surf scroll.bottom | ||
| surf scroll.top | ||
| surf scroll.top |
Author
There was a problem hiding this comment.
Apologies for the stray whitespace deletions here and there
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.
This adds an AI Studio (aistudio.google.com) provider so
surf aistudio "<prompt>"can drive the Playground UI via the existing Chrome extension + native host bridge, returning the model’s final answer directly in the terminal. The motivation for adding this (over the existing Gemini provider) is that, when accessed via AI Studio, the Gemini models are not as nerfed as they are from the consumer-facing Gemini experience. For Gemini 3 Pro the difference can be very meaningful with certain prompts. The downside is aggressive per-day rate limiting for the Gemini 3 Pro and Gemini 3 Flash models when accessed this way.Response extraction is network-first by parsing the
MakerSuiteService/GenerateContentRPC payload from captured network entries, with a DOM-based fallback (waitForResponse) to keep the provider working when network capture or RPC parsing fails. The host log redaction is also hardened to avoid writing prompts/model outputs and large payloads to disk.Summary of changes:
native/aistudio-client.cjsCDP-driven client: open new chat, best-effort model selection, enable Raw Markdown view, type + submit prompts, network-first GenerateContent parsing (final-response only) with DOM fallbackREAD_NETWORK_REQUESTSfull path (plusurlPatternfiltering)AISTUDIO_QUERY, optionally prepend page context (--with-page), filter network polling to GenerateContent viaurlPattern, and hardenredactForLogto omit/summarize high-volume sensitive fields (request/response bodies, page text, screenshots, network dumps)surf aistudiocommand/help, make--jsonalways emit valid JSON via a shared formatterREADME.md+skills/surf/SKILL.mdwith AI Studio examples, default model behavior, and rate-limit cautiontest/unit/cli-json-output.test.ts)