@wenathlan/devthink 2.0.13 → 2.0.15

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 +27 -0
  2. package/accounts.ts +2087 -0
  3. package/agent.ts +2331 -0
  4. package/antigravity.ts +2139 -0
  5. package/apifreeze.ts +4146 -0
  6. package/auth.ts +642 -0
  7. package/background.ts +16837 -0
  8. package/bridge.ts +2080 -0
  9. package/build.ts +54 -0
  10. package/bun.ts +26 -0
  11. package/capture.ts +1614 -0
  12. package/checksecrets.ts +72 -0
  13. package/cjs.ts +9 -0
  14. package/cli.ts +3500 -0
  15. package/commands.ts +1101 -0
  16. package/companion.ts +450 -0
  17. package/compatibility.ts +37 -0
  18. package/config.ts +3137 -0
  19. package/constants.ts +943 -0
  20. package/core.ts +1473 -0
  21. package/crossbrowser.ts +1359 -0
  22. package/dashdone.ts +605 -0
  23. package/data.ts +943 -0
  24. package/database.ts +133 -0
  25. package/debug.ts +850 -0
  26. package/deno.ts +27 -0
  27. package/devthink.ts +707 -0
  28. package/dist/accounts.d.ts +409 -0
  29. package/dist/agent.d.ts +837 -0
  30. package/dist/antigravity.d.ts +380 -0
  31. package/dist/apifreeze.d.ts +113 -0
  32. package/dist/auth.d.ts +224 -0
  33. package/{bridge.d.ts → dist/bridge.d.ts} +1 -1
  34. package/dist/capture.d.ts +595 -0
  35. package/dist/cjs.d.ts +6 -0
  36. package/{cli.js → dist/cli.js} +2 -2
  37. package/dist/commands.d.ts +310 -0
  38. package/dist/compatibility.d.ts +17 -0
  39. package/dist/config.d.ts +1853 -0
  40. package/dist/constants.d.ts +637 -0
  41. package/dist/core.d.ts +361 -0
  42. package/dist/data.d.ts +330 -0
  43. package/dist/database.d.ts +24 -0
  44. package/dist/debug.d.ts +270 -0
  45. package/dist/engine.d.ts +74 -0
  46. package/dist/environments.d.ts +244 -0
  47. package/dist/evidence.d.ts +277 -0
  48. package/dist/export.d.ts +311 -0
  49. package/dist/fingerprint.d.ts +594 -0
  50. package/dist/flow.d.ts +300 -0
  51. package/dist/gates.d.ts +103 -0
  52. package/dist/identity.d.ts +51 -0
  53. package/dist/ids.d.ts +7 -0
  54. package/dist/llm.d.ts +652 -0
  55. package/dist/models.d.ts +1807 -0
  56. package/dist/net.d.ts +325 -0
  57. package/dist/neutral.d.ts +41 -0
  58. package/dist/oauth.d.ts +703 -0
  59. package/dist/page.d.ts +1166 -0
  60. package/dist/perf.d.ts +481 -0
  61. package/dist/plan.d.ts +134 -0
  62. package/dist/project.d.ts +395 -0
  63. package/dist/providers.d.ts +37 -0
  64. package/dist/quota.d.ts +453 -0
  65. package/dist/recovery.d.ts +621 -0
  66. package/dist/request.d.ts +1492 -0
  67. package/dist/run.d.ts +779 -0
  68. package/dist/runtime.d.ts +212 -0
  69. package/dist/search.d.ts +375 -0
  70. package/dist/security.d.ts +534 -0
  71. package/dist/serve.d.ts +136 -0
  72. package/dist/session.d.ts +296 -0
  73. package/dist/storage.d.ts +53 -0
  74. package/dist/streaming.d.ts +1119 -0
  75. package/dist/swarm.d.ts +328 -0
  76. package/dist/tools.d.ts +170 -0
  77. package/dist/types.d.ts +8357 -0
  78. package/dist/utils.d.ts +82 -0
  79. package/dist/version.d.ts +7 -0
  80. package/dist/versionregistry.d.ts +406 -0
  81. package/dist/views.d.ts +579 -0
  82. package/dist/workbenchsession.d.ts +69 -0
  83. package/dist/workflow.d.ts +649 -0
  84. package/docs/readme.md +92 -0
  85. package/docs/schemas/antigravity.json +192 -0
  86. package/engine.ts +1524 -0
  87. package/environments.ts +1005 -0
  88. package/evidence.ts +643 -0
  89. package/export.ts +889 -0
  90. package/fingerprint.ts +1458 -0
  91. package/flow.ts +1190 -0
  92. package/gates.ts +307 -0
  93. package/gateway.ts +34 -0
  94. package/hardening.ts +191 -0
  95. package/headless.ts +369 -0
  96. package/http.ts +2110 -0
  97. package/identity.ts +246 -0
  98. package/ids.ts +26 -0
  99. package/index.ts +369 -0
  100. package/llm.ts +2682 -0
  101. package/mcp.ts +1835 -0
  102. package/{memory.js → memory.ts} +3834 -2310
  103. package/models.ts +3805 -0
  104. package/modes.ts +43 -0
  105. package/net.ts +1214 -0
  106. package/neutral.ts +362 -0
  107. package/node.ts +26 -0
  108. package/oauth.ts +2216 -0
  109. package/offscreen.ts +170 -0
  110. package/pack.ts +956 -0
  111. package/package.json +175 -82
  112. package/page.ts +7824 -0
  113. package/pagebridge.ts +1116 -0
  114. package/perf.ts +957 -0
  115. package/plan.ts +672 -0
  116. package/plugin.ts +76 -0
  117. package/{policy.js → policy.ts} +5073 -4679
  118. package/prisma.config.ts +27 -0
  119. package/progress.ts +1308 -0
  120. package/project.ts +1291 -0
  121. package/protocol.ts +4187 -0
  122. package/providers.ts +246 -0
  123. package/quota.ts +1887 -0
  124. package/recovery.ts +2433 -0
  125. package/request.ts +4482 -0
  126. package/run.ts +2135 -0
  127. package/runtime.ts +526 -0
  128. package/search.ts +1760 -0
  129. package/security.ts +1673 -0
  130. package/serve.ts +419 -0
  131. package/server.ts +5538 -0
  132. package/session.ts +1162 -0
  133. package/storage.ts +182 -0
  134. package/streaming.ts +4101 -0
  135. package/swarm.ts +884 -0
  136. package/sync.ts +56 -0
  137. package/tests/agentcert.test.ts +128 -0
  138. package/tests/agentfleet.test.ts +214 -0
  139. package/tests/agentreview.test.ts +241 -0
  140. package/tests/agentstream.test.ts +335 -0
  141. package/tests/agentwork.test.ts +356 -0
  142. package/tests/apifreeze.test.ts +290 -0
  143. package/tests/apimap.test.ts +112 -0
  144. package/tests/approvalgate.test.ts +175 -0
  145. package/tests/artifactmanifest.test.ts +204 -0
  146. package/tests/attentionfeed.test.ts +163 -0
  147. package/tests/backgroundruns.test.ts +100 -0
  148. package/tests/batchscheduling.test.ts +131 -0
  149. package/tests/blackboard.test.ts +238 -0
  150. package/tests/bridge.test.ts +1088 -0
  151. package/tests/browsercoverage.test.ts +134 -0
  152. package/tests/browserpolyfills.test.ts +124 -0
  153. package/tests/build.mjs +1260 -0
  154. package/tests/clientauth.test.ts +223 -0
  155. package/tests/clitools.test.ts +578 -0
  156. package/tests/confirmgates.test.ts +190 -0
  157. package/tests/containerpack.test.ts +143 -0
  158. package/tests/controlflow.test.ts +2120 -0
  159. package/tests/coordination.test.ts +345 -0
  160. package/tests/copyscreen.test.ts +139 -0
  161. package/tests/core.test.ts +417 -0
  162. package/tests/costcert.test.ts +95 -0
  163. package/tests/crossbrowser.test.ts +115 -0
  164. package/tests/cspaudit.test.ts +79 -0
  165. package/tests/dashdone.test.ts +615 -0
  166. package/tests/datagrid.test.ts +137 -0
  167. package/tests/doccheck.test.ts +107 -0
  168. package/tests/dombatch.test.ts +109 -0
  169. package/tests/emulation.test.ts +282 -0
  170. package/tests/environments.test.ts +259 -0
  171. package/tests/evidenceviews.test.ts +88 -0
  172. package/tests/exporttools.test.ts +185 -0
  173. package/tests/firefoxprep.test.ts +134 -0
  174. package/tests/flowlibrary.test.ts +242 -0
  175. package/tests/flowrun.test.ts +303 -0
  176. package/tests/forensics.test.ts +439 -0
  177. package/tests/gateway.test.ts +939 -0
  178. package/tests/headlesslib.test.ts +171 -0
  179. package/tests/httpstream.test.ts +277 -0
  180. package/tests/immutablelog.test.ts +157 -0
  181. package/tests/inboundguard.test.ts +177 -0
  182. package/tests/lazyload.test.ts +72 -0
  183. package/tests/librarymodes.test.ts +623 -0
  184. package/tests/llm.test.ts +696 -0
  185. package/tests/manifest.test.ts +226 -0
  186. package/tests/maskinputs.test.ts +150 -0
  187. package/tests/matrixverify.test.ts +111 -0
  188. package/tests/mavenpack.test.ts +75 -0
  189. package/tests/mcpserver.test.ts +704 -0
  190. package/tests/memory.test.ts +4155 -0
  191. package/tests/memorycare.test.ts +230 -0
  192. package/tests/migrateplan.test.ts +349 -0
  193. package/tests/minimization.test.ts +414 -0
  194. package/tests/modelroute.test.ts +112 -0
  195. package/tests/multiagent.test.ts +440 -0
  196. package/tests/nativebridge.test.ts +807 -0
  197. package/tests/navigation.test.ts +284 -0
  198. package/tests/nugetpack.test.ts +83 -0
  199. package/tests/orchestration.test.ts +449 -0
  200. package/tests/originpolicy.test.ts +405 -0
  201. package/tests/outputcompare.test.ts +97 -0
  202. package/tests/package.test.ts +91 -0
  203. package/tests/pagebridge.test.ts +5909 -0
  204. package/tests/pentest.test.ts +75 -0
  205. package/tests/perfrecords.test.ts +257 -0
  206. package/tests/permdiff.test.ts +85 -0
  207. package/tests/phishguard.test.ts +128 -0
  208. package/tests/pickerviews.test.ts +155 -0
  209. package/tests/pipelines.test.ts +381 -0
  210. package/tests/planlint.test.ts +240 -0
  211. package/tests/planreview.test.ts +383 -0
  212. package/tests/platformtargets.test.ts +56 -0
  213. package/tests/policy.test.ts +8284 -0
  214. package/tests/portability.test.ts +96 -0
  215. package/tests/progress.test.ts +1036 -0
  216. package/tests/promptlibrary.test.ts +116 -0
  217. package/tests/protocol.test.ts +4793 -0
  218. package/tests/publishingpipeline.test.ts +314 -0
  219. package/tests/quickactions.test.ts +164 -0
  220. package/tests/readiness.test.ts +78 -0
  221. package/tests/recipes.test.ts +163 -0
  222. package/tests/redactshots.test.ts +216 -0
  223. package/tests/registernvidiakeys.ts +51 -0
  224. package/tests/relayserve.test.ts +304 -0
  225. package/tests/releasenotes.test.ts +276 -0
  226. package/tests/resilience.test.ts +467 -0
  227. package/tests/resourceaware.test.ts +187 -0
  228. package/tests/runbudget.test.ts +125 -0
  229. package/tests/runhistory.test.ts +299 -0
  230. package/tests/runreplay.test.ts +113 -0
  231. package/tests/runresume.test.ts +184 -0
  232. package/tests/runstate.test.ts +288 -0
  233. package/tests/runtimeadapters.test.ts +251 -0
  234. package/tests/safariskeleton.test.ts +115 -0
  235. package/tests/sandboxframe.test.ts +196 -0
  236. package/tests/sbom.test.ts +105 -0
  237. package/tests/secretvault.test.ts +188 -0
  238. package/tests/selcache.test.ts +111 -0
  239. package/tests/sessioninterface.test.ts +791 -0
  240. package/tests/sessions.test.ts +591 -0
  241. package/tests/siteprefs.test.ts +228 -0
  242. package/tests/snapshotdelta.test.ts +165 -0
  243. package/tests/statusviews.test.ts +237 -0
  244. package/tests/stepmeter.test.ts +200 -0
  245. package/tests/streamparse.test.ts +163 -0
  246. package/tests/stylepruning.test.ts +90 -0
  247. package/tests/surfaces.test.ts +282 -0
  248. package/tests/sweep.test.ts +78 -0
  249. package/tests/syncbridge.test.ts +164 -0
  250. package/tests/taskqueue.test.ts +206 -0
  251. package/tests/toolcalls.test.ts +336 -0
  252. package/tests/toolcatalog.test.ts +201 -0
  253. package/tests/torture-agent.test.ts +706 -0
  254. package/tests/torture-auth.test.ts +461 -0
  255. package/tests/torture-commands.test.ts +895 -0
  256. package/tests/torture-data.test.ts +923 -0
  257. package/tests/torture-environments.test.ts +285 -0
  258. package/tests/torture-export.test.ts +263 -0
  259. package/tests/torture-http.test.ts +1379 -0
  260. package/tests/torture-llm.test.ts +808 -0
  261. package/tests/torture-memory.test.ts +1084 -0
  262. package/tests/torture-plan.test.ts +829 -0
  263. package/tests/torture-run.test.ts +626 -0
  264. package/tests/torture-session.test.ts +928 -0
  265. package/tests/torture-swarm.test.ts +1245 -0
  266. package/tests/torture-tools.test.ts +964 -0
  267. package/tests/torture-workflow.test.ts +2354 -0
  268. package/tests/tourviews.test.ts +52 -0
  269. package/tests/transparency.test.ts +147 -0
  270. package/tests/trigger.test.ts +941 -0
  271. package/tests/v1sunset.test.ts +428 -0
  272. package/tests/virtlist.test.ts +94 -0
  273. package/tests/vision.test.ts +540 -0
  274. package/tests/vsixpack.test.ts +145 -0
  275. package/tests/webapi.test.ts +523 -0
  276. package/tests/workflow.test.ts +1785 -0
  277. package/tests/workfloweditor.test.ts +759 -0
  278. package/tests/xpipack.test.ts +128 -0
  279. package/tools.ts +734 -0
  280. package/types.ts +9908 -0
  281. package/umd.ts +9 -0
  282. package/utils.ts +249 -0
  283. package/version.ts +8 -0
  284. package/versionregistry.ts +1310 -0
  285. package/views.ts +2153 -0
  286. package/vitest.config.ts +12 -0
  287. package/web/App.tsx +78 -0
  288. package/web/README.md +47 -0
  289. package/web/capacitor.config.ts +46 -0
  290. package/web/const.ts +19 -0
  291. package/web/control.shell.tsx +66 -0
  292. package/web/dashboardpage.ts +554 -0
  293. package/web/db.ts +493 -0
  294. package/web/design.html +541 -0
  295. package/web/gatewayview/Gateway.tsx +345 -0
  296. package/web/gatewayview/config.ts +1042 -0
  297. package/web/gatewayview/definition.ts +174 -0
  298. package/web/icons.ts +15 -0
  299. package/{manifest.json → web/manifest.json} +1 -1
  300. package/web/optionspage.ts +691 -0
  301. package/web/popup.ts +1651 -0
  302. package/web/schema.prisma +176 -0
  303. package/web/sidepanel.ts +7941 -0
  304. package/web/sitemanifest.json +13 -0
  305. package/web/terminal-ui.tsx +622 -0
  306. package/web/transparencypage.ts +541 -0
  307. package/web/vite.config.ts +39 -0
  308. package/web/workspace.ts +23 -0
  309. package/workbenchmemory.ts +104 -0
  310. package/workbenchsession.ts +304 -0
  311. package/workflow.ts +4495 -0
  312. package/bridge.d.ts.map +0 -1
  313. package/bridge.js +0 -1877
  314. package/bun.d.ts.map +0 -1
  315. package/bun.js +0 -52329
  316. package/caps/background.json +0 -712
  317. package/caps/cli.json +0 -360
  318. package/caps/library.json +0 -3611
  319. package/caps/mcp.json +0 -126
  320. package/caps/pagebridge.json +0 -377
  321. package/caps/popup.json +0 -51
  322. package/caps/sidepanel.json +0 -522
  323. package/checksums.txt +0 -142
  324. package/cli.d.ts.map +0 -1
  325. package/companion.d.ts.map +0 -1
  326. package/companion.js +0 -389
  327. package/crossbrowser.d.ts.map +0 -1
  328. package/crossbrowser.js +0 -1191
  329. package/dashdone.d.ts.map +0 -1
  330. package/dashdone.js +0 -368
  331. package/deno.d.ts.map +0 -1
  332. package/deno.js +0 -52325
  333. package/devthink.umd.js +0 -52346
  334. package/fixtures/bun.ts +0 -7
  335. package/fixtures/cjs.js +0 -6
  336. package/fixtures/deno.ts +0 -6
  337. package/fixtures/example-org-pagestate.json +0 -22
  338. package/fixtures/importers/automa-workflow.json +0 -18
  339. package/fixtures/importers/selenium-side.json +0 -20
  340. package/fixtures/importers/tabular-plan.csv +0 -7
  341. package/fixtures/importers/uivision-macro.json +0 -10
  342. package/fixtures/importers/v1-plan.json +0 -13
  343. package/fixtures/mcp-client.mjs +0 -14
  344. package/fixtures/pages/checkout.html +0 -192
  345. package/fixtures/pages/dashboard.html +0 -110
  346. package/fixtures/pages/feed.html +0 -113
  347. package/fixtures/pages/product-grid.html +0 -150
  348. package/fixtures/plans/form-inventory-plan.json +0 -11
  349. package/fixtures/plans/release-notes-plan.json +0 -11
  350. package/fixtures/recipes/agentscompete.json +0 -11
  351. package/fixtures/recipes/agentsforms.json +0 -11
  352. package/fixtures/recipes/agentsmonitor.json +0 -11
  353. package/fixtures/recipes/agentsreview.json +0 -29
  354. package/fixtures/recipes/agentswarm.json +0 -11
  355. package/fixtures/recipes/fillcalendar.json +0 -12
  356. package/fixtures/recipes/fillcheckout.json +0 -13
  357. package/fixtures/recipes/filldependentdropdowns.json +0 -12
  358. package/fixtures/recipes/fillfromcsv.json +0 -13
  359. package/fixtures/recipes/fillloginform.json +0 -12
  360. package/fixtures/recipes/fillmultistepwizard.json +0 -13
  361. package/fixtures/recipes/fillregistration.json +0 -12
  362. package/fixtures/recipes/fillsearchfilters.json +0 -12
  363. package/fixtures/recipes/filltypeahead.json +0 -11
  364. package/fixtures/recipes/monitoralerts.json +0 -12
  365. package/fixtures/recipes/monitoravailability.json +0 -11
  366. package/fixtures/recipes/monitornetworkquiet.json +0 -12
  367. package/fixtures/recipes/monitorpagechanges.json +0 -11
  368. package/fixtures/recipes/monitorpricechange.json +0 -11
  369. package/fixtures/recipes/monitorschedule.json +0 -12
  370. package/fixtures/recipes/scrapedynamicprices.json +0 -13
  371. package/fixtures/recipes/scrapeimagegallery.json +0 -12
  372. package/fixtures/recipes/scrapeinfinitefeed.json +0 -13
  373. package/fixtures/recipes/scrapenestedlists.json +0 -12
  374. package/fixtures/recipes/scrapeproductgrid.json +0 -12
  375. package/fixtures/recipes/scrapereviews.json +0 -12
  376. package/fixtures/recipes/scrapesearchresults.json +0 -12
  377. package/fixtures/recipes/scrapetablepagination.json +0 -12
  378. package/fixtures/recipes/testaccessibility.json +0 -34
  379. package/fixtures/recipes/testconsoleerrors.json +0 -12
  380. package/fixtures/recipes/testdeeplinks.json +0 -12
  381. package/fixtures/recipes/testformvalidation.json +0 -13
  382. package/fixtures/recipes/testlayoutshift.json +0 -12
  383. package/fixtures/recipes/testlinkcheck.json +0 -12
  384. package/fixtures/recipes/testloadtiming.json +0 -12
  385. package/fixtures/recipes/testvisualdiff.json +0 -12
  386. package/fixtures/workflows/changelog-digest-workflow.json +0 -13
  387. package/fixtures/workflows/form-survey-workflow.json +0 -13
  388. package/gallery.json +0 -706
  389. package/hardening.d.ts.map +0 -1
  390. package/hardening.js +0 -188
  391. package/headless.d.ts.map +0 -1
  392. package/headless.js +0 -11522
  393. package/http.d.ts.map +0 -1
  394. package/http.js +0 -2165
  395. package/index.cjs +0 -54682
  396. package/index.d.ts.map +0 -1
  397. package/index.js +0 -52310
  398. package/index.neutral.js +0 -46343
  399. package/mcp.d.ts.map +0 -1
  400. package/mcp.js +0 -20515
  401. package/memory.d.ts.map +0 -1
  402. package/nativehost.template.json +0 -10
  403. package/node.cjs +0 -54686
  404. package/node.d.ts.map +0 -1
  405. package/pack.d.ts.map +0 -1
  406. package/pack.js +0 -805
  407. package/policy.d.ts.map +0 -1
  408. package/progress.d.ts.map +0 -1
  409. package/progress.js +0 -645
  410. package/protocol.d.ts.map +0 -1
  411. package/protocol.js +0 -8334
  412. package/schemas/audit.schema.json +0 -226
  413. package/schemas/capability.schema.json +0 -113
  414. package/schemas/envelope.schema.json +0 -162
  415. package/schemas/memory.schema.json +0 -51
  416. package/schemas/observation.schema.json +0 -113
  417. package/schemas/plan.schema.json +0 -208
  418. package/schemas/progress.schema.json +0 -126
  419. package/schemas/proposal.schema.json +0 -68
  420. package/schemas/session.schema.json +0 -82
  421. package/schemas/tool.schema.json +0 -94
  422. package/server.d.ts.map +0 -1
  423. package/server.js +0 -28877
  424. package/umd-example.html +0 -18
  425. package/umd.d.ts.map +0 -1
  426. /package/{bun.d.ts → dist/bun.d.ts} +0 -0
  427. /package/{cli.d.ts → dist/cli.d.ts} +0 -0
  428. /package/{companion.d.ts → dist/companion.d.ts} +0 -0
  429. /package/{crossbrowser.d.ts → dist/crossbrowser.d.ts} +0 -0
  430. /package/{dashdone.d.ts → dist/dashdone.d.ts} +0 -0
  431. /package/{deno.d.ts → dist/deno.d.ts} +0 -0
  432. /package/{hardening.d.ts → dist/hardening.d.ts} +0 -0
  433. /package/{headless.d.ts → dist/headless.d.ts} +0 -0
  434. /package/{http.d.ts → dist/http.d.ts} +0 -0
  435. /package/{index.d.ts → dist/index.d.ts} +0 -0
  436. /package/{mcp.d.ts → dist/mcp.d.ts} +0 -0
  437. /package/{memory.d.ts → dist/memory.d.ts} +0 -0
  438. /package/{node.d.ts → dist/node.d.ts} +0 -0
  439. /package/{pack.d.ts → dist/pack.d.ts} +0 -0
  440. /package/{policy.d.ts → dist/policy.d.ts} +0 -0
  441. /package/{progress.d.ts → dist/progress.d.ts} +0 -0
  442. /package/{protocol.d.ts → dist/protocol.d.ts} +0 -0
  443. /package/{server.d.ts → dist/server.d.ts} +0 -0
  444. /package/{umd.d.ts → dist/umd.d.ts} +0 -0
@@ -0,0 +1,1853 @@
1
+ export type DevThinkConfig = {
2
+ activeProvider?: string | undefined;
3
+ activeModel?: string | undefined;
4
+ provider?: string;
5
+ model?: string;
6
+ mode?: string;
7
+ baseUrl?: string;
8
+ apiKey?: string;
9
+ anthropicApiKey?: string;
10
+ googleApiKey?: string;
11
+ zaiApiKey?: string;
12
+ temperature?: number;
13
+ maxTokens?: number;
14
+ projectMemory?: boolean;
15
+ externalMemory?: boolean;
16
+ fallbackProviders?: string[];
17
+ providers?: Record<string, {
18
+ baseUrl?: string;
19
+ apiKey?: string;
20
+ model?: string;
21
+ transport?: "official" | "openai-compatible" | "local-gateway";
22
+ auth?: {
23
+ kind: "api-key" | "bearer" | "oauth";
24
+ value?: string;
25
+ expiresAt?: number;
26
+ };
27
+ }>;
28
+ gateway?: {
29
+ mode?: "embedded";
30
+ stream?: boolean;
31
+ host?: string;
32
+ };
33
+ web?: {
34
+ enabled?: boolean;
35
+ pagesUrl?: string;
36
+ gatewayUrl?: string;
37
+ allowedOrigins?: string[];
38
+ remoteSync?: {
39
+ enabled?: boolean;
40
+ endpoint?: string;
41
+ };
42
+ };
43
+ };
44
+ export type AuthKind = "api-key" | "bearer" | "oauth";
45
+ export type AuthCredential = {
46
+ kind: AuthKind;
47
+ value?: string;
48
+ accessToken?: string;
49
+ refreshToken?: string;
50
+ expiresAt?: number | undefined;
51
+ resourceUrl?: string;
52
+ updatedAt: string;
53
+ };
54
+ export type DevThinkAuth = {
55
+ version: 1;
56
+ providers: Record<string, AuthCredential>;
57
+ };
58
+ export type DevThinkPaths = {
59
+ home: string;
60
+ config: string;
61
+ auth: string;
62
+ identity: string;
63
+ pairings: string;
64
+ legacyConfig: string;
65
+ sessions: string;
66
+ workspaces: string;
67
+ database: string;
68
+ legacyDatabase: string;
69
+ memory: string;
70
+ logs: string;
71
+ };
72
+ export declare function resolvePaths(root?: string): DevThinkPaths;
73
+ export declare function ensurePaths(paths?: DevThinkPaths): DevThinkPaths;
74
+ export declare function readConfig(paths?: DevThinkPaths): DevThinkConfig;
75
+ export declare function saveConfig(config: DevThinkConfig, paths?: DevThinkPaths): void;
76
+ export declare function readAuth(paths?: DevThinkPaths): DevThinkAuth;
77
+ export declare function saveAuth(auth: DevThinkAuth, paths?: DevThinkPaths): void;
78
+ export declare function setAuthCredential(provider: string, credential: Omit<AuthCredential, "updatedAt">, paths?: DevThinkPaths): DevThinkAuth;
79
+ export declare function clearAuthCredential(provider: string, paths?: DevThinkPaths): DevThinkAuth;
80
+ export declare function migrateLegacyCredentials(config: DevThinkConfig, paths?: DevThinkPaths): {
81
+ config: DevThinkConfig;
82
+ migrated: string[];
83
+ };
84
+ export declare function getConfigValue(config: DevThinkConfig, key: string): unknown;
85
+ export declare function setConfigValue(config: DevThinkConfig, key: string, value: unknown): DevThinkConfig;
86
+ export declare function resolveCredential(provider: string, config: DevThinkConfig, paths?: DevThinkPaths): string | undefined;
87
+ export declare function redactValue(value: unknown): unknown;
88
+ export declare function redactAuth(auth: DevThinkAuth): Record<string, unknown>;
89
+ export declare function redactConfig(config: DevThinkConfig): Record<string, unknown>;
90
+ export declare function parseConfigValue(raw: string): unknown;
91
+ /**
92
+ * OAuth2 Client ID of the Gemini CLI (Google Cloud Code).
93
+ * @readonly
94
+ */
95
+ /**
96
+ * OAuth2 Client Secret of the Gemini CLI.
97
+ * @readonly
98
+ * @security This secret is public inside the Gemini CLI binary; it is not a private secret.
99
+ */
100
+ /**
101
+ * OAuth scopes required for Cloud Code + identity.
102
+ * @readonly
103
+ */
104
+ /**
105
+ * OAuth scopes as a space-separated string, ready for token requests.
106
+ */
107
+ export declare const OAUTH_SCOPE_STRING: string;
108
+ /**
109
+ * Canonical Gemini CLI User-Agent.
110
+ * Format: GeminiCLI/<version>/<default-model> (<platform>; <arch>; GitHub) google-api-nodejs-client/<gaxios-ver>
111
+ * Note: platform varies to avoid static fingerprinting.
112
+ * @readonly
113
+ */
114
+ /** Fingerprinted google-api-nodejs-client version. */
115
+ export declare const GOOGLE_API_CLIENT_VERSION: "9.15.1";
116
+ /** Fingerprinted GeminiCLI version. */
117
+ export declare const GEMINI_CLI_VERSION: "0.57.0";
118
+ /** Default model announced in the User-Agent. */
119
+ export declare const GEMINI_CLI_DEFAULT_MODEL: "gemini-3-pro-preview";
120
+ /**
121
+ * X-Goog-Api-Client header value (Node.js runtime fingerprint).
122
+ * @readonly
123
+ */
124
+ /**
125
+ * Client metadata used for bypass (IDE_UNSPECIFIED = pure CLI).
126
+ * @readonly
127
+ */
128
+ /**
129
+ * Client-Metadata serialized as an `X-Goog-Client-Metadata` header string / payload.
130
+ */
131
+ /**
132
+ * Project fallback when the cloud project cannot be resolved via loadCodeAssist.
133
+ * @readonly
134
+ */
135
+ /** Cloud Code Assist PA (Playground API) base endpoints. */
136
+ import { MODELS_2026_LEGACY as MODELS_2026 } from "./models.js";
137
+ import type { RotationStrategy } from "./accounts.js";
138
+ export type { RotationStrategy };
139
+ import type { Model2026 } from "./models.js";
140
+ export { MODELS_2026 };
141
+ export type { Model2026 };
142
+ /**
143
+ * Normalized platform tuple used for UA fingerprinting.
144
+ * Converts Node os.platform()/arch() into the strings Google expects.
145
+ */
146
+ export type PlatformTuple = {
147
+ platform: string;
148
+ arch: string;
149
+ };
150
+ /**
151
+ * Returns the platform/arch tuple in the format used by the official UA.
152
+ * Example: linux -> linux, darwin -> darwin, win32 -> win32
153
+ * @returns {PlatformTuple}
154
+ */
155
+ export declare function getPlatformTuple(): PlatformTuple;
156
+ /**
157
+ * Builds the GeminiCLI User-Agent dynamically, varying the platform.
158
+ * Avoids static fingerprinting at the WAF level.
159
+ *
160
+ * Template: GeminiCLI/<cliVersion>/<model> (<platform>; <arch>; GitHub) google-api-nodejs-client/<gclientVersion>
161
+ *
162
+ * @param overrides - optional override of platform / cliVersion / model
163
+ * @returns User-Agent string ready for the `User-Agent` header
164
+ */
165
+ /**
166
+ * Builds a dynamic X-Goog-Api-Client header based on the current Node version,
167
+ * falling back to the static constant when process.versions is unavailable.
168
+ */
169
+ export declare function buildXGoogApiClient(): string;
170
+ /** Complete identification headers for bypass. */
171
+ export declare function getBypassHeaders(): Record<string, string>;
172
+ export declare const ROTATION_STRATEGIES: readonly ["round-robin", "sticky"];
173
+ /** Notification/toast display scope for opencode. */
174
+ export type ToastScope = "all" | "project" | "minimal" | "none";
175
+ /**
176
+ * Quota fallback mode.
177
+ * - true: enables automatic fallback to a reserve model
178
+ * - false: disables fallback, hard failure on 429
179
+ * - "auto": system picks the best model with remaining quota
180
+ * - string: specific model name to fall back to
181
+ */
182
+ export type QuotaFallback = boolean | "auto" | string;
183
+ export type DebugLevel = "debug" | "info" | "warn" | "error" | "silent";
184
+ export interface DebugObjectConfig {
185
+ /** enable debug logging */
186
+ enabled?: boolean;
187
+ /** log level */
188
+ level?: DebugLevel;
189
+ /** custom log file path */
190
+ log_file?: string | null;
191
+ /** retention days */
192
+ retain_days?: number;
193
+ /** max bytes before rotation, e.g. 10MB */
194
+ max_bytes?: number;
195
+ /** TUI circular buffer lines */
196
+ tui_buffer_lines?: number;
197
+ /** redact secrets in logs */
198
+ redact_secrets?: boolean;
199
+ }
200
+ export type DebugConfig = boolean | DebugObjectConfig;
201
+ export interface GoogleSearchConfig {
202
+ /** enable google_search tool injection */
203
+ enabled?: boolean;
204
+ /** model used for search grounding, defaults to gemini-3-flash */
205
+ model?: string;
206
+ /** enable url_context companion tool */
207
+ url_context?: boolean;
208
+ /** include groundingMetadata in response */
209
+ include_grounding_metadata?: boolean;
210
+ }
211
+ export interface EndpointOverrides {
212
+ /** prod: https://cloudcode-pa.googleapis.com */
213
+ prod?: string;
214
+ /** daily: https://daily-cloudcode-pa.googleapis.com */
215
+ daily?: string;
216
+ /** sandbox: https://daily-cloudcode-pa.sandbox.googleapis.com */
217
+ sandbox?: string;
218
+ /** autopush: https://autopush-cloudcode-pa.sandbox.googleapis.com */
219
+ autopush?: string;
220
+ /** quota endpoint override */
221
+ quota?: string;
222
+ /** models endpoint override */
223
+ models?: string;
224
+ /** gemini cli companion endpoint */
225
+ gemini_cli?: string;
226
+ /** cloudaicompanion.googleapis.com */
227
+ cloud_companion?: string;
228
+ /** generateContent base */
229
+ generate?: string;
230
+ /** streamGenerateContent base */
231
+ stream_generate?: string;
232
+ }
233
+ /**
234
+ * Quota settings block of antigravity.json (v2.1.15 Phase D: renamed from
235
+ * QuotaSettings — quota.js owns that name with the runtime quota shape; this
236
+ * is the user-facing config-file schema).
237
+ */
238
+ export interface QuotaSettings {
239
+ refresh_interval_minutes?: number;
240
+ cache_ttl_minutes?: number;
241
+ soft_threshold?: number;
242
+ hard_threshold?: number;
243
+ dual_pool?: boolean;
244
+ [k: string]: unknown;
245
+ }
246
+ export interface BypassMetadata {
247
+ /** fallback version when dynamic fetch fails */
248
+ version_fallback?: string;
249
+ /** min supported version */
250
+ min_supported?: string;
251
+ /** custom user agent override — observer warns to keep antigravity/{semver} {os}/{arch} pattern */
252
+ user_agent?: string;
253
+ /** strip x-goog-user-project header to avoid 403 */
254
+ strip_user_project_header?: boolean;
255
+ /** enable fingerprint jitter 0-80ms */
256
+ fingerprint_jitter?: boolean;
257
+ /** pid offset trick for Gemini CLI bypass */
258
+ pid_offset?: boolean;
259
+ }
260
+ export interface AntigravityConfig {
261
+ /** json schema pointer, optional */
262
+ $schema?: string;
263
+ /** config version, integer */
264
+ version?: number;
265
+ /** try Gemini CLI pool first (v2 default false / v1 default true) */
266
+ cli_first?: boolean;
267
+ /** apply PID offset to avoid automation detection */
268
+ pid_offset_enabled?: boolean;
269
+ /** quota refresh interval in minutes */
270
+ quota_refresh_interval_minutes?: number;
271
+ /** enable Google grounded search (google_search tool) */
272
+ google_search_enabled?: boolean;
273
+ /** debug flag or object (boolean in v1, boolean|object in v2) */
274
+ debug?: DebugConfig;
275
+ /** account rotation strategy */
276
+ rotation_strategy?: RotationStrategy;
277
+ /** alias kept for backward compat with older schema */
278
+ account_rotation?: RotationStrategy;
279
+ /** boolean debug shortcut */
280
+ debug_enabled?: boolean;
281
+ /** full google search object */
282
+ google_search?: GoogleSearchConfig;
283
+ /** endpoint overrides */
284
+ endpoints?: EndpointOverrides;
285
+ /** quota sub-config */
286
+ quota?: QuotaSettings;
287
+ /** bypass metadata */
288
+ bypass?: BypassMetadata;
289
+ /** fallback project id blinded */
290
+ fallback_project_id?: string;
291
+ /** default chat model 2026 */
292
+ default_model?: string;
293
+ /** search/grounding model */
294
+ search_model?: string;
295
+ /** client id override — public client, do not commit secret */
296
+ client_id?: string | null;
297
+ /** client secret override — optional, blinded in logs */
298
+ client_secret?: string | null;
299
+ /** accounts file path override */
300
+ accounts_file?: string | null;
301
+ /** model allowlist custom */
302
+ models_allowlist?: string[];
303
+ /** enable fetch interceptor stripping */
304
+ strip_user_project?: boolean;
305
+ /** toast/notification display scope (v1, default "all") */
306
+ toast_scope?: ToastScope;
307
+ /** quota percentage where soft warning/fallback starts (v1, default 90, range 0-100) */
308
+ soft_quota_threshold_percent?: number;
309
+ /** fallback strategy when quota hits threshold (v1, default "auto") */
310
+ quota_fallback?: QuotaFallback;
311
+ /** soft quota cache TTL in minutes (v1, default 5, range 1-1440) */
312
+ soft_quota_cache_ttl_minutes?: number;
313
+ /** version/update check cache TTL in minutes (v1, default 60, range 1-10080) */
314
+ version_cache_ttl?: number;
315
+ /** extra */
316
+ [k: string]: unknown;
317
+ }
318
+ export declare const DEFAULT_ENDPOINTS: Readonly<Required<Pick<EndpointOverrides, "prod" | "daily" | "sandbox" | "autopush">>>;
319
+ export declare const DEFAULT_QUOTA: Required<QuotaSettings>;
320
+ export declare const DEFAULT_BYPASS: Required<BypassMetadata>;
321
+ export declare const DEFAULT_DEBUG_OBJECT: Required<DebugObjectConfig>;
322
+ export declare const DEFAULT_GOOGLE_SEARCH: Required<GoogleSearchConfig>;
323
+ export declare function getDefaultConfig(): AntigravityConfig;
324
+ export declare const CONFIG_DEFAULTS: AntigravityConfig;
325
+ /**
326
+ * Immutable v1 default configuration.
327
+ */
328
+ export declare const DEFAULT_CONFIG: Readonly<AntigravityConfig>;
329
+ /**
330
+ * Schema for ~/.config/opencode/antigravity.json
331
+ * The observer documents this file with third-person view and bilingual help.
332
+ */
333
+ export declare const ANTIGRAVITY_CONFIG_JSON_SCHEMA: {
334
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
335
+ readonly $id: "https://opencode.ai/schemas/antigravity.json";
336
+ readonly title: "devthink provider config — antigravity.json";
337
+ readonly description: "Configuration for the devthink provider plugin. Bypass metadata: mimics antigravity/{ver} {os}/{arch} User-Agent, strips x-goog-user-project, endpoint cascade 403/404/5xx, supports Gemini CLI dual quota pool, round-robin/sticky rotation, google_search grounding.";
338
+ readonly type: "object";
339
+ readonly additionalProperties: false;
340
+ readonly properties: {
341
+ readonly $schema: {
342
+ readonly type: "string";
343
+ readonly format: "uri";
344
+ readonly description: "JSON schema pointer";
345
+ readonly default: "https://json-schema.org/draft-07/schema#";
346
+ readonly examples: readonly ["https://json-schema.org/draft-07/schema#", "./antigravity.schema.json"];
347
+ };
348
+ readonly version: {
349
+ readonly type: "integer";
350
+ readonly minimum: 1;
351
+ readonly maximum: 10;
352
+ readonly default: 2;
353
+ readonly description: "config version";
354
+ readonly examples: readonly [2];
355
+ };
356
+ readonly cli_first: {
357
+ readonly type: "boolean";
358
+ readonly default: false;
359
+ readonly description: "When true, tries Gemini CLI quota pool first before Antigravity pool. Useful when Antigravity quota is exhausted but CLI pool still has tokens.";
360
+ readonly examples: readonly [false, true];
361
+ };
362
+ readonly pid_offset_enabled: {
363
+ readonly type: "boolean";
364
+ readonly default: false;
365
+ readonly description: "Enables PID offset trick to bypass per-PID rate limiting observed in Gemini CLI gateway. When enabled, adds pid % 1000 to jitter.";
366
+ readonly examples: readonly [false, true];
367
+ };
368
+ readonly quota_refresh_interval_minutes: {
369
+ readonly type: "integer";
370
+ readonly minimum: 1;
371
+ readonly maximum: 120;
372
+ readonly default: 15;
373
+ readonly description: "Interval in minutes for background quota refresh. Adaptive TTL 2-10min when near soft threshold 90%.";
374
+ readonly examples: readonly [5, 15, 30];
375
+ };
376
+ readonly rotation_strategy: {
377
+ readonly type: "string";
378
+ readonly enum: string[];
379
+ readonly default: "round-robin";
380
+ readonly description: "Multi-account rotation strategy — round-robin distributes evenly, sticky keeps same account until quota exhausted.";
381
+ readonly examples: readonly ["round-robin", "sticky"];
382
+ };
383
+ readonly account_rotation: {
384
+ readonly type: "string";
385
+ readonly enum: string[];
386
+ readonly default: "round-robin";
387
+ readonly description: "Alias for rotation_strategy (backward compat)";
388
+ readonly examples: readonly ["round-robin", "sticky"];
389
+ };
390
+ readonly debug: {
391
+ readonly oneOf: readonly [{
392
+ readonly type: "boolean";
393
+ }, {
394
+ readonly type: "object";
395
+ readonly additionalProperties: false;
396
+ readonly properties: {
397
+ readonly enabled: {
398
+ readonly type: "boolean";
399
+ readonly default: false;
400
+ readonly description: "enable debug";
401
+ readonly examples: readonly [false, true];
402
+ };
403
+ readonly level: {
404
+ readonly type: "string";
405
+ readonly enum: readonly ["debug", "info", "warn", "error", "silent"];
406
+ readonly default: "warn";
407
+ readonly description: "log level";
408
+ readonly examples: readonly ["debug", "warn"];
409
+ };
410
+ readonly log_file: {
411
+ readonly type: readonly ["string", "null"];
412
+ readonly default: null;
413
+ readonly description: "custom log file path";
414
+ readonly examples: readonly [null, "~/.config/opencode/antigravity-debug.log"];
415
+ };
416
+ readonly retain_days: {
417
+ readonly type: "integer";
418
+ readonly minimum: 1;
419
+ readonly maximum: 90;
420
+ readonly default: 7;
421
+ readonly description: "log retention days";
422
+ readonly examples: readonly [7];
423
+ };
424
+ readonly max_bytes: {
425
+ readonly type: "integer";
426
+ readonly minimum: 1024;
427
+ readonly maximum: number;
428
+ readonly default: 10485760;
429
+ readonly description: "max bytes before rotation, 10MB default";
430
+ readonly examples: readonly [10485760];
431
+ };
432
+ readonly tui_buffer_lines: {
433
+ readonly type: "integer";
434
+ readonly minimum: 10;
435
+ readonly maximum: 10000;
436
+ readonly default: 1000;
437
+ readonly description: "circular TUI buffer lines";
438
+ readonly examples: readonly [1000];
439
+ };
440
+ readonly redact_secrets: {
441
+ readonly type: "boolean";
442
+ readonly default: true;
443
+ readonly description: "redact secrets in logs";
444
+ readonly examples: readonly [true];
445
+ };
446
+ };
447
+ }];
448
+ readonly default: false;
449
+ readonly description: "Debug mode — boolean or object with rotation, retention, redaction.";
450
+ readonly examples: readonly [false, true, {
451
+ readonly enabled: true;
452
+ readonly level: "debug";
453
+ }];
454
+ };
455
+ readonly debug_enabled: {
456
+ readonly type: "boolean";
457
+ readonly default: false;
458
+ readonly description: "shortcut for debug.enabled";
459
+ readonly examples: readonly [false, true];
460
+ };
461
+ readonly google_search_enabled: {
462
+ readonly type: "boolean";
463
+ readonly default: true;
464
+ readonly description: "Enable native google_search grounding tool (Gemini) injection.";
465
+ readonly examples: readonly [true, false];
466
+ };
467
+ readonly google_search: {
468
+ readonly type: "object";
469
+ readonly additionalProperties: false;
470
+ readonly default: {
471
+ readonly enabled: boolean;
472
+ readonly model: string;
473
+ readonly url_context: boolean;
474
+ readonly include_grounding_metadata: boolean;
475
+ };
476
+ readonly description: "Google search grounding full config";
477
+ readonly properties: {
478
+ readonly enabled: {
479
+ readonly type: "boolean";
480
+ readonly default: true;
481
+ readonly description: "enable google_search tool";
482
+ readonly examples: readonly [true, false];
483
+ };
484
+ readonly model: {
485
+ readonly type: "string";
486
+ readonly default: "gemini-3-flash";
487
+ readonly description: "model used for search grounding";
488
+ readonly examples: readonly ["gemini-3-flash", "gemini-3-flash-preview"];
489
+ };
490
+ readonly url_context: {
491
+ readonly type: "boolean";
492
+ readonly default: true;
493
+ readonly description: "enable url_context companion tool";
494
+ readonly examples: readonly [true, false];
495
+ };
496
+ readonly include_grounding_metadata: {
497
+ readonly type: "boolean";
498
+ readonly default: true;
499
+ readonly description: "include groundingMetadata in response";
500
+ readonly examples: readonly [true];
501
+ };
502
+ };
503
+ };
504
+ readonly endpoints: {
505
+ readonly type: "object";
506
+ readonly additionalProperties: false;
507
+ readonly description: "Override Antigravity endpoints. Observer warns: must use https and googleapis.com for bypass.";
508
+ readonly properties: {
509
+ readonly prod: {
510
+ readonly type: "string";
511
+ readonly format: "uri";
512
+ readonly default: "https://cloudcode-pa.googleapis.com";
513
+ readonly description: "PROD endpoint";
514
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
515
+ };
516
+ readonly daily: {
517
+ readonly type: "string";
518
+ readonly format: "uri";
519
+ readonly default: "https://daily-cloudcode-pa.googleapis.com";
520
+ readonly description: "DAILY endpoint";
521
+ readonly examples: readonly ["https://daily-cloudcode-pa.googleapis.com"];
522
+ };
523
+ readonly sandbox: {
524
+ readonly type: "string";
525
+ readonly format: "uri";
526
+ readonly default: "https://daily-cloudcode-pa.sandbox.googleapis.com";
527
+ readonly description: "SANDBOX endpoint";
528
+ readonly examples: readonly ["https://daily-cloudcode-pa.sandbox.googleapis.com"];
529
+ };
530
+ readonly autopush: {
531
+ readonly type: "string";
532
+ readonly format: "uri";
533
+ readonly default: "https://autopush-cloudcode-pa.sandbox.googleapis.com";
534
+ readonly description: "AUTOPUSH optional";
535
+ readonly examples: readonly ["https://autopush-cloudcode-pa.sandbox.googleapis.com"];
536
+ };
537
+ readonly quota: {
538
+ readonly type: "string";
539
+ readonly format: "uri";
540
+ readonly description: "quota endpoint override";
541
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
542
+ };
543
+ readonly models: {
544
+ readonly type: "string";
545
+ readonly format: "uri";
546
+ readonly description: "models endpoint override";
547
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
548
+ };
549
+ readonly gemini_cli: {
550
+ readonly type: "string";
551
+ readonly format: "uri";
552
+ readonly description: "Gemini CLI companion endpoint";
553
+ readonly examples: readonly ["https://cloudaicompanion.googleapis.com"];
554
+ };
555
+ readonly cloud_companion: {
556
+ readonly type: "string";
557
+ readonly format: "uri";
558
+ readonly description: "cloudaicompanion.googleapis.com";
559
+ readonly examples: readonly ["https://cloudaicompanion.googleapis.com"];
560
+ };
561
+ readonly generate: {
562
+ readonly type: "string";
563
+ readonly format: "uri";
564
+ readonly description: "generateContent base";
565
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
566
+ };
567
+ readonly stream_generate: {
568
+ readonly type: "string";
569
+ readonly format: "uri";
570
+ readonly description: "streamGenerateContent base";
571
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
572
+ };
573
+ };
574
+ };
575
+ readonly quota: {
576
+ readonly type: "object";
577
+ readonly additionalProperties: false;
578
+ readonly description: "Quota config";
579
+ readonly properties: {
580
+ readonly refresh_interval_minutes: {
581
+ readonly type: "integer";
582
+ readonly minimum: 1;
583
+ readonly maximum: 120;
584
+ readonly default: 15;
585
+ readonly examples: readonly [15];
586
+ };
587
+ readonly cache_ttl_minutes: {
588
+ readonly type: "integer";
589
+ readonly minimum: 1;
590
+ readonly maximum: 60;
591
+ readonly default: 15;
592
+ readonly examples: readonly [15];
593
+ };
594
+ readonly soft_threshold: {
595
+ readonly type: "number";
596
+ readonly minimum: 0.1;
597
+ readonly maximum: 1;
598
+ readonly default: 0.9;
599
+ readonly examples: readonly [0.9];
600
+ };
601
+ readonly hard_threshold: {
602
+ readonly type: "number";
603
+ readonly minimum: 0.5;
604
+ readonly maximum: 1;
605
+ readonly default: 1;
606
+ readonly examples: readonly [1];
607
+ };
608
+ readonly dual_pool: {
609
+ readonly type: "boolean";
610
+ readonly default: true;
611
+ readonly description: "enable dual pool Antigravity + Gemini CLI";
612
+ readonly examples: readonly [true];
613
+ };
614
+ };
615
+ };
616
+ readonly bypass: {
617
+ readonly type: "object";
618
+ readonly additionalProperties: false;
619
+ readonly description: "Bypass metadata — documents how library imitates Antigravity traffic. UA must match antigravity/{semver} {os}/{arch}.";
620
+ readonly properties: {
621
+ readonly version_fallback: {
622
+ readonly type: "string";
623
+ readonly pattern: "^\\d+\\.\\d+\\.\\d+";
624
+ readonly default: "1.19.2";
625
+ readonly examples: readonly ["1.19.2"];
626
+ };
627
+ readonly min_supported: {
628
+ readonly type: "string";
629
+ readonly pattern: "^\\d+\\.\\d+\\.\\d+";
630
+ readonly default: "1.15.8";
631
+ readonly examples: readonly ["1.15.8"];
632
+ };
633
+ readonly user_agent: {
634
+ readonly type: "string";
635
+ readonly default: "antigravity/1.19.2";
636
+ readonly description: "full UA, should contain antigravity/ prefix";
637
+ readonly examples: readonly ["antigravity/1.19.2 darwin/arm64", "antigravity/1.19.2 linux/x64"];
638
+ };
639
+ readonly strip_user_project_header: {
640
+ readonly type: "boolean";
641
+ readonly default: true;
642
+ readonly description: "strip x-goog-user-project to avoid 403";
643
+ readonly examples: readonly [true];
644
+ };
645
+ readonly fingerprint_jitter: {
646
+ readonly type: "boolean";
647
+ readonly default: true;
648
+ readonly examples: readonly [true];
649
+ };
650
+ readonly pid_offset: {
651
+ readonly type: "boolean";
652
+ readonly default: false;
653
+ readonly examples: readonly [false, true];
654
+ };
655
+ };
656
+ };
657
+ readonly fallback_project_id: {
658
+ readonly type: "string";
659
+ readonly minLength: 3;
660
+ readonly default: "rising-fact-p41fc";
661
+ readonly description: "fallback project id blinded";
662
+ readonly examples: readonly ["rising-fact-p41fc"];
663
+ };
664
+ readonly default_model: {
665
+ readonly type: "string";
666
+ readonly default: "antigravity-gemini-3-flash";
667
+ readonly description: "default chat model 2026";
668
+ readonly examples: readonly ["antigravity-gemini-3-flash", "gemini-3-pro-preview"];
669
+ };
670
+ readonly search_model: {
671
+ readonly type: "string";
672
+ readonly default: "gemini-3-flash";
673
+ readonly description: "search grounding model";
674
+ readonly examples: readonly ["gemini-3-flash", "gemini-3-flash-preview"];
675
+ };
676
+ readonly client_id: {
677
+ readonly type: readonly ["string", "null"];
678
+ readonly default: null;
679
+ readonly description: "OAuth client_id override (public)";
680
+ readonly examples: readonly [null, "1071006060591-...apps.googleusercontent.com"];
681
+ };
682
+ readonly client_secret: {
683
+ readonly type: readonly ["string", "null"];
684
+ readonly default: null;
685
+ readonly description: "OAuth client_secret override — do not commit";
686
+ readonly examples: readonly [null];
687
+ };
688
+ readonly accounts_file: {
689
+ readonly type: readonly ["string", "null"];
690
+ readonly default: null;
691
+ readonly format: "uri-reference";
692
+ readonly description: "custom accounts file path";
693
+ readonly examples: readonly [null, "~/.config/opencode/antigravity-accounts.json"];
694
+ };
695
+ readonly models_allowlist: {
696
+ readonly type: "array";
697
+ readonly items: {
698
+ readonly type: "string";
699
+ };
700
+ readonly default: readonly [];
701
+ readonly description: "optional model allowlist";
702
+ readonly examples: readonly [readonly [], readonly ["antigravity-gemini-3-flash", "claude-opus-4-6-thinking"]];
703
+ };
704
+ readonly strip_user_project: {
705
+ readonly type: "boolean";
706
+ readonly default: true;
707
+ readonly description: "legacy alias for bypass.strip_user_project_header";
708
+ readonly examples: readonly [true];
709
+ };
710
+ readonly toast_scope: {
711
+ readonly type: "string";
712
+ readonly enum: readonly ["all", "project", "minimal", "none"];
713
+ readonly default: "all";
714
+ readonly description: "toast/notification display scope (v1 field)";
715
+ readonly examples: readonly ["all", "project", "minimal", "none"];
716
+ };
717
+ readonly soft_quota_threshold_percent: {
718
+ readonly type: "number";
719
+ readonly minimum: 0;
720
+ readonly maximum: 100;
721
+ readonly default: 90;
722
+ readonly description: "quota percentage where soft warning/fallback starts (v1 field)";
723
+ readonly examples: readonly [90];
724
+ };
725
+ readonly quota_fallback: {
726
+ readonly oneOf: readonly [{
727
+ readonly type: "boolean";
728
+ }, {
729
+ readonly type: "string";
730
+ }];
731
+ readonly default: "auto";
732
+ readonly description: 'fallback strategy on quota exhaustion: boolean | "auto" | modelName (v1 field)';
733
+ readonly examples: readonly ["auto", true, false];
734
+ };
735
+ readonly soft_quota_cache_ttl_minutes: {
736
+ readonly type: "integer";
737
+ readonly minimum: 1;
738
+ readonly maximum: 1440;
739
+ readonly default: 5;
740
+ readonly description: "soft quota cache TTL in minutes (v1 field)";
741
+ readonly examples: readonly [5];
742
+ };
743
+ readonly version_cache_ttl: {
744
+ readonly type: "integer";
745
+ readonly minimum: 1;
746
+ readonly maximum: 10080;
747
+ readonly default: 60;
748
+ readonly description: "version/update check cache TTL in minutes (v1 field)";
749
+ readonly examples: readonly [60];
750
+ };
751
+ };
752
+ readonly required: readonly [];
753
+ };
754
+ /**
755
+ * The observer resolves config directory honoring OPENCODE_CONFIG_DIR.
756
+ */
757
+ export declare function resolveConfigDir(): string;
758
+ /**
759
+ * Resolves full antigravity.json path.
760
+ * @param customPath - optional explicit path from caller
761
+ */
762
+ export declare function resolveConfigPath(customPath?: string): string;
763
+ /**
764
+ * Returns the absolute config file path for the current OS:
765
+ * ~/.config/opencode/antigravity.json.
766
+ * Honors XDG_CONFIG_HOME on Linux when defined.
767
+ *
768
+ * @returns absolute path
769
+ */
770
+ export declare function getConfigPath(): string;
771
+ export interface ValidationError {
772
+ path: string;
773
+ message: string;
774
+ value?: unknown;
775
+ }
776
+ /**
777
+ * Unified config validation error.
778
+ * - v2 signature: new ConfigValidationError(message, structuredErrors[])
779
+ * - v1 signature: new ConfigValidationError(stringErrorList)
780
+ */
781
+ export declare class ConfigValidationError extends Error {
782
+ readonly errors: ReadonlyArray<ValidationError | string>;
783
+ constructor(messageOrErrors: string | ReadonlyArray<string>, errors?: ReadonlyArray<ValidationError>);
784
+ }
785
+ /**
786
+ * Validates config strictly for production.
787
+ * The observer collects all errors before throwing, to give full feedback.
788
+ *
789
+ * @param input - raw parsed json
790
+ * @returns sanitized AntigravityConfig
791
+ * @throws ConfigValidationError when invalid
792
+ */
793
+ export declare function validate(input: unknown): AntigravityConfig;
794
+ export declare function validateConfig(input: unknown): {
795
+ valid: boolean;
796
+ errors: ValidationError[];
797
+ config?: AntigravityConfig | undefined;
798
+ };
799
+ /**
800
+ * Validates and normalizes a partial config object, merging with defaults.
801
+ * No zod — manual validation for zero deps.
802
+ *
803
+ * @param raw - raw object read from JSON
804
+ * @param opts.strict - when true, throws ConfigValidationError on errors; otherwise uses defaults and accumulates warnings
805
+ * @returns sanitized config
806
+ */
807
+ export declare function parseAndValidateConfig(raw: unknown, opts?: {
808
+ strict?: boolean;
809
+ }): AntigravityConfig;
810
+ /**
811
+ * Lightweight validation returning the error list without throwing;
812
+ * useful for diagnostics.
813
+ */
814
+ export declare function validateConfigRaw(raw: unknown): {
815
+ valid: boolean;
816
+ errors: string[];
817
+ config: AntigravityConfig;
818
+ };
819
+ /**
820
+ * The observer returns fresh defaults without leaking references.
821
+ */
822
+ export declare function defaults(): AntigravityConfig;
823
+ /**
824
+ * Clears the in-memory cache (useful for tests or when the file changed externally).
825
+ */
826
+ export declare function clearConfigCache(): void;
827
+ /**
828
+ * Loads configuration from disk with an mtime-based in-memory cache.
829
+ * - If the file does not exist, returns defaults.
830
+ * - If JSON is invalid, returns defaults (+ logs a warning when debug).
831
+ * - Refreshes the in-memory cache.
832
+ *
833
+ * This is the preserved v1 synchronous cached API; other modules import it
834
+ * by this exact name.
835
+ *
836
+ * @param opts - force: when true ignores the in-memory cache
837
+ * @returns sanitized AntigravityConfig
838
+ */
839
+ export declare function loadConfig(opts?: {
840
+ force?: boolean;
841
+ }): AntigravityConfig;
842
+ /**
843
+ * Saves the full configuration atomically with chmod 0o600.
844
+ * Refreshes the in-memory cache.
845
+ *
846
+ * Preserved v1 synchronous cached API.
847
+ *
848
+ * @param config - full (validated) config object
849
+ * @returns saved config (clone)
850
+ */
851
+ export declare function agsaveConfig(config: AntigravityConfig): AntigravityConfig;
852
+ /**
853
+ * Partially updates the config: shallow merge + atomic save.
854
+ * Safe enough for single-process use; multi-process safety relies on atomic rename.
855
+ *
856
+ * @param partial - fields to update
857
+ * @returns full updated config
858
+ *
859
+ * @example
860
+ * updateConfig({ debug: true, toast_scope: "minimal" })
861
+ */
862
+ export declare function updateConfig(partial: Partial<AntigravityConfig>): AntigravityConfig;
863
+ /**
864
+ * Async loader (v2 implementation).
865
+ *
866
+ * - Passing a string `customPath` performs the v2 flow: read the given path,
867
+ * merge defaults, strictly validate, throw ConfigValidationError on
868
+ * corruption, return defaults silently when the file is missing.
869
+ * - Passing `{ force }` or nothing delegates to the v1 synchronous cached
870
+ * loader wrapped in a Promise (preserves the original v1 wrapper contract).
871
+ *
872
+ * @param customPathOrOpts - explicit config path (v2) or cache options (v1)
873
+ */
874
+ export declare function loadConfigAsync(customPathOrOpts?: string | {
875
+ force?: boolean;
876
+ }): Promise<AntigravityConfig>;
877
+ /**
878
+ * Async saver (v2 implementation): merges with defaults, validates, then
879
+ * writes atomically (tmp + chmod 600 + rename).
880
+ *
881
+ * Note: returns the written file path (v2 semantics). Callers that need the
882
+ * saved config clone can use the synchronous agsaveConfig.
883
+ *
884
+ * @param cfg - partial or full config, merged with defaults then validated
885
+ * @param customPath - optional explicit path override
886
+ * @returns written file path
887
+ */
888
+ export declare function saveConfigAsync(cfg: Partial<AntigravityConfig> | AntigravityConfig, customPath?: string): Promise<string>;
889
+ /**
890
+ * Async version of updateConfig (v1 wrapper over the sync implementation).
891
+ */
892
+ export declare function updateConfigAsync(partial: Partial<AntigravityConfig>): Promise<AntigravityConfig>;
893
+ /**
894
+ * Sync load — for CLI bootstrap where async is not convenient.
895
+ * Same semantics as the v2 async loader but synchronous and uncached.
896
+ */
897
+ export declare function loadConfigSync(customPath?: string): AntigravityConfig;
898
+ /**
899
+ * Sync save atomic — writes tmp, chmod, rename.
900
+ */
901
+ export declare function saveConfigSync(cfg: Partial<AntigravityConfig> | AntigravityConfig, customPath?: string): string;
902
+ /**
903
+ * Safe debug info (no secret). Intended for logging with debug enabled.
904
+ */
905
+ export declare function getSafeDebugInfo(): {
906
+ readonly configPath: string;
907
+ readonly clientId: string;
908
+ readonly projectFallback: "rising-fact-p41fc";
909
+ readonly endpoints: {
910
+ readonly base: "https://cloudcode-pa.googleapis.com";
911
+ readonly loadCodeAssist: "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist";
912
+ readonly onboardUser: "https://cloudcode-pa.googleapis.com/v1internal:onboardUser";
913
+ readonly fetchAvailableModels: "https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels";
914
+ readonly generateContent: "https://cloudcode-pa.googleapis.com/v1internal:generateContent";
915
+ readonly streamGenerateContent: "https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent";
916
+ readonly retrieveUserQuotaSummary: "https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary";
917
+ };
918
+ readonly modelsCount: 11;
919
+ readonly platform: string;
920
+ readonly arch: string;
921
+ readonly userAgent: string;
922
+ readonly xGoog: string;
923
+ readonly clientMetadata: "ideType=IDE_UNSPECIFIED,platform=PLATFORM_UNSPECIFIED,pluginType=GEMINI";
924
+ };
925
+ export declare const Config: {
926
+ resolveConfigDir: typeof resolveConfigDir;
927
+ resolveConfigPath: typeof resolveConfigPath;
928
+ getConfigPath: typeof getConfigPath;
929
+ getDefaultConfig: typeof getDefaultConfig;
930
+ defaults: typeof defaults;
931
+ DEFAULT_CONFIG: Readonly<AntigravityConfig>;
932
+ validate: typeof validate;
933
+ validateConfig: typeof validateConfig;
934
+ validateConfigRaw: typeof validateConfigRaw;
935
+ parseAndValidateConfig: typeof parseAndValidateConfig;
936
+ loadConfig: typeof loadConfig;
937
+ agsaveConfig: typeof agsaveConfig;
938
+ updateConfig: typeof updateConfig;
939
+ clearConfigCache: typeof clearConfigCache;
940
+ loadConfigAsync: typeof loadConfigAsync;
941
+ saveConfigAsync: typeof saveConfigAsync;
942
+ updateConfigAsync: typeof updateConfigAsync;
943
+ loadConfigSync: typeof loadConfigSync;
944
+ saveConfigSync: typeof saveConfigSync;
945
+ getSafeDebugInfo: typeof getSafeDebugInfo;
946
+ schema: {
947
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
948
+ readonly $id: "https://opencode.ai/schemas/antigravity.json";
949
+ readonly title: "devthink provider config — antigravity.json";
950
+ readonly description: "Configuration for the devthink provider plugin. Bypass metadata: mimics antigravity/{ver} {os}/{arch} User-Agent, strips x-goog-user-project, endpoint cascade 403/404/5xx, supports Gemini CLI dual quota pool, round-robin/sticky rotation, google_search grounding.";
951
+ readonly type: "object";
952
+ readonly additionalProperties: false;
953
+ readonly properties: {
954
+ readonly $schema: {
955
+ readonly type: "string";
956
+ readonly format: "uri";
957
+ readonly description: "JSON schema pointer";
958
+ readonly default: "https://json-schema.org/draft-07/schema#";
959
+ readonly examples: readonly ["https://json-schema.org/draft-07/schema#", "./antigravity.schema.json"];
960
+ };
961
+ readonly version: {
962
+ readonly type: "integer";
963
+ readonly minimum: 1;
964
+ readonly maximum: 10;
965
+ readonly default: 2;
966
+ readonly description: "config version";
967
+ readonly examples: readonly [2];
968
+ };
969
+ readonly cli_first: {
970
+ readonly type: "boolean";
971
+ readonly default: false;
972
+ readonly description: "When true, tries Gemini CLI quota pool first before Antigravity pool. Useful when Antigravity quota is exhausted but CLI pool still has tokens.";
973
+ readonly examples: readonly [false, true];
974
+ };
975
+ readonly pid_offset_enabled: {
976
+ readonly type: "boolean";
977
+ readonly default: false;
978
+ readonly description: "Enables PID offset trick to bypass per-PID rate limiting observed in Gemini CLI gateway. When enabled, adds pid % 1000 to jitter.";
979
+ readonly examples: readonly [false, true];
980
+ };
981
+ readonly quota_refresh_interval_minutes: {
982
+ readonly type: "integer";
983
+ readonly minimum: 1;
984
+ readonly maximum: 120;
985
+ readonly default: 15;
986
+ readonly description: "Interval in minutes for background quota refresh. Adaptive TTL 2-10min when near soft threshold 90%.";
987
+ readonly examples: readonly [5, 15, 30];
988
+ };
989
+ readonly rotation_strategy: {
990
+ readonly type: "string";
991
+ readonly enum: string[];
992
+ readonly default: "round-robin";
993
+ readonly description: "Multi-account rotation strategy — round-robin distributes evenly, sticky keeps same account until quota exhausted.";
994
+ readonly examples: readonly ["round-robin", "sticky"];
995
+ };
996
+ readonly account_rotation: {
997
+ readonly type: "string";
998
+ readonly enum: string[];
999
+ readonly default: "round-robin";
1000
+ readonly description: "Alias for rotation_strategy (backward compat)";
1001
+ readonly examples: readonly ["round-robin", "sticky"];
1002
+ };
1003
+ readonly debug: {
1004
+ readonly oneOf: readonly [{
1005
+ readonly type: "boolean";
1006
+ }, {
1007
+ readonly type: "object";
1008
+ readonly additionalProperties: false;
1009
+ readonly properties: {
1010
+ readonly enabled: {
1011
+ readonly type: "boolean";
1012
+ readonly default: false;
1013
+ readonly description: "enable debug";
1014
+ readonly examples: readonly [false, true];
1015
+ };
1016
+ readonly level: {
1017
+ readonly type: "string";
1018
+ readonly enum: readonly ["debug", "info", "warn", "error", "silent"];
1019
+ readonly default: "warn";
1020
+ readonly description: "log level";
1021
+ readonly examples: readonly ["debug", "warn"];
1022
+ };
1023
+ readonly log_file: {
1024
+ readonly type: readonly ["string", "null"];
1025
+ readonly default: null;
1026
+ readonly description: "custom log file path";
1027
+ readonly examples: readonly [null, "~/.config/opencode/antigravity-debug.log"];
1028
+ };
1029
+ readonly retain_days: {
1030
+ readonly type: "integer";
1031
+ readonly minimum: 1;
1032
+ readonly maximum: 90;
1033
+ readonly default: 7;
1034
+ readonly description: "log retention days";
1035
+ readonly examples: readonly [7];
1036
+ };
1037
+ readonly max_bytes: {
1038
+ readonly type: "integer";
1039
+ readonly minimum: 1024;
1040
+ readonly maximum: number;
1041
+ readonly default: 10485760;
1042
+ readonly description: "max bytes before rotation, 10MB default";
1043
+ readonly examples: readonly [10485760];
1044
+ };
1045
+ readonly tui_buffer_lines: {
1046
+ readonly type: "integer";
1047
+ readonly minimum: 10;
1048
+ readonly maximum: 10000;
1049
+ readonly default: 1000;
1050
+ readonly description: "circular TUI buffer lines";
1051
+ readonly examples: readonly [1000];
1052
+ };
1053
+ readonly redact_secrets: {
1054
+ readonly type: "boolean";
1055
+ readonly default: true;
1056
+ readonly description: "redact secrets in logs";
1057
+ readonly examples: readonly [true];
1058
+ };
1059
+ };
1060
+ }];
1061
+ readonly default: false;
1062
+ readonly description: "Debug mode — boolean or object with rotation, retention, redaction.";
1063
+ readonly examples: readonly [false, true, {
1064
+ readonly enabled: true;
1065
+ readonly level: "debug";
1066
+ }];
1067
+ };
1068
+ readonly debug_enabled: {
1069
+ readonly type: "boolean";
1070
+ readonly default: false;
1071
+ readonly description: "shortcut for debug.enabled";
1072
+ readonly examples: readonly [false, true];
1073
+ };
1074
+ readonly google_search_enabled: {
1075
+ readonly type: "boolean";
1076
+ readonly default: true;
1077
+ readonly description: "Enable native google_search grounding tool (Gemini) injection.";
1078
+ readonly examples: readonly [true, false];
1079
+ };
1080
+ readonly google_search: {
1081
+ readonly type: "object";
1082
+ readonly additionalProperties: false;
1083
+ readonly default: {
1084
+ readonly enabled: boolean;
1085
+ readonly model: string;
1086
+ readonly url_context: boolean;
1087
+ readonly include_grounding_metadata: boolean;
1088
+ };
1089
+ readonly description: "Google search grounding full config";
1090
+ readonly properties: {
1091
+ readonly enabled: {
1092
+ readonly type: "boolean";
1093
+ readonly default: true;
1094
+ readonly description: "enable google_search tool";
1095
+ readonly examples: readonly [true, false];
1096
+ };
1097
+ readonly model: {
1098
+ readonly type: "string";
1099
+ readonly default: "gemini-3-flash";
1100
+ readonly description: "model used for search grounding";
1101
+ readonly examples: readonly ["gemini-3-flash", "gemini-3-flash-preview"];
1102
+ };
1103
+ readonly url_context: {
1104
+ readonly type: "boolean";
1105
+ readonly default: true;
1106
+ readonly description: "enable url_context companion tool";
1107
+ readonly examples: readonly [true, false];
1108
+ };
1109
+ readonly include_grounding_metadata: {
1110
+ readonly type: "boolean";
1111
+ readonly default: true;
1112
+ readonly description: "include groundingMetadata in response";
1113
+ readonly examples: readonly [true];
1114
+ };
1115
+ };
1116
+ };
1117
+ readonly endpoints: {
1118
+ readonly type: "object";
1119
+ readonly additionalProperties: false;
1120
+ readonly description: "Override Antigravity endpoints. Observer warns: must use https and googleapis.com for bypass.";
1121
+ readonly properties: {
1122
+ readonly prod: {
1123
+ readonly type: "string";
1124
+ readonly format: "uri";
1125
+ readonly default: "https://cloudcode-pa.googleapis.com";
1126
+ readonly description: "PROD endpoint";
1127
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1128
+ };
1129
+ readonly daily: {
1130
+ readonly type: "string";
1131
+ readonly format: "uri";
1132
+ readonly default: "https://daily-cloudcode-pa.googleapis.com";
1133
+ readonly description: "DAILY endpoint";
1134
+ readonly examples: readonly ["https://daily-cloudcode-pa.googleapis.com"];
1135
+ };
1136
+ readonly sandbox: {
1137
+ readonly type: "string";
1138
+ readonly format: "uri";
1139
+ readonly default: "https://daily-cloudcode-pa.sandbox.googleapis.com";
1140
+ readonly description: "SANDBOX endpoint";
1141
+ readonly examples: readonly ["https://daily-cloudcode-pa.sandbox.googleapis.com"];
1142
+ };
1143
+ readonly autopush: {
1144
+ readonly type: "string";
1145
+ readonly format: "uri";
1146
+ readonly default: "https://autopush-cloudcode-pa.sandbox.googleapis.com";
1147
+ readonly description: "AUTOPUSH optional";
1148
+ readonly examples: readonly ["https://autopush-cloudcode-pa.sandbox.googleapis.com"];
1149
+ };
1150
+ readonly quota: {
1151
+ readonly type: "string";
1152
+ readonly format: "uri";
1153
+ readonly description: "quota endpoint override";
1154
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1155
+ };
1156
+ readonly models: {
1157
+ readonly type: "string";
1158
+ readonly format: "uri";
1159
+ readonly description: "models endpoint override";
1160
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1161
+ };
1162
+ readonly gemini_cli: {
1163
+ readonly type: "string";
1164
+ readonly format: "uri";
1165
+ readonly description: "Gemini CLI companion endpoint";
1166
+ readonly examples: readonly ["https://cloudaicompanion.googleapis.com"];
1167
+ };
1168
+ readonly cloud_companion: {
1169
+ readonly type: "string";
1170
+ readonly format: "uri";
1171
+ readonly description: "cloudaicompanion.googleapis.com";
1172
+ readonly examples: readonly ["https://cloudaicompanion.googleapis.com"];
1173
+ };
1174
+ readonly generate: {
1175
+ readonly type: "string";
1176
+ readonly format: "uri";
1177
+ readonly description: "generateContent base";
1178
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1179
+ };
1180
+ readonly stream_generate: {
1181
+ readonly type: "string";
1182
+ readonly format: "uri";
1183
+ readonly description: "streamGenerateContent base";
1184
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1185
+ };
1186
+ };
1187
+ };
1188
+ readonly quota: {
1189
+ readonly type: "object";
1190
+ readonly additionalProperties: false;
1191
+ readonly description: "Quota config";
1192
+ readonly properties: {
1193
+ readonly refresh_interval_minutes: {
1194
+ readonly type: "integer";
1195
+ readonly minimum: 1;
1196
+ readonly maximum: 120;
1197
+ readonly default: 15;
1198
+ readonly examples: readonly [15];
1199
+ };
1200
+ readonly cache_ttl_minutes: {
1201
+ readonly type: "integer";
1202
+ readonly minimum: 1;
1203
+ readonly maximum: 60;
1204
+ readonly default: 15;
1205
+ readonly examples: readonly [15];
1206
+ };
1207
+ readonly soft_threshold: {
1208
+ readonly type: "number";
1209
+ readonly minimum: 0.1;
1210
+ readonly maximum: 1;
1211
+ readonly default: 0.9;
1212
+ readonly examples: readonly [0.9];
1213
+ };
1214
+ readonly hard_threshold: {
1215
+ readonly type: "number";
1216
+ readonly minimum: 0.5;
1217
+ readonly maximum: 1;
1218
+ readonly default: 1;
1219
+ readonly examples: readonly [1];
1220
+ };
1221
+ readonly dual_pool: {
1222
+ readonly type: "boolean";
1223
+ readonly default: true;
1224
+ readonly description: "enable dual pool Antigravity + Gemini CLI";
1225
+ readonly examples: readonly [true];
1226
+ };
1227
+ };
1228
+ };
1229
+ readonly bypass: {
1230
+ readonly type: "object";
1231
+ readonly additionalProperties: false;
1232
+ readonly description: "Bypass metadata — documents how library imitates Antigravity traffic. UA must match antigravity/{semver} {os}/{arch}.";
1233
+ readonly properties: {
1234
+ readonly version_fallback: {
1235
+ readonly type: "string";
1236
+ readonly pattern: "^\\d+\\.\\d+\\.\\d+";
1237
+ readonly default: "1.19.2";
1238
+ readonly examples: readonly ["1.19.2"];
1239
+ };
1240
+ readonly min_supported: {
1241
+ readonly type: "string";
1242
+ readonly pattern: "^\\d+\\.\\d+\\.\\d+";
1243
+ readonly default: "1.15.8";
1244
+ readonly examples: readonly ["1.15.8"];
1245
+ };
1246
+ readonly user_agent: {
1247
+ readonly type: "string";
1248
+ readonly default: "antigravity/1.19.2";
1249
+ readonly description: "full UA, should contain antigravity/ prefix";
1250
+ readonly examples: readonly ["antigravity/1.19.2 darwin/arm64", "antigravity/1.19.2 linux/x64"];
1251
+ };
1252
+ readonly strip_user_project_header: {
1253
+ readonly type: "boolean";
1254
+ readonly default: true;
1255
+ readonly description: "strip x-goog-user-project to avoid 403";
1256
+ readonly examples: readonly [true];
1257
+ };
1258
+ readonly fingerprint_jitter: {
1259
+ readonly type: "boolean";
1260
+ readonly default: true;
1261
+ readonly examples: readonly [true];
1262
+ };
1263
+ readonly pid_offset: {
1264
+ readonly type: "boolean";
1265
+ readonly default: false;
1266
+ readonly examples: readonly [false, true];
1267
+ };
1268
+ };
1269
+ };
1270
+ readonly fallback_project_id: {
1271
+ readonly type: "string";
1272
+ readonly minLength: 3;
1273
+ readonly default: "rising-fact-p41fc";
1274
+ readonly description: "fallback project id blinded";
1275
+ readonly examples: readonly ["rising-fact-p41fc"];
1276
+ };
1277
+ readonly default_model: {
1278
+ readonly type: "string";
1279
+ readonly default: "antigravity-gemini-3-flash";
1280
+ readonly description: "default chat model 2026";
1281
+ readonly examples: readonly ["antigravity-gemini-3-flash", "gemini-3-pro-preview"];
1282
+ };
1283
+ readonly search_model: {
1284
+ readonly type: "string";
1285
+ readonly default: "gemini-3-flash";
1286
+ readonly description: "search grounding model";
1287
+ readonly examples: readonly ["gemini-3-flash", "gemini-3-flash-preview"];
1288
+ };
1289
+ readonly client_id: {
1290
+ readonly type: readonly ["string", "null"];
1291
+ readonly default: null;
1292
+ readonly description: "OAuth client_id override (public)";
1293
+ readonly examples: readonly [null, "1071006060591-...apps.googleusercontent.com"];
1294
+ };
1295
+ readonly client_secret: {
1296
+ readonly type: readonly ["string", "null"];
1297
+ readonly default: null;
1298
+ readonly description: "OAuth client_secret override — do not commit";
1299
+ readonly examples: readonly [null];
1300
+ };
1301
+ readonly accounts_file: {
1302
+ readonly type: readonly ["string", "null"];
1303
+ readonly default: null;
1304
+ readonly format: "uri-reference";
1305
+ readonly description: "custom accounts file path";
1306
+ readonly examples: readonly [null, "~/.config/opencode/antigravity-accounts.json"];
1307
+ };
1308
+ readonly models_allowlist: {
1309
+ readonly type: "array";
1310
+ readonly items: {
1311
+ readonly type: "string";
1312
+ };
1313
+ readonly default: readonly [];
1314
+ readonly description: "optional model allowlist";
1315
+ readonly examples: readonly [readonly [], readonly ["antigravity-gemini-3-flash", "claude-opus-4-6-thinking"]];
1316
+ };
1317
+ readonly strip_user_project: {
1318
+ readonly type: "boolean";
1319
+ readonly default: true;
1320
+ readonly description: "legacy alias for bypass.strip_user_project_header";
1321
+ readonly examples: readonly [true];
1322
+ };
1323
+ readonly toast_scope: {
1324
+ readonly type: "string";
1325
+ readonly enum: readonly ["all", "project", "minimal", "none"];
1326
+ readonly default: "all";
1327
+ readonly description: "toast/notification display scope (v1 field)";
1328
+ readonly examples: readonly ["all", "project", "minimal", "none"];
1329
+ };
1330
+ readonly soft_quota_threshold_percent: {
1331
+ readonly type: "number";
1332
+ readonly minimum: 0;
1333
+ readonly maximum: 100;
1334
+ readonly default: 90;
1335
+ readonly description: "quota percentage where soft warning/fallback starts (v1 field)";
1336
+ readonly examples: readonly [90];
1337
+ };
1338
+ readonly quota_fallback: {
1339
+ readonly oneOf: readonly [{
1340
+ readonly type: "boolean";
1341
+ }, {
1342
+ readonly type: "string";
1343
+ }];
1344
+ readonly default: "auto";
1345
+ readonly description: 'fallback strategy on quota exhaustion: boolean | "auto" | modelName (v1 field)';
1346
+ readonly examples: readonly ["auto", true, false];
1347
+ };
1348
+ readonly soft_quota_cache_ttl_minutes: {
1349
+ readonly type: "integer";
1350
+ readonly minimum: 1;
1351
+ readonly maximum: 1440;
1352
+ readonly default: 5;
1353
+ readonly description: "soft quota cache TTL in minutes (v1 field)";
1354
+ readonly examples: readonly [5];
1355
+ };
1356
+ readonly version_cache_ttl: {
1357
+ readonly type: "integer";
1358
+ readonly minimum: 1;
1359
+ readonly maximum: 10080;
1360
+ readonly default: 60;
1361
+ readonly description: "version/update check cache TTL in minutes (v1 field)";
1362
+ readonly examples: readonly [60];
1363
+ };
1364
+ };
1365
+ readonly required: readonly [];
1366
+ };
1367
+ defaultsRaw: AntigravityConfig;
1368
+ };
1369
+ export default Config;
1370
+ export declare const SCHEMA: {
1371
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
1372
+ readonly $id: "https://opencode.ai/schemas/antigravity.json";
1373
+ readonly title: "devthink provider config — antigravity.json";
1374
+ readonly description: "Configuration for the devthink provider plugin. Bypass metadata: mimics antigravity/{ver} {os}/{arch} User-Agent, strips x-goog-user-project, endpoint cascade 403/404/5xx, supports Gemini CLI dual quota pool, round-robin/sticky rotation, google_search grounding.";
1375
+ readonly type: "object";
1376
+ readonly additionalProperties: false;
1377
+ readonly properties: {
1378
+ readonly $schema: {
1379
+ readonly type: "string";
1380
+ readonly format: "uri";
1381
+ readonly description: "JSON schema pointer";
1382
+ readonly default: "https://json-schema.org/draft-07/schema#";
1383
+ readonly examples: readonly ["https://json-schema.org/draft-07/schema#", "./antigravity.schema.json"];
1384
+ };
1385
+ readonly version: {
1386
+ readonly type: "integer";
1387
+ readonly minimum: 1;
1388
+ readonly maximum: 10;
1389
+ readonly default: 2;
1390
+ readonly description: "config version";
1391
+ readonly examples: readonly [2];
1392
+ };
1393
+ readonly cli_first: {
1394
+ readonly type: "boolean";
1395
+ readonly default: false;
1396
+ readonly description: "When true, tries Gemini CLI quota pool first before Antigravity pool. Useful when Antigravity quota is exhausted but CLI pool still has tokens.";
1397
+ readonly examples: readonly [false, true];
1398
+ };
1399
+ readonly pid_offset_enabled: {
1400
+ readonly type: "boolean";
1401
+ readonly default: false;
1402
+ readonly description: "Enables PID offset trick to bypass per-PID rate limiting observed in Gemini CLI gateway. When enabled, adds pid % 1000 to jitter.";
1403
+ readonly examples: readonly [false, true];
1404
+ };
1405
+ readonly quota_refresh_interval_minutes: {
1406
+ readonly type: "integer";
1407
+ readonly minimum: 1;
1408
+ readonly maximum: 120;
1409
+ readonly default: 15;
1410
+ readonly description: "Interval in minutes for background quota refresh. Adaptive TTL 2-10min when near soft threshold 90%.";
1411
+ readonly examples: readonly [5, 15, 30];
1412
+ };
1413
+ readonly rotation_strategy: {
1414
+ readonly type: "string";
1415
+ readonly enum: string[];
1416
+ readonly default: "round-robin";
1417
+ readonly description: "Multi-account rotation strategy — round-robin distributes evenly, sticky keeps same account until quota exhausted.";
1418
+ readonly examples: readonly ["round-robin", "sticky"];
1419
+ };
1420
+ readonly account_rotation: {
1421
+ readonly type: "string";
1422
+ readonly enum: string[];
1423
+ readonly default: "round-robin";
1424
+ readonly description: "Alias for rotation_strategy (backward compat)";
1425
+ readonly examples: readonly ["round-robin", "sticky"];
1426
+ };
1427
+ readonly debug: {
1428
+ readonly oneOf: readonly [{
1429
+ readonly type: "boolean";
1430
+ }, {
1431
+ readonly type: "object";
1432
+ readonly additionalProperties: false;
1433
+ readonly properties: {
1434
+ readonly enabled: {
1435
+ readonly type: "boolean";
1436
+ readonly default: false;
1437
+ readonly description: "enable debug";
1438
+ readonly examples: readonly [false, true];
1439
+ };
1440
+ readonly level: {
1441
+ readonly type: "string";
1442
+ readonly enum: readonly ["debug", "info", "warn", "error", "silent"];
1443
+ readonly default: "warn";
1444
+ readonly description: "log level";
1445
+ readonly examples: readonly ["debug", "warn"];
1446
+ };
1447
+ readonly log_file: {
1448
+ readonly type: readonly ["string", "null"];
1449
+ readonly default: null;
1450
+ readonly description: "custom log file path";
1451
+ readonly examples: readonly [null, "~/.config/opencode/antigravity-debug.log"];
1452
+ };
1453
+ readonly retain_days: {
1454
+ readonly type: "integer";
1455
+ readonly minimum: 1;
1456
+ readonly maximum: 90;
1457
+ readonly default: 7;
1458
+ readonly description: "log retention days";
1459
+ readonly examples: readonly [7];
1460
+ };
1461
+ readonly max_bytes: {
1462
+ readonly type: "integer";
1463
+ readonly minimum: 1024;
1464
+ readonly maximum: number;
1465
+ readonly default: 10485760;
1466
+ readonly description: "max bytes before rotation, 10MB default";
1467
+ readonly examples: readonly [10485760];
1468
+ };
1469
+ readonly tui_buffer_lines: {
1470
+ readonly type: "integer";
1471
+ readonly minimum: 10;
1472
+ readonly maximum: 10000;
1473
+ readonly default: 1000;
1474
+ readonly description: "circular TUI buffer lines";
1475
+ readonly examples: readonly [1000];
1476
+ };
1477
+ readonly redact_secrets: {
1478
+ readonly type: "boolean";
1479
+ readonly default: true;
1480
+ readonly description: "redact secrets in logs";
1481
+ readonly examples: readonly [true];
1482
+ };
1483
+ };
1484
+ }];
1485
+ readonly default: false;
1486
+ readonly description: "Debug mode — boolean or object with rotation, retention, redaction.";
1487
+ readonly examples: readonly [false, true, {
1488
+ readonly enabled: true;
1489
+ readonly level: "debug";
1490
+ }];
1491
+ };
1492
+ readonly debug_enabled: {
1493
+ readonly type: "boolean";
1494
+ readonly default: false;
1495
+ readonly description: "shortcut for debug.enabled";
1496
+ readonly examples: readonly [false, true];
1497
+ };
1498
+ readonly google_search_enabled: {
1499
+ readonly type: "boolean";
1500
+ readonly default: true;
1501
+ readonly description: "Enable native google_search grounding tool (Gemini) injection.";
1502
+ readonly examples: readonly [true, false];
1503
+ };
1504
+ readonly google_search: {
1505
+ readonly type: "object";
1506
+ readonly additionalProperties: false;
1507
+ readonly default: {
1508
+ readonly enabled: boolean;
1509
+ readonly model: string;
1510
+ readonly url_context: boolean;
1511
+ readonly include_grounding_metadata: boolean;
1512
+ };
1513
+ readonly description: "Google search grounding full config";
1514
+ readonly properties: {
1515
+ readonly enabled: {
1516
+ readonly type: "boolean";
1517
+ readonly default: true;
1518
+ readonly description: "enable google_search tool";
1519
+ readonly examples: readonly [true, false];
1520
+ };
1521
+ readonly model: {
1522
+ readonly type: "string";
1523
+ readonly default: "gemini-3-flash";
1524
+ readonly description: "model used for search grounding";
1525
+ readonly examples: readonly ["gemini-3-flash", "gemini-3-flash-preview"];
1526
+ };
1527
+ readonly url_context: {
1528
+ readonly type: "boolean";
1529
+ readonly default: true;
1530
+ readonly description: "enable url_context companion tool";
1531
+ readonly examples: readonly [true, false];
1532
+ };
1533
+ readonly include_grounding_metadata: {
1534
+ readonly type: "boolean";
1535
+ readonly default: true;
1536
+ readonly description: "include groundingMetadata in response";
1537
+ readonly examples: readonly [true];
1538
+ };
1539
+ };
1540
+ };
1541
+ readonly endpoints: {
1542
+ readonly type: "object";
1543
+ readonly additionalProperties: false;
1544
+ readonly description: "Override Antigravity endpoints. Observer warns: must use https and googleapis.com for bypass.";
1545
+ readonly properties: {
1546
+ readonly prod: {
1547
+ readonly type: "string";
1548
+ readonly format: "uri";
1549
+ readonly default: "https://cloudcode-pa.googleapis.com";
1550
+ readonly description: "PROD endpoint";
1551
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1552
+ };
1553
+ readonly daily: {
1554
+ readonly type: "string";
1555
+ readonly format: "uri";
1556
+ readonly default: "https://daily-cloudcode-pa.googleapis.com";
1557
+ readonly description: "DAILY endpoint";
1558
+ readonly examples: readonly ["https://daily-cloudcode-pa.googleapis.com"];
1559
+ };
1560
+ readonly sandbox: {
1561
+ readonly type: "string";
1562
+ readonly format: "uri";
1563
+ readonly default: "https://daily-cloudcode-pa.sandbox.googleapis.com";
1564
+ readonly description: "SANDBOX endpoint";
1565
+ readonly examples: readonly ["https://daily-cloudcode-pa.sandbox.googleapis.com"];
1566
+ };
1567
+ readonly autopush: {
1568
+ readonly type: "string";
1569
+ readonly format: "uri";
1570
+ readonly default: "https://autopush-cloudcode-pa.sandbox.googleapis.com";
1571
+ readonly description: "AUTOPUSH optional";
1572
+ readonly examples: readonly ["https://autopush-cloudcode-pa.sandbox.googleapis.com"];
1573
+ };
1574
+ readonly quota: {
1575
+ readonly type: "string";
1576
+ readonly format: "uri";
1577
+ readonly description: "quota endpoint override";
1578
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1579
+ };
1580
+ readonly models: {
1581
+ readonly type: "string";
1582
+ readonly format: "uri";
1583
+ readonly description: "models endpoint override";
1584
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1585
+ };
1586
+ readonly gemini_cli: {
1587
+ readonly type: "string";
1588
+ readonly format: "uri";
1589
+ readonly description: "Gemini CLI companion endpoint";
1590
+ readonly examples: readonly ["https://cloudaicompanion.googleapis.com"];
1591
+ };
1592
+ readonly cloud_companion: {
1593
+ readonly type: "string";
1594
+ readonly format: "uri";
1595
+ readonly description: "cloudaicompanion.googleapis.com";
1596
+ readonly examples: readonly ["https://cloudaicompanion.googleapis.com"];
1597
+ };
1598
+ readonly generate: {
1599
+ readonly type: "string";
1600
+ readonly format: "uri";
1601
+ readonly description: "generateContent base";
1602
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1603
+ };
1604
+ readonly stream_generate: {
1605
+ readonly type: "string";
1606
+ readonly format: "uri";
1607
+ readonly description: "streamGenerateContent base";
1608
+ readonly examples: readonly ["https://cloudcode-pa.googleapis.com"];
1609
+ };
1610
+ };
1611
+ };
1612
+ readonly quota: {
1613
+ readonly type: "object";
1614
+ readonly additionalProperties: false;
1615
+ readonly description: "Quota config";
1616
+ readonly properties: {
1617
+ readonly refresh_interval_minutes: {
1618
+ readonly type: "integer";
1619
+ readonly minimum: 1;
1620
+ readonly maximum: 120;
1621
+ readonly default: 15;
1622
+ readonly examples: readonly [15];
1623
+ };
1624
+ readonly cache_ttl_minutes: {
1625
+ readonly type: "integer";
1626
+ readonly minimum: 1;
1627
+ readonly maximum: 60;
1628
+ readonly default: 15;
1629
+ readonly examples: readonly [15];
1630
+ };
1631
+ readonly soft_threshold: {
1632
+ readonly type: "number";
1633
+ readonly minimum: 0.1;
1634
+ readonly maximum: 1;
1635
+ readonly default: 0.9;
1636
+ readonly examples: readonly [0.9];
1637
+ };
1638
+ readonly hard_threshold: {
1639
+ readonly type: "number";
1640
+ readonly minimum: 0.5;
1641
+ readonly maximum: 1;
1642
+ readonly default: 1;
1643
+ readonly examples: readonly [1];
1644
+ };
1645
+ readonly dual_pool: {
1646
+ readonly type: "boolean";
1647
+ readonly default: true;
1648
+ readonly description: "enable dual pool Antigravity + Gemini CLI";
1649
+ readonly examples: readonly [true];
1650
+ };
1651
+ };
1652
+ };
1653
+ readonly bypass: {
1654
+ readonly type: "object";
1655
+ readonly additionalProperties: false;
1656
+ readonly description: "Bypass metadata — documents how library imitates Antigravity traffic. UA must match antigravity/{semver} {os}/{arch}.";
1657
+ readonly properties: {
1658
+ readonly version_fallback: {
1659
+ readonly type: "string";
1660
+ readonly pattern: "^\\d+\\.\\d+\\.\\d+";
1661
+ readonly default: "1.19.2";
1662
+ readonly examples: readonly ["1.19.2"];
1663
+ };
1664
+ readonly min_supported: {
1665
+ readonly type: "string";
1666
+ readonly pattern: "^\\d+\\.\\d+\\.\\d+";
1667
+ readonly default: "1.15.8";
1668
+ readonly examples: readonly ["1.15.8"];
1669
+ };
1670
+ readonly user_agent: {
1671
+ readonly type: "string";
1672
+ readonly default: "antigravity/1.19.2";
1673
+ readonly description: "full UA, should contain antigravity/ prefix";
1674
+ readonly examples: readonly ["antigravity/1.19.2 darwin/arm64", "antigravity/1.19.2 linux/x64"];
1675
+ };
1676
+ readonly strip_user_project_header: {
1677
+ readonly type: "boolean";
1678
+ readonly default: true;
1679
+ readonly description: "strip x-goog-user-project to avoid 403";
1680
+ readonly examples: readonly [true];
1681
+ };
1682
+ readonly fingerprint_jitter: {
1683
+ readonly type: "boolean";
1684
+ readonly default: true;
1685
+ readonly examples: readonly [true];
1686
+ };
1687
+ readonly pid_offset: {
1688
+ readonly type: "boolean";
1689
+ readonly default: false;
1690
+ readonly examples: readonly [false, true];
1691
+ };
1692
+ };
1693
+ };
1694
+ readonly fallback_project_id: {
1695
+ readonly type: "string";
1696
+ readonly minLength: 3;
1697
+ readonly default: "rising-fact-p41fc";
1698
+ readonly description: "fallback project id blinded";
1699
+ readonly examples: readonly ["rising-fact-p41fc"];
1700
+ };
1701
+ readonly default_model: {
1702
+ readonly type: "string";
1703
+ readonly default: "antigravity-gemini-3-flash";
1704
+ readonly description: "default chat model 2026";
1705
+ readonly examples: readonly ["antigravity-gemini-3-flash", "gemini-3-pro-preview"];
1706
+ };
1707
+ readonly search_model: {
1708
+ readonly type: "string";
1709
+ readonly default: "gemini-3-flash";
1710
+ readonly description: "search grounding model";
1711
+ readonly examples: readonly ["gemini-3-flash", "gemini-3-flash-preview"];
1712
+ };
1713
+ readonly client_id: {
1714
+ readonly type: readonly ["string", "null"];
1715
+ readonly default: null;
1716
+ readonly description: "OAuth client_id override (public)";
1717
+ readonly examples: readonly [null, "1071006060591-...apps.googleusercontent.com"];
1718
+ };
1719
+ readonly client_secret: {
1720
+ readonly type: readonly ["string", "null"];
1721
+ readonly default: null;
1722
+ readonly description: "OAuth client_secret override — do not commit";
1723
+ readonly examples: readonly [null];
1724
+ };
1725
+ readonly accounts_file: {
1726
+ readonly type: readonly ["string", "null"];
1727
+ readonly default: null;
1728
+ readonly format: "uri-reference";
1729
+ readonly description: "custom accounts file path";
1730
+ readonly examples: readonly [null, "~/.config/opencode/antigravity-accounts.json"];
1731
+ };
1732
+ readonly models_allowlist: {
1733
+ readonly type: "array";
1734
+ readonly items: {
1735
+ readonly type: "string";
1736
+ };
1737
+ readonly default: readonly [];
1738
+ readonly description: "optional model allowlist";
1739
+ readonly examples: readonly [readonly [], readonly ["antigravity-gemini-3-flash", "claude-opus-4-6-thinking"]];
1740
+ };
1741
+ readonly strip_user_project: {
1742
+ readonly type: "boolean";
1743
+ readonly default: true;
1744
+ readonly description: "legacy alias for bypass.strip_user_project_header";
1745
+ readonly examples: readonly [true];
1746
+ };
1747
+ readonly toast_scope: {
1748
+ readonly type: "string";
1749
+ readonly enum: readonly ["all", "project", "minimal", "none"];
1750
+ readonly default: "all";
1751
+ readonly description: "toast/notification display scope (v1 field)";
1752
+ readonly examples: readonly ["all", "project", "minimal", "none"];
1753
+ };
1754
+ readonly soft_quota_threshold_percent: {
1755
+ readonly type: "number";
1756
+ readonly minimum: 0;
1757
+ readonly maximum: 100;
1758
+ readonly default: 90;
1759
+ readonly description: "quota percentage where soft warning/fallback starts (v1 field)";
1760
+ readonly examples: readonly [90];
1761
+ };
1762
+ readonly quota_fallback: {
1763
+ readonly oneOf: readonly [{
1764
+ readonly type: "boolean";
1765
+ }, {
1766
+ readonly type: "string";
1767
+ }];
1768
+ readonly default: "auto";
1769
+ readonly description: 'fallback strategy on quota exhaustion: boolean | "auto" | modelName (v1 field)';
1770
+ readonly examples: readonly ["auto", true, false];
1771
+ };
1772
+ readonly soft_quota_cache_ttl_minutes: {
1773
+ readonly type: "integer";
1774
+ readonly minimum: 1;
1775
+ readonly maximum: 1440;
1776
+ readonly default: 5;
1777
+ readonly description: "soft quota cache TTL in minutes (v1 field)";
1778
+ readonly examples: readonly [5];
1779
+ };
1780
+ readonly version_cache_ttl: {
1781
+ readonly type: "integer";
1782
+ readonly minimum: 1;
1783
+ readonly maximum: 10080;
1784
+ readonly default: 60;
1785
+ readonly description: "version/update check cache TTL in minutes (v1 field)";
1786
+ readonly examples: readonly [60];
1787
+ };
1788
+ };
1789
+ readonly required: readonly [];
1790
+ };
1791
+ /**
1792
+ * Validates an email address.
1793
+ * @param email - candidate email (nullish / non-string inputs coerce to "")
1794
+ * @returns true when the address has exactly one "@" and a dotted domain
1795
+ */
1796
+ export declare function isValidEmail(email: string): boolean;
1797
+ /**
1798
+ * Validates a semantic-version string (optional prerelease / build suffix).
1799
+ * @param v - candidate version
1800
+ */
1801
+ export declare function isValidSemver(v: string): boolean;
1802
+ /**
1803
+ * Validates a Google-style project id (lowercase, 6..30 chars) or the
1804
+ * documented fallback project id.
1805
+ * @param id - candidate project id
1806
+ */
1807
+ export declare function isValidProjectId(id: string): boolean;
1808
+ /**
1809
+ * Validates a persisted account shape (email + refresh token).
1810
+ * @param a - candidate account object
1811
+ * @returns valid flag plus a human-readable error list
1812
+ */
1813
+ export declare function validateAccount(a: any): {
1814
+ valid: boolean;
1815
+ errors: string[];
1816
+ };
1817
+ /**
1818
+ * Validates a model id semantically: the lowercased id must contain one of
1819
+ * the substrings gemini / claude / antigravity.
1820
+ * @param model - candidate model id
1821
+ */
1822
+ export declare function validateModelId(model: string): boolean;
1823
+ /** Config directory (honors OPENCODE_CONFIG_DIR, defaults to ~/.config/opencode). */
1824
+ export declare const cfgDir: () => string;
1825
+ /** Governed fallback version when every version-chain source fails. */
1826
+ export declare const VERSION_FALLBACK: "1.19.2";
1827
+ /** Fetches the latest Antigravity version across the known update sources. */
1828
+ export declare const fetchVersionChain: () => Promise<string>;
1829
+ export declare const validateEmail: typeof isValidEmail;
1830
+ export declare const validateSemver: typeof isValidSemver;
1831
+ export declare const validateProjectId: typeof isValidProjectId;
1832
+ /** Charset regex variant of model-id validation (former system.ts validateModelId). */
1833
+ export declare const validateModelIdCharset: (id: string) => boolean;
1834
+ /** Minimal raw JSON read of antigravity.json (no schema validation, never throws). */
1835
+ export declare const loadConfigRaw: () => any;
1836
+ /** Minimal raw JSON write of antigravity.json (atomic tmp+rename, chmod 600, never throws). */
1837
+ export declare const saveConfigRaw: (c: any) => void;
1838
+ /** Atomic file write (tmp + chmod 600 + rename) used for plain-file persistence. */
1839
+ export declare const atomicWrite: (p: string, c: string) => void;
1840
+ import type { gatewayconfig, gatewaydefinition } from "./types";
1841
+ /** loadconfig — resolve the gateway definition from the standard locations
1842
+ * caches the result for the process lifetime — call reloadconfig to refresh */
1843
+ export declare function loadconfig(): Promise<gatewaydefinition>;
1844
+ /** reloadconfig — clear the cache and reload from disk */
1845
+ export declare function reloadconfig(): Promise<gatewaydefinition>;
1846
+ /** getversion — get one version config by id */
1847
+ export declare function getversion(id: string): Promise<gatewayconfig | null>;
1848
+ /** listversions — get all version ids */
1849
+ export declare function listversions(): Promise<string[]>;
1850
+ /** validateconfig — check a gateway definition for common errors
1851
+ * returns a list of human readable problems — empty when valid */
1852
+ export declare function validateconfig(def: gatewaydefinition): string[];
1853
+ //# sourceMappingURL=config.d.ts.map