// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v4.25.0
// source: hostexec/pb/hostexec.proto

package pb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	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)
)

type ExecOutput_Stream int32

const (
	ExecOutput_STDOUT ExecOutput_Stream = 0
	ExecOutput_STDERR ExecOutput_Stream = 1
)

// Enum value maps for ExecOutput_Stream.
var (
	ExecOutput_Stream_name = map[int32]string{
		0: "STDOUT",
		1: "STDERR",
	}
	ExecOutput_Stream_value = map[string]int32{
		"STDOUT": 0,
		"STDERR": 1,
	}
)

func (x ExecOutput_Stream) Enum() *ExecOutput_Stream {
	p := new(ExecOutput_Stream)
	*p = x
	return p
}

func (x ExecOutput_Stream) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ExecOutput_Stream) Descriptor() protoreflect.EnumDescriptor {
	return file_hostexec_pb_hostexec_proto_enumTypes[0].Descriptor()
}

func (ExecOutput_Stream) Type() protoreflect.EnumType {
	return &file_hostexec_pb_hostexec_proto_enumTypes[0]
}

func (x ExecOutput_Stream) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ExecOutput_Stream.Descriptor instead.
func (ExecOutput_Stream) EnumDescriptor() ([]byte, []int) {
	return file_hostexec_pb_hostexec_proto_rawDescGZIP(), []int{2, 0}
}

type ExecRequest struct {
	state          protoimpl.MessageState `protogen:"open.v1"`
	Command        string                 `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	Args           []string               `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	WorkingDir     string                 `protobuf:"bytes,3,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"`
	Env            map[string]string      `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Stdin          []byte                 `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
	TimeoutMs      int64                  `protobuf:"varint,6,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"`
	MaxOutputBytes int64                  `protobuf:"varint,7,opt,name=max_output_bytes,json=maxOutputBytes,proto3" json:"max_output_bytes,omitempty"` // max stdout+stderr size (0 = default 10MB), truncate if exceeded
	unknownFields  protoimpl.UnknownFields
	sizeCache      protoimpl.SizeCache
}

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

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

func (*ExecRequest) ProtoMessage() {}

func (x *ExecRequest) ProtoReflect() protoreflect.Message {
	mi := &file_hostexec_pb_hostexec_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 ExecRequest.ProtoReflect.Descriptor instead.
func (*ExecRequest) Descriptor() ([]byte, []int) {
	return file_hostexec_pb_hostexec_proto_rawDescGZIP(), []int{0}
}

func (x *ExecRequest) GetCommand() string {
	if x != nil {
		return x.Command
	}
	return ""
}

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

func (x *ExecRequest) GetWorkingDir() string {
	if x != nil {
		return x.WorkingDir
	}
	return ""
}

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

func (x *ExecRequest) GetStdin() []byte {
	if x != nil {
		return x.Stdin
	}
	return nil
}

func (x *ExecRequest) GetTimeoutMs() int64 {
	if x != nil {
		return x.TimeoutMs
	}
	return 0
}

func (x *ExecRequest) GetMaxOutputBytes() int64 {
	if x != nil {
		return x.MaxOutputBytes
	}
	return 0
}

type ExecResponse struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	ExitCode      int32                  `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	Stdout        []byte                 `protobuf:"bytes,2,opt,name=stdout,proto3" json:"stdout,omitempty"`
	Stderr        []byte                 `protobuf:"bytes,3,opt,name=stderr,proto3" json:"stderr,omitempty"`
	DurationMs    int64                  `protobuf:"varint,4,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"`
	Error         string                 `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`          // non-empty if Tai failed to execute (not the command's error)
	Truncated     bool                   `protobuf:"varint,6,opt,name=truncated,proto3" json:"truncated,omitempty"` // true if stdout+stderr exceeded max_output_bytes and was truncated
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ExecResponse) ProtoMessage() {}

func (x *ExecResponse) ProtoReflect() protoreflect.Message {
	mi := &file_hostexec_pb_hostexec_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 ExecResponse.ProtoReflect.Descriptor instead.
func (*ExecResponse) Descriptor() ([]byte, []int) {
	return file_hostexec_pb_hostexec_proto_rawDescGZIP(), []int{1}
}

func (x *ExecResponse) GetExitCode() int32 {
	if x != nil {
		return x.ExitCode
	}
	return 0
}

func (x *ExecResponse) GetStdout() []byte {
	if x != nil {
		return x.Stdout
	}
	return nil
}

func (x *ExecResponse) GetStderr() []byte {
	if x != nil {
		return x.Stderr
	}
	return nil
}

func (x *ExecResponse) GetDurationMs() int64 {
	if x != nil {
		return x.DurationMs
	}
	return 0
}

func (x *ExecResponse) GetError() string {
	if x != nil {
		return x.Error
	}
	return ""
}

func (x *ExecResponse) GetTruncated() bool {
	if x != nil {
		return x.Truncated
	}
	return false
}

type ExecOutput struct {
	state  protoimpl.MessageState `protogen:"open.v1"`
	Stream ExecOutput_Stream      `protobuf:"varint,1,opt,name=stream,proto3,enum=hostexec.ExecOutput_Stream" json:"stream,omitempty"`
	Data   []byte                 `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// Only set in the final message (exit_code is meaningful).
	Done          bool   `protobuf:"varint,3,opt,name=done,proto3" json:"done,omitempty"`
	ExitCode      int32  `protobuf:"varint,4,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	Error         string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ExecOutput) ProtoMessage() {}

func (x *ExecOutput) ProtoReflect() protoreflect.Message {
	mi := &file_hostexec_pb_hostexec_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 ExecOutput.ProtoReflect.Descriptor instead.
func (*ExecOutput) Descriptor() ([]byte, []int) {
	return file_hostexec_pb_hostexec_proto_rawDescGZIP(), []int{2}
}

func (x *ExecOutput) GetStream() ExecOutput_Stream {
	if x != nil {
		return x.Stream
	}
	return ExecOutput_STDOUT
}

func (x *ExecOutput) GetData() []byte {
	if x != nil {
		return x.Data
	}
	return nil
}

func (x *ExecOutput) GetDone() bool {
	if x != nil {
		return x.Done
	}
	return false
}

func (x *ExecOutput) GetExitCode() int32 {
	if x != nil {
		return x.ExitCode
	}
	return 0
}

func (x *ExecOutput) GetError() string {
	if x != nil {
		return x.Error
	}
	return ""
}

var File_hostexec_pb_hostexec_proto protoreflect.FileDescriptor

const file_hostexec_pb_hostexec_proto_rawDesc = "" +
	"\n" +
	"\x1ahostexec/pb/hostexec.proto\x12\bhostexec\"\xa5\x02\n" +
	"\vExecRequest\x12\x18\n" +
	"\acommand\x18\x01 \x01(\tR\acommand\x12\x12\n" +
	"\x04args\x18\x02 \x03(\tR\x04args\x12\x1f\n" +
	"\vworking_dir\x18\x03 \x01(\tR\n" +
	"workingDir\x120\n" +
	"\x03env\x18\x04 \x03(\v2\x1e.hostexec.ExecRequest.EnvEntryR\x03env\x12\x14\n" +
	"\x05stdin\x18\x05 \x01(\fR\x05stdin\x12\x1d\n" +
	"\n" +
	"timeout_ms\x18\x06 \x01(\x03R\ttimeoutMs\x12(\n" +
	"\x10max_output_bytes\x18\a \x01(\x03R\x0emaxOutputBytes\x1a6\n" +
	"\bEnvEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb0\x01\n" +
	"\fExecResponse\x12\x1b\n" +
	"\texit_code\x18\x01 \x01(\x05R\bexitCode\x12\x16\n" +
	"\x06stdout\x18\x02 \x01(\fR\x06stdout\x12\x16\n" +
	"\x06stderr\x18\x03 \x01(\fR\x06stderr\x12\x1f\n" +
	"\vduration_ms\x18\x04 \x01(\x03R\n" +
	"durationMs\x12\x14\n" +
	"\x05error\x18\x05 \x01(\tR\x05error\x12\x1c\n" +
	"\ttruncated\x18\x06 \x01(\bR\ttruncated\"\xbe\x01\n" +
	"\n" +
	"ExecOutput\x123\n" +
	"\x06stream\x18\x01 \x01(\x0e2\x1b.hostexec.ExecOutput.StreamR\x06stream\x12\x12\n" +
	"\x04data\x18\x02 \x01(\fR\x04data\x12\x12\n" +
	"\x04done\x18\x03 \x01(\bR\x04done\x12\x1b\n" +
	"\texit_code\x18\x04 \x01(\x05R\bexitCode\x12\x14\n" +
	"\x05error\x18\x05 \x01(\tR\x05error\" \n" +
	"\x06Stream\x12\n" +
	"\n" +
	"\x06STDOUT\x10\x00\x12\n" +
	"\n" +
	"\x06STDERR\x10\x012~\n" +
	"\bHostExec\x125\n" +
	"\x04Exec\x12\x15.hostexec.ExecRequest\x1a\x16.hostexec.ExecResponse\x12;\n" +
	"\n" +
	"ExecStream\x12\x15.hostexec.ExecRequest\x1a\x14.hostexec.ExecOutput0\x01B#Z!github.com/yaoapp/tai/hostexec/pbb\x06proto3"

var (
	file_hostexec_pb_hostexec_proto_rawDescOnce sync.Once
	file_hostexec_pb_hostexec_proto_rawDescData []byte
)

func file_hostexec_pb_hostexec_proto_rawDescGZIP() []byte {
	file_hostexec_pb_hostexec_proto_rawDescOnce.Do(func() {
		file_hostexec_pb_hostexec_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_hostexec_pb_hostexec_proto_rawDesc), len(file_hostexec_pb_hostexec_proto_rawDesc)))
	})
	return file_hostexec_pb_hostexec_proto_rawDescData
}

var file_hostexec_pb_hostexec_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_hostexec_pb_hostexec_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_hostexec_pb_hostexec_proto_goTypes = []any{
	(ExecOutput_Stream)(0), // 0: hostexec.ExecOutput.Stream
	(*ExecRequest)(nil),    // 1: hostexec.ExecRequest
	(*ExecResponse)(nil),   // 2: hostexec.ExecResponse
	(*ExecOutput)(nil),     // 3: hostexec.ExecOutput
	nil,                    // 4: hostexec.ExecRequest.EnvEntry
}
var file_hostexec_pb_hostexec_proto_depIdxs = []int32{
	4, // 0: hostexec.ExecRequest.env:type_name -> hostexec.ExecRequest.EnvEntry
	0, // 1: hostexec.ExecOutput.stream:type_name -> hostexec.ExecOutput.Stream
	1, // 2: hostexec.HostExec.Exec:input_type -> hostexec.ExecRequest
	1, // 3: hostexec.HostExec.ExecStream:input_type -> hostexec.ExecRequest
	2, // 4: hostexec.HostExec.Exec:output_type -> hostexec.ExecResponse
	3, // 5: hostexec.HostExec.ExecStream:output_type -> hostexec.ExecOutput
	4, // [4:6] is the sub-list for method output_type
	2, // [2:4] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_hostexec_pb_hostexec_proto_init() }
func file_hostexec_pb_hostexec_proto_init() {
	if File_hostexec_pb_hostexec_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_hostexec_pb_hostexec_proto_rawDesc), len(file_hostexec_pb_hostexec_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_hostexec_pb_hostexec_proto_goTypes,
		DependencyIndexes: file_hostexec_pb_hostexec_proto_depIdxs,
		EnumInfos:         file_hostexec_pb_hostexec_proto_enumTypes,
		MessageInfos:      file_hostexec_pb_hostexec_proto_msgTypes,
	}.Build()
	File_hostexec_pb_hostexec_proto = out.File
	file_hostexec_pb_hostexec_proto_goTypes = nil
	file_hostexec_pb_hostexec_proto_depIdxs = nil
}
