/** * Literal-safe character-name substitution and inverse tokenization. */ export declare function replaceNameTokens(text: string, name: string): string; /** * Resolve indexed example-participant tokens (`{{name1}}` / `{{user1}}` …) in * example-conversation templates against a positional `names` array (slot 1 -> * `names[0]`). Whitespace inside the braces (`{{ name1 }}`) is tolerated, and an * out-of-range index is left untouched so a partial name pool never blanks a * token. * * Same canonical-owner rationale and `$`-safety as `replaceNameTokens`: a * replacer function inserts the name literally, so a generated name containing * `$&` / `$1` / `$$` is not re-read as a `String.replace` substitution pattern. * The core prompt builder (`composeRandomUser`) and the character provider both * resolve these tokens through this one implementation. */ export declare function replaceIndexedNameTokens(text: string, names: readonly string[]): string; /** * Reverse of `replaceNameTokens` — rewrite whole-word occurrences of the * given literal character name back into `{{name}}` tokens so that a * later rename continues to propagate through every text field. * * Rules: * - Case-sensitive, whole-word match (word boundaries on both sides). * - Names under 2 characters are ignored; the tokenizer is not * meaningful for single-letter names and risks destroying prose. * - Idempotent: re-running on already-tokenized text leaves it unchanged because * `{{name}}` does not contain the literal name. * - Non-destructive on empty input or empty name. * * @param text The text to scan. * @param name The literal character name to tokenize (e.g. "Momo"). * @returns The text with whole-word occurrences replaced by `{{name}}`. */ export declare function tokenizeNameOccurrences(text: string, name: string): string;