import type { PrDiffPayload } from "../tools/gh-pr-diff.js"; import type { ViewLookupResult } from "../tools/gh-view.js"; import type { InternalResource, InternalUrl, ResolveContext } from "./types.js"; /** * Resolve the working directory the protocol should use. * * Order: * 1. Caller-supplied `context.cwd` (the session that initiated `read`). * 2. First registered session via `AgentRegistry` (single-session fallback). * 3. `process.cwd()` (last resort). * * The cwd drives `gh repo view` / `glab repo view` and repo listings for * short-form URLs, so getting this right is what keeps reads of `issue://N` * or `mr://N/diff` from picking the wrong repo across concurrent sessions. */ export declare function resolveCwd(context: ResolveContext | undefined): string; /** * Split an internal URL path into raw (undecoded) segments, rejecting empty, * `.`, `..`, and undecodable segments. */ export declare function splitInternalUrlSegments(url: InternalUrl, scheme: string): string[]; export interface DiffFamilyLabels { /** URL prefix without `/diff`, e.g. `pr://owner/repo/7`. */ baseUrl: string; /** Listing header title, e.g. `Pull Request Diff: owner/repo#7`. */ heading: string; /** Short noun used in range errors, e.g. `PR`. */ noun: string; /** Suffix such as `?at=` appended to nested diff URLs. */ query?: string; } export declare function renderDiffFamilyResource(url: InternalUrl, mode: "list" | "all" | "slice", index: number | undefined, lookup: ViewLookupResult, labels: DiffFamilyLabels): InternalResource;