export type LogLevel = 'info' | 'warn' | 'action' | 'success' | 'error' | 'ai'; export type LogKind = 'reasoning' | 'action' | 'system' | 'guidance'; export interface LogEntry { level: LogLevel; message: string; timestamp: number; runStartedAt?: number; runElapsedMs?: number; iteration?: number; maxIterations?: number; action?: string; params?: Record; /** Lang/theme/target context injected by the agent — used for parallel capture tracking */ lang?: string; theme?: string; targetId?: string; /** Semantic kind for chat-style rendering */ kind?: LogKind; } export type OnLogCallback = (entry: LogEntry) => void; export type OnScreenshotCallback = (base64: string) => void; export type OnReasoningDeltaCallback = (delta: string, messageId: string) => void; interface LoggerContext { onLog?: OnLogCallback | null; onScreenshot?: OnScreenshotCallback | null; onReasoningDelta?: OnReasoningDeltaCallback | null; } export declare function setDebugEnabled(enabled: boolean): void; export declare function isDebugEnabled(): boolean; export declare function runWithLoggerCallbacks(callbacks: LoggerContext, fn: () => Promise): Promise; export declare function setOnLog(cb: OnLogCallback | null): void; export declare function getOnLog(): OnLogCallback | null; export declare function setOnScreenshot(cb: OnScreenshotCallback | null): void; export declare function emitScreenshot(base64: string): void; export declare function emitReasoningDelta(delta: string, messageId: string): void; export declare const logger: { /** User-visible informational log — shown in both console and UI. */ info(msg: string): void; /** Internal debug log — only printed when --debug is enabled. Console only, NOT emitted to the UI callback. */ debug(msg: string): void; /** Security / rate-limit warnings — emitted to both console and UI. */ warn(msg: string): void; action(iteration: number, maxIter: number, action: string, params: Record, context?: { lang?: string; theme?: string; }): void; success(msg: string): void; error(msg: string): void; ai(msg: string): void; }; export {};