interface RemoteSshOptions {
    extraSshArgs?: string[];
}
/**
 * Render a path for safe interpolation into a REMOTE shell, expanding a leading
 * `~`/`~/` to `"$HOME"` so it resolves on the host. A plain `shellQuote('~/x')`
 * single-quotes the tilde and the remote shell leaves it literal (the same
 * reason dispatch.ts uses `$HOME`, not `~`). Everything after the tilde is still
 * single-quoted, so odd path characters stay safe.
 */
export declare function remotePathExpr(p: string): string;
/**
 * Resolve the ABSOLUTE git top-level for a (possibly `~`-relative) repo path on
 * the host, or null when it isn't a git repo / the host is unreachable. Used by
 * `ensureRemoteRepo` to both VALIDATE and CANONICALIZE a repo location, so every
 * downstream remote command (launch `cd`, worktree create, polling) works from an
 * absolute path with no tilde-expansion hazard.
 */
export declare function resolveRemoteRepoRoot(target: string, repoPath: string, opts?: RemoteSshOptions): string | null;
/** True when `repoPath` is a git working tree on the host. */
export declare function isRemoteGitRepo(target: string, repoPath: string, opts?: RemoteSshOptions): boolean;
/**
 * Resolve the host repo's default branch name (origin/HEAD → `main`/`master`/…).
 * Falls back to `main` when origin/HEAD isn't set, matching the local recipe's
 * `remote set-head` step.
 */
export declare function remoteDefaultBranch(target: string, repoPath: string, opts?: RemoteSshOptions): string;
/**
 * Create a worktree on the host for a teammate, branched off the freshly-fetched
 * default branch. Returns the absolute worktree path on the host.
 *
 * Same base policy as local `createWorktree`: fetch origin, then
 * `worktree add -b … origin/<default>` so a stale checkout can't fork the
 * teammate off old code.
 */
export declare function createRemoteWorktree(target: string, repoPath: string, worktreeName: string, opts?: RemoteSshOptions): string;
/**
 * How many commits the host checkout at `repoPath` is behind `origin/<default>` —
 * the remote analog of the local {@link commitsBehindDefault} staleness probe, and
 * the exact case from the incident this guard exists for (a distributed team
 * pointed at a 71-commit-stale checkout on another box).
 *
 * `ensureRemoteRepo` already fetched `origin` when it provisioned/reused the
 * checkout right before this runs, so the remote-tracking ref is usually fresh and
 * this reads it WITHOUT a second fetch: resolve the default branch, then
 * `rev-list --count HEAD..origin/<default>`. (That reuse fetch is best-effort —
 * an offline host leaves the ref stale, so this under-reports rather than blocks;
 * `createRemoteWorktree` re-fetches at launch so the teammate's base is still
 * fresh regardless.) Returns null on any git/ssh error (unreachable host, non-repo
 * path) — the caller treats null as "can't tell, don't block".
 */
export declare function remoteCommitsBehindDefault(target: string, repoPath: string, opts?: RemoteSshOptions): {
    behind: number;
    base: string;
} | null;
/**
 * Ensure the team's repo is present on the host and return its absolute git
 * root. The canonical location is `~/.agents/repos/<slug>` (slug = sanitized
 * team name). Resolution, in order:
 *
 *   1. `~/.agents/repos/<slug>` already a git repo  → `git fetch origin`, use it.
 *   2. `repo` is a path that exists on the host as a git repo → use it in place.
 *   3. `repo` is a URL (or a non-existent path)      → `git clone` into the
 *      canonical location, then use it.
 *
 * `$HOME`-prefixed paths interpolate UNQUOTED (remotePathExpr) so the host shell
 * expands `$HOME` — single-quoting the tilde would defeat expansion, the same
 * hazard dispatch.ts avoids.
 */
export declare function ensureRemoteRepo(target: string, repo: string, slug: string, opts?: RemoteSshOptions): string;
/** True when the host worktree has uncommitted changes (staged or unstaged). */
export declare function remoteWorktreeDirty(target: string, worktreePath: string, opts?: RemoteSshOptions): boolean;
/**
 * Remove a host worktree and (optionally) its branch. Best-effort: prunes on a
 * "not a working tree" error and ignores a missing branch, matching local
 * `removeWorktree` semantics so cleanup never throws on a half-gone worktree.
 */
export declare function removeRemoteWorktree(target: string, repoPath: string, worktreeName: string, deleteBranch?: boolean, opts?: RemoteSshOptions): void;
export {};
