/**
 * `sw:skill-refine` CLI entry point.
 *
 * Orchestrates:
 *   1. Flag parsing (--dry-run, --show-signals, --scope project|user)
 *   2. Session-lock guard (ADR-0671-01 — never mutate during /sw:do or /sw:done)
 *   3. Resolve skill file path based on scope
 *   4. Aggregate refinement signals (aggregator.ts)
 *   5. --show-signals: print + exit
 *   6. Haiku diff proposal (haiku-diff.ts)
 *   7. --dry-run: print diff + exit
 *   8. Interactive approve/reject/edit (approval.ts)
 *   9. On approve: write + git commit + ledger (apply.ts)
 *      On reject: ledger rejection entry only
 *
 * This module is exported as a library function `runSkillRefine` so it is
 * testable in isolation. CLI wiring happens in `bin/specweave.js` separately.
 *
 * @module skills/skill-refine
 */
import { type AggregateResult } from '../core/skill-refine/aggregator';
import { type HaikuClientLike } from '../core/skill-refine/haiku-diff';
import { type PromptFns } from '../core/skill-refine/approval';
export type Scope = 'project' | 'user';
export interface ParsedArgs {
    skillSlug: string;
    dryRun: boolean;
    showSignals: boolean;
    scope: Scope;
    lastN?: number;
}
export interface RunOptions {
    /** CWD used as the project root (for `scope=project` and signals/ledger paths). */
    projectRoot: string;
    /** Raw CLI argv (after the subcommand name). */
    argv: string[];
    /** Anthropic client for Haiku calls. Omit to skip network in tests. */
    client?: HaikuClientLike;
    /** Stream to write user-facing text to. Defaults to stdout. */
    stdout?: {
        write: (s: string) => void;
    };
    /** Prompt stubs for tests. Omit to use terminal prompts. */
    prompts?: PromptFns;
    /** Override env for session-lock detection (tests). */
    env?: NodeJS.ProcessEnv;
}
export interface RunResult {
    status: 'shown-signals' | 'dry-run' | 'applied' | 'rejected' | 'no-signals' | 'no-diff';
    message: string;
    commitSha?: string;
}
/**
 * Parse `argv` into structured flags. Throws on invalid usage so the CLI
 * can surface a single helpful error line.
 */
export declare function parseArgs(argv: string[]): ParsedArgs;
/**
 * Returns a human-readable reason string when the current process is inside
 * an active /sw:do or /sw:done session (ADR-0671-01 red line). Null means
 * safe to proceed.
 */
export declare function detectSessionLock(projectRoot: string, env: NodeJS.ProcessEnv): string | null;
/**
 * Resolve the SKILL.md path to refine. `project` scope targets
 * `<projectRoot>/.claude/skills/<slugDir>/SKILL.md`; `user` scope targets
 * `~/.claude/skills/<slugDir>/SKILL.md`. The slug's leading namespace
 * (e.g. `sw:` → `sw-`) is mapped to a flat directory name, matching the
 * existing flat-dir convention (see feedback_skill_naming_flat_dirs).
 */
export declare function resolveSkillPath(slug: string, scope: Scope, projectRoot: string): string;
/**
 * Main entry. Returns a structured result instead of throwing for known
 * non-error outcomes (no signals, dry-run, rejected). Unknown errors propagate.
 */
export declare function runSkillRefine(opts: RunOptions): Promise<RunResult>;
/**
 * Pretty-print an aggregate for `--show-signals`. Deterministic output shape.
 */
export declare function renderSignalReport(agg: AggregateResult): string;
//# sourceMappingURL=skill-refine.d.ts.map