import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
/**
 * @generated from protobuf enum nimi.runtime.v1.LocalEngineStatus
 */
export var LocalEngineStatus;
(function (LocalEngineStatus) {
    /**
     * @generated from protobuf enum value: LOCAL_ENGINE_STATUS_UNSPECIFIED = 0;
     */
    LocalEngineStatus[LocalEngineStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: LOCAL_ENGINE_STATUS_STOPPED = 1;
     */
    LocalEngineStatus[LocalEngineStatus["STOPPED"] = 1] = "STOPPED";
    /**
     * @generated from protobuf enum value: LOCAL_ENGINE_STATUS_STARTING = 2;
     */
    LocalEngineStatus[LocalEngineStatus["STARTING"] = 2] = "STARTING";
    /**
     * @generated from protobuf enum value: LOCAL_ENGINE_STATUS_HEALTHY = 3;
     */
    LocalEngineStatus[LocalEngineStatus["HEALTHY"] = 3] = "HEALTHY";
    /**
     * @generated from protobuf enum value: LOCAL_ENGINE_STATUS_UNHEALTHY = 4;
     */
    LocalEngineStatus[LocalEngineStatus["UNHEALTHY"] = 4] = "UNHEALTHY";
})(LocalEngineStatus || (LocalEngineStatus = {}));
// @generated message type with reflection information, may provide speed optimized methods
class LocalEngineDescriptor$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.LocalEngineDescriptor", [
            { no: 1, name: "engine", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "endpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "port", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 5, name: "status", kind: "enum", T: () => ["nimi.runtime.v1.LocalEngineStatus", LocalEngineStatus, "LOCAL_ENGINE_STATUS_"] },
            { no: 6, name: "pid", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 7, name: "platform", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "binary_size_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 9, name: "started_at", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "last_healthy_at", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 11, name: "consecutive_failures", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 12, name: "binary_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.engine = "";
        message.version = "";
        message.endpoint = "";
        message.port = 0;
        message.status = 0;
        message.pid = 0;
        message.platform = "";
        message.binarySizeBytes = "0";
        message.startedAt = "";
        message.lastHealthyAt = "";
        message.consecutiveFailures = 0;
        message.binaryPath = "";
        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 engine */ 1:
                    message.engine = reader.string();
                    break;
                case /* string version */ 2:
                    message.version = reader.string();
                    break;
                case /* string endpoint */ 3:
                    message.endpoint = reader.string();
                    break;
                case /* int32 port */ 4:
                    message.port = reader.int32();
                    break;
                case /* nimi.runtime.v1.LocalEngineStatus status */ 5:
                    message.status = reader.int32();
                    break;
                case /* int32 pid */ 6:
                    message.pid = reader.int32();
                    break;
                case /* string platform */ 7:
                    message.platform = reader.string();
                    break;
                case /* int64 binary_size_bytes */ 8:
                    message.binarySizeBytes = reader.int64().toString();
                    break;
                case /* string started_at */ 9:
                    message.startedAt = reader.string();
                    break;
                case /* string last_healthy_at */ 10:
                    message.lastHealthyAt = reader.string();
                    break;
                case /* int32 consecutive_failures */ 11:
                    message.consecutiveFailures = reader.int32();
                    break;
                case /* string binary_path */ 12:
                    message.binaryPath = 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 engine = 1; */
        if (message.engine !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.engine);
        /* string version = 2; */
        if (message.version !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.version);
        /* string endpoint = 3; */
        if (message.endpoint !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.endpoint);
        /* int32 port = 4; */
        if (message.port !== 0)
            writer.tag(4, WireType.Varint).int32(message.port);
        /* nimi.runtime.v1.LocalEngineStatus status = 5; */
        if (message.status !== 0)
            writer.tag(5, WireType.Varint).int32(message.status);
        /* int32 pid = 6; */
        if (message.pid !== 0)
            writer.tag(6, WireType.Varint).int32(message.pid);
        /* string platform = 7; */
        if (message.platform !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.platform);
        /* int64 binary_size_bytes = 8; */
        if (message.binarySizeBytes !== "0")
            writer.tag(8, WireType.Varint).int64(message.binarySizeBytes);
        /* string started_at = 9; */
        if (message.startedAt !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.startedAt);
        /* string last_healthy_at = 10; */
        if (message.lastHealthyAt !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.lastHealthyAt);
        /* int32 consecutive_failures = 11; */
        if (message.consecutiveFailures !== 0)
            writer.tag(11, WireType.Varint).int32(message.consecutiveFailures);
        /* string binary_path = 12; */
        if (message.binaryPath !== "")
            writer.tag(12, WireType.LengthDelimited).string(message.binaryPath);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.LocalEngineDescriptor
 */
export const LocalEngineDescriptor = new LocalEngineDescriptor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListEnginesRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListEnginesRequest", []);
    }
    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) {
                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) {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.ListEnginesRequest
 */
export const ListEnginesRequest = new ListEnginesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListEnginesResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListEnginesResponse", [
            { no: 1, name: "engines", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => LocalEngineDescriptor }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.engines = [];
        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 nimi.runtime.v1.LocalEngineDescriptor engines */ 1:
                    message.engines.push(LocalEngineDescriptor.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;
    }
    internalBinaryWrite(message, writer, options) {
        /* repeated nimi.runtime.v1.LocalEngineDescriptor engines = 1; */
        for (let i = 0; i < message.engines.length; i++)
            LocalEngineDescriptor.internalBinaryWrite(message.engines[i], 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 nimi.runtime.v1.ListEnginesResponse
 */
export const ListEnginesResponse = new ListEnginesResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EnsureEngineRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.EnsureEngineRequest", [
            { no: 1, name: "engine", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.engine = "";
        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 engine */ 1:
                    message.engine = reader.string();
                    break;
                case /* string version */ 2:
                    message.version = 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 engine = 1; */
        if (message.engine !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.engine);
        /* string version = 2; */
        if (message.version !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.version);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.EnsureEngineRequest
 */
export const EnsureEngineRequest = new EnsureEngineRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EnsureEngineResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.EnsureEngineResponse", [
            { no: 1, name: "engine", kind: "message", T: () => LocalEngineDescriptor }
        ]);
    }
    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 /* nimi.runtime.v1.LocalEngineDescriptor engine */ 1:
                    message.engine = LocalEngineDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.engine);
                    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) {
        /* nimi.runtime.v1.LocalEngineDescriptor engine = 1; */
        if (message.engine)
            LocalEngineDescriptor.internalBinaryWrite(message.engine, 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 nimi.runtime.v1.EnsureEngineResponse
 */
export const EnsureEngineResponse = new EnsureEngineResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StartEngineRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.StartEngineRequest", [
            { no: 1, name: "engine", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "port", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 3, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.engine = "";
        message.port = 0;
        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 engine */ 1:
                    message.engine = reader.string();
                    break;
                case /* int32 port */ 2:
                    message.port = reader.int32();
                    break;
                case /* string version */ 3:
                    message.version = 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 engine = 1; */
        if (message.engine !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.engine);
        /* int32 port = 2; */
        if (message.port !== 0)
            writer.tag(2, WireType.Varint).int32(message.port);
        /* string version = 3; */
        if (message.version !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.version);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.StartEngineRequest
 */
export const StartEngineRequest = new StartEngineRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StartEngineResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.StartEngineResponse", [
            { no: 1, name: "engine", kind: "message", T: () => LocalEngineDescriptor }
        ]);
    }
    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 /* nimi.runtime.v1.LocalEngineDescriptor engine */ 1:
                    message.engine = LocalEngineDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.engine);
                    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) {
        /* nimi.runtime.v1.LocalEngineDescriptor engine = 1; */
        if (message.engine)
            LocalEngineDescriptor.internalBinaryWrite(message.engine, 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 nimi.runtime.v1.StartEngineResponse
 */
export const StartEngineResponse = new StartEngineResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StopEngineRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.StopEngineRequest", [
            { no: 1, name: "engine", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.engine = "";
        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 engine */ 1:
                    message.engine = 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 engine = 1; */
        if (message.engine !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.engine);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.StopEngineRequest
 */
export const StopEngineRequest = new StopEngineRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StopEngineResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.StopEngineResponse", [
            { no: 1, name: "engine", kind: "message", T: () => LocalEngineDescriptor }
        ]);
    }
    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 /* nimi.runtime.v1.LocalEngineDescriptor engine */ 1:
                    message.engine = LocalEngineDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.engine);
                    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) {
        /* nimi.runtime.v1.LocalEngineDescriptor engine = 1; */
        if (message.engine)
            LocalEngineDescriptor.internalBinaryWrite(message.engine, 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 nimi.runtime.v1.StopEngineResponse
 */
export const StopEngineResponse = new StopEngineResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetEngineStatusRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.GetEngineStatusRequest", [
            { no: 1, name: "engine", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.engine = "";
        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 engine */ 1:
                    message.engine = 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 engine = 1; */
        if (message.engine !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.engine);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.GetEngineStatusRequest
 */
export const GetEngineStatusRequest = new GetEngineStatusRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetEngineStatusResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.GetEngineStatusResponse", [
            { no: 1, name: "engine", kind: "message", T: () => LocalEngineDescriptor }
        ]);
    }
    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 /* nimi.runtime.v1.LocalEngineDescriptor engine */ 1:
                    message.engine = LocalEngineDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.engine);
                    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) {
        /* nimi.runtime.v1.LocalEngineDescriptor engine = 1; */
        if (message.engine)
            LocalEngineDescriptor.internalBinaryWrite(message.engine, 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 nimi.runtime.v1.GetEngineStatusResponse
 */
export const GetEngineStatusResponse = new GetEngineStatusResponse$Type();
//# sourceMappingURL=local_runtime_engine.js.map