/** * Event Triage — classifies coordinator events as "routine" or "creative" * to route them to the fast small-LLM path or the full Milaidy pipeline. * * Tier 1 (auto-response rules at PTY worker) already handled before we get here. * This module splits the remaining events into: * - "routine": simple approvals, permissions, config prompts → small LLM (~1-2s) * - "creative": error recovery, design questions, task evaluation → Milaidy (~5-10s) * * Pure functions — no side effects, same pattern as stall-classifier.ts. * * @module services/swarm-event-triage */ import { type IAgentRuntime } from "@elizaos/core"; export type TriageTier = "routine" | "creative"; export interface TriageContext { /** "blocked" or "turn_complete" */ eventType: "blocked" | "turn_complete"; /** The blocking prompt text (empty for turn completions). */ promptText: string; /** Adapter's promptInfo.type if available. */ promptType?: string; /** Recent terminal output (for turn completions). */ recentOutput?: string; /** The original task description. */ originalTask: string; } /** * Classify an event tier using only heuristics (prompt type + regex). * Returns null if inconclusive. */ export declare function classifyByHeuristic(ctx: TriageContext): TriageTier | null; /** * Build a short classifier prompt for ambiguous events. */ export declare function buildTriagePrompt(ctx: TriageContext): string; /** * Parse the LLM's triage response. Returns null on failure. */ export declare function parseTriageResponse(llmOutput: string): TriageTier | null; /** * Main entry point: classify an event as routine or creative. * * 1. Heuristics (0ms) * 2. Small LLM classifier (~500ms-1s) if heuristics are inconclusive * 3. Default to "creative" if classifier fails (safe default) */ export declare function classifyEventTier(runtime: IAgentRuntime, ctx: TriageContext, log: (msg: string) => void): Promise; //# sourceMappingURL=swarm-event-triage.d.ts.map