/**
 * Worktree prune operation for @cleocode/worktree.
 *
 * Thin orchestration over the `worktrunk_core` SDK exposed via
 * `@cleocode/worktree-napi` (T10203 / ADR-087). The native binding owns:
 *
 * - Git-aware prune-plan construction (`napi.pruneWorktrees`) — read-only
 *   discovery of merged-in worktrees + orphan branches.
 * - Recursive directory removal (`napi.removeDir`) — replaces the
 *   `rmSync` + `git worktree remove` fallback that previously lived here.
 *
 * The TypeScript layer keeps three concerns that are explicitly outside the
 * SDK boundary per ADR-061:
 *
 * 1. CLEO XDG-layout scan + `preserveTaskIds`/`idleDays` filter — business
 *    logic that the napi binding intentionally avoids.
 * 2. Audit-log writes to `.cleo/audit/worktree-lifecycle.jsonl` (T9805 AC3).
 * 3. Sentinel-index updates at `<gitRoot>/.cleo/worktrees.json` (D009).
 *
 * Called periodically by `cleo sentient tick` via `worktree-dispatch.ts`.
 *
 * @task T1161
 * @task T9805
 * @task T10204
 */
import type { PruneWorktreesOptions, PruneWorktreesResult } from '@cleocode/contracts';
import { pruneWorktrees as napiPrune } from './napi-binding.js';
/**
 * Prune orphaned agent worktrees for a project.
 *
 * Algorithm (thin orchestration over napi SDK):
 *
 * 1. Resolve the git root (falling back to `projectRoot` when not in a repo).
 * 2. Optionally invoke `napi.pruneWorktrees` for git-aware candidate discovery
 *    — the SDK plan is currently advisory; the TS layer drives the actual
 *    removal because audit + sentinel concerns are TS-owned per ADR-061.
 * 3. Scan the XDG worktree root, filtering by `preserveTaskIds`/`idleDays`.
 * 4. For each eligible entry: unlock via git → remove via napi → audit-log →
 *    sentinel-index cleanup.
 *
 * @param options - Prune options with project root and optional preserve list.
 * @returns Result listing removed paths and any errors.
 *
 * @task T1161
 * @task T9805
 * @task T10204
 */
export declare function pruneWorktrees(options: PruneWorktreesOptions): PruneWorktreesResult;
/**
 * Build a git-aware prune plan via the `worktrunk-core` SDK (T10203).
 *
 * Wraps `napi.pruneWorktrees` with the integration-target branch the caller
 * expects. Returns `null` when the underlying call fails (the napi layer
 * raises on bare repos, detached HEAD on main, or empty worktree lists) so
 * the legacy filesystem-scan path stays unaffected.
 *
 * Currently advisory: the result is exposed for callers that want the
 * SDK-classified merge-state, but {@link pruneWorktrees} still drives removal
 * from the XDG layout because preserveTaskIds + idleDays semantics live
 * outside the SDK boundary.
 *
 * @param gitRoot - Absolute path to the git repository root.
 * @param integrationTarget - Branch name to test "is merged" against
 *   (typically `main` or `master`).
 * @returns The SDK plan, or `null` when the napi call cannot be issued.
 *
 * @task T10204
 */
export declare function buildGitAwarePrunePlan(gitRoot: string, integrationTarget: string): ReturnType<typeof napiPrune> | null;
//# sourceMappingURL=worktree-prune.d.ts.map