import { SyncGuardrailDetector } from "../contracts/guardrail.contract.mjs"; import { TopicFilterOptions } from "../contracts/guard-options.type.mjs"; //#region ../ai/src/guard/detectors/topic.d.ts /** * Build the built-in **topic filter** (`ai.guardrail.topic`) — a * zero-runtime-dependency {@link GuardrailDetector} that gates text against a * deny list, an allow list, or both. * * - **`deny`** — any term that appears triggers `onMatch`. A `string` * matches case-insensitively as a substring; a `RegExp` is tested as-is. * The deny list is checked first; the first hit decides the verdict. * - **`allow`** — when set, text matching **none** of the allow terms * triggers `onMatch` (an allow-list miss). Text matching at least one * allow term passes the allow gate. * * `onMatch` is `"block"` (default) or `"flag"`. With neither list supplied * the detector is a no-op that always allows. * * @example * ai.guardrail.topic({ deny: ["medical advice", /diagnos\w+/i] }); * * @example * // Stay on-topic: anything not about billing is flagged. * ai.guardrail.topic({ allow: ["billing", "invoice", "refund"], onMatch: "flag" }); */ declare function topic(options: TopicFilterOptions): SyncGuardrailDetector; //#endregion export { topic }; //# sourceMappingURL=topic.d.mts.map