import type { Rule } from "../capability/rule"; import type { TtsrSettings } from "../config/settings"; export type TtsrMatchSource = "text" | "thinking" | "tool"; /** Context about the stream content currently being checked against TTSR rules. */ export interface TtsrMatchContext { source: TtsrMatchSource; /** Tool name for tool argument deltas, e.g. "edit" or "write". */ toolName?: string; /** Candidate file paths associated with the current stream chunk. */ filePaths?: string[]; /** Stable key to isolate buffering (for example a tool call ID). */ streamKey?: string; } export declare class TtsrManager { #private; constructor(settings?: TtsrSettings); /** Add a TTSR rule to be monitored. */ addRule(rule: Rule): boolean; /** * Add a stream chunk to its scoped buffer and return matching rules. * * Buffers are isolated by source/tool key so matches don't bleed across * assistant prose, thinking text, and unrelated tool argument streams. */ checkDelta(delta: string, context: TtsrMatchContext): Rule[]; /** Mark rules as injected (won't trigger again until conditions allow). */ markInjected(rulesToMark: Rule[]): void; /** Mark rule names as injected (won't trigger again until conditions allow). */ markInjectedByNames(ruleNames: string[]): void; /** Get names of all injected rules (for persistence). */ getInjectedRuleNames(): string[]; /** Restore injected state from a list of rule names. */ restoreInjected(ruleNames: string[]): void; /** Reset stream buffers (called on new turn). */ resetBuffer(): void; /** Check if any TTSR rules are registered. */ hasRules(): boolean; /** Increment message counter (call after each turn). */ incrementMessageCount(): void; /** Get current message count. */ getMessageCount(): number; /** Get settings. */ getSettings(): Required; }