import type { PrAnswer, PrCardData, PrRef, PrStatus } from "@kenkaiiii/gg-protocol"; import { type GhRunner } from "./git-ship.js"; /** Pure: a GitHub PR link as the card's owner/repo/number, or null for anything else. */ export declare function prRefFromUrl(url: string): PrRef | null; /** Pure: a prompt's `meta.prAnswer`, when it names a real PR card answer. */ export declare function parsePrAnswer(raw: unknown): PrAnswer | null; /** * The PR cards one window session owes the transcript: noted as the main agent, * its sub-agents and the ship key open PRs, then flushed once the run ends. */ export declare class PrCardQueue { private readonly recorder; private readonly seenByAgent; private queued; /** Queue a card; the same PR again keeps only its latest place and `after`. */ note(url: string, after?: PrCardData["after"]): void; toolStart(toolCallId: unknown, name: unknown, args: unknown): void; toolEnd(toolCallId: unknown, result: unknown, isError: unknown): void; /** * A worker's snapshot: queue only the PRs this agent hadn't reported yet. A * worker first seen as recovered from an earlier run already had its cards. */ noteAgent(agentId: string, urls: readonly string[] | undefined, recovered?: boolean): void; /** Drop cards not yet shown (the conversation changed under them). */ clear(): void; get size(): number; /** The queued cards, oldest first; empties the queue. */ flush(): PrCardData[]; } /** Pure: only a plain GitHub PR page is ever handed to `gh`. */ export declare function isPrUrl(url: string): boolean; /** The PR's live title and state, from `gh pr view`. */ export declare function readPrStatus(url: string, cwd: string, gh?: GhRunner): Promise;