/** * Escalation Triggers for PraisonAI Agents. * * Python parity: praisonaiagents/escalation/triggers.py. Detects signals * that indicate escalation or de-escalation is needed. Uses heuristics only - * no extra LLM calls for signal detection. */ import { EscalationConfig, EscalationConfigOptions, EscalationSignal, EscalationStage } from './types'; /** * Detects escalation signals from prompts and context. * * Python parity: escalation/triggers.py:13 `EscalationTrigger`. * * @example * const trigger = new EscalationTrigger(); * const signals = trigger.analyze('Refactor the auth module'); * const stage = trigger.recommendStage(signals); */ export declare class EscalationTrigger { /** Keywords indicating complex tasks (triggers.py:28). */ static readonly COMPLEX_KEYWORDS: readonly string[]; /** Keywords indicating simple tasks (triggers.py:37). */ static readonly SIMPLE_KEYWORDS: readonly string[]; /** Keywords indicating edit intent (triggers.py:44). */ static readonly EDIT_KEYWORDS: readonly string[]; /** Keywords indicating test intent (triggers.py:51). */ static readonly TEST_KEYWORDS: readonly string[]; /** Keywords indicating build intent (triggers.py:57). */ static readonly BUILD_KEYWORDS: readonly string[]; /** Keywords indicating refactor intent (triggers.py:63). */ static readonly REFACTOR_KEYWORDS: readonly string[]; /** File path pattern (triggers.py:70). */ static readonly FILE_PATTERN: RegExp; /** Code block pattern (triggers.py:76). */ static readonly CODE_BLOCK_PATTERN: RegExp; config: EscalationConfig; /** Python parity: escalation/triggers.py:78 `__init__(config=None)`. */ constructor(config?: EscalationConfig | EscalationConfigOptions | null); /** * Analyze prompt and context for escalation signals. * * Python parity: escalation/triggers.py:82 `analyze(prompt, context=None)`. */ analyze(prompt: string, context?: Record | null): Set; /** Python parity: escalation/triggers.py:156 `_has_multi_step_intent`. */ private hasMultiStepIntent; /** * Recommend an escalation stage based on signals. * * Python parity: escalation/triggers.py:182 `recommend_stage(signals, current_stage=None)`. */ recommendStage(signals: Set, currentStage?: EscalationStage | null): EscalationStage; /** Python parity: escalation/triggers.py:246 `_has_escalation_signals`. */ private hasEscalationSignals; /** * Check if escalation is recommended. * * Python parity: escalation/triggers.py:257 `should_escalate(signals, current_stage, context=None)`. */ shouldEscalate(signals: Set, currentStage: EscalationStage, context?: Record | null): boolean; /** * Check if de-escalation is appropriate. * * Python parity: escalation/triggers.py:277 `should_deescalate(signals, current_stage, context=None)`. */ shouldDeescalate(signals: Set, currentStage: EscalationStage, context?: Record | null): boolean; /** Python parity: escalation/triggers.py:316 `get_stage_description(stage)`. */ getStageDescription(stage: EscalationStage): string; }