@cortexkit/opencode-antigravity-auth 3.0.5 → 3.0.7

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 (422) hide show
  1. package/README.md +38 -352
  2. package/dist/cli.js +13757 -12857
  3. package/dist/cli.js.map +4 -4
  4. package/dist/cli.meta.json +1362 -1056
  5. package/dist/index.js +16038 -16162
  6. package/dist/index.js.map +4 -4
  7. package/dist/index.meta.json +1447 -1375
  8. package/dist/server.js +11254 -10921
  9. package/dist/server.js.map +4 -4
  10. package/dist/server.meta.json +1 -1
  11. package/dist/src/auth-method-labels.d.ts +3 -0
  12. package/dist/src/auth-method-labels.d.ts.map +1 -0
  13. package/dist/src/auth-method-labels.js +5 -0
  14. package/dist/src/auth-method-labels.js.map +1 -0
  15. package/dist/src/cli.d.ts +3 -1
  16. package/dist/src/cli.d.ts.map +1 -1
  17. package/dist/src/cli.js +98 -12
  18. package/dist/src/cli.js.map +1 -1
  19. package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +44 -4
  20. package/dist/src/common-auth-embedded/claustrum/consumer.js +134 -2
  21. package/dist/src/common-auth-embedded/claustrum/custody.d.ts +33 -1
  22. package/dist/src/common-auth-embedded/claustrum/custody.js +17 -0
  23. package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
  24. package/dist/src/common-auth-embedded/claustrum/enrollment.js +6 -1
  25. package/dist/src/common-auth-embedded/claustrum/index.d.ts +3 -2
  26. package/dist/src/common-auth-embedded/claustrum/index.js +5 -3
  27. package/dist/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
  28. package/dist/src/common-auth-embedded/claustrum/insula.js +152 -0
  29. package/dist/src/common-auth-embedded/claustrum/roster.d.ts +13 -0
  30. package/dist/src/common-auth-embedded/claustrum/roster.js +33 -3
  31. package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
  32. package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +26 -12
  33. package/dist/src/common-auth-embedded/pi-slot/lock.js +7 -3
  34. package/dist/src/common-auth-embedded/quota/codec.d.ts +2 -0
  35. package/dist/src/common-auth-embedded/quota/codec.js +2 -1
  36. package/dist/src/common-auth-embedded/quota/format.d.ts +40 -3
  37. package/dist/src/common-auth-embedded/quota/format.js +196 -43
  38. package/dist/src/common-auth-embedded/quota/index.d.ts +4 -4
  39. package/dist/src/common-auth-embedded/quota/index.js +2 -2
  40. package/dist/src/common-auth-embedded/quota/map.d.ts +11 -0
  41. package/dist/src/common-auth-embedded/quota/map.js +36 -1
  42. package/dist/src/common-auth-embedded/quota/merge.d.ts +3 -1
  43. package/dist/src/common-auth-embedded/quota/merge.js +21 -5
  44. package/dist/src/common-auth-embedded/quota/projection.d.ts +2 -1
  45. package/dist/src/common-auth-embedded/quota/projection.js +3 -1
  46. package/dist/src/common-auth-embedded/setup/command-error.d.ts +32 -0
  47. package/dist/src/common-auth-embedded/setup/command-error.js +79 -0
  48. package/dist/src/common-auth-embedded/setup/command-runner.js +143 -0
  49. package/dist/src/common-auth-embedded/setup/command.d.ts +3 -0
  50. package/dist/src/common-auth-embedded/setup/command.js +271 -0
  51. package/dist/src/common-auth-embedded/setup/config-write.js +60 -0
  52. package/dist/src/common-auth-embedded/setup/detect.d.ts +6 -0
  53. package/dist/src/common-auth-embedded/setup/detect.js +224 -0
  54. package/dist/src/common-auth-embedded/setup/enroll.js +82 -0
  55. package/dist/src/common-auth-embedded/setup/index.d.ts +6 -0
  56. package/dist/src/common-auth-embedded/setup/index.js +5 -0
  57. package/dist/src/common-auth-embedded/setup/paths.js +33 -0
  58. package/dist/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
  59. package/dist/src/common-auth-embedded/setup/process-fence.js +270 -0
  60. package/dist/src/common-auth-embedded/setup/prompts.js +26 -0
  61. package/dist/src/common-auth-embedded/setup/register.d.ts +11 -0
  62. package/dist/src/common-auth-embedded/setup/register.js +136 -0
  63. package/dist/src/common-auth-embedded/setup/types.d.ts +150 -0
  64. package/dist/src/common-auth-embedded/source-output.json +265 -101
  65. package/dist/src/common-auth-embedded/store/pool.d.ts +1 -1
  66. package/dist/src/common-auth-embedded/store/pool.js +0 -1
  67. package/dist/src/common-auth-embedded/store/refresh-lock.d.ts +0 -1
  68. package/dist/src/common-auth-embedded/store/refresh-lock.js +0 -1
  69. package/dist/src/common-auth-embedded/store/schema.d.ts +2 -0
  70. package/dist/src/common-auth-embedded/store/schema.js +3 -2
  71. package/dist/src/ga/rpc/protocol.d.ts +4 -7
  72. package/dist/src/ga/rpc/protocol.d.ts.map +1 -1
  73. package/dist/src/ga/rpc/protocol.js +5 -13
  74. package/dist/src/ga/rpc/protocol.js.map +1 -1
  75. package/dist/src/ga/server/auth.d.ts +8 -3
  76. package/dist/src/ga/server/auth.d.ts.map +1 -1
  77. package/dist/src/ga/server/auth.js +25 -9
  78. package/dist/src/ga/server/auth.js.map +1 -1
  79. package/dist/src/ga/server/index.d.ts +39 -12
  80. package/dist/src/ga/server/index.d.ts.map +1 -1
  81. package/dist/src/ga/server/index.js +218 -55
  82. package/dist/src/ga/server/index.js.map +1 -1
  83. package/dist/src/ga/server/pool-login.d.ts +22 -0
  84. package/dist/src/ga/server/pool-login.d.ts.map +1 -0
  85. package/dist/src/ga/server/pool-login.js +150 -0
  86. package/dist/src/ga/server/pool-login.js.map +1 -0
  87. package/dist/src/ga/tui/host-ga.d.ts +2 -5
  88. package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
  89. package/dist/src/ga/tui/host-ga.js +54 -52
  90. package/dist/src/ga/tui/host-ga.js.map +1 -1
  91. package/dist/src/plugin/accounts.d.ts +1 -1
  92. package/dist/src/plugin/accounts.d.ts.map +1 -1
  93. package/dist/src/plugin/accounts.js +1 -0
  94. package/dist/src/plugin/accounts.js.map +1 -1
  95. package/dist/src/plugin/background-vault-quota-refresh.d.ts +2 -0
  96. package/dist/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
  97. package/dist/src/plugin/background-vault-quota-refresh.js +125 -10
  98. package/dist/src/plugin/background-vault-quota-refresh.js.map +1 -1
  99. package/dist/src/plugin/command-apply.d.ts +2 -2
  100. package/dist/src/plugin/command-apply.d.ts.map +1 -1
  101. package/dist/src/plugin/command-apply.js +3 -10
  102. package/dist/src/plugin/command-apply.js.map +1 -1
  103. package/dist/src/plugin/commands.d.ts +1 -0
  104. package/dist/src/plugin/commands.d.ts.map +1 -1
  105. package/dist/src/plugin/commands.js +2 -2
  106. package/dist/src/plugin/commands.js.map +1 -1
  107. package/dist/src/plugin/config/operator-settings-schema.d.ts +0 -4
  108. package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -1
  109. package/dist/src/plugin/config/operator-settings-schema.js +0 -5
  110. package/dist/src/plugin/config/operator-settings-schema.js.map +1 -1
  111. package/dist/src/plugin/config/schema.d.ts +0 -7
  112. package/dist/src/plugin/config/schema.d.ts.map +1 -1
  113. package/dist/src/plugin/config/schema.js +2 -44
  114. package/dist/src/plugin/config/schema.js.map +1 -1
  115. package/dist/src/plugin/config/writer.d.ts +1 -1
  116. package/dist/src/plugin/config/writer.js +1 -1
  117. package/dist/src/plugin/fetch/retry-state.d.ts +19 -3
  118. package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -1
  119. package/dist/src/plugin/fetch/retry-state.js +0 -6
  120. package/dist/src/plugin/fetch/retry-state.js.map +1 -1
  121. package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -1
  122. package/dist/src/plugin/fetch-interceptor.js +0 -3
  123. package/dist/src/plugin/fetch-interceptor.js.map +1 -1
  124. package/dist/src/plugin/fetch-routing.d.ts +0 -16
  125. package/dist/src/plugin/fetch-routing.d.ts.map +1 -1
  126. package/dist/src/plugin/fetch-routing.js +0 -49
  127. package/dist/src/plugin/fetch-routing.js.map +1 -1
  128. package/dist/src/plugin/ga-location-services.d.ts +14 -9
  129. package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
  130. package/dist/src/plugin/ga-location-services.js +124 -43
  131. package/dist/src/plugin/ga-location-services.js.map +1 -1
  132. package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
  133. package/dist/src/plugin/gemini-dump.js +2 -5
  134. package/dist/src/plugin/gemini-dump.js.map +1 -1
  135. package/dist/src/plugin/google-origin.d.ts +7 -0
  136. package/dist/src/plugin/google-origin.d.ts.map +1 -0
  137. package/dist/src/plugin/google-origin.js +14 -0
  138. package/dist/src/plugin/google-origin.js.map +1 -0
  139. package/dist/src/plugin/index.d.ts.map +1 -1
  140. package/dist/src/plugin/index.js +18 -7
  141. package/dist/src/plugin/index.js.map +1 -1
  142. package/dist/src/plugin/logging-utils.d.ts.map +1 -1
  143. package/dist/src/plugin/logging-utils.js +2 -5
  144. package/dist/src/plugin/logging-utils.js.map +1 -1
  145. package/dist/src/plugin/oauth-methods.d.ts.map +1 -1
  146. package/dist/src/plugin/oauth-methods.js +0 -33
  147. package/dist/src/plugin/oauth-methods.js.map +1 -1
  148. package/dist/src/plugin/operator-settings.d.ts +1 -1
  149. package/dist/src/plugin/operator-settings.d.ts.map +1 -1
  150. package/dist/src/plugin/operator-settings.js +1 -8
  151. package/dist/src/plugin/operator-settings.js.map +1 -1
  152. package/dist/src/plugin/quota.d.ts +11 -7
  153. package/dist/src/plugin/quota.d.ts.map +1 -1
  154. package/dist/src/plugin/quota.js +128 -102
  155. package/dist/src/plugin/quota.js.map +1 -1
  156. package/dist/src/plugin/request.d.ts +6 -5
  157. package/dist/src/plugin/request.d.ts.map +1 -1
  158. package/dist/src/plugin/request.js +95 -180
  159. package/dist/src/plugin/request.js.map +1 -1
  160. package/dist/src/plugin/server.d.ts.map +1 -1
  161. package/dist/src/plugin/server.js +60 -53
  162. package/dist/src/plugin/server.js.map +1 -1
  163. package/dist/src/plugin/shared/advisory-repository.d.ts +20 -0
  164. package/dist/src/plugin/shared/advisory-repository.d.ts.map +1 -0
  165. package/dist/src/plugin/shared/advisory-repository.js +91 -0
  166. package/dist/src/plugin/shared/advisory-repository.js.map +1 -0
  167. package/dist/src/plugin/shared/request-services.d.ts +27 -26
  168. package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
  169. package/dist/src/plugin/shared/request-services.js +244 -245
  170. package/dist/src/plugin/shared/request-services.js.map +1 -1
  171. package/dist/src/plugin/shared/runtime.js +4 -2
  172. package/dist/src/plugin/shared/runtime.js.map +1 -1
  173. package/dist/src/plugin/shared/vault-request-credentials.d.ts +16 -4
  174. package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
  175. package/dist/src/plugin/shared/vault-request-credentials.js +44 -7
  176. package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
  177. package/dist/src/plugin/storage.d.ts +2 -2
  178. package/dist/src/plugin/storage.d.ts.map +1 -1
  179. package/dist/src/plugin/storage.js.map +1 -1
  180. package/dist/src/plugin/vault-custody.d.ts +14 -1
  181. package/dist/src/plugin/vault-custody.d.ts.map +1 -1
  182. package/dist/src/plugin/vault-custody.js +203 -44
  183. package/dist/src/plugin/vault-custody.js.map +1 -1
  184. package/dist/src/plugin/vault-quota-outcome.d.ts +19 -0
  185. package/dist/src/plugin/vault-quota-outcome.d.ts.map +1 -0
  186. package/dist/src/plugin/vault-quota-outcome.js +47 -0
  187. package/dist/src/plugin/vault-quota-outcome.js.map +1 -0
  188. package/dist/src/quota-presentation.d.ts +29 -1
  189. package/dist/src/quota-presentation.d.ts.map +1 -1
  190. package/dist/src/quota-presentation.js +52 -17
  191. package/dist/src/quota-presentation.js.map +1 -1
  192. package/dist/src/setup.d.ts +15 -0
  193. package/dist/src/setup.d.ts.map +1 -0
  194. package/dist/src/setup.js +320 -0
  195. package/dist/src/setup.js.map +1 -0
  196. package/dist/src/sidebar-projection.d.ts +5 -1
  197. package/dist/src/sidebar-projection.d.ts.map +1 -1
  198. package/dist/src/sidebar-projection.js +6 -2
  199. package/dist/src/sidebar-projection.js.map +1 -1
  200. package/dist/src/sidebar-state.d.ts +1 -1
  201. package/dist/src/sidebar-state.d.ts.map +1 -1
  202. package/dist/src/sidebar-state.js +19 -1
  203. package/dist/src/sidebar-state.js.map +1 -1
  204. package/dist/src/tui/quota-layout.d.ts +94 -0
  205. package/dist/src/tui/quota-layout.d.ts.map +1 -0
  206. package/dist/src/tui/quota-layout.js +139 -0
  207. package/dist/src/tui/quota-layout.js.map +1 -0
  208. package/dist/src/tui/route-layout.d.ts +8 -0
  209. package/dist/src/tui/route-layout.d.ts.map +1 -0
  210. package/dist/src/tui/route-layout.js +36 -0
  211. package/dist/src/tui/route-layout.js.map +1 -0
  212. package/dist/src/tui.d.ts.map +1 -1
  213. package/dist/src/tui.js +120 -127
  214. package/dist/src/tui.js.map +1 -1
  215. package/dist/tui-build-map.json +66 -37
  216. package/dist/tui-ga-build-map.json +66 -37
  217. package/dist/types/src/auth-method-labels.d.ts +3 -0
  218. package/dist/types/src/auth-method-labels.d.ts.map +1 -0
  219. package/dist/types/src/cli.d.ts +3 -1
  220. package/dist/types/src/cli.d.ts.map +1 -1
  221. package/dist/types/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
  222. package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +142 -0
  223. package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +207 -0
  224. package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +164 -0
  225. package/dist/types/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
  226. package/dist/types/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
  227. package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +19 -0
  228. package/dist/types/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
  229. package/dist/types/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
  230. package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +221 -0
  231. package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
  232. package/dist/types/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
  233. package/dist/types/src/common-auth-embedded/opencode2/index.d.ts +8 -0
  234. package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +55 -0
  235. package/dist/types/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
  236. package/dist/types/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
  237. package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +413 -0
  238. package/dist/types/src/common-auth-embedded/quota/codec.d.ts +2 -0
  239. package/dist/types/src/common-auth-embedded/quota/format.d.ts +40 -3
  240. package/dist/types/src/common-auth-embedded/quota/index.d.ts +4 -4
  241. package/dist/types/src/common-auth-embedded/quota/map.d.ts +11 -0
  242. package/dist/types/src/common-auth-embedded/quota/merge.d.ts +3 -1
  243. package/dist/types/src/common-auth-embedded/quota/projection.d.ts +2 -1
  244. package/dist/types/src/common-auth-embedded/routing/admission.d.ts +93 -0
  245. package/dist/types/src/common-auth-embedded/routing/index.d.ts +8 -0
  246. package/dist/types/src/common-auth-embedded/routing/ordered.d.ts +47 -0
  247. package/dist/types/src/common-auth-embedded/routing/pins.d.ts +22 -0
  248. package/dist/types/src/common-auth-embedded/routing/sticky.d.ts +158 -0
  249. package/dist/types/src/common-auth-embedded/setup/command-error.d.ts +32 -0
  250. package/dist/types/src/common-auth-embedded/setup/command.d.ts +3 -0
  251. package/dist/types/src/common-auth-embedded/setup/detect.d.ts +6 -0
  252. package/dist/types/src/common-auth-embedded/setup/index.d.ts +6 -0
  253. package/dist/types/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
  254. package/dist/types/src/common-auth-embedded/setup/register.d.ts +11 -0
  255. package/dist/types/src/common-auth-embedded/setup/types.d.ts +150 -0
  256. package/dist/types/src/common-auth-embedded/store/pool.d.ts +1 -1
  257. package/dist/types/src/common-auth-embedded/store/refresh-lock.d.ts +0 -1
  258. package/dist/types/src/common-auth-embedded/store/schema.d.ts +2 -0
  259. package/dist/types/src/ga/rpc/protocol.d.ts +4 -7
  260. package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -1
  261. package/dist/types/src/ga/server/auth.d.ts +8 -3
  262. package/dist/types/src/ga/server/auth.d.ts.map +1 -1
  263. package/dist/types/src/ga/server/index.d.ts +39 -12
  264. package/dist/types/src/ga/server/index.d.ts.map +1 -1
  265. package/dist/types/src/ga/server/pool-login.d.ts +22 -0
  266. package/dist/types/src/ga/server/pool-login.d.ts.map +1 -0
  267. package/dist/types/src/plugin/accounts.d.ts +1 -1
  268. package/dist/types/src/plugin/accounts.d.ts.map +1 -1
  269. package/dist/types/src/plugin/background-vault-quota-refresh.d.ts +2 -0
  270. package/dist/types/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
  271. package/dist/types/src/plugin/command-apply.d.ts +2 -2
  272. package/dist/types/src/plugin/command-apply.d.ts.map +1 -1
  273. package/dist/types/src/plugin/commands.d.ts +1 -0
  274. package/dist/types/src/plugin/commands.d.ts.map +1 -1
  275. package/dist/types/src/plugin/config/operator-settings-schema.d.ts +0 -4
  276. package/dist/types/src/plugin/config/operator-settings-schema.d.ts.map +1 -1
  277. package/dist/types/src/plugin/config/schema.d.ts +0 -7
  278. package/dist/types/src/plugin/config/schema.d.ts.map +1 -1
  279. package/dist/types/src/plugin/config/writer.d.ts +1 -1
  280. package/dist/types/src/plugin/fetch/retry-state.d.ts +19 -3
  281. package/dist/types/src/plugin/fetch/retry-state.d.ts.map +1 -1
  282. package/dist/types/src/plugin/fetch-interceptor.d.ts.map +1 -1
  283. package/dist/types/src/plugin/fetch-routing.d.ts +0 -16
  284. package/dist/types/src/plugin/fetch-routing.d.ts.map +1 -1
  285. package/dist/types/src/plugin/ga-location-services.d.ts +14 -9
  286. package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
  287. package/dist/types/src/plugin/gemini-dump.d.ts.map +1 -1
  288. package/dist/types/src/plugin/google-origin.d.ts +7 -0
  289. package/dist/types/src/plugin/google-origin.d.ts.map +1 -0
  290. package/dist/types/src/plugin/index.d.ts.map +1 -1
  291. package/dist/types/src/plugin/logging-utils.d.ts.map +1 -1
  292. package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -1
  293. package/dist/types/src/plugin/operator-settings.d.ts +1 -1
  294. package/dist/types/src/plugin/operator-settings.d.ts.map +1 -1
  295. package/dist/types/src/plugin/quota.d.ts +11 -7
  296. package/dist/types/src/plugin/quota.d.ts.map +1 -1
  297. package/dist/types/src/plugin/request.d.ts +6 -5
  298. package/dist/types/src/plugin/request.d.ts.map +1 -1
  299. package/dist/types/src/plugin/server.d.ts.map +1 -1
  300. package/dist/types/src/plugin/shared/advisory-repository.d.ts +20 -0
  301. package/dist/types/src/plugin/shared/advisory-repository.d.ts.map +1 -0
  302. package/dist/types/src/plugin/shared/request-services.d.ts +27 -26
  303. package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
  304. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +16 -4
  305. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
  306. package/dist/types/src/plugin/storage.d.ts +2 -2
  307. package/dist/types/src/plugin/storage.d.ts.map +1 -1
  308. package/dist/types/src/plugin/vault-custody.d.ts +14 -1
  309. package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
  310. package/dist/types/src/plugin/vault-quota-outcome.d.ts +19 -0
  311. package/dist/types/src/plugin/vault-quota-outcome.d.ts.map +1 -0
  312. package/dist/types/src/setup.d.ts +15 -0
  313. package/dist/types/src/setup.d.ts.map +1 -0
  314. package/dist/types/src/sidebar-state.d.ts +1 -1
  315. package/dist/types/src/sidebar-state.d.ts.map +1 -1
  316. package/package.json +5 -4
  317. package/src/common-auth-embedded/claustrum/consumer.d.ts +44 -4
  318. package/src/common-auth-embedded/claustrum/consumer.js +134 -2
  319. package/src/common-auth-embedded/claustrum/custody.d.ts +33 -1
  320. package/src/common-auth-embedded/claustrum/custody.js +17 -0
  321. package/src/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
  322. package/src/common-auth-embedded/claustrum/enrollment.js +6 -1
  323. package/src/common-auth-embedded/claustrum/index.d.ts +3 -2
  324. package/src/common-auth-embedded/claustrum/index.js +5 -3
  325. package/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
  326. package/src/common-auth-embedded/claustrum/insula.js +152 -0
  327. package/src/common-auth-embedded/claustrum/roster.d.ts +13 -0
  328. package/src/common-auth-embedded/claustrum/roster.js +33 -3
  329. package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
  330. package/src/common-auth-embedded/fs/refresh-file-lock.js +26 -12
  331. package/src/common-auth-embedded/pi-slot/lock.js +7 -3
  332. package/src/common-auth-embedded/quota/codec.d.ts +2 -0
  333. package/src/common-auth-embedded/quota/codec.js +2 -1
  334. package/src/common-auth-embedded/quota/format.d.ts +40 -3
  335. package/src/common-auth-embedded/quota/format.js +196 -43
  336. package/src/common-auth-embedded/quota/index.d.ts +4 -4
  337. package/src/common-auth-embedded/quota/index.js +2 -2
  338. package/src/common-auth-embedded/quota/map.d.ts +11 -0
  339. package/src/common-auth-embedded/quota/map.js +36 -1
  340. package/src/common-auth-embedded/quota/merge.d.ts +3 -1
  341. package/src/common-auth-embedded/quota/merge.js +21 -5
  342. package/src/common-auth-embedded/quota/projection.d.ts +2 -1
  343. package/src/common-auth-embedded/quota/projection.js +3 -1
  344. package/src/common-auth-embedded/setup/command-error.d.ts +32 -0
  345. package/src/common-auth-embedded/setup/command-error.js +79 -0
  346. package/src/common-auth-embedded/setup/command-runner.js +143 -0
  347. package/src/common-auth-embedded/setup/command.d.ts +3 -0
  348. package/src/common-auth-embedded/setup/command.js +271 -0
  349. package/src/common-auth-embedded/setup/config-write.js +60 -0
  350. package/src/common-auth-embedded/setup/detect.d.ts +6 -0
  351. package/src/common-auth-embedded/setup/detect.js +224 -0
  352. package/src/common-auth-embedded/setup/enroll.js +82 -0
  353. package/src/common-auth-embedded/setup/index.d.ts +6 -0
  354. package/src/common-auth-embedded/setup/index.js +5 -0
  355. package/src/common-auth-embedded/setup/paths.js +33 -0
  356. package/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
  357. package/src/common-auth-embedded/setup/process-fence.js +270 -0
  358. package/src/common-auth-embedded/setup/prompts.js +26 -0
  359. package/src/common-auth-embedded/setup/register.d.ts +11 -0
  360. package/src/common-auth-embedded/setup/register.js +136 -0
  361. package/src/common-auth-embedded/setup/types.d.ts +150 -0
  362. package/src/common-auth-embedded/source-output.json +265 -101
  363. package/src/common-auth-embedded/store/pool.d.ts +1 -1
  364. package/src/common-auth-embedded/store/pool.js +0 -1
  365. package/src/common-auth-embedded/store/refresh-lock.d.ts +0 -1
  366. package/src/common-auth-embedded/store/refresh-lock.js +0 -1
  367. package/src/common-auth-embedded/store/schema.d.ts +2 -0
  368. package/src/common-auth-embedded/store/schema.js +3 -2
  369. package/src/sidebar-state.ts +19 -2
  370. package/src/tui-compiled/common-auth-embedded/quota/codec.js +2 -1
  371. package/src/tui-compiled/common-auth-embedded/quota/format.js +196 -43
  372. package/src/tui-compiled/common-auth-embedded/quota/index.js +2 -2
  373. package/src/tui-compiled/common-auth-embedded/quota/map.js +36 -1
  374. package/src/tui-compiled/common-auth-embedded/quota/merge.js +21 -5
  375. package/src/tui-compiled/common-auth-embedded/quota/projection.js +3 -1
  376. package/src/tui-compiled/quota-presentation.js +42 -9
  377. package/src/tui-compiled/sidebar-state.js +15 -1
  378. package/src/tui-compiled/tui/quota-layout.js +378 -0
  379. package/src/tui-compiled/tui/route-layout.js +30 -0
  380. package/src/tui-compiled/tui.js +271 -371
  381. package/src/tui-ga-compiled/host-ga.js +93 -90
  382. package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +3 -1
  383. package/src/tui-ga-compiled/shared/6ca47cd4ec33fe72-route-layout.js +30 -0
  384. package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +36 -1
  385. package/src/tui-ga-compiled/shared/8ae1927e5910ea81-sidebar-projection.js +2 -2
  386. package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
  387. package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +196 -43
  388. package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +2 -2
  389. package/src/tui-ga-compiled/shared/ca21dc417b36dc5d-codec.js +2 -1
  390. package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +378 -0
  391. package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +21 -5
  392. package/src/tui-ga-raw/host-ga.tsx +102 -92
  393. package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +3 -1
  394. package/src/tui-ga-raw/shared/6ca47cd4ec33fe72-route-layout.js +30 -0
  395. package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +36 -1
  396. package/src/tui-ga-raw/shared/8ae1927e5910ea81-sidebar-projection.js +2 -2
  397. package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
  398. package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +196 -43
  399. package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +2 -2
  400. package/src/tui-ga-raw/shared/ca21dc417b36dc5d-codec.js +2 -1
  401. package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +391 -0
  402. package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +21 -5
  403. package/src/tui-raw/common-auth-embedded/quota/codec.js +2 -1
  404. package/src/tui-raw/common-auth-embedded/quota/format.js +196 -43
  405. package/src/tui-raw/common-auth-embedded/quota/index.js +2 -2
  406. package/src/tui-raw/common-auth-embedded/quota/map.js +36 -1
  407. package/src/tui-raw/common-auth-embedded/quota/merge.js +21 -5
  408. package/src/tui-raw/common-auth-embedded/quota/projection.js +3 -1
  409. package/src/tui-raw/quota-presentation.js +42 -9
  410. package/src/tui-raw/sidebar-state.js +15 -1
  411. package/src/tui-raw/tui/quota-layout.tsx +391 -0
  412. package/src/tui-raw/tui/route-layout.js +30 -0
  413. package/src/tui-raw/tui.tsx +218 -272
  414. package/src/tui.tsx +218 -272
  415. package/dist/src/tui/vault-setup.d.ts +0 -98
  416. package/dist/src/tui/vault-setup.d.ts.map +0 -1
  417. package/dist/src/tui/vault-setup.js +0 -198
  418. package/dist/src/tui/vault-setup.js.map +0 -1
  419. package/dist/types/src/plugin/transform/model-resolver.d.ts +0 -2
  420. package/dist/types/src/plugin/transform/model-resolver.d.ts.map +0 -1
  421. package/dist/types/src/quota-presentation.d.ts +0 -18
  422. package/dist/types/src/quota-presentation.d.ts.map +0 -1
@@ -1,5 +1,6 @@
1
- import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
2
1
  import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
2
+ import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
3
+ import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
3
4
  import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
4
5
  import { effect as _$effect } from "opentui:runtime-module:%40opentui%2Fsolid";
5
6
  import { insertNode as _$insertNode } from "opentui:runtime-module:%40opentui%2Fsolid";
@@ -21,16 +22,20 @@ import { createElement as _$createElement } from "opentui:runtime-module:%40open
21
22
  * score, and per-session routing decisions), so the fleet components are
22
23
  * adapted rather than copied verbatim:
23
24
  *
24
- * - `QuotaRow` reads `remainingPercent + resetAt` from the Antigravity
25
- * `SidebarQuotaEntry` shape and colors via `quotaTone` (remaining
26
- * threshold) instead of `usageTone` (used threshold).
25
+ * - The quota rows come from `tui/quota-layout.tsx`, shared with the
26
+ * OpenCode 2 sidebar: each window reads `remainingPercent + resetAt` from
27
+ * the Antigravity `SidebarQuotaEntry` shape, is colored via `quotaTone`
28
+ * (remaining threshold) instead of `usageTone` (used threshold), and is
29
+ * one line sized from the measured sidebar width.
27
30
  * - `AccountBlock` derives its status word (`active` / `idle` /
28
- * `cooling` / `off` / `blocked`) from the Antigravity account state and
29
- * surfaces health as a muted secondary line rather than a top-level
30
- * bar — fleet parity for "Quota first, health second".
31
- * - `Routing` resolves to a single `Route` `StatRow` carrying the most
32
- * recent `activeRouting` entry, since Antigravity does not maintain a
33
- * per-session sidebar state alongside the slot-rendered tree.
31
+ * `cooling` / `off`) from the Antigravity account state; the shared block
32
+ * shows the reading age once per account and groups windows under
33
+ * `Gemini` and `Other models` headers. The routing health score is not
34
+ * shown.
35
+ * - `Routing` shows the mounted session's most recent `activeRouting`
36
+ * entry, or `No request yet` before the session's first request, since
37
+ * Antigravity does not maintain a per-session sidebar state alongside the
38
+ * slot-rendered tree.
34
39
  *
35
40
  * Hard rules for this file:
36
41
  *
@@ -48,11 +53,13 @@ import { dirname, join } from "node:path";
48
53
  import { fileURLToPath } from "node:url";
49
54
  import { createSlot } from "opentui:runtime-module:%40opentui%2Fsolid";
50
55
  import { createSignal, For, onCleanup, onMount, Show } from "opentui:runtime-module:solid-js";
51
- import { formatQuotaReading, quotaReadingParts } from "./quota-presentation.js";
56
+ import { NO_QUOTA_READING } from "./quota-presentation.js";
52
57
  import { getRpcDir } from "./rpc/rpc-dir.js";
53
58
  import { readSidebarState } from "./sidebar-state.js";
54
59
  import { createTuiFileLogger } from "./tui/file-logger.js";
55
60
  import { createV1MenuTransport, dispatchV1Notification } from "./tui/host-v1.js";
61
+ import { ASSUMED_CONTENT_WIDTH, accountWindows, fitLabel, QuotaAccountBlock, quotaTone, RESET_SINCE_READING, showsFigure } from "./tui/quota-layout.js";
62
+ import { routeLineFits } from "./tui/route-layout.js";
56
63
  import { computeEffectiveOrder, DEFAULT_PREFS, DEFAULT_SLOT_ORDER, PLUGIN_KEY, queueTuiPreferenceUpdate, readTuiPreferencesFile, resolveAntigravityAuthPrefs, watchTuiPreferences } from "./tui-preferences.js";
57
64
  const ID = 'cortexkit.antigravity-auth';
58
65
  const POLL_INTERVAL_MS = 2000;
@@ -98,16 +105,12 @@ const dispatchedNotificationIds = new Set();
98
105
  let rpcInFlight = false;
99
106
  const GLOBAL_NOTIFICATION_CURSOR = '__global__';
100
107
  const MAX_NOTIFICATION_CURSORS = 256;
101
- const QUOTA_LABELS = {
102
- gemini: 'Gm',
103
- 'non-gemini': 'NG'
104
- };
105
- const QUOTA_ORDER = ['gemini', 'non-gemini'];
106
- const WINDOW_GUTTER = {
107
- weekly: '7d',
108
- '5h': '5h'
109
- };
110
108
 
109
+ // The collapsed row has room for one word before the window name.
110
+ const COLLAPSED_GROUP_NAMES = {
111
+ gemini: 'Gemini',
112
+ 'non-gemini': 'Other'
113
+ };
111
114
  // --- Theme tokens ----------------------------------------------------------
112
115
  //
113
116
  // The sidebar pulls its colors from the live host theme (`api.theme.current`
@@ -195,22 +198,16 @@ function toneColor(theme, tone) {
195
198
  return theme.text;
196
199
  }
197
200
  }
198
- function quotaTone(usedPct, appearance) {
199
- if (usedPct < appearance.warnThreshold) return 'ok';
200
- if (usedPct < appearance.errorThreshold) return 'warn';
201
- return 'err';
202
- }
203
- function quotaBarSegments(remainingPct, appearance) {
204
- const width = appearance.barWidth;
205
- const usedCells = Math.max(0, Math.min(Math.round(remainingPct / 100 * width), width));
206
- const tone = quotaTone(100 - remainingPct, appearance);
207
- return [{
208
- text: appearance.barFilledChar.repeat(usedCells),
209
- tone
210
- }, {
211
- text: appearance.barEmptyChar.repeat(width - usedCells),
212
- tone
213
- }].filter(segment => segment.text.length > 0);
201
+
202
+ // The shared quota layout reads its colors through this palette. Muted text
203
+ // and the account label read `textMuted` and `text` straight from the theme,
204
+ // without the `toneColor` fallback chain.
205
+ function themePalette(theme) {
206
+ return {
207
+ text: () => theme().text,
208
+ muted: () => theme().textMuted,
209
+ tone: tone => toneColor(theme(), tone)
210
+ };
214
211
  }
215
212
  const EMPTY_STATE = {
216
213
  version: 2,
@@ -314,12 +311,6 @@ function getSidebarController() {
314
311
 
315
312
  // --- Shared helpers (fleet shape, antigravity data) ------------------------
316
313
 
317
- function clamp(value, min, max) {
318
- if (value < min) return min;
319
- if (value > max) return max;
320
- return value;
321
- }
322
-
323
314
  // Render a "reset in Nm/Nh/NdNh" string from an epoch-ms reset time.
324
315
  // Empty string when no resetAt is cached. The fleet's `formatResetIn`
325
316
  // reads ISO strings; Antigravity persists resetAt as a numeric epoch, so
@@ -398,11 +389,9 @@ function StatRow(props) {
398
389
  })();
399
390
  }
400
391
 
401
- // Fleet CollapsedRow: muted label left, caller-supplied value right. Used
402
- // for the collapsed sidebar view; the Antigravity adapter renders one
403
- // CollapsedRow per visible account (Claude's sibling collapses to a
404
- // single primary-quota line, but Antigravity's multi-quota model fits a
405
- // per-account row better when the sidebar is collapsed).
392
+ // Fleet CollapsedRow: muted label left, caller-supplied value right. The
393
+ // collapsed view renders one for the active account. The caller sizes both
394
+ // sides to the measured width, so neither side may wrap.
406
395
  function CollapsedRow(props) {
407
396
  return (() => {
408
397
  var _el$8 = _$createElement("box"),
@@ -411,6 +400,8 @@ function CollapsedRow(props) {
411
400
  _$setProp(_el$8, "width", '100%');
412
401
  _$setProp(_el$8, "flexDirection", 'row');
413
402
  _$setProp(_el$8, "justifyContent", 'space-between');
403
+ _$setProp(_el$9, "flexShrink", 0);
404
+ _$setProp(_el$9, "wrapMode", 'none');
414
405
  _$insert(_el$9, () => props.label);
415
406
  _$insert(_el$8, () => props.children, null);
416
407
  _$effect(_$p => _$setProp(_el$9, "fg", props.theme().textMuted, _$p));
@@ -418,225 +409,84 @@ function CollapsedRow(props) {
418
409
  })();
419
410
  }
420
411
 
421
- // The bar fills with remaining quota. The shared formatter supplies the
422
- // figure, reset and reading age; the right column aligns reset and age text.
423
- function QuotaRow(props) {
424
- const parts = () => quotaReadingParts(props.label, props.entry, props.now());
425
- const remaining = () => parts().remaining;
426
- const reset = () => parts().detail;
427
- return _$createComponent(Show, {
428
- get when() {
429
- return remaining() != null;
430
- },
431
- get fallback() {
432
- return (() => {
433
- var _el$14 = _$createElement("box"),
434
- _el$15 = _$createElement("text"),
435
- _el$16 = _$createElement("text");
436
- _$insertNode(_el$14, _el$15);
437
- _$insertNode(_el$14, _el$16);
438
- _$setProp(_el$14, "width", '100%');
439
- _$setProp(_el$14, "flexDirection", 'row');
440
- _$setProp(_el$14, "justifyContent", 'space-between');
441
- _$insert(_el$15, () => props.label.padEnd(5));
442
- _$insert(_el$16, () => parts().figure);
443
- _$effect(_p$ => {
444
- var _v$6 = props.theme().textMuted,
445
- _v$7 = props.theme().textMuted;
446
- _v$6 !== _p$.e && (_p$.e = _$setProp(_el$15, "fg", _v$6, _p$.e));
447
- _v$7 !== _p$.t && (_p$.t = _$setProp(_el$16, "fg", _v$7, _p$.t));
448
- return _p$;
449
- }, {
450
- e: undefined,
451
- t: undefined
452
- });
453
- return _el$14;
454
- })();
455
- },
456
- get children() {
457
- var _el$0 = _$createElement("box"),
458
- _el$1 = _$createElement("box"),
459
- _el$10 = _$createElement("text"),
460
- _el$11 = _$createElement("box"),
461
- _el$12 = _$createElement("text");
462
- _$insertNode(_el$0, _el$1);
463
- _$setProp(_el$0, "width", '100%');
464
- _$setProp(_el$0, "flexDirection", 'row');
465
- _$setProp(_el$0, "justifyContent", 'space-between');
466
- _$insertNode(_el$1, _el$10);
467
- _$insertNode(_el$1, _el$11);
468
- _$insertNode(_el$1, _el$12);
469
- _$setProp(_el$1, "flexDirection", 'row');
470
- _$setProp(_el$10, "width", 5);
471
- _$setProp(_el$10, "flexShrink", 0);
472
- _$insert(_el$10, () => props.label);
473
- _$setProp(_el$11, "flexShrink", 0);
474
- _$setProp(_el$11, "flexDirection", 'row');
475
- _$insert(_el$11, _$createComponent(For, {
476
- get each() {
477
- return quotaBarSegments(remaining() ?? 0, props.appearance);
478
- },
479
- children: segment => (() => {
480
- var _el$17 = _$createElement("text");
481
- _$insert(_el$17, () => segment.text);
482
- _$effect(_$p => _$setProp(_el$17, "fg", toneColor(props.theme(), segment.tone), _$p));
483
- return _el$17;
484
- })()
485
- }));
486
- _$insert(_el$12, () => ` ${parts().figure}`);
487
- _$insert(_el$0, _$createComponent(Show, {
488
- get when() {
489
- return reset();
490
- },
491
- get children() {
492
- var _el$13 = _$createElement("text");
493
- _$insert(_el$13, reset);
494
- _$effect(_$p => _$setProp(_el$13, "fg", props.theme().textMuted, _$p));
495
- return _el$13;
496
- }
497
- }), null);
498
- _$effect(_p$ => {
499
- var _v$3 = props.theme().textMuted,
500
- _v$4 = props.appearance.barWidth,
501
- _v$5 = toneColor(props.theme(), quotaTone(100 - (remaining() ?? 0), props.appearance));
502
- _v$3 !== _p$.e && (_p$.e = _$setProp(_el$10, "fg", _v$3, _p$.e));
503
- _v$4 !== _p$.t && (_p$.t = _$setProp(_el$11, "width", _v$4, _p$.t));
504
- _v$5 !== _p$.a && (_p$.a = _$setProp(_el$12, "fg", _v$5, _p$.a));
505
- return _p$;
506
- }, {
507
- e: undefined,
508
- t: undefined,
509
- a: undefined
510
- });
511
- return _el$0;
512
- }
513
- });
514
- }
515
-
516
- // Fleet AccountBlock, adapted to Antigravity's per-account data. Header
517
- // row is account label (left) + status word (right). The body renders one
518
- // QuotaRow per present quota group in the fleet's stable order, then a
519
- // muted secondary line with the account's health score and, when
520
- // relevant, a cooldown countdown. Status word priorities (first match
521
- // wins):
412
+ // One account in the Quota section: the shared quota block, with the status
413
+ // word computed from the sidebar file's account state. Status word priorities
414
+ // (first match wins):
522
415
  // - `off` when the account is disabled
523
- // - `cooling` when cooldownUntil is still in the future
416
+ // - `cooling <wait>` when cooldownUntil is still in the future
524
417
  // - `active` when current === true
525
418
  // - `idle` for the fallback (current === false) case
526
419
  function AccountBlock(props) {
527
420
  const active = () => props.active ?? props.account.current;
421
+ const cooldownMs = () => {
422
+ const cd = props.account.cooldownUntil;
423
+ if (typeof cd !== 'number') return 0;
424
+ return Math.max(0, cd - props.now());
425
+ };
528
426
  const statusWord = () => {
529
427
  if (!props.account.enabled) return 'off';
530
- const cd = props.account.cooldownUntil;
531
- if (typeof cd === 'number' && cd > props.now()) return 'cooling';
428
+ if (cooldownMs() > 0) return `cooling ${formatWait(cooldownMs())}`;
532
429
  return active() ? 'active' : 'idle';
533
430
  };
534
431
  const statusTone = () => {
535
432
  if (!props.account.enabled) return 'muted';
536
- const cd = props.account.cooldownUntil;
537
- if (typeof cd === 'number' && cd > props.now()) return 'warn';
433
+ if (cooldownMs() > 0) return 'warn';
538
434
  return active() ? 'ok' : 'muted';
539
435
  };
540
- const cooldownMs = () => {
541
- const cd = props.account.cooldownUntil;
542
- if (typeof cd !== 'number') return 0;
543
- return Math.max(0, cd - props.now());
436
+ return _$createComponent(QuotaAccountBlock, {
437
+ get palette() {
438
+ return themePalette(props.theme);
439
+ },
440
+ get appearance() {
441
+ return props.appearance;
442
+ },
443
+ get account() {
444
+ return props.account;
445
+ },
446
+ get status() {
447
+ return statusWord();
448
+ },
449
+ get statusTone() {
450
+ return statusTone();
451
+ },
452
+ get now() {
453
+ return props.now;
454
+ },
455
+ get width() {
456
+ return props.width;
457
+ },
458
+ get marginTop() {
459
+ return props.marginTop;
460
+ }
461
+ });
462
+ }
463
+ // The collapsed row's figure: the lowest current window across both groups.
464
+ // A window that reset since its reading is not current and never binds.
465
+ function collapsedQuota(account, now) {
466
+ if (account.quota.gemini == null && account.quota['non-gemini'] == null) return {
467
+ prefix: '',
468
+ text: '—',
469
+ remaining: null
544
470
  };
545
- const healthText = () => {
546
- const base = `health ${Math.round(clamp(props.account.health, 0, 100))}`;
547
- return cooldownMs() > 0 ? `${base} · cooling ${formatWait(cooldownMs())}` : base;
471
+ const windows = accountWindows(account, now);
472
+ let lowest;
473
+ for (const window of windows) {
474
+ if (!showsFigure(window)) continue;
475
+ if (lowest === undefined || (window.text.remaining ?? 100) < (lowest.text.remaining ?? 100)) lowest = window;
476
+ }
477
+ if (lowest) {
478
+ const name = lowest.text.name;
479
+ return {
480
+ prefix: `${COLLAPSED_GROUP_NAMES[lowest.key]}${name ? ` ${name}` : ''} `,
481
+ text: lowest.text.figure,
482
+ remaining: lowest.text.remaining
483
+ };
484
+ }
485
+ return {
486
+ prefix: '',
487
+ text: windows.some(window => window.text.resetSinceReading) ? RESET_SINCE_READING : NO_QUOTA_READING,
488
+ remaining: null
548
489
  };
549
- return (() => {
550
- var _el$18 = _$createElement("box"),
551
- _el$19 = _$createElement("box"),
552
- _el$20 = _$createElement("text"),
553
- _el$21 = _$createElement("b"),
554
- _el$22 = _$createElement("text"),
555
- _el$23 = _$createElement("b"),
556
- _el$24 = _$createElement("box"),
557
- _el$25 = _$createElement("text");
558
- _$insertNode(_el$18, _el$19);
559
- _$insertNode(_el$18, _el$24);
560
- _$setProp(_el$18, "width", '100%');
561
- _$setProp(_el$18, "flexDirection", 'column');
562
- _$insertNode(_el$19, _el$20);
563
- _$insertNode(_el$19, _el$22);
564
- _$setProp(_el$19, "width", '100%');
565
- _$setProp(_el$19, "flexDirection", 'row');
566
- _$setProp(_el$19, "justifyContent", 'space-between');
567
- _$insertNode(_el$20, _el$21);
568
- _$insert(_el$21, () => props.account.label);
569
- _$insertNode(_el$22, _el$23);
570
- _$insert(_el$23, statusWord);
571
- _$insert(_el$18, _$createComponent(For, {
572
- each: QUOTA_ORDER,
573
- children: key => {
574
- const poolEntry = props.account.quota[key];
575
- const windows = poolEntry?.windows;
576
- // Legacy: no windows array — render a single row with the pool label.
577
- const hasWindows = windows && windows.length > 0;
578
- if (!hasWindows) {
579
- return _$createComponent(QuotaRow, {
580
- get theme() {
581
- return props.theme;
582
- },
583
- get appearance() {
584
- return props.appearance;
585
- },
586
- get label() {
587
- return QUOTA_LABELS[key];
588
- },
589
- entry: poolEntry,
590
- get now() {
591
- return props.now;
592
- }
593
- });
594
- }
595
- return _$memo(() => windows.map(w => _$createComponent(QuotaRow, {
596
- get theme() {
597
- return props.theme;
598
- },
599
- get appearance() {
600
- return props.appearance;
601
- },
602
- get label() {
603
- return `${QUOTA_LABELS[key]} ${WINDOW_GUTTER[w.window] ?? w.window}`;
604
- },
605
- get entry() {
606
- return {
607
- remainingPercent: w.remainingPercent,
608
- resetAt: w.resetAt,
609
- checkedAt: w.checkedAt
610
- };
611
- },
612
- get now() {
613
- return props.now;
614
- }
615
- })));
616
- }
617
- }), _el$24);
618
- _$insertNode(_el$24, _el$25);
619
- _$setProp(_el$24, "width", '100%');
620
- _$setProp(_el$24, "flexDirection", 'row');
621
- _$insert(_el$25, () => ` ${healthText()}`);
622
- _$effect(_p$ => {
623
- var _v$8 = props.marginTop ?? 0,
624
- _v$9 = props.theme().text,
625
- _v$0 = toneColor(props.theme(), statusTone()),
626
- _v$1 = props.theme().textMuted;
627
- _v$8 !== _p$.e && (_p$.e = _$setProp(_el$18, "marginTop", _v$8, _p$.e));
628
- _v$9 !== _p$.t && (_p$.t = _$setProp(_el$20, "fg", _v$9, _p$.t));
629
- _v$0 !== _p$.a && (_p$.a = _$setProp(_el$22, "fg", _v$0, _p$.a));
630
- _v$1 !== _p$.o && (_p$.o = _$setProp(_el$25, "fg", _v$1, _p$.o));
631
- return _p$;
632
- }, {
633
- e: undefined,
634
- t: undefined,
635
- a: undefined,
636
- o: undefined
637
- });
638
- return _el$18;
639
- })();
640
490
  }
641
491
  function formatWait(ms) {
642
492
  const seconds = Math.ceil(ms / 1000);
@@ -714,6 +564,24 @@ export function SidebarPanel(props) {
714
564
  };
715
565
  };
716
566
 
567
+ // The route on one `Route <value>` line when it fits, else one line per
568
+ // part with the strategy last.
569
+ const routeValue = route => `${route.strategy ? `${route.strategy} · ` : ''}${route.family}: ${route.style}`;
570
+ const routeLines = route => [`${route.family}: ${route.style}`, route.strategy ?? ''].filter(line => line !== '');
571
+
572
+ // The width available to content: the header row spans the panel inside
573
+ // its border and padding. Layout reports it during a render pass, so the
574
+ // signal is updated afterwards rather than rebuilding rows mid-pass.
575
+ const [contentWidth, setContentWidth] = createSignal(ASSUMED_CONTENT_WIDTH);
576
+ let headerRow;
577
+ const measureContentWidth = () => {
578
+ const width = headerRow?.width;
579
+ if (typeof width !== 'number' || width <= 0) return;
580
+ queueMicrotask(() => {
581
+ if (width !== contentWidth()) setContentWidth(width);
582
+ });
583
+ };
584
+
717
585
  // Header badge: ▼/▶ {label}. The fleet shows the version string on the
718
586
  // right when no degraded state is present; the antigravity adapter keeps
719
587
  // that right-alignment and surfaces `degraded` as a "LIMITED" badge
@@ -723,36 +591,40 @@ export function SidebarPanel(props) {
723
591
  return !hasData() ? name : collapsed() ? `\u25b6 ${name}` : `\u25bc ${name}`;
724
592
  };
725
593
  return (() => {
726
- var _el$26 = _$createElement("box"),
727
- _el$27 = _$createElement("box"),
728
- _el$28 = _$createElement("box"),
729
- _el$29 = _$createElement("text"),
730
- _el$30 = _$createElement("b");
731
- _$insertNode(_el$26, _el$27);
732
- _$setProp(_el$26, "width", '100%');
733
- _$setProp(_el$26, "flexDirection", 'column');
734
- _$setProp(_el$26, "border", SINGLE_BORDER);
735
- _$setProp(_el$26, "paddingTop", 1);
736
- _$setProp(_el$26, "paddingBottom", 1);
737
- _$setProp(_el$26, "paddingLeft", 1);
738
- _$setProp(_el$26, "paddingRight", 1);
739
- _$insertNode(_el$27, _el$28);
740
- _$setProp(_el$27, "width", '100%');
741
- _$setProp(_el$27, "flexDirection", 'row');
742
- _$setProp(_el$27, "justifyContent", 'space-between');
743
- _$setProp(_el$27, "alignItems", 'center');
744
- _$setProp(_el$27, "onMouseDown", () => {
594
+ var _el$0 = _$createElement("box"),
595
+ _el$1 = _$createElement("box"),
596
+ _el$10 = _$createElement("box"),
597
+ _el$11 = _$createElement("text"),
598
+ _el$12 = _$createElement("b");
599
+ _$insertNode(_el$0, _el$1);
600
+ _$setProp(_el$0, "width", '100%');
601
+ _$setProp(_el$0, "flexDirection", 'column');
602
+ _$setProp(_el$0, "border", SINGLE_BORDER);
603
+ _$setProp(_el$0, "paddingTop", 1);
604
+ _$setProp(_el$0, "paddingBottom", 1);
605
+ _$setProp(_el$0, "paddingLeft", 1);
606
+ _$setProp(_el$0, "paddingRight", 1);
607
+ _$insertNode(_el$1, _el$10);
608
+ _$use(element => {
609
+ headerRow = element;
610
+ }, _el$1);
611
+ _$setProp(_el$1, "onSizeChange", measureContentWidth);
612
+ _$setProp(_el$1, "width", '100%');
613
+ _$setProp(_el$1, "flexDirection", 'row');
614
+ _$setProp(_el$1, "justifyContent", 'space-between');
615
+ _$setProp(_el$1, "alignItems", 'center');
616
+ _$setProp(_el$1, "onMouseDown", () => {
745
617
  // Mirror the fleet guard: only toggle when there is data to expand
746
618
  // into. Without this a click on the empty-awaiting header would just
747
619
  // toggle the affordance for nothing.
748
620
  if (hasData()) controller.toggleCollapsed();
749
621
  });
750
- _$insertNode(_el$28, _el$29);
751
- _$setProp(_el$28, "paddingLeft", 1);
752
- _$setProp(_el$28, "paddingRight", 1);
753
- _$insertNode(_el$29, _el$30);
754
- _$insert(_el$30, headerLabel);
755
- _$insert(_el$27, _$createComponent(Show, {
622
+ _$insertNode(_el$10, _el$11);
623
+ _$setProp(_el$10, "paddingLeft", 1);
624
+ _$setProp(_el$10, "paddingRight", 1);
625
+ _$insertNode(_el$11, _el$12);
626
+ _$insert(_el$12, headerLabel);
627
+ _$insert(_el$1, _$createComponent(Show, {
756
628
  get when() {
757
629
  return degraded();
758
630
  },
@@ -762,59 +634,42 @@ export function SidebarPanel(props) {
762
634
  return prefs().header.showVersion && PLUGIN_VERSION !== '';
763
635
  },
764
636
  get children() {
765
- var _el$35 = _$createElement("text");
766
- _$insert(_el$35, `v${PLUGIN_VERSION}`);
767
- _$effect(_$p => _$setProp(_el$35, "fg", theme().textMuted, _$p));
768
- return _el$35;
637
+ var _el$17 = _$createElement("text");
638
+ _$insert(_el$17, `v${PLUGIN_VERSION}`);
639
+ _$effect(_$p => _$setProp(_el$17, "fg", theme().textMuted, _$p));
640
+ return _el$17;
769
641
  }
770
642
  });
771
643
  },
772
644
  get children() {
773
- var _el$31 = _$createElement("box"),
774
- _el$32 = _$createElement("text"),
775
- _el$33 = _$createElement("b");
776
- _$insertNode(_el$31, _el$32);
777
- _$setProp(_el$31, "paddingLeft", 1);
778
- _$setProp(_el$31, "paddingRight", 1);
779
- _$insertNode(_el$32, _el$33);
780
- _$insertNode(_el$33, _$createTextNode(`LIMITED`));
645
+ var _el$13 = _$createElement("box"),
646
+ _el$14 = _$createElement("text"),
647
+ _el$15 = _$createElement("b");
648
+ _$insertNode(_el$13, _el$14);
649
+ _$setProp(_el$13, "paddingLeft", 1);
650
+ _$setProp(_el$13, "paddingRight", 1);
651
+ _$insertNode(_el$14, _el$15);
652
+ _$insertNode(_el$15, _$createTextNode(`LIMITED`));
781
653
  _$effect(_p$ => {
782
- var _v$10 = theme().warning,
783
- _v$11 = theme().background;
784
- _v$10 !== _p$.e && (_p$.e = _$setProp(_el$31, "backgroundColor", _v$10, _p$.e));
785
- _v$11 !== _p$.t && (_p$.t = _$setProp(_el$32, "fg", _v$11, _p$.t));
654
+ var _v$3 = theme().warning,
655
+ _v$4 = theme().background;
656
+ _v$3 !== _p$.e && (_p$.e = _$setProp(_el$13, "backgroundColor", _v$3, _p$.e));
657
+ _v$4 !== _p$.t && (_p$.t = _$setProp(_el$14, "fg", _v$4, _p$.t));
786
658
  return _p$;
787
659
  }, {
788
660
  e: undefined,
789
661
  t: undefined
790
662
  });
791
- return _el$31;
663
+ return _el$13;
792
664
  }
793
665
  }), null);
794
- _$insert(_el$26, _$createComponent(Show, {
666
+ _$insert(_el$0, _$createComponent(Show, {
795
667
  get when() {
796
668
  return _$memo(() => !!collapsed())() && hasData();
797
669
  },
798
670
  get children() {
799
671
  return (() => {
800
672
  const account = () => visibleAccounts().find(entry => entry.current) ?? visibleAccounts()[0];
801
- const remaining = () => {
802
- const q = account()?.quota;
803
- // The lowest remaining percentage among dated readings determines the warning tone.
804
- const gemini = quotaReadingParts('Gm', q?.gemini, now()).remaining;
805
- const nonGemini = quotaReadingParts('NG', q?.['non-gemini'], now()).remaining;
806
- if (gemini === null && nonGemini === null) return null;
807
- return Math.min(gemini ?? 100, nonGemini ?? 100);
808
- };
809
- const poolText = key => {
810
- const entry = account()?.quota[key];
811
- if (!entry) return `${QUOTA_LABELS[key]}: ${formatQuotaReading(QUOTA_LABELS[key], undefined, now())}`;
812
- // Show binding window when available, else just pool label.
813
- const bindingWindow = entry.windows?.reduce((best, w) => best === null || w.remainingPercent < best.remainingPercent ? w : best, null);
814
- const gutter = bindingWindow ? ` ${WINDOW_GUTTER[bindingWindow.window] ?? bindingWindow.window}` : '';
815
- const text = formatQuotaReading(`${QUOTA_LABELS[key]}${gutter}`, bindingWindow ?? entry, now());
816
- return bindingWindow ? `${QUOTA_LABELS[key]} ${text}` : text;
817
- };
818
673
  const unavailable = () => {
819
674
  const selected = account();
820
675
  return selected != null && (!selected.enabled || selected.cooldownUntil != null && selected.cooldownUntil > now());
@@ -823,43 +678,63 @@ export function SidebarPanel(props) {
823
678
  get when() {
824
679
  return account();
825
680
  },
826
- children: selected => _$createComponent(CollapsedRow, {
827
- theme: theme,
828
- get label() {
829
- return selected().label;
830
- },
831
- get children() {
832
- var _el$36 = _$createElement("box"),
833
- _el$37 = _$createElement("text"),
834
- _el$38 = _$createElement("b"),
835
- _el$39 = _$createElement("text");
836
- _$insertNode(_el$36, _el$37);
837
- _$insertNode(_el$36, _el$39);
838
- _$setProp(_el$36, "flexDirection", 'row');
839
- _$insertNode(_el$37, _el$38);
840
- _$insert(_el$38, (() => {
841
- var _c$ = _$memo(() => !!(account()?.quota.gemini == null && account()?.quota['non-gemini'] == null));
842
- return () => _c$() ? '—' : `${poolText('gemini')} · ${poolText('non-gemini')}`;
843
- })());
844
- _$insert(_el$39, () => unavailable() ? ' ⊘' : ' ●');
845
- _$effect(_p$ => {
846
- var _v$15 = toneColor(theme(), remaining() == null ? 'muted' : quotaTone(100 - (remaining() ?? 100), prefs().appearance)),
847
- _v$16 = toneColor(theme(), unavailable() ? 'err' : remaining() == null ? 'muted' : quotaTone(100 - (remaining() ?? 100), prefs().appearance));
848
- _v$15 !== _p$.e && (_p$.e = _$setProp(_el$37, "fg", _v$15, _p$.e));
849
- _v$16 !== _p$.t && (_p$.t = _$setProp(_el$39, "fg", _v$16, _p$.t));
850
- return _p$;
851
- }, {
852
- e: undefined,
853
- t: undefined
854
- });
855
- return _el$36;
856
- }
857
- })
681
+ children: selected => {
682
+ const quota = () => collapsedQuota(selected(), now());
683
+ const tone = () => {
684
+ const remaining = quota().remaining;
685
+ return remaining == null ? 'muted' : quotaTone(100 - remaining, prefs().appearance);
686
+ };
687
+ // Label, one space, the figure and the two-cell dot. The
688
+ // group prefix goes first when narrow; then the label is cut.
689
+ const figure = () => {
690
+ const {
691
+ prefix,
692
+ text
693
+ } = quota();
694
+ const full = `${prefix}${text}`;
695
+ return selected().label.length + 1 + full.length + 2 <= contentWidth() ? full : text;
696
+ };
697
+ const label = () => fitLabel(selected().label, contentWidth() - 1 - figure().length - 2);
698
+ return _$createComponent(CollapsedRow, {
699
+ theme: theme,
700
+ get label() {
701
+ return label();
702
+ },
703
+ get children() {
704
+ var _el$18 = _$createElement("box"),
705
+ _el$19 = _$createElement("text"),
706
+ _el$20 = _$createElement("b"),
707
+ _el$21 = _$createElement("text");
708
+ _$insertNode(_el$18, _el$19);
709
+ _$insertNode(_el$18, _el$21);
710
+ _$setProp(_el$18, "flexDirection", 'row');
711
+ _$setProp(_el$18, "flexShrink", 0);
712
+ _$insertNode(_el$19, _el$20);
713
+ _$setProp(_el$19, "flexShrink", 0);
714
+ _$setProp(_el$19, "wrapMode", 'none');
715
+ _$insert(_el$20, figure);
716
+ _$setProp(_el$21, "flexShrink", 0);
717
+ _$setProp(_el$21, "wrapMode", 'none');
718
+ _$insert(_el$21, () => unavailable() ? ' ⊘' : ' ●');
719
+ _$effect(_p$ => {
720
+ var _v$8 = toneColor(theme(), tone()),
721
+ _v$9 = toneColor(theme(), unavailable() ? 'err' : tone());
722
+ _v$8 !== _p$.e && (_p$.e = _$setProp(_el$19, "fg", _v$8, _p$.e));
723
+ _v$9 !== _p$.t && (_p$.t = _$setProp(_el$21, "fg", _v$9, _p$.t));
724
+ return _p$;
725
+ }, {
726
+ e: undefined,
727
+ t: undefined
728
+ });
729
+ return _el$18;
730
+ }
731
+ });
732
+ }
858
733
  });
859
734
  })();
860
735
  }
861
736
  }), null);
862
- _$insert(_el$26, _$createComponent(Show, {
737
+ _$insert(_el$0, _$createComponent(Show, {
863
738
  get when() {
864
739
  return !collapsed() || !hasData();
865
740
  },
@@ -870,14 +745,14 @@ export function SidebarPanel(props) {
870
745
  },
871
746
  get fallback() {
872
747
  return (() => {
873
- var _el$40 = _$createElement("box"),
874
- _el$41 = _$createElement("text");
875
- _$insertNode(_el$40, _el$41);
876
- _$setProp(_el$40, "marginTop", 1);
877
- _$setProp(_el$40, "width", '100%');
878
- _$insertNode(_el$41, _$createTextNode(`Waiting for quota…`));
879
- _$effect(_$p => _$setProp(_el$41, "fg", theme().textMuted, _$p));
880
- return _el$40;
748
+ var _el$22 = _$createElement("box"),
749
+ _el$23 = _$createElement("text");
750
+ _$insertNode(_el$22, _el$23);
751
+ _$setProp(_el$22, "marginTop", 1);
752
+ _$setProp(_el$22, "width", '100%');
753
+ _$insertNode(_el$23, _$createTextNode(`Waiting for quota…`));
754
+ _$effect(_$p => _$setProp(_el$23, "fg", theme().textMuted, _$p));
755
+ return _el$22;
881
756
  })();
882
757
  },
883
758
  get children() {
@@ -900,6 +775,7 @@ export function SidebarPanel(props) {
900
775
  },
901
776
  account: account,
902
777
  now: now,
778
+ width: contentWidth,
903
779
  get marginTop() {
904
780
  return index() === 0 ? 0 : 1;
905
781
  }
@@ -919,20 +795,44 @@ export function SidebarPanel(props) {
919
795
  return currentRoute();
920
796
  },
921
797
  get fallback() {
922
- return _$createComponent(StatRow, {
923
- theme: theme,
924
- label: "Route",
925
- value: "\u2014",
926
- tone: "muted"
927
- });
798
+ return (() => {
799
+ var _el$25 = _$createElement("text");
800
+ _$insertNode(_el$25, _$createTextNode(`No request yet`));
801
+ _$setProp(_el$25, "wrapMode", 'none');
802
+ _$effect(_$p => _$setProp(_el$25, "fg", theme().textMuted, _$p));
803
+ return _el$25;
804
+ })();
928
805
  },
929
- children: route => _$createComponent(StatRow, {
930
- theme: theme,
931
- label: "Route",
932
- get value() {
933
- return `${route().strategy ? `${route().strategy} · ` : ''}${route().family}: ${route().style}`;
806
+ children: route => _$createComponent(Show, {
807
+ get when() {
808
+ return routeLineFits('Route', routeValue(route()), contentWidth());
934
809
  },
935
- tone: "accent"
810
+ get fallback() {
811
+ return _$createComponent(For, {
812
+ get each() {
813
+ return routeLines(route());
814
+ },
815
+ children: line => (() => {
816
+ var _el$27 = _$createElement("text"),
817
+ _el$28 = _$createElement("b");
818
+ _$insertNode(_el$27, _el$28);
819
+ _$setProp(_el$27, "wrapMode", 'none');
820
+ _$insert(_el$28, line);
821
+ _$effect(_$p => _$setProp(_el$27, "fg", toneColor(theme(), 'accent'), _$p));
822
+ return _el$27;
823
+ })()
824
+ });
825
+ },
826
+ get children() {
827
+ return _$createComponent(StatRow, {
828
+ theme: theme,
829
+ label: "Route",
830
+ get value() {
831
+ return routeValue(route());
832
+ },
833
+ tone: "accent"
834
+ });
835
+ }
936
836
  })
937
837
  })];
938
838
  }
@@ -980,19 +880,19 @@ export function SidebarPanel(props) {
980
880
  }
981
881
  }), null);
982
882
  _$effect(_p$ => {
983
- var _v$12 = theme().borderActive,
984
- _v$13 = theme().accent,
985
- _v$14 = theme().background;
986
- _v$12 !== _p$.e && (_p$.e = _$setProp(_el$26, "borderColor", _v$12, _p$.e));
987
- _v$13 !== _p$.t && (_p$.t = _$setProp(_el$28, "backgroundColor", _v$13, _p$.t));
988
- _v$14 !== _p$.a && (_p$.a = _$setProp(_el$29, "fg", _v$14, _p$.a));
883
+ var _v$5 = theme().borderActive,
884
+ _v$6 = theme().accent,
885
+ _v$7 = theme().background;
886
+ _v$5 !== _p$.e && (_p$.e = _$setProp(_el$0, "borderColor", _v$5, _p$.e));
887
+ _v$6 !== _p$.t && (_p$.t = _$setProp(_el$10, "backgroundColor", _v$6, _p$.t));
888
+ _v$7 !== _p$.a && (_p$.a = _$setProp(_el$11, "fg", _v$7, _p$.a));
989
889
  return _p$;
990
890
  }, {
991
891
  e: undefined,
992
892
  t: undefined,
993
893
  a: undefined
994
894
  });
995
- return _el$26;
895
+ return _el$0;
996
896
  })();
997
897
  }
998
898