import type { PersistedSession } from "./session-store.js";
/**
 * Should we keep an otherwise-orphaned session live?
 *
 * Returns true when both:
 *   - the session's worktree directory still exists on disk, AND
 *   - the agent JSONL was written within the last 24 h.
 *
 * The boot/restore archive sweeps consult this gate before calling
 * `SessionStore.archive()`. The historical bug (goal sessions-p-14dc3ec7,
 * 2026-05-09) bulk-archived 9 actively-running sessions whose worktrees
 * and transcripts were healthy because `sessions.json` had silently rolled
 * back. Applying this gate makes the archive sweep refuse to garbage-
 * collect anything that still has a live worktree + recent transcript —
 * the user can still archive manually from the UI if they really are dead.
 *
 * Sandboxed sessions: their `worktreePath` is a container-internal path,
 * so `fs.existsSync` will return false and the gate naturally falls
 * through. That's correct — sandbox health is checked elsewhere.
 */
export declare function shouldKeepDespiteOrphan(ps: PersistedSession): boolean;
/**
 * Walk `<agentSessionsRoot>` for `*.jsonl` transcripts that are NOT tracked
 * by any `PersistedSession.agentSessionFile`. Used to surface a splash
 * banner when the session-metadata index has diverged from the agent CLI's
 * on-disk transcripts. No auto-import — banner only.
 *
 * @param agentSessionsRoot Root directory of the agent CLI's session files.
 * @param trackedFiles Set of `agentSessionFile` paths from all known sessions
 *                    (live + archived).
 * @param mostRecentLastActivity Skip transcripts whose mtime is older than
 *                               this — they're noise from prior installs.
 * @returns `{ count, paths }` where `paths` is capped at 50.
 */
export declare function scanOrphanedTranscripts(agentSessionsRoot: string, trackedFiles: Set<string>, mostRecentLastActivity: number): {
    count: number;
    paths: string[];
};
//# sourceMappingURL=orphan-cleanup.d.ts.map