/** Max accepted base64 delta, in characters (~8 MiB). */ export declare const MAX_DELTA_B64_CHARS: number; /** Chars of provenance label kept — a diff carries no text, so the label is its only description. */ export declare const DELTA_LABEL_MAX_CHARS = 800; /** A validated delta contribution — the exact body a producer sends. */ export interface DeltaLearnPayload { /** base64 serialized RowDelta (`diffCheckpoints(base, adapted)`). */ diff: string; /** The model version the delta was diffed against. */ baseVersion: number; /** FedAvg sample weight (> 0). Absent means the writer's default (1). */ weight?: number; /** Provenance for the merged row (e.g. the run's task). */ label?: string; } /** Why a body was refused: `invalid` (malformed) or `too-large` (over {@link MAX_DELTA_B64_CHARS}). */ export type DeltaParseResult = { ok: true; payload: DeltaLearnPayload; } | { ok: false; reason: "invalid" | "too-large"; error: string; }; /** * Parse + validate a delta body. Pure — a front door calls it to refuse a bad body * early, and the single writer calls it again because it trusts no caller. */ export declare function parseDeltaLearnPayload(raw: unknown): DeltaParseResult; /** * Build the payload for one computed diff. The caller owns the size guard (compare * `payload.diff.length` with {@link MAX_DELTA_B64_CHARS}) so it can choose a fallback. */ export declare function buildDeltaLearnPayload(diff: ArrayBuffer, baseVersion: number, weight?: number, label?: string): DeltaLearnPayload; /** Decode a payload's base64 `diff` to the serialized RowDelta bytes. Throws on malformed base64. */ export declare function decodeDeltaPayload(payload: Pick): ArrayBuffer; /** * Structural check of ONE delta against the base it claims to diff: it must * deserialize, be element-granular, index only elements the base has, and carry * finite values. Returns why it is unusable, or null when it can join a merge. */ export declare function deltaUnusableReason(delta: ArrayBuffer, baseCheckpoint: ArrayBuffer): string | null; //# sourceMappingURL=delta_wire.d.ts.map