Files
yetone 38594b5aee gemini-web 0.1.0: the Gemini web app, one streamed call to its own endpoint per request
@jtbbtnt54249 on X (11-18) asked for a Gemini web plugin: the community
@dorokuma/magpie-gemini-web is "太慢了根本用不了". The MCP in their
screenshot is a Gemini web "custom app" remote connector: Google's servers
call a public MCP URL, so it can't serve a local agent and is not a route.

Why the existing one is slow: it goes through a separate local Go backend
that fetches the XSRF token before every request, uploads prompts over
128KB as a file, sleeps 2s between retries, and holds replies behind a
tool-fence gate and a slot limiter.

This package calls gemini.google.com the way the app's page does:
- the page's tokens (SNlM0e, cfb2h, FdrFJe) are read from /app once and
  kept 15 minutes;
- each request is one POST to StreamGenerate, the whole request inline in
  a temporary chat (slot 45, nothing kept in history), read as it
  streams and given back as SSE or a whole completion;
- tools are asked for as <tool_call> text (prompt.mjs and openai.mjs from
  doubao-work) and given back as tool_calls;
- signed in: a Chrome profile of the plugin's own opens at Google's
  sign-in, the user signs in themselves, the google.com cookies are read
  with Storage.getCookies on the browser target (nothing attached to the
  page) and the window closes. Set-Cookie renewals are saved back with
  client.auth.set; RotateCookies every ten minutes; signed out, rotate,
  then reopen the profile headless, then ask for a sign-in;
- a visitor (no account) gets Google's visitor model;
- models from the account's own picker (otAQ7b), fallback marked;
- prompts over 600K characters get 413 before they are sent (measured:
  315K fine, 900K ignored the request, 1.8M refused with error 3); error 3
  is named as a refusal with its likely causes.

Run:
- HOME=$(mktemp -d) bun test packages/gemini-web on mote: 28 pass. The
  fixtures are real StreamGenerate replies (a signed-in "pong" served as
  4 Hydrogen, a visitor's rivers text with its real chunks) and a real
  otAQ7b list, with the location Google guessed scrubbed.
- Broken by hand: not sending `at` turns two tests red.
- Full suite on mote, HOME=$(mktemp -d) bun test at ea805ecc plus this change (before the root README line): 9091 pass, 20 skip, 0 fail.
- bun scripts/check.mjs: registry.json and gemini-web ok.
- Real, through the plugin's fetch from Bun on mote, as a visitor: three
  "pong" requests, first text at 14.0s (reads the page), 7.9s, 6.9s; a
  tool request came back as Echo {"text":"391"} with finish tool_calls.
  Signed in, in the app's own page: first text about 3.5s.

Not tried: a real Google sign-in through the plugin's window (Google may
refuse a browser with a DevTools port open), whether DBSC stops
RotateCookies, thinking output, paid models (4 Carbon, 4 Neon). Said in
the README.

First publish of a new package: publish.yml can't publish it (no trusted
publisher yet), so magpie installs it from the dist branch until the
owner publishes it once and adds the trust.
2026-11-19 14:14:50 +08:00

21 lines
16 KiB
Plaintext

)]}'
177
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],{\"18\":\"r_eba8a47460a76636\",\"21\":[\"asdtkWyx0BVUQJ55eBpNvjqnNYxwiAWeeCUGBcDytC0\"],\"44\":true}]"]]
5143
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],null,null,[[\"rc_cbe156e871667e29\",[\"pong\"],null,null,null,null,null,null,[1],\"en\",null,null,[null,null,null,null,null,null,null,[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,null,null,null,null,null,null,null,[]]],[\"Earth\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dSCRUBBED\"],null,null,\"US\",null,null,null,null,null,false,null,null,null,null,\"en\",null,null,null,true,[null,[false,false,false],[false,false,false,true,false,false],false,[[[\"Academic - Other\",3.6566027E-5],[\"Coding\",0.0047765616],[\"Creative - Other\",6.9606246E-4],[\"Creative Writing\",0.0062274956],[\"Customer Support\",5.9680577E-5],[\"Daily Life Expert - Other\",2.9749834E-4],[\"Daily Life Personal - Other\",0.012238796],[\"Data Analysis\",7.913798E-6],[\"Emotional Support\",0.0010376282],[\"Engagement - Other\",0.09617307],[\"Events\",0.0037010005],[\"Finance / Accounting\",2.5545125E-4],[\"Fitness\",2.7213006E-5],[\"Games\",0.032687347],[\"General Info Seeking\",0.0698771],[\"Government / Law\",3.2684745E-4],[\"HR / Career Management\",1.0684955E-4],[\"Health\",0.0013718734],[\"Life Organizer\",0.015343721],[\"Lifelong Learning\",0.0051377923],[\"Marketing \\u0026 Advertising\",1.5487098E-4],[\"Meals / Nutrition\",2.8867606E-5],[\"Media / Entertainment\",0.03858377],[\"Multimodal Generation\",0.014970068],[\"News / Status\",0.003492183],[\"Personal Finance\",2.1750004E-4],[\"Professional - Other\",0.0020969831],[\"Sales / Order Fulfillment\",1.852516E-5],[\"School Work\",0.003995552],[\"Shopping\",3.0050002E-4],[\"Social / Roleplay\",0.052563407],[\"Sports\",0.0022424166],[\"Teaching\",3.1138377E-4],[\"Travel\",9.5403835E-4],[\"Troubleshoot Issues\",0.0023305137]],[[\"Action Execution / Device Control - Other\",0.0010581263],[\"Advice \\u0026 Opinion - Other\",1.7419884E-4],[\"Analyze Image Files\",0.010819459],[\"Audio Generation\",0.0013371494],[\"Brainstorming\",0.001310665],[\"Casual Interaction / Chat - Other\",0.02446192],[\"Casual Topic Chat\",0.02275599],[\"Classification\",6.855382E-5],[\"Code - Other\",1.9389122E-4],[\"Code Debugging\",3.706237E-5],[\"Code Explanation / QA\",3.9427483E-4],[\"Code Generation\",0.0012060025],[\"Compile\",0.0010742453],[\"Comprehension / QA\",0.010258929],[\"Continue / Add More\",0.0014172237],[\"Device / App Control\",0.0053148842],[\"Find Image\",4.1281506E-5],[\"Game\",0.046038385],[\"Image Edit\",0.0014275591],[\"Image Generation\",0.005869978],[\"Image Understanding - Other\",8.7820736E-5],[\"Information Gathering - Other\",0.002771539],[\"Mathematical Reasoning\",2.0180266E-4],[\"Media Execution\",0.0030772914],[\"Multimodal Generation - Other\",3.193296E-4],[\"Perspective\",1.4933689E-4],[\"Procedural Instruction\",4.1683548E-4],[\"Proofreading / Grammar\",4.3138723E-5],[\"Quiz / Test\",0.0026402562],[\"Reasoning \\u0026 Games - Other\",4.8267003E-4],[\"Recommendation\",8.918942E-4],[\"Share Sentiment\",4.5978493E-4],[\"Simple Pleasantries\",0.025048718],[\"Simple Search\",0.033451524],[\"Subjective Rewrite / Revision\",0.0015298126],[\"Synthesize Broad Topic\",0.0010250498],[\"Task Planning\",4.8624264E-5],[\"Text Analysis - Other\",3.5045872E-5],[\"Text Extraction\",0.0014324589],[\"Text Summarization\",0.0026276645],[\"Translation - Other\",8.4641564E-4],[\"Translation, En to Non-En\",0.00356676],[\"Translation, Non-En to En\",0.02047738],[\"Video Generation\",1.4522072E-4],[\"Visual Referencing\",5.785735E-4],[\"Writing \\u0026 Rewriting - Other\",0.0027552813],[\"Writing From Scratch\",0.01961354]],[[\"Output List\",0.007500472],[\"Output Outline\",5.125946E-5],[\"Output Table\",6.874714E-5],[\"Output Citations\",9.3464814E-7],[\"Output Format\",0.0071068886],[\"Change Length\",0.114683956],[\"Change Ordering\",9.382272E-5],[\"Change Structure\",0.0023307023],[\"Adopt Persona\",0.007961407],[\"Change Tone\",0.0026379393],[\"Rhyme\",2.2826256E-5],[\"Change to Specific Audience\",0.0015867657],[\"Change Tone / Style\",0.005672928],[\"Rephrase\",9.786978E-4],[\"Simplify / Condense\",0.00978237],[\"Factual / Logical Correction\",1.9885237E-4],[\"Attribute-Specific Correction\",0.00833049],[\"Pushback Circumvention\",0.0014117413],[\"Constraint Re-Statement\",0.0013818535],[\"Exact Resubmission\",0.0010319188],[\"Expand / Elaborate\",0.018284313],[\"Revise\",5.7333347E-4]],[[\"Positive\",0.015922986],[\"Negative\",0.012672394]]]],null,[[[[null,[null,0,\"pong\"]]]]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,\"4 Hydrogen\",true,[[[[1004,\"Longer\",5,null,[\"expand\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/expand/default/24px.svg\",null,true]],[1005,\"Shorter\",6,null,[\"compress\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/compress/default/24px.svg\",null,true]],[1001,\"Try again\",1,null,[\"refresh\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/refresh/default/24px.svg\",null,true]]]]],null,2,null,null,null,null,null,null,null,null,null,null,true,6,1]"]]
5143
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],null,null,[[\"rc_cbe156e871667e29\",[\"pong\"],null,null,null,null,null,null,[1],\"en\",null,null,[null,null,null,null,null,null,null,[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,null,null,null,null,null,null,null,[]]],[\"Earth\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dSCRUBBED\"],null,null,\"US\",null,null,null,null,null,false,null,null,null,null,\"en\",null,null,null,true,[null,[false,false,false],[false,false,false,true,false,false],false,[[[\"Academic - Other\",3.6566027E-5],[\"Coding\",0.0047765616],[\"Creative - Other\",6.9606246E-4],[\"Creative Writing\",0.0062274956],[\"Customer Support\",5.9680577E-5],[\"Daily Life Expert - Other\",2.9749834E-4],[\"Daily Life Personal - Other\",0.012238796],[\"Data Analysis\",7.913798E-6],[\"Emotional Support\",0.0010376282],[\"Engagement - Other\",0.09617307],[\"Events\",0.0037010005],[\"Finance / Accounting\",2.5545125E-4],[\"Fitness\",2.7213006E-5],[\"Games\",0.032687347],[\"General Info Seeking\",0.0698771],[\"Government / Law\",3.2684745E-4],[\"HR / Career Management\",1.0684955E-4],[\"Health\",0.0013718734],[\"Life Organizer\",0.015343721],[\"Lifelong Learning\",0.0051377923],[\"Marketing \\u0026 Advertising\",1.5487098E-4],[\"Meals / Nutrition\",2.8867606E-5],[\"Media / Entertainment\",0.03858377],[\"Multimodal Generation\",0.014970068],[\"News / Status\",0.003492183],[\"Personal Finance\",2.1750004E-4],[\"Professional - Other\",0.0020969831],[\"Sales / Order Fulfillment\",1.852516E-5],[\"School Work\",0.003995552],[\"Shopping\",3.0050002E-4],[\"Social / Roleplay\",0.052563407],[\"Sports\",0.0022424166],[\"Teaching\",3.1138377E-4],[\"Travel\",9.5403835E-4],[\"Troubleshoot Issues\",0.0023305137]],[[\"Action Execution / Device Control - Other\",0.0010581263],[\"Advice \\u0026 Opinion - Other\",1.7419884E-4],[\"Analyze Image Files\",0.010819459],[\"Audio Generation\",0.0013371494],[\"Brainstorming\",0.001310665],[\"Casual Interaction / Chat - Other\",0.02446192],[\"Casual Topic Chat\",0.02275599],[\"Classification\",6.855382E-5],[\"Code - Other\",1.9389122E-4],[\"Code Debugging\",3.706237E-5],[\"Code Explanation / QA\",3.9427483E-4],[\"Code Generation\",0.0012060025],[\"Compile\",0.0010742453],[\"Comprehension / QA\",0.010258929],[\"Continue / Add More\",0.0014172237],[\"Device / App Control\",0.0053148842],[\"Find Image\",4.1281506E-5],[\"Game\",0.046038385],[\"Image Edit\",0.0014275591],[\"Image Generation\",0.005869978],[\"Image Understanding - Other\",8.7820736E-5],[\"Information Gathering - Other\",0.002771539],[\"Mathematical Reasoning\",2.0180266E-4],[\"Media Execution\",0.0030772914],[\"Multimodal Generation - Other\",3.193296E-4],[\"Perspective\",1.4933689E-4],[\"Procedural Instruction\",4.1683548E-4],[\"Proofreading / Grammar\",4.3138723E-5],[\"Quiz / Test\",0.0026402562],[\"Reasoning \\u0026 Games - Other\",4.8267003E-4],[\"Recommendation\",8.918942E-4],[\"Share Sentiment\",4.5978493E-4],[\"Simple Pleasantries\",0.025048718],[\"Simple Search\",0.033451524],[\"Subjective Rewrite / Revision\",0.0015298126],[\"Synthesize Broad Topic\",0.0010250498],[\"Task Planning\",4.8624264E-5],[\"Text Analysis - Other\",3.5045872E-5],[\"Text Extraction\",0.0014324589],[\"Text Summarization\",0.0026276645],[\"Translation - Other\",8.4641564E-4],[\"Translation, En to Non-En\",0.00356676],[\"Translation, Non-En to En\",0.02047738],[\"Video Generation\",1.4522072E-4],[\"Visual Referencing\",5.785735E-4],[\"Writing \\u0026 Rewriting - Other\",0.0027552813],[\"Writing From Scratch\",0.01961354]],[[\"Output List\",0.007500472],[\"Output Outline\",5.125946E-5],[\"Output Table\",6.874714E-5],[\"Output Citations\",9.3464814E-7],[\"Output Format\",0.0071068886],[\"Change Length\",0.114683956],[\"Change Ordering\",9.382272E-5],[\"Change Structure\",0.0023307023],[\"Adopt Persona\",0.007961407],[\"Change Tone\",0.0026379393],[\"Rhyme\",2.2826256E-5],[\"Change to Specific Audience\",0.0015867657],[\"Change Tone / Style\",0.005672928],[\"Rephrase\",9.786978E-4],[\"Simplify / Condense\",0.00978237],[\"Factual / Logical Correction\",1.9885237E-4],[\"Attribute-Specific Correction\",0.00833049],[\"Pushback Circumvention\",0.0014117413],[\"Constraint Re-Statement\",0.0013818535],[\"Exact Resubmission\",0.0010319188],[\"Expand / Elaborate\",0.018284313],[\"Revise\",5.7333347E-4]],[[\"Positive\",0.015922986],[\"Negative\",0.012672394]]]],null,[[[[null,[null,0,\"pong\"]]]]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,\"4 Hydrogen\",true,[[[[1004,\"Longer\",5,null,[\"expand\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/expand/default/24px.svg\",null,true]],[1005,\"Shorter\",6,null,[\"compress\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/compress/default/24px.svg\",null,true]],[1001,\"Try again\",1,null,[\"refresh\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/refresh/default/24px.svg\",null,true]]]]],null,2,null,null,null,null,null,null,null,null,null,null,true,6,1]"]]
5245
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],null,null,[[\"rc_cbe156e871667e29\",[\"pong\"],null,null,null,null,null,null,[2],\"en\",null,null,[null,null,null,null,null,null,null,[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[],null,null,null,null,null,null,null,null,[]]],[\"Earth\",\"SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS\",false,null,\"//www.google.com/maps/vt/data\\u003dSCRUBBED\"],null,null,\"US\",null,null,null,null,null,true,null,null,null,null,\"en\",null,null,null,true,[null,[false,false,false],[false,false,false,true,false,false],false,[[[\"Academic - Other\",3.6566027E-5],[\"Coding\",0.0047765616],[\"Creative - Other\",6.9606246E-4],[\"Creative Writing\",0.0062274956],[\"Customer Support\",5.9680577E-5],[\"Daily Life Expert - Other\",2.9749834E-4],[\"Daily Life Personal - Other\",0.012238796],[\"Data Analysis\",7.913798E-6],[\"Emotional Support\",0.0010376282],[\"Engagement - Other\",0.09617307],[\"Events\",0.0037010005],[\"Finance / Accounting\",2.5545125E-4],[\"Fitness\",2.7213006E-5],[\"Games\",0.032687347],[\"General Info Seeking\",0.0698771],[\"Government / Law\",3.2684745E-4],[\"HR / Career Management\",1.0684955E-4],[\"Health\",0.0013718734],[\"Life Organizer\",0.015343721],[\"Lifelong Learning\",0.0051377923],[\"Marketing \\u0026 Advertising\",1.5487098E-4],[\"Meals / Nutrition\",2.8867606E-5],[\"Media / Entertainment\",0.03858377],[\"Multimodal Generation\",0.014970068],[\"News / Status\",0.003492183],[\"Personal Finance\",2.1750004E-4],[\"Professional - Other\",0.0020969831],[\"Sales / Order Fulfillment\",1.852516E-5],[\"School Work\",0.003995552],[\"Shopping\",3.0050002E-4],[\"Social / Roleplay\",0.052563407],[\"Sports\",0.0022424166],[\"Teaching\",3.1138377E-4],[\"Travel\",9.5403835E-4],[\"Troubleshoot Issues\",0.0023305137]],[[\"Action Execution / Device Control - Other\",0.0010581263],[\"Advice \\u0026 Opinion - Other\",1.7419884E-4],[\"Analyze Image Files\",0.010819459],[\"Audio Generation\",0.0013371494],[\"Brainstorming\",0.001310665],[\"Casual Interaction / Chat - Other\",0.02446192],[\"Casual Topic Chat\",0.02275599],[\"Classification\",6.855382E-5],[\"Code - Other\",1.9389122E-4],[\"Code Debugging\",3.706237E-5],[\"Code Explanation / QA\",3.9427483E-4],[\"Code Generation\",0.0012060025],[\"Compile\",0.0010742453],[\"Comprehension / QA\",0.010258929],[\"Continue / Add More\",0.0014172237],[\"Device / App Control\",0.0053148842],[\"Find Image\",4.1281506E-5],[\"Game\",0.046038385],[\"Image Edit\",0.0014275591],[\"Image Generation\",0.005869978],[\"Image Understanding - Other\",8.7820736E-5],[\"Information Gathering - Other\",0.002771539],[\"Mathematical Reasoning\",2.0180266E-4],[\"Media Execution\",0.0030772914],[\"Multimodal Generation - Other\",3.193296E-4],[\"Perspective\",1.4933689E-4],[\"Procedural Instruction\",4.1683548E-4],[\"Proofreading / Grammar\",4.3138723E-5],[\"Quiz / Test\",0.0026402562],[\"Reasoning \\u0026 Games - Other\",4.8267003E-4],[\"Recommendation\",8.918942E-4],[\"Share Sentiment\",4.5978493E-4],[\"Simple Pleasantries\",0.025048718],[\"Simple Search\",0.033451524],[\"Subjective Rewrite / Revision\",0.0015298126],[\"Synthesize Broad Topic\",0.0010250498],[\"Task Planning\",4.8624264E-5],[\"Text Analysis - Other\",3.5045872E-5],[\"Text Extraction\",0.0014324589],[\"Text Summarization\",0.0026276645],[\"Translation - Other\",8.4641564E-4],[\"Translation, En to Non-En\",0.00356676],[\"Translation, Non-En to En\",0.02047738],[\"Video Generation\",1.4522072E-4],[\"Visual Referencing\",5.785735E-4],[\"Writing \\u0026 Rewriting - Other\",0.0027552813],[\"Writing From Scratch\",0.01961354]],[[\"Output List\",0.007500472],[\"Output Outline\",5.125946E-5],[\"Output Table\",6.874714E-5],[\"Output Citations\",9.3464814E-7],[\"Output Format\",0.0071068886],[\"Change Length\",0.114683956],[\"Change Ordering\",9.382272E-5],[\"Change Structure\",0.0023307023],[\"Adopt Persona\",0.007961407],[\"Change Tone\",0.0026379393],[\"Rhyme\",2.2826256E-5],[\"Change to Specific Audience\",0.0015867657],[\"Change Tone / Style\",0.005672928],[\"Rephrase\",9.786978E-4],[\"Simplify / Condense\",0.00978237],[\"Factual / Logical Correction\",1.9885237E-4],[\"Attribute-Specific Correction\",0.00833049],[\"Pushback Circumvention\",0.0014117413],[\"Constraint Re-Statement\",0.0013818535],[\"Exact Resubmission\",0.0010319188],[\"Expand / Elaborate\",0.018284313],[\"Revise\",5.7333347E-4]],[[\"Positive\",0.015922986],[\"Negative\",0.012672394]]]],null,[[[[null,[null,0,\"pong\"]]]]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,\"4 Hydrogen\",true,[[[[1004,\"Longer\",5,null,[\"expand\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/expand/default/24px.svg\",null,true]],[1005,\"Shorter\",6,null,[\"compress\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/compress/default/24px.svg\",null,true]],[1001,\"Try again\",1,null,[\"refresh\",\"https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/refresh/default/24px.svg\",null,true]]]]],null,2,null,null,null,null,null,null,null,[null,null,0,null,[[44,null,1,null,[1]],[5,null,1,null,[1]]],null,null,null,false,false,0],null,null,true,6,1,null,null,null,3]"]]
131
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],{\"11\":[\"A Simple Ping-Pong Exchange\"],\"44\":true}]"]]
133
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],{\"26\":\"AwAAAAAAAAAQANM7mBjXKZRJhDwlHxo\",\"44\":true}]"]]
137
[["wrb.fr",null,"[null,[\"c_d3f36400b81a4940\",\"r_eba8a47460a76636\"],{\"44\":true,\"46\":[\"c_d3f36400b81a4940\",\"\"],\"52\":[]}]"]]
59
[["di",4333],["af.httprm",4333,"-1281535129237460415",4]]
28
[["e",10,null,null,16794]]