/* eslint-disable */
// @generated by protobuf-ts 2.11.1 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
// @generated from protobuf file "runme/parser/v1/parser.proto" (package "runme.parser.v1", syntax proto3)
// tslint:disable
// @ts-nocheck
/* eslint-disable */
// @generated by protobuf-ts 2.11.1 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
// @generated from protobuf file "runme/parser/v1/parser.proto" (package "runme.parser.v1", syntax proto3)
// tslint:disable
// @ts-nocheck
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { DocResult } from "./docresult_pb";
import { BoolValue } from "../../../google/protobuf/wrappers_pb";
import { UInt32Value } from "../../../google/protobuf/wrappers_pb";
import { Int64Value } from "../../../google/protobuf/wrappers_pb";
/**
 * @generated from protobuf enum runme.parser.v1.CellKind
 */
export var CellKind;
(function (CellKind) {
    /**
     * @generated from protobuf enum value: CELL_KIND_UNSPECIFIED = 0;
     */
    CellKind[CellKind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: CELL_KIND_MARKUP = 1;
     */
    CellKind[CellKind["MARKUP"] = 1] = "MARKUP";
    /**
     * @generated from protobuf enum value: CELL_KIND_CODE = 2;
     */
    CellKind[CellKind["CODE"] = 2] = "CODE";
    /**
     * todo(sebastian): is this needed?
     *
     * @generated from protobuf enum value: CELL_KIND_DOC_RESULTS = 3;
     */
    CellKind[CellKind["DOC_RESULTS"] = 3] = "DOC_RESULTS";
})(CellKind || (CellKind = {}));
/**
 * @generated from protobuf enum runme.parser.v1.CellRole
 */
export var CellRole;
(function (CellRole) {
    /**
     * @generated from protobuf enum value: CELL_ROLE_UNSPECIFIED = 0;
     */
    CellRole[CellRole["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: CELL_ROLE_USER = 1;
     */
    CellRole[CellRole["USER"] = 1] = "USER";
    /**
     * @generated from protobuf enum value: CELL_ROLE_ASSISTANT = 2;
     */
    CellRole[CellRole["ASSISTANT"] = 2] = "ASSISTANT";
})(CellRole || (CellRole = {}));
/**
 * RunmeIdentity controls if unique identifiers are inserted if not present.
 *
 * @generated from protobuf enum runme.parser.v1.RunmeIdentity
 */
export var RunmeIdentity;
(function (RunmeIdentity) {
    /**
     * aka NONE
     *
     * @generated from protobuf enum value: RUNME_IDENTITY_UNSPECIFIED = 0;
     */
    RunmeIdentity[RunmeIdentity["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: RUNME_IDENTITY_ALL = 1;
     */
    RunmeIdentity[RunmeIdentity["ALL"] = 1] = "ALL";
    /**
     * @generated from protobuf enum value: RUNME_IDENTITY_DOCUMENT = 2;
     */
    RunmeIdentity[RunmeIdentity["DOCUMENT"] = 2] = "DOCUMENT";
    /**
     * @generated from protobuf enum value: RUNME_IDENTITY_CELL = 3;
     */
    RunmeIdentity[RunmeIdentity["CELL"] = 3] = "CELL";
})(RunmeIdentity || (RunmeIdentity = {}));
// @generated message type with reflection information, may provide speed optimized methods
class Notebook$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.Notebook", [
            { no: 1, name: "cells", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Cell },
            { no: 2, name: "metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
            { no: 3, name: "frontmatter", kind: "message", T: () => Frontmatter }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.cells = [];
        message.metadata = {};
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated runme.parser.v1.Cell cells */ 1:
                    message.cells.push(Cell.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* map<string, string> metadata */ 2:
                    this.binaryReadMap2(message.metadata, reader, options);
                    break;
                case /* runme.parser.v1.Frontmatter frontmatter */ 3:
                    message.frontmatter = Frontmatter.internalBinaryRead(reader, reader.uint32(), options, message.frontmatter);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    binaryReadMap2(map, reader, options) {
        let len = reader.uint32(), end = reader.pos + len, key, val;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = reader.string();
                    break;
                default: throw new globalThis.Error("unknown map entry field for runme.parser.v1.Notebook.metadata");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message, writer, options) {
        /* repeated runme.parser.v1.Cell cells = 1; */
        for (let i = 0; i < message.cells.length; i++)
            Cell.internalBinaryWrite(message.cells[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* map<string, string> metadata = 2; */
        for (let k of globalThis.Object.keys(message.metadata))
            writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.metadata[k]).join();
        /* runme.parser.v1.Frontmatter frontmatter = 3; */
        if (message.frontmatter)
            Frontmatter.internalBinaryWrite(message.frontmatter, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.Notebook
 */
export const Notebook = new Notebook$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionSummaryTiming$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.ExecutionSummaryTiming", [
            { no: 1, name: "start_time", kind: "message", T: () => Int64Value },
            { no: 2, name: "end_time", kind: "message", T: () => Int64Value }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* google.protobuf.Int64Value start_time */ 1:
                    message.startTime = Int64Value.internalBinaryRead(reader, reader.uint32(), options, message.startTime);
                    break;
                case /* google.protobuf.Int64Value end_time */ 2:
                    message.endTime = Int64Value.internalBinaryRead(reader, reader.uint32(), options, message.endTime);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* google.protobuf.Int64Value start_time = 1; */
        if (message.startTime)
            Int64Value.internalBinaryWrite(message.startTime, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Int64Value end_time = 2; */
        if (message.endTime)
            Int64Value.internalBinaryWrite(message.endTime, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.ExecutionSummaryTiming
 */
export const ExecutionSummaryTiming = new ExecutionSummaryTiming$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CellOutputItem$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.CellOutputItem", [
            { no: 1, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
            { no: 2, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "mime", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.data = new Uint8Array(0);
        message.type = "";
        message.mime = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* bytes data */ 1:
                    message.data = reader.bytes();
                    break;
                case /* string type */ 2:
                    message.type = reader.string();
                    break;
                case /* string mime */ 3:
                    message.mime = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* bytes data = 1; */
        if (message.data.length)
            writer.tag(1, WireType.LengthDelimited).bytes(message.data);
        /* string type = 2; */
        if (message.type !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.type);
        /* string mime = 3; */
        if (message.mime !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.mime);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.CellOutputItem
 */
export const CellOutputItem = new CellOutputItem$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ProcessInfoExitReason$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.ProcessInfoExitReason", [
            { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "code", kind: "message", T: () => UInt32Value }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.type = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string type */ 1:
                    message.type = reader.string();
                    break;
                case /* google.protobuf.UInt32Value code */ 2:
                    message.code = UInt32Value.internalBinaryRead(reader, reader.uint32(), options, message.code);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string type = 1; */
        if (message.type !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.type);
        /* google.protobuf.UInt32Value code = 2; */
        if (message.code)
            UInt32Value.internalBinaryWrite(message.code, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.ProcessInfoExitReason
 */
export const ProcessInfoExitReason = new ProcessInfoExitReason$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CellOutputProcessInfo$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.CellOutputProcessInfo", [
            { no: 1, name: "exit_reason", kind: "message", T: () => ProcessInfoExitReason },
            { no: 2, name: "pid", kind: "message", T: () => Int64Value }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.ProcessInfoExitReason exit_reason */ 1:
                    message.exitReason = ProcessInfoExitReason.internalBinaryRead(reader, reader.uint32(), options, message.exitReason);
                    break;
                case /* google.protobuf.Int64Value pid */ 2:
                    message.pid = Int64Value.internalBinaryRead(reader, reader.uint32(), options, message.pid);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.ProcessInfoExitReason exit_reason = 1; */
        if (message.exitReason)
            ProcessInfoExitReason.internalBinaryWrite(message.exitReason, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Int64Value pid = 2; */
        if (message.pid)
            Int64Value.internalBinaryWrite(message.pid, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.CellOutputProcessInfo
 */
export const CellOutputProcessInfo = new CellOutputProcessInfo$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CellOutput$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.CellOutput", [
            { no: 1, name: "items", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => CellOutputItem },
            { no: 2, name: "metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
            { no: 3, name: "process_info", kind: "message", T: () => CellOutputProcessInfo }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.items = [];
        message.metadata = {};
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated runme.parser.v1.CellOutputItem items */ 1:
                    message.items.push(CellOutputItem.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* map<string, string> metadata */ 2:
                    this.binaryReadMap2(message.metadata, reader, options);
                    break;
                case /* runme.parser.v1.CellOutputProcessInfo process_info */ 3:
                    message.processInfo = CellOutputProcessInfo.internalBinaryRead(reader, reader.uint32(), options, message.processInfo);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    binaryReadMap2(map, reader, options) {
        let len = reader.uint32(), end = reader.pos + len, key, val;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = reader.string();
                    break;
                default: throw new globalThis.Error("unknown map entry field for runme.parser.v1.CellOutput.metadata");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message, writer, options) {
        /* repeated runme.parser.v1.CellOutputItem items = 1; */
        for (let i = 0; i < message.items.length; i++)
            CellOutputItem.internalBinaryWrite(message.items[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* map<string, string> metadata = 2; */
        for (let k of globalThis.Object.keys(message.metadata))
            writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.metadata[k]).join();
        /* runme.parser.v1.CellOutputProcessInfo process_info = 3; */
        if (message.processInfo)
            CellOutputProcessInfo.internalBinaryWrite(message.processInfo, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.CellOutput
 */
export const CellOutput = new CellOutput$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CellExecutionSummary$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.CellExecutionSummary", [
            { no: 1, name: "execution_order", kind: "message", T: () => UInt32Value },
            { no: 2, name: "success", kind: "message", T: () => BoolValue },
            { no: 3, name: "timing", kind: "message", T: () => ExecutionSummaryTiming }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* google.protobuf.UInt32Value execution_order */ 1:
                    message.executionOrder = UInt32Value.internalBinaryRead(reader, reader.uint32(), options, message.executionOrder);
                    break;
                case /* google.protobuf.BoolValue success */ 2:
                    message.success = BoolValue.internalBinaryRead(reader, reader.uint32(), options, message.success);
                    break;
                case /* runme.parser.v1.ExecutionSummaryTiming timing */ 3:
                    message.timing = ExecutionSummaryTiming.internalBinaryRead(reader, reader.uint32(), options, message.timing);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* google.protobuf.UInt32Value execution_order = 1; */
        if (message.executionOrder)
            UInt32Value.internalBinaryWrite(message.executionOrder, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.BoolValue success = 2; */
        if (message.success)
            BoolValue.internalBinaryWrite(message.success, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* runme.parser.v1.ExecutionSummaryTiming timing = 3; */
        if (message.timing)
            ExecutionSummaryTiming.internalBinaryWrite(message.timing, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.CellExecutionSummary
 */
export const CellExecutionSummary = new CellExecutionSummary$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TextRange$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.TextRange", [
            { no: 1, name: "start", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
            { no: 2, name: "end", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.start = 0;
        message.end = 0;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* uint32 start */ 1:
                    message.start = reader.uint32();
                    break;
                case /* uint32 end */ 2:
                    message.end = reader.uint32();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* uint32 start = 1; */
        if (message.start !== 0)
            writer.tag(1, WireType.Varint).uint32(message.start);
        /* uint32 end = 2; */
        if (message.end !== 0)
            writer.tag(2, WireType.Varint).uint32(message.end);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.TextRange
 */
export const TextRange = new TextRange$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Cell$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.Cell", [
            { no: 1, name: "kind", kind: "enum", T: () => ["runme.parser.v1.CellKind", CellKind, "CELL_KIND_"] },
            { no: 2, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "language_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
            { no: 5, name: "text_range", kind: "message", T: () => TextRange },
            { no: 6, name: "outputs", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => CellOutput },
            { no: 7, name: "execution_summary", kind: "message", T: () => CellExecutionSummary },
            { no: 100, name: "ref_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 101, name: "role", kind: "enum", T: () => ["runme.parser.v1.CellRole", CellRole, "CELL_ROLE_"] },
            { no: 102, name: "call_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 103, name: "doc_results", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DocResult }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.kind = 0;
        message.value = "";
        message.languageId = "";
        message.metadata = {};
        message.outputs = [];
        message.refId = "";
        message.role = 0;
        message.callId = "";
        message.docResults = [];
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.CellKind kind */ 1:
                    message.kind = reader.int32();
                    break;
                case /* string value */ 2:
                    message.value = reader.string();
                    break;
                case /* string language_id */ 3:
                    message.languageId = reader.string();
                    break;
                case /* map<string, string> metadata */ 4:
                    this.binaryReadMap4(message.metadata, reader, options);
                    break;
                case /* runme.parser.v1.TextRange text_range */ 5:
                    message.textRange = TextRange.internalBinaryRead(reader, reader.uint32(), options, message.textRange);
                    break;
                case /* repeated runme.parser.v1.CellOutput outputs */ 6:
                    message.outputs.push(CellOutput.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* runme.parser.v1.CellExecutionSummary execution_summary */ 7:
                    message.executionSummary = CellExecutionSummary.internalBinaryRead(reader, reader.uint32(), options, message.executionSummary);
                    break;
                case /* string ref_id */ 100:
                    message.refId = reader.string();
                    break;
                case /* runme.parser.v1.CellRole role */ 101:
                    message.role = reader.int32();
                    break;
                case /* string call_id */ 102:
                    message.callId = reader.string();
                    break;
                case /* repeated runme.parser.v1.DocResult doc_results */ 103:
                    message.docResults.push(DocResult.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    binaryReadMap4(map, reader, options) {
        let len = reader.uint32(), end = reader.pos + len, key, val;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = reader.string();
                    break;
                default: throw new globalThis.Error("unknown map entry field for runme.parser.v1.Cell.metadata");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.CellKind kind = 1; */
        if (message.kind !== 0)
            writer.tag(1, WireType.Varint).int32(message.kind);
        /* string value = 2; */
        if (message.value !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.value);
        /* string language_id = 3; */
        if (message.languageId !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.languageId);
        /* map<string, string> metadata = 4; */
        for (let k of globalThis.Object.keys(message.metadata))
            writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.metadata[k]).join();
        /* runme.parser.v1.TextRange text_range = 5; */
        if (message.textRange)
            TextRange.internalBinaryWrite(message.textRange, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated runme.parser.v1.CellOutput outputs = 6; */
        for (let i = 0; i < message.outputs.length; i++)
            CellOutput.internalBinaryWrite(message.outputs[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* runme.parser.v1.CellExecutionSummary execution_summary = 7; */
        if (message.executionSummary)
            CellExecutionSummary.internalBinaryWrite(message.executionSummary, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* string ref_id = 100; */
        if (message.refId !== "")
            writer.tag(100, WireType.LengthDelimited).string(message.refId);
        /* runme.parser.v1.CellRole role = 101; */
        if (message.role !== 0)
            writer.tag(101, WireType.Varint).int32(message.role);
        /* string call_id = 102; */
        if (message.callId !== "")
            writer.tag(102, WireType.LengthDelimited).string(message.callId);
        /* repeated runme.parser.v1.DocResult doc_results = 103; */
        for (let i = 0; i < message.docResults.length; i++)
            DocResult.internalBinaryWrite(message.docResults[i], writer.tag(103, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.Cell
 */
export const Cell = new Cell$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RunmeSessionDocument$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.RunmeSessionDocument", [
            { no: 1, name: "relative_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.relativePath = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string relative_path */ 1:
                    message.relativePath = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string relative_path = 1; */
        if (message.relativePath !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.relativePath);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.RunmeSessionDocument
 */
export const RunmeSessionDocument = new RunmeSessionDocument$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RunmeSession$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.RunmeSession", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "document", kind: "message", T: () => RunmeSessionDocument }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.id = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string id */ 1:
                    message.id = reader.string();
                    break;
                case /* runme.parser.v1.RunmeSessionDocument document */ 2:
                    message.document = RunmeSessionDocument.internalBinaryRead(reader, reader.uint32(), options, message.document);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string id = 1; */
        if (message.id !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.id);
        /* runme.parser.v1.RunmeSessionDocument document = 2; */
        if (message.document)
            RunmeSessionDocument.internalBinaryWrite(message.document, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.RunmeSession
 */
export const RunmeSession = new RunmeSession$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FrontmatterRunme$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.FrontmatterRunme", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "session", kind: "message", T: () => RunmeSession }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.id = "";
        message.version = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string id */ 1:
                    message.id = reader.string();
                    break;
                case /* string version */ 2:
                    message.version = reader.string();
                    break;
                case /* runme.parser.v1.RunmeSession session */ 3:
                    message.session = RunmeSession.internalBinaryRead(reader, reader.uint32(), options, message.session);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string id = 1; */
        if (message.id !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.id);
        /* string version = 2; */
        if (message.version !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.version);
        /* runme.parser.v1.RunmeSession session = 3; */
        if (message.session)
            RunmeSession.internalBinaryWrite(message.session, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.FrontmatterRunme
 */
export const FrontmatterRunme = new FrontmatterRunme$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Frontmatter$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.Frontmatter", [
            { no: 1, name: "shell", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "cwd", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "skip_prompts", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 4, name: "runme", kind: "message", T: () => FrontmatterRunme },
            { no: 5, name: "category", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "terminal_rows", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "tag", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.shell = "";
        message.cwd = "";
        message.skipPrompts = false;
        message.category = "";
        message.terminalRows = "";
        message.tag = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string shell */ 1:
                    message.shell = reader.string();
                    break;
                case /* string cwd */ 2:
                    message.cwd = reader.string();
                    break;
                case /* bool skip_prompts */ 3:
                    message.skipPrompts = reader.bool();
                    break;
                case /* runme.parser.v1.FrontmatterRunme runme */ 4:
                    message.runme = FrontmatterRunme.internalBinaryRead(reader, reader.uint32(), options, message.runme);
                    break;
                case /* string category */ 5:
                    message.category = reader.string();
                    break;
                case /* string terminal_rows */ 6:
                    message.terminalRows = reader.string();
                    break;
                case /* string tag */ 7:
                    message.tag = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string shell = 1; */
        if (message.shell !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.shell);
        /* string cwd = 2; */
        if (message.cwd !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.cwd);
        /* bool skip_prompts = 3; */
        if (message.skipPrompts !== false)
            writer.tag(3, WireType.Varint).bool(message.skipPrompts);
        /* runme.parser.v1.FrontmatterRunme runme = 4; */
        if (message.runme)
            FrontmatterRunme.internalBinaryWrite(message.runme, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* string category = 5; */
        if (message.category !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.category);
        /* string terminal_rows = 6; */
        if (message.terminalRows !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.terminalRows);
        /* string tag = 7; */
        if (message.tag !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.tag);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.Frontmatter
 */
export const Frontmatter = new Frontmatter$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeserializeRequestOptions$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.DeserializeRequestOptions", [
            { no: 1, name: "identity", kind: "enum", T: () => ["runme.parser.v1.RunmeIdentity", RunmeIdentity, "RUNME_IDENTITY_"] }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.identity = 0;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.RunmeIdentity identity */ 1:
                    message.identity = reader.int32();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.RunmeIdentity identity = 1; */
        if (message.identity !== 0)
            writer.tag(1, WireType.Varint).int32(message.identity);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.DeserializeRequestOptions
 */
export const DeserializeRequestOptions = new DeserializeRequestOptions$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeserializeRequest$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.DeserializeRequest", [
            { no: 1, name: "source", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
            { no: 2, name: "options", kind: "message", T: () => DeserializeRequestOptions }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.source = new Uint8Array(0);
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* bytes source */ 1:
                    message.source = reader.bytes();
                    break;
                case /* runme.parser.v1.DeserializeRequestOptions options */ 2:
                    message.options = DeserializeRequestOptions.internalBinaryRead(reader, reader.uint32(), options, message.options);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* bytes source = 1; */
        if (message.source.length)
            writer.tag(1, WireType.LengthDelimited).bytes(message.source);
        /* runme.parser.v1.DeserializeRequestOptions options = 2; */
        if (message.options)
            DeserializeRequestOptions.internalBinaryWrite(message.options, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.DeserializeRequest
 */
export const DeserializeRequest = new DeserializeRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeserializeResponse$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.DeserializeResponse", [
            { no: 1, name: "notebook", kind: "message", T: () => Notebook }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.Notebook notebook */ 1:
                    message.notebook = Notebook.internalBinaryRead(reader, reader.uint32(), options, message.notebook);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.Notebook notebook = 1; */
        if (message.notebook)
            Notebook.internalBinaryWrite(message.notebook, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.DeserializeResponse
 */
export const DeserializeResponse = new DeserializeResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SerializeRequestOutputOptions$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.SerializeRequestOutputOptions", [
            { no: 1, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 2, name: "summary", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.enabled = false;
        message.summary = false;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* bool enabled */ 1:
                    message.enabled = reader.bool();
                    break;
                case /* bool summary */ 2:
                    message.summary = reader.bool();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* bool enabled = 1; */
        if (message.enabled !== false)
            writer.tag(1, WireType.Varint).bool(message.enabled);
        /* bool summary = 2; */
        if (message.summary !== false)
            writer.tag(2, WireType.Varint).bool(message.summary);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.SerializeRequestOutputOptions
 */
export const SerializeRequestOutputOptions = new SerializeRequestOutputOptions$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SerializeRequestOptions$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.SerializeRequestOptions", [
            { no: 1, name: "outputs", kind: "message", T: () => SerializeRequestOutputOptions },
            { no: 2, name: "session", kind: "message", T: () => RunmeSession }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.SerializeRequestOutputOptions outputs */ 1:
                    message.outputs = SerializeRequestOutputOptions.internalBinaryRead(reader, reader.uint32(), options, message.outputs);
                    break;
                case /* runme.parser.v1.RunmeSession session */ 2:
                    message.session = RunmeSession.internalBinaryRead(reader, reader.uint32(), options, message.session);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.SerializeRequestOutputOptions outputs = 1; */
        if (message.outputs)
            SerializeRequestOutputOptions.internalBinaryWrite(message.outputs, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* runme.parser.v1.RunmeSession session = 2; */
        if (message.session)
            RunmeSession.internalBinaryWrite(message.session, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.SerializeRequestOptions
 */
export const SerializeRequestOptions = new SerializeRequestOptions$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SerializeRequest$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.SerializeRequest", [
            { no: 1, name: "notebook", kind: "message", T: () => Notebook },
            { no: 2, name: "options", kind: "message", T: () => SerializeRequestOptions }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.Notebook notebook */ 1:
                    message.notebook = Notebook.internalBinaryRead(reader, reader.uint32(), options, message.notebook);
                    break;
                case /* runme.parser.v1.SerializeRequestOptions options */ 2:
                    message.options = SerializeRequestOptions.internalBinaryRead(reader, reader.uint32(), options, message.options);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.Notebook notebook = 1; */
        if (message.notebook)
            Notebook.internalBinaryWrite(message.notebook, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* runme.parser.v1.SerializeRequestOptions options = 2; */
        if (message.options)
            SerializeRequestOptions.internalBinaryWrite(message.options, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.SerializeRequest
 */
export const SerializeRequest = new SerializeRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SerializeResponse$Type extends MessageType {
    constructor() {
        super("runme.parser.v1.SerializeResponse", [
            { no: 1, name: "result", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.result = new Uint8Array(0);
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* bytes result */ 1:
                    message.result = reader.bytes();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* bytes result = 1; */
        if (message.result.length)
            writer.tag(1, WireType.LengthDelimited).bytes(message.result);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.parser.v1.SerializeResponse
 */
export const SerializeResponse = new SerializeResponse$Type();
/**
 * @generated ServiceType for protobuf service runme.parser.v1.ParserService
 */
export const ParserService = new ServiceType("runme.parser.v1.ParserService", [
    { name: "Deserialize", options: {}, I: DeserializeRequest, O: DeserializeResponse },
    { name: "Serialize", options: {}, I: SerializeRequest, O: SerializeResponse }
]);
