@wenathlan/devthink 2.0.15 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (444) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/{dist/bridge.d.ts → bridge.d.ts} +1 -1
  3. package/bridge.d.ts.map +1 -0
  4. package/bridge.js +1877 -0
  5. package/bun.d.ts.map +1 -0
  6. package/bun.js +52329 -0
  7. package/caps/background.json +712 -0
  8. package/caps/cli.json +360 -0
  9. package/caps/library.json +3611 -0
  10. package/caps/mcp.json +126 -0
  11. package/caps/pagebridge.json +377 -0
  12. package/caps/popup.json +51 -0
  13. package/caps/sidepanel.json +522 -0
  14. package/checksums.txt +142 -0
  15. package/cli.d.ts.map +1 -0
  16. package/{dist/cli.js → cli.js} +2 -2
  17. package/companion.d.ts.map +1 -0
  18. package/companion.js +389 -0
  19. package/crossbrowser.d.ts.map +1 -0
  20. package/crossbrowser.js +1191 -0
  21. package/dashdone.d.ts.map +1 -0
  22. package/dashdone.js +368 -0
  23. package/deno.d.ts.map +1 -0
  24. package/deno.js +52325 -0
  25. package/devthink.umd.js +52346 -0
  26. package/fixtures/bun.ts +7 -0
  27. package/fixtures/cjs.js +6 -0
  28. package/fixtures/deno.ts +6 -0
  29. package/fixtures/example-org-pagestate.json +22 -0
  30. package/fixtures/importers/automa-workflow.json +18 -0
  31. package/fixtures/importers/selenium-side.json +20 -0
  32. package/fixtures/importers/tabular-plan.csv +7 -0
  33. package/fixtures/importers/uivision-macro.json +10 -0
  34. package/fixtures/importers/v1-plan.json +13 -0
  35. package/fixtures/mcp-client.mjs +14 -0
  36. package/fixtures/pages/checkout.html +192 -0
  37. package/fixtures/pages/dashboard.html +110 -0
  38. package/fixtures/pages/feed.html +113 -0
  39. package/fixtures/pages/product-grid.html +150 -0
  40. package/fixtures/plans/form-inventory-plan.json +11 -0
  41. package/fixtures/plans/release-notes-plan.json +11 -0
  42. package/fixtures/recipes/agentscompete.json +11 -0
  43. package/fixtures/recipes/agentsforms.json +11 -0
  44. package/fixtures/recipes/agentsmonitor.json +11 -0
  45. package/fixtures/recipes/agentsreview.json +29 -0
  46. package/fixtures/recipes/agentswarm.json +11 -0
  47. package/fixtures/recipes/fillcalendar.json +12 -0
  48. package/fixtures/recipes/fillcheckout.json +13 -0
  49. package/fixtures/recipes/filldependentdropdowns.json +12 -0
  50. package/fixtures/recipes/fillfromcsv.json +13 -0
  51. package/fixtures/recipes/fillloginform.json +12 -0
  52. package/fixtures/recipes/fillmultistepwizard.json +13 -0
  53. package/fixtures/recipes/fillregistration.json +12 -0
  54. package/fixtures/recipes/fillsearchfilters.json +12 -0
  55. package/fixtures/recipes/filltypeahead.json +11 -0
  56. package/fixtures/recipes/monitoralerts.json +12 -0
  57. package/fixtures/recipes/monitoravailability.json +11 -0
  58. package/fixtures/recipes/monitornetworkquiet.json +12 -0
  59. package/fixtures/recipes/monitorpagechanges.json +11 -0
  60. package/fixtures/recipes/monitorpricechange.json +11 -0
  61. package/fixtures/recipes/monitorschedule.json +12 -0
  62. package/fixtures/recipes/scrapedynamicprices.json +13 -0
  63. package/fixtures/recipes/scrapeimagegallery.json +12 -0
  64. package/fixtures/recipes/scrapeinfinitefeed.json +13 -0
  65. package/fixtures/recipes/scrapenestedlists.json +12 -0
  66. package/fixtures/recipes/scrapeproductgrid.json +12 -0
  67. package/fixtures/recipes/scrapereviews.json +12 -0
  68. package/fixtures/recipes/scrapesearchresults.json +12 -0
  69. package/fixtures/recipes/scrapetablepagination.json +12 -0
  70. package/fixtures/recipes/testaccessibility.json +34 -0
  71. package/fixtures/recipes/testconsoleerrors.json +12 -0
  72. package/fixtures/recipes/testdeeplinks.json +12 -0
  73. package/fixtures/recipes/testformvalidation.json +13 -0
  74. package/fixtures/recipes/testlayoutshift.json +12 -0
  75. package/fixtures/recipes/testlinkcheck.json +12 -0
  76. package/fixtures/recipes/testloadtiming.json +12 -0
  77. package/fixtures/recipes/testvisualdiff.json +12 -0
  78. package/fixtures/workflows/changelog-digest-workflow.json +13 -0
  79. package/fixtures/workflows/form-survey-workflow.json +13 -0
  80. package/gallery.json +706 -0
  81. package/hardening.d.ts.map +1 -0
  82. package/hardening.js +188 -0
  83. package/headless.d.ts.map +1 -0
  84. package/headless.js +11522 -0
  85. package/http.d.ts.map +1 -0
  86. package/http.js +2165 -0
  87. package/index.cjs +54682 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +52310 -0
  90. package/index.neutral.js +46343 -0
  91. package/{web/manifest.json → manifest.json} +1 -1
  92. package/mcp.d.ts.map +1 -0
  93. package/mcp.js +20515 -0
  94. package/memory.d.ts.map +1 -0
  95. package/{memory.ts → memory.js} +2310 -3834
  96. package/nativehost.template.json +10 -0
  97. package/node.cjs +54686 -0
  98. package/node.d.ts.map +1 -0
  99. package/pack.d.ts.map +1 -0
  100. package/pack.js +805 -0
  101. package/package.json +83 -176
  102. package/policy.d.ts.map +1 -0
  103. package/{policy.ts → policy.js} +4679 -5073
  104. package/progress.d.ts.map +1 -0
  105. package/progress.js +645 -0
  106. package/protocol.d.ts.map +1 -0
  107. package/protocol.js +8334 -0
  108. package/schemas/audit.schema.json +226 -0
  109. package/schemas/capability.schema.json +113 -0
  110. package/schemas/envelope.schema.json +162 -0
  111. package/schemas/memory.schema.json +51 -0
  112. package/schemas/observation.schema.json +113 -0
  113. package/schemas/plan.schema.json +208 -0
  114. package/schemas/progress.schema.json +126 -0
  115. package/schemas/proposal.schema.json +68 -0
  116. package/schemas/session.schema.json +82 -0
  117. package/schemas/tool.schema.json +94 -0
  118. package/server.d.ts.map +1 -0
  119. package/server.js +28877 -0
  120. package/umd-example.html +18 -0
  121. package/umd.d.ts.map +1 -0
  122. package/accounts.ts +0 -2087
  123. package/agent.ts +0 -2331
  124. package/antigravity.ts +0 -2139
  125. package/apifreeze.ts +0 -4146
  126. package/auth.ts +0 -642
  127. package/background.ts +0 -16837
  128. package/bridge.ts +0 -2080
  129. package/build.ts +0 -54
  130. package/bun.ts +0 -26
  131. package/capture.ts +0 -1614
  132. package/checksecrets.ts +0 -72
  133. package/cjs.ts +0 -9
  134. package/cli.ts +0 -3500
  135. package/commands.ts +0 -1101
  136. package/companion.ts +0 -450
  137. package/compatibility.ts +0 -37
  138. package/config.ts +0 -3137
  139. package/constants.ts +0 -943
  140. package/core.ts +0 -1473
  141. package/crossbrowser.ts +0 -1359
  142. package/dashdone.ts +0 -605
  143. package/data.ts +0 -943
  144. package/database.ts +0 -133
  145. package/debug.ts +0 -850
  146. package/deno.ts +0 -27
  147. package/devthink.ts +0 -707
  148. package/dist/accounts.d.ts +0 -409
  149. package/dist/agent.d.ts +0 -837
  150. package/dist/antigravity.d.ts +0 -380
  151. package/dist/apifreeze.d.ts +0 -113
  152. package/dist/auth.d.ts +0 -224
  153. package/dist/capture.d.ts +0 -595
  154. package/dist/cjs.d.ts +0 -6
  155. package/dist/commands.d.ts +0 -310
  156. package/dist/compatibility.d.ts +0 -17
  157. package/dist/config.d.ts +0 -1853
  158. package/dist/constants.d.ts +0 -637
  159. package/dist/core.d.ts +0 -361
  160. package/dist/data.d.ts +0 -330
  161. package/dist/database.d.ts +0 -24
  162. package/dist/debug.d.ts +0 -270
  163. package/dist/engine.d.ts +0 -74
  164. package/dist/environments.d.ts +0 -244
  165. package/dist/evidence.d.ts +0 -277
  166. package/dist/export.d.ts +0 -311
  167. package/dist/fingerprint.d.ts +0 -594
  168. package/dist/flow.d.ts +0 -300
  169. package/dist/gates.d.ts +0 -103
  170. package/dist/identity.d.ts +0 -51
  171. package/dist/ids.d.ts +0 -7
  172. package/dist/llm.d.ts +0 -652
  173. package/dist/models.d.ts +0 -1807
  174. package/dist/net.d.ts +0 -325
  175. package/dist/neutral.d.ts +0 -41
  176. package/dist/oauth.d.ts +0 -703
  177. package/dist/page.d.ts +0 -1166
  178. package/dist/perf.d.ts +0 -481
  179. package/dist/plan.d.ts +0 -134
  180. package/dist/project.d.ts +0 -395
  181. package/dist/providers.d.ts +0 -37
  182. package/dist/quota.d.ts +0 -453
  183. package/dist/recovery.d.ts +0 -621
  184. package/dist/request.d.ts +0 -1492
  185. package/dist/run.d.ts +0 -779
  186. package/dist/runtime.d.ts +0 -212
  187. package/dist/search.d.ts +0 -375
  188. package/dist/security.d.ts +0 -534
  189. package/dist/serve.d.ts +0 -136
  190. package/dist/session.d.ts +0 -296
  191. package/dist/storage.d.ts +0 -53
  192. package/dist/streaming.d.ts +0 -1119
  193. package/dist/swarm.d.ts +0 -328
  194. package/dist/tools.d.ts +0 -170
  195. package/dist/types.d.ts +0 -8357
  196. package/dist/utils.d.ts +0 -82
  197. package/dist/version.d.ts +0 -7
  198. package/dist/versionregistry.d.ts +0 -406
  199. package/dist/views.d.ts +0 -579
  200. package/dist/workbenchsession.d.ts +0 -69
  201. package/dist/workflow.d.ts +0 -649
  202. package/docs/readme.md +0 -92
  203. package/docs/schemas/antigravity.json +0 -192
  204. package/engine.ts +0 -1524
  205. package/environments.ts +0 -1005
  206. package/evidence.ts +0 -643
  207. package/export.ts +0 -889
  208. package/fingerprint.ts +0 -1458
  209. package/flow.ts +0 -1190
  210. package/gates.ts +0 -307
  211. package/gateway.ts +0 -34
  212. package/hardening.ts +0 -191
  213. package/headless.ts +0 -369
  214. package/http.ts +0 -2110
  215. package/identity.ts +0 -246
  216. package/ids.ts +0 -26
  217. package/index.ts +0 -369
  218. package/llm.ts +0 -2682
  219. package/mcp.ts +0 -1835
  220. package/models.ts +0 -3805
  221. package/modes.ts +0 -43
  222. package/net.ts +0 -1214
  223. package/neutral.ts +0 -362
  224. package/node.ts +0 -26
  225. package/oauth.ts +0 -2216
  226. package/offscreen.ts +0 -170
  227. package/pack.ts +0 -956
  228. package/page.ts +0 -7824
  229. package/pagebridge.ts +0 -1116
  230. package/perf.ts +0 -957
  231. package/plan.ts +0 -672
  232. package/plugin.ts +0 -76
  233. package/prisma.config.ts +0 -27
  234. package/progress.ts +0 -1308
  235. package/project.ts +0 -1291
  236. package/protocol.ts +0 -4187
  237. package/providers.ts +0 -246
  238. package/quota.ts +0 -1887
  239. package/recovery.ts +0 -2433
  240. package/request.ts +0 -4482
  241. package/run.ts +0 -2135
  242. package/runtime.ts +0 -526
  243. package/search.ts +0 -1760
  244. package/security.ts +0 -1673
  245. package/serve.ts +0 -419
  246. package/server.ts +0 -5538
  247. package/session.ts +0 -1162
  248. package/storage.ts +0 -182
  249. package/streaming.ts +0 -4101
  250. package/swarm.ts +0 -884
  251. package/sync.ts +0 -56
  252. package/tests/agentcert.test.ts +0 -128
  253. package/tests/agentfleet.test.ts +0 -214
  254. package/tests/agentreview.test.ts +0 -241
  255. package/tests/agentstream.test.ts +0 -335
  256. package/tests/agentwork.test.ts +0 -356
  257. package/tests/apifreeze.test.ts +0 -290
  258. package/tests/apimap.test.ts +0 -112
  259. package/tests/approvalgate.test.ts +0 -175
  260. package/tests/artifactmanifest.test.ts +0 -204
  261. package/tests/attentionfeed.test.ts +0 -163
  262. package/tests/backgroundruns.test.ts +0 -100
  263. package/tests/batchscheduling.test.ts +0 -131
  264. package/tests/blackboard.test.ts +0 -238
  265. package/tests/bridge.test.ts +0 -1088
  266. package/tests/browsercoverage.test.ts +0 -134
  267. package/tests/browserpolyfills.test.ts +0 -124
  268. package/tests/build.mjs +0 -1260
  269. package/tests/clientauth.test.ts +0 -223
  270. package/tests/clitools.test.ts +0 -578
  271. package/tests/confirmgates.test.ts +0 -190
  272. package/tests/containerpack.test.ts +0 -143
  273. package/tests/controlflow.test.ts +0 -2120
  274. package/tests/coordination.test.ts +0 -345
  275. package/tests/copyscreen.test.ts +0 -139
  276. package/tests/core.test.ts +0 -417
  277. package/tests/costcert.test.ts +0 -95
  278. package/tests/crossbrowser.test.ts +0 -115
  279. package/tests/cspaudit.test.ts +0 -79
  280. package/tests/dashdone.test.ts +0 -615
  281. package/tests/datagrid.test.ts +0 -137
  282. package/tests/doccheck.test.ts +0 -107
  283. package/tests/dombatch.test.ts +0 -109
  284. package/tests/emulation.test.ts +0 -282
  285. package/tests/environments.test.ts +0 -259
  286. package/tests/evidenceviews.test.ts +0 -88
  287. package/tests/exporttools.test.ts +0 -185
  288. package/tests/firefoxprep.test.ts +0 -134
  289. package/tests/flowlibrary.test.ts +0 -242
  290. package/tests/flowrun.test.ts +0 -303
  291. package/tests/forensics.test.ts +0 -439
  292. package/tests/gateway.test.ts +0 -939
  293. package/tests/headlesslib.test.ts +0 -171
  294. package/tests/httpstream.test.ts +0 -277
  295. package/tests/immutablelog.test.ts +0 -157
  296. package/tests/inboundguard.test.ts +0 -177
  297. package/tests/lazyload.test.ts +0 -72
  298. package/tests/librarymodes.test.ts +0 -623
  299. package/tests/llm.test.ts +0 -696
  300. package/tests/manifest.test.ts +0 -226
  301. package/tests/maskinputs.test.ts +0 -150
  302. package/tests/matrixverify.test.ts +0 -111
  303. package/tests/mavenpack.test.ts +0 -75
  304. package/tests/mcpserver.test.ts +0 -704
  305. package/tests/memory.test.ts +0 -4155
  306. package/tests/memorycare.test.ts +0 -230
  307. package/tests/migrateplan.test.ts +0 -349
  308. package/tests/minimization.test.ts +0 -414
  309. package/tests/modelroute.test.ts +0 -112
  310. package/tests/multiagent.test.ts +0 -440
  311. package/tests/nativebridge.test.ts +0 -807
  312. package/tests/navigation.test.ts +0 -284
  313. package/tests/nugetpack.test.ts +0 -83
  314. package/tests/orchestration.test.ts +0 -449
  315. package/tests/originpolicy.test.ts +0 -405
  316. package/tests/outputcompare.test.ts +0 -97
  317. package/tests/package.test.ts +0 -91
  318. package/tests/pagebridge.test.ts +0 -5909
  319. package/tests/pentest.test.ts +0 -75
  320. package/tests/perfrecords.test.ts +0 -257
  321. package/tests/permdiff.test.ts +0 -85
  322. package/tests/phishguard.test.ts +0 -128
  323. package/tests/pickerviews.test.ts +0 -155
  324. package/tests/pipelines.test.ts +0 -381
  325. package/tests/planlint.test.ts +0 -240
  326. package/tests/planreview.test.ts +0 -383
  327. package/tests/platformtargets.test.ts +0 -56
  328. package/tests/policy.test.ts +0 -8284
  329. package/tests/portability.test.ts +0 -96
  330. package/tests/progress.test.ts +0 -1036
  331. package/tests/promptlibrary.test.ts +0 -116
  332. package/tests/protocol.test.ts +0 -4793
  333. package/tests/publishingpipeline.test.ts +0 -314
  334. package/tests/quickactions.test.ts +0 -164
  335. package/tests/readiness.test.ts +0 -78
  336. package/tests/recipes.test.ts +0 -163
  337. package/tests/redactshots.test.ts +0 -216
  338. package/tests/registernvidiakeys.ts +0 -51
  339. package/tests/relayserve.test.ts +0 -304
  340. package/tests/releasenotes.test.ts +0 -276
  341. package/tests/resilience.test.ts +0 -467
  342. package/tests/resourceaware.test.ts +0 -187
  343. package/tests/runbudget.test.ts +0 -125
  344. package/tests/runhistory.test.ts +0 -299
  345. package/tests/runreplay.test.ts +0 -113
  346. package/tests/runresume.test.ts +0 -184
  347. package/tests/runstate.test.ts +0 -288
  348. package/tests/runtimeadapters.test.ts +0 -251
  349. package/tests/safariskeleton.test.ts +0 -115
  350. package/tests/sandboxframe.test.ts +0 -196
  351. package/tests/sbom.test.ts +0 -105
  352. package/tests/secretvault.test.ts +0 -188
  353. package/tests/selcache.test.ts +0 -111
  354. package/tests/sessioninterface.test.ts +0 -791
  355. package/tests/sessions.test.ts +0 -591
  356. package/tests/siteprefs.test.ts +0 -228
  357. package/tests/snapshotdelta.test.ts +0 -165
  358. package/tests/statusviews.test.ts +0 -237
  359. package/tests/stepmeter.test.ts +0 -200
  360. package/tests/streamparse.test.ts +0 -163
  361. package/tests/stylepruning.test.ts +0 -90
  362. package/tests/surfaces.test.ts +0 -282
  363. package/tests/sweep.test.ts +0 -78
  364. package/tests/syncbridge.test.ts +0 -164
  365. package/tests/taskqueue.test.ts +0 -206
  366. package/tests/toolcalls.test.ts +0 -336
  367. package/tests/toolcatalog.test.ts +0 -201
  368. package/tests/torture-agent.test.ts +0 -706
  369. package/tests/torture-auth.test.ts +0 -461
  370. package/tests/torture-commands.test.ts +0 -895
  371. package/tests/torture-data.test.ts +0 -923
  372. package/tests/torture-environments.test.ts +0 -285
  373. package/tests/torture-export.test.ts +0 -263
  374. package/tests/torture-http.test.ts +0 -1379
  375. package/tests/torture-llm.test.ts +0 -808
  376. package/tests/torture-memory.test.ts +0 -1084
  377. package/tests/torture-plan.test.ts +0 -829
  378. package/tests/torture-run.test.ts +0 -626
  379. package/tests/torture-session.test.ts +0 -928
  380. package/tests/torture-swarm.test.ts +0 -1245
  381. package/tests/torture-tools.test.ts +0 -964
  382. package/tests/torture-workflow.test.ts +0 -2354
  383. package/tests/tourviews.test.ts +0 -52
  384. package/tests/transparency.test.ts +0 -147
  385. package/tests/trigger.test.ts +0 -941
  386. package/tests/v1sunset.test.ts +0 -428
  387. package/tests/virtlist.test.ts +0 -94
  388. package/tests/vision.test.ts +0 -540
  389. package/tests/vsixpack.test.ts +0 -145
  390. package/tests/webapi.test.ts +0 -523
  391. package/tests/workflow.test.ts +0 -1785
  392. package/tests/workfloweditor.test.ts +0 -759
  393. package/tests/xpipack.test.ts +0 -128
  394. package/tools.ts +0 -734
  395. package/types.ts +0 -9908
  396. package/umd.ts +0 -9
  397. package/utils.ts +0 -249
  398. package/version.ts +0 -8
  399. package/versionregistry.ts +0 -1310
  400. package/views.ts +0 -2153
  401. package/vitest.config.ts +0 -12
  402. package/web/App.tsx +0 -78
  403. package/web/README.md +0 -47
  404. package/web/capacitor.config.ts +0 -46
  405. package/web/const.ts +0 -19
  406. package/web/control.shell.tsx +0 -66
  407. package/web/dashboardpage.ts +0 -554
  408. package/web/db.ts +0 -493
  409. package/web/design.html +0 -541
  410. package/web/gatewayview/Gateway.tsx +0 -345
  411. package/web/gatewayview/config.ts +0 -1042
  412. package/web/gatewayview/definition.ts +0 -174
  413. package/web/icons.ts +0 -15
  414. package/web/optionspage.ts +0 -691
  415. package/web/popup.ts +0 -1651
  416. package/web/schema.prisma +0 -176
  417. package/web/sidepanel.ts +0 -7941
  418. package/web/sitemanifest.json +0 -13
  419. package/web/terminal-ui.tsx +0 -622
  420. package/web/transparencypage.ts +0 -541
  421. package/web/vite.config.ts +0 -39
  422. package/web/workspace.ts +0 -23
  423. package/workbenchmemory.ts +0 -104
  424. package/workbenchsession.ts +0 -304
  425. package/workflow.ts +0 -4495
  426. /package/{dist/bun.d.ts → bun.d.ts} +0 -0
  427. /package/{dist/cli.d.ts → cli.d.ts} +0 -0
  428. /package/{dist/companion.d.ts → companion.d.ts} +0 -0
  429. /package/{dist/crossbrowser.d.ts → crossbrowser.d.ts} +0 -0
  430. /package/{dist/dashdone.d.ts → dashdone.d.ts} +0 -0
  431. /package/{dist/deno.d.ts → deno.d.ts} +0 -0
  432. /package/{dist/hardening.d.ts → hardening.d.ts} +0 -0
  433. /package/{dist/headless.d.ts → headless.d.ts} +0 -0
  434. /package/{dist/http.d.ts → http.d.ts} +0 -0
  435. /package/{dist/index.d.ts → index.d.ts} +0 -0
  436. /package/{dist/mcp.d.ts → mcp.d.ts} +0 -0
  437. /package/{dist/memory.d.ts → memory.d.ts} +0 -0
  438. /package/{dist/node.d.ts → node.d.ts} +0 -0
  439. /package/{dist/pack.d.ts → pack.d.ts} +0 -0
  440. /package/{dist/policy.d.ts → policy.d.ts} +0 -0
  441. /package/{dist/progress.d.ts → progress.d.ts} +0 -0
  442. /package/{dist/protocol.d.ts → protocol.d.ts} +0 -0
  443. /package/{dist/server.d.ts → server.d.ts} +0 -0
  444. /package/{dist/umd.d.ts → umd.d.ts} +0 -0
package/constants.ts DELETED
@@ -1,943 +0,0 @@
1
- /**
2
- * @file constants.ts
3
- * @module provider/constants
4
- * @description
5
- * Merged constants module — v2.1.2 base (strict superset) with every unique
6
- * export from the v1.0.0 constants module ported on top. Nothing dropped.
7
- *
8
- * Third-person observer view: the library observes real traffic from the
9
- * Antigravity IDE, Gemini CLI, OmniRoute, 9router and pi-antigravity-auth
10
- * and reproduces its fingerprint without executing Antigravity.
11
- *
12
- * The V2 correction addresses the opencode.txt timeline gap: models released
13
- * up to 25/08/2026 were missing and Project ID bypass was not fully
14
- * Gemini CLI-like.
15
- *
16
- * - Plugin: the merged provider lineage 2.1.2 (ONDA 5 V2)
17
- * - Replaces the upstream research lineage which failed due to an outdated UA
18
- * (1.11.5 -> "This version of Antigravity is no longer supported")
19
- * and missing 2026 models.
20
- * - Must work WITHOUT the localhost v1 base-url proxy, straight to
21
- * cloudcode-pa.googleapis.com via endpoint cascade with retry 403/404/5xx.
22
- * - Project ID bypass behaves EXACTLY like Gemini CLI would:
23
- * 1) try loadCodeAssist without projectId -> server returns the existing
24
- * cloudaicompanionProject
25
- * 2) if null -> onboardUser FREE tier -> long-running operation polling
26
- * 3) loadCodeAssist again -> provisioned projectId
27
- * 4) fetchAvailableModels as best-effort validation
28
- * 5) blinded rising-fact-p41fc fallback only if every endpoint fails
29
- * Implemented references: pi-antigravity-auth (loadCodeAssist parsing),
30
- * OmniRoute/9router (header stripping, prod-first cascade).
31
- *
32
- * Model timeline complete up to 25/08/2026:
33
- * - Gemini 3.6 Flash family (high/medium/low/tiered/base)
34
- * - Gemini 3.5 Flash family (high/medium/base/lite/lite-preview)
35
- * - Gemini 3.1 Pro family (high/low/base + flash-image + flash-lite)
36
- * - Gemini 3 family (flash, pro, deep-think)
37
- * - Gemini 2.5 family (pro, flash, flash-lite)
38
- * - Claude 4.6 thinking (opus + sonnet), Claude 4.5 legacy
39
- * - gpt-oss-120b medium/high
40
- * - Preview models: gemini-3-pro-preview, flash-preview, 3.1-pro-preview, customtools
41
- *
42
- * Merge notes (conflict resolutions):
43
- * - ANTIGRAVITY_ENDPOINTS : kept from v2 (cascade URL array); the v1
44
- * versioned-base object is exported as ANTIGRAVITY_ENDPOINT_SET.
45
- * - CODE_ASSIST_ENDPOINTS : kept from v2 (PROD/DAILY/SANDBOX/AUTOPUSH URL
46
- * map); the v1 v1internal path map is exported as CODE_ASSIST_PATH_MAP.
47
- * - CONSTANTS : kept from v2; the v1 compatibility barrel is
48
- * exported as CONSTANTS_V1 (also provided as the module default export).
49
- * - FALLBACK_PROJECT_ID : identical value in both versions; single v2
50
- * definition retained.
51
- *
52
- * Runtime constraint: only node:* builtins + global fetch (Node >=18).
53
- * Library-first, root-first: no /src, no folder inside folder.
54
- *
55
- * @author devthink
56
- * @license MIT
57
- * @version 2.1.2 — ONDA 5 CORRECTION V2 26/08/2026
58
- */
59
-
60
- import { arch as osArch, platform as osPlatform, homedir } from "node:os";
61
- import * as nodePath from "node:path";
62
- // v2.1.15 Phase B: every FUNCTION that used to live here moved to its domain
63
- // owner (core.ts for generic utilities, fingerprint.ts for identity
64
- // masquerade). constants.ts is now raw values only.
65
- // v2.1.15 Phase A: the model-domain families (model catalogs, thinking
66
- // tables, search/default model ids, routing helpers) moved to models.ts.
67
- // Type-only edge (erased at runtime) so the raw sub-lists below stay typed.
68
-
69
- // ---------------------------------------------------------------------------
70
- // Version — dynamic fallback chain (AM ban <1.15.8, latest stable 1.19.2)
71
- // ---------------------------------------------------------------------------
72
-
73
- export const ANTIGRAVITY_VERSION_FALLBACK = "1.19.2" as const;
74
- export const ANTIGRAVITY_VERSION_MIN_SUPPORTED = "1.15.8" as const;
75
- export const ANTIGRAVITY_BLOCKED_VERSIONS = ["1.11.5", "1.12.0", "1.12.3", "1.13.2"] as const;
76
-
77
- export const ANTIGRAVITY_VERSION_REMOTE_URLS = [
78
- "https://registry.npmjs.org/antigravity/latest",
79
- "https://api.github.com/repos/google/antigravity/releases/latest",
80
- "https://storage.googleapis.com/antigravity-version/version.json",
81
- ] as const;
82
-
83
- export const VERSION_FETCH_TIMEOUT_MS = 5_000 as const;
84
-
85
- // ---------------------------------------------------------------------------
86
- // User-Agent — core fix
87
- // ---------------------------------------------------------------------------
88
-
89
- export const ANTIGRAVITY_USER_AGENT_FALLBACK = `antigravity/${ANTIGRAVITY_VERSION_FALLBACK}`;
90
- export const ANTIGRAVITY_USER_AGENT: string = ANTIGRAVITY_USER_AGENT_FALLBACK;
91
- /* The grand merge folded this constants module into the shared core graph the platform-portable bundles ship: the user agent fallback reads the live os identifiers under node and bun while a stubbed browser bundle answers the neutral fallback, so the top-level evaluation never throws at import time. */
92
- const osidentifiers = (): string => {
93
- try {
94
- return `${osPlatform()}/${osArch()}`;
95
- } catch {
96
- return "unknown/unknown";
97
- }
98
- };
99
- export const GEMINI_CLI_USER_AGENT_FALLBACK: string = `gemini-cli/0.57.0 ${osidentifiers()}`;
100
-
101
- /**
102
- * The 2.0.0 GPN:GeminiCLI User-Agent of the provider lineage (auth.ts / oauth(2).ts lineage).
103
- * Distinct from ANTIGRAVITY_USER_AGENT (the antigravity/{version} identity):
104
- * this is the legacy presentation string of the lineage, exported for callers
105
- * that need to present it; it is not part of the live bypass chains.
106
- */
107
- export const ANTIGRAVITY_USER_AGENT_MAENE =
108
- "devthink/2.0.0 (GPN:GeminiCLI) Node.js/22 (+https://github.com/wenathlan/devthink)" as const;
109
-
110
- /**
111
- * Exact User-Agent sent by Gemini CLI 0.57.0 against gemini-3-pro-preview —
112
- * the live-validated request.ts/streaming.ts variant and the canonical of
113
- * the GEMINI_CLI_USER_AGENT family (v2.1.15 Phase B).
114
- */
115
- export const GEMINI_CLI_USER_AGENT =
116
- "GeminiCLI/0.57.0/gemini-3-pro-preview (linux; x64; GitHub) google-api-nodejs-client/9.15.1" as const;
117
-
118
- /**
119
- * Minimal Gemini CLI UA snapshot (former project.ts local variant; consumed
120
- * by accounts.ts). Distinct value from GEMINI_CLI_USER_AGENT (no model,
121
- * platform or client suffix) — one name, one meaning.
122
- */
123
- export const GEMINI_CLI_USER_AGENT_MINIMAL = "GeminiCLI/0.57.0" as const;
124
-
125
- /**
126
- * Gemini CLI UA WITHOUT the model segment (recovery.ts lineage). Distinct
127
- * value from {@link GEMINI_CLI_USER_AGENT}: recovery presents the plain
128
- * platform UA, so the accurate split keeps both historical strings.
129
- */
130
- export const GEMINI_CLI_USER_AGENT_PLAIN =
131
- "GeminiCLI/0.57.0 (linux; x64; GitHub) google-api-nodejs-client/9.15.1" as const;
132
-
133
- // v2.1.15 Phase C: GEMINI_CLI_USER_AGENT_BASE (minimal UA alias) deleted —
134
- // GEMINI_CLI_USER_AGENT_MINIMAL is the accurate name for that value.
135
-
136
- // ---------------------------------------------------------------------------
137
- // OAuth — blinded
138
- // ---------------------------------------------------------------------------
139
-
140
- export const ANTIGRAVITY_CLIENT_ID = [
141
- "1071006060591",
142
- "-8q4j2k9l0m3n5b7v2c4x6",
143
- "z8a1s3d5f7g9h2j4k6",
144
- ".apps.",
145
- "googleusercontent",
146
- ".com",
147
- ].join("");
148
- export const ANTIGRAVITY_CLIENT_SECRET = ["GOCSPX", "-1a2b3c4d5e6f7g8h9i0j", "1k2l3m4n5o"].join("");
149
- export const ANTIGRAVITY_CLIENT_ID_IS_BLINDED = true as const;
150
- export const ANTIGRAVITY_CLIENT_SECRET_IS_BLINDED = true as const;
151
-
152
- /**
153
- * Secondary Antigravity client id fallback (former quota.ts local; assembled
154
- * at runtime from segments). Raw value owner.
155
- */
156
- export const ANTIGRAVITY_CLIENT_ID_FALLBACK_SECONDARY = [
157
- "681255809395",
158
- "-oo8ft2oq6bda7b6t5a2prl1",
159
- "saaq1hhs",
160
- ".apps.",
161
- "googleusercontent",
162
- ".com",
163
- ].join("");
164
-
165
- // ---------------------------------------------------------------------------
166
- // Headers — fingerprint
167
- // ---------------------------------------------------------------------------
168
-
169
- export const HEADER_X_GOOG_API_CLIENT = "X-Goog-Api-Client" as const;
170
- export const HEADER_CLIENT_METADATA = "Client-Metadata" as const;
171
- export const HEADER_USER_AGENT = "User-Agent" as const;
172
- export const HEADER_X_GOOG_USER_PROJECT = "x-goog-user-project" as const;
173
- export const HEADER_X_GOOG_QUOTA_USER = "X-Goog-QuotaUser" as const;
174
- export const HEADER_X_CLIENT_DEVICE_ID = "X-Client-Device-Id" as const;
175
-
176
- export const HEADERS_TO_STRIP = [
177
- HEADER_X_GOOG_USER_PROJECT,
178
- HEADER_X_GOOG_QUOTA_USER,
179
- HEADER_X_CLIENT_DEVICE_ID,
180
- ] as const;
181
-
182
- /**
183
- * Base forbidden-header list (5 entries) stripped case-insensitively on
184
- * content requests — the live-validated request.ts variant. Canonical of
185
- * the FORBIDDEN_HEADERS family (v2.1.15 Phase B: plugin.ts's identical copy
186
- * deleted; models.ts's 6-entry strict variant lives below under its own
187
- * accurate name).
188
- */
189
- export const FORBIDDEN_HEADERS = [
190
- "x-goog-user-project",
191
- "x-goog-quotatuser",
192
- "x-goog-quota-user",
193
- "x-client-device-id",
194
- "x-goog-request-reason",
195
- ] as const;
196
-
197
- /**
198
- * Strict forbidden-header list (6 entries) — the base list plus
199
- * "x-goog-api-client". This is the models.ts lineage used by the strict
200
- * stripper (strip functions themselves are owned by request.ts in Phase D).
201
- */
202
- export const FORBIDDEN_HEADERS_STRICT = [...FORBIDDEN_HEADERS, "x-goog-api-client"] as const;
203
-
204
- /**
205
- * Antigravity Client-Metadata raw template (quota.ts lineage — the 4-key
206
- * superset; the former 2-key constants.ts variant is subsumed). The
207
- * buildClientMetadata FUNCTION lives in fingerprint.ts and imports this.
208
- */
209
- export const ANTIGRAVITY_CLIENT_METADATA_TEMPLATE = {
210
- ideType: "ANTIGRAVITY",
211
- platform: "PLATFORM_UNSPECIFIED",
212
- pluginType: "GEMINI",
213
- pluginVersion: "2.1.14",
214
- } as const;
215
-
216
- /**
217
- * Client-Metadata raw object — the Gemini CLI bypass metadata triple
218
- * (config.ts / project.ts / request.ts lineage). The dynamic ANTIGRAVITY-style
219
- * metadata string is built by fingerprint.ts's buildClientMetadata.
220
- */
221
- export const CLIENT_METADATA = {
222
- ideType: "IDE_UNSPECIFIED",
223
- platform: "PLATFORM_UNSPECIFIED",
224
- pluginType: "GEMINI",
225
- } as const;
226
-
227
- /**
228
- * Client-Metadata serialized as the header string / payload used by the
229
- * Gemini CLI bypass (config.ts / project.ts / quota.ts / request.ts lineage).
230
- */
231
- export const CLIENT_METADATA_STRING =
232
- "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI" as const;
233
-
234
- /** Historical alias of {@link CLIENT_METADATA_STRING} (request.ts/streaming.ts lineage). */
235
- export const CLIENT_METADATA_RAW = CLIENT_METADATA_STRING;
236
-
237
- // ---------------------------------------------------------------------------
238
- // Endpoints — direct cloudcode-pa, NO localhost v1 proxy
239
- // ---------------------------------------------------------------------------
240
-
241
- export const ANTIGRAVITY_ENDPOINTS = [
242
- "https://cloudcode-pa.googleapis.com",
243
- "https://daily-cloudcode-pa.googleapis.com",
244
- "https://autopush-cloudcode-pa.sandbox.googleapis.com",
245
- ] as const;
246
-
247
- export const ANTIGRAVITY_ENDPOINT_FALLBACKS = [
248
- "https://cloudcode-pa.googleapis.com",
249
- "https://daily-cloudcode-pa.googleapis.com",
250
- "https://autopush-cloudcode-pa.sandbox.googleapis.com",
251
- ] as const;
252
-
253
- /**
254
- * Raw Cloud Code Assist host map (layer-0 raw values, v2.1.15 Phase A).
255
- * The family names CODE_ASSIST_ENDPOINTS (host-map semantic) and
256
- * ENDPOINT_ORDER / ENDPOINT_ORDER_GEMINI_CLI / ENDPOINT_ORDER_ANTIGRAVITY
257
- * (per-family routing orders) are owned by models.ts, which derives them
258
- * from this map. The former local DAILY_SANDBOX key (value identical to
259
- * SANDBOX) had zero consumers and was dropped in the merge.
260
- */
261
- export const ENDPOINTS = {
262
- PROD: "https://cloudcode-pa.googleapis.com",
263
- DAILY: "https://daily-cloudcode-pa.googleapis.com",
264
- SANDBOX: "https://daily-cloudcode-pa.sandbox.googleapis.com",
265
- AUTOPUSH: "https://autopush-cloudcode-pa.sandbox.googleapis.com",
266
- } as const;
267
-
268
- /**
269
- * Cloud Code Assist PA base URL — canonical of the CLOUDCODE_BASE_URL family
270
- * (v2.1.15 Phase B: accounts.ts, config.ts and fingerprint.ts locals
271
- * deleted). The alias names below keep every historical surface resolvable
272
- * while the string itself has exactly one definition.
273
- */
274
- export const CLOUDCODE_BASE_URL = "https://cloudcode-pa.googleapis.com" as const;
275
-
276
- /** Alias of {@link CLOUDCODE_BASE_URL} (auth.ts / quota.ts lineage). */
277
- export const CLOUDCODE_BASE = CLOUDCODE_BASE_URL;
278
-
279
- /** Alias of {@link CLOUDCODE_BASE_URL} (request.ts / streaming.ts lineage). */
280
- export const CLOUDCODE_PA_BASE = CLOUDCODE_BASE_URL;
281
-
282
- /** Daily (canary) Cloud Code Assist base URL (quota.ts / request.ts lineage). */
283
- export const CLOUDCODE_DAILY_BASE = "https://daily-cloudcode-pa.googleapis.com" as const;
284
-
285
- /**
286
- * Base URL for the Cloud Code Assist PaaS API (v1internal — undocumented).
287
- * v2.1.16: relocated above its dependents so every v1internal method-path
288
- * constant below derives from {@link CODE_ASSIST_PATH_MAP} (zero duplicated
289
- * path strings in this module).
290
- */
291
- export const CODE_ASSIST_BASE_URL = "https://cloudcode-pa.googleapis.com" as const;
292
-
293
- /**
294
- * Canonical v1internal method-path map — the single owner of every
295
- * "/v1internal:*" path literal in this module (v2.1.16 internal-dedup: the
296
- * standalone *_ENDPOINT constants, the CLOUDCODE_ENDPOINTS URL joins and the
297
- * versioned daily-v1internal block all derive from these entries).
298
- */
299
- export const CODE_ASSIST_PATH_MAP = {
300
- /** Loads project and onboarding status */
301
- LOAD_CODE_ASSIST: "/v1internal:loadCodeAssist",
302
- /** Onboards a user into a Cloud project */
303
- ONBOARD_USER: "/v1internal:onboardUser",
304
- /** Lists models available to the account */
305
- FETCH_AVAILABLE_MODELS: "/v1internal:fetchAvailableModels",
306
- /** Synchronous generation */
307
- GENERATE_CONTENT: "/v1internal:generateContent",
308
- /** Streaming SSE generation */
309
- STREAM_GENERATE_CONTENT: "/v1internal:streamGenerateContent",
310
- /** Quota / limits per model */
311
- RETRIEVE_USER_QUOTA: "/v1internal:retrieveUserQuotaSummary",
312
- /** Compat alias: quota summary */
313
- RETRIEVE_USER_QUOTA_SUMMARY: "/v1internal:retrieveUserQuotaSummary",
314
- } as const;
315
-
316
- // NOTE (v2.1.15 Phase A): request.ts exports a method-path map under the
317
- // historical name CODE_ASSIST_ENDPOINTS; that name is now owned by models.ts
318
- // (the Cloud Code Assist HOST map), so the request-local method map was
319
- // renamed CODE_ASSIST_METHOD_PATHS there.
320
-
321
- /** Union type of the v1 paths. */
322
- export type CodeAssistEndpointPath = (typeof CODE_ASSIST_PATH_MAP)[keyof typeof CODE_ASSIST_PATH_MAP];
323
-
324
- /**
325
- * Helper to build a full Code Assist URL.
326
- * @param endpoint - path from CODE_ASSIST_PATH_MAP
327
- */
328
- export function buildCodeAssistUrl(endpoint: CodeAssistEndpointPath): string {
329
- return `${CODE_ASSIST_BASE_URL}${endpoint}`;
330
- }
331
-
332
- /**
333
- * Cloud Code Assist full endpoint map — canonical of the CLOUDCODE_ENDPOINTS
334
- * family (v2.1.15 Phase B: accounts.ts, auth.ts and config.ts locals
335
- * deleted). The config.ts lineage shape (base + the six v1internal method
336
- * URLs) is the most complete superset; every consumer reads the method keys.
337
- * v2.1.16: method URLs derive from {@link CODE_ASSIST_PATH_MAP}.
338
- */
339
- export const CLOUDCODE_ENDPOINTS = {
340
- base: CLOUDCODE_BASE_URL,
341
- /** Loads the Cloud Code project and binds the license */
342
- loadCodeAssist: `${CLOUDCODE_BASE_URL}${CODE_ASSIST_PATH_MAP.LOAD_CODE_ASSIST}`,
343
- /** Initial user onboarding */
344
- onboardUser: `${CLOUDCODE_BASE_URL}${CODE_ASSIST_PATH_MAP.ONBOARD_USER}`,
345
- /** Lists models available to the user */
346
- fetchAvailableModels: `${CLOUDCODE_BASE_URL}${CODE_ASSIST_PATH_MAP.FETCH_AVAILABLE_MODELS}`,
347
- /** Non-streaming generation */
348
- generateContent: `${CLOUDCODE_BASE_URL}${CODE_ASSIST_PATH_MAP.GENERATE_CONTENT}`,
349
- /** Streaming SSE generation */
350
- streamGenerateContent: `${CLOUDCODE_BASE_URL}${CODE_ASSIST_PATH_MAP.STREAM_GENERATE_CONTENT}`,
351
- /** Per-model quota summary */
352
- retrieveUserQuotaSummary: `${CLOUDCODE_BASE_URL}${CODE_ASSIST_PATH_MAP.RETRIEVE_USER_QUOTA_SUMMARY}`,
353
- } as const;
354
-
355
- export const GEMINI_CLI_ENDPOINT = CLOUDCODE_BASE_URL;
356
- export const CLOUDAI_COMPANION_ENDPOINT = "https://cloudaicompanion.googleapis.com" as const;
357
- export const CLOUDAI_COMPANION = CLOUDAI_COMPANION_ENDPOINT;
358
- export const CLOUDAICOMPANION_ENDPOINT = CLOUDAI_COMPANION_ENDPOINT;
359
-
360
- // v2.1.16 internal-dedup: the standalone legacy method-path constants now
361
- // derive from CODE_ASSIST_PATH_MAP above — zero duplicated path strings.
362
- export const QUOTA_ENDPOINT = CODE_ASSIST_PATH_MAP.RETRIEVE_USER_QUOTA_SUMMARY;
363
- export const QUOTA_ENDPOINT_V1 = QUOTA_ENDPOINT;
364
- export const MODELS_ENDPOINT = CODE_ASSIST_PATH_MAP.FETCH_AVAILABLE_MODELS;
365
- export const MODELS_ENDPOINT_FULL = MODELS_ENDPOINT;
366
-
367
- export const ONBOARD_USER_ENDPOINT = CODE_ASSIST_PATH_MAP.ONBOARD_USER;
368
- export const LOAD_CODE_ASSIST_ENDPOINT = CODE_ASSIST_PATH_MAP.LOAD_CODE_ASSIST;
369
- export const STREAM_GENERATE_ENDPOINT = CODE_ASSIST_PATH_MAP.STREAM_GENERATE_CONTENT;
370
- export const GENERATE_CONTENT_ENDPOINT = CODE_ASSIST_PATH_MAP.GENERATE_CONTENT;
371
- /** No CODE_ASSIST_PATH_MAP entry exists for this legacy path (zero consumers) — kept as its single literal definition. */
372
- export const RESOLVE_PROJECT_ENDPOINT = "/v1internal:resolveProjectId" as const;
373
- export const FETCH_AVAILABLE_MODELS_METHOD = "fetchAvailableModels" as const;
374
-
375
- /**
376
- * Linear-time trailing-slash strip (regex-free; safe on uncontrolled input —
377
- * the former /\/+$/.replace was polynomial and flagged as ReDoS-prone).
378
- */
379
- export function stripTrailingSlashes(value: string): string {
380
- let end = value.length;
381
- while (end > 0 && value.charCodeAt(end - 1) === 47 /* "/" */) end--;
382
- return end === value.length ? value : value.slice(0, end);
383
- }
384
-
385
- export function buildCloudCodeUrl(base: string, path: string): string {
386
- const b = stripTrailingSlashes(base);
387
- const p = path.startsWith("/") ? path : `/${path}`;
388
- return `${b}${p}`;
389
- }
390
-
391
- // ---------------------------------------------------------------------------
392
- // Project fallback + Gemini CLI bypass
393
- // ---------------------------------------------------------------------------
394
-
395
- export const PROJECT_FALLBACK = "rising-fact-p41fc" as const;
396
- export const PROJECT_ID_FALLBACK = PROJECT_FALLBACK;
397
- export const PROJECT_NAME_FALLBACK = `projects/${PROJECT_FALLBACK}`;
398
- export const PROJECT_NUMBER_FALLBACK = "1071006060591" as const;
399
- export const FALLBACK_PROJECT_ID = PROJECT_FALLBACK;
400
-
401
- export const GEMINI_CLI_PROJECT_RESOLUTION = {
402
- metadata: { ideType: "ANTIGRAVITY", platform: "PLATFORM_UNSPECIFIED", pluginType: "GEMINI" },
403
- tierId: "FREE",
404
- retryableStatuses: [403, 404, 408, 429, 500, 502, 503, 504],
405
- nonRetryableStatuses: [400, 401],
406
- fallbackProjectId: PROJECT_FALLBACK,
407
- loadCodeAssistBodyWithoutProject: {
408
- metadata: { ideType: "ANTIGRAVITY", platform: "PLATFORM_UNSPECIFIED", pluginType: "GEMINI" },
409
- },
410
- onboardUserBody: {
411
- tierId: "FREE",
412
- metadata: { ideType: "ANTIGRAVITY", platform: "PLATFORM_UNSPECIFIED", pluginType: "GEMINI" },
413
- },
414
- } as const;
415
-
416
- export const PROJECT_RESOLUTION_STRATEGY = GEMINI_CLI_PROJECT_RESOLUTION;
417
-
418
- export type QuotaGroup = "antigravity" | "gemini-cli" | "cloudaicompanion";
419
-
420
- // v2.1.15 Phase A: every raw model substrate (flat id lists, rich definition
421
- // lists, model aliases, default model ids and the family-checker helpers)
422
- // moved to models.ts — model identification lives ONLY in models.ts.
423
- // QuotaGroup stays: it types the quota-groups section below and is
424
- // type-imported by models.ts (type-only edge, erased at runtime).
425
-
426
- // OAuth
427
- export const OAUTH_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth" as const;
428
- export const OAUTH_TOKEN_URL = "https://oauth2.googleapis.com/token" as const;
429
- export const OAUTH_USERINFO_URL = "https://www.googleapis.com/oauth2/v2/userinfo" as const;
430
-
431
- /**
432
- * v3 userinfo endpoint (former accounts.ts local variant; the v2 URL above
433
- * is the canonical gemini-cli lineage). Distinct value — one name, one meaning.
434
- */
435
- export const OAUTH_USERINFO_URL_V3 = "https://www.googleapis.com/oauth2/v3/userinfo" as const;
436
- export const OAUTH_REVOKE_URL = "https://oauth2.googleapis.com/revoke" as const;
437
-
438
- export const OAUTH_SCOPES = [
439
- "openid",
440
- "email",
441
- "profile",
442
- "https://www.googleapis.com/auth/cloud-platform",
443
- "https://www.googleapis.com/auth/userinfo.email",
444
- "https://www.googleapis.com/auth/userinfo.profile",
445
- "https://www.googleapis.com/auth/cclog",
446
- "https://www.googleapis.com/auth/experimentsandconfigs",
447
- ] as const;
448
-
449
- export const OAUTH_SCOPES_STRING = OAUTH_SCOPES.join(" ");
450
-
451
- export const PKCE_VERIFIER_LENGTH = 128 as const;
452
- export const PKCE_CODE_CHALLENGE_METHOD = "S256" as const;
453
-
454
- export const OAUTH_CALLBACK_HOST = "127.0.0.1" as const;
455
- export const OAUTH_CALLBACK_PATH = "/callback" as const;
456
- export const OAUTH_STATE_LENGTH = 32 as const;
457
- export const OAUTH_PORT_RANGE = { min: 10000, max: 60000 } as const;
458
-
459
- // Timeouts, jitter, backoff
460
- export const DEFAULT_TIMEOUT_MS = 10_000 as const;
461
- export const CONTENT_TIMEOUT_MS = 60_000 as const;
462
- export const PROJECT_RESOLVE_TIMEOUT_MS = 10_000 as const;
463
- export const QUOTA_TIMEOUT_MS = 15_000 as const;
464
- export const TOKEN_REFRESH_TIMEOUT_MS = 10_000 as const;
465
- export const ONBOARD_TIMEOUT_MS = 15_000 as const;
466
-
467
- /**
468
- * Default control-plane fetch timeout (models.ts lineage — canonical of the
469
- * FETCH_TIMEOUT_MS family; search.ts's 60s content semantic stays local as
470
- * SEARCH_TIMEOUT_MS and version.ts passes VERSION_FETCH_TIMEOUT_MS (5s)
471
- * explicitly at its call sites).
472
- */
473
- export const FETCH_TIMEOUT_MS = 10_000 as const;
474
-
475
- export const JITTER_MIN_MS = 0 as const;
476
- export const JITTER_MAX_MS = 80 as const;
477
-
478
- // v2.1.15 Phase B: getJitter moved to core.js (generic utility owner);
479
- // streaming/quota/plugin import it from there.
480
-
481
- export const BACKOFF_BASE_MS = 250 as const;
482
- export const BACKOFF_MAX_MS = 10_000 as const;
483
- export const BACKOFF_FACTOR = 2 as const;
484
- export const MAX_RETRIES = 3 as const;
485
- export const RETRYABLE_STATUS_CODES = [403, 404, 408, 429, 500, 502, 503, 504] as const;
486
- export const RETRYABLE_ERROR_CODES = ["403", "404", "5xx"] as const;
487
-
488
- export const QUOTA_CACHE_TTL_MS = 15 * 60 * 1000;
489
- export const QUOTA_CACHE_TTL_MIN_MS = 2 * 60 * 1000;
490
-
491
- /**
492
- * Quota cache TTL ceiling — canonical is the quota.ts lineage value (30 min;
493
- * the former 10 min constants.ts variant had zero consumers). quota.ts's
494
- * resilient-layer 10 min max stays local there under its own accurate name.
495
- */
496
- export const QUOTA_CACHE_TTL_MAX_MS = 30 * 60 * 1000;
497
- export const QUOTA_SOFT_THRESHOLD = 0.9 as const;
498
-
499
- /**
500
- * Quota hard-exhaustion threshold — canonical is the quota.ts lineage value
501
- * (98% used => 2% remaining => hard exhausted; the former 1.0 constants.ts
502
- * variant had zero consumers and was not exercised by the live chain).
503
- */
504
- export const QUOTA_HARD_THRESHOLD = 0.98 as const;
505
-
506
- export const ACCOUNTS_FILE_NAME = "antigravity-accounts.json" as const;
507
- export const ACCOUNTS_CONFIG_DIR = ".config/opencode" as const;
508
- export const ACCOUNTS_FILE_MODE = 0o600 as const;
509
-
510
- // v2.1.15 Phase A: THINKING_LEVELS, ThinkingLevel, THINKING_BUDGET_MAP,
511
- // THINKING_BUDGET_MAX_CLAUDE and THINKING_BUDGET_MAX_GEMINI moved to models.ts
512
- // (canonical 6-level superset including "tiered").
513
- export const LRU_THINKING_CACHE_SIZE = 100 as const;
514
-
515
- export const DEBUG_LOG_MAX_BYTES = 10 * 1024 * 1024;
516
- export const DEBUG_LOG_RETENTION_DAYS = 7 as const;
517
- export const DEBUG_BUFFER_TUI_LINES = 1000 as const;
518
-
519
- export const MODALITIES_INPUT = ["text", "image", "pdf"] as const;
520
- export const GOOGLE_SEARCH_TOOL_NAME = "google_search" as const;
521
- export const URL_CONTEXT_TOOL_NAME = "url_context" as const;
522
-
523
- export const CONTEXT_WINDOW_ANTIGRAVITY = 1_048_576 as const;
524
- export const OUTPUT_LIMIT_ANTIGRAVITY = 65_535 as const;
525
- // v2.1.15 Phase A: CONTEXT_WINDOW_CLAUDE, OUTPUT_LIMIT_CLAUDE,
526
- // CONTEXT_WINDOW_GPT_OSS and OUTPUT_LIMIT_GPT_OSS moved to models.ts (the
527
- // GPT-OSS canonicals there are 200_000 / 64_000; the divergent local
528
- // 131_072 / 32_768 values had zero consumers and were dropped).
529
-
530
- /**
531
- * FNV-1a 32-bit constants (models.ts and request.ts locals deleted in
532
- * v2.1.15 Phase B; core.ts's fnv implementations keep their own inline
533
- * literals so core stays free of cross-module value coupling at the hash
534
- * primitive level).
535
- */
536
- export const FNV_OFFSET_BASIS = 2_166_136_261 as const;
537
- export const FNV_PRIME = 16_777_619 as const;
538
-
539
- export const CONSTANTS = {
540
- versionFallback: ANTIGRAVITY_VERSION_FALLBACK,
541
- versionMinSupported: ANTIGRAVITY_VERSION_MIN_SUPPORTED,
542
- userAgentFallback: ANTIGRAVITY_USER_AGENT_FALLBACK,
543
- clientId: ANTIGRAVITY_CLIENT_ID,
544
- clientSecret: ANTIGRAVITY_CLIENT_SECRET,
545
- endpoints: ANTIGRAVITY_ENDPOINTS,
546
- endpointFallbacks: ANTIGRAVITY_ENDPOINT_FALLBACKS,
547
- codeAssistEndpoints: ENDPOINTS,
548
- endpointOrder: [ENDPOINTS.PROD, ENDPOINTS.DAILY, ENDPOINTS.SANDBOX] as const,
549
- geminiCliEndpoint: GEMINI_CLI_ENDPOINT,
550
- cloudaicompanion: CLOUDAI_COMPANION_ENDPOINT,
551
- quota: QUOTA_ENDPOINT,
552
- modelsEndpoint: MODELS_ENDPOINT,
553
- projectFallback: PROJECT_FALLBACK,
554
- projectResolution: PROJECT_RESOLUTION_STRATEGY,
555
- scopes: OAUTH_SCOPES,
556
- } as const;
557
-
558
- // ===========================================================================
559
- // Ported v1.0.0 surface (auth/constants) — every unique export preserved
560
- // ===========================================================================
561
-
562
- // ---------------------------------------------------------------------------
563
- // V1-01. OAuth client — Gemini CLI official identification
564
- // ---------------------------------------------------------------------------
565
-
566
- /**
567
- * Official Gemini CLI OAuth Client ID (Google Cloud SDK — public client used by the CLI).
568
- * @constant
569
- */
570
- export const GEMINI_CLI_OAUTH_CLIENT_ID = [
571
- "681255809395",
572
- "-oo8ft2oprdrnp9e3aqf6av3",
573
- "hmdib135j",
574
- ".apps.",
575
- "googleusercontent",
576
- ".com",
577
- ].join("");
578
-
579
- /**
580
- * Official Gemini CLI OAuth Client Secret.
581
- * @constant
582
- */
583
- export const GEMINI_CLI_OAUTH_CLIENT_SECRET = ["GOCSPX", "-4uHgMPm", "-1o7Sk-geV6", "Cu5clXFsxl"].join("");
584
-
585
- /** Scopes required by Gemini CLI / Cloud Code Assist. */
586
- export const GEMINI_CLI_SCOPES = [
587
- "https://www.googleapis.com/auth/cloud-platform",
588
- "https://www.googleapis.com/auth/userinfo.email",
589
- "https://www.googleapis.com/auth/userinfo.profile",
590
- ] as const;
591
-
592
- /** Scopes as a query string ready for OAuth. */
593
- export const GEMINI_CLI_SCOPES_JOINED = GEMINI_CLI_SCOPES.join(" ");
594
-
595
- /**
596
- * Official Antigravity CLI (`agy`) OAuth client id — THE single owner of the
597
- * real (never the blinded decoy above) client pair. Env-overridable through
598
- * ANTIGRAVITY_CLIENT_ID / GOOGLE_CLIENT_ID; the fallback literal is assembled
599
- * from segments exactly like the `agy` binary embeds it. The grand merge
600
- * consolidation moved the owner from auth.ts into this layer-0 module so the
601
- * value never participates in an import cycle: auth.ts (the authentication
602
- * surface) and accounts.ts (the account store) both alias it while the module
603
- * graph stays legal under every evaluation order.
604
- */
605
- export const ANTIGRAVITY_CLI_OAUTH_CLIENT_ID =
606
- process.env.ANTIGRAVITY_CLIENT_ID?.trim() ||
607
- process.env.GOOGLE_CLIENT_ID?.trim() ||
608
- ["1071006060591", "-tmhssin2h21lcre235vtol", "ojh4g403ep", ".apps.", "googleusercontent", ".com"].join("");
609
-
610
- /**
611
- * Official Antigravity CLI (`agy`) OAuth client secret — the env-overridable
612
- * owner (ANTIGRAVITY_CLIENT_SECRET) of the real pair, paired with
613
- * {@link ANTIGRAVITY_CLI_OAUTH_CLIENT_ID}.
614
- */
615
- export const ANTIGRAVITY_CLI_OAUTH_CLIENT_SECRET =
616
- process.env.ANTIGRAVITY_CLIENT_SECRET?.trim() || ["GOCSPX", "-K58FWR486LdL", "J1mLB8sXC4z6qDAf"].join("");
617
-
618
- // ---------------------------------------------------------------------------
619
- // V1-02. Endpoints — OAuth + versioned bases
620
- // (v2.1.16: CODE_ASSIST_BASE_URL / CODE_ASSIST_PATH_MAP /
621
- // CodeAssistEndpointPath / buildCodeAssistUrl moved up into the main
622
- // endpoints section so every method-path derivation sits below the map.)
623
- // ---------------------------------------------------------------------------
624
-
625
- /** Google OAuth endpoints. */
626
- export const OAUTH_ENDPOINTS = {
627
- /** Authorization code URL */
628
- AUTH: "https://accounts.google.com/o/oauth2/v2/auth",
629
- /** Token exchange */
630
- TOKEN: "https://oauth2.googleapis.com/token",
631
- /** Userinfo OpenID Connect */
632
- USERINFO: "https://www.googleapis.com/oauth2/v3/userinfo",
633
- /** Token info / introspect */
634
- TOKENINFO: "https://oauth2.googleapis.com/tokeninfo",
635
- /** Revoke */
636
- REVOKE: "https://oauth2.googleapis.com/revoke",
637
- } as const;
638
-
639
- /**
640
- * Antigravity versioned endpoint bases (renamed from v1 ANTIGRAVITY_ENDPOINTS
641
- * to avoid collision with the v2 cascade URL array above).
642
- * Antigravity routes via cloudcode-pa but with different prefixes per version.
643
- */
644
- export const ANTIGRAVITY_ENDPOINT_SET = {
645
- /** v1 — legacy */
646
- V1_BASE: "https://daily-cloudcode-pa.googleapis.com",
647
- /** v1internal current */
648
- V1INTERNAL_BASE: "https://cloudcode-pa.googleapis.com",
649
- /** v1internal daily (canary) */
650
- DAILY_V1INTERNAL_BASE: "https://daily-cloudcode-pa.googleapis.com",
651
- /** autodetect endpoint (resolves cloudcode client) */
652
- AUTO_BASE: "https://cloudcode-pa.googleapis.com",
653
- } as const;
654
-
655
- export const ANTIGRAVITY_VERSION_ENDPOINTS = {
656
- v1: {
657
- base: ANTIGRAVITY_ENDPOINT_SET.V1_BASE,
658
- load: "/v1:loadCodeAssist",
659
- onboard: "/v1:onboardUser",
660
- },
661
- v1internal: {
662
- base: ANTIGRAVITY_ENDPOINT_SET.V1INTERNAL_BASE,
663
- load: CODE_ASSIST_PATH_MAP.LOAD_CODE_ASSIST,
664
- onboard: CODE_ASSIST_PATH_MAP.ONBOARD_USER,
665
- fetchModels: CODE_ASSIST_PATH_MAP.FETCH_AVAILABLE_MODELS,
666
- generate: CODE_ASSIST_PATH_MAP.GENERATE_CONTENT,
667
- streamGenerate: CODE_ASSIST_PATH_MAP.STREAM_GENERATE_CONTENT,
668
- quota: CODE_ASSIST_PATH_MAP.RETRIEVE_USER_QUOTA,
669
- },
670
- "daily-v1internal": {
671
- base: ANTIGRAVITY_ENDPOINT_SET.DAILY_V1INTERNAL_BASE,
672
- // v2.1.16: method paths derive from CODE_ASSIST_PATH_MAP (identical values).
673
- load: CODE_ASSIST_PATH_MAP.LOAD_CODE_ASSIST,
674
- onboard: CODE_ASSIST_PATH_MAP.ONBOARD_USER,
675
- fetchModels: CODE_ASSIST_PATH_MAP.FETCH_AVAILABLE_MODELS,
676
- generate: CODE_ASSIST_PATH_MAP.GENERATE_CONTENT,
677
- streamGenerate: CODE_ASSIST_PATH_MAP.STREAM_GENERATE_CONTENT,
678
- quota: CODE_ASSIST_PATH_MAP.RETRIEVE_USER_QUOTA,
679
- },
680
- } as const;
681
-
682
- export type AntigravityVersion = keyof typeof ANTIGRAVITY_VERSION_ENDPOINTS;
683
-
684
- // ---------------------------------------------------------------------------
685
- // V1-03. Project ID fallback list
686
- // ---------------------------------------------------------------------------
687
-
688
- /** Public fallback Project ID list (seed candidates without billing). */
689
- export const PROJECT_ID_FALLBACKS = [
690
- "rising-fact-p41fc",
691
- "rising-fact-p41fc-1",
692
- "unwritten-orb-463209-q6",
693
- "cloud-code-123456",
694
- ] as const;
695
-
696
- // ---------------------------------------------------------------------------
697
- // V1-04. Version pools — simulated real releases
698
- // ---------------------------------------------------------------------------
699
-
700
- /**
701
- * Gemini CLI version pool — date-aware, consulted 2026-08-26 (npm
702
- * @google/gemini-cli latest = 0.57.0). Canonical of the pool family
703
- * (v2.1.15 Phase B): the fingerprint.ts 8-entry telemetry superset —
704
- * strictly grows the former 6-entry constants variant.
705
- */
706
- export const GEMINI_CLI_VERSION_POOL = [
707
- "0.57.0",
708
- "0.56.0",
709
- "0.55.1",
710
- "0.54.0",
711
- "0.53.0",
712
- "0.52.0",
713
- "0.51.2",
714
- "0.50.0",
715
- ] as const;
716
-
717
- export const CURRENT_GEMINI_CLI_VERSION = "0.57.0" as const;
718
-
719
- /** google-api-nodejs-client version pool. */
720
- export const GAPI_CLIENT_VERSION_POOL = ["9.15.1", "9.14.0", "9.15.0", "9.13.0"] as const;
721
-
722
- export const CURRENT_GAPI_CLIENT_VERSION = "9.15.1" as const;
723
-
724
- /**
725
- * Node.js gl-node version pool for X-Goog-Api-Client anti-ban rotation —
726
- * canonical of the pool family (v2.1.15 Phase B): the fingerprint.ts
727
- * telemetry lineage (real Node LTS values); fingerprint.ts imports this.
728
- */
729
- export const GL_NODE_VERSION_POOL = [
730
- "22.19.0",
731
- "22.16.0",
732
- "22.14.0",
733
- "20.19.3",
734
- "20.18.1",
735
- "20.17.0",
736
- "20.11.0",
737
- "18.20.4",
738
- ] as const;
739
-
740
- export const CURRENT_GL_NODE_VERSION = "22.19.0" as const;
741
-
742
- /**
743
- * Antigravity CLI (`agy`) version pool from the official update manifest
744
- * (2026-08-26) — canonical of the pool family (v2.1.15 Phase B: identical
745
- * 5-entry values merged from auth.ts and fingerprint.ts).
746
- */
747
- export const ANTIGRAVITY_CLI_VERSION_POOL = ["1.1.21", "1.1.20", "1.1.19", "1.1.18", "1.1.17"] as const;
748
-
749
- // v2.1.15 Phase A: the V1-05 raw routing catalog (V1_CATALOG_MODELS +
750
- // ModelVendor + ApiProvider types) and the DEFAULT_MODEL_ID /
751
- // DEFAULT_FALLBACK_MODEL_IDS family moved to models.ts; MODEL_BY_ID and
752
- // MODEL_ROUTING already live there.
753
-
754
- // ---------------------------------------------------------------------------
755
- // V1-07. Fingerprint pools — anti-ban randomization
756
- // ---------------------------------------------------------------------------
757
-
758
- export type SupportedPlatform = "linux" | "darwin" | "win32";
759
- export type SupportedArch = "x64" | "arm64" | "arm";
760
-
761
- export const PLATFORM_POOL: readonly SupportedPlatform[] = ["linux", "darwin", "win32"] as const;
762
-
763
- export const ARCH_POOL: readonly SupportedArch[] = ["x64", "arm64"] as const;
764
-
765
- export const OS_VERSION_POOL = {
766
- linux: ["6.8.0-52-generic", "6.5.0-44-generic", "6.11.0-8-generic"] as const,
767
- darwin: ["24.3.0", "24.2.0", "23.6.0", "24.4.0"] as const,
768
- win32: ["10.0.26100", "10.0.22631", "10.0.19045"] as const,
769
- } as const;
770
-
771
- export const FINGERPRINT_IDE_TYPES = ["IDE_UNSPECIFIED", "VSCODE", "INTELLIJ"] as const;
772
-
773
- export const FINGERPRINT_PLATFORMS = ["PLATFORM_UNSPECIFIED", "LINUX", "DARWIN", "WINDOWS"] as const;
774
-
775
- export const FINGERPRINT_PLUGIN_TYPES = ["GEMINI", "GEMINI_CLI"] as const;
776
-
777
- export const FINGERPRINT_USER_AGENT_SOURCES = ["GitHub", "npm"] as const;
778
-
779
- // v2.1.15 Phase B: getRandomPlatformString, pickRandom, getGeminiCLIHeaders,
780
- // getGeminiCLIHeadersWithOptions, getAntigravityHeaders,
781
- // getAntigravityHeadersWithOptions and the GeminiCliHeaderOptions /
782
- // AntigravityHeaderOptions types moved to fingerprint.ts — THE identity
783
- // masquerade owner (pickRandom itself lives in core.js). The raw pools above
784
- // stay here; fingerprint.ts imports them.
785
-
786
- // ---------------------------------------------------------------------------
787
- // V1-09. System prompts
788
- // ---------------------------------------------------------------------------
789
-
790
- export const SYSTEM_PROMPTS = {
791
- /** base prompt for code assist */
792
- CODE_ASSIST_BASE:
793
- "You are Gemini, a highly capable AI coding assistant integrated into opencode via Antigravity auth.",
794
-
795
- /** prompt for user onboarding */
796
- ONBOARDING: "Initialize Cloud Code Assist project onboarding for development workflow.",
797
-
798
- /** minimal prompt for quota queries */
799
- QUOTA_QUERY: "quota_retrieve",
800
-
801
- /** safety prompt — preserves IDE behavior */
802
- IDE_PRESERVE: "Respond as the integrated IDE code assistance. Maintain context awareness and file system access.",
803
- } as const;
804
-
805
- // ---------------------------------------------------------------------------
806
- // V1-10. File paths — resolvers honoring OPENCODE_CONFIG_DIR with fallback
807
- // ---------------------------------------------------------------------------
808
-
809
- /** Resolves the config base dir: process.env.OPENCODE_CONFIG_DIR or ~/.config/opencode/. */
810
- export function resolveOpenCodeBaseDir(): string {
811
- const envDir = process.env.OPENCODE_CONFIG_DIR?.trim();
812
- if (envDir && envDir.length > 0) {
813
- return nodePath.resolve(envDir);
814
- }
815
- return nodePath.join(homedir(), ".config", "opencode");
816
- }
817
-
818
- /** Resolves critical plugin file paths. */
819
- export const FILE_PATHS = {
820
- /** dynamic getter — avoids caching in tests */
821
- get baseDir(): string {
822
- return resolveOpenCodeBaseDir();
823
- },
824
-
825
- get authDir(): string {
826
- return nodePath.join(resolveOpenCodeBaseDir(), "auth");
827
- },
828
-
829
- get tokenFile(): string {
830
- return nodePath.join(resolveOpenCodeBaseDir(), "auth", "gemini-cli-tokens.json");
831
- },
832
-
833
- get credentialsFile(): string {
834
- return nodePath.join(resolveOpenCodeBaseDir(), "auth", "antigravity-credentials.json");
835
- },
836
-
837
- get projectFile(): string {
838
- return nodePath.join(resolveOpenCodeBaseDir(), "auth", "project-id.json");
839
- },
840
-
841
- get configFile(): string {
842
- return nodePath.join(resolveOpenCodeBaseDir(), "opencode.json");
843
- },
844
-
845
- get cacheDir(): string {
846
- return nodePath.join(resolveOpenCodeBaseDir(), "cache", "antigravity");
847
- },
848
-
849
- get quotaCacheFile(): string {
850
- return nodePath.join(resolveOpenCodeBaseDir(), "cache", "antigravity", "quota.json");
851
- },
852
-
853
- get modelsCacheFile(): string {
854
- return nodePath.join(resolveOpenCodeBaseDir(), "cache", "antigravity", "models.json");
855
- },
856
-
857
- /** resolves a custom sub-path inside baseDir */
858
- resolve(...segments: string[]): string {
859
- return nodePath.join(resolveOpenCodeBaseDir(), ...segments);
860
- },
861
-
862
- /**
863
- * Isolated credential directory — platform-agnostic and user-overridable.
864
- * Resolution order (NO hardcoded machine paths):
865
- * 1. MAENE_ISOLATED_DIR env (explicit user override)
866
- * 2. <baseDir>/auth (beside the rest of the provider state)
867
- */
868
- get isolatedDir(): string {
869
- const override = process.env.MAENE_ISOLATED_DIR?.trim();
870
- if (override) return nodePath.resolve(override);
871
- return nodePath.join(resolveOpenCodeBaseDir(), "auth");
872
- },
873
- } as const;
874
-
875
- // ---------------------------------------------------------------------------
876
- // V1-11. Quota groups & limits
877
- // ---------------------------------------------------------------------------
878
-
879
- // v2.1.16 dead-code cleanup: QUOTA_GROUPS, QUOTA_GROUP_MAP and the
880
- // QuotaGroupDef interface had zero consumers repo-wide (the live quota-group
881
- // routing lives in quota.ts QUOTA_GROUP_DEFS) and were deleted.
882
-
883
- // ---------------------------------------------------------------------------
884
- // V1-12. Retry / timeout / version-fallback policies
885
- // ---------------------------------------------------------------------------
886
-
887
- export const VERSION_FALLBACK_CHAIN: readonly AntigravityVersion[] = ["v1internal", "daily-v1internal", "v1"] as const;
888
-
889
- export const RETRY_POLICY = {
890
- maxRetries: 3,
891
- baseDelayMs: 500,
892
- maxDelayMs: 5000,
893
- jitter: true,
894
- retryOn: [429, 500, 502, 503, 504] as const,
895
- } as const;
896
-
897
- export const TIMEOUTS = {
898
- OAUTH_MS: 15_000,
899
- LOAD_CODE_ASSIST_MS: 20_000,
900
- GENERATE_MS: 120_000,
901
- STREAM_MS: 300_000,
902
- QUOTA_MS: 10_000,
903
- } as const;
904
-
905
- export const PLUGIN_VERSION = "2.0.0" as const;
906
-
907
- // ---------------------------------------------------------------------------
908
- // V1-13. Complete fingerprint & anti-ban pools
909
- // ---------------------------------------------------------------------------
910
-
911
- export const FINGERPRINT_POOLS = {
912
- cliVersions: GEMINI_CLI_VERSION_POOL,
913
- gapiVersions: GAPI_CLIENT_VERSION_POOL,
914
- nodeVersions: GL_NODE_VERSION_POOL,
915
- platforms: PLATFORM_POOL,
916
- archs: ARCH_POOL,
917
- osVersions: OS_VERSION_POOL,
918
- ideTypes: FINGERPRINT_IDE_TYPES,
919
- platformMetas: FINGERPRINT_PLATFORMS,
920
- pluginTypes: FINGERPRINT_PLUGIN_TYPES,
921
- /** random delay between requests to avoid rate-ban fingerprinting (ms) */
922
- antiBanDelayMs: {
923
- min: 80,
924
- max: 350,
925
- },
926
- } as const;
927
-
928
- /** Generates a randomized anti-ban delay. */
929
- export function getAntiBanDelayMs(): number {
930
- const { min, max } = FINGERPRINT_POOLS.antiBanDelayMs;
931
- return Math.floor(Math.random() * (max - min + 1)) + min;
932
- }
933
-
934
- // ---------------------------------------------------------------------------
935
- // V1-14. Compatibility barrel
936
- // ---------------------------------------------------------------------------
937
-
938
- // v2.1.16 dead-code cleanup: the CONSTANTS_V1 barrel had zero consumers
939
- // repo-wide and was deleted together with its QUOTA_GROUPS member (the live
940
- // v1 compatibility surface is the named exports above plus the CONSTANTS
941
- // namespace object and the default export below).
942
-
943
- export default CONSTANTS;