export type IdentityFileName = 'SOUL.md' | 'USER.md';
export interface StructuredEntry {
    id: string;
    category: string;
    summary: string;
    metadata?: Record<string, unknown>;
    createdAt: string;
    updatedAt: string;
}
export interface StructuredStore {
    version: 1;
    entries: StructuredEntry[];
}
export interface IdentitySnapshot {
    soul: string;
    user: string;
    structured: StructuredStore;
}
export declare function readIdentitySnapshot(projectDir: string): Promise<IdentitySnapshot>;
export declare function readIdentityFile(projectDir: string, fileName: IdentityFileName): Promise<string>;
export declare function writeIdentityFile(projectDir: string, fileName: IdentityFileName, content: string): Promise<void>;
export declare function readStructuredStore(projectDir: string): Promise<StructuredStore>;
export interface UpsertStructuredInput {
    id?: string;
    category: string;
    summary: string;
    metadata?: Record<string, unknown>;
}
export declare function upsertStructuredEntry(projectDir: string, input: UpsertStructuredInput, now?: Date): Promise<StructuredEntry>;
export declare function deleteStructuredEntry(projectDir: string, id: string): Promise<boolean>;
export declare function queryStructured(projectDir: string, filter?: {
    category?: string;
    q?: string;
}): Promise<StructuredEntry[]>;
/**
 * Build a compact identity context block suitable for inclusion in a system
 * prompt. Returns an empty string when nothing is configured so it can be
 * concatenated unconditionally.
 */
export declare function renderIdentityForPrompt(projectDir: string, options?: {
    maxChars?: number;
}): Promise<string>;
export interface IdentityExport {
    version: 1;
    exportedAt: string;
    snapshot: IdentitySnapshot;
}
export declare function exportIdentity(projectDir: string): Promise<IdentityExport>;
export interface ImportIdentityOptions {
    /** When true (default), structured entries are merged on id; when false, the existing structured store is replaced. */
    mergeStructured?: boolean;
    /** When true, SOUL.md / USER.md are overwritten only if the import payload contains a non-empty value. */
    overwriteFiles?: boolean;
}
export interface ImportIdentitySummary {
    importedSoul: boolean;
    importedUser: boolean;
    importedStructured: number;
    skippedStructured: number;
}
export declare function importIdentity(projectDir: string, payload: unknown, options?: ImportIdentityOptions): Promise<ImportIdentitySummary>;
export interface IdentityGcOptions {
    /** Drop entries older than this many days. Defaults to 90. */
    maxAgeDays?: number;
}
export interface IdentityGcSummary {
    scanned: number;
    removed: number;
    pinnedKept: number;
}
/**
 * Drop structured entries that have not been updated in `maxAgeDays`. Entries
 * with `metadata.pinned === true` are always kept regardless of age.
 */
export declare function runIdentityGc(projectDir: string, options?: IdentityGcOptions, now?: Date): Promise<IdentityGcSummary>;
//# sourceMappingURL=identity.d.ts.map