/**
 * Interactive approve/reject/edit prompt for `sw:skill-refine`.
 *
 * The user is shown the proposed diff + rationale and chooses one of:
 * - **approve**: the caller applies the diff verbatim.
 * - **reject**: the caller records a rejection (with reason) in the ledger;
 *   no SKILL.md write happens.
 * - **edit**: the user's `$EDITOR` opens on the diff so they can hand-tune
 *   it before re-prompting for approval. Rejection during edit path is also
 *   honored.
 *
 * The `promptFns` param lets tests inject deterministic behavior; in
 * production we default to `@inquirer/prompts` (already used elsewhere in
 * specweave for wizard UI).
 *
 * @module core/skill-refine/approval
 */
export type Decision = {
    action: 'approve';
    diff: string;
} | {
    action: 'reject';
    reason: string;
} | {
    action: 'edit';
    diff: string;
};
export interface ApprovalPromptContext {
    targetSkill: string;
    rationale: string;
    diff: string;
}
export interface PromptFns {
    /** Presents the approve/reject/edit menu. */
    chooseAction: (ctx: ApprovalPromptContext) => Promise<'approve' | 'reject' | 'edit'>;
    /** Prompted only when user picked 'reject'. */
    askRejectionReason: () => Promise<string>;
    /** Prompted only when user picked 'edit'; returns the new diff text. */
    editDiff: (original: string) => Promise<string>;
}
export interface ApprovalOptions {
    /** Max edit→re-ask loops before forcing a final decision. Default 3. */
    maxEditLoops?: number;
}
/**
 * Drive the approval flow. Returns a terminal decision:
 * `{action:'approve', diff}` (the final, possibly-edited diff) OR
 * `{action:'reject', reason}`.
 *
 * If the user loops through edits more than `maxEditLoops` without approving,
 * the loop terminates as a rejection with an auto-reason so we never hang.
 */
export declare function runApprovalFlow(ctx: ApprovalPromptContext, prompts: PromptFns, opts?: ApprovalOptions): Promise<{
    action: 'approve';
    diff: string;
} | {
    action: 'reject';
    reason: string;
}>;
/**
 * Default production prompts backed by `@inquirer/prompts` + `$EDITOR`.
 * Lazy-imported so tests that use stubs don't pay the dep cost.
 */
export declare function defaultPromptFns(): Promise<PromptFns>;
/**
 * Write `text` to a temp file, launch `$EDITOR` (or `vi` fallback), read the
 * file back. Exposed for tests that want to validate the fallback path
 * without actually spawning an editor.
 */
export declare function openInEditor(text: string): string;
//# sourceMappingURL=approval.d.ts.map