/**
 * Programmatic fix handler registry.
 * Provides matchHandler(), resolveHandlerChain(), executeHandlerChain() for
 * replacing shell-metachar-blocked fixCommands with safe TypeScript handlers.
 *
 * Handler registration order: sysctl, fileAppend, fileWrite, packageInstall, chmodChown, sedReplace, aptUpgrade, systemctl
 */
export interface HandlerParams {
    type: "sysctl" | "file-append" | "file-write" | "package-install" | "chmod-chown" | "sed-replace" | "apt-upgrade" | "systemctl";
    [key: string]: unknown;
}
/** Diff information collected during handler execution for --diff preview */
export interface DiffLine {
    handlerType: "sysctl" | "file-append" | "file-write" | "package-install" | "chmod-chown" | "sed-replace" | "apt-upgrade" | "systemctl";
    key: string;
    before: string;
    after: string;
}
export interface HandlerResult {
    success: boolean;
    skipped?: boolean;
    error?: string;
    diff?: DiffLine;
}
/** Diff entry collected during fix loop — shared by CLI and MCP fix paths */
export interface CollectedDiff {
    checkId: string;
    category: string;
    severity: string;
    diff?: DiffLine;
}
/** Rollback info collected during chain execution for atomic undo (D-08, D-16) */
export interface RollbackStep {
    rollback: (ip: string) => Promise<void>;
}
export interface FixHandler {
    match(fixCommand: string): HandlerParams | null;
    execute(ip: string, params: HandlerParams): Promise<HandlerResult & {
        rollbackStep?: RollbackStep;
    }>;
}
/**
 * Returns the first matching handler+params pair, or null if no handler matches.
 */
export declare function matchHandler(fixCommand: string): {
    handler: FixHandler;
    params: HandlerParams;
} | null;
/**
 * Splits a compound fixCommand on ' && ', resolves each part to a handler.
 * Returns null if ANY part is unmatched (D-15 — no partial dispatch).
 */
export declare function resolveHandlerChain(fixCommand: string): Array<{
    handler: FixHandler;
    params: HandlerParams;
}> | null;
/**
 * Executes each step in the chain sequentially.
 * If any step fails, rolls back all previously collected rollback steps in reverse order.
 * Implements atomic rollback (D-16).
 */
export declare function executeHandlerChain(ip: string, chain: Array<{
    handler: FixHandler;
    params: HandlerParams;
}>): Promise<HandlerResult>;
/**
 * Attempts handler dispatch for a fix command.
 * Returns { handled: true, diff? } if a handler matched (success or failure),
 * { handled: false } if no handler matched (caller should fall through to shell path).
 * Shared by runFix(), fixSafeCommand(), and handleServerFix() to avoid copy-paste.
 */
export declare function tryHandlerDispatch(ip: string, check: {
    id: string;
    fixCommand: string;
}, applied: string[], errors: string[]): Promise<{
    handled: boolean;
    diff?: DiffLine;
}>;
//# sourceMappingURL=index.d.ts.map