workflow

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package workflow executes resolved Callee agent trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TreeRequiresInteraction added in v0.20.0

func TreeRequiresInteraction(root *registry.ResolvedNode, overrides PolicyOverrides) (bool, error)

TreeRequiresInteraction reports whether effective tree policy needs an interactor.

func ValidateParallelPreflight added in v0.21.0

func ValidateParallelPreflight(root *registry.ResolvedNode, values map[string]string, overrides PolicyOverrides) error

ValidateParallelPreflight rejects interactive policy and missing parameters that would otherwise require terminal input from a concurrent subtree.

func ValidatePolicyOverrides added in v0.20.0

func ValidatePolicyOverrides(overrides PolicyOverrides) error

ValidatePolicyOverrides rejects unsupported programmatic permission modes.

func ValidateRuntimeParams added in v0.20.0

func ValidateRuntimeParams(root *registry.ResolvedNode, values map[string]string) error

ValidateRuntimeParams validates supplied qualified parameter values.

Types

type Interactor

type Interactor interface {
	Prompt(ctx context.Context, label string) (string, error)
	Display(text string) error
}

Interactor owns all controlling-TTY input and display for a workflow run.

type PauseController

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

PauseController pauses and resumes the active provider-turn budget while Callee waits for an operator permission decision.

func NewPauseController

func NewPauseController() *PauseController

NewPauseController creates a controller for one serial workflow run.

func (*PauseController) Pause

func (p *PauseController) Pause(ctx context.Context) error

Pause stops the current active-time budget.

func (*PauseController) Resume

func (p *PauseController) Resume(ctx context.Context) error

Resume restarts the current active-time budget with its remaining duration.

type PolicyOverrides added in v0.20.0

type PolicyOverrides struct {
	Interactive *bool
	Permissions *agent.PermissionMode
}

PolicyOverrides contains optional whole-run Role policy overrides.

type RolePolicy added in v0.20.0

type RolePolicy struct {
	Interactive bool
	Permissions agent.PermissionMode
}

RolePolicy is the effective protocol and ACP permission policy for one Role.

func ResolveNodeRolePolicy added in v0.21.0

func ResolveNodeRolePolicy(node *registry.ResolvedNode, overrides PolicyOverrides) (RolePolicy, error)

ResolveNodeRolePolicy resolves policy from a node's registry-projected defaults and then applies explicit whole-run overrides.

func ResolveRolePolicy added in v0.20.0

func ResolveRolePolicy(role agent.Resource, overrides PolicyOverrides) (RolePolicy, error)

ResolveRolePolicy resolves independent Role protocol and permission values.

type RunMetrics added in v0.16.0

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

RunMetrics accumulates provider usage for one resolved agent run.

func (*RunMetrics) Usage added in v0.16.0

func (m *RunMetrics) Usage() runtime.UsageMetrics

Usage returns a snapshot of the run's provider-reported token usage.

type Runner

type Runner struct {
	Root                *registry.ResolvedNode
	Factory             runtime.ProcessFactory
	Interactor          Interactor
	Params              map[string]string
	Pauses              *PauseController
	Metrics             *RunMetrics
	InteractiveOverride *bool
	PermissionOverride  *agent.PermissionMode
	EvaluationEvaluator evaluationapi.Evaluator
}

Runner executes one resolved root using shared ephemeral state.

func (Runner) Run

func (r Runner) Run(ctx context.Context, prompt string) (artifact string, resultErr error)

Run executes the root and returns its sole final artifact only after every started provider process closes successfully.

Jump to

Keyboard shortcuts

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