/** * A minimal protobuf wire-format codec, just enough for Depot's build-step RPCs. * * Why this exists: Depot's Connect JSON binding of `depot.build.v1.BuildService/GetBuildSteps` * is broken server-side (observed 2026-09-06: the server fails to encode its own response, * "cannot encode field ... has_logs to JSON: expected boolean, got 0"), while the same RPC over * the binary protobuf encoding works. The messages involved are tiny (strings, int32, bool, an * enum, and google.protobuf.Timestamp), so a dependency-free codec is smaller and safer than * pulling in a protobuf runtime plus generated code. * * Only the wire types that appear in those messages are supported: varint (0), 64-bit (1), * length-delimited (2) and 32-bit (5). Groups (3, 4) are rejected. */ export interface VarintField { readonly wire: 0; readonly value: bigint; } export interface BytesField { readonly wire: 1 | 2 | 5; readonly value: Uint8Array; } export type WireField = VarintField | BytesField; /** A decoded message: field number -> every occurrence, in wire order. */ export type DecodedMessage = ReadonlyMap; export declare class ProtobufDecodeError extends Error { constructor(message: string); } export declare function decodeMessage(bytes: Uint8Array): DecodedMessage; /** proto3 "last one wins" for scalars. */ export declare function fieldString(message: DecodedMessage, field: number): string | undefined; export declare function fieldBool(message: DecodedMessage, field: number): boolean | undefined; /** Varint read as a signed 64-bit integer, then narrowed to a JS number. */ export declare function fieldInt(message: DecodedMessage, field: number): number | undefined; export declare function fieldMessages(message: DecodedMessage, field: number): DecodedMessage[]; export declare function fieldMessage(message: DecodedMessage, field: number): DecodedMessage | undefined; /** google.protobuf.Timestamp { int64 seconds = 1; int32 nanos = 2; } as an RFC 3339 string. */ export declare function fieldTimestamp(message: DecodedMessage, field: number): string | undefined; /** Builds a message from scalar fields and nested messages; unset (undefined) values are omitted. */ export declare class ProtobufWriter { private readonly parts; private varint; private tag; private lengthDelimited; string(field: number, value: string | undefined): this; int32(field: number, value: number | undefined): this; bool(field: number, value: boolean | undefined): this; message(field: number, value: ProtobufWriter | undefined): this; finish(): Uint8Array; } //# sourceMappingURL=protobuf.d.ts.map