workflow

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 20 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 Descriptions added in v0.0.42

func Descriptions(definitions map[string]*Definition) []protocol.WorkflowDescription

Descriptions returns sorted name/description pairs for loaded definitions.

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, protocol.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 Definition

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

Definition is a compiled workflow definition.

type ProgressFunc

type ProgressFunc func(context.Context, protocol.PhaseUpdate) error

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

type Result

type Result struct {
	Text   string
	Silent bool
	Phases []protocol.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 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