@cortexkit/opencode-antigravity-auth 1.1.0 → 2.0.1

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 (379) hide show
  1. package/README.md +225 -569
  2. package/dist/cli.js +4017 -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 +20742 -14586
  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/account-command-oauth.d.ts +34 -0
  38. package/dist/src/plugin/account-command-oauth.d.ts.map +1 -0
  39. package/dist/src/plugin/account-command-oauth.js +156 -0
  40. package/dist/src/plugin/account-command-oauth.js.map +1 -0
  41. package/dist/src/plugin/accounts.d.ts +7 -256
  42. package/dist/src/plugin/accounts.d.ts.map +1 -1
  43. package/dist/src/plugin/accounts.js +31 -1367
  44. package/dist/src/plugin/accounts.js.map +1 -1
  45. package/dist/src/plugin/agy-request-metadata.d.ts +1 -1
  46. package/dist/src/plugin/agy-request-metadata.js +1 -1
  47. package/dist/src/plugin/agy-transport.d.ts +1 -1
  48. package/dist/src/plugin/agy-transport.js +1 -1
  49. package/dist/src/plugin/auth-doctor.d.ts +6 -6
  50. package/dist/src/plugin/auth-doctor.d.ts.map +1 -1
  51. package/dist/src/plugin/auth-doctor.js +74 -66
  52. package/dist/src/plugin/auth-doctor.js.map +1 -1
  53. package/dist/src/plugin/auth-drift.d.ts +4 -4
  54. package/dist/src/plugin/auth-drift.d.ts.map +1 -1
  55. package/dist/src/plugin/auth-drift.js +15 -15
  56. package/dist/src/plugin/auth-drift.js.map +1 -1
  57. package/dist/src/plugin/auth-loader.d.ts +50 -0
  58. package/dist/src/plugin/auth-loader.d.ts.map +1 -0
  59. package/dist/src/plugin/auth-loader.js +225 -0
  60. package/dist/src/plugin/auth-loader.js.map +1 -0
  61. package/dist/src/plugin/auth.d.ts +1 -1
  62. package/dist/src/plugin/auth.js +1 -1
  63. package/dist/src/plugin/background-quota-refresh.d.ts +146 -0
  64. package/dist/src/plugin/background-quota-refresh.d.ts.map +1 -0
  65. package/dist/src/plugin/background-quota-refresh.js +347 -0
  66. package/dist/src/plugin/background-quota-refresh.js.map +1 -0
  67. package/dist/src/plugin/cache/index.d.ts +1 -1
  68. package/dist/src/plugin/cache/index.d.ts.map +1 -1
  69. package/dist/src/plugin/cache/index.js +1 -1
  70. package/dist/src/plugin/cache/index.js.map +1 -1
  71. package/dist/src/plugin/cache/signature-cache.d.ts +1 -1
  72. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
  73. package/dist/src/plugin/cache/signature-cache.js +23 -24
  74. package/dist/src/plugin/cache/signature-cache.js.map +1 -1
  75. package/dist/src/plugin/cache.d.ts +6 -5
  76. package/dist/src/plugin/cache.d.ts.map +1 -1
  77. package/dist/src/plugin/cache.js +21 -7
  78. package/dist/src/plugin/cache.js.map +1 -1
  79. package/dist/src/plugin/catalog.d.ts +23 -0
  80. package/dist/src/plugin/catalog.d.ts.map +1 -0
  81. package/dist/src/plugin/catalog.js +60 -0
  82. package/dist/src/plugin/catalog.js.map +1 -0
  83. package/dist/src/plugin/cli.d.ts +7 -7
  84. package/dist/src/plugin/cli.d.ts.map +1 -1
  85. package/dist/src/plugin/cli.js +62 -55
  86. package/dist/src/plugin/cli.js.map +1 -1
  87. package/dist/src/plugin/command-data.d.ts +329 -0
  88. package/dist/src/plugin/command-data.d.ts.map +1 -0
  89. package/dist/src/plugin/command-data.js +517 -0
  90. package/dist/src/plugin/command-data.js.map +1 -0
  91. package/dist/src/plugin/commands.d.ts +154 -0
  92. package/dist/src/plugin/commands.d.ts.map +1 -0
  93. package/dist/src/plugin/commands.js +746 -0
  94. package/dist/src/plugin/commands.js.map +1 -0
  95. package/dist/src/plugin/config/index.d.ts +2 -2
  96. package/dist/src/plugin/config/index.d.ts.map +1 -1
  97. package/dist/src/plugin/config/index.js +2 -2
  98. package/dist/src/plugin/config/index.js.map +1 -1
  99. package/dist/src/plugin/config/loader.d.ts +1 -1
  100. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  101. package/dist/src/plugin/config/loader.js +18 -16
  102. package/dist/src/plugin/config/loader.js.map +1 -1
  103. package/dist/src/plugin/config/models.d.ts +2 -2
  104. package/dist/src/plugin/config/models.d.ts.map +1 -1
  105. package/dist/src/plugin/config/models.js +1 -1
  106. package/dist/src/plugin/config/models.js.map +1 -1
  107. package/dist/src/plugin/config/operator-settings-schema.d.ts +29 -0
  108. package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
  109. package/dist/src/plugin/config/operator-settings-schema.js +28 -0
  110. package/dist/src/plugin/config/operator-settings-schema.js.map +1 -0
  111. package/dist/src/plugin/config/schema.d.ts +23 -2
  112. package/dist/src/plugin/config/schema.d.ts.map +1 -1
  113. package/dist/src/plugin/config/schema.js +109 -25
  114. package/dist/src/plugin/config/schema.js.map +1 -1
  115. package/dist/src/plugin/config/updater.d.ts.map +1 -1
  116. package/dist/src/plugin/config/updater.js +15 -15
  117. package/dist/src/plugin/config/updater.js.map +1 -1
  118. package/dist/src/plugin/config/writer.d.ts +34 -0
  119. package/dist/src/plugin/config/writer.d.ts.map +1 -0
  120. package/dist/src/plugin/config/writer.js +81 -0
  121. package/dist/src/plugin/config/writer.js.map +1 -0
  122. package/dist/src/plugin/core/streaming/index.d.ts +1 -1
  123. package/dist/src/plugin/core/streaming/index.d.ts.map +1 -1
  124. package/dist/src/plugin/core/streaming/index.js +1 -1
  125. package/dist/src/plugin/core/streaming/index.js.map +1 -1
  126. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
  127. package/dist/src/plugin/core/streaming/transformer.js +85 -44
  128. package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
  129. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
  130. package/dist/src/plugin/debug.d.ts +10 -3
  131. package/dist/src/plugin/debug.d.ts.map +1 -1
  132. package/dist/src/plugin/debug.js +110 -47
  133. package/dist/src/plugin/debug.js.map +1 -1
  134. package/dist/src/plugin/dependencies.d.ts +129 -0
  135. package/dist/src/plugin/dependencies.d.ts.map +1 -0
  136. package/dist/src/plugin/dependencies.js +107 -0
  137. package/dist/src/plugin/dependencies.js.map +1 -0
  138. package/dist/src/plugin/errors.d.ts +27 -0
  139. package/dist/src/plugin/errors.d.ts.map +1 -1
  140. package/dist/src/plugin/errors.js +29 -3
  141. package/dist/src/plugin/errors.js.map +1 -1
  142. package/dist/src/plugin/event-handler.d.ts +53 -0
  143. package/dist/src/plugin/event-handler.d.ts.map +1 -0
  144. package/dist/src/plugin/event-handler.js +101 -0
  145. package/dist/src/plugin/event-handler.js.map +1 -0
  146. package/dist/src/plugin/fetch/retry-state.d.ts +61 -0
  147. package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -0
  148. package/dist/src/plugin/fetch/retry-state.js +248 -0
  149. package/dist/src/plugin/fetch/retry-state.js.map +1 -0
  150. package/dist/src/plugin/fetch/warmup.d.ts +30 -0
  151. package/dist/src/plugin/fetch/warmup.d.ts.map +1 -0
  152. package/dist/src/plugin/fetch/warmup.js +76 -0
  153. package/dist/src/plugin/fetch/warmup.js.map +1 -0
  154. package/dist/src/plugin/fetch-interceptor.d.ts +59 -0
  155. package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -0
  156. package/dist/src/plugin/fetch-interceptor.js +1399 -0
  157. package/dist/src/plugin/fetch-interceptor.js.map +1 -0
  158. package/dist/src/plugin/fetch-routing.d.ts +26 -0
  159. package/dist/src/plugin/fetch-routing.d.ts.map +1 -0
  160. package/dist/src/plugin/fetch-routing.js +99 -0
  161. package/dist/src/plugin/fetch-routing.js.map +1 -0
  162. package/dist/src/plugin/fingerprint.d.ts +1 -1
  163. package/dist/src/plugin/fingerprint.js +1 -1
  164. package/dist/src/plugin/gemini-dump.d.ts +5 -5
  165. package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
  166. package/dist/src/plugin/gemini-dump.js +109 -55
  167. package/dist/src/plugin/gemini-dump.js.map +1 -1
  168. package/dist/src/plugin/google-search-tool.d.ts +9 -0
  169. package/dist/src/plugin/google-search-tool.d.ts.map +1 -0
  170. package/dist/src/plugin/google-search-tool.js +56 -0
  171. package/dist/src/plugin/google-search-tool.js.map +1 -0
  172. package/dist/src/plugin/image-saver.d.ts.map +1 -1
  173. package/dist/src/plugin/image-saver.js +16 -16
  174. package/dist/src/plugin/image-saver.js.map +1 -1
  175. package/dist/src/plugin/index.d.ts +30 -0
  176. package/dist/src/plugin/index.d.ts.map +1 -0
  177. package/dist/src/plugin/index.js +411 -0
  178. package/dist/src/plugin/index.js.map +1 -0
  179. package/dist/src/plugin/killswitch.d.ts +94 -0
  180. package/dist/src/plugin/killswitch.d.ts.map +1 -0
  181. package/dist/src/plugin/killswitch.js +197 -0
  182. package/dist/src/plugin/killswitch.js.map +1 -0
  183. package/dist/src/plugin/lifecycle.d.ts +40 -0
  184. package/dist/src/plugin/lifecycle.d.ts.map +1 -0
  185. package/dist/src/plugin/lifecycle.js +73 -0
  186. package/dist/src/plugin/lifecycle.js.map +1 -0
  187. package/dist/src/plugin/logger.d.ts +10 -1
  188. package/dist/src/plugin/logger.d.ts.map +1 -1
  189. package/dist/src/plugin/logger.js +38 -12
  190. package/dist/src/plugin/logger.js.map +1 -1
  191. package/dist/src/plugin/logging-utils.d.ts +35 -1
  192. package/dist/src/plugin/logging-utils.d.ts.map +1 -1
  193. package/dist/src/plugin/logging-utils.js +98 -15
  194. package/dist/src/plugin/logging-utils.js.map +1 -1
  195. package/dist/src/plugin/model-registry.d.ts +1 -1
  196. package/dist/src/plugin/model-registry.js +1 -1
  197. package/dist/src/plugin/oauth-login.d.ts +22 -0
  198. package/dist/src/plugin/oauth-login.d.ts.map +1 -0
  199. package/dist/src/plugin/oauth-login.js +37 -0
  200. package/dist/src/plugin/oauth-login.js.map +1 -0
  201. package/dist/src/plugin/oauth-methods.d.ts +42 -0
  202. package/dist/src/plugin/oauth-methods.d.ts.map +1 -0
  203. package/dist/src/plugin/oauth-methods.js +1276 -0
  204. package/dist/src/plugin/oauth-methods.js.map +1 -0
  205. package/dist/src/plugin/operator-settings.d.ts +40 -0
  206. package/dist/src/plugin/operator-settings.d.ts.map +1 -0
  207. package/dist/src/plugin/operator-settings.js +148 -0
  208. package/dist/src/plugin/operator-settings.js.map +1 -0
  209. package/dist/src/plugin/persist-account-pool.d.ts +37 -0
  210. package/dist/src/plugin/persist-account-pool.d.ts.map +1 -0
  211. package/dist/src/plugin/persist-account-pool.js +142 -0
  212. package/dist/src/plugin/persist-account-pool.js.map +1 -0
  213. package/dist/src/plugin/project.d.ts +1 -1
  214. package/dist/src/plugin/project.js +1 -1
  215. package/dist/src/plugin/prompt-context.d.ts.map +1 -1
  216. package/dist/src/plugin/prompt-context.js +11 -11
  217. package/dist/src/plugin/prompt-context.js.map +1 -1
  218. package/dist/src/plugin/quota.d.ts +138 -41
  219. package/dist/src/plugin/quota.d.ts.map +1 -1
  220. package/dist/src/plugin/quota.js +417 -285
  221. package/dist/src/plugin/quota.js.map +1 -1
  222. package/dist/src/plugin/recovery/constants.d.ts.map +1 -1
  223. package/dist/src/plugin/recovery/constants.js +24 -15
  224. package/dist/src/plugin/recovery/constants.js.map +1 -1
  225. package/dist/src/plugin/recovery/index.d.ts +3 -3
  226. package/dist/src/plugin/recovery/index.d.ts.map +1 -1
  227. package/dist/src/plugin/recovery/index.js +3 -3
  228. package/dist/src/plugin/recovery/index.js.map +1 -1
  229. package/dist/src/plugin/recovery/storage.d.ts +1 -1
  230. package/dist/src/plugin/recovery/storage.d.ts.map +1 -1
  231. package/dist/src/plugin/recovery/storage.js +31 -39
  232. package/dist/src/plugin/recovery/storage.js.map +1 -1
  233. package/dist/src/plugin/recovery/types.d.ts +12 -12
  234. package/dist/src/plugin/recovery/types.d.ts.map +1 -1
  235. package/dist/src/plugin/recovery.d.ts +3 -3
  236. package/dist/src/plugin/recovery.d.ts.map +1 -1
  237. package/dist/src/plugin/recovery.js +62 -58
  238. package/dist/src/plugin/recovery.js.map +1 -1
  239. package/dist/src/plugin/refresh-queue.d.ts +5 -2
  240. package/dist/src/plugin/refresh-queue.d.ts.map +1 -1
  241. package/dist/src/plugin/refresh-queue.js +37 -15
  242. package/dist/src/plugin/refresh-queue.js.map +1 -1
  243. package/dist/src/plugin/request-helpers.d.ts +1 -1
  244. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  245. package/dist/src/plugin/request-helpers.js +451 -352
  246. package/dist/src/plugin/request-helpers.js.map +1 -1
  247. package/dist/src/plugin/request.d.ts +7 -7
  248. package/dist/src/plugin/request.d.ts.map +1 -1
  249. package/dist/src/plugin/request.js +622 -384
  250. package/dist/src/plugin/request.js.map +1 -1
  251. package/dist/src/plugin/rotation.d.ts +1 -168
  252. package/dist/src/plugin/rotation.d.ts.map +1 -1
  253. package/dist/src/plugin/rotation.js +1 -327
  254. package/dist/src/plugin/rotation.js.map +1 -1
  255. package/dist/src/plugin/search.d.ts.map +1 -1
  256. package/dist/src/plugin/search.js +39 -35
  257. package/dist/src/plugin/search.js.map +1 -1
  258. package/dist/src/plugin/server.d.ts +1 -1
  259. package/dist/src/plugin/server.d.ts.map +1 -1
  260. package/dist/src/plugin/server.js +42 -37
  261. package/dist/src/plugin/server.js.map +1 -1
  262. package/dist/src/plugin/session-context.d.ts +2 -1
  263. package/dist/src/plugin/session-context.d.ts.map +1 -1
  264. package/dist/src/plugin/session-context.js +11 -7
  265. package/dist/src/plugin/session-context.js.map +1 -1
  266. package/dist/src/plugin/storage.d.ts +59 -120
  267. package/dist/src/plugin/storage.d.ts.map +1 -1
  268. package/dist/src/plugin/storage.js +140 -485
  269. package/dist/src/plugin/storage.js.map +1 -1
  270. package/dist/src/plugin/stores/signature-store.d.ts.map +1 -1
  271. package/dist/src/plugin/stores/signature-store.js.map +1 -1
  272. package/dist/src/plugin/thinking-recovery.d.ts.map +1 -1
  273. package/dist/src/plugin/thinking-recovery.js +35 -33
  274. package/dist/src/plugin/thinking-recovery.js.map +1 -1
  275. package/dist/src/plugin/token.d.ts +2 -2
  276. package/dist/src/plugin/token.d.ts.map +1 -1
  277. package/dist/src/plugin/token.js +30 -21
  278. package/dist/src/plugin/token.js.map +1 -1
  279. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +1 -1
  280. package/dist/src/plugin/transform/cross-model-sanitizer.js +1 -1
  281. package/dist/src/plugin/transform/index.d.ts +1 -1
  282. package/dist/src/plugin/transform/index.js +1 -1
  283. package/dist/src/plugin/transform/model-resolver.d.ts +1 -1
  284. package/dist/src/plugin/transform/model-resolver.js +1 -1
  285. package/dist/src/plugin/transform/types.d.ts +1 -1
  286. package/dist/src/plugin/transform/types.js +1 -1
  287. package/dist/src/plugin/types.d.ts +25 -69
  288. package/dist/src/plugin/types.d.ts.map +1 -1
  289. package/dist/src/plugin/ui/ansi.d.ts.map +1 -1
  290. package/dist/src/plugin/ui/ansi.js.map +1 -1
  291. package/dist/src/plugin/ui/auth-menu.d.ts +1 -1
  292. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
  293. package/dist/src/plugin/ui/auth-menu.js +84 -35
  294. package/dist/src/plugin/ui/auth-menu.js.map +1 -1
  295. package/dist/src/plugin/ui/confirm.d.ts.map +1 -1
  296. package/dist/src/plugin/ui/confirm.js.map +1 -1
  297. package/dist/src/plugin/ui/model-status.d.ts +3 -3
  298. package/dist/src/plugin/ui/model-status.d.ts.map +1 -1
  299. package/dist/src/plugin/ui/model-status.js +3 -3
  300. package/dist/src/plugin/ui/model-status.js.map +1 -1
  301. package/dist/src/plugin/ui/quota-status.d.ts +4 -4
  302. package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
  303. package/dist/src/plugin/ui/quota-status.js +49 -49
  304. package/dist/src/plugin/ui/quota-status.js.map +1 -1
  305. package/dist/src/plugin/ui/select.d.ts.map +1 -1
  306. package/dist/src/plugin/ui/select.js +22 -12
  307. package/dist/src/plugin/ui/select.js.map +1 -1
  308. package/dist/src/plugin/version.d.ts +1 -1
  309. package/dist/src/plugin/version.js +1 -1
  310. package/dist/src/rpc/notifications.d.ts +6 -0
  311. package/dist/src/rpc/notifications.d.ts.map +1 -0
  312. package/dist/src/rpc/notifications.js +46 -0
  313. package/dist/src/rpc/notifications.js.map +1 -0
  314. package/dist/src/rpc/port-file.d.ts +13 -0
  315. package/dist/src/rpc/port-file.d.ts.map +1 -0
  316. package/dist/src/rpc/port-file.js +109 -0
  317. package/dist/src/rpc/port-file.js.map +1 -0
  318. package/dist/src/rpc/protocol.d.ts +22 -0
  319. package/dist/src/rpc/protocol.d.ts.map +1 -0
  320. package/dist/src/rpc/protocol.js +1 -0
  321. package/dist/src/rpc/protocol.js.map +1 -0
  322. package/dist/src/rpc/rpc-client.d.ts +10 -0
  323. package/dist/src/rpc/rpc-client.d.ts.map +1 -0
  324. package/dist/src/rpc/rpc-client.js +58 -0
  325. package/dist/src/rpc/rpc-client.js.map +1 -0
  326. package/dist/src/rpc/rpc-dir.d.ts +4 -0
  327. package/dist/src/rpc/rpc-dir.d.ts.map +1 -0
  328. package/dist/src/rpc/rpc-dir.js +19 -0
  329. package/dist/src/rpc/rpc-dir.js.map +1 -0
  330. package/dist/src/rpc/rpc-server.d.ts +13 -0
  331. package/dist/src/rpc/rpc-server.d.ts.map +1 -0
  332. package/dist/src/rpc/rpc-server.js +231 -0
  333. package/dist/src/rpc/rpc-server.js.map +1 -0
  334. package/dist/src/sidebar-state.d.ts +357 -0
  335. package/dist/src/sidebar-state.d.ts.map +1 -0
  336. package/dist/src/sidebar-state.js +680 -0
  337. package/dist/src/sidebar-state.js.map +1 -0
  338. package/dist/src/tui/command-dialogs.d.ts +61 -0
  339. package/dist/src/tui/command-dialogs.d.ts.map +1 -0
  340. package/dist/src/tui/command-dialogs.js +595 -0
  341. package/dist/src/tui/command-dialogs.js.map +1 -0
  342. package/dist/src/tui/file-logger.d.ts +41 -0
  343. package/dist/src/tui/file-logger.d.ts.map +1 -0
  344. package/dist/src/tui/file-logger.js +114 -0
  345. package/dist/src/tui/file-logger.js.map +1 -0
  346. package/dist/src/tui-preferences.d.ts +40 -0
  347. package/dist/src/tui-preferences.d.ts.map +1 -0
  348. package/dist/src/tui-preferences.js +328 -0
  349. package/dist/src/tui-preferences.js.map +1 -0
  350. package/dist/src/tui.d.ts +68 -0
  351. package/dist/src/tui.d.ts.map +1 -0
  352. package/dist/src/tui.js +697 -0
  353. package/dist/src/tui.js.map +1 -0
  354. package/package.json +46 -22
  355. package/src/plugin/command-data.ts +931 -0
  356. package/src/rpc/port-file.ts +143 -0
  357. package/src/rpc/protocol.ts +31 -0
  358. package/src/rpc/rpc-client.ts +102 -0
  359. package/src/rpc/rpc-dir.ts +24 -0
  360. package/src/sidebar-state.ts +991 -0
  361. package/src/tui/command-dialogs.tsx +832 -0
  362. package/src/tui/entry.mjs +74 -0
  363. package/src/tui/file-logger.ts +145 -0
  364. package/src/tui-compiled/plugin/command-data.ts +931 -0
  365. package/src/tui-compiled/rpc/port-file.ts +143 -0
  366. package/src/tui-compiled/rpc/protocol.ts +31 -0
  367. package/src/tui-compiled/rpc/rpc-client.ts +102 -0
  368. package/src/tui-compiled/rpc/rpc-dir.ts +24 -0
  369. package/src/tui-compiled/sidebar-state.ts +991 -0
  370. package/src/tui-compiled/tui/command-dialogs.tsx +779 -0
  371. package/src/tui-compiled/tui/file-logger.ts +145 -0
  372. package/src/tui-compiled/tui-preferences.ts +416 -0
  373. package/src/tui-compiled/tui.tsx +1193 -0
  374. package/src/tui-preferences.ts +416 -0
  375. package/src/tui.tsx +1171 -0
  376. package/dist/src/plugin.d.ts +0 -48
  377. package/dist/src/plugin.d.ts.map +0 -1
  378. package/dist/src/plugin.js +0 -3311
  379. package/dist/src/plugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/plugin/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG1F;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAA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G;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAG7C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAa9C;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAsE7B"}
1
+ {"version":3,"file":"updater.d.ts","sourceRoot":"","sources":["../../../../src/plugin/config/updater.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE;YACP,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;YAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SACvB,CAAA;QACD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;IACD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAoBD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAG7C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAa9C;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAwE7B"}
@@ -3,28 +3,28 @@
3
3
  *
4
4
  * Updates ~/.config/opencode/opencode.json(c) with plugin models.
5
5
  */
6
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
7
- import { join, dirname } from "node:path";
8
- import { homedir } from "node:os";
9
- import { getAntigravityOpencodeModelIds, OPENCODE_MODEL_DEFINITIONS } from "./models";
6
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
7
+ import { homedir } from 'node:os';
8
+ import { dirname, join } from 'node:path';
9
+ import { getAntigravityOpencodeModelIds, OPENCODE_MODEL_DEFINITIONS, } from './models';
10
10
  // =============================================================================
11
11
  // Constants
12
12
  // =============================================================================
13
- const PLUGIN_NAME = "@cortexkit/opencode-antigravity-auth@latest";
14
- const SCHEMA_URL = "https://opencode.ai/config.json";
15
- const OPENCODE_JSON_FILENAME = "opencode.json";
16
- const OPENCODE_JSONC_FILENAME = "opencode.jsonc";
13
+ const PLUGIN_NAME = '@cortexkit/opencode-antigravity-auth@latest';
14
+ const SCHEMA_URL = 'https://opencode.ai/config.json';
15
+ const OPENCODE_JSON_FILENAME = 'opencode.json';
16
+ const OPENCODE_JSONC_FILENAME = 'opencode.jsonc';
17
17
  function stripJsonCommentsAndTrailingCommas(json) {
18
18
  return json
19
- .replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (match, group) => (group ? "" : match))
20
- .replace(/,(\s*[}\]])/g, "$1");
19
+ .replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (match, group) => (group ? '' : match))
20
+ .replace(/,(\s*[}\]])/g, '$1');
21
21
  }
22
22
  /**
23
23
  * Get the opencode config directory path.
24
24
  */
25
25
  export function getOpencodeConfigDir() {
26
- const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
27
- return join(xdgConfig, "opencode");
26
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), '.config');
27
+ return join(xdgConfig, 'opencode');
28
28
  }
29
29
  /**
30
30
  * Get the opencode config file path.
@@ -69,7 +69,7 @@ export async function updateOpencodeConfig(options = {}) {
69
69
  let config;
70
70
  // Read existing config or create default
71
71
  if (existsSync(configPath)) {
72
- const content = readFileSync(configPath, "utf-8");
72
+ const content = readFileSync(configPath, 'utf-8');
73
73
  config = JSON.parse(stripJsonCommentsAndTrailingCommas(content));
74
74
  }
75
75
  else {
@@ -89,7 +89,7 @@ export async function updateOpencodeConfig(options = {}) {
89
89
  config.plugin = [];
90
90
  }
91
91
  // Check if plugin is already in the list (any version)
92
- const hasPlugin = config.plugin.some((p) => p.includes("opencode-antigravity-auth"));
92
+ const hasPlugin = config.plugin.some((p) => p.includes('opencode-antigravity-auth'));
93
93
  if (!hasPlugin) {
94
94
  config.plugin.push(PLUGIN_NAME);
95
95
  }
@@ -110,7 +110,7 @@ export async function updateOpencodeConfig(options = {}) {
110
110
  mkdirSync(configDir, { recursive: true });
111
111
  }
112
112
  // Write config with proper formatting (2-space indent)
113
- writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
113
+ writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
114
114
  return {
115
115
  success: true,
116
116
  configPath,
@@ -1 +1 @@
1
- {"version":3,"file":"updater.js","sourceRoot":"","sources":["../../../../src/plugin/config/updater.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AA8BtF,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,MAAM,WAAW,GAAG,6CAA6C,CAAC;AAClE,MAAM,UAAU,GAAG,iCAAiC,CAAC;AACrD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAC/C,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAEjD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AAG,OAAO,CAAC,UAAU,CAAC,CAAA;QACrC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC3C,CAAC;QAED,uDAAuD;QACvD,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QAEnE,OAAO;YACL,OAAO,EAAE,IAAI;YACb,UAAU;SACX,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,UAAU;YACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Lock-held config writer for operator-controlled settings.
3
+ *
4
+ * The /antigravity-quota, /antigravity-account, /antigravity-routing,
5
+ * /antigravity-killswitch, /antigravity-dump, and /antigravity-logging
6
+ * slash commands all mutate a small slice of the persisted
7
+ * `antigravity.json`. This writer:
8
+ *
9
+ * 1. Selects the existing project config (if present) — never the
10
+ * user one — so a multi-workspace OpenCode install gets per-project
11
+ * overrides. When no project config exists, the user config is the
12
+ * fallback.
13
+ * 2. Holds the same fenced file lock Task 7's core uses for the
14
+ * account pool so two slash commands fired in quick succession
15
+ * cannot race.
16
+ * 3. Serializes through `writeJsonAtomic` — staged tmp + rename —
17
+ * so a crash mid-write leaves the previous file intact.
18
+ * 4. Preserves every other top-level field the user may have set
19
+ * (the operator slice is one slot in the schema, not the whole
20
+ * file).
21
+ *
22
+ * No raw OAuth refresh tokens ever pass through this writer — the
23
+ * killswitch accounts map is keyed by sha256(refreshToken).slice(0,12)
24
+ * and `OperatorSettings` carries only that hash.
25
+ */
26
+ import type { OperatorSettings } from './operator-settings-schema';
27
+ export type { OperatorSettings } from './operator-settings-schema';
28
+ export interface WriteOperatorConfigOptions {
29
+ projectConfigPath: string;
30
+ userConfigPath: string;
31
+ operator: OperatorSettings;
32
+ }
33
+ export declare function writeOperatorConfig(options: WriteOperatorConfigOptions): Promise<void>;
34
+ //# sourceMappingURL=writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../../src/plugin/config/writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAUH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAGlE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAElE,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,gBAAgB,CAAA;CAC3B;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Lock-held config writer for operator-controlled settings.
3
+ *
4
+ * The /antigravity-quota, /antigravity-account, /antigravity-routing,
5
+ * /antigravity-killswitch, /antigravity-dump, and /antigravity-logging
6
+ * slash commands all mutate a small slice of the persisted
7
+ * `antigravity.json`. This writer:
8
+ *
9
+ * 1. Selects the existing project config (if present) — never the
10
+ * user one — so a multi-workspace OpenCode install gets per-project
11
+ * overrides. When no project config exists, the user config is the
12
+ * fallback.
13
+ * 2. Holds the same fenced file lock Task 7's core uses for the
14
+ * account pool so two slash commands fired in quick succession
15
+ * cannot race.
16
+ * 3. Serializes through `writeJsonAtomic` — staged tmp + rename —
17
+ * so a crash mid-write leaves the previous file intact.
18
+ * 4. Preserves every other top-level field the user may have set
19
+ * (the operator slice is one slot in the schema, not the whole
20
+ * file).
21
+ *
22
+ * No raw OAuth refresh tokens ever pass through this writer — the
23
+ * killswitch accounts map is keyed by sha256(refreshToken).slice(0,12)
24
+ * and `OperatorSettings` carries only that hash.
25
+ */
26
+ import { existsSync, readFileSync } from 'node:fs';
27
+ import { dirname } from 'node:path';
28
+ import { acquireFencedFileLock, writeJsonAtomic, } from '@cortexkit/antigravity-auth-core';
29
+ import { z } from 'zod';
30
+ import { OperatorSettingsSchema } from './operator-settings-schema';
31
+ export async function writeOperatorConfig(options) {
32
+ const operator = OperatorSettingsSchema.parse(options.operator);
33
+ const target = existsSync(options.projectConfigPath)
34
+ ? options.projectConfigPath
35
+ : options.userConfigPath;
36
+ const lock = await acquireFencedFileLock({
37
+ path: target,
38
+ name: 'antigravity-operator',
39
+ ttlMs: 5_000,
40
+ renew: false,
41
+ });
42
+ if (!lock) {
43
+ throw new Error(`Could not acquire operator-config lock at ${target} (already held by another writer).`);
44
+ }
45
+ try {
46
+ const existing = readExistingConfig(target);
47
+ const merged = mergeOperator(existing, operator);
48
+ await writeJsonAtomic(target, merged);
49
+ }
50
+ finally {
51
+ await lock.release().catch(() => { });
52
+ }
53
+ }
54
+ function readExistingConfig(target) {
55
+ if (!existsSync(target))
56
+ return {};
57
+ try {
58
+ const raw = readFileSync(target, 'utf-8');
59
+ const parsed = JSON.parse(raw);
60
+ if (parsed !== null &&
61
+ typeof parsed === 'object' &&
62
+ !Array.isArray(parsed)) {
63
+ return parsed;
64
+ }
65
+ return {};
66
+ }
67
+ catch {
68
+ return {};
69
+ }
70
+ }
71
+ function mergeOperator(existing, operator) {
72
+ // Carry every other top-level field forward — only the operator slice is
73
+ // replaced by this writer. Anything else the user sets in their
74
+ // antigravity.json (debug flags, model registry, etc.) is preserved.
75
+ const next = { ...existing };
76
+ next.operator = operator;
77
+ return next;
78
+ }
79
+ void z;
80
+ void dirname;
81
+ //# sourceMappingURL=writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.js","sourceRoot":"","sources":["../../../../src/plugin/config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AAS,kBAAkB,CAAC,MAAc;IACxC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAA;IAClC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAA;QACzC,IACE,MAAM,KAAK,IAAI;YACf,OAAO,MAAM,KAAK,QAAQ;YAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACtB,CAAC;YACD,OAAO,MAAiC,CAAA;QAC1C,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CACpB,QAAiC,EACjC,QAA0B;IAE1B,yEAAyE;IACzE,gEAAgE;IAChE,qEAAqE;IACrE,MAAM,IAAI,GAA4B,EAAE,GAAG,QAAQ,EAAE,CAAA;IACrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACxB,OAAO,IAAI,CAAA;AACb,CAAC;AAED,KAAK,CAAC,CAAA;AACN,KAAK,OAAO,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './types';
2
1
  export * from './transformer';
2
+ export * from './types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/core/streaming/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/core/streaming/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA"}
@@ -1,3 +1,3 @@
1
- export * from './types';
2
1
  export * from './transformer';
2
+ export * from './types';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugin/core/streaming/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugin/core/streaming/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../../../../src/plugin/core/streaming/transformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACd,MAAM,SAAS,CAAC;AAcjB,wBAAgB,mBAAmB,IAAI,aAAa,CAOnD;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,GACtD,MAAM,CAyBR;AACD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,aAAa,EACzB,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GACpC,OAAO,CA0GT;AAkLD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,aAAa,EACjC,SAAS,EAAE,kBAAkB,EAC7B,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,EACjC,UAAU,CAAC,EAAE;IAAE,SAAS,EAAE,sBAAsB,GAAG,IAAI,CAAA;CAAE,GACxD,MAAM,CAWR;AAED,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,OAAO,EACjB,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAA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EAAE,aAAa,EAC5B,gBAAgB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,KACd,IAAI,GACR,IAAI,CAqEN;AAED,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,kBAAkB,EAC7B,OAAO,GAAE,gBAAqB,GAC7B,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAmJzC"}
@@ -6,7 +6,7 @@ import { processImageData } from '../../image-saver';
6
6
  function hashString(str) {
7
7
  let hash = 5381;
8
8
  for (let i = 0; i < str.length; i++) {
9
- hash = ((hash << 5) + hash) + str.charCodeAt(i); /* hash * 33 + c */
9
+ hash = (hash << 5) + hash + str.charCodeAt(i); /* hash * 33 + c */
10
10
  }
11
11
  return (hash >>> 0).toString(16);
12
12
  }
@@ -39,7 +39,7 @@ export function transformStreamingPayload(payload, transformThinkingParts) {
39
39
  }
40
40
  }
41
41
  catch (_) {
42
- console.warn("[antigravity] Malformed SSE chunk, passing through untransformed:", json.slice(0, 200));
42
+ console.warn('[antigravity] Malformed SSE chunk, passing through untransformed:', json.slice(0, 200));
43
43
  }
44
44
  return line;
45
45
  })
@@ -71,7 +71,11 @@ export function deduplicateThinkingText(response, sentBuffer, displayedThinkingH
71
71
  }
72
72
  }
73
73
  if (p.thought === true || p.type === 'thinking') {
74
- const fullText = typeof p.text === "string" ? p.text : typeof p.thinking === "string" ? p.thinking : "";
74
+ const fullText = typeof p.text === 'string'
75
+ ? p.text
76
+ : typeof p.thinking === 'string'
77
+ ? p.thinking
78
+ : '';
75
79
  if (displayedThinkingHashes) {
76
80
  const hash = hashString(fullText);
77
81
  if (displayedThinkingHashes.has(hash)) {
@@ -107,7 +111,11 @@ export function deduplicateThinkingText(response, sentBuffer, displayedThinkingH
107
111
  const newContent = resp.content.flatMap((block) => {
108
112
  const b = block;
109
113
  if (b?.type === 'thinking') {
110
- const fullText = typeof b.thinking === "string" ? b.thinking : typeof b.text === "string" ? b.text : "";
114
+ const fullText = typeof b.thinking === 'string'
115
+ ? b.thinking
116
+ : typeof b.text === 'string'
117
+ ? b.text
118
+ : '';
111
119
  if (displayedThinkingHashes) {
112
120
  const hash = hashString(fullText);
113
121
  if (displayedThinkingHashes.has(hash)) {
@@ -139,51 +147,54 @@ export function deduplicateThinkingText(response, sentBuffer, displayedThinkingH
139
147
  return response;
140
148
  }
141
149
  function extractUsageMetadataFromDataLine(line) {
142
- if (!line.startsWith("data:"))
150
+ if (!line.startsWith('data:'))
143
151
  return undefined;
144
152
  const json = line.slice(5).trim();
145
- if (!json || json === "[DONE]")
153
+ if (!json || json === '[DONE]')
146
154
  return undefined;
147
155
  try {
148
156
  const parsed = JSON.parse(json);
149
- const response = parsed && typeof parsed === "object" && "response" in parsed
157
+ const response = parsed && typeof parsed === 'object' && 'response' in parsed
150
158
  ? parsed.response
151
159
  : parsed;
152
- if (!response || typeof response !== "object")
160
+ if (!response || typeof response !== 'object')
153
161
  return undefined;
154
162
  const usage = response.usageMetadata;
155
- return usage && typeof usage === "object" ? usage : undefined;
163
+ return usage && typeof usage === 'object'
164
+ ? usage
165
+ : undefined;
156
166
  }
157
167
  catch {
158
168
  return undefined;
159
169
  }
160
170
  }
161
171
  function usageMetadataHasCacheRead(usageMetadata) {
162
- return typeof usageMetadata?.cachedContentTokenCount === "number";
172
+ return typeof usageMetadata?.cachedContentTokenCount === 'number';
163
173
  }
164
174
  function completeSseEventSuffix(suffix) {
165
- if (suffix.includes("\n\n"))
175
+ if (suffix.includes('\n\n'))
166
176
  return suffix;
167
- if (suffix.endsWith("\n"))
168
- return suffix + "\n";
169
- return suffix + "\n\n";
177
+ if (suffix.endsWith('\n'))
178
+ return `${suffix}\n`;
179
+ return `${suffix}\n\n`;
170
180
  }
171
181
  function mergeUsageMetadataIntoDataLine(line, usageMetadata) {
172
- if (!usageMetadata || !line.startsWith("data:"))
182
+ if (!usageMetadata || !line.startsWith('data:'))
173
183
  return line;
174
184
  const json = line.slice(5).trim();
175
- if (!json || json === "[DONE]")
185
+ if (!json || json === '[DONE]')
176
186
  return line;
177
187
  try {
178
188
  const parsed = JSON.parse(json);
179
- const hasResponseWrapper = !!parsed && typeof parsed === "object" && "response" in parsed;
189
+ const hasResponseWrapper = !!parsed && typeof parsed === 'object' && 'response' in parsed;
180
190
  const response = hasResponseWrapper
181
191
  ? parsed.response
182
192
  : parsed;
183
- if (!response || typeof response !== "object")
193
+ if (!response || typeof response !== 'object')
184
194
  return line;
185
195
  const mutableResponse = response;
186
- const existing = mutableResponse.usageMetadata && typeof mutableResponse.usageMetadata === "object"
196
+ const existing = mutableResponse.usageMetadata &&
197
+ typeof mutableResponse.usageMetadata === 'object'
187
198
  ? mutableResponse.usageMetadata
188
199
  : {};
189
200
  mutableResponse.usageMetadata = { ...existing, ...usageMetadata };
@@ -194,7 +205,7 @@ function mergeUsageMetadataIntoDataLine(line, usageMetadata) {
194
205
  }
195
206
  }
196
207
  function responseHasToolCall(response) {
197
- if (!response || typeof response !== "object")
208
+ if (!response || typeof response !== 'object')
198
209
  return false;
199
210
  const resp = response;
200
211
  if (Array.isArray(resp.candidates)) {
@@ -202,32 +213,33 @@ function responseHasToolCall(response) {
202
213
  const cand = candidate;
203
214
  const content = cand?.content;
204
215
  const parts = content?.parts;
205
- return Array.isArray(parts) && parts.some((part) => {
206
- const p = part;
207
- return Boolean(p?.functionCall) || p?.type === "tool_use";
208
- });
216
+ return (Array.isArray(parts) &&
217
+ parts.some((part) => {
218
+ const p = part;
219
+ return Boolean(p?.functionCall) || p?.type === 'tool_use';
220
+ }));
209
221
  });
210
222
  }
211
223
  if (Array.isArray(resp.content)) {
212
224
  return resp.content.some((block) => {
213
225
  const b = block;
214
- return Boolean(b?.functionCall) || b?.type === "tool_use";
226
+ return Boolean(b?.functionCall) || b?.type === 'tool_use';
215
227
  });
216
228
  }
217
229
  return false;
218
230
  }
219
231
  function responseHasFinishReason(response) {
220
- if (!response || typeof response !== "object")
232
+ if (!response || typeof response !== 'object')
221
233
  return false;
222
234
  const resp = response;
223
235
  if (Array.isArray(resp.candidates)) {
224
236
  return resp.candidates.some((candidate) => {
225
237
  const cand = candidate;
226
- return typeof cand?.finishReason === "string" && cand.finishReason.length > 0;
238
+ return (typeof cand?.finishReason === 'string' && cand.finishReason.length > 0);
227
239
  });
228
240
  }
229
241
  const stopReason = resp.stopReason ?? resp.stop_reason;
230
- return typeof stopReason === "string" && stopReason.length > 0;
242
+ return typeof stopReason === 'string' && stopReason.length > 0;
231
243
  }
232
244
  function transformSseLineWithMetadata(line, signatureStore, thoughtBuffer, sentThinkingBuffer, callbacks, options, debugState, usageState) {
233
245
  if (!line.startsWith('data:')) {
@@ -249,17 +261,27 @@ function transformSseLineWithMetadata(line, signatureStore, thoughtBuffer, sentT
249
261
  if (usageState) {
250
262
  const resp = parsed.response;
251
263
  const meta = resp.usageMetadata;
252
- if (meta && typeof meta === "object") {
264
+ if (meta && typeof meta === 'object') {
253
265
  usageState.lastUsage = {
254
- cachedContentTokenCount: typeof meta.cachedContentTokenCount === "number" ? meta.cachedContentTokenCount : 0,
255
- promptTokenCount: typeof meta.promptTokenCount === "number" ? meta.promptTokenCount : 0,
256
- candidatesTokenCount: typeof meta.candidatesTokenCount === "number" ? meta.candidatesTokenCount : 0,
257
- totalTokenCount: typeof meta.totalTokenCount === "number" ? meta.totalTokenCount : 0,
266
+ cachedContentTokenCount: typeof meta.cachedContentTokenCount === 'number'
267
+ ? meta.cachedContentTokenCount
268
+ : 0,
269
+ promptTokenCount: typeof meta.promptTokenCount === 'number'
270
+ ? meta.promptTokenCount
271
+ : 0,
272
+ candidatesTokenCount: typeof meta.candidatesTokenCount === 'number'
273
+ ? meta.candidatesTokenCount
274
+ : 0,
275
+ totalTokenCount: typeof meta.totalTokenCount === 'number'
276
+ ? meta.totalTokenCount
277
+ : 0,
258
278
  };
259
279
  }
260
280
  }
261
281
  let response = deduplicateThinkingText(parsed.response, sentThinkingBuffer, options.displayedThinkingHashes);
262
- if (options.debugText && callbacks.onInjectDebug && !debugState.injected) {
282
+ if (options.debugText &&
283
+ callbacks.onInjectDebug &&
284
+ !debugState.injected) {
263
285
  response = callbacks.onInjectDebug(response, options.debugText);
264
286
  debugState.injected = true;
265
287
  }
@@ -267,11 +289,15 @@ function transformSseLineWithMetadata(line, signatureStore, thoughtBuffer, sentT
267
289
  const transformed = callbacks.transformThinkingParts
268
290
  ? callbacks.transformThinkingParts(response)
269
291
  : response;
270
- return { line: `data: ${JSON.stringify(transformed)}`, hasToolCall, hasFinishReason };
292
+ return {
293
+ line: `data: ${JSON.stringify(transformed)}`,
294
+ hasToolCall,
295
+ hasFinishReason,
296
+ };
271
297
  }
272
298
  }
273
299
  catch (_) {
274
- console.warn("[antigravity] Malformed SSE chunk in streaming transform, passing through untransformed:", json.slice(0, 200));
300
+ console.warn('[antigravity] Malformed SSE chunk in streaming transform, passing through untransformed:', json.slice(0, 200));
275
301
  }
276
302
  return { line, hasToolCall: false, hasFinishReason: false };
277
303
  }
@@ -293,7 +319,11 @@ export function cacheThinkingSignaturesFromResponse(response, signatureSessionKe
293
319
  content.parts.forEach((part) => {
294
320
  const p = part;
295
321
  if (p.thought === true || p.type === 'thinking') {
296
- const text = typeof p.text === "string" ? p.text : typeof p.thinking === "string" ? p.thinking : "";
322
+ const text = typeof p.text === 'string'
323
+ ? p.text
324
+ : typeof p.thinking === 'string'
325
+ ? p.thinking
326
+ : '';
297
327
  if (text) {
298
328
  const current = thoughtBuffer.get(index) ?? '';
299
329
  thoughtBuffer.set(index, current + text);
@@ -304,7 +334,10 @@ export function cacheThinkingSignaturesFromResponse(response, signatureSessionKe
304
334
  if (fullText) {
305
335
  const signature = p.thoughtSignature;
306
336
  onCacheSignature?.(signatureSessionKey, fullText, signature);
307
- signatureStore.set(signatureSessionKey, { text: fullText, signature });
337
+ signatureStore.set(signatureSessionKey, {
338
+ text: fullText,
339
+ signature,
340
+ });
308
341
  }
309
342
  }
310
343
  });
@@ -317,7 +350,11 @@ export function cacheThinkingSignaturesFromResponse(response, signatureSessionKe
317
350
  resp.content.forEach((block) => {
318
351
  const b = block;
319
352
  if (b?.type === 'thinking') {
320
- const text = typeof b.thinking === "string" ? b.thinking : typeof b.text === "string" ? b.text : "";
353
+ const text = typeof b.thinking === 'string'
354
+ ? b.thinking
355
+ : typeof b.text === 'string'
356
+ ? b.text
357
+ : '';
321
358
  if (text) {
322
359
  const current = thoughtBuffer.get(CLAUDE_BUFFER_KEY) ?? '';
323
360
  thoughtBuffer.set(CLAUDE_BUFFER_KEY, current + text);
@@ -344,7 +381,9 @@ export function createStreamingTransformer(signatureStore, callbacks, options =
344
381
  let hasSeenUsageMetadata = false;
345
382
  let terminatedAfterFinishReason = false;
346
383
  const pendingUsageLines = [];
347
- const usageState = { lastUsage: null };
384
+ const usageState = {
385
+ lastUsage: null,
386
+ };
348
387
  const emitSyntheticUsageIfMissing = (controller) => {
349
388
  if (hasSeenUsageMetadata)
350
389
  return;
@@ -354,8 +393,8 @@ export function createStreamingTransformer(signatureStore, callbacks, options =
354
393
  promptTokenCount: 0,
355
394
  candidatesTokenCount: 0,
356
395
  totalTokenCount: 0,
357
- }
358
- }
396
+ },
397
+ },
359
398
  };
360
399
  controller.enqueue(encoder.encode(`\ndata: ${JSON.stringify(syntheticUsage)}\n\n`));
361
400
  hasSeenUsageMetadata = true;
@@ -375,7 +414,7 @@ export function createStreamingTransformer(signatureStore, callbacks, options =
375
414
  }
376
415
  };
377
416
  const processLine = (line, controller, suffix) => {
378
- if (pendingUsageLines.length > 0 && line.trim() === "") {
417
+ if (pendingUsageLines.length > 0 && line.trim() === '') {
379
418
  const lastPending = pendingUsageLines[pendingUsageLines.length - 1];
380
419
  if (lastPending)
381
420
  lastPending.suffix += suffix;
@@ -389,7 +428,9 @@ export function createStreamingTransformer(signatureStore, callbacks, options =
389
428
  emitPendingUsageLines(controller);
390
429
  }
391
430
  const lineUsage = extractUsageMetadataFromDataLine(result.line);
392
- if (!result.hasFinishReason && lineUsage && !usageMetadataHasCacheRead(lineUsage)) {
431
+ if (!result.hasFinishReason &&
432
+ lineUsage &&
433
+ !usageMetadataHasCacheRead(lineUsage)) {
393
434
  // Gemini often reports partial usage on the content/functionCall event,
394
435
  // then reports cachedContentTokenCount only on the terminal STOP event.
395
436
  // Some OpenCode/AI SDK paths attach step usage from the latest content