/** * Lemma API v2 — StatelessScrubber (Lane F) * * Stateless privacy firewall over raw text and serialized agent tool-call JSON. * * Contract (src/contracts/api-v2.types.ts): * scrubText(text, mode) -> { text, findings } text input * scrubToolCallJson(raw, mode) -> { toolCallJson, findings } * * Invariants: * - DETECTED VALUES ARE NEVER RETURNED. The response carries only the masked * text and an inventory of `{ type, offset, length }` findings. Nothing the * caller passed in is echoed back except by design. * - STATELESS: the constructor does NO I/O (unlike SemanticScrubber, whose * constructor reads lemma.config.json from cwd). Fresh RegExps are compiled * per call so `lastIndex` never leaks across concurrent requests. Nothing is * persisted. * - No `console.*` logging of the payload. * * This is the lane's adapted "wrap" of SemanticScrubber (which we cannot reuse * verbatim: it exposes no per-finding offsets, has no DSN coverage, and loads * config from cwd at construct time). See lane-notes/F.md ## decisions. * * Ownership: Lane F. */ import type { ScrubFinding } from "../../contracts/api-v2.types"; export type ScrubMode = "mask" | "detect"; export declare class StatelessScrubber { readonly lane = "F"; /** Scrub a raw text string. Offsets in findings are relative to `text`. */ scrubText(text: string, mode?: ScrubMode): { text: string; findings: ScrubFinding[]; }; /** * Scrub a serialized agent tool-call JSON string. The JSON structure is * preserved (always valid JSON on output). Each string leaf's text content is * scrubbed in-place; findings offsets are relative to the ORIGINAL `raw` * string the client sent. In detect mode the original string is returned * byte-for-byte untouched (findings only). */ scrubToolCallJson(raw: string, mode?: ScrubMode): { toolCallJson: string; findings: ScrubFinding[]; }; /** Backwards-compatible alias: scrubText. */ scrub(text: string, mode?: ScrubMode): { text: string; findings: ScrubFinding[]; }; } export default StatelessScrubber; //# sourceMappingURL=StatelessScrubber.d.ts.map