import type { FasedAgentConfig } from "../config/config.js";
import type { PluginRecord } from "../plugins/registry.js";
import type { MemoryProviderStatus } from "./types.js";
export type MemoryInventoryPathStatus = {
    path: string;
    redacted?: boolean;
    exists: boolean;
    kind: "file" | "directory" | "symlink" | "other" | "missing" | "error";
    markdownFiles?: number;
    truncated?: boolean;
    error?: string;
};
export type SessionMemoryFilenameDiagnostics = {
    checked: true;
    status: "none" | "suffixes-present" | "truncated" | "unavailable";
    groups: Array<{
        stem: string;
        state: "collision-suffixed" | "suffix-gap";
        files: Array<{
            name: string;
            suffix: number;
        }>;
    }>;
    truncated?: boolean;
    error?: string;
};
export type DoctorMemoryInventoryPayload = {
    agentId: string;
    workspace: {
        path: string;
        exists: boolean;
        memoryRoots: Array<MemoryInventoryPathStatus & {
            id: "MEMORY.md" | "memory.md" | "memory-dir";
        }>;
    };
    backend: {
        configured: "builtin" | "qmd";
        active?: "builtin" | "qmd";
        citations: "auto" | "on" | "off";
        provider?: string;
        model?: string;
        requestedProvider?: string;
        files?: number;
        chunks?: number;
        dirty?: boolean;
        db?: MemoryInventoryPathStatus;
        sources?: MemoryProviderStatus["sources"];
        sourceCounts?: MemoryProviderStatus["sourceCounts"];
        extraPaths?: MemoryInventoryPathStatus[];
        error?: string;
    };
    qmd: {
        enabled: boolean;
        command?: string;
        searchMode?: string;
        index?: MemoryInventoryPathStatus;
        collections?: Array<MemoryInventoryPathStatus & {
            name: string;
            pattern: string;
            collectionKind: "memory" | "custom" | "sessions";
        }>;
        sessions?: {
            enabled: boolean;
            exportDir?: MemoryInventoryPathStatus;
            retentionDays?: number;
        };
        mcporter?: {
            enabled: boolean;
            serverName: string;
            startDaemon: boolean;
        };
    };
    sessionMemory: {
        hookConfigured: boolean;
        enabled: boolean;
        messages?: number;
        llmSlug?: boolean;
        memoryDir: MemoryInventoryPathStatus;
        filenameDiagnostics?: SessionMemoryFilenameDiagnostics;
    };
    memoryPlugin: {
        configuredSlot: string | null;
        enabled: boolean;
        registryLoaded: boolean;
        active?: {
            id: string;
            name: string;
            kind?: string;
            origin: string;
            status: PluginRecord["status"];
            enabled: boolean;
            toolNames: string[];
            error?: string;
        };
        reason?: string;
    };
};
export type DoctorMemoryValidationSeverity = "error" | "warn" | "info";
export type DoctorMemoryValidationFinding = {
    severity: DoctorMemoryValidationSeverity;
    code: string;
    area: "workspace" | "backend" | "qmd" | "session-memory" | "plugin";
    message: string;
    path?: string;
};
export type DoctorMemoryValidationPayload = {
    agentId: string;
    ok: boolean;
    summary: {
        errors: number;
        warnings: number;
        info: number;
    };
    findings: DoctorMemoryValidationFinding[];
};
export type DoctorMemoryRepairPreviewAction = "create_file" | "create_directory" | "rebuild_index" | "review_backend" | "review_config" | "review_plugin" | "manual_review" | "seed_memory";
export type DoctorMemoryRepairPreviewProposal = {
    id: string;
    area: DoctorMemoryValidationFinding["area"];
    sourceCode: string;
    severity: DoctorMemoryValidationSeverity;
    action: DoctorMemoryRepairPreviewAction;
    description: string;
    targetPath?: string;
    dryRun: true;
    wouldMutate: true;
    requiresOperatorWrite: true;
    supported: boolean;
    blockReason?: string;
};
export type DoctorMemoryRepairPreviewPayload = {
    agentId: string;
    dryRun: true;
    ok: boolean;
    validation: DoctorMemoryValidationPayload["summary"];
    summary: {
        proposals: number;
        supported: number;
        blocked: number;
    };
    proposals: DoctorMemoryRepairPreviewProposal[];
};
export declare function buildMemoryInventory(params: {
    cfg: FasedAgentConfig;
    agentId: string;
    providerStatus?: MemoryProviderStatus;
    providerError?: string;
}): Promise<DoctorMemoryInventoryPayload>;
export declare function validateMemoryInventory(inventory: DoctorMemoryInventoryPayload): DoctorMemoryValidationPayload;
export declare function previewMemoryInventoryRepair(inventory: DoctorMemoryInventoryPayload): DoctorMemoryRepairPreviewPayload;
