codex-multi-auth 2.18.0 → 2.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/README.md +2 -2
  3. package/dist/lib/account-policy.d.ts +3 -1
  4. package/dist/lib/account-policy.js +21 -5
  5. package/dist/lib/codex-manager/commands/history.js +3 -1
  6. package/dist/lib/codex-manager/commands/status.js +8 -3
  7. package/dist/lib/codex-manager/dashboard-settings-data.js +2 -0
  8. package/dist/lib/codex-manager/formatters/subscription-status.d.ts +16 -0
  9. package/dist/lib/codex-manager/formatters/subscription-status.js +69 -0
  10. package/dist/lib/codex-manager/formatters/text-style.js +4 -1
  11. package/dist/lib/codex-manager/health-check.js +17 -12
  12. package/dist/lib/codex-manager/quota-cache-helpers.js +8 -4
  13. package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +1 -1
  14. package/dist/lib/codex-manager/settings-hub/dashboard.js +4 -0
  15. package/dist/lib/codex-manager/settings-panels.d.ts +1 -0
  16. package/dist/lib/codex-manager/settings-panels.js +1 -0
  17. package/dist/lib/codex-manager/theme-settings-panel.d.ts +2 -1
  18. package/dist/lib/codex-manager/theme-settings-panel.js +39 -0
  19. package/dist/lib/dashboard-settings.d.ts +2 -0
  20. package/dist/lib/dashboard-settings.js +18 -0
  21. package/dist/lib/model-route-policy.d.ts +5 -5
  22. package/dist/lib/quota-cache.d.ts +6 -0
  23. package/dist/lib/quota-cache.js +33 -16
  24. package/dist/lib/quota-probe.d.ts +3 -0
  25. package/dist/lib/quota-probe.js +5 -4
  26. package/dist/lib/quota-readiness.d.ts +3 -3
  27. package/dist/lib/quota-readiness.js +6 -2
  28. package/dist/lib/request/url-rewriting.js +3 -1
  29. package/dist/lib/runtime/account-model-catalog.d.ts +5 -5
  30. package/dist/lib/runtime/account-reset-credits.d.ts +2 -2
  31. package/dist/lib/runtime/model-discovery-status.d.ts +5 -5
  32. package/dist/lib/runtime/reset-credits.d.ts +7 -7
  33. package/dist/lib/runtime/resume-picker.js +1 -1
  34. package/dist/lib/runtime/subscription-first-use.js +1 -1
  35. package/dist/lib/runtime/workspace-model-scopes.d.ts +3 -3
  36. package/dist/lib/schemas.d.ts +65 -65
  37. package/dist/lib/ui/index.d.ts +1 -1
  38. package/dist/lib/ui/index.js +1 -1
  39. package/dist/lib/ui/runtime.d.ts +3 -1
  40. package/dist/lib/ui/runtime.js +11 -1
  41. package/dist/lib/ui/theme.d.ts +20 -1
  42. package/dist/lib/ui/theme.js +154 -30
  43. package/dist/lib/ui/ui-copy.d.ts +3 -2
  44. package/dist/lib/ui/ui-copy.js +3 -2
  45. package/package.json +25 -24
  46. package/scripts/codex.js +70 -3
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/lib/account-policy.d.ts.map +0 -1
  49. package/dist/lib/accounts/rate-limits.d.ts.map +0 -1
  50. package/dist/lib/accounts.d.ts.map +0 -1
  51. package/dist/lib/api-route-store.d.ts.map +0 -1
  52. package/dist/lib/audit.d.ts.map +0 -1
  53. package/dist/lib/auth/account-access.d.ts.map +0 -1
  54. package/dist/lib/auth/auth.d.ts.map +0 -1
  55. package/dist/lib/auth/browser.d.ts.map +0 -1
  56. package/dist/lib/auth/callback-guidance.d.ts.map +0 -1
  57. package/dist/lib/auth/device-auth.d.ts.map +0 -1
  58. package/dist/lib/auth/index.d.ts.map +0 -1
  59. package/dist/lib/auth/org-override.d.ts.map +0 -1
  60. package/dist/lib/auth/server.d.ts.map +0 -1
  61. package/dist/lib/auth/token-utils.d.ts.map +0 -1
  62. package/dist/lib/auth-rate-limit.d.ts.map +0 -1
  63. package/dist/lib/budget-guard.d.ts.map +0 -1
  64. package/dist/lib/capability-policy.d.ts.map +0 -1
  65. package/dist/lib/circuit-breaker.d.ts.map +0 -1
  66. package/dist/lib/cli.d.ts.map +0 -1
  67. package/dist/lib/codex-cli/index.d.ts.map +0 -1
  68. package/dist/lib/codex-cli/observability.d.ts.map +0 -1
  69. package/dist/lib/codex-cli/state.d.ts.map +0 -1
  70. package/dist/lib/codex-cli/sync.d.ts.map +0 -1
  71. package/dist/lib/codex-cli/writer.d.ts.map +0 -1
  72. package/dist/lib/codex-manager/account-credentials.d.ts.map +0 -1
  73. package/dist/lib/codex-manager/account-manager-commands.d.ts.map +0 -1
  74. package/dist/lib/codex-manager/account-pool-write.d.ts.map +0 -1
  75. package/dist/lib/codex-manager/api-login-menu.d.ts.map +0 -1
  76. package/dist/lib/codex-manager/backend-category-entry.d.ts.map +0 -1
  77. package/dist/lib/codex-manager/backend-category-helpers.d.ts.map +0 -1
  78. package/dist/lib/codex-manager/backend-category-prompt.d.ts.map +0 -1
  79. package/dist/lib/codex-manager/backend-settings-controller.d.ts.map +0 -1
  80. package/dist/lib/codex-manager/backend-settings-entry.d.ts.map +0 -1
  81. package/dist/lib/codex-manager/backend-settings-helpers.d.ts.map +0 -1
  82. package/dist/lib/codex-manager/backend-settings-prompt.d.ts.map +0 -1
  83. package/dist/lib/codex-manager/backend-settings-schema.d.ts.map +0 -1
  84. package/dist/lib/codex-manager/behavior-settings-panel.d.ts.map +0 -1
  85. package/dist/lib/codex-manager/commands/account.d.ts.map +0 -1
  86. package/dist/lib/codex-manager/commands/best.d.ts.map +0 -1
  87. package/dist/lib/codex-manager/commands/bridge.d.ts.map +0 -1
  88. package/dist/lib/codex-manager/commands/budget.d.ts.map +0 -1
  89. package/dist/lib/codex-manager/commands/check.d.ts.map +0 -1
  90. package/dist/lib/codex-manager/commands/config-explain.d.ts.map +0 -1
  91. package/dist/lib/codex-manager/commands/debug-bundle.d.ts.map +0 -1
  92. package/dist/lib/codex-manager/commands/forecast.d.ts.map +0 -1
  93. package/dist/lib/codex-manager/commands/history.d.ts.map +0 -1
  94. package/dist/lib/codex-manager/commands/init-config.d.ts.map +0 -1
  95. package/dist/lib/codex-manager/commands/integrations.d.ts.map +0 -1
  96. package/dist/lib/codex-manager/commands/limits.d.ts.map +0 -1
  97. package/dist/lib/codex-manager/commands/models.d.ts.map +0 -1
  98. package/dist/lib/codex-manager/commands/monitor.d.ts.map +0 -1
  99. package/dist/lib/codex-manager/commands/report.d.ts.map +0 -1
  100. package/dist/lib/codex-manager/commands/resets.d.ts.map +0 -1
  101. package/dist/lib/codex-manager/commands/rotation.d.ts.map +0 -1
  102. package/dist/lib/codex-manager/commands/status.d.ts.map +0 -1
  103. package/dist/lib/codex-manager/commands/switch.d.ts.map +0 -1
  104. package/dist/lib/codex-manager/commands/uninstall.d.ts.map +0 -1
  105. package/dist/lib/codex-manager/commands/unpin.d.ts.map +0 -1
  106. package/dist/lib/codex-manager/commands/usage.d.ts.map +0 -1
  107. package/dist/lib/codex-manager/commands/verify.d.ts.map +0 -1
  108. package/dist/lib/codex-manager/commands/why-selected.d.ts.map +0 -1
  109. package/dist/lib/codex-manager/commands/workspace.d.ts.map +0 -1
  110. package/dist/lib/codex-manager/dashboard-display-panel.d.ts.map +0 -1
  111. package/dist/lib/codex-manager/dashboard-formatters.d.ts.map +0 -1
  112. package/dist/lib/codex-manager/dashboard-settings-controller.d.ts.map +0 -1
  113. package/dist/lib/codex-manager/dashboard-settings-data.d.ts.map +0 -1
  114. package/dist/lib/codex-manager/dashboard-settings-entry.d.ts.map +0 -1
  115. package/dist/lib/codex-manager/experimental-settings-entry.d.ts.map +0 -1
  116. package/dist/lib/codex-manager/experimental-settings-prompt.d.ts.map +0 -1
  117. package/dist/lib/codex-manager/experimental-settings-schema.d.ts.map +0 -1
  118. package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts.map +0 -1
  119. package/dist/lib/codex-manager/experimental-sync-target.d.ts.map +0 -1
  120. package/dist/lib/codex-manager/forecast-report-shared.d.ts.map +0 -1
  121. package/dist/lib/codex-manager/formatters/account-formatters.d.ts.map +0 -1
  122. package/dist/lib/codex-manager/formatters/index.d.ts.map +0 -1
  123. package/dist/lib/codex-manager/formatters/model-formatters.d.ts.map +0 -1
  124. package/dist/lib/codex-manager/formatters/quota-formatters.d.ts.map +0 -1
  125. package/dist/lib/codex-manager/formatters/text-style.d.ts.map +0 -1
  126. package/dist/lib/codex-manager/health-check.d.ts.map +0 -1
  127. package/dist/lib/codex-manager/help.d.ts.map +0 -1
  128. package/dist/lib/codex-manager/login-action-panel.d.ts.map +0 -1
  129. package/dist/lib/codex-manager/login-flow.d.ts.map +0 -1
  130. package/dist/lib/codex-manager/login-menu-actions.d.ts.map +0 -1
  131. package/dist/lib/codex-manager/login-menu-data.d.ts.map +0 -1
  132. package/dist/lib/codex-manager/login-oauth.d.ts.map +0 -1
  133. package/dist/lib/codex-manager/login-workspace-choice.d.ts.map +0 -1
  134. package/dist/lib/codex-manager/manual-callback.d.ts.map +0 -1
  135. package/dist/lib/codex-manager/persist-selected-account.d.ts.map +0 -1
  136. package/dist/lib/codex-manager/quota-cache-helpers.d.ts.map +0 -1
  137. package/dist/lib/codex-manager/rate-limit-markers.d.ts.map +0 -1
  138. package/dist/lib/codex-manager/repair-commands.d.ts.map +0 -1
  139. package/dist/lib/codex-manager/settings-hub/backend.d.ts.map +0 -1
  140. package/dist/lib/codex-manager/settings-hub/dashboard.d.ts.map +0 -1
  141. package/dist/lib/codex-manager/settings-hub/experimental.d.ts.map +0 -1
  142. package/dist/lib/codex-manager/settings-hub/index.d.ts.map +0 -1
  143. package/dist/lib/codex-manager/settings-hub/shared.d.ts.map +0 -1
  144. package/dist/lib/codex-manager/settings-hub-entry.d.ts.map +0 -1
  145. package/dist/lib/codex-manager/settings-hub-menu.d.ts.map +0 -1
  146. package/dist/lib/codex-manager/settings-hub-prompt.d.ts.map +0 -1
  147. package/dist/lib/codex-manager/settings-hub.d.ts.map +0 -1
  148. package/dist/lib/codex-manager/settings-panels.d.ts.map +0 -1
  149. package/dist/lib/codex-manager/settings-persist-utils.d.ts.map +0 -1
  150. package/dist/lib/codex-manager/settings-preview.d.ts.map +0 -1
  151. package/dist/lib/codex-manager/settings-write-queue.d.ts.map +0 -1
  152. package/dist/lib/codex-manager/statusline-settings-panel.d.ts.map +0 -1
  153. package/dist/lib/codex-manager/theme-settings-panel.d.ts.map +0 -1
  154. package/dist/lib/codex-manager/unified-settings-controller.d.ts.map +0 -1
  155. package/dist/lib/codex-manager/unified-settings-entry.d.ts.map +0 -1
  156. package/dist/lib/codex-manager.d.ts.map +0 -1
  157. package/dist/lib/concurrency.d.ts.map +0 -1
  158. package/dist/lib/config-schema.d.ts.map +0 -1
  159. package/dist/lib/config.d.ts.map +0 -1
  160. package/dist/lib/constants.d.ts.map +0 -1
  161. package/dist/lib/context-budget/model-context-windows.d.ts.map +0 -1
  162. package/dist/lib/context-budget-guard.d.ts.map +0 -1
  163. package/dist/lib/context-budget-response.d.ts.map +0 -1
  164. package/dist/lib/context-overflow.d.ts.map +0 -1
  165. package/dist/lib/dashboard-settings.d.ts.map +0 -1
  166. package/dist/lib/entitlement-cache.d.ts.map +0 -1
  167. package/dist/lib/env-parsing.d.ts.map +0 -1
  168. package/dist/lib/errors.d.ts.map +0 -1
  169. package/dist/lib/forecast.d.ts.map +0 -1
  170. package/dist/lib/fs-retry.d.ts.map +0 -1
  171. package/dist/lib/health.d.ts.map +0 -1
  172. package/dist/lib/index.d.ts.map +0 -1
  173. package/dist/lib/integration-generators.d.ts.map +0 -1
  174. package/dist/lib/live-account-sync.d.ts.map +0 -1
  175. package/dist/lib/local-bridge.d.ts.map +0 -1
  176. package/dist/lib/local-client-tokens.d.ts.map +0 -1
  177. package/dist/lib/logger.d.ts.map +0 -1
  178. package/dist/lib/model-capability-matrix.d.ts.map +0 -1
  179. package/dist/lib/model-route-policy.d.ts.map +0 -1
  180. package/dist/lib/named-backup-export.d.ts.map +0 -1
  181. package/dist/lib/oc-chatgpt-import-adapter.d.ts.map +0 -1
  182. package/dist/lib/oc-chatgpt-orchestrator.d.ts.map +0 -1
  183. package/dist/lib/oc-chatgpt-target-detection.d.ts.map +0 -1
  184. package/dist/lib/parallel-probe.d.ts.map +0 -1
  185. package/dist/lib/policy/runtime-policy.d.ts.map +0 -1
  186. package/dist/lib/preemptive-quota-scheduler.d.ts.map +0 -1
  187. package/dist/lib/proactive-refresh.d.ts.map +0 -1
  188. package/dist/lib/prompts/codex-host-bridge.d.ts.map +0 -1
  189. package/dist/lib/prompts/codex.d.ts.map +0 -1
  190. package/dist/lib/prompts/fetch-utils.d.ts.map +0 -1
  191. package/dist/lib/prompts/host-codex-prompt.d.ts.map +0 -1
  192. package/dist/lib/quota-cache.d.ts.map +0 -1
  193. package/dist/lib/quota-probe.d.ts.map +0 -1
  194. package/dist/lib/quota-readiness.d.ts.map +0 -1
  195. package/dist/lib/recovery/constants.d.ts.map +0 -1
  196. package/dist/lib/recovery/storage.d.ts.map +0 -1
  197. package/dist/lib/recovery/types.d.ts.map +0 -1
  198. package/dist/lib/recovery.d.ts.map +0 -1
  199. package/dist/lib/redaction.d.ts.map +0 -1
  200. package/dist/lib/refresh-guardian.d.ts.map +0 -1
  201. package/dist/lib/refresh-lease.d.ts.map +0 -1
  202. package/dist/lib/refresh-queue.d.ts.map +0 -1
  203. package/dist/lib/request/client-cancellation.d.ts.map +0 -1
  204. package/dist/lib/request/error-classification.d.ts.map +0 -1
  205. package/dist/lib/request/failover-config.d.ts.map +0 -1
  206. package/dist/lib/request/failure-policy.d.ts.map +0 -1
  207. package/dist/lib/request/fetch-helpers.d.ts.map +0 -1
  208. package/dist/lib/request/headers.d.ts.map +0 -1
  209. package/dist/lib/request/helpers/input-utils.d.ts.map +0 -1
  210. package/dist/lib/request/helpers/model-map.d.ts.map +0 -1
  211. package/dist/lib/request/helpers/tool-utils.d.ts.map +0 -1
  212. package/dist/lib/request/index.d.ts.map +0 -1
  213. package/dist/lib/request/rate-limit-backoff.d.ts.map +0 -1
  214. package/dist/lib/request/rate-limit-decision.d.ts.map +0 -1
  215. package/dist/lib/request/request-attempt-budget.d.ts.map +0 -1
  216. package/dist/lib/request/request-init.d.ts.map +0 -1
  217. package/dist/lib/request/request-resilience.d.ts.map +0 -1
  218. package/dist/lib/request/request-transformer.d.ts.map +0 -1
  219. package/dist/lib/request/response-compaction.d.ts.map +0 -1
  220. package/dist/lib/request/response-handler.d.ts.map +0 -1
  221. package/dist/lib/request/response-metadata.d.ts.map +0 -1
  222. package/dist/lib/request/response-outcome.d.ts.map +0 -1
  223. package/dist/lib/request/stream-failover-runtime.d.ts.map +0 -1
  224. package/dist/lib/request/stream-failover.d.ts.map +0 -1
  225. package/dist/lib/request/token-refresh.d.ts.map +0 -1
  226. package/dist/lib/request/url-rewriting.d.ts.map +0 -1
  227. package/dist/lib/request/wait-utils.d.ts.map +0 -1
  228. package/dist/lib/rotation.d.ts.map +0 -1
  229. package/dist/lib/routing-mutex.d.ts.map +0 -1
  230. package/dist/lib/routing-profiles.d.ts.map +0 -1
  231. package/dist/lib/runtime/account-check-helpers.d.ts.map +0 -1
  232. package/dist/lib/runtime/account-check-types.d.ts.map +0 -1
  233. package/dist/lib/runtime/account-check.d.ts.map +0 -1
  234. package/dist/lib/runtime/account-manager-cache-entry.d.ts.map +0 -1
  235. package/dist/lib/runtime/account-manager-cache.d.ts.map +0 -1
  236. package/dist/lib/runtime/account-model-catalog.d.ts.map +0 -1
  237. package/dist/lib/runtime/account-pool.d.ts.map +0 -1
  238. package/dist/lib/runtime/account-reset-credits.d.ts.map +0 -1
  239. package/dist/lib/runtime/account-scope.d.ts.map +0 -1
  240. package/dist/lib/runtime/account-select-event.d.ts.map +0 -1
  241. package/dist/lib/runtime/account-selection.d.ts.map +0 -1
  242. package/dist/lib/runtime/account-state.d.ts.map +0 -1
  243. package/dist/lib/runtime/account-status.d.ts.map +0 -1
  244. package/dist/lib/runtime/account-storage-scope-entry.d.ts.map +0 -1
  245. package/dist/lib/runtime/api-model-capabilities.d.ts.map +0 -1
  246. package/dist/lib/runtime/api-model-runtime.d.ts.map +0 -1
  247. package/dist/lib/runtime/app-bind.d.ts.map +0 -1
  248. package/dist/lib/runtime/app-helper-selection.d.ts.map +0 -1
  249. package/dist/lib/runtime/auth-facade.d.ts.map +0 -1
  250. package/dist/lib/runtime/automatic-account-checks.d.ts.map +0 -1
  251. package/dist/lib/runtime/automatic-subscription-checks.d.ts.map +0 -1
  252. package/dist/lib/runtime/browser-oauth-flow.d.ts.map +0 -1
  253. package/dist/lib/runtime/capability-boost.d.ts.map +0 -1
  254. package/dist/lib/runtime/catalog-capabilities.d.ts.map +0 -1
  255. package/dist/lib/runtime/config-toml.d.ts.map +0 -1
  256. package/dist/lib/runtime/context-budget-settings.d.ts.map +0 -1
  257. package/dist/lib/runtime/event-handler.d.ts.map +0 -1
  258. package/dist/lib/runtime/first-run.d.ts.map +0 -1
  259. package/dist/lib/runtime/flagged-verify-types.d.ts.map +0 -1
  260. package/dist/lib/runtime/hydrate-emails.d.ts.map +0 -1
  261. package/dist/lib/runtime/inference-activity.d.ts.map +0 -1
  262. package/dist/lib/runtime/live-sync-entry.d.ts.map +0 -1
  263. package/dist/lib/runtime/live-sync.d.ts.map +0 -1
  264. package/dist/lib/runtime/loader-setup.d.ts.map +0 -1
  265. package/dist/lib/runtime/login-menu-accounts.d.ts.map +0 -1
  266. package/dist/lib/runtime/manual-oauth-flow.d.ts.map +0 -1
  267. package/dist/lib/runtime/model-discovery-status.d.ts.map +0 -1
  268. package/dist/lib/runtime/native-account-storage.d.ts.map +0 -1
  269. package/dist/lib/runtime/native-account-sync.d.ts.map +0 -1
  270. package/dist/lib/runtime/native-binding-lock.d.ts.map +0 -1
  271. package/dist/lib/runtime/native-client-auth.d.ts.map +0 -1
  272. package/dist/lib/runtime/native-provider-config.d.ts.map +0 -1
  273. package/dist/lib/runtime/native-rate-limits.d.ts.map +0 -1
  274. package/dist/lib/runtime/preemptive-quota.d.ts.map +0 -1
  275. package/dist/lib/runtime/quota-headers.d.ts.map +0 -1
  276. package/dist/lib/runtime/quota-probe.d.ts.map +0 -1
  277. package/dist/lib/runtime/quota-settings.d.ts.map +0 -1
  278. package/dist/lib/runtime/refresh-guardian-entry.d.ts.map +0 -1
  279. package/dist/lib/runtime/refresh-guardian.d.ts.map +0 -1
  280. package/dist/lib/runtime/request-init.d.ts.map +0 -1
  281. package/dist/lib/runtime/reset-credit-routing.d.ts.map +0 -1
  282. package/dist/lib/runtime/reset-credits.d.ts.map +0 -1
  283. package/dist/lib/runtime/response-output-history.d.ts.map +0 -1
  284. package/dist/lib/runtime/responses-websocket.d.ts.map +0 -1
  285. package/dist/lib/runtime/resume-picker.d.ts.map +0 -1
  286. package/dist/lib/runtime/rotation-account-selection.d.ts.map +0 -1
  287. package/dist/lib/runtime/rotation-proxy-state.d.ts.map +0 -1
  288. package/dist/lib/runtime/rotation-server-types.d.ts.map +0 -1
  289. package/dist/lib/runtime/rotation-storage-meta.d.ts.map +0 -1
  290. package/dist/lib/runtime/rotation-token-refresh.d.ts.map +0 -1
  291. package/dist/lib/runtime/runtime-capability-failures.d.ts.map +0 -1
  292. package/dist/lib/runtime/runtime-current-account.d.ts.map +0 -1
  293. package/dist/lib/runtime/runtime-observability.d.ts.map +0 -1
  294. package/dist/lib/runtime/runtime-services.d.ts.map +0 -1
  295. package/dist/lib/runtime/session-affinity-entry.d.ts.map +0 -1
  296. package/dist/lib/runtime/session-recovery.d.ts.map +0 -1
  297. package/dist/lib/runtime/status-marker.d.ts.map +0 -1
  298. package/dist/lib/runtime/storage-scope.d.ts.map +0 -1
  299. package/dist/lib/runtime/subscription-first-use.d.ts.map +0 -1
  300. package/dist/lib/runtime/subscription-quota-event.d.ts.map +0 -1
  301. package/dist/lib/runtime/subscription-quota-order.d.ts.map +0 -1
  302. package/dist/lib/runtime/toast.d.ts.map +0 -1
  303. package/dist/lib/runtime/ui-runtime-entry.d.ts.map +0 -1
  304. package/dist/lib/runtime/ui-runtime.d.ts.map +0 -1
  305. package/dist/lib/runtime/verify-flagged.d.ts.map +0 -1
  306. package/dist/lib/runtime/workspace-model-scopes.d.ts.map +0 -1
  307. package/dist/lib/runtime-constants.d.ts.map +0 -1
  308. package/dist/lib/runtime-paths.d.ts.map +0 -1
  309. package/dist/lib/runtime-rotation-proxy.d.ts.map +0 -1
  310. package/dist/lib/schemas.d.ts.map +0 -1
  311. package/dist/lib/session-affinity.d.ts.map +0 -1
  312. package/dist/lib/shutdown.d.ts.map +0 -1
  313. package/dist/lib/storage/account-clear-entry.d.ts.map +0 -1
  314. package/dist/lib/storage/account-clear.d.ts.map +0 -1
  315. package/dist/lib/storage/account-match-utils.d.ts.map +0 -1
  316. package/dist/lib/storage/account-persistence.d.ts.map +0 -1
  317. package/dist/lib/storage/account-port.d.ts.map +0 -1
  318. package/dist/lib/storage/account-save-entry.d.ts.map +0 -1
  319. package/dist/lib/storage/account-save.d.ts.map +0 -1
  320. package/dist/lib/storage/account-snapshot.d.ts.map +0 -1
  321. package/dist/lib/storage/backup-metadata-builder.d.ts.map +0 -1
  322. package/dist/lib/storage/backup-metadata.d.ts.map +0 -1
  323. package/dist/lib/storage/backup-paths.d.ts.map +0 -1
  324. package/dist/lib/storage/backup-restore.d.ts.map +0 -1
  325. package/dist/lib/storage/cache-artifacts.d.ts.map +0 -1
  326. package/dist/lib/storage/credential-sidecars.d.ts.map +0 -1
  327. package/dist/lib/storage/error-hints.d.ts.map +0 -1
  328. package/dist/lib/storage/file-lock.d.ts.map +0 -1
  329. package/dist/lib/storage/file-paths.d.ts.map +0 -1
  330. package/dist/lib/storage/fixture-guards.d.ts.map +0 -1
  331. package/dist/lib/storage/flagged-entry.d.ts.map +0 -1
  332. package/dist/lib/storage/flagged-load-entry.d.ts.map +0 -1
  333. package/dist/lib/storage/flagged-save-entry.d.ts.map +0 -1
  334. package/dist/lib/storage/flagged-storage-file.d.ts.map +0 -1
  335. package/dist/lib/storage/flagged-storage-io.d.ts.map +0 -1
  336. package/dist/lib/storage/flagged-storage.d.ts.map +0 -1
  337. package/dist/lib/storage/gitignore.d.ts.map +0 -1
  338. package/dist/lib/storage/hash.d.ts.map +0 -1
  339. package/dist/lib/storage/health.d.ts.map +0 -1
  340. package/dist/lib/storage/identity.d.ts.map +0 -1
  341. package/dist/lib/storage/import-export.d.ts.map +0 -1
  342. package/dist/lib/storage/metadata-section.d.ts.map +0 -1
  343. package/dist/lib/storage/migrations.d.ts.map +0 -1
  344. package/dist/lib/storage/named-backup-entry.d.ts.map +0 -1
  345. package/dist/lib/storage/named-backups-entry.d.ts.map +0 -1
  346. package/dist/lib/storage/named-backups.d.ts.map +0 -1
  347. package/dist/lib/storage/path-state.d.ts.map +0 -1
  348. package/dist/lib/storage/paths.d.ts.map +0 -1
  349. package/dist/lib/storage/pending-auth.d.ts.map +0 -1
  350. package/dist/lib/storage/project-migration.d.ts.map +0 -1
  351. package/dist/lib/storage/public-types.d.ts.map +0 -1
  352. package/dist/lib/storage/record-identity.d.ts.map +0 -1
  353. package/dist/lib/storage/record-utils.d.ts.map +0 -1
  354. package/dist/lib/storage/restore-assessment.d.ts.map +0 -1
  355. package/dist/lib/storage/restore-backup-entry.d.ts.map +0 -1
  356. package/dist/lib/storage/restore-metadata.d.ts.map +0 -1
  357. package/dist/lib/storage/save-retry.d.ts.map +0 -1
  358. package/dist/lib/storage/snapshot-inspectors.d.ts.map +0 -1
  359. package/dist/lib/storage/snapshot-merge.d.ts.map +0 -1
  360. package/dist/lib/storage/storage-parser.d.ts.map +0 -1
  361. package/dist/lib/storage/transactions.d.ts.map +0 -1
  362. package/dist/lib/storage.d.ts.map +0 -1
  363. package/dist/lib/synthetic-response.d.ts.map +0 -1
  364. package/dist/lib/table-formatter.d.ts.map +0 -1
  365. package/dist/lib/temp-path.d.ts.map +0 -1
  366. package/dist/lib/tools/hashline-tools.d.ts.map +0 -1
  367. package/dist/lib/types.d.ts.map +0 -1
  368. package/dist/lib/ui/ansi.d.ts.map +0 -1
  369. package/dist/lib/ui/auth-menu-builder.d.ts.map +0 -1
  370. package/dist/lib/ui/auth-menu.d.ts.map +0 -1
  371. package/dist/lib/ui/check-progress.d.ts.map +0 -1
  372. package/dist/lib/ui/confirm.d.ts.map +0 -1
  373. package/dist/lib/ui/display-width.d.ts.map +0 -1
  374. package/dist/lib/ui/format.d.ts.map +0 -1
  375. package/dist/lib/ui/index.d.ts.map +0 -1
  376. package/dist/lib/ui/runtime.d.ts.map +0 -1
  377. package/dist/lib/ui/select.d.ts.map +0 -1
  378. package/dist/lib/ui/theme.d.ts.map +0 -1
  379. package/dist/lib/ui/ui-copy.d.ts.map +0 -1
  380. package/dist/lib/unified-settings.d.ts.map +0 -1
  381. package/dist/lib/update-notice.d.ts.map +0 -1
  382. package/dist/lib/usage/index.d.ts.map +0 -1
  383. package/dist/lib/usage/ledger.d.ts.map +0 -1
  384. package/dist/lib/usage/pricing.d.ts.map +0 -1
  385. package/dist/lib/usage/redaction.d.ts.map +0 -1
  386. package/dist/lib/usage/stream-usage-deferral.d.ts.map +0 -1
  387. package/dist/lib/usage/types.d.ts.map +0 -1
  388. package/dist/lib/usage/usage-extraction.d.ts.map +0 -1
  389. package/dist/lib/utils.d.ts.map +0 -1
  390. package/dist/lib/wsl.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-multi-auth",
3
- "version": "2.18.0",
3
+ "version": "2.19.1",
4
4
  "description": "Install and operate codex-multi-auth for the official @openai/codex CLI with multi-account OAuth rotation, switching, health checks, and recovery tools.",
5
5
  "interface": {
6
6
  "composerIcon": "./assets/codex-multi-auth-icon.svg"
package/README.md CHANGED
@@ -33,7 +33,7 @@ Using OpenCode rather than the Codex CLI? The sibling project [`oc-codex-multi-a
33
33
 
34
34
  ## Install
35
35
 
36
- Requirements: Node.js >= 18.17, and the official Codex CLI on `PATH` (`npm i -g @openai/codex`, Homebrew, or a release binary).
36
+ Requirements: Node.js >= 22.19, and the official Codex CLI on `PATH` (`npm i -g @openai/codex`, Homebrew, or a release binary).
37
37
 
38
38
  ```bash
39
39
  npm i -g codex-multi-auth
@@ -137,7 +137,7 @@ Common symptoms — wrong active account, OAuth callback port `1455` already bou
137
137
 
138
138
  ## Release notes
139
139
 
140
- - Current stable: [v2.18.0](docs/releases/v2.18.0.md) — `npm i -g codex-multi-auth`
140
+ - Current stable: [v2.19.1](docs/releases/v2.19.1.md) — `npm i -g codex-multi-auth`
141
141
  - Earlier stable lines: [v2.6.0](docs/releases/v2.6.0.md), [v2.5.0](docs/releases/v2.5.0.md)
142
142
  - Full release archive: [docs/README.md#release-history](docs/README.md#release-history)
143
143
 
@@ -20,7 +20,9 @@ export declare function getAccountPolicyPath(): string;
20
20
  export declare function getAccountPolicyKey(account: Pick<AccountMetadataV3, "accountId" | "email"> & {
21
21
  refreshToken?: string | null;
22
22
  }, _index?: number): string;
23
- export declare function loadAccountPolicyStore(): Promise<AccountPolicyStore>;
23
+ export declare function loadAccountPolicyStore(options?: {
24
+ strict?: boolean;
25
+ }): Promise<AccountPolicyStore>;
24
26
  export declare function saveAccountPolicyStore(store: AccountPolicyStore, baseline?: AccountPolicyStore): Promise<void>;
25
27
  /**
26
28
  * Run a policy-store read→mutate→write inside the write queue (in-process
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { existsSync, promises as fs } from "node:fs";
2
+ import { promises as fs } from "node:fs";
3
3
  import { basename, join } from "node:path";
4
4
  import { logWarn } from "./logger.js";
5
5
  import { getCodexMultiAuthDir } from "./runtime-paths.js";
@@ -100,14 +100,30 @@ export function getAccountPolicyKey(account, _index) {
100
100
  (refreshFallback ? `refresh:${refreshFallback}` : "unknown");
101
101
  return `sha256:${createHash("sha256").update(identity).digest("hex")}`;
102
102
  }
103
- export async function loadAccountPolicyStore() {
103
+ export async function loadAccountPolicyStore(options = {}) {
104
104
  const path = getAccountPolicyPath();
105
- if (!existsSync(path))
106
- return emptyStore();
107
105
  try {
108
- return normalizeStore(JSON.parse(await readFileWithRetry(path)));
106
+ const parsed = JSON.parse(await readFileWithRetry(path));
107
+ if (options.strict) {
108
+ if (!isRecord(parsed) || parsed.version !== 1 || !isRecord(parsed.accounts)) {
109
+ throw new Error("Invalid account policy store");
110
+ }
111
+ for (const [key, row] of Object.entries(parsed.accounts)) {
112
+ if (!key.startsWith("sha256:"))
113
+ continue;
114
+ // Legacy rows may omit flags; explicit malformed values are not OFF.
115
+ if (!isRecord(row) || ["autoPrime", "paused", "drained"].some(flag => flag in row && typeof row[flag] !== "boolean")) {
116
+ throw new Error("Invalid account policy row");
117
+ }
118
+ }
119
+ }
120
+ return normalizeStore(parsed);
109
121
  }
110
122
  catch (error) {
123
+ if (error.code === "ENOENT")
124
+ return emptyStore();
125
+ if (options.strict)
126
+ throw error;
111
127
  logWarn(`Failed to load account policies from ${basename(path)}: ${error instanceof Error ? error.message : String(error)}`);
112
128
  return emptyStore();
113
129
  }
@@ -107,7 +107,9 @@ function parseRollout(rolloutPath, deps, previewLimit) {
107
107
  if (typeof record.timestamp === "string") {
108
108
  updatedAt = record.timestamp;
109
109
  }
110
- if (record.type === "session_meta") {
110
+ // Forked rollouts append the parent's session_meta after their own, so
111
+ // only the first one describes this rollout.
112
+ if (record.type === "session_meta" && !hasSessionMeta) {
111
113
  const payload = record.payload;
112
114
  const metaId = readStringField(payload, "id");
113
115
  if (metaId)
@@ -1,3 +1,4 @@
1
+ import { subscriptionStatus, formatSubscriptionStatus } from "../formatters/subscription-status.js";
1
2
  import { resetSnapshotQuota } from "../../runtime/reset-credits.js";
2
3
  import { resetTargetForStoredAccount } from "../../runtime/account-reset-credits.js";
3
4
  import { subscriptionQuotaPreference, compareSubscriptionQuota, usesSubscriptionReserve, SUBSCRIPTION_RESERVE_PERCENT } from "../../runtime/subscription-quota-order.js";
@@ -87,7 +88,8 @@ export async function runStatusCommand(deps) {
87
88
  const modelInventory = await deps.loadModelInventory?.();
88
89
  const resetCredits = await deps.loadResetCreditState?.().catch(() => null);
89
90
  const resetSnapshot = (account) => { const target = resetTargetForStoredAccount(account); return target ? resetCredits?.snapshots[target.key] : undefined; };
90
- const accountPolicies = await (deps.loadAccountPolicies ?? loadAccountPolicyStore)().catch(() => ({ version: 1, accounts: {} }));
91
+ let policiesUnavailable = false;
92
+ const accountPolicies = await (deps.loadAccountPolicies ?? loadAccountPolicyStore)({ strict: true }).catch(() => { policiesUnavailable = true; return { version: 1, accounts: {} }; });
91
93
  if (!deps.json && deps.loadModelInventory)
92
94
  for (const line of formatModelInventory(modelInventory ?? null))
93
95
  logInfo(line);
@@ -136,6 +138,7 @@ export async function runStatusCommand(deps) {
136
138
  const now = deps.getNow?.() ?? Date.now();
137
139
  const activeIndex = storage.accounts.length ? deps.resolveActiveIndex(storage, "codex") : -1;
138
140
  const quotaCache = await deps.loadQuotaCache?.() ?? null;
141
+ const subscriptionStatuses = storage.accounts.map(account => subscriptionStatus(account, findQuotaCacheEntryForAccount(quotaCache, account, storage.accounts), policiesUnavailable ? undefined : accountPolicies.accounts[getAccountPolicyKey(account)] ?? {}, now));
139
142
  const forecastQuotas = storage.accounts.map(account => {
140
143
  const cached = findQuotaCacheEntryForAccount(quotaCache, account, storage.accounts);
141
144
  const reset = resetSnapshot(account);
@@ -217,6 +220,7 @@ export async function runStatusCommand(deps) {
217
220
  const markers = buildAccountMarkers(account, i, activeIndex, runtimeCurrent, now, quotaCache, storage.accounts, deps.formatRateLimitEntry);
218
221
  return {
219
222
  index: i,
223
+ subscription: subscriptionStatuses[i],
220
224
  resetCreditsAvailable: resetSnapshot(account)?.availableCount ?? null,
221
225
  resetCreditsCheckedAt: resetSnapshot(account)?.updatedAt ?? null,
222
226
  label: formatAccountLabel(account, i),
@@ -335,8 +339,9 @@ export async function runStatusCommand(deps) {
335
339
  : `inference not yet recorded; ${activity}`;
336
340
  logInfo(`${paint(`${i + 1}. ${label}`, "heading")}${paint(markerLabel, markers.some(m => /disabled|cooldown|exhausted|limited|invalid/.test(m)) ? "warning" : "success")} ${paint(lastUsed, "muted")}`);
337
341
  logInfo(` ${paint(`priority tier: ${accountPolicies.accounts[getAccountPolicyKey(account, i)]?.priority ?? 1}`, "accent")}`);
338
- if (accountPolicies.accounts[getAccountPolicyKey(account, i)]?.autoPrime)
339
- logInfo(" automatic first-use priming: on (router checks every 15 minutes)");
342
+ const subscription = subscriptionStatuses[i];
343
+ if (subscription)
344
+ logInfo(` ${formatSubscriptionStatus(subscription)}`);
340
345
  if (appBindStatus?.nativeOpenai) {
341
346
  const preference = quotaPreferences[i];
342
347
  const order = automaticOrder.get(i);
@@ -22,6 +22,7 @@ export function cloneDashboardSettingsData(settings, deps) {
22
22
  menuSortQuickSwitchVisibleRow: settings.menuSortQuickSwitchVisibleRow ?? true,
23
23
  uiThemePreset: settings.uiThemePreset ?? "green",
24
24
  uiAccentColor: settings.uiAccentColor ?? "green",
25
+ uiColorMode: settings.uiColorMode ?? "auto",
25
26
  menuShowStatusBadge: settings.menuShowStatusBadge ?? true,
26
27
  menuShowCurrentBadge: settings.menuShowCurrentBadge ?? true,
27
28
  menuShowLastUsed: settings.menuShowLastUsed ?? true,
@@ -71,6 +72,7 @@ export function dashboardSettingsDataEqual(left, right, deps) {
71
72
  (right.menuSortQuickSwitchVisibleRow ?? true) &&
72
73
  (left.uiThemePreset ?? "green") === (right.uiThemePreset ?? "green") &&
73
74
  (left.uiAccentColor ?? "green") === (right.uiAccentColor ?? "green") &&
75
+ (left.uiColorMode ?? "auto") === (right.uiColorMode ?? "auto") &&
74
76
  (left.menuShowStatusBadge ?? true) ===
75
77
  (right.menuShowStatusBadge ?? true) &&
76
78
  (left.menuShowCurrentBadge ?? true) ===
@@ -0,0 +1,16 @@
1
+ import type { AccountPolicy } from "../../account-policy.js";
2
+ import type { QuotaCacheEntry } from "../../quota-cache.js";
3
+ import type { AccountMetadataV3 } from "../../storage.js";
4
+ /** Display only observed evidence; never age a placeholder into a running timer. */
5
+ export declare function subscriptionStatus(account: AccountMetadataV3, entry: QuotaCacheEntry | null, policy: Partial<AccountPolicy> | undefined, now: number): {
6
+ planType: string | null;
7
+ planLabel: string;
8
+ selectedWorkspace: string;
9
+ autoPrime: boolean | null;
10
+ primingState: "awaiting-first-use" | "completed" | "failed" | "not-applicable" | "timer-running" | "unknown" | "used";
11
+ primingFailure: "network error" | "response too large" | "stream ended early" | "timed out" | "upstream failed" | null;
12
+ automaticBlock: string | null;
13
+ freshness: string;
14
+ observedAt: number | null;
15
+ };
16
+ export declare function formatSubscriptionStatus(value: ReturnType<typeof subscriptionStatus>): string;
@@ -0,0 +1,69 @@
1
+ import { needsSubscriptionFirstUse } from "../../runtime/subscription-first-use.js";
2
+ const PLAN_LABELS = new Map([
3
+ ["free", "Free"], ["plus", "Plus"], ["pro", "Pro 200"],
4
+ ["prolite", "Pro 100"], ["promax", "Pro 500"], ["team", "Business"],
5
+ ["business", "Business"], ["enterprise", "Enterprise"], ["edu", "Edu"],
6
+ ]);
7
+ const STATE_LABELS = {
8
+ unknown: "Priming status unknown",
9
+ "awaiting-first-use": "Awaiting first use",
10
+ "timer-running": "Reset timer running",
11
+ used: "Usage recorded",
12
+ completed: "First-use completed; timer not yet verified",
13
+ failed: "Priming failed",
14
+ "not-applicable": "Priming not applicable",
15
+ };
16
+ /** Display only observed evidence; never age a placeholder into a running timer. */
17
+ export function subscriptionStatus(account, entry, policy, now) {
18
+ const workspace = account.workspaces?.[account.currentWorkspaceIndex ?? 0];
19
+ const selectedWorkspace = workspace
20
+ ? workspace.name?.replace(/\s*\(role:.*$|\s*\[id:.*$/g, "").trim() || "Unnamed workspace"
21
+ : account.workspaces?.length ? "Invalid workspace selection" : "Stored binding (workspace unknown)";
22
+ const freshness = !entry ? "missing"
23
+ : entry.updatedAt > now || now - entry.updatedAt > 30 * 60000 ? "stale" : "fresh";
24
+ const planType = entry?.planType?.trim().toLowerCase() ?? null;
25
+ const planLabel = PLAN_LABELS.get(planType ?? "") ?? "Unknown plan";
26
+ let primingState = "unknown";
27
+ if (entry && freshness === "fresh" && entry.status === 200) {
28
+ const windows = [entry.primary, entry.secondary].filter(w => w.windowMinutes !== 0);
29
+ if (!planType || !PLAN_LABELS.has(planType))
30
+ primingState = "unknown";
31
+ else if (!["plus", "pro", "prolite", "promax"].includes(planType))
32
+ primingState = "not-applicable";
33
+ else if (entry.primingFailure)
34
+ primingState = "failed";
35
+ else if (entry.primingCompleted)
36
+ primingState = "completed";
37
+ else if (windows.some(w => typeof w.usedPercent === "number" && w.usedPercent > 0)) {
38
+ primingState = "used";
39
+ }
40
+ else if (windows.some(w => typeof w.windowMinutes === "number" && w.windowMinutes > 0 &&
41
+ typeof w.resetAtMs === "number" && w.resetAtMs > now &&
42
+ w.resetAtMs - entry.updatedAt < w.windowMinutes * 60000 - 2000)) {
43
+ primingState = "timer-running";
44
+ }
45
+ else if (needsSubscriptionFirstUse(entry, entry.updatedAt)) {
46
+ primingState = "awaiting-first-use";
47
+ }
48
+ }
49
+ const automaticBlock = account.enabled === false ? "account disabled"
50
+ : account.authInvalidatedAt ? "sign-in required"
51
+ : policy?.paused ? "paused"
52
+ : policy?.drained ? "drained"
53
+ : (account.coolingDownUntil ?? 0) > now ? "cooling down"
54
+ : account.workspaces?.length && (!workspace || workspace.enabled === false) ? "workspace unavailable"
55
+ : null;
56
+ return {
57
+ planType, planLabel, selectedWorkspace,
58
+ autoPrime: policy ? policy.autoPrime === true : null,
59
+ primingState, primingFailure: entry?.primingFailure ?? null,
60
+ automaticBlock, freshness, observedAt: entry?.updatedAt ?? null,
61
+ };
62
+ }
63
+ export function formatSubscriptionStatus(value) {
64
+ const freshness = value.freshness === "stale" ? " (stale; run check accounts)"
65
+ : value.freshness === "missing" ? " (not observed)" : "";
66
+ const autoPrime = value.autoPrime === null ? "unknown" : value.autoPrime ? "ON" : "OFF";
67
+ const block = value.automaticBlock ? `; blocked: ${value.automaticBlock}` : "";
68
+ return `${value.selectedWorkspace} · ${value.planLabel}${freshness} · Auto-prime ${autoPrime} · ${STATE_LABELS[value.primingState]}${block}`;
69
+ }
@@ -8,7 +8,10 @@ export function stylePromptText(text, tone) {
8
8
  const ui = getUiRuntimeOptions();
9
9
  if (ui.v2Enabled) {
10
10
  if (tone === "muted") {
11
- return `${ui.theme.colors.dim}${paintUiText(ui, text, "muted")}${ui.theme.colors.reset}`;
11
+ // In light mode the muted foreground is already dark; stacking the
12
+ // dim attribute on top makes the text faint again on light themes.
13
+ const dim = ui.theme.colorMode === "light" ? "" : ui.theme.colors.dim;
14
+ return `${dim}${paintUiText(ui, text, "muted")}${ui.theme.colors.reset}`;
12
15
  }
13
16
  const mapped = tone === "accent" ? "primary" : tone;
14
17
  return paintUiText(ui, text, mapped);
@@ -1,3 +1,6 @@
1
+ import { subscriptionStatus, formatSubscriptionStatus } from "./formatters/subscription-status.js";
2
+ import { getAccountPolicyKey, loadAccountPolicyStore } from "../account-policy.js";
3
+ import { automaticCheckWorkspaceId } from "../runtime/automatic-account-checks.js";
1
4
  import { refreshAndPrintResetCredits } from "../runtime/account-reset-credits.js";
2
5
  import { mapWithConcurrency } from "../concurrency.js";
3
6
  import { withCheckProgress } from "../ui/check-progress.js";
@@ -16,7 +19,7 @@ import { loadAccounts, saveAccounts, setStoragePath } from "../storage.js";
16
19
  import { applyTokenAccountIdentity, hasLikelyInvalidRefreshToken, hasUsableAccessToken, } from "./account-credentials.js";
17
20
  import { saveAccountsWithRetry } from "./forecast-report-shared.js";
18
21
  import { formatModelInspection, formatQuotaSnapshotForDashboard, formatResultSummary, inspectRequestedModel, normalizeFailureDetail, styleAccountDetailText, stylePromptText, } from "./formatters/index.js";
19
- import { cloneQuotaCacheData, DEFAULT_LIVE_PROBE_MODEL, pruneUnsafeQuotaEmailCacheEntry, updateQuotaCacheForAccount, } from "./quota-cache-helpers.js";
22
+ import { cloneQuotaCacheData, DEFAULT_LIVE_PROBE_MODEL, pruneUnsafeQuotaEmailCacheEntry, updateQuotaCacheForWorkspace, } from "./quota-cache-helpers.js";
20
23
  function appendAuthInvalidationMarker(account, detail) {
21
24
  return typeof account.authInvalidatedAt === "number" &&
22
25
  Number.isFinite(account.authInvalidatedAt)
@@ -44,6 +47,8 @@ export async function runHealthCheck(options = {}) {
44
47
  let quotaEmailFallbackState = liveProbe && quotaCache
45
48
  ? buildQuotaEmailFallbackState(storage.accounts)
46
49
  : null;
50
+ const policies = await loadAccountPolicyStore({ strict: true }).catch(() => null);
51
+ const subscriptionLine = (account, snapshot) => formatSubscriptionStatus(subscriptionStatus(account, { ...snapshot, updatedAt: snapshot.observedAt ?? Date.now() }, policies ? policies.accounts[getAccountPolicyKey(account)] ?? {} : undefined, Date.now()));
47
52
  let changed = false;
48
53
  let ok = 0;
49
54
  let failed = 0;
@@ -62,7 +67,7 @@ export async function runHealthCheck(options = {}) {
62
67
  const quickProbes = new Map();
63
68
  if (liveProbe && !forceRefresh) {
64
69
  const candidates = storage.accounts.flatMap((account, index) => {
65
- const accountId = account.accountId ?? extractAccountId(account.accessToken);
70
+ const accountId = automaticCheckWorkspaceId(account);
66
71
  return hasUsableAccessToken(account, now) && account.accessToken && accountId
67
72
  ? [{ index, accountId, accessToken: account.accessToken }] : [];
68
73
  });
@@ -104,14 +109,14 @@ export async function runHealthCheck(options = {}) {
104
109
  if (liveProbe) {
105
110
  const currentAccessToken = account.accessToken;
106
111
  const probeAccountId = currentAccessToken
107
- ? (account.accountId ?? extractAccountId(currentAccessToken))
112
+ ? automaticCheckWorkspaceId(account)
108
113
  : undefined;
109
114
  if (!probeAccountId || !currentAccessToken) {
110
115
  warnings += 1;
111
116
  signedInOnly += 1;
112
117
  healthTone = "warning";
113
118
  healthDetail =
114
- "signed in (live check skipped: missing account ID)";
119
+ "signed in (live check skipped: missing account ID or unavailable selected workspace)";
115
120
  }
116
121
  else {
117
122
  try {
@@ -124,10 +129,10 @@ export async function runHealthCheck(options = {}) {
124
129
  model: modelInspection.normalized,
125
130
  }), console.log);
126
131
  if (workingQuotaCache) {
127
- quotaCacheChanged =
128
- updateQuotaCacheForAccount(workingQuotaCache, account, snapshot, storage.accounts, quotaEmailFallbackState ?? undefined) || quotaCacheChanged;
132
+ updateQuotaCacheForWorkspace(workingQuotaCache, account, probeAccountId, snapshot, storage.accounts);
133
+ quotaCacheChanged = true;
129
134
  }
130
- healthDetail = formatQuotaSnapshotForDashboard(snapshot, display);
135
+ healthDetail = formatQuotaSnapshotForDashboard(snapshot, display) + " | " + subscriptionLine(account, snapshot);
131
136
  if (snapshot.primingFailure) {
132
137
  healthTone = "warning";
133
138
  warnings += 1;
@@ -210,13 +215,13 @@ export async function runHealthCheck(options = {}) {
210
215
  let healthyMessage = "working now";
211
216
  let healthyTone = "success";
212
217
  if (liveProbe) {
213
- const probeAccountId = account.accountId ?? tokenAccountId;
218
+ const probeAccountId = automaticCheckWorkspaceId(account);
214
219
  if (!probeAccountId) {
215
220
  warnings += 1;
216
221
  signedInOnly += 1;
217
222
  healthyTone = "warning";
218
223
  healthyMessage =
219
- "signed in (live check skipped: missing account ID)";
224
+ "signed in (live check skipped: missing account ID or unavailable selected workspace)";
220
225
  }
221
226
  else {
222
227
  try {
@@ -226,10 +231,10 @@ export async function runHealthCheck(options = {}) {
226
231
  model: modelInspection.normalized,
227
232
  }), console.log);
228
233
  if (workingQuotaCache) {
229
- quotaCacheChanged =
230
- updateQuotaCacheForAccount(workingQuotaCache, account, snapshot, storage.accounts, quotaEmailFallbackState ?? undefined) || quotaCacheChanged;
234
+ updateQuotaCacheForWorkspace(workingQuotaCache, account, probeAccountId, snapshot, storage.accounts);
235
+ quotaCacheChanged = true;
231
236
  }
232
- healthyMessage = formatQuotaSnapshotForDashboard(snapshot, display);
237
+ healthyMessage = formatQuotaSnapshotForDashboard(snapshot, display) + " | " + subscriptionLine(account, snapshot);
233
238
  if (snapshot.primingFailure) {
234
239
  healthyTone = "warning";
235
240
  warnings += 1;
@@ -1,4 +1,5 @@
1
1
  import { buildQuotaEmailFallbackState, findQuotaCacheEntryForAccount, quotaWorkspaceKey, hasSafeQuotaEmailFallback, hasUniqueQuotaAccountId, normalizeQuotaAccountId, normalizeQuotaEmail, } from "../quota-readiness.js";
2
+ import { mergeQuotaCacheEntry, } from "../quota-cache.js";
2
3
  import { DEFAULT_MODEL, DEFAULT_PROBE_MODEL, } from "../request/helpers/model-map.js";
3
4
  import { getRateLimitResetTimeForFamily } from "../runtime/account-status.js";
4
5
  /**
@@ -41,7 +42,10 @@ export function getPersistedQuotaViewForAccount(cache, account, accounts, now, e
41
42
  /** Retain only quota fields from a probe, never its credentials or response body. */
42
43
  function quotaEntryFromSnapshot(snapshot) {
43
44
  return {
44
- updatedAt: Date.now(),
45
+ ...(snapshot.primingCompleted ? { primingCompleted: true } : {}),
46
+ ...(snapshot.primingFailure ? { primingFailure: snapshot.primingFailure } : {}),
47
+ ...(snapshot.primingCompleted || snapshot.primingFailure ? { primingObservedAt: snapshot.primingObservedAt ?? Date.now() } : {}),
48
+ updatedAt: snapshot.observedAt ?? Date.now(),
45
49
  status: snapshot.status,
46
50
  model: snapshot.model,
47
51
  planType: snapshot.planType,
@@ -64,14 +68,14 @@ export function updateQuotaCacheForAccount(cache, account, snapshot, accounts, e
64
68
  const accountId = normalizeQuotaAccountId(account.accountId);
65
69
  const hasUniqueAccountId = accountId !== null && hasUniqueQuotaAccountId(accounts, account);
66
70
  if (hasUniqueAccountId) {
67
- cache.byAccountId[accountId] = nextEntry;
71
+ cache.byAccountId[accountId] = mergeQuotaCacheEntry(cache.byAccountId[accountId], nextEntry);
68
72
  changed = true;
69
73
  }
70
74
  const email = normalizeQuotaEmail(account.email);
71
75
  if (email &&
72
76
  hasSafeQuotaEmailFallback(emailFallbackState, account) &&
73
77
  !hasUniqueAccountId) {
74
- cache.byEmail[email] = nextEntry;
78
+ cache.byEmail[email] = mergeQuotaCacheEntry(cache.byEmail[email], nextEntry);
75
79
  changed = true;
76
80
  }
77
81
  else if (email && cache.byEmail[email]) {
@@ -86,7 +90,7 @@ export function updateQuotaCacheForWorkspace(cache, account, workspaceId, snapsh
86
90
  if (!key)
87
91
  return;
88
92
  cache.byWorkspace ??= {};
89
- cache.byWorkspace[key] = quotaEntryFromSnapshot(snapshot);
93
+ cache.byWorkspace[key] = mergeQuotaCacheEntry(cache.byWorkspace[key], quotaEntryFromSnapshot(snapshot));
90
94
  if (workspaceId === normalizeQuotaAccountId(account.accountId)) {
91
95
  updateQuotaCacheForAccount(cache, account, snapshot, accounts);
92
96
  }
@@ -1,6 +1,6 @@
1
1
  import { type DashboardDisplaySettings } from "../../dashboard-settings.js";
2
2
  export declare const BEHAVIOR_PANEL_KEYS: readonly ["actionAutoReturnMs", "actionPauseOnKey", "menuAutoFetchLimits", "menuShowFetchStatus", "menuQuotaTtlMs"];
3
- export declare const THEME_PANEL_KEYS: readonly ["uiThemePreset", "uiAccentColor"];
3
+ export declare const THEME_PANEL_KEYS: readonly ["uiThemePreset", "uiAccentColor", "uiColorMode"];
4
4
  export declare function applyUiThemeFromDashboardSettings(settings: DashboardDisplaySettings): void;
5
5
  export declare function promptDashboardDisplaySettings(initial: DashboardDisplaySettings): Promise<DashboardDisplaySettings | null>;
6
6
  export declare function configureDashboardDisplaySettings(currentSettings?: DashboardDisplaySettings): Promise<DashboardDisplaySettings>;
@@ -93,6 +93,7 @@ const ACCENT_COLOR_OPTIONS = [
93
93
  "blue",
94
94
  "yellow",
95
95
  ];
96
+ const COLOR_MODE_OPTIONS = ["auto", "dark", "light"];
96
97
  const ACCOUNT_LIST_PANEL_KEYS = [
97
98
  "menuShowStatusBadge",
98
99
  "menuShowCurrentBadge",
@@ -121,6 +122,7 @@ export const BEHAVIOR_PANEL_KEYS = [
121
122
  export const THEME_PANEL_KEYS = [
122
123
  "uiThemePreset",
123
124
  "uiAccentColor",
125
+ "uiColorMode",
124
126
  ];
125
127
  export function applyUiThemeFromDashboardSettings(settings) {
126
128
  const current = getUiRuntimeOptions();
@@ -130,6 +132,7 @@ export function applyUiThemeFromDashboardSettings(settings) {
130
132
  glyphMode: current.glyphMode,
131
133
  palette: settings.uiThemePreset ?? "green",
132
134
  accent: settings.uiAccentColor ?? "green",
135
+ colorMode: settings.uiColorMode ?? "auto",
133
136
  });
134
137
  }
135
138
  /* c8 ignore start - interactive prompt flows are covered by integration tests */
@@ -215,6 +218,7 @@ export async function promptThemeSettings(initial) {
215
218
  applyUiThemeFromDashboardSettings,
216
219
  THEME_PRESET_OPTIONS,
217
220
  ACCENT_COLOR_OPTIONS,
221
+ COLOR_MODE_OPTIONS,
218
222
  THEME_PANEL_KEYS,
219
223
  UI_COPY,
220
224
  });
@@ -50,6 +50,7 @@ export declare function promptThemeSettingsPanelEntry(params: {
50
50
  applyUiThemeFromDashboardSettings: ThemeSettingsPanelDeps["applyUiThemeFromDashboardSettings"];
51
51
  THEME_PRESET_OPTIONS: ThemeSettingsPanelDeps["THEME_PRESET_OPTIONS"];
52
52
  ACCENT_COLOR_OPTIONS: ThemeSettingsPanelDeps["ACCENT_COLOR_OPTIONS"];
53
+ COLOR_MODE_OPTIONS: ThemeSettingsPanelDeps["COLOR_MODE_OPTIONS"];
53
54
  THEME_PANEL_KEYS: ThemeSettingsPanelDeps["THEME_PANEL_KEYS"];
54
55
  UI_COPY: ThemeSettingsPanelDeps["UI_COPY"];
55
56
  }): Promise<DashboardDisplaySettings | null>;
@@ -66,6 +66,7 @@ export async function promptThemeSettingsPanelEntry(params) {
66
66
  applyUiThemeFromDashboardSettings: params.applyUiThemeFromDashboardSettings,
67
67
  THEME_PRESET_OPTIONS: params.THEME_PRESET_OPTIONS,
68
68
  ACCENT_COLOR_OPTIONS: params.ACCENT_COLOR_OPTIONS,
69
+ COLOR_MODE_OPTIONS: params.COLOR_MODE_OPTIONS,
69
70
  THEME_PANEL_KEYS: params.THEME_PANEL_KEYS,
70
71
  UI_COPY: params.UI_COPY,
71
72
  });
@@ -1,4 +1,4 @@
1
- import type { DashboardAccentColor, DashboardDisplaySettings, DashboardThemePreset } from "../dashboard-settings.js";
1
+ import type { DashboardAccentColor, DashboardColorMode, DashboardDisplaySettings, DashboardThemePreset } from "../dashboard-settings.js";
2
2
  import type { UI_COPY } from "../ui/ui-copy.js";
3
3
  export interface ThemeSettingsPanelDeps {
4
4
  cloneDashboardSettings: (settings: DashboardDisplaySettings) => DashboardDisplaySettings;
@@ -6,6 +6,7 @@ export interface ThemeSettingsPanelDeps {
6
6
  applyUiThemeFromDashboardSettings: (settings: DashboardDisplaySettings) => void;
7
7
  THEME_PRESET_OPTIONS: readonly DashboardThemePreset[];
8
8
  ACCENT_COLOR_OPTIONS: readonly DashboardAccentColor[];
9
+ COLOR_MODE_OPTIONS: readonly DashboardColorMode[];
9
10
  THEME_PANEL_KEYS: readonly (keyof DashboardDisplaySettings)[];
10
11
  UI_COPY: typeof UI_COPY;
11
12
  }
@@ -14,6 +14,7 @@ export async function promptThemeSettingsPanel(initial, deps) {
14
14
  const ui = getUiRuntimeOptions();
15
15
  const palette = draft.uiThemePreset ?? "green";
16
16
  const accent = draft.uiAccentColor ?? "green";
17
+ const colorMode = draft.uiColorMode ?? "auto";
17
18
  const paletteItems = deps.THEME_PRESET_OPTIONS.map((candidate, index) => {
18
19
  const color = palette === candidate ? "green" : "yellow";
19
20
  return {
@@ -33,6 +34,21 @@ export async function promptThemeSettingsPanel(initial, deps) {
33
34
  color,
34
35
  };
35
36
  });
37
+ const colorModeItems = deps.COLOR_MODE_OPTIONS.map((candidate) => {
38
+ const color = colorMode === candidate ? "green" : "yellow";
39
+ const key = candidate === "auto" ? "A" : candidate === "dark" ? "D" : "L";
40
+ const hint = candidate === "auto"
41
+ ? "Detect from COLORFGBG; dark when unknown."
42
+ : candidate === "dark"
43
+ ? "Pale text on a dark terminal background."
44
+ : "Dark text on a light terminal background.";
45
+ return {
46
+ label: `${colorMode === candidate ? "[x]" : "[ ]"} ${key}. ${candidate}`,
47
+ hint,
48
+ value: { type: "set-color-mode", colorMode: candidate },
49
+ color,
50
+ };
51
+ });
36
52
  const items = [
37
53
  {
38
54
  label: deps.UI_COPY.settings.baseTheme,
@@ -48,6 +64,13 @@ export async function promptThemeSettingsPanel(initial, deps) {
48
64
  },
49
65
  ...accentItems,
50
66
  { label: "", value: { type: "cancel" }, separator: true },
67
+ {
68
+ label: deps.UI_COPY.settings.terminalBackground,
69
+ value: { type: "cancel" },
70
+ kind: "heading",
71
+ },
72
+ ...colorModeItems,
73
+ { label: "", value: { type: "cancel" }, separator: true },
51
74
  {
52
75
  label: deps.UI_COPY.settings.resetDefault,
53
76
  value: { type: "reset" },
@@ -74,6 +97,10 @@ export async function promptThemeSettingsPanel(initial, deps) {
74
97
  if (value.type === "set-accent" && focus.type === "set-accent") {
75
98
  return value.accent === focus.accent;
76
99
  }
100
+ if (value.type === "set-color-mode" &&
101
+ focus.type === "set-color-mode") {
102
+ return value.colorMode === focus.colorMode;
103
+ }
77
104
  return true;
78
105
  });
79
106
  const result = await select(items, {
@@ -98,6 +125,12 @@ export async function promptThemeSettingsPanel(initial, deps) {
98
125
  return { type: "save" };
99
126
  if (lower === "r")
100
127
  return { type: "reset" };
128
+ if (lower === "a")
129
+ return { type: "set-color-mode", colorMode: "auto" };
130
+ if (lower === "d")
131
+ return { type: "set-color-mode", colorMode: "dark" };
132
+ if (lower === "l")
133
+ return { type: "set-color-mode", colorMode: "light" };
101
134
  if (raw === "1")
102
135
  return { type: "set-palette", palette: "green" };
103
136
  if (raw === "2")
@@ -123,6 +156,12 @@ export async function promptThemeSettingsPanel(initial, deps) {
123
156
  deps.applyUiThemeFromDashboardSettings(draft);
124
157
  continue;
125
158
  }
159
+ if (result.type === "set-color-mode") {
160
+ draft = { ...draft, uiColorMode: result.colorMode };
161
+ focus = result;
162
+ deps.applyUiThemeFromDashboardSettings(draft);
163
+ continue;
164
+ }
126
165
  draft = { ...draft, uiAccentColor: result.accent };
127
166
  focus = result;
128
167
  deps.applyUiThemeFromDashboardSettings(draft);
@@ -1,5 +1,6 @@
1
1
  export type DashboardThemePreset = "green" | "blue";
2
2
  export type DashboardAccentColor = "green" | "cyan" | "blue" | "yellow";
3
+ export type DashboardColorMode = "auto" | "dark" | "light";
3
4
  export type DashboardAccountSortMode = "manual" | "ready-first";
4
5
  type DashboardLayoutMode = "compact-details" | "expanded-rows";
5
6
  type DashboardFocusStyle = "row-invert";
@@ -18,6 +19,7 @@ export interface DashboardDisplaySettings {
18
19
  menuSortQuickSwitchVisibleRow?: boolean;
19
20
  uiThemePreset?: DashboardThemePreset;
20
21
  uiAccentColor?: DashboardAccentColor;
22
+ uiColorMode?: DashboardColorMode;
21
23
  menuShowStatusBadge?: boolean;
22
24
  menuShowCurrentBadge?: boolean;
23
25
  menuShowLastUsed?: boolean;
@@ -19,6 +19,7 @@ export const DEFAULT_DASHBOARD_DISPLAY_SETTINGS = {
19
19
  menuSortQuickSwitchVisibleRow: true,
20
20
  uiThemePreset: "green",
21
21
  uiAccentColor: "green",
22
+ uiColorMode: "auto",
22
23
  menuShowStatusBadge: true,
23
24
  menuShowCurrentBadge: true,
24
25
  menuShowLastUsed: true,
@@ -102,6 +103,22 @@ function normalizeAccentColor(value) {
102
103
  return "green";
103
104
  }
104
105
  }
106
+ /**
107
+ * Normalize an input value into a dashboard terminal-background mode.
108
+ *
109
+ * @param value - Input value to coerce into a color mode
110
+ * @returns `'dark'` or `'light'` if `value` matches one of those strings; otherwise `'auto'` (terminal detection)
111
+ */
112
+ function normalizeColorMode(value) {
113
+ switch (value) {
114
+ case "dark":
115
+ return "dark";
116
+ case "light":
117
+ return "light";
118
+ default:
119
+ return "auto";
120
+ }
121
+ }
105
122
  /**
106
123
  * Validate a dashboard layout mode, allowing only "expanded-rows".
107
124
  *
@@ -249,6 +266,7 @@ export function normalizeDashboardDisplaySettings(value) {
249
266
  menuSortQuickSwitchVisibleRow: normalizeBoolean(value.menuSortQuickSwitchVisibleRow, DEFAULT_DASHBOARD_DISPLAY_SETTINGS.menuSortQuickSwitchVisibleRow ?? true),
250
267
  uiThemePreset: normalizeThemePreset(value.uiThemePreset),
251
268
  uiAccentColor: normalizeAccentColor(value.uiAccentColor),
269
+ uiColorMode: normalizeColorMode(value.uiColorMode),
252
270
  menuShowStatusBadge: normalizeBoolean(value.menuShowStatusBadge, DEFAULT_DASHBOARD_DISPLAY_SETTINGS.menuShowStatusBadge ?? true),
253
271
  menuShowCurrentBadge: normalizeBoolean(value.menuShowCurrentBadge, DEFAULT_DASHBOARD_DISPLAY_SETTINGS.menuShowCurrentBadge ?? true),
254
272
  menuShowLastUsed: normalizeBoolean(value.menuShowLastUsed, DEFAULT_DASHBOARD_DISPLAY_SETTINGS.menuShowLastUsed ?? true),
@@ -37,15 +37,15 @@ export declare function resolveModelRoute(model: string, catalogs: RouteCatalog[
37
37
  export declare function buildVisibleModelUnion(catalogs: RouteCatalog[]): RouteModel[];
38
38
  /** Whitelist capability metadata; never persist model instructions or arbitrary fields. */
39
39
  export declare function modelEntitlements(model: RouteModel): {
40
+ model: string;
41
+ checkedAt?: number | undefined;
42
+ probes?: {
43
+ [k: string]: "downgraded" | "unsupported" | "unverified" | "verified";
44
+ } | undefined;
40
45
  serviceTiers: {
41
46
  id: string;
42
47
  name: string;
43
48
  }[];
44
49
  reasoningLevels: string[];
45
50
  accessPrograms: string[];
46
- probes?: {
47
- [k: string]: "verified" | "unsupported" | "unverified" | "downgraded";
48
- } | undefined;
49
- checkedAt?: number | undefined;
50
- model: string;
51
51
  };