@cortexkit/opencode-antigravity-auth 1.1.0 → 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 (371) hide show
  1. package/README.md +225 -569
  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 +18767 -13829
  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 -256
  38. package/dist/src/plugin/accounts.d.ts.map +1 -1
  39. package/dist/src/plugin/accounts.js +31 -1367
  40. package/dist/src/plugin/accounts.js.map +1 -1
  41. package/dist/src/plugin/agy-request-metadata.d.ts +1 -1
  42. package/dist/src/plugin/agy-request-metadata.js +1 -1
  43. package/dist/src/plugin/agy-transport.d.ts +1 -1
  44. package/dist/src/plugin/agy-transport.js +1 -1
  45. package/dist/src/plugin/auth-doctor.d.ts +6 -6
  46. package/dist/src/plugin/auth-doctor.d.ts.map +1 -1
  47. package/dist/src/plugin/auth-doctor.js +74 -66
  48. package/dist/src/plugin/auth-doctor.js.map +1 -1
  49. package/dist/src/plugin/auth-drift.d.ts +4 -4
  50. package/dist/src/plugin/auth-drift.d.ts.map +1 -1
  51. package/dist/src/plugin/auth-drift.js +15 -15
  52. package/dist/src/plugin/auth-drift.js.map +1 -1
  53. package/dist/src/plugin/auth-loader.d.ts +35 -0
  54. package/dist/src/plugin/auth-loader.d.ts.map +1 -0
  55. package/dist/src/plugin/auth-loader.js +144 -0
  56. package/dist/src/plugin/auth-loader.js.map +1 -0
  57. package/dist/src/plugin/auth.d.ts +1 -1
  58. package/dist/src/plugin/auth.js +1 -1
  59. package/dist/src/plugin/cache/index.d.ts +1 -1
  60. package/dist/src/plugin/cache/index.d.ts.map +1 -1
  61. package/dist/src/plugin/cache/index.js +1 -1
  62. package/dist/src/plugin/cache/index.js.map +1 -1
  63. package/dist/src/plugin/cache/signature-cache.d.ts +1 -1
  64. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
  65. package/dist/src/plugin/cache/signature-cache.js +23 -24
  66. package/dist/src/plugin/cache/signature-cache.js.map +1 -1
  67. package/dist/src/plugin/cache.d.ts +6 -5
  68. package/dist/src/plugin/cache.d.ts.map +1 -1
  69. package/dist/src/plugin/cache.js +21 -7
  70. package/dist/src/plugin/cache.js.map +1 -1
  71. package/dist/src/plugin/catalog.d.ts +23 -0
  72. package/dist/src/plugin/catalog.d.ts.map +1 -0
  73. package/dist/src/plugin/catalog.js +60 -0
  74. package/dist/src/plugin/catalog.js.map +1 -0
  75. package/dist/src/plugin/cli.d.ts +7 -7
  76. package/dist/src/plugin/cli.d.ts.map +1 -1
  77. package/dist/src/plugin/cli.js +62 -55
  78. package/dist/src/plugin/cli.js.map +1 -1
  79. package/dist/src/plugin/command-data.d.ts +276 -0
  80. package/dist/src/plugin/command-data.d.ts.map +1 -0
  81. package/dist/src/plugin/command-data.js +325 -0
  82. package/dist/src/plugin/command-data.js.map +1 -0
  83. package/dist/src/plugin/commands.d.ts +151 -0
  84. package/dist/src/plugin/commands.d.ts.map +1 -0
  85. package/dist/src/plugin/commands.js +639 -0
  86. package/dist/src/plugin/commands.js.map +1 -0
  87. package/dist/src/plugin/config/index.d.ts +2 -2
  88. package/dist/src/plugin/config/index.d.ts.map +1 -1
  89. package/dist/src/plugin/config/index.js +2 -2
  90. package/dist/src/plugin/config/index.js.map +1 -1
  91. package/dist/src/plugin/config/loader.d.ts +1 -1
  92. package/dist/src/plugin/config/loader.d.ts.map +1 -1
  93. package/dist/src/plugin/config/loader.js +18 -16
  94. package/dist/src/plugin/config/loader.js.map +1 -1
  95. package/dist/src/plugin/config/models.d.ts +2 -2
  96. package/dist/src/plugin/config/models.d.ts.map +1 -1
  97. package/dist/src/plugin/config/models.js +1 -1
  98. package/dist/src/plugin/config/models.js.map +1 -1
  99. package/dist/src/plugin/config/operator-settings-schema.d.ts +29 -0
  100. package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
  101. package/dist/src/plugin/config/operator-settings-schema.js +28 -0
  102. package/dist/src/plugin/config/operator-settings-schema.js.map +1 -0
  103. package/dist/src/plugin/config/schema.d.ts +21 -2
  104. package/dist/src/plugin/config/schema.d.ts.map +1 -1
  105. package/dist/src/plugin/config/schema.js +85 -25
  106. package/dist/src/plugin/config/schema.js.map +1 -1
  107. package/dist/src/plugin/config/updater.d.ts.map +1 -1
  108. package/dist/src/plugin/config/updater.js +15 -15
  109. package/dist/src/plugin/config/updater.js.map +1 -1
  110. package/dist/src/plugin/config/writer.d.ts +34 -0
  111. package/dist/src/plugin/config/writer.d.ts.map +1 -0
  112. package/dist/src/plugin/config/writer.js +81 -0
  113. package/dist/src/plugin/config/writer.js.map +1 -0
  114. package/dist/src/plugin/core/streaming/index.d.ts +1 -1
  115. package/dist/src/plugin/core/streaming/index.d.ts.map +1 -1
  116. package/dist/src/plugin/core/streaming/index.js +1 -1
  117. package/dist/src/plugin/core/streaming/index.js.map +1 -1
  118. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
  119. package/dist/src/plugin/core/streaming/transformer.js +85 -44
  120. package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
  121. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
  122. package/dist/src/plugin/debug.d.ts +3 -3
  123. package/dist/src/plugin/debug.d.ts.map +1 -1
  124. package/dist/src/plugin/debug.js +85 -47
  125. package/dist/src/plugin/debug.js.map +1 -1
  126. package/dist/src/plugin/dependencies.d.ts +129 -0
  127. package/dist/src/plugin/dependencies.d.ts.map +1 -0
  128. package/dist/src/plugin/dependencies.js +107 -0
  129. package/dist/src/plugin/dependencies.js.map +1 -0
  130. package/dist/src/plugin/errors.d.ts +27 -0
  131. package/dist/src/plugin/errors.d.ts.map +1 -1
  132. package/dist/src/plugin/errors.js +29 -3
  133. package/dist/src/plugin/errors.js.map +1 -1
  134. package/dist/src/plugin/event-handler.d.ts +53 -0
  135. package/dist/src/plugin/event-handler.d.ts.map +1 -0
  136. package/dist/src/plugin/event-handler.js +101 -0
  137. package/dist/src/plugin/event-handler.js.map +1 -0
  138. package/dist/src/plugin/fetch/retry-state.d.ts +61 -0
  139. package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -0
  140. package/dist/src/plugin/fetch/retry-state.js +248 -0
  141. package/dist/src/plugin/fetch/retry-state.js.map +1 -0
  142. package/dist/src/plugin/fetch/warmup.d.ts +30 -0
  143. package/dist/src/plugin/fetch/warmup.d.ts.map +1 -0
  144. package/dist/src/plugin/fetch/warmup.js +76 -0
  145. package/dist/src/plugin/fetch/warmup.js.map +1 -0
  146. package/dist/src/plugin/fetch-interceptor.d.ts +59 -0
  147. package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -0
  148. package/dist/src/plugin/fetch-interceptor.js +1387 -0
  149. package/dist/src/plugin/fetch-interceptor.js.map +1 -0
  150. package/dist/src/plugin/fetch-routing.d.ts +26 -0
  151. package/dist/src/plugin/fetch-routing.d.ts.map +1 -0
  152. package/dist/src/plugin/fetch-routing.js +99 -0
  153. package/dist/src/plugin/fetch-routing.js.map +1 -0
  154. package/dist/src/plugin/fingerprint.d.ts +1 -1
  155. package/dist/src/plugin/fingerprint.js +1 -1
  156. package/dist/src/plugin/gemini-dump.d.ts +5 -5
  157. package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
  158. package/dist/src/plugin/gemini-dump.js +109 -55
  159. package/dist/src/plugin/gemini-dump.js.map +1 -1
  160. package/dist/src/plugin/google-search-tool.d.ts +9 -0
  161. package/dist/src/plugin/google-search-tool.d.ts.map +1 -0
  162. package/dist/src/plugin/google-search-tool.js +56 -0
  163. package/dist/src/plugin/google-search-tool.js.map +1 -0
  164. package/dist/src/plugin/image-saver.d.ts.map +1 -1
  165. package/dist/src/plugin/image-saver.js +16 -16
  166. package/dist/src/plugin/image-saver.js.map +1 -1
  167. package/dist/src/plugin/index.d.ts +23 -0
  168. package/dist/src/plugin/index.d.ts.map +1 -0
  169. package/dist/src/plugin/index.js +308 -0
  170. package/dist/src/plugin/index.js.map +1 -0
  171. package/dist/src/plugin/killswitch.d.ts +94 -0
  172. package/dist/src/plugin/killswitch.d.ts.map +1 -0
  173. package/dist/src/plugin/killswitch.js +194 -0
  174. package/dist/src/plugin/killswitch.js.map +1 -0
  175. package/dist/src/plugin/lifecycle.d.ts +40 -0
  176. package/dist/src/plugin/lifecycle.d.ts.map +1 -0
  177. package/dist/src/plugin/lifecycle.js +73 -0
  178. package/dist/src/plugin/lifecycle.js.map +1 -0
  179. package/dist/src/plugin/logger.d.ts +10 -1
  180. package/dist/src/plugin/logger.d.ts.map +1 -1
  181. package/dist/src/plugin/logger.js +38 -12
  182. package/dist/src/plugin/logger.js.map +1 -1
  183. package/dist/src/plugin/logging-utils.d.ts +35 -1
  184. package/dist/src/plugin/logging-utils.d.ts.map +1 -1
  185. package/dist/src/plugin/logging-utils.js +98 -15
  186. package/dist/src/plugin/logging-utils.js.map +1 -1
  187. package/dist/src/plugin/model-registry.d.ts +1 -1
  188. package/dist/src/plugin/model-registry.js +1 -1
  189. package/dist/src/plugin/oauth-login.d.ts +22 -0
  190. package/dist/src/plugin/oauth-login.d.ts.map +1 -0
  191. package/dist/src/plugin/oauth-login.js +37 -0
  192. package/dist/src/plugin/oauth-login.js.map +1 -0
  193. package/dist/src/plugin/oauth-methods.d.ts +42 -0
  194. package/dist/src/plugin/oauth-methods.d.ts.map +1 -0
  195. package/dist/src/plugin/oauth-methods.js +1284 -0
  196. package/dist/src/plugin/oauth-methods.js.map +1 -0
  197. package/dist/src/plugin/operator-settings.d.ts +40 -0
  198. package/dist/src/plugin/operator-settings.d.ts.map +1 -0
  199. package/dist/src/plugin/operator-settings.js +148 -0
  200. package/dist/src/plugin/operator-settings.js.map +1 -0
  201. package/dist/src/plugin/persist-account-pool.d.ts +37 -0
  202. package/dist/src/plugin/persist-account-pool.d.ts.map +1 -0
  203. package/dist/src/plugin/persist-account-pool.js +142 -0
  204. package/dist/src/plugin/persist-account-pool.js.map +1 -0
  205. package/dist/src/plugin/project.d.ts +1 -1
  206. package/dist/src/plugin/project.js +1 -1
  207. package/dist/src/plugin/prompt-context.d.ts.map +1 -1
  208. package/dist/src/plugin/prompt-context.js +11 -11
  209. package/dist/src/plugin/prompt-context.js.map +1 -1
  210. package/dist/src/plugin/quota.d.ts +97 -41
  211. package/dist/src/plugin/quota.d.ts.map +1 -1
  212. package/dist/src/plugin/quota.js +273 -285
  213. package/dist/src/plugin/quota.js.map +1 -1
  214. package/dist/src/plugin/recovery/constants.d.ts.map +1 -1
  215. package/dist/src/plugin/recovery/constants.js +24 -15
  216. package/dist/src/plugin/recovery/constants.js.map +1 -1
  217. package/dist/src/plugin/recovery/index.d.ts +3 -3
  218. package/dist/src/plugin/recovery/index.d.ts.map +1 -1
  219. package/dist/src/plugin/recovery/index.js +3 -3
  220. package/dist/src/plugin/recovery/index.js.map +1 -1
  221. package/dist/src/plugin/recovery/storage.d.ts +1 -1
  222. package/dist/src/plugin/recovery/storage.d.ts.map +1 -1
  223. package/dist/src/plugin/recovery/storage.js +31 -39
  224. package/dist/src/plugin/recovery/storage.js.map +1 -1
  225. package/dist/src/plugin/recovery/types.d.ts +12 -12
  226. package/dist/src/plugin/recovery/types.d.ts.map +1 -1
  227. package/dist/src/plugin/recovery.d.ts +3 -3
  228. package/dist/src/plugin/recovery.d.ts.map +1 -1
  229. package/dist/src/plugin/recovery.js +62 -58
  230. package/dist/src/plugin/recovery.js.map +1 -1
  231. package/dist/src/plugin/refresh-queue.d.ts +5 -2
  232. package/dist/src/plugin/refresh-queue.d.ts.map +1 -1
  233. package/dist/src/plugin/refresh-queue.js +37 -15
  234. package/dist/src/plugin/refresh-queue.js.map +1 -1
  235. package/dist/src/plugin/request-helpers.d.ts +1 -1
  236. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  237. package/dist/src/plugin/request-helpers.js +451 -352
  238. package/dist/src/plugin/request-helpers.js.map +1 -1
  239. package/dist/src/plugin/request.d.ts +7 -7
  240. package/dist/src/plugin/request.d.ts.map +1 -1
  241. package/dist/src/plugin/request.js +622 -384
  242. package/dist/src/plugin/request.js.map +1 -1
  243. package/dist/src/plugin/rotation.d.ts +1 -168
  244. package/dist/src/plugin/rotation.d.ts.map +1 -1
  245. package/dist/src/plugin/rotation.js +1 -327
  246. package/dist/src/plugin/rotation.js.map +1 -1
  247. package/dist/src/plugin/search.d.ts.map +1 -1
  248. package/dist/src/plugin/search.js +39 -35
  249. package/dist/src/plugin/search.js.map +1 -1
  250. package/dist/src/plugin/server.d.ts +1 -1
  251. package/dist/src/plugin/server.d.ts.map +1 -1
  252. package/dist/src/plugin/server.js +42 -37
  253. package/dist/src/plugin/server.js.map +1 -1
  254. package/dist/src/plugin/session-context.d.ts +2 -1
  255. package/dist/src/plugin/session-context.d.ts.map +1 -1
  256. package/dist/src/plugin/session-context.js +11 -7
  257. package/dist/src/plugin/session-context.js.map +1 -1
  258. package/dist/src/plugin/storage.d.ts +59 -120
  259. package/dist/src/plugin/storage.d.ts.map +1 -1
  260. package/dist/src/plugin/storage.js +140 -485
  261. package/dist/src/plugin/storage.js.map +1 -1
  262. package/dist/src/plugin/stores/signature-store.d.ts.map +1 -1
  263. package/dist/src/plugin/stores/signature-store.js.map +1 -1
  264. package/dist/src/plugin/thinking-recovery.d.ts.map +1 -1
  265. package/dist/src/plugin/thinking-recovery.js +35 -33
  266. package/dist/src/plugin/thinking-recovery.js.map +1 -1
  267. package/dist/src/plugin/token.d.ts +2 -2
  268. package/dist/src/plugin/token.d.ts.map +1 -1
  269. package/dist/src/plugin/token.js +30 -21
  270. package/dist/src/plugin/token.js.map +1 -1
  271. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +1 -1
  272. package/dist/src/plugin/transform/cross-model-sanitizer.js +1 -1
  273. package/dist/src/plugin/transform/index.d.ts +1 -1
  274. package/dist/src/plugin/transform/index.js +1 -1
  275. package/dist/src/plugin/transform/model-resolver.d.ts +1 -1
  276. package/dist/src/plugin/transform/model-resolver.js +1 -1
  277. package/dist/src/plugin/transform/types.d.ts +1 -1
  278. package/dist/src/plugin/transform/types.js +1 -1
  279. package/dist/src/plugin/types.d.ts +25 -69
  280. package/dist/src/plugin/types.d.ts.map +1 -1
  281. package/dist/src/plugin/ui/ansi.d.ts.map +1 -1
  282. package/dist/src/plugin/ui/ansi.js.map +1 -1
  283. package/dist/src/plugin/ui/auth-menu.d.ts +1 -1
  284. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
  285. package/dist/src/plugin/ui/auth-menu.js +82 -31
  286. package/dist/src/plugin/ui/auth-menu.js.map +1 -1
  287. package/dist/src/plugin/ui/confirm.d.ts.map +1 -1
  288. package/dist/src/plugin/ui/confirm.js.map +1 -1
  289. package/dist/src/plugin/ui/model-status.d.ts +3 -3
  290. package/dist/src/plugin/ui/model-status.d.ts.map +1 -1
  291. package/dist/src/plugin/ui/model-status.js +3 -3
  292. package/dist/src/plugin/ui/model-status.js.map +1 -1
  293. package/dist/src/plugin/ui/quota-status.d.ts +4 -4
  294. package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
  295. package/dist/src/plugin/ui/quota-status.js +51 -49
  296. package/dist/src/plugin/ui/quota-status.js.map +1 -1
  297. package/dist/src/plugin/ui/select.d.ts.map +1 -1
  298. package/dist/src/plugin/ui/select.js +22 -12
  299. package/dist/src/plugin/ui/select.js.map +1 -1
  300. package/dist/src/plugin/version.d.ts +1 -1
  301. package/dist/src/plugin/version.js +1 -1
  302. package/dist/src/rpc/notifications.d.ts +6 -0
  303. package/dist/src/rpc/notifications.d.ts.map +1 -0
  304. package/dist/src/rpc/notifications.js +46 -0
  305. package/dist/src/rpc/notifications.js.map +1 -0
  306. package/dist/src/rpc/port-file.d.ts +13 -0
  307. package/dist/src/rpc/port-file.d.ts.map +1 -0
  308. package/dist/src/rpc/port-file.js +109 -0
  309. package/dist/src/rpc/port-file.js.map +1 -0
  310. package/dist/src/rpc/protocol.d.ts +22 -0
  311. package/dist/src/rpc/protocol.d.ts.map +1 -0
  312. package/dist/src/rpc/protocol.js +1 -0
  313. package/dist/src/rpc/protocol.js.map +1 -0
  314. package/dist/src/rpc/rpc-client.d.ts +10 -0
  315. package/dist/src/rpc/rpc-client.d.ts.map +1 -0
  316. package/dist/src/rpc/rpc-client.js +58 -0
  317. package/dist/src/rpc/rpc-client.js.map +1 -0
  318. package/dist/src/rpc/rpc-dir.d.ts +4 -0
  319. package/dist/src/rpc/rpc-dir.d.ts.map +1 -0
  320. package/dist/src/rpc/rpc-dir.js +19 -0
  321. package/dist/src/rpc/rpc-dir.js.map +1 -0
  322. package/dist/src/rpc/rpc-server.d.ts +13 -0
  323. package/dist/src/rpc/rpc-server.d.ts.map +1 -0
  324. package/dist/src/rpc/rpc-server.js +231 -0
  325. package/dist/src/rpc/rpc-server.js.map +1 -0
  326. package/dist/src/sidebar-state.d.ts +240 -0
  327. package/dist/src/sidebar-state.d.ts.map +1 -0
  328. package/dist/src/sidebar-state.js +520 -0
  329. package/dist/src/sidebar-state.js.map +1 -0
  330. package/dist/src/tui/command-dialogs.d.ts +61 -0
  331. package/dist/src/tui/command-dialogs.d.ts.map +1 -0
  332. package/dist/src/tui/command-dialogs.js +497 -0
  333. package/dist/src/tui/command-dialogs.js.map +1 -0
  334. package/dist/src/tui/file-logger.d.ts +41 -0
  335. package/dist/src/tui/file-logger.d.ts.map +1 -0
  336. package/dist/src/tui/file-logger.js +114 -0
  337. package/dist/src/tui/file-logger.js.map +1 -0
  338. package/dist/src/tui-preferences.d.ts +40 -0
  339. package/dist/src/tui-preferences.d.ts.map +1 -0
  340. package/dist/src/tui-preferences.js +328 -0
  341. package/dist/src/tui-preferences.js.map +1 -0
  342. package/dist/src/tui.d.ts +68 -0
  343. package/dist/src/tui.d.ts.map +1 -0
  344. package/dist/src/tui.js +662 -0
  345. package/dist/src/tui.js.map +1 -0
  346. package/package.json +46 -22
  347. package/src/plugin/command-data.ts +651 -0
  348. package/src/rpc/port-file.ts +143 -0
  349. package/src/rpc/protocol.ts +31 -0
  350. package/src/rpc/rpc-client.ts +102 -0
  351. package/src/rpc/rpc-dir.ts +24 -0
  352. package/src/sidebar-state.ts +717 -0
  353. package/src/tui/command-dialogs.tsx +699 -0
  354. package/src/tui/entry.mjs +74 -0
  355. package/src/tui/file-logger.ts +145 -0
  356. package/src/tui-compiled/plugin/command-data.ts +651 -0
  357. package/src/tui-compiled/rpc/port-file.ts +143 -0
  358. package/src/tui-compiled/rpc/protocol.ts +31 -0
  359. package/src/tui-compiled/rpc/rpc-client.ts +102 -0
  360. package/src/tui-compiled/rpc/rpc-dir.ts +24 -0
  361. package/src/tui-compiled/sidebar-state.ts +717 -0
  362. package/src/tui-compiled/tui/command-dialogs.tsx +659 -0
  363. package/src/tui-compiled/tui/file-logger.ts +145 -0
  364. package/src/tui-compiled/tui-preferences.ts +416 -0
  365. package/src/tui-compiled/tui.tsx +1150 -0
  366. package/src/tui-preferences.ts +416 -0
  367. package/src/tui.tsx +1117 -0
  368. package/dist/src/plugin.d.ts +0 -48
  369. package/dist/src/plugin.d.ts.map +0 -1
  370. package/dist/src/plugin.js +0 -3311
  371. package/dist/src/plugin.js.map +0 -1
@@ -0,0 +1,639 @@
1
+ /**
2
+ * Slash-command wiring for the antigravity plugin.
3
+ *
4
+ * Three places must agree on the set of modal commands — keeping
5
+ * them in lockstep is a hard invariant:
6
+ *
7
+ * 1. `MODAL_COMMANDS` — the canonical list of `CommandModalName`s.
8
+ * 2. `registerAntigravityCommands` (in `./catalog.ts`) — what we
9
+ * register in the host `config.command.*` map so OpenCode
10
+ * recognises them.
11
+ * 3. `buildDialogPayload` (here) — the per-command dialog payload
12
+ * builder the TUI renders when a notification arrives.
13
+ *
14
+ * If any one drifts, a future slash command will be discoverable in
15
+ * the host palette but invisible to the dialog flow (or vice versa).
16
+ * The bidirectional three-wiring test pins this invariant.
17
+ *
18
+ * `/gemini-dump` remains a backward-compatibility alias: the host
19
+ * already registers the command under that name in `OpenCode` and
20
+ * long-running sessions may still call it. The modal name
21
+ * `antigravity-dump` is the canonical name; both stay registered.
22
+ */
23
+ import { isTuiConnected as defaultIsTuiConnected } from '../rpc/notifications';
24
+ import { buildSidebarMachineStateFromAccounts, setSidebarMachineState, } from '../sidebar-state';
25
+ import { executeGeminiDumpCommand, GEMINI_DUMP_COMMAND_NAME, parseGeminiDumpCommandAction, setGeminiDumpEnabled, } from './gemini-dump';
26
+ import { createLogger } from './logger';
27
+ import { createOperatorSettingsController, } from './operator-settings';
28
+ import { resolvePromptContext } from './prompt-context';
29
+ import { AccountStorageUnreadableError } from './storage';
30
+ const log = createLogger('commands');
31
+ export const ANTIGRAVITY_QUOTA_COMMAND_NAME = 'antigravity-quota';
32
+ export const ANTIGRAVITY_ACCOUNT_COMMAND_NAME = 'antigravity-account';
33
+ export const ANTIGRAVITY_ROUTING_COMMAND_NAME = 'antigravity-routing';
34
+ export const ANTIGRAVITY_KILLSWITCH_COMMAND_NAME = 'antigravity-killswitch';
35
+ export const ANTIGRAVITY_DUMP_COMMAND_NAME = 'antigravity-dump';
36
+ export const ANTIGRAVITY_LOGGING_COMMAND_NAME = 'antigravity-logging';
37
+ export const MODAL_COMMANDS = [
38
+ ANTIGRAVITY_QUOTA_COMMAND_NAME,
39
+ ANTIGRAVITY_ACCOUNT_COMMAND_NAME,
40
+ ANTIGRAVITY_ROUTING_COMMAND_NAME,
41
+ ANTIGRAVITY_KILLSWITCH_COMMAND_NAME,
42
+ ANTIGRAVITY_DUMP_COMMAND_NAME,
43
+ ANTIGRAVITY_LOGGING_COMMAND_NAME,
44
+ ];
45
+ const HANDLED_COMMAND_SENTINEL = 'ANTIGRAVITY_COMMAND_HANDLED';
46
+ async function sendIgnoredMessage(client, sessionID, text) {
47
+ const session = client.session;
48
+ const promptContext = await resolvePromptContext(client, sessionID);
49
+ const request = {
50
+ path: { id: sessionID },
51
+ body: {
52
+ noReply: true,
53
+ parts: [{ type: 'text', text, ignored: true }],
54
+ ...(promptContext?.agent ? { agent: promptContext.agent } : {}),
55
+ ...(promptContext?.model ? { model: promptContext.model } : {}),
56
+ ...(promptContext?.variant ? { variant: promptContext.variant } : {}),
57
+ },
58
+ };
59
+ if (typeof session?.promptAsync === 'function') {
60
+ await session.promptAsync(request);
61
+ return;
62
+ }
63
+ if (typeof session?.prompt === 'function') {
64
+ await Promise.resolve(session.prompt(request));
65
+ return;
66
+ }
67
+ throw new Error('OpenCode session prompt API is unavailable for ignored replies.');
68
+ }
69
+ function throwHandledCommandSentinel() {
70
+ throw new Error(HANDLED_COMMAND_SENTINEL);
71
+ }
72
+ /**
73
+ * Build the dialog payload the TUI renders for `command`.
74
+ *
75
+ * Each branch produces a self-contained payload the OpenTUI dialog tree
76
+ * can mount without further RPC chatter. The knobs object is the
77
+ * payload-specific metadata (current toggle state, available actions,
78
+ * default values) — knobs are intentionally stringly-typed to keep the
79
+ * dialog code free of per-command schema definitions.
80
+ */
81
+ export async function buildDialogPayload(command, argumentsText, context) {
82
+ switch (command) {
83
+ case 'antigravity-quota': {
84
+ const action = argumentsText.trim().toLowerCase();
85
+ // Opening the quota dialog is cache-only — we render the
86
+ // privacy-safe rows straight from the data service so the user
87
+ // sees the last-known percentages the moment the dialog mounts,
88
+ // with zero network I/O. The Refresh action (handled by
89
+ // `applyCommandInner`) is the only path that performs a live
90
+ // fetch.
91
+ const accounts = context.commandData
92
+ ? await context.commandData.listAccounts()
93
+ : [];
94
+ return {
95
+ command,
96
+ text: 'Antigravity quota',
97
+ knobs: {
98
+ mode: action === 'refresh' ? 'refresh' : 'status',
99
+ accounts,
100
+ },
101
+ };
102
+ }
103
+ case 'antigravity-account': {
104
+ const action = argumentsText.trim().toLowerCase();
105
+ return {
106
+ command,
107
+ text: 'Antigravity accounts',
108
+ knobs: {
109
+ action: action === 'add' ||
110
+ action === 'refresh' ||
111
+ action === 'remove' ||
112
+ action === 'list'
113
+ ? action
114
+ : 'list',
115
+ },
116
+ };
117
+ }
118
+ case 'antigravity-routing': {
119
+ const settings = context.settings.get();
120
+ const parsed = parseToggleArguments(argumentsText);
121
+ // State-first: the opening payload reports the CURRENT persisted
122
+ // values (no `!` inversion). Argument overrides still flow through
123
+ // so the slash-command-direct path can pre-stage a value, but the
124
+ // fallback when no argument is provided is the actual current
125
+ // state, not its negation. The apply handler returns the complete
126
+ // post-mutation state in `knobs` so the dialog re-renders from
127
+ // the same shape it was opened with.
128
+ return {
129
+ command,
130
+ text: 'Antigravity routing',
131
+ knobs: {
132
+ cli_first: parsed.cli_first ?? settings.routing.cli_first,
133
+ quota_style_fallback: parsed.quota_style_fallback ??
134
+ settings.routing.quota_style_fallback,
135
+ timeoutMs: 2_000,
136
+ },
137
+ };
138
+ }
139
+ case 'antigravity-killswitch': {
140
+ const settings = context.settings.get();
141
+ const parsed = parseKillswitchArguments(argumentsText);
142
+ // State-first: opening reports the current killswitch shape
143
+ // (`enabled`, `minimum_remaining_percent`, plus the full
144
+ // per-account override map if any keys exist). Argument overrides
145
+ // are honored so the slash-command-direct path stays explicit.
146
+ return {
147
+ command,
148
+ text: 'Antigravity killswitch',
149
+ knobs: {
150
+ enabled: parsed.enabled ?? settings.killswitch.enabled,
151
+ minimum_remaining_percent: parsed.minimum_remaining_percent ??
152
+ settings.killswitch.minimum_remaining_percent,
153
+ accounts: settings.killswitch.accounts ?? {},
154
+ timeoutMs: 2_000,
155
+ },
156
+ };
157
+ }
158
+ case 'antigravity-dump': {
159
+ const action = parseGeminiDumpCommandAction(argumentsText);
160
+ return {
161
+ command,
162
+ text: 'Antigravity wire dump',
163
+ knobs: {
164
+ mode: action.type === 'usage' ? 'status' : action.type,
165
+ },
166
+ };
167
+ }
168
+ case 'antigravity-logging': {
169
+ const level = parseLoggingLevel(argumentsText);
170
+ return {
171
+ command,
172
+ text: 'Antigravity logging',
173
+ knobs: { log_level: level },
174
+ };
175
+ }
176
+ default: {
177
+ const exhaustiveCheck = command;
178
+ throw new Error(`Unknown command ${exhaustiveCheck}`);
179
+ }
180
+ }
181
+ }
182
+ function parseToggleArguments(input) {
183
+ const result = {};
184
+ for (const part of input.split(/\s+/).filter(Boolean)) {
185
+ const eq = part.indexOf('=');
186
+ if (eq < 0)
187
+ continue;
188
+ const key = part.slice(0, eq).trim().toLowerCase();
189
+ const value = part
190
+ .slice(eq + 1)
191
+ .trim()
192
+ .toLowerCase();
193
+ if (key === 'cli_first' || key === 'cli-first') {
194
+ result.cli_first = value === 'true' || value === '1' || value === 'on';
195
+ }
196
+ else if (key === 'quota_style_fallback' ||
197
+ key === 'quota-style-fallback') {
198
+ result.quota_style_fallback =
199
+ value === 'true' || value === '1' || value === 'on';
200
+ }
201
+ }
202
+ return result;
203
+ }
204
+ function parseKillswitchArguments(input) {
205
+ const result = {};
206
+ for (const part of input.split(/\s+/).filter(Boolean)) {
207
+ const eq = part.indexOf('=');
208
+ if (eq < 0)
209
+ continue;
210
+ const key = part.slice(0, eq).trim().toLowerCase();
211
+ const value = part
212
+ .slice(eq + 1)
213
+ .trim()
214
+ .toLowerCase();
215
+ if (key === 'enabled') {
216
+ result.enabled = value === 'true' || value === '1' || value === 'on';
217
+ }
218
+ else if (key === 'minimum_remaining_percent' ||
219
+ key === 'minimum-remaining-percent') {
220
+ const n = Number.parseFloat(value);
221
+ if (!Number.isNaN(n) && n >= 0 && n <= 100) {
222
+ result.minimum_remaining_percent = n;
223
+ }
224
+ }
225
+ }
226
+ return result;
227
+ }
228
+ function parseLoggingLevel(input) {
229
+ const trimmed = input.trim().toLowerCase();
230
+ if (trimmed === 'error' ||
231
+ trimmed === 'warn' ||
232
+ trimmed === 'info' ||
233
+ trimmed === 'debug' ||
234
+ trimmed === 'trace') {
235
+ return trimmed;
236
+ }
237
+ return 'info';
238
+ }
239
+ /**
240
+ * Parse the slash-command apply argument for `/antigravity-account`.
241
+ *
242
+ * Recognized forms:
243
+ * `<empty>` → `{ kind: 'refresh' }` (keeps the original
244
+ * "manage → refresh" placeholder semantics)
245
+ * `add` → `{ kind: 'add' }`
246
+ * `refresh` → `{ kind: 'refresh' }`
247
+ * `current <n>` → `{ kind: 'current', index: n }`
248
+ * `toggle <n>` → `{ kind: 'toggle', index: n }`
249
+ * `remove <n>` → `{ kind: 'remove', index: n }`
250
+ *
251
+ * `n` is the transient `acct-<index>` position the dialog renders.
252
+ * Negative or non-integer values are rejected; out-of-range indices
253
+ * are accepted here and rejected by the data service so the dialog
254
+ * can surface the error text.
255
+ */
256
+ function parseAccountAction(input) {
257
+ const trimmed = input.trim();
258
+ if (!trimmed)
259
+ return { kind: 'refresh' };
260
+ const parts = trimmed.split(/\s+/).filter(Boolean);
261
+ const head = parts[0]?.toLowerCase();
262
+ if (head === 'add')
263
+ return { kind: 'add' };
264
+ if (head === 'refresh')
265
+ return { kind: 'refresh' };
266
+ if (head === 'current' || head === 'toggle' || head === 'remove') {
267
+ const raw = parts[1];
268
+ if (raw === undefined)
269
+ return undefined;
270
+ const index = Number.parseInt(raw, 10);
271
+ if (!Number.isInteger(index) || index < 0)
272
+ return undefined;
273
+ return { kind: head, index };
274
+ }
275
+ return undefined;
276
+ }
277
+ /**
278
+ * Apply the result of a TUI dialog back to the plugin runtime.
279
+ *
280
+ * Most commands mutate persistent operator settings (routing toggles,
281
+ * killswitch thresholds, log level). Account add/refresh kicks off the
282
+ * OAuth flow which can take up to two minutes on a fresh login — that
283
+ * path opts into a 120s RPC timeout. Status / toggle paths keep the
284
+ * default 2s timeout.
285
+ *
286
+ * The TUI's imperative dispatcher (`tui/command-dialogs.openCommandDialog`)
287
+ * forwards the apply `options.timeoutMs` knob into the RPC apply call
288
+ * so a long-running path (account add / refresh) can opt in without the
289
+ * dialog layer having to special-case it.
290
+ */
291
+ export async function applyCommand(request, context) {
292
+ const result = await applyCommandInner(request, context);
293
+ // Push a sidebar refresh after every mutation so the TUI's next poll
294
+ // sees a fresh `checkedAt`. The refresher is optional; tests and
295
+ // read-only contexts leave it undefined and skip the write entirely.
296
+ if (context.onApplied) {
297
+ await Promise.resolve(context.onApplied()).catch(() => {
298
+ // Sidebar refresh must never break the command's apply response.
299
+ });
300
+ }
301
+ return result;
302
+ }
303
+ async function runAccountMutation(context, call) {
304
+ if (!context.commandData) {
305
+ return {
306
+ kind: 'error',
307
+ text: 'Command data service is not wired; account mutations are disabled.',
308
+ };
309
+ }
310
+ try {
311
+ const rows = await call();
312
+ if (rows == null)
313
+ return { kind: 'not-found' };
314
+ return { kind: 'rows', rows };
315
+ }
316
+ catch (error) {
317
+ if (error instanceof AccountStorageUnreadableError) {
318
+ log.warn('account mutation: locked storage is unreadable', {
319
+ error: error.message,
320
+ });
321
+ return {
322
+ kind: 'error',
323
+ text: `Account storage is unreadable: ${error.details.reason}. The mutation was not applied.`,
324
+ };
325
+ }
326
+ const message = error instanceof Error ? error.message : String(error);
327
+ log.warn('account mutation failed', { error: message });
328
+ return {
329
+ kind: 'error',
330
+ text: `Account mutation failed: ${message}`,
331
+ };
332
+ }
333
+ }
334
+ function notFoundResult(verb, index) {
335
+ return {
336
+ text: `Cannot ${verb}: account ${index} not found`,
337
+ knobs: { action: verb, timeoutMs: 2_000 },
338
+ };
339
+ }
340
+ function errorResult(verb, text) {
341
+ return {
342
+ text,
343
+ knobs: { action: verb, timeoutMs: 2_000, error: true },
344
+ };
345
+ }
346
+ async function applyCommandInner(request, context) {
347
+ switch (request.command) {
348
+ case 'antigravity-quota': {
349
+ // `refresh` is the only quota apply path; opening is cache-only
350
+ // via `listAccounts`. The data service forces the refresh and
351
+ // returns the freshly persisted rows so the dialog can re-render
352
+ // in place without a second RPC round-trip.
353
+ const accounts = context.commandData
354
+ ? await context.commandData.refreshQuota()
355
+ : [];
356
+ return {
357
+ text: 'Quota refreshed',
358
+ knobs: { accounts, timeoutMs: 2_000 },
359
+ };
360
+ }
361
+ case 'antigravity-account': {
362
+ // Apply arguments follow the `<action> <index>` pattern the
363
+ // dialog uses to call back into the apply path:
364
+ // `current <index>` — pin the account as active for every family
365
+ // `toggle <index>` — flip the enabled flag
366
+ // `remove <index>` — drop the account (destructive, confirmed)
367
+ // `add` — backwards-compatible; opens the OAuth flow
368
+ // via the 120s timeout so the dialog can
369
+ // signal "Account add requested" (the OAuth
370
+ // implementation lands in a follow-up task).
371
+ // Bare `add` / `refresh` keep their 120s timeout so the OAuth
372
+ // handshake has room; everything else stays on the 2s default.
373
+ const args = request.arguments.trim();
374
+ const parsed = parseAccountAction(args);
375
+ if (!parsed) {
376
+ return {
377
+ text: `Unknown account action: ${args}`,
378
+ knobs: { action: 'unknown', timeoutMs: 2_000 },
379
+ };
380
+ }
381
+ // The data service drives the locked-storage mutator for the
382
+ // three CRUD mutations; `add` stays a no-op response so the
383
+ // dispatcher keeps its existing 120s RPC timeout contract.
384
+ //
385
+ // The locked-storage write is awaited FIRST (service-side) so a
386
+ // failed disk write never leaves the runtime ahead of disk. When
387
+ // that await throws — AccountStorageUnreadableError, lock
388
+ // contention, I/O — we catch here and surface the message as the
389
+ // apply's `text`. The dialog toasts that text and stays mounted
390
+ // (the `clear()` is gated on `apply returning rows`).
391
+ if (parsed.kind === 'current') {
392
+ const result = await runAccountMutation(context, () => context.commandData?.setCurrentAccount(parsed.index));
393
+ if (result.kind === 'not-found') {
394
+ return notFoundResult('set current', parsed.index);
395
+ }
396
+ if (result.kind === 'error') {
397
+ return errorResult('current', result.text);
398
+ }
399
+ return {
400
+ text: 'Current account updated',
401
+ knobs: {
402
+ accounts: result.rows,
403
+ action: 'current',
404
+ timeoutMs: 2_000,
405
+ },
406
+ };
407
+ }
408
+ if (parsed.kind === 'toggle') {
409
+ const result = await runAccountMutation(context, () => context.commandData?.toggleAccountEnabled(parsed.index));
410
+ if (result.kind === 'not-found') {
411
+ return notFoundResult('toggle', parsed.index);
412
+ }
413
+ if (result.kind === 'error') {
414
+ return errorResult('toggle', result.text);
415
+ }
416
+ return {
417
+ text: 'Account enabled state updated',
418
+ knobs: {
419
+ accounts: result.rows,
420
+ action: 'toggle',
421
+ timeoutMs: 2_000,
422
+ },
423
+ };
424
+ }
425
+ if (parsed.kind === 'remove') {
426
+ const result = await runAccountMutation(context, () => context.commandData?.removeAccount(parsed.index));
427
+ if (result.kind === 'not-found') {
428
+ return notFoundResult('remove', parsed.index);
429
+ }
430
+ if (result.kind === 'error') {
431
+ return errorResult('remove', result.text);
432
+ }
433
+ return {
434
+ text: 'Account removed',
435
+ knobs: {
436
+ accounts: result.rows,
437
+ action: 'remove',
438
+ timeoutMs: 2_000,
439
+ },
440
+ };
441
+ }
442
+ // `add` (and `refresh`) — backwards-compatible no-op response
443
+ // that keeps the 120s RPC timeout for the future OAuth path.
444
+ return {
445
+ text: `Account ${parsed.kind} requested`,
446
+ knobs: { action: parsed.kind, timeoutMs: 120_000 },
447
+ };
448
+ }
449
+ case 'antigravity-routing': {
450
+ const parsed = parseToggleArguments(request.arguments);
451
+ try {
452
+ await context.settings.update((draft) => {
453
+ if (parsed.cli_first !== undefined) {
454
+ draft.routing.cli_first = parsed.cli_first;
455
+ }
456
+ if (parsed.quota_style_fallback !== undefined) {
457
+ draft.routing.quota_style_fallback = parsed.quota_style_fallback;
458
+ }
459
+ });
460
+ }
461
+ catch (error) {
462
+ // Lock contention / unreadable config — surface the writer's
463
+ // message so the dialog can toast the real cause and stay
464
+ // mounted (T8/T10 pattern). The runtime view is left untouched
465
+ // because the writer either landed or threw.
466
+ const message = error instanceof Error ? error.message : String(error);
467
+ log.warn('routing update failed', { error: message });
468
+ return {
469
+ text: `Routing update failed: ${message}`,
470
+ knobs: { timeoutMs: 2_000, error: true },
471
+ };
472
+ }
473
+ // Complete persisted state — the dialog re-renders from the same
474
+ // shape `buildDialogPayload` produced on open.
475
+ const after = context.settings.get();
476
+ return {
477
+ text: 'Routing updated',
478
+ knobs: {
479
+ cli_first: after.routing.cli_first,
480
+ quota_style_fallback: after.routing.quota_style_fallback,
481
+ timeoutMs: 2_000,
482
+ },
483
+ };
484
+ }
485
+ case 'antigravity-killswitch': {
486
+ const parsed = parseKillswitchArguments(request.arguments);
487
+ try {
488
+ await context.settings.update((draft) => {
489
+ if (parsed.enabled !== undefined) {
490
+ draft.killswitch.enabled = parsed.enabled;
491
+ }
492
+ if (parsed.minimum_remaining_percent !== undefined) {
493
+ draft.killswitch.minimum_remaining_percent =
494
+ parsed.minimum_remaining_percent;
495
+ }
496
+ });
497
+ }
498
+ catch (error) {
499
+ const message = error instanceof Error ? error.message : String(error);
500
+ log.warn('killswitch update failed', { error: message });
501
+ return {
502
+ text: `Killswitch update failed: ${message}`,
503
+ knobs: { timeoutMs: 2_000, error: true },
504
+ };
505
+ }
506
+ // Complete persisted state — the dialog re-renders the full
507
+ // killswitch shape (enabled, threshold, per-account overrides).
508
+ const after = context.settings.get();
509
+ return {
510
+ text: 'Killswitch updated',
511
+ knobs: {
512
+ enabled: after.killswitch.enabled,
513
+ minimum_remaining_percent: after.killswitch.minimum_remaining_percent,
514
+ accounts: after.killswitch.accounts ?? {},
515
+ timeoutMs: 2_000,
516
+ },
517
+ };
518
+ }
519
+ case 'antigravity-dump': {
520
+ const action = parseGeminiDumpCommandAction(request.arguments);
521
+ if (action.type === 'enable')
522
+ setGeminiDumpEnabled(true);
523
+ else if (action.type === 'disable')
524
+ setGeminiDumpEnabled(false);
525
+ return {
526
+ text: executeGeminiDumpCommand({
527
+ argumentsText: request.arguments,
528
+ }),
529
+ knobs: { timeoutMs: 2_000 },
530
+ };
531
+ }
532
+ case 'antigravity-logging': {
533
+ const level = parseLoggingLevel(request.arguments);
534
+ await context.settings.update((draft) => {
535
+ draft.log_level = level;
536
+ });
537
+ return {
538
+ text: `Logging level set to ${level}`,
539
+ knobs: { log_level: level, timeoutMs: 2_000 },
540
+ };
541
+ }
542
+ default: {
543
+ const exhaustiveCheck = request.command;
544
+ throw new Error(`Unknown command ${exhaustiveCheck}`);
545
+ }
546
+ }
547
+ }
548
+ /**
549
+ * Build a sidebar refresher bound to the supplied account-snapshot provider.
550
+ * The plugin entry passes `lifecycle.getAccountManager()`'s snapshot getter so
551
+ * every `/antigravity-*` apply that mutates persistent state also bumps the
552
+ * sidebar's `checkedAt`. The refresher is best-effort: a lock-contention
553
+ * error or missing manager is swallowed by the caller.
554
+ */
555
+ export function createSidebarRefresher(getAccounts) {
556
+ return async () => {
557
+ const accounts = getAccounts();
558
+ if (!accounts || accounts.length === 0)
559
+ return;
560
+ try {
561
+ await setSidebarMachineState(buildSidebarMachineStateFromAccounts(accounts.map((entry) => ({
562
+ index: entry.index,
563
+ label: entry.label,
564
+ enabled: entry.enabled,
565
+ coolingDownUntil: entry.coolingDownUntil,
566
+ cachedQuota: entry.cachedQuota,
567
+ }))));
568
+ }
569
+ catch {
570
+ // Lock contention is the only realistic failure — sidebar refresh
571
+ // is best-effort and the next periodic writer will catch up.
572
+ }
573
+ };
574
+ }
575
+ /**
576
+ * Hook the host's `command.execute.before` to the modal commands.
577
+ *
578
+ * When a slash command is invoked, we push a notification onto the
579
+ * RPC queue and abort the normal prompt with the same handled
580
+ * sentinel the legacy `/gemini-dump` flow already uses.
581
+ *
582
+ * The `sendIgnoredMessage` fallback only fires when no TUI is
583
+ * listening — the only path that actually consumes the queued
584
+ * message. With a live TUI, push alone is enough; double-sending
585
+ * would otherwise render the command text as a visible chat message
586
+ * alongside the dialog the TUI renders.
587
+ */
588
+ export function createCommandExecuteBefore(client, settings, pushNotification, commandData, connectionState = {
589
+ isTuiConnected: defaultIsTuiConnected,
590
+ }) {
591
+ const context = {
592
+ client,
593
+ sessionID: '',
594
+ settings,
595
+ commandData,
596
+ };
597
+ return async (input) => {
598
+ const command = input.command;
599
+ if (command === GEMINI_DUMP_COMMAND_NAME) {
600
+ const action = parseGeminiDumpCommandAction(input.arguments);
601
+ if (action.type === 'enable' || action.type === 'disable') {
602
+ setGeminiDumpEnabled(action.type === 'enable');
603
+ }
604
+ if (!connectionState.isTuiConnected(input.sessionID)) {
605
+ await sendIgnoredMessage(client, input.sessionID, executeGeminiDumpCommand({ argumentsText: input.arguments }));
606
+ }
607
+ throwHandledCommandSentinel();
608
+ }
609
+ if (command !== ANTIGRAVITY_QUOTA_COMMAND_NAME &&
610
+ command !== ANTIGRAVITY_ACCOUNT_COMMAND_NAME &&
611
+ command !== ANTIGRAVITY_ROUTING_COMMAND_NAME &&
612
+ command !== ANTIGRAVITY_KILLSWITCH_COMMAND_NAME &&
613
+ command !== ANTIGRAVITY_DUMP_COMMAND_NAME &&
614
+ command !== ANTIGRAVITY_LOGGING_COMMAND_NAME) {
615
+ return;
616
+ }
617
+ const payload = await buildDialogPayload(command, input.arguments, {
618
+ ...context,
619
+ sessionID: input.sessionID,
620
+ });
621
+ pushNotification(payload, input.sessionID);
622
+ if (!connectionState.isTuiConnected(input.sessionID)) {
623
+ await sendIgnoredMessage(client, input.sessionID, payload.text);
624
+ }
625
+ throwHandledCommandSentinel();
626
+ };
627
+ }
628
+ /**
629
+ * Backward-compat wrapper that constructs a no-settings `command.execute.before`
630
+ * for tests that don't care about the operator settings controller. Production
631
+ * code wires the real controller via `createAntigravityPlugin`.
632
+ */
633
+ export function createCommandExecuteBeforeForClient(client, commandData) {
634
+ return createCommandExecuteBefore(client, createOperatorSettingsController({
635
+ projectConfigPath: '/dev/null',
636
+ userConfigPath: '/dev/null',
637
+ }), () => undefined, commandData);
638
+ }
639
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/plugin/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EACL,oCAAoC,EACpC,sBAAsB,GACvB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EACL,gCAAgC,GAGjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AAGzD,MAAM,GAAG,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;AAEpC,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAAA;AACjE,MAAM,CAAC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