// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: runme/runner/v2/config.proto

package runnerv2

import (
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"

	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)

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 CommandMode int32

const (
	CommandMode_COMMAND_MODE_UNSPECIFIED CommandMode = 0
	// COMMAND_MODE_INLINE indicates that the command should be executed inline.
	// For example: bash -c "echo 'Hello, World'"
	CommandMode_COMMAND_MODE_INLINE CommandMode = 1
	// COMMAND_MODE_FILE indicates that the command should be executed as a file.
	// For example: bash /tmp/script.sh
	CommandMode_COMMAND_MODE_FILE CommandMode = 2
	// COMMAND_MODE_TERMINAL indicates that the command should be executed as a Runme Terminal.
	// This is used by the VS Code extension.
	CommandMode_COMMAND_MODE_TERMINAL CommandMode = 3
	// COMMAND_MODE_CLI indicates that the command is executed via runme CLI.
	// It is executed as a native command.
	CommandMode_COMMAND_MODE_CLI CommandMode = 4
)

// Enum value maps for CommandMode.
var (
	CommandMode_name = map[int32]string{
		0: "COMMAND_MODE_UNSPECIFIED",
		1: "COMMAND_MODE_INLINE",
		2: "COMMAND_MODE_FILE",
		3: "COMMAND_MODE_TERMINAL",
		4: "COMMAND_MODE_CLI",
	}
	CommandMode_value = map[string]int32{
		"COMMAND_MODE_UNSPECIFIED": 0,
		"COMMAND_MODE_INLINE":      1,
		"COMMAND_MODE_FILE":        2,
		"COMMAND_MODE_TERMINAL":    3,
		"COMMAND_MODE_CLI":         4,
	}
)

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

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

func (CommandMode) Descriptor() protoreflect.EnumDescriptor {
	return file_runme_runner_v2_config_proto_enumTypes[0].Descriptor()
}

func (CommandMode) Type() protoreflect.EnumType {
	return &file_runme_runner_v2_config_proto_enumTypes[0]
}

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

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

// ProgramConfig is a configuration for a program to execute.
// From this configuration, any program can be built.
type ProgramConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// program_name is a name of the program to execute.
	// If it's not a path (relative or absolute), the runner
	// will try to resolve the name.
	// For example: "sh", "/bin/bash".
	ProgramName string `protobuf:"bytes,1,opt,name=program_name,json=programName,proto3" json:"program_name,omitempty"`
	// arguments is a list of arguments passed to the program.
	Arguments []string `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty"`
	// directory to execute the program in.
	Directory string `protobuf:"bytes,3,opt,name=directory,proto3" json:"directory,omitempty"`
	// language_id associated with script to allow interpreter
	// detection if no specific interpreter program is provided.
	LanguageId string `protobuf:"bytes,4,opt,name=language_id,json=languageId,proto3" json:"language_id,omitempty"`
	// background indicates a background process
	// required to handle running background tasks via CLI in C/I
	Background bool `protobuf:"varint,5,opt,name=background,proto3" json:"background,omitempty"`
	// file_extension associated with script. Some interpreters are strict
	// about file extensions, such as tsc which requires "ts" extension.
	FileExtension string `protobuf:"bytes,6,opt,name=file_extension,json=fileExtension,proto3" json:"file_extension,omitempty"`
	// env is a list of additional environment variables
	// that will be injected to the executed program.
	Env []string `protobuf:"bytes,7,rep,name=env,proto3" json:"env,omitempty"`
	// Types that are valid to be assigned to Source:
	//
	//	*ProgramConfig_Commands
	//	*ProgramConfig_Script
	Source isProgramConfig_Source `protobuf_oneof:"source"`
	// interactive, if true, uses a pseudo-tty to execute the program.
	// Otherwise, the program is executed using in-memory buffers for I/O.
	Interactive bool `protobuf:"varint,10,opt,name=interactive,proto3" json:"interactive,omitempty"`
	// TODO(adamb): understand motivation for this. In theory, source
	// should tell whether to execute it inline or as a file.
	Mode CommandMode `protobuf:"varint,11,opt,name=mode,proto3,enum=runme.runner.v2.CommandMode" json:"mode,omitempty"`
	// optional well known id for cell/block
	KnownId string `protobuf:"bytes,12,opt,name=known_id,json=knownId,proto3" json:"known_id,omitempty"`
	// optional well known name for cell/block
	KnownName string `protobuf:"bytes,13,opt,name=known_name,json=knownName,proto3" json:"known_name,omitempty"`
	// optional run ID to track the execution of the program
	RunId         string `protobuf:"bytes,14,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ProgramConfig) ProtoMessage() {}

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

func (x *ProgramConfig) GetProgramName() string {
	if x != nil {
		return x.ProgramName
	}
	return ""
}

func (x *ProgramConfig) GetArguments() []string {
	if x != nil {
		return x.Arguments
	}
	return nil
}

func (x *ProgramConfig) GetDirectory() string {
	if x != nil {
		return x.Directory
	}
	return ""
}

func (x *ProgramConfig) GetLanguageId() string {
	if x != nil {
		return x.LanguageId
	}
	return ""
}

func (x *ProgramConfig) GetBackground() bool {
	if x != nil {
		return x.Background
	}
	return false
}

func (x *ProgramConfig) GetFileExtension() string {
	if x != nil {
		return x.FileExtension
	}
	return ""
}

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

func (x *ProgramConfig) GetSource() isProgramConfig_Source {
	if x != nil {
		return x.Source
	}
	return nil
}

func (x *ProgramConfig) GetCommands() *ProgramConfig_CommandList {
	if x != nil {
		if x, ok := x.Source.(*ProgramConfig_Commands); ok {
			return x.Commands
		}
	}
	return nil
}

func (x *ProgramConfig) GetScript() string {
	if x != nil {
		if x, ok := x.Source.(*ProgramConfig_Script); ok {
			return x.Script
		}
	}
	return ""
}

func (x *ProgramConfig) GetInteractive() bool {
	if x != nil {
		return x.Interactive
	}
	return false
}

func (x *ProgramConfig) GetMode() CommandMode {
	if x != nil {
		return x.Mode
	}
	return CommandMode_COMMAND_MODE_UNSPECIFIED
}

func (x *ProgramConfig) GetKnownId() string {
	if x != nil {
		return x.KnownId
	}
	return ""
}

func (x *ProgramConfig) GetKnownName() string {
	if x != nil {
		return x.KnownName
	}
	return ""
}

func (x *ProgramConfig) GetRunId() string {
	if x != nil {
		return x.RunId
	}
	return ""
}

type isProgramConfig_Source interface {
	isProgramConfig_Source()
}

type ProgramConfig_Commands struct {
	// commands are commands to be executed by the program.
	// The commands are joined and executed as a script.
	Commands *ProgramConfig_CommandList `protobuf:"bytes,8,opt,name=commands,proto3,oneof"`
}

type ProgramConfig_Script struct {
	// script is code to be executed by the program.
	// Individual lines are joined with the new line character.
	Script string `protobuf:"bytes,9,opt,name=script,proto3,oneof"`
}

func (*ProgramConfig_Commands) isProgramConfig_Source() {}

func (*ProgramConfig_Script) isProgramConfig_Source() {}

type ProgramConfig_CommandList struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// commands are commands to be executed by the program.
	// The commands are joined and executed as a script.
	// For example: ["echo 'Hello, World'", "ls -l /etc"].
	Items         []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ProgramConfig_CommandList) ProtoMessage() {}

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

func (x *ProgramConfig_CommandList) GetItems() []string {
	if x != nil {
		return x.Items
	}
	return nil
}

var File_runme_runner_v2_config_proto protoreflect.FileDescriptor

const file_runme_runner_v2_config_proto_rawDesc = "" +
	"\n" +
	"\x1crunme/runner/v2/config.proto\x12\x0frunme.runner.v2\"\xa0\x04\n" +
	"\rProgramConfig\x12!\n" +
	"\fprogram_name\x18\x01 \x01(\tR\vprogramName\x12\x1c\n" +
	"\targuments\x18\x02 \x03(\tR\targuments\x12\x1c\n" +
	"\tdirectory\x18\x03 \x01(\tR\tdirectory\x12\x1f\n" +
	"\vlanguage_id\x18\x04 \x01(\tR\n" +
	"languageId\x12\x1e\n" +
	"\n" +
	"background\x18\x05 \x01(\bR\n" +
	"background\x12%\n" +
	"\x0efile_extension\x18\x06 \x01(\tR\rfileExtension\x12\x10\n" +
	"\x03env\x18\a \x03(\tR\x03env\x12H\n" +
	"\bcommands\x18\b \x01(\v2*.runme.runner.v2.ProgramConfig.CommandListH\x00R\bcommands\x12\x18\n" +
	"\x06script\x18\t \x01(\tH\x00R\x06script\x12 \n" +
	"\vinteractive\x18\n" +
	" \x01(\bR\vinteractive\x120\n" +
	"\x04mode\x18\v \x01(\x0e2\x1c.runme.runner.v2.CommandModeR\x04mode\x12\x19\n" +
	"\bknown_id\x18\f \x01(\tR\aknownId\x12\x1d\n" +
	"\n" +
	"known_name\x18\r \x01(\tR\tknownName\x12\x15\n" +
	"\x06run_id\x18\x0e \x01(\tR\x05runId\x1a#\n" +
	"\vCommandList\x12\x14\n" +
	"\x05items\x18\x01 \x03(\tR\x05itemsB\b\n" +
	"\x06source*\x8c\x01\n" +
	"\vCommandMode\x12\x1c\n" +
	"\x18COMMAND_MODE_UNSPECIFIED\x10\x00\x12\x17\n" +
	"\x13COMMAND_MODE_INLINE\x10\x01\x12\x15\n" +
	"\x11COMMAND_MODE_FILE\x10\x02\x12\x19\n" +
	"\x15COMMAND_MODE_TERMINAL\x10\x03\x12\x14\n" +
	"\x10COMMAND_MODE_CLI\x10\x04BHZFgithub.com/runmedev/runme/v3/api/gen/proto/go/runme/runner/v2;runnerv2b\x06proto3"

var (
	file_runme_runner_v2_config_proto_rawDescOnce sync.Once
	file_runme_runner_v2_config_proto_rawDescData []byte
)

func file_runme_runner_v2_config_proto_rawDescGZIP() []byte {
	file_runme_runner_v2_config_proto_rawDescOnce.Do(func() {
		file_runme_runner_v2_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_runme_runner_v2_config_proto_rawDesc), len(file_runme_runner_v2_config_proto_rawDesc)))
	})
	return file_runme_runner_v2_config_proto_rawDescData
}

var file_runme_runner_v2_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_runme_runner_v2_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_runme_runner_v2_config_proto_goTypes = []any{
	(CommandMode)(0),                  // 0: runme.runner.v2.CommandMode
	(*ProgramConfig)(nil),             // 1: runme.runner.v2.ProgramConfig
	(*ProgramConfig_CommandList)(nil), // 2: runme.runner.v2.ProgramConfig.CommandList
}
var file_runme_runner_v2_config_proto_depIdxs = []int32{
	2, // 0: runme.runner.v2.ProgramConfig.commands:type_name -> runme.runner.v2.ProgramConfig.CommandList
	0, // 1: runme.runner.v2.ProgramConfig.mode:type_name -> runme.runner.v2.CommandMode
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] 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_runme_runner_v2_config_proto_init() }
func file_runme_runner_v2_config_proto_init() {
	if File_runme_runner_v2_config_proto != nil {
		return
	}
	file_runme_runner_v2_config_proto_msgTypes[0].OneofWrappers = []any{
		(*ProgramConfig_Commands)(nil),
		(*ProgramConfig_Script)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_runme_runner_v2_config_proto_rawDesc), len(file_runme_runner_v2_config_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_runme_runner_v2_config_proto_goTypes,
		DependencyIndexes: file_runme_runner_v2_config_proto_depIdxs,
		EnumInfos:         file_runme_runner_v2_config_proto_enumTypes,
		MessageInfos:      file_runme_runner_v2_config_proto_msgTypes,
	}.Build()
	File_runme_runner_v2_config_proto = out.File
	file_runme_runner_v2_config_proto_goTypes = nil
	file_runme_runner_v2_config_proto_depIdxs = nil
}
