/** Commit tally for one author email. */
export interface AuthorCommits {
    author: string;
    commits: number;
}
/** The shipped-work rollup for a window. */
export interface GitOutputSummary {
    reposScanned: number;
    commits: number;
    byAuthor: AuthorCommits[];
    prsOpened: number;
    prsMerged: number;
    /**
     * Deduped commit SHAs authored by us in the window. Carried so `--all-hosts`
     * can UNION across machines — a repo cloned on several boxes exposes the same
     * commits to `git log` on each, so summing counts would multi-count.
     */
    commitShas: string[];
    /** false when `gh` is missing/unauthed — PR counts are then 0 and not trustworthy. */
    ghAvailable: boolean;
    /** Author emails counted as "ours". */
    authors: string[];
    /** gh logins queried for PRs. */
    logins: string[];
    sinceIso: string;
}
export interface GitOutputOptions {
    /** Root scanned for git repos (e.g. ~/src). */
    reposDir: string;
    /** Window start, epoch ms. */
    sinceMs: number;
    /** Restrict commit authorship to these emails; default: identities discovered from git config. */
    authors?: string[];
    /** gh logins to search PRs for; default: the current `gh api user` login. */
    logins?: string[];
    /** Repo discovery depth below reposDir (default 4 — covers ~/src/host/org/repo). */
    maxDepth?: number;
    /** Query PRs via gh (default true). */
    includePrs?: boolean;
}
/**
 * Find git repositories under `root` up to `maxDepth` levels deep. A directory
 * with a `.git` entry is a repo and is NOT descended into (so nested worktrees
 * / submodules don't double-count).
 */
export declare function findGitRepos(root: string, maxDepth?: number): string[];
/**
 * Count commits by our authors across all repos, deduped by SHA (so the same
 * commit reachable via multiple repo clones/worktrees on this machine — or, at
 * the fleet layer, across machines — is counted once), tallied per email.
 */
export declare function collectCommits(repos: string[], sinceIso: string, authors: string[]): Promise<{
    total: number;
    byAuthor: AuthorCommits[];
    shas: string[];
}>;
/**
 * Count PRs opened and merged in the window across the given logins. `gh search
 * prs` searches all of GitHub, so one authed gh can cover multiple accounts'
 * logins. Returns ghAvailable=false if gh can't be reached at all.
 */
export declare function collectPrs(logins: string[], sinceDate: string): Promise<{
    opened: number;
    merged: number;
    logins: string[];
    ghAvailable: boolean;
}>;
/** Format an epoch-ms as a YYYY-MM-DD date (UTC), for gh's date-range search. */
export declare function toSearchDate(ms: number): string;
/**
 * Collect the full shipped-work summary for a window: commits (across accounts)
 * plus PRs opened/merged.
 */
export declare function collectGitOutput(options: GitOutputOptions): Promise<GitOutputSummary>;
