/**
 * Settings Module for Cyclist
 *
 * Simple file-based persistence for Cyclist settings.
 * Settings stored in .pennyfarthing/config.local.yaml
 */
/**
 * Permission modes for Claude Code (gearshift)
 * - plan: Read-only planning mode
 * - manual: Ask permission for everything (default)
 * - accept: Auto-accept file edits
 *
 * Note: 'turbo' was removed in MSSCI-12395. Auto-handoff is now controlled
 * by the separate relay_mode setting. Old turbo configs are migrated to
 * permission_mode: 'accept' + relay_mode: true.
 */
export type PermissionMode = 'plan' | 'manual' | 'accept';
export interface WorkflowSettings {
    permission_mode: PermissionMode;
    relay_mode?: boolean;
}
export interface AccountSettings {
    billing_rollover_day: 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
}
export type AccountsSettings = Record<string, AccountSettings>;
export interface CyclistSettings {
    workflow: WorkflowSettings;
    accounts?: AccountsSettings;
}
export type PartialSettings = {
    workflow?: Partial<WorkflowSettings>;
    accounts?: AccountsSettings;
};
export type SettingsInput = PartialSettings & {
    pennyfarthing?: {
        theme?: string;
    };
};
export declare const USER_SETTINGS_DIR: string;
export declare const PROJECT_SETTINGS_FILE = ".pennyfarthing/config.local.yaml";
export declare const GRANTS_FILE: string;
/**
 * Get a copy of the default settings
 */
export declare function getDefaultSettings(): CyclistSettings;
/**
 * Ensure the settings directory exists
 */
export declare function ensureSettingsDir(): void;
/**
 * Parse YAML string to settings object
 */
export declare function parseSettings(yamlContent: string): PartialSettings;
/**
 * Serialize settings to YAML string
 */
export declare function serializeSettings(settings: CyclistSettings): string;
/**
 * Validate settings object structure
 */
export declare function validateSettings(settings: unknown): boolean;
/**
 * Migrate legacy settings to new format
 *
 * Migration paths:
 * - permission_mode: 'turbo' → permission_mode: 'accept' + relay_mode: true
 * - handoff_mode: 'auto' → relay_mode: true
 * - handoff_mode: 'manual' → relay_mode: false
 * - auto_handoff: true → relay_mode: true
 * - auto_handoff: false → relay_mode: false
 */
export declare function migrateSettings(settings: PartialSettings): CyclistSettings;
/**
 * Deep merge settings objects
 */
export declare function mergeSettings(base: CyclistSettings, override: PartialSettings): CyclistSettings;
/**
 * Load project settings from .pennyfarthing/config.local.yaml
 */
export declare function loadProjectSettings(projectDir: string): PartialSettings;
/**
 * Load settings with optional project directory
 */
export declare function loadSettings(projectDir?: string): CyclistSettings;
/**
 * @deprecated Use saveProjectSettings instead
 */
export declare function saveUserSettings(settings: Partial<CyclistSettings>, projectDir?: string): boolean;
/**
 * Save settings to .pennyfarthing/config.local.yaml
 * Uses read-modify-write: reads entire file, deep merges changes, writes back.
 */
export declare function saveProjectSettings(settings: Partial<CyclistSettings>, projectDir?: string): boolean;
/**
 * Initialize settings on app startup
 */
export declare function initializeSettings(projectDir?: string): CyclistSettings;
/**
 * Get current in-memory settings
 */
export declare function getCurrentSettings(): CyclistSettings;
/**
 * Register a callback to be notified when settings change
 */
export declare function onSettingsChange(callback: (settings: CyclistSettings) => void): () => void;
export declare const GrantType: {
    readonly ONCE: "once";
    readonly SESSION: "session";
    readonly ALWAYS: "always";
};
export type GrantTypeValue = (typeof GrantType)[keyof typeof GrantType];
export interface PermissionGrant {
    tool: string;
    scope: string;
    grant_type: GrantTypeValue;
    granted_at: string;
}
export declare function validateGrant(grant: unknown): boolean;
export declare function loadGrants(): PermissionGrant[];
export declare function saveGrants(grants: PermissionGrant[]): boolean;
export type BillingDay = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
export declare function getBillingRolloverDay(email: string | null): BillingDay;
/**
 * Check if turbo mode is enabled (legacy compatibility function)
 *
 * Turbo mode = auto-accept everything + auto-handoff to next agent.
 * Now implemented as: permission_mode: 'accept' + relay_mode: true
 *
 * @deprecated Check permission_mode and relay_mode separately instead
 */
export declare function isTurboModeEnabled(settings: Pick<CyclistSettings, 'workflow'>): boolean;
/**
 * @deprecated Use isTurboModeEnabled instead
 */
export declare function isAutoModeEnabled(settings: Pick<CyclistSettings, 'workflow'>): boolean;
//# sourceMappingURL=settings.d.ts.map