@cortexkit/opencode-antigravity-auth 3.0.12 → 3.0.13

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 (225) hide show
  1. package/dist/cli.js +2846 -1007
  2. package/dist/cli.js.map +4 -4
  3. package/dist/cli.meta.json +435 -127
  4. package/dist/index.js +3312 -1268
  5. package/dist/index.js.map +4 -4
  6. package/dist/index.meta.json +472 -160
  7. package/dist/server.js +12703 -10471
  8. package/dist/server.js.map +4 -4
  9. package/dist/server.meta.json +1 -1
  10. package/dist/src/cli.d.ts +15 -0
  11. package/dist/src/cli.d.ts.map +1 -1
  12. package/dist/src/cli.js +27 -1
  13. package/dist/src/cli.js.map +1 -1
  14. package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +77 -2
  15. package/dist/src/common-auth-embedded/claustrum/consumer.js +320 -35
  16. package/dist/src/common-auth-embedded/claustrum/custody.d.ts +36 -1
  17. package/dist/src/common-auth-embedded/claustrum/custody.js +95 -11
  18. package/dist/src/common-auth-embedded/claustrum/enrollment.js +37 -12
  19. package/dist/src/common-auth-embedded/claustrum/hub.d.ts +195 -0
  20. package/dist/src/common-auth-embedded/claustrum/hub.js +988 -0
  21. package/dist/src/common-auth-embedded/claustrum/index.d.ts +13 -3
  22. package/dist/src/common-auth-embedded/claustrum/index.js +37 -4
  23. package/dist/src/common-auth-embedded/claustrum/quota-writer.d.ts +8 -1
  24. package/dist/src/common-auth-embedded/claustrum/quota-writer.js +34 -12
  25. package/dist/src/common-auth-embedded/claustrum/roster.d.ts +49 -1
  26. package/dist/src/common-auth-embedded/claustrum/roster.js +187 -12
  27. package/dist/src/common-auth-embedded/claustrum/shutdown.js +42 -0
  28. package/dist/src/common-auth-embedded/fs/file-read-cache.js +57 -0
  29. package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +1 -1
  30. package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +20 -11
  31. package/dist/src/common-auth-embedded/opencode2/errors.d.ts +4 -1
  32. package/dist/src/common-auth-embedded/opencode2/index.d.ts +2 -2
  33. package/dist/src/common-auth-embedded/opencode2/index.js +1 -1
  34. package/dist/src/common-auth-embedded/opencode2/install.d.ts +7 -5
  35. package/dist/src/common-auth-embedded/opencode2/install.js +139 -13
  36. package/dist/src/common-auth-embedded/opencode2/types.d.ts +42 -10
  37. package/dist/src/common-auth-embedded/quota/commit-interval.d.ts +9 -0
  38. package/dist/src/common-auth-embedded/quota/commit-interval.js +18 -0
  39. package/dist/src/common-auth-embedded/rpc/rpc-server.js +29 -19
  40. package/dist/src/common-auth-embedded/setup/command.js +52 -14
  41. package/dist/src/common-auth-embedded/setup/register.d.ts +2 -0
  42. package/dist/src/common-auth-embedded/setup/register.js +90 -11
  43. package/dist/src/common-auth-embedded/source-output.json +145 -97
  44. package/dist/src/common-auth-embedded/store/mutate.d.ts +2 -0
  45. package/dist/src/common-auth-embedded/store/mutate.js +4 -0
  46. package/dist/src/common-auth-embedded/store/pool.d.ts +6 -1
  47. package/dist/src/common-auth-embedded/store/pool.js +1 -1
  48. package/dist/src/common-auth-embedded/store/quota-writer.js +27 -13
  49. package/dist/src/common-auth-embedded/store/settings.d.ts +1 -1
  50. package/dist/src/common-auth-embedded/store/settings.js +16 -6
  51. package/dist/src/ga/rpc/protocol.d.ts +2 -0
  52. package/dist/src/ga/rpc/protocol.d.ts.map +1 -1
  53. package/dist/src/ga/rpc/protocol.js +2 -2
  54. package/dist/src/ga/rpc/protocol.js.map +1 -1
  55. package/dist/src/ga/server/index.d.ts.map +1 -1
  56. package/dist/src/ga/server/index.js +11 -0
  57. package/dist/src/ga/server/index.js.map +1 -1
  58. package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
  59. package/dist/src/ga/tui/host-ga.js +2 -1
  60. package/dist/src/ga/tui/host-ga.js.map +1 -1
  61. package/dist/src/plugin/background-vault-quota-refresh.d.ts +10 -0
  62. package/dist/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
  63. package/dist/src/plugin/background-vault-quota-refresh.js +33 -5
  64. package/dist/src/plugin/background-vault-quota-refresh.js.map +1 -1
  65. package/dist/src/plugin/command-data.d.ts +2 -2
  66. package/dist/src/plugin/command-data.d.ts.map +1 -1
  67. package/dist/src/plugin/command-data.js +2 -0
  68. package/dist/src/plugin/command-data.js.map +1 -1
  69. package/dist/src/plugin/config/operator-settings-schema.d.ts +1 -1
  70. package/dist/src/plugin/config/schema.d.ts +1 -1
  71. package/dist/src/plugin/ga-location-services.d.ts +28 -2
  72. package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
  73. package/dist/src/plugin/ga-location-services.js +80 -16
  74. package/dist/src/plugin/ga-location-services.js.map +1 -1
  75. package/dist/src/plugin/ga-shared-vault-custody.d.ts +64 -0
  76. package/dist/src/plugin/ga-shared-vault-custody.d.ts.map +1 -0
  77. package/dist/src/plugin/ga-shared-vault-custody.js +169 -0
  78. package/dist/src/plugin/ga-shared-vault-custody.js.map +1 -0
  79. package/dist/src/plugin/index.d.ts.map +1 -1
  80. package/dist/src/plugin/index.js +11 -1
  81. package/dist/src/plugin/index.js.map +1 -1
  82. package/dist/src/plugin/killswitch.d.ts.map +1 -1
  83. package/dist/src/plugin/killswitch.js +13 -7
  84. package/dist/src/plugin/killswitch.js.map +1 -1
  85. package/dist/src/plugin/oauth-methods.d.ts.map +1 -1
  86. package/dist/src/plugin/oauth-methods.js +3 -0
  87. package/dist/src/plugin/oauth-methods.js.map +1 -1
  88. package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
  89. package/dist/src/plugin/shared/request-services.js +2 -3
  90. package/dist/src/plugin/shared/request-services.js.map +1 -1
  91. package/dist/src/plugin/shared/vault-request-credentials.d.ts +8 -1
  92. package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
  93. package/dist/src/plugin/shared/vault-request-credentials.js +38 -5
  94. package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
  95. package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
  96. package/dist/src/plugin/ui/auth-menu.js +3 -0
  97. package/dist/src/plugin/ui/auth-menu.js.map +1 -1
  98. package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
  99. package/dist/src/plugin/ui/quota-status.js +4 -2
  100. package/dist/src/plugin/ui/quota-status.js.map +1 -1
  101. package/dist/src/plugin/vault-custody.d.ts +28 -7
  102. package/dist/src/plugin/vault-custody.d.ts.map +1 -1
  103. package/dist/src/plugin/vault-custody.js +198 -35
  104. package/dist/src/plugin/vault-custody.js.map +1 -1
  105. package/dist/src/plugin/vault-insula-quota.d.ts.map +1 -1
  106. package/dist/src/plugin/vault-insula-quota.js +4 -0
  107. package/dist/src/plugin/vault-insula-quota.js.map +1 -1
  108. package/dist/src/plugin/vault-sidebar-projection.d.ts.map +1 -1
  109. package/dist/src/process-heartbeat.d.ts +76 -0
  110. package/dist/src/process-heartbeat.d.ts.map +1 -0
  111. package/dist/src/process-heartbeat.js +248 -0
  112. package/dist/src/process-heartbeat.js.map +1 -0
  113. package/dist/src/setup.d.ts.map +1 -1
  114. package/dist/src/setup.js +3 -0
  115. package/dist/src/setup.js.map +1 -1
  116. package/dist/src/sidebar-projection.d.ts +3 -1
  117. package/dist/src/sidebar-projection.d.ts.map +1 -1
  118. package/dist/src/sidebar-projection.js +10 -1
  119. package/dist/src/sidebar-projection.js.map +1 -1
  120. package/dist/src/sidebar-state.d.ts +10 -1
  121. package/dist/src/sidebar-state.d.ts.map +1 -1
  122. package/dist/src/sidebar-state.js +12 -2
  123. package/dist/src/sidebar-state.js.map +1 -1
  124. package/dist/src/tui/quota-layout.d.ts +3 -1
  125. package/dist/src/tui/quota-layout.d.ts.map +1 -1
  126. package/dist/src/tui/quota-layout.js +6 -1
  127. package/dist/src/tui/quota-layout.js.map +1 -1
  128. package/dist/tui-build-map.json +9 -9
  129. package/dist/tui-ga-build-map.json +13 -13
  130. package/dist/types/src/cli.d.ts +15 -0
  131. package/dist/types/src/cli.d.ts.map +1 -1
  132. package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +77 -2
  133. package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +36 -1
  134. package/dist/types/src/common-auth-embedded/claustrum/hub.d.ts +195 -0
  135. package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +13 -3
  136. package/dist/types/src/common-auth-embedded/claustrum/quota-writer.d.ts +8 -1
  137. package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +49 -1
  138. package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +1 -1
  139. package/dist/types/src/common-auth-embedded/opencode2/errors.d.ts +4 -1
  140. package/dist/types/src/common-auth-embedded/opencode2/index.d.ts +2 -2
  141. package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +7 -5
  142. package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +42 -10
  143. package/dist/types/src/common-auth-embedded/quota/commit-interval.d.ts +9 -0
  144. package/dist/types/src/common-auth-embedded/setup/register.d.ts +2 -0
  145. package/dist/types/src/common-auth-embedded/store/mutate.d.ts +2 -0
  146. package/dist/types/src/common-auth-embedded/store/pool.d.ts +6 -1
  147. package/dist/types/src/common-auth-embedded/store/settings.d.ts +1 -1
  148. package/dist/types/src/ga/rpc/protocol.d.ts +2 -0
  149. package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -1
  150. package/dist/types/src/ga/server/index.d.ts.map +1 -1
  151. package/dist/types/src/plugin/background-vault-quota-refresh.d.ts +10 -0
  152. package/dist/types/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
  153. package/dist/types/src/plugin/command-data.d.ts +2 -2
  154. package/dist/types/src/plugin/command-data.d.ts.map +1 -1
  155. package/dist/types/src/plugin/ga-location-services.d.ts +28 -2
  156. package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
  157. package/dist/types/src/plugin/ga-shared-vault-custody.d.ts +64 -0
  158. package/dist/types/src/plugin/ga-shared-vault-custody.d.ts.map +1 -0
  159. package/dist/types/src/plugin/index.d.ts.map +1 -1
  160. package/dist/types/src/plugin/killswitch.d.ts.map +1 -1
  161. package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -1
  162. package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
  163. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +8 -1
  164. package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
  165. package/dist/types/src/plugin/ui/auth-menu.d.ts.map +1 -1
  166. package/dist/types/src/plugin/ui/quota-status.d.ts.map +1 -1
  167. package/dist/types/src/plugin/vault-custody.d.ts +28 -7
  168. package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
  169. package/dist/types/src/plugin/vault-insula-quota.d.ts.map +1 -1
  170. package/dist/types/src/plugin/vault-sidebar-projection.d.ts.map +1 -1
  171. package/dist/types/src/process-heartbeat.d.ts +76 -0
  172. package/dist/types/src/process-heartbeat.d.ts.map +1 -0
  173. package/dist/types/src/setup.d.ts.map +1 -1
  174. package/dist/types/src/sidebar-state.d.ts +10 -1
  175. package/dist/types/src/sidebar-state.d.ts.map +1 -1
  176. package/package.json +2 -2
  177. package/src/common-auth-embedded/claustrum/consumer.d.ts +77 -2
  178. package/src/common-auth-embedded/claustrum/consumer.js +320 -35
  179. package/src/common-auth-embedded/claustrum/custody.d.ts +36 -1
  180. package/src/common-auth-embedded/claustrum/custody.js +95 -11
  181. package/src/common-auth-embedded/claustrum/enrollment.js +37 -12
  182. package/src/common-auth-embedded/claustrum/hub.d.ts +195 -0
  183. package/src/common-auth-embedded/claustrum/hub.js +988 -0
  184. package/src/common-auth-embedded/claustrum/index.d.ts +13 -3
  185. package/src/common-auth-embedded/claustrum/index.js +37 -4
  186. package/src/common-auth-embedded/claustrum/quota-writer.d.ts +8 -1
  187. package/src/common-auth-embedded/claustrum/quota-writer.js +34 -12
  188. package/src/common-auth-embedded/claustrum/roster.d.ts +49 -1
  189. package/src/common-auth-embedded/claustrum/roster.js +187 -12
  190. package/src/common-auth-embedded/claustrum/shutdown.js +42 -0
  191. package/src/common-auth-embedded/fs/file-read-cache.js +57 -0
  192. package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +1 -1
  193. package/src/common-auth-embedded/fs/refresh-file-lock.js +20 -11
  194. package/src/common-auth-embedded/opencode2/errors.d.ts +4 -1
  195. package/src/common-auth-embedded/opencode2/index.d.ts +2 -2
  196. package/src/common-auth-embedded/opencode2/index.js +1 -1
  197. package/src/common-auth-embedded/opencode2/install.d.ts +7 -5
  198. package/src/common-auth-embedded/opencode2/install.js +139 -13
  199. package/src/common-auth-embedded/opencode2/types.d.ts +42 -10
  200. package/src/common-auth-embedded/quota/commit-interval.d.ts +9 -0
  201. package/src/common-auth-embedded/quota/commit-interval.js +18 -0
  202. package/src/common-auth-embedded/rpc/rpc-server.js +29 -19
  203. package/src/common-auth-embedded/setup/command.js +52 -14
  204. package/src/common-auth-embedded/setup/register.d.ts +2 -0
  205. package/src/common-auth-embedded/setup/register.js +90 -11
  206. package/src/common-auth-embedded/source-output.json +145 -97
  207. package/src/common-auth-embedded/store/mutate.d.ts +2 -0
  208. package/src/common-auth-embedded/store/mutate.js +4 -0
  209. package/src/common-auth-embedded/store/pool.d.ts +6 -1
  210. package/src/common-auth-embedded/store/pool.js +1 -1
  211. package/src/common-auth-embedded/store/quota-writer.js +27 -13
  212. package/src/common-auth-embedded/store/settings.d.ts +1 -1
  213. package/src/common-auth-embedded/store/settings.js +16 -6
  214. package/src/plugin/command-data.ts +4 -2
  215. package/src/sidebar-state.ts +23 -3
  216. package/src/tui-compiled/sidebar-state.js +4 -3
  217. package/src/tui-compiled/tui/quota-layout.js +3 -2
  218. package/src/tui-ga-compiled/host-ga.js +2 -1
  219. package/src/tui-ga-compiled/shared/8ae1927e5910ea81-sidebar-projection.js +9 -2
  220. package/src/tui-ga-compiled/shared/dd4c9e1a907f8ef0-quota-layout.js +3 -2
  221. package/src/tui-ga-raw/host-ga.tsx +12 -1
  222. package/src/tui-ga-raw/shared/8ae1927e5910ea81-sidebar-projection.js +9 -2
  223. package/src/tui-ga-raw/shared/dd4c9e1a907f8ef0-quota-layout.tsx +9 -2
  224. package/src/tui-raw/sidebar-state.js +4 -3
  225. package/src/tui-raw/tui/quota-layout.tsx +9 -2
@@ -1,8 +1,10 @@
1
1
  import { isDeepStrictEqual } from 'node:util';
2
2
  import { writeJsonAtomic } from '../fs/atomic-write.js';
3
+ import { FileReadCache } from '../fs/file-read-cache.js';
4
+ import { windowsPrivateFiles } from '../fs/private-files.js';
3
5
  import { PoolOperationError } from './errors.js';
4
6
  import { assertNotInsideHook, runInsideHook } from './hooks.js';
5
- import { notReadyError, readPool, runOperation } from './mutate.js';
7
+ import { notReadyError, readPool, readPoolConfig, runOperation, } from './mutate.js';
6
8
  import { isRecord, POOL_KEY } from './schema.js';
7
9
  /**
8
10
  * Top-level config keys the pool owns: the legacy `version`, the legacy
@@ -58,12 +60,20 @@ function settingsRefusal(message) {
58
60
  message,
59
61
  });
60
62
  }
61
- /** Reads the settings without taking a lock or writing anything. */
63
+ const settingsCache = new FileReadCache();
64
+ /** Reads only the config's settings, without taking a lock or writing anything. */
62
65
  export async function readPoolSettings(rt) {
63
- const result = await readPool(rt.ctx);
64
- if (result.status === 'error')
65
- return result;
66
- return { status: result.status, settings: settingsOf(result.config) };
66
+ const read = async ([configPath = rt.ctx.configPath,] = []) => {
67
+ const result = await readPoolConfig(configPath);
68
+ if (result.status === 'error')
69
+ return { status: 'error', file: 'config', reason: result.reason };
70
+ return { status: result.status, settings: settingsOf(result.config) };
71
+ };
72
+ // Native Windows security checks cannot be replaced by a stat fingerprint.
73
+ const result = windowsPrivateFiles
74
+ ? await read()
75
+ : await settingsCache.read([rt.ctx.configPath], read);
76
+ return structuredClone(result);
67
77
  }
68
78
  /**
69
79
  * One locked read-modify-write of the plugin's settings in the config file
@@ -22,7 +22,7 @@ type CommandDataAccountMetadata = {
22
22
  accountIneligible?: boolean
23
23
  }
24
24
 
25
- type CommandDataQuotaGroup = 'gemini' | 'non-gemini'
25
+ type CommandDataQuotaGroup = 'gemini' | 'non-gemini' | 'gemini-argon'
26
26
 
27
27
  type CommandDataQuotaGroupSummary = {
28
28
  remainingFraction?: number
@@ -73,7 +73,7 @@ export interface CommandAccountRow {
73
73
  healthScore?: number
74
74
  cachedQuotaUpdatedAt?: number
75
75
  quota: Array<{
76
- key: 'gemini' | 'non-gemini'
76
+ key: 'gemini' | 'non-gemini' | 'gemini-argon'
77
77
  label: string
78
78
  remainingPercent: number | null
79
79
  resetAt?: number
@@ -97,11 +97,13 @@ const QUOTA_GROUP_LABELS: Record<
97
97
  > = {
98
98
  gemini: 'Gemini',
99
99
  'non-gemini': 'Non-Gemini',
100
+ 'gemini-argon': 'Argon',
100
101
  }
101
102
 
102
103
  const SUPPORTED_QUOTA_KEYS = [
103
104
  'gemini',
104
105
  'non-gemini',
106
+ 'gemini-argon',
105
107
  ] as const satisfies readonly CommandAccountRow['quota'][number]['key'][]
106
108
 
107
109
  interface LiveAccountSnapshot {
@@ -54,7 +54,7 @@ import { xdgState } from 'xdg-basedir'
54
54
 
55
55
  export const SIDEBAR_STATE_VERSION = 2 as const
56
56
 
57
- export type SidebarQuotaKey = 'gemini' | 'non-gemini'
57
+ export type SidebarQuotaKey = 'gemini' | 'non-gemini' | 'gemini-argon'
58
58
 
59
59
  export interface SidebarQuotaWindowEntry {
60
60
  window: 'weekly' | '5h'
@@ -328,7 +328,10 @@ function normalizeAccount(input: unknown): SidebarAccountState | null {
328
328
  const quotaRaw = record.quota
329
329
  const quota: SidebarAccountState['quota'] = {}
330
330
  if (isObject(quotaRaw)) {
331
- for (const key of ['gemini', 'non-gemini'] as const) {
331
+ // The Argon pool exists only on accounts that report it: readers carry
332
+ // any stored Argon reading, and accounts without one read exactly the
333
+ // two canonical pools, as before.
334
+ for (const key of ['gemini', 'non-gemini', 'gemini-argon'] as const) {
332
335
  const entry = (quotaRaw as Record<string, unknown>)[key]
333
336
  const normalized = normalizeQuota(entry)
334
337
  if (normalized) quota[key] = normalized
@@ -545,6 +548,16 @@ export interface SidebarAccountRedactionInput {
545
548
  resetTime: string
546
549
  }>
547
550
  }
551
+ // Reported only by paid Pro accounts with the Argon weekly allowance.
552
+ 'gemini-argon'?: {
553
+ remainingFraction?: number
554
+ resetTime?: string
555
+ windows?: Array<{
556
+ window: 'weekly' | '5h'
557
+ remainingFraction: number
558
+ resetTime: string
559
+ }>
560
+ }
548
561
  // Legacy per-pool keys written by older versions of the plugin.
549
562
  // Accepted here so the normalizer can map them to the current pool
550
563
  // keys at read time without requiring a disk migration.
@@ -685,6 +698,11 @@ export function normalizeLegacyCachedQuota(
685
698
  return {
686
699
  ...(gemini !== undefined ? { gemini } : {}),
687
700
  ...(nonGemini !== undefined ? { 'non-gemini': nonGemini } : {}),
701
+ // The Argon pool postdates the legacy pool keys, so a snapshot that
702
+ // carries both keeps its Argon pool untouched by the migration.
703
+ ...(raw['gemini-argon'] !== undefined
704
+ ? { 'gemini-argon': raw['gemini-argon'] }
705
+ : {}),
688
706
  }
689
707
  }
690
708
 
@@ -811,7 +829,9 @@ export function redactAccountForSidebar(
811
829
  ? undefined
812
830
  : normalizeLegacyCachedQuota(source.cachedQuota)
813
831
  if (cached) {
814
- for (const key of ['gemini', 'non-gemini'] as const) {
832
+ // The Argon pool is projected only when the account reports it, so an
833
+ // account without it serializes byte-identical to before.
834
+ for (const key of ['gemini', 'non-gemini', 'gemini-argon'] as const) {
815
835
  const entry = cached[key]
816
836
  if (!entry) continue
817
837
  const projected = projectQuotaPoolForSidebar(
@@ -98,7 +98,7 @@ function normalizeAccount(input) {
98
98
  return null;
99
99
  const enabled = record.enabled !== !1, health = clampNumber(toFiniteNumber(record.health), 0, 100), current = record.current === !0, cooldownUntil = toFiniteNumber(record.cooldownUntil) ?? void 0, quotaRaw = record.quota, quota = {};
100
100
  if (isObject(quotaRaw))
101
- for (const key of ["gemini", "non-gemini"]) {
101
+ for (const key of ["gemini", "non-gemini", "gemini-argon"]) {
102
102
  const entry = quotaRaw[key], normalized = normalizeQuota(entry);
103
103
  if (normalized)
104
104
  quota[key] = normalized;
@@ -246,7 +246,8 @@ export function normalizeLegacyCachedQuota(raw) {
246
246
  }, gemini = minFraction(raw.gemini, minFraction(raw["gemini-pro"], raw["gemini-flash"])) ?? raw.gemini, nonGemini = minFraction(raw["non-gemini"], minFraction(raw.claude, raw["gpt-oss"])) ?? raw["non-gemini"];
247
247
  return {
248
248
  ...gemini !== void 0 ? { gemini } : {},
249
- ...nonGemini !== void 0 ? { "non-gemini": nonGemini } : {}
249
+ ...nonGemini !== void 0 ? { "non-gemini": nonGemini } : {},
250
+ ...raw["gemini-argon"] !== void 0 ? { "gemini-argon": raw["gemini-argon"] } : {}
250
251
  };
251
252
  }
252
253
  export function projectQuotaPoolForSidebar(source, checkedAt) {
@@ -284,7 +285,7 @@ export function isAccountCurrent(index, activeIndexByFamily) {
284
285
  export function redactAccountForSidebar(source) {
285
286
  const id = `acct-${source.index}`, label = `Account ${source.index + 1}`, enabled = source.enabled !== !1, current = source.current === !0, cooldownUntil = typeof source.coolingDownUntil === "number" && Number.isFinite(source.coolingDownUntil) ? source.coolingDownUntil : void 0, health = clampNumber(typeof source.healthScore === "number" ? source.healthScore : 100, 0, 100), quota = {}, cached = typeof source.cachedQuotaAccountId === "string" && typeof source.currentQuotaAccountId === "string" && source.cachedQuotaAccountId !== source.currentQuotaAccountId ? void 0 : normalizeLegacyCachedQuota(source.cachedQuota);
286
287
  if (cached)
287
- for (const key of ["gemini", "non-gemini"]) {
288
+ for (const key of ["gemini", "non-gemini", "gemini-argon"]) {
288
289
  const entry = cached[key];
289
290
  if (!entry)
290
291
  continue;
@@ -48,9 +48,10 @@ export const DEFAULT_QUOTA_APPEARANCE = {
48
48
  // Group headers name each quota pool in plain words.
49
49
  export const GROUP_NAMES = {
50
50
  gemini: 'Gemini',
51
- 'non-gemini': 'Other models'
51
+ 'non-gemini': 'Other models',
52
+ 'gemini-argon': 'Argon'
52
53
  };
53
- export const QUOTA_ORDER = ['gemini', 'non-gemini'];
54
+ export const QUOTA_ORDER = ['gemini', 'non-gemini', 'gemini-argon'];
54
55
 
55
56
  // Shown instead of a stored figure once the window has reset since it was
56
57
  // read: the stored figure describes the window before the reset.
@@ -209,9 +209,10 @@ function checkAccount(value, path, issues) {
209
209
  if (!isRecord(value.quota)) {
210
210
  issues.push(`${path}.quota: expected quota readings`);
211
211
  } else {
212
- keys(value.quota, [], ['gemini', 'non-gemini'], `${path}.quota`, issues);
212
+ keys(value.quota, [], ['gemini', 'non-gemini', 'gemini-argon'], `${path}.quota`, issues);
213
213
  checkQuotaEntry(value.quota.gemini, `${path}.quota.gemini`, issues);
214
214
  checkQuotaEntry(value.quota['non-gemini'], `${path}.quota.non-gemini`, issues);
215
+ checkQuotaEntry(value.quota['gemini-argon'], `${path}.quota.gemini-argon`, issues);
215
216
  }
216
217
  if (value.tier !== undefined) {
217
218
  const tier = value.tier;
@@ -1,9 +1,14 @@
1
1
  import { quotaReadingParts } from "./98cc0c186c46c42d-quota-presentation.js";
2
2
  export const QUOTA_POOL_LABELS = {
3
3
  gemini: "Gemini",
4
- "non-gemini": "Other models"
4
+ "non-gemini": "Other models",
5
+ "gemini-argon": "Argon"
5
6
  };
6
- const POOL_ORDER = ["gemini", "non-gemini"];
7
+ const POOL_ORDER = [
8
+ "gemini",
9
+ "non-gemini",
10
+ "gemini-argon"
11
+ ];
7
12
  function clamp(value) {
8
13
  if (!Number.isFinite(value))
9
14
  return 0;
@@ -47,6 +52,8 @@ function quotaRows(account, now) {
47
52
  for (const key of POOL_ORDER) {
48
53
  const entry = account.quota[key], label = QUOTA_POOL_LABELS[key];
49
54
  if (!entry) {
55
+ if (key === "gemini-argon")
56
+ continue;
50
57
  rows.push({
51
58
  label,
52
59
  remaining: null,
@@ -48,9 +48,10 @@ export const DEFAULT_QUOTA_APPEARANCE = {
48
48
  // Group headers name each quota pool in plain words.
49
49
  export const GROUP_NAMES = {
50
50
  gemini: 'Gemini',
51
- 'non-gemini': 'Other models'
51
+ 'non-gemini': 'Other models',
52
+ 'gemini-argon': 'Argon'
52
53
  };
53
- export const QUOTA_ORDER = ['gemini', 'non-gemini'];
54
+ export const QUOTA_ORDER = ['gemini', 'non-gemini', 'gemini-argon'];
54
55
 
55
56
  // Shown instead of a stored figure once the window has reset since it was
56
57
  // read: the stored figure describes the window before the reset.
@@ -472,13 +472,24 @@ function checkAccount(value: unknown, path: string, issues: Issues) {
472
472
  if (!isRecord(value.quota)) {
473
473
  issues.push(`${path}.quota: expected quota readings`)
474
474
  } else {
475
- keys(value.quota, [], ['gemini', 'non-gemini'], `${path}.quota`, issues)
475
+ keys(
476
+ value.quota,
477
+ [],
478
+ ['gemini', 'non-gemini', 'gemini-argon'],
479
+ `${path}.quota`,
480
+ issues,
481
+ )
476
482
  checkQuotaEntry(value.quota.gemini, `${path}.quota.gemini`, issues)
477
483
  checkQuotaEntry(
478
484
  value.quota['non-gemini'],
479
485
  `${path}.quota.non-gemini`,
480
486
  issues,
481
487
  )
488
+ checkQuotaEntry(
489
+ value.quota['gemini-argon'],
490
+ `${path}.quota.gemini-argon`,
491
+ issues,
492
+ )
482
493
  }
483
494
  if (value.tier !== undefined) {
484
495
  const tier = value.tier
@@ -1,9 +1,14 @@
1
1
  import { quotaReadingParts } from "./98cc0c186c46c42d-quota-presentation.js";
2
2
  export const QUOTA_POOL_LABELS = {
3
3
  gemini: "Gemini",
4
- "non-gemini": "Other models"
4
+ "non-gemini": "Other models",
5
+ "gemini-argon": "Argon"
5
6
  };
6
- const POOL_ORDER = ["gemini", "non-gemini"];
7
+ const POOL_ORDER = [
8
+ "gemini",
9
+ "non-gemini",
10
+ "gemini-argon"
11
+ ];
7
12
  function clamp(value) {
8
13
  if (!Number.isFinite(value))
9
14
  return 0;
@@ -47,6 +52,8 @@ function quotaRows(account, now) {
47
52
  for (const key of POOL_ORDER) {
48
53
  const entry = account.quota[key], label = QUOTA_POOL_LABELS[key];
49
54
  if (!entry) {
55
+ if (key === "gemini-argon")
56
+ continue;
50
57
  rows.push({
51
58
  label,
52
59
  remaining: null,
@@ -58,7 +58,7 @@ export const DEFAULT_QUOTA_APPEARANCE: QuotaAppearance = {
58
58
  errorThreshold: 80,
59
59
  }
60
60
 
61
- export type QuotaGroupKey = 'gemini' | 'non-gemini'
61
+ export type QuotaGroupKey = 'gemini' | 'non-gemini' | 'gemini-argon'
62
62
 
63
63
  export interface QuotaLayoutWindow {
64
64
  readonly window: 'weekly' | '5h'
@@ -80,6 +80,8 @@ export interface QuotaLayoutAccount {
80
80
  readonly quota: {
81
81
  readonly gemini?: QuotaLayoutEntry
82
82
  readonly 'non-gemini'?: QuotaLayoutEntry
83
+ /** Present only on accounts whose reading reports the Argon pool. */
84
+ readonly 'gemini-argon'?: QuotaLayoutEntry
83
85
  }
84
86
  }
85
87
 
@@ -87,9 +89,14 @@ export interface QuotaLayoutAccount {
87
89
  export const GROUP_NAMES: Record<QuotaGroupKey, string> = {
88
90
  gemini: 'Gemini',
89
91
  'non-gemini': 'Other models',
92
+ 'gemini-argon': 'Argon',
90
93
  }
91
94
 
92
- export const QUOTA_ORDER: readonly QuotaGroupKey[] = ['gemini', 'non-gemini']
95
+ export const QUOTA_ORDER: readonly QuotaGroupKey[] = [
96
+ 'gemini',
97
+ 'non-gemini',
98
+ 'gemini-argon',
99
+ ]
93
100
 
94
101
  // Shown instead of a stored figure once the window has reset since it was
95
102
  // read: the stored figure describes the window before the reset.
@@ -98,7 +98,7 @@ function normalizeAccount(input) {
98
98
  return null;
99
99
  const enabled = record.enabled !== !1, health = clampNumber(toFiniteNumber(record.health), 0, 100), current = record.current === !0, cooldownUntil = toFiniteNumber(record.cooldownUntil) ?? void 0, quotaRaw = record.quota, quota = {};
100
100
  if (isObject(quotaRaw))
101
- for (const key of ["gemini", "non-gemini"]) {
101
+ for (const key of ["gemini", "non-gemini", "gemini-argon"]) {
102
102
  const entry = quotaRaw[key], normalized = normalizeQuota(entry);
103
103
  if (normalized)
104
104
  quota[key] = normalized;
@@ -246,7 +246,8 @@ export function normalizeLegacyCachedQuota(raw) {
246
246
  }, gemini = minFraction(raw.gemini, minFraction(raw["gemini-pro"], raw["gemini-flash"])) ?? raw.gemini, nonGemini = minFraction(raw["non-gemini"], minFraction(raw.claude, raw["gpt-oss"])) ?? raw["non-gemini"];
247
247
  return {
248
248
  ...gemini !== void 0 ? { gemini } : {},
249
- ...nonGemini !== void 0 ? { "non-gemini": nonGemini } : {}
249
+ ...nonGemini !== void 0 ? { "non-gemini": nonGemini } : {},
250
+ ...raw["gemini-argon"] !== void 0 ? { "gemini-argon": raw["gemini-argon"] } : {}
250
251
  };
251
252
  }
252
253
  export function projectQuotaPoolForSidebar(source, checkedAt) {
@@ -284,7 +285,7 @@ export function isAccountCurrent(index, activeIndexByFamily) {
284
285
  export function redactAccountForSidebar(source) {
285
286
  const id = `acct-${source.index}`, label = `Account ${source.index + 1}`, enabled = source.enabled !== !1, current = source.current === !0, cooldownUntil = typeof source.coolingDownUntil === "number" && Number.isFinite(source.coolingDownUntil) ? source.coolingDownUntil : void 0, health = clampNumber(typeof source.healthScore === "number" ? source.healthScore : 100, 0, 100), quota = {}, cached = typeof source.cachedQuotaAccountId === "string" && typeof source.currentQuotaAccountId === "string" && source.cachedQuotaAccountId !== source.currentQuotaAccountId ? void 0 : normalizeLegacyCachedQuota(source.cachedQuota);
286
287
  if (cached)
287
- for (const key of ["gemini", "non-gemini"]) {
288
+ for (const key of ["gemini", "non-gemini", "gemini-argon"]) {
288
289
  const entry = cached[key];
289
290
  if (!entry)
290
291
  continue;
@@ -58,7 +58,7 @@ export const DEFAULT_QUOTA_APPEARANCE: QuotaAppearance = {
58
58
  errorThreshold: 80,
59
59
  }
60
60
 
61
- export type QuotaGroupKey = 'gemini' | 'non-gemini'
61
+ export type QuotaGroupKey = 'gemini' | 'non-gemini' | 'gemini-argon'
62
62
 
63
63
  export interface QuotaLayoutWindow {
64
64
  readonly window: 'weekly' | '5h'
@@ -80,6 +80,8 @@ export interface QuotaLayoutAccount {
80
80
  readonly quota: {
81
81
  readonly gemini?: QuotaLayoutEntry
82
82
  readonly 'non-gemini'?: QuotaLayoutEntry
83
+ /** Present only on accounts whose reading reports the Argon pool. */
84
+ readonly 'gemini-argon'?: QuotaLayoutEntry
83
85
  }
84
86
  }
85
87
 
@@ -87,9 +89,14 @@ export interface QuotaLayoutAccount {
87
89
  export const GROUP_NAMES: Record<QuotaGroupKey, string> = {
88
90
  gemini: 'Gemini',
89
91
  'non-gemini': 'Other models',
92
+ 'gemini-argon': 'Argon',
90
93
  }
91
94
 
92
- export const QUOTA_ORDER: readonly QuotaGroupKey[] = ['gemini', 'non-gemini']
95
+ export const QUOTA_ORDER: readonly QuotaGroupKey[] = [
96
+ 'gemini',
97
+ 'non-gemini',
98
+ 'gemini-argon',
99
+ ]
93
100
 
94
101
  // Shown instead of a stored figure once the window has reset since it was
95
102
  // read: the stored figure describes the window before the reset.