models

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandList

type CommandList []CommandSpec

CommandList unmarshals create-task / stored commands as objects only.

func NewCommandList

func NewCommandList(lines ...string) CommandList

NewCommandList builds unnamed command specs from shell lines (tests and adapters).

func (CommandList) ShellLines

func (c CommandList) ShellLines() []string

func (*CommandList) UnmarshalJSON

func (c *CommandList) UnmarshalJSON(data []byte) error

type CommandSpec

type CommandSpec struct {
	Name    string `json:"name,omitempty"`
	Command string `json:"command"`
	Kind    string `json:"kind,omitempty"`
	Preview string `json:"preview,omitempty"`
}

CommandSpec is one shell directive in a command_list task. JSON must be {"name","command"} (name optional). Kind and Preview are optional live-log labels (bash/prompt/setup and a user-facing snippet).

func (CommandSpec) DisplayText

func (c CommandSpec) DisplayText() string

DisplayText is the live-log accordion title (name when set, otherwise the shell).

func (CommandSpec) ShellLine

func (c CommandSpec) ShellLine() string

ShellLine is the directive sourced/executed by the runner.

type EnvironmentVariable

type EnvironmentVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ExecutionMode

type ExecutionMode string
const (
	ExecutionHost   ExecutionMode = "host"
	ExecutionDocker ExecutionMode = "docker"
)

type RunMode

type RunMode string

RunMode selects what the runner executes. Orthogonal to ExecutionMode (host vs docker).

const (
	// RunModeCommandList runs Commands as sequential shell directives (today's `commands` field).
	RunModeCommandList RunMode = "command_list"
	// RunModeArgv runs Command as a single argv subprocess (today's `command` field).
	RunModeArgv RunMode = "argv"
	// RunModeJavaScript runs Script with node; global $ is the message chain.
	RunModeJavaScript RunMode = "javascript_script"
	// RunModePython runs Script with python3; main(payload) receives the message chain.
	RunModePython RunMode = "python_script"
	// RunModeBash runs Script with bash; message_chain is written to SUPERPLANE_PAYLOAD_FILE.
	RunModeBash RunMode = "bash_script"
)

func InferRunMode

func InferRunMode(commands CommandList, command []string, script string) RunMode

InferRunMode maps legacy task fields when RunMode is unset.

type TaskFile

type TaskFile struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	// Mode is an optional unix file mode in octal (e.g. "0644", "0755").
	// When empty, the runner uses 0644.
	Mode string `json:"mode,omitempty"`
}

TaskFile is a file the runner materializes before task execution. Path is relative to SUPERPLANE_TASK_DIR (no absolute paths or "..").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL