runner

package
v1.0.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AgentStepPrompt = "prompt"
	AgentStepBash   = "bash"

	CredentialsSourceSecret      = "secret"
	CredentialsSourceIntegration = "integration"
	CredentialsSourceHosted      = "hosted"
)
View Source
const (
	ArtifactUploadTokenPurpose = "runner_artifact_upload"
	EnvSuperplaneArtifactToken = "SUPERPLANE_ARTIFACT_TOKEN"
	EnvPlaywrightMCPBrowser    = "PLAYWRIGHT_MCP_BROWSER"
)
View Source
const (
	VideoMaxDurationSeconds     = 900
	HostedVideoDownloadTimeout  = 180
	VideoMaxFrames              = 24
	VideoMaxFrameWidth          = 1280
	VideoMaxFrameHeight         = 1280
	VideoMaxSourcePixels        = 16_777_216
	VideoProcessTimeoutSeconds  = 120
	VideoDiskBudgetBytes        = 2 << 30
	AttachmentManifestVersion   = 1
	AttachmentManifestPath      = "attachments/manifest.json"
	AttachmentIndexPath         = "attachments/INDEX.md"
	AttachmentFetchScriptPath   = "fetch_task_attachments.sh"
	AttachmentProcessScriptPath = "process_video_attachments.sh"
)
View Source
const (
	RunModeJavaScript = "javascript_script"
	RunModePython     = "python_script"
	RunModeBash       = "bash_script"
)
View Source
const (
	EnvironmentFromSourceIntegration = "integration"
	EnvironmentFromSourceSecret      = "secret"

	EnvironmentValueSourceLiteral = "literal"
	EnvironmentValueSourceSecret  = "secret"

	// EnvExecutionTimeoutSeconds is the node wall-clock limit in seconds.
	// OpenRouter wait/retry uses this so a 60s rate-limit pause cannot outlive
	// the broker task timeout.
	EnvExecutionTimeoutSeconds = "SUPERPLANE_EXECUTION_TIMEOUT_SECONDS"
)
View Source
const (
	FactoryAgentName  = "SuperPlane Agent"
	FactoryAgentEmail = "superplaneagent@superplane.com"

	EnvGitAuthorName     = "GIT_AUTHOR_NAME"
	EnvGitAuthorEmail    = "GIT_AUTHOR_EMAIL"
	EnvGitCommitterName  = "GIT_COMMITTER_NAME"
	EnvGitCommitterEmail = "GIT_COMMITTER_EMAIL"

	FactoryGitWrapperPath = "bin/git"
	FactoryGitHookPath    = "git-hooks/prepare-commit-msg"

	// FactoryCommitIdentityPrompt tells the agent not to override the identity
	// the environment, wrapper, and hook already enforce.
	FactoryCommitIdentityPrompt = "Do not set git user.email, and do not add Co-authored-by or Signed-off-by trailers."
)
View Source
const (
	MachineTypeE1LargeAMD64 = "e1-large-amd64"
	MachineTypeE1LargeARM64 = "e1-large-arm64"
	MachineTypeE1TinyAMD64  = "e1-tiny-amd64"
	MachineTypeE1TinyARM64  = "e1-tiny-arm64"
)

Machine type names, which are also the default task-broker fleet IDs (GET /v1/fleets) stored in node configuration and sent as fleet_id unless TASK_BROKER_FLEET_ID is set.

View Source
const (
	DefaultLiveLogRecordLimit = 200
	MaxLiveLogRecordLimit     = 1000
)
View Source
const (
	LiveLogKindBash       = "bash"
	LiveLogKindPrompt     = "prompt"
	LiveLogKindSetup      = "setup"
	LiveLogKindJavaScript = "javascript"
	LiveLogKindPython     = "python"
)
View Source
const (
	LiveLogStreamTokenPurpose       = "runner_live_logs"
	LiveLogStreamTokenAudience      = "task_broker"
	LiveLogErrorCodeHeader          = "X-Superplane-Error-Code"
	LiveLogSessionNotReadyErrorCode = "live_log_session_not_ready"
)
View Source
const (
	MergeConfidenceTokenPurpose = "merge_confidence"

	// EnvSuperplaneMergeConfidenceOrderID is set on the merge confidence
	// agent node. The runner reads it, then removes it from the task
	// environment. The work order id travels in the signed token instead.
	EnvSuperplaneMergeConfidenceOrderID = "SUPERPLANE_MERGE_CONFIDENCE_ORDER_ID"
	EnvSuperplaneMergeConfidenceToken   = "SUPERPLANE_MERGE_CONFIDENCE_TOKEN"
)
View Source
const (
	ExecutionMetadataBrokerTaskID = "runner_broker_task_id"
	ExecutionMetadataTaskLog      = "runner_task_log"
	ExecutionMetadataTaskBackend  = "runner_task_backend"
)
View Source
const (
	PlanningSessionTokenPurpose      = "planning_session"
	EnvSuperplanePlanningID          = "SUPERPLANE_PLANNING_SESSION_ID"
	EnvSuperplanePlanningSessionKind = "SUPERPLANE_PLANNING_SESSION_KIND"
	EnvSuperplanePlanningClarity     = "SUPERPLANE_PLANNING_CLARITY"
	EnvSuperplanePlanningConfidence  = "SUPERPLANE_PLANNING_CONFIDENCE"
	EnvSuperplanePlanningReview      = "SUPERPLANE_PLANNING_REVIEW"
	EnvSuperplaneAnalysisSpecFile    = "SUPERPLANE_ANALYSIS_SPEC_FILE"
	EnvSuperplaneAnalysisScoreFile   = "SUPERPLANE_ANALYSIS_SCORE_FILE"
	EnvSuperplaneBaseURL             = "SUPERPLANE_BASE_URL"
	EnvSuperplaneRunToken            = "SUPERPLANE_RUN_TOKEN"
)
View Source
const (
	RunBashComponentName     = "runnerBash"
	RunBashFinishedEventType = "runnerBash.finished"
)
View Source
const (
	PassedOutputChannel     = "passed"
	FailedOutputChannel     = core.FailedOutputChannel
	RunnerFinishedEventType = "runner.finished"
)
View Source
const (
	RunJSComponentName     = "runnerJS"
	RunJSFinishedEventType = "runnerJS.finished"
)
View Source
const (
	RunPythonComponentName     = "runnerPython"
	RunPythonFinishedEventType = "runnerPython.finished"
)
View Source
const (
	ExecutionModeHost   = "host"
	ExecutionModeDocker = "docker"

	// DockerImagePresetCustom selects the free-text docker_image field instead of a quick-pick ref.
	DockerImagePresetCustom = "custom"

	// DefaultExecutionTimeoutSeconds is the wall-clock limit when a node omits execution_timeout_seconds.
	DefaultExecutionTimeoutSeconds = 3600 // 1 hour
)

Execution modes accepted by the task broker / fleet manager (lowercase JSON).

View Source
const (
	MachineTypeFieldName              = configurationFieldMachineType
	HookPoll                          = hookActionPoll
	MaxExecutionTimeoutSecondsRequest = maxExecutionTimeoutSecondsRequest
)
View Source
const (
	ThinkingLevelKey    = "thinkingLevel"
	ThinkingLevelLow    = "low"
	ThinkingLevelMedium = "medium"
	ThinkingLevelHigh   = "high"
	// DispatchThinkingDefault is the Start override that uses runner Default
	// instead of the saved agent thinking level. Empty dispatch thinking means Auto.
	DispatchThinkingDefault = "default"
)
View Source
const (
	WorkspaceMCPConfigPath          = "workspace_mcp.json"
	EnvSuperplaneWorkspaceMCPConfig = "SUPERPLANE_WORKSPACE_MCP_CONFIG"

	WorkspaceSetupConfigPath   = "workspace_setup.json"
	WorkspaceContextConfigPath = "workspace_context.json"
)
View Source
const AttachmentAgentInstructions = `` /* 250-byte string literal not displayed */

AttachmentAgentInstructions tell every agent CLI to read processed artifacts instead of original video or audio bytes.

View Source
const ComponentName = "runner"

ComponentName is the registry / canvas component key for Runner.

View Source
const FactoryImaginedLimitPrompt = "" /* 281-byte string literal not displayed */

FactoryImaginedLimitPrompt tells a factory coding agent not to invent a budget or a remaining context size. The application does not set one unless the task text sets one.

View Source
const HostedVideoKind = "hosted_video"
View Source
const (
	OpenRouterChildKeyHashKV = "openrouter_key_hash"
)

Variables

View Source
var (
	ErrLiveLogCanvasNotFound    = errors.New("canvas not found")
	ErrLiveLogExecutionNotFound = errors.New("execution not found")
	ErrLiveLogNodeNotFound      = errors.New("node not found")
	ErrLiveLogNotRunner         = errors.New("not a runner component")
	ErrLiveLogBrokerTaskMissing = errors.New("broker task id missing")
	ErrLiveLogNotConfigured     = errors.New("live logs not configured")
)
View Source
var ActivityStreamScript string
View Source
var ErrArtifactRunScopeNotFound = errors.New("artifact run scope not found")
View Source
var LLMUsageScript string
View Source
var TurnTelemetryScript string

Functions

func AfterRunnerTaskCreated added in v0.30.0

func AfterRunnerTaskCreated(
	ctx core.ExecutionContext,
	taskID, backend string,
) error

func AgentCredentialsField

func AgentCredentialsField(opts AgentCredentialsOptions) configuration.Field

func AgentEnvironmentField

func AgentEnvironmentField(reservedEnv string) configuration.Field

func AgentModelField

func AgentModelField(provider string) configuration.Field

func AgentStepLabel

func AgentStepLabel(stepName, fallback string) string

func AgentStepSlug

func AgentStepSlug(stepNumber int, name string) string

func AgentStepsField

func AgentStepsField(description, promptPlaceholder, commandPlaceholder string) configuration.Field

func AgentTimeoutField

func AgentTimeoutField() configuration.Field

func AgentWorkingDirectoryField

func AgentWorkingDirectoryField() configuration.Field

func ApplyAttachmentInstructions

func ApplyAttachmentInstructions(prompt string, attachments []TaskAttachment) string

func ApplyIntegrationUsage

func ApplyIntegrationUsage(prompt, usage string) string

func AttachFactoryCommitIdentity

func AttachFactoryCommitIdentity(
	ctx core.ExecutionContext,
	environment []BrokerEnvironmentVariable,
	files []BrokerTaskFile,
) ([]BrokerEnvironmentVariable, []BrokerTaskFile)

AttachFactoryCommitIdentity forces SuperPlane Agent <superplaneagent@superplane.com> on factory-owned agent tasks. A canvas that is not a factory app is left unchanged.

func AttachWorkspaceAgentResources

func AttachWorkspaceAgentResources(
	ctx core.ExecutionContext,
	environment []BrokerEnvironmentVariable,
	files []BrokerTaskFile,
) ([]BrokerEnvironmentVariable, []BrokerTaskFile)

AttachWorkspaceAgentResources ships enabled workspace MCP connections, inline skills, setup commands, and context repositories on the broker task. It is a no-op when the canvas is not factory-owned.

func AttachmentManifestJSON

func AttachmentManifestJSON(attachments []TaskAttachment) string

func AttachmentSetup

func AttachmentSetup(attachments []TaskAttachment) (files []BrokerTaskFile, commands []BrokerCommand)

func BrokerTaskIDFromExecutionMetadata added in v0.23.0

func BrokerTaskIDFromExecutionMetadata(meta map[string]any) string

func BuildAgentBrokerTask

func BuildAgentBrokerTask(input AgentBrokerTaskInput) (commands []BrokerCommand, files []BrokerTaskFile)

func BuildIntegrationSetupCommands

func BuildIntegrationSetupCommands(setups []IntegrationSetup) (commands []BrokerCommand, files []BrokerTaskFile)

func CancelBrokerTask added in v0.30.0

func CancelBrokerTask(ctx core.ExecutionContext, finishedEventType string) error

func DefaultAgentSteps

func DefaultAgentSteps() []map[string]any

func DispatchFileRewriter

func DispatchFileRewriter(exec core.ExecutionContext, timeoutSeconds int) func(string) (string, error)

DispatchFileRewriter mints reachable GET URLs for sp-file refs at runner prompt-build time. Stored markdown stays unchanged.

func EffectiveWorkingDirectory

func EffectiveWorkingDirectory(nodeDir, stepDir string) string

EffectiveWorkingDirectory returns the per-step directory when set, otherwise the node working directory. Each broker command starts a new shell, so steps must cd even when they do not set a per-step directory.

func EnvironmentFromConfigurationField added in v0.30.0

func EnvironmentFromConfigurationField() configuration.Field

func FactoryGitWrapperScript

func FactoryGitWrapperScript() string

FactoryGitWrapperScript shadows git on factory agent tasks. Commit and merge keep the caller's hook directory and replace only prepare-commit-msg. A disabled hooks path skips repository hooks. The identity hook still runs.

func FactoryPrepareCommitMessageHook

func FactoryPrepareCommitMessageHook() string

FactoryPrepareCommitMessageHook drops other agent trailers from the trailer block and keeps one SuperPlane Agent sign-off. A quoted trailer line in the body stays. Human sign-offs, human co-authors, and the agent co-author stay.

func FactoryRepoCommitSetup

func FactoryRepoCommitSetup() string

FactoryRepoCommitSetup runs after clone, inside the repository. It sets the local identity and installs the trailer hook so a later factory reset cannot restore the old hook.

func FollowUpLoopCommand

func FollowUpLoopCommand(model, thinking string) string

func FollowUpLoopScript

func FollowUpLoopScript() string

FollowUpLoopScript waits on SuperPlane for the next user message and reruns run.js --continue (or the runner's equivalent) for each one.

func FormatAgentPrompt

func FormatAgentPrompt(prompt, usage string, attachments []TaskAttachment, inspectImages bool) string

func FormatInspectAttachmentInstruction

func FormatInspectAttachmentInstruction(paths []string) string

func FundingSourceForCredentials

func FundingSourceForCredentials(source string) string

func HandleBrokerWebhook added in v0.30.0

func HandleBrokerWebhook(ctx core.WebhookRequestContext, finishedEventType string) (int, *core.WebhookResponseBody, error)

func HasArtifactUploadToken

func HasArtifactUploadToken(environment []BrokerEnvironmentVariable) bool

func HasMergeConfidenceToken

func HasMergeConfidenceToken(environment []BrokerEnvironmentVariable) bool

func HasPlanningSessionToken

func HasPlanningSessionToken(environment []BrokerEnvironmentVariable) bool

func HasVideoAttachment

func HasVideoAttachment(attachments []TaskAttachment) bool

func HostedVideoMaxBytes

func HostedVideoMaxBytes() int64

func HostedVideoMaxDurationSeconds

func HostedVideoMaxDurationSeconds() int

func InstallWorkspaceSkillFilesCommand

func InstallWorkspaceSkillFilesCommand() string

InstallWorkspaceSkillFilesCommand copies attached SKILL.md files from the task dir into the current working directory. A skill directory that already exists in the project is left unchanged so workspace skills cannot replace or later commit over project-owned instructions.

func IntPtr added in v0.30.0

func IntPtr(v int) *int

func IsHostedCredentials

func IsHostedCredentials(source string) bool

func IsRunnerComponent added in v0.28.0

func IsRunnerComponent(name string) bool

func LiveLogFirstLine

func LiveLogFirstLine(text string) string

LiveLogFirstLine returns the first non-empty line of text, for compact contexts (the runner live-log dialog header, CLI logs) that must stay single-line.

func LiveLogStreamURL added in v0.23.0

func LiveLogStreamURL(brokerTaskID string) (string, error)

func LiveLogText

func LiveLogText(text string) string

LiveLogText returns the full user-facing command or prompt text, with interior newlines preserved and leading/trailing blank lines trimmed. The Automations tab renders this as the step title, wrapped and with newlines preserved, so callers that need a one-line label should use LiveLogFirstLine instead.

func LocalAttachmentPath

func LocalAttachmentPath(dest string) string

func MachineTypeField

func MachineTypeField(name string) configuration.Field

func MergeCheckID

func MergeCheckID(prompt string) string

MergeCheckID reads the check id from a step prompt. An empty string means the step is not a check.

func MergeConfidenceChecksFromSteps

func MergeConfidenceChecksFromSteps(steps []AgentStep) ([]string, map[string]string)

MergeConfidenceChecksFromSteps reads one check from each step that starts with a Merge check line. When no step has that line, it reads the older Enabled checks line and returns no labels.

func MergeConfidenceMCPScript

func MergeConfidenceMCPScript() string

func MintArtifactUploadToken

func MintArtifactUploadToken(signer *jwt.Signer, scope ArtifactUploadScope, ttl time.Duration) (string, error)

func MintLiveLogStreamToken added in v0.23.0

func MintLiveLogStreamToken(brokerTaskID string, now time.Time) (string, time.Time, error)

func MintMergeConfidenceToken

func MintMergeConfidenceToken(signer *jwt.Signer, scope MergeConfidenceScope, ttl time.Duration) (string, error)

func MintPlanningSessionToken

func MintPlanningSessionToken(signer *jwt.Signer, scope PlanningSessionScope, ttl time.Duration) (string, error)

func NewSpecDecoder added in v0.30.0

func NewSpecDecoder(result any) (*mapstructure.Decoder, error)

func NodePrepareScript

func NodePrepareScript(cliName, cliMissingMessage string, workdir string) string

func NormalizeAgentStepType

func NormalizeAgentStepType(stepType string) string

func NormalizeDispatchThinkingLevel

func NormalizeDispatchThinkingLevel(value string) (string, error)

func NormalizeThinkingLevel

func NormalizeThinkingLevel(value string) (string, error)

func OriginLabelsForTask

func OriginLabelsForTask(ctx core.ExecutionContext) map[string]string

OriginLabelsForTask are optional labels for task-broker metrics / Dash0 alerts.

func OverlayThinkingLevel

func OverlayThinkingLevel(agentValue, dispatchValue string) (string, bool)

func ParseMergeConfidenceChecks

func ParseMergeConfidenceChecks(prompts []string) []string

ParseMergeConfidenceChecks reads the enabled-checks line from agent prompts. A missing line or "none" enables nothing.

func ParseRunnerLLMUsage

func ParseRunnerLLMUsage(provider string, configuration any, result json.RawMessage) (core.UsageRecord, bool)

func PlanningSessionMCPConfigJSON

func PlanningSessionMCPConfigJSON() string

PlanningSessionMCPConfigJSON is the static mcp.json reference config.

func PlanningSessionMCPScript

func PlanningSessionMCPScript() string

PlanningSessionMCPScript is the stdio MCP server exposing task-refinement tools. Runners that speak MCP (Claude, Codex, OpenCode) ship it under SUPERPLANE_TASK_DIR as planning_session_mcp.js.

func PlanningSessionProtocolMarkdown

func PlanningSessionProtocolMarkdown() string

PlanningSessionProtocolMarkdown returns the hardcoded refinement system protocol. Runners append this. The canvas prompt must not replace it.

func PlanningSessionUserPromptMarkdown

func PlanningSessionUserPromptMarkdown() string

PlanningSessionUserPromptMarkdown is the Refine Task prompt: tone, the 1 through 3 sub-parameters, and plan shape. Factories can edit that node prompt. A saved canvas prompt is not rewritten.

func PlanningSessionUserPromptReviewMarkdown

func PlanningSessionUserPromptReviewMarkdown() string

PlanningSessionUserPromptReviewMarkdown is the Refine Task prompt.

func PollBrokerTask added in v0.30.0

func PollBrokerTask(ctx core.ActionHookContext, finishedEventType string) error

func PrepareHostedRun

func PrepareHostedRun(ctx core.ExecutionContext, provider, model string) (core.HostedLLMAccess, error)

func ProcessBrokerTaskStatus added in v0.30.0

func ProcessBrokerTaskStatus(state core.ExecutionStateContext, task *Task, finishedEventType, organizationID string) error

func PromptNodeCommand

func PromptNodeCommand(promptName, model, thinking string) string

func PublicSuperplaneBaseURL

func PublicSuperplaneBaseURL(fallback string) string

func RecordRunnerComputeUsage

func RecordRunnerComputeUsage(
	usage core.UsageRecorder,
	logger *log.Entry,
	state core.ExecutionStateContext,
	configuration any,
	task *Task,
)

func RecordRunnerLLMUsage

func RecordRunnerLLMUsage(usage core.UsageRecorder, logger *log.Entry, finishedEventType string, configuration any, result json.RawMessage)

func RegisterRunnerComponent added in v0.30.0

func RegisterRunnerComponent(name string)

RegisterRunnerComponent marks a runner subpackage component as eligible for live logs.

func RejectHostedCredentials

func RejectHostedCredentials(credentials AgentCredentials) error

func RevokeOpenRouterChildKey

func RevokeOpenRouterChildKey(httpCtx core.HTTPContext, state core.ExecutionStateContext, hosted core.HostedLLMContext, logger *logrus.Entry)

func RewriteLoopbackTaskFileURLs

func RewriteLoopbackTaskFileURLs(text string, files []storedfiles.DispatchFile) (string, []storedfiles.DispatchFile)

RewriteLoopbackTaskFileURLs points localhost file URLs at the origin a local runner container can reach. A remote broker leaves every URL as minted. A public host, including object storage, stays unchanged.

func RewritePromptLocalAttachmentPaths

func RewritePromptLocalAttachmentPaths(prompt string, attachments []TaskAttachment) string

func RunnerSuperplaneBaseURL

func RunnerSuperplaneBaseURL(fallback string) string

RunnerSuperplaneBaseURL is the SuperPlane origin the runner process can reach. A local Docker broker talks to the compose app on the host, even when BASE_URL is a public tunnel for GitHub.

func ShellSingleQuote

func ShellSingleQuote(value string) string

func SuperPlaneAgentModelField

func SuperPlaneAgentModelField() configuration.Field

func TaskArtifactMCPScript

func TaskArtifactMCPScript() string

func TaskBackendFromExecutionMetadata

func TaskBackendFromExecutionMetadata(meta map[string]any) string

func ValidateAgentCredentials

func ValidateAgentCredentials(credentials AgentCredentials, integrationRequired bool) error

func ValidateAgentSteps

func ValidateAgentSteps(steps []AgentStep) error

func ValidateEnvironment added in v0.30.0

func ValidateEnvironment(environment []EnvironmentVariable) error

func ValidateEnvironmentFrom added in v0.30.0

func ValidateEnvironmentFrom(environmentFrom []EnvironmentFromEntry) error

func ValidateLiveLogStreamToken added in v0.23.0

func ValidateLiveLogStreamToken(tokenString, brokerTaskID, secret string) error

ValidateLiveLogStreamToken validates a browser stream token and ensures it matches the requested task.

func ValidateReservedEnvironmentName

func ValidateReservedEnvironmentName(environment []EnvironmentVariable, reserved string) error

func ValidateReservedEnvironmentNames

func ValidateReservedEnvironmentNames(environment []EnvironmentVariable, reserved ...string) error

func WithTaskBinOnPath

func WithTaskBinOnPath(command string) string

func WorkspaceContextRepoDirectory

func WorkspaceContextRepoDirectory(repository string) string

func WorkspaceContextRepoURL

func WorkspaceContextRepoURL(provider, repository string) string

func WrapAgentStepCommand

func WrapAgentStepCommand(command string) string

WrapAgentStepCommand runs command, then merges accumulated LLM usage into SUPERPLANE_RESULT_FILE even when command exits non-zero.

func WrapCommandInWorkingDirectory

func WrapCommandInWorkingDirectory(dir, command string) string

WrapCommandInWorkingDirectory prefixes command so it runs in dir. Relative dirs are resolved from the task launch directory recorded in prepare.sh, so a later `cd` in another step cannot nest or miss the clone.

func WrapPromptCommandInWorkingDirectory

func WrapPromptCommandInWorkingDirectory(dir, command string) string

WrapPromptCommandInWorkingDirectory cds into dir, then copies workspace skills into that directory before it runs the prompt command. Claude, Codex, and OpenCode load SKILL.md from the working directory, not from the task dir.

Types

type ActiveTask added in v0.22.0

type ActiveTask struct {
	ID                      string     `json:"id"`
	Status                  string     `json:"status"`
	FleetID                 string     `json:"fleet_id"`
	CreatedAt               time.Time  `json:"created_at"`
	ClaimedAt               *time.Time `json:"claimed_at,omitempty"`
	LeaseUntil              *time.Time `json:"lease_until,omitempty"`
	RunnerID                string     `json:"runner_id,omitempty"`
	ExecutionMode           string     `json:"execution_mode,omitempty"`
	DockerImage             string     `json:"docker_image,omitempty"`
	CancelRequested         bool       `json:"cancel_requested,omitempty"`
	ExecutionTimeoutSeconds *int       `json:"execution_timeout_seconds,omitempty"`
}

ActiveTask is a non-terminal task from GET /v1/tasks on the task broker.

type AgentBrokerTaskInput

type AgentBrokerTaskInput struct {
	PrepareName      string
	PrepareScript    string
	RunScriptName    string
	RunScript        string
	WorkingDirectory string
	Steps            []AgentStep
	// DispatchedSteps, when set to the same length as Steps, supply minted
	// prompt/command text for task files and attachment fetches. Preview
	// text stays on Steps.
	DispatchedSteps []AgentStep
	Usage           string
	Setups          []IntegrationSetup
	Model           string
	PromptCommand   AgentPromptCommand
	Attachments     []TaskAttachment
	InspectImages   bool
}

type AgentCredentials

type AgentCredentials struct {
	Source      string                       `mapstructure:"source"`
	Secret      configuration.SecretKeyRef   `mapstructure:"secret"`
	Integration configuration.IntegrationRef `mapstructure:"integration"`
}

type AgentCredentialsOptions

type AgentCredentialsOptions struct {
	SecretLabel      string
	IntegrationName  string
	IntegrationLabel string
}

type AgentPromptCommand

type AgentPromptCommand func(promptName, model string) string

type AgentStep

type AgentStep struct {
	Name             string  `mapstructure:"name"`
	Type             string  `mapstructure:"type"`
	Prompt           *string `mapstructure:"prompt,omitempty"`
	Command          *string `mapstructure:"command,omitempty"`
	WorkingDirectory string  `mapstructure:"workingDirectory,omitempty"`
}

AgentStep is one ordered bash or prompt action for a fleet-runner agent node.

func AgentStepForDispatch

func AgentStepForDispatch(original, dispatched []AgentStep, i int) AgentStep

func AgentStepsForDispatch

func AgentStepsForDispatch(original, dispatched []AgentStep) []AgentStep

func AppendFactoryImaginedLimitPrompt

func AppendFactoryImaginedLimitPrompt(ctx core.ExecutionContext, steps []AgentStep) []AgentStep

AppendFactoryImaginedLimitPrompt returns a copy of steps with FactoryImaginedLimitPrompt added to each prompt step. A canvas that is not a factory app, and a planning session, are left unchanged. The original steps remain suitable for live-log previews and saved prompts.

func AppendVisualEvidenceProtocol

func AppendVisualEvidenceProtocol(steps []AgentStep, enabled bool) []AgentStep

AppendVisualEvidenceProtocol returns a copy of steps with the protocol added to the first prompt step. The original steps remain suitable for live-log previews and configuration displays.

func MintAgentStepFileRefs

func MintAgentStepFileRefs(steps []AgentStep, rewrite func(string) (string, error)) ([]AgentStep, error)

func MintStepsForRun

func MintStepsForRun(exec core.ExecutionContext, timeoutSeconds int, steps []AgentStep) ([]AgentStep, error)

type ArtifactRunContext

type ArtifactRunContext struct {
	OrganizationID uuid.UUID
	FactoryID      uuid.UUID
	WorkOrderID    uuid.UUID
	CanvasID       uuid.UUID
	LineExecution  *models.FactoryWorkOrderExecution
}

func ResolveArtifactRunContext

func ResolveArtifactRunContext(tx *gorm.DB, runID uuid.UUID) (*ArtifactRunContext, error)

ResolveArtifactRunContext accepts factory line runs, registered PR discussion runs, and Verify visual evidence runs. Other factory canvases do not receive artifact access.

type ArtifactUploadScope

type ArtifactUploadScope struct {
	OrganizationID  uuid.UUID
	FactoryID       uuid.UUID
	WorkOrderID     uuid.UUID
	CanvasID        uuid.UUID
	CanvasRunID     uuid.UUID
	NodeExecutionID uuid.UUID
	NodeID          string
}

func ParseArtifactUploadToken

func ParseArtifactUploadToken(signer *jwt.Signer, token string) (*ArtifactUploadScope, error)

type AttachmentManifest

type AttachmentManifest struct {
	Version int                      `json:"version"`
	Policy  AttachmentPolicy         `json:"policy"`
	Files   []AttachmentManifestFile `json:"files"`
}

func NewAttachmentManifest

func NewAttachmentManifest(attachments []TaskAttachment) AttachmentManifest

type AttachmentManifestFile

type AttachmentManifestFile struct {
	ID          string `json:"id,omitempty"`
	Filename    string `json:"filename"`
	ContentType string `json:"content_type,omitempty"`
	SizeBytes   int64  `json:"size_bytes,omitempty"`
	Checksum    string `json:"checksum,omitempty"`
	URL         string `json:"url"`
	Dest        string `json:"dest"`
	Kind        string `json:"kind,omitempty"`
	Status      string `json:"status,omitempty"`
}

type AttachmentPolicy

type AttachmentPolicy struct {
	MaxDurationSeconds             int   `json:"max_duration_seconds"`
	HostedVideoMaxDurationSeconds  int   `json:"hosted_video_max_duration_seconds"`
	HostedVideoMaxBytes            int64 `json:"hosted_video_max_bytes"`
	HostedVideoDownloadTimeoutSecs int   `json:"hosted_video_download_timeout_seconds"`
	MaxFrames                      int   `json:"max_frames"`
	MaxFrameWidth                  int   `json:"max_frame_width"`
	MaxFrameHeight                 int   `json:"max_frame_height"`
	MaxSourcePixels                int   `json:"max_source_pixels"`
	ProcessTimeoutSeconds          int   `json:"process_timeout_seconds"`
	DiskBudgetBytes                int64 `json:"disk_budget_bytes"`
}

func DefaultAttachmentPolicy

func DefaultAttachmentPolicy() AttachmentPolicy

type BrokerClient

type BrokerClient struct {
	// contains filtered or unexported fields
}

func NewBrokerClient

func NewBrokerClient(httpClient core.HTTPContext) (*BrokerClient, error)

func (*BrokerClient) CancelTask added in v0.22.0

func (b *BrokerClient) CancelTask(brokerTaskID string) error

func (*BrokerClient) CreateTask

func (b *BrokerClient) CreateTask(p CreateTaskParams) (string, error)

func (*BrokerClient) FetchTaskStatus

func (b *BrokerClient) FetchTaskStatus(taskID string) (*Task, error)

func (*BrokerClient) ListActiveTasks added in v0.22.0

func (b *BrokerClient) ListActiveTasks() ([]ActiveTask, error)

func (*BrokerClient) ProcessWebhook

func (b *BrokerClient) ProcessWebhook(body []byte) (*Task, error)

type BrokerCommand added in v0.30.0

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

BrokerCommand is one command_list entry sent as {"name","command"} (name optional). Kind and Preview are optional live-log labels. Unmarshal still accepts legacy plain strings for tests/fixtures.

func AttachmentFetchCommand

func AttachmentFetchCommand(attachments []TaskAttachment) *BrokerCommand

func BrokerCommandsFromLines added in v0.30.0

func BrokerCommandsFromLines(lines []string) []BrokerCommand

BrokerCommandsFromLines adapts plain shell lines into unnamed broker commands.

func VideoAttachmentCommand

func VideoAttachmentCommand() BrokerCommand

func VideoAttachmentCommands

func VideoAttachmentCommands() []BrokerCommand

func (*BrokerCommand) UnmarshalJSON added in v0.30.0

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

type BrokerEnvironmentVariable

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

BrokerEnvironmentVariable is forwarded to the task broker as JSON.

func AttachArtifactUploadEnv

func AttachArtifactUploadEnv(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, timeoutSeconds int, enabled bool) []BrokerEnvironmentVariable

func AttachExecutionTimeoutEnv

func AttachExecutionTimeoutEnv(environment []BrokerEnvironmentVariable, timeoutSeconds int) []BrokerEnvironmentVariable

AttachExecutionTimeoutEnv copies the node timeout into the task environment so agent wrappers can cap waits before the broker kills the task.

func AttachMergeConfidenceEnv

func AttachMergeConfidenceEnv(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, steps []AgentStep, timeoutSeconds int) ([]BrokerEnvironmentVariable, error)

AttachMergeConfidenceEnv mints a runner token when the node carries a work order id. Other agent runs are unchanged. The work order id is removed from the task environment after the token is minted.

func AttachPlanningSessionEnv

func AttachPlanningSessionEnv(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, timeoutSeconds int) []BrokerEnvironmentVariable

func InjectHostedAPIKey

func InjectHostedAPIKey(environment []BrokerEnvironmentVariable, envName, apiKey string, extra ...BrokerEnvironmentVariable) []BrokerEnvironmentVariable

func InjectHostedCredentials

func InjectHostedCredentials(environment []BrokerEnvironmentVariable, apiKeyEnv, apiKey, baseURLEnv, baseURL string) []BrokerEnvironmentVariable

type BrokerTaskFile added in v0.30.0

type BrokerTaskFile struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Mode    string `json:"mode,omitempty"`
}

BrokerTaskFile is materialized under SUPERPLANE_TASK_DIR before execution.

func ActivityStreamTaskFile

func ActivityStreamTaskFile() BrokerTaskFile

func AppendAttachmentLimitFile

func AppendAttachmentLimitFile(files []BrokerTaskFile) []BrokerTaskFile

func AppendAttachmentSetupFiles

func AppendAttachmentSetupFiles(files []BrokerTaskFile) []BrokerTaskFile

func AppendMergeConfidenceMCP

func AppendMergeConfidenceMCP(environment []BrokerEnvironmentVariable, files []BrokerTaskFile) []BrokerTaskFile

func AppendPlanningSessionContinuation

func AppendPlanningSessionContinuation(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, files []BrokerTaskFile) []BrokerTaskFile

func AppendPlanningSessionMCPFiles

func AppendPlanningSessionMCPFiles(files []BrokerTaskFile) []BrokerTaskFile

func AppendTaskArtifactMCP

func AppendTaskArtifactMCP(environment []BrokerEnvironmentVariable, files []BrokerTaskFile) []BrokerTaskFile

func AttachmentLimitFile

func AttachmentLimitFile() BrokerTaskFile

func AttachmentSetupFiles

func AttachmentSetupFiles() []BrokerTaskFile

func FollowUpLoopFile

func FollowUpLoopFile() BrokerTaskFile

FollowUpLoopFile returns the shared wait-loop task file. Only attach this when HasPlanningSessionToken is true.

func LLMUsageTaskFile

func LLMUsageTaskFile() BrokerTaskFile

func MergeConfidenceMCPFile

func MergeConfidenceMCPFile() BrokerTaskFile

func PlanningSessionContinuationFile

func PlanningSessionContinuationFile(ctx core.ExecutionContext) *BrokerTaskFile

func PlanningSessionMCPConfigFile

func PlanningSessionMCPConfigFile() BrokerTaskFile

PlanningSessionMCPConfigFile is the static mcp.json reference config file.

func PlanningSessionMCPFiles

func PlanningSessionMCPFiles() []BrokerTaskFile

PlanningSessionMCPFiles returns the MCP server, attachment limit, static config, and analysis protocol task files. Only attach these when HasPlanningSessionToken is true.

func PlanningSessionMCPScriptFile

func PlanningSessionMCPScriptFile() BrokerTaskFile

PlanningSessionMCPScriptFile is just the MCP server task file. Attach it together with PlanningSessionMCPConfigFile for runners that speak MCP.

func PlanningSessionProtocolFile

func PlanningSessionProtocolFile() BrokerTaskFile

func PlanningSessionProtocolMarkdownFile

func PlanningSessionProtocolMarkdownFile() BrokerTaskFile

PlanningSessionProtocolMarkdownFile ships the review protocol to runners.

func PlanningSessionReviewProtocolMarkdownFile

func PlanningSessionReviewProtocolMarkdownFile() BrokerTaskFile

func TaskArtifactMCPFile

func TaskArtifactMCPFile() BrokerTaskFile

func TurnTelemetryTaskFile

func TurnTelemetryTaskFile() BrokerTaskFile

type CreateTaskParams

type CreateTaskParams struct {
	MachineType             string
	RunMode                 string
	Script                  string
	MessageChain            json.RawMessage
	Commands                []BrokerCommand
	SetupCommands           []string
	WebhookURL              string
	WebhookPayloadSizeLimit int
	Environment             []BrokerEnvironmentVariable
	Files                   []BrokerTaskFile
	ExecutionMode           string
	DockerImage             string
	TimeoutSeconds          int // 0 = DefaultExecutionTimeoutSeconds
	Labels                  map[string]string
}

CreateTaskParams is forwarded to the task broker POST /v1/tasks.

type EnvironmentFromEntry added in v0.30.0

type EnvironmentFromEntry struct {
	Source      string                       `json:"source" mapstructure:"source"`
	Integration configuration.IntegrationRef `json:"integration,omitempty" mapstructure:"integration"`
	Secret      configuration.SecretRef      `json:"secret,omitempty" mapstructure:"secret"`
}

type EnvironmentVariable

type EnvironmentVariable struct {
	Name        string                     `json:"name" mapstructure:"name"`
	ValueSource string                     `json:"valueSource" mapstructure:"valueSource"`
	Value       *string                    `json:"value,omitempty" mapstructure:"value"`
	Secret      configuration.SecretKeyRef `json:"secret,omitempty" mapstructure:"secret"`
}

EnvironmentVariable is one row in the Runner "Environment variables" list.

type HostedUsagePricing

type HostedUsagePricing struct {
	Rate      pricebook.Rate `json:"rate"`
	MarkupBPS int            `json:"markup_bps"`
}

HostedUsagePricing prices live display usage without writing a billing event.

func ResolveHostedUsagePricing

func ResolveHostedUsagePricing(tx *gorm.DB, orgID uuid.UUID, component string, configuration map[string]any) (*HostedUsagePricing, error)

ResolveHostedUsagePricing returns display pricing for a hosted execution.

type HostedVideo

type HostedVideo struct {
	ProviderID   string
	ProviderName string
	ID           string
	PageURL      string
}

func ParseHostedVideoURL

func ParseHostedVideoURL(raw string) (HostedVideo, bool)

type IntegrationSetup

type IntegrationSetup struct {
	Name   string
	Script string
}

type LiveLogAccessContext added in v0.23.0

type LiveLogAccessContext struct {
	BrokerTaskID  string
	TaskBackend   string
	ComponentName string
	Configuration map[string]any
}

LiveLogAccessContext is the resolved runner execution context for live log access.

func ResolveLiveLogAccess added in v0.23.0

func ResolveLiveLogAccess(orgID uuid.UUID, canvasID uuid.UUID, executionID uuid.UUID) (*LiveLogAccessContext, error)

type LiveLogFetchOptions added in v0.28.0

type LiveLogFetchOptions struct {
	Limit       int
	HTTPClient  *http.Client
	Now         time.Time
	IdleTimeout time.Duration
}

type LiveLogFetchResult added in v0.28.0

type LiveLogFetchResult struct {
	Records   []LiveLogRecord
	Truncated bool
}

func FetchLiveLogRecords added in v0.28.0

func FetchLiveLogRecords(ctx context.Context, brokerTaskID string, opts LiveLogFetchOptions) (*LiveLogFetchResult, error)

func FetchLiveLogSessionRecords added in v0.28.0

func FetchLiveLogSessionRecords(ctx context.Context, session LiveLogSession, opts LiveLogFetchOptions) (*LiveLogFetchResult, error)

type LiveLogRecord added in v0.28.0

type LiveLogRecord struct {
	Type       string `json:"type,omitempty"`
	ID         string `json:"id,omitempty"`
	Text       string `json:"text,omitempty"`
	Kind       string `json:"kind,omitempty"`
	Preview    string `json:"preview,omitempty"`
	Message    string `json:"message,omitempty"`
	Index      *int   `json:"index,omitempty"`
	Turn       *int   `json:"turn,omitempty"`
	Status     string `json:"status,omitempty"`
	DurationMS *int64 `json:"duration_ms,omitempty"`
	StartedAt  *int64 `json:"started_at,omitempty"`
}

type LiveLogSession added in v0.23.0

type LiveLogSession struct {
	Backend       string              `json:"backend"`
	StreamURL     string              `json:"stream_url"`
	Token         string              `json:"token"`
	ExpiresAt     time.Time           `json:"expires_at"`
	HostedPricing *HostedUsagePricing `json:"hosted_pricing,omitempty"`
}

LiveLogSession is returned to the browser after SuperPlane authorizes log access.

func NewLiveLogSession added in v0.23.0

func NewLiveLogSession(brokerTaskID string, now time.Time) (*LiveLogSession, error)

type LiveLogStreamTokenClaims added in v0.23.0

type LiveLogStreamTokenClaims struct {
	TaskID  string `json:"task_id"`
	Purpose string `json:"purpose"`
	gojwt.RegisteredClaims
}

LiveLogStreamTokenClaims is the JWT payload SuperPlane mints for browser → task-broker streaming.

type MergeConfidenceScope

type MergeConfidenceScope struct {
	OrganizationID  uuid.UUID
	FactoryID       uuid.UUID
	WorkOrderID     uuid.UUID
	CanvasRunID     uuid.UUID
	NodeExecutionID uuid.UUID
	EnabledChecks   []string
	// CheckLabels maps a check id to the step name. Built-in checks use their
	// own names when this map has no entry.
	CheckLabels map[string]string
}

MergeConfidenceScope is the runner token for one merge confidence agent run. EnabledChecks is the list from the agent prompt. The server reports a check only when its name is in this list.

func ParseMergeConfidenceToken

func ParseMergeConfidenceToken(signer *jwt.Signer, token string) (*MergeConfidenceScope, error)

type MintedAgentDispatch

type MintedAgentDispatch struct {
	Steps       []AgentStep
	Attachments []TaskAttachment
}

MintAgentStepFileRefs copies steps and rewrites prompt/command text with rewrite. Preview callers keep the original steps.

func MintDispatchForRun

func MintDispatchForRun(exec core.ExecutionContext, timeoutSeconds int, steps []AgentStep) (MintedAgentDispatch, error)

type PlanningSessionScope

type PlanningSessionScope struct {
	OrganizationID uuid.UUID
	FactoryID      uuid.UUID
	SessionID      uuid.UUID
	CanvasRunID    uuid.UUID
}

func ParsePlanningSessionToken

func ParsePlanningSessionToken(signer *jwt.Signer, token string) (*PlanningSessionScope, error)

type ResolvedEnvironment

type ResolvedEnvironment struct {
	Variables []BrokerEnvironmentVariable
	Usage     string
	Setups    []IntegrationSetup
}

func ResolveEnvironment added in v0.30.0

func ResolveEnvironment(
	secrets core.SecretsContext,
	environmentFrom []EnvironmentFromEntry,
	environment []EnvironmentVariable,
) (ResolvedEnvironment, error)

type RunBash added in v0.25.1

type RunBash struct{}

func (*RunBash) Cancel added in v0.25.1

func (c *RunBash) Cancel(ctx core.ExecutionContext) error

func (*RunBash) Cleanup added in v0.25.1

func (c *RunBash) Cleanup(ctx core.SetupContext) error

func (*RunBash) Color added in v0.25.1

func (c *RunBash) Color() string

func (*RunBash) Configuration added in v0.25.1

func (c *RunBash) Configuration() []configuration.Field

func (*RunBash) Description added in v0.25.1

func (c *RunBash) Description() string

func (*RunBash) Documentation added in v0.25.1

func (c *RunBash) Documentation() string

func (*RunBash) ExampleOutput added in v0.25.1

func (c *RunBash) ExampleOutput() map[string]any

func (*RunBash) Execute added in v0.25.1

func (c *RunBash) Execute(ctx core.ExecutionContext) error

func (*RunBash) HandleHook added in v0.25.1

func (c *RunBash) HandleHook(ctx core.ActionHookContext) error

func (*RunBash) HandleWebhook added in v0.25.1

func (c *RunBash) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (*RunBash) Hooks added in v0.25.1

func (c *RunBash) Hooks() []core.Hook

func (*RunBash) Icon added in v0.25.1

func (c *RunBash) Icon() string

func (*RunBash) Label added in v0.25.1

func (c *RunBash) Label() string

func (*RunBash) Name added in v0.25.1

func (c *RunBash) Name() string

func (*RunBash) OutputChannels added in v0.25.1

func (c *RunBash) OutputChannels(configuration any) []core.OutputChannel

func (*RunBash) Setup added in v0.25.1

func (c *RunBash) Setup(ctx core.SetupContext) error

type RunBashSpec added in v0.25.1

type RunBashSpec struct {
	MachineType             string                 `mapstructure:"machine_type"`
	Script                  string                 `mapstructure:"script"`
	EnableSetupCommands     bool                   `mapstructure:"enable_setup_commands"`
	SetupCommands           string                 `mapstructure:"setup_commands"`
	EnvironmentFrom         []EnvironmentFromEntry `mapstructure:"environmentFrom"`
	Environment             []EnvironmentVariable  `mapstructure:"environment"`
	ExecutionMode           string                 `mapstructure:"execution_mode"`
	DockerImagePreset       string                 `mapstructure:"docker_image_preset"`
	DockerImage             string                 `mapstructure:"docker_image"`
	ExecutionTimeoutSeconds int                    `mapstructure:"execution_timeout_seconds"` // 0 = DefaultExecutionTimeoutSeconds
}

RunBashSpec is persisted runnerBash node configuration.

type RunJS added in v0.25.0

type RunJS struct{}

func (*RunJS) Cancel added in v0.25.0

func (c *RunJS) Cancel(ctx core.ExecutionContext) error

func (*RunJS) Cleanup added in v0.25.0

func (c *RunJS) Cleanup(ctx core.SetupContext) error

func (*RunJS) Color added in v0.25.0

func (c *RunJS) Color() string

func (*RunJS) Configuration added in v0.25.0

func (c *RunJS) Configuration() []configuration.Field

func (*RunJS) Description added in v0.25.0

func (c *RunJS) Description() string

func (*RunJS) Documentation added in v0.25.0

func (c *RunJS) Documentation() string

func (*RunJS) ExampleOutput added in v0.25.0

func (c *RunJS) ExampleOutput() map[string]any

func (*RunJS) Execute added in v0.25.0

func (c *RunJS) Execute(ctx core.ExecutionContext) error

func (*RunJS) HandleHook added in v0.25.0

func (c *RunJS) HandleHook(ctx core.ActionHookContext) error

func (*RunJS) HandleWebhook added in v0.25.0

func (c *RunJS) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (*RunJS) Hooks added in v0.25.0

func (c *RunJS) Hooks() []core.Hook

func (*RunJS) Icon added in v0.25.0

func (c *RunJS) Icon() string

func (*RunJS) Label added in v0.25.0

func (c *RunJS) Label() string

func (*RunJS) Name added in v0.25.0

func (c *RunJS) Name() string

func (*RunJS) OutputChannels added in v0.25.0

func (c *RunJS) OutputChannels(configuration any) []core.OutputChannel

func (*RunJS) Setup added in v0.25.0

func (c *RunJS) Setup(ctx core.SetupContext) error

type RunJSSpec added in v0.25.0

type RunJSSpec struct {
	MachineType             string                 `mapstructure:"machine_type"`
	Script                  string                 `mapstructure:"script"`
	EnableSetupCommands     bool                   `mapstructure:"enable_setup_commands"`
	SetupCommands           string                 `mapstructure:"setup_commands"`
	EnvironmentFrom         []EnvironmentFromEntry `mapstructure:"environmentFrom"`
	Environment             []EnvironmentVariable  `mapstructure:"environment"`
	ExecutionMode           string                 `mapstructure:"execution_mode"`
	DockerImagePreset       string                 `mapstructure:"docker_image_preset"`
	DockerImage             string                 `mapstructure:"docker_image"`
	ExecutionTimeoutSeconds int                    `mapstructure:"execution_timeout_seconds"` // 0 = DefaultExecutionTimeoutSeconds
}

RunJSSpec is persisted runnerJS node configuration.

type RunPython added in v0.25.0

type RunPython struct{}

func (*RunPython) Cancel added in v0.25.0

func (c *RunPython) Cancel(ctx core.ExecutionContext) error

func (*RunPython) Cleanup added in v0.25.0

func (c *RunPython) Cleanup(ctx core.SetupContext) error

func (*RunPython) Color added in v0.25.0

func (c *RunPython) Color() string

func (*RunPython) Configuration added in v0.25.0

func (c *RunPython) Configuration() []configuration.Field

func (*RunPython) Description added in v0.25.0

func (c *RunPython) Description() string

func (*RunPython) Documentation added in v0.25.0

func (c *RunPython) Documentation() string

func (*RunPython) ExampleOutput added in v0.25.0

func (c *RunPython) ExampleOutput() map[string]any

func (*RunPython) Execute added in v0.25.0

func (c *RunPython) Execute(ctx core.ExecutionContext) error

func (*RunPython) HandleHook added in v0.25.0

func (c *RunPython) HandleHook(ctx core.ActionHookContext) error

func (*RunPython) HandleWebhook added in v0.25.0

func (*RunPython) Hooks added in v0.25.0

func (c *RunPython) Hooks() []core.Hook

func (*RunPython) Icon added in v0.25.0

func (c *RunPython) Icon() string

func (*RunPython) Label added in v0.25.0

func (c *RunPython) Label() string

func (*RunPython) Name added in v0.25.0

func (c *RunPython) Name() string

func (*RunPython) OutputChannels added in v0.25.0

func (c *RunPython) OutputChannels(configuration any) []core.OutputChannel

func (*RunPython) Setup added in v0.25.0

func (c *RunPython) Setup(ctx core.SetupContext) error

type RunPythonSpec added in v0.25.0

type RunPythonSpec struct {
	MachineType             string                 `mapstructure:"machine_type"`
	Script                  string                 `mapstructure:"script"`
	EnableSetupCommands     bool                   `mapstructure:"enable_setup_commands"`
	SetupCommands           string                 `mapstructure:"setup_commands"`
	EnvironmentFrom         []EnvironmentFromEntry `mapstructure:"environmentFrom"`
	Environment             []EnvironmentVariable  `mapstructure:"environment"`
	ExecutionMode           string                 `mapstructure:"execution_mode"`
	DockerImagePreset       string                 `mapstructure:"docker_image_preset"`
	DockerImage             string                 `mapstructure:"docker_image"`
	ExecutionTimeoutSeconds int                    `mapstructure:"execution_timeout_seconds"` // 0 = DefaultExecutionTimeoutSeconds
}

RunPythonSpec is persisted runnerPython node configuration.

type Runner

type Runner struct{}

func (*Runner) Cancel

func (c *Runner) Cancel(ctx core.ExecutionContext) error

func (*Runner) Cleanup

func (c *Runner) Cleanup(ctx core.SetupContext) error

func (*Runner) Color

func (c *Runner) Color() string

func (*Runner) Configuration

func (c *Runner) Configuration() []configuration.Field

func (*Runner) Description

func (c *Runner) Description() string

func (*Runner) Documentation

func (c *Runner) Documentation() string

func (*Runner) ExampleOutput

func (c *Runner) ExampleOutput() map[string]any

func (*Runner) Execute

func (c *Runner) Execute(ctx core.ExecutionContext) error

func (*Runner) HandleHook

func (c *Runner) HandleHook(ctx core.ActionHookContext) error

func (*Runner) HandleWebhook

func (c *Runner) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (*Runner) Hooks

func (c *Runner) Hooks() []core.Hook

func (*Runner) Icon

func (c *Runner) Icon() string

func (*Runner) Label

func (c *Runner) Label() string

func (*Runner) Name

func (c *Runner) Name() string

func (*Runner) OutputChannels

func (c *Runner) OutputChannels(configuration any) []core.OutputChannel

func (*Runner) Setup

func (c *Runner) Setup(ctx core.SetupContext) error

type Spec

type Spec struct {
	MachineType             string                 `mapstructure:"machine_type"`
	Commands                string                 `mapstructure:"commands"`
	EnvironmentFrom         []EnvironmentFromEntry `mapstructure:"environmentFrom"`
	Environment             []EnvironmentVariable  `mapstructure:"environment"`
	ExecutionMode           string                 `mapstructure:"execution_mode"`
	DockerImagePreset       string                 `mapstructure:"docker_image_preset"`
	DockerImage             string                 `mapstructure:"docker_image"`
	ExecutionTimeoutSeconds int                    `mapstructure:"execution_timeout_seconds"` // 0 = DefaultExecutionTimeoutSeconds
}

Spec is persisted Runner node configuration.

type SystemSkillTemplate

type SystemSkillTemplate struct {
	ID           string
	Version      int32
	Title        string
	Description  string
	Instructions string
}

SystemSkillTemplate is the current SuperPlane definition of a workspace skill. Increment Version when changing its instructions or frontmatter.

func SystemSkillTemplateByID

func SystemSkillTemplateByID(id string) (SystemSkillTemplate, bool)

SystemSkillTemplateByID shares the existing default instructions with restores. Installation of these templates during onboarding is a separate step.

func (SystemSkillTemplate) Markdown

func (t SystemSkillTemplate) Markdown(commandName string) string

Markdown retains the installed command name when restoring a template.

type Task

type Task struct {
	TaskID   string          `json:"task_id"`
	ID       string          `json:"id"` // GET status uses "id"; webhook uses "task_id"
	Status   string          `json:"status"`
	ExitCode *int            `json:"exit_code,omitempty"`
	Output   string          `json:"output,omitempty"`
	Error    string          `json:"error,omitempty"`
	Result   json.RawMessage `json:"result,omitempty"`

	ClaimedAt  *time.Time `json:"claimed_at,omitempty"`
	FinishedAt *time.Time `json:"finished_at,omitempty"`

	TaskLog *TaskLogSink `json:"task_log,omitempty"`

	CloudWatchLogGroup  string `json:"cloudwatch_log_group,omitempty"`
	CloudWatchLogStream string `json:"cloudwatch_log_stream,omitempty"`
}

Task is the broker task payload (GET /v1/tasks/:id and webhook body).

func (*Task) IsInTerminalState

func (t *Task) IsInTerminalState() bool

type TaskAttachment

type TaskAttachment struct {
	ID          string
	URL         string
	Filename    string
	ContentType string
	SizeBytes   int64
	Checksum    string
	Kind        string
}

func CollectTaskAttachments

func CollectTaskAttachments(texts ...string) []TaskAttachment

func CollectTaskAttachmentsFromSteps

func CollectTaskAttachmentsFromSteps(steps []AgentStep) []TaskAttachment

func HostedVideoAttachments

func HostedVideoAttachments(texts ...string) []TaskAttachment

func ResolveTaskAttachments

func ResolveTaskAttachments(input AgentBrokerTaskInput) []TaskAttachment

func TaskAttachmentsFromDispatch

func TaskAttachmentsFromDispatch(files []storedfiles.DispatchFile) []TaskAttachment

func (TaskAttachment) RunnerFile

func (a TaskAttachment) RunnerFile() map[string]any

type TaskClient

type TaskClient interface {
	CreateTask(CreateTaskParams) (string, error)
	FetchTaskStatus(string) (*Task, error)
	CancelTask(string) error
}

func NewTaskClient

func NewTaskClient(
	httpClient core.HTTPContext,
	runnerTasks core.RunnerTaskContext,
) (TaskClient, string, error)

type TaskLogSink

type TaskLogSink struct {
	Type       string `json:"type"`
	CloudWatch *struct {
		LogGroupName  string `json:"log_group_name"`
		LogStreamName string `json:"log_stream_name"`
		Region        string `json:"region,omitempty"`
	} `json:"cloudwatch,omitempty"`
}

TaskLogSink matches the task-broker / fleet-manager JSON shape for CloudWatch-backed live logs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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