import { EventEmitter } from "node:events"; import type { OutputMode, OutputEvent } from "../types.js"; export declare class OutputManager extends EventEmitter { private mode; constructor(mode?: OutputMode); /** * Detect output mode based on TTY status * If stdout is a TTY, use interactive mode * Otherwise (pipe, redirect, etc.), use JSON mode */ static detectMode(): OutputMode; /** * Get the current output mode */ getMode(): OutputMode; /** * Emit an output event * In JSON mode: writes to stdout as single-line JSON * In interactive mode: emits event for Ink components to handle */ emitEvent(event: OutputEvent): void; /** * Emit a log event */ emitLog(level: "debug" | "info" | "warn" | "error", message: string, args?: any[]): void; /** * Emit agent start event */ emitAgentStart(agent: string, prompt: string): void; /** * Emit agent stream chunk * Forwards raw chunks from deepagents/LangGraph for client-side interpretation */ emitAgentStream(chunk: any, tokenUsage?: { inputTokens: number; outputTokens: number; totalTokens: number; }, estimatedContextTokens?: number, thresholdTokens?: number): void; /** * Emit explicit context summarization start signal */ emitContextSummarizing(): void; /** * Emit explicit context summarization signal */ emitContextSummarized(payload: { inputTokens: number; peakInputTokens: number; thresholdTokens?: number; }): void; /** * Emit agent completion */ emitAgentComplete(result: any): void; /** * Emit agent error */ emitAgentError(error: Error | string): void; }