import { type ExtractedProjectMemory, type MemoryBlockParse, type ProjectMemoryKind } from '../types.js'; /** Accepted-kind set, derived from the canonical `PROJECT_MEMORY_KINDS` * tuple so the parser cannot drift from the union type / tier map. */ export declare const VALID_MEMORY_KINDS: ReadonlySet; /** Exported for guard tests + tooling that needs to enumerate the accepted * set (CLI help text, `--kind` validation) without duplicating the literal. */ export declare const VALID_PROJECT_MEMORY_KINDS: readonly ProjectMemoryKind[]; /** * Filename stem for a memory title, and the `name:` its stored frontmatter * carries. * * The character class is Unicode-aware deliberately. An ASCII-only class * reduced EVERY title written in a non-Latin script to the same empty string, * so all of them landed on one constant name: whichever title arrived first * took that file, and each later one was skipped because the store refuses to * overwrite a file it already holds. Two titles that still reduce to one stem * are refused outright by the plan builders' duplicate-name check. * * A title with no letter or digit in any script ("!!!") leaves nothing to build * a name from. That branch takes the first 32 hex characters of the title's * sha256 instead of a fixed constant, so distinct titles still reach distinct * names. It is a DIGEST rather than the title's bytes because of LENGTH: an * encoding that grew with the title (the two-hex-chars-per-byte * `toString('hex')` this replaced) produced names past the filesystem limit for * a long enough title, so the write failed and took the whole batch with it — * measured, exit 1 and 0 files for a 140-character title. A digest is 39 * characters whatever the title is. * * THE FIXED LENGTH IS BOUGHT WITH A PROBABILISTIC GUARANTEE, and that is the * strongest thing this branch can claim. For the derived branch distinct titles * reach distinct names with overwhelming probability rather than by * construction: a collision needs two titles whose first 128 digest bits agree * — the birthday bound puts that at about n^2 / 2^129 for n derived names in one * store, i.e. under 1 in 10^26 at a million names. The branch above keeps the * stronger, exact property (two titles share a stem only if they are equal * modulo case and runs of non-letter/non-digit characters). Neither branch loses * a block silently on a collision: within a run the duplicate-name check refuses * the whole extract, and across runs the later write is skipped and NAMED in the * envelope's `warnings`. * * The '_' is outside the alphabet the branch above can emit, so a derived name * cannot equal a title-derived stem. */ export declare function slugify(title: string): string; /** * Single implementation of the extract-path block parse. Returns a * discriminated result so the caller can say WHY a found block was rejected. * * The precondition order mirrors the original combined `if` exactly * (separator → title → kind present → kind valid → body non-empty), so the * accepted set is bit-for-bit what it always was; only the explanation is new. */ export declare function parseBlockResult(block: string, sourceArtifact: string): MemoryBlockParse; /** * `null`-on-failure projection of `parseBlockResult`. Kept because callers * (and the parser's own contract) consume a plain nullable value; both views * come from the one implementation above, so they cannot diverge. */ export declare function parseBlock(block: string, sourceArtifact: string): ExtractedProjectMemory | null; export declare function renderMemoryFile(memory: ExtractedProjectMemory): string;