codex-multi-auth 2.17.2 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/README.md +86 -425
  3. package/config/README.md +1 -1
  4. package/config/codex-legacy.json +12 -212
  5. package/config/codex-modern.json +4 -80
  6. package/config/minimal-codex.json +1 -1
  7. package/dist/index.d.ts +0 -1
  8. package/dist/lib/account-policy.d.ts +18 -2
  9. package/dist/lib/account-policy.js +97 -40
  10. package/dist/lib/accounts/rate-limits.d.ts +0 -1
  11. package/dist/lib/accounts.d.ts +0 -1
  12. package/dist/lib/accounts.js +4 -5
  13. package/dist/lib/api-route-store.d.ts +0 -1
  14. package/dist/lib/audit.d.ts +0 -1
  15. package/dist/lib/audit.js +43 -12
  16. package/dist/lib/auth/account-access.d.ts +0 -1
  17. package/dist/lib/auth/account-access.js +5 -1
  18. package/dist/lib/auth/auth.d.ts +4 -3
  19. package/dist/lib/auth/auth.js +220 -28
  20. package/dist/lib/auth/browser.d.ts +0 -1
  21. package/dist/lib/auth/callback-guidance.d.ts +0 -1
  22. package/dist/lib/auth/device-auth.d.ts +0 -1
  23. package/dist/lib/auth/index.d.ts +0 -1
  24. package/dist/lib/auth/org-override.d.ts +0 -1
  25. package/dist/lib/auth/server.d.ts +1 -2
  26. package/dist/lib/auth/server.js +100 -53
  27. package/dist/lib/auth/token-utils.d.ts +0 -1
  28. package/dist/lib/auth-rate-limit.d.ts +0 -1
  29. package/dist/lib/budget-guard.d.ts +16 -2
  30. package/dist/lib/budget-guard.js +123 -43
  31. package/dist/lib/capability-policy.d.ts +0 -1
  32. package/dist/lib/circuit-breaker.d.ts +20 -1
  33. package/dist/lib/circuit-breaker.js +24 -5
  34. package/dist/lib/cli.d.ts +0 -1
  35. package/dist/lib/codex-cli/index.d.ts +0 -1
  36. package/dist/lib/codex-cli/observability.d.ts +0 -1
  37. package/dist/lib/codex-cli/state.d.ts +0 -1
  38. package/dist/lib/codex-cli/sync.d.ts +0 -1
  39. package/dist/lib/codex-cli/writer.d.ts +0 -1
  40. package/dist/lib/codex-manager/account-credentials.d.ts +0 -1
  41. package/dist/lib/codex-manager/account-manager-commands.d.ts +0 -1
  42. package/dist/lib/codex-manager/account-pool-write.d.ts +0 -1
  43. package/dist/lib/codex-manager/active-account-sync.d.ts +6 -0
  44. package/dist/lib/codex-manager/active-account-sync.js +336 -0
  45. package/dist/lib/codex-manager/api-login-menu.d.ts +0 -1
  46. package/dist/lib/codex-manager/backend-category-entry.d.ts +0 -1
  47. package/dist/lib/codex-manager/backend-category-helpers.d.ts +0 -1
  48. package/dist/lib/codex-manager/backend-category-prompt.d.ts +0 -1
  49. package/dist/lib/codex-manager/backend-settings-controller.d.ts +0 -1
  50. package/dist/lib/codex-manager/backend-settings-entry.d.ts +0 -1
  51. package/dist/lib/codex-manager/backend-settings-helpers.d.ts +0 -1
  52. package/dist/lib/codex-manager/backend-settings-prompt.d.ts +0 -1
  53. package/dist/lib/codex-manager/backend-settings-schema.d.ts +0 -1
  54. package/dist/lib/codex-manager/behavior-settings-panel.d.ts +0 -1
  55. package/dist/lib/codex-manager/commands/account.d.ts +8 -3
  56. package/dist/lib/codex-manager/commands/account.js +46 -34
  57. package/dist/lib/codex-manager/commands/best.d.ts +0 -1
  58. package/dist/lib/codex-manager/commands/bridge.d.ts +0 -1
  59. package/dist/lib/codex-manager/commands/budget.d.ts +8 -3
  60. package/dist/lib/codex-manager/commands/budget.js +6 -4
  61. package/dist/lib/codex-manager/commands/check.d.ts +0 -1
  62. package/dist/lib/codex-manager/commands/config-explain.d.ts +0 -1
  63. package/dist/lib/codex-manager/commands/debug-bundle.d.ts +0 -1
  64. package/dist/lib/codex-manager/commands/forecast.d.ts +0 -1
  65. package/dist/lib/codex-manager/commands/history.d.ts +0 -1
  66. package/dist/lib/codex-manager/commands/init-config.d.ts +0 -1
  67. package/dist/lib/codex-manager/commands/integrations.d.ts +0 -1
  68. package/dist/lib/codex-manager/commands/limits.d.ts +0 -1
  69. package/dist/lib/codex-manager/commands/models.d.ts +0 -1
  70. package/dist/lib/codex-manager/commands/monitor.d.ts +0 -1
  71. package/dist/lib/codex-manager/commands/report.d.ts +0 -1
  72. package/dist/lib/codex-manager/commands/resets.d.ts +0 -1
  73. package/dist/lib/codex-manager/commands/resets.js +9 -1
  74. package/dist/lib/codex-manager/commands/rotation.d.ts +0 -1
  75. package/dist/lib/codex-manager/commands/status.d.ts +0 -1
  76. package/dist/lib/codex-manager/commands/switch.d.ts +0 -1
  77. package/dist/lib/codex-manager/commands/uninstall.d.ts +0 -1
  78. package/dist/lib/codex-manager/commands/unpin.d.ts +0 -1
  79. package/dist/lib/codex-manager/commands/usage.d.ts +0 -1
  80. package/dist/lib/codex-manager/commands/verify.d.ts +0 -1
  81. package/dist/lib/codex-manager/commands/why-selected.d.ts +0 -1
  82. package/dist/lib/codex-manager/commands/workspace.d.ts +0 -1
  83. package/dist/lib/codex-manager/dashboard-display-panel.d.ts +0 -1
  84. package/dist/lib/codex-manager/dashboard-formatters.d.ts +0 -1
  85. package/dist/lib/codex-manager/dashboard-settings-controller.d.ts +0 -1
  86. package/dist/lib/codex-manager/dashboard-settings-data.d.ts +0 -1
  87. package/dist/lib/codex-manager/dashboard-settings-entry.d.ts +0 -1
  88. package/dist/lib/codex-manager/experimental-settings-entry.d.ts +0 -1
  89. package/dist/lib/codex-manager/experimental-settings-prompt.d.ts +0 -1
  90. package/dist/lib/codex-manager/experimental-settings-schema.d.ts +0 -1
  91. package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts +0 -1
  92. package/dist/lib/codex-manager/experimental-sync-target.d.ts +0 -1
  93. package/dist/lib/codex-manager/forecast-report-shared.d.ts +0 -1
  94. package/dist/lib/codex-manager/formatters/account-formatters.d.ts +0 -1
  95. package/dist/lib/codex-manager/formatters/index.d.ts +0 -1
  96. package/dist/lib/codex-manager/formatters/model-formatters.d.ts +0 -1
  97. package/dist/lib/codex-manager/formatters/quota-formatters.d.ts +0 -1
  98. package/dist/lib/codex-manager/formatters/text-style.d.ts +0 -1
  99. package/dist/lib/codex-manager/health-check.d.ts +0 -1
  100. package/dist/lib/codex-manager/help.d.ts +0 -1
  101. package/dist/lib/codex-manager/login-action-panel.d.ts +0 -1
  102. package/dist/lib/codex-manager/login-flow.d.ts +0 -1
  103. package/dist/lib/codex-manager/login-menu-actions.d.ts +0 -1
  104. package/dist/lib/codex-manager/login-menu-data.d.ts +0 -1
  105. package/dist/lib/codex-manager/login-oauth.d.ts +0 -1
  106. package/dist/lib/codex-manager/login-workspace-choice.d.ts +0 -1
  107. package/dist/lib/codex-manager/manual-callback.d.ts +0 -1
  108. package/dist/lib/codex-manager/persist-selected-account.d.ts +0 -1
  109. package/dist/lib/codex-manager/quota-cache-helpers.d.ts +0 -1
  110. package/dist/lib/codex-manager/rate-limit-markers.d.ts +0 -1
  111. package/dist/lib/codex-manager/repair-commands.d.ts +0 -1
  112. package/dist/lib/codex-manager/settings-hub/backend.d.ts +0 -1
  113. package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +0 -1
  114. package/dist/lib/codex-manager/settings-hub/experimental.d.ts +0 -1
  115. package/dist/lib/codex-manager/settings-hub/index.d.ts +0 -1
  116. package/dist/lib/codex-manager/settings-hub/shared.d.ts +0 -1
  117. package/dist/lib/codex-manager/settings-hub-entry.d.ts +0 -1
  118. package/dist/lib/codex-manager/settings-hub-menu.d.ts +0 -1
  119. package/dist/lib/codex-manager/settings-hub-prompt.d.ts +0 -1
  120. package/dist/lib/codex-manager/settings-hub.d.ts +0 -1
  121. package/dist/lib/codex-manager/settings-panels.d.ts +0 -1
  122. package/dist/lib/codex-manager/settings-persist-utils.d.ts +0 -1
  123. package/dist/lib/codex-manager/settings-preview.d.ts +0 -1
  124. package/dist/lib/codex-manager/settings-write-queue.d.ts +0 -1
  125. package/dist/lib/codex-manager/statusline-settings-panel.d.ts +0 -1
  126. package/dist/lib/codex-manager/theme-settings-panel.d.ts +0 -1
  127. package/dist/lib/codex-manager/unified-settings-controller.d.ts +0 -1
  128. package/dist/lib/codex-manager/unified-settings-entry.d.ts +0 -1
  129. package/dist/lib/codex-manager.d.ts +1 -2
  130. package/dist/lib/codex-manager.js +5 -95
  131. package/dist/lib/concurrency.d.ts +0 -1
  132. package/dist/lib/config-schema.d.ts +0 -1
  133. package/dist/lib/config.d.ts +0 -1
  134. package/dist/lib/config.js +46 -241
  135. package/dist/lib/constants.d.ts +0 -1
  136. package/dist/lib/context-budget/model-context-windows.d.ts +1 -2
  137. package/dist/lib/context-budget/model-context-windows.js +10 -13
  138. package/dist/lib/context-budget-guard.d.ts +0 -1
  139. package/dist/lib/context-budget-response.d.ts +0 -1
  140. package/dist/lib/context-overflow.d.ts +0 -1
  141. package/dist/lib/dashboard-settings.d.ts +0 -1
  142. package/dist/lib/entitlement-cache.d.ts +0 -1
  143. package/dist/lib/env-parsing.d.ts +13 -1
  144. package/dist/lib/env-parsing.js +21 -0
  145. package/dist/lib/errors.d.ts +0 -1
  146. package/dist/lib/forecast.d.ts +0 -1
  147. package/dist/lib/fs-retry.d.ts +0 -1
  148. package/dist/lib/health.d.ts +0 -1
  149. package/dist/lib/index.d.ts +0 -1
  150. package/dist/lib/integration-generators.d.ts +0 -1
  151. package/dist/lib/live-account-sync.d.ts +0 -1
  152. package/dist/lib/local-bridge.d.ts +0 -1
  153. package/dist/lib/local-bridge.js +4 -1
  154. package/dist/lib/local-client-tokens.d.ts +0 -1
  155. package/dist/lib/local-client-tokens.js +125 -30
  156. package/dist/lib/logger.d.ts +0 -1
  157. package/dist/lib/logger.js +11 -1
  158. package/dist/lib/model-capability-matrix.d.ts +0 -1
  159. package/dist/lib/model-route-policy.d.ts +1 -2
  160. package/dist/lib/named-backup-export.d.ts +0 -1
  161. package/dist/lib/oc-chatgpt-import-adapter.d.ts +0 -1
  162. package/dist/lib/oc-chatgpt-orchestrator.d.ts +0 -1
  163. package/dist/lib/oc-chatgpt-target-detection.d.ts +3 -3
  164. package/dist/lib/oc-chatgpt-target-detection.js +40 -13
  165. package/dist/lib/parallel-probe.d.ts +0 -1
  166. package/dist/lib/policy/runtime-policy-cache.d.ts +80 -0
  167. package/dist/lib/policy/runtime-policy-cache.js +310 -0
  168. package/dist/lib/policy/runtime-policy.d.ts +1 -2
  169. package/dist/lib/policy/runtime-policy.js +46 -19
  170. package/dist/lib/preemptive-quota-scheduler.d.ts +0 -1
  171. package/dist/lib/proactive-refresh.d.ts +0 -1
  172. package/dist/lib/prompts/codex-host-bridge.d.ts +0 -1
  173. package/dist/lib/prompts/codex.d.ts +0 -1
  174. package/dist/lib/prompts/fetch-utils.d.ts +0 -1
  175. package/dist/lib/prompts/host-codex-prompt.d.ts +0 -1
  176. package/dist/lib/quota-cache.d.ts +0 -1
  177. package/dist/lib/quota-cache.js +60 -36
  178. package/dist/lib/quota-probe.d.ts +0 -1
  179. package/dist/lib/quota-probe.js +5 -2
  180. package/dist/lib/quota-readiness.d.ts +0 -1
  181. package/dist/lib/recovery/constants.d.ts +0 -1
  182. package/dist/lib/recovery/storage.d.ts +0 -1
  183. package/dist/lib/recovery/types.d.ts +0 -1
  184. package/dist/lib/recovery.d.ts +0 -1
  185. package/dist/lib/redaction.d.ts +0 -1
  186. package/dist/lib/refresh-guardian.d.ts +0 -1
  187. package/dist/lib/refresh-lease.d.ts +0 -1
  188. package/dist/lib/refresh-queue.d.ts +0 -1
  189. package/dist/lib/request/client-cancellation.d.ts +0 -1
  190. package/dist/lib/request/error-classification.d.ts +0 -1
  191. package/dist/lib/request/error-classification.js +41 -52
  192. package/dist/lib/request/failover-config.d.ts +0 -1
  193. package/dist/lib/request/failure-policy.d.ts +0 -1
  194. package/dist/lib/request/fetch-helpers.d.ts +0 -1
  195. package/dist/lib/request/fetch-helpers.js +1 -1
  196. package/dist/lib/request/headers.d.ts +0 -1
  197. package/dist/lib/request/helpers/input-utils.d.ts +0 -1
  198. package/dist/lib/request/helpers/input-utils.js +88 -34
  199. package/dist/lib/request/helpers/model-map.d.ts +2 -3
  200. package/dist/lib/request/helpers/model-map.js +120 -78
  201. package/dist/lib/request/helpers/tool-utils.d.ts +0 -1
  202. package/dist/lib/request/helpers/tool-utils.js +421 -4
  203. package/dist/lib/request/index.d.ts +0 -1
  204. package/dist/lib/request/rate-limit-backoff.d.ts +0 -1
  205. package/dist/lib/request/rate-limit-decision.d.ts +0 -1
  206. package/dist/lib/request/request-attempt-budget.d.ts +0 -1
  207. package/dist/lib/request/request-init.d.ts +0 -1
  208. package/dist/lib/request/request-resilience.d.ts +0 -1
  209. package/dist/lib/request/request-transformer.d.ts +1 -2
  210. package/dist/lib/request/request-transformer.js +51 -26
  211. package/dist/lib/request/response-compaction.d.ts +0 -1
  212. package/dist/lib/request/response-handler.d.ts +0 -1
  213. package/dist/lib/request/response-metadata.d.ts +0 -1
  214. package/dist/lib/request/response-outcome.d.ts +0 -1
  215. package/dist/lib/request/stream-failover-runtime.d.ts +0 -1
  216. package/dist/lib/request/stream-failover.d.ts +0 -1
  217. package/dist/lib/request/stream-failover.js +28 -4
  218. package/dist/lib/request/token-refresh.d.ts +0 -1
  219. package/dist/lib/request/url-rewriting.d.ts +0 -1
  220. package/dist/lib/request/wait-utils.d.ts +0 -1
  221. package/dist/lib/rotation.d.ts +0 -1
  222. package/dist/lib/routing-mutex.d.ts +0 -1
  223. package/dist/lib/routing-profiles.d.ts +16 -2
  224. package/dist/lib/routing-profiles.js +119 -44
  225. package/dist/lib/runtime/account-check-helpers.d.ts +0 -1
  226. package/dist/lib/runtime/account-check-types.d.ts +0 -1
  227. package/dist/lib/runtime/account-check.d.ts +0 -1
  228. package/dist/lib/runtime/account-manager-cache-entry.d.ts +0 -1
  229. package/dist/lib/runtime/account-manager-cache.d.ts +0 -1
  230. package/dist/lib/runtime/account-model-catalog.d.ts +1 -2
  231. package/dist/lib/runtime/account-pool.d.ts +0 -1
  232. package/dist/lib/runtime/account-reset-credits.d.ts +0 -1
  233. package/dist/lib/runtime/account-reset-credits.js +8 -2
  234. package/dist/lib/runtime/account-scope.d.ts +0 -1
  235. package/dist/lib/runtime/account-select-event.d.ts +0 -1
  236. package/dist/lib/runtime/account-selection.d.ts +0 -1
  237. package/dist/lib/runtime/account-state.d.ts +0 -1
  238. package/dist/lib/runtime/account-status.d.ts +0 -1
  239. package/dist/lib/runtime/account-storage-scope-entry.d.ts +0 -1
  240. package/dist/lib/runtime/api-model-capabilities.d.ts +0 -1
  241. package/dist/lib/runtime/api-model-runtime.d.ts +0 -1
  242. package/dist/lib/runtime/app-bind.d.ts +0 -1
  243. package/dist/lib/runtime/app-helper-selection.d.ts +0 -1
  244. package/dist/lib/runtime/auth-facade.d.ts +0 -1
  245. package/dist/lib/runtime/automatic-account-checks.d.ts +0 -1
  246. package/dist/lib/runtime/automatic-subscription-checks.d.ts +0 -1
  247. package/dist/lib/runtime/browser-oauth-flow.d.ts +0 -1
  248. package/dist/lib/runtime/capability-boost.d.ts +0 -1
  249. package/dist/lib/runtime/catalog-capabilities.d.ts +0 -1
  250. package/dist/lib/runtime/config-toml.d.ts +0 -1
  251. package/dist/lib/runtime/context-budget-settings.d.ts +0 -1
  252. package/dist/lib/runtime/event-handler.d.ts +0 -1
  253. package/dist/lib/runtime/first-run.d.ts +0 -1
  254. package/dist/lib/runtime/flagged-verify-types.d.ts +0 -1
  255. package/dist/lib/runtime/hydrate-emails.d.ts +0 -1
  256. package/dist/lib/runtime/inference-activity.d.ts +0 -1
  257. package/dist/lib/runtime/live-sync-entry.d.ts +0 -1
  258. package/dist/lib/runtime/live-sync.d.ts +0 -1
  259. package/dist/lib/runtime/loader-setup.d.ts +0 -1
  260. package/dist/lib/runtime/login-menu-accounts.d.ts +0 -1
  261. package/dist/lib/runtime/manual-oauth-flow.d.ts +0 -1
  262. package/dist/lib/runtime/model-discovery-status.d.ts +0 -1
  263. package/dist/lib/runtime/native-account-storage.d.ts +0 -1
  264. package/dist/lib/runtime/native-account-sync.d.ts +0 -1
  265. package/dist/lib/runtime/native-binding-lock.d.ts +0 -1
  266. package/dist/lib/runtime/native-client-auth.d.ts +0 -1
  267. package/dist/lib/runtime/native-provider-config.d.ts +0 -1
  268. package/dist/lib/runtime/native-rate-limits.d.ts +2 -1
  269. package/dist/lib/runtime/native-rate-limits.js +23 -6
  270. package/dist/lib/runtime/preemptive-quota.d.ts +0 -1
  271. package/dist/lib/runtime/quota-headers.d.ts +0 -1
  272. package/dist/lib/runtime/quota-probe.d.ts +0 -1
  273. package/dist/lib/runtime/quota-settings.d.ts +0 -1
  274. package/dist/lib/runtime/refresh-guardian-entry.d.ts +0 -1
  275. package/dist/lib/runtime/refresh-guardian.d.ts +0 -1
  276. package/dist/lib/runtime/request-init.d.ts +0 -1
  277. package/dist/lib/runtime/reset-credit-routing.d.ts +0 -1
  278. package/dist/lib/runtime/reset-credits.d.ts +0 -1
  279. package/dist/lib/runtime/response-output-history.d.ts +0 -1
  280. package/dist/lib/runtime/responses-websocket.d.ts +0 -1
  281. package/dist/lib/runtime/resume-picker.d.ts +0 -1
  282. package/dist/lib/runtime/rotation-account-selection.d.ts +0 -1
  283. package/dist/lib/runtime/rotation-proxy-state.d.ts +0 -1
  284. package/dist/lib/runtime/rotation-server-types.d.ts +0 -1
  285. package/dist/lib/runtime/rotation-storage-meta.d.ts +0 -1
  286. package/dist/lib/runtime/rotation-token-refresh.d.ts +0 -1
  287. package/dist/lib/runtime/runtime-capability-failures.d.ts +0 -1
  288. package/dist/lib/runtime/runtime-current-account.d.ts +0 -1
  289. package/dist/lib/runtime/runtime-observability.d.ts +0 -1
  290. package/dist/lib/runtime/runtime-services.d.ts +0 -1
  291. package/dist/lib/runtime/session-affinity-entry.d.ts +0 -1
  292. package/dist/lib/runtime/session-recovery.d.ts +0 -1
  293. package/dist/lib/runtime/status-marker.d.ts +0 -1
  294. package/dist/lib/runtime/storage-scope.d.ts +0 -1
  295. package/dist/lib/runtime/subscription-first-use.d.ts +0 -1
  296. package/dist/lib/runtime/subscription-quota-event.d.ts +0 -1
  297. package/dist/lib/runtime/subscription-quota-order.d.ts +0 -1
  298. package/dist/lib/runtime/toast.d.ts +0 -1
  299. package/dist/lib/runtime/ui-runtime-entry.d.ts +0 -1
  300. package/dist/lib/runtime/ui-runtime.d.ts +0 -1
  301. package/dist/lib/runtime/verify-flagged.d.ts +0 -1
  302. package/dist/lib/runtime/workspace-model-scopes.d.ts +0 -1
  303. package/dist/lib/runtime-constants.d.ts +0 -1
  304. package/dist/lib/runtime-paths.d.ts +0 -1
  305. package/dist/lib/runtime-rotation-proxy.d.ts +1 -1
  306. package/dist/lib/runtime-rotation-proxy.js +133 -0
  307. package/dist/lib/schemas.d.ts +35 -13
  308. package/dist/lib/schemas.js +19 -2
  309. package/dist/lib/session-affinity.d.ts +0 -1
  310. package/dist/lib/shutdown.d.ts +0 -1
  311. package/dist/lib/storage/account-clear-entry.d.ts +0 -1
  312. package/dist/lib/storage/account-clear.d.ts +0 -1
  313. package/dist/lib/storage/account-match-utils.d.ts +0 -1
  314. package/dist/lib/storage/account-persistence.d.ts +0 -1
  315. package/dist/lib/storage/account-port.d.ts +0 -1
  316. package/dist/lib/storage/account-save-entry.d.ts +0 -1
  317. package/dist/lib/storage/account-save.d.ts +9 -2
  318. package/dist/lib/storage/account-save.js +4 -1
  319. package/dist/lib/storage/account-snapshot.d.ts +0 -1
  320. package/dist/lib/storage/backup-metadata-builder.d.ts +0 -1
  321. package/dist/lib/storage/backup-metadata.d.ts +0 -1
  322. package/dist/lib/storage/backup-paths.d.ts +0 -1
  323. package/dist/lib/storage/backup-restore.d.ts +0 -1
  324. package/dist/lib/storage/cache-artifacts.d.ts +0 -1
  325. package/dist/lib/storage/credential-sidecars.d.ts +0 -1
  326. package/dist/lib/storage/error-hints.d.ts +0 -1
  327. package/dist/lib/storage/file-lock.d.ts +0 -1
  328. package/dist/lib/storage/file-lock.js +33 -1
  329. package/dist/lib/storage/file-paths.d.ts +0 -1
  330. package/dist/lib/storage/fixture-guards.d.ts +0 -1
  331. package/dist/lib/storage/flagged-entry.d.ts +0 -1
  332. package/dist/lib/storage/flagged-load-entry.d.ts +0 -1
  333. package/dist/lib/storage/flagged-save-entry.d.ts +0 -1
  334. package/dist/lib/storage/flagged-storage-file.d.ts +0 -1
  335. package/dist/lib/storage/flagged-storage-io.d.ts +0 -1
  336. package/dist/lib/storage/flagged-storage.d.ts +0 -1
  337. package/dist/lib/storage/gitignore.d.ts +0 -1
  338. package/dist/lib/storage/hash.d.ts +0 -1
  339. package/dist/lib/storage/health.d.ts +0 -1
  340. package/dist/lib/storage/identity.d.ts +0 -1
  341. package/dist/lib/storage/import-export.d.ts +0 -1
  342. package/dist/lib/storage/json-store-lock.d.ts +105 -0
  343. package/dist/lib/storage/json-store-lock.js +259 -0
  344. package/dist/lib/storage/metadata-section.d.ts +0 -1
  345. package/dist/lib/storage/migrations.d.ts +0 -1
  346. package/dist/lib/storage/migrations.js +31 -18
  347. package/dist/lib/storage/named-backup-entry.d.ts +0 -1
  348. package/dist/lib/storage/named-backups-entry.d.ts +0 -1
  349. package/dist/lib/storage/named-backups.d.ts +0 -1
  350. package/dist/lib/storage/path-state.d.ts +0 -1
  351. package/dist/lib/storage/paths.d.ts +0 -1
  352. package/dist/lib/storage/pending-auth.d.ts +9 -3
  353. package/dist/lib/storage/pending-auth.js +30 -8
  354. package/dist/lib/storage/project-migration.d.ts +0 -1
  355. package/dist/lib/storage/public-types.d.ts +0 -1
  356. package/dist/lib/storage/record-identity.d.ts +0 -1
  357. package/dist/lib/storage/record-utils.d.ts +0 -1
  358. package/dist/lib/storage/restore-assessment.d.ts +0 -1
  359. package/dist/lib/storage/restore-backup-entry.d.ts +0 -1
  360. package/dist/lib/storage/restore-metadata.d.ts +0 -1
  361. package/dist/lib/storage/save-retry.d.ts +0 -1
  362. package/dist/lib/storage/snapshot-inspectors.d.ts +0 -1
  363. package/dist/lib/storage/snapshot-merge.d.ts +0 -1
  364. package/dist/lib/storage/storage-parser.d.ts +2 -1
  365. package/dist/lib/storage/storage-parser.js +10 -2
  366. package/dist/lib/storage/transactions.d.ts +0 -1
  367. package/dist/lib/storage.d.ts +15 -2
  368. package/dist/lib/storage.js +612 -25
  369. package/dist/lib/synthetic-response.d.ts +0 -1
  370. package/dist/lib/table-formatter.d.ts +0 -1
  371. package/dist/lib/temp-path.d.ts +0 -1
  372. package/dist/lib/tools/hashline-tools.d.ts +0 -1
  373. package/dist/lib/types.d.ts +0 -1
  374. package/dist/lib/ui/ansi.d.ts +0 -1
  375. package/dist/lib/ui/auth-menu-builder.d.ts +0 -1
  376. package/dist/lib/ui/auth-menu.d.ts +0 -1
  377. package/dist/lib/ui/check-progress.d.ts +0 -1
  378. package/dist/lib/ui/confirm.d.ts +0 -1
  379. package/dist/lib/ui/display-width.d.ts +0 -1
  380. package/dist/lib/ui/format.d.ts +0 -1
  381. package/dist/lib/ui/index.d.ts +0 -1
  382. package/dist/lib/ui/runtime.d.ts +0 -1
  383. package/dist/lib/ui/select.d.ts +0 -1
  384. package/dist/lib/ui/theme.d.ts +0 -1
  385. package/dist/lib/ui/ui-copy.d.ts +1 -2
  386. package/dist/lib/ui/ui-copy.js +1 -1
  387. package/dist/lib/unified-settings.d.ts +13 -11
  388. package/dist/lib/unified-settings.js +22 -14
  389. package/dist/lib/update-notice.d.ts +0 -1
  390. package/dist/lib/usage/index.d.ts +0 -1
  391. package/dist/lib/usage/ledger.d.ts +0 -1
  392. package/dist/lib/usage/pricing.d.ts +1 -2
  393. package/dist/lib/usage/pricing.js +41 -16
  394. package/dist/lib/usage/redaction.d.ts +0 -1
  395. package/dist/lib/usage/stream-usage-deferral.d.ts +0 -1
  396. package/dist/lib/usage/types.d.ts +0 -1
  397. package/dist/lib/usage/usage-extraction.d.ts +0 -1
  398. package/dist/lib/utils.d.ts +21 -1
  399. package/dist/lib/utils.js +31 -0
  400. package/dist/lib/wsl.d.ts +0 -1
  401. package/package.json +11 -5
  402. package/scripts/codex-bin-resolver.js +20 -1
  403. package/scripts/codex-multi-auth.js +7 -1
  404. package/scripts/codex.js +385 -89
  405. package/skills/codex-auth-setup/SKILL.md +73 -0
@@ -18,4 +18,3 @@ export interface LimitsCommandDeps {
18
18
  * existing sequential, age-gated refresh path before serializing the snapshot.
19
19
  */
20
20
  export declare function runLimitsCommand(args: string[], deps: LimitsCommandDeps): Promise<number>;
21
- //# sourceMappingURL=limits.d.ts.map
@@ -11,4 +11,3 @@ export interface ModelsCommandDeps {
11
11
  getNow?: () => number;
12
12
  }
13
13
  export declare function runModelsCommand(args: string[], deps: ModelsCommandDeps): Promise<number>;
14
- //# sourceMappingURL=models.d.ts.map
@@ -19,4 +19,3 @@ export interface MonitorCommandDeps {
19
19
  getNow?: () => number;
20
20
  }
21
21
  export declare function runMonitorCommand(args: string[], deps: MonitorCommandDeps): Promise<number>;
22
- //# sourceMappingURL=monitor.d.ts.map
@@ -28,4 +28,3 @@ export interface ReportCommandDeps {
28
28
  loadQuotaCache?: () => Promise<QuotaCacheData | null>;
29
29
  }
30
30
  export declare function runReportCommand(args: string[], deps: ReportCommandDeps): Promise<number>;
31
- //# sourceMappingURL=report.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function runResetsCommand(args: string[]): Promise<number>;
2
- //# sourceMappingURL=resets.d.ts.map
@@ -37,6 +37,9 @@ export async function runResetsCommand(args) {
37
37
  return 0;
38
38
  }
39
39
  const targets = (storage?.accounts ?? []).map(resetTargetForStoredAccount).filter(t => t !== null);
40
+ const keyCounts = new Map();
41
+ for (const target of targets)
42
+ keyCounts.set(target.key, (keyCounts.get(target.key) ?? 0) + 1);
40
43
  const refreshed = value === '--refresh' ? await withCheckProgress('Refreshing reset-credit availability', () => service.refresh(targets)) : null;
41
44
  const state = await service.status();
42
45
  console.log(`Automatic redemption: ${state.policy}`);
@@ -44,7 +47,12 @@ export async function runResetsCommand(args) {
44
47
  const index = (storage?.accounts ?? []).findIndex(a => resetTargetForStoredAccount(a)?.key === state.lastRedemption?.key);
45
48
  console.log(`Last confirmed reset: ${index >= 0 ? `account ${index + 1}` : "removed account"}; ${state.lastRedemption.outcome}; ${state.lastRedemption.automatic ? "automatic" : "explicit"}`);
46
49
  }
47
- (storage?.accounts ?? []).forEach((a, i) => { const target = resetTargetForStoredAccount(a); const snapshot = target ? (refreshed ?? state.snapshots)[target.key] : undefined; console.log(`${resetAccountLabel(a, i)}: ${snapshot?.availableCount ?? 'unknown'} reset credits${snapshot ? ` (checked ${Math.max(0, Math.floor((Date.now() - snapshot.updatedAt) / 1000))}s ago)` : ''}${target?.key === state.pending?.key ? ' [redemption pending; retry this account]' : ''}`); });
50
+ (storage?.accounts ?? []).forEach((a, i) => { const target = resetTargetForStoredAccount(a); const ambiguous = target && (keyCounts.get(target.key) ?? 0) > 1; const snapshot = target && !ambiguous ? (refreshed ?? state.snapshots)[target.key] : undefined; console.log(`${resetAccountLabel(a, i)}: ${snapshot?.availableCount ?? 'unknown'} reset credits${snapshot ? ` (checked ${Math.max(0, Math.floor((Date.now() - snapshot.updatedAt) / 1000))}s ago)` : ''}${ambiguous ? ' [ambiguous account identity; repair duplicate records]' : ''}${target?.key === state.pending?.key ? ' [redemption pending; retry this account]' : ''}`); });
51
+ const failed = refreshed ? targets.filter(target => (keyCounts.get(target.key) ?? 0) > 1 || !refreshed[target.key]).length : 0;
52
+ if (failed) {
53
+ console.error(`${failed} of ${targets.length} reset-credit reads failed. Check account authentication and the native Codex backend (CODEX_MULTI_AUTH_USAGE_CODEX_BIN selects an executable). No credits were redeemed.`);
54
+ return 1;
55
+ }
48
56
  return 0;
49
57
  }
50
58
  catch {
@@ -24,4 +24,3 @@ export interface RotationCommandDeps {
24
24
  }
25
25
  export declare function runRotationCommand(args: string[], deps: RotationCommandDeps): Promise<number>;
26
26
  export {};
27
- //# sourceMappingURL=rotation.d.ts.map
@@ -42,4 +42,3 @@ export interface FeaturesCommandDeps {
42
42
  }
43
43
  export declare function runFeaturesCommand(deps: FeaturesCommandDeps): number;
44
44
  export {};
45
- //# sourceMappingURL=status.d.ts.map
@@ -23,4 +23,3 @@ export interface SwitchCommandDeps {
23
23
  }
24
24
  export declare function runSwitchCommand(args: string[], deps: SwitchCommandDeps): Promise<number>;
25
25
  export {};
26
- //# sourceMappingURL=switch.d.ts.map
@@ -34,4 +34,3 @@ export type UninstallCommandDeps = {
34
34
  };
35
35
  export declare function runUninstallCommand(args: string[], deps?: UninstallCommandDeps): Promise<number>;
36
36
  export {};
37
- //# sourceMappingURL=uninstall.d.ts.map
@@ -10,4 +10,3 @@ export interface UnpinCommandDeps {
10
10
  }
11
11
  export declare function runUnpinCommand(deps: UnpinCommandDeps): Promise<number>;
12
12
  export {};
13
- //# sourceMappingURL=unpin.d.ts.map
@@ -10,4 +10,3 @@ export interface UsageCommandDeps {
10
10
  writeFile?: (path: string, contents: string) => Promise<void>;
11
11
  }
12
12
  export declare function runUsageCommand(args: string[], deps?: UsageCommandDeps): Promise<number>;
13
- //# sourceMappingURL=usage.d.ts.map
@@ -56,4 +56,3 @@ export declare function runVerifyCommand(args: string[], deps: VerifyCommandDeps
56
56
  export declare function parseVerifyArgs(args: string[]): ParsedArgsResult<VerifyCliOptions>;
57
57
  export declare function printVerifyUsage(): void;
58
58
  export {};
59
- //# sourceMappingURL=verify.d.ts.map
@@ -33,4 +33,3 @@ export declare function runWhySelectedCommand(args: string[], deps: WhySelectedC
33
33
  export declare function parseWhySelectedArgs(args: string[]): ParsedArgsResult<WhySelectedCliOptions>;
34
34
  export declare function printWhySelectedUsage(): void;
35
35
  export {};
36
- //# sourceMappingURL=why-selected.d.ts.map
@@ -16,4 +16,3 @@ export interface WorkspaceCommandDeps {
16
16
  */
17
17
  export declare function runWorkspaceCommand(args: string[], deps: WorkspaceCommandDeps): Promise<number>;
18
18
  export {};
19
- //# sourceMappingURL=workspace.d.ts.map
@@ -23,4 +23,3 @@ export interface DashboardDisplayPanelDeps {
23
23
  UI_COPY: typeof UI_COPY;
24
24
  }
25
25
  export declare function promptDashboardDisplayPanel(initial: DashboardDisplaySettings, deps: DashboardDisplayPanelDeps): Promise<DashboardDisplaySettings | null>;
26
- //# sourceMappingURL=dashboard-display-panel.d.ts.map
@@ -3,4 +3,3 @@ export declare function formatDashboardSettingState(value: boolean): string;
3
3
  export declare function formatMenuSortMode(mode: DashboardAccountSortMode): string;
4
4
  export declare function formatMenuLayoutMode(mode: "compact-details" | "expanded-rows"): string;
5
5
  export declare function formatMenuQuotaTtl(ttlMs: number): string;
6
- //# sourceMappingURL=dashboard-formatters.d.ts.map
@@ -9,4 +9,3 @@ export declare function configureDashboardSettingsController(currentSettings: Da
9
9
  getDashboardSettingsPath: () => string;
10
10
  writeLine: (message: string) => void;
11
11
  }): Promise<DashboardDisplaySettings>;
12
- //# sourceMappingURL=dashboard-settings-controller.d.ts.map
@@ -7,4 +7,3 @@ export declare function dashboardSettingsDataEqual(left: DashboardDisplaySetting
7
7
  resolveMenuLayoutMode: (settings: DashboardDisplaySettings) => "compact-details" | "expanded-rows";
8
8
  normalizeStatuslineFields: (fields: DashboardDisplaySettings["menuStatuslineFields"]) => DashboardDisplaySettings["menuStatuslineFields"];
9
9
  }): boolean;
10
- //# sourceMappingURL=dashboard-settings-data.d.ts.map
@@ -19,4 +19,3 @@ export declare function configureDashboardSettingsEntry(currentSettings: Dashboa
19
19
  getDashboardSettingsPath: () => string;
20
20
  writeLine: (message: string) => void;
21
21
  }): Promise<DashboardDisplaySettings>;
22
- //# sourceMappingURL=dashboard-settings-entry.d.ts.map
@@ -4,4 +4,3 @@ export declare function promptExperimentalSettingsEntry<TTargetState>(params: {
4
4
  initialConfig: PluginConfig;
5
5
  promptExperimentalSettingsMenu: (args: ExperimentalSettingsPromptDeps<TTargetState>) => Promise<PluginConfig | null>;
6
6
  } & ExperimentalSettingsPromptDeps<TTargetState>): Promise<PluginConfig | null>;
7
- //# sourceMappingURL=experimental-settings-entry.d.ts.map
@@ -65,4 +65,3 @@ export type ExperimentalSettingsPromptDeps<TTargetState> = {
65
65
  };
66
66
  export declare function promptExperimentalSettingsMenu<TTargetState>(params: ExperimentalSettingsPromptDeps<TTargetState>): Promise<PluginConfig | null>;
67
67
  export {};
68
- //# sourceMappingURL=experimental-settings-prompt.d.ts.map
@@ -22,4 +22,3 @@ export type ExperimentalSettingsAction = {
22
22
  export declare function getExperimentalSelectOptions(ui: ReturnType<typeof getUiRuntimeOptions>, help: string, onInput?: SelectOptions<ExperimentalSettingsAction>["onInput"]): SelectOptions<ExperimentalSettingsAction>;
23
23
  export declare function mapExperimentalMenuHotkey(raw: string): ExperimentalSettingsAction | undefined;
24
24
  export declare function mapExperimentalStatusHotkey(raw: string): ExperimentalSettingsAction | undefined;
25
- //# sourceMappingURL=experimental-settings-schema.d.ts.map
@@ -27,4 +27,3 @@ export declare function loadExperimentalSyncTargetEntry(params: {
27
27
  normalizeAccountStorage: (value: unknown) => AccountStorageV3 | null;
28
28
  sleep: (ms: number) => Promise<void>;
29
29
  }): ReturnType<typeof params.loadExperimentalSyncTargetState>;
30
- //# sourceMappingURL=experimental-sync-target-entry.d.ts.map
@@ -20,4 +20,3 @@ export declare function loadExperimentalSyncTargetState(deps: {
20
20
  normalizeAccountStorage: (value: unknown) => AccountStorageV3 | null;
21
21
  }): Promise<ExperimentalSyncTargetState>;
22
22
  export {};
23
- //# sourceMappingURL=experimental-sync-target.d.ts.map
@@ -32,4 +32,3 @@ export declare function serializeForecastResults(results: ForecastAccountResult[
32
32
  };
33
33
  refreshFailure?: TokenFailure;
34
34
  }>;
35
- //# sourceMappingURL=forecast-report-shared.d.ts.map
@@ -8,4 +8,3 @@ export declare function formatRateLimitEntry(account: {
8
8
  rateLimitResetTimes?: Record<string, number | undefined>;
9
9
  }, now: number, family?: ModelFamily): string | null;
10
10
  export declare function formatBackupSavedAt(mtimeMs: number): string;
11
- //# sourceMappingURL=account-formatters.d.ts.map
@@ -2,4 +2,3 @@ export * from "./account-formatters.js";
2
2
  export * from "./model-formatters.js";
3
3
  export * from "./quota-formatters.js";
4
4
  export * from "./text-style.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -9,4 +9,3 @@ export interface ModelInspection {
9
9
  }
10
10
  export declare function inspectRequestedModel(requestedModel: string): ModelInspection;
11
11
  export declare function formatModelInspection(model: ModelInspection): string;
12
- //# sourceMappingURL=model-formatters.d.ts.map
@@ -23,4 +23,3 @@ export interface CompactQuotaFormatOptions {
23
23
  }
24
24
  export declare function formatCompactQuotaSnapshot(snapshot: CodexQuotaSnapshot, now?: number, options?: CompactQuotaFormatOptions): string;
25
25
  export declare function formatAccountQuotaSummary(entry: QuotaCacheEntry, now?: number, options?: CompactQuotaFormatOptions): string;
26
- //# sourceMappingURL=quota-formatters.d.ts.map
@@ -11,4 +11,3 @@ export declare function formatResultSummary(segments: ReadonlyArray<{
11
11
  tone: PromptTone;
12
12
  }>): string;
13
13
  export declare function stringifyLogArgs(args: unknown[]): string;
14
- //# sourceMappingURL=text-style.d.ts.map
@@ -14,4 +14,3 @@ export interface HealthCheckOptions {
14
14
  display?: DashboardDisplaySettings;
15
15
  }
16
16
  export declare function runHealthCheck(options?: HealthCheckOptions): Promise<void>;
17
- //# sourceMappingURL=health-check.d.ts.map
@@ -38,4 +38,3 @@ export type ParsedBestArgs = {
38
38
  export declare function printBestUsage(): void;
39
39
  export declare function parseBestArgs(args: string[]): ParsedBestArgs;
40
40
  export {};
41
- //# sourceMappingURL=help.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import type { DashboardDisplaySettings } from "../dashboard-settings.js";
2
2
  /** @internal */
3
3
  export declare function runActionPanel(title: string, stage: string, action: () => Promise<void> | void, settings?: DashboardDisplaySettings): Promise<void>;
4
- //# sourceMappingURL=login-action-panel.d.ts.map
@@ -17,4 +17,3 @@ export interface LoginFlowDeps {
17
17
  export declare function resolveLoginAccountTarget(storage: AccountStorageV3, identifier: string): AccountMetadataV3 | null;
18
18
  /** @internal */
19
19
  export declare function runAuthLogin(args: string[], deps: LoginFlowDeps): Promise<number>;
20
- //# sourceMappingURL=login-flow.d.ts.map
@@ -17,4 +17,3 @@ export declare function promptBackupRestoreMode(latestBackup: NamedBackupSummary
17
17
  export declare function promptManualBackupSelection(backups: NamedBackupSummary[]): Promise<NamedBackupSummary | null>;
18
18
  /** @internal */
19
19
  export declare function handleManageAction(storage: AccountStorageV3, menuResult: Awaited<ReturnType<typeof promptLoginMode>>): Promise<void>;
20
- //# sourceMappingURL=login-menu-actions.d.ts.map
@@ -16,4 +16,3 @@ export declare function refreshQuotaCacheForMenu(storage: AccountStorageV3, cach
16
16
  export declare function toExistingAccountInfo(storage: AccountStorageV3, quotaCache: QuotaCacheData | null, displaySettings: DashboardDisplaySettings, runtimeCurrent?: RuntimeCurrentAccountSelection | null): ExistingAccountInfo[];
17
17
  export declare function loadRuntimeCurrentSelectionForStorage(storage: AccountStorageV3, now?: number): Promise<RuntimeCurrentAccountSelection | null>;
18
18
  export declare function syncCodexCliActiveSelectionIfDrifted(storage: AccountStorageV3): Promise<boolean>;
19
- //# sourceMappingURL=login-menu-data.d.ts.map
@@ -91,4 +91,3 @@ export interface PersistAccountPoolOptions {
91
91
  export declare function persistAccountPool(results: TokenSuccessWithAccount[], replaceAll: boolean, options?: PersistAccountPoolOptions): Promise<PersistAccountPoolResult | null>;
92
92
  /** @internal */
93
93
  export declare function syncSelectionToCodex(tokens: TokenSuccessWithAccount): Promise<void>;
94
- //# sourceMappingURL=login-oauth.d.ts.map
@@ -8,4 +8,3 @@ interface WorkspaceChoiceDeps {
8
8
  /** Undefined delegates to the unambiguous default; null means cancel without saving. */
9
9
  export declare function chooseLoginWorkspace(candidates: AccountIdCandidate[], deps?: WorkspaceChoiceDeps): Promise<string | undefined | null>;
10
10
  export {};
11
- //# sourceMappingURL=login-workspace-choice.d.ts.map
@@ -30,4 +30,3 @@ export type ManualCallbackClassification = {
30
30
  * which is treated as a cancellation.
31
31
  */
32
32
  export declare function classifyManualCallbackInput(answer: string | null, expectedState: string): ManualCallbackClassification;
33
- //# sourceMappingURL=manual-callback.d.ts.map
@@ -21,4 +21,3 @@ export declare function persistAndSyncSelectedAccount({ storage, targetIndex, pa
21
21
  synced: boolean;
22
22
  wasDisabled: boolean;
23
23
  }>;
24
- //# sourceMappingURL=persist-selected-account.d.ts.map
@@ -21,4 +21,3 @@ export declare function updateQuotaCacheForWorkspace(cache: QuotaCacheData, acco
21
21
  /** Clone every cache namespace; immutable entries may safely remain shared. */
22
22
  export declare function cloneQuotaCacheData(cache: QuotaCacheData): QuotaCacheData;
23
23
  export declare function pruneUnsafeQuotaEmailCacheEntry(cache: QuotaCacheData, email: string | undefined, accounts: readonly Pick<AccountMetadataV3, "accountId" | "email">[], emailFallbackState?: ReadonlyMap<string, import("../quota-readiness.js").QuotaEmailFallbackState>): boolean;
24
- //# sourceMappingURL=quota-cache-helpers.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function isRateLimitedMarker(marker: string): boolean;
2
- //# sourceMappingURL=rate-limit-markers.d.ts.map
@@ -65,4 +65,3 @@ export declare function runVerifyFlagged(args: string[], deps: RepairCommandDeps
65
65
  export declare function runFix(args: string[], deps: RepairCommandDeps): Promise<number>;
66
66
  export declare function runDoctor(args: string[], deps: RepairCommandDeps): Promise<number>;
67
67
  export {};
68
- //# sourceMappingURL=repair-commands.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import type { PluginConfig } from "../../types.js";
2
2
  export declare function promptBackendSettings(initial: PluginConfig): Promise<PluginConfig | null>;
3
3
  export declare function configureBackendSettings(currentConfig?: PluginConfig): Promise<PluginConfig>;
4
- //# sourceMappingURL=backend.d.ts.map
@@ -8,4 +8,3 @@ export declare function promptStatuslineSettings(initial: DashboardDisplaySettin
8
8
  export declare function configureStatuslineSettings(currentSettings?: DashboardDisplaySettings): Promise<DashboardDisplaySettings>;
9
9
  export declare function promptBehaviorSettings(initial: DashboardDisplaySettings): Promise<DashboardDisplaySettings | null>;
10
10
  export declare function promptThemeSettings(initial: DashboardDisplaySettings): Promise<DashboardDisplaySettings | null>;
11
- //# sourceMappingURL=dashboard.d.ts.map
@@ -15,4 +15,3 @@ export declare function loadExperimentalSyncTarget(): Promise<{
15
15
  destination: import("../../storage.js").AccountStorageV3 | null;
16
16
  }>;
17
17
  export declare function promptExperimentalSettings(initialConfig: PluginConfig): Promise<PluginConfig | null>;
18
- //# sourceMappingURL=experimental.d.ts.map
@@ -31,4 +31,3 @@ declare const __testOnly: {
31
31
  promptBackendSettings: typeof promptBackendSettings;
32
32
  };
33
33
  export { configureUnifiedSettings, applyUiThemeFromDashboardSettings, resolveMenuLayoutMode, __testOnly, };
34
- //# sourceMappingURL=index.d.ts.map
@@ -37,4 +37,3 @@ export declare function resolveMenuLayoutMode(settings: DashboardDisplaySettings
37
37
  export declare function withQueuedRetryForTests<T>(pathKey: string, task: () => Promise<T>): Promise<T>;
38
38
  export declare function persistDashboardSettingsSelectionForTests(selected: DashboardDisplaySettings, keys: ReadonlyArray<keyof DashboardDisplaySettings>, scope: string): Promise<DashboardDisplaySettings>;
39
39
  export declare function persistBackendConfigSelectionForTests(selected: PluginConfig, scope: string): Promise<PluginConfig>;
40
- //# sourceMappingURL=shared.d.ts.map
@@ -27,4 +27,3 @@ export declare function promptSettingsHubEntry<TAction extends {
27
27
  help: string;
28
28
  };
29
29
  }): Promise<TAction | null>;
30
- //# sourceMappingURL=settings-hub-entry.d.ts.map
@@ -27,4 +27,3 @@ export declare function buildSettingsHubItems(copy: {
27
27
  back: string;
28
28
  }): MenuItem<SettingsHubMenuAction>[];
29
29
  export declare function findSettingsHubInitialCursor(items: MenuItem<SettingsHubMenuAction>[], initialFocus: SettingsHubMenuAction["type"]): number | undefined;
30
- //# sourceMappingURL=settings-hub-menu.d.ts.map
@@ -22,4 +22,3 @@ export declare function promptSettingsHubMenu(initialFocus: SettingsHubMenuActio
22
22
  help: string;
23
23
  };
24
24
  }): Promise<SettingsHubMenuAction | null>;
25
- //# sourceMappingURL=settings-hub-prompt.d.ts.map
@@ -1,2 +1 @@
1
1
  export { __testOnly, applyUiThemeFromDashboardSettings, configureUnifiedSettings, resolveMenuLayoutMode, } from "./settings-hub/index.js";
2
- //# sourceMappingURL=settings-hub.d.ts.map
@@ -53,4 +53,3 @@ export declare function promptThemeSettingsPanelEntry(params: {
53
53
  THEME_PANEL_KEYS: ThemeSettingsPanelDeps["THEME_PANEL_KEYS"];
54
54
  UI_COPY: ThemeSettingsPanelDeps["UI_COPY"];
55
55
  }): Promise<DashboardDisplaySettings | null>;
56
- //# sourceMappingURL=settings-panels.d.ts.map
@@ -6,4 +6,3 @@ export declare function readFileWithRetry(path: string, deps: {
6
6
  maxAttempts: number;
7
7
  sleep: (ms: number) => Promise<void>;
8
8
  }): Promise<string>;
9
- //# sourceMappingURL=settings-persist-utils.d.ts.map
@@ -9,4 +9,3 @@ export declare function buildAccountListPreview(settings: DashboardDisplaySettin
9
9
  label: string;
10
10
  hint: string;
11
11
  };
12
- //# sourceMappingURL=settings-preview.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare function withQueuedRetry<T>(pathKey: string, task: () => Promise<T>, deps: {
2
2
  sleep: (ms: number) => Promise<void>;
3
3
  }): Promise<T>;
4
- //# sourceMappingURL=settings-write-queue.d.ts.map
@@ -22,4 +22,3 @@ export interface StatuslineSettingsPanelDeps {
22
22
  }
23
23
  export declare function promptStatuslineSettingsPanel(initial: DashboardDisplaySettings, deps: StatuslineSettingsPanelDeps): Promise<DashboardDisplaySettings | null>;
24
24
  export {};
25
- //# sourceMappingURL=statusline-settings-panel.d.ts.map
@@ -10,4 +10,3 @@ export interface ThemeSettingsPanelDeps {
10
10
  UI_COPY: typeof UI_COPY;
11
11
  }
12
12
  export declare function promptThemeSettingsPanel(initial: DashboardDisplaySettings, deps: ThemeSettingsPanelDeps): Promise<DashboardDisplaySettings | null>;
13
- //# sourceMappingURL=theme-settings-panel.d.ts.map
@@ -24,4 +24,3 @@ export type UnifiedSettingsControllerDeps = {
24
24
  THEME_PANEL_KEYS: readonly (keyof DashboardDisplaySettings)[];
25
25
  };
26
26
  export declare function configureUnifiedSettingsController(initialSettings: DashboardDisplaySettings | undefined, deps: UnifiedSettingsControllerDeps): Promise<DashboardDisplaySettings>;
27
- //# sourceMappingURL=unified-settings-controller.d.ts.map
@@ -3,4 +3,3 @@ import type { UnifiedSettingsControllerDeps } from "./unified-settings-controlle
3
3
  export declare function configureUnifiedSettingsEntry(initialSettings: DashboardDisplaySettings | undefined, deps: {
4
4
  configureUnifiedSettingsController: (initialSettings: DashboardDisplaySettings | undefined, deps: UnifiedSettingsControllerDeps) => Promise<DashboardDisplaySettings>;
5
5
  } & UnifiedSettingsControllerDeps): Promise<DashboardDisplaySettings>;
6
- //# sourceMappingURL=unified-settings-entry.d.ts.map
@@ -2,8 +2,7 @@ import { selectHybridAccountTraced } from "./rotation.js";
2
2
  import { formatBackupSavedAt, styleAccountDetailText } from "./codex-manager/formatters/index.js";
3
3
  import { type AccountStorageV3 } from "./storage.js";
4
4
  export { formatBackupSavedAt, styleAccountDetailText };
5
- export declare function autoSyncActiveAccountToCodex(): Promise<boolean>;
5
+ export { autoSyncActiveAccountToCodex } from "./codex-manager/active-account-sync.js";
6
6
  /** @internal Exposed for diagnostics regression tests; not part of the CLI API. */
7
7
  export declare function buildSelectAccountTraced(): (storage: AccountStorageV3) => Promise<ReturnType<typeof selectHybridAccountTraced>>;
8
8
  export declare function runCodexMultiAuthCli(rawArgs: string[]): Promise<number>;
9
- //# sourceMappingURL=codex-manager.d.ts.map
@@ -5,7 +5,6 @@ import { loadInferenceRequestTimes } from "./runtime/inference-activity.js";
5
5
  import { loadModelInventory, refreshAndPrintModelInventory } from "./runtime/model-discovery-status.js";
6
6
  import { AUTH_INVALIDATION_MARKER, AccountManager, extractAccountEmail, extractAccountId, formatAccountLabel, formatWaitTime, sanitizeEmail, } from "./accounts.js";
7
7
  import { reboundUnauthorizedAccountIdentity, refreshCodexCliMirror, } from "./auth/account-access.js";
8
- import { codexCliAccountIdFor } from "./auth/token-utils.js";
9
8
  import { loadCodexCliState } from "./codex-cli/state.js";
10
9
  import { setCodexCliActiveSelection } from "./codex-cli/writer.js";
11
10
  import { parseBestArgs, printBestUsage, runBestCommand, } from "./codex-manager/commands/best.js";
@@ -60,7 +59,7 @@ import { loadQuotaCache, saveQuotaCache } from "./quota-cache.js";
60
59
  import { readAppRuntimeHelperAccountSignal } from "./runtime/runtime-current-account.js";
61
60
  import { fetchCodexQuotaSnapshot, formatQuotaSnapshotLine, } from "./quota-probe.js";
62
61
  import { queuedRefresh } from "./refresh-queue.js";
63
- import { clearAccounts, findMatchingAccountIndex, inspectStorageHealth, getLastAccountsSaveTimestamp, getStoragePath, loadAccounts, loadFlaggedAccounts, saveAccounts, setStoragePath, withAccountStorageTransaction, } from "./storage.js";
62
+ import { clearAccounts, inspectStorageHealth, getLastAccountsSaveTimestamp, getStoragePath, loadAccounts, loadFlaggedAccounts, saveAccounts, setStoragePath, } from "./storage.js";
64
63
  // Formatter implementations moved to lib/codex-manager/formatters/ (audit
65
64
  // roadmap §4.1.1 phase 1). Re-exported here so existing consumers importing
66
65
  // from lib/codex-manager.js keep working unchanged.
@@ -196,99 +195,10 @@ async function runBest(args) {
196
195
  setCodexCliActiveSelection,
197
196
  });
198
197
  }
199
- export async function autoSyncActiveAccountToCodex() {
200
- setStoragePath(null);
201
- const storage = await loadAccounts();
202
- if (!storage || storage.accounts.length === 0) {
203
- return false;
204
- }
205
- const activeIndex = resolveActiveIndex(storage, "codex");
206
- if (activeIndex < 0 || activeIndex >= storage.accounts.length) {
207
- return false;
208
- }
209
- const account = storage.accounts[activeIndex];
210
- if (!account) {
211
- return false;
212
- }
213
- const accountMatch = {
214
- accountId: account.accountId,
215
- email: account.email,
216
- refreshToken: account.refreshToken,
217
- };
218
- const now = Date.now();
219
- let syncAccessToken = account.accessToken;
220
- let syncRefreshToken = account.refreshToken;
221
- let syncExpiresAt = account.expiresAt;
222
- let syncIdToken;
223
- let syncEmail = account.email;
224
- let changed = false;
225
- let nextStoredAccount = null;
226
- if (!hasUsableAccessToken(account, now)) {
227
- const refreshResult = await queuedRefresh(account.refreshToken);
228
- if (refreshResult.type !== "success") {
229
- return false;
230
- }
231
- nextStoredAccount = structuredClone(account);
232
- const tokenAccountId = extractAccountId(refreshResult.access);
233
- const nextEmail = sanitizeEmail(extractAccountEmail(refreshResult.access, refreshResult.idToken));
234
- if (nextStoredAccount.refreshToken !== refreshResult.refresh) {
235
- nextStoredAccount.refreshToken = refreshResult.refresh;
236
- changed = true;
237
- }
238
- if (nextStoredAccount.accessToken !== refreshResult.access) {
239
- nextStoredAccount.accessToken = refreshResult.access;
240
- changed = true;
241
- }
242
- if (nextStoredAccount.expiresAt !== refreshResult.expires) {
243
- nextStoredAccount.expiresAt = refreshResult.expires;
244
- changed = true;
245
- }
246
- if (nextEmail && nextEmail !== nextStoredAccount.email) {
247
- nextStoredAccount.email = nextEmail;
248
- changed = true;
249
- }
250
- if (applyTokenAccountIdentity(nextStoredAccount, tokenAccountId)) {
251
- changed = true;
252
- }
253
- syncAccessToken = refreshResult.access;
254
- syncRefreshToken = refreshResult.refresh;
255
- syncExpiresAt = refreshResult.expires;
256
- syncIdToken = refreshResult.idToken;
257
- syncEmail = nextStoredAccount.email;
258
- }
259
- if (changed && nextStoredAccount) {
260
- let persisted = false;
261
- await withAccountStorageTransaction(async (loadedStorage, persist) => {
262
- if (!loadedStorage) {
263
- return;
264
- }
265
- const nextStorage = structuredClone(loadedStorage);
266
- const targetIndex = findMatchingAccountIndex(nextStorage.accounts, accountMatch, {
267
- allowUniqueAccountIdFallbackWithoutEmail: true,
268
- }) ??
269
- findMatchingAccountIndex(nextStorage.accounts, nextStoredAccount, {
270
- allowUniqueAccountIdFallbackWithoutEmail: true,
271
- });
272
- if (targetIndex === undefined) {
273
- return;
274
- }
275
- nextStorage.accounts[targetIndex] = structuredClone(nextStoredAccount);
276
- await persist(nextStorage);
277
- persisted = true;
278
- });
279
- if (!persisted) {
280
- return false;
281
- }
282
- }
283
- return setCodexCliActiveSelection({
284
- accountId: codexCliAccountIdFor(nextStoredAccount ?? account, syncAccessToken, syncIdToken),
285
- email: syncEmail,
286
- accessToken: syncAccessToken,
287
- refreshToken: syncRefreshToken,
288
- expiresAt: syncExpiresAt,
289
- ...(syncIdToken ? { idToken: syncIdToken } : {}),
290
- });
291
- }
198
+ // Moved to lib/codex-manager/active-account-sync.ts so the wrapper's forwarded
199
+ // path can import the sync without the whole manager/dispatch graph. Re-exported
200
+ // here to keep the codex-manager.js surface (and its tests) unchanged.
201
+ export { autoSyncActiveAccountToCodex } from "./codex-manager/active-account-sync.js";
292
202
  /** @internal Exposed for diagnostics regression tests; not part of the CLI API. */
293
203
  export function buildSelectAccountTraced() {
294
204
  return async (storage) => {
@@ -1,3 +1,2 @@
1
1
  /** Bounded independent work, refilling free slots immediately and preserving result order. */
2
2
  export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, worker: (item: T, index: number) => Promise<R>): Promise<R[]>;
3
- //# sourceMappingURL=concurrency.d.ts.map
@@ -29,4 +29,3 @@ export declare function buildConfigJsonSchema(): JsonObject;
29
29
  */
30
30
  export declare function renderConfigJsonSchema(): string;
31
31
  export {};
32
- //# sourceMappingURL=config-schema.d.ts.map
@@ -385,4 +385,3 @@ export declare function getRoutingMutexMode(pluginConfig: PluginConfig): "enable
385
385
  export declare function getSchedulingStrategy(pluginConfig: PluginConfig): "hybrid" | "sequential";
386
386
  export declare function getPluginConfigExplainReport(): ConfigExplainReport;
387
387
  export {};
388
- //# sourceMappingURL=config.d.ts.map