codex-multi-auth 2.16.0 → 2.17.2

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 (303) hide show
  1. package/.codex-plugin/plugin.json +9 -9
  2. package/LICENSE +21 -21
  3. package/README.md +487 -463
  4. package/assets/codex-multi-auth-icon.svg +39 -39
  5. package/assets/readme-hero.svg +31 -31
  6. package/config/README.md +31 -31
  7. package/config/codex-legacy.json +1221 -1221
  8. package/config/codex-modern.json +423 -423
  9. package/config/minimal-codex.json +15 -15
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +8 -3
  12. package/dist/lib/account-policy.d.ts +4 -0
  13. package/dist/lib/account-policy.d.ts.map +1 -1
  14. package/dist/lib/account-policy.js +8 -0
  15. package/dist/lib/accounts/rate-limits.d.ts.map +1 -1
  16. package/dist/lib/accounts/rate-limits.js +2 -0
  17. package/dist/lib/accounts.d.ts +15 -3
  18. package/dist/lib/accounts.d.ts.map +1 -1
  19. package/dist/lib/accounts.js +231 -30
  20. package/dist/lib/api-route-store.d.ts +24 -0
  21. package/dist/lib/api-route-store.d.ts.map +1 -0
  22. package/dist/lib/api-route-store.js +145 -0
  23. package/dist/lib/auth/account-access.d.ts +115 -0
  24. package/dist/lib/auth/account-access.d.ts.map +1 -0
  25. package/dist/lib/auth/account-access.js +214 -0
  26. package/dist/lib/auth/token-utils.d.ts +54 -1
  27. package/dist/lib/auth/token-utils.d.ts.map +1 -1
  28. package/dist/lib/auth/token-utils.js +92 -7
  29. package/dist/lib/cli.d.ts +1 -1
  30. package/dist/lib/cli.d.ts.map +1 -1
  31. package/dist/lib/cli.js +4 -0
  32. package/dist/lib/codex-cli/state.d.ts +7 -0
  33. package/dist/lib/codex-cli/state.d.ts.map +1 -1
  34. package/dist/lib/codex-cli/state.js +18 -0
  35. package/dist/lib/codex-cli/writer.d.ts.map +1 -1
  36. package/dist/lib/codex-cli/writer.js +60 -8
  37. package/dist/lib/codex-manager/account-manager-commands.d.ts.map +1 -1
  38. package/dist/lib/codex-manager/account-manager-commands.js +1 -0
  39. package/dist/lib/codex-manager/account-pool-write.d.ts +3 -1
  40. package/dist/lib/codex-manager/account-pool-write.d.ts.map +1 -1
  41. package/dist/lib/codex-manager/account-pool-write.js +4 -0
  42. package/dist/lib/codex-manager/api-login-menu.d.ts +14 -0
  43. package/dist/lib/codex-manager/api-login-menu.d.ts.map +1 -0
  44. package/dist/lib/codex-manager/api-login-menu.js +224 -0
  45. package/dist/lib/codex-manager/commands/account.d.ts.map +1 -1
  46. package/dist/lib/codex-manager/commands/account.js +27 -0
  47. package/dist/lib/codex-manager/commands/best.d.ts.map +1 -1
  48. package/dist/lib/codex-manager/commands/best.js +6 -2
  49. package/dist/lib/codex-manager/commands/check.d.ts +7 -1
  50. package/dist/lib/codex-manager/commands/check.d.ts.map +1 -1
  51. package/dist/lib/codex-manager/commands/check.js +24 -3
  52. package/dist/lib/codex-manager/commands/forecast.d.ts +1 -1
  53. package/dist/lib/codex-manager/commands/forecast.d.ts.map +1 -1
  54. package/dist/lib/codex-manager/commands/forecast.js +7 -3
  55. package/dist/lib/codex-manager/commands/report.d.ts.map +1 -1
  56. package/dist/lib/codex-manager/commands/report.js +5 -1
  57. package/dist/lib/codex-manager/commands/resets.d.ts +2 -0
  58. package/dist/lib/codex-manager/commands/resets.d.ts.map +1 -0
  59. package/dist/lib/codex-manager/commands/resets.js +67 -0
  60. package/dist/lib/codex-manager/commands/rotation.d.ts +2 -2
  61. package/dist/lib/codex-manager/commands/rotation.d.ts.map +1 -1
  62. package/dist/lib/codex-manager/commands/rotation.js +63 -12
  63. package/dist/lib/codex-manager/commands/status.d.ts +12 -1
  64. package/dist/lib/codex-manager/commands/status.d.ts.map +1 -1
  65. package/dist/lib/codex-manager/commands/status.js +166 -22
  66. package/dist/lib/codex-manager/commands/uninstall.js +1 -1
  67. package/dist/lib/codex-manager/formatters/quota-formatters.d.ts.map +1 -1
  68. package/dist/lib/codex-manager/formatters/quota-formatters.js +3 -2
  69. package/dist/lib/codex-manager/health-check.d.ts +3 -0
  70. package/dist/lib/codex-manager/health-check.d.ts.map +1 -1
  71. package/dist/lib/codex-manager/health-check.js +57 -7
  72. package/dist/lib/codex-manager/help.d.ts.map +1 -1
  73. package/dist/lib/codex-manager/help.js +4 -2
  74. package/dist/lib/codex-manager/login-flow.d.ts.map +1 -1
  75. package/dist/lib/codex-manager/login-flow.js +69 -7
  76. package/dist/lib/codex-manager/login-menu-data.d.ts.map +1 -1
  77. package/dist/lib/codex-manager/login-menu-data.js +21 -8
  78. package/dist/lib/codex-manager/login-oauth.d.ts +3 -0
  79. package/dist/lib/codex-manager/login-oauth.d.ts.map +1 -1
  80. package/dist/lib/codex-manager/login-oauth.js +6 -1
  81. package/dist/lib/codex-manager/login-workspace-choice.d.ts +11 -0
  82. package/dist/lib/codex-manager/login-workspace-choice.d.ts.map +1 -0
  83. package/dist/lib/codex-manager/login-workspace-choice.js +37 -0
  84. package/dist/lib/codex-manager/persist-selected-account.d.ts.map +1 -1
  85. package/dist/lib/codex-manager/persist-selected-account.js +2 -1
  86. package/dist/lib/codex-manager/quota-cache-helpers.d.ts +7 -1
  87. package/dist/lib/codex-manager/quota-cache-helpers.d.ts.map +1 -1
  88. package/dist/lib/codex-manager/quota-cache-helpers.js +34 -19
  89. package/dist/lib/codex-manager/repair-commands.d.ts +13 -0
  90. package/dist/lib/codex-manager/repair-commands.d.ts.map +1 -1
  91. package/dist/lib/codex-manager/repair-commands.js +144 -9
  92. package/dist/lib/codex-manager.d.ts.map +1 -1
  93. package/dist/lib/codex-manager.js +25 -6
  94. package/dist/lib/concurrency.d.ts +3 -0
  95. package/dist/lib/concurrency.d.ts.map +1 -0
  96. package/dist/lib/concurrency.js +31 -0
  97. package/dist/lib/context-budget-response.js +8 -8
  98. package/dist/lib/context-overflow.js +10 -10
  99. package/dist/lib/model-route-policy.d.ts +52 -0
  100. package/dist/lib/model-route-policy.d.ts.map +1 -0
  101. package/dist/lib/model-route-policy.js +159 -0
  102. package/dist/lib/oauth-success.html +125 -125
  103. package/dist/lib/policy/runtime-policy.d.ts +1 -0
  104. package/dist/lib/policy/runtime-policy.d.ts.map +1 -1
  105. package/dist/lib/policy/runtime-policy.js +3 -0
  106. package/dist/lib/preemptive-quota-scheduler.d.ts +2 -0
  107. package/dist/lib/preemptive-quota-scheduler.d.ts.map +1 -1
  108. package/dist/lib/preemptive-quota-scheduler.js +4 -0
  109. package/dist/lib/prompts/codex-host-bridge.js +138 -138
  110. package/dist/lib/prompts/codex.js +79 -79
  111. package/dist/lib/quota-cache.d.ts +7 -3
  112. package/dist/lib/quota-cache.d.ts.map +1 -1
  113. package/dist/lib/quota-cache.js +91 -59
  114. package/dist/lib/quota-probe.d.ts +5 -0
  115. package/dist/lib/quota-probe.d.ts.map +1 -1
  116. package/dist/lib/quota-probe.js +26 -2
  117. package/dist/lib/quota-readiness.d.ts +7 -2
  118. package/dist/lib/quota-readiness.d.ts.map +1 -1
  119. package/dist/lib/quota-readiness.js +25 -4
  120. package/dist/lib/request/client-cancellation.d.ts +5 -0
  121. package/dist/lib/request/client-cancellation.d.ts.map +1 -0
  122. package/dist/lib/request/client-cancellation.js +7 -0
  123. package/dist/lib/request/response-outcome.d.ts +25 -0
  124. package/dist/lib/request/response-outcome.d.ts.map +1 -0
  125. package/dist/lib/request/response-outcome.js +49 -0
  126. package/dist/lib/request/stream-failover-runtime.d.ts +2 -1
  127. package/dist/lib/request/stream-failover-runtime.d.ts.map +1 -1
  128. package/dist/lib/request/stream-failover-runtime.js +29 -10
  129. package/dist/lib/runtime/account-check.d.ts.map +1 -1
  130. package/dist/lib/runtime/account-check.js +2 -8
  131. package/dist/lib/runtime/account-model-catalog.d.ts +64 -0
  132. package/dist/lib/runtime/account-model-catalog.d.ts.map +1 -0
  133. package/dist/lib/runtime/account-model-catalog.js +154 -0
  134. package/dist/lib/runtime/account-pool.d.ts +3 -1
  135. package/dist/lib/runtime/account-pool.d.ts.map +1 -1
  136. package/dist/lib/runtime/account-pool.js +4 -0
  137. package/dist/lib/runtime/account-reset-credits.d.ts +42 -0
  138. package/dist/lib/runtime/account-reset-credits.d.ts.map +1 -0
  139. package/dist/lib/runtime/account-reset-credits.js +82 -0
  140. package/dist/lib/runtime/api-model-capabilities.d.ts +30 -0
  141. package/dist/lib/runtime/api-model-capabilities.d.ts.map +1 -0
  142. package/dist/lib/runtime/api-model-capabilities.js +434 -0
  143. package/dist/lib/runtime/api-model-runtime.d.ts +42 -0
  144. package/dist/lib/runtime/api-model-runtime.d.ts.map +1 -0
  145. package/dist/lib/runtime/api-model-runtime.js +358 -0
  146. package/dist/lib/runtime/app-bind.d.ts +19 -1
  147. package/dist/lib/runtime/app-bind.d.ts.map +1 -1
  148. package/dist/lib/runtime/app-bind.js +89 -11
  149. package/dist/lib/runtime/automatic-account-checks.d.ts +35 -0
  150. package/dist/lib/runtime/automatic-account-checks.d.ts.map +1 -0
  151. package/dist/lib/runtime/automatic-account-checks.js +140 -0
  152. package/dist/lib/runtime/automatic-subscription-checks.d.ts +7 -0
  153. package/dist/lib/runtime/automatic-subscription-checks.d.ts.map +1 -0
  154. package/dist/lib/runtime/automatic-subscription-checks.js +54 -0
  155. package/dist/lib/runtime/catalog-capabilities.d.ts +8 -0
  156. package/dist/lib/runtime/catalog-capabilities.d.ts.map +1 -0
  157. package/dist/lib/runtime/catalog-capabilities.js +61 -0
  158. package/dist/lib/runtime/inference-activity.d.ts +15 -0
  159. package/dist/lib/runtime/inference-activity.d.ts.map +1 -0
  160. package/dist/lib/runtime/inference-activity.js +95 -0
  161. package/dist/lib/runtime/model-discovery-status.d.ts +100 -0
  162. package/dist/lib/runtime/model-discovery-status.d.ts.map +1 -0
  163. package/dist/lib/runtime/model-discovery-status.js +387 -0
  164. package/dist/lib/runtime/native-account-storage.d.ts +11 -0
  165. package/dist/lib/runtime/native-account-storage.d.ts.map +1 -0
  166. package/dist/lib/runtime/native-account-storage.js +50 -0
  167. package/dist/lib/runtime/native-account-sync.d.ts +19 -0
  168. package/dist/lib/runtime/native-account-sync.d.ts.map +1 -0
  169. package/dist/lib/runtime/native-account-sync.js +62 -0
  170. package/dist/lib/runtime/native-binding-lock.d.ts +3 -0
  171. package/dist/lib/runtime/native-binding-lock.d.ts.map +1 -0
  172. package/dist/lib/runtime/native-binding-lock.js +5 -0
  173. package/dist/lib/runtime/native-client-auth.d.ts +3 -0
  174. package/dist/lib/runtime/native-client-auth.d.ts.map +1 -0
  175. package/dist/lib/runtime/native-client-auth.js +42 -0
  176. package/dist/lib/runtime/native-provider-config.d.ts +4 -0
  177. package/dist/lib/runtime/native-provider-config.d.ts.map +1 -0
  178. package/dist/lib/runtime/native-provider-config.js +52 -0
  179. package/dist/lib/runtime/native-rate-limits.d.ts +18 -0
  180. package/dist/lib/runtime/native-rate-limits.d.ts.map +1 -0
  181. package/dist/lib/runtime/native-rate-limits.js +135 -0
  182. package/dist/lib/runtime/reset-credit-routing.d.ts +41 -0
  183. package/dist/lib/runtime/reset-credit-routing.d.ts.map +1 -0
  184. package/dist/lib/runtime/reset-credit-routing.js +66 -0
  185. package/dist/lib/runtime/reset-credits.d.ts +101 -0
  186. package/dist/lib/runtime/reset-credits.d.ts.map +1 -0
  187. package/dist/lib/runtime/reset-credits.js +162 -0
  188. package/dist/lib/runtime/response-output-history.d.ts +17 -0
  189. package/dist/lib/runtime/response-output-history.d.ts.map +1 -0
  190. package/dist/lib/runtime/response-output-history.js +85 -0
  191. package/dist/lib/runtime/responses-websocket.d.ts +31 -0
  192. package/dist/lib/runtime/responses-websocket.d.ts.map +1 -0
  193. package/dist/lib/runtime/responses-websocket.js +636 -0
  194. package/dist/lib/runtime/resume-picker.d.ts +41 -0
  195. package/dist/lib/runtime/resume-picker.d.ts.map +1 -0
  196. package/dist/lib/runtime/resume-picker.js +169 -0
  197. package/dist/lib/runtime/rotation-account-selection.d.ts +6 -0
  198. package/dist/lib/runtime/rotation-account-selection.d.ts.map +1 -1
  199. package/dist/lib/runtime/rotation-account-selection.js +63 -0
  200. package/dist/lib/runtime/rotation-proxy-state.d.ts +33 -0
  201. package/dist/lib/runtime/rotation-proxy-state.d.ts.map +1 -1
  202. package/dist/lib/runtime/rotation-server-types.d.ts +18 -0
  203. package/dist/lib/runtime/rotation-server-types.d.ts.map +1 -1
  204. package/dist/lib/runtime/runtime-capability-failures.d.ts +14 -0
  205. package/dist/lib/runtime/runtime-capability-failures.d.ts.map +1 -0
  206. package/dist/lib/runtime/runtime-capability-failures.js +76 -0
  207. package/dist/lib/runtime/runtime-observability.d.ts +7 -0
  208. package/dist/lib/runtime/runtime-observability.d.ts.map +1 -1
  209. package/dist/lib/runtime/runtime-observability.js +42 -2
  210. package/dist/lib/runtime/subscription-first-use.d.ts +10 -0
  211. package/dist/lib/runtime/subscription-first-use.d.ts.map +1 -0
  212. package/dist/lib/runtime/subscription-first-use.js +64 -0
  213. package/dist/lib/runtime/subscription-quota-event.d.ts +6 -0
  214. package/dist/lib/runtime/subscription-quota-event.d.ts.map +1 -0
  215. package/dist/lib/runtime/subscription-quota-event.js +31 -0
  216. package/dist/lib/runtime/subscription-quota-order.d.ts +17 -0
  217. package/dist/lib/runtime/subscription-quota-order.d.ts.map +1 -0
  218. package/dist/lib/runtime/subscription-quota-order.js +31 -0
  219. package/dist/lib/runtime/workspace-model-scopes.d.ts +15 -0
  220. package/dist/lib/runtime/workspace-model-scopes.d.ts.map +1 -0
  221. package/dist/lib/runtime/workspace-model-scopes.js +34 -0
  222. package/dist/lib/runtime-constants.d.ts +3 -0
  223. package/dist/lib/runtime-constants.d.ts.map +1 -1
  224. package/dist/lib/runtime-constants.js +5 -0
  225. package/dist/lib/runtime-paths.d.ts.map +1 -1
  226. package/dist/lib/runtime-paths.js +4 -1
  227. package/dist/lib/runtime-rotation-proxy.d.ts.map +1 -1
  228. package/dist/lib/runtime-rotation-proxy.js +852 -42
  229. package/dist/lib/schemas.d.ts +20 -0
  230. package/dist/lib/schemas.d.ts.map +1 -1
  231. package/dist/lib/schemas.js +3 -0
  232. package/dist/lib/storage/credential-sidecars.d.ts +13 -0
  233. package/dist/lib/storage/credential-sidecars.d.ts.map +1 -0
  234. package/dist/lib/storage/credential-sidecars.js +52 -0
  235. package/dist/lib/storage/file-lock.d.ts +9 -0
  236. package/dist/lib/storage/file-lock.d.ts.map +1 -0
  237. package/dist/lib/storage/file-lock.js +186 -0
  238. package/dist/lib/storage/flagged-storage.d.ts.map +1 -1
  239. package/dist/lib/storage/flagged-storage.js +12 -0
  240. package/dist/lib/storage/path-state.d.ts +2 -0
  241. package/dist/lib/storage/path-state.d.ts.map +1 -1
  242. package/dist/lib/storage/path-state.js +9 -0
  243. package/dist/lib/storage/paths.js +4 -4
  244. package/dist/lib/storage/pending-auth.d.ts +18 -0
  245. package/dist/lib/storage/pending-auth.d.ts.map +1 -0
  246. package/dist/lib/storage/pending-auth.js +155 -0
  247. package/dist/lib/storage/public-types.d.ts +13 -0
  248. package/dist/lib/storage/public-types.d.ts.map +1 -1
  249. package/dist/lib/storage/record-identity.d.ts +16 -0
  250. package/dist/lib/storage/record-identity.d.ts.map +1 -0
  251. package/dist/lib/storage/record-identity.js +16 -0
  252. package/dist/lib/storage/snapshot-merge.d.ts +16 -0
  253. package/dist/lib/storage/snapshot-merge.d.ts.map +1 -0
  254. package/dist/lib/storage/snapshot-merge.js +206 -0
  255. package/dist/lib/storage/transactions.d.ts.map +1 -1
  256. package/dist/lib/storage/transactions.js +5 -4
  257. package/dist/lib/storage.d.ts +6 -0
  258. package/dist/lib/storage.d.ts.map +1 -1
  259. package/dist/lib/storage.js +77 -7
  260. package/dist/lib/ui/auth-menu-builder.d.ts +2 -0
  261. package/dist/lib/ui/auth-menu-builder.d.ts.map +1 -1
  262. package/dist/lib/ui/auth-menu-builder.js +1 -0
  263. package/dist/lib/ui/auth-menu.d.ts.map +1 -1
  264. package/dist/lib/ui/auth-menu.js +1 -0
  265. package/dist/lib/ui/check-progress.d.ts +8 -0
  266. package/dist/lib/ui/check-progress.d.ts.map +1 -0
  267. package/dist/lib/ui/check-progress.js +30 -0
  268. package/dist/lib/ui/format.d.ts +3 -1
  269. package/dist/lib/ui/format.d.ts.map +1 -1
  270. package/dist/lib/ui/format.js +8 -0
  271. package/dist/lib/ui/ui-copy.d.ts +2 -2
  272. package/dist/lib/ui/ui-copy.js +2 -2
  273. package/dist/lib/usage/pricing.js +2 -2
  274. package/dist/lib/usage/usage-extraction.d.ts +3 -1
  275. package/dist/lib/usage/usage-extraction.d.ts.map +1 -1
  276. package/dist/lib/usage/usage-extraction.js +46 -9
  277. package/node_modules/@codex-ai/plugin/dist/index.d.ts +2 -2
  278. package/node_modules/@codex-ai/plugin/dist/index.js +2 -2
  279. package/node_modules/@codex-ai/plugin/dist/tool.d.ts +42 -42
  280. package/node_modules/@codex-ai/plugin/dist/tool.js +29 -29
  281. package/node_modules/@codex-ai/plugin/package.json +9 -9
  282. package/node_modules/@codex-ai/sdk/dist/index.d.ts +4 -4
  283. package/node_modules/@codex-ai/sdk/dist/index.js +2 -2
  284. package/node_modules/@codex-ai/sdk/package.json +8 -8
  285. package/package.json +200 -197
  286. package/scripts/codex-app-launcher.js +653 -653
  287. package/scripts/codex-app-router.js +373 -366
  288. package/scripts/codex-bin-resolver.js +313 -281
  289. package/scripts/codex-multi-auth.js +59 -59
  290. package/scripts/codex-routing.js +62 -61
  291. package/scripts/codex.js +6642 -6564
  292. package/scripts/install-codex-auth-utils.js +213 -213
  293. package/scripts/mcodex.js +367 -367
  294. package/scripts/postinstall.js +114 -114
  295. package/scripts/preuninstall.js +265 -265
  296. package/vendor/codex-ai-plugin/dist/index.d.ts +2 -2
  297. package/vendor/codex-ai-plugin/dist/index.js +2 -2
  298. package/vendor/codex-ai-plugin/dist/tool.d.ts +42 -42
  299. package/vendor/codex-ai-plugin/dist/tool.js +29 -29
  300. package/vendor/codex-ai-plugin/package.json +9 -9
  301. package/vendor/codex-ai-sdk/dist/index.d.ts +4 -4
  302. package/vendor/codex-ai-sdk/dist/index.js +2 -2
  303. package/vendor/codex-ai-sdk/package.json +8 -8
@@ -153,6 +153,10 @@ export declare const AccountMetadataV3Schema: z.ZodObject<{
153
153
  isDefault: z.ZodOptional<z.ZodBoolean>;
154
154
  }, z.core.$strip>>>;
155
155
  currentWorkspaceIndex: z.ZodOptional<z.ZodNumber>;
156
+ codexCliMirror: z.ZodOptional<z.ZodObject<{
157
+ forAccountId: z.ZodString;
158
+ accountId: z.ZodString;
159
+ }, z.core.$strip>>;
156
160
  }, z.core.$strip>;
157
161
  /**
158
162
  * Account storage V3 - current storage format with per-family active indices.
@@ -202,6 +206,10 @@ export declare const AccountStorageV3Schema: z.ZodObject<{
202
206
  isDefault: z.ZodOptional<z.ZodBoolean>;
203
207
  }, z.core.$strip>>>;
204
208
  currentWorkspaceIndex: z.ZodOptional<z.ZodNumber>;
209
+ codexCliMirror: z.ZodOptional<z.ZodObject<{
210
+ forAccountId: z.ZodString;
211
+ accountId: z.ZodString;
212
+ }, z.core.$strip>>;
205
213
  }, z.core.$strip>>;
206
214
  activeIndex: z.ZodNumber;
207
215
  activeIndexByFamily: z.ZodOptional<z.ZodObject<{
@@ -339,6 +347,10 @@ export declare const AnyAccountStorageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
339
347
  isDefault: z.ZodOptional<z.ZodBoolean>;
340
348
  }, z.core.$strip>>>;
341
349
  currentWorkspaceIndex: z.ZodOptional<z.ZodNumber>;
350
+ codexCliMirror: z.ZodOptional<z.ZodObject<{
351
+ forAccountId: z.ZodString;
352
+ accountId: z.ZodString;
353
+ }, z.core.$strip>>;
342
354
  }, z.core.$strip>>;
343
355
  activeIndex: z.ZodNumber;
344
356
  activeIndexByFamily: z.ZodOptional<z.ZodObject<{
@@ -400,6 +412,10 @@ export declare const FlaggedAccountMetadataV1Schema: z.ZodObject<{
400
412
  isDefault: z.ZodOptional<z.ZodBoolean>;
401
413
  }, z.core.$strip>>>;
402
414
  currentWorkspaceIndex: z.ZodOptional<z.ZodNumber>;
415
+ codexCliMirror: z.ZodOptional<z.ZodObject<{
416
+ forAccountId: z.ZodString;
417
+ accountId: z.ZodString;
418
+ }, z.core.$strip>>;
403
419
  flaggedAt: z.ZodNumber;
404
420
  flaggedReason: z.ZodOptional<z.ZodString>;
405
421
  lastError: z.ZodOptional<z.ZodString>;
@@ -452,6 +468,10 @@ export declare const FlaggedAccountStorageV1Schema: z.ZodObject<{
452
468
  isDefault: z.ZodOptional<z.ZodBoolean>;
453
469
  }, z.core.$strip>>>;
454
470
  currentWorkspaceIndex: z.ZodOptional<z.ZodNumber>;
471
+ codexCliMirror: z.ZodOptional<z.ZodObject<{
472
+ forAccountId: z.ZodString;
473
+ accountId: z.ZodString;
474
+ }, z.core.$strip>>;
455
475
  flaggedAt: z.ZodNumber;
456
476
  flaggedReason: z.ZodOptional<z.ZodString>;
457
477
  lastError: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../lib/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmE7B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAMxE;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAwB9E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAwBhF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;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EAAE,OAAO,GACX,MAAM,EAAE,CASV"}
@@ -175,6 +175,9 @@ export const AccountMetadataV3Schema = z.object({
175
175
  // silently vanish after one read/write round-trip.
176
176
  workspaces: z.array(WorkspaceSchema).optional(),
177
177
  currentWorkspaceIndex: z.number().optional(),
178
+ codexCliMirror: z
179
+ .object({ forAccountId: z.string().min(1), accountId: z.string().min(1) })
180
+ .optional(),
178
181
  });
179
182
  /**
180
183
  * Build activeIndexByFamily schema dynamically from MODEL_FAMILIES.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Remove the files beside the account pool that hold raw API keys or
3
+ * per-account runtime state. `clearAccounts` only touches the account pool, so
4
+ * `uninstall --clear-accounts` and the dashboard reset call this as well.
5
+ */
6
+ export declare function clearCredentialSidecars(): Promise<void>;
7
+ /**
8
+ * Clear the account pool and the credential sidecars. The sidecars are removed
9
+ * even when the pool clear fails (e.g. a lasting Windows EBUSY), so raw API
10
+ * keys never survive a reset; the first failure is rethrown afterwards.
11
+ */
12
+ export declare function clearAccountsAndCredentialSidecars(clearPool: () => Promise<void>): Promise<void>;
13
+ //# sourceMappingURL=credential-sidecars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-sidecars.d.ts","sourceRoot":"","sources":["../../../lib/storage/credential-sidecars.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuB7D;AAED;;;;GAIG;AACH,wBAAsB,kCAAkC,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAYtG"}
@@ -0,0 +1,52 @@
1
+ import { promises as fs } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { getApiRoutesPath } from "../api-route-store.js";
4
+ import { withRetry } from "../fs-retry.js";
5
+ import { getCodexMultiAuthDir } from "../runtime-paths.js";
6
+ import { withFileTransactionLock } from "./file-lock.js";
7
+ import { withStorageLock } from "./transactions.js";
8
+ const retry = { maxAttempts: 6, backoffMs: 25 };
9
+ /**
10
+ * Remove the files beside the account pool that hold raw API keys or
11
+ * per-account runtime state. `clearAccounts` only touches the account pool, so
12
+ * `uninstall --clear-accounts` and the dashboard reset call this as well.
13
+ */
14
+ export async function clearCredentialSidecars() {
15
+ const routes = getApiRoutesPath();
16
+ // Same locks as saveApiRoutes, so a concurrent menu save cannot resurrect keys.
17
+ await withStorageLock(() => withFileTransactionLock(routes, () => withRetry(() => fs.rm(routes, { force: true }), retry)));
18
+ const dir = getCodexMultiAuthDir();
19
+ // Each writer read-modify-writes under its file lock; deleting under the same
20
+ // lock stops an in-flight refresh or redemption renaming its old state (and a
21
+ // last-resort policy) back after the reset.
22
+ for (const path of [
23
+ join(dir, "reset-credits.json"),
24
+ join(dir, "api-capability-probes.json"),
25
+ ]) {
26
+ await withFileTransactionLock(path, () => withRetry(() => fs.rm(path, { force: true }), retry));
27
+ }
28
+ // Per-account timestamps only; their writers take no lock and hold no secrets.
29
+ const activity = join(dir, "inference-activity");
30
+ await withRetry(() => fs.rm(activity, { recursive: true, force: true }), retry);
31
+ }
32
+ /**
33
+ * Clear the account pool and the credential sidecars. The sidecars are removed
34
+ * even when the pool clear fails (e.g. a lasting Windows EBUSY), so raw API
35
+ * keys never survive a reset; the first failure is rethrown afterwards.
36
+ */
37
+ export async function clearAccountsAndCredentialSidecars(clearPool) {
38
+ let failure;
39
+ let failed = false;
40
+ for (const step of [clearPool, clearCredentialSidecars]) {
41
+ try {
42
+ await step();
43
+ }
44
+ catch (error) {
45
+ if (!failed)
46
+ failure = error;
47
+ failed = true;
48
+ }
49
+ }
50
+ if (failed)
51
+ throw failure;
52
+ }
@@ -0,0 +1,9 @@
1
+ /** Local-disk transaction lock. Live processes are never evicted by age.
2
+ * Publish an already-populated directory atomically: there is no ownerless acquisition window.
3
+ * Recovery unlinks only the dead owner's unique filename; rmdir cannot erase a new owner's lock.
4
+ * A reused PID fails closed (bounded contention) rather than risking two writers.
5
+ */
6
+ export declare function withFileTransactionLock<T>(path: string, action: () => Promise<T>, options?: {
7
+ waitMs?: number;
8
+ }): Promise<T>;
9
+ //# sourceMappingURL=file-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-lock.d.ts","sourceRoot":"","sources":["../../../lib/storage/file-lock.ts"],"names":[],"mappings":"AA0GA;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,CAAC,CAAC,CA+DlB"}
@@ -0,0 +1,186 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ import { createHash, randomUUID } from "node:crypto";
3
+ import { promises as fs } from "node:fs";
4
+ import { hostname } from "node:os";
5
+ import { basename, dirname, join, resolve } from "node:path";
6
+ import { logWarn } from "../logger.js";
7
+ import { withRetry } from "../fs-retry.js";
8
+ const abandonedOwners = new Set();
9
+ const leases = new AsyncLocalStorage();
10
+ const host = createHash("sha256").update(hostname()).digest("hex").slice(0, 16);
11
+ const ownerPattern = /^([a-f0-9]{16})\.([1-9][0-9]*)\.([a-f0-9-]{36})$/;
12
+ function code(error) {
13
+ return error?.code;
14
+ }
15
+ function dead(pid) {
16
+ try {
17
+ process.kill(pid, 0);
18
+ return false;
19
+ }
20
+ catch (error) {
21
+ return code(error) === "ESRCH";
22
+ }
23
+ }
24
+ async function removeEmpty(path) {
25
+ try {
26
+ await fs.rmdir(path);
27
+ }
28
+ catch (error) {
29
+ if (!["ENOENT", "ENOTEMPTY", "EEXIST"].includes(code(error) ?? ""))
30
+ throw error;
31
+ }
32
+ }
33
+ function retryAbandonedRelease(path, owner, remaining = 30) {
34
+ const timer = setTimeout(() => {
35
+ void (async () => {
36
+ try {
37
+ try {
38
+ await fs.unlink(join(path, owner));
39
+ }
40
+ catch (error) {
41
+ if (code(error) !== "ENOENT")
42
+ throw error;
43
+ }
44
+ // Owner filenames are unique; never delete another owner's contents.
45
+ await removeEmpty(path);
46
+ abandonedOwners.delete(owner);
47
+ }
48
+ catch {
49
+ if (remaining > 1)
50
+ retryAbandonedRelease(path, owner, remaining - 1);
51
+ }
52
+ })();
53
+ }, 250);
54
+ timer.unref();
55
+ }
56
+ async function recoverDeadOwner(path) {
57
+ let entries;
58
+ try {
59
+ const stat = await fs.lstat(path);
60
+ if (!stat.isDirectory() || stat.isSymbolicLink())
61
+ throw Error("Invalid storage lock; manual repair required");
62
+ entries = await fs.readdir(path);
63
+ }
64
+ catch (error) {
65
+ if (code(error) === "ENOENT")
66
+ return;
67
+ throw error;
68
+ }
69
+ // Published locks always have an owner. Empty means a release/recovery was interrupted.
70
+ if (!entries.length) {
71
+ await removeEmpty(path);
72
+ return;
73
+ }
74
+ if (entries.length !== 1)
75
+ throw Error("Invalid storage lock contents; manual repair required");
76
+ const name = entries[0];
77
+ if (!name)
78
+ return;
79
+ const owner = ownerPattern.exec(name);
80
+ if (!owner || owner[1] !== host || !Number.isSafeInteger(Number(owner[2])))
81
+ return;
82
+ if (!abandonedOwners.has(name) && !dead(Number(owner[2])))
83
+ return;
84
+ try {
85
+ await fs.unlink(join(path, name));
86
+ }
87
+ catch (error) {
88
+ if (code(error) === "ENOENT")
89
+ return;
90
+ throw error;
91
+ }
92
+ // Never recursively remove: another writer may already have published a new nonempty lock.
93
+ abandonedOwners.delete(name);
94
+ await removeEmpty(path);
95
+ }
96
+ async function recoverDeadCandidates(lock) {
97
+ const parent = dirname(lock), prefix = `${basename(lock)}.candidate-`;
98
+ for (const entry of await fs.readdir(parent, { withFileTypes: true })) {
99
+ if (!entry.name.startsWith(prefix) || !entry.isDirectory() || entry.isSymbolicLink())
100
+ continue;
101
+ const candidate = join(parent, entry.name);
102
+ try {
103
+ const owners = await fs.readdir(candidate);
104
+ // An empty candidate may belong to a live writer still publishing its owner.
105
+ if (owners.length !== 1 || !ownerPattern.test(owners[0] ?? ""))
106
+ continue;
107
+ await recoverDeadOwner(candidate);
108
+ }
109
+ catch (error) {
110
+ if (code(error) !== "ENOENT")
111
+ logWarn("Storage candidate cleanup deferred", { code: code(error) ?? "unknown" });
112
+ }
113
+ }
114
+ }
115
+ /** Local-disk transaction lock. Live processes are never evicted by age.
116
+ * Publish an already-populated directory atomically: there is no ownerless acquisition window.
117
+ * Recovery unlinks only the dead owner's unique filename; rmdir cannot erase a new owner's lock.
118
+ * A reused PID fails closed (bounded contention) rather than risking two writers.
119
+ */
120
+ export async function withFileTransactionLock(path, action, options = {}) {
121
+ const absolute = resolve(path);
122
+ await fs.mkdir(dirname(absolute), { recursive: true, mode: 0o700 });
123
+ // Canonicalize the existing parent so /tmp and its symlink aliases share a lock.
124
+ const key = join(await fs.realpath(dirname(absolute)), absolute.slice(dirname(absolute).length + 1));
125
+ if (leases.getStore()?.get(key)?.active)
126
+ return action();
127
+ const lock = `${key}.write-lock`;
128
+ await recoverDeadCandidates(lock);
129
+ const candidate = await fs.mkdtemp(`${lock}.candidate-`);
130
+ const owner = `${host}.${process.pid}.${randomUUID()}`;
131
+ let published = false;
132
+ try {
133
+ await fs.chmod(candidate, 0o700);
134
+ await fs.writeFile(join(candidate, owner), "", { flag: "wx", mode: 0o600 });
135
+ await withRetry(async () => {
136
+ try {
137
+ await fs.rename(candidate, lock);
138
+ published = true;
139
+ }
140
+ catch (error) {
141
+ if (!["ENOTEMPTY", "EEXIST", "EPERM", "EACCES"].includes(code(error) ?? ""))
142
+ throw error;
143
+ // Permission errors without a destination are not lock contention.
144
+ if (["EPERM", "EACCES"].includes(code(error) ?? "")) {
145
+ try {
146
+ await fs.lstat(lock);
147
+ }
148
+ catch {
149
+ throw error;
150
+ }
151
+ }
152
+ await recoverDeadOwner(lock);
153
+ throw Object.assign(Error("Storage is busy with another live writer; retry shortly."), { code: "ELOCKED" });
154
+ }
155
+ }, { maxAttempts: Math.max(1, Math.ceil((options.waitMs ?? 10000) / 25) + 1), backoffMs: 25, retryableCodes: ["ELOCKED", "EBUSY", "EPERM", "EACCES", "EAGAIN"] });
156
+ const lease = { active: true };
157
+ const context = new Map(leases.getStore());
158
+ context.set(key, lease);
159
+ try {
160
+ return await leases.run(context, action);
161
+ }
162
+ finally {
163
+ lease.active = false;
164
+ }
165
+ }
166
+ finally {
167
+ const directory = published ? lock : candidate;
168
+ try {
169
+ await withRetry(async () => {
170
+ try {
171
+ await fs.unlink(join(directory, owner));
172
+ }
173
+ catch (error) {
174
+ if (code(error) !== "ENOENT")
175
+ throw error;
176
+ }
177
+ await removeEmpty(directory);
178
+ }, { maxAttempts: 6, backoffMs: 25 });
179
+ }
180
+ catch (error) {
181
+ abandonedOwners.add(owner);
182
+ retryAbandonedRelease(directory, owner);
183
+ logWarn("Storage lock cleanup deferred", { code: code(error) ?? "unknown" });
184
+ }
185
+ }
186
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"flagged-storage.d.ts","sourceRoot":"","sources":["../../../lib/storage/flagged-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGX,uBAAuB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,OAAO,EACb,IAAI,EAAE;IACL,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,GAAG,EAAE,MAAM,MAAM,CAAC;CAClB,GACC,uBAAuB,CAyJzB"}
1
+ {"version":3,"file":"flagged-storage.d.ts","sourceRoot":"","sources":["../../../lib/storage/flagged-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIX,uBAAuB,EACvB,MAAM,mBAAmB,CAAC;AAa3B,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,OAAO,EACb,IAAI,EAAE;IACL,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,GAAG,EAAE,MAAM,MAAM,CAAC;CAClB,GACC,uBAAuB,CA0JzB"}
@@ -1,3 +1,14 @@
1
+ function normalizeCodexCliMirror(value) {
2
+ if (typeof value !== "object" || value === null)
3
+ return undefined;
4
+ const { forAccountId, accountId } = value;
5
+ return typeof forAccountId === "string" &&
6
+ forAccountId.trim() &&
7
+ typeof accountId === "string" &&
8
+ accountId.trim()
9
+ ? { forAccountId, accountId }
10
+ : undefined;
11
+ }
1
12
  export function normalizeFlaggedStorage(data, deps) {
2
13
  if (!deps.isRecord(data) ||
3
14
  data.version !== 1 ||
@@ -101,6 +112,7 @@ export function normalizeFlaggedStorage(data, deps) {
101
112
  currentWorkspaceIndex: typeof rawAccount.currentWorkspaceIndex === "number"
102
113
  ? rawAccount.currentWorkspaceIndex
103
114
  : undefined,
115
+ codexCliMirror: normalizeCodexCliMirror(rawAccount.codexCliMirror),
104
116
  flaggedAt,
105
117
  flaggedReason: typeof rawAccount.flaggedReason === "string"
106
118
  ? rawAccount.flaggedReason
@@ -8,4 +8,6 @@ export declare function getStoragePathState(): StoragePathState;
8
8
  export declare function setStoragePathState(state: StoragePathState): void;
9
9
  export declare function setStoragePathDirectState(state: StoragePathState): void;
10
10
  export declare function runWithStoragePathState<T>(state: StoragePathState, fn: () => T | Promise<T>): Promise<T>;
11
+ /** Temporarily use the shared pool without mutating the caller or sibling async scopes. */
12
+ export declare function runWithGlobalStoragePath<T>(fn: () => T | Promise<T>): Promise<T>;
11
13
  //# sourceMappingURL=path-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"path-state.d.ts","sourceRoot":"","sources":["../../../lib/storage/path-state.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAwBF,wBAAgB,mBAAmB,IAAI,gBAAgB,CAatD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAOjE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAQvE;AAED,wBAAsB,uBAAuB,CAAC,CAAC,EAC9C,KAAK,EAAE,gBAAgB,EACvB,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,CAAC,CAAC,CAKZ"}
1
+ {"version":3,"file":"path-state.d.ts","sourceRoot":"","sources":["../../../lib/storage/path-state.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAwBF,wBAAgB,mBAAmB,IAAI,gBAAgB,CAatD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAOjE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAQvE;AAED,wBAAsB,uBAAuB,CAAC,CAAC,EAC9C,KAAK,EAAE,gBAAgB,EACvB,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,CAAC,CAAC,CAKZ;AAED,2FAA2F;AAC3F,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOhF"}
@@ -47,3 +47,12 @@ export function setStoragePathDirectState(state) {
47
47
  export async function runWithStoragePathState(state, fn) {
48
48
  return await storagePathStateContext.run({ state, directGeneration: directStorageGeneration }, fn);
49
49
  }
50
+ /** Temporarily use the shared pool without mutating the caller or sibling async scopes. */
51
+ export function runWithGlobalStoragePath(fn) {
52
+ return runWithStoragePathState({
53
+ currentStoragePath: null,
54
+ currentLegacyProjectStoragePath: null,
55
+ currentLegacyWorktreeStoragePath: null,
56
+ currentProjectRoot: null,
57
+ }, fn);
58
+ }
@@ -57,7 +57,7 @@ function resolveGitPath(basePath, pointerValue) {
57
57
  : resolve(basePath, normalizedPointer);
58
58
  }
59
59
  function readGitCommonDir(gitDirPath) {
60
- const commonDirFile = join(gitDirPath, "commondir");
60
+ const commonDirFile = resolveGitPath(gitDirPath, "commondir");
61
61
  if (!existsSync(commonDirFile)) {
62
62
  return gitDirPath;
63
63
  }
@@ -107,7 +107,7 @@ function normalizeCanonicalPathForIdentityCheck(pathValue) {
107
107
  }
108
108
  }
109
109
  function worktreeGitDirBelongsToProject(projectRoot, gitDirPath) {
110
- const gitdirBackRefPath = join(gitDirPath, "gitdir");
110
+ const gitdirBackRefPath = resolveGitPath(gitDirPath, "gitdir");
111
111
  if (!existsSync(gitdirBackRefPath)) {
112
112
  return false;
113
113
  }
@@ -268,8 +268,8 @@ export function resolveProjectStorageIdentityRoot(projectRoot) {
268
268
  if (!isGitDirUnderCommonWorktrees(gitDirPath, commonGitDir)) {
269
269
  return projectRoot;
270
270
  }
271
- const candidateRepoRoot = dirname(commonGitDir);
272
- if (!existsSync(join(candidateRepoRoot, ".git"))) {
271
+ const candidateRepoRoot = resolveGitPath(commonGitDir, "..");
272
+ if (!existsSync(resolveGitPath(candidateRepoRoot, ".git"))) {
273
273
  return projectRoot;
274
274
  }
275
275
  return candidateRepoRoot;
@@ -0,0 +1,18 @@
1
+ import type { AccountStorageV3 } from "./public-types.js";
2
+ export declare function getPendingAuthPath(storagePath: string): string;
3
+ /** Record a rotated credential beside the account pool. */
4
+ export declare function recordPendingAuth(storagePath: string, auth: {
5
+ priorRefreshToken: string;
6
+ recordId?: string;
7
+ refreshToken: string;
8
+ accessToken: string;
9
+ expiresAt: number;
10
+ at: number;
11
+ }): Promise<void>;
12
+ /** Overlay pending rotated credentials on rows that still hold the spent token. */
13
+ export declare function applyPendingAuth(storagePath: string, storage: AccountStorageV3 | null): Promise<AccountStorageV3 | null>;
14
+ /** After a save, drop entries whose spent token is no longer on disk (persisted or superseded). */
15
+ export declare function prunePendingAuth(storagePath: string, saved: AccountStorageV3): Promise<void>;
16
+ /** Coordinate resets with pending credential writers, including Windows rename locks. */
17
+ export declare function clearPendingAuth(storagePath: string): Promise<void>;
18
+ //# sourceMappingURL=pending-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-auth.d.ts","sourceRoot":"","sources":["../../../lib/storage/pending-auth.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA0B1D,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D;AAmCD,2DAA2D;AAC3D,wBAAsB,iBAAiB,CACtC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC9H,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED,mFAAmF;AACnF,wBAAsB,gBAAgB,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC9B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA6BlC;AAED,mGAAmG;AACnG,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUlG;AAED,yFAAyF;AACzF,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE"}
@@ -0,0 +1,155 @@
1
+ import { createHash } from "node:crypto";
2
+ import { promises as fs } from "node:fs";
3
+ import { dirname } from "node:path";
4
+ import { z } from "zod";
5
+ import { withRetry } from "../fs-retry.js";
6
+ import { createLogger } from "../logger.js";
7
+ import { tempPathFor } from "../temp-path.js";
8
+ import { withFileTransactionLock } from "./file-lock.js";
9
+ import { getIntentionalResetMarkerPath } from "./backup-paths.js";
10
+ /**
11
+ * Rotated OAuth credentials that could not be written to the account pool
12
+ * (a locked or unreadable accounts file). A refresh spends the previous
13
+ * refresh token upstream, so losing the new one with the process means the
14
+ * account needs a re-login. Every load applies these entries until a save
15
+ * persists them.
16
+ */
17
+ const entrySchema = z.object({
18
+ /** sha256 of the spent refresh token: identifies the row without storing it. */
19
+ prior: z.string().regex(/^[0-9a-f]{64}$/),
20
+ recordId: z.string().trim().min(1).optional(),
21
+ refreshToken: z.string().min(1),
22
+ accessToken: z.string().min(1),
23
+ expiresAt: z.number(),
24
+ at: z.number(),
25
+ });
26
+ /** The writer keeps the journal at this size; the reader accepts any size so an
27
+ * over-cap file an earlier writer left behind still loads and is trimmed on the next write. */
28
+ const MAX_ENTRIES = 1000;
29
+ const fileSchema = z.object({ version: z.literal(1), entries: z.array(entrySchema) });
30
+ const retry = { maxAttempts: 6, backoffMs: 25 };
31
+ const log = createLogger("pending-auth");
32
+ export function getPendingAuthPath(storagePath) {
33
+ return `${storagePath}.pending-auth.json`;
34
+ }
35
+ const hash = (token) => createHash("sha256").update(token).digest("hex");
36
+ /**
37
+ * Only a missing file is empty. The entries are the only copy of rotated
38
+ * tokens, so a lock that outlasts the retries or a torn/corrupt file throws:
39
+ * a writer must never replace it with a partial list.
40
+ */
41
+ async function read(path) {
42
+ let raw;
43
+ try {
44
+ raw = await withRetry(() => fs.readFile(path, "utf8"), retry);
45
+ }
46
+ catch (error) {
47
+ if (error.code === "ENOENT")
48
+ return [];
49
+ throw error;
50
+ }
51
+ return fileSchema.parse(JSON.parse(raw)).entries;
52
+ }
53
+ async function write(path, entries) {
54
+ if (!entries.length) {
55
+ await withRetry(() => fs.rm(path, { force: true }), retry);
56
+ return;
57
+ }
58
+ await fs.mkdir(dirname(path), { recursive: true, mode: 0o700 });
59
+ const temp = tempPathFor(path);
60
+ try {
61
+ await fs.writeFile(temp, `${JSON.stringify({ version: 1, entries })}\n`, { mode: 0o600, flag: "wx" });
62
+ await withRetry(() => fs.rename(temp, path), retry);
63
+ }
64
+ finally {
65
+ await fs.rm(temp, { force: true }).catch(() => undefined);
66
+ }
67
+ }
68
+ /** Record a rotated credential beside the account pool. */
69
+ export async function recordPendingAuth(storagePath, auth) {
70
+ const path = getPendingAuthPath(storagePath);
71
+ await withFileTransactionLock(path, async () => {
72
+ try {
73
+ await fs.stat(getIntentionalResetMarkerPath(storagePath));
74
+ throw Object.assign(new Error("Account pool was reset; rotated credentials were not retained."), { code: "ESTALE" });
75
+ }
76
+ catch (error) {
77
+ if (error.code !== "ENOENT")
78
+ throw error;
79
+ }
80
+ const prior = hash(auth.priorRefreshToken);
81
+ const entries = (await read(path)).filter((entry) => entry.prior !== prior && entry.prior !== hash(auth.refreshToken));
82
+ // Rotating a token that is itself only journaled: the row on disk still holds
83
+ // the original spent token, so extend that entry rather than add one that
84
+ // no disk row can match.
85
+ const chained = entries.find((entry) => entry.refreshToken === auth.priorRefreshToken);
86
+ const current = chained ?? { prior, recordId: auth.recordId, refreshToken: auth.refreshToken, accessToken: auth.accessToken, expiresAt: auth.expiresAt, at: auth.at };
87
+ if (chained)
88
+ Object.assign(chained, { recordId: chained.recordId ?? auth.recordId, refreshToken: auth.refreshToken, accessToken: auth.accessToken, expiresAt: auth.expiresAt, at: auth.at });
89
+ else
90
+ entries.push(current);
91
+ const excess = entries.length - MAX_ENTRIES;
92
+ if (excess > 0) {
93
+ // Drop the oldest other entries, never the credential being recorded now.
94
+ const dropped = new Set(entries.filter((entry) => entry !== current).sort((a, b) => a.at - b.at).slice(0, excess));
95
+ log.warn("Pending rotated credentials exceeded the journal cap; dropped the oldest entries", { dropped: dropped.size });
96
+ await write(path, entries.filter((entry) => !dropped.has(entry)));
97
+ return;
98
+ }
99
+ await write(path, entries);
100
+ });
101
+ }
102
+ /** Overlay pending rotated credentials on rows that still hold the spent token. */
103
+ export async function applyPendingAuth(storagePath, storage) {
104
+ if (!storage)
105
+ return storage;
106
+ let entries;
107
+ try {
108
+ entries = await read(getPendingAuthPath(storagePath));
109
+ }
110
+ catch (error) {
111
+ // Loading must still work; the file is left untouched for a later load.
112
+ log.error("Pending rotated credentials could not be read; affected accounts may need a re-login if this persists", {
113
+ path: getPendingAuthPath(storagePath),
114
+ code: typeof error.code === "string" && /^[A-Z_]{1,40}$/.test(error.code ?? "") ? error.code : "INVALID_PENDING_AUTH",
115
+ });
116
+ return storage;
117
+ }
118
+ if (!entries.length)
119
+ return storage;
120
+ for (const account of storage.accounts) {
121
+ const entry = account.refreshToken ? entries.find((item) => item.prior === hash(account.refreshToken)) : undefined;
122
+ if (!entry)
123
+ continue;
124
+ account.recordId ??= entry.recordId;
125
+ account.refreshToken = entry.refreshToken;
126
+ account.accessToken = entry.accessToken;
127
+ account.expiresAt = entry.expiresAt;
128
+ delete account.authInvalidatedAt;
129
+ delete account.authInvalidationErrorCode;
130
+ if (account.cooldownReason === "auth-failure") {
131
+ delete account.coolingDownUntil;
132
+ delete account.cooldownReason;
133
+ }
134
+ }
135
+ return storage;
136
+ }
137
+ /** After a save, drop entries whose spent token is no longer on disk (persisted or superseded). */
138
+ export async function prunePendingAuth(storagePath, saved) {
139
+ const path = getPendingAuthPath(storagePath);
140
+ const current = await read(path);
141
+ if (!current.length)
142
+ return;
143
+ await withFileTransactionLock(path, async () => {
144
+ const spent = new Set(saved.accounts.map((account) => hash(account.refreshToken)));
145
+ const entries = await read(path);
146
+ const remaining = entries.filter((entry) => spent.has(entry.prior));
147
+ if (remaining.length !== entries.length)
148
+ await write(path, remaining);
149
+ });
150
+ }
151
+ /** Coordinate resets with pending credential writers, including Windows rename locks. */
152
+ export async function clearPendingAuth(storagePath) {
153
+ const path = getPendingAuthPath(storagePath);
154
+ await withFileTransactionLock(path, () => withRetry(() => fs.rm(path, { force: true }), retry));
155
+ }
@@ -41,6 +41,19 @@ export interface AccountMetadataV3 {
41
41
  authInvalidationErrorCode?: string;
42
42
  workspaces?: Workspace[];
43
43
  currentWorkspaceIndex?: number;
44
+ /** See {@link CodexCliMirror}. */
45
+ codexCliMirror?: CodexCliMirror;
46
+ }
47
+ /**
48
+ * The id written to ~/.codex/auth.json in place of an explicit `login --org` /
49
+ * CODEX_AUTH_ACCOUNT_ID binding the backend does not authorize (Codex CLI
50
+ * 0.156+ refuses such an id, issue #700). Applies only while `forAccountId`
51
+ * still equals the account's `accountId`, so any change of that id (re-login,
52
+ * a new explicit id, a token-follow, a rebind) makes it stale on its own.
53
+ */
54
+ export interface CodexCliMirror {
55
+ forAccountId: string;
56
+ accountId: string;
44
57
  }
45
58
  export interface AccountStorageV3 {
46
59
  version: 3;
@@ -1 +1 @@
1
- {"version":3,"file":"public-types.d.ts","sourceRoot":"","sources":["../../../lib/storage/public-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,GAAG,YAAY,CAAC;AAE9F,MAAM,WAAW,gBAAgB;IA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