/**
 * M28 Git Sync — best-effort mirroring of claude4spec actions into the user's
 * git repository. This service OWNS every `git` subprocess call (the only git
 * shell-out in the server). All methods are best-effort: a missing/broken git,
 * a missing repo, or a failed command never throws to the caller — it resolves
 * to a non-throwing result shape.
 *
 * `detect()` answers "is `pagesDir` inside a worktree, and what does it look
 * like". `commit()` / `push()` perform the two sync actions. `commitOnRelease()`
 * / `pushOnPush()` are the gated entry points the hooks call: they read the
 * (hot-reloaded) config flag, detect the repo, and either act or return `null`
 * (flag off OR no repo).
 *
 * Spec: brief 0-1-37-to-0-1-38.md (M28).
 */
import type { GitCommitResult, GitPushResult, GitStatusResponse } from '../../shared/git.js';
export declare class GitService {
    private cwd;
    private pagesPath;
    /**
     * @param cwd       project root (holds `.claude4spec/config.json`).
     * @param pagesPath absolute path to the pages directory — the probe location
     *                  for repo detection (a release may live in a sub-worktree).
     */
    constructor(cwd: string, pagesPath: string);
    /** Run `git <args>` in `dir`. Throws on non-zero exit or a missing binary. */
    private git;
    /**
     * Probe `pagesDir` for a git worktree. Never throws — git missing (ENOENT),
     * no repo, or `pagesDir` outside any worktree (exit 128) all map to
     * `detected: false`.
     */
    detect(): Promise<GitStatusResponse>;
    /**
     * Stage `pagesDir` + `config.json` and commit. Assumes a repo is detected
     * (callers gate via `commitOnRelease`). Returns `'skipped'` on detached HEAD,
     * `'nothing-to-commit'` when nothing is staged, `'error'` on any git failure.
     */
    commit(opts: {
        name: string;
        description: string;
    }): Promise<GitCommitResult>;
    /**
     * Push the current branch to its upstream. Assumes a repo is detected.
     * `'nothing-to-push'` when git reports "Everything up-to-date", `'skipped'`
     * on detached HEAD, `'error'` on a missing upstream or any other failure.
     */
    push(): Promise<GitPushResult>;
    /**
     * Gated commit hook. `null` when commit-sync is off OR no repo detected;
     * otherwise the `commit()` result. Reads config per-call (hot-reload).
     */
    commitOnRelease(release: {
        name: string;
        description: string;
    }): Promise<GitCommitResult | null>;
    /**
     * Gated push hook. `null` when push-sync is off OR no repo detected;
     * otherwise the `push()` result. Reads config per-call (hot-reload).
     */
    pushOnPush(): Promise<GitPushResult | null>;
}
