/** * Rule evaluation for the copilot turn-end decision pipeline. * * Pure, deterministic evaluator over `CopilotRule` config. This module * owns NO session access, NO injection, and no side effects beyond an * occasional log line — the decision pipeline (the next stage of the * pipeline) consumes the returned `RuleDecision` and performs the actual * reply injection / turn-end handling. * * Semantics: * - Rules are evaluated in config order; the FIRST match wins. * - `match.pattern` is a regex tested against the last assistant text. * - `match.contains` is a case-insensitive substring check. * - When both are set, BOTH must match (AND). * - Invalid regexes are warned about and the offending rule is skipped — * evaluation never throws. * - A match returns a `RuleDecision`. No match returns `null`, and the * pipeline falls through to the next decision source. * - The `skip` action is represented as a real `RuleDecision` (distinct * from `null`): it means "consume the turn — no injection AND do not * fall through to the LLM source". */ import type { CopilotAction, CopilotRule } from "./types.ts"; /** Default reply text per action, used when a matching rule has no custom `reply`. */ export declare const DEFAULT_RULE_REPLIES: Record; /** A single rule match decision. */ export interface RuleDecision { /** Id of the rule that matched. */ ruleId: string; /** Action the pipeline must take for this turn. */ action: CopilotAction; /** Reply text: the rule's custom `reply`, or the per-action default. */ reply: string; } /** * Evaluate `rules` against the last assistant text. * * Returns the first matching rule's decision, or `null` when no rule * matches (the pipeline then falls through to the next decision source). * A `skip` match still returns a decision object — it is NOT `null`. */ export declare function evaluateRules(rules: CopilotRule[], lastAssistantText: string): RuleDecision | null; //# sourceMappingURL=rules.d.ts.map