/* 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/runner/v2/runner.proto" (package "runme.runner.v2", 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/runner/v2/runner.proto" (package "runme.runner.v2", 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 { UInt32Value } from "../../../google/protobuf/wrappers_pb";
import { ProgramConfig } from "./config_pb";
/**
 * @generated from protobuf enum runme.runner.v2.CreateSessionRequest.Config.SessionEnvStoreSeeding
 */
export var CreateSessionRequest_Config_SessionEnvStoreSeeding;
(function (CreateSessionRequest_Config_SessionEnvStoreSeeding) {
    /**
     * default seeding; ignore system
     *
     * @generated from protobuf enum value: SESSION_ENV_STORE_SEEDING_UNSPECIFIED = 0;
     */
    CreateSessionRequest_Config_SessionEnvStoreSeeding[CreateSessionRequest_Config_SessionEnvStoreSeeding["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * enable seeding from system
     *
     * @generated from protobuf enum value: SESSION_ENV_STORE_SEEDING_SYSTEM = 1;
     */
    CreateSessionRequest_Config_SessionEnvStoreSeeding[CreateSessionRequest_Config_SessionEnvStoreSeeding["SYSTEM"] = 1] = "SYSTEM";
})(CreateSessionRequest_Config_SessionEnvStoreSeeding || (CreateSessionRequest_Config_SessionEnvStoreSeeding = {}));
/**
 * @generated from protobuf enum runme.runner.v2.ResolveProgramRequest.Mode
 */
export var ResolveProgramRequest_Mode;
(function (ResolveProgramRequest_Mode) {
    /**
     * unspecified is auto (default) which prompts for all
     * unresolved environment variables.
     * Subsequent runs will likely resolve via the session.
     *
     * @generated from protobuf enum value: MODE_UNSPECIFIED = 0;
     */
    ResolveProgramRequest_Mode[ResolveProgramRequest_Mode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * prompt always means to prompt for all environment variables.
     *
     * @generated from protobuf enum value: MODE_PROMPT_ALL = 1;
     */
    ResolveProgramRequest_Mode[ResolveProgramRequest_Mode["PROMPT_ALL"] = 1] = "PROMPT_ALL";
    /**
     * skip means to not prompt for any environment variables.
     * All variables will be marked as resolved.
     *
     * @generated from protobuf enum value: MODE_SKIP_ALL = 2;
     */
    ResolveProgramRequest_Mode[ResolveProgramRequest_Mode["SKIP_ALL"] = 2] = "SKIP_ALL";
})(ResolveProgramRequest_Mode || (ResolveProgramRequest_Mode = {}));
/**
 * @generated from protobuf enum runme.runner.v2.ResolveProgramRequest.Retention
 */
export var ResolveProgramRequest_Retention;
(function (ResolveProgramRequest_Retention) {
    /**
     * @generated from protobuf enum value: RETENTION_UNSPECIFIED = 0;
     */
    ResolveProgramRequest_Retention[ResolveProgramRequest_Retention["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * first run means to always retain the first resolved value.
     *
     * @generated from protobuf enum value: RETENTION_FIRST_RUN = 1;
     */
    ResolveProgramRequest_Retention[ResolveProgramRequest_Retention["FIRST_RUN"] = 1] = "FIRST_RUN";
    /**
     * last run means to always retain the last resolved value.
     *
     * @generated from protobuf enum value: RETENTION_LAST_RUN = 2;
     */
    ResolveProgramRequest_Retention[ResolveProgramRequest_Retention["LAST_RUN"] = 2] = "LAST_RUN";
})(ResolveProgramRequest_Retention || (ResolveProgramRequest_Retention = {}));
/**
 * @generated from protobuf enum runme.runner.v2.ResolveProgramResponse.Status
 */
export var ResolveProgramResponse_Status;
(function (ResolveProgramResponse_Status) {
    /**
     * unspecified is the default value and it means unresolved.
     *
     * @generated from protobuf enum value: STATUS_UNSPECIFIED = 0;
     */
    ResolveProgramResponse_Status[ResolveProgramResponse_Status["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * resolved means that the variable is resolved.
     *
     * @generated from protobuf enum value: STATUS_RESOLVED = 1;
     */
    ResolveProgramResponse_Status[ResolveProgramResponse_Status["RESOLVED"] = 1] = "RESOLVED";
    /**
     * unresolved with message means that the variable is unresolved
     * but it contains a message. E.g. FOO=this is message.
     *
     * @generated from protobuf enum value: STATUS_UNRESOLVED_WITH_MESSAGE = 2;
     */
    ResolveProgramResponse_Status[ResolveProgramResponse_Status["UNRESOLVED_WITH_MESSAGE"] = 2] = "UNRESOLVED_WITH_MESSAGE";
    /**
     * unresolved with placeholder means that the variable is unresolved
     * but it contains a placeholder. E.g. FOO="this is placeholder".
     *
     * @generated from protobuf enum value: STATUS_UNRESOLVED_WITH_PLACEHOLDER = 3;
     */
    ResolveProgramResponse_Status[ResolveProgramResponse_Status["UNRESOLVED_WITH_PLACEHOLDER"] = 3] = "UNRESOLVED_WITH_PLACEHOLDER";
    /**
     * unresolved with secret means that the variable is unresolved
     * and it requires treatment as a secret.
     *
     * @generated from protobuf enum value: STATUS_UNRESOLVED_WITH_SECRET = 4;
     */
    ResolveProgramResponse_Status[ResolveProgramResponse_Status["UNRESOLVED_WITH_SECRET"] = 4] = "UNRESOLVED_WITH_SECRET";
})(ResolveProgramResponse_Status || (ResolveProgramResponse_Status = {}));
/**
 * @generated from protobuf enum runme.runner.v2.MonitorEnvStoreResponseSnapshot.Status
 */
export var MonitorEnvStoreResponseSnapshot_Status;
(function (MonitorEnvStoreResponseSnapshot_Status) {
    /**
     * @generated from protobuf enum value: STATUS_UNSPECIFIED = 0;
     */
    MonitorEnvStoreResponseSnapshot_Status[MonitorEnvStoreResponseSnapshot_Status["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: STATUS_LITERAL = 1;
     */
    MonitorEnvStoreResponseSnapshot_Status[MonitorEnvStoreResponseSnapshot_Status["LITERAL"] = 1] = "LITERAL";
    /**
     * @generated from protobuf enum value: STATUS_HIDDEN = 2;
     */
    MonitorEnvStoreResponseSnapshot_Status[MonitorEnvStoreResponseSnapshot_Status["HIDDEN"] = 2] = "HIDDEN";
    /**
     * @generated from protobuf enum value: STATUS_MASKED = 3;
     */
    MonitorEnvStoreResponseSnapshot_Status[MonitorEnvStoreResponseSnapshot_Status["MASKED"] = 3] = "MASKED";
})(MonitorEnvStoreResponseSnapshot_Status || (MonitorEnvStoreResponseSnapshot_Status = {}));
/**
 * env store implementation
 *
 * @generated from protobuf enum runme.runner.v2.SessionEnvStoreType
 */
export var SessionEnvStoreType;
(function (SessionEnvStoreType) {
    /**
     * uses default env store
     *
     * @generated from protobuf enum value: SESSION_ENV_STORE_TYPE_UNSPECIFIED = 0;
     */
    SessionEnvStoreType[SessionEnvStoreType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * uses owl store
     *
     * @generated from protobuf enum value: SESSION_ENV_STORE_TYPE_OWL = 1;
     */
    SessionEnvStoreType[SessionEnvStoreType["OWL"] = 1] = "OWL";
})(SessionEnvStoreType || (SessionEnvStoreType = {}));
/**
 * @generated from protobuf enum runme.runner.v2.ExecuteStop
 */
export var ExecuteStop;
(function (ExecuteStop) {
    /**
     * @generated from protobuf enum value: EXECUTE_STOP_UNSPECIFIED = 0;
     */
    ExecuteStop[ExecuteStop["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: EXECUTE_STOP_INTERRUPT = 1;
     */
    ExecuteStop[ExecuteStop["INTERRUPT"] = 1] = "INTERRUPT";
    /**
     * @generated from protobuf enum value: EXECUTE_STOP_KILL = 2;
     */
    ExecuteStop[ExecuteStop["KILL"] = 2] = "KILL";
})(ExecuteStop || (ExecuteStop = {}));
/**
 * SessionStrategy determines a session selection in
 * an initial execute request.
 *
 * @generated from protobuf enum runme.runner.v2.SessionStrategy
 */
export var SessionStrategy;
(function (SessionStrategy) {
    /**
     * Uses the session_id field to determine the session.
     * If none is present, a new session is created.
     *
     * @generated from protobuf enum value: SESSION_STRATEGY_UNSPECIFIED = 0;
     */
    SessionStrategy[SessionStrategy["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * Uses the most recent session on the server.
     * If there is none, a new one is created.
     *
     * @generated from protobuf enum value: SESSION_STRATEGY_MOST_RECENT = 1;
     */
    SessionStrategy[SessionStrategy["MOST_RECENT"] = 1] = "MOST_RECENT";
})(SessionStrategy || (SessionStrategy = {}));
/**
 * @generated from protobuf enum runme.runner.v2.MonitorEnvStoreType
 */
export var MonitorEnvStoreType;
(function (MonitorEnvStoreType) {
    /**
     * @generated from protobuf enum value: MONITOR_ENV_STORE_TYPE_UNSPECIFIED = 0;
     */
    MonitorEnvStoreType[MonitorEnvStoreType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * possible expansion to have a "timeline" view
     * MONITOR_ENV_STORE_TYPE_TIMELINE = 2;
     *
     * @generated from protobuf enum value: MONITOR_ENV_STORE_TYPE_SNAPSHOT = 1;
     */
    MonitorEnvStoreType[MonitorEnvStoreType["SNAPSHOT"] = 1] = "SNAPSHOT";
})(MonitorEnvStoreType || (MonitorEnvStoreType = {}));
// @generated message type with reflection information, may provide speed optimized methods
class Project$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.Project", [
            { no: 1, name: "root", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "env_load_order", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.root = "";
        message.envLoadOrder = [];
        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 root */ 1:
                    message.root = reader.string();
                    break;
                case /* repeated string env_load_order */ 2:
                    message.envLoadOrder.push(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 root = 1; */
        if (message.root !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.root);
        /* repeated string env_load_order = 2; */
        for (let i = 0; i < message.envLoadOrder.length; i++)
            writer.tag(2, WireType.LengthDelimited).string(message.envLoadOrder[i]);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.Project
 */
export const Project = new Project$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Session$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.Session", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "env", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.id = "";
        message.env = [];
        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 /* string id */ 1:
                    message.id = reader.string();
                    break;
                case /* repeated string env */ 2:
                    message.env.push(reader.string());
                    break;
                case /* map<string, string> metadata */ 3:
                    this.binaryReadMap3(message.metadata, reader, 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;
    }
    binaryReadMap3(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.runner.v2.Session.metadata");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message, writer, options) {
        /* string id = 1; */
        if (message.id !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.id);
        /* repeated string env = 2; */
        for (let i = 0; i < message.env.length; i++)
            writer.tag(2, WireType.LengthDelimited).string(message.env[i]);
        /* map<string, string> metadata = 3; */
        for (let k of globalThis.Object.keys(message.metadata))
            writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.metadata[k]).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.runner.v2.Session
 */
export const Session = new Session$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateSessionRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.CreateSessionRequest", [
            { no: 1, name: "metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
            { no: 2, name: "env", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "project", kind: "message", T: () => Project },
            { no: 4, name: "env_store_type", kind: "enum", opt: true, T: () => ["runme.runner.v2.SessionEnvStoreType", SessionEnvStoreType, "SESSION_ENV_STORE_TYPE_"] },
            { no: 5, name: "config", kind: "message", T: () => CreateSessionRequest_Config }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.metadata = {};
        message.env = [];
        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 /* map<string, string> metadata */ 1:
                    this.binaryReadMap1(message.metadata, reader, options);
                    break;
                case /* repeated string env */ 2:
                    message.env.push(reader.string());
                    break;
                case /* optional runme.runner.v2.Project project */ 3:
                    message.project = Project.internalBinaryRead(reader, reader.uint32(), options, message.project);
                    break;
                case /* optional runme.runner.v2.SessionEnvStoreType env_store_type */ 4:
                    message.envStoreType = reader.int32();
                    break;
                case /* runme.runner.v2.CreateSessionRequest.Config config */ 5:
                    message.config = CreateSessionRequest_Config.internalBinaryRead(reader, reader.uint32(), options, message.config);
                    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;
    }
    binaryReadMap1(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.runner.v2.CreateSessionRequest.metadata");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message, writer, options) {
        /* map<string, string> metadata = 1; */
        for (let k of globalThis.Object.keys(message.metadata))
            writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.metadata[k]).join();
        /* repeated string env = 2; */
        for (let i = 0; i < message.env.length; i++)
            writer.tag(2, WireType.LengthDelimited).string(message.env[i]);
        /* optional runme.runner.v2.Project project = 3; */
        if (message.project)
            Project.internalBinaryWrite(message.project, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* optional runme.runner.v2.SessionEnvStoreType env_store_type = 4; */
        if (message.envStoreType !== undefined)
            writer.tag(4, WireType.Varint).int32(message.envStoreType);
        /* runme.runner.v2.CreateSessionRequest.Config config = 5; */
        if (message.config)
            CreateSessionRequest_Config.internalBinaryWrite(message.config, writer.tag(5, 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.runner.v2.CreateSessionRequest
 */
export const CreateSessionRequest = new CreateSessionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateSessionRequest_Config$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.CreateSessionRequest.Config", [
            { no: 1, name: "env_store_type", kind: "enum", opt: true, T: () => ["runme.runner.v2.SessionEnvStoreType", SessionEnvStoreType, "SESSION_ENV_STORE_TYPE_"] },
            { no: 2, name: "env_store_seeding", kind: "enum", opt: true, T: () => ["runme.runner.v2.CreateSessionRequest.Config.SessionEnvStoreSeeding", CreateSessionRequest_Config_SessionEnvStoreSeeding, "SESSION_ENV_STORE_SEEDING_"] }
        ]);
    }
    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 /* optional runme.runner.v2.SessionEnvStoreType env_store_type */ 1:
                    message.envStoreType = reader.int32();
                    break;
                case /* optional runme.runner.v2.CreateSessionRequest.Config.SessionEnvStoreSeeding env_store_seeding */ 2:
                    message.envStoreSeeding = 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) {
        /* optional runme.runner.v2.SessionEnvStoreType env_store_type = 1; */
        if (message.envStoreType !== undefined)
            writer.tag(1, WireType.Varint).int32(message.envStoreType);
        /* optional runme.runner.v2.CreateSessionRequest.Config.SessionEnvStoreSeeding env_store_seeding = 2; */
        if (message.envStoreSeeding !== undefined)
            writer.tag(2, WireType.Varint).int32(message.envStoreSeeding);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.CreateSessionRequest.Config
 */
export const CreateSessionRequest_Config = new CreateSessionRequest_Config$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateSessionResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.CreateSessionResponse", [
            { no: 1, name: "session", kind: "message", T: () => Session }
        ]);
    }
    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.runner.v2.Session session */ 1:
                    message.session = Session.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.runner.v2.Session session = 1; */
        if (message.session)
            Session.internalBinaryWrite(message.session, 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.runner.v2.CreateSessionResponse
 */
export const CreateSessionResponse = new CreateSessionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetSessionRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.GetSessionRequest", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    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;
                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);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.GetSessionRequest
 */
export const GetSessionRequest = new GetSessionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetSessionResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.GetSessionResponse", [
            { no: 1, name: "session", kind: "message", T: () => Session }
        ]);
    }
    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.runner.v2.Session session */ 1:
                    message.session = Session.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.runner.v2.Session session = 1; */
        if (message.session)
            Session.internalBinaryWrite(message.session, 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.runner.v2.GetSessionResponse
 */
export const GetSessionResponse = new GetSessionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListSessionsRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ListSessionsRequest", []);
    }
    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 runme.runner.v2.ListSessionsRequest
 */
export const ListSessionsRequest = new ListSessionsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListSessionsResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ListSessionsResponse", [
            { no: 1, name: "sessions", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Session }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.sessions = [];
        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.runner.v2.Session sessions */ 1:
                    message.sessions.push(Session.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 runme.runner.v2.Session sessions = 1; */
        for (let i = 0; i < message.sessions.length; i++)
            Session.internalBinaryWrite(message.sessions[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 runme.runner.v2.ListSessionsResponse
 */
export const ListSessionsResponse = new ListSessionsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateSessionRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.UpdateSessionRequest", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
            { no: 3, name: "env", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "project", kind: "message", T: () => Project }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.id = "";
        message.metadata = {};
        message.env = [];
        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 /* map<string, string> metadata */ 2:
                    this.binaryReadMap2(message.metadata, reader, options);
                    break;
                case /* repeated string env */ 3:
                    message.env.push(reader.string());
                    break;
                case /* optional runme.runner.v2.Project project */ 4:
                    message.project = Project.internalBinaryRead(reader, reader.uint32(), options, message.project);
                    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.runner.v2.UpdateSessionRequest.metadata");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message, writer, options) {
        /* string id = 1; */
        if (message.id !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.id);
        /* 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();
        /* repeated string env = 3; */
        for (let i = 0; i < message.env.length; i++)
            writer.tag(3, WireType.LengthDelimited).string(message.env[i]);
        /* optional runme.runner.v2.Project project = 4; */
        if (message.project)
            Project.internalBinaryWrite(message.project, writer.tag(4, 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.runner.v2.UpdateSessionRequest
 */
export const UpdateSessionRequest = new UpdateSessionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateSessionResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.UpdateSessionResponse", [
            { no: 1, name: "session", kind: "message", T: () => Session }
        ]);
    }
    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.runner.v2.Session session */ 1:
                    message.session = Session.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.runner.v2.Session session = 1; */
        if (message.session)
            Session.internalBinaryWrite(message.session, 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.runner.v2.UpdateSessionResponse
 */
export const UpdateSessionResponse = new UpdateSessionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteSessionRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.DeleteSessionRequest", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    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;
                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);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.DeleteSessionRequest
 */
export const DeleteSessionRequest = new DeleteSessionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteSessionResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.DeleteSessionResponse", []);
    }
    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 runme.runner.v2.DeleteSessionResponse
 */
export const DeleteSessionResponse = new DeleteSessionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Winsize$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.Winsize", [
            { no: 1, name: "rows", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
            { no: 2, name: "cols", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
            { no: 3, name: "x", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
            { no: 4, name: "y", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.rows = 0;
        message.cols = 0;
        message.x = 0;
        message.y = 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 rows */ 1:
                    message.rows = reader.uint32();
                    break;
                case /* uint32 cols */ 2:
                    message.cols = reader.uint32();
                    break;
                case /* uint32 x */ 3:
                    message.x = reader.uint32();
                    break;
                case /* uint32 y */ 4:
                    message.y = 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 rows = 1; */
        if (message.rows !== 0)
            writer.tag(1, WireType.Varint).uint32(message.rows);
        /* uint32 cols = 2; */
        if (message.cols !== 0)
            writer.tag(2, WireType.Varint).uint32(message.cols);
        /* uint32 x = 3; */
        if (message.x !== 0)
            writer.tag(3, WireType.Varint).uint32(message.x);
        /* uint32 y = 4; */
        if (message.y !== 0)
            writer.tag(4, WireType.Varint).uint32(message.y);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.Winsize
 */
export const Winsize = new Winsize$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecuteRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ExecuteRequest", [
            { no: 1, name: "config", kind: "message", T: () => ProgramConfig },
            { no: 8, name: "input_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
            { no: 9, name: "stop", kind: "enum", T: () => ["runme.runner.v2.ExecuteStop", ExecuteStop, "EXECUTE_STOP_"] },
            { no: 10, name: "winsize", kind: "message", T: () => Winsize },
            { no: 20, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 21, name: "session_strategy", kind: "enum", T: () => ["runme.runner.v2.SessionStrategy", SessionStrategy, "SESSION_STRATEGY_"] },
            { no: 22, name: "project", kind: "message", T: () => Project },
            { no: 23, name: "store_stdout_in_env", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.inputData = new Uint8Array(0);
        message.stop = 0;
        message.sessionId = "";
        message.sessionStrategy = 0;
        message.storeStdoutInEnv = 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 /* runme.runner.v2.ProgramConfig config */ 1:
                    message.config = ProgramConfig.internalBinaryRead(reader, reader.uint32(), options, message.config);
                    break;
                case /* bytes input_data */ 8:
                    message.inputData = reader.bytes();
                    break;
                case /* runme.runner.v2.ExecuteStop stop */ 9:
                    message.stop = reader.int32();
                    break;
                case /* optional runme.runner.v2.Winsize winsize */ 10:
                    message.winsize = Winsize.internalBinaryRead(reader, reader.uint32(), options, message.winsize);
                    break;
                case /* string session_id */ 20:
                    message.sessionId = reader.string();
                    break;
                case /* runme.runner.v2.SessionStrategy session_strategy */ 21:
                    message.sessionStrategy = reader.int32();
                    break;
                case /* optional runme.runner.v2.Project project */ 22:
                    message.project = Project.internalBinaryRead(reader, reader.uint32(), options, message.project);
                    break;
                case /* bool store_stdout_in_env */ 23:
                    message.storeStdoutInEnv = 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) {
        /* runme.runner.v2.ProgramConfig config = 1; */
        if (message.config)
            ProgramConfig.internalBinaryWrite(message.config, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* bytes input_data = 8; */
        if (message.inputData.length)
            writer.tag(8, WireType.LengthDelimited).bytes(message.inputData);
        /* runme.runner.v2.ExecuteStop stop = 9; */
        if (message.stop !== 0)
            writer.tag(9, WireType.Varint).int32(message.stop);
        /* optional runme.runner.v2.Winsize winsize = 10; */
        if (message.winsize)
            Winsize.internalBinaryWrite(message.winsize, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
        /* string session_id = 20; */
        if (message.sessionId !== "")
            writer.tag(20, WireType.LengthDelimited).string(message.sessionId);
        /* runme.runner.v2.SessionStrategy session_strategy = 21; */
        if (message.sessionStrategy !== 0)
            writer.tag(21, WireType.Varint).int32(message.sessionStrategy);
        /* optional runme.runner.v2.Project project = 22; */
        if (message.project)
            Project.internalBinaryWrite(message.project, writer.tag(22, WireType.LengthDelimited).fork(), options).join();
        /* bool store_stdout_in_env = 23; */
        if (message.storeStdoutInEnv !== false)
            writer.tag(23, WireType.Varint).bool(message.storeStdoutInEnv);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.ExecuteRequest
 */
export const ExecuteRequest = new ExecuteRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecuteResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ExecuteResponse", [
            { no: 1, name: "exit_code", kind: "message", T: () => UInt32Value },
            { no: 2, name: "stdout_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
            { no: 3, name: "stderr_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
            { no: 4, name: "pid", kind: "message", T: () => UInt32Value },
            { no: 5, name: "mime_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.stdoutData = new Uint8Array(0);
        message.stderrData = new Uint8Array(0);
        message.mimeType = "";
        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 exit_code */ 1:
                    message.exitCode = UInt32Value.internalBinaryRead(reader, reader.uint32(), options, message.exitCode);
                    break;
                case /* bytes stdout_data */ 2:
                    message.stdoutData = reader.bytes();
                    break;
                case /* bytes stderr_data */ 3:
                    message.stderrData = reader.bytes();
                    break;
                case /* google.protobuf.UInt32Value pid */ 4:
                    message.pid = UInt32Value.internalBinaryRead(reader, reader.uint32(), options, message.pid);
                    break;
                case /* string mime_type */ 5:
                    message.mimeType = 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) {
        /* google.protobuf.UInt32Value exit_code = 1; */
        if (message.exitCode)
            UInt32Value.internalBinaryWrite(message.exitCode, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* bytes stdout_data = 2; */
        if (message.stdoutData.length)
            writer.tag(2, WireType.LengthDelimited).bytes(message.stdoutData);
        /* bytes stderr_data = 3; */
        if (message.stderrData.length)
            writer.tag(3, WireType.LengthDelimited).bytes(message.stderrData);
        /* google.protobuf.UInt32Value pid = 4; */
        if (message.pid)
            UInt32Value.internalBinaryWrite(message.pid, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* string mime_type = 5; */
        if (message.mimeType !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.mimeType);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.ExecuteResponse
 */
export const ExecuteResponse = new ExecuteResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ResolveProgramCommandList$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ResolveProgramCommandList", [
            { no: 1, name: "lines", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.lines = [];
        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 string lines */ 1:
                    message.lines.push(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 string lines = 1; */
        for (let i = 0; i < message.lines.length; i++)
            writer.tag(1, WireType.LengthDelimited).string(message.lines[i]);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.ResolveProgramCommandList
 */
export const ResolveProgramCommandList = new ResolveProgramCommandList$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ResolveProgramRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ResolveProgramRequest", [
            { no: 1, name: "commands", kind: "message", oneof: "source", T: () => ResolveProgramCommandList },
            { no: 2, name: "script", kind: "scalar", oneof: "source", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "mode", kind: "enum", T: () => ["runme.runner.v2.ResolveProgramRequest.Mode", ResolveProgramRequest_Mode, "MODE_"] },
            { no: 4, name: "env", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "session_strategy", kind: "enum", T: () => ["runme.runner.v2.SessionStrategy", SessionStrategy, "SESSION_STRATEGY_"] },
            { no: 7, name: "project", kind: "message", T: () => Project },
            { no: 8, name: "language_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "retention", kind: "enum", T: () => ["runme.runner.v2.ResolveProgramRequest.Retention", ResolveProgramRequest_Retention, "RETENTION_"] }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.source = { oneofKind: undefined };
        message.mode = 0;
        message.env = [];
        message.sessionId = "";
        message.sessionStrategy = 0;
        message.languageId = "";
        message.retention = 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.runner.v2.ResolveProgramCommandList commands */ 1:
                    message.source = {
                        oneofKind: "commands",
                        commands: ResolveProgramCommandList.internalBinaryRead(reader, reader.uint32(), options, message.source.commands)
                    };
                    break;
                case /* string script */ 2:
                    message.source = {
                        oneofKind: "script",
                        script: reader.string()
                    };
                    break;
                case /* runme.runner.v2.ResolveProgramRequest.Mode mode */ 3:
                    message.mode = reader.int32();
                    break;
                case /* repeated string env */ 4:
                    message.env.push(reader.string());
                    break;
                case /* string session_id */ 5:
                    message.sessionId = reader.string();
                    break;
                case /* runme.runner.v2.SessionStrategy session_strategy */ 6:
                    message.sessionStrategy = reader.int32();
                    break;
                case /* optional runme.runner.v2.Project project */ 7:
                    message.project = Project.internalBinaryRead(reader, reader.uint32(), options, message.project);
                    break;
                case /* string language_id */ 8:
                    message.languageId = reader.string();
                    break;
                case /* runme.runner.v2.ResolveProgramRequest.Retention retention */ 9:
                    message.retention = 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.runner.v2.ResolveProgramCommandList commands = 1; */
        if (message.source.oneofKind === "commands")
            ResolveProgramCommandList.internalBinaryWrite(message.source.commands, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string script = 2; */
        if (message.source.oneofKind === "script")
            writer.tag(2, WireType.LengthDelimited).string(message.source.script);
        /* runme.runner.v2.ResolveProgramRequest.Mode mode = 3; */
        if (message.mode !== 0)
            writer.tag(3, WireType.Varint).int32(message.mode);
        /* repeated string env = 4; */
        for (let i = 0; i < message.env.length; i++)
            writer.tag(4, WireType.LengthDelimited).string(message.env[i]);
        /* string session_id = 5; */
        if (message.sessionId !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.sessionId);
        /* runme.runner.v2.SessionStrategy session_strategy = 6; */
        if (message.sessionStrategy !== 0)
            writer.tag(6, WireType.Varint).int32(message.sessionStrategy);
        /* optional runme.runner.v2.Project project = 7; */
        if (message.project)
            Project.internalBinaryWrite(message.project, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* string language_id = 8; */
        if (message.languageId !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.languageId);
        /* runme.runner.v2.ResolveProgramRequest.Retention retention = 9; */
        if (message.retention !== 0)
            writer.tag(9, WireType.Varint).int32(message.retention);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.ResolveProgramRequest
 */
export const ResolveProgramRequest = new ResolveProgramRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ResolveProgramResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ResolveProgramResponse", [
            { no: 1, name: "script", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "commands", kind: "message", T: () => ResolveProgramCommandList },
            { no: 3, name: "vars", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ResolveProgramResponse_VarResult }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.script = "";
        message.vars = [];
        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 script */ 1:
                    message.script = reader.string();
                    break;
                case /* runme.runner.v2.ResolveProgramCommandList commands */ 2:
                    message.commands = ResolveProgramCommandList.internalBinaryRead(reader, reader.uint32(), options, message.commands);
                    break;
                case /* repeated runme.runner.v2.ResolveProgramResponse.VarResult vars */ 3:
                    message.vars.push(ResolveProgramResponse_VarResult.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) {
        /* string script = 1; */
        if (message.script !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.script);
        /* runme.runner.v2.ResolveProgramCommandList commands = 2; */
        if (message.commands)
            ResolveProgramCommandList.internalBinaryWrite(message.commands, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* repeated runme.runner.v2.ResolveProgramResponse.VarResult vars = 3; */
        for (let i = 0; i < message.vars.length; i++)
            ResolveProgramResponse_VarResult.internalBinaryWrite(message.vars[i], 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.runner.v2.ResolveProgramResponse
 */
export const ResolveProgramResponse = new ResolveProgramResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ResolveProgramResponse_VarResult$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.ResolveProgramResponse.VarResult", [
            { no: 1, name: "status", kind: "enum", T: () => ["runme.runner.v2.ResolveProgramResponse.Status", ResolveProgramResponse_Status, "STATUS_"] },
            { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "original_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "resolved_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.status = 0;
        message.name = "";
        message.originalValue = "";
        message.resolvedValue = "";
        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.runner.v2.ResolveProgramResponse.Status status */ 1:
                    message.status = reader.int32();
                    break;
                case /* string name */ 2:
                    message.name = reader.string();
                    break;
                case /* string original_value */ 3:
                    message.originalValue = reader.string();
                    break;
                case /* string resolved_value */ 4:
                    message.resolvedValue = 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) {
        /* runme.runner.v2.ResolveProgramResponse.Status status = 1; */
        if (message.status !== 0)
            writer.tag(1, WireType.Varint).int32(message.status);
        /* string name = 2; */
        if (message.name !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.name);
        /* string original_value = 3; */
        if (message.originalValue !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.originalValue);
        /* string resolved_value = 4; */
        if (message.resolvedValue !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.resolvedValue);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.ResolveProgramResponse.VarResult
 */
export const ResolveProgramResponse_VarResult = new ResolveProgramResponse_VarResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MonitorEnvStoreRequest$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.MonitorEnvStoreRequest", [
            { no: 1, name: "session", kind: "message", T: () => Session }
        ]);
    }
    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.runner.v2.Session session */ 1:
                    message.session = Session.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.runner.v2.Session session = 1; */
        if (message.session)
            Session.internalBinaryWrite(message.session, 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.runner.v2.MonitorEnvStoreRequest
 */
export const MonitorEnvStoreRequest = new MonitorEnvStoreRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MonitorEnvStoreResponseSnapshot$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.MonitorEnvStoreResponseSnapshot", [
            { no: 1, name: "envs", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MonitorEnvStoreResponseSnapshot_SnapshotEnv }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.envs = [];
        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.runner.v2.MonitorEnvStoreResponseSnapshot.SnapshotEnv envs */ 1:
                    message.envs.push(MonitorEnvStoreResponseSnapshot_SnapshotEnv.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 runme.runner.v2.MonitorEnvStoreResponseSnapshot.SnapshotEnv envs = 1; */
        for (let i = 0; i < message.envs.length; i++)
            MonitorEnvStoreResponseSnapshot_SnapshotEnv.internalBinaryWrite(message.envs[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 runme.runner.v2.MonitorEnvStoreResponseSnapshot
 */
export const MonitorEnvStoreResponseSnapshot = new MonitorEnvStoreResponseSnapshot$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.MonitorEnvStoreResponseSnapshot.SnapshotEnv", [
            { no: 1, name: "status", kind: "enum", T: () => ["runme.runner.v2.MonitorEnvStoreResponseSnapshot.Status", MonitorEnvStoreResponseSnapshot_Status, "STATUS_"] },
            { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "spec", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "is_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 6, name: "origin", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "original_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "resolved_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "create_time", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "update_time", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 11, name: "errors", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MonitorEnvStoreResponseSnapshot_Error }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.status = 0;
        message.name = "";
        message.description = "";
        message.spec = "";
        message.isRequired = false;
        message.origin = "";
        message.originalValue = "";
        message.resolvedValue = "";
        message.createTime = "";
        message.updateTime = "";
        message.errors = [];
        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.runner.v2.MonitorEnvStoreResponseSnapshot.Status status */ 1:
                    message.status = reader.int32();
                    break;
                case /* string name */ 2:
                    message.name = reader.string();
                    break;
                case /* string description */ 3:
                    message.description = reader.string();
                    break;
                case /* string spec */ 4:
                    message.spec = reader.string();
                    break;
                case /* bool is_required */ 5:
                    message.isRequired = reader.bool();
                    break;
                case /* string origin */ 6:
                    message.origin = reader.string();
                    break;
                case /* string original_value */ 7:
                    message.originalValue = reader.string();
                    break;
                case /* string resolved_value */ 8:
                    message.resolvedValue = reader.string();
                    break;
                case /* string create_time */ 9:
                    message.createTime = reader.string();
                    break;
                case /* string update_time */ 10:
                    message.updateTime = reader.string();
                    break;
                case /* repeated runme.runner.v2.MonitorEnvStoreResponseSnapshot.Error errors */ 11:
                    message.errors.push(MonitorEnvStoreResponseSnapshot_Error.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) {
        /* runme.runner.v2.MonitorEnvStoreResponseSnapshot.Status status = 1; */
        if (message.status !== 0)
            writer.tag(1, WireType.Varint).int32(message.status);
        /* string name = 2; */
        if (message.name !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.name);
        /* string description = 3; */
        if (message.description !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.description);
        /* string spec = 4; */
        if (message.spec !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.spec);
        /* bool is_required = 5; */
        if (message.isRequired !== false)
            writer.tag(5, WireType.Varint).bool(message.isRequired);
        /* string origin = 6; */
        if (message.origin !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.origin);
        /* string original_value = 7; */
        if (message.originalValue !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.originalValue);
        /* string resolved_value = 8; */
        if (message.resolvedValue !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.resolvedValue);
        /* string create_time = 9; */
        if (message.createTime !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.createTime);
        /* string update_time = 10; */
        if (message.updateTime !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.updateTime);
        /* repeated runme.runner.v2.MonitorEnvStoreResponseSnapshot.Error errors = 11; */
        for (let i = 0; i < message.errors.length; i++)
            MonitorEnvStoreResponseSnapshot_Error.internalBinaryWrite(message.errors[i], writer.tag(11, 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.runner.v2.MonitorEnvStoreResponseSnapshot.SnapshotEnv
 */
export const MonitorEnvStoreResponseSnapshot_SnapshotEnv = new MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MonitorEnvStoreResponseSnapshot_Error$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.MonitorEnvStoreResponseSnapshot.Error", [
            { no: 1, name: "code", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
            { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.code = 0;
        message.message = "";
        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 code */ 1:
                    message.code = reader.uint32();
                    break;
                case /* string message */ 2:
                    message.message = 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) {
        /* uint32 code = 1; */
        if (message.code !== 0)
            writer.tag(1, WireType.Varint).uint32(message.code);
        /* string message = 2; */
        if (message.message !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.message);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.runner.v2.MonitorEnvStoreResponseSnapshot.Error
 */
export const MonitorEnvStoreResponseSnapshot_Error = new MonitorEnvStoreResponseSnapshot_Error$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MonitorEnvStoreResponse$Type extends MessageType {
    constructor() {
        super("runme.runner.v2.MonitorEnvStoreResponse", [
            { no: 1, name: "type", kind: "enum", T: () => ["runme.runner.v2.MonitorEnvStoreType", MonitorEnvStoreType, "MONITOR_ENV_STORE_TYPE_"] },
            { no: 2, name: "snapshot", kind: "message", oneof: "data", T: () => MonitorEnvStoreResponseSnapshot }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.type = 0;
        message.data = { oneofKind: undefined };
        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.runner.v2.MonitorEnvStoreType type */ 1:
                    message.type = reader.int32();
                    break;
                case /* runme.runner.v2.MonitorEnvStoreResponseSnapshot snapshot */ 2:
                    message.data = {
                        oneofKind: "snapshot",
                        snapshot: MonitorEnvStoreResponseSnapshot.internalBinaryRead(reader, reader.uint32(), options, message.data.snapshot)
                    };
                    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.runner.v2.MonitorEnvStoreType type = 1; */
        if (message.type !== 0)
            writer.tag(1, WireType.Varint).int32(message.type);
        /* runme.runner.v2.MonitorEnvStoreResponseSnapshot snapshot = 2; */
        if (message.data.oneofKind === "snapshot")
            MonitorEnvStoreResponseSnapshot.internalBinaryWrite(message.data.snapshot, 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.runner.v2.MonitorEnvStoreResponse
 */
export const MonitorEnvStoreResponse = new MonitorEnvStoreResponse$Type();
/**
 * @generated ServiceType for protobuf service runme.runner.v2.RunnerService
 */
export const RunnerService = new ServiceType("runme.runner.v2.RunnerService", [
    { name: "CreateSession", options: {}, I: CreateSessionRequest, O: CreateSessionResponse },
    { name: "GetSession", options: {}, I: GetSessionRequest, O: GetSessionResponse },
    { name: "ListSessions", options: {}, I: ListSessionsRequest, O: ListSessionsResponse },
    { name: "UpdateSession", options: {}, I: UpdateSessionRequest, O: UpdateSessionResponse },
    { name: "DeleteSession", options: {}, I: DeleteSessionRequest, O: DeleteSessionResponse },
    { name: "MonitorEnvStore", serverStreaming: true, options: {}, I: MonitorEnvStoreRequest, O: MonitorEnvStoreResponse },
    { name: "Execute", serverStreaming: true, clientStreaming: true, options: {}, I: ExecuteRequest, O: ExecuteResponse },
    { name: "ResolveProgram", options: {}, I: ResolveProgramRequest, O: ResolveProgramResponse }
]);
