diff --git a/lib/audit.ts b/lib/audit.ts index 93764022..0af9df20 100644 --- a/lib/audit.ts +++ b/lib/audit.ts @@ -29,7 +29,7 @@ export enum AuditOutcome { PARTIAL = "partial", } -export interface AuditEntry { +interface AuditEntry { timestamp: string; correlationId: string | null; action: AuditAction; diff --git a/lib/auth/device-auth.ts b/lib/auth/device-auth.ts index be257d56..a7a8676d 100644 --- a/lib/auth/device-auth.ts +++ b/lib/auth/device-auth.ts @@ -30,7 +30,7 @@ export interface DeviceAuthCode { expiresAtMs?: number; } -export interface DeviceAuthCompletion { +interface DeviceAuthCompletion { authorizationCode: string; codeVerifier: string; } diff --git a/lib/codex-manager/behavior-settings-panel.ts b/lib/codex-manager/behavior-settings-panel.ts index 516990ab..0a2aaa4f 100644 --- a/lib/codex-manager/behavior-settings-panel.ts +++ b/lib/codex-manager/behavior-settings-panel.ts @@ -4,7 +4,7 @@ import type { UI_COPY } from "../ui/ui-copy.js"; import { getUiRuntimeOptions } from "../ui/runtime.js"; import { type MenuItem, select } from "../ui/select.js"; -export type BehaviorConfigAction = +type BehaviorConfigAction = | { type: "set-delay"; delayMs: number } | { type: "toggle-pause" } | { type: "toggle-menu-limit-fetch" } diff --git a/lib/codex-manager/commands/uninstall.ts b/lib/codex-manager/commands/uninstall.ts index b1497f3d..039a72ab 100644 --- a/lib/codex-manager/commands/uninstall.ts +++ b/lib/codex-manager/commands/uninstall.ts @@ -40,7 +40,7 @@ export function removePluginFromList(list: unknown[]): unknown[] { }); } -export type UninstallCliOptions = { +type UninstallCliOptions = { dryRun: boolean; json: boolean; clearAccounts: boolean; diff --git a/lib/codex-manager/commands/verify.ts b/lib/codex-manager/commands/verify.ts index 91726f45..7b0f3f3b 100644 --- a/lib/codex-manager/commands/verify.ts +++ b/lib/codex-manager/commands/verify.ts @@ -12,7 +12,7 @@ type ParsedArgsResult = | { ok: true; options: T } | { ok: false; message: string }; -export interface VerifyPathStep { +interface VerifyPathStep { name: string; input?: string; output?: string; @@ -20,7 +20,7 @@ export interface VerifyPathStep { error?: string; } -export interface VerifySandboxResult { +interface VerifySandboxResult { name: string; input: string; rejected: boolean; diff --git a/lib/codex-manager/commands/why-selected.ts b/lib/codex-manager/commands/why-selected.ts index ba7cdc5c..c13eacb9 100644 --- a/lib/codex-manager/commands/why-selected.ts +++ b/lib/codex-manager/commands/why-selected.ts @@ -13,7 +13,7 @@ type ParsedArgsResult = | { ok: true; options: T } | { ok: false; message: string }; -export interface WhySelectedRuntimeSnapshot { +interface WhySelectedRuntimeSnapshot { lastSwitchReason?: string; lastRateLimitReason?: string; cooldownReason?: string; @@ -37,7 +37,7 @@ export interface WhySelectedCommandDeps { logError?: (message: string) => void; } -export interface WhySelectedCandidateRecord { +interface WhySelectedCandidateRecord { index: number; oneBasedIndex: number; email?: string; @@ -56,7 +56,7 @@ export interface WhySelectedCandidateRecord { reason?: string; } -export interface WhySelectedSelectedRecord extends WhySelectedCandidateRecord { +interface WhySelectedSelectedRecord extends WhySelectedCandidateRecord { selectionReason: string; } diff --git a/lib/codex-manager/dashboard-display-panel.ts b/lib/codex-manager/dashboard-display-panel.ts index bc9cfec3..6420c11f 100644 --- a/lib/codex-manager/dashboard-display-panel.ts +++ b/lib/codex-manager/dashboard-display-panel.ts @@ -27,7 +27,7 @@ export interface DashboardDisplaySettingOption { description: string; } -export type DashboardConfigAction = +type DashboardConfigAction = | { type: "toggle"; key: DashboardDisplaySettingKey } | { type: "cycle-sort-mode" } | { type: "cycle-layout-mode" } diff --git a/lib/codex-manager/experimental-settings-prompt.ts b/lib/codex-manager/experimental-settings-prompt.ts index 268b45c4..7092d99b 100644 --- a/lib/codex-manager/experimental-settings-prompt.ts +++ b/lib/codex-manager/experimental-settings-prompt.ts @@ -21,7 +21,7 @@ import type { mapExperimentalStatusHotkey, } from "./experimental-settings-schema.js"; -export type ExperimentalSettingsCopy = { +type ExperimentalSettingsCopy = { experimentalSync: string; experimentalBackup: string; experimentalRefreshGuard: string; diff --git a/lib/codex-manager/help.ts b/lib/codex-manager/help.ts index 2277bcd8..f4eadf6d 100644 --- a/lib/codex-manager/help.ts +++ b/lib/codex-manager/help.ts @@ -130,7 +130,7 @@ export function parseAuthLoginArgs(args: string[]): ParsedAuthLoginArgs { return { ok: true, options }; } -export interface BestCliOptions { +interface BestCliOptions { live: boolean; json: boolean; model: string; diff --git a/lib/codex-manager/repair-commands.ts b/lib/codex-manager/repair-commands.ts index 3dfe62bb..3bd23940 100644 --- a/lib/codex-manager/repair-commands.ts +++ b/lib/codex-manager/repair-commands.ts @@ -70,13 +70,13 @@ export interface FixCliOptions { model: string; } -export interface VerifyFlaggedCliOptions { +interface VerifyFlaggedCliOptions { dryRun: boolean; json: boolean; restore: boolean; } -export interface DoctorCliOptions { +interface DoctorCliOptions { json: boolean; fix: boolean; dryRun: boolean; diff --git a/lib/codex-manager/statusline-settings-panel.ts b/lib/codex-manager/statusline-settings-panel.ts index b8df9eb5..80bd9563 100644 --- a/lib/codex-manager/statusline-settings-panel.ts +++ b/lib/codex-manager/statusline-settings-panel.ts @@ -7,7 +7,7 @@ import type { UI_COPY } from "../ui/ui-copy.js"; import { getUiRuntimeOptions } from "../ui/runtime.js"; import { type MenuItem, select } from "../ui/select.js"; -export type StatuslineConfigAction = +type StatuslineConfigAction = | { type: "toggle"; key: DashboardStatuslineField } | { type: "move-up"; key: DashboardStatuslineField } | { type: "move-down"; key: DashboardStatuslineField } @@ -15,7 +15,7 @@ export type StatuslineConfigAction = | { type: "save" } | { type: "cancel" }; -export interface StatuslineFieldOption { +interface StatuslineFieldOption { key: DashboardStatuslineField; label: string; description: string; diff --git a/lib/codex-manager/theme-settings-panel.ts b/lib/codex-manager/theme-settings-panel.ts index 49813d91..97471cee 100644 --- a/lib/codex-manager/theme-settings-panel.ts +++ b/lib/codex-manager/theme-settings-panel.ts @@ -8,7 +8,7 @@ import type { UI_COPY } from "../ui/ui-copy.js"; import { getUiRuntimeOptions } from "../ui/runtime.js"; import { type MenuItem, select } from "../ui/select.js"; -export type ThemeConfigAction = +type ThemeConfigAction = | { type: "set-palette"; palette: DashboardThemePreset } | { type: "set-accent"; accent: DashboardAccentColor } | { type: "reset" } diff --git a/lib/dashboard-settings.ts b/lib/dashboard-settings.ts index 32841501..4199772a 100644 --- a/lib/dashboard-settings.ts +++ b/lib/dashboard-settings.ts @@ -12,8 +12,8 @@ import { export type DashboardThemePreset = "green" | "blue"; export type DashboardAccentColor = "green" | "cyan" | "blue" | "yellow"; export type DashboardAccountSortMode = "manual" | "ready-first"; -export type DashboardLayoutMode = "compact-details" | "expanded-rows"; -export type DashboardFocusStyle = "row-invert"; +type DashboardLayoutMode = "compact-details" | "expanded-rows"; +type DashboardFocusStyle = "row-invert"; export interface DashboardDisplaySettings { showPerAccountRows: boolean; diff --git a/lib/errors.ts b/lib/errors.ts index 4da17b87..1b1a6828 100644 --- a/lib/errors.ts +++ b/lib/errors.ts @@ -16,8 +16,6 @@ export const ErrorCode = { CODEX_UNAVAILABLE: "CODEX_UNAVAILABLE", } as const; -export type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode]; - /** * Options for creating a CodexError. */ diff --git a/lib/forecast.ts b/lib/forecast.ts index 6db6d148..1ca1e4fa 100644 --- a/lib/forecast.ts +++ b/lib/forecast.ts @@ -10,8 +10,8 @@ import { getRateLimitResetTimeForFamily } from "./runtime/account-status.js"; import type { AccountMetadataV3 } from "./storage.js"; import type { TokenFailure } from "./types.js"; -export type ForecastAvailability = "ready" | "delayed" | "unavailable"; -export type ForecastRiskLevel = "low" | "medium" | "high"; +type ForecastAvailability = "ready" | "delayed" | "unavailable"; +type ForecastRiskLevel = "low" | "medium" | "high"; export interface ForecastAccountInput { index: number; @@ -54,7 +54,7 @@ export interface ForecastRecommendation { reason: string; } -export interface ForecastExplanationAccount { +interface ForecastExplanationAccount { index: number; label: string; isCurrent: boolean; diff --git a/lib/oc-chatgpt-import-adapter.ts b/lib/oc-chatgpt-import-adapter.ts index 21cce0c4..37cb3cb6 100644 --- a/lib/oc-chatgpt-import-adapter.ts +++ b/lib/oc-chatgpt-import-adapter.ts @@ -18,7 +18,7 @@ export type OcChatgptPreviewPayload = { accounts: OcChatgptAccountRef[]; }; -export type OcChatgptAccountRef = { +type OcChatgptAccountRef = { accountId?: string; email?: string; refreshTokenLast4: string; diff --git a/lib/oc-chatgpt-target-detection.ts b/lib/oc-chatgpt-target-detection.ts index a3378c8d..19edfe5d 100644 --- a/lib/oc-chatgpt-target-detection.ts +++ b/lib/oc-chatgpt-target-detection.ts @@ -63,7 +63,7 @@ export type OcChatgptTargetNone = { >; }; -export type OcChatgptTargetFound = { +type OcChatgptTargetFound = { kind: "target"; descriptor: OcChatgptTargetDescriptor; }; diff --git a/lib/recovery.ts b/lib/recovery.ts index 3becf6f7..458750a0 100644 --- a/lib/recovery.ts +++ b/lib/recovery.ts @@ -11,14 +11,14 @@ import { } from "./recovery/storage.js"; import type { MessageInfo, + ResumeConfig, MessageData, MessagePart, RecoveryErrorType, - ResumeConfig, ToolResultPart, } from "./recovery/types.js"; -export type { RecoveryErrorType, MessageInfo, MessageData, ResumeConfig }; +export type { RecoveryErrorType }; type PluginClient = PluginInput["client"]; diff --git a/lib/recovery/types.ts b/lib/recovery/types.ts index e109051a..4d3477fa 100644 --- a/lib/recovery/types.ts +++ b/lib/recovery/types.ts @@ -8,9 +8,6 @@ // Storage Types (for reading from host runtime filesystem) // ============================================================================= -export type ThinkingPartType = "thinking" | "redacted_thinking" | "reasoning"; -export type MetaPartType = "step-start" | "step-finish"; -export type ContentPartType = "text" | "tool" | "tool_use" | "tool_result"; export interface StoredMessageMeta { id: string; @@ -34,7 +31,7 @@ export interface StoredTextPart { ignored?: boolean; } -export interface StoredToolPart { +interface StoredToolPart { id: string; sessionID: string; messageID: string; @@ -49,7 +46,7 @@ export interface StoredToolPart { }; } -export interface StoredReasoningPart { +interface StoredReasoningPart { id: string; sessionID: string; messageID: string; @@ -57,7 +54,7 @@ export interface StoredReasoningPart { text: string; } -export interface StoredStepPart { +interface StoredStepPart { id: string; sessionID: string; messageID: string; @@ -136,13 +133,6 @@ export type RecoveryErrorType = | "thinking_disabled_violation" | null; -export interface ToolUsePart { - type: "tool_use"; - id: string; - name: string; - input: Record; -} - export interface ToolResultPart { type: "tool_result"; tool_use_id: string; diff --git a/lib/request/response-compaction.ts b/lib/request/response-compaction.ts index 82d6f5f8..db9fae54 100644 --- a/lib/request/response-compaction.ts +++ b/lib/request/response-compaction.ts @@ -4,7 +4,7 @@ import { isRecord } from "../utils.js"; import { getModelCapabilities } from "./helpers/model-map.js"; import { trimInputForFastSession } from "./request-transformer.js"; -export interface DeferredFastSessionInputTrim { +interface DeferredFastSessionInputTrim { maxItems: number; preferLatestUserOnly: boolean; } diff --git a/lib/rotation.ts b/lib/rotation.ts index 4308d35b..e139f811 100644 --- a/lib/rotation.ts +++ b/lib/rotation.ts @@ -8,16 +8,6 @@ import { createLogger } from "./logger.js"; -// PR-N / R4: re-export SelectionRecord + RoutingMutexMode so rotation.ts -// remains the canonical entry point for "selection decision" types even -// though the concrete mutex lives in ./routing-mutex.ts. Callers wiring -// the fetch loop only need to import from `lib/rotation`. -export type { - SelectionRecord, - RoutingMutexMode, - AsyncMutex, -} from "./routing-mutex.js"; - const log = createLogger("rotation"); // ============================================================================ diff --git a/lib/runtime/first-run.ts b/lib/runtime/first-run.ts index eb3285b4..21d05ed0 100644 --- a/lib/runtime/first-run.ts +++ b/lib/runtime/first-run.ts @@ -43,14 +43,14 @@ const CI_ENV_KEYS = [ "BITBUCKET_BUILD_NUMBER", ]; -export type FirstRunStepStatus = "completed" | "skipped" | "failed"; +type FirstRunStepStatus = "completed" | "skipped" | "failed"; -export interface FirstRunSetupOutcome { +interface FirstRunSetupOutcome { appBind: FirstRunStepStatus; launcher: FirstRunStepStatus; } -export type FirstRunSkipReason = +type FirstRunSkipReason = | "ci" | "not-installed" | "already-done" diff --git a/lib/runtime/quota-headers.ts b/lib/runtime/quota-headers.ts index 5724f078..8f8ce247 100644 --- a/lib/runtime/quota-headers.ts +++ b/lib/runtime/quota-headers.ts @@ -1,6 +1,6 @@ import type { CodexQuotaSnapshot, CodexQuotaWindow } from "../quota-probe.js"; -export type { CodexQuotaSnapshot, CodexQuotaWindow } from "../quota-probe.js"; +export type { CodexQuotaSnapshot } from "../quota-probe.js"; export type ParsedCodexQuotaSnapshot = Omit; diff --git a/lib/runtime/runtime-current-account.ts b/lib/runtime/runtime-current-account.ts index 0b007461..04009d01 100644 --- a/lib/runtime/runtime-current-account.ts +++ b/lib/runtime/runtime-current-account.ts @@ -8,12 +8,12 @@ import { getCodexMultiAuthDir } from "../runtime-paths.js"; import type { AccountStorageV3 } from "../storage.js"; import { isRecord } from "../utils.js"; -export type RuntimeCurrentAccountSource = +type RuntimeCurrentAccountSource = | "runtime-observability" | "app-bind" | "app-helper"; -export type RuntimeCurrentAccountMatch = "account-id" | "email" | "index"; +type RuntimeCurrentAccountMatch = "account-id" | "email" | "index"; export type AccountCurrentMarker = "current" | "in-use" | "selected"; diff --git a/lib/runtime/runtime-observability.ts b/lib/runtime/runtime-observability.ts index e5458ced..cd76d07f 100644 --- a/lib/runtime/runtime-observability.ts +++ b/lib/runtime/runtime-observability.ts @@ -2,7 +2,7 @@ import { existsSync, readFileSync, promises as fs } from "node:fs"; import { join } from "node:path"; import { getCodexMultiAuthDir } from "../runtime-paths.js"; -export interface RuntimeMetricsSnapshot { +interface RuntimeMetricsSnapshot { startedAt: number; totalRequests: number; successfulRequests: number; diff --git a/lib/schemas.ts b/lib/schemas.ts index a24e1f05..22aa1df3 100644 --- a/lib/schemas.ts +++ b/lib/schemas.ts @@ -109,8 +109,6 @@ const CooldownReasonSchema = z.enum([ "rate-limit", ]); -export type CooldownReasonFromSchema = z.infer; - /** * Last switch reason for account rotation tracking. */ @@ -123,8 +121,6 @@ const SwitchReasonSchema = z.enum([ "manual", ]); -export type SwitchReasonFromSchema = z.infer; - /** * Switch reasons that callers may pass to `persistAndSyncSelectedAccount`. * Excludes the runtime-internal reasons (`rate-limit`, `initial`) which are @@ -147,8 +143,6 @@ const RateLimitStateV3Schema = z.record( z.number().optional(), ); -export type RateLimitStateV3FromSchema = z.infer; - /** * Workspace entry within an account. Supports a single OpenAI/Google account * that belongs to multiple ChatGPT workspaces (e.g. personal Plus + a @@ -163,8 +157,6 @@ const WorkspaceSchema = z.object({ isDefault: z.boolean().optional(), }); -export type WorkspaceFromSchema = z.infer; - /** * Account metadata V3 - current storage format. */ @@ -190,10 +182,6 @@ export const AccountMetadataV3Schema = z.object({ currentWorkspaceIndex: z.number().optional(), }); -export type AccountMetadataV3FromSchema = z.infer< - typeof AccountMetadataV3Schema ->; - /** * Build activeIndexByFamily schema dynamically from MODEL_FAMILIES. */ @@ -210,10 +198,6 @@ const ActiveIndexByFamilySchema = z ) .partial(); -export type ActiveIndexByFamilyFromSchema = z.infer< - typeof ActiveIndexByFamilySchema ->; - /** * Account storage V3 - current storage format with per-family active indices. */ @@ -248,10 +232,6 @@ const AccountMetadataV1Schema = z.object({ cooldownReason: CooldownReasonSchema.optional(), }); -export type AccountMetadataV1FromSchema = z.infer< - typeof AccountMetadataV1Schema ->; - /** * Legacy V1 storage format for migration support. */ @@ -261,8 +241,6 @@ export const AccountStorageV1Schema = z.object({ activeIndex: z.number().min(0), }); -export type AccountStorageV1FromSchema = z.infer; - /** * Union of V1 and V3 storage formats for migration detection. */ @@ -290,10 +268,6 @@ export const FlaggedAccountMetadataV1Schema = AccountMetadataV3Schema.extend({ lastError: z.string().optional(), }).passthrough(); -export type FlaggedAccountMetadataV1FromSchema = z.infer< - typeof FlaggedAccountMetadataV1Schema ->; - /** * Flagged account storage V1 format (version: 1, accounts: []). */ diff --git a/lib/storage/migrations.ts b/lib/storage/migrations.ts index ea81d9f5..7156c05e 100644 --- a/lib/storage/migrations.ts +++ b/lib/storage/migrations.ts @@ -15,7 +15,7 @@ import type { RateLimitStateV3, } from "./public-types.js"; -export interface AccountMetadataV1 { +interface AccountMetadataV1 { accountId?: string; accountIdSource?: AccountIdSource; accountLabel?: string; diff --git a/lib/ui/theme.ts b/lib/ui/theme.ts index dc251cb6..4f92d3e5 100644 --- a/lib/ui/theme.ts +++ b/lib/ui/theme.ts @@ -7,7 +7,7 @@ export type UiGlyphMode = "ascii" | "unicode" | "auto"; export type UiPalette = "green" | "blue"; export type UiAccent = "green" | "cyan" | "blue" | "yellow"; -export interface UiGlyphSet { +interface UiGlyphSet { selected: string; unselected: string; bullet: string; @@ -15,7 +15,7 @@ export interface UiGlyphSet { cross: string; } -export interface UiThemeColors { +interface UiThemeColors { reset: string; dim: string; muted: string;