import type { CompiledDefinition, Inventory } from './types.js'; /** * Scheme names that mean "a path inside a checkout". * * A walk cannot infer this from the grammar: `db://[\w.-]+/[\w.-]+` and * `route://[\w.-]+/\S*` have a slash and a path segment too, and neither names * a file. Nor can it be inferred from the format, which declares what a * citation may LOOK like, never what it points at. So the meaning of these * names is knowledge the engine holds, and anything not on this list is left to * the author to claim explicitly with `--scheme ` — the default answer for * a scheme we do not recognise is "not verified", never "verified". */ export declare const WALKABLE_SCHEMES: readonly string[]; /** One scanned checkout: the name that becomes the first URI segment, and the * source-relative paths under it (posix separators, no leading slash). */ export interface SourceFiles { name: string; files: string[]; } /** * A path as a citation can spell it. * * A file called `Example Concept.md` cannot appear in a citation as written: * every shipped grammar ends in `\S+`, and the token scanner in definition.ts * stops a reference at `[\s,;·|)]`. The only spelling of that file anyone can * write is percent-encoded — which is what the starter template already does * (`repo://my-docs/vault/Concepts/Example%20Concept.md`). Emitting the raw path * instead would leave a true citation matching nothing in the inventory, i.e. * false drift, which is worse than shipping no scanner at all. * * Only those characters are touched. Percent-encoding everything a URI spec * permits would rewrite paths people already cite verbatim, and the point is to * meet the citations that exist, not to be maximally correct at their expense. */ export declare function citable(rel: string): string; export interface ScanResult { inventory: Inventory; /** URIs a declared grammar would refuse — see buildInventory. */ unspellable: string[]; } /** * Split the format's declared schemes into the ones a walk can speak for and * the ones it cannot. * * `extra` is the author's explicit claim (`--scheme `) that one of their * own names is filesystem-backed — the escape hatch for a format that calls its * checkouts something other than repo/test/src/code/file. It is a claim only * they can make: nothing about a name spells out what it points at. */ export declare function walkableSchemes(def: CompiledDefinition, extra?: readonly string[]): { walk: string[]; skip: string[]; }; /** * Every scanned file, under every scheme the walk may speak for, as the * inventory Inventory declares. * * Each URI is checked against the SAME grammar parseDoc applies to citations * (`def.schemes[scheme].test(uri)`), after citable() has spelled the path the * way a citation would have to. What still fails — a source whose grammar is * narrower than its files, say `repo://[\w.-]+/src/\S+` over a whole checkout — * is a URI no citation in this vault could ever have written, so emitting it * would add rows nothing can match. Those are returned separately, so the * command can say out loud which files it could not name instead of dropping * them quietly: a file missing from the inventory reads downstream as drift. * * `kind` is the scheme, because the scheme IS the kind: it is what distinguishes * `repo://app/x` from `test://app/x` when both are the same bytes on disk. * `in_scope` and `exempt` are deliberately absent — report.ts computes the * reverse gap from them, and a walk knows what EXISTS, never what ought to have * been documented. That is policy, and policy is not a fact about a directory. */ export declare function buildInventory(sources: readonly SourceFiles[], schemes: readonly string[], def: CompiledDefinition): ScanResult;