workflow

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package workflow loads and validates saved RocketClaw workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(root *os.Root, runtimeDir string) (definitions map[string]*Definition, err error)

Load loads top-level workflow definitions from runtimeDir.

Types

type AgentProgressFunc

type AgentProgressFunc func(context.Context, AgentUpdate) error

AgentProgressFunc receives serialized workflow agent activity updates and is never invoked concurrently.

type AgentRequest

type AgentRequest struct {
	Worker Worker
	Prompt string
	Schema map[string]any
}

AgentRequest describes one isolated agent call.

type AgentRunFunc

AgentRunFunc runs one isolated agent call.

type AgentThinkingFunc

type AgentThinkingFunc func(context.Context, string) error

AgentThinkingFunc receives serialized observable activity from one isolated agent call. Implementations must not invoke it concurrently or after the agent run returns.

type AgentUpdate

type AgentUpdate struct {
	CallID, PhaseID, Label, Activity string
}

AgentUpdate reports one workflow agent call's latest observable activity.

type Definition

type Definition struct {
	Name         string
	Description  string
	Phases       []string
	WorkerModels []string
	// contains filtered or unexported fields
}

Definition is a compiled workflow definition.

type Description

type Description struct{ Name, Description string }

Description identifies one available workflow.

type PhaseStatus

type PhaseStatus string

PhaseStatus identifies one workflow phase state.

const (
	// PhasePending has not started.
	PhasePending PhaseStatus = "pending"
	// PhaseInProgress is executing.
	PhaseInProgress PhaseStatus = "in-progress"
	// PhaseComplete finished successfully.
	PhaseComplete PhaseStatus = "complete"
	// PhaseError failed.
	PhaseError PhaseStatus = "error"
	// PhaseSkipped was not entered before the workflow terminated.
	PhaseSkipped PhaseStatus = "skipped"
)

type PhaseUpdate

type PhaseUpdate struct {
	PhaseID, Name                string
	Status                       PhaseStatus
	Scheduled, Running, Complete int
	Details                      string
}

PhaseUpdate reports connector-neutral workflow progress.

type ProgressFunc

type ProgressFunc func(context.Context, PhaseUpdate) error

ProgressFunc receives serialized workflow progress updates and is never invoked concurrently.

type Result

type Result struct {
	Text   string
	Silent bool
	Phases []PhaseUpdate
}

Result is the rendered workflow result.

func Run

func Run(ctx context.Context, definition *Definition, request RunRequest, agent AgentRunFunc, progress ProgressFunc, agentProgress AgentProgressFunc) (result Result, err error)

Run executes a compiled workflow in the foreground.

type RunRequest

type RunRequest struct {
	RunID, Args string
	Definition  *Definition
}

RunRequest identifies one foreground workflow invocation.

type Terminal

type Terminal string

Terminal identifies how a workflow run ended.

const (
	// TerminalComplete reports a successful workflow.
	TerminalComplete Terminal = "complete"
	// TerminalFailed reports a workflow infrastructure failure.
	TerminalFailed Terminal = "failed"
	// TerminalStopped reports a human interruption.
	TerminalStopped Terminal = "stopped"
)

type Worker

type Worker struct {
	Name, Instructions, Model string
	Tools                     []string
}

Worker describes an isolated workflow agent.

Jump to

Keyboard shortcuts

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