/** * Tool-layer helpers. * * Small, shared utilities for brief / pack tools. Keeps domain-specific * normalization out of individual handlers without bloating the common * briefs module, which is already evidence-focused. */ /** * Max length for a user-supplied corpus_query string. 200 chars is well * past any reasonable natural-language query yet small enough that a * novice/noisy caller can't fill the embedding input with fence-delimited * prose blobs or whole log excerpts. */ export declare const MAX_CORPUS_QUERY_CHARS = 200; /** * Enforce the corpus_query length + shape contract. * * The query flows through to embedding + prompt contexts; long multi-line * payloads dilute the vector, waste tokens, and can smuggle code-fence * delimiters into prompts. Reject rather than silently truncating — the * caller learns the limit the first time. * * Strips newlines (CR/LF) and fence markers from OTHERWISE-valid queries * as a convenience: they're always mistakes, never intent. */ /** * Strip prompt-injection vectors from a user-supplied field: code-fence * delimiters and CR/LF become spaces, then runs of whitespace collapse. A * user field can no longer break out of its slot in an LLM prompt with a * fenced block or a newline-delimited "IGNORE ABOVE" instruction. */ export declare function stripInjectionVectors(raw: string): string; /** * Sanitize a user-supplied field that flows VERBATIM into an LLM prompt * (classify labels/frame, research question — M9). Strips injection vectors * (fences/newlines) then rejects if the cleaned text exceeds maxChars. * Returns the cleaned text. The length reject keeps a caller from filling the * prompt budget with a whole log/diff blob under the guise of one field. */ export declare function sanitizePromptField(raw: string, opts: { fieldName: string; maxChars: number; }): string; export declare function normalizeCorpusQuery(raw: string | undefined, opts?: { fieldName?: string; }): string | undefined; //# sourceMappingURL=_helpers.d.ts.map