// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v7.35.0
// source: spawn.proto

package proto

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	anypb "google.golang.org/protobuf/types/known/anypb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// SpawnMessage is one framed message on the spawn helper's control socket. Each
// message is written length-delimited (a varint byte-length prefix followed by
// the serialized message, like protobuf-java's writeDelimitedTo) and
// demultiplexed by id, so many concurrent actions share one socketpair.
type SpawnMessage struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	Id    uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are valid to be assigned to Payload:
	//
	//	*SpawnMessage_Start
	//	*SpawnMessage_Cancel
	//	*SpawnMessage_Result
	//	*SpawnMessage_Error
	Payload       isSpawnMessage_Payload `protobuf_oneof:"payload"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SpawnMessage) Reset() {
	*x = SpawnMessage{}
	mi := &file_spawn_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SpawnMessage) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SpawnMessage) ProtoMessage() {}

func (x *SpawnMessage) ProtoReflect() protoreflect.Message {
	mi := &file_spawn_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SpawnMessage.ProtoReflect.Descriptor instead.
func (*SpawnMessage) Descriptor() ([]byte, []int) {
	return file_spawn_proto_rawDescGZIP(), []int{0}
}

func (x *SpawnMessage) GetId() uint64 {
	if x != nil {
		return x.Id
	}
	return 0
}

func (x *SpawnMessage) GetPayload() isSpawnMessage_Payload {
	if x != nil {
		return x.Payload
	}
	return nil
}

func (x *SpawnMessage) GetStart() *SpawnRequest {
	if x != nil {
		if x, ok := x.Payload.(*SpawnMessage_Start); ok {
			return x.Start
		}
	}
	return nil
}

func (x *SpawnMessage) GetCancel() *SpawnCancel {
	if x != nil {
		if x, ok := x.Payload.(*SpawnMessage_Cancel); ok {
			return x.Cancel
		}
	}
	return nil
}

func (x *SpawnMessage) GetResult() *SpawnResult {
	if x != nil {
		if x, ok := x.Payload.(*SpawnMessage_Result); ok {
			return x.Result
		}
	}
	return nil
}

func (x *SpawnMessage) GetError() *SpawnError {
	if x != nil {
		if x, ok := x.Payload.(*SpawnMessage_Error); ok {
			return x.Error
		}
	}
	return nil
}

type isSpawnMessage_Payload interface {
	isSpawnMessage_Payload()
}

type SpawnMessage_Start struct {
	Start *SpawnRequest `protobuf:"bytes,2,opt,name=start,proto3,oneof"` // client -> helper: command to fork+exec
}

type SpawnMessage_Cancel struct {
	Cancel *SpawnCancel `protobuf:"bytes,3,opt,name=cancel,proto3,oneof"` // client -> helper: cancel the action with this id
}

type SpawnMessage_Result struct {
	Result *SpawnResult `protobuf:"bytes,4,opt,name=result,proto3,oneof"` // helper -> client: the finished action's result
}

type SpawnMessage_Error struct {
	Error *SpawnError `protobuf:"bytes,5,opt,name=error,proto3,oneof"` // helper -> client: the action could not be run
}

func (*SpawnMessage_Start) isSpawnMessage_Payload() {}

func (*SpawnMessage_Cancel) isSpawnMessage_Payload() {}

func (*SpawnMessage_Result) isSpawnMessage_Payload() {}

func (*SpawnMessage_Error) isSpawnMessage_Payload() {}

// SpawnRequest is the command the helper should fork+exec. args/env are proto3
// strings, so non-UTF-8 argv/env bytes are not preserved verbatim (accepted
// risk). workspace_root and work_dir are passed separately and joined by the
// helper, so it keeps the absolute workspace root available for follow-up work.
type SpawnRequest struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Id            string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Args          []string               `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	Env           []string               `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"`
	WorkspaceRoot string                 `protobuf:"bytes,4,opt,name=workspace_root,json=workspaceRoot,proto3" json:"workspace_root,omitempty"`
	WorkDir       string                 `protobuf:"bytes,5,opt,name=work_dir,json=workDir,proto3" json:"work_dir,omitempty"`
	OomScoreAdj   *int32                 `protobuf:"varint,6,opt,name=oom_score_adj,json=oomScoreAdj,proto3,oneof" json:"oom_score_adj,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SpawnRequest) Reset() {
	*x = SpawnRequest{}
	mi := &file_spawn_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SpawnRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SpawnRequest) ProtoMessage() {}

func (x *SpawnRequest) ProtoReflect() protoreflect.Message {
	mi := &file_spawn_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SpawnRequest.ProtoReflect.Descriptor instead.
func (*SpawnRequest) Descriptor() ([]byte, []int) {
	return file_spawn_proto_rawDescGZIP(), []int{1}
}

func (x *SpawnRequest) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *SpawnRequest) GetArgs() []string {
	if x != nil {
		return x.Args
	}
	return nil
}

func (x *SpawnRequest) GetEnv() []string {
	if x != nil {
		return x.Env
	}
	return nil
}

func (x *SpawnRequest) GetWorkspaceRoot() string {
	if x != nil {
		return x.WorkspaceRoot
	}
	return ""
}

func (x *SpawnRequest) GetWorkDir() string {
	if x != nil {
		return x.WorkDir
	}
	return ""
}

func (x *SpawnRequest) GetOomScoreAdj() int32 {
	if x != nil && x.OomScoreAdj != nil {
		return *x.OomScoreAdj
	}
	return 0
}

// SpawnCancel cancels the in-flight action; its id is carried by the enclosing
// SpawnMessage, so the message itself is empty.
type SpawnCancel struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SpawnCancel) Reset() {
	*x = SpawnCancel{}
	mi := &file_spawn_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SpawnCancel) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SpawnCancel) ProtoMessage() {}

func (x *SpawnCancel) ProtoReflect() protoreflect.Message {
	mi := &file_spawn_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SpawnCancel.ProtoReflect.Descriptor instead.
func (*SpawnCancel) Descriptor() ([]byte, []int) {
	return file_spawn_proto_rawDescGZIP(), []int{2}
}

// SpawnResult carries the finished action's result: a
// build.bazel.remote.execution.v2.ActionResult wrapped in an Any.
type SpawnResult struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	ActionResult  *anypb.Any             `protobuf:"bytes,1,opt,name=action_result,json=actionResult,proto3" json:"action_result,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SpawnResult) Reset() {
	*x = SpawnResult{}
	mi := &file_spawn_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SpawnResult) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SpawnResult) ProtoMessage() {}

func (x *SpawnResult) ProtoReflect() protoreflect.Message {
	mi := &file_spawn_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SpawnResult.ProtoReflect.Descriptor instead.
func (*SpawnResult) Descriptor() ([]byte, []int) {
	return file_spawn_proto_rawDescGZIP(), []int{3}
}

func (x *SpawnResult) GetActionResult() *anypb.Any {
	if x != nil {
		return x.ActionResult
	}
	return nil
}

// SpawnError reports that the action could not be run at all (distinct from the
// action running and exiting non-zero, which comes back as a SpawnResult).
type SpawnError struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Message       string                 `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SpawnError) Reset() {
	*x = SpawnError{}
	mi := &file_spawn_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SpawnError) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SpawnError) ProtoMessage() {}

func (x *SpawnError) ProtoReflect() protoreflect.Message {
	mi := &file_spawn_proto_msgTypes[4]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SpawnError.ProtoReflect.Descriptor instead.
func (*SpawnError) Descriptor() ([]byte, []int) {
	return file_spawn_proto_rawDescGZIP(), []int{4}
}

func (x *SpawnError) GetMessage() string {
	if x != nil {
		return x.Message
	}
	return ""
}

var File_spawn_proto protoreflect.FileDescriptor

const file_spawn_proto_rawDesc = "" +
	"\n" +
	"\vspawn.proto\x12\fsiso.execute\x1a\x19google/protobuf/any.proto\"\xf9\x01\n" +
	"\fSpawnMessage\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\x04R\x02id\x122\n" +
	"\x05start\x18\x02 \x01(\v2\x1a.siso.execute.SpawnRequestH\x00R\x05start\x123\n" +
	"\x06cancel\x18\x03 \x01(\v2\x19.siso.execute.SpawnCancelH\x00R\x06cancel\x123\n" +
	"\x06result\x18\x04 \x01(\v2\x19.siso.execute.SpawnResultH\x00R\x06result\x120\n" +
	"\x05error\x18\x05 \x01(\v2\x18.siso.execute.SpawnErrorH\x00R\x05errorB\t\n" +
	"\apayload\"\xc1\x01\n" +
	"\fSpawnRequest\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
	"\x04args\x18\x02 \x03(\tR\x04args\x12\x10\n" +
	"\x03env\x18\x03 \x03(\tR\x03env\x12%\n" +
	"\x0eworkspace_root\x18\x04 \x01(\tR\rworkspaceRoot\x12\x19\n" +
	"\bwork_dir\x18\x05 \x01(\tR\aworkDir\x12'\n" +
	"\room_score_adj\x18\x06 \x01(\x05H\x00R\voomScoreAdj\x88\x01\x01B\x10\n" +
	"\x0e_oom_score_adj\"\r\n" +
	"\vSpawnCancel\"H\n" +
	"\vSpawnResult\x129\n" +
	"\raction_result\x18\x01 \x01(\v2\x14.google.protobuf.AnyR\factionResult\"&\n" +
	"\n" +
	"SpawnError\x12\x18\n" +
	"\amessage\x18\x01 \x01(\tR\amessageB*Z(go.chromium.org/build/siso/execute/protob\x06proto3"

var (
	file_spawn_proto_rawDescOnce sync.Once
	file_spawn_proto_rawDescData []byte
)

func file_spawn_proto_rawDescGZIP() []byte {
	file_spawn_proto_rawDescOnce.Do(func() {
		file_spawn_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_spawn_proto_rawDesc), len(file_spawn_proto_rawDesc)))
	})
	return file_spawn_proto_rawDescData
}

var file_spawn_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_spawn_proto_goTypes = []any{
	(*SpawnMessage)(nil), // 0: siso.execute.SpawnMessage
	(*SpawnRequest)(nil), // 1: siso.execute.SpawnRequest
	(*SpawnCancel)(nil),  // 2: siso.execute.SpawnCancel
	(*SpawnResult)(nil),  // 3: siso.execute.SpawnResult
	(*SpawnError)(nil),   // 4: siso.execute.SpawnError
	(*anypb.Any)(nil),    // 5: google.protobuf.Any
}
var file_spawn_proto_depIdxs = []int32{
	1, // 0: siso.execute.SpawnMessage.start:type_name -> siso.execute.SpawnRequest
	2, // 1: siso.execute.SpawnMessage.cancel:type_name -> siso.execute.SpawnCancel
	3, // 2: siso.execute.SpawnMessage.result:type_name -> siso.execute.SpawnResult
	4, // 3: siso.execute.SpawnMessage.error:type_name -> siso.execute.SpawnError
	5, // 4: siso.execute.SpawnResult.action_result:type_name -> google.protobuf.Any
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_spawn_proto_init() }
func file_spawn_proto_init() {
	if File_spawn_proto != nil {
		return
	}
	file_spawn_proto_msgTypes[0].OneofWrappers = []any{
		(*SpawnMessage_Start)(nil),
		(*SpawnMessage_Cancel)(nil),
		(*SpawnMessage_Result)(nil),
		(*SpawnMessage_Error)(nil),
	}
	file_spawn_proto_msgTypes[1].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_spawn_proto_rawDesc), len(file_spawn_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   5,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_spawn_proto_goTypes,
		DependencyIndexes: file_spawn_proto_depIdxs,
		MessageInfos:      file_spawn_proto_msgTypes,
	}.Build()
	File_spawn_proto = out.File
	file_spawn_proto_goTypes = nil
	file_spawn_proto_depIdxs = nil
}
