// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

export interface RegexCondition {
    /**
     * This is the regular expression pattern to match against message content.
     *
     * Note:
     * - This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true.
     *
     * Hot tips:
     * - In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead.
     * - RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, use anchors: /^cat$/ will only match exactly "cat".
     * - Word boundaries \b are useful for matching whole words: /\bcat\b/ matches "cat" but not "cats" or "category".
     * - Use inline flags for portability: (?i) for case insensitive, (?m) for multiline
     */
    regex: string;
    /**
     * This is the target for messages to check against.
     * If not specified, the condition will run on the last message (position: -1).
     * If role is not specified, it will look at the last message regardless of role.
     * @default { position: -1 }
     */
    target?: Vapi.MessageTarget | undefined;
    /**
     * This is the flag that when true, the condition matches if the pattern does NOT match.
     * Useful for ensuring certain words/phrases are absent.
     *
     * @default false
     */
    negate?: boolean | undefined;
}
