import { DEFAULT_PREFERENCES, PREFERENCES_SCHEMA_VERSION, type ProjectPreferences } from './preferences-types.js'; export { DEFAULT_PREFERENCES, PREFERENCES_SCHEMA_VERSION }; export type { ProjectPreferences } from './preferences-types.js'; export declare function preferencesPath(projectRoot: string): string; export declare function loadPreferences(projectRoot: string): ProjectPreferences; export declare function savePreferences(projectRoot: string, overrides: Partial): ProjectPreferences; /** * Atomic write helper for preferences.json. Writes to `.tmp--` * and renames over the target. On Windows, `rename` is atomic for files * on the same volume; on POSIX, `rename(2)` is atomic by spec. */ export declare function writeAtomic(filePath: string, prefs: ProjectPreferences): void; /** * Slice 2026-06-23-audit-4th #C1: migrate a legacy preferences.json * (any `schema_version` older than PREFERENCES_SCHEMA_VERSION) to the * current shape. Returns the migrated object + a list of changes * applied (for surfacing in the CLI envelope and the migration log). * * The v1 → v2 mapping fills in the `headroom.perTouchpoint` sub-keys * that v1 didn't track: each touchpoint gets the v1 `headroom.defaultMode` * (or 'balanced' if absent), and `compressMinBytes` is preserved * verbatim. v1's `agentShieldPrompt` and `loopAutonomousEnabled` were * already present, so they carry through unchanged. The `fanout` field * is new in v2 — it defaults to `{ defaultMode: 'fan-out' }` so the * pre-v2 behavior (peak-solo SKILL instructed fan-out when ≥ 2 leaves) * is preserved. */ export type MigrateResult = { readonly fromVersion: string; readonly toVersion: typeof PREFERENCES_SCHEMA_VERSION; readonly migrated: ProjectPreferences; readonly changes: readonly string[]; readonly written: boolean; }; export declare function migratePreferences(projectRoot: string, opts?: { write?: boolean; now?: () => Date; }): MigrateResult | null;