/** * Best-effort lookup of GitHub pull requests for a worktree branch via the * `gh` CLI. `crew status` uses this to surface PR links inline; failures * (gh not on PATH, not authenticated, non-GitHub remote) are silent — the * caller falls back to omitting the row. * * The lookup runs with `cwd` set to the worktree directory and lets `gh` * resolve the GitHub repo from that checkout's own `origin` remote. This * handles bare config names, full `owner/repo` slugs, forks, and SSH/HTTPS * remotes uniformly — we never reconstruct the slug ourselves. * * Whatever GitHub returns is returned verbatim. We do not filter by commit * history: the branch name on the remote (which `gh pr list --head` matches) * is already a strong identifier for "the PR(s) for this checkout". Stale * PRs from a long-dead branch with a reused name surface as `(merged)` or * `(closed)` in the status output, which is more informative than silently * dropping them. Decision-making callers (e.g. `crew task done`) filter by * lifecycle state instead. */ export interface PullRequestSummary { url: string; number: number; /** Lowercased lifecycle: "open" | "merged" | "closed". */ state: string; title: string; } interface LookupArgs { /** Worktree directory; `gh` resolves the GitHub repo from its git remote. */ cwd: string; /** Branch name to filter PRs by. */ branchName: string; signal?: AbortSignal; } export interface ResolvedPullRequest { number: number; /** Head branch name the PR is built from (`headRefName`). */ branch: string; title: string; url: string; /** Lowercased lifecycle: "open" | "merged" | "closed". */ state: string; /** True when the head branch lives on a fork rather than the base repo. */ isCrossRepository: boolean; } interface ResolvePullRequestArgs { /** Clone directory used as `gh`'s cwd so it resolves the GitHub repo from its remote. */ repoDir: string; /** PR number or URL accepted by `gh pr view`. */ pr: string; signal?: AbortSignal; } /** * Resolve a single pull request to the metadata `crew open` needs (head branch, * title, url, fork flag) via `gh pr view`. Unlike `findPullRequestsForBranch`, * the caller named a specific PR, so failures are fatal: a missing `gh`, an * unauthenticated host, or an unknown PR all throw with a clear message rather * than degrading to "no PR info". */ export declare function resolvePullRequest(arguments_: ResolvePullRequestArgs): Promise; export declare function findPullRequestsForBranch(arguments_: LookupArgs): Promise; export {}; //# sourceMappingURL=pullRequests.d.ts.map