Documentation
¶
Index ¶
- Constants
- Variables
- func AfterRunnerTaskCreated(ctx core.ExecutionContext, taskID, backend string) error
- func AgentCredentialsField(opts AgentCredentialsOptions) configuration.Field
- func AgentEnvironmentField(reservedEnv string) configuration.Field
- func AgentModelField(provider string) configuration.Field
- func AgentStepLabel(stepName, fallback string) string
- func AgentStepSlug(stepNumber int, name string) string
- func AgentStepsField(description, promptPlaceholder, commandPlaceholder string) configuration.Field
- func AgentTimeoutField() configuration.Field
- func AgentWorkingDirectoryField() configuration.Field
- func ApplyAttachmentInstructions(prompt string, attachments []TaskAttachment) string
- func ApplyIntegrationUsage(prompt, usage string) string
- func AttachFactoryCommitIdentity(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) ([]BrokerEnvironmentVariable, []BrokerTaskFile)
- func AttachWorkspaceAgentResources(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) ([]BrokerEnvironmentVariable, []BrokerTaskFile)
- func AttachmentManifestJSON(attachments []TaskAttachment) string
- func AttachmentSetup(attachments []TaskAttachment) (files []BrokerTaskFile, commands []BrokerCommand)
- func BrokerTaskIDFromExecutionMetadata(meta map[string]any) string
- func BuildAgentBrokerTask(input AgentBrokerTaskInput) (commands []BrokerCommand, files []BrokerTaskFile)
- func BuildIntegrationSetupCommands(setups []IntegrationSetup) (commands []BrokerCommand, files []BrokerTaskFile)
- func CancelBrokerTask(ctx core.ExecutionContext, finishedEventType string) error
- func DefaultAgentSteps() []map[string]any
- func DispatchFileRewriter(exec core.ExecutionContext, timeoutSeconds int) func(string) (string, error)
- func EffectiveWorkingDirectory(nodeDir, stepDir string) string
- func EnvironmentFromConfigurationField() configuration.Field
- func FactoryGitWrapperScript() string
- func FactoryPrepareCommitMessageHook() string
- func FactoryRepoCommitSetup() string
- func FollowUpLoopCommand(model, thinking string) string
- func FollowUpLoopScript() string
- func FormatAgentPrompt(prompt, usage string, attachments []TaskAttachment, inspectImages bool) string
- func FormatInspectAttachmentInstruction(paths []string) string
- func FundingSourceForCredentials(source string) string
- func HandleBrokerWebhook(ctx core.WebhookRequestContext, finishedEventType string) (int, *core.WebhookResponseBody, error)
- func HasArtifactUploadToken(environment []BrokerEnvironmentVariable) bool
- func HasMergeConfidenceToken(environment []BrokerEnvironmentVariable) bool
- func HasPlanningSessionToken(environment []BrokerEnvironmentVariable) bool
- func HasVideoAttachment(attachments []TaskAttachment) bool
- func HostedVideoMaxBytes() int64
- func HostedVideoMaxDurationSeconds() int
- func InstallWorkspaceSkillFilesCommand() string
- func IntPtr(v int) *int
- func IsHostedCredentials(source string) bool
- func IsRunnerComponent(name string) bool
- func LiveLogFirstLine(text string) string
- func LiveLogStreamURL(brokerTaskID string) (string, error)
- func LiveLogText(text string) string
- func LocalAttachmentPath(dest string) string
- func MachineTypeField(name string) configuration.Field
- func MergeCheckID(prompt string) string
- func MergeConfidenceChecksFromSteps(steps []AgentStep) ([]string, map[string]string)
- func MergeConfidenceMCPScript() string
- func MintArtifactUploadToken(signer *jwt.Signer, scope ArtifactUploadScope, ttl time.Duration) (string, error)
- func MintLiveLogStreamToken(brokerTaskID string, now time.Time) (string, time.Time, error)
- func MintMergeConfidenceToken(signer *jwt.Signer, scope MergeConfidenceScope, ttl time.Duration) (string, error)
- func MintPlanningSessionToken(signer *jwt.Signer, scope PlanningSessionScope, ttl time.Duration) (string, error)
- func NewSpecDecoder(result any) (*mapstructure.Decoder, error)
- func NodePrepareScript(cliName, cliMissingMessage string, workdir string) string
- func NormalizeAgentStepType(stepType string) string
- func NormalizeDispatchThinkingLevel(value string) (string, error)
- func NormalizeThinkingLevel(value string) (string, error)
- func OriginLabelsForTask(ctx core.ExecutionContext) map[string]string
- func OverlayThinkingLevel(agentValue, dispatchValue string) (string, bool)
- func ParseMergeConfidenceChecks(prompts []string) []string
- func ParseRunnerLLMUsage(provider string, configuration any, result json.RawMessage) (core.UsageRecord, bool)
- func PlanningSessionMCPConfigJSON() string
- func PlanningSessionMCPScript() string
- func PlanningSessionProtocolMarkdown() string
- func PlanningSessionUserPromptMarkdown() string
- func PlanningSessionUserPromptReviewMarkdown() string
- func PollBrokerTask(ctx core.ActionHookContext, finishedEventType string) error
- func PrepareHostedRun(ctx core.ExecutionContext, provider, model string) (core.HostedLLMAccess, error)
- func ProcessBrokerTaskStatus(state core.ExecutionStateContext, task *Task, ...) error
- func PromptNodeCommand(promptName, model, thinking string) string
- func PublicSuperplaneBaseURL(fallback string) string
- func RecordRunnerComputeUsage(usage core.UsageRecorder, logger *log.Entry, state core.ExecutionStateContext, ...)
- func RecordRunnerLLMUsage(usage core.UsageRecorder, logger *log.Entry, finishedEventType string, ...)
- func RegisterRunnerComponent(name string)
- func RejectHostedCredentials(credentials AgentCredentials) error
- func RevokeOpenRouterChildKey(httpCtx core.HTTPContext, state core.ExecutionStateContext, ...)
- func RewriteLoopbackTaskFileURLs(text string, files []storedfiles.DispatchFile) (string, []storedfiles.DispatchFile)
- func RewritePromptLocalAttachmentPaths(prompt string, attachments []TaskAttachment) string
- func RunnerSuperplaneBaseURL(fallback string) string
- func ShellSingleQuote(value string) string
- func SuperPlaneAgentModelField() configuration.Field
- func TaskArtifactMCPScript() string
- func TaskBackendFromExecutionMetadata(meta map[string]any) string
- func ValidateAgentCredentials(credentials AgentCredentials, integrationRequired bool) error
- func ValidateAgentSteps(steps []AgentStep) error
- func ValidateEnvironment(environment []EnvironmentVariable) error
- func ValidateEnvironmentFrom(environmentFrom []EnvironmentFromEntry) error
- func ValidateLiveLogStreamToken(tokenString, brokerTaskID, secret string) error
- func ValidateReservedEnvironmentName(environment []EnvironmentVariable, reserved string) error
- func ValidateReservedEnvironmentNames(environment []EnvironmentVariable, reserved ...string) error
- func WithTaskBinOnPath(command string) string
- func WorkspaceContextRepoDirectory(repository string) string
- func WorkspaceContextRepoURL(provider, repository string) string
- func WrapAgentStepCommand(command string) string
- func WrapCommandInWorkingDirectory(dir, command string) string
- func WrapPromptCommandInWorkingDirectory(dir, command string) string
- type ActiveTask
- type AgentBrokerTaskInput
- type AgentCredentials
- type AgentCredentialsOptions
- type AgentPromptCommand
- type AgentStep
- func AgentStepForDispatch(original, dispatched []AgentStep, i int) AgentStep
- func AgentStepsForDispatch(original, dispatched []AgentStep) []AgentStep
- func AppendFactoryImaginedLimitPrompt(ctx core.ExecutionContext, steps []AgentStep) []AgentStep
- func AppendVisualEvidenceProtocol(steps []AgentStep, enabled bool) []AgentStep
- func MintAgentStepFileRefs(steps []AgentStep, rewrite func(string) (string, error)) ([]AgentStep, error)
- func MintStepsForRun(exec core.ExecutionContext, timeoutSeconds int, steps []AgentStep) ([]AgentStep, error)
- type ArtifactRunContext
- type ArtifactUploadScope
- type AttachmentManifest
- type AttachmentManifestFile
- type AttachmentPolicy
- type BrokerClient
- func (b *BrokerClient) CancelTask(brokerTaskID string) error
- func (b *BrokerClient) CreateTask(p CreateTaskParams) (string, error)
- func (b *BrokerClient) FetchTaskStatus(taskID string) (*Task, error)
- func (b *BrokerClient) ListActiveTasks() ([]ActiveTask, error)
- func (b *BrokerClient) ProcessWebhook(body []byte) (*Task, error)
- type BrokerCommand
- type BrokerEnvironmentVariable
- func AttachArtifactUploadEnv(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) []BrokerEnvironmentVariable
- func AttachExecutionTimeoutEnv(environment []BrokerEnvironmentVariable, timeoutSeconds int) []BrokerEnvironmentVariable
- func AttachMergeConfidenceEnv(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) ([]BrokerEnvironmentVariable, error)
- func AttachPlanningSessionEnv(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) []BrokerEnvironmentVariable
- func InjectHostedAPIKey(environment []BrokerEnvironmentVariable, envName, apiKey string, ...) []BrokerEnvironmentVariable
- func InjectHostedCredentials(environment []BrokerEnvironmentVariable, ...) []BrokerEnvironmentVariable
- func InjectIntegrationKeys(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) ([]BrokerEnvironmentVariable, error)
- func InjectSecretAPIKey(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) ([]BrokerEnvironmentVariable, error)
- type BrokerTaskFile
- func ActivityStreamTaskFile() BrokerTaskFile
- func AppendAttachmentLimitFile(files []BrokerTaskFile) []BrokerTaskFile
- func AppendAttachmentSetupFiles(files []BrokerTaskFile) []BrokerTaskFile
- func AppendMergeConfidenceMCP(environment []BrokerEnvironmentVariable, files []BrokerTaskFile) []BrokerTaskFile
- func AppendPlanningSessionContinuation(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, ...) []BrokerTaskFile
- func AppendPlanningSessionMCPFiles(files []BrokerTaskFile) []BrokerTaskFile
- func AppendTaskArtifactMCP(environment []BrokerEnvironmentVariable, files []BrokerTaskFile) []BrokerTaskFile
- func AttachmentLimitFile() BrokerTaskFile
- func AttachmentSetupFiles() []BrokerTaskFile
- func FollowUpLoopFile() BrokerTaskFile
- func LLMUsageTaskFile() BrokerTaskFile
- func MergeConfidenceMCPFile() BrokerTaskFile
- func PlanningSessionContinuationFile(ctx core.ExecutionContext) *BrokerTaskFile
- func PlanningSessionMCPConfigFile() BrokerTaskFile
- func PlanningSessionMCPFiles() []BrokerTaskFile
- func PlanningSessionMCPScriptFile() BrokerTaskFile
- func PlanningSessionProtocolFile() BrokerTaskFile
- func PlanningSessionProtocolMarkdownFile() BrokerTaskFile
- func PlanningSessionReviewProtocolMarkdownFile() BrokerTaskFile
- func TaskArtifactMCPFile() BrokerTaskFile
- func TurnTelemetryTaskFile() BrokerTaskFile
- type CreateTaskParams
- type EnvironmentFromEntry
- type EnvironmentVariable
- type HostedUsagePricing
- type HostedVideo
- type IntegrationSetup
- type LiveLogAccessContext
- type LiveLogFetchOptions
- type LiveLogFetchResult
- type LiveLogRecord
- type LiveLogSession
- type LiveLogStreamTokenClaims
- type MergeConfidenceScope
- type MintedAgentDispatch
- type PlanningSessionScope
- type ResolvedEnvironment
- type RunBash
- func (c *RunBash) Cancel(ctx core.ExecutionContext) error
- func (c *RunBash) Cleanup(ctx core.SetupContext) error
- func (c *RunBash) Color() string
- func (c *RunBash) Configuration() []configuration.Field
- func (c *RunBash) Description() string
- func (c *RunBash) Documentation() string
- func (c *RunBash) ExampleOutput() map[string]any
- func (c *RunBash) Execute(ctx core.ExecutionContext) error
- func (c *RunBash) HandleHook(ctx core.ActionHookContext) error
- func (c *RunBash) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *RunBash) Hooks() []core.Hook
- func (c *RunBash) Icon() string
- func (c *RunBash) Label() string
- func (c *RunBash) Name() string
- func (c *RunBash) OutputChannels(configuration any) []core.OutputChannel
- func (c *RunBash) Setup(ctx core.SetupContext) error
- type RunBashSpec
- type RunJS
- func (c *RunJS) Cancel(ctx core.ExecutionContext) error
- func (c *RunJS) Cleanup(ctx core.SetupContext) error
- func (c *RunJS) Color() string
- func (c *RunJS) Configuration() []configuration.Field
- func (c *RunJS) Description() string
- func (c *RunJS) Documentation() string
- func (c *RunJS) ExampleOutput() map[string]any
- func (c *RunJS) Execute(ctx core.ExecutionContext) error
- func (c *RunJS) HandleHook(ctx core.ActionHookContext) error
- func (c *RunJS) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *RunJS) Hooks() []core.Hook
- func (c *RunJS) Icon() string
- func (c *RunJS) Label() string
- func (c *RunJS) Name() string
- func (c *RunJS) OutputChannels(configuration any) []core.OutputChannel
- func (c *RunJS) Setup(ctx core.SetupContext) error
- type RunJSSpec
- type RunPython
- func (c *RunPython) Cancel(ctx core.ExecutionContext) error
- func (c *RunPython) Cleanup(ctx core.SetupContext) error
- func (c *RunPython) Color() string
- func (c *RunPython) Configuration() []configuration.Field
- func (c *RunPython) Description() string
- func (c *RunPython) Documentation() string
- func (c *RunPython) ExampleOutput() map[string]any
- func (c *RunPython) Execute(ctx core.ExecutionContext) error
- func (c *RunPython) HandleHook(ctx core.ActionHookContext) error
- func (c *RunPython) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *RunPython) Hooks() []core.Hook
- func (c *RunPython) Icon() string
- func (c *RunPython) Label() string
- func (c *RunPython) Name() string
- func (c *RunPython) OutputChannels(configuration any) []core.OutputChannel
- func (c *RunPython) Setup(ctx core.SetupContext) error
- type RunPythonSpec
- type Runner
- func (c *Runner) Cancel(ctx core.ExecutionContext) error
- func (c *Runner) Cleanup(ctx core.SetupContext) error
- func (c *Runner) Color() string
- func (c *Runner) Configuration() []configuration.Field
- func (c *Runner) Description() string
- func (c *Runner) Documentation() string
- func (c *Runner) ExampleOutput() map[string]any
- func (c *Runner) Execute(ctx core.ExecutionContext) error
- func (c *Runner) HandleHook(ctx core.ActionHookContext) error
- func (c *Runner) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *Runner) Hooks() []core.Hook
- func (c *Runner) Icon() string
- func (c *Runner) Label() string
- func (c *Runner) Name() string
- func (c *Runner) OutputChannels(configuration any) []core.OutputChannel
- func (c *Runner) Setup(ctx core.SetupContext) error
- type Spec
- type SystemSkillTemplate
- type Task
- type TaskAttachment
- func CollectTaskAttachments(texts ...string) []TaskAttachment
- func CollectTaskAttachmentsFromSteps(steps []AgentStep) []TaskAttachment
- func HostedVideoAttachments(texts ...string) []TaskAttachment
- func ResolveTaskAttachments(input AgentBrokerTaskInput) []TaskAttachment
- func TaskAttachmentsFromDispatch(files []storedfiles.DispatchFile) []TaskAttachment
- type TaskClient
- type TaskLogSink
Constants ¶
const ( AgentStepPrompt = "prompt" AgentStepBash = "bash" CredentialsSourceSecret = "secret" CredentialsSourceIntegration = "integration" CredentialsSourceHosted = "hosted" )
const ( ArtifactUploadTokenPurpose = "runner_artifact_upload" EnvSuperplaneArtifactToken = "SUPERPLANE_ARTIFACT_TOKEN" EnvPlaywrightMCPBrowser = "PLAYWRIGHT_MCP_BROWSER" )
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" )
const ( RunModeJavaScript = "javascript_script" RunModePython = "python_script" RunModeBash = "bash_script" )
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" )
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." )
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.
const ( DefaultLiveLogRecordLimit = 200 MaxLiveLogRecordLimit = 1000 )
const ( LiveLogKindBash = "bash" LiveLogKindPrompt = "prompt" LiveLogKindSetup = "setup" LiveLogKindJavaScript = "javascript" LiveLogKindPython = "python" )
const ( LiveLogStreamTokenPurpose = "runner_live_logs" LiveLogStreamTokenAudience = "task_broker" LiveLogErrorCodeHeader = "X-Superplane-Error-Code" LiveLogSessionNotReadyErrorCode = "live_log_session_not_ready" )
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" )
const ( ExecutionMetadataBrokerTaskID = "runner_broker_task_id" ExecutionMetadataTaskLog = "runner_task_log" ExecutionMetadataTaskBackend = "runner_task_backend" )
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" )
const ( RunBashComponentName = "runnerBash" RunBashFinishedEventType = "runnerBash.finished" )
const ( PassedOutputChannel = "passed" FailedOutputChannel = core.FailedOutputChannel RunnerFinishedEventType = "runner.finished" )
const ( RunJSComponentName = "runnerJS" RunJSFinishedEventType = "runnerJS.finished" )
const ( RunPythonComponentName = "runnerPython" RunPythonFinishedEventType = "runnerPython.finished" )
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).
const ( MachineTypeFieldName = configurationFieldMachineType HookPoll = hookActionPoll MaxExecutionTimeoutSecondsRequest = maxExecutionTimeoutSecondsRequest )
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" )
const ( WorkspaceMCPConfigPath = "workspace_mcp.json" EnvSuperplaneWorkspaceMCPConfig = "SUPERPLANE_WORKSPACE_MCP_CONFIG" WorkspaceSetupConfigPath = "workspace_setup.json" WorkspaceContextConfigPath = "workspace_context.json" )
const AttachmentAgentInstructions = `` /* 250-byte string literal not displayed */
AttachmentAgentInstructions tell every agent CLI to read processed artifacts instead of original video or audio bytes.
const ComponentName = "runner"
ComponentName is the registry / canvas component key for Runner.
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.
const HostedVideoKind = "hosted_video"
const (
OpenRouterChildKeyHashKV = "openrouter_key_hash"
)
Variables ¶
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") )
var ActivityStreamScript string
var ErrArtifactRunScopeNotFound = errors.New("artifact run scope not found")
var LLMUsageScript string
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 AgentStepSlug ¶
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 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 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 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 ¶
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 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 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 IsHostedCredentials ¶
func IsRunnerComponent ¶ added in v0.28.0
func LiveLogFirstLine ¶
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 LiveLogText ¶
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 MachineTypeField ¶
func MachineTypeField(name string) configuration.Field
func MergeCheckID ¶
MergeCheckID reads the check id from a step prompt. An empty string means the step is not a check.
func MergeConfidenceChecksFromSteps ¶
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 MintLiveLogStreamToken ¶ added in v0.23.0
func NewSpecDecoder ¶ added in v0.30.0
func NewSpecDecoder(result any) (*mapstructure.Decoder, error)
func NodePrepareScript ¶
func NormalizeAgentStepType ¶
func NormalizeThinkingLevel ¶
func OriginLabelsForTask ¶
func OriginLabelsForTask(ctx core.ExecutionContext) map[string]string
OriginLabelsForTask are optional labels for task-broker metrics / Dash0 alerts.
func OverlayThinkingLevel ¶
func ParseMergeConfidenceChecks ¶
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 PublicSuperplaneBaseURL ¶
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 ¶
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 SuperPlaneAgentModelField ¶
func SuperPlaneAgentModelField() configuration.Field
func TaskArtifactMCPScript ¶
func TaskArtifactMCPScript() string
func ValidateAgentCredentials ¶
func ValidateAgentCredentials(credentials AgentCredentials, integrationRequired bool) error
func ValidateAgentSteps ¶
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
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 WorkspaceContextRepoURL ¶
func WrapAgentStepCommand ¶
WrapAgentStepCommand runs command, then merges accumulated LLM usage into SUPERPLANE_RESULT_FILE even when command exits non-zero.
func WrapCommandInWorkingDirectory ¶
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 ¶
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 AgentPromptCommand ¶
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 AgentStepsForDispatch ¶
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 ¶
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 MintStepsForRun ¶
type ArtifactRunContext ¶
type ArtifactRunContext struct {
OrganizationID uuid.UUID
FactoryID uuid.UUID
WorkOrderID uuid.UUID
CanvasID uuid.UUID
LineExecution *models.FactoryWorkOrderExecution
}
func ResolveArtifactRunContext ¶
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 ¶
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
func InjectIntegrationKeys ¶
func InjectIntegrationKeys(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, integration configuration.IntegrationRef) ([]BrokerEnvironmentVariable, error)
func InjectSecretAPIKey ¶
func InjectSecretAPIKey(ctx core.ExecutionContext, environment []BrokerEnvironmentVariable, envName string, secret configuration.SecretKeyRef) ([]BrokerEnvironmentVariable, error)
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.
type HostedVideo ¶
func ParseHostedVideoURL ¶
func ParseHostedVideoURL(raw string) (HostedVideo, bool)
type IntegrationSetup ¶
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
type LiveLogFetchOptions ¶ added in v0.28.0
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) Configuration ¶ added in v0.25.1
func (c *RunBash) Configuration() []configuration.Field
func (*RunBash) Description ¶ added in v0.25.1
func (*RunBash) Documentation ¶ added in v0.25.1
func (*RunBash) ExampleOutput ¶ added in v0.25.1
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) OutputChannels ¶ added in v0.25.1
func (c *RunBash) OutputChannels(configuration any) []core.OutputChannel
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) Configuration ¶ added in v0.25.0
func (c *RunJS) Configuration() []configuration.Field
func (*RunJS) Description ¶ added in v0.25.0
func (*RunJS) Documentation ¶ added in v0.25.0
func (*RunJS) ExampleOutput ¶ added in v0.25.0
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) OutputChannels ¶ added in v0.25.0
func (c *RunJS) OutputChannels(configuration any) []core.OutputChannel
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) Configuration ¶ added in v0.25.0
func (c *RunPython) Configuration() []configuration.Field
func (*RunPython) Description ¶ added in v0.25.0
func (*RunPython) Documentation ¶ added in v0.25.0
func (*RunPython) ExampleOutput ¶ added in v0.25.0
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 (c *RunPython) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*RunPython) OutputChannels ¶ added in v0.25.0
func (c *RunPython) OutputChannels(configuration any) []core.OutputChannel
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) Configuration ¶
func (c *Runner) Configuration() []configuration.Field
func (*Runner) Description ¶
func (*Runner) Documentation ¶
func (*Runner) ExampleOutput ¶
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) OutputChannels ¶
func (c *Runner) OutputChannels(configuration any) []core.OutputChannel
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 ¶
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.
Source Files
¶
- activity_stream.go
- agent_fields.go
- agent_steps.go
- agent_task.go
- agent_usage.go
- artifact_token.go
- attachment_manifest.go
- attachment_policy.go
- broker.go
- broker_env.go
- commands.go
- compute_usage.go
- dispatch_file_refs.go
- environment.go
- factory_commit_identity.go
- factory_imagined_limit.go
- fleets.go
- hosted.go
- hosted_video.go
- live_log_fetch.go
- live_log_labels.go
- live_log_session.go
- live_usage_pricing.go
- llm_usage.go
- merge_confidence_assets.go
- merge_confidence_token.go
- message_chain.go
- metadata.go
- openrouter_child_key.go
- origin_labels.go
- planning_session_assets.go
- planning_session_token.go
- run_bash.go
- run_bash_spec.go
- run_commands.go
- run_javascript.go
- run_js_spec.go
- run_python.go
- run_python_spec.go
- runner_file_url.go
- runner_task_lifecycle.go
- spec.go
- subcomponents.go
- system_skill_templates.go
- task_artifact_assets.go
- task_client.go
- thinking.go
- turn_telemetry.go
- visual_evidence_protocol.go
- workspace_agent_resources.go