@cortexkit/opencode-antigravity-auth 1.0.1 → 2.0.0

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 (374) hide show
  1. package/README.md +225 -553
  2. package/dist/cli.js +3790 -0
  3. package/dist/cli.js.map +7 -0
  4. package/dist/index.d.ts +1 -3
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +18951 -13145
  7. package/dist/index.js.map +4 -4
  8. package/dist/src/antigravity/oauth.d.ts +1 -1
  9. package/dist/src/antigravity/oauth.js +1 -1
  10. package/dist/src/cli.d.ts +21 -0
  11. package/dist/src/cli.d.ts.map +1 -0
  12. package/dist/src/cli.js +237 -0
  13. package/dist/src/cli.js.map +1 -0
  14. package/dist/src/constants.d.ts +1 -1
  15. package/dist/src/constants.js +1 -1
  16. package/dist/src/hooks/auto-update-checker/cache.d.ts.map +1 -1
  17. package/dist/src/hooks/auto-update-checker/cache.js +13 -13
  18. package/dist/src/hooks/auto-update-checker/cache.js.map +1 -1
  19. package/dist/src/hooks/auto-update-checker/checker.d.ts +1 -1
  20. package/dist/src/hooks/auto-update-checker/checker.d.ts.map +1 -1
  21. package/dist/src/hooks/auto-update-checker/checker.js +75 -51
  22. package/dist/src/hooks/auto-update-checker/checker.js.map +1 -1
  23. package/dist/src/hooks/auto-update-checker/constants.d.ts.map +1 -1
  24. package/dist/src/hooks/auto-update-checker/constants.js +12 -12
  25. package/dist/src/hooks/auto-update-checker/constants.js.map +1 -1
  26. package/dist/src/hooks/auto-update-checker/index.d.ts +6 -6
  27. package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -1
  28. package/dist/src/hooks/auto-update-checker/index.js +17 -17
  29. package/dist/src/hooks/auto-update-checker/index.js.map +1 -1
  30. package/dist/src/hooks/auto-update-checker/logging.js +2 -2
  31. package/dist/src/hooks/auto-update-checker/logging.js.map +1 -1
  32. package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -1
  33. package/dist/src/plugin/account-access.d.ts +99 -0
  34. package/dist/src/plugin/account-access.d.ts.map +1 -0
  35. package/dist/src/plugin/account-access.js +480 -0
  36. package/dist/src/plugin/account-access.js.map +1 -0
  37. package/dist/src/plugin/accounts.d.ts +7 -236
  38. package/dist/src/plugin/accounts.d.ts.map +1 -1
  39. package/dist/src/plugin/accounts.js +31 -1166
  40. package/dist/src/plugin/accounts.js.map +1 -1
  41. package/dist/src/plugin/agy-request-metadata.d.ts +2 -0
  42. package/dist/src/plugin/agy-request-metadata.d.ts.map +1 -0
  43. package/dist/src/plugin/agy-request-metadata.js +2 -0
  44. package/dist/src/plugin/agy-request-metadata.js.map +1 -0
  45. package/dist/src/plugin/agy-transport.d.ts +1 -1
  46. package/dist/src/plugin/agy-transport.js +1 -1
  47. package/dist/src/plugin/auth-doctor.d.ts +6 -6
  48. package/dist/src/plugin/auth-doctor.d.ts.map +1 -1
  49. package/dist/src/plugin/auth-doctor.js +79 -62
  50. package/dist/src/plugin/auth-doctor.js.map +1 -1
  51. package/dist/src/plugin/auth-drift.d.ts +4 -4
  52. package/dist/src/plugin/auth-drift.d.ts.map +1 -1
  53. package/dist/src/plugin/auth-drift.js +15 -15
  54. package/dist/src/plugin/auth-drift.js.map +1 -1
  55. package/dist/src/plugin/auth-loader.d.ts +35 -0
  56. package/dist/src/plugin/auth-loader.d.ts.map +1 -0
  57. package/dist/src/plugin/auth-loader.js +144 -0
  58. package/dist/src/plugin/auth-loader.js.map +1 -0
  59. package/dist/src/plugin/auth.d.ts +1 -1
  60. package/dist/src/plugin/auth.js +1 -1
  61. package/dist/src/plugin/cache/index.d.ts +1 -1
  62. package/dist/src/plugin/cache/index.d.ts.map +1 -1
  63. package/dist/src/plugin/cache/index.js +1 -1
  64. package/dist/src/plugin/cache/index.js.map +1 -1
  65. package/dist/src/plugin/cache/signature-cache.d.ts +1 -1
  66. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
  67. package/dist/src/plugin/cache/signature-cache.js +23 -24
  68. package/dist/src/plugin/cache/signature-cache.js.map +1 -1
  69. package/dist/src/plugin/cache.d.ts +6 -5
  70. package/dist/src/plugin/cache.d.ts.map +1 -1
  71. package/dist/src/plugin/cache.js +21 -7
  72. package/dist/src/plugin/cache.js.map +1 -1
  73. package/dist/src/plugin/catalog.d.ts +23 -0
  74. package/dist/src/plugin/catalog.d.ts.map +1 -0
  75. package/dist/src/plugin/catalog.js +60 -0
  76. package/dist/src/plugin/catalog.js.map +1 -0
  77. package/dist/src/plugin/cli.d.ts +7 -7
  78. package/dist/src/plugin/cli.d.ts.map +1 -1
  79. package/dist/src/plugin/cli.js +62 -55
  80. package/dist/src/plugin/cli.js.map +1 -1
  81. package/dist/src/plugin/command-data.d.ts +276 -0
  82. package/dist/src/plugin/command-data.d.ts.map +1 -0
  83. package/dist/src/plugin/command-data.js +325 -0
  84. package/dist/src/plugin/command-data.js.map +1 -0
  85. package/dist/src/plugin/commands.d.ts +151 -0
  86. package/dist/src/plugin/commands.d.ts.map +1 -0
  87. package/dist/src/plugin/commands.js +639 -0
  88. package/dist/src/plugin/commands.js.map +1 -0
  89. package/dist/src/plugin/config/index.d.ts +2 -2
  90. package/dist/src/plugin/config/index.d.ts.map +1 -1
  91. package/dist/src/plugin/config/index.js +2 -2
  92. package/dist/src/plugin/config/index.js.map +1 -1
  93. package/dist/src/plugin/config/loader.d.ts +1 -1
  94. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  95. package/dist/src/plugin/config/loader.js +18 -16
  96. package/dist/src/plugin/config/loader.js.map +1 -1
  97. package/dist/src/plugin/config/models.d.ts +2 -2
  98. package/dist/src/plugin/config/models.d.ts.map +1 -1
  99. package/dist/src/plugin/config/models.js +1 -1
  100. package/dist/src/plugin/config/models.js.map +1 -1
  101. package/dist/src/plugin/config/operator-settings-schema.d.ts +29 -0
  102. package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
  103. package/dist/src/plugin/config/operator-settings-schema.js +28 -0
  104. package/dist/src/plugin/config/operator-settings-schema.js.map +1 -0
  105. package/dist/src/plugin/config/schema.d.ts +21 -2
  106. package/dist/src/plugin/config/schema.d.ts.map +1 -1
  107. package/dist/src/plugin/config/schema.js +85 -25
  108. package/dist/src/plugin/config/schema.js.map +1 -1
  109. package/dist/src/plugin/config/updater.d.ts.map +1 -1
  110. package/dist/src/plugin/config/updater.js +15 -15
  111. package/dist/src/plugin/config/updater.js.map +1 -1
  112. package/dist/src/plugin/config/writer.d.ts +34 -0
  113. package/dist/src/plugin/config/writer.d.ts.map +1 -0
  114. package/dist/src/plugin/config/writer.js +81 -0
  115. package/dist/src/plugin/config/writer.js.map +1 -0
  116. package/dist/src/plugin/core/streaming/index.d.ts +1 -1
  117. package/dist/src/plugin/core/streaming/index.d.ts.map +1 -1
  118. package/dist/src/plugin/core/streaming/index.js +1 -1
  119. package/dist/src/plugin/core/streaming/index.js.map +1 -1
  120. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
  121. package/dist/src/plugin/core/streaming/transformer.js +85 -44
  122. package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
  123. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
  124. package/dist/src/plugin/debug.d.ts +3 -3
  125. package/dist/src/plugin/debug.d.ts.map +1 -1
  126. package/dist/src/plugin/debug.js +85 -47
  127. package/dist/src/plugin/debug.js.map +1 -1
  128. package/dist/src/plugin/dependencies.d.ts +129 -0
  129. package/dist/src/plugin/dependencies.d.ts.map +1 -0
  130. package/dist/src/plugin/dependencies.js +107 -0
  131. package/dist/src/plugin/dependencies.js.map +1 -0
  132. package/dist/src/plugin/errors.d.ts +27 -0
  133. package/dist/src/plugin/errors.d.ts.map +1 -1
  134. package/dist/src/plugin/errors.js +29 -3
  135. package/dist/src/plugin/errors.js.map +1 -1
  136. package/dist/src/plugin/event-handler.d.ts +53 -0
  137. package/dist/src/plugin/event-handler.d.ts.map +1 -0
  138. package/dist/src/plugin/event-handler.js +101 -0
  139. package/dist/src/plugin/event-handler.js.map +1 -0
  140. package/dist/src/plugin/fetch/retry-state.d.ts +61 -0
  141. package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -0
  142. package/dist/src/plugin/fetch/retry-state.js +248 -0
  143. package/dist/src/plugin/fetch/retry-state.js.map +1 -0
  144. package/dist/src/plugin/fetch/warmup.d.ts +30 -0
  145. package/dist/src/plugin/fetch/warmup.d.ts.map +1 -0
  146. package/dist/src/plugin/fetch/warmup.js +76 -0
  147. package/dist/src/plugin/fetch/warmup.js.map +1 -0
  148. package/dist/src/plugin/fetch-interceptor.d.ts +59 -0
  149. package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -0
  150. package/dist/src/plugin/fetch-interceptor.js +1387 -0
  151. package/dist/src/plugin/fetch-interceptor.js.map +1 -0
  152. package/dist/src/plugin/fetch-routing.d.ts +26 -0
  153. package/dist/src/plugin/fetch-routing.d.ts.map +1 -0
  154. package/dist/src/plugin/fetch-routing.js +99 -0
  155. package/dist/src/plugin/fetch-routing.js.map +1 -0
  156. package/dist/src/plugin/fingerprint.d.ts +1 -1
  157. package/dist/src/plugin/fingerprint.js +1 -1
  158. package/dist/src/plugin/gemini-dump.d.ts +5 -5
  159. package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
  160. package/dist/src/plugin/gemini-dump.js +109 -55
  161. package/dist/src/plugin/gemini-dump.js.map +1 -1
  162. package/dist/src/plugin/google-search-tool.d.ts +9 -0
  163. package/dist/src/plugin/google-search-tool.d.ts.map +1 -0
  164. package/dist/src/plugin/google-search-tool.js +56 -0
  165. package/dist/src/plugin/google-search-tool.js.map +1 -0
  166. package/dist/src/plugin/image-saver.d.ts +2 -21
  167. package/dist/src/plugin/image-saver.d.ts.map +1 -1
  168. package/dist/src/plugin/image-saver.js +22 -56
  169. package/dist/src/plugin/image-saver.js.map +1 -1
  170. package/dist/src/plugin/index.d.ts +23 -0
  171. package/dist/src/plugin/index.d.ts.map +1 -0
  172. package/dist/src/plugin/index.js +308 -0
  173. package/dist/src/plugin/index.js.map +1 -0
  174. package/dist/src/plugin/killswitch.d.ts +94 -0
  175. package/dist/src/plugin/killswitch.d.ts.map +1 -0
  176. package/dist/src/plugin/killswitch.js +194 -0
  177. package/dist/src/plugin/killswitch.js.map +1 -0
  178. package/dist/src/plugin/lifecycle.d.ts +40 -0
  179. package/dist/src/plugin/lifecycle.d.ts.map +1 -0
  180. package/dist/src/plugin/lifecycle.js +73 -0
  181. package/dist/src/plugin/lifecycle.js.map +1 -0
  182. package/dist/src/plugin/logger.d.ts +10 -1
  183. package/dist/src/plugin/logger.d.ts.map +1 -1
  184. package/dist/src/plugin/logger.js +38 -12
  185. package/dist/src/plugin/logger.js.map +1 -1
  186. package/dist/src/plugin/logging-utils.d.ts +35 -1
  187. package/dist/src/plugin/logging-utils.d.ts.map +1 -1
  188. package/dist/src/plugin/logging-utils.js +98 -15
  189. package/dist/src/plugin/logging-utils.js.map +1 -1
  190. package/dist/src/plugin/model-registry.d.ts +1 -1
  191. package/dist/src/plugin/model-registry.js +1 -1
  192. package/dist/src/plugin/oauth-login.d.ts +22 -0
  193. package/dist/src/plugin/oauth-login.d.ts.map +1 -0
  194. package/dist/src/plugin/oauth-login.js +37 -0
  195. package/dist/src/plugin/oauth-login.js.map +1 -0
  196. package/dist/src/plugin/oauth-methods.d.ts +42 -0
  197. package/dist/src/plugin/oauth-methods.d.ts.map +1 -0
  198. package/dist/src/plugin/oauth-methods.js +1284 -0
  199. package/dist/src/plugin/oauth-methods.js.map +1 -0
  200. package/dist/src/plugin/operator-settings.d.ts +40 -0
  201. package/dist/src/plugin/operator-settings.d.ts.map +1 -0
  202. package/dist/src/plugin/operator-settings.js +148 -0
  203. package/dist/src/plugin/operator-settings.js.map +1 -0
  204. package/dist/src/plugin/persist-account-pool.d.ts +37 -0
  205. package/dist/src/plugin/persist-account-pool.d.ts.map +1 -0
  206. package/dist/src/plugin/persist-account-pool.js +142 -0
  207. package/dist/src/plugin/persist-account-pool.js.map +1 -0
  208. package/dist/src/plugin/project.d.ts +1 -1
  209. package/dist/src/plugin/project.js +1 -1
  210. package/dist/src/plugin/prompt-context.d.ts.map +1 -1
  211. package/dist/src/plugin/prompt-context.js +11 -11
  212. package/dist/src/plugin/prompt-context.js.map +1 -1
  213. package/dist/src/plugin/quota.d.ts +97 -41
  214. package/dist/src/plugin/quota.d.ts.map +1 -1
  215. package/dist/src/plugin/quota.js +273 -285
  216. package/dist/src/plugin/quota.js.map +1 -1
  217. package/dist/src/plugin/recovery/constants.d.ts.map +1 -1
  218. package/dist/src/plugin/recovery/constants.js +24 -15
  219. package/dist/src/plugin/recovery/constants.js.map +1 -1
  220. package/dist/src/plugin/recovery/index.d.ts +3 -3
  221. package/dist/src/plugin/recovery/index.d.ts.map +1 -1
  222. package/dist/src/plugin/recovery/index.js +3 -3
  223. package/dist/src/plugin/recovery/index.js.map +1 -1
  224. package/dist/src/plugin/recovery/storage.d.ts +1 -1
  225. package/dist/src/plugin/recovery/storage.d.ts.map +1 -1
  226. package/dist/src/plugin/recovery/storage.js +31 -39
  227. package/dist/src/plugin/recovery/storage.js.map +1 -1
  228. package/dist/src/plugin/recovery/types.d.ts +12 -12
  229. package/dist/src/plugin/recovery/types.d.ts.map +1 -1
  230. package/dist/src/plugin/recovery.d.ts +3 -3
  231. package/dist/src/plugin/recovery.d.ts.map +1 -1
  232. package/dist/src/plugin/recovery.js +62 -58
  233. package/dist/src/plugin/recovery.js.map +1 -1
  234. package/dist/src/plugin/refresh-queue.d.ts +5 -2
  235. package/dist/src/plugin/refresh-queue.d.ts.map +1 -1
  236. package/dist/src/plugin/refresh-queue.js +37 -15
  237. package/dist/src/plugin/refresh-queue.js.map +1 -1
  238. package/dist/src/plugin/request-helpers.d.ts +2 -1
  239. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  240. package/dist/src/plugin/request-helpers.js +458 -354
  241. package/dist/src/plugin/request-helpers.js.map +1 -1
  242. package/dist/src/plugin/request.d.ts +12 -6
  243. package/dist/src/plugin/request.d.ts.map +1 -1
  244. package/dist/src/plugin/request.js +801 -390
  245. package/dist/src/plugin/request.js.map +1 -1
  246. package/dist/src/plugin/rotation.d.ts +1 -168
  247. package/dist/src/plugin/rotation.d.ts.map +1 -1
  248. package/dist/src/plugin/rotation.js +1 -327
  249. package/dist/src/plugin/rotation.js.map +1 -1
  250. package/dist/src/plugin/search.d.ts.map +1 -1
  251. package/dist/src/plugin/search.js +39 -35
  252. package/dist/src/plugin/search.js.map +1 -1
  253. package/dist/src/plugin/server.d.ts +1 -1
  254. package/dist/src/plugin/server.d.ts.map +1 -1
  255. package/dist/src/plugin/server.js +42 -37
  256. package/dist/src/plugin/server.js.map +1 -1
  257. package/dist/src/plugin/session-context.d.ts +22 -0
  258. package/dist/src/plugin/session-context.d.ts.map +1 -0
  259. package/dist/src/plugin/session-context.js +67 -0
  260. package/dist/src/plugin/session-context.js.map +1 -0
  261. package/dist/src/plugin/storage.d.ts +59 -114
  262. package/dist/src/plugin/storage.d.ts.map +1 -1
  263. package/dist/src/plugin/storage.js +140 -474
  264. package/dist/src/plugin/storage.js.map +1 -1
  265. package/dist/src/plugin/stores/signature-store.d.ts.map +1 -1
  266. package/dist/src/plugin/stores/signature-store.js.map +1 -1
  267. package/dist/src/plugin/thinking-recovery.d.ts.map +1 -1
  268. package/dist/src/plugin/thinking-recovery.js +35 -33
  269. package/dist/src/plugin/thinking-recovery.js.map +1 -1
  270. package/dist/src/plugin/token.d.ts +2 -2
  271. package/dist/src/plugin/token.d.ts.map +1 -1
  272. package/dist/src/plugin/token.js +30 -21
  273. package/dist/src/plugin/token.js.map +1 -1
  274. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +1 -1
  275. package/dist/src/plugin/transform/cross-model-sanitizer.js +1 -1
  276. package/dist/src/plugin/transform/index.d.ts +1 -1
  277. package/dist/src/plugin/transform/index.js +1 -1
  278. package/dist/src/plugin/transform/model-resolver.d.ts +1 -1
  279. package/dist/src/plugin/transform/model-resolver.js +1 -1
  280. package/dist/src/plugin/transform/types.d.ts +1 -1
  281. package/dist/src/plugin/transform/types.js +1 -1
  282. package/dist/src/plugin/types.d.ts +25 -69
  283. package/dist/src/plugin/types.d.ts.map +1 -1
  284. package/dist/src/plugin/ui/ansi.d.ts.map +1 -1
  285. package/dist/src/plugin/ui/ansi.js.map +1 -1
  286. package/dist/src/plugin/ui/auth-menu.d.ts +2 -2
  287. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
  288. package/dist/src/plugin/ui/auth-menu.js +84 -31
  289. package/dist/src/plugin/ui/auth-menu.js.map +1 -1
  290. package/dist/src/plugin/ui/confirm.d.ts.map +1 -1
  291. package/dist/src/plugin/ui/confirm.js.map +1 -1
  292. package/dist/src/plugin/ui/model-status.d.ts +3 -3
  293. package/dist/src/plugin/ui/model-status.d.ts.map +1 -1
  294. package/dist/src/plugin/ui/model-status.js +3 -3
  295. package/dist/src/plugin/ui/model-status.js.map +1 -1
  296. package/dist/src/plugin/ui/quota-status.d.ts +4 -4
  297. package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
  298. package/dist/src/plugin/ui/quota-status.js +51 -48
  299. package/dist/src/plugin/ui/quota-status.js.map +1 -1
  300. package/dist/src/plugin/ui/select.d.ts.map +1 -1
  301. package/dist/src/plugin/ui/select.js +22 -12
  302. package/dist/src/plugin/ui/select.js.map +1 -1
  303. package/dist/src/plugin/version.d.ts +1 -1
  304. package/dist/src/plugin/version.js +1 -1
  305. package/dist/src/rpc/notifications.d.ts +6 -0
  306. package/dist/src/rpc/notifications.d.ts.map +1 -0
  307. package/dist/src/rpc/notifications.js +46 -0
  308. package/dist/src/rpc/notifications.js.map +1 -0
  309. package/dist/src/rpc/port-file.d.ts +13 -0
  310. package/dist/src/rpc/port-file.d.ts.map +1 -0
  311. package/dist/src/rpc/port-file.js +109 -0
  312. package/dist/src/rpc/port-file.js.map +1 -0
  313. package/dist/src/rpc/protocol.d.ts +22 -0
  314. package/dist/src/rpc/protocol.d.ts.map +1 -0
  315. package/dist/src/rpc/protocol.js +1 -0
  316. package/dist/src/rpc/protocol.js.map +1 -0
  317. package/dist/src/rpc/rpc-client.d.ts +10 -0
  318. package/dist/src/rpc/rpc-client.d.ts.map +1 -0
  319. package/dist/src/rpc/rpc-client.js +58 -0
  320. package/dist/src/rpc/rpc-client.js.map +1 -0
  321. package/dist/src/rpc/rpc-dir.d.ts +4 -0
  322. package/dist/src/rpc/rpc-dir.d.ts.map +1 -0
  323. package/dist/src/rpc/rpc-dir.js +19 -0
  324. package/dist/src/rpc/rpc-dir.js.map +1 -0
  325. package/dist/src/rpc/rpc-server.d.ts +13 -0
  326. package/dist/src/rpc/rpc-server.d.ts.map +1 -0
  327. package/dist/src/rpc/rpc-server.js +231 -0
  328. package/dist/src/rpc/rpc-server.js.map +1 -0
  329. package/dist/src/sidebar-state.d.ts +240 -0
  330. package/dist/src/sidebar-state.d.ts.map +1 -0
  331. package/dist/src/sidebar-state.js +520 -0
  332. package/dist/src/sidebar-state.js.map +1 -0
  333. package/dist/src/tui/command-dialogs.d.ts +61 -0
  334. package/dist/src/tui/command-dialogs.d.ts.map +1 -0
  335. package/dist/src/tui/command-dialogs.js +497 -0
  336. package/dist/src/tui/command-dialogs.js.map +1 -0
  337. package/dist/src/tui/file-logger.d.ts +41 -0
  338. package/dist/src/tui/file-logger.d.ts.map +1 -0
  339. package/dist/src/tui/file-logger.js +114 -0
  340. package/dist/src/tui/file-logger.js.map +1 -0
  341. package/dist/src/tui-preferences.d.ts +40 -0
  342. package/dist/src/tui-preferences.d.ts.map +1 -0
  343. package/dist/src/tui-preferences.js +328 -0
  344. package/dist/src/tui-preferences.js.map +1 -0
  345. package/dist/src/tui.d.ts +68 -0
  346. package/dist/src/tui.d.ts.map +1 -0
  347. package/dist/src/tui.js +662 -0
  348. package/dist/src/tui.js.map +1 -0
  349. package/package.json +46 -22
  350. package/src/plugin/command-data.ts +651 -0
  351. package/src/rpc/port-file.ts +143 -0
  352. package/src/rpc/protocol.ts +31 -0
  353. package/src/rpc/rpc-client.ts +102 -0
  354. package/src/rpc/rpc-dir.ts +24 -0
  355. package/src/sidebar-state.ts +717 -0
  356. package/src/tui/command-dialogs.tsx +699 -0
  357. package/src/tui/entry.mjs +74 -0
  358. package/src/tui/file-logger.ts +145 -0
  359. package/src/tui-compiled/plugin/command-data.ts +651 -0
  360. package/src/tui-compiled/rpc/port-file.ts +143 -0
  361. package/src/tui-compiled/rpc/protocol.ts +31 -0
  362. package/src/tui-compiled/rpc/rpc-client.ts +102 -0
  363. package/src/tui-compiled/rpc/rpc-dir.ts +24 -0
  364. package/src/tui-compiled/sidebar-state.ts +717 -0
  365. package/src/tui-compiled/tui/command-dialogs.tsx +659 -0
  366. package/src/tui-compiled/tui/file-logger.ts +145 -0
  367. package/src/tui-compiled/tui-preferences.ts +416 -0
  368. package/src/tui-compiled/tui.tsx +1150 -0
  369. package/src/tui-preferences.ts +416 -0
  370. package/src/tui.tsx +1117 -0
  371. package/dist/src/plugin.d.ts +0 -32
  372. package/dist/src/plugin.d.ts.map +0 -1
  373. package/dist/src/plugin.js +0 -3151
  374. package/dist/src/plugin.js.map +0 -1
package/README.md CHANGED
@@ -1,543 +1,252 @@
1
- # Antigravity + Gemini CLI OAuth Plugin for Opencode
1
+ # `@cortexkit/opencode-antigravity-auth`
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@cortexkit/opencode-antigravity-auth.svg)](https://www.npmjs.com/package/@cortexkit/opencode-antigravity-auth)
4
4
  [![npm downloads](https://img.shields.io/npm/dw/@cortexkit/opencode-antigravity-auth.svg)](https://www.npmjs.com/package/@cortexkit/opencode-antigravity-auth)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
6
 
7
- Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth so you can use Antigravity rate limits and access models like `gemini-3.1-pro` and `claude-opus-4-6-thinking` with your Google credentials.
7
+ OpenCode 1.x plugin + OpenTUI sidebar for Google Antigravity. Authenticate with your Google account, get **Antigravity quota** access to Claude 4.6, Gemini 3.x/2.5, and GPT-OSS 120B, plus standalone OAuth login and quota commands through the bundled `antigravity-auth` CLI.
8
8
 
9
- ## What You Get
10
-
11
- - **Claude Opus 4.6, Sonnet 4.6** and **Gemini 3.1 Pro/Flash** via Google OAuth
12
- - **Multi-account support** — add multiple Google accounts, auto-rotates when rate-limited
13
- - **Dual quota system** — access both Antigravity and Gemini CLI quotas from one plugin
14
- - **Thinking models** — extended thinking for Claude and Gemini 3 with configurable budgets
15
- - **Google Search grounding** — enable web search for Gemini models (auto or always-on)
16
- - **Auto-recovery** — handles session errors and tool failures automatically
17
- - **Plugin compatible** — works alongside other OpenCode plugins (oh-my-opencode, dcp, etc.)
18
-
19
- ---
20
-
21
- <details open>
22
- <summary><b>⚠️ Terms of Service Warning — Read Before Installing</b></summary>
23
-
24
- > [!CAUTION]
25
- > Using this plugin (and any proxy for Antigravity) violates Google's Terms of Service. A number of users have reported their Google accounts being **banned** or **shadow-banned** (restricted access without explicit notification).
9
+ > **CAUTION — read before installing.**
26
10
  >
27
- > **By using this plugin, you acknowledge:**
28
- > - This is an unofficial tool not endorsed by Google
29
- > - Your account may be suspended or permanently banned
30
- > - You assume all risks associated with using this plugin
31
- >
32
-
33
- </details>
34
-
35
- ---
36
-
37
- ## Installation
38
-
39
- <details open>
40
- <summary><b>For Humans</b></summary>
41
-
42
- **Option A: Let an LLM do it**
43
-
44
- Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
45
-
46
- ```
47
- Install the opencode-antigravity-auth plugin and add the Antigravity model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/cortexkit/antigravity-auth/main/README.md
48
- ```
49
-
50
- **Option B: Manual setup**
11
+ > Using this plugin (and any proxy for Antigravity) violates Google's Terms of Service. Google account holders have reported suspensions, bans, and shadow-bans (restricted access without notice). The plugin is **not endorsed by Google**; you assume all risks.
51
12
 
52
- 1. **Add the plugin** to `~/.config/opencode/opencode.json`:
13
+ This package is part of the `@cortexkit/antigravity-auth@2.0.0` monorepo. See the [root README](../../README.md) for the full operator and contributor guide, the installation matrix, the configuration reference, and the release process.
53
14
 
54
- ```json
55
- {
56
- "plugin": ["@cortexkit/opencode-antigravity-auth@latest"]
57
- }
58
- ```
15
+ ## What you get
59
16
 
60
- 2. **Login** with your Google account:
17
+ - **Claude Opus 4.6 / Sonnet 4.6 (thinking)** and **Gemini 3 Pro / Flash / 3.6 Flash / 3.1 Pro / 3.1 Flash Image** via Google OAuth against the Antigravity quota pool.
18
+ - **GPT-OSS 120B Medium** through the Antigravity-style headers.
19
+ - **Multi-account rotation** with deterministic selection (`sticky`, `round-robin`, `hybrid`), per-account rate-limit cooldowns, and a failsafe **killswitch** that hard-blocks accounts below a quota threshold.
20
+ - **Dual quota pools:** Antigravity headers + Gemini CLI headers with style-fallback so a single exhausted pool does not stall a request.
21
+ - **OpenTUI sidebar** — read-only, polls the on-disk sidebar-state file every 2s. Carries per-account health, cooldown, and per-quota-group remaining percent; never carries credentials.
22
+ - **Six slash commands** wired through the OpenTUI dialog system — `/antigravity-quota`, `/antigravity-account`, `/antigravity-routing`, `/antigravity-killswitch`, `/antigravity-dump`, `/antigravity-logging`. See `packages/opencode/src/plugin/commands.ts` and `packages/opencode/src/tui/command-dialogs.tsx`. `/gemini-dump` remains a backward-compat alias.
23
+ - **Thinking models** with optional signature caching and precompiled OpenTUI JSX.
24
+ - **Standalone CLI** shipped as the `antigravity-auth` bin (`login`, `list`, `quota`) — same storage as the plugin.
25
+ - **Auto-recovery** from `tool_result_missing` errors and proactive background token refresh.
61
26
 
62
- ```bash
63
- opencode auth login
64
- ```
27
+ ## Host requirement
65
28
 
66
- 3. **Add models** — choose one:
67
- - Run `opencode auth login` → Google → OAuth with Google (Antigravity) → select **"Configure models in opencode.json"** (auto-configures all models)
68
- - Or manually copy the [full configuration](#models) below
29
+ | Host field | Required range |
30
+ | --- | --- |
31
+ | `@opencode-ai/plugin` peer dependency | `>=1.17.13 <2` |
32
+ | `@opentui/core`, `@opentui/keymap`, `@opentui/solid` (peer) | `^0.4.5` each |
33
+ | Node | `>=20` |
69
34
 
70
- 4. **Use it:**
35
+ The package pins the supported host range through `engines.opencode` (`>=1.17.13 <2`); `opencode plugin` refuses to install a plugin that asks for an unsupported range.
71
36
 
72
- ```bash
73
- opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --variant=max
74
- ```
37
+ The package exposes two `exports` subpaths the host installer reads:
75
38
 
76
- </details>
39
+ - `exports["."]` — the bundled `dist/index.js` server root. `opencode plugin` writes this entry into `opencode.json`'s `plugin` array.
40
+ - `exports["./tui"]` — `src/tui/entry.mjs`, the OpenTUI sidebar loader. `opencode plugin` writes this entry into `tui.json` so the TUI process picks it up on the next host start.
77
41
 
78
- <details>
79
- <summary><b>For LLM Agents</b></summary>
80
-
81
- ### Step-by-Step Instructions
82
-
83
- 1. Edit the OpenCode configuration file at `~/.config/opencode/opencode.json`
84
-
85
- > **Note**: This path works on all platforms. On Windows, `~` resolves to your user home directory (e.g., `C:\Users\YourName`).
86
-
87
- 2. Add the plugin to the `plugin` array
88
-
89
- 3. Add the model definitions from the [Full models configuration](#models) section
42
+ ## Installation
90
43
 
91
- 4. Set `provider` to `"google"` and choose a model
44
+ ### End-user (npm) — the supported path
92
45
 
93
- ### Verification
46
+ The supported installer writes both registrations in one step:
94
47
 
95
48
  ```bash
96
- opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --variant=max
49
+ opencode plugin @cortexkit/opencode-antigravity-auth@latest
97
50
  ```
98
51
 
99
- </details>
52
+ What this does:
100
53
 
101
- ---
54
+ - Reads the package's `exports["."]` and writes it into `~/.config/opencode/opencode.json` under the `plugin` array — the `auth.loader` and `fetch` interceptor the host calls on every model dispatch.
55
+ - Reads the package's `exports["./tui"]` and writes it into `~/.config/opencode/tui.json` so the TUI process picks the sidebar up on the next host start.
56
+ - Refuses to install when the host's OpenCode version falls outside the package's `engines.opencode` range.
102
57
 
103
- ## Models
58
+ #### Manual config (hand-edited configs)
104
59
 
105
- ### Model Reference
106
-
107
- **Antigravity quota** (default routing for Claude and Gemini):
108
-
109
- | Model | Variants | Notes |
110
- |-------|----------|-------|
111
- | `antigravity-gemini-3-pro` | low, high | Gemini 3 Pro with thinking |
112
- | `antigravity-gemini-3.1-pro` | low, high | Gemini 3.1 Pro with thinking (rollout-dependent) |
113
- | `antigravity-gemini-3-flash` | minimal, low, medium, high | Gemini 3 Flash with thinking |
114
- | `antigravity-claude-sonnet-4-6` | — | Claude Sonnet 4.6 |
115
- | `antigravity-claude-opus-4-6-thinking` | low, max | Claude Opus 4.6 with extended thinking |
116
-
117
- **Gemini CLI quota** (separate from Antigravity; used when `cli_first` is true or as fallback):
118
-
119
- | Model | Notes |
120
- |-------|-------|
121
- | `gemini-2.5-flash` | Gemini 2.5 Flash |
122
- | `gemini-2.5-pro` | Gemini 2.5 Pro |
123
- | `gemini-3-flash-preview` | Gemini 3 Flash (preview) |
124
- | `gemini-3-pro-preview` | Gemini 3 Pro (preview) |
125
- | `gemini-3.1-pro-preview` | Gemini 3.1 Pro (preview, rollout-dependent) |
126
- | `gemini-3.1-pro-preview-customtools` | Gemini 3.1 Pro Preview Custom Tools (preview, rollout-dependent) |
127
-
128
- > **Routing Behavior:**
129
- > - **Antigravity-first (default):** Gemini models use Antigravity quota across accounts.
130
- > - **CLI-first (`cli_first: true`):** Gemini models use Gemini CLI quota first.
131
- > - When a Gemini quota pool is exhausted, the plugin automatically falls back to the other pool.
132
- > - Claude and image models always use Antigravity.
133
- > Model names are automatically transformed for the target API (e.g., `antigravity-gemini-3-flash` → `gemini-3-flash-preview` for CLI).
134
-
135
- **Using variants:**
136
- ```bash
137
- opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --variant=max
138
- ```
60
+ If you cannot use `opencode plugin`, write both files by hand:
139
61
 
140
- For details on variant configuration and thinking levels, see [docs/MODEL-VARIANTS.md](docs/MODEL-VARIANTS.md).
141
-
142
- <details>
143
- <summary><b>Full models configuration (copy-paste ready)</b></summary>
144
-
145
- Add this to your `~/.config/opencode/opencode.json`:
146
-
147
- ```json
62
+ ```jsonc
63
+ // ~/.config/opencode/opencode.json
148
64
  {
149
- "$schema": "https://opencode.ai/config.json",
150
- "plugin": ["@cortexkit/opencode-antigravity-auth@latest"],
151
- "provider": {
152
- "google": {
153
- "models": {
154
- "antigravity-gemini-3-pro": {
155
- "name": "Gemini 3 Pro (Antigravity)",
156
- "limit": { "context": 1048576, "output": 65535 },
157
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
158
- "variants": {
159
- "low": { "thinkingLevel": "low" },
160
- "high": { "thinkingLevel": "high" }
161
- }
162
- },
163
- "antigravity-gemini-3.1-pro": {
164
- "name": "Gemini 3.1 Pro (Antigravity)",
165
- "limit": { "context": 1048576, "output": 65535 },
166
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
167
- "variants": {
168
- "low": { "thinkingLevel": "low" },
169
- "high": { "thinkingLevel": "high" }
170
- }
171
- },
172
- "antigravity-gemini-3-flash": {
173
- "name": "Gemini 3 Flash (Antigravity)",
174
- "limit": { "context": 1048576, "output": 65536 },
175
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
176
- "variants": {
177
- "minimal": { "thinkingLevel": "minimal" },
178
- "low": { "thinkingLevel": "low" },
179
- "medium": { "thinkingLevel": "medium" },
180
- "high": { "thinkingLevel": "high" }
181
- }
182
- },
183
- "antigravity-claude-sonnet-4-6": {
184
- "name": "Claude Sonnet 4.6 (Antigravity)",
185
- "limit": { "context": 200000, "output": 64000 },
186
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
187
- },
188
- "antigravity-claude-opus-4-6-thinking": {
189
- "name": "Claude Opus 4.6 Thinking (Antigravity)",
190
- "limit": { "context": 200000, "output": 64000 },
191
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
192
- "variants": {
193
- "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
194
- "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
195
- }
196
- },
197
- "gemini-2.5-flash": {
198
- "name": "Gemini 2.5 Flash (Gemini CLI)",
199
- "limit": { "context": 1048576, "output": 65536 },
200
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
201
- },
202
- "gemini-2.5-pro": {
203
- "name": "Gemini 2.5 Pro (Gemini CLI)",
204
- "limit": { "context": 1048576, "output": 65536 },
205
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
206
- },
207
- "gemini-3-flash-preview": {
208
- "name": "Gemini 3 Flash Preview (Gemini CLI)",
209
- "limit": { "context": 1048576, "output": 65536 },
210
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
211
- },
212
- "gemini-3-pro-preview": {
213
- "name": "Gemini 3 Pro Preview (Gemini CLI)",
214
- "limit": { "context": 1048576, "output": 65535 },
215
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
216
- },
217
- "gemini-3.1-pro-preview": {
218
- "name": "Gemini 3.1 Pro Preview (Gemini CLI)",
219
- "limit": { "context": 1048576, "output": 65535 },
220
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
221
- },
222
- "gemini-3.1-pro-preview-customtools": {
223
- "name": "Gemini 3.1 Pro Preview Custom Tools (Gemini CLI)",
224
- "limit": { "context": 1048576, "output": 65535 },
225
- "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
226
- }
227
- }
228
- }
229
- }
65
+ "plugin": ["@cortexkit/opencode-antigravity-auth@latest"]
230
66
  }
231
67
  ```
232
68
 
233
- > **Backward Compatibility:** Legacy model names with `antigravity-` prefix (e.g., `antigravity-gemini-3-flash`) still work. The plugin automatically handles model name transformation for both Antigravity and Gemini CLI APIs.
234
-
235
- </details>
236
-
237
- ---
238
-
239
- ## Multi-Account Setup
240
-
241
- Add multiple Google accounts for a higher combined quota. The plugin automatically rotates between accounts when one is rate-limited.
242
-
243
- ```bash
244
- opencode auth login # Run again to add more accounts
245
- ```
246
-
247
- **Account management options (via `opencode auth login`):**
248
- - **Configure models** — Auto-configure all plugin models in opencode.json
249
- - **Check quotas** — View remaining API quota for each account
250
- - **Manage accounts** — Enable/disable specific accounts for rotation
251
-
252
- For details on load balancing, dual quota pools, and account storage, see [docs/MULTI-ACCOUNT.md](docs/MULTI-ACCOUNT.md).
253
-
254
- ---
255
-
256
- ## Troubleshooting
257
-
258
- > **Quick Reset**: Most issues can be resolved by deleting `~/.config/opencode/antigravity-accounts.json` and running `opencode auth login` again.
259
-
260
- ### Configuration Path (All Platforms)
261
-
262
- OpenCode uses `~/.config/opencode/` on **all platforms** including Windows.
263
-
264
- | File | Path |
265
- |------|------|
266
- | Main config | `~/.config/opencode/opencode.json` |
267
- | Accounts | `~/.config/opencode/antigravity-accounts.json` |
268
- | Plugin config | `~/.config/opencode/antigravity.json` |
269
- | Debug logs | `~/.config/opencode/antigravity-logs/` |
270
-
271
- > **Windows users**: `~` resolves to your user home directory (e.g., `C:\Users\YourName`). Do NOT use `%APPDATA%`.
272
-
273
- > **Custom path**: Set `OPENCODE_CONFIG_DIR` environment variable to use a custom location.
274
-
275
- > **Windows migration**: If upgrading from plugin v1.3.x or earlier, the plugin will automatically find your existing config in `%APPDATA%\opencode\` and use it. New installations use `~/.config/opencode/`.
276
-
277
- ---
278
-
279
- ### Multi-Account Auth Issues
280
-
281
- If you encounter authentication issues with multiple accounts:
282
-
283
- 1. Delete the accounts file:
284
- ```bash
285
- rm ~/.config/opencode/antigravity-accounts.json
286
- ```
287
- 2. Re-authenticate:
288
- ```bash
289
- opencode auth login
290
- ```
291
-
292
- ---
293
-
294
- ### 403 Permission Denied (`rising-fact-p41fc`)
295
-
296
- **Error:**
297
- ```
298
- Permission 'cloudaicompanion.companions.generateChat' denied on resource
299
- '//cloudaicompanion.googleapis.com/projects/rising-fact-p41fc/locations/global'
300
- ```
301
-
302
- **Cause:** Plugin falls back to a default project ID when no valid project is found. This works for Antigravity but fails for Gemini CLI models.
303
-
304
- **Solution:**
305
- 1. Go to [Google Cloud Console](https://console.cloud.google.com/)
306
- 2. Create or select a project
307
- 3. Enable the **Gemini for Google Cloud API** (`cloudaicompanion.googleapis.com`)
308
- 4. Add `projectId` to your accounts file:
309
- ```json
310
- {
311
- "accounts": [
312
- {
313
- "email": "your@email.com",
314
- "refreshToken": "...",
315
- "projectId": "your-project-id"
316
- }
317
- ]
318
- }
319
- ```
320
-
321
- > **Note**: Do this for each account in a multi-account setup.
322
-
323
- ---
324
-
325
- ### Gemini Model Not Found
326
-
327
- Add this to your `google` provider config:
328
-
329
- ```json
69
+ ```jsonc
70
+ // ~/.config/opencode/tui.json
330
71
  {
331
- "provider": {
332
- "google": {
333
- "npm": "@ai-sdk/google",
334
- "models": { ... }
335
- }
336
- }
72
+ "plugin": ["@cortexkit/opencode-antigravity-auth"]
337
73
  }
338
74
  ```
339
75
 
340
- ---
341
-
342
- ### Gemini 3 Models 400 Error ("Unknown name 'parameters'")
343
-
344
- **Error:**
345
- ```
346
- Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]'
347
- ```
348
-
349
- **Causes:**
350
- - Tool schema incompatibility with Gemini's strict protobuf validation
351
- - MCP servers with malformed schemas
352
- - Plugin version regression
353
-
354
- **Solutions:**
355
- 1. **Update to latest beta:**
356
- ```json
357
- { "plugin": ["@cortexkit/opencode-antigravity-auth@latest"] }
358
- ```
76
+ The two files are independent — the server registration is read from `opencode.json` and the TUI registration from `tui.json`.
359
77
 
360
- 2. **Disable MCP servers** one-by-one to find the problematic one
78
+ Then start OpenCode and run `opencode auth login`, pick **Antigravity (Google OAuth)** in the menu (or `/antigravity-account add`). Verify with `npx -y @cortexkit/opencode-antigravity-auth quota`.
361
79
 
362
- 3. **Add npm override:**
363
- ```json
364
- { "provider": { "google": { "npm": "@ai-sdk/google" } } }
365
- ```
80
+ ### Contributor (Bun)
366
81
 
367
- ---
368
-
369
- ### MCP Servers Causing Errors
370
-
371
- Some MCP servers have schemas incompatible with Antigravity's strict JSON format.
372
-
373
- **Common symptom:**
374
82
  ```bash
375
- Invalid function name must start with a letter or underscore
83
+ bun install # at repo root
84
+ bun run build # core -> opencode -> pi
85
+ bun run --cwd packages/opencode smoke:tui # bundle + spawn the precompiled TUI
376
86
  ```
377
87
 
378
- Sometimes it shows up as:
379
- ```bash
380
- GenerateContentRequest.tools[0].function_declarations[12].name: Invalid function name must start with a letter or underscore
381
- ```
88
+ A precompiled JSX tree ships under `dist/src/tui-compiled/` and is regenerated by `bun run build:tui` (alias of `bunx tsx packages/opencode/scripts/build-tui.ts`). The host runtime module loads either the **precompiled** tree (production) or the **raw** `src/tui.tsx` source (development installs). `bun run --cwd packages/opencode smoke:tui` confirms both subpaths resolve correctly against the packaged tarball.
382
89
 
383
- This usually means an MCP tool name starts with a number (for example, a 1mcp key like `1mcp_*`). Rename the MCP key to start with a letter (e.g., `gw`) or disable that MCP entry for Antigravity models.
90
+ > Note: the pre-`2.0` inline quota helper is no longer shipped. Use `antigravity-auth quota [--refresh] [--json]` from this package or from the standalone CLI.
384
91
 
385
- **Diagnosis:**
386
- 1. Disable all MCP servers in your config
387
- 2. Enable one-by-one until error reappears
388
- 3. Report the specific MCP in a [GitHub issue](https://github.com/cortexkit/antigravity-auth/issues)
92
+ ## v2.0 migration
389
93
 
390
- ---
94
+ - **Root exports changed.** The package no longer re-exports `authorizeAntigravity` / `exchangeAntigravity` at the root — import them from `@cortexkit/antigravity-auth-core` instead:
391
95
 
392
- ### "All Accounts Rate-Limited" (But Quota Available)
96
+ ```ts
97
+ // v1.x — no longer supported at the root
98
+ // import { authorizeAntigravity } from "@cortexkit/opencode-antigravity-auth"
393
99
 
394
- **Cause:** Cascade bug in `clearExpiredRateLimits()` in hybrid mode (fixed in recent beta).
100
+ // v2.0 — explicit core import
101
+ import { authorizeAntigravity, exchangeAntigravity } from "@cortexkit/antigravity-auth-core"
102
+ ```
395
103
 
396
- **Solutions:**
397
- 1. Update to latest beta version
398
- 2. If persists, delete accounts file and re-authenticate
399
- 3. Try switching `account_selection_strategy` to `"sticky"` in `antigravity.json`
104
+ - **`@opencode-ai/plugin` peer dependency** moved from `^0.15.30` to `^1.17.13`. Hosts on 1.17.13+ get the TUI registration through `opencode plugin` (the host reads `exports["./tui"]` and writes it into `tui.json`).
105
+ - **New peer dependencies** (`@opentui/core`, `@opentui/keymap`, `@opentui/solid` at `^0.4.5`) — required by the sidebar.
106
+ - No account-storage changes: the on-disk format is unchanged from the v1.4+ storage schema (`AccountStorageV4`).
107
+ - Missing accounts now return **HTTP 401 `UNAUTHENTICATED`** from the fetch interceptor instead of a synthetic 200 with assistant text.
400
108
 
401
- ---
109
+ See [packages/opencode/CHANGELOG.md](./CHANGELOG.md) for the full list of v2.0.0 changes.
402
110
 
403
- ### Session Recovery
111
+ ## Models
404
112
 
405
- If you encounter errors during a session:
406
- 1. Type `continue` to trigger the recovery mechanism
407
- 2. If blocked, use `/undo` to revert to pre-error state
408
- 3. Retry the operation
113
+ ### Quick reference
409
114
 
410
- ---
115
+ The model registry lives at `packages/core/src/model-registry.ts`; the OpenCode package re-exports it through `getAntigravityOpencodeModelIds()`. Models below are an authoritative mirror at the time of release.
411
116
 
412
- ### Using with Oh-My-OpenCode
117
+ | Model | Variants | Quota group |
118
+ | --- | --- | --- |
119
+ | `antigravity-gemini-3.6-flash` | `low`, `high` | `gemini-flash` |
120
+ | `antigravity-gemini-3.5-flash` | `low`, `high` | `gemini-flash` |
121
+ | `antigravity-gemini-3.1-pro` | `low`, `high` | `gemini-pro` |
122
+ | `antigravity-gemini-3.1-flash-image` | — | `gemini-flash` |
123
+ | `antigravity-claude-sonnet-4-6` | — | `claude` |
124
+ | `antigravity-claude-opus-4-6-thinking` | `low`, `max` | `claude` |
125
+ | `antigravity-gpt-oss-120b-medium` | — | `gpt-oss` |
126
+ | `gemini-2.5-flash` | — | `gemini-flash` (CLI pool) |
127
+ | `gemini-2.5-pro` | — | `gemini-pro` (CLI pool) |
128
+ | `gemini-3-flash-preview` | — | `gemini-flash` (CLI pool) |
129
+ | `gemini-3-pro-preview` | — | `gemini-pro` (CLI pool) |
130
+ | `gemini-3.1-pro-preview` | — | `gemini-pro` (CLI pool) |
131
+ | `gemini-3.1-pro-preview-customtools` | — | `gemini-pro` (CLI pool) |
413
132
 
414
- **Important:** Disable the built-in Google auth to prevent conflicts:
133
+ > Gemini 3.5 Flash-Lite is not in the AGY 1.1.5 Antigravity or Gemini CLI quota catalogs, and Gemini 3.5 Flash Cyber is restricted to a limited-access CodeMender pilot — neither is exposed by this plugin.
415
134
 
416
- ```json
417
- // ~/.config/opencode/oh-my-opencode.json
418
- {
419
- "google_auth": false,
420
- "agents": {
421
- "frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
422
- "document-writer": { "model": "google/antigravity-gemini-3-flash" }
423
- }
424
- }
425
- ```
135
+ ### Routing
426
136
 
427
- ---
137
+ - **Antigravity-first (default).** Gemini requests go to the Antigravity header style first; on `429 RESOURCE_EXHAUSTED` they fall back to the Gemini CLI header set.
138
+ - **CLI-first** (`cli_first: true`). Flip the order — Gemini CLI first, Antigravity fallback. Toggle at runtime through `/antigravity-routing cli_first=true`.
139
+ - **Style-fallback** (`quota_style_fallback: true`). Re-send the SAME request through the other header set on a rate limit. Default OFF to prevent double-spend across pools. Toggle at runtime through `/antigravity-routing quota_style_fallback=true`.
140
+ - **Claude and image models** always use Antigravity regardless of toggles.
141
+ - Model names transform automatically between Antigravity and Gemini CLI namespaces (`antigravity-gemini-3-flash` ↔ `gemini-3-flash-preview`).
428
142
 
429
- ### Infinite `.tmp` Files Created
143
+ ### Quota, killswitch, and the soft-threshold fail-open
430
144
 
431
- **Cause:** When account is rate-limited and plugin retries infinitely, it creates many temp files.
145
+ Each cached quota entry carries `{ remainingFraction, resetTime }` per group:
432
146
 
433
- **Workaround:**
434
- 1. Stop OpenCode
435
- 2. Clean up: `rm ~/.config/opencode/*.tmp`
436
- 3. Add more accounts or wait for rate limit to expire
147
+ - **Soft-quota threshold** — `soft_quota_threshold_percent` (default 80). Accounts above the threshold are skipped as if rate-limited. Set to `100` to disable.
148
+ - **Stale-TTL fail-open** — `soft_quota_cache_ttl_minutes = "auto"` resolves to `max(2 × refresh, 10)` minutes. Cache older than the TTL is treated as unknown and allowed through.
149
+ - **Proactive rotation** — `proactive_rotation_threshold_percent` (default 20). When the active account's remaining quota drops below, dispatch the next request from a warm-cache account.
150
+ - **All-throttled wait** — `max_rate_limit_wait_seconds` (default 300). Cap on how long the interceptor waits when every account is rate-limited before failing fast.
437
151
 
438
- ---
152
+ The **operator killswitch** is a hard rejection layer run BEFORE the soft-quota filter:
439
153
 
440
- ### OAuth Callback Issues
154
+ - `enabled` master switch.
155
+ - `minimum_remaining_percent` (default 5) — global hard-block threshold.
156
+ - `accounts[key]` — per-account override keyed by `sha256(refreshToken).slice(0,12)`. The hash is deterministic but irreversible; the raw token never appears in the config, the sidebar, RPC payloads, or apply responses.
157
+ - **Cache-TTL fail-open** — when an account has no fresh cached quota (default 5 min TTL), it is allowed through so a cold start cannot deadlock.
158
+ - **All-killed error** — if the entire pool is excluded, the interceptor throws `AntigravityKillswitchError` with a per-account summary.
441
159
 
442
- <details>
443
- <summary><b>Safari OAuth Callback Fails (macOS)</b></summary>
160
+ Both filters run before the token bucket / health score pick, so the operator's threshold is authoritative even on a healthy pool.
444
161
 
445
- **Symptoms:**
446
- - "fail to authorize" after successful Google login
447
- - Safari shows "Safari can't open the page"
162
+ ## Six slash commands
448
163
 
449
- **Cause:** Safari's "HTTPS-Only Mode" blocks `http://localhost` callback.
164
+ All commands are registered through `packages/opencode/src/plugin/catalog.ts` and the modal flow renders in `packages/opencode/src/tui/command-dialogs.tsx`. The apply RPC defaults to `2_000` ms; account `add` / `refresh` opts into `120_000` ms because OAuth can take up to two minutes on a fresh login.
450
165
 
451
- **Solutions:**
166
+ | Command | Args | Default timeout |
167
+ | --- | --- | --- |
168
+ | `/antigravity-quota` | `[refresh]` — status (default) or refresh all accounts | `2_000` |
169
+ | `/antigravity-account` | `add` · `refresh` · `remove` · `list` | `2_000` for list/remove, `120_000` for add/refresh |
170
+ | `/antigravity-routing` | `cli_first=true\|false` · `quota_style_fallback=true\|false` (omit a key to flip) | `2_000` |
171
+ | `/antigravity-killswitch` | `enabled=true\|false` · `minimum_remaining_percent=0..100` | `2_000` |
172
+ | `/antigravity-dump` | `enable` · `disable` · `status` (alias: `/gemini-dump`) | `2_000` |
173
+ | `/antigravity-logging` | `error` · `warn` · `info` · `debug` · `trace` | `2_000` |
452
174
 
453
- 1. **Use Chrome or Firefox** (easiest):
454
- Copy the OAuth URL and paste into a different browser.
175
+ Every apply mutates persistent state and bumps the sidebar's `checkedAt` via `createSidebarRefresher` so the TUI's next poll sees a fresh snapshot. Sidebar writers go through `sidebarWriteChain` (cross-process fenced lock, 2s lock timeout, atomic write `0600`).
455
176
 
456
- 2. **Disable HTTPS-Only Mode temporarily:**
457
- - Safari > Settings (⌘,) > Privacy
458
- - Uncheck "Enable HTTPS-Only Mode"
459
- - Run `opencode auth login`
460
- - Re-enable after authentication
177
+ ## Standalone CLI
461
178
 
462
- </details>
179
+ The `antigravity-auth` bin is bundled into this package:
463
180
 
464
- <details>
465
- <summary><b>Port Conflict (Address Already in Use)</b></summary>
466
-
467
- **macOS / Linux:**
468
181
  ```bash
469
- # Find process using the port
470
- lsof -i :51121
182
+ npx -y @cortexkit/opencode-antigravity-auth login [--project <id>] [--no-browser]
183
+ npx -y @cortexkit/opencode-antigravity-auth list [--json]
184
+ npx -y @cortexkit/opencode-antigravity-auth quota [--json] [--refresh]
185
+ ```
471
186
 
472
- # Kill if stale
473
- kill -9 <PID>
187
+ - `login` runs the full PKCE + local callback flow. `--no-browser` prints the URL instead of opening it (handy in headless / SSH sessions where the browser cannot reach the callback port; see Troubleshooting).
188
+ - `list` prints `INDEX`, `EMAIL`, `STATUS` for every account in storage (`active`, `disabled`, `ineligible`, `verification-required`).
189
+ - `quota` prints `ACCOUNT`, `STATUS`, `GROUP`, `REMAINING`, `RESET` rows. `--refresh` forces a live refresh; `--json` emits the same data as JSON.
474
190
 
475
- # Retry
476
- opencode auth login
477
- ```
191
+ Exit codes: `0` success, `1` thrown error, `2` parse failure. The CLI writes to the same `antigravity-accounts.json` the plugin reads — a CLI login shows up at the next plugin reload.
478
192
 
479
- **Windows (PowerShell):**
480
- ```powershell
481
- netstat -ano | findstr :51121
482
- taskkill /PID <PID> /F
483
- opencode auth login
484
- ```
193
+ ## Multi-account setup
485
194
 
486
- </details>
195
+ ```bash
196
+ opencode auth login # run again to add more accounts; pick Antigravity (Google OAuth)
197
+ opencode auth login # → "Check quotas" or "Manage accounts" for the existing pool
198
+ ```
487
199
 
488
- <details>
489
- <summary><b>Docker / WSL2 / Remote Development</b></summary>
200
+ Options exposed through the auth menu: configure models in `opencode.json` automatically, view remaining quota per account, enable/disable specific accounts. See [docs/MULTI-ACCOUNT.md](./docs/MULTI-ACCOUNT.md) for the storage schema, fenced-lock writers, and the rotation strategies (`sticky`, `hybrid`, `round-robin`) in depth.
490
201
 
491
- OAuth callback requires browser to reach `localhost` on the machine running OpenCode.
202
+ ## Sidebar / RPC state and recovery
492
203
 
493
- **WSL2:**
494
- - Use VS Code's port forwarding, or
495
- - Configure Windows → WSL port forwarding
204
+ The sidebar reads from `$XDG_STATE_HOME/cortexkit/antigravity-auth/sidebar-state.json` (or whatever `ANTIGRAVITY_AUTH_SIDEBAR_STATE_FILE` points at) and polls every `2s`. The contract version is `1`; malformed JSON or unknown versions silently fall back to `DEFAULT_SIDEBAR_STATE` (which is rendered as "Awaiting Antigravity state"). Carries `version`, `checkedAt`, `accounts[]`, `activeRouting` (per-session map, pruned to 24h / 100 entries), `routingAuthoritative`, optional `quotaBackoffUntil` and `lastError`. **Never carries refresh tokens, access tokens, project IDs, or fingerprints.**
496
205
 
497
- **SSH / Remote:**
498
- ```bash
499
- ssh -L 51121:localhost:51121 user@remote
500
- ```
206
+ The RPC lives under `$XDG_STATE_HOME/cortexkit/antigravity-auth/rpc/<project-hash>/port-<pid>.json` (override via `ANTIGRAVITY_AUTH_RPC_DIR`). The TUI process reads the highest-mtime live entry, drops entries whose owning PID is dead (`process.kill(pid, 0)`), and posts to `/rpc/apply` / `/rpc/pending-notifications` with a `Bearer <token>` header on `http://127.0.0.1`. The default request timeout is `2_000` ms; account `add` / `refresh` opts into `120_000` ms.
501
207
 
502
- **Docker / Containers:**
503
- - OAuth with localhost redirect doesn't work in containers
504
- - Wait 30s for manual URL flow, or use SSH port forwarding
208
+ **Recovery from a stale sidebar** — stop the host, verify `$XDG_STATE_HOME/cortexkit/antigravity-auth/sidebar-state.json` exists and is `0600`, then restart. **Recovery from a missing RPC port file** — confirm the running plugin process exists; `getRpcDir(directory)` derives the directory from a sha256 of the project directory, so two projects on the same host get independent RPC dirs.
505
209
 
506
- </details>
210
+ ## Disposal
507
211
 
508
- ---
212
+ The plugin's `dispose()` (host shutdown) runs in order:
509
213
 
510
- ### Configuration Key Typo: `plugin` not `plugins`
214
+ 1. Dispose the active `AccountManager` + proactive token-refresh queue.
215
+ 2. Shut down the disk signature cache (if `keep_thinking` is on).
216
+ 3. Clear the session registry.
217
+ 4. Drop the fetch-interceptor state.
218
+ 5. `drainSidebarWrites()` — wait for any in-flight sidebar-state merge to land so the TUI sees a fully landed snapshot if the user immediately reopens.
219
+ 6. Tear down registered disposables (RPC server, file logger, quota manager).
511
220
 
512
- The correct key is `plugin` (singular):
221
+ This ordering matters because a routing upsert enqueued at shutdown must land before the host closes the terminal. See `packages/opencode/src/plugin/lifecycle.ts:createPluginLifecycle`.
513
222
 
514
- ```json
515
- {
516
- "plugin": ["@cortexkit/opencode-antigravity-auth@latest"]
517
- }
518
- ```
223
+ ## File / state inventory (this package)
519
224
 
520
- **Not** `"plugins"` (will cause "Unrecognized key" error).
225
+ | Purpose | Path | Mode | Notes |
226
+ | --- | --- | --- | --- |
227
+ | Account pool | `~/.config/opencode/antigravity-accounts.json` (`%APPDATA%\opencode\…` on Windows) | `0600` | Storage schema `V4`. |
228
+ | Plugin config | `~/.config/opencode/antigravity.json` (and project `.opencode/antigravity.json`) | `0600` | Zod-validated config. |
229
+ | Debug logs | `~/.config/opencode/antigravity-logs/` (or `log_dir`) | `0600` | Sensitive — request/response bodies. |
230
+ | Sidebar state | `$XDG_STATE_HOME/cortexkit/antigravity-auth/sidebar-state.json` | `0600` dir `0700` | Poll-every-2s; pruned to 24h / 100 entries. |
231
+ | RPC port file | `$XDG_STATE_HOME/cortexkit/antigravity-auth/rpc/<project-hash>/port-<pid>.json` | `0600` | Loopback token bearer. |
232
+ | Signature cache | `signature-cache-disk-<hash>.json` (when `keep_thinking: true`) | `0600` | 2-day default TTL. |
521
233
 
522
- ---
234
+ ## Debug sinks
523
235
 
524
- ### Migrating Accounts Between Machines
236
+ The plugin has **two** debug sinks controlled independently:
525
237
 
526
- When copying `antigravity-accounts.json` to a new machine:
527
- 1. Ensure the plugin is installed: `"plugin": ["@cortexkit/opencode-antigravity-auth@latest"]`
528
- 2. Copy `~/.config/opencode/antigravity-accounts.json`
529
- 3. If you get "API key missing" error, the refresh token may be invalid — re-authenticate
238
+ - `debug: true` — file logging under `log_dir`. Disabled by default. May include request/response bodies; handle with care.
239
+ - `debug_tui: true` — TUI log-panel verbosity. Independent of `debug`.
530
240
 
531
- ## Known Plugin Interactions
532
- For details on load balancing, dual quota pools, and account storage, see [docs/MULTI-ACCOUNT.md](docs/MULTI-ACCOUNT.md).
241
+ Combined with the runtime log-level filter (`operator.log_level`, mutable through `/antigravity-logging`), you have three independent knobs.
533
242
 
534
- ---
243
+ ## Plugin interactions
535
244
 
536
- ## Plugin Compatibility
245
+ For load-balancing, dual quota pools, and account storage details, see [docs/MULTI-ACCOUNT.md](./docs/MULTI-ACCOUNT.md).
537
246
 
538
- ### @tarquinen/opencode-dcp
247
+ ### `@tarquinen/opencode-dcp`
539
248
 
540
- DCP creates synthetic assistant messages that lack thinking blocks. **List this plugin BEFORE DCP:**
249
+ DCP creates synthetic assistant messages that lack thinking blocks. **List this plugin BEFORE DCP**:
541
250
 
542
251
  ```json
543
252
  {
@@ -548,7 +257,7 @@ DCP creates synthetic assistant messages that lack thinking blocks. **List this
548
257
  }
549
258
  ```
550
259
 
551
- ### oh-my-opencode
260
+ ### `oh-my-opencode`
552
261
 
553
262
  Disable built-in auth and override agent models in `oh-my-opencode.json`:
554
263
 
@@ -567,117 +276,105 @@ Disable built-in auth and override agent models in `oh-my-opencode.json`:
567
276
 
568
277
  ### Plugins you don't need
569
278
 
570
- - **gemini-auth plugins** — Not needed. This plugin handles all Google OAuth.
571
-
572
- ---
279
+ - **gemini-auth plugins** — not needed; this plugin handles all Google OAuth.
573
280
 
574
- ## Configuration
281
+ ## Configuration keys (selected)
575
282
 
576
- Create `~/.config/opencode/antigravity.json` for optional settings:
283
+ Created by `~/.config/opencode/antigravity.json` for optional overrides. The full list with defaults and env overrides is in the [root README](../../README.md#configuration-reference) and the generated schema at [`assets/antigravity.schema.json`](./assets/antigravity.schema.json).
577
284
 
578
285
  ```json
579
286
  {
580
- "$schema": "https://raw.githubusercontent.com/cortexkit/antigravity-auth/main/assets/antigravity.schema.json"
287
+ "$schema": "https://raw.githubusercontent.com/cortexkit/antigravity-auth/main/assets/antigravity.schema.json",
288
+ "account_selection_strategy": "hybrid",
289
+ "scheduling_mode": "cache_first",
290
+ "soft_quota_threshold_percent": 80,
291
+ "quota_refresh_interval_minutes": 30,
292
+ "keep_thinking": false
581
293
  }
582
294
  ```
583
295
 
584
- Most users don't need to configure anything — defaults work well.
296
+ Environment variables:
585
297
 
586
- ### Model Behavior
298
+ ```bash
299
+ OPENCODE_CONFIG_DIR=/path/to/config opencode
300
+ OPENCODE_ANTIGRAVITY_DEBUG=1 opencode
301
+ OPENCODE_ANTIGRAVITY_DEBUG_TUI=1 opencode
302
+ OPENCODE_ANTIGRAVITY_LOG_DIR=/secure/path opencode
303
+ ```
587
304
 
588
- | Option | Default | What it does |
589
- |--------|---------|--------------
590
- | `keep_thinking` | `false` | Preserve Claude's thinking across turns. **Warning:** enabling may degrade model stability. |
591
- | `session_recovery` | `true` | Auto-recover from tool errors |
592
- | `cli_first` | `false` | Route Gemini models to Gemini CLI first (Claude and image models stay on Antigravity). |
305
+ For every option, see [docs/CONFIGURATION.md](./docs/CONFIGURATION.md) and the generated [`assets/antigravity.schema.json`](./assets/antigravity.schema.json).
593
306
 
594
- ### Account Rotation
307
+ ## Tests
595
308
 
596
- | Your Setup | Recommended Config |
597
- |------------|-------------------|
598
- | **1 account** | `"account_selection_strategy": "sticky"` |
599
- | **2-5 accounts** | Default (`"hybrid"`) works great |
600
- | **5+ accounts** | `"account_selection_strategy": "round-robin"` |
601
- | **Parallel agents** | Add `"pid_offset_enabled": true` |
309
+ This package ships **deterministic** tests for everything except the model registry and the live cross-model regression suite:
602
310
 
603
- ### Quota Protection
311
+ | Scope | Tooling | Network | Command |
312
+ | --- | --- | --- | --- |
313
+ | Unit (deterministic) | `bun test --isolate` | No | `bun run test` |
314
+ | Black-box e2e (deterministic) | mock Antigravity + harness runner in `packages/e2e-tests/` | No | `bun run test:e2e` |
315
+ | Live model inventory | `script/test-models.ts` | Yes (gated by label) | `bun run test:e2e:models` |
316
+ | Cross-model regression | `script/test-regression.ts` + `script/test-cross-model*.sh` | Yes | `bun run test:e2e:regression` |
317
+ | TUI smoke | install tarball + spawn | No | `bun run smoke:tui` |
604
318
 
605
- | Option | Default | What it does |
606
- |--------|---------|--------------|
607
- | `soft_quota_threshold_percent` | `90` | Skip account when quota usage exceeds this percentage. Prevents Google from penalizing accounts that fully exhaust quota. Set to `100` to disable. |
608
- | `quota_refresh_interval_minutes` | `15` | Background quota refresh interval. After successful API requests, refreshes quota cache if older than this interval. Set to `0` to disable. |
609
- | `soft_quota_cache_ttl_minutes` | `"auto"` | How long quota cache is considered fresh. `"auto"` = max(2 × refresh interval, 10 minutes). Set a number (1-120) for fixed TTL. |
319
+ The deterministic tier is what CI gates; the live tier is opt-in for changes that touch the model registry, the request transform, or the response transform.
610
320
 
611
- > **How it works**: Quota cache is refreshed automatically after API requests (when older than `quota_refresh_interval_minutes`) and manually via "Check quotas" in `opencode auth login`. The threshold check uses `soft_quota_cache_ttl_minutes` to determine cache freshness - if cache is older, the account is considered "unknown" and allowed (fail-open). When ALL accounts exceed the threshold, the plugin waits for the earliest quota reset time (like rate limit behavior). If wait time exceeds `max_rate_limit_wait_seconds`, it errors immediately.
321
+ ## Troubleshooting
612
322
 
613
- ### Rate Limit Scheduling
323
+ > **Quick reset** when nothing else works: stop OpenCode, `rm ~/.config/opencode/antigravity-accounts.json`, then `opencode auth login`.
614
324
 
615
- Control how the plugin handles rate limits:
325
+ ### Configuration paths (all platforms)
616
326
 
617
- | Option | Default | What it does |
618
- |--------|---------|--------------|
619
- | `scheduling_mode` | `"cache_first"` | `"cache_first"` = wait for same account (preserves prompt cache), `"balance"` = switch immediately, `"performance_first"` = round-robin |
620
- | `max_cache_first_wait_seconds` | `60` | Max seconds to wait in cache_first mode before switching accounts |
621
- | `failure_ttl_seconds` | `3600` | Reset failure count after this many seconds (prevents old failures from permanently penalizing accounts) |
327
+ OpenCode uses `~/.config/opencode/` on **all platforms** including Windows; do not use `%APPDATA%` for new installs. Override with `OPENCODE_CONFIG_DIR`. v1.3.x and earlier stored config under `%APPDATA%\opencode\` — the plugin auto-migrates on first read.
622
328
 
623
- **When to use each mode:**
624
- - **cache_first** (default): Best for long conversations. Waits for the same account to recover, preserving your prompt cache.
625
- - **balance**: Best for quick tasks. Switches accounts immediately when rate-limited for maximum availability.
626
- - **performance_first**: Best for many short requests. Distributes load evenly across all accounts.
329
+ ### OAuth callback issues
627
330
 
628
- ### App Behavior
331
+ - **Safari HTTPS-Only mode** blocks `http://localhost`. Switch browsers or temporarily disable HTTPS-Only (Safari → Settings → Privacy) during login.
332
+ - **Stale `Address already in use :51121`** — `lsof -i :51121` (or `netstat -ano | findstr :51121` on Windows) → kill the PID → retry. The standalone CLI's `--no-browser` flag avoids the listener entirely.
333
+ - **SSH / remote dev** — forward the callback port with `ssh -L 51121:localhost:51121 user@remote`. The standalone CLI + `--no-browser` is the simplest workaround when SSH-port-forwarding is awkward.
334
+ - **Docker / WSL2 / containers** — localhost OAuth does not work in containers out of the box. Wait 30s for the manual URL flow, or port-forward `51121` to the host.
629
335
 
630
- | Option | Default | What it does |
631
- |--------|---------|--------------|
632
- | `quiet_mode` | `false` | Hide toast notifications |
633
- | `debug` | `false` | Enable debug file logging (`~/.config/opencode/antigravity-logs/`) |
634
- | `debug_tui` | `false` | Show debug logs in the TUI log panel (independent from `debug`) |
635
- | `auto_update` | `true` | Auto-update plugin |
336
+ ### Common errors
636
337
 
637
- For all options, see [docs/CONFIGURATION.md](docs/CONFIGURATION.md).
338
+ - **`Permission 'cloudaicompanion.companions.generateChat' denied on resource '…/locations/global'`** — Antigravity returned no project ID (likely a workspace account) and the plugin used the hardcoded fallback `rising-fact-p41fc`. Enable the Gemini for Google Cloud API on a Cloud project and set `projectId` on the account in `antigravity-accounts.json`.
339
+ - **Gemini 3 model 400 "Unknown name 'parameters'"** — usually a tool-schema incompatibility. Update to the latest plugin version; or disable MCP servers one-by-one to isolate the offender.
340
+ - **`Invalid function name must start with a letter or underscore`** — an MCP tool name starts with a digit (e.g. `1mcp_*`). Rename the MCP key to start with a letter (e.g. `gw`) or disable that MCP entry for Antigravity models.
341
+ - **`All Accounts Rate-Limited (But Quota Available)`** — usually a stale cascade in `clearExpiredRateLimits()`. Lower `soft_quota_threshold_percent` (or raise to `100`), run `/antigravity-quota refresh`, or delete `antigravity-accounts.json` and re-authenticate.
342
+ - **Infinite `.tmp` files** — a rate-limit retry loop is creating temp files faster than cleanup. Stop OpenCode, `rm ~/.config/opencode/*.tmp`, add accounts, or wait for the cooldown.
638
343
 
639
- **Environment variables:**
640
- ```bash
641
- OPENCODE_CONFIG_DIR=/path/to/config opencode # Custom config directory
642
- OPENCODE_ANTIGRAVITY_DEBUG=1 opencode # Enable debug file logging
643
- OPENCODE_ANTIGRAVITY_DEBUG=2 opencode # Verbose debug file logging
644
- OPENCODE_ANTIGRAVITY_DEBUG_TUI=1 opencode # Enable TUI log panel debug output
645
- ```
344
+ ### Sidebar / TUI
646
345
 
647
- ---
346
+ - **`Awaiting Antigravity state` stuck** — verify `$XDG_STATE_HOME/cortexkit/antigravity-auth/sidebar-state.json` exists, is `0600`, and the host user can write. Restart the host.
347
+ - **TUI bundle fails to spawn** — `bun run --cwd packages/opencode build` regenerates `dist/src/tui-compiled/tui.tsx`. Verify the file exists. Then `bun run --cwd packages/opencode smoke:tui`.
348
+ - **`Antigravity RPC server is not available`** — the TUI posts to a per-PID port file in `$XDG_STATE_HOME/cortexkit/antigravity-auth/rpc/<project-hash>/`. If the running plugin process is gone, stop and restart the host.
648
349
 
649
- ## Troubleshooting
350
+ ### Migration between machines
351
+
352
+ When copying `antigravity-accounts.json` to a new machine:
650
353
 
651
- See the full [Troubleshooting Guide](docs/TROUBLESHOOTING.md) for solutions to common issues including:
354
+ 1. Ensure the plugin is installed: `"plugin": ["@cortexkit/opencode-antigravity-auth@latest"]`.
355
+ 2. Copy `~/.config/opencode/antigravity-accounts.json` (preserve the `0600` mode).
356
+ 3. If you see `API key missing`, the refresh token may be invalid — re-authenticate.
652
357
 
653
- - Auth problems and token refresh
654
- - "Model not found" errors
655
- - Session recovery
656
- - Gemini CLI permission errors
657
- - Safari OAuth issues
658
- - Plugin compatibility
659
- - Migration guides
358
+ ### Plugin config schema
660
359
 
661
- ---
360
+ The schema reference at `assets/antigravity.schema.json` drives editor IntelliSense. Set `$schema: "https://raw.githubusercontent.com/cortexkit/antigravity-auth/main/assets/antigravity.schema.json"` in your `antigravity.json` for autocomplete in the IDE.
662
361
 
663
362
  ## Documentation
664
363
 
665
- - [Configuration](docs/CONFIGURATION.md) — All configuration options
666
- - [Multi-Account](docs/MULTI-ACCOUNT.md) — Load balancing, dual quota pools, account storage
667
- - [Model Variants](docs/MODEL-VARIANTS.md) — Thinking budgets and variant system
668
- - [Troubleshooting](docs/TROUBLESHOOTING.md) — Common issues and fixes
669
- - [Architecture](docs/ARCHITECTURE.md) — How the plugin works
670
- - [API Spec](docs/ANTIGRAVITY_API_SPEC.md) — Antigravity API reference
671
-
672
- ---
364
+ - [Root README](../../README.md) — full operator + contributor guide
365
+ - [CHANGELOG.md](./CHANGELOG.md) — release history
366
+ - [STRUCTURE.md](./STRUCTURE.md) — file-system map
367
+ - [ARCHITECTURE.md](./ARCHITECTURE.md) — architecture overview
368
+ - [docs/CONFIGURATION.md](./docs/CONFIGURATION.md) — every option with examples
369
+ - [docs/MULTI-ACCOUNT.md](./docs/MULTI-ACCOUNT.md) — load balancing, dual quota, storage
370
+ - [docs/MODEL-VARIANTS.md](./docs/MODEL-VARIANTS.md) — variants and thinking budgets
371
+ - [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) — long-form troubleshooting
372
+ - [docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md) — internal architecture
373
+ - [docs/ANTIGRAVITY_API_SPEC.md](./docs/ANTIGRAVITY_API_SPEC.md) — Antigravity API reference
673
374
 
674
375
  ## Support
675
376
 
676
- If this plugin saves you time, consider supporting its development:
677
-
678
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S81QBOIR)
679
-
680
- ---
377
+ If this plugin saves you time, consider supporting its development at <https://ko-fi.com/S6S81QBOIR>.
681
378
 
682
379
  ## Credits
683
380
 
@@ -686,29 +383,4 @@ If this plugin saves you time, consider supporting its development:
686
383
 
687
384
  ## License
688
385
 
689
- MIT License. See [LICENSE](LICENSE) for details.
690
-
691
- <details>
692
- <summary><b>Legal</b></summary>
693
-
694
- ### Intended Use
695
-
696
- - Personal / internal development only
697
- - Respect internal quotas and data handling policies
698
- - Not for production services or bypassing intended limits
699
-
700
- ### Warning
701
-
702
- By using this plugin, you acknowledge:
703
-
704
- - **Terms of Service risk** — This approach may violate ToS of AI model providers
705
- - **Account risk** — Providers may suspend or ban accounts
706
- - **No guarantees** — APIs may change without notice
707
- - **Assumption of risk** — You assume all legal, financial, and technical risks
708
-
709
- ### Disclaimer
710
-
711
- - Not affiliated with Google. This is an independent open-source project.
712
- - "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
713
-
714
- </details>
386
+ MIT. See [LICENSE](./LICENSE).