/** * Self-contained adapter: `RawjsonEnvelope` → `RawjsonVertexEvent`. * * The output shape is OWNED by `@fjall/util/docker`. It does NOT import * from `@fjall/cli` or any cli-side BuildKit decoder module — that bridge * is a PR 2 concern. The shape below is structurally compatible with the * cli-side `BuildKitStateManager` input (`BuildKitStatusResponse`); the * PR 2 bridge maps these fields directly. * * Field mapping the PR 2 bridge will use: * vertex.digest → BuildKitVertex.digest * vertex.name → BuildKitVertex.name * vertex.started → BuildKitVertex.started (timestamp) * vertex.completed → BuildKitVertex.completed (timestamp) * vertex.error → BuildKitVertex.error * log.data → BuildKitVertexLog.data (base64-encoded; consumer decodes) * log.stream → BuildKitVertexLog.stream (1=stdout, 2=stderr) * status.id → BuildKitVertexStatus.id * status.name → BuildKitVertexStatus.name * * Same external-API exemption as `rawjsonParser.ts`: this shape is * structural-typed, not Zod-validated. Buildx ships new fields without * notice; a `.strict()` schema would reject valid output. * * Returns `null` if the envelope has no extractable vertex/status/log/warning * arrays (e.g. when `extra` contains buildx-private metadata only). */ import type { RawjsonEnvelope } from "./rawjsonParser.js"; export interface NormalisedVertex { readonly digest: string; readonly name: string; readonly started?: string; readonly completed?: string; readonly cached?: boolean; readonly error?: string; readonly inputs?: readonly string[]; } export interface NormalisedStatus { readonly id: string; readonly vertex: string; readonly name: string; readonly current: number; readonly total?: number; readonly started?: string; readonly completed?: string; } export interface NormalisedLog { readonly vertex: string; readonly stream: "stdout" | "stderr"; readonly data: string; readonly timestamp?: string; } export interface NormalisedWarning { readonly vertex: string; readonly level: string; readonly short: string; } export interface RawjsonVertexEvent { readonly vertexes: readonly NormalisedVertex[]; readonly statuses: readonly NormalisedStatus[]; readonly logs: readonly NormalisedLog[]; readonly warnings: readonly NormalisedWarning[]; } export declare function rawjsonToVertexEvent(envelope: RawjsonEnvelope): RawjsonVertexEvent | null;