/** * How a `std::grep` call becomes a regular expression. * * Models write `flags` the way they would for the `grep` command (`n`, `rn`, * `gi`), but the search runs in-process on a JavaScript RegExp, which only * knows a few single-letter flags. This module owns the translation: each * letter is either a real regex flag, a grep habit the tool already * satisfies, or a request that belongs to a named parameter. The rule table * is the single place that decision lives; the messages it produces go back * to the model as the tool's failure text, so they say what to send instead. */ /** What the caller asked for: the raw `flags` string plus the named options. */ export type GrepQuery = { pattern: string; flags: string; ignoreCase: boolean; wholeWord: boolean; filesOnly: boolean; invert: boolean; }; /** The search the walker runs: one compiled regex and two output switches. */ export type GrepPlan = { regex: RegExp; filesOnly: boolean; invert: boolean; }; /** Turn a query into the regex the walker runs, or throw a message that * tells the caller which flag was wrong and what to send instead. */ export declare function compileGrepQuery(query: GrepQuery): GrepPlan;