codex-multi-auth 0.1.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/LICENSE +1 -0
- package/README.md +162 -0
- package/assets/opencode-logo-ornate-dark.svg +18 -0
- package/assets/readme-hero.svg +31 -0
- package/config/README.md +87 -0
- package/config/minimal-opencode.json +13 -0
- package/config/opencode-legacy.json +571 -0
- package/config/opencode-modern.json +239 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3160 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/accounts/rate-limits.d.ts +22 -0
- package/dist/lib/accounts/rate-limits.d.ts.map +1 -0
- package/dist/lib/accounts/rate-limits.js +63 -0
- package/dist/lib/accounts/rate-limits.js.map +1 -0
- package/dist/lib/accounts.d.ts +95 -0
- package/dist/lib/accounts.d.ts.map +1 -0
- package/dist/lib/accounts.js +668 -0
- package/dist/lib/accounts.js.map +1 -0
- package/dist/lib/audit.d.ts +45 -0
- package/dist/lib/audit.d.ts.map +1 -0
- package/dist/lib/audit.js +131 -0
- package/dist/lib/audit.js.map +1 -0
- package/dist/lib/auth/auth.d.ts +56 -0
- package/dist/lib/auth/auth.d.ts.map +1 -0
- package/dist/lib/auth/auth.js +214 -0
- package/dist/lib/auth/auth.js.map +1 -0
- package/dist/lib/auth/browser.d.ts +34 -0
- package/dist/lib/auth/browser.d.ts.map +1 -0
- package/dist/lib/auth/browser.js +185 -0
- package/dist/lib/auth/browser.js.map +1 -0
- package/dist/lib/auth/server.d.ts +24 -0
- package/dist/lib/auth/server.d.ts.map +1 -0
- package/dist/lib/auth/server.js +116 -0
- package/dist/lib/auth/server.js.map +1 -0
- package/dist/lib/auth/token-utils.d.ts +59 -0
- package/dist/lib/auth/token-utils.d.ts.map +1 -0
- package/dist/lib/auth/token-utils.js +331 -0
- package/dist/lib/auth/token-utils.js.map +1 -0
- package/dist/lib/auth-rate-limit.d.ts +20 -0
- package/dist/lib/auth-rate-limit.d.ts.map +1 -0
- package/dist/lib/auth-rate-limit.js +91 -0
- package/dist/lib/auth-rate-limit.js.map +1 -0
- package/dist/lib/auto-update-checker.d.ts +10 -0
- package/dist/lib/auto-update-checker.d.ts.map +1 -0
- package/dist/lib/auto-update-checker.js +216 -0
- package/dist/lib/auto-update-checker.js.map +1 -0
- package/dist/lib/capability-policy.d.ts +18 -0
- package/dist/lib/capability-policy.d.ts.map +1 -0
- package/dist/lib/capability-policy.js +150 -0
- package/dist/lib/capability-policy.js.map +1 -0
- package/dist/lib/circuit-breaker.d.ts +34 -0
- package/dist/lib/circuit-breaker.d.ts.map +1 -0
- package/dist/lib/circuit-breaker.js +124 -0
- package/dist/lib/circuit-breaker.js.map +1 -0
- package/dist/lib/cli.d.ts +64 -0
- package/dist/lib/cli.d.ts.map +1 -0
- package/dist/lib/cli.js +274 -0
- package/dist/lib/cli.js.map +1 -0
- package/dist/lib/codex-cli/observability.d.ts +22 -0
- package/dist/lib/codex-cli/observability.d.ts.map +1 -0
- package/dist/lib/codex-cli/observability.js +36 -0
- package/dist/lib/codex-cli/observability.js.map +1 -0
- package/dist/lib/codex-cli/state.d.ts +86 -0
- package/dist/lib/codex-cli/state.d.ts.map +1 -0
- package/dist/lib/codex-cli/state.js +470 -0
- package/dist/lib/codex-cli/state.js.map +1 -0
- package/dist/lib/codex-cli/sync.d.ts +27 -0
- package/dist/lib/codex-cli/sync.d.ts.map +1 -0
- package/dist/lib/codex-cli/sync.js +325 -0
- package/dist/lib/codex-cli/sync.js.map +1 -0
- package/dist/lib/codex-cli/writer.d.ts +12 -0
- package/dist/lib/codex-cli/writer.d.ts.map +1 -0
- package/dist/lib/codex-cli/writer.js +388 -0
- package/dist/lib/codex-cli/writer.js.map +1 -0
- package/dist/lib/codex-manager.d.ts +2 -0
- package/dist/lib/codex-manager.d.ts.map +1 -0
- package/dist/lib/codex-manager.js +4841 -0
- package/dist/lib/codex-manager.js.map +1 -0
- package/dist/lib/config.d.ts +269 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +789 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constants.d.ts +78 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +78 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/context-overflow.d.ts +27 -0
- package/dist/lib/context-overflow.d.ts.map +1 -0
- package/dist/lib/context-overflow.js +124 -0
- package/dist/lib/context-overflow.js.map +1 -0
- package/dist/lib/dashboard-settings.d.ts +90 -0
- package/dist/lib/dashboard-settings.d.ts.map +1 -0
- package/dist/lib/dashboard-settings.js +327 -0
- package/dist/lib/dashboard-settings.js.map +1 -0
- package/dist/lib/entitlement-cache.d.ts +41 -0
- package/dist/lib/entitlement-cache.d.ts.map +1 -0
- package/dist/lib/entitlement-cache.js +137 -0
- package/dist/lib/entitlement-cache.js.map +1 -0
- package/dist/lib/errors.d.ts +113 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +103 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/forecast.d.ts +42 -0
- package/dist/lib/forecast.d.ts.map +1 -0
- package/dist/lib/forecast.js +256 -0
- package/dist/lib/forecast.js.map +1 -0
- package/dist/lib/health.d.ts +33 -0
- package/dist/lib/health.d.ts.map +1 -0
- package/dist/lib/health.js +70 -0
- package/dist/lib/health.js.map +1 -0
- package/dist/lib/index.d.ts +32 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +32 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/live-account-sync.d.ts +39 -0
- package/dist/lib/live-account-sync.d.ts.map +1 -0
- package/dist/lib/live-account-sync.js +196 -0
- package/dist/lib/live-account-sync.js.map +1 -0
- package/dist/lib/logger.d.ts +40 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +364 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/oauth-success.html +338 -0
- package/dist/lib/parallel-probe.d.ts +28 -0
- package/dist/lib/parallel-probe.d.ts.map +1 -0
- package/dist/lib/parallel-probe.js +97 -0
- package/dist/lib/parallel-probe.js.map +1 -0
- package/dist/lib/preemptive-quota-scheduler.d.ts +53 -0
- package/dist/lib/preemptive-quota-scheduler.d.ts.map +1 -0
- package/dist/lib/preemptive-quota-scheduler.js +220 -0
- package/dist/lib/preemptive-quota-scheduler.js.map +1 -0
- package/dist/lib/proactive-refresh.d.ts +66 -0
- package/dist/lib/proactive-refresh.d.ts.map +1 -0
- package/dist/lib/proactive-refresh.js +143 -0
- package/dist/lib/proactive-refresh.js.map +1 -0
- package/dist/lib/prompts/codex-opencode-bridge.d.ts +19 -0
- package/dist/lib/prompts/codex-opencode-bridge.d.ts.map +1 -0
- package/dist/lib/prompts/codex-opencode-bridge.js +169 -0
- package/dist/lib/prompts/codex-opencode-bridge.js.map +1 -0
- package/dist/lib/prompts/codex.d.ts +41 -0
- package/dist/lib/prompts/codex.d.ts.map +1 -0
- package/dist/lib/prompts/codex.js +383 -0
- package/dist/lib/prompts/codex.js.map +1 -0
- package/dist/lib/prompts/opencode-codex.d.ts +25 -0
- package/dist/lib/prompts/opencode-codex.d.ts.map +1 -0
- package/dist/lib/prompts/opencode-codex.js +270 -0
- package/dist/lib/prompts/opencode-codex.js.map +1 -0
- package/dist/lib/quota-cache.d.ts +68 -0
- package/dist/lib/quota-cache.d.ts.map +1 -0
- package/dist/lib/quota-cache.js +224 -0
- package/dist/lib/quota-cache.js.map +1 -0
- package/dist/lib/quota-probe.d.ts +49 -0
- package/dist/lib/quota-probe.d.ts.map +1 -0
- package/dist/lib/quota-probe.js +368 -0
- package/dist/lib/quota-probe.js.map +1 -0
- package/dist/lib/recovery/constants.d.ts +12 -0
- package/dist/lib/recovery/constants.d.ts.map +1 -0
- package/dist/lib/recovery/constants.js +31 -0
- package/dist/lib/recovery/constants.js.map +1 -0
- package/dist/lib/recovery/index.d.ts +12 -0
- package/dist/lib/recovery/index.d.ts.map +1 -0
- package/dist/lib/recovery/index.js +12 -0
- package/dist/lib/recovery/index.js.map +1 -0
- package/dist/lib/recovery/storage.d.ts +24 -0
- package/dist/lib/recovery/storage.d.ts.map +1 -0
- package/dist/lib/recovery/storage.js +362 -0
- package/dist/lib/recovery/storage.js.map +1 -0
- package/dist/lib/recovery/types.d.ts +116 -0
- package/dist/lib/recovery/types.d.ts.map +1 -0
- package/dist/lib/recovery/types.js +7 -0
- package/dist/lib/recovery/types.js.map +1 -0
- package/dist/lib/recovery.d.ts +31 -0
- package/dist/lib/recovery.d.ts.map +1 -0
- package/dist/lib/recovery.js +313 -0
- package/dist/lib/recovery.js.map +1 -0
- package/dist/lib/refresh-guardian.d.ts +31 -0
- package/dist/lib/refresh-guardian.d.ts.map +1 -0
- package/dist/lib/refresh-guardian.js +151 -0
- package/dist/lib/refresh-guardian.js.map +1 -0
- package/dist/lib/refresh-lease.d.ts +37 -0
- package/dist/lib/refresh-lease.d.ts.map +1 -0
- package/dist/lib/refresh-lease.js +335 -0
- package/dist/lib/refresh-lease.js.map +1 -0
- package/dist/lib/refresh-queue.d.ts +117 -0
- package/dist/lib/refresh-queue.d.ts.map +1 -0
- package/dist/lib/refresh-queue.js +297 -0
- package/dist/lib/refresh-queue.js.map +1 -0
- package/dist/lib/request/failure-policy.d.ts +42 -0
- package/dist/lib/request/failure-policy.d.ts.map +1 -0
- package/dist/lib/request/failure-policy.js +133 -0
- package/dist/lib/request/failure-policy.js.map +1 -0
- package/dist/lib/request/fetch-helpers.d.ts +152 -0
- package/dist/lib/request/fetch-helpers.d.ts.map +1 -0
- package/dist/lib/request/fetch-helpers.js +704 -0
- package/dist/lib/request/fetch-helpers.js.map +1 -0
- package/dist/lib/request/helpers/input-utils.d.ts +7 -0
- package/dist/lib/request/helpers/input-utils.d.ts.map +1 -0
- package/dist/lib/request/helpers/input-utils.js +214 -0
- package/dist/lib/request/helpers/input-utils.js.map +1 -0
- package/dist/lib/request/helpers/model-map.d.ts +28 -0
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -0
- package/dist/lib/request/helpers/model-map.js +133 -0
- package/dist/lib/request/helpers/model-map.js.map +1 -0
- package/dist/lib/request/helpers/tool-utils.d.ts +29 -0
- package/dist/lib/request/helpers/tool-utils.d.ts.map +1 -0
- package/dist/lib/request/helpers/tool-utils.js +117 -0
- package/dist/lib/request/helpers/tool-utils.js.map +1 -0
- package/dist/lib/request/rate-limit-backoff.d.ts +17 -0
- package/dist/lib/request/rate-limit-backoff.d.ts.map +1 -0
- package/dist/lib/request/rate-limit-backoff.js +83 -0
- package/dist/lib/request/rate-limit-backoff.js.map +1 -0
- package/dist/lib/request/request-transformer.d.ts +107 -0
- package/dist/lib/request/request-transformer.d.ts.map +1 -0
- package/dist/lib/request/request-transformer.js +814 -0
- package/dist/lib/request/request-transformer.js.map +1 -0
- package/dist/lib/request/response-handler.d.ts +23 -0
- package/dist/lib/request/response-handler.d.ts.map +1 -0
- package/dist/lib/request/response-handler.js +155 -0
- package/dist/lib/request/response-handler.js.map +1 -0
- package/dist/lib/request/stream-failover.d.ts +21 -0
- package/dist/lib/request/stream-failover.d.ts.map +1 -0
- package/dist/lib/request/stream-failover.js +204 -0
- package/dist/lib/request/stream-failover.js.map +1 -0
- package/dist/lib/rotation.d.ts +146 -0
- package/dist/lib/rotation.d.ts.map +1 -0
- package/dist/lib/rotation.js +321 -0
- package/dist/lib/rotation.js.map +1 -0
- package/dist/lib/runtime-paths.d.ts +58 -0
- package/dist/lib/runtime-paths.d.ts.map +1 -0
- package/dist/lib/runtime-paths.js +164 -0
- package/dist/lib/runtime-paths.js.map +1 -0
- package/dist/lib/schemas.d.ts +435 -0
- package/dist/lib/schemas.d.ts.map +1 -0
- package/dist/lib/schemas.js +268 -0
- package/dist/lib/schemas.js.map +1 -0
- package/dist/lib/session-affinity.d.ts +23 -0
- package/dist/lib/session-affinity.d.ts.map +1 -0
- package/dist/lib/session-affinity.js +127 -0
- package/dist/lib/session-affinity.js.map +1 -0
- package/dist/lib/shutdown.d.ts +7 -0
- package/dist/lib/shutdown.d.ts.map +1 -0
- package/dist/lib/shutdown.js +43 -0
- package/dist/lib/shutdown.js.map +1 -0
- package/dist/lib/storage/migrations.d.ts +59 -0
- package/dist/lib/storage/migrations.d.ts.map +1 -0
- package/dist/lib/storage/migrations.js +41 -0
- package/dist/lib/storage/migrations.js.map +1 -0
- package/dist/lib/storage/paths.d.ts +51 -0
- package/dist/lib/storage/paths.d.ts.map +1 -0
- package/dist/lib/storage/paths.js +152 -0
- package/dist/lib/storage/paths.js.map +1 -0
- package/dist/lib/storage.d.ts +106 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/lib/storage.js +896 -0
- package/dist/lib/storage.js.map +1 -0
- package/dist/lib/table-formatter.d.ts +32 -0
- package/dist/lib/table-formatter.d.ts.map +1 -0
- package/dist/lib/table-formatter.js +44 -0
- package/dist/lib/table-formatter.js.map +1 -0
- package/dist/lib/tools/hashline-tools.d.ts +51 -0
- package/dist/lib/tools/hashline-tools.d.ts.map +1 -0
- package/dist/lib/tools/hashline-tools.js +456 -0
- package/dist/lib/tools/hashline-tools.js.map +1 -0
- package/dist/lib/types.d.ts +130 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/ui/ansi.d.ts +40 -0
- package/dist/lib/ui/ansi.d.ts.map +1 -0
- package/dist/lib/ui/ansi.js +68 -0
- package/dist/lib/ui/ansi.js.map +1 -0
- package/dist/lib/ui/auth-menu.d.ts +76 -0
- package/dist/lib/ui/auth-menu.d.ts.map +1 -0
- package/dist/lib/ui/auth-menu.js +590 -0
- package/dist/lib/ui/auth-menu.js.map +1 -0
- package/dist/lib/ui/confirm.d.ts +11 -0
- package/dist/lib/ui/confirm.d.ts.map +1 -0
- package/dist/lib/ui/confirm.js +29 -0
- package/dist/lib/ui/confirm.js.map +1 -0
- package/dist/lib/ui/copy.d.ts +123 -0
- package/dist/lib/ui/copy.d.ts.map +1 -0
- package/dist/lib/ui/copy.js +127 -0
- package/dist/lib/ui/copy.js.map +1 -0
- package/dist/lib/ui/format.d.ts +62 -0
- package/dist/lib/ui/format.d.ts.map +1 -0
- package/dist/lib/ui/format.js +205 -0
- package/dist/lib/ui/format.js.map +1 -0
- package/dist/lib/ui/runtime.d.ts +43 -0
- package/dist/lib/ui/runtime.d.ts.map +1 -0
- package/dist/lib/ui/runtime.js +69 -0
- package/dist/lib/ui/runtime.js.map +1 -0
- package/dist/lib/ui/select.d.ts +60 -0
- package/dist/lib/ui/select.d.ts.map +1 -0
- package/dist/lib/ui/select.js +467 -0
- package/dist/lib/ui/select.js.map +1 -0
- package/dist/lib/ui/theme.d.ts +56 -0
- package/dist/lib/ui/theme.d.ts.map +1 -0
- package/dist/lib/ui/theme.js +186 -0
- package/dist/lib/ui/theme.js.map +1 -0
- package/dist/lib/unified-settings.d.ts +71 -0
- package/dist/lib/unified-settings.d.ts.map +1 -0
- package/dist/lib/unified-settings.js +299 -0
- package/dist/lib/unified-settings.js.map +1 -0
- package/dist/lib/utils.d.ts +29 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +54 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +115 -0
- package/scripts/audit-dev-allowlist.js +128 -0
- package/scripts/bench-format/hashline-v2.mjs +642 -0
- package/scripts/bench-format/models.mjs +105 -0
- package/scripts/bench-format/opencode.mjs +205 -0
- package/scripts/bench-format/render.mjs +496 -0
- package/scripts/bench-format/stats.mjs +54 -0
- package/scripts/bench-format/tasks.mjs +151 -0
- package/scripts/benchmark-edit-formats.mjs +1161 -0
- package/scripts/benchmark-render-dashboard.mjs +49 -0
- package/scripts/codex-multi-auth.js +6 -0
- package/scripts/codex-routing.js +34 -0
- package/scripts/codex.js +122 -0
- package/scripts/copy-oauth-success.js +37 -0
- package/scripts/install-opencode-codex-auth.js +193 -0
- package/scripts/test-all-models.sh +7 -0
- package/scripts/test-model-matrix.js +424 -0
- package/scripts/validate-model-map.sh +7 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import type { PluginConfig } from "./types.js";
|
|
2
|
+
export type UnsupportedCodexPolicy = "strict" | "fallback";
|
|
3
|
+
export declare function __resetConfigWarningCacheForTests(): void;
|
|
4
|
+
/**
|
|
5
|
+
* Default plugin configuration
|
|
6
|
+
* CODEX_MODE is enabled by default for better Codex CLI parity
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_PLUGIN_CONFIG: PluginConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Return a shallow copy of the default plugin configuration.
|
|
11
|
+
*
|
|
12
|
+
* Safe to call concurrently; performs no I/O and has no filesystem or Windows atomicity implications.
|
|
13
|
+
* The returned object may include placeholder fields for secrets or tokens — callers must redact sensitive values before logging or persisting.
|
|
14
|
+
*
|
|
15
|
+
* @returns A shallow copy of DEFAULT_PLUGIN_CONFIG
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDefaultPluginConfig(): PluginConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Load the plugin configuration, merging validated user settings with defaults and applying legacy fallbacks.
|
|
20
|
+
*
|
|
21
|
+
* Attempts to read unified settings first; if absent, falls back to legacy per-user JSON files (UTF-8 BOM is stripped on Windows before parsing).
|
|
22
|
+
* Emits one-time warnings for validation or migration issues and avoids exposing sensitive tokens in logged messages.
|
|
23
|
+
* This function performs filesystem reads and may write a migrated unified config; callers should avoid concurrent writers to the same config paths.
|
|
24
|
+
*
|
|
25
|
+
* @returns The effective PluginConfig: a shallow merge of DEFAULT_PLUGIN_CONFIG with any validated user-provided settings
|
|
26
|
+
*/
|
|
27
|
+
export declare function loadPluginConfig(): PluginConfig;
|
|
28
|
+
/**
|
|
29
|
+
* Persist a partial plugin configuration to disk, merging it with existing stored settings.
|
|
30
|
+
*
|
|
31
|
+
* This writes the sanitized patch either to the path specified by the CODEX_MULTI_AUTH_CONFIG_PATH
|
|
32
|
+
* environment variable (if set) or into the unified settings store. The function does not take
|
|
33
|
+
* internal locks; callers should avoid concurrent invocations that might overwrite each other.
|
|
34
|
+
* On Windows and other platforms the write behavior follows the Node.js filesystem semantics and may
|
|
35
|
+
* not be atomic across processes. Callers are responsible for redacting any sensitive values
|
|
36
|
+
* (tokens, secrets) before calling if redaction is required; this function writes merged values as-is.
|
|
37
|
+
*
|
|
38
|
+
* @param configPatch - Partial PluginConfig containing changes to persist; undefined fields are ignored.
|
|
39
|
+
* @returns void
|
|
40
|
+
*/
|
|
41
|
+
export declare function savePluginConfig(configPatch: Partial<PluginConfig>): Promise<void>;
|
|
42
|
+
export declare function getCodexMode(pluginConfig: PluginConfig): boolean;
|
|
43
|
+
export declare function getCodexTuiV2(pluginConfig: PluginConfig): boolean;
|
|
44
|
+
export declare function getCodexTuiColorProfile(pluginConfig: PluginConfig): "truecolor" | "ansi16" | "ansi256";
|
|
45
|
+
export declare function getCodexTuiGlyphMode(pluginConfig: PluginConfig): "ascii" | "unicode" | "auto";
|
|
46
|
+
export declare function getFastSession(pluginConfig: PluginConfig): boolean;
|
|
47
|
+
export declare function getFastSessionStrategy(pluginConfig: PluginConfig): "hybrid" | "always";
|
|
48
|
+
export declare function getFastSessionMaxInputItems(pluginConfig: PluginConfig): number;
|
|
49
|
+
export declare function getRetryAllAccountsRateLimited(pluginConfig: PluginConfig): boolean;
|
|
50
|
+
export declare function getRetryAllAccountsMaxWaitMs(pluginConfig: PluginConfig): number;
|
|
51
|
+
export declare function getRetryAllAccountsMaxRetries(pluginConfig: PluginConfig): number;
|
|
52
|
+
export declare function getUnsupportedCodexPolicy(pluginConfig: PluginConfig): UnsupportedCodexPolicy;
|
|
53
|
+
export declare function getFallbackOnUnsupportedCodexModel(pluginConfig: PluginConfig): boolean;
|
|
54
|
+
export declare function getFallbackToGpt52OnUnsupportedGpt53(pluginConfig: PluginConfig): boolean;
|
|
55
|
+
export declare function getUnsupportedCodexFallbackChain(pluginConfig: PluginConfig): Record<string, string[]>;
|
|
56
|
+
export declare function getTokenRefreshSkewMs(pluginConfig: PluginConfig): number;
|
|
57
|
+
export declare function getRateLimitToastDebounceMs(pluginConfig: PluginConfig): number;
|
|
58
|
+
export declare function getSessionRecovery(pluginConfig: PluginConfig): boolean;
|
|
59
|
+
export declare function getAutoResume(pluginConfig: PluginConfig): boolean;
|
|
60
|
+
export declare function getToastDurationMs(pluginConfig: PluginConfig): number;
|
|
61
|
+
export declare function getPerProjectAccounts(pluginConfig: PluginConfig): boolean;
|
|
62
|
+
export declare function getParallelProbing(pluginConfig: PluginConfig): boolean;
|
|
63
|
+
export declare function getParallelProbingMaxConcurrency(pluginConfig: PluginConfig): number;
|
|
64
|
+
export declare function getEmptyResponseMaxRetries(pluginConfig: PluginConfig): number;
|
|
65
|
+
export declare function getEmptyResponseRetryDelayMs(pluginConfig: PluginConfig): number;
|
|
66
|
+
export declare function getPidOffsetEnabled(pluginConfig: PluginConfig): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Resolve the HTTP fetch timeout to use for account/token requests.
|
|
69
|
+
*
|
|
70
|
+
* Concurrency: value is read-only and safe to use concurrently; callers must enforce timeout usage in their request code. On Windows, filesystem-derived overrides (via env or config file) are subject to typical path encoding and newline semantics. Configuration values may contain sensitive tokens elsewhere; this function only returns a numeric timeout and does not expose or log secrets.
|
|
71
|
+
*
|
|
72
|
+
* @param pluginConfig - Plugin configuration object to read the `fetchTimeoutMs` fallback from
|
|
73
|
+
* @returns The resolved fetch timeout in milliseconds (at least 1000)
|
|
74
|
+
*/
|
|
75
|
+
export declare function getFetchTimeoutMs(pluginConfig: PluginConfig): number;
|
|
76
|
+
/**
|
|
77
|
+
* Compute the effective stream stall timeout used to detect stalled streams.
|
|
78
|
+
*
|
|
79
|
+
* This value applies across concurrent operations and should be treated as a global per-process timeout; callers may use it from multiple async contexts without additional synchronization. The function performs no filesystem I/O and has no special Windows filesystem behavior. Returned values do not contain or reveal any tokens and no redaction is performed by this function.
|
|
80
|
+
*
|
|
81
|
+
* @param pluginConfig - Plugin configuration that may contain a `streamStallTimeoutMs` override
|
|
82
|
+
* @returns The effective stream stall timeout in milliseconds; at least 1000 ms, defaults to 45000 ms
|
|
83
|
+
*/
|
|
84
|
+
export declare function getStreamStallTimeoutMs(pluginConfig: PluginConfig): number;
|
|
85
|
+
/**
|
|
86
|
+
* Determine whether live account synchronization is enabled.
|
|
87
|
+
*
|
|
88
|
+
* Respects the environment override `CODEX_AUTH_LIVE_ACCOUNT_SYNC`, falls back to
|
|
89
|
+
* `pluginConfig.liveAccountSync` when present, and defaults to `true`. This accessor performs no
|
|
90
|
+
* filesystem operations (behaves the same on Windows paths) and does not mutate or log token or
|
|
91
|
+
* credential material; callers are responsible for concurrency and must redact tokens before
|
|
92
|
+
* logging or persisting them.
|
|
93
|
+
*
|
|
94
|
+
* @param pluginConfig - The plugin configuration object used as the non-environment fallback
|
|
95
|
+
* @returns `true` if live account synchronization is enabled, `false` otherwise
|
|
96
|
+
*/
|
|
97
|
+
export declare function getLiveAccountSync(pluginConfig: PluginConfig): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Get the debounce interval, in milliseconds, used when synchronizing live accounts.
|
|
100
|
+
*
|
|
101
|
+
* @param pluginConfig - Plugin configuration which may contain an override for the debounce value
|
|
102
|
+
* @returns The debounce interval in milliseconds; defaults to 250, and will be at least 50
|
|
103
|
+
*
|
|
104
|
+
* Concurrency: safe to call from multiple threads/tasks concurrently.
|
|
105
|
+
* Windows filesystem: value is independent of filesystem semantics.
|
|
106
|
+
* Token redaction: this value contains no secrets and is safe to log.
|
|
107
|
+
*/
|
|
108
|
+
export declare function getLiveAccountSyncDebounceMs(pluginConfig: PluginConfig): number;
|
|
109
|
+
/**
|
|
110
|
+
* Determines the polling interval (in milliseconds) used by live account synchronization.
|
|
111
|
+
*
|
|
112
|
+
* @param pluginConfig - The plugin configuration to read the setting from.
|
|
113
|
+
* @returns The effective poll interval in milliseconds; guaranteed to be at least 500.
|
|
114
|
+
*
|
|
115
|
+
* Notes:
|
|
116
|
+
* - Concurrency: this value is used to debounce/drive polling and should be treated as a minimum per-worker interval when multiple workers run concurrently.
|
|
117
|
+
* - Platform: value is independent of Windows filesystem semantics.
|
|
118
|
+
* - Secrets: the returned value contains no sensitive tokens and is safe for logging (no redaction required).
|
|
119
|
+
*/
|
|
120
|
+
export declare function getLiveAccountSyncPollMs(pluginConfig: PluginConfig): number;
|
|
121
|
+
/**
|
|
122
|
+
* Indicates whether session affinity is enabled.
|
|
123
|
+
*
|
|
124
|
+
* Reads the `sessionAffinity` value from `pluginConfig` and allows an environment
|
|
125
|
+
* override via `CODEX_AUTH_SESSION_AFFINITY`. Safe for concurrent reads, unaffected
|
|
126
|
+
* by Windows filesystem semantics, and does not expose or log authentication tokens.
|
|
127
|
+
*
|
|
128
|
+
* @param pluginConfig - The plugin configuration to consult for the setting
|
|
129
|
+
* @returns `true` if session affinity is enabled, `false` otherwise
|
|
130
|
+
*/
|
|
131
|
+
export declare function getSessionAffinity(pluginConfig: PluginConfig): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Get the session-affinity time-to-live in milliseconds.
|
|
134
|
+
*
|
|
135
|
+
* Reads CODEX_AUTH_SESSION_AFFINITY_TTL_MS from the environment if present, otherwise uses
|
|
136
|
+
* `pluginConfig.sessionAffinityTtlMs`, falling back to 20 minutes. The returned value is
|
|
137
|
+
* clamped to a minimum of 1000 ms.
|
|
138
|
+
*
|
|
139
|
+
* This function performs no filesystem I/O, is safe for concurrent callers, and does not
|
|
140
|
+
* read or emit any token or secret material (suitable for logging without redaction).
|
|
141
|
+
* Because it does no file operations, there are no Windows filesystem semantics to consider.
|
|
142
|
+
*
|
|
143
|
+
* @param pluginConfig - The plugin configuration to read the setting from
|
|
144
|
+
* @returns The effective session-affinity TTL in milliseconds (minimum 1000)
|
|
145
|
+
*/
|
|
146
|
+
export declare function getSessionAffinityTtlMs(pluginConfig: PluginConfig): number;
|
|
147
|
+
/**
|
|
148
|
+
* Determine the configured maximum number of session-affinity entries.
|
|
149
|
+
*
|
|
150
|
+
* @param pluginConfig - The plugin configuration to read the `sessionAffinityMaxEntries` setting from.
|
|
151
|
+
* @returns The effective maximum number of affinity entries (minimum 8, default 512).
|
|
152
|
+
*
|
|
153
|
+
* Concurrency: value is used for in-memory sizing and should be safe for concurrent use by runtime components.
|
|
154
|
+
* Filesystem: value is runtime-only and unaffected by Windows filesystem semantics.
|
|
155
|
+
* Security: this setting contains no secrets and is safe to log; it does not include tokens or credentials.
|
|
156
|
+
*/
|
|
157
|
+
export declare function getSessionAffinityMaxEntries(pluginConfig: PluginConfig): number;
|
|
158
|
+
/**
|
|
159
|
+
* Controls whether the proactive refresh guardian is enabled.
|
|
160
|
+
*
|
|
161
|
+
* When enabled, background refreshes may run concurrently; callers should assume safe concurrent access.
|
|
162
|
+
* Configuration respects cross-platform semantics (including Windows filesystem behavior) when persisting or migrating settings.
|
|
163
|
+
* Any tokens or sensitive values observed during refresh operations are redacted from logs and persisted records.
|
|
164
|
+
*
|
|
165
|
+
* @param pluginConfig - The plugin configuration object to read the setting from
|
|
166
|
+
* @returns `true` if the proactive refresh guardian is enabled, `false` otherwise.
|
|
167
|
+
*/
|
|
168
|
+
export declare function getProactiveRefreshGuardian(pluginConfig: PluginConfig): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Determines the proactive refresh guardian interval in milliseconds.
|
|
171
|
+
*
|
|
172
|
+
* Uses the environment override `CODEX_AUTH_PROACTIVE_GUARDIAN_INTERVAL_MS` if present; otherwise uses
|
|
173
|
+
* the configured `pluginConfig.proactiveRefreshIntervalMs` or the default of 60000 ms. The resulting
|
|
174
|
+
* value is constrained to be at least 5000 ms.
|
|
175
|
+
*
|
|
176
|
+
* Concurrency assumption: callers may be invoked from multiple timers/workers concurrently.
|
|
177
|
+
* Windows filesystem and token-redaction concerns do not affect this getter.
|
|
178
|
+
*
|
|
179
|
+
* @param pluginConfig - Plugin configuration used as the fallback source for the interval value
|
|
180
|
+
* @returns The proactive refresh interval in milliseconds (>= 5000)
|
|
181
|
+
*/
|
|
182
|
+
export declare function getProactiveRefreshIntervalMs(pluginConfig: PluginConfig): number;
|
|
183
|
+
/**
|
|
184
|
+
* Get the proactive refresh guardian buffer interval in milliseconds.
|
|
185
|
+
*
|
|
186
|
+
* @param pluginConfig - Plugin configuration object; `proactiveRefreshBufferMs` may override the default
|
|
187
|
+
* @returns The buffer interval in milliseconds: at least 30000, default 300000
|
|
188
|
+
*
|
|
189
|
+
* Concurrency: this value is shared across concurrent proactive-refresh workers and should be treated as a global timing setting.
|
|
190
|
+
* Windows filesystem: not related to filesystem behavior.
|
|
191
|
+
* Token redaction: environment values and config contents may be redacted in logs and diagnostics.
|
|
192
|
+
*/
|
|
193
|
+
export declare function getProactiveRefreshBufferMs(pluginConfig: PluginConfig): number;
|
|
194
|
+
/**
|
|
195
|
+
* Get the network error cooldown interval used before retrying network operations.
|
|
196
|
+
*
|
|
197
|
+
* @param pluginConfig - Plugin configuration to read override values from
|
|
198
|
+
* @returns The cooldown interval in milliseconds (greater than or equal to 0)
|
|
199
|
+
*
|
|
200
|
+
* Concurrency: callers may read and cache this value; it is read-only at call time.
|
|
201
|
+
* Windows filesystem: no platform-specific filesystem behavior affects this setting.
|
|
202
|
+
* Token redaction: this function does not expose or log sensitive tokens.
|
|
203
|
+
*/
|
|
204
|
+
export declare function getNetworkErrorCooldownMs(pluginConfig: PluginConfig): number;
|
|
205
|
+
/**
|
|
206
|
+
* Get the cooldown duration in milliseconds to apply after a server error.
|
|
207
|
+
*
|
|
208
|
+
* Callers may invoke this concurrently; the returned value is read-only and safe for concurrent use.
|
|
209
|
+
* This function performs no filesystem access and is unaffected by Windows path semantics.
|
|
210
|
+
* It does not log or expose secrets — environment-derived values are treated as configuration, not token data.
|
|
211
|
+
*
|
|
212
|
+
* @param pluginConfig - Plugin configuration used to resolve the setting
|
|
213
|
+
* @returns The cooldown in milliseconds to use after a server error (minimum 0, default 4000)
|
|
214
|
+
*/
|
|
215
|
+
export declare function getServerErrorCooldownMs(pluginConfig: PluginConfig): number;
|
|
216
|
+
/**
|
|
217
|
+
* Determines whether periodic storage backups are enabled.
|
|
218
|
+
*
|
|
219
|
+
* When enabled, background backup tasks may run concurrently; backups follow platform filesystem semantics (including Windows path behavior), and persisted backup data will have sensitive tokens redacted.
|
|
220
|
+
*
|
|
221
|
+
* @param pluginConfig - The plugin configuration to read the setting from
|
|
222
|
+
* @returns `true` if storage backup is enabled, `false` otherwise
|
|
223
|
+
*/
|
|
224
|
+
export declare function getStorageBackupEnabled(pluginConfig: PluginConfig): boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Determines whether preemptive quota checks are enabled.
|
|
227
|
+
*
|
|
228
|
+
* Safe to call concurrently; this function does not access the filesystem (no Windows-specific behavior)
|
|
229
|
+
* and does not expose or log any authentication tokens.
|
|
230
|
+
*
|
|
231
|
+
* @param pluginConfig - Plugin configuration to read the preemptive quota setting from
|
|
232
|
+
* @returns `true` if preemptive quota is enabled, `false` otherwise
|
|
233
|
+
*/
|
|
234
|
+
export declare function getPreemptiveQuotaEnabled(pluginConfig: PluginConfig): boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Get the configured preemptive-quota remaining percentage for 5-hour windows.
|
|
237
|
+
*
|
|
238
|
+
* @param pluginConfig - Plugin configuration to read the setting from. The value may be overridden by the CODEX_AUTH_PREEMPTIVE_QUOTA_5H_REMAINING_PCT environment variable; environment override semantics are the same on Windows. Safe to call concurrently. The returned value does not contain sensitive tokens and requires no redaction.
|
|
239
|
+
* @returns The percentage (0–100) used as the preemptive quota threshold for 5-hour intervals.
|
|
240
|
+
*/
|
|
241
|
+
export declare function getPreemptiveQuotaRemainingPercent5h(pluginConfig: PluginConfig): number;
|
|
242
|
+
/**
|
|
243
|
+
* Determine the percentage of quota to reserve for the 7-day window.
|
|
244
|
+
*
|
|
245
|
+
* Resolves the effective value from the environment variable `CODEX_AUTH_PREEMPTIVE_QUOTA_7D_REMAINING_PCT`,
|
|
246
|
+
* then from `pluginConfig.preemptiveQuotaRemainingPercent7d`, falling back to `5` if unset, and clamps the result
|
|
247
|
+
* to the inclusive range `0`–`100`.
|
|
248
|
+
*
|
|
249
|
+
* Concurrent reads are safe. Behavior is independent of Windows filesystem semantics. No sensitive tokens are included
|
|
250
|
+
* or returned by this function.
|
|
251
|
+
*
|
|
252
|
+
* @param pluginConfig - Plugin configuration object used as a fallback when the environment variable is not set
|
|
253
|
+
* @returns The reserved quota percentage for the 7-day window, an integer between `0` and `100`
|
|
254
|
+
*/
|
|
255
|
+
export declare function getPreemptiveQuotaRemainingPercent7d(pluginConfig: PluginConfig): number;
|
|
256
|
+
/**
|
|
257
|
+
* Get the configured maximum deferral time (in milliseconds) for preemptive quota checks.
|
|
258
|
+
*
|
|
259
|
+
* Reads an environment override or the plugin configuration and enforces a minimum of 1000 ms.
|
|
260
|
+
*
|
|
261
|
+
* @param pluginConfig - Plugin configuration object to read the setting from
|
|
262
|
+
* @returns The maximum deferral interval in milliseconds
|
|
263
|
+
*
|
|
264
|
+
* Concurrency: concurrent config writers may not be observed immediately by readers.
|
|
265
|
+
* Filesystem note: config persistence/visibility may differ on Windows vs POSIX filesystems.
|
|
266
|
+
* Security: the returned value contains no sensitive tokens and is safe to log.
|
|
267
|
+
*/
|
|
268
|
+
export declare function getPreemptiveQuotaMaxDeferralMs(pluginConfig: PluginConfig): number;
|
|
269
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA4B/C,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAU3D,wBAAgB,iCAAiC,IAAI,IAAI,CAExD;AAuDD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,YA4CnC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED;;;;;;;;GAQG;AACH,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