import { type BatchPackageResult } from './batch-log-parser.js'; /** * One line of a batch run's output, carrying the severity Open Cloud reported * for the message it came from. * * Severity is per *message*, and a message can be several lines — an error * arrives with its whole traceback attached — so every line of a message * inherits it. That is why this is not derived from the text: guessing at * severity from patterns misreads a traceback's continuation lines, while the * API already says which of OUTPUT, WARNING and ERROR each message was. */ export interface RenderableLogLine { line: string; severity: 'output' | 'warning' | 'error'; } export interface BatchLogRenderOptions { /** Section slug to the package name a reader recognizes, for group titles. */ slugToPackage: Map; /** * Per-package verdicts, printed as each section closes so a package's result * sits with the output that produced it rather than in a later block. * * Keyed by package name, as `parseBatchTestLogs` returns it — sections are * named by slug, so a lookup here goes through `slugToPackage` first. */ results?: Map; /** Emit GitHub `::group::` markers. Off outside CI, where they are noise. */ useGroups: boolean; /** Colorize by severity. Off when NO_COLOR is set. */ color: boolean; } /** * Split typed messages into the lines the parser tokenizes, keeping severity. * * The join is the same one `getRawTaskLogsAsync` performs, so the resulting * lines are positionally identical to the parser's — which is what lets the * token at index i describe the line at index i. */ export declare function toRenderableLines(messages: Array<{ message: string; messageType?: string; }>): RenderableLogLine[]; /** * Render a whole batch run's output in arrival order, with each package's * section wrapped in a collapsible group. * * Every line the run produced is emitted, including the ones that belong to no * package: output between two sections, or before the first BEGIN, used to be * discarded by the parser and so never reached anyone. Those lines are exactly * the ones worth seeing when a batch misbehaves — a crash between packages, or * a harness message printed before the first test — so they are rendered at the * top level, outside any group, rather than dropped. * * Groups are injected around the parser's own BEGIN/END tokens rather than * opened as each package starts. An aggregated batch starts every package at * once, before the cloud task exists, so grouping by start time produced one * empty group per package and put every line under the last of them. */ export declare function renderBatchLog(lines: RenderableLogLine[], options: BatchLogRenderOptions): string[]; /** * Render everything one batch execution produced, ready to print. * * The binding between what a run reports and what the renderer is told about it * lives here rather than at the call site, so a field the outcome carries and * the render forgets — the results that put a verdict in every group title, say * — is a mistake one test can catch. * * Structural rather than typed against `BatchExecutionOutcome`: the job context * that defines it already imports this module. */ export declare function renderBatchOutcome(outcome: { lines: RenderableLogLine[]; results: Map; slugToPackage: Map; }, presentation: { useGroups: boolean; color: boolean; }): string[]; //# sourceMappingURL=batch-log-renderer.d.ts.map