codex-multi-auth 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +22 -1
- package/config/README.md +2 -2
- package/config/codex-legacy.json +109 -184
- package/config/codex-modern.json +44 -114
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/lib/account-policy.d.ts +4 -0
- package/dist/lib/account-policy.d.ts.map +1 -1
- package/dist/lib/account-policy.js +8 -0
- package/dist/lib/accounts/rate-limits.d.ts.map +1 -1
- package/dist/lib/accounts/rate-limits.js +2 -0
- package/dist/lib/accounts.d.ts +21 -3
- package/dist/lib/accounts.d.ts.map +1 -1
- package/dist/lib/accounts.js +229 -17
- package/dist/lib/api-route-store.d.ts +24 -0
- package/dist/lib/api-route-store.d.ts.map +1 -0
- package/dist/lib/api-route-store.js +145 -0
- package/dist/lib/auth/account-access.d.ts +115 -0
- package/dist/lib/auth/account-access.d.ts.map +1 -0
- package/dist/lib/auth/account-access.js +214 -0
- package/dist/lib/auth/token-utils.d.ts +54 -1
- package/dist/lib/auth/token-utils.d.ts.map +1 -1
- package/dist/lib/auth/token-utils.js +92 -7
- package/dist/lib/cli.d.ts +1 -1
- package/dist/lib/cli.d.ts.map +1 -1
- package/dist/lib/cli.js +4 -0
- package/dist/lib/codex-cli/state.d.ts +7 -0
- package/dist/lib/codex-cli/state.d.ts.map +1 -1
- package/dist/lib/codex-cli/state.js +18 -0
- package/dist/lib/codex-cli/writer.d.ts.map +1 -1
- package/dist/lib/codex-cli/writer.js +60 -8
- package/dist/lib/codex-manager/account-manager-commands.d.ts.map +1 -1
- package/dist/lib/codex-manager/account-manager-commands.js +1 -0
- package/dist/lib/codex-manager/account-pool-write.d.ts +3 -1
- package/dist/lib/codex-manager/account-pool-write.d.ts.map +1 -1
- package/dist/lib/codex-manager/account-pool-write.js +4 -0
- package/dist/lib/codex-manager/api-login-menu.d.ts +14 -0
- package/dist/lib/codex-manager/api-login-menu.d.ts.map +1 -0
- package/dist/lib/codex-manager/api-login-menu.js +224 -0
- package/dist/lib/codex-manager/commands/account.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/account.js +27 -0
- package/dist/lib/codex-manager/commands/best.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/best.js +6 -2
- package/dist/lib/codex-manager/commands/check.d.ts +7 -1
- package/dist/lib/codex-manager/commands/check.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/check.js +24 -3
- package/dist/lib/codex-manager/commands/forecast.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/forecast.js +5 -1
- package/dist/lib/codex-manager/commands/report.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/report.js +5 -1
- package/dist/lib/codex-manager/commands/resets.d.ts +2 -0
- package/dist/lib/codex-manager/commands/resets.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/resets.js +67 -0
- package/dist/lib/codex-manager/commands/rotation.d.ts +2 -2
- package/dist/lib/codex-manager/commands/rotation.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/rotation.js +63 -12
- package/dist/lib/codex-manager/commands/status.d.ts +12 -1
- package/dist/lib/codex-manager/commands/status.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/status.js +166 -22
- package/dist/lib/codex-manager/commands/uninstall.js +1 -1
- package/dist/lib/codex-manager/formatters/quota-formatters.d.ts.map +1 -1
- package/dist/lib/codex-manager/formatters/quota-formatters.js +3 -2
- package/dist/lib/codex-manager/health-check.d.ts +3 -0
- package/dist/lib/codex-manager/health-check.d.ts.map +1 -1
- package/dist/lib/codex-manager/health-check.js +56 -6
- package/dist/lib/codex-manager/help.d.ts.map +1 -1
- package/dist/lib/codex-manager/help.js +4 -2
- package/dist/lib/codex-manager/login-flow.d.ts.map +1 -1
- package/dist/lib/codex-manager/login-flow.js +69 -7
- package/dist/lib/codex-manager/login-menu-data.d.ts.map +1 -1
- package/dist/lib/codex-manager/login-menu-data.js +14 -5
- package/dist/lib/codex-manager/login-oauth.d.ts +3 -0
- package/dist/lib/codex-manager/login-oauth.d.ts.map +1 -1
- package/dist/lib/codex-manager/login-oauth.js +6 -1
- package/dist/lib/codex-manager/login-workspace-choice.d.ts +11 -0
- package/dist/lib/codex-manager/login-workspace-choice.d.ts.map +1 -0
- package/dist/lib/codex-manager/login-workspace-choice.js +37 -0
- package/dist/lib/codex-manager/persist-selected-account.d.ts.map +1 -1
- package/dist/lib/codex-manager/persist-selected-account.js +2 -1
- package/dist/lib/codex-manager/repair-commands.d.ts +13 -0
- package/dist/lib/codex-manager/repair-commands.d.ts.map +1 -1
- package/dist/lib/codex-manager/repair-commands.js +143 -8
- package/dist/lib/codex-manager.d.ts.map +1 -1
- package/dist/lib/codex-manager.js +25 -6
- package/dist/lib/concurrency.d.ts +3 -0
- package/dist/lib/concurrency.d.ts.map +1 -0
- package/dist/lib/concurrency.js +31 -0
- package/dist/lib/context-budget/model-context-windows.d.ts +1 -1
- package/dist/lib/context-budget/model-context-windows.d.ts.map +1 -1
- package/dist/lib/context-budget/model-context-windows.js +9 -10
- package/dist/lib/model-route-policy.d.ts +52 -0
- package/dist/lib/model-route-policy.d.ts.map +1 -0
- package/dist/lib/model-route-policy.js +159 -0
- package/dist/lib/policy/runtime-policy.d.ts +1 -0
- package/dist/lib/policy/runtime-policy.d.ts.map +1 -1
- package/dist/lib/policy/runtime-policy.js +3 -0
- package/dist/lib/preemptive-quota-scheduler.d.ts +2 -0
- package/dist/lib/preemptive-quota-scheduler.d.ts.map +1 -1
- package/dist/lib/preemptive-quota-scheduler.js +4 -0
- package/dist/lib/prompts/codex.d.ts.map +1 -1
- package/dist/lib/prompts/codex.js +3 -1
- package/dist/lib/quota-probe.d.ts +5 -0
- package/dist/lib/quota-probe.d.ts.map +1 -1
- package/dist/lib/quota-probe.js +26 -2
- package/dist/lib/request/client-cancellation.d.ts +5 -0
- package/dist/lib/request/client-cancellation.d.ts.map +1 -0
- package/dist/lib/request/client-cancellation.js +7 -0
- package/dist/lib/request/error-classification.d.ts.map +1 -1
- package/dist/lib/request/error-classification.js +39 -25
- package/dist/lib/request/fetch-helpers.js +1 -1
- package/dist/lib/request/helpers/model-map.d.ts +12 -2
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
- package/dist/lib/request/helpers/model-map.js +174 -147
- package/dist/lib/request/response-outcome.d.ts +25 -0
- package/dist/lib/request/response-outcome.d.ts.map +1 -0
- package/dist/lib/request/response-outcome.js +49 -0
- package/dist/lib/request/stream-failover-runtime.d.ts +2 -1
- package/dist/lib/request/stream-failover-runtime.d.ts.map +1 -1
- package/dist/lib/request/stream-failover-runtime.js +29 -10
- package/dist/lib/runtime/account-check.d.ts.map +1 -1
- package/dist/lib/runtime/account-check.js +2 -8
- package/dist/lib/runtime/account-model-catalog.d.ts +64 -0
- package/dist/lib/runtime/account-model-catalog.d.ts.map +1 -0
- package/dist/lib/runtime/account-model-catalog.js +154 -0
- package/dist/lib/runtime/account-pool.d.ts +3 -1
- package/dist/lib/runtime/account-pool.d.ts.map +1 -1
- package/dist/lib/runtime/account-pool.js +4 -0
- package/dist/lib/runtime/account-reset-credits.d.ts +42 -0
- package/dist/lib/runtime/account-reset-credits.d.ts.map +1 -0
- package/dist/lib/runtime/account-reset-credits.js +82 -0
- package/dist/lib/runtime/api-model-capabilities.d.ts +30 -0
- package/dist/lib/runtime/api-model-capabilities.d.ts.map +1 -0
- package/dist/lib/runtime/api-model-capabilities.js +434 -0
- package/dist/lib/runtime/api-model-runtime.d.ts +42 -0
- package/dist/lib/runtime/api-model-runtime.d.ts.map +1 -0
- package/dist/lib/runtime/api-model-runtime.js +358 -0
- package/dist/lib/runtime/app-bind.d.ts +19 -1
- package/dist/lib/runtime/app-bind.d.ts.map +1 -1
- package/dist/lib/runtime/app-bind.js +79 -9
- package/dist/lib/runtime/automatic-account-checks.d.ts +31 -0
- package/dist/lib/runtime/automatic-account-checks.d.ts.map +1 -0
- package/dist/lib/runtime/automatic-account-checks.js +113 -0
- package/dist/lib/runtime/automatic-subscription-checks.d.ts +7 -0
- package/dist/lib/runtime/automatic-subscription-checks.d.ts.map +1 -0
- package/dist/lib/runtime/automatic-subscription-checks.js +57 -0
- package/dist/lib/runtime/catalog-capabilities.d.ts +8 -0
- package/dist/lib/runtime/catalog-capabilities.d.ts.map +1 -0
- package/dist/lib/runtime/catalog-capabilities.js +61 -0
- package/dist/lib/runtime/inference-activity.d.ts +15 -0
- package/dist/lib/runtime/inference-activity.d.ts.map +1 -0
- package/dist/lib/runtime/inference-activity.js +95 -0
- package/dist/lib/runtime/model-discovery-status.d.ts +100 -0
- package/dist/lib/runtime/model-discovery-status.d.ts.map +1 -0
- package/dist/lib/runtime/model-discovery-status.js +387 -0
- package/dist/lib/runtime/native-account-storage.d.ts +11 -0
- package/dist/lib/runtime/native-account-storage.d.ts.map +1 -0
- package/dist/lib/runtime/native-account-storage.js +50 -0
- package/dist/lib/runtime/native-account-sync.d.ts +19 -0
- package/dist/lib/runtime/native-account-sync.d.ts.map +1 -0
- package/dist/lib/runtime/native-account-sync.js +62 -0
- package/dist/lib/runtime/native-binding-lock.d.ts +3 -0
- package/dist/lib/runtime/native-binding-lock.d.ts.map +1 -0
- package/dist/lib/runtime/native-binding-lock.js +5 -0
- package/dist/lib/runtime/native-client-auth.d.ts +3 -0
- package/dist/lib/runtime/native-client-auth.d.ts.map +1 -0
- package/dist/lib/runtime/native-client-auth.js +42 -0
- package/dist/lib/runtime/native-provider-config.d.ts +4 -0
- package/dist/lib/runtime/native-provider-config.d.ts.map +1 -0
- package/dist/lib/runtime/native-provider-config.js +52 -0
- package/dist/lib/runtime/native-rate-limits.d.ts +18 -0
- package/dist/lib/runtime/native-rate-limits.d.ts.map +1 -0
- package/dist/lib/runtime/native-rate-limits.js +135 -0
- package/dist/lib/runtime/reset-credit-routing.d.ts +41 -0
- package/dist/lib/runtime/reset-credit-routing.d.ts.map +1 -0
- package/dist/lib/runtime/reset-credit-routing.js +66 -0
- package/dist/lib/runtime/reset-credits.d.ts +101 -0
- package/dist/lib/runtime/reset-credits.d.ts.map +1 -0
- package/dist/lib/runtime/reset-credits.js +162 -0
- package/dist/lib/runtime/response-output-history.d.ts +17 -0
- package/dist/lib/runtime/response-output-history.d.ts.map +1 -0
- package/dist/lib/runtime/response-output-history.js +85 -0
- package/dist/lib/runtime/responses-websocket.d.ts +31 -0
- package/dist/lib/runtime/responses-websocket.d.ts.map +1 -0
- package/dist/lib/runtime/responses-websocket.js +636 -0
- package/dist/lib/runtime/resume-picker.d.ts +41 -0
- package/dist/lib/runtime/resume-picker.d.ts.map +1 -0
- package/dist/lib/runtime/resume-picker.js +169 -0
- package/dist/lib/runtime/rotation-account-selection.d.ts +6 -0
- package/dist/lib/runtime/rotation-account-selection.d.ts.map +1 -1
- package/dist/lib/runtime/rotation-account-selection.js +63 -0
- package/dist/lib/runtime/rotation-proxy-state.d.ts +33 -0
- package/dist/lib/runtime/rotation-proxy-state.d.ts.map +1 -1
- package/dist/lib/runtime/rotation-server-types.d.ts +18 -0
- package/dist/lib/runtime/rotation-server-types.d.ts.map +1 -1
- package/dist/lib/runtime/runtime-capability-failures.d.ts +14 -0
- package/dist/lib/runtime/runtime-capability-failures.d.ts.map +1 -0
- package/dist/lib/runtime/runtime-capability-failures.js +76 -0
- package/dist/lib/runtime/runtime-observability.d.ts +7 -0
- package/dist/lib/runtime/runtime-observability.d.ts.map +1 -1
- package/dist/lib/runtime/runtime-observability.js +42 -2
- package/dist/lib/runtime/subscription-first-use.d.ts +10 -0
- package/dist/lib/runtime/subscription-first-use.d.ts.map +1 -0
- package/dist/lib/runtime/subscription-first-use.js +64 -0
- package/dist/lib/runtime/subscription-quota-event.d.ts +6 -0
- package/dist/lib/runtime/subscription-quota-event.d.ts.map +1 -0
- package/dist/lib/runtime/subscription-quota-event.js +31 -0
- package/dist/lib/runtime/subscription-quota-order.d.ts +17 -0
- package/dist/lib/runtime/subscription-quota-order.d.ts.map +1 -0
- package/dist/lib/runtime/subscription-quota-order.js +31 -0
- package/dist/lib/runtime/workspace-model-scopes.d.ts +15 -0
- package/dist/lib/runtime/workspace-model-scopes.d.ts.map +1 -0
- package/dist/lib/runtime/workspace-model-scopes.js +34 -0
- package/dist/lib/runtime-constants.d.ts +3 -0
- package/dist/lib/runtime-constants.d.ts.map +1 -1
- package/dist/lib/runtime-constants.js +5 -0
- package/dist/lib/runtime-paths.d.ts.map +1 -1
- package/dist/lib/runtime-paths.js +4 -1
- package/dist/lib/runtime-rotation-proxy.d.ts.map +1 -1
- package/dist/lib/runtime-rotation-proxy.js +855 -46
- package/dist/lib/schemas.d.ts +20 -0
- package/dist/lib/schemas.d.ts.map +1 -1
- package/dist/lib/schemas.js +3 -0
- package/dist/lib/storage/credential-sidecars.d.ts +13 -0
- package/dist/lib/storage/credential-sidecars.d.ts.map +1 -0
- package/dist/lib/storage/credential-sidecars.js +52 -0
- package/dist/lib/storage/file-lock.d.ts +9 -0
- package/dist/lib/storage/file-lock.d.ts.map +1 -0
- package/dist/lib/storage/file-lock.js +186 -0
- package/dist/lib/storage/flagged-storage.d.ts.map +1 -1
- package/dist/lib/storage/flagged-storage.js +12 -0
- package/dist/lib/storage/path-state.d.ts +2 -0
- package/dist/lib/storage/path-state.d.ts.map +1 -1
- package/dist/lib/storage/path-state.js +9 -0
- package/dist/lib/storage/paths.js +4 -4
- package/dist/lib/storage/pending-auth.d.ts +17 -0
- package/dist/lib/storage/pending-auth.d.ts.map +1 -0
- package/dist/lib/storage/pending-auth.js +153 -0
- package/dist/lib/storage/public-types.d.ts +13 -0
- package/dist/lib/storage/public-types.d.ts.map +1 -1
- package/dist/lib/storage/snapshot-merge.d.ts +16 -0
- package/dist/lib/storage/snapshot-merge.d.ts.map +1 -0
- package/dist/lib/storage/snapshot-merge.js +206 -0
- package/dist/lib/storage/transactions.d.ts.map +1 -1
- package/dist/lib/storage/transactions.js +5 -4
- package/dist/lib/storage.d.ts +6 -0
- package/dist/lib/storage.d.ts.map +1 -1
- package/dist/lib/storage.js +77 -7
- package/dist/lib/ui/auth-menu-builder.d.ts +2 -0
- package/dist/lib/ui/auth-menu-builder.d.ts.map +1 -1
- package/dist/lib/ui/auth-menu-builder.js +1 -0
- package/dist/lib/ui/auth-menu.d.ts.map +1 -1
- package/dist/lib/ui/auth-menu.js +1 -0
- package/dist/lib/ui/check-progress.d.ts +8 -0
- package/dist/lib/ui/check-progress.d.ts.map +1 -0
- package/dist/lib/ui/check-progress.js +30 -0
- package/dist/lib/ui/format.d.ts +3 -1
- package/dist/lib/ui/format.d.ts.map +1 -1
- package/dist/lib/ui/format.js +8 -0
- package/dist/lib/ui/ui-copy.d.ts +2 -2
- package/dist/lib/ui/ui-copy.js +2 -2
- package/dist/lib/usage/pricing.d.ts +19 -2
- package/dist/lib/usage/pricing.d.ts.map +1 -1
- package/dist/lib/usage/pricing.js +101 -40
- package/dist/lib/usage/usage-extraction.d.ts +3 -1
- package/dist/lib/usage/usage-extraction.d.ts.map +1 -1
- package/dist/lib/usage/usage-extraction.js +46 -9
- package/package.json +7 -4
- package/scripts/codex-app-router.js +7 -0
- package/scripts/codex-bin-resolver.js +40 -8
- package/scripts/codex-routing.js +1 -0
- package/scripts/codex.js +209 -126
package/dist/lib/schemas.d.ts
CHANGED
|
@@ -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
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../lib/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,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AAsB,GAAG,IAAI,CAM/B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,OAAO,GACX,2BAA2B,GAAG,IAAI,CAMpC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,OAAO,GACX,0BAA0B,GAAG,IAAI,CAMnC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,OAAO,GACX,qBAAqB,GAAG,IAAI,CAM9B;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,OAAO,GACX,4BAA4B,GAAG,IAAI,CAMrC;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC/C,IAAI,EAAE,OAAO,GACX,iCAAiC,GAAG,IAAI,CAM1C;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC5C,IAAI,EAAE,OAAO,GACX,8BAA8B,GAAG,IAAI,CAMvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC9B,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,SAAkB,GACvB,CAAC,GAAG,IAAI,CA8BV;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,CAAC,CAAC,OAAO,EACjB,IAAI,EAAE,OAAO,GACX,MAAM,EAAE,CASV"}
|
package/dist/lib/schemas.js
CHANGED
|
@@ -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,
|
|
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 =
|
|
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 =
|
|
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 =
|
|
272
|
-
if (!existsSync(
|
|
271
|
+
const candidateRepoRoot = resolveGitPath(commonGitDir, "..");
|
|
272
|
+
if (!existsSync(resolveGitPath(candidateRepoRoot, ".git"))) {
|
|
273
273
|
return projectRoot;
|
|
274
274
|
}
|
|
275
275
|
return candidateRepoRoot;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
refreshToken: string;
|
|
7
|
+
accessToken: string;
|
|
8
|
+
expiresAt: number;
|
|
9
|
+
at: number;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
/** Overlay pending rotated credentials on rows that still hold the spent token. */
|
|
12
|
+
export declare function applyPendingAuth(storagePath: string, storage: AccountStorageV3 | null): Promise<AccountStorageV3 | null>;
|
|
13
|
+
/** After a save, drop entries whose spent token is no longer on disk (persisted or superseded). */
|
|
14
|
+
export declare function prunePendingAuth(storagePath: string, saved: AccountStorageV3): Promise<void>;
|
|
15
|
+
/** Coordinate resets with pending credential writers, including Windows rename locks. */
|
|
16
|
+
export declare function clearPendingAuth(storagePath: string): Promise<void>;
|
|
17
|
+
//# 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;AAyB1D,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,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC3G,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,CA4BlC;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,153 @@
|
|
|
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
|
+
refreshToken: z.string().min(1),
|
|
21
|
+
accessToken: z.string().min(1),
|
|
22
|
+
expiresAt: z.number(),
|
|
23
|
+
at: z.number(),
|
|
24
|
+
});
|
|
25
|
+
/** The writer keeps the journal at this size; the reader accepts any size so an
|
|
26
|
+
* over-cap file an earlier writer left behind still loads and is trimmed on the next write. */
|
|
27
|
+
const MAX_ENTRIES = 1000;
|
|
28
|
+
const fileSchema = z.object({ version: z.literal(1), entries: z.array(entrySchema) });
|
|
29
|
+
const retry = { maxAttempts: 6, backoffMs: 25 };
|
|
30
|
+
const log = createLogger("pending-auth");
|
|
31
|
+
export function getPendingAuthPath(storagePath) {
|
|
32
|
+
return `${storagePath}.pending-auth.json`;
|
|
33
|
+
}
|
|
34
|
+
const hash = (token) => createHash("sha256").update(token).digest("hex");
|
|
35
|
+
/**
|
|
36
|
+
* Only a missing file is empty. The entries are the only copy of rotated
|
|
37
|
+
* tokens, so a lock that outlasts the retries or a torn/corrupt file throws:
|
|
38
|
+
* a writer must never replace it with a partial list.
|
|
39
|
+
*/
|
|
40
|
+
async function read(path) {
|
|
41
|
+
let raw;
|
|
42
|
+
try {
|
|
43
|
+
raw = await withRetry(() => fs.readFile(path, "utf8"), retry);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error.code === "ENOENT")
|
|
47
|
+
return [];
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
return fileSchema.parse(JSON.parse(raw)).entries;
|
|
51
|
+
}
|
|
52
|
+
async function write(path, entries) {
|
|
53
|
+
if (!entries.length) {
|
|
54
|
+
await withRetry(() => fs.rm(path, { force: true }), retry);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
await fs.mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
58
|
+
const temp = tempPathFor(path);
|
|
59
|
+
try {
|
|
60
|
+
await fs.writeFile(temp, `${JSON.stringify({ version: 1, entries })}\n`, { mode: 0o600, flag: "wx" });
|
|
61
|
+
await withRetry(() => fs.rename(temp, path), retry);
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
await fs.rm(temp, { force: true }).catch(() => undefined);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Record a rotated credential beside the account pool. */
|
|
68
|
+
export async function recordPendingAuth(storagePath, auth) {
|
|
69
|
+
const path = getPendingAuthPath(storagePath);
|
|
70
|
+
await withFileTransactionLock(path, async () => {
|
|
71
|
+
try {
|
|
72
|
+
await fs.stat(getIntentionalResetMarkerPath(storagePath));
|
|
73
|
+
throw Object.assign(new Error("Account pool was reset; rotated credentials were not retained."), { code: "ESTALE" });
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
if (error.code !== "ENOENT")
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
const prior = hash(auth.priorRefreshToken);
|
|
80
|
+
const entries = (await read(path)).filter((entry) => entry.prior !== prior && entry.prior !== hash(auth.refreshToken));
|
|
81
|
+
// Rotating a token that is itself only journaled: the row on disk still holds
|
|
82
|
+
// the original spent token, so extend that entry rather than add one that
|
|
83
|
+
// no disk row can match.
|
|
84
|
+
const chained = entries.find((entry) => entry.refreshToken === auth.priorRefreshToken);
|
|
85
|
+
const current = chained ?? { prior, refreshToken: auth.refreshToken, accessToken: auth.accessToken, expiresAt: auth.expiresAt, at: auth.at };
|
|
86
|
+
if (chained)
|
|
87
|
+
Object.assign(chained, { refreshToken: auth.refreshToken, accessToken: auth.accessToken, expiresAt: auth.expiresAt, at: auth.at });
|
|
88
|
+
else
|
|
89
|
+
entries.push(current);
|
|
90
|
+
const excess = entries.length - MAX_ENTRIES;
|
|
91
|
+
if (excess > 0) {
|
|
92
|
+
// Drop the oldest other entries, never the credential being recorded now.
|
|
93
|
+
const dropped = new Set(entries.filter((entry) => entry !== current).sort((a, b) => a.at - b.at).slice(0, excess));
|
|
94
|
+
log.warn("Pending rotated credentials exceeded the journal cap; dropped the oldest entries", { dropped: dropped.size });
|
|
95
|
+
await write(path, entries.filter((entry) => !dropped.has(entry)));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
await write(path, entries);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/** Overlay pending rotated credentials on rows that still hold the spent token. */
|
|
102
|
+
export async function applyPendingAuth(storagePath, storage) {
|
|
103
|
+
if (!storage)
|
|
104
|
+
return storage;
|
|
105
|
+
let entries;
|
|
106
|
+
try {
|
|
107
|
+
entries = await read(getPendingAuthPath(storagePath));
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
// Loading must still work; the file is left untouched for a later load.
|
|
111
|
+
log.error("Pending rotated credentials could not be read; affected accounts may need a re-login if this persists", {
|
|
112
|
+
path: getPendingAuthPath(storagePath),
|
|
113
|
+
code: typeof error.code === "string" && /^[A-Z_]{1,40}$/.test(error.code ?? "") ? error.code : "INVALID_PENDING_AUTH",
|
|
114
|
+
});
|
|
115
|
+
return storage;
|
|
116
|
+
}
|
|
117
|
+
if (!entries.length)
|
|
118
|
+
return storage;
|
|
119
|
+
for (const account of storage.accounts) {
|
|
120
|
+
const entry = account.refreshToken ? entries.find((item) => item.prior === hash(account.refreshToken)) : undefined;
|
|
121
|
+
if (!entry)
|
|
122
|
+
continue;
|
|
123
|
+
account.refreshToken = entry.refreshToken;
|
|
124
|
+
account.accessToken = entry.accessToken;
|
|
125
|
+
account.expiresAt = entry.expiresAt;
|
|
126
|
+
delete account.authInvalidatedAt;
|
|
127
|
+
delete account.authInvalidationErrorCode;
|
|
128
|
+
if (account.cooldownReason === "auth-failure") {
|
|
129
|
+
delete account.coolingDownUntil;
|
|
130
|
+
delete account.cooldownReason;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return storage;
|
|
134
|
+
}
|
|
135
|
+
/** After a save, drop entries whose spent token is no longer on disk (persisted or superseded). */
|
|
136
|
+
export async function prunePendingAuth(storagePath, saved) {
|
|
137
|
+
const path = getPendingAuthPath(storagePath);
|
|
138
|
+
const current = await read(path);
|
|
139
|
+
if (!current.length)
|
|
140
|
+
return;
|
|
141
|
+
await withFileTransactionLock(path, async () => {
|
|
142
|
+
const spent = new Set(saved.accounts.map((account) => hash(account.refreshToken)));
|
|
143
|
+
const entries = await read(path);
|
|
144
|
+
const remaining = entries.filter((entry) => spent.has(entry.prior));
|
|
145
|
+
if (remaining.length !== entries.length)
|
|
146
|
+
await write(path, remaining);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/** Coordinate resets with pending credential writers, including Windows rename locks. */
|
|
150
|
+
export async function clearPendingAuth(storagePath) {
|
|
151
|
+
const path = getPendingAuthPath(storagePath);
|
|
152
|
+
await withFileTransactionLock(path, () => withRetry(() => fs.rm(path, { force: true }), retry));
|
|
153
|
+
}
|
|
@@ -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;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EACd,YAAY,GACZ,SAAS,GACT,UAAU,GACV,MAAM,GACN,SAAS,GACT,QAAQ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