import type { FasedAgentConfig } from "../config/config.js";
import { type DoctorMemoryRepairPreviewAction } from "./inventory.js";
import { DOCTOR_MEMORY_REPAIR_EXECUTION_METHOD } from "./repair-execution-request-contract.js";
export type DoctorMemoryRepairExecuteSurface = "cli" | "dashboard-admin";
export type DoctorMemoryRepairExecuteInput = {
    cfg: FasedAgentConfig;
    agentId: string;
    proposalIds: string[];
    surface: DoctorMemoryRepairExecuteSurface;
    confirmation: "cli-yes" | "confirmation-token";
    allowWrites: boolean;
    acceptedPreviewFingerprint?: string;
    acceptedAuditPlanFingerprint?: string;
    acceptCurrentPreview?: boolean;
    acceptCurrentAuditPlan?: boolean;
    executionId?: string;
    now?: Date;
    env?: NodeJS.ProcessEnv;
};
export type DoctorMemoryRepairExecuteStep = {
    proposalId: string;
    action: DoctorMemoryRepairPreviewAction;
    stage: "backup" | "write" | "rollback" | "audit" | "lock" | "gate" | "fs-safety";
    status: "succeeded" | "failed" | "skipped";
    targetPath?: string;
    snapshotPath?: string;
    message?: string;
    errorCode?: string;
};
export type DoctorMemoryRepairExecuteResult = {
    schemaVersion: 1;
    kind: "doctor.memory.repair.execution.result";
    method: typeof DOCTOR_MEMORY_REPAIR_EXECUTION_METHOD;
    dryRun: false;
    noWritePerformed: boolean;
    executionId: string;
    agentId: string;
    status: "success" | "failure" | "partial-write" | "denied" | "idempotent";
    previewFingerprint: string;
    auditPlanFingerprint?: string;
    selectedProposalIds: string[];
    backupManifestPath?: string;
    auditRecordPath?: string;
    lockPath?: string;
    summary: {
        selected: number;
        backupSucceeded: number;
        writeSucceeded: number;
        failed: number;
        skipped: number;
    };
    rollback: {
        attempted: boolean;
        status: "not-needed" | "completed" | "failed" | "manual-required";
        reasons: string[];
    };
    steps: DoctorMemoryRepairExecuteStep[];
    reasons: string[];
};
export declare function executeMemoryRepair(input: DoctorMemoryRepairExecuteInput): Promise<DoctorMemoryRepairExecuteResult>;
