import type { LogEntry } from './logger.js'; import type { ProgressEvent } from './opcode-runner.js'; import type { RunFailureKind } from './execution-types.js'; export interface OpcodeContext { index: number; kind: string; targetId?: string; } export interface ExportedLogEntry extends LogEntry { opcode?: OpcodeContext; recovery?: { strategy: string; reason: string; succeeded: boolean; }; postcondition?: { type: string; reason: string; }; meta?: Record; } export interface ErrorLogsPayload { runId: string; presetId: string; entries: ExportedLogEntry[]; envName?: string; endedAt: string; /** Structured failure category (e.g. 'login_failed'). Lets the server tag the * preset's capture_failed event with a specific kind. */ failureKind?: RunFailureKind; } export declare class LogCollector { private entries; private previousLogCallback; private started; private runStartedAt; start(): void; stop(): void; onProgress(event: ProgressEvent): void; snapshot(): ExportedLogEntry[]; size(): number; flushTo(runId: string, presetId: string, apiBaseUrl: string, apiKey: string, envName?: string, failureKind?: RunFailureKind): Promise<{ ok: boolean; status?: number; error?: string; }>; private push; private mapLogEntry; private captureExistingCallback; }