codex-multi-auth 2.17.2 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +86 -425
- package/config/README.md +1 -1
- package/config/codex-legacy.json +12 -212
- package/config/codex-modern.json +4 -80
- package/config/minimal-codex.json +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/lib/account-policy.d.ts +18 -2
- package/dist/lib/account-policy.js +97 -40
- package/dist/lib/accounts/rate-limits.d.ts +0 -1
- package/dist/lib/accounts.d.ts +0 -1
- package/dist/lib/accounts.js +4 -5
- package/dist/lib/api-route-store.d.ts +0 -1
- package/dist/lib/audit.d.ts +0 -1
- package/dist/lib/audit.js +43 -12
- package/dist/lib/auth/account-access.d.ts +0 -1
- package/dist/lib/auth/account-access.js +5 -1
- package/dist/lib/auth/auth.d.ts +4 -3
- package/dist/lib/auth/auth.js +220 -28
- package/dist/lib/auth/browser.d.ts +0 -1
- package/dist/lib/auth/callback-guidance.d.ts +0 -1
- package/dist/lib/auth/device-auth.d.ts +0 -1
- package/dist/lib/auth/index.d.ts +0 -1
- package/dist/lib/auth/org-override.d.ts +0 -1
- package/dist/lib/auth/server.d.ts +1 -2
- package/dist/lib/auth/server.js +100 -53
- package/dist/lib/auth/token-utils.d.ts +0 -1
- package/dist/lib/auth-rate-limit.d.ts +0 -1
- package/dist/lib/budget-guard.d.ts +16 -2
- package/dist/lib/budget-guard.js +123 -43
- package/dist/lib/capability-policy.d.ts +0 -1
- package/dist/lib/circuit-breaker.d.ts +20 -1
- package/dist/lib/circuit-breaker.js +24 -5
- package/dist/lib/cli.d.ts +0 -1
- package/dist/lib/codex-cli/index.d.ts +0 -1
- package/dist/lib/codex-cli/observability.d.ts +0 -1
- package/dist/lib/codex-cli/state.d.ts +0 -1
- package/dist/lib/codex-cli/sync.d.ts +0 -1
- package/dist/lib/codex-cli/writer.d.ts +0 -1
- package/dist/lib/codex-manager/account-credentials.d.ts +0 -1
- package/dist/lib/codex-manager/account-manager-commands.d.ts +0 -1
- package/dist/lib/codex-manager/account-pool-write.d.ts +0 -1
- package/dist/lib/codex-manager/active-account-sync.d.ts +6 -0
- package/dist/lib/codex-manager/active-account-sync.js +336 -0
- package/dist/lib/codex-manager/api-login-menu.d.ts +0 -1
- package/dist/lib/codex-manager/backend-category-entry.d.ts +0 -1
- package/dist/lib/codex-manager/backend-category-helpers.d.ts +0 -1
- package/dist/lib/codex-manager/backend-category-prompt.d.ts +0 -1
- package/dist/lib/codex-manager/backend-settings-controller.d.ts +0 -1
- package/dist/lib/codex-manager/backend-settings-entry.d.ts +0 -1
- package/dist/lib/codex-manager/backend-settings-helpers.d.ts +0 -1
- package/dist/lib/codex-manager/backend-settings-prompt.d.ts +0 -1
- package/dist/lib/codex-manager/backend-settings-schema.d.ts +0 -1
- package/dist/lib/codex-manager/behavior-settings-panel.d.ts +0 -1
- package/dist/lib/codex-manager/commands/account.d.ts +8 -3
- package/dist/lib/codex-manager/commands/account.js +46 -34
- package/dist/lib/codex-manager/commands/best.d.ts +0 -1
- package/dist/lib/codex-manager/commands/bridge.d.ts +0 -1
- package/dist/lib/codex-manager/commands/budget.d.ts +8 -3
- package/dist/lib/codex-manager/commands/budget.js +6 -4
- package/dist/lib/codex-manager/commands/check.d.ts +0 -1
- package/dist/lib/codex-manager/commands/config-explain.d.ts +0 -1
- package/dist/lib/codex-manager/commands/debug-bundle.d.ts +0 -1
- package/dist/lib/codex-manager/commands/forecast.d.ts +0 -1
- package/dist/lib/codex-manager/commands/history.d.ts +0 -1
- package/dist/lib/codex-manager/commands/init-config.d.ts +0 -1
- package/dist/lib/codex-manager/commands/integrations.d.ts +0 -1
- package/dist/lib/codex-manager/commands/limits.d.ts +0 -1
- package/dist/lib/codex-manager/commands/models.d.ts +0 -1
- package/dist/lib/codex-manager/commands/monitor.d.ts +0 -1
- package/dist/lib/codex-manager/commands/report.d.ts +0 -1
- package/dist/lib/codex-manager/commands/resets.d.ts +0 -1
- package/dist/lib/codex-manager/commands/resets.js +9 -1
- package/dist/lib/codex-manager/commands/rotation.d.ts +0 -1
- package/dist/lib/codex-manager/commands/status.d.ts +0 -1
- package/dist/lib/codex-manager/commands/switch.d.ts +0 -1
- package/dist/lib/codex-manager/commands/uninstall.d.ts +0 -1
- package/dist/lib/codex-manager/commands/unpin.d.ts +0 -1
- package/dist/lib/codex-manager/commands/usage.d.ts +0 -1
- package/dist/lib/codex-manager/commands/verify.d.ts +0 -1
- package/dist/lib/codex-manager/commands/why-selected.d.ts +0 -1
- package/dist/lib/codex-manager/commands/workspace.d.ts +0 -1
- package/dist/lib/codex-manager/dashboard-display-panel.d.ts +0 -1
- package/dist/lib/codex-manager/dashboard-formatters.d.ts +0 -1
- package/dist/lib/codex-manager/dashboard-settings-controller.d.ts +0 -1
- package/dist/lib/codex-manager/dashboard-settings-data.d.ts +0 -1
- package/dist/lib/codex-manager/dashboard-settings-entry.d.ts +0 -1
- package/dist/lib/codex-manager/experimental-settings-entry.d.ts +0 -1
- package/dist/lib/codex-manager/experimental-settings-prompt.d.ts +0 -1
- package/dist/lib/codex-manager/experimental-settings-schema.d.ts +0 -1
- package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts +0 -1
- package/dist/lib/codex-manager/experimental-sync-target.d.ts +0 -1
- package/dist/lib/codex-manager/forecast-report-shared.d.ts +0 -1
- package/dist/lib/codex-manager/formatters/account-formatters.d.ts +0 -1
- package/dist/lib/codex-manager/formatters/index.d.ts +0 -1
- package/dist/lib/codex-manager/formatters/model-formatters.d.ts +0 -1
- package/dist/lib/codex-manager/formatters/quota-formatters.d.ts +0 -1
- package/dist/lib/codex-manager/formatters/text-style.d.ts +0 -1
- package/dist/lib/codex-manager/health-check.d.ts +0 -1
- package/dist/lib/codex-manager/help.d.ts +0 -1
- package/dist/lib/codex-manager/login-action-panel.d.ts +0 -1
- package/dist/lib/codex-manager/login-flow.d.ts +0 -1
- package/dist/lib/codex-manager/login-menu-actions.d.ts +0 -1
- package/dist/lib/codex-manager/login-menu-data.d.ts +0 -1
- package/dist/lib/codex-manager/login-oauth.d.ts +0 -1
- package/dist/lib/codex-manager/login-workspace-choice.d.ts +0 -1
- package/dist/lib/codex-manager/manual-callback.d.ts +0 -1
- package/dist/lib/codex-manager/persist-selected-account.d.ts +0 -1
- package/dist/lib/codex-manager/quota-cache-helpers.d.ts +0 -1
- package/dist/lib/codex-manager/rate-limit-markers.d.ts +0 -1
- package/dist/lib/codex-manager/repair-commands.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub/backend.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub/experimental.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub/index.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub/shared.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub-entry.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub-menu.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub-prompt.d.ts +0 -1
- package/dist/lib/codex-manager/settings-hub.d.ts +0 -1
- package/dist/lib/codex-manager/settings-panels.d.ts +0 -1
- package/dist/lib/codex-manager/settings-persist-utils.d.ts +0 -1
- package/dist/lib/codex-manager/settings-preview.d.ts +0 -1
- package/dist/lib/codex-manager/settings-write-queue.d.ts +0 -1
- package/dist/lib/codex-manager/statusline-settings-panel.d.ts +0 -1
- package/dist/lib/codex-manager/theme-settings-panel.d.ts +0 -1
- package/dist/lib/codex-manager/unified-settings-controller.d.ts +0 -1
- package/dist/lib/codex-manager/unified-settings-entry.d.ts +0 -1
- package/dist/lib/codex-manager.d.ts +1 -2
- package/dist/lib/codex-manager.js +5 -95
- package/dist/lib/concurrency.d.ts +0 -1
- package/dist/lib/config-schema.d.ts +0 -1
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +46 -241
- package/dist/lib/constants.d.ts +0 -1
- package/dist/lib/context-budget/model-context-windows.d.ts +1 -2
- package/dist/lib/context-budget/model-context-windows.js +10 -13
- package/dist/lib/context-budget-guard.d.ts +0 -1
- package/dist/lib/context-budget-response.d.ts +0 -1
- package/dist/lib/context-overflow.d.ts +0 -1
- package/dist/lib/dashboard-settings.d.ts +0 -1
- package/dist/lib/entitlement-cache.d.ts +0 -1
- package/dist/lib/env-parsing.d.ts +13 -1
- package/dist/lib/env-parsing.js +21 -0
- package/dist/lib/errors.d.ts +0 -1
- package/dist/lib/forecast.d.ts +0 -1
- package/dist/lib/fs-retry.d.ts +0 -1
- package/dist/lib/health.d.ts +0 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/integration-generators.d.ts +0 -1
- package/dist/lib/live-account-sync.d.ts +0 -1
- package/dist/lib/local-bridge.d.ts +0 -1
- package/dist/lib/local-bridge.js +4 -1
- package/dist/lib/local-client-tokens.d.ts +0 -1
- package/dist/lib/local-client-tokens.js +125 -30
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +11 -1
- package/dist/lib/model-capability-matrix.d.ts +0 -1
- package/dist/lib/model-route-policy.d.ts +1 -2
- package/dist/lib/named-backup-export.d.ts +0 -1
- package/dist/lib/oc-chatgpt-import-adapter.d.ts +0 -1
- package/dist/lib/oc-chatgpt-orchestrator.d.ts +0 -1
- package/dist/lib/oc-chatgpt-target-detection.d.ts +3 -3
- package/dist/lib/oc-chatgpt-target-detection.js +40 -13
- package/dist/lib/parallel-probe.d.ts +0 -1
- package/dist/lib/policy/runtime-policy-cache.d.ts +80 -0
- package/dist/lib/policy/runtime-policy-cache.js +310 -0
- package/dist/lib/policy/runtime-policy.d.ts +1 -2
- package/dist/lib/policy/runtime-policy.js +46 -19
- package/dist/lib/preemptive-quota-scheduler.d.ts +0 -1
- package/dist/lib/proactive-refresh.d.ts +0 -1
- package/dist/lib/prompts/codex-host-bridge.d.ts +0 -1
- package/dist/lib/prompts/codex.d.ts +0 -1
- package/dist/lib/prompts/fetch-utils.d.ts +0 -1
- package/dist/lib/prompts/host-codex-prompt.d.ts +0 -1
- package/dist/lib/quota-cache.d.ts +0 -1
- package/dist/lib/quota-cache.js +60 -36
- package/dist/lib/quota-probe.d.ts +0 -1
- package/dist/lib/quota-probe.js +5 -2
- package/dist/lib/quota-readiness.d.ts +0 -1
- package/dist/lib/recovery/constants.d.ts +0 -1
- package/dist/lib/recovery/storage.d.ts +0 -1
- package/dist/lib/recovery/types.d.ts +0 -1
- package/dist/lib/recovery.d.ts +0 -1
- package/dist/lib/redaction.d.ts +0 -1
- package/dist/lib/refresh-guardian.d.ts +0 -1
- package/dist/lib/refresh-lease.d.ts +0 -1
- package/dist/lib/refresh-queue.d.ts +0 -1
- package/dist/lib/request/client-cancellation.d.ts +0 -1
- package/dist/lib/request/error-classification.d.ts +0 -1
- package/dist/lib/request/error-classification.js +41 -52
- package/dist/lib/request/failover-config.d.ts +0 -1
- package/dist/lib/request/failure-policy.d.ts +0 -1
- package/dist/lib/request/fetch-helpers.d.ts +0 -1
- package/dist/lib/request/fetch-helpers.js +1 -1
- package/dist/lib/request/headers.d.ts +0 -1
- package/dist/lib/request/helpers/input-utils.d.ts +0 -1
- package/dist/lib/request/helpers/input-utils.js +88 -34
- package/dist/lib/request/helpers/model-map.d.ts +2 -3
- package/dist/lib/request/helpers/model-map.js +120 -78
- package/dist/lib/request/helpers/tool-utils.d.ts +0 -1
- package/dist/lib/request/helpers/tool-utils.js +421 -4
- package/dist/lib/request/index.d.ts +0 -1
- package/dist/lib/request/rate-limit-backoff.d.ts +0 -1
- package/dist/lib/request/rate-limit-decision.d.ts +0 -1
- package/dist/lib/request/request-attempt-budget.d.ts +0 -1
- package/dist/lib/request/request-init.d.ts +0 -1
- package/dist/lib/request/request-resilience.d.ts +0 -1
- package/dist/lib/request/request-transformer.d.ts +1 -2
- package/dist/lib/request/request-transformer.js +51 -26
- package/dist/lib/request/response-compaction.d.ts +0 -1
- package/dist/lib/request/response-handler.d.ts +0 -1
- package/dist/lib/request/response-metadata.d.ts +0 -1
- package/dist/lib/request/response-outcome.d.ts +0 -1
- package/dist/lib/request/stream-failover-runtime.d.ts +0 -1
- package/dist/lib/request/stream-failover.d.ts +0 -1
- package/dist/lib/request/stream-failover.js +28 -4
- package/dist/lib/request/token-refresh.d.ts +0 -1
- package/dist/lib/request/url-rewriting.d.ts +0 -1
- package/dist/lib/request/wait-utils.d.ts +0 -1
- package/dist/lib/rotation.d.ts +0 -1
- package/dist/lib/routing-mutex.d.ts +0 -1
- package/dist/lib/routing-profiles.d.ts +16 -2
- package/dist/lib/routing-profiles.js +119 -44
- package/dist/lib/runtime/account-check-helpers.d.ts +0 -1
- package/dist/lib/runtime/account-check-types.d.ts +0 -1
- package/dist/lib/runtime/account-check.d.ts +0 -1
- package/dist/lib/runtime/account-manager-cache-entry.d.ts +0 -1
- package/dist/lib/runtime/account-manager-cache.d.ts +0 -1
- package/dist/lib/runtime/account-model-catalog.d.ts +1 -2
- package/dist/lib/runtime/account-pool.d.ts +0 -1
- package/dist/lib/runtime/account-reset-credits.d.ts +0 -1
- package/dist/lib/runtime/account-reset-credits.js +8 -2
- package/dist/lib/runtime/account-scope.d.ts +0 -1
- package/dist/lib/runtime/account-select-event.d.ts +0 -1
- package/dist/lib/runtime/account-selection.d.ts +0 -1
- package/dist/lib/runtime/account-state.d.ts +0 -1
- package/dist/lib/runtime/account-status.d.ts +0 -1
- package/dist/lib/runtime/account-storage-scope-entry.d.ts +0 -1
- package/dist/lib/runtime/api-model-capabilities.d.ts +0 -1
- package/dist/lib/runtime/api-model-runtime.d.ts +0 -1
- package/dist/lib/runtime/app-bind.d.ts +0 -1
- package/dist/lib/runtime/app-helper-selection.d.ts +0 -1
- package/dist/lib/runtime/auth-facade.d.ts +0 -1
- package/dist/lib/runtime/automatic-account-checks.d.ts +0 -1
- package/dist/lib/runtime/automatic-subscription-checks.d.ts +0 -1
- package/dist/lib/runtime/browser-oauth-flow.d.ts +0 -1
- package/dist/lib/runtime/capability-boost.d.ts +0 -1
- package/dist/lib/runtime/catalog-capabilities.d.ts +0 -1
- package/dist/lib/runtime/config-toml.d.ts +0 -1
- package/dist/lib/runtime/context-budget-settings.d.ts +0 -1
- package/dist/lib/runtime/event-handler.d.ts +0 -1
- package/dist/lib/runtime/first-run.d.ts +0 -1
- package/dist/lib/runtime/flagged-verify-types.d.ts +0 -1
- package/dist/lib/runtime/hydrate-emails.d.ts +0 -1
- package/dist/lib/runtime/inference-activity.d.ts +0 -1
- package/dist/lib/runtime/live-sync-entry.d.ts +0 -1
- package/dist/lib/runtime/live-sync.d.ts +0 -1
- package/dist/lib/runtime/loader-setup.d.ts +0 -1
- package/dist/lib/runtime/login-menu-accounts.d.ts +0 -1
- package/dist/lib/runtime/manual-oauth-flow.d.ts +0 -1
- package/dist/lib/runtime/model-discovery-status.d.ts +0 -1
- package/dist/lib/runtime/native-account-storage.d.ts +0 -1
- package/dist/lib/runtime/native-account-sync.d.ts +0 -1
- package/dist/lib/runtime/native-binding-lock.d.ts +0 -1
- package/dist/lib/runtime/native-client-auth.d.ts +0 -1
- package/dist/lib/runtime/native-provider-config.d.ts +0 -1
- package/dist/lib/runtime/native-rate-limits.d.ts +2 -1
- package/dist/lib/runtime/native-rate-limits.js +23 -6
- package/dist/lib/runtime/preemptive-quota.d.ts +0 -1
- package/dist/lib/runtime/quota-headers.d.ts +0 -1
- package/dist/lib/runtime/quota-probe.d.ts +0 -1
- package/dist/lib/runtime/quota-settings.d.ts +0 -1
- package/dist/lib/runtime/refresh-guardian-entry.d.ts +0 -1
- package/dist/lib/runtime/refresh-guardian.d.ts +0 -1
- package/dist/lib/runtime/request-init.d.ts +0 -1
- package/dist/lib/runtime/reset-credit-routing.d.ts +0 -1
- package/dist/lib/runtime/reset-credits.d.ts +0 -1
- package/dist/lib/runtime/response-output-history.d.ts +0 -1
- package/dist/lib/runtime/responses-websocket.d.ts +0 -1
- package/dist/lib/runtime/resume-picker.d.ts +0 -1
- package/dist/lib/runtime/rotation-account-selection.d.ts +0 -1
- package/dist/lib/runtime/rotation-proxy-state.d.ts +0 -1
- package/dist/lib/runtime/rotation-server-types.d.ts +0 -1
- package/dist/lib/runtime/rotation-storage-meta.d.ts +0 -1
- package/dist/lib/runtime/rotation-token-refresh.d.ts +0 -1
- package/dist/lib/runtime/runtime-capability-failures.d.ts +0 -1
- package/dist/lib/runtime/runtime-current-account.d.ts +0 -1
- package/dist/lib/runtime/runtime-observability.d.ts +0 -1
- package/dist/lib/runtime/runtime-services.d.ts +0 -1
- package/dist/lib/runtime/session-affinity-entry.d.ts +0 -1
- package/dist/lib/runtime/session-recovery.d.ts +0 -1
- package/dist/lib/runtime/status-marker.d.ts +0 -1
- package/dist/lib/runtime/storage-scope.d.ts +0 -1
- package/dist/lib/runtime/subscription-first-use.d.ts +0 -1
- package/dist/lib/runtime/subscription-quota-event.d.ts +0 -1
- package/dist/lib/runtime/subscription-quota-order.d.ts +0 -1
- package/dist/lib/runtime/toast.d.ts +0 -1
- package/dist/lib/runtime/ui-runtime-entry.d.ts +0 -1
- package/dist/lib/runtime/ui-runtime.d.ts +0 -1
- package/dist/lib/runtime/verify-flagged.d.ts +0 -1
- package/dist/lib/runtime/workspace-model-scopes.d.ts +0 -1
- package/dist/lib/runtime-constants.d.ts +0 -1
- package/dist/lib/runtime-paths.d.ts +0 -1
- package/dist/lib/runtime-rotation-proxy.d.ts +1 -1
- package/dist/lib/runtime-rotation-proxy.js +133 -0
- package/dist/lib/schemas.d.ts +35 -13
- package/dist/lib/schemas.js +19 -2
- package/dist/lib/session-affinity.d.ts +0 -1
- package/dist/lib/shutdown.d.ts +0 -1
- package/dist/lib/storage/account-clear-entry.d.ts +0 -1
- package/dist/lib/storage/account-clear.d.ts +0 -1
- package/dist/lib/storage/account-match-utils.d.ts +0 -1
- package/dist/lib/storage/account-persistence.d.ts +0 -1
- package/dist/lib/storage/account-port.d.ts +0 -1
- package/dist/lib/storage/account-save-entry.d.ts +0 -1
- package/dist/lib/storage/account-save.d.ts +9 -2
- package/dist/lib/storage/account-save.js +4 -1
- package/dist/lib/storage/account-snapshot.d.ts +0 -1
- package/dist/lib/storage/backup-metadata-builder.d.ts +0 -1
- package/dist/lib/storage/backup-metadata.d.ts +0 -1
- package/dist/lib/storage/backup-paths.d.ts +0 -1
- package/dist/lib/storage/backup-restore.d.ts +0 -1
- package/dist/lib/storage/cache-artifacts.d.ts +0 -1
- package/dist/lib/storage/credential-sidecars.d.ts +0 -1
- package/dist/lib/storage/error-hints.d.ts +0 -1
- package/dist/lib/storage/file-lock.d.ts +0 -1
- package/dist/lib/storage/file-lock.js +33 -1
- package/dist/lib/storage/file-paths.d.ts +0 -1
- package/dist/lib/storage/fixture-guards.d.ts +0 -1
- package/dist/lib/storage/flagged-entry.d.ts +0 -1
- package/dist/lib/storage/flagged-load-entry.d.ts +0 -1
- package/dist/lib/storage/flagged-save-entry.d.ts +0 -1
- package/dist/lib/storage/flagged-storage-file.d.ts +0 -1
- package/dist/lib/storage/flagged-storage-io.d.ts +0 -1
- package/dist/lib/storage/flagged-storage.d.ts +0 -1
- package/dist/lib/storage/gitignore.d.ts +0 -1
- package/dist/lib/storage/hash.d.ts +0 -1
- package/dist/lib/storage/health.d.ts +0 -1
- package/dist/lib/storage/identity.d.ts +0 -1
- package/dist/lib/storage/import-export.d.ts +0 -1
- package/dist/lib/storage/json-store-lock.d.ts +105 -0
- package/dist/lib/storage/json-store-lock.js +259 -0
- package/dist/lib/storage/metadata-section.d.ts +0 -1
- package/dist/lib/storage/migrations.d.ts +0 -1
- package/dist/lib/storage/migrations.js +31 -18
- package/dist/lib/storage/named-backup-entry.d.ts +0 -1
- package/dist/lib/storage/named-backups-entry.d.ts +0 -1
- package/dist/lib/storage/named-backups.d.ts +0 -1
- package/dist/lib/storage/path-state.d.ts +0 -1
- package/dist/lib/storage/paths.d.ts +0 -1
- package/dist/lib/storage/pending-auth.d.ts +9 -3
- package/dist/lib/storage/pending-auth.js +30 -8
- package/dist/lib/storage/project-migration.d.ts +0 -1
- package/dist/lib/storage/public-types.d.ts +0 -1
- package/dist/lib/storage/record-identity.d.ts +0 -1
- package/dist/lib/storage/record-utils.d.ts +0 -1
- package/dist/lib/storage/restore-assessment.d.ts +0 -1
- package/dist/lib/storage/restore-backup-entry.d.ts +0 -1
- package/dist/lib/storage/restore-metadata.d.ts +0 -1
- package/dist/lib/storage/save-retry.d.ts +0 -1
- package/dist/lib/storage/snapshot-inspectors.d.ts +0 -1
- package/dist/lib/storage/snapshot-merge.d.ts +0 -1
- package/dist/lib/storage/storage-parser.d.ts +2 -1
- package/dist/lib/storage/storage-parser.js +10 -2
- package/dist/lib/storage/transactions.d.ts +0 -1
- package/dist/lib/storage.d.ts +15 -2
- package/dist/lib/storage.js +612 -25
- package/dist/lib/synthetic-response.d.ts +0 -1
- package/dist/lib/table-formatter.d.ts +0 -1
- package/dist/lib/temp-path.d.ts +0 -1
- package/dist/lib/tools/hashline-tools.d.ts +0 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/ui/ansi.d.ts +0 -1
- package/dist/lib/ui/auth-menu-builder.d.ts +0 -1
- package/dist/lib/ui/auth-menu.d.ts +0 -1
- package/dist/lib/ui/check-progress.d.ts +0 -1
- package/dist/lib/ui/confirm.d.ts +0 -1
- package/dist/lib/ui/display-width.d.ts +0 -1
- package/dist/lib/ui/format.d.ts +0 -1
- package/dist/lib/ui/index.d.ts +0 -1
- package/dist/lib/ui/runtime.d.ts +0 -1
- package/dist/lib/ui/select.d.ts +0 -1
- package/dist/lib/ui/theme.d.ts +0 -1
- package/dist/lib/ui/ui-copy.d.ts +1 -2
- package/dist/lib/ui/ui-copy.js +1 -1
- package/dist/lib/unified-settings.d.ts +13 -11
- package/dist/lib/unified-settings.js +22 -14
- package/dist/lib/update-notice.d.ts +0 -1
- package/dist/lib/usage/index.d.ts +0 -1
- package/dist/lib/usage/ledger.d.ts +0 -1
- package/dist/lib/usage/pricing.d.ts +1 -2
- package/dist/lib/usage/pricing.js +41 -16
- package/dist/lib/usage/redaction.d.ts +0 -1
- package/dist/lib/usage/stream-usage-deferral.d.ts +0 -1
- package/dist/lib/usage/types.d.ts +0 -1
- package/dist/lib/usage/usage-extraction.d.ts +0 -1
- package/dist/lib/utils.d.ts +21 -1
- package/dist/lib/utils.js +31 -0
- package/dist/lib/wsl.d.ts +0 -1
- package/package.json +11 -5
- package/scripts/codex-bin-resolver.js +20 -1
- package/scripts/codex-multi-auth.js +7 -1
- package/scripts/codex.js +385 -89
- package/skills/codex-auth-setup/SKILL.md +73 -0
|
@@ -29,4 +29,3 @@ export declare function buildTableRow(values: string[], options: TableOptions):
|
|
|
29
29
|
* Build a complete table with header, separator, and rows.
|
|
30
30
|
*/
|
|
31
31
|
export declare function buildTable(rows: string[][], options: TableOptions): string[];
|
|
32
|
-
//# sourceMappingURL=table-formatter.d.ts.map
|
package/dist/lib/temp-path.d.ts
CHANGED
|
@@ -48,4 +48,3 @@ export declare function applyHashlineEdit(content: string, args: HashlineEditArg
|
|
|
48
48
|
export declare function createHashlineReadTool(): ToolDefinition;
|
|
49
49
|
export declare function createHashlineEditTool(): ToolDefinition;
|
|
50
50
|
export {};
|
|
51
|
-
//# sourceMappingURL=hashline-tools.d.ts.map
|
package/dist/lib/types.d.ts
CHANGED
package/dist/lib/ui/ansi.d.ts
CHANGED
|
@@ -98,4 +98,3 @@ export declare function currentMarkerLabel(marker: AccountCurrentMarker): string
|
|
|
98
98
|
export declare function resolveQuotaWindowLabel(windowMinutes: number | undefined, fallbackLabel: string): string;
|
|
99
99
|
export declare function formatAccountHint(account: AccountInfo, ui: ReturnType<typeof getUiRuntimeOptions>): string;
|
|
100
100
|
export declare function authMenuFocusKey(action: AuthMenuAction): string;
|
|
101
|
-
//# sourceMappingURL=auth-menu-builder.d.ts.map
|
|
@@ -4,4 +4,3 @@ export type { AccountAction, AccountInfo, AccountStatus, AuthMenuAction, AuthMen
|
|
|
4
4
|
export declare function showAuthMenu(accounts: AccountInfo[], options?: AuthMenuOptions): Promise<AuthMenuAction>;
|
|
5
5
|
export declare function showAccountDetails(account: AccountInfo): Promise<AccountAction>;
|
|
6
6
|
export { isTTY };
|
|
7
|
-
//# sourceMappingURL=auth-menu.d.ts.map
|
|
@@ -5,4 +5,3 @@ type ProgressOutput = {
|
|
|
5
5
|
/** Indeterminate progress: elapsed time is real; no guessed completion percentage. */
|
|
6
6
|
export declare function withCheckProgress<T>(label: string | (() => string), operation: () => Promise<T>, log?: (message: string) => void, output?: ProgressOutput): Promise<T>;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=check-progress.d.ts.map
|
package/dist/lib/ui/confirm.d.ts
CHANGED
package/dist/lib/ui/format.d.ts
CHANGED
|
@@ -61,4 +61,3 @@ export declare function formatUiBadge(ui: UiRuntimeOptions, label: string, tone?
|
|
|
61
61
|
export declare function quotaToneFromLeftPercent(leftPercent: number): Extract<UiTextTone, "success" | "warning" | "danger">;
|
|
62
62
|
/** Style human-readable reports; JSON callers must bypass this presentation helper. */
|
|
63
63
|
export declare function styleReportText(text: string, tone?: UiTextTone): string;
|
|
64
|
-
//# sourceMappingURL=format.d.ts.map
|
package/dist/lib/ui/index.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export { getUiRuntimeOptions, resetUiRuntimeOptions, setUiRuntimeOptions, type U
|
|
|
7
7
|
export { select, type MenuItem, type SelectOptions } from "./select.js";
|
|
8
8
|
export { createUiTheme, shouldDisableColor, type UiAccent, type UiColorProfile, type UiGlyphMode, type UiPalette, type UiTheme, } from "./theme.js";
|
|
9
9
|
export { UI_COPY, formatCheckFlaggedLabel } from "./ui-copy.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/ui/runtime.d.ts
CHANGED
package/dist/lib/ui/select.d.ts
CHANGED
|
@@ -80,4 +80,3 @@ export declare function truncateAnsi(input: string, maxVisibleChars: number): st
|
|
|
80
80
|
* @throws If not running on a TTY, if `items` is empty, or if all menu items are non-selectable.
|
|
81
81
|
*/
|
|
82
82
|
export declare function select<T>(items: MenuItem<T>[], options: SelectOptions<T>): Promise<T | null>;
|
|
83
|
-
//# sourceMappingURL=select.d.ts.map
|
package/dist/lib/ui/theme.d.ts
CHANGED
package/dist/lib/ui/ui-copy.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ export declare const UI_COPY: {
|
|
|
94
94
|
readonly experimentalHelpMenu: "Enter Select | 1 Sync | 2 Backup | 3 Guard | 4 Budget | [ - Down | ] + Up | S Save | Q Back";
|
|
95
95
|
readonly experimentalHelpPreview: "Enter Select | A Apply | Q Back";
|
|
96
96
|
readonly experimentalHelpStatus: "Enter Select | Q Back";
|
|
97
|
-
readonly experimentalSync: "Sync Accounts to oc-
|
|
97
|
+
readonly experimentalSync: "Sync Accounts to oc-codex-multi-auth";
|
|
98
98
|
readonly experimentalApplySync: "Apply Sync";
|
|
99
99
|
readonly experimentalBackup: "Save Pool Backup";
|
|
100
100
|
readonly experimentalBackupPrompt: "Backup file name (.json): ";
|
|
@@ -157,4 +157,3 @@ export declare const UI_COPY: {
|
|
|
157
157
|
* @returns The resulting label string: the base label when `flaggedCount` is 0 or less, otherwise the base label followed by ` (count)`.
|
|
158
158
|
*/
|
|
159
159
|
export declare function formatCheckFlaggedLabel(flaggedCount: number): string;
|
|
160
|
-
//# sourceMappingURL=ui-copy.d.ts.map
|
package/dist/lib/ui/ui-copy.js
CHANGED
|
@@ -95,7 +95,7 @@ export const UI_COPY = {
|
|
|
95
95
|
experimentalHelpMenu: "Enter Select | 1 Sync | 2 Backup | 3 Guard | 4 Budget | [ - Down | ] + Up | S Save | Q Back",
|
|
96
96
|
experimentalHelpPreview: "Enter Select | A Apply | Q Back",
|
|
97
97
|
experimentalHelpStatus: "Enter Select | Q Back",
|
|
98
|
-
experimentalSync: "Sync Accounts to oc-
|
|
98
|
+
experimentalSync: "Sync Accounts to oc-codex-multi-auth",
|
|
99
99
|
experimentalApplySync: "Apply Sync",
|
|
100
100
|
experimentalBackup: "Save Pool Backup",
|
|
101
101
|
experimentalBackupPrompt: "Backup file name (.json): ",
|
|
@@ -34,10 +34,12 @@ export declare function saveUnifiedPluginConfigSync(pluginConfig: JsonRecord): v
|
|
|
34
34
|
/**
|
|
35
35
|
* Persist the provided plugin configuration to the unified settings file, replacing the `pluginConfig` section.
|
|
36
36
|
*
|
|
37
|
-
* Writes a shallow clone of `pluginConfig` into the on-disk settings payload.
|
|
38
|
-
* through
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* Writes a shallow clone of `pluginConfig` into the on-disk settings payload. Calls are serialized
|
|
38
|
+
* through a per-path async queue and a cross-process lock directory (lib/storage/json-store-lock.ts);
|
|
39
|
+
* each attempt re-reads the freshest on-disk record and re-applies the section under mtime CAS, so a
|
|
40
|
+
* concurrent process's write is merged rather than clobbered. On Windows, filesystem atomicity and
|
|
41
|
+
* visibility semantics are platform-dependent. The settings file is written as plain JSON; redact or
|
|
42
|
+
* remove any sensitive tokens or secrets before calling.
|
|
41
43
|
*
|
|
42
44
|
* @param pluginConfig - The plugin configuration object to store (will be shallow-cloned)
|
|
43
45
|
*/
|
|
@@ -57,15 +59,15 @@ export declare function loadUnifiedDashboardSettings(): Promise<JsonRecord | nul
|
|
|
57
59
|
*
|
|
58
60
|
* Writes `dashboardDisplaySettings` into the shared settings.json (overwriting
|
|
59
61
|
* any existing dashboardDisplaySettings section) and ensures the payload is
|
|
60
|
-
* normalized with the file version.
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
62
|
+
* normalized with the file version. Async callers are serialized through a
|
|
63
|
+
* per-path queue plus the cross-process lock directory
|
|
64
|
+
* (lib/storage/json-store-lock.ts), with mtime CAS reload-and-retry inside the
|
|
65
|
+
* lock (last writer still wins per section). On Windows, path and directory
|
|
66
|
+
* creation follow Node's filesystem semantics (case-insensitive paths, ACLs
|
|
67
|
+
* apply). Sensitive tokens or secrets included in `dashboardDisplaySettings`
|
|
68
|
+
* are written verbatim — callers must redact or omit secrets before calling.
|
|
66
69
|
*
|
|
67
70
|
* @param dashboardDisplaySettings - A plain JSON record describing dashboard display preferences; the object is shallow-copied before persisting.
|
|
68
71
|
*/
|
|
69
72
|
export declare function saveUnifiedDashboardSettings(dashboardDisplaySettings: JsonRecord): Promise<void>;
|
|
70
73
|
export {};
|
|
71
|
-
//# sourceMappingURL=unified-settings.d.ts.map
|
|
@@ -3,12 +3,12 @@ import { join } from "node:path";
|
|
|
3
3
|
import { getCodexMultiAuthDir } from "./runtime-paths.js";
|
|
4
4
|
import { sleep } from "./utils.js";
|
|
5
5
|
import { tempPathFor } from "./temp-path.js";
|
|
6
|
+
import { withJsonStoreFileLock, withJsonStoreWriteQueue, } from "./storage/json-store-lock.js";
|
|
6
7
|
export const UNIFIED_SETTINGS_VERSION = 1;
|
|
7
8
|
const UNIFIED_SETTINGS_PATH = join(getCodexMultiAuthDir(), "settings.json");
|
|
8
9
|
const UNIFIED_SETTINGS_BACKUP_PATH = `${UNIFIED_SETTINGS_PATH}.bak`;
|
|
9
10
|
const RETRYABLE_FS_CODES = new Set(["EBUSY", "EPERM"]);
|
|
10
11
|
const TRANSIENT_READ_FS_CODES = new Set(["EBUSY", "EAGAIN"]);
|
|
11
|
-
let settingsWriteQueue = Promise.resolve();
|
|
12
12
|
function isRetryableFsError(error) {
|
|
13
13
|
const code = error?.code;
|
|
14
14
|
return typeof code === "string" && RETRYABLE_FS_CODES.has(code);
|
|
@@ -403,10 +403,15 @@ async function getUnifiedSettingsMtimeMs() {
|
|
|
403
403
|
throw error;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Serialize async settings writes: the per-path promise queue orders writers
|
|
408
|
+
* inside THIS process, and the cross-process lock directory
|
|
409
|
+
* (lib/storage/json-store-lock.ts) closes the same read→merge→rename window
|
|
410
|
+
* against OTHER processes. The task keeps its mtime CAS retry as the
|
|
411
|
+
* second-line guard for writers that do not take the lockfile.
|
|
412
|
+
*/
|
|
406
413
|
async function enqueueSettingsWrite(task) {
|
|
407
|
-
|
|
408
|
-
settingsWriteQueue = run.then(() => undefined, () => undefined);
|
|
409
|
-
return run;
|
|
414
|
+
return withJsonStoreWriteQueue(UNIFIED_SETTINGS_PATH, () => withJsonStoreFileLock(UNIFIED_SETTINGS_PATH, task));
|
|
410
415
|
}
|
|
411
416
|
/**
|
|
412
417
|
* Get the absolute filesystem path to the unified settings JSON file used for multi-auth plugins.
|
|
@@ -461,10 +466,12 @@ export function saveUnifiedPluginConfigSync(pluginConfig) {
|
|
|
461
466
|
/**
|
|
462
467
|
* Persist the provided plugin configuration to the unified settings file, replacing the `pluginConfig` section.
|
|
463
468
|
*
|
|
464
|
-
* Writes a shallow clone of `pluginConfig` into the on-disk settings payload.
|
|
465
|
-
* through
|
|
466
|
-
*
|
|
467
|
-
*
|
|
469
|
+
* Writes a shallow clone of `pluginConfig` into the on-disk settings payload. Calls are serialized
|
|
470
|
+
* through a per-path async queue and a cross-process lock directory (lib/storage/json-store-lock.ts);
|
|
471
|
+
* each attempt re-reads the freshest on-disk record and re-applies the section under mtime CAS, so a
|
|
472
|
+
* concurrent process's write is merged rather than clobbered. On Windows, filesystem atomicity and
|
|
473
|
+
* visibility semantics are platform-dependent. The settings file is written as plain JSON; redact or
|
|
474
|
+
* remove any sensitive tokens or secrets before calling.
|
|
468
475
|
*
|
|
469
476
|
* @param pluginConfig - The plugin configuration object to store (will be shallow-cloned)
|
|
470
477
|
*/
|
|
@@ -517,12 +524,13 @@ export async function loadUnifiedDashboardSettings() {
|
|
|
517
524
|
*
|
|
518
525
|
* Writes `dashboardDisplaySettings` into the shared settings.json (overwriting
|
|
519
526
|
* any existing dashboardDisplaySettings section) and ensures the payload is
|
|
520
|
-
* normalized with the file version.
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
527
|
+
* normalized with the file version. Async callers are serialized through a
|
|
528
|
+
* per-path queue plus the cross-process lock directory
|
|
529
|
+
* (lib/storage/json-store-lock.ts), with mtime CAS reload-and-retry inside the
|
|
530
|
+
* lock (last writer still wins per section). On Windows, path and directory
|
|
531
|
+
* creation follow Node's filesystem semantics (case-insensitive paths, ACLs
|
|
532
|
+
* apply). Sensitive tokens or secrets included in `dashboardDisplaySettings`
|
|
533
|
+
* are written verbatim — callers must redact or omit secrets before calling.
|
|
526
534
|
*
|
|
527
535
|
* @param dashboardDisplaySettings - A plain JSON record describing dashboard display preferences; the object is shallow-copied before persisting.
|
|
528
536
|
*/
|
|
@@ -9,4 +9,3 @@ export declare function formatManualUpdateNotice(result: UpdateCheckResult): str
|
|
|
9
9
|
export declare function checkForUpdates(force?: boolean, fetchTimeoutMs?: number): Promise<UpdateCheckResult>;
|
|
10
10
|
export declare function checkAndNotify(showToast?: (message: string, variant: "info" | "warning") => Promise<void>): Promise<void>;
|
|
11
11
|
export declare function clearUpdateCache(): void;
|
|
12
|
-
//# sourceMappingURL=update-notice.d.ts.map
|
|
@@ -51,8 +51,7 @@ export declare const SHORT_CONTEXT_MAX_INPUT_TOKENS = 272000;
|
|
|
51
51
|
* `test/usage-pricing-coverage.test.ts` fails if a NEW routable model appears
|
|
52
52
|
* in neither list.
|
|
53
53
|
*/
|
|
54
|
-
export declare const UNPRICED_ROUTABLE_MODELS: readonly ["gpt-
|
|
54
|
+
export declare const UNPRICED_ROUTABLE_MODELS: readonly ["gpt-daybreak-blue-latest", "gpt-daybreak-red-latest"];
|
|
55
55
|
export declare function getUsageModelPricing(model: string | null | undefined): UsageModelPricing | null;
|
|
56
56
|
export declare function estimateUsageCostUsd(model: string | null | undefined, tokens: UsageTokenCounts): number | null;
|
|
57
57
|
export declare function listUsageModelPricing(): Record<string, UsageModelPricing>;
|
|
58
|
-
//# sourceMappingURL=pricing.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RETIRED_MODEL_REPLACEMENTS } from "../request/helpers/model-map.js";
|
|
1
|
+
import { getNormalizedModel, RETIRED_MODEL_REPLACEMENTS, } from "../request/helpers/model-map.js";
|
|
2
2
|
/**
|
|
3
3
|
* Largest input still billed at the short-context rate. OpenAI's GPT-6 model
|
|
4
4
|
* pages say "Prompts with more than 272K input tokens are priced at 2x input
|
|
@@ -48,6 +48,37 @@ const MODEL_PRICING = {
|
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
|
+
// GPT-6.1 Sol, published with the model on 2026-09-29: same $2 / $10 shape
|
|
52
|
+
// as 6 Sol but a cheaper cached-input rate ($0.10 vs $0.20) and a separate
|
|
53
|
+
// cache-write rate this table has no field for — cache writes bill as input
|
|
54
|
+
// here. Long-context (>272K input) doubles input and cache rates and
|
|
55
|
+
// multiplies output 1.5x; the Fast tier is the usual 2x.
|
|
56
|
+
"gpt-6.1-sol": {
|
|
57
|
+
inputUsdPerMillion: 2,
|
|
58
|
+
outputUsdPerMillion: 10,
|
|
59
|
+
cachedInputUsdPerMillion: 0.1,
|
|
60
|
+
reasoningUsdPerMillion: 10,
|
|
61
|
+
longContext: {
|
|
62
|
+
inputUsdPerMillion: 4,
|
|
63
|
+
outputUsdPerMillion: 15,
|
|
64
|
+
cachedInputUsdPerMillion: 0.2,
|
|
65
|
+
reasoningUsdPerMillion: 15,
|
|
66
|
+
},
|
|
67
|
+
serviceTiers: {
|
|
68
|
+
priority: {
|
|
69
|
+
inputUsdPerMillion: 4,
|
|
70
|
+
outputUsdPerMillion: 20,
|
|
71
|
+
cachedInputUsdPerMillion: 0.2,
|
|
72
|
+
reasoningUsdPerMillion: 20,
|
|
73
|
+
longContext: {
|
|
74
|
+
inputUsdPerMillion: 8,
|
|
75
|
+
outputUsdPerMillion: 30,
|
|
76
|
+
cachedInputUsdPerMillion: 0.4,
|
|
77
|
+
reasoningUsdPerMillion: 30,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
51
82
|
// GPT-6 Sol and Luna, from the OpenAI API pricing page (read 2026-09-23;
|
|
52
83
|
// short- and long-context rows). Both publish a Fast tier at exactly 2x,
|
|
53
84
|
// like Astra.
|
|
@@ -103,12 +134,6 @@ const MODEL_PRICING = {
|
|
|
103
134
|
},
|
|
104
135
|
},
|
|
105
136
|
},
|
|
106
|
-
"gpt-5.5": {
|
|
107
|
-
inputUsdPerMillion: 2,
|
|
108
|
-
outputUsdPerMillion: 12,
|
|
109
|
-
cachedInputUsdPerMillion: 0.2,
|
|
110
|
-
reasoningUsdPerMillion: 12,
|
|
111
|
-
},
|
|
112
137
|
"gpt-5.6-sol": {
|
|
113
138
|
inputUsdPerMillion: 5,
|
|
114
139
|
outputUsdPerMillion: 30,
|
|
@@ -143,16 +168,10 @@ const MODEL_PRICING = {
|
|
|
143
168
|
* in neither list.
|
|
144
169
|
*/
|
|
145
170
|
export const UNPRICED_ROUTABLE_MODELS = [
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
// a separate controlled-access agreement with no public per-token rate.
|
|
149
|
-
// Pricing `aeon` off the flagship would be a guess on the model whose whole
|
|
150
|
-
// purpose is running for days, which is exactly where a wrong rate does the
|
|
151
|
-
// most damage.
|
|
152
|
-
"gpt-6-astra-aeon",
|
|
171
|
+
// The Daybreak cyber models are sold under a separate controlled-access
|
|
172
|
+
// agreement with no public per-token rate.
|
|
153
173
|
"gpt-daybreak-blue-latest",
|
|
154
174
|
"gpt-daybreak-red-latest",
|
|
155
|
-
"gpt-5.5-pro",
|
|
156
175
|
];
|
|
157
176
|
function normalizeModelName(model) {
|
|
158
177
|
const trimmed = model?.trim().toLowerCase();
|
|
@@ -179,7 +198,13 @@ export function getUsageModelPricing(model) {
|
|
|
179
198
|
// the ledger stores `costUsd` when a row is written and never re-prices it.
|
|
180
199
|
const effective = !/^(api|zdr)\//.test(model ?? "") && Object.hasOwn(RETIRED_MODEL_REPLACEMENTS, normalized)
|
|
181
200
|
? RETIRED_MODEL_REPLACEMENTS[normalized]
|
|
182
|
-
:
|
|
201
|
+
: // Bare aliases (`gpt-6.1`, `gpt-6`, `gpt-5.6`, `astra`) and
|
|
202
|
+
// effort-suffixed ids (`gpt-6.1-sol-max`) reach the ledger raw too;
|
|
203
|
+
// `getNormalizedModel` is the exact/alias-only resolver — NOT
|
|
204
|
+
// `resolveNormalizedModel`, which hands back DEFAULT_MODEL for
|
|
205
|
+
// anything unrecognized and would price an unknown model at the
|
|
206
|
+
// default's rate.
|
|
207
|
+
(getNormalizedModel(normalized) ?? normalized);
|
|
183
208
|
if (!effective || !Object.hasOwn(MODEL_PRICING, effective)) {
|
|
184
209
|
return null;
|
|
185
210
|
}
|
|
@@ -7,4 +7,3 @@ export declare function createUsageAccountRef(input: {
|
|
|
7
7
|
}): UsageLedgerAccountRef | null;
|
|
8
8
|
export declare function normalizeUsageLedgerRow(input: UsageLedgerAppendInput): UsageLedgerRow;
|
|
9
9
|
export declare function usageRowToJsonLine(row: UsageLedgerRow): string;
|
|
10
|
-
//# sourceMappingURL=redaction.d.ts.map
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -14,6 +14,27 @@ export declare function isRecord(value: unknown): value is Record<string, unknow
|
|
|
14
14
|
* @returns True when the error should be treated as an abort signal
|
|
15
15
|
*/
|
|
16
16
|
export declare function isAbortError(error: unknown): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Combines two abort signals into one that aborts when the FIRST input does.
|
|
19
|
+
*
|
|
20
|
+
* This is a thin null-tolerant wrapper over `AbortSignal.any` — available
|
|
21
|
+
* since Node 18.17.0, which the engines floor already requires. Using the
|
|
22
|
+
* native composite matters beyond brevity: a manual addEventListener pair
|
|
23
|
+
* stays registered on BOTH inputs until one fires, so a caller that combines
|
|
24
|
+
* a long-lived signal (e.g. a proxy-lifetime abort) once per request would
|
|
25
|
+
* pin one listener + controller closure per completed request. The native
|
|
26
|
+
* composite is tracked as a weak dependency of the sources, so it detaches
|
|
27
|
+
* from a long-lived caller signal as soon as the request drops it.
|
|
28
|
+
*
|
|
29
|
+
* The forwarded signal aborts with the firing signal's `reason` (matching
|
|
30
|
+
* `AbortSignal.any` semantics, including timeout reasons from
|
|
31
|
+
* `AbortSignal.timeout`).
|
|
32
|
+
*
|
|
33
|
+
* Undefined/null inputs are treated as "no constraint": one real signal is
|
|
34
|
+
* returned as-is, and two absent inputs yield a never-aborting signal. An
|
|
35
|
+
* already-aborted input is returned directly so its reason survives.
|
|
36
|
+
*/
|
|
37
|
+
export declare function combineSignals(first: AbortSignal | null | undefined, second: AbortSignal | null | undefined): AbortSignal;
|
|
17
38
|
/**
|
|
18
39
|
* Returns the current timestamp in milliseconds.
|
|
19
40
|
* Wrapper for Date.now() to enable testing with mocked time.
|
|
@@ -32,4 +53,3 @@ export declare function toStringValue(value: unknown): string;
|
|
|
32
53
|
* @returns Promise that resolves after the specified time
|
|
33
54
|
*/
|
|
34
55
|
export declare function sleep(ms: number): Promise<void>;
|
|
35
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/lib/utils.js
CHANGED
|
@@ -21,6 +21,37 @@ export function isAbortError(error) {
|
|
|
21
21
|
const maybe = error;
|
|
22
22
|
return maybe.name === "AbortError" || maybe.code === "ABORT_ERR";
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Combines two abort signals into one that aborts when the FIRST input does.
|
|
26
|
+
*
|
|
27
|
+
* This is a thin null-tolerant wrapper over `AbortSignal.any` — available
|
|
28
|
+
* since Node 18.17.0, which the engines floor already requires. Using the
|
|
29
|
+
* native composite matters beyond brevity: a manual addEventListener pair
|
|
30
|
+
* stays registered on BOTH inputs until one fires, so a caller that combines
|
|
31
|
+
* a long-lived signal (e.g. a proxy-lifetime abort) once per request would
|
|
32
|
+
* pin one listener + controller closure per completed request. The native
|
|
33
|
+
* composite is tracked as a weak dependency of the sources, so it detaches
|
|
34
|
+
* from a long-lived caller signal as soon as the request drops it.
|
|
35
|
+
*
|
|
36
|
+
* The forwarded signal aborts with the firing signal's `reason` (matching
|
|
37
|
+
* `AbortSignal.any` semantics, including timeout reasons from
|
|
38
|
+
* `AbortSignal.timeout`).
|
|
39
|
+
*
|
|
40
|
+
* Undefined/null inputs are treated as "no constraint": one real signal is
|
|
41
|
+
* returned as-is, and two absent inputs yield a never-aborting signal. An
|
|
42
|
+
* already-aborted input is returned directly so its reason survives.
|
|
43
|
+
*/
|
|
44
|
+
export function combineSignals(first, second) {
|
|
45
|
+
if (first?.aborted)
|
|
46
|
+
return first;
|
|
47
|
+
if (second?.aborted)
|
|
48
|
+
return second;
|
|
49
|
+
if (!first)
|
|
50
|
+
return second ?? new AbortController().signal;
|
|
51
|
+
if (!second)
|
|
52
|
+
return first;
|
|
53
|
+
return AbortSignal.any([first, second]);
|
|
54
|
+
}
|
|
24
55
|
/**
|
|
25
56
|
* Returns the current timestamp in milliseconds.
|
|
26
57
|
* Wrapper for Date.now() to enable testing with mocked time.
|
package/dist/lib/wsl.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-multi-auth",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "Codex CLI multi-account OAuth manager with account switching, health checks, runtime rotation, diagnostics, and recovery tools for @openai/codex",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"build": "tsc && node scripts/copy-oauth-success.js",
|
|
82
82
|
"generate:schema": "npm run build && node scripts/generate-config-schema.mjs",
|
|
83
83
|
"typecheck": "tsc --noEmit",
|
|
84
|
-
"typecheck:scripts": "
|
|
84
|
+
"typecheck:scripts": "tsc -p tsconfig.scripts.json",
|
|
85
85
|
"lint": "npm run lint:ts && npm run lint:scripts",
|
|
86
86
|
"lint:ts": "eslint . --ext .ts",
|
|
87
87
|
"lint:scripts": "eslint scripts --ext .js,.mjs",
|
|
@@ -125,6 +125,7 @@
|
|
|
125
125
|
"dist/",
|
|
126
126
|
"assets/",
|
|
127
127
|
"config/",
|
|
128
|
+
"skills/",
|
|
128
129
|
"scripts/codex.js",
|
|
129
130
|
"scripts/codex-app-launcher.js",
|
|
130
131
|
"scripts/codex-app-router.js",
|
|
@@ -183,7 +184,10 @@
|
|
|
183
184
|
"overrides": {
|
|
184
185
|
"hono": "4.13.9",
|
|
185
186
|
"flatted": "3.4.2",
|
|
186
|
-
"minimatch":
|
|
187
|
+
"minimatch": {
|
|
188
|
+
".": "10.2.4",
|
|
189
|
+
"brace-expansion": "5.0.9"
|
|
190
|
+
},
|
|
187
191
|
"picomatch": "4.0.4",
|
|
188
192
|
"rollup": "4.59.0",
|
|
189
193
|
"vite": "^7.3.2",
|
|
@@ -191,9 +195,11 @@
|
|
|
191
195
|
"picomatch": "2.3.2"
|
|
192
196
|
},
|
|
193
197
|
"@typescript-eslint/typescript-estree": {
|
|
194
|
-
"minimatch":
|
|
198
|
+
"minimatch": {
|
|
199
|
+
".": "9.0.9",
|
|
200
|
+
"brace-expansion": "2.1.7"
|
|
201
|
+
}
|
|
195
202
|
},
|
|
196
|
-
"brace-expansion": "5.0.9",
|
|
197
203
|
"postcss": "8.5.25",
|
|
198
204
|
"nanoid": "3.3.18"
|
|
199
205
|
}
|
|
@@ -90,6 +90,21 @@ function resolveWindowsCmdPath(env) {
|
|
|
90
90
|
return "cmd.exe";
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// win32.isAbsolute("\bin\codex.exe") is true for a root-relative path with no
|
|
94
|
+
// drive — it resolves against the CURRENT drive, so the existence check would
|
|
95
|
+
// probe (and a forwarder would exec) whatever file lives at "<cwd's
|
|
96
|
+
// drive>\bin\codex.exe". CWE-426: a binary override must be drive-qualified
|
|
97
|
+
// (C:\...) or a UNC/device path (\\server\share\..., \\?\...), never a bare
|
|
98
|
+
// "\" or "/" root. POSIX keeps plain absolute-path semantics.
|
|
99
|
+
export function isFullyQualifiedBinOverride(candidatePath, platform) {
|
|
100
|
+
if (platform === "win32") {
|
|
101
|
+
if (!win32.isAbsolute(candidatePath)) return false;
|
|
102
|
+
const root = win32.parse(candidatePath).root;
|
|
103
|
+
return root !== "\\" && root !== "/";
|
|
104
|
+
}
|
|
105
|
+
return posix.isAbsolute(candidatePath);
|
|
106
|
+
}
|
|
107
|
+
|
|
93
108
|
export function splitPathEntries(pathValue, platform = process.platform) {
|
|
94
109
|
if (typeof pathValue !== "string" || pathValue.trim().length === 0) {
|
|
95
110
|
return [];
|
|
@@ -235,7 +250,11 @@ export function resolveRealCodexBin(options = {}) {
|
|
|
235
250
|
|
|
236
251
|
const override = (env.CODEX_MULTI_AUTH_REAL_CODEX_BIN ?? "").trim();
|
|
237
252
|
if (override.length > 0) {
|
|
238
|
-
|
|
253
|
+
// The override is the binary every forwarded command execs, so require a
|
|
254
|
+
// fully-qualified absolute path: a relative one resolves against the
|
|
255
|
+
// caller's cwd, and on Windows a root-relative one resolves against the
|
|
256
|
+
// cwd's DRIVE — either could silently exec a planted file.
|
|
257
|
+
if (!isFullyQualifiedBinOverride(override, platform) || !existsSyncImpl(override)) return null;
|
|
239
258
|
if (platform === "win32" && isWindowsShimPath(override)) {
|
|
240
259
|
const entry = resolveWindowsShimPackageEntry(override, existsSyncImpl);
|
|
241
260
|
return entry ? createResolvedCodexBin(entry) : null;
|
|
@@ -53,7 +53,13 @@ if (args.length === 1 && versionFlags.has(firstArg)) {
|
|
|
53
53
|
process.exitCode = 1;
|
|
54
54
|
}
|
|
55
55
|
} else {
|
|
56
|
-
|
|
56
|
+
// The specifier lives in a variable so `tsc -p tsconfig.scripts.json` can
|
|
57
|
+
// check this file without a prior `npm run build`: a literal
|
|
58
|
+
// "../dist/lib/codex-manager.js" specifier forces module resolution against
|
|
59
|
+
// dist/. The imported surface is guarded by Number.isInteger below, so the
|
|
60
|
+
// erased type information costs nothing here.
|
|
61
|
+
const managerModuleSpecifier = "../dist/lib/codex-manager.js";
|
|
62
|
+
const { runCodexMultiAuthCli } = await import(managerModuleSpecifier);
|
|
57
63
|
const exitCode = await runCodexMultiAuthCli(args);
|
|
58
64
|
process.exitCode = Number.isInteger(exitCode) ? exitCode : 1;
|
|
59
65
|
}
|