/* 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 "agent/v1/service.proto" (package "agent.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 "agent/v1/service.proto" (package "agent.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 { Cell } from "../../runme/parser/v1/parser_pb";
// @generated message type with reflection information, may provide speed optimized methods
class GenerateRequest$Type extends MessageType {
    constructor() {
        super("agent.v1.GenerateRequest", [
            { no: 1, name: "cells", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Cell },
            { no: 2, name: "previous_response_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "openai_access_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.cells = [];
        message.previousResponseId = "";
        message.openaiAccessToken = "";
        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 /* string previous_response_id */ 2:
                    message.previousResponseId = reader.string();
                    break;
                case /* string openai_access_token */ 3:
                    message.openaiAccessToken = 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) {
        /* 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();
        /* string previous_response_id = 2; */
        if (message.previousResponseId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.previousResponseId);
        /* string openai_access_token = 3; */
        if (message.openaiAccessToken !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.openaiAccessToken);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message agent.v1.GenerateRequest
 */
export const GenerateRequest = new GenerateRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GenerateResponse$Type extends MessageType {
    constructor() {
        super("agent.v1.GenerateResponse", [
            { no: 1, name: "cells", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Cell },
            { no: 2, name: "response_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.cells = [];
        message.responseId = "";
        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 /* string response_id */ 2:
                    message.responseId = 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) {
        /* 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();
        /* string response_id = 2; */
        if (message.responseId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.responseId);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message agent.v1.GenerateResponse
 */
export const GenerateResponse = new GenerateResponse$Type();
/**
 * @generated ServiceType for protobuf service agent.v1.MessagesService
 */
export const MessagesService = new ServiceType("agent.v1.MessagesService", [
    { name: "Generate", serverStreaming: true, options: {}, I: GenerateRequest, O: GenerateResponse }
]);
