/**
 * Identity Manager
 *
 * Handles loading, validating, and hot-reloading identity files
 * (SOUL.md, USER.md, AGENTS.md, TOOLS.md, IDENTITY.md).
 *
 * Project-level files (.codebuddy/) override global files (~/.codebuddy/)
 * for the same name. File changes are watched and hot-reloaded.
 */
import { EventEmitter } from 'events';
export interface IdentityFile {
    /** File name (e.g. 'SOUL.md') */
    name: string;
    /** File content */
    content: string;
    /** Whether the file comes from project or global directory */
    source: 'project' | 'global';
    /** Absolute path to the file */
    path: string;
    /** Last modification timestamp */
    lastModified: Date;
}
export interface IdentityManagerConfig {
    /** Project config directory name (default: '.codebuddy') */
    projectDir: string;
    /** Global config directory path (default: '~/.codebuddy') */
    globalDir: string;
    /** Whether to watch for file changes (default: true) */
    watchForChanges: boolean;
    /** Identity file names to load */
    fileNames: string[];
}
export interface IdentityManagerEvents {
    'identity:loaded': (files: IdentityFile[]) => void;
    'identity:changed': (file: IdentityFile) => void;
    'identity:error': (error: Error) => void;
}
export declare class IdentityManager extends EventEmitter {
    private config;
    private files;
    private watchers;
    private cwd;
    constructor(config?: Partial<IdentityManagerConfig>);
    /**
     * Load all identity files from project and global directories.
     * Project files override global files for the same name.
     */
    load(cwd: string): Promise<IdentityFile[]>;
    /**
     * Get a specific identity file by name.
     */
    get(name: string): IdentityFile | undefined;
    /**
     * Get all loaded identity files.
     */
    getAll(): IdentityFile[];
    /**
     * Write or update an identity file in the project directory.
     */
    set(name: string, content: string): Promise<void>;
    /**
     * Returns formatted string of all identity content for prompt injection.
     * Each file is wrapped in a section header and separated by horizontal rules.
     */
    getPromptInjection(): string;
    /**
     * Watch for file changes in project and global directories.
     * Automatically reloads changed identity files.
     */
    watch(cwd: string): void;
    /**
     * Stop watching for file changes.
     */
    unwatch(): void;
    /**
     * Load a single identity file, checking project dir first, then global.
     */
    private loadFile;
    /**
     * Read a single identity file from disk with metadata.
     */
    private readIdentityFile;
    /**
     * Watch a directory for changes to identity files.
     */
    private watchDirectory;
}
/**
 * Get or create the IdentityManager singleton.
 */
export declare function getIdentityManager(): IdentityManager;
/**
 * Reset the IdentityManager singleton (for testing).
 */
export declare function resetIdentityManager(): void;
