import { type RunGh } from "../clone/github-scaffold.js";
import type { CloneResult, CloneTargetKind, ReferenceMatch, SkillSource, SkillSourceLocation } from "../clone/types.js";
export interface CloneCommandOptions {
    target?: CloneTargetKind;
    path?: string;
    plugin?: string;
    pluginName?: string;
    author?: string;
    namespace?: string;
    github?: boolean;
    force?: boolean;
    source?: SkillSourceLocation;
    dryRun?: boolean;
    /** Auto-confirm all prompts (--yes / -y). */
    yes?: boolean;
    /** Override home — used for tests. */
    home?: string;
    /** Override cwd — used for tests. */
    cwd?: string;
    /** Injectable `gh` adapter for tests. */
    runGh?: RunGh;
    /** When true, error messages are thrown instead of printed (used for tests / whole-plugin path). */
    throwOnError?: boolean;
}
declare function slugify(name: string): string;
/**
 * Recursively scan a skill directory for cross-skill references and
 * self-name occurrences across SKILL.md and any .md files in subdirectories
 * (e.g., agents/*.md). Operates on the staged `.tmp` content so the report
 * reflects what actually got copied.
 */
declare function scanCopiedSkill(stagingDir: string, oldSkillName: string): Promise<{
    refs: ReferenceMatch[];
    selfNames: ReferenceMatch[];
}>;
/**
 * Validate the staged clone: SKILL.md must parse and any `agents/*.md`
 * referenced by frontmatter must exist. Throws on any inconsistency.
 */
declare function validateStagedClone(stagingDir: string): Promise<void>;
interface ResolvedCloneArgs {
    source: SkillSource;
    targetKind: CloneTargetKind;
    newSkillBase: string;
    newSkillFullName: string;
    author: string;
    namespace: string;
    finalDir: string;
    pluginRoot?: string;
    pluginName?: string;
}
declare function resolveArgs(positionalSource: string, opts: CloneCommandOptions, homePath: string, cwdPath: string): Promise<ResolvedCloneArgs>;
/**
 * Run the clone pipeline. Returns the CloneResult on success. On failure,
 * cleans up every staged `.tmp` path before propagating the error.
 *
 * The function is exported for use by the whole-plugin path (T-010) and unit
 * tests; the CLI entry point is `cloneCommand` below.
 */
export declare function runCloneOnce(resolved: ResolvedCloneArgs, opts: CloneCommandOptions): Promise<CloneResult>;
/** CLI entry point (Commander action). */
export declare function cloneCommand(source: string | undefined, opts: CloneCommandOptions): Promise<void>;
/**
 * Whole-plugin clone path (T-010). Delegated to its own module is overkill —
 * the orchestration is small and shares all the same primitives.
 */
declare function runWholePluginClone(pluginName: string, opts: CloneCommandOptions, homePath: string, cwdPath: string): Promise<void>;
/** Re-exports for tests. */
export { resolveArgs, validateStagedClone, scanCopiedSkill, slugify, runWholePluginClone };
export type { ResolvedCloneArgs };
