codex-multi-auth 2.3.0-beta.1 → 2.3.0-beta.3
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 +2 -1
- package/README.md +4 -4
- package/config/schema/config.schema.json +268 -21
- package/dist/index.js +0 -1
- package/dist/lib/account-policy.d.ts.map +1 -1
- package/dist/lib/account-policy.js +2 -2
- package/dist/lib/accounts/rate-limits.js +0 -1
- package/dist/lib/accounts.d.ts +3 -8
- package/dist/lib/accounts.d.ts.map +1 -1
- package/dist/lib/accounts.js +2 -3
- package/dist/lib/audit.d.ts +0 -9
- package/dist/lib/audit.d.ts.map +1 -1
- package/dist/lib/audit.js +0 -1
- package/dist/lib/auth/auth.js +0 -1
- package/dist/lib/auth/browser.js +0 -1
- package/dist/lib/auth/device-auth.d.ts +1 -6
- package/dist/lib/auth/device-auth.d.ts.map +1 -1
- package/dist/lib/auth/device-auth.js +5 -6
- package/dist/lib/auth/index.js +0 -1
- package/dist/lib/auth/org-override.js +0 -1
- package/dist/lib/auth/server.js +0 -1
- package/dist/lib/auth/token-utils.js +0 -1
- package/dist/lib/auth-rate-limit.js +0 -1
- package/dist/lib/budget-guard.d.ts.map +1 -1
- package/dist/lib/budget-guard.js +2 -2
- package/dist/lib/capability-policy.js +0 -1
- package/dist/lib/circuit-breaker.js +0 -1
- package/dist/lib/cli.js +1 -2
- package/dist/lib/codex-cli/index.js +0 -1
- package/dist/lib/codex-cli/observability.js +0 -1
- package/dist/lib/codex-cli/state.js +0 -1
- package/dist/lib/codex-cli/sync.d.ts +2 -2
- package/dist/lib/codex-cli/sync.d.ts.map +1 -1
- package/dist/lib/codex-cli/sync.js +1 -2
- package/dist/lib/codex-cli/writer.d.ts.map +1 -1
- package/dist/lib/codex-cli/writer.js +2 -2
- package/dist/lib/codex-manager/account-credentials.d.ts +13 -0
- package/dist/lib/codex-manager/account-credentials.d.ts.map +1 -0
- package/dist/lib/codex-manager/account-credentials.js +55 -0
- package/dist/lib/codex-manager/account-manager-commands.js +0 -1
- package/dist/lib/codex-manager/account-pool-write.d.ts +1 -1
- package/dist/lib/codex-manager/account-pool-write.d.ts.map +1 -1
- package/dist/lib/codex-manager/account-pool-write.js +0 -1
- package/dist/lib/codex-manager/backend-category-entry.js +0 -1
- package/dist/lib/codex-manager/backend-category-helpers.js +0 -1
- package/dist/lib/codex-manager/backend-category-prompt.js +0 -1
- package/dist/lib/codex-manager/backend-settings-controller.js +0 -1
- package/dist/lib/codex-manager/backend-settings-entry.js +0 -1
- package/dist/lib/codex-manager/backend-settings-helpers.d.ts +0 -1
- package/dist/lib/codex-manager/backend-settings-helpers.d.ts.map +1 -1
- package/dist/lib/codex-manager/backend-settings-helpers.js +1 -2
- package/dist/lib/codex-manager/backend-settings-prompt.js +0 -1
- package/dist/lib/codex-manager/backend-settings-schema.js +0 -1
- package/dist/lib/codex-manager/behavior-settings-panel.d.ts +1 -20
- package/dist/lib/codex-manager/behavior-settings-panel.d.ts.map +1 -1
- package/dist/lib/codex-manager/behavior-settings-panel.js +0 -1
- package/dist/lib/codex-manager/commands/account.js +0 -1
- package/dist/lib/codex-manager/commands/best.d.ts +8 -0
- package/dist/lib/codex-manager/commands/best.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/best.js +64 -1
- package/dist/lib/codex-manager/commands/bridge.js +0 -1
- package/dist/lib/codex-manager/commands/budget.js +0 -1
- package/dist/lib/codex-manager/commands/check.js +0 -1
- package/dist/lib/codex-manager/commands/config-explain.js +0 -1
- package/dist/lib/codex-manager/commands/debug-bundle.js +0 -1
- package/dist/lib/codex-manager/commands/forecast.js +0 -1
- package/dist/lib/codex-manager/commands/init-config.js +0 -1
- package/dist/lib/codex-manager/commands/integrations.js +0 -1
- package/dist/lib/codex-manager/commands/models.js +0 -1
- package/dist/lib/codex-manager/commands/monitor.js +0 -1
- package/dist/lib/codex-manager/commands/report.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/report.js +2 -2
- package/dist/lib/codex-manager/commands/rotation.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/rotation.js +1 -4
- package/dist/lib/codex-manager/commands/status.js +0 -1
- package/dist/lib/codex-manager/commands/switch.js +0 -1
- package/dist/lib/codex-manager/commands/uninstall.d.ts +2 -2
- package/dist/lib/codex-manager/commands/uninstall.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/uninstall.js +3 -34
- package/dist/lib/codex-manager/commands/unpin.js +0 -1
- package/dist/lib/codex-manager/commands/usage.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/usage.js +2 -2
- package/dist/lib/codex-manager/commands/verify.d.ts +2 -2
- package/dist/lib/codex-manager/commands/verify.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/verify.js +0 -1
- package/dist/lib/codex-manager/commands/why-selected.d.ts +1 -22
- package/dist/lib/codex-manager/commands/why-selected.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/why-selected.js +0 -1
- package/dist/lib/codex-manager/commands/workspace.js +0 -1
- package/dist/lib/codex-manager/dashboard-display-panel.d.ts +1 -15
- package/dist/lib/codex-manager/dashboard-display-panel.d.ts.map +1 -1
- package/dist/lib/codex-manager/dashboard-display-panel.js +0 -1
- package/dist/lib/codex-manager/dashboard-formatters.js +0 -1
- package/dist/lib/codex-manager/dashboard-settings-controller.js +0 -1
- package/dist/lib/codex-manager/dashboard-settings-data.js +0 -1
- package/dist/lib/codex-manager/dashboard-settings-entry.js +0 -1
- package/dist/lib/codex-manager/experimental-settings-entry.js +0 -1
- package/dist/lib/codex-manager/experimental-settings-prompt.d.ts +2 -1
- package/dist/lib/codex-manager/experimental-settings-prompt.d.ts.map +1 -1
- package/dist/lib/codex-manager/experimental-settings-prompt.js +0 -1
- package/dist/lib/codex-manager/experimental-settings-schema.js +1 -2
- package/dist/lib/codex-manager/experimental-sync-target-entry.js +0 -1
- package/dist/lib/codex-manager/experimental-sync-target.js +0 -1
- package/dist/lib/codex-manager/forecast-report-commands.js +0 -1
- package/dist/lib/codex-manager/forecast-report-shared.d.ts +2 -2
- package/dist/lib/codex-manager/forecast-report-shared.d.ts.map +1 -1
- package/dist/lib/codex-manager/forecast-report-shared.js +5 -21
- package/dist/lib/codex-manager/formatters/account-formatters.d.ts +11 -0
- package/dist/lib/codex-manager/formatters/account-formatters.d.ts.map +1 -0
- package/dist/lib/codex-manager/formatters/account-formatters.js +79 -0
- package/dist/lib/codex-manager/formatters/index.d.ts +5 -0
- package/dist/lib/codex-manager/formatters/index.d.ts.map +1 -0
- package/dist/lib/codex-manager/formatters/index.js +4 -0
- package/dist/lib/codex-manager/formatters/model-formatters.d.ts +12 -0
- package/dist/lib/codex-manager/formatters/model-formatters.d.ts.map +1 -0
- package/dist/lib/codex-manager/formatters/model-formatters.js +23 -0
- package/dist/lib/codex-manager/formatters/quota-formatters.d.ts +9 -0
- package/dist/lib/codex-manager/formatters/quota-formatters.d.ts.map +1 -0
- package/dist/lib/codex-manager/formatters/quota-formatters.js +104 -0
- package/dist/lib/codex-manager/formatters/text-style.d.ts +14 -0
- package/dist/lib/codex-manager/formatters/text-style.d.ts.map +1 -0
- package/dist/lib/codex-manager/formatters/text-style.js +111 -0
- package/dist/lib/codex-manager/health-check.d.ts +14 -0
- package/dist/lib/codex-manager/health-check.d.ts.map +1 -0
- package/dist/lib/codex-manager/health-check.js +278 -0
- package/dist/lib/codex-manager/help.d.ts +2 -1
- package/dist/lib/codex-manager/help.d.ts.map +1 -1
- package/dist/lib/codex-manager/help.js +0 -1
- package/dist/lib/codex-manager/login-action-panel.d.ts +4 -0
- package/dist/lib/codex-manager/login-action-panel.d.ts.map +1 -0
- package/dist/lib/codex-manager/login-action-panel.js +238 -0
- package/dist/lib/codex-manager/login-flow.d.ts +17 -0
- package/dist/lib/codex-manager/login-flow.d.ts.map +1 -0
- package/dist/lib/codex-manager/login-flow.js +387 -0
- package/dist/lib/codex-manager/login-menu-actions.d.ts +20 -0
- package/dist/lib/codex-manager/login-menu-actions.d.ts.map +1 -0
- package/dist/lib/codex-manager/login-menu-actions.js +303 -0
- package/dist/lib/codex-manager/login-menu-data.d.ts +19 -0
- package/dist/lib/codex-manager/login-menu-data.d.ts.map +1 -0
- package/dist/lib/codex-manager/login-menu-data.js +378 -0
- package/dist/lib/codex-manager/login-oauth.d.ts +55 -0
- package/dist/lib/codex-manager/login-oauth.d.ts.map +1 -0
- package/dist/lib/codex-manager/login-oauth.js +345 -0
- package/dist/lib/codex-manager/manual-callback.js +0 -1
- package/dist/lib/codex-manager/persist-selected-account.d.ts +24 -0
- package/dist/lib/codex-manager/persist-selected-account.d.ts.map +1 -0
- package/dist/lib/codex-manager/persist-selected-account.js +107 -0
- package/dist/lib/codex-manager/quota-cache-helpers.d.ts +18 -0
- package/dist/lib/codex-manager/quota-cache-helpers.d.ts.map +1 -0
- package/dist/lib/codex-manager/quota-cache-helpers.js +112 -0
- package/dist/lib/codex-manager/rate-limit-markers.js +0 -1
- package/dist/lib/codex-manager/repair-commands.d.ts +0 -15
- package/dist/lib/codex-manager/repair-commands.d.ts.map +1 -1
- package/dist/lib/codex-manager/repair-commands.js +5 -6
- package/dist/lib/codex-manager/settings-hub/backend.d.ts +0 -5
- package/dist/lib/codex-manager/settings-hub/backend.d.ts.map +1 -1
- package/dist/lib/codex-manager/settings-hub/backend.js +2 -3
- package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +1 -14
- package/dist/lib/codex-manager/settings-hub/dashboard.d.ts.map +1 -1
- package/dist/lib/codex-manager/settings-hub/dashboard.js +9 -10
- package/dist/lib/codex-manager/settings-hub/experimental.js +1 -2
- package/dist/lib/codex-manager/settings-hub/index.js +1 -2
- package/dist/lib/codex-manager/settings-hub/shared.js +0 -1
- package/dist/lib/codex-manager/settings-hub-entry.js +0 -1
- package/dist/lib/codex-manager/settings-hub-menu.js +0 -1
- package/dist/lib/codex-manager/settings-hub-prompt.js +0 -1
- package/dist/lib/codex-manager/settings-hub.js +0 -1
- package/dist/lib/codex-manager/settings-panels.js +0 -1
- package/dist/lib/codex-manager/settings-persist-utils.js +0 -1
- package/dist/lib/codex-manager/settings-preview.js +0 -1
- package/dist/lib/codex-manager/settings-write-queue.d.ts +0 -10
- package/dist/lib/codex-manager/settings-write-queue.d.ts.map +1 -1
- package/dist/lib/codex-manager/settings-write-queue.js +10 -11
- package/dist/lib/codex-manager/statusline-order.js +0 -1
- package/dist/lib/codex-manager/statusline-settings-panel.d.ts +3 -18
- package/dist/lib/codex-manager/statusline-settings-panel.d.ts.map +1 -1
- package/dist/lib/codex-manager/statusline-settings-panel.js +0 -1
- package/dist/lib/codex-manager/theme-settings-panel.d.ts +1 -14
- package/dist/lib/codex-manager/theme-settings-panel.d.ts.map +1 -1
- package/dist/lib/codex-manager/theme-settings-panel.js +0 -1
- package/dist/lib/codex-manager/unified-settings-controller.js +0 -1
- package/dist/lib/codex-manager/unified-settings-entry.js +0 -1
- package/dist/lib/codex-manager.d.ts +2 -4
- package/dist/lib/codex-manager.d.ts.map +1 -1
- package/dist/lib/codex-manager.js +219 -2570
- package/dist/lib/config-schema.d.ts +32 -0
- package/dist/lib/config-schema.d.ts.map +1 -0
- package/dist/lib/config-schema.js +96 -0
- package/dist/lib/config.d.ts +0 -13
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +82 -123
- package/dist/lib/constants.js +0 -1
- package/dist/lib/context-overflow.js +0 -1
- package/dist/lib/dashboard-settings.d.ts +3 -3
- package/dist/lib/dashboard-settings.d.ts.map +1 -1
- package/dist/lib/dashboard-settings.js +0 -2
- package/dist/lib/entitlement-cache.js +0 -1
- package/dist/lib/env-parsing.js +0 -1
- package/dist/lib/errors.d.ts +0 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +0 -1
- package/dist/lib/forecast.d.ts +4 -3
- package/dist/lib/forecast.d.ts.map +1 -1
- package/dist/lib/forecast.js +0 -1
- package/dist/lib/fs-retry.d.ts +46 -3
- package/dist/lib/fs-retry.d.ts.map +1 -1
- package/dist/lib/fs-retry.js +77 -9
- package/dist/lib/health.js +0 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/integration-generators.js +0 -1
- package/dist/lib/live-account-sync.js +0 -1
- package/dist/lib/local-bridge.js +0 -1
- package/dist/lib/local-client-tokens.d.ts.map +1 -1
- package/dist/lib/local-client-tokens.js +2 -2
- package/dist/lib/logger.js +0 -1
- package/dist/lib/model-capability-matrix.js +0 -1
- package/dist/lib/named-backup-export.js +0 -1
- package/dist/lib/oc-chatgpt-import-adapter.d.ts +1 -1
- package/dist/lib/oc-chatgpt-import-adapter.d.ts.map +1 -1
- package/dist/lib/oc-chatgpt-import-adapter.js +0 -1
- package/dist/lib/oc-chatgpt-orchestrator.d.ts.map +1 -1
- package/dist/lib/oc-chatgpt-orchestrator.js +2 -2
- package/dist/lib/oc-chatgpt-target-detection.d.ts +1 -1
- package/dist/lib/oc-chatgpt-target-detection.d.ts.map +1 -1
- package/dist/lib/oc-chatgpt-target-detection.js +0 -1
- package/dist/lib/parallel-probe.js +0 -1
- package/dist/lib/policy/runtime-policy.js +0 -1
- package/dist/lib/preemptive-quota-scheduler.js +0 -1
- package/dist/lib/proactive-refresh.js +0 -1
- package/dist/lib/prompts/codex-host-bridge.d.ts +0 -8
- package/dist/lib/prompts/codex-host-bridge.d.ts.map +1 -1
- package/dist/lib/prompts/codex-host-bridge.js +0 -21
- package/dist/lib/prompts/codex.d.ts +3 -11
- package/dist/lib/prompts/codex.d.ts.map +1 -1
- package/dist/lib/prompts/codex.js +6 -13
- package/dist/lib/prompts/fetch-utils.d.ts +0 -2
- package/dist/lib/prompts/fetch-utils.d.ts.map +1 -1
- package/dist/lib/prompts/fetch-utils.js +2 -3
- package/dist/lib/prompts/host-codex-prompt.d.ts.map +1 -1
- package/dist/lib/prompts/host-codex-prompt.js +2 -2
- package/dist/lib/quota-cache.d.ts.map +1 -1
- package/dist/lib/quota-cache.js +17 -44
- package/dist/lib/quota-probe.js +0 -1
- package/dist/lib/quota-readiness.js +0 -1
- package/dist/lib/recovery/constants.js +0 -1
- package/dist/lib/recovery/index.js +0 -1
- package/dist/lib/recovery/storage.d.ts.map +1 -1
- package/dist/lib/recovery/storage.js +35 -54
- package/dist/lib/recovery/storage.js.map +1 -1
- package/dist/lib/recovery/types.d.ts +4 -12
- package/dist/lib/recovery/types.d.ts.map +1 -1
- package/dist/lib/recovery/types.js +0 -1
- package/dist/lib/recovery.d.ts +2 -2
- package/dist/lib/recovery.d.ts.map +1 -1
- package/dist/lib/recovery.js +0 -1
- package/dist/lib/refresh-guardian.js +0 -1
- package/dist/lib/refresh-lease.d.ts.map +1 -1
- package/dist/lib/refresh-lease.js +1 -4
- package/dist/lib/refresh-queue.js +0 -1
- package/dist/lib/request/error-classification.d.ts +75 -0
- package/dist/lib/request/error-classification.d.ts.map +1 -0
- package/dist/lib/request/error-classification.js +295 -0
- package/dist/lib/request/failover-config.js +0 -1
- package/dist/lib/request/failure-policy.js +0 -1
- package/dist/lib/request/fetch-helpers.d.ts +10 -114
- package/dist/lib/request/fetch-helpers.d.ts.map +1 -1
- package/dist/lib/request/fetch-helpers.js +7 -589
- package/dist/lib/request/headers.d.ts +33 -0
- package/dist/lib/request/headers.d.ts.map +1 -0
- package/dist/lib/request/headers.js +64 -0
- package/dist/lib/request/helpers/input-utils.js +0 -1
- package/dist/lib/request/helpers/model-map.d.ts +10 -0
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
- package/dist/lib/request/helpers/model-map.js +11 -1
- package/dist/lib/request/helpers/tool-utils.js +0 -1
- package/dist/lib/request/index.js +0 -1
- package/dist/lib/request/rate-limit-backoff.js +0 -1
- package/dist/lib/request/rate-limit-decision.d.ts +28 -0
- package/dist/lib/request/rate-limit-decision.d.ts.map +1 -0
- package/dist/lib/request/rate-limit-decision.js +191 -0
- package/dist/lib/request/request-attempt-budget.js +0 -1
- package/dist/lib/request/request-init.js +0 -1
- package/dist/lib/request/request-resilience.js +0 -1
- package/dist/lib/request/request-transformer.js +0 -1
- package/dist/lib/request/response-compaction.d.ts +2 -1
- package/dist/lib/request/response-compaction.d.ts.map +1 -1
- package/dist/lib/request/response-compaction.js +0 -1
- package/dist/lib/request/response-handler.js +0 -1
- package/dist/lib/request/response-metadata.js +0 -1
- package/dist/lib/request/stream-failover-runtime.d.ts +8 -0
- package/dist/lib/request/stream-failover-runtime.d.ts.map +1 -0
- package/dist/lib/request/stream-failover-runtime.js +171 -0
- package/dist/lib/request/stream-failover.js +0 -1
- package/dist/lib/request/token-refresh.d.ts +30 -0
- package/dist/lib/request/token-refresh.d.ts.map +1 -0
- package/dist/lib/request/token-refresh.js +116 -0
- package/dist/lib/request/url-rewriting.d.ts +24 -0
- package/dist/lib/request/url-rewriting.d.ts.map +1 -0
- package/dist/lib/request/url-rewriting.js +153 -0
- package/dist/lib/request/wait-utils.js +0 -1
- package/dist/lib/rotation.d.ts +2 -4
- package/dist/lib/rotation.d.ts.map +1 -1
- package/dist/lib/rotation.js +1 -3
- package/dist/lib/routing-mutex.js +0 -1
- package/dist/lib/routing-profiles.d.ts.map +1 -1
- package/dist/lib/routing-profiles.js +2 -2
- package/dist/lib/runtime/account-check-helpers.js +0 -1
- package/dist/lib/runtime/account-check-types.js +0 -1
- package/dist/lib/runtime/account-check.js +0 -1
- package/dist/lib/runtime/account-health-check.js +0 -1
- package/dist/lib/runtime/account-manager-cache-entry.js +0 -1
- package/dist/lib/runtime/account-manager-cache.js +0 -1
- package/dist/lib/runtime/account-pool.js +0 -1
- package/dist/lib/runtime/account-scope.js +0 -1
- package/dist/lib/runtime/account-select-event.js +0 -1
- package/dist/lib/runtime/account-selection.js +0 -1
- package/dist/lib/runtime/account-state.js +0 -1
- package/dist/lib/runtime/account-status.js +0 -1
- package/dist/lib/runtime/account-storage-scope-entry.js +0 -1
- package/dist/lib/runtime/app-bind.js +0 -1
- package/dist/lib/runtime/auth-facade.js +0 -1
- package/dist/lib/runtime/browser-oauth-flow.js +0 -1
- package/dist/lib/runtime/capability-boost.js +0 -1
- package/dist/lib/runtime/config-toml.d.ts +0 -6
- package/dist/lib/runtime/config-toml.d.ts.map +1 -1
- package/dist/lib/runtime/config-toml.js +6 -7
- package/dist/lib/runtime/event-handler.d.ts +0 -31
- package/dist/lib/runtime/event-handler.d.ts.map +1 -1
- package/dist/lib/runtime/event-handler.js +0 -23
- package/dist/lib/runtime/first-run.d.ts +78 -0
- package/dist/lib/runtime/first-run.d.ts.map +1 -0
- package/dist/lib/runtime/first-run.js +327 -0
- package/dist/lib/runtime/flagged-verify-types.js +0 -1
- package/dist/lib/runtime/hydrate-emails.js +0 -1
- package/dist/lib/runtime/live-sync-entry.js +0 -1
- package/dist/lib/runtime/live-sync.js +0 -1
- package/dist/lib/runtime/loader-setup.js +0 -1
- package/dist/lib/runtime/login-menu-accounts.js +0 -1
- package/dist/lib/runtime/manual-oauth-flow.js +0 -1
- package/dist/lib/runtime/oauth-browser-flow.js +0 -1
- package/dist/lib/runtime/preemptive-quota.js +0 -1
- package/dist/lib/runtime/quota-headers.d.ts +1 -6
- package/dist/lib/runtime/quota-headers.d.ts.map +1 -1
- package/dist/lib/runtime/quota-headers.js +5 -6
- package/dist/lib/runtime/quota-probe.js +0 -1
- package/dist/lib/runtime/quota-settings.js +0 -1
- package/dist/lib/runtime/refresh-guardian-entry.js +0 -1
- package/dist/lib/runtime/refresh-guardian.js +0 -1
- package/dist/lib/runtime/request-init.js +0 -1
- package/dist/lib/runtime/rotation-account-selection.d.ts +38 -0
- package/dist/lib/runtime/rotation-account-selection.d.ts.map +1 -0
- package/dist/lib/runtime/rotation-account-selection.js +172 -0
- package/dist/lib/runtime/rotation-proxy-state.d.ts +54 -0
- package/dist/lib/runtime/rotation-proxy-state.d.ts.map +1 -0
- package/dist/lib/runtime/rotation-proxy-state.js +56 -0
- package/dist/lib/runtime/rotation-server-types.d.ts +57 -0
- package/dist/lib/runtime/rotation-server-types.d.ts.map +1 -0
- package/dist/lib/runtime/rotation-server-types.js +1 -0
- package/dist/lib/runtime/rotation-storage-meta.d.ts +40 -0
- package/dist/lib/runtime/rotation-storage-meta.d.ts.map +1 -0
- package/dist/lib/runtime/rotation-storage-meta.js +143 -0
- package/dist/lib/runtime/rotation-token-refresh.d.ts +25 -0
- package/dist/lib/runtime/rotation-token-refresh.d.ts.map +1 -0
- package/dist/lib/runtime/rotation-token-refresh.js +99 -0
- package/dist/lib/runtime/runtime-current-account.d.ts +3 -3
- package/dist/lib/runtime/runtime-current-account.d.ts.map +1 -1
- package/dist/lib/runtime/runtime-current-account.js +2 -5
- package/dist/lib/runtime/runtime-observability.d.ts +2 -2
- package/dist/lib/runtime/runtime-observability.d.ts.map +1 -1
- package/dist/lib/runtime/runtime-observability.js +0 -5
- package/dist/lib/runtime/runtime-services.js +0 -1
- package/dist/lib/runtime/session-affinity-entry.js +0 -1
- package/dist/lib/runtime/session-affinity.js +0 -1
- package/dist/lib/runtime/session-recovery.js +0 -1
- package/dist/lib/runtime/status-marker.js +0 -1
- package/dist/lib/runtime/storage-scope.js +0 -1
- package/dist/lib/runtime/toast.js +0 -1
- package/dist/lib/runtime/ui-runtime-entry.js +0 -1
- package/dist/lib/runtime/ui-runtime.js +0 -1
- package/dist/lib/runtime/verify-flagged.js +0 -1
- package/dist/lib/runtime-constants.js +0 -1
- package/dist/lib/runtime-paths.js +0 -1
- package/dist/lib/runtime-rotation-proxy.d.ts +7 -124
- package/dist/lib/runtime-rotation-proxy.d.ts.map +1 -1
- package/dist/lib/runtime-rotation-proxy.js +618 -1356
- package/dist/lib/schemas.d.ts +5 -93
- package/dist/lib/schemas.d.ts.map +1 -1
- package/dist/lib/schemas.js +9 -10
- package/dist/lib/session-affinity.js +0 -1
- package/dist/lib/shutdown.js +0 -1
- package/dist/lib/storage/account-clear-entry.js +0 -1
- package/dist/lib/storage/account-clear.js +0 -1
- package/dist/lib/storage/account-match-utils.js +0 -1
- package/dist/lib/storage/account-persistence.d.ts +1 -1
- package/dist/lib/storage/account-persistence.d.ts.map +1 -1
- package/dist/lib/storage/account-persistence.js +0 -1
- package/dist/lib/storage/account-port.d.ts +1 -1
- package/dist/lib/storage/account-port.d.ts.map +1 -1
- package/dist/lib/storage/account-port.js +0 -1
- package/dist/lib/storage/account-save-entry.d.ts +1 -1
- package/dist/lib/storage/account-save-entry.d.ts.map +1 -1
- package/dist/lib/storage/account-save-entry.js +0 -1
- package/dist/lib/storage/account-save.d.ts +1 -1
- package/dist/lib/storage/account-save.d.ts.map +1 -1
- package/dist/lib/storage/account-save.js +0 -1
- package/dist/lib/storage/account-snapshot.js +0 -1
- package/dist/lib/storage/backup-metadata-builder.d.ts +1 -1
- package/dist/lib/storage/backup-metadata-builder.d.ts.map +1 -1
- package/dist/lib/storage/backup-metadata-builder.js +0 -1
- package/dist/lib/storage/backup-metadata.d.ts +13 -0
- package/dist/lib/storage/backup-metadata.d.ts.map +1 -1
- package/dist/lib/storage/backup-metadata.js +0 -1
- package/dist/lib/storage/backup-paths.js +0 -1
- package/dist/lib/storage/backup-restore.d.ts +1 -1
- package/dist/lib/storage/backup-restore.d.ts.map +1 -1
- package/dist/lib/storage/backup-restore.js +0 -1
- package/dist/lib/storage/cache-artifacts.js +0 -1
- package/dist/lib/storage/error-hints.js +0 -1
- package/dist/lib/storage/file-paths.d.ts +2 -2
- package/dist/lib/storage/file-paths.d.ts.map +1 -1
- package/dist/lib/storage/file-paths.js +2 -3
- package/dist/lib/storage/fixture-guards.d.ts +1 -1
- package/dist/lib/storage/fixture-guards.d.ts.map +1 -1
- package/dist/lib/storage/fixture-guards.js +0 -1
- package/dist/lib/storage/flagged-entry.js +0 -1
- package/dist/lib/storage/flagged-load-entry.d.ts +1 -1
- package/dist/lib/storage/flagged-load-entry.d.ts.map +1 -1
- package/dist/lib/storage/flagged-load-entry.js +0 -1
- package/dist/lib/storage/flagged-save-entry.d.ts +1 -1
- package/dist/lib/storage/flagged-save-entry.d.ts.map +1 -1
- package/dist/lib/storage/flagged-save-entry.js +0 -1
- package/dist/lib/storage/flagged-storage-file.d.ts +1 -1
- package/dist/lib/storage/flagged-storage-file.d.ts.map +1 -1
- package/dist/lib/storage/flagged-storage-file.js +0 -1
- package/dist/lib/storage/flagged-storage-io.d.ts +1 -1
- package/dist/lib/storage/flagged-storage-io.d.ts.map +1 -1
- package/dist/lib/storage/flagged-storage-io.js +2 -3
- package/dist/lib/storage/flagged-storage.d.ts +1 -1
- package/dist/lib/storage/flagged-storage.d.ts.map +1 -1
- package/dist/lib/storage/flagged-storage.js +15 -2
- package/dist/lib/storage/flagged-storage.js.map +1 -1
- package/dist/lib/storage/gitignore.js +0 -1
- package/dist/lib/storage/hash.js +0 -1
- package/dist/lib/storage/health.js +0 -1
- package/dist/lib/storage/identity.js +0 -1
- package/dist/lib/storage/import-export.d.ts +1 -1
- package/dist/lib/storage/import-export.d.ts.map +1 -1
- package/dist/lib/storage/import-export.js +2 -3
- package/dist/lib/storage/metadata-section.js +0 -1
- package/dist/lib/storage/migrations.d.ts +7 -49
- package/dist/lib/storage/migrations.d.ts.map +1 -1
- package/dist/lib/storage/migrations.js +5 -2
- package/dist/lib/storage/named-backup-entry.js +0 -1
- package/dist/lib/storage/named-backups-entry.d.ts +1 -1
- package/dist/lib/storage/named-backups-entry.d.ts.map +1 -1
- package/dist/lib/storage/named-backups-entry.js +0 -1
- package/dist/lib/storage/named-backups.js +0 -1
- package/dist/lib/storage/path-state.js +0 -1
- package/dist/lib/storage/paths.js +0 -1
- package/dist/lib/storage/project-migration.d.ts +1 -1
- package/dist/lib/storage/project-migration.d.ts.map +1 -1
- package/dist/lib/storage/project-migration.js +0 -1
- package/dist/lib/storage/public-types.d.ts +70 -0
- package/dist/lib/storage/public-types.d.ts.map +1 -0
- package/dist/lib/storage/public-types.js +6 -0
- package/dist/lib/storage/record-utils.js +0 -1
- package/dist/lib/storage/restore-assessment.d.ts +1 -1
- package/dist/lib/storage/restore-assessment.d.ts.map +1 -1
- package/dist/lib/storage/restore-assessment.js +0 -1
- package/dist/lib/storage/restore-backup-entry.d.ts +1 -1
- package/dist/lib/storage/restore-backup-entry.d.ts.map +1 -1
- package/dist/lib/storage/restore-backup-entry.js +0 -1
- package/dist/lib/storage/restore-metadata.d.ts +1 -1
- package/dist/lib/storage/restore-metadata.d.ts.map +1 -1
- package/dist/lib/storage/restore-metadata.js +0 -1
- package/dist/lib/storage/restore.d.ts +1 -1
- package/dist/lib/storage/restore.d.ts.map +1 -1
- package/dist/lib/storage/restore.js +0 -1
- package/dist/lib/storage/save-retry.d.ts +10 -0
- package/dist/lib/storage/save-retry.d.ts.map +1 -0
- package/dist/lib/storage/save-retry.js +26 -0
- package/dist/lib/storage/snapshot-inspectors.d.ts +1 -1
- package/dist/lib/storage/snapshot-inspectors.d.ts.map +1 -1
- package/dist/lib/storage/snapshot-inspectors.js +0 -1
- package/dist/lib/storage/storage-parser.d.ts +1 -1
- package/dist/lib/storage/storage-parser.d.ts.map +1 -1
- package/dist/lib/storage/storage-parser.js +0 -1
- package/dist/lib/storage/transactions.d.ts +1 -1
- package/dist/lib/storage/transactions.d.ts.map +1 -1
- package/dist/lib/storage/transactions.js +0 -1
- package/dist/lib/storage.d.ts +3 -24
- package/dist/lib/storage.d.ts.map +1 -1
- package/dist/lib/storage.js +47 -55
- package/dist/lib/table-formatter.js +0 -1
- package/dist/lib/temp-path.d.ts +26 -0
- package/dist/lib/temp-path.d.ts.map +1 -0
- package/dist/lib/temp-path.js +30 -0
- package/dist/lib/tools/hashline-tools.js +0 -1
- package/dist/lib/types.js +0 -1
- package/dist/lib/ui/ansi.js +0 -1
- package/dist/lib/ui/auth-menu-builder.d.ts +89 -0
- package/dist/lib/ui/auth-menu-builder.d.ts.map +1 -0
- package/dist/lib/ui/auth-menu-builder.js +350 -0
- package/dist/lib/ui/auth-menu.d.ts +2 -76
- package/dist/lib/ui/auth-menu.d.ts.map +1 -1
- package/dist/lib/ui/auth-menu.js +3 -349
- package/dist/lib/ui/confirm.js +0 -1
- package/dist/lib/ui/display-width.js +0 -1
- package/dist/lib/ui/format.js +0 -1
- package/dist/lib/ui/index.d.ts +10 -0
- package/dist/lib/ui/index.d.ts.map +1 -0
- package/dist/lib/ui/index.js +9 -0
- package/dist/lib/ui/runtime.js +0 -1
- package/dist/lib/ui/select.js +0 -1
- package/dist/lib/ui/theme.d.ts +3 -2
- package/dist/lib/ui/theme.d.ts.map +1 -1
- package/dist/lib/ui/theme.js +0 -1
- package/dist/lib/ui/ui-copy.d.ts +159 -0
- package/dist/lib/ui/ui-copy.d.ts.map +1 -0
- package/dist/lib/ui/ui-copy.js +163 -0
- package/dist/lib/unified-settings.d.ts.map +1 -1
- package/dist/lib/unified-settings.js +2 -2
- package/dist/lib/update-notice.d.ts.map +1 -1
- package/dist/lib/update-notice.js +2 -2
- package/dist/lib/usage/index.js +0 -1
- package/dist/lib/usage/ledger.js +0 -1
- package/dist/lib/usage/pricing.js +0 -1
- package/dist/lib/usage/redaction.js +0 -1
- package/dist/lib/usage/types.js +0 -1
- package/dist/lib/utils.js +0 -1
- package/package.json +8 -9
- package/scripts/postinstall.js +34 -265
- package/scripts/preuninstall.js +2 -2
package/dist/lib/forecast.js
CHANGED
package/dist/lib/fs-retry.d.ts
CHANGED
|
@@ -1,7 +1,50 @@
|
|
|
1
1
|
export declare const FILE_RETRY_CODES: Set<string>;
|
|
2
|
-
export declare const FILE_RETRY_MAX_ATTEMPTS = 6;
|
|
3
|
-
export declare const FILE_RETRY_BASE_DELAY_MS = 25;
|
|
4
|
-
export declare const FILE_RETRY_JITTER_MS = 20;
|
|
5
2
|
export declare function shouldRetryFileOperation(error: unknown): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link withRetry} / {@link withRetrySync}.
|
|
5
|
+
*
|
|
6
|
+
* The shape is deliberately wide enough to express every hand-rolled
|
|
7
|
+
* file-retry loop in the codebase without changing any call site's behavior:
|
|
8
|
+
* per-site attempt counts, exponential/linear backoff schedules, optional
|
|
9
|
+
* jitter, and per-site retryable code sets are all preserved exactly.
|
|
10
|
+
*/
|
|
11
|
+
export interface RetryOptions {
|
|
12
|
+
/** Total number of attempts (including the first one). Must be >= 1. */
|
|
13
|
+
maxAttempts: number;
|
|
14
|
+
/**
|
|
15
|
+
* Delay before the next attempt, either a fixed number of milliseconds or
|
|
16
|
+
* a function of the 1-based index of the attempt that just failed (so the
|
|
17
|
+
* delay after the first failure is `backoffMs(1)`). A computed delay <= 0
|
|
18
|
+
* retries immediately without scheduling a timer.
|
|
19
|
+
*/
|
|
20
|
+
backoffMs: number | ((attempt: number) => number);
|
|
21
|
+
/**
|
|
22
|
+
* Optional jitter: adds `Math.floor(Math.random() * jitterMs)` to each
|
|
23
|
+
* computed backoff delay.
|
|
24
|
+
*/
|
|
25
|
+
jitterMs?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Error codes considered transient. Defaults to {@link FILE_RETRY_CODES}.
|
|
28
|
+
* An error retries only when it carries a string `code` in this set;
|
|
29
|
+
* everything else is rethrown immediately.
|
|
30
|
+
*/
|
|
31
|
+
retryableCodes?: ReadonlySet<string> | readonly string[];
|
|
32
|
+
/** Invoked after each retryable failure, before the backoff delay. */
|
|
33
|
+
onRetry?: (error: unknown, attempt: number) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Run `operation`, retrying on transient filesystem error codes with a
|
|
37
|
+
* per-call backoff schedule. Non-retryable errors are rethrown immediately;
|
|
38
|
+
* once `maxAttempts` is exhausted the error from the final attempt is
|
|
39
|
+
* rethrown unchanged. No delay is scheduled after the final attempt.
|
|
40
|
+
*/
|
|
41
|
+
export declare function withRetry<T>(operation: () => Promise<T> | T, options: RetryOptions): Promise<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Synchronous variant of {@link withRetry} for callers that cannot await
|
|
44
|
+
* (e.g. the synchronous recovery storage paths). Delays use a bounded
|
|
45
|
+
* busy-wait, so keep per-site schedules short; a computed delay <= 0 retries
|
|
46
|
+
* immediately without spinning.
|
|
47
|
+
*/
|
|
48
|
+
export declare function withRetrySync<T>(operation: () => T, options: RetryOptions): T;
|
|
6
49
|
export declare function withFileOperationRetry<T>(operation: () => Promise<T>): Promise<T>;
|
|
7
50
|
//# sourceMappingURL=fs-retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-retry.d.ts","sourceRoot":"","sources":["../../lib/fs-retry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,aAM3B,CAAC;AACH,
|
|
1
|
+
{"version":3,"file":"fs-retry.d.ts","sourceRoot":"","sources":["../../lib/fs-retry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,aAM3B,CAAC;AASH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOhE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC5B,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,MAAM,EAAE,CAAC;IACzD,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAgCD;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAChC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC/B,OAAO,EAAE,YAAY,GACnB,OAAO,CAAC,CAAC,CAAC,CAkBZ;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,GAAG,CAAC,CAqB7E;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EACvC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CAOZ"}
|
package/dist/lib/fs-retry.js
CHANGED
|
@@ -5,9 +5,9 @@ export const FILE_RETRY_CODES = new Set([
|
|
|
5
5
|
"ENOTEMPTY",
|
|
6
6
|
"EACCES",
|
|
7
7
|
]);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const FILE_RETRY_MAX_ATTEMPTS = 6;
|
|
9
|
+
const FILE_RETRY_BASE_DELAY_MS = 25;
|
|
10
|
+
const FILE_RETRY_JITTER_MS = 20;
|
|
11
11
|
function sleep(ms) {
|
|
12
12
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
13
13
|
}
|
|
@@ -17,19 +17,87 @@ export function shouldRetryFileOperation(error) {
|
|
|
17
17
|
typeof error.code === "string" &&
|
|
18
18
|
FILE_RETRY_CODES.has(error.code));
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function getErrorCode(error) {
|
|
21
|
+
if (typeof error !== "object" || error === null)
|
|
22
|
+
return undefined;
|
|
23
|
+
const code = error.code;
|
|
24
|
+
return typeof code === "string" ? code : undefined;
|
|
25
|
+
}
|
|
26
|
+
function isRetryableError(error, retryableCodes) {
|
|
27
|
+
const code = getErrorCode(error);
|
|
28
|
+
if (code === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (retryableCodes === undefined)
|
|
31
|
+
return FILE_RETRY_CODES.has(code);
|
|
32
|
+
return Array.isArray(retryableCodes)
|
|
33
|
+
? retryableCodes.includes(code)
|
|
34
|
+
: retryableCodes.has(code);
|
|
35
|
+
}
|
|
36
|
+
function computeDelayMs(options, attempt) {
|
|
37
|
+
const base = typeof options.backoffMs === "function"
|
|
38
|
+
? options.backoffMs(attempt)
|
|
39
|
+
: options.backoffMs;
|
|
40
|
+
const jitter = options.jitterMs !== undefined && options.jitterMs > 0
|
|
41
|
+
? Math.floor(Math.random() * options.jitterMs)
|
|
42
|
+
: 0;
|
|
43
|
+
return base + jitter;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Run `operation`, retrying on transient filesystem error codes with a
|
|
47
|
+
* per-call backoff schedule. Non-retryable errors are rethrown immediately;
|
|
48
|
+
* once `maxAttempts` is exhausted the error from the final attempt is
|
|
49
|
+
* rethrown unchanged. No delay is scheduled after the final attempt.
|
|
50
|
+
*/
|
|
51
|
+
export async function withRetry(operation, options) {
|
|
21
52
|
for (let attempt = 1;; attempt += 1) {
|
|
22
53
|
try {
|
|
23
54
|
return await operation();
|
|
24
55
|
}
|
|
25
56
|
catch (error) {
|
|
26
|
-
if (!
|
|
57
|
+
if (!isRetryableError(error, options.retryableCodes) ||
|
|
58
|
+
attempt >= options.maxAttempts) {
|
|
27
59
|
throw error;
|
|
28
60
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
61
|
+
options.onRetry?.(error, attempt);
|
|
62
|
+
const delayMs = computeDelayMs(options, attempt);
|
|
63
|
+
if (delayMs > 0) {
|
|
64
|
+
await sleep(delayMs);
|
|
65
|
+
}
|
|
32
66
|
}
|
|
33
67
|
}
|
|
34
68
|
}
|
|
35
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Synchronous variant of {@link withRetry} for callers that cannot await
|
|
71
|
+
* (e.g. the synchronous recovery storage paths). Delays use a bounded
|
|
72
|
+
* busy-wait, so keep per-site schedules short; a computed delay <= 0 retries
|
|
73
|
+
* immediately without spinning.
|
|
74
|
+
*/
|
|
75
|
+
export function withRetrySync(operation, options) {
|
|
76
|
+
for (let attempt = 1;; attempt += 1) {
|
|
77
|
+
try {
|
|
78
|
+
return operation();
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (!isRetryableError(error, options.retryableCodes) ||
|
|
82
|
+
attempt >= options.maxAttempts) {
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
options.onRetry?.(error, attempt);
|
|
86
|
+
const delayMs = computeDelayMs(options, attempt);
|
|
87
|
+
if (delayMs > 0) {
|
|
88
|
+
const waitUntil = Date.now() + delayMs;
|
|
89
|
+
while (Date.now() < waitUntil) {
|
|
90
|
+
// Busy-wait within the bounded per-attempt budget.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export function withFileOperationRetry(operation) {
|
|
97
|
+
return withRetry(operation, {
|
|
98
|
+
maxAttempts: FILE_RETRY_MAX_ATTEMPTS,
|
|
99
|
+
backoffMs: (attempt) => FILE_RETRY_BASE_DELAY_MS * 2 ** (attempt - 1),
|
|
100
|
+
jitterMs: FILE_RETRY_JITTER_MS,
|
|
101
|
+
retryableCodes: FILE_RETRY_CODES,
|
|
102
|
+
});
|
|
103
|
+
}
|
package/dist/lib/health.js
CHANGED
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,6BAA6B,EAC7B,iCAAiC,IAAI,2CAA2C,EAChF,qBAAqB,EACrB,2BAA2B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAA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ACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -90,4 +90,3 @@ export function generateIntegrationSnippet(kind, input = {}) {
|
|
|
90
90
|
export function generateIntegrationSnippets(kinds = ["opencode", "openclaw", "python", "curl", "env"], input = {}) {
|
|
91
91
|
return kinds.map((kind) => generateIntegrationSnippet(kind, input));
|
|
92
92
|
}
|
|
93
|
-
//# sourceMappingURL=integration-generators.js.map
|
package/dist/lib/local-bridge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-client-tokens.d.ts","sourceRoot":"","sources":["../../lib/local-client-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-client-tokens.d.ts","sourceRoot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,GAAG,SAAa,GACd,OAAO,CAAC,OAAO,CAAC,CASlB;AAED,wBAAsB,4BAA4B,CACjD,mBAAmB,EAAE,MAAM,GAAG,IAAI,EAClC,GAAG,SAAa,GACd,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAwBxC;AAED,wBAAgB,uCAAuC,IAAI,IAAI,CAE9D"}
|
|
@@ -4,6 +4,7 @@ import { basename, join } from "node:path";
|
|
|
4
4
|
import { logWarn } from "./logger.js";
|
|
5
5
|
import { getCodexMultiAuthDir } from "./runtime-paths.js";
|
|
6
6
|
import { isRecord, sleep } from "./utils.js";
|
|
7
|
+
import { tempPathFor } from "./temp-path.js";
|
|
7
8
|
const TOKEN_FILE_NAME = "local-client-tokens.json";
|
|
8
9
|
const TOKEN_PREFIX = "cma_local";
|
|
9
10
|
// Debounce window for persisting a record's lastUsedAt. Bearer verification is
|
|
@@ -138,7 +139,7 @@ async function writeStoreToDisk(store) {
|
|
|
138
139
|
// Best-effort hardening only.
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
|
-
const tempPath =
|
|
142
|
+
const tempPath = tempPathFor(path);
|
|
142
143
|
let moved = false;
|
|
143
144
|
try {
|
|
144
145
|
await fs.writeFile(tempPath, `${JSON.stringify(payload, null, 2)}\n`, {
|
|
@@ -250,4 +251,3 @@ export async function verifyLocalClientBearerToken(authorizationHeader, now = Da
|
|
|
250
251
|
export function resetLocalClientTokenWriteQueueForTests() {
|
|
251
252
|
writeQueue = Promise.resolve();
|
|
252
253
|
}
|
|
253
|
-
//# sourceMappingURL=local-client-tokens.js.map
|
package/dist/lib/logger.js
CHANGED
|
@@ -7,7 +7,7 @@ export type OcChatgptPreviewPayload = {
|
|
|
7
7
|
activeIndexByFamily?: AccountStorageV3["activeIndexByFamily"];
|
|
8
8
|
accounts: OcChatgptAccountRef[];
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type OcChatgptAccountRef = {
|
|
11
11
|
accountId?: string;
|
|
12
12
|
email?: string;
|
|
13
13
|
refreshTokenLast4: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oc-chatgpt-import-adapter.d.ts","sourceRoot":"","sources":["../../lib/oc-chatgpt-import-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,gBAAgB,EAIrB,MAAM,cAAc,CAAC;AAEtB,KAAK,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC;AAE5D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG;IACrC,OAAO,EAAE,CAAC,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC9D,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CAChC,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"oc-chatgpt-import-adapter.d.ts","sourceRoot":"","sources":["../../lib/oc-chatgpt-import-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,gBAAgB,EAIrB,MAAM,cAAc,CAAC;AAEtB,KAAK,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC;AAE5D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG;IACrC,OAAO,EAAE,CAAC,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC9D,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CAChC,CAAC;AAEF,KAAK,mBAAmB,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,OAAO,EAAE,uBAAuB,CAAC;IACjC,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC;QACf,QAAQ,EAAE,mBAAmB,CAAC;QAC9B,IAAI,EAAE,mBAAmB,CAAC;QAC1B,SAAS,EAAE,aAAa,CAAC;KACzB,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,wBAAwB,EAAE,mBAAmB,EAAE,CAAC;IAChD,uBAAuB,EAAE,sBAAsB,CAAC;CAChD,CAAC;AAseF;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,gBAAgB,GAAG,IAAI,GAC7B,sBAAsB,CAGxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACpD,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrC,GAAG,qBAAqB,CA2ExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oc-chatgpt-orchestrator.d.ts","sourceRoot":"","sources":["../../lib/oc-chatgpt-orchestrator.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,2BAA2B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAE9B,KAAK,mBAAmB,EACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,KAAK,gBAAgB,EACrB,iBAAiB,EAEjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"oc-chatgpt-orchestrator.d.ts","sourceRoot":"","sources":["../../lib/oc-chatgpt-orchestrator.ts"],"names":[],"mappings":"AAGA,OAAO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AAkB,CACvC,OAAO,EAAE,yBAAyB,GAChC,OAAO,CAAC,wBAAwB,CAAC,CA6CnC;AAED,KAAK,kBAAkB,GAAG;IACzB,YAAY,CAAC,EAAE,OAAO,iBAAiB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GACnC;IACA,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACZ,GACD;IACA,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACZ,GACD;IACA,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CACd,CAAC;AAoBL,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,2BAA2B,GAClC,OAAO,CAAC,0BAA0B,CAAC,CAYrC"}
|
|
@@ -4,6 +4,7 @@ import { withFileOperationRetry } from "./fs-retry.js";
|
|
|
4
4
|
import { previewOcChatgptImportMerge, } from "./oc-chatgpt-import-adapter.js";
|
|
5
5
|
import { detectOcChatgptMultiAuthTarget, } from "./oc-chatgpt-target-detection.js";
|
|
6
6
|
import { exportNamedBackup, normalizeAccountStorage, } from "./storage.js";
|
|
7
|
+
import { tempPathFor } from "./temp-path.js";
|
|
7
8
|
function mapDetectionToBlocked(detection) {
|
|
8
9
|
if (detection.kind === "ambiguous") {
|
|
9
10
|
return { kind: "blocked-ambiguous", detection };
|
|
@@ -84,7 +85,7 @@ async function persistMergedDefault(target, merged) {
|
|
|
84
85
|
if (process.platform !== "win32") {
|
|
85
86
|
await fs.chmod(dir, 0o700).catch(() => undefined);
|
|
86
87
|
}
|
|
87
|
-
const tempPath =
|
|
88
|
+
const tempPath = tempPathFor(path);
|
|
88
89
|
const content = `${JSON.stringify(merged, null, 2)}\n`;
|
|
89
90
|
try {
|
|
90
91
|
await fs.writeFile(tempPath, content, { encoding: "utf-8", mode: 0o600 });
|
|
@@ -186,4 +187,3 @@ export async function runNamedBackupExport(options) {
|
|
|
186
187
|
return { kind: "error", path, error };
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
//# sourceMappingURL=oc-chatgpt-orchestrator.js.map
|
|
@@ -27,7 +27,7 @@ export type OcChatgptTargetNone = {
|
|
|
27
27
|
reason: string;
|
|
28
28
|
tried: Array<Pick<OcChatgptTargetCandidate, "scope" | "root" | "accountPath" | "backupRoot" | "source">>;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type OcChatgptTargetFound = {
|
|
31
31
|
kind: "target";
|
|
32
32
|
descriptor: OcChatgptTargetDescriptor;
|
|
33
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oc-chatgpt-target-detection.d.ts","sourceRoot":"","sources":["../../lib/oc-chatgpt-target-detection.ts"],"names":[],"mappings":"AAcA,KAAK,oBAAoB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjD,KAAK,qBAAqB,GAAG,UAAU,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAEvE,KAAK,wBAAwB,GAAG;IAC/B,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,UAAU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AAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,KAAK,CAChB,IAAI,CACH,wBAAwB,EACtB,OAAO,GACP,MAAM,GACN,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,qBAAqB,GACrB,YAAY,CACd,CACD,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CACX,IAAI,CACH,wBAAwB,EACxB,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,YAAY,GAAG,QAAQ,CAC1D,CACD,CAAC;CACF,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,yBAAyB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GACvC,oBAAoB,GACpB,wBAAwB,GACxB,mBAAmB,CAAC;AAoMvB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,CAAC,EAAE;IACxD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,8BAA8B,CA4JjC"}
|
|
@@ -8,12 +8,4 @@
|
|
|
8
8
|
* Token Count: ~450 tokens (~90% reduction vs full host prompt)
|
|
9
9
|
*/
|
|
10
10
|
export declare const CODEX_HOST_BRIDGE = "# Codex Host Bridge\n\nYou are running Codex through a host terminal coding runtime. The host provides specific tools to help you work efficiently.\n\n## CRITICAL: Tool Usage\n\n<critical_rule priority=\"0\">\napply_patch/applyPatch are Codex names, but host tool names vary by version.\n- Inspect the actual tool list before editing.\n- If `edit` exists: use `edit` for precise in-place string replacements and hashline edits.\n- If `edit` is absent and `apply_patch` exists: use `apply_patch` for those precise/hashline edits in this plugin.\n- For diff-style or multi-line structural edits: use `patch` if available, otherwise use `apply_patch`.\n- In this plugin, `edit` / `apply_patch` also support hashline refs (`lineRef`, `endLineRef`, `operation`, `content`)\n</critical_rule>\n\n<critical_rule priority=\"0\">\nUPDATE_PLAN DOES NOT EXIST -> USE \"todowrite\" INSTEAD\n- NEVER use: update_plan, updatePlan, read_plan, readPlan\n- ALWAYS use: todowrite for task/plan updates, todoread to read plans\n- Before plan operations: Verify you're using \"todowrite\", NOT \"update_plan\"\n</critical_rule>\n\n## Available Host Tools\n\n**File Operations:**\n- `write` - Create new files\n - Overwriting existing files requires a prior Read in this session; default to ASCII unless the file already uses Unicode.\n- `edit` - Modify existing files with string replacement (version-dependent)\n - Requires a prior Read in this session; preserve exact indentation; ensure `oldString` uniquely matches or use `replaceAll`; edit fails if ambiguous or missing.\n - Never pass unresolved template placeholders in `oldString` (e.g. `${TARGET_SNIPPET}`); `oldString` must be literal text copied from the current file.\n - For complex multi-line changes: break into multiple sequential edit calls, each with unique oldString context.\n- `apply_patch` - May be the edit/patch tool name in newer host builds (version-dependent)\n - In this plugin, `apply_patch` also accepts hashline edit args (`path`, `lineRef`, `endLineRef`, `operation`, `content`) when `edit` is not available.\n- `hashline_read` - Read file with hashline refs (`L<line>#<hash>`) for deterministic edits\n- `patch` - Apply diff-style patches for multi-line updates (version-dependent)\n- `read` - Read file contents\n\nNote: Tool naming is version-dependent. If `edit` is unavailable but `apply_patch` exists, use `apply_patch`.\n\nWhen available, prefer hashline workflow for reliability:\n1. Call `hashline_read` for target file and capture refs.\n2. Call `edit` or `apply_patch` with `lineRef` (and optional `endLineRef`) plus `operation` and `content`.\n3. Use legacy `oldString` / `newString` only when hashline refs are unavailable, and only with literal file text (no template placeholders).\n\n**Search/Discovery:**\n- `grep` - Search file contents (tool, not bash grep); use `include` to filter patterns; set `path` only when not searching workspace root; for cross-file match counts use bash with `rg`.\n- `glob` - Find files by pattern; defaults to workspace cwd unless `path` is set.\n- `list` - List directories (requires absolute paths)\n\n**Execution:**\n- `bash` - Run shell commands\n - No workdir parameter; do not include it in tool calls.\n - Always include a short description for the command.\n - Do not use cd; use absolute paths in commands.\n - Quote paths containing spaces with double quotes.\n - Chain multiple commands with ';' or '&&'; avoid newlines.\n - Use Grep/Glob tools for searches; only use bash with `rg` when you need counts or advanced features.\n - Do not use `ls`/`cat` in bash; use `list`/`read` tools instead.\n - For deletions (rm), verify by listing parent dir with `list`.\n\n**Network:**\n- `webfetch` - Fetch web content\n - Use fully-formed URLs (http/https; http auto-upgrades to https).\n - Always set `format` to one of: text | markdown | html; prefer markdown unless otherwise required.\n - Read-only; short cache window.\n\n**Task Management:**\n- `todowrite` - Manage tasks/plans (REPLACES update_plan)\n- `todoread` - Read current plan\n\n## Substitution Rules\n\nBase instruction says: You MUST use instead:\napply_patch -> patch (preferred if available), otherwise edit/apply_patch based on actual tool list\nupdate_plan -> todowrite\nread_plan -> todoread\n\n**Path Usage:** Use per-tool conventions to avoid conflicts:\n- Tool calls: `read`, `edit`, `write`, `list` require absolute paths.\n- Searches: `grep`/`glob` default to the workspace cwd; prefer relative include patterns; set `path` only when a different root is needed.\n- Presentation: In assistant messages, show workspace-relative paths; use absolute paths only inside tool calls.\n- Tool schema overrides general path preferences-do not convert required absolute paths to relative.\n\n## Verification Checklist\n\nBefore file/plan modifications:\n1. Am I using the actual available edit tool name (`edit`, `patch`, or `apply_patch`)?\n2. Am I using \"todowrite\" NOT \"update_plan\"?\n3. Is this tool in the approved list above?\n4. Am I following each tool's path requirements?\n\nIf ANY answer is NO -> STOP and correct before proceeding.\n\n## Host Working Style\n\n**Communication:**\n- Send brief preambles (8-12 words) before tool calls, building on prior context\n- Provide progress updates during longer tasks\n\n**Execution:**\n- Keep working autonomously until query is fully resolved before yielding\n- Don't return to user with partial solutions\n\n**Code Approach:**\n- New projects: Be ambitious and creative\n- Existing codebases: Surgical precision - modify only what's requested unless explicitly instructed to do otherwise\n\n**Testing:**\n- If tests exist: Start specific to your changes, then broader validation\n\n## Advanced Tools\n\n**Task Tool (Sub-Agents):**\n- Use the Task tool (functions.task) to launch sub-agents\n- Check the Task tool description for current agent types and their capabilities\n- Useful for complex analysis, specialized workflows, or tasks requiring isolated context\n- The agent list is dynamically generated - refer to tool schema for available agents\n\n**Parallelization:**\n- When multiple independent tool calls are needed, use multi_tool_use.parallel to run them concurrently.\n- Reserve sequential calls for ordered or data-dependent steps.\n\n**MCP Tools:**\n- Model Context Protocol servers provide additional capabilities\n- MCP tools are prefixed: `mcp__<server-name>__<tool-name>`\n- Check your available tools for MCP integrations\n- Use when the tool's functionality matches your task needs\n\n## What Remains from Codex\n \nSandbox policies, approval mechanisms, final answer formatting, git commit protocols, and file reference formats all follow Codex instructions. In approval policy \"never\", never request escalations.\n\n## Approvals & Safety\n- Assume workspace-write filesystem, network enabled, approval on-failure unless explicitly stated otherwise.\n- When a command fails due to sandboxing or permissions, retry with escalated permissions if allowed by policy, including a one-line justification.\n- Treat destructive commands (e.g., `rm`, `git reset --hard`) as requiring explicit user request or approval.\n- Never run `git reset --hard`, `git checkout --`, or force deletes unless the user explicitly asked for that exact action.\n- `request_user_input` is Plan-mode only; do not call it in Default mode.\n- When uncertain, prefer non-destructive verification first (e.g., confirm file existence with `list`, then delete with `bash`).";
|
|
11
|
-
export interface CodexHostBridgeMeta {
|
|
12
|
-
estimatedTokens: number;
|
|
13
|
-
reductionVsCurrent: string;
|
|
14
|
-
reductionVsToolRemap: string;
|
|
15
|
-
protects: string[];
|
|
16
|
-
omits: string[];
|
|
17
|
-
}
|
|
18
|
-
export declare const CODEX_HOST_BRIDGE_META: CodexHostBridgeMeta;
|
|
19
11
|
//# sourceMappingURL=codex-host-bridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-host-bridge.d.ts","sourceRoot":"","sources":["../../../lib/prompts/codex-host-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,iBAAiB,y5OA0IuG,CAAC
|
|
1
|
+
{"version":3,"file":"codex-host-bridge.d.ts","sourceRoot":"","sources":["../../../lib/prompts/codex-host-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,iBAAiB,y5OA0IuG,CAAC"}
|
|
@@ -146,24 +146,3 @@ Sandbox policies, approval mechanisms, final answer formatting, git commit proto
|
|
|
146
146
|
- Never run \`git reset --hard\`, \`git checkout --\`, or force deletes unless the user explicitly asked for that exact action.
|
|
147
147
|
- \`request_user_input\` is Plan-mode only; do not call it in Default mode.
|
|
148
148
|
- When uncertain, prefer non-destructive verification first (e.g., confirm file existence with \`list\`, then delete with \`bash\`).`;
|
|
149
|
-
export const CODEX_HOST_BRIDGE_META = {
|
|
150
|
-
estimatedTokens: 550,
|
|
151
|
-
reductionVsCurrent: "88%",
|
|
152
|
-
reductionVsToolRemap: "10%",
|
|
153
|
-
protects: [
|
|
154
|
-
"Tool name confusion (update_plan)",
|
|
155
|
-
"Missing tool awareness",
|
|
156
|
-
"Task tool / sub-agent awareness",
|
|
157
|
-
"MCP tool awareness",
|
|
158
|
-
"Premature yielding to user",
|
|
159
|
-
"Over-modification of existing code",
|
|
160
|
-
"Environment confusion",
|
|
161
|
-
],
|
|
162
|
-
omits: [
|
|
163
|
-
"Sandbox details (in Codex)",
|
|
164
|
-
"Formatting rules (in Codex)",
|
|
165
|
-
"Tool schemas (in tool JSONs)",
|
|
166
|
-
"Git protocols (in Codex)",
|
|
167
|
-
],
|
|
168
|
-
};
|
|
169
|
-
//# sourceMappingURL=codex-host-bridge.js.map
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ModelFamily } from "../request/helpers/model-map.js";
|
|
2
2
|
/**
|
|
3
3
|
* Clear the memory cache - exposed for testing
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
6
|
export declare function __clearCacheForTesting(): void;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Maps to different system prompts in the Codex CLI
|
|
10
|
-
*/
|
|
11
|
-
export type ModelFamily = PromptModelFamily;
|
|
12
|
-
/**
|
|
13
|
-
* All supported model families
|
|
14
|
-
* Used for per-family account rotation and rate limit tracking
|
|
15
|
-
*/
|
|
16
|
-
export declare const MODEL_FAMILIES: readonly ModelFamily[];
|
|
7
|
+
export { MODEL_FAMILIES } from "../request/helpers/model-map.js";
|
|
8
|
+
export type { ModelFamily } from "../request/helpers/model-map.js";
|
|
17
9
|
/**
|
|
18
10
|
* Determine the prompt family based on the effective model name.
|
|
19
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../lib/prompts/codex.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkC,KAAK,
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../lib/prompts/codex.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AA4EnG;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAI7C;AAcD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAyBnE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,CAEnE;AA4ED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACzC,eAAe,SAAgB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAkHjB;AA6GD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,GAAE,MAAM,EAAO,GAAG,IAAI,CAiBpE;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,ozGA+EV,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { getCodexCacheDir } from "../runtime-paths.js";
|
|
|
7
7
|
import { DEFAULT_MODEL, getModelProfile } from "../request/helpers/model-map.js";
|
|
8
8
|
import { fetchWithTimeout, readBodyTextGuarded, withBodyTimeout } from "./fetch-utils.js";
|
|
9
9
|
import { withFileOperationRetry } from "../fs-retry.js";
|
|
10
|
+
import { tempFileNonce } from "../temp-path.js";
|
|
10
11
|
/** SHA-256 of cache content for integrity verification (prompts-03). */
|
|
11
12
|
function sha256(content) {
|
|
12
13
|
return createHash("sha256").update(content, "utf8").digest("hex");
|
|
@@ -29,7 +30,7 @@ function sha256(content) {
|
|
|
29
30
|
*/
|
|
30
31
|
async function writeCacheAtomically(cacheFile, cacheMetaFile, content, meta) {
|
|
31
32
|
await withFileOperationRetry(() => fs.mkdir(CACHE_DIR, { recursive: true }));
|
|
32
|
-
const nonce =
|
|
33
|
+
const nonce = tempFileNonce();
|
|
33
34
|
const contentTmp = `${cacheFile}.${nonce}.tmp`;
|
|
34
35
|
const metaTmp = `${cacheMetaFile}.${nonce}.tmp`;
|
|
35
36
|
try {
|
|
@@ -77,17 +78,10 @@ function setCacheEntry(key, value) {
|
|
|
77
78
|
}
|
|
78
79
|
memoryCache.set(key, value);
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export const MODEL_FAMILIES = [
|
|
85
|
-
"gpt-5-codex",
|
|
86
|
-
"codex-max",
|
|
87
|
-
"codex",
|
|
88
|
-
"gpt-5.2",
|
|
89
|
-
"gpt-5.1",
|
|
90
|
-
];
|
|
81
|
+
// ModelFamily/MODEL_FAMILIES live in the leaf model-map module so low-level
|
|
82
|
+
// modules (schemas, storage types) can use them without importing this file.
|
|
83
|
+
// Re-exported here to preserve the historical import surface.
|
|
84
|
+
export { MODEL_FAMILIES } from "../request/helpers/model-map.js";
|
|
91
85
|
/**
|
|
92
86
|
* Prompt file mapping for each model family
|
|
93
87
|
* Based on codex-rs/core/src/model_family.rs logic
|
|
@@ -465,4 +459,3 @@ When hashline_read is available:
|
|
|
465
459
|
- Never call \`request_user_input\` unless collaboration mode is explicitly Plan mode.
|
|
466
460
|
</safety_rules>
|
|
467
461
|
</user_instructions>`;
|
|
468
|
-
//# sourceMappingURL=codex.js.map
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* - a User-Agent (api.github.com rejects requests without one) plus a sensible
|
|
14
14
|
* Accept, applied to every request (prompts-08)
|
|
15
15
|
*/
|
|
16
|
-
export declare const PROMPT_FETCH_TIMEOUT_MS = 10000;
|
|
17
16
|
export declare const PROMPT_FETCH_MAX_BYTES = 1000000;
|
|
18
|
-
export declare const PROMPT_FETCH_USER_AGENT = "codex-multi-auth";
|
|
19
17
|
export interface PromptFetchOptions {
|
|
20
18
|
headers?: Record<string, string>;
|
|
21
19
|
timeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-utils.d.ts","sourceRoot":"","sources":["../../../lib/prompts/fetch-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"fetch-utils.d.ts","sourceRoot":"","sources":["../../../lib/prompts/fetch-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,eAAO,MAAM,sBAAsB,UAAY,CAAC;AAGhD,MAAM,WAAW,kBAAkB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,IAAI,UAAQ,GACV,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,EAChC,SAAS,GAAE,OAAO,KAAa,GAC7B,OAAO,CAAC,QAAQ,CAAC,CAYnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACtC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,EAChC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,SAAS,GAAE,MAAgC,GACzC,OAAO,CAAC,CAAC,CAAC,CAqBZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACxC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,GAAE,MAA+B,EACzC,SAAS,GAAE,MAAgC,GACzC,OAAO,CAAC,MAAM,CAAC,CA2DjB"}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* - a User-Agent (api.github.com rejects requests without one) plus a sensible
|
|
14
14
|
* Accept, applied to every request (prompts-08)
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
const PROMPT_FETCH_TIMEOUT_MS = 10_000;
|
|
17
17
|
export const PROMPT_FETCH_MAX_BYTES = 1_000_000; // 1 MB ceiling for a prompt body
|
|
18
|
-
|
|
18
|
+
const PROMPT_FETCH_USER_AGENT = "codex-multi-auth";
|
|
19
19
|
/**
|
|
20
20
|
* Merge caller headers with the mandatory User-Agent / Accept defaults.
|
|
21
21
|
*
|
|
@@ -162,4 +162,3 @@ export async function readBodyTextGuarded(response, maxBytes = PROMPT_FETCH_MAX_
|
|
|
162
162
|
}
|
|
163
163
|
return text;
|
|
164
164
|
}
|
|
165
|
-
//# sourceMappingURL=fetch-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-codex-prompt.d.ts","sourceRoot":"","sources":["../../../lib/prompts/host-codex-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"host-codex-prompt.d.ts","sourceRoot":"","sources":["../../../lib/prompts/host-codex-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2VH;;;;;;GAMG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CA+B1D;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,SAAK,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAO9E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAI7C"}
|
|
@@ -10,6 +10,7 @@ import { logDebug } from "../logger.js";
|
|
|
10
10
|
import { getCodexCacheDir } from "../runtime-paths.js";
|
|
11
11
|
import { sleep } from "../utils.js";
|
|
12
12
|
import { fetchWithTimeout, readBodyTextGuarded } from "./fetch-utils.js";
|
|
13
|
+
import { tempFileNonce } from "../temp-path.js";
|
|
13
14
|
const DEFAULT_HOST_CODEX_PROMPT_URLS = [
|
|
14
15
|
// Canonical upstream is sst/opencode. The previous list pointed at a rebrand
|
|
15
16
|
// artifact (`anomalyco/Codex`, `sst/Codex`, `packages/Codex/...`) that 404s, so
|
|
@@ -132,7 +133,7 @@ async function removeFileQuietly(path) {
|
|
|
132
133
|
}
|
|
133
134
|
async function writeCacheFilesAtomically(content, meta) {
|
|
134
135
|
await mkdir(CACHE_DIR, { recursive: true });
|
|
135
|
-
const nonce =
|
|
136
|
+
const nonce = tempFileNonce();
|
|
136
137
|
const contentTmp = `${CACHE_FILE}.${nonce}.tmp`;
|
|
137
138
|
const metaTmp = `${CACHE_META_FILE}.${nonce}.tmp`;
|
|
138
139
|
const metaJson = JSON.stringify(meta, null, 2);
|
|
@@ -370,4 +371,3 @@ export function prewarmHostCodexPrompt() {
|
|
|
370
371
|
logDebug("Codex prompt prewarm failed", { error: String(error) });
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
|
-
//# sourceMappingURL=host-codex-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-cache.d.ts","sourceRoot":"","sources":["../../lib/quota-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quota-cache.d.ts","sourceRoot":"","sources":["../../lib/quota-cache.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,gBAAgB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,SAAS,EAAE,gBAAgB,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACzC;AAsGD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,CA4B9D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA4DxE"}
|