/** * One-shot import: a GitHub issue seeds a roadmap item. * * Import, not sync. Nothing reconciles afterwards, nothing is written back to the issue, * and running it twice over the same issue is reported rather than duplicated. * * The `title` is **always** double-quoted, with no judgement call about whether this one * needs it. An unquoted YAML plain scalar may not begin with a reserved indicator * character, so the single most natural way to name a code defect — an identifier in * backticks — does not parse; and nothing reports it, because an item that will not parse * and an item that was never written look identical. Five of this project's first 49 items * were lost that way for up to ten days, and GitHub issue titles are precisely the corpus * that produces them. * * Requirements: roadmap-issue-projection/AC-51 … roadmap-issue-projection/AC-60 * * @module */ import { type GhRunner } from './gh.js'; /** A GitHub issue, reduced to what identifies it. */ export interface IssueCoord { host: string; owner: string; repo: string; number: number; } export type ImportResult = { kind: 'written'; path: string; } | { kind: 'duplicate'; existing: string; coord: IssueCoord; } | { kind: 'refused'; error: string; }; /** Slug used when a title yields nothing usable. */ export declare const FALLBACK_SLUG_PREFIX = "imported-issue"; /** * Parse an issue reference into a comparable tuple. * * Normalising is the point: `https://github.com/o/r/issues/12`, the same with a trailing * slash, with a `#issuecomment-…` fragment, with `www.`, and the * `api.github.com/repos/o/r/issues/12` form all denote one issue. Comparing raw strings * would report false duplicates in one direction and miss real ones in the other — and a * naive substring compare makes `issues/1` match `issues/12`. */ export declare function parseIssueUrl(raw: string): IssueCoord | null; /** Canonical string form of a coordinate, for map keys. */ export declare function coordKey(coord: IssueCoord): string; /** * Every issue already linked by a roadmap item, keyed by coordinate. * * This reads item **bodies**, which the roadmap skill's frontmatter-only rule otherwise * discourages. That rule governs *browse*, which is a list and must stay cheap enough to * run over the whole roadmap. Import is neither a list nor cheap-by-contract, and there is * nowhere else the local half of a duplicate check could come from — DD-1 means no * `remote:` field exists to consult. */ export declare function linkedCoords(cwd: string): Map; /** * A filename-safe slug from an issue title. * * Must satisfy `ITEM_FILENAME_RE`'s `[a-z0-9][a-z0-9-]*`, which a title of punctuation or * of a non-Latin script will not survive — hence the fallback rather than a refusal. An * issue that cannot be imported because of its title would be a strange thing to tell * somebody. */ export declare function slugFromTitle(title: string, number: number): string; /** Import one issue into `inbox/`. */ export declare function importIssue(gh: GhRunner, cwd: string, url: string): ImportResult; //# sourceMappingURL=import.d.ts.map