codex-multi-auth 1.1.11 → 1.2.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 (695) hide show
  1. package/README.md +52 -20
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1023 -1661
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/accounts.d.ts +22 -2
  6. package/dist/lib/accounts.d.ts.map +1 -1
  7. package/dist/lib/accounts.js +84 -1
  8. package/dist/lib/accounts.js.map +1 -1
  9. package/dist/lib/auth/browser.d.ts +1 -0
  10. package/dist/lib/auth/browser.d.ts.map +1 -1
  11. package/dist/lib/auth/browser.js +13 -0
  12. package/dist/lib/auth/browser.js.map +1 -1
  13. package/dist/lib/auth/index.d.ts +2 -0
  14. package/dist/lib/auth/index.d.ts.map +1 -0
  15. package/dist/lib/auth/index.js +2 -0
  16. package/dist/lib/auth/index.js.map +1 -0
  17. package/dist/lib/auth/token-utils.d.ts +16 -0
  18. package/dist/lib/auth/token-utils.d.ts.map +1 -1
  19. package/dist/lib/auth/token-utils.js +13 -0
  20. package/dist/lib/auth/token-utils.js.map +1 -1
  21. package/dist/lib/codex-cli/index.d.ts +5 -0
  22. package/dist/lib/codex-cli/index.d.ts.map +1 -0
  23. package/dist/lib/codex-cli/index.js +5 -0
  24. package/dist/lib/codex-cli/index.js.map +1 -0
  25. package/dist/lib/codex-manager/auth-commands.d.ts +72 -0
  26. package/dist/lib/codex-manager/auth-commands.d.ts.map +1 -0
  27. package/dist/lib/codex-manager/auth-commands.js +643 -0
  28. package/dist/lib/codex-manager/auth-commands.js.map +1 -0
  29. package/dist/lib/codex-manager/backend-category-entry.d.ts +103 -0
  30. package/dist/lib/codex-manager/backend-category-entry.d.ts.map +1 -0
  31. package/dist/lib/codex-manager/backend-category-entry.js +23 -0
  32. package/dist/lib/codex-manager/backend-category-entry.js.map +1 -0
  33. package/dist/lib/codex-manager/backend-category-helpers.d.ts +10 -0
  34. package/dist/lib/codex-manager/backend-category-helpers.d.ts.map +1 -0
  35. package/dist/lib/codex-manager/backend-category-helpers.js +29 -0
  36. package/dist/lib/codex-manager/backend-category-helpers.js.map +1 -0
  37. package/dist/lib/codex-manager/backend-category-prompt.d.ts +55 -0
  38. package/dist/lib/codex-manager/backend-category-prompt.d.ts.map +1 -0
  39. package/dist/lib/codex-manager/backend-category-prompt.js +178 -0
  40. package/dist/lib/codex-manager/backend-category-prompt.js.map +1 -0
  41. package/dist/lib/codex-manager/backend-settings-controller.d.ts +11 -0
  42. package/dist/lib/codex-manager/backend-settings-controller.d.ts.map +1 -0
  43. package/dist/lib/codex-manager/backend-settings-controller.js +14 -0
  44. package/dist/lib/codex-manager/backend-settings-controller.js.map +1 -0
  45. package/dist/lib/codex-manager/backend-settings-entry.d.ts +20 -0
  46. package/dist/lib/codex-manager/backend-settings-entry.d.ts.map +1 -0
  47. package/dist/lib/codex-manager/backend-settings-entry.js +12 -0
  48. package/dist/lib/codex-manager/backend-settings-entry.js.map +1 -0
  49. package/dist/lib/codex-manager/backend-settings-helpers.d.ts +16 -0
  50. package/dist/lib/codex-manager/backend-settings-helpers.d.ts.map +1 -0
  51. package/dist/lib/codex-manager/backend-settings-helpers.js +102 -0
  52. package/dist/lib/codex-manager/backend-settings-helpers.js.map +1 -0
  53. package/dist/lib/codex-manager/backend-settings-prompt.d.ts +49 -0
  54. package/dist/lib/codex-manager/backend-settings-prompt.d.ts.map +1 -0
  55. package/dist/lib/codex-manager/backend-settings-prompt.js +121 -0
  56. package/dist/lib/codex-manager/backend-settings-prompt.js.map +1 -0
  57. package/dist/lib/codex-manager/backend-settings-schema.d.ts +55 -0
  58. package/dist/lib/codex-manager/backend-settings-schema.d.ts.map +1 -0
  59. package/dist/lib/codex-manager/backend-settings-schema.js +264 -0
  60. package/dist/lib/codex-manager/backend-settings-schema.js.map +1 -0
  61. package/dist/lib/codex-manager/behavior-settings-panel.d.ts +33 -0
  62. package/dist/lib/codex-manager/behavior-settings-panel.d.ts.map +1 -0
  63. package/dist/lib/codex-manager/behavior-settings-panel.js +180 -0
  64. package/dist/lib/codex-manager/behavior-settings-panel.js.map +1 -0
  65. package/dist/lib/codex-manager/best.d.ts +26 -0
  66. package/dist/lib/codex-manager/best.d.ts.map +1 -0
  67. package/dist/lib/codex-manager/best.js +249 -0
  68. package/dist/lib/codex-manager/best.js.map +1 -0
  69. package/dist/lib/codex-manager/commands/best.d.ts +81 -0
  70. package/dist/lib/codex-manager/commands/best.d.ts.map +1 -0
  71. package/dist/lib/codex-manager/commands/best.js +223 -0
  72. package/dist/lib/codex-manager/commands/best.js.map +1 -0
  73. package/dist/lib/codex-manager/commands/check.d.ts +7 -0
  74. package/dist/lib/codex-manager/commands/check.d.ts.map +1 -0
  75. package/dist/lib/codex-manager/commands/check.js +5 -0
  76. package/dist/lib/codex-manager/commands/check.js.map +1 -0
  77. package/dist/lib/codex-manager/commands/config-explain.d.ts +7 -0
  78. package/dist/lib/codex-manager/commands/config-explain.d.ts.map +1 -0
  79. package/dist/lib/codex-manager/commands/config-explain.js +31 -0
  80. package/dist/lib/codex-manager/commands/config-explain.js.map +1 -0
  81. package/dist/lib/codex-manager/commands/debug-bundle.d.ts +28 -0
  82. package/dist/lib/codex-manager/commands/debug-bundle.d.ts.map +1 -0
  83. package/dist/lib/codex-manager/commands/debug-bundle.js +62 -0
  84. package/dist/lib/codex-manager/commands/debug-bundle.js.map +1 -0
  85. package/dist/lib/codex-manager/commands/doctor.d.ts +85 -0
  86. package/dist/lib/codex-manager/commands/doctor.d.ts.map +1 -0
  87. package/dist/lib/codex-manager/commands/doctor.js +424 -0
  88. package/dist/lib/codex-manager/commands/doctor.js.map +1 -0
  89. package/dist/lib/codex-manager/commands/fix.d.ts +92 -0
  90. package/dist/lib/codex-manager/commands/fix.d.ts.map +1 -0
  91. package/dist/lib/codex-manager/commands/fix.js +347 -0
  92. package/dist/lib/codex-manager/commands/fix.js.map +1 -0
  93. package/dist/lib/codex-manager/commands/forecast.d.ts +70 -0
  94. package/dist/lib/codex-manager/commands/forecast.d.ts.map +1 -0
  95. package/dist/lib/codex-manager/commands/forecast.js +281 -0
  96. package/dist/lib/codex-manager/commands/forecast.js.map +1 -0
  97. package/dist/lib/codex-manager/commands/init-config.d.ts +15 -0
  98. package/dist/lib/codex-manager/commands/init-config.d.ts.map +1 -0
  99. package/dist/lib/codex-manager/commands/init-config.js +95 -0
  100. package/dist/lib/codex-manager/commands/init-config.js.map +1 -0
  101. package/dist/lib/codex-manager/commands/report.d.ts +24 -0
  102. package/dist/lib/codex-manager/commands/report.d.ts.map +1 -0
  103. package/dist/lib/codex-manager/commands/report.js +314 -0
  104. package/dist/lib/codex-manager/commands/report.js.map +1 -0
  105. package/dist/lib/codex-manager/commands/status.d.ts +23 -0
  106. package/dist/lib/codex-manager/commands/status.d.ts.map +1 -0
  107. package/dist/lib/codex-manager/commands/status.js +50 -0
  108. package/dist/lib/codex-manager/commands/status.js.map +1 -0
  109. package/dist/lib/codex-manager/commands/switch.d.ts +22 -0
  110. package/dist/lib/codex-manager/commands/switch.d.ts.map +1 -0
  111. package/dist/lib/codex-manager/commands/switch.js +41 -0
  112. package/dist/lib/codex-manager/commands/switch.js.map +1 -0
  113. package/dist/lib/codex-manager/commands/verify-flagged.d.ts +69 -0
  114. package/dist/lib/codex-manager/commands/verify-flagged.d.ts.map +1 -0
  115. package/dist/lib/codex-manager/commands/verify-flagged.js +251 -0
  116. package/dist/lib/codex-manager/commands/verify-flagged.js.map +1 -0
  117. package/dist/lib/codex-manager/config-explain.d.ts +2 -0
  118. package/dist/lib/codex-manager/config-explain.d.ts.map +1 -0
  119. package/dist/lib/codex-manager/config-explain.js +62 -0
  120. package/dist/lib/codex-manager/config-explain.js.map +1 -0
  121. package/dist/lib/codex-manager/config-template.d.ts +2 -0
  122. package/dist/lib/codex-manager/config-template.d.ts.map +1 -0
  123. package/dist/lib/codex-manager/config-template.js +112 -0
  124. package/dist/lib/codex-manager/config-template.js.map +1 -0
  125. package/dist/lib/codex-manager/dashboard-display-panel.d.ts +40 -0
  126. package/dist/lib/codex-manager/dashboard-display-panel.d.ts.map +1 -0
  127. package/dist/lib/codex-manager/dashboard-display-panel.js +187 -0
  128. package/dist/lib/codex-manager/dashboard-display-panel.js.map +1 -0
  129. package/dist/lib/codex-manager/dashboard-formatters.d.ts +6 -0
  130. package/dist/lib/codex-manager/dashboard-formatters.d.ts.map +1 -0
  131. package/dist/lib/codex-manager/dashboard-formatters.js +19 -0
  132. package/dist/lib/codex-manager/dashboard-formatters.js.map +1 -0
  133. package/dist/lib/codex-manager/dashboard-settings-controller.d.ts +12 -0
  134. package/dist/lib/codex-manager/dashboard-settings-controller.d.ts.map +1 -0
  135. package/dist/lib/codex-manager/dashboard-settings-controller.js +17 -0
  136. package/dist/lib/codex-manager/dashboard-settings-controller.js.map +1 -0
  137. package/dist/lib/codex-manager/dashboard-settings-data.d.ts +10 -0
  138. package/dist/lib/codex-manager/dashboard-settings-data.d.ts.map +1 -0
  139. package/dist/lib/codex-manager/dashboard-settings-data.js +95 -0
  140. package/dist/lib/codex-manager/dashboard-settings-data.js.map +1 -0
  141. package/dist/lib/codex-manager/dashboard-settings-entry.d.ts +22 -0
  142. package/dist/lib/codex-manager/dashboard-settings-entry.d.ts.map +1 -0
  143. package/dist/lib/codex-manager/dashboard-settings-entry.js +13 -0
  144. package/dist/lib/codex-manager/dashboard-settings-entry.js.map +1 -0
  145. package/dist/lib/codex-manager/debug-bundle.d.ts +2 -0
  146. package/dist/lib/codex-manager/debug-bundle.d.ts.map +1 -0
  147. package/dist/lib/codex-manager/debug-bundle.js +128 -0
  148. package/dist/lib/codex-manager/debug-bundle.js.map +1 -0
  149. package/dist/lib/codex-manager/doctor.d.ts +20 -0
  150. package/dist/lib/codex-manager/doctor.d.ts.map +1 -0
  151. package/dist/lib/codex-manager/doctor.js +546 -0
  152. package/dist/lib/codex-manager/doctor.js.map +1 -0
  153. package/dist/lib/codex-manager/experimental-settings-entry.d.ts +7 -0
  154. package/dist/lib/codex-manager/experimental-settings-entry.d.ts.map +1 -0
  155. package/dist/lib/codex-manager/experimental-settings-entry.js +30 -0
  156. package/dist/lib/codex-manager/experimental-settings-entry.js.map +1 -0
  157. package/dist/lib/codex-manager/experimental-settings-prompt.d.ts +66 -0
  158. package/dist/lib/codex-manager/experimental-settings-prompt.d.ts.map +1 -0
  159. package/dist/lib/codex-manager/experimental-settings-prompt.js +221 -0
  160. package/dist/lib/codex-manager/experimental-settings-prompt.js.map +1 -0
  161. package/dist/lib/codex-manager/experimental-settings-schema.d.ts +23 -0
  162. package/dist/lib/codex-manager/experimental-settings-schema.d.ts.map +1 -0
  163. package/dist/lib/codex-manager/experimental-settings-schema.js +34 -0
  164. package/dist/lib/codex-manager/experimental-settings-schema.js.map +1 -0
  165. package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts +30 -0
  166. package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts.map +1 -0
  167. package/dist/lib/codex-manager/experimental-sync-target-entry.js +16 -0
  168. package/dist/lib/codex-manager/experimental-sync-target-entry.js.map +1 -0
  169. package/dist/lib/codex-manager/experimental-sync-target.d.ts +23 -0
  170. package/dist/lib/codex-manager/experimental-sync-target.d.ts.map +1 -0
  171. package/dist/lib/codex-manager/experimental-sync-target.js +39 -0
  172. package/dist/lib/codex-manager/experimental-sync-target.js.map +1 -0
  173. package/dist/lib/codex-manager/fix.d.ts +26 -0
  174. package/dist/lib/codex-manager/fix.d.ts.map +1 -0
  175. package/dist/lib/codex-manager/fix.js +366 -0
  176. package/dist/lib/codex-manager/fix.js.map +1 -0
  177. package/dist/lib/codex-manager/forecast-report-commands.d.ts +54 -0
  178. package/dist/lib/codex-manager/forecast-report-commands.d.ts.map +1 -0
  179. package/dist/lib/codex-manager/forecast-report-commands.js +443 -0
  180. package/dist/lib/codex-manager/forecast-report-commands.js.map +1 -0
  181. package/dist/lib/codex-manager/forecast.d.ts +26 -0
  182. package/dist/lib/codex-manager/forecast.d.ts.map +1 -0
  183. package/dist/lib/codex-manager/forecast.js +218 -0
  184. package/dist/lib/codex-manager/forecast.js.map +1 -0
  185. package/dist/lib/codex-manager/help.d.ts +36 -0
  186. package/dist/lib/codex-manager/help.d.ts.map +1 -0
  187. package/dist/lib/codex-manager/help.js +125 -0
  188. package/dist/lib/codex-manager/help.js.map +1 -0
  189. package/dist/lib/codex-manager/info.d.ts +11 -0
  190. package/dist/lib/codex-manager/info.d.ts.map +1 -0
  191. package/dist/lib/codex-manager/info.js +91 -0
  192. package/dist/lib/codex-manager/info.js.map +1 -0
  193. package/dist/lib/codex-manager/login.d.ts +40 -0
  194. package/dist/lib/codex-manager/login.d.ts.map +1 -0
  195. package/dist/lib/codex-manager/login.js +1041 -0
  196. package/dist/lib/codex-manager/login.js.map +1 -0
  197. package/dist/lib/codex-manager/repair-commands.d.ts +70 -0
  198. package/dist/lib/codex-manager/repair-commands.d.ts.map +1 -0
  199. package/dist/lib/codex-manager/repair-commands.js +1671 -0
  200. package/dist/lib/codex-manager/repair-commands.js.map +1 -0
  201. package/dist/lib/codex-manager/report.d.ts +39 -0
  202. package/dist/lib/codex-manager/report.d.ts.map +1 -0
  203. package/dist/lib/codex-manager/report.js +243 -0
  204. package/dist/lib/codex-manager/report.js.map +1 -0
  205. package/dist/lib/codex-manager/settings-hub-entry.d.ts +30 -0
  206. package/dist/lib/codex-manager/settings-hub-entry.d.ts.map +1 -0
  207. package/dist/lib/codex-manager/settings-hub-entry.js +11 -0
  208. package/dist/lib/codex-manager/settings-hub-entry.js.map +1 -0
  209. package/dist/lib/codex-manager/settings-hub-menu.d.ts +30 -0
  210. package/dist/lib/codex-manager/settings-hub-menu.d.ts.map +1 -0
  211. package/dist/lib/codex-manager/settings-hub-menu.js +37 -0
  212. package/dist/lib/codex-manager/settings-hub-menu.js.map +1 -0
  213. package/dist/lib/codex-manager/settings-hub-prompt.d.ts +25 -0
  214. package/dist/lib/codex-manager/settings-hub-prompt.d.ts.map +1 -0
  215. package/dist/lib/codex-manager/settings-hub-prompt.js +23 -0
  216. package/dist/lib/codex-manager/settings-hub-prompt.js.map +1 -0
  217. package/dist/lib/codex-manager/settings-hub.d.ts +12 -10
  218. package/dist/lib/codex-manager/settings-hub.d.ts.map +1 -1
  219. package/dist/lib/codex-manager/settings-hub.js +262 -2187
  220. package/dist/lib/codex-manager/settings-hub.js.map +1 -1
  221. package/dist/lib/codex-manager/settings-panels.d.ts +56 -0
  222. package/dist/lib/codex-manager/settings-panels.d.ts.map +1 -0
  223. package/dist/lib/codex-manager/settings-panels.js +73 -0
  224. package/dist/lib/codex-manager/settings-panels.js.map +1 -0
  225. package/dist/lib/codex-manager/settings-persist-utils.d.ts +9 -0
  226. package/dist/lib/codex-manager/settings-persist-utils.d.ts.map +1 -0
  227. package/dist/lib/codex-manager/settings-persist-utils.js +33 -0
  228. package/dist/lib/codex-manager/settings-persist-utils.js.map +1 -0
  229. package/dist/lib/codex-manager/settings-preview.d.ts +12 -0
  230. package/dist/lib/codex-manager/settings-preview.d.ts.map +1 -0
  231. package/dist/lib/codex-manager/settings-preview.js +118 -0
  232. package/dist/lib/codex-manager/settings-preview.js.map +1 -0
  233. package/dist/lib/codex-manager/settings-write-queue.d.ts +14 -0
  234. package/dist/lib/codex-manager/settings-write-queue.d.ts.map +1 -0
  235. package/dist/lib/codex-manager/settings-write-queue.js +88 -0
  236. package/dist/lib/codex-manager/settings-write-queue.js.map +1 -0
  237. package/dist/lib/codex-manager/statusline-order.d.ts +3 -0
  238. package/dist/lib/codex-manager/statusline-order.d.ts.map +1 -0
  239. package/dist/lib/codex-manager/statusline-order.js +17 -0
  240. package/dist/lib/codex-manager/statusline-order.js.map +1 -0
  241. package/dist/lib/codex-manager/statusline-settings-panel.d.ts +40 -0
  242. package/dist/lib/codex-manager/statusline-settings-panel.d.ts.map +1 -0
  243. package/dist/lib/codex-manager/statusline-settings-panel.js +167 -0
  244. package/dist/lib/codex-manager/statusline-settings-panel.js.map +1 -0
  245. package/dist/lib/codex-manager/switch.d.ts +31 -0
  246. package/dist/lib/codex-manager/switch.d.ts.map +1 -0
  247. package/dist/lib/codex-manager/switch.js +103 -0
  248. package/dist/lib/codex-manager/switch.js.map +1 -0
  249. package/dist/lib/codex-manager/theme-settings-panel.d.ts +26 -0
  250. package/dist/lib/codex-manager/theme-settings-panel.d.ts.map +1 -0
  251. package/dist/lib/codex-manager/theme-settings-panel.js +131 -0
  252. package/dist/lib/codex-manager/theme-settings-panel.js.map +1 -0
  253. package/dist/lib/codex-manager/unified-settings-controller.d.ts +27 -0
  254. package/dist/lib/codex-manager/unified-settings-controller.d.ts.map +1 -0
  255. package/dist/lib/codex-manager/unified-settings-controller.js +50 -0
  256. package/dist/lib/codex-manager/unified-settings-controller.js.map +1 -0
  257. package/dist/lib/codex-manager/unified-settings-entry.d.ts +6 -0
  258. package/dist/lib/codex-manager/unified-settings-entry.d.ts.map +1 -0
  259. package/dist/lib/codex-manager/unified-settings-entry.js +23 -0
  260. package/dist/lib/codex-manager/unified-settings-entry.js.map +1 -0
  261. package/dist/lib/codex-manager/verify-flagged.d.ts +20 -0
  262. package/dist/lib/codex-manager/verify-flagged.d.ts.map +1 -0
  263. package/dist/lib/codex-manager/verify-flagged.js +316 -0
  264. package/dist/lib/codex-manager/verify-flagged.js.map +1 -0
  265. package/dist/lib/codex-manager.d.ts +1 -0
  266. package/dist/lib/codex-manager.d.ts.map +1 -1
  267. package/dist/lib/codex-manager.js +767 -2195
  268. package/dist/lib/codex-manager.js.map +1 -1
  269. package/dist/lib/config.d.ts +38 -0
  270. package/dist/lib/config.d.ts.map +1 -1
  271. package/dist/lib/config.js +371 -9
  272. package/dist/lib/config.js.map +1 -1
  273. package/dist/lib/errors.d.ts +9 -0
  274. package/dist/lib/errors.d.ts.map +1 -1
  275. package/dist/lib/errors.js +13 -0
  276. package/dist/lib/errors.js.map +1 -1
  277. package/dist/lib/forecast.d.ts +17 -0
  278. package/dist/lib/forecast.d.ts.map +1 -1
  279. package/dist/lib/forecast.js +33 -6
  280. package/dist/lib/forecast.js.map +1 -1
  281. package/dist/lib/named-backup-export.js +2 -2
  282. package/dist/lib/named-backup-export.js.map +1 -1
  283. package/dist/lib/prompts/codex.d.ts +8 -3
  284. package/dist/lib/prompts/codex.d.ts.map +1 -1
  285. package/dist/lib/prompts/codex.js +16 -26
  286. package/dist/lib/prompts/codex.js.map +1 -1
  287. package/dist/lib/request/failover-config.d.ts +4 -0
  288. package/dist/lib/request/failover-config.d.ts.map +1 -0
  289. package/dist/lib/request/failover-config.js +15 -0
  290. package/dist/lib/request/failover-config.js.map +1 -0
  291. package/dist/lib/request/fetch-helpers.d.ts +28 -4
  292. package/dist/lib/request/fetch-helpers.d.ts.map +1 -1
  293. package/dist/lib/request/fetch-helpers.js +170 -8
  294. package/dist/lib/request/fetch-helpers.js.map +1 -1
  295. package/dist/lib/request/helpers/model-map.d.ts +49 -12
  296. package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
  297. package/dist/lib/request/helpers/model-map.js +303 -108
  298. package/dist/lib/request/helpers/model-map.js.map +1 -1
  299. package/dist/lib/request/helpers/tool-utils.d.ts +2 -15
  300. package/dist/lib/request/helpers/tool-utils.d.ts.map +1 -1
  301. package/dist/lib/request/helpers/tool-utils.js +40 -27
  302. package/dist/lib/request/helpers/tool-utils.js.map +1 -1
  303. package/dist/lib/request/index.d.ts +5 -0
  304. package/dist/lib/request/index.d.ts.map +1 -0
  305. package/dist/lib/request/index.js +5 -0
  306. package/dist/lib/request/index.js.map +1 -0
  307. package/dist/lib/request/request-init.d.ts +3 -0
  308. package/dist/lib/request/request-init.d.ts.map +1 -0
  309. package/dist/lib/request/request-init.js +50 -0
  310. package/dist/lib/request/request-init.js.map +1 -0
  311. package/dist/lib/request/request-transformer.d.ts +19 -6
  312. package/dist/lib/request/request-transformer.d.ts.map +1 -1
  313. package/dist/lib/request/request-transformer.js +210 -193
  314. package/dist/lib/request/request-transformer.js.map +1 -1
  315. package/dist/lib/request/response-compaction.d.ts +20 -0
  316. package/dist/lib/request/response-compaction.d.ts.map +1 -0
  317. package/dist/lib/request/response-compaction.js +124 -0
  318. package/dist/lib/request/response-compaction.js.map +1 -0
  319. package/dist/lib/request/response-handler.d.ts +2 -0
  320. package/dist/lib/request/response-handler.d.ts.map +1 -1
  321. package/dist/lib/request/response-handler.js +567 -11
  322. package/dist/lib/request/response-handler.js.map +1 -1
  323. package/dist/lib/request/response-metadata.d.ts +3 -0
  324. package/dist/lib/request/response-metadata.d.ts.map +1 -0
  325. package/dist/lib/request/response-metadata.js +61 -0
  326. package/dist/lib/request/response-metadata.js.map +1 -0
  327. package/dist/lib/request/trace-mode.d.ts +9 -0
  328. package/dist/lib/request/trace-mode.d.ts.map +1 -0
  329. package/dist/lib/request/trace-mode.js +14 -0
  330. package/dist/lib/request/trace-mode.js.map +1 -0
  331. package/dist/lib/request/wait-utils.d.ts +14 -0
  332. package/dist/lib/request/wait-utils.d.ts.map +1 -0
  333. package/dist/lib/request/wait-utils.js +44 -0
  334. package/dist/lib/request/wait-utils.js.map +1 -0
  335. package/dist/lib/runtime/account-check-helpers.d.ts +8 -0
  336. package/dist/lib/runtime/account-check-helpers.d.ts.map +1 -0
  337. package/dist/lib/runtime/account-check-helpers.js +30 -0
  338. package/dist/lib/runtime/account-check-helpers.js.map +1 -0
  339. package/dist/lib/runtime/account-check-types.d.ts +18 -0
  340. package/dist/lib/runtime/account-check-types.d.ts.map +1 -0
  341. package/dist/lib/runtime/account-check-types.js +12 -0
  342. package/dist/lib/runtime/account-check-types.js.map +1 -0
  343. package/dist/lib/runtime/account-check.d.ts +48 -0
  344. package/dist/lib/runtime/account-check.d.ts.map +1 -0
  345. package/dist/lib/runtime/account-check.js +202 -0
  346. package/dist/lib/runtime/account-check.js.map +1 -0
  347. package/dist/lib/runtime/account-health-check.d.ts +8 -0
  348. package/dist/lib/runtime/account-health-check.d.ts.map +1 -0
  349. package/dist/lib/runtime/account-health-check.js +30 -0
  350. package/dist/lib/runtime/account-health-check.js.map +1 -0
  351. package/dist/lib/runtime/account-manager-cache-entry.d.ts +25 -0
  352. package/dist/lib/runtime/account-manager-cache-entry.d.ts.map +1 -0
  353. package/dist/lib/runtime/account-manager-cache-entry.js +17 -0
  354. package/dist/lib/runtime/account-manager-cache-entry.js.map +1 -0
  355. package/dist/lib/runtime/account-manager-cache.d.ts +25 -0
  356. package/dist/lib/runtime/account-manager-cache.d.ts.map +1 -0
  357. package/dist/lib/runtime/account-manager-cache.js +44 -0
  358. package/dist/lib/runtime/account-manager-cache.js.map +1 -0
  359. package/dist/lib/runtime/account-pool.d.ts +23 -0
  360. package/dist/lib/runtime/account-pool.d.ts.map +1 -0
  361. package/dist/lib/runtime/account-pool.js +138 -0
  362. package/dist/lib/runtime/account-pool.js.map +1 -0
  363. package/dist/lib/runtime/account-scope.d.ts +10 -0
  364. package/dist/lib/runtime/account-scope.d.ts.map +1 -0
  365. package/dist/lib/runtime/account-scope.js +13 -0
  366. package/dist/lib/runtime/account-scope.js.map +1 -0
  367. package/dist/lib/runtime/account-select-event.d.ts +19 -0
  368. package/dist/lib/runtime/account-select-event.d.ts.map +1 -0
  369. package/dist/lib/runtime/account-select-event.js +53 -0
  370. package/dist/lib/runtime/account-select-event.js.map +1 -0
  371. package/dist/lib/runtime/account-selection.d.ts +28 -0
  372. package/dist/lib/runtime/account-selection.d.ts.map +1 -0
  373. package/dist/lib/runtime/account-selection.js +46 -0
  374. package/dist/lib/runtime/account-selection.js.map +1 -0
  375. package/dist/lib/runtime/account-state.d.ts +13 -0
  376. package/dist/lib/runtime/account-state.d.ts.map +1 -0
  377. package/dist/lib/runtime/account-state.js +38 -0
  378. package/dist/lib/runtime/account-state.js.map +1 -0
  379. package/dist/lib/runtime/account-status.d.ts +13 -0
  380. package/dist/lib/runtime/account-status.d.ts.map +1 -0
  381. package/dist/lib/runtime/account-status.js +37 -0
  382. package/dist/lib/runtime/account-status.js.map +1 -0
  383. package/dist/lib/runtime/account-storage-scope-entry.d.ts +26 -0
  384. package/dist/lib/runtime/account-storage-scope-entry.d.ts.map +1 -0
  385. package/dist/lib/runtime/account-storage-scope-entry.js +15 -0
  386. package/dist/lib/runtime/account-storage-scope-entry.js.map +1 -0
  387. package/dist/lib/runtime/auth-facade.d.ts +51 -0
  388. package/dist/lib/runtime/auth-facade.d.ts.map +1 -0
  389. package/dist/lib/runtime/auth-facade.js +48 -0
  390. package/dist/lib/runtime/auth-facade.js.map +1 -0
  391. package/dist/lib/runtime/browser-oauth-flow.d.ts +32 -0
  392. package/dist/lib/runtime/browser-oauth-flow.d.ts.map +1 -0
  393. package/dist/lib/runtime/browser-oauth-flow.js +31 -0
  394. package/dist/lib/runtime/browser-oauth-flow.js.map +1 -0
  395. package/dist/lib/runtime/capability-boost.d.ts +25 -0
  396. package/dist/lib/runtime/capability-boost.d.ts.map +1 -0
  397. package/dist/lib/runtime/capability-boost.js +26 -0
  398. package/dist/lib/runtime/capability-boost.js.map +1 -0
  399. package/dist/lib/runtime/event-handler.d.ts +53 -0
  400. package/dist/lib/runtime/event-handler.d.ts.map +1 -0
  401. package/dist/lib/runtime/event-handler.js +46 -0
  402. package/dist/lib/runtime/event-handler.js.map +1 -0
  403. package/dist/lib/runtime/flagged-verify-types.d.ts +9 -0
  404. package/dist/lib/runtime/flagged-verify-types.d.ts.map +1 -0
  405. package/dist/lib/runtime/flagged-verify-types.js +7 -0
  406. package/dist/lib/runtime/flagged-verify-types.js.map +1 -0
  407. package/dist/lib/runtime/hydrate-emails.d.ts +13 -0
  408. package/dist/lib/runtime/hydrate-emails.d.ts.map +1 -0
  409. package/dist/lib/runtime/hydrate-emails.js +56 -0
  410. package/dist/lib/runtime/hydrate-emails.js.map +1 -0
  411. package/dist/lib/runtime/live-sync-entry.d.ts +36 -0
  412. package/dist/lib/runtime/live-sync-entry.d.ts.map +1 -0
  413. package/dist/lib/runtime/live-sync-entry.js +14 -0
  414. package/dist/lib/runtime/live-sync-entry.js.map +1 -0
  415. package/dist/lib/runtime/live-sync.d.ts +35 -0
  416. package/dist/lib/runtime/live-sync.d.ts.map +1 -0
  417. package/dist/lib/runtime/live-sync.js +65 -0
  418. package/dist/lib/runtime/live-sync.js.map +1 -0
  419. package/dist/lib/runtime/loader-setup.d.ts +9 -0
  420. package/dist/lib/runtime/loader-setup.d.ts.map +1 -0
  421. package/dist/lib/runtime/loader-setup.js +8 -0
  422. package/dist/lib/runtime/loader-setup.js.map +1 -0
  423. package/dist/lib/runtime/login-menu-accounts.d.ts +29 -0
  424. package/dist/lib/runtime/login-menu-accounts.d.ts.map +1 -0
  425. package/dist/lib/runtime/login-menu-accounts.js +33 -0
  426. package/dist/lib/runtime/login-menu-accounts.js.map +1 -0
  427. package/dist/lib/runtime/manual-oauth-flow.d.ts +40 -0
  428. package/dist/lib/runtime/manual-oauth-flow.d.ts.map +1 -0
  429. package/dist/lib/runtime/manual-oauth-flow.js +71 -0
  430. package/dist/lib/runtime/manual-oauth-flow.js.map +1 -0
  431. package/dist/lib/runtime/metrics.d.ts +29 -0
  432. package/dist/lib/runtime/metrics.d.ts.map +1 -0
  433. package/dist/lib/runtime/metrics.js +97 -0
  434. package/dist/lib/runtime/metrics.js.map +1 -0
  435. package/dist/lib/runtime/oauth-browser-flow.d.ts +9 -0
  436. package/dist/lib/runtime/oauth-browser-flow.d.ts.map +1 -0
  437. package/dist/lib/runtime/oauth-browser-flow.js +34 -0
  438. package/dist/lib/runtime/oauth-browser-flow.js.map +1 -0
  439. package/dist/lib/runtime/preemptive-quota.d.ts +13 -0
  440. package/dist/lib/runtime/preemptive-quota.d.ts.map +1 -0
  441. package/dist/lib/runtime/preemptive-quota.js +9 -0
  442. package/dist/lib/runtime/preemptive-quota.js.map +1 -0
  443. package/dist/lib/runtime/quota-headers.d.ts +12 -0
  444. package/dist/lib/runtime/quota-headers.d.ts.map +1 -0
  445. package/dist/lib/runtime/quota-headers.js +131 -0
  446. package/dist/lib/runtime/quota-headers.js.map +1 -0
  447. package/dist/lib/runtime/quota-probe.d.ts +18 -0
  448. package/dist/lib/runtime/quota-probe.d.ts.map +1 -0
  449. package/dist/lib/runtime/quota-probe.js +82 -0
  450. package/dist/lib/runtime/quota-probe.js.map +1 -0
  451. package/dist/lib/runtime/quota-settings.d.ts +14 -0
  452. package/dist/lib/runtime/quota-settings.d.ts.map +1 -0
  453. package/dist/lib/runtime/quota-settings.js +12 -0
  454. package/dist/lib/runtime/quota-settings.js.map +1 -0
  455. package/dist/lib/runtime/refresh-guardian-entry.d.ts +32 -0
  456. package/dist/lib/runtime/refresh-guardian-entry.d.ts.map +1 -0
  457. package/dist/lib/runtime/refresh-guardian-entry.js +12 -0
  458. package/dist/lib/runtime/refresh-guardian-entry.js.map +1 -0
  459. package/dist/lib/runtime/refresh-guardian.d.ts +24 -0
  460. package/dist/lib/runtime/refresh-guardian.d.ts.map +1 -0
  461. package/dist/lib/runtime/refresh-guardian.js +32 -0
  462. package/dist/lib/runtime/refresh-guardian.js.map +1 -0
  463. package/dist/lib/runtime/request-init.d.ts +5 -0
  464. package/dist/lib/runtime/request-init.d.ts.map +1 -0
  465. package/dist/lib/runtime/request-init.js +50 -0
  466. package/dist/lib/runtime/request-init.js.map +1 -0
  467. package/dist/lib/runtime/runtime-services.d.ts +58 -0
  468. package/dist/lib/runtime/runtime-services.d.ts.map +1 -0
  469. package/dist/lib/runtime/runtime-services.js +87 -0
  470. package/dist/lib/runtime/runtime-services.js.map +1 -0
  471. package/dist/lib/runtime/session-affinity-entry.d.ts +30 -0
  472. package/dist/lib/runtime/session-affinity-entry.d.ts.map +1 -0
  473. package/dist/lib/runtime/session-affinity-entry.js +11 -0
  474. package/dist/lib/runtime/session-affinity-entry.js.map +1 -0
  475. package/dist/lib/runtime/session-affinity.d.ts +13 -0
  476. package/dist/lib/runtime/session-affinity.d.ts.map +1 -0
  477. package/dist/lib/runtime/session-affinity.js +17 -0
  478. package/dist/lib/runtime/session-affinity.js.map +1 -0
  479. package/dist/lib/runtime/session-recovery.d.ts +8 -0
  480. package/dist/lib/runtime/session-recovery.d.ts.map +1 -0
  481. package/dist/lib/runtime/session-recovery.js +7 -0
  482. package/dist/lib/runtime/session-recovery.js.map +1 -0
  483. package/dist/lib/runtime/status-marker.d.ts +3 -0
  484. package/dist/lib/runtime/status-marker.d.ts.map +1 -0
  485. package/dist/lib/runtime/status-marker.js +15 -0
  486. package/dist/lib/runtime/status-marker.js.map +1 -0
  487. package/dist/lib/runtime/storage-scope.d.ts +13 -0
  488. package/dist/lib/runtime/storage-scope.d.ts.map +1 -0
  489. package/dist/lib/runtime/storage-scope.js +14 -0
  490. package/dist/lib/runtime/storage-scope.js.map +1 -0
  491. package/dist/lib/runtime/toast.d.ts +16 -0
  492. package/dist/lib/runtime/toast.d.ts.map +1 -0
  493. package/dist/lib/runtime/toast.js +16 -0
  494. package/dist/lib/runtime/toast.js.map +1 -0
  495. package/dist/lib/runtime/ui-runtime-entry.d.ts +7 -0
  496. package/dist/lib/runtime/ui-runtime-entry.d.ts.map +1 -0
  497. package/dist/lib/runtime/ui-runtime-entry.js +4 -0
  498. package/dist/lib/runtime/ui-runtime-entry.js.map +1 -0
  499. package/dist/lib/runtime/ui-runtime.d.ts +9 -0
  500. package/dist/lib/runtime/ui-runtime.d.ts.map +1 -0
  501. package/dist/lib/runtime/ui-runtime.js +23 -0
  502. package/dist/lib/runtime/ui-runtime.js.map +1 -0
  503. package/dist/lib/runtime/verify-flagged.d.ts +44 -0
  504. package/dist/lib/runtime/verify-flagged.d.ts.map +1 -0
  505. package/dist/lib/runtime/verify-flagged.js +84 -0
  506. package/dist/lib/runtime/verify-flagged.js.map +1 -0
  507. package/dist/lib/schemas.d.ts +9 -0
  508. package/dist/lib/schemas.d.ts.map +1 -1
  509. package/dist/lib/schemas.js +9 -1
  510. package/dist/lib/schemas.js.map +1 -1
  511. package/dist/lib/session-affinity.d.ts +10 -0
  512. package/dist/lib/session-affinity.d.ts.map +1 -1
  513. package/dist/lib/session-affinity.js +53 -6
  514. package/dist/lib/session-affinity.js.map +1 -1
  515. package/dist/lib/storage/account-clear-entry.d.ts +16 -0
  516. package/dist/lib/storage/account-clear-entry.d.ts.map +1 -0
  517. package/dist/lib/storage/account-clear-entry.js +12 -0
  518. package/dist/lib/storage/account-clear-entry.js.map +1 -0
  519. package/dist/lib/storage/account-clear.d.ts +8 -0
  520. package/dist/lib/storage/account-clear.d.ts.map +1 -0
  521. package/dist/lib/storage/account-clear.js +29 -0
  522. package/dist/lib/storage/account-clear.js.map +1 -0
  523. package/dist/lib/storage/account-match-utils.d.ts +9 -0
  524. package/dist/lib/storage/account-match-utils.d.ts.map +1 -0
  525. package/dist/lib/storage/account-match-utils.js +45 -0
  526. package/dist/lib/storage/account-match-utils.js.map +1 -0
  527. package/dist/lib/storage/account-persistence.d.ts +3 -0
  528. package/dist/lib/storage/account-persistence.d.ts.map +1 -0
  529. package/dist/lib/storage/account-persistence.js +12 -0
  530. package/dist/lib/storage/account-persistence.js.map +1 -0
  531. package/dist/lib/storage/account-port.d.ts +50 -0
  532. package/dist/lib/storage/account-port.d.ts.map +1 -0
  533. package/dist/lib/storage/account-port.js +43 -0
  534. package/dist/lib/storage/account-port.js.map +1 -0
  535. package/dist/lib/storage/account-save-entry.d.ts +7 -0
  536. package/dist/lib/storage/account-save-entry.d.ts.map +1 -0
  537. package/dist/lib/storage/account-save-entry.js +6 -0
  538. package/dist/lib/storage/account-save-entry.js.map +1 -0
  539. package/dist/lib/storage/account-save.d.ts +30 -0
  540. package/dist/lib/storage/account-save.d.ts.map +1 -0
  541. package/dist/lib/storage/account-save.js +49 -0
  542. package/dist/lib/storage/account-save.js.map +1 -0
  543. package/dist/lib/storage/account-snapshot.d.ts +25 -0
  544. package/dist/lib/storage/account-snapshot.d.ts.map +1 -0
  545. package/dist/lib/storage/account-snapshot.js +78 -0
  546. package/dist/lib/storage/account-snapshot.js.map +1 -0
  547. package/dist/lib/storage/backup-metadata-builder.d.ts +32 -0
  548. package/dist/lib/storage/backup-metadata-builder.d.ts.map +1 -0
  549. package/dist/lib/storage/backup-metadata-builder.js +77 -0
  550. package/dist/lib/storage/backup-metadata-builder.js.map +1 -0
  551. package/dist/lib/storage/backup-metadata.d.ts +29 -0
  552. package/dist/lib/storage/backup-metadata.d.ts.map +1 -0
  553. package/dist/lib/storage/backup-metadata.js +16 -0
  554. package/dist/lib/storage/backup-metadata.js.map +1 -0
  555. package/dist/lib/storage/backup-paths.d.ts +10 -0
  556. package/dist/lib/storage/backup-paths.d.ts.map +1 -0
  557. package/dist/lib/storage/backup-paths.js +27 -0
  558. package/dist/lib/storage/backup-paths.js.map +1 -0
  559. package/dist/lib/storage/backup-restore.d.ts +11 -0
  560. package/dist/lib/storage/backup-restore.d.ts.map +1 -0
  561. package/dist/lib/storage/backup-restore.js +52 -0
  562. package/dist/lib/storage/backup-restore.js.map +1 -0
  563. package/dist/lib/storage/cache-artifacts.d.ts +2 -0
  564. package/dist/lib/storage/cache-artifacts.d.ts.map +1 -0
  565. package/dist/lib/storage/cache-artifacts.js +4 -0
  566. package/dist/lib/storage/cache-artifacts.js.map +1 -0
  567. package/dist/lib/storage/error-hints.d.ts +10 -0
  568. package/dist/lib/storage/error-hints.d.ts.map +1 -0
  569. package/dist/lib/storage/error-hints.js +36 -0
  570. package/dist/lib/storage/error-hints.js.map +1 -0
  571. package/dist/lib/storage/file-paths.d.ts +6 -0
  572. package/dist/lib/storage/file-paths.d.ts.map +1 -0
  573. package/dist/lib/storage/file-paths.js +17 -0
  574. package/dist/lib/storage/file-paths.js.map +1 -0
  575. package/dist/lib/storage/fixture-guards.d.ts +4 -0
  576. package/dist/lib/storage/fixture-guards.d.ts.map +1 -0
  577. package/dist/lib/storage/fixture-guards.js +27 -0
  578. package/dist/lib/storage/fixture-guards.js.map +1 -0
  579. package/dist/lib/storage/flagged-entry.d.ts +15 -0
  580. package/dist/lib/storage/flagged-entry.d.ts.map +1 -0
  581. package/dist/lib/storage/flagged-entry.js +12 -0
  582. package/dist/lib/storage/flagged-entry.js.map +1 -0
  583. package/dist/lib/storage/flagged-load-entry.d.ts +20 -0
  584. package/dist/lib/storage/flagged-load-entry.d.ts.map +1 -0
  585. package/dist/lib/storage/flagged-load-entry.js +13 -0
  586. package/dist/lib/storage/flagged-load-entry.js.map +1 -0
  587. package/dist/lib/storage/flagged-save-entry.d.ts +7 -0
  588. package/dist/lib/storage/flagged-save-entry.d.ts.map +1 -0
  589. package/dist/lib/storage/flagged-save-entry.js +6 -0
  590. package/dist/lib/storage/flagged-save-entry.js.map +1 -0
  591. package/dist/lib/storage/flagged-storage-file.d.ts +7 -0
  592. package/dist/lib/storage/flagged-storage-file.d.ts.map +1 -0
  593. package/dist/lib/storage/flagged-storage-file.js +25 -0
  594. package/dist/lib/storage/flagged-storage-file.js.map +1 -0
  595. package/dist/lib/storage/flagged-storage-io.d.ts +28 -0
  596. package/dist/lib/storage/flagged-storage-io.d.ts.map +1 -0
  597. package/dist/lib/storage/flagged-storage-io.js +135 -0
  598. package/dist/lib/storage/flagged-storage-io.js.map +1 -0
  599. package/dist/lib/storage/flagged-storage.d.ts +6 -0
  600. package/dist/lib/storage/flagged-storage.d.ts.map +1 -0
  601. package/dist/lib/storage/flagged-storage.js +90 -0
  602. package/dist/lib/storage/flagged-storage.js.map +1 -0
  603. package/dist/lib/storage/gitignore.d.ts +7 -0
  604. package/dist/lib/storage/gitignore.d.ts.map +1 -0
  605. package/dist/lib/storage/gitignore.js +34 -0
  606. package/dist/lib/storage/gitignore.js.map +1 -0
  607. package/dist/lib/storage/hash.d.ts +2 -0
  608. package/dist/lib/storage/hash.d.ts.map +1 -0
  609. package/dist/lib/storage/hash.js +5 -0
  610. package/dist/lib/storage/hash.js.map +1 -0
  611. package/dist/lib/storage/identity.d.ts +15 -0
  612. package/dist/lib/storage/identity.d.ts.map +1 -0
  613. package/dist/lib/storage/identity.js +48 -0
  614. package/dist/lib/storage/identity.js.map +1 -0
  615. package/dist/lib/storage/import-export.d.ts +24 -0
  616. package/dist/lib/storage/import-export.d.ts.map +1 -0
  617. package/dist/lib/storage/import-export.js +108 -0
  618. package/dist/lib/storage/import-export.js.map +1 -0
  619. package/dist/lib/storage/metadata-section.d.ts +16 -0
  620. package/dist/lib/storage/metadata-section.d.ts.map +1 -0
  621. package/dist/lib/storage/metadata-section.js +16 -0
  622. package/dist/lib/storage/metadata-section.js.map +1 -0
  623. package/dist/lib/storage/migrations.d.ts +5 -2
  624. package/dist/lib/storage/migrations.d.ts.map +1 -1
  625. package/dist/lib/storage/migrations.js.map +1 -1
  626. package/dist/lib/storage/named-backup-entry.d.ts +15 -0
  627. package/dist/lib/storage/named-backup-entry.d.ts.map +1 -0
  628. package/dist/lib/storage/named-backup-entry.js +7 -0
  629. package/dist/lib/storage/named-backup-entry.js.map +1 -0
  630. package/dist/lib/storage/named-backups-entry.d.ts +19 -0
  631. package/dist/lib/storage/named-backups-entry.d.ts.map +1 -0
  632. package/dist/lib/storage/named-backups-entry.js +7 -0
  633. package/dist/lib/storage/named-backups-entry.js.map +1 -0
  634. package/dist/lib/storage/named-backups.d.ts +15 -0
  635. package/dist/lib/storage/named-backups.d.ts.map +1 -0
  636. package/dist/lib/storage/named-backups.js +68 -0
  637. package/dist/lib/storage/named-backups.js.map +1 -0
  638. package/dist/lib/storage/path-state.d.ts +9 -0
  639. package/dist/lib/storage/path-state.d.ts.map +1 -0
  640. package/dist/lib/storage/path-state.js +20 -0
  641. package/dist/lib/storage/path-state.js.map +1 -0
  642. package/dist/lib/storage/project-migration.d.ts +10 -0
  643. package/dist/lib/storage/project-migration.d.ts.map +1 -0
  644. package/dist/lib/storage/project-migration.js +38 -0
  645. package/dist/lib/storage/project-migration.js.map +1 -0
  646. package/dist/lib/storage/record-utils.d.ts +3 -0
  647. package/dist/lib/storage/record-utils.d.ts.map +1 -0
  648. package/dist/lib/storage/record-utils.js +9 -0
  649. package/dist/lib/storage/record-utils.js.map +1 -0
  650. package/dist/lib/storage/restore-assessment.d.ts +7 -0
  651. package/dist/lib/storage/restore-assessment.d.ts.map +1 -0
  652. package/dist/lib/storage/restore-assessment.js +42 -0
  653. package/dist/lib/storage/restore-assessment.js.map +1 -0
  654. package/dist/lib/storage/restore-backup-entry.d.ts +24 -0
  655. package/dist/lib/storage/restore-backup-entry.d.ts.map +1 -0
  656. package/dist/lib/storage/restore-backup-entry.js +10 -0
  657. package/dist/lib/storage/restore-backup-entry.js.map +1 -0
  658. package/dist/lib/storage/restore-metadata.d.ts +10 -0
  659. package/dist/lib/storage/restore-metadata.d.ts.map +1 -0
  660. package/dist/lib/storage/restore-metadata.js +18 -0
  661. package/dist/lib/storage/restore-metadata.js.map +1 -0
  662. package/dist/lib/storage/restore.d.ts +14 -0
  663. package/dist/lib/storage/restore.d.ts.map +1 -0
  664. package/dist/lib/storage/restore.js +53 -0
  665. package/dist/lib/storage/restore.js.map +1 -0
  666. package/dist/lib/storage/snapshot-inspectors.d.ts +22 -0
  667. package/dist/lib/storage/snapshot-inspectors.d.ts.map +1 -0
  668. package/dist/lib/storage/snapshot-inspectors.js +95 -0
  669. package/dist/lib/storage/snapshot-inspectors.js.map +1 -0
  670. package/dist/lib/storage/storage-parser.d.ts +15 -0
  671. package/dist/lib/storage/storage-parser.d.ts.map +1 -0
  672. package/dist/lib/storage/storage-parser.js +16 -0
  673. package/dist/lib/storage/storage-parser.js.map +1 -0
  674. package/dist/lib/storage/transactions.d.ts +23 -0
  675. package/dist/lib/storage/transactions.d.ts.map +1 -0
  676. package/dist/lib/storage/transactions.js +64 -0
  677. package/dist/lib/storage/transactions.js.map +1 -0
  678. package/dist/lib/storage.d.ts +12 -41
  679. package/dist/lib/storage.d.ts.map +1 -1
  680. package/dist/lib/storage.js +527 -938
  681. package/dist/lib/storage.js.map +1 -1
  682. package/dist/lib/types.d.ts +80 -1
  683. package/dist/lib/types.d.ts.map +1 -1
  684. package/dist/lib/ui/copy.d.ts +24 -4
  685. package/dist/lib/ui/copy.d.ts.map +1 -1
  686. package/dist/lib/ui/copy.js +24 -4
  687. package/dist/lib/ui/copy.js.map +1 -1
  688. package/package.json +44 -6
  689. package/scripts/check-pack-budget-lib.js +114 -0
  690. package/scripts/check-pack-budget.mjs +10 -0
  691. package/scripts/codex-multi-auth.js +34 -10
  692. package/scripts/install-codex-auth-utils.js +54 -14
  693. package/scripts/install-codex-auth.js +62 -33
  694. package/scripts/update-vendor-provenance.mjs +96 -0
  695. package/scripts/verify-vendor-provenance.mjs +53 -0
@@ -0,0 +1,643 @@
1
+ import { isBrowserLaunchSuppressed } from "../auth/browser.js";
2
+ import { extractAccountEmail, extractAccountId, formatAccountLabel, sanitizeEmail, } from "../accounts.js";
3
+ import { promptAddAnotherAccount, promptLoginMode } from "../cli.js";
4
+ import { ACCOUNT_LIMITS } from "../constants.js";
5
+ import { loadDashboardDisplaySettings, } from "../dashboard-settings.js";
6
+ import { evaluateForecastAccounts, recommendForecastAccount, } from "../forecast.js";
7
+ import { loadQuotaCache } from "../quota-cache.js";
8
+ import { fetchCodexQuotaSnapshot } from "../quota-probe.js";
9
+ import { queuedRefresh } from "../refresh-queue.js";
10
+ import { getNamedBackups, formatStorageErrorHint, getStoragePath, loadAccounts, loadFlaggedAccounts, restoreAccountsFromBackup, saveAccounts, setStoragePath, StorageError, } from "../storage.js";
11
+ import { setCodexCliActiveSelection } from "../codex-cli/writer.js";
12
+ import { MODEL_FAMILIES } from "../prompts/codex.js";
13
+ import { RefreshLeaseCoordinator } from "../refresh-lease.js";
14
+ import { UI_COPY } from "../ui/copy.js";
15
+ import { confirm } from "../ui/confirm.js";
16
+ import { applyUiThemeFromDashboardSettings, configureUnifiedSettings, } from "./settings-hub.js";
17
+ import { parseAuthLoginArgs, parseBestArgs, printBestUsage, printUsage, } from "./help.js";
18
+ const liveBestLeaseCoordinator = RefreshLeaseCoordinator.fromEnvironment();
19
+ const serializedLiveBestByStorage = new Map();
20
+ async function withSerializedBestLiveRun(storagePath, action) {
21
+ const queueEntry = serializedLiveBestByStorage.get(storagePath) ?? { tail: Promise.resolve() };
22
+ serializedLiveBestByStorage.set(storagePath, queueEntry);
23
+ const waitForPrior = queueEntry.tail.catch(() => undefined);
24
+ let releaseQueue = () => undefined;
25
+ const currentTail = new Promise((resolve) => {
26
+ releaseQueue = resolve;
27
+ });
28
+ queueEntry.tail = currentTail;
29
+ await waitForPrior;
30
+ let lease = null;
31
+ try {
32
+ lease = await liveBestLeaseCoordinator.acquire(`codex-auth-best-live:${storagePath}`);
33
+ return await action();
34
+ }
35
+ finally {
36
+ try {
37
+ if (lease) {
38
+ await lease.release();
39
+ }
40
+ }
41
+ finally {
42
+ releaseQueue();
43
+ if (serializedLiveBestByStorage.get(storagePath) === queueEntry &&
44
+ queueEntry.tail === currentTail) {
45
+ serializedLiveBestByStorage.delete(storagePath);
46
+ }
47
+ }
48
+ }
49
+ }
50
+ function clampPreservedActiveIndexByFamily(storage, targetIndex) {
51
+ const maxIndex = Math.max(0, storage.accounts.length - 1);
52
+ const existingByFamily = storage.activeIndexByFamily ?? {};
53
+ const nextByFamily = {};
54
+ for (const family of MODEL_FAMILIES) {
55
+ const candidate = existingByFamily[family];
56
+ if (typeof candidate !== "number" || !Number.isInteger(candidate))
57
+ continue;
58
+ nextByFamily[family] = Math.min(maxIndex, Math.max(0, candidate));
59
+ }
60
+ nextByFamily.codex = targetIndex;
61
+ storage.activeIndexByFamily = nextByFamily;
62
+ }
63
+ export async function persistAndSyncSelectedAccount({ storage, targetIndex, parsed, switchReason, initialSyncIdToken, preserveActiveIndexByFamily = false, helpers, }) {
64
+ const account = storage.accounts[targetIndex];
65
+ if (!account) {
66
+ throw new Error(`Account ${parsed} not found.`);
67
+ }
68
+ const wasDisabled = account.enabled === false;
69
+ if (wasDisabled) {
70
+ account.enabled = true;
71
+ }
72
+ storage.activeIndex = targetIndex;
73
+ if (storage.activeIndexByFamily && preserveActiveIndexByFamily) {
74
+ clampPreservedActiveIndexByFamily(storage, targetIndex);
75
+ }
76
+ else {
77
+ storage.activeIndexByFamily = {};
78
+ storage.activeIndexByFamily.codex = targetIndex;
79
+ }
80
+ const switchNow = Date.now();
81
+ let syncAccessToken = account.accessToken;
82
+ let syncRefreshToken = account.refreshToken;
83
+ let syncExpiresAt = account.expiresAt;
84
+ let syncIdToken = initialSyncIdToken;
85
+ if (!helpers.hasUsableAccessToken(account, switchNow)) {
86
+ const refreshResult = await queuedRefresh(account.refreshToken);
87
+ if (refreshResult.type === "success") {
88
+ const refreshedEmail = sanitizeEmail(extractAccountEmail(refreshResult.access, refreshResult.idToken));
89
+ const tokenAccountId = extractAccountId(refreshResult.access);
90
+ account.refreshToken = refreshResult.refresh;
91
+ account.accessToken = refreshResult.access;
92
+ account.expiresAt = refreshResult.expires;
93
+ if (refreshedEmail)
94
+ account.email = refreshedEmail;
95
+ helpers.applyTokenAccountIdentity(account, tokenAccountId);
96
+ syncAccessToken = refreshResult.access;
97
+ syncRefreshToken = refreshResult.refresh;
98
+ syncExpiresAt = refreshResult.expires;
99
+ syncIdToken = refreshResult.idToken;
100
+ }
101
+ else {
102
+ console.warn(`Switch validation refresh failed for account ${parsed}: ${helpers.normalizeFailureDetail(refreshResult.message, refreshResult.reason)}.`);
103
+ }
104
+ }
105
+ account.lastUsed = switchNow;
106
+ account.lastSwitchReason = switchReason;
107
+ await saveAccounts(storage);
108
+ const synced = await setCodexCliActiveSelection({
109
+ accountId: account.accountId,
110
+ email: account.email,
111
+ accessToken: syncAccessToken,
112
+ refreshToken: syncRefreshToken,
113
+ expiresAt: syncExpiresAt,
114
+ ...(syncIdToken ? { idToken: syncIdToken } : {}),
115
+ });
116
+ return { synced, wasDisabled };
117
+ }
118
+ export async function runSwitch(args, helpers) {
119
+ setStoragePath(null);
120
+ const indexArg = args[0];
121
+ if (!indexArg) {
122
+ console.error("Missing index. Usage: codex auth switch <index>");
123
+ return 1;
124
+ }
125
+ const parsed = Number.parseInt(indexArg, 10);
126
+ if (!Number.isFinite(parsed) || parsed < 1) {
127
+ console.error(`Invalid index: ${indexArg}`);
128
+ return 1;
129
+ }
130
+ const targetIndex = parsed - 1;
131
+ const storage = await loadAccounts();
132
+ if (!storage || storage.accounts.length === 0) {
133
+ console.error("No accounts configured.");
134
+ return 1;
135
+ }
136
+ if (targetIndex < 0 || targetIndex >= storage.accounts.length) {
137
+ console.error(`Index out of range. Valid range: 1-${storage.accounts.length}`);
138
+ return 1;
139
+ }
140
+ const account = storage.accounts[targetIndex];
141
+ if (!account) {
142
+ console.error(`Account ${parsed} not found.`);
143
+ return 1;
144
+ }
145
+ const { synced, wasDisabled } = await persistAndSyncSelectedAccount({
146
+ storage,
147
+ targetIndex,
148
+ parsed,
149
+ switchReason: "rotation",
150
+ helpers,
151
+ });
152
+ if (!synced) {
153
+ console.warn(`Switched account ${parsed} locally, but Codex auth sync did not complete. Multi-auth routing will still use this account.`);
154
+ }
155
+ console.log(`Switched to account ${parsed}: ${formatAccountLabel(account, targetIndex)}${wasDisabled ? " (re-enabled)" : ""}`);
156
+ return 0;
157
+ }
158
+ export async function runBest(args, helpers) {
159
+ const parsedArgs = parseBestArgs(args);
160
+ if (!parsedArgs.ok) {
161
+ if (parsedArgs.reason === "help") {
162
+ printBestUsage();
163
+ return 0;
164
+ }
165
+ console.error(parsedArgs.message);
166
+ printBestUsage();
167
+ return 1;
168
+ }
169
+ const options = parsedArgs.options;
170
+ if (options.modelProvided && !options.live) {
171
+ console.error("--model requires --live for codex auth best");
172
+ printBestUsage();
173
+ return 1;
174
+ }
175
+ setStoragePath(null);
176
+ const execute = async () => {
177
+ const storage = await loadAccounts();
178
+ if (!storage || storage.accounts.length === 0) {
179
+ if (options.json) {
180
+ console.log(JSON.stringify({ error: "No accounts configured." }, null, 2));
181
+ }
182
+ else {
183
+ console.log("No accounts configured.");
184
+ }
185
+ return 1;
186
+ }
187
+ const now = Date.now();
188
+ const refreshFailures = new Map();
189
+ const liveQuotaByIndex = new Map();
190
+ const probeIdTokenByIndex = new Map();
191
+ const probeRefreshedIndices = new Set();
192
+ const probeErrors = [];
193
+ let changed = false;
194
+ const printProbeNotes = () => {
195
+ if (probeErrors.length === 0)
196
+ return;
197
+ console.log(`Live check notes (${probeErrors.length}):`);
198
+ for (const error of probeErrors) {
199
+ console.log(` - ${error}`);
200
+ }
201
+ };
202
+ const persistProbeChangesIfNeeded = async () => {
203
+ if (!changed)
204
+ return;
205
+ await saveAccounts(storage);
206
+ changed = false;
207
+ };
208
+ for (let i = 0; i < storage.accounts.length; i += 1) {
209
+ const account = storage.accounts[i];
210
+ if (!account || !options.live)
211
+ continue;
212
+ if (account.enabled === false)
213
+ continue;
214
+ let probeAccessToken = account.accessToken;
215
+ let probeAccountId = account.accountId ?? extractAccountId(account.accessToken);
216
+ if (!helpers.hasUsableAccessToken(account, now)) {
217
+ const refreshResult = await queuedRefresh(account.refreshToken);
218
+ if (refreshResult.type !== "success") {
219
+ refreshFailures.set(i, {
220
+ ...refreshResult,
221
+ message: helpers.normalizeFailureDetail(refreshResult.message, refreshResult.reason),
222
+ });
223
+ continue;
224
+ }
225
+ const refreshedEmail = sanitizeEmail(extractAccountEmail(refreshResult.access, refreshResult.idToken));
226
+ const refreshedAccountId = extractAccountId(refreshResult.access);
227
+ if (account.refreshToken !== refreshResult.refresh) {
228
+ account.refreshToken = refreshResult.refresh;
229
+ changed = true;
230
+ }
231
+ if (account.accessToken !== refreshResult.access) {
232
+ account.accessToken = refreshResult.access;
233
+ changed = true;
234
+ }
235
+ if (account.expiresAt !== refreshResult.expires) {
236
+ account.expiresAt = refreshResult.expires;
237
+ changed = true;
238
+ }
239
+ if (refreshedEmail && refreshedEmail !== account.email) {
240
+ account.email = refreshedEmail;
241
+ changed = true;
242
+ }
243
+ if (refreshedAccountId && refreshedAccountId !== account.accountId) {
244
+ account.accountId = refreshedAccountId;
245
+ account.accountIdSource = "token";
246
+ changed = true;
247
+ }
248
+ if (refreshResult.idToken) {
249
+ probeIdTokenByIndex.set(i, refreshResult.idToken);
250
+ }
251
+ probeRefreshedIndices.add(i);
252
+ probeAccessToken = account.accessToken;
253
+ probeAccountId = account.accountId ?? refreshedAccountId;
254
+ }
255
+ if (!probeAccessToken || !probeAccountId) {
256
+ probeErrors.push(`${formatAccountLabel(account, i)}: missing accountId for live probe`);
257
+ continue;
258
+ }
259
+ try {
260
+ const liveQuota = await fetchCodexQuotaSnapshot({
261
+ accountId: probeAccountId,
262
+ accessToken: probeAccessToken,
263
+ model: options.model,
264
+ });
265
+ liveQuotaByIndex.set(i, liveQuota);
266
+ }
267
+ catch (error) {
268
+ const message = helpers.normalizeFailureDetail(error instanceof Error ? error.message : String(error), undefined);
269
+ probeErrors.push(`${formatAccountLabel(account, i)}: ${message}`);
270
+ }
271
+ }
272
+ const forecastInputs = storage.accounts.map((account, index) => ({
273
+ index,
274
+ account,
275
+ isCurrent: index === helpers.resolveActiveIndex(storage, "codex"),
276
+ now,
277
+ refreshFailure: refreshFailures.get(index),
278
+ liveQuota: liveQuotaByIndex.get(index),
279
+ }));
280
+ const forecastResults = evaluateForecastAccounts(forecastInputs);
281
+ const recommendation = recommendForecastAccount(forecastResults);
282
+ if (recommendation.recommendedIndex === null) {
283
+ await persistProbeChangesIfNeeded();
284
+ if (options.json) {
285
+ console.log(JSON.stringify({
286
+ error: recommendation.reason,
287
+ ...(probeErrors.length > 0 ? { probeErrors } : {}),
288
+ }, null, 2));
289
+ }
290
+ else {
291
+ console.log(`No best account available: ${recommendation.reason}`);
292
+ printProbeNotes();
293
+ }
294
+ return 1;
295
+ }
296
+ const bestIndex = recommendation.recommendedIndex;
297
+ const bestAccount = storage.accounts[bestIndex];
298
+ if (!bestAccount) {
299
+ await persistProbeChangesIfNeeded();
300
+ if (options.json) {
301
+ console.log(JSON.stringify({ error: "Best account not found." }, null, 2));
302
+ }
303
+ else {
304
+ console.log("Best account not found.");
305
+ }
306
+ return 1;
307
+ }
308
+ const currentIndex = helpers.resolveActiveIndex(storage, "codex");
309
+ if (currentIndex === bestIndex) {
310
+ const shouldSyncCurrentBest = probeRefreshedIndices.has(bestIndex) || probeIdTokenByIndex.has(bestIndex);
311
+ let alreadyBestSynced;
312
+ if (changed) {
313
+ bestAccount.lastUsed = now;
314
+ await persistProbeChangesIfNeeded();
315
+ }
316
+ if (shouldSyncCurrentBest) {
317
+ alreadyBestSynced = await setCodexCliActiveSelection({
318
+ accountId: bestAccount.accountId,
319
+ email: bestAccount.email,
320
+ accessToken: bestAccount.accessToken,
321
+ refreshToken: bestAccount.refreshToken,
322
+ expiresAt: bestAccount.expiresAt,
323
+ ...(probeIdTokenByIndex.has(bestIndex)
324
+ ? { idToken: probeIdTokenByIndex.get(bestIndex) }
325
+ : {}),
326
+ });
327
+ if (!alreadyBestSynced && !options.json) {
328
+ console.warn("Codex auth sync did not complete. Multi-auth routing will still use this account.");
329
+ }
330
+ }
331
+ if (options.json) {
332
+ console.log(JSON.stringify({
333
+ message: `Already on best account: ${formatAccountLabel(bestAccount, bestIndex)}`,
334
+ accountIndex: bestIndex + 1,
335
+ reason: recommendation.reason,
336
+ ...(alreadyBestSynced !== undefined ? { synced: alreadyBestSynced } : {}),
337
+ ...(probeErrors.length > 0 ? { probeErrors } : {}),
338
+ }, null, 2));
339
+ }
340
+ else {
341
+ console.log(`Already on best account ${bestIndex + 1}: ${formatAccountLabel(bestAccount, bestIndex)}`);
342
+ console.log(`Reason: ${recommendation.reason}`);
343
+ printProbeNotes();
344
+ }
345
+ return 0;
346
+ }
347
+ const parsed = bestIndex + 1;
348
+ const { synced, wasDisabled } = await persistAndSyncSelectedAccount({
349
+ storage,
350
+ targetIndex: bestIndex,
351
+ parsed,
352
+ switchReason: "best",
353
+ initialSyncIdToken: probeIdTokenByIndex.get(bestIndex),
354
+ helpers,
355
+ });
356
+ if (options.json) {
357
+ console.log(JSON.stringify({
358
+ message: `Switched to best account: ${formatAccountLabel(bestAccount, bestIndex)}`,
359
+ accountIndex: parsed,
360
+ reason: recommendation.reason,
361
+ synced,
362
+ wasDisabled,
363
+ ...(probeErrors.length > 0 ? { probeErrors } : {}),
364
+ }, null, 2));
365
+ }
366
+ else {
367
+ console.log(`Switched to best account ${parsed}: ${formatAccountLabel(bestAccount, bestIndex)}${wasDisabled ? " (re-enabled)" : ""}`);
368
+ console.log(`Reason: ${recommendation.reason}`);
369
+ printProbeNotes();
370
+ if (!synced) {
371
+ console.warn("Codex auth sync did not complete. Multi-auth routing will still use this account.");
372
+ }
373
+ }
374
+ return 0;
375
+ };
376
+ if (options.live) {
377
+ return withSerializedBestLiveRun(getStoragePath(), execute);
378
+ }
379
+ return execute();
380
+ }
381
+ export async function runAuthLogin(args, deps) {
382
+ const parsedArgs = parseAuthLoginArgs(args);
383
+ if (!parsedArgs.ok) {
384
+ if (parsedArgs.reason === "error") {
385
+ console.error(parsedArgs.message);
386
+ printUsage();
387
+ return 1;
388
+ }
389
+ printUsage();
390
+ return 0;
391
+ }
392
+ const loginOptions = parsedArgs.options;
393
+ setStoragePath(null);
394
+ let pendingMenuQuotaRefresh = null;
395
+ let menuQuotaRefreshStatus;
396
+ loginFlow: while (true) {
397
+ let existingStorage = await loadAccounts();
398
+ if (existingStorage && existingStorage.accounts.length > 0) {
399
+ while (true) {
400
+ existingStorage = await loadAccounts();
401
+ if (!existingStorage || existingStorage.accounts.length === 0) {
402
+ break;
403
+ }
404
+ const currentStorage = existingStorage;
405
+ const displaySettings = await loadDashboardDisplaySettings();
406
+ applyUiThemeFromDashboardSettings(displaySettings);
407
+ const quotaCache = await loadQuotaCache();
408
+ const shouldAutoFetchLimits = displaySettings.menuAutoFetchLimits ?? true;
409
+ const showFetchStatus = displaySettings.menuShowFetchStatus ?? true;
410
+ const quotaTtlMs = displaySettings.menuQuotaTtlMs ?? deps.defaultMenuQuotaRefreshTtlMs;
411
+ if (shouldAutoFetchLimits && !pendingMenuQuotaRefresh) {
412
+ const staleCount = deps.countMenuQuotaRefreshTargets(currentStorage, quotaCache, quotaTtlMs);
413
+ if (staleCount > 0) {
414
+ if (showFetchStatus) {
415
+ menuQuotaRefreshStatus = `${UI_COPY.mainMenu.loadingLimits} [0/${staleCount}]`;
416
+ }
417
+ pendingMenuQuotaRefresh = deps.refreshQuotaCacheForMenu(currentStorage, quotaCache, quotaTtlMs, (current, total) => {
418
+ if (!showFetchStatus)
419
+ return;
420
+ menuQuotaRefreshStatus = `${UI_COPY.mainMenu.loadingLimits} [${current}/${total}]`;
421
+ })
422
+ .then(() => undefined)
423
+ .catch(() => undefined)
424
+ .finally(() => {
425
+ menuQuotaRefreshStatus = undefined;
426
+ pendingMenuQuotaRefresh = null;
427
+ });
428
+ }
429
+ }
430
+ const flaggedStorage = await loadFlaggedAccounts();
431
+ const menuResult = await promptLoginMode(deps.toExistingAccountInfo(currentStorage, quotaCache, displaySettings), {
432
+ flaggedCount: flaggedStorage.accounts.length,
433
+ statusMessage: showFetchStatus ? () => menuQuotaRefreshStatus : undefined,
434
+ });
435
+ if (menuResult.mode === "cancel") {
436
+ console.log("Cancelled.");
437
+ return 0;
438
+ }
439
+ if (menuResult.mode === "check") {
440
+ await deps.runActionPanel("Quick Check", "Checking local session + live status", async () => {
441
+ await deps.runHealthCheck({ forceRefresh: false, liveProbe: true });
442
+ }, displaySettings);
443
+ continue;
444
+ }
445
+ if (menuResult.mode === "deep-check") {
446
+ await deps.runActionPanel("Deep Check", "Refreshing and testing all accounts", async () => {
447
+ await deps.runHealthCheck({ forceRefresh: true, liveProbe: true });
448
+ }, displaySettings);
449
+ continue;
450
+ }
451
+ if (menuResult.mode === "forecast") {
452
+ await deps.runActionPanel("Best Account", "Comparing accounts", async () => {
453
+ await deps.runForecast(["--live"]);
454
+ }, displaySettings);
455
+ continue;
456
+ }
457
+ if (menuResult.mode === "fix") {
458
+ await deps.runActionPanel("Auto-Fix", "Checking and fixing common issues", async () => {
459
+ await deps.runFix(["--live"]);
460
+ }, displaySettings);
461
+ continue;
462
+ }
463
+ if (menuResult.mode === "settings") {
464
+ await configureUnifiedSettings(displaySettings);
465
+ continue;
466
+ }
467
+ if (menuResult.mode === "verify-flagged") {
468
+ await deps.runActionPanel("Problem Account Check", "Checking problem accounts", async () => {
469
+ await deps.runVerifyFlagged([]);
470
+ }, displaySettings);
471
+ continue;
472
+ }
473
+ if (menuResult.mode === "fresh" && menuResult.deleteAll) {
474
+ await deps.runActionPanel("Reset Accounts", "Deleting all saved accounts", async () => {
475
+ await deps.clearAccountsAndReset();
476
+ console.log("Cleared saved accounts from active storage. Recovery snapshots remain available.");
477
+ }, displaySettings);
478
+ continue;
479
+ }
480
+ if (menuResult.mode === "manage") {
481
+ const requiresInteractiveOAuth = typeof menuResult.refreshAccountIndex === "number";
482
+ if (requiresInteractiveOAuth) {
483
+ await deps.handleManageAction(currentStorage, menuResult);
484
+ continue;
485
+ }
486
+ await deps.runActionPanel("Applying Change", "Updating selected account", async () => {
487
+ await deps.handleManageAction(currentStorage, menuResult);
488
+ }, displaySettings);
489
+ continue;
490
+ }
491
+ if (menuResult.mode === "add") {
492
+ break;
493
+ }
494
+ }
495
+ }
496
+ const refreshedStorage = await loadAccounts();
497
+ let existingCount = refreshedStorage?.accounts.length ?? 0;
498
+ let forceNewLogin = existingCount > 0;
499
+ let onboardingBackupDiscoveryWarning = null;
500
+ const loadNamedBackupsForOnboarding = async () => {
501
+ if (existingCount > 0) {
502
+ onboardingBackupDiscoveryWarning = null;
503
+ return [];
504
+ }
505
+ try {
506
+ onboardingBackupDiscoveryWarning = null;
507
+ return await getNamedBackups();
508
+ }
509
+ catch (error) {
510
+ const code = error.code;
511
+ deps.log.debug("getNamedBackups failed, skipping restore option", {
512
+ code,
513
+ error: error instanceof Error ? error.message : String(error),
514
+ });
515
+ if (code && code !== "ENOENT") {
516
+ onboardingBackupDiscoveryWarning =
517
+ "Named backup discovery failed. Continuing with browser or manual sign-in only.";
518
+ console.warn(onboardingBackupDiscoveryWarning);
519
+ }
520
+ else {
521
+ onboardingBackupDiscoveryWarning = null;
522
+ }
523
+ return [];
524
+ }
525
+ };
526
+ let namedBackups = await loadNamedBackupsForOnboarding();
527
+ while (true) {
528
+ const latestNamedBackup = namedBackups[0] ?? null;
529
+ const preferManualMode = loginOptions.manual || isBrowserLaunchSuppressed();
530
+ const signInMode = preferManualMode
531
+ ? "manual"
532
+ : await deps.promptOAuthSignInMode(latestNamedBackup, onboardingBackupDiscoveryWarning);
533
+ if (signInMode === "cancel") {
534
+ if (existingCount > 0) {
535
+ console.log(deps.stylePromptText(UI_COPY.oauth.cancelledBackToMenu, "muted"));
536
+ continue loginFlow;
537
+ }
538
+ console.log("Cancelled.");
539
+ return 0;
540
+ }
541
+ if (signInMode === "restore-backup") {
542
+ const latestAvailableBackup = namedBackups[0] ?? null;
543
+ if (!latestAvailableBackup) {
544
+ namedBackups = await loadNamedBackupsForOnboarding();
545
+ continue;
546
+ }
547
+ const restoreMode = await deps.promptBackupRestoreMode(latestAvailableBackup);
548
+ if (restoreMode === "back") {
549
+ namedBackups = await loadNamedBackupsForOnboarding();
550
+ continue;
551
+ }
552
+ const selectedBackup = restoreMode === "manual"
553
+ ? await deps.promptManualBackupSelection(namedBackups)
554
+ : latestAvailableBackup;
555
+ if (!selectedBackup) {
556
+ namedBackups = await loadNamedBackupsForOnboarding();
557
+ continue;
558
+ }
559
+ const confirmed = await confirm(UI_COPY.oauth.restoreBackupConfirm(selectedBackup.fileName, selectedBackup.accountCount));
560
+ if (!confirmed) {
561
+ namedBackups = await loadNamedBackupsForOnboarding();
562
+ continue;
563
+ }
564
+ const displaySettings = await loadDashboardDisplaySettings();
565
+ applyUiThemeFromDashboardSettings(displaySettings);
566
+ try {
567
+ await deps.runActionPanel("Load Backup", `Loading ${selectedBackup.fileName}`, async () => {
568
+ const restoredStorage = await restoreAccountsFromBackup(selectedBackup.path, { persist: false });
569
+ const targetIndex = deps.resolveActiveIndex(restoredStorage);
570
+ const { synced } = await persistAndSyncSelectedAccount({
571
+ storage: restoredStorage,
572
+ targetIndex,
573
+ parsed: targetIndex + 1,
574
+ switchReason: "restore",
575
+ preserveActiveIndexByFamily: true,
576
+ helpers: deps,
577
+ });
578
+ console.log(UI_COPY.oauth.restoreBackupLoaded(selectedBackup.fileName, restoredStorage.accounts.length));
579
+ if (!synced) {
580
+ console.warn(UI_COPY.oauth.restoreBackupSyncWarning);
581
+ }
582
+ }, displaySettings);
583
+ }
584
+ catch (error) {
585
+ const message = error instanceof Error ? error.message : String(error);
586
+ if (error instanceof StorageError) {
587
+ console.error(formatStorageErrorHint(error, selectedBackup.path));
588
+ }
589
+ else {
590
+ console.error(`Backup restore failed: ${message}`);
591
+ }
592
+ const storageAfterRestoreAttempt = await loadAccounts().catch(() => null);
593
+ if ((storageAfterRestoreAttempt?.accounts.length ?? 0) > 0) {
594
+ continue loginFlow;
595
+ }
596
+ namedBackups = await loadNamedBackupsForOnboarding();
597
+ continue;
598
+ }
599
+ continue loginFlow;
600
+ }
601
+ if (signInMode !== "browser" && signInMode !== "manual") {
602
+ continue;
603
+ }
604
+ const tokenResult = await deps.runOAuthFlow(forceNewLogin, signInMode);
605
+ if (tokenResult.type !== "success") {
606
+ const message = tokenResult.message ?? tokenResult.reason ?? "unknown error";
607
+ if (message.toLowerCase().includes("cancelled")) {
608
+ if (existingCount > 0) {
609
+ console.log(deps.stylePromptText(UI_COPY.oauth.cancelledBackToMenu, "muted"));
610
+ continue loginFlow;
611
+ }
612
+ console.log("Cancelled.");
613
+ return 0;
614
+ }
615
+ console.error(`Login failed: ${message}`);
616
+ return 1;
617
+ }
618
+ const resolved = deps.resolveAccountSelection(tokenResult);
619
+ await deps.persistAccountPool([resolved], false);
620
+ await deps.syncSelectionToCodex(resolved);
621
+ const latestStorage = await loadAccounts();
622
+ const count = latestStorage?.accounts.length ?? 1;
623
+ existingCount = count;
624
+ namedBackups = [];
625
+ onboardingBackupDiscoveryWarning = null;
626
+ console.log(`Added account. Total: ${count}`);
627
+ console.log("Next steps:");
628
+ console.log(" codex auth status Check that the wrapper is active.");
629
+ console.log(" codex auth check Confirm your saved accounts look healthy.");
630
+ console.log(" codex auth list Review saved accounts before switching.");
631
+ if (count >= ACCOUNT_LIMITS.MAX_ACCOUNTS) {
632
+ console.log(`Reached maximum account limit (${ACCOUNT_LIMITS.MAX_ACCOUNTS}).`);
633
+ break;
634
+ }
635
+ const addAnother = await promptAddAnotherAccount(count);
636
+ if (!addAnother)
637
+ break;
638
+ forceNewLogin = true;
639
+ }
640
+ continue loginFlow;
641
+ }
642
+ }
643
+ //# sourceMappingURL=auth-commands.js.map