import { IntentSummary } from '@suss/intent-ir'; export { BoundaryIntentSummary, IntentOutcome, IntentSummary, PrdScenarioSummary, PrdSummary } from '@suss/intent-ir'; /** * Validate an in-memory intent doc (already parsed from YAML / JSON) and * normalise it to an IntentSummary. Throws on validation failure, * malformed specs are a load-time error, never a comparison finding. * * Accepts both `kind: boundary` and `kind: prd`; the transform * dispatches on the discriminator. */ declare function loadIntentDoc(raw: unknown): IntentSummary; /** * Read a single intent-doc file (YAML or JSON, chosen by extension) and * normalise it. JSON is parsed strictly; everything else goes through * the YAML parser, which also accepts JSON syntax. * * Accepts both `*.intent.{yaml,yml,json}` and `*.prd.{yaml,yml,json}`, * the document's `kind` picks the shape. */ declare function loadIntentFile(filepath: string): IntentSummary; /** One intent document, and where in the folder it was read from. */ interface LoadedIntentDoc { /** The absolute path of the file. */ file: string; summary: IntentSummary; /** The line each outcome's id is written on, by id. Empty for a PRD. */ outcomeLines: Record; /** * The fields the file leaves blank, empty for one that loads as * written. Each blank is filled with a placeholder, so `purpose` and * the rest of them contain that placeholder rather than what * anybody wrote. */ blanks: string[]; } interface IntentDirectoryRead { /** Every document in the folder, in file order. */ docs: LoadedIntentDoc[]; /** One message per file that could not be read at all. */ broken: string[]; } /** * Walk `dir` recursively for `*.intent.{yaml,yml,json}` and * `*.prd.{yaml,yml,json}` files and normalise each. Specs can live * anywhere under the root, organised however the team prefers. * * An inferred draft comes back with a placeholder in each blank, so a * reader that only wants the outcome ids can still have them. A caller * that needs finished documents reads `blanks` and refuses the ones * that have any. */ declare function readIntentDirectory(dir: string): IntentDirectoryRead; /** * Walk `dir` and normalise every document in it, refusing the whole * folder when a file is an uncurated draft or does not read at all. */ declare function loadIntentDirectory(dir: string): IntentSummary[]; export { type IntentDirectoryRead, type LoadedIntentDoc, loadIntentDirectory, loadIntentDoc, loadIntentFile, readIntentDirectory };