/** Subset of a PM-tool task that discovery cares about. */ export interface DiscoveredTask { id: string; title: string; description?: string; } /** * Plan reference forms: * - string ending with ".md" → plan file path; titles parsed from H3 headings; * slug derived from the filename (strips leading YYYY-MM-DD- prefix + .md extension) * - string NOT ending with ".md" → bare plan slug; expectedTitles is empty; * matching falls back to slug-in-description * - string[] → expected titles directly; slug undefined; matching is exact-title-only */ export type PlanRef = string | string[]; export interface DiscoverPlanTasksOptions { planRef: PlanRef; /** Caller-supplied lister. Returns ALL open tasks in scope. */ listOpenTasks: () => Promise; } export interface DiscoveryResult { /** Each expected title matched by exactly one task. */ found: DiscoveredTask[]; /** Expected titles with zero matches. */ missing: string[]; /** Expected titles with multiple matches — caller resolves. Each entry is the match set for one expected title; caller re-correlates via task.title. */ ambiguous: DiscoveredTask[][]; } /** * Discover existing PM tasks that correspond to entries in a plan. * * Matching rules (no fuzzy, no case folding, no whitespace normalization): * * | planRef form | match strategy | * |------------------|-------------------------------------------------------------| * | string[] | exact title equality (case-sensitive) per expected title | * | ".md" path | parse H3 titles + derive slug; per-title exact equality | * | bare slug (str) | collect tasks whose description contains `[plan:]` | * * Outcomes (explicit-titles mode): * - 0 matches → expected title added to `missing` * - 1 match → task added to `found` * - 2+ matches → match set pushed onto `ambiguous`; caller disambiguates * * Bare-slug mode (no expected titles): every marker-bearing task lands in * `found`; `missing` and `ambiguous` stay empty. */ export declare function discoverPlanTasks(opts: DiscoverPlanTasksOptions): Promise; /** * Resolve a PlanRef into the inputs needed for matching. * - string[] → use as-is, no slug * - string ending in ".md" → read file; parse titles from H3 headings; derive slug * - other string → treat as bare slug; no expected titles */ export declare function resolvePlanRef(ref: PlanRef): Promise<{ expectedTitles: string[]; slug?: string; }>; /** Extract H3 headings (lines starting with "### " exactly, after trim). */ export declare function parseH3Titles(markdown: string): string[]; /** * Convert a filename to a slug: strip leading YYYY-MM-DD- prefix (if present) * and the .md extension. Path components other than the basename are dropped. * * Examples: * "docs/plans/2026-06-19-pm-tasks-v1.9.0-foo.md" → "pm-tasks-v1.9.0-foo" * "/abs/path/2026-06-22-headless-runtime.md" → "headless-runtime" * "plain-slug.md" → "plain-slug" */ export declare function filenameToSlug(filePath: string): string; //# sourceMappingURL=discover.d.ts.map