/** * Current on-disk schema version. Bumped when the persisted layout requires * a one-time migration. One-way gate — no rollback. */ export declare const CONFIG_VERSION: 2; /** * Resolve the canonical config path lazily. Computing on each call (instead of * caching at module load) keeps the path responsive to vitest's `vi.doMock` * for `node:os` — which only reliably reaches cli-core's compiled `homedir()` * call after the mock has been set up by the test, not at import time. */ export declare function getConfigPath(): string; export type AuthMode = 'read-only' | 'read-write' | 'unknown'; export type UpdateChannel = 'stable' | 'pre-release'; export declare const UPDATE_CHANNELS: ReadonlySet; export interface UserSettings { unarchiveNewThreads?: boolean; } /** * One row of the `users[]` array. `id` is the stringified numeric Twist user * id. `token` is a plaintext fallback persisted only when the keyring is * unavailable at write time. */ export type StoredUser = { id: string; name: string; authMode?: AuthMode; authScope?: string; token?: string; }; export interface Config { config_version?: number; users?: StoredUser[]; defaultUserId?: string; token?: string; pendingSecureStoreClear?: boolean; authMode?: AuthMode; authScope?: string; authUserId?: number; authUserName?: string; currentWorkspace?: number; updateChannel?: UpdateChannel; userSettings?: UserSettings; } /** * Thin wrapper around cli-core's lenient `readConfig`. Returns `{}` when the * file is missing, unreadable, or invalid — runtime code paths treat "no * config" and "empty config" the same. Use `readConfigStrict` for inspection * commands that need to distinguish failure modes. */ export declare function getConfig(): Promise; export type StrictReadResult = { state: 'missing'; } | { state: 'present'; config: Config; }; /** * Read and parse the config file strictly — for inspection commands that need * to distinguish "missing" from "present but broken". `getConfig` deliberately * swallows errors for runtime code paths; this one surfaces them. */ export declare function readConfigStrict(): Promise; /** Thin wrapper around cli-core's `writeConfig`. Dual-writes the channel field. */ export declare function setConfig(config: Config): Promise; /** * Atomic partial-write wrapper around cli-core's `updateConfig`. Preserves * cli-core's read-merge-write atomicity so two concurrent `tw` processes * can't lose each other's updates. Channel field is translated to disk * shape (dual-written) before the merge. */ export declare function updateConfig(updates: Partial): Promise; export declare function validateConfigForDoctor(config: Record): string[]; //# sourceMappingURL=config.d.ts.map