/** * Cockpit resolver — parses issue arguments and resolves them to a live * `{ ref, repo, gh }` bundle: * * - `IssueRef` — owner/repo/number/nwo * - `parseIssueRef(input)` — @internal; strict qualified-forms parser * (owner/repo#N and URL only). Cockpit callers * MUST go through `resolveIssueContext`. * - `resolveIssueContext(x)` — gates bare numbers via cwd-origin inference, * delegates qualified forms to `parseIssueRef`, * and returns a live `{ ref, repo, gh }` bundle. * * Errors are loud (`parse issue: `) so callers can prefix * `Error: cockpit : ` per cli-surface.md. */ import { type CommandRunner, type GhWrapper } from '@generacy-ai/cockpit'; export interface IssueRef { /** GitHub owner login (e.g. "generacy-ai") */ owner: string; /** GitHub repo name (e.g. "generacy") */ repo: string; /** GitHub issue/PR number */ number: number; /** "owner/repo" — convenience for gh CLI calls */ nwo: string; } export interface ResolveIssueContextInput { /** The `` argument as typed by the caller. */ issue: string; /** Optional programmatic override — never exposed as a CLI flag on `context`. */ repo?: string; /** Working directory; defaults to `process.cwd()` for git-origin inference. */ cwd?: string; /** Injected runner (tests only). */ runner?: CommandRunner; } export interface ResolvedIssueContext { ref: IssueRef; /** Same as `ref.nwo` — retained for legacy call-site compatibility. */ repo: string; gh: GhWrapper; } /** * @internal — cockpit callers MUST use `resolveIssueContext` instead. This * function is exported only for its unit tests. Enforced by ESLint * `no-restricted-imports` (see `.eslintrc.json`). See #850. * * Strict qualified-forms parser. Accepts: * - `owner/repo#123` * - `https://github.com/owner/repo/issues/123` * - `https://github.com/owner/repo/pull/123` * * Bare numbers ("123") fall through to the `unrecognized issue ref` throw — * they are NOT a special case here. The bare-number remedy (cwd-origin * inference) lives in `resolveIssueContext`. */ export declare function parseIssueRef(input: string): IssueRef; /** * Resolve an issue argument to a full `{ ref, repo, gh }` bundle. * * Strategy: * 1. Bare numbers ("123"): resolve owner/repo from `input.repo` or cwd git * origin inference, then build the ref directly via `makeRef`. * 2. Qualified forms (`owner/repo#N`, URLs): delegate to `parseIssueRef`. * * The `input.repo` override exists for programmatic callers; the `context` * verb intentionally does not expose it as a CLI flag (spec Q5 → A). */ export declare function resolveIssueContext(input: ResolveIssueContextInput): Promise; //# sourceMappingURL=resolver.d.ts.map