callback

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(info StepInfo)

Callback is a function type invoked at various lifecycle phases.

type Phase

type Phase string

Phase represents a lifecycle stage of an agent, task, crew, or flow.

const (
	PhaseAgentInit     Phase = "agent_init"
	PhaseAgentThink    Phase = "agent_think"
	PhaseAgentTool     Phase = "agent_tool"
	PhaseAgentOutput   Phase = "agent_output"
	PhaseAgentComplete Phase = "agent_complete"
	PhaseAgentError    Phase = "agent_error"

	PhaseTaskStart    Phase = "task_start"
	PhaseTaskComplete Phase = "task_complete"
	PhaseTaskError    Phase = "task_error"

	PhaseCrewStart    Phase = "crew_start"
	PhaseCrewComplete Phase = "crew_complete"
	PhaseCrewError    Phase = "crew_error"

	PhaseHumanInput       Phase = "human_input"
	PhaseReviewRequired   Phase = "review_required"
	PhaseFlowStart        Phase = "flow_start"
	PhaseFlowNodeStart    Phase = "flow_node_start"
	PhaseFlowNodeComplete Phase = "flow_node_complete"
	PhaseFlowComplete     Phase = "flow_complete"

	// @sk-task production-features#T1.1: add checkpoint phases (AC-013)
	PhaseCheckpointSave Phase = "checkpoint_save"
	PhaseCheckpointLoad Phase = "checkpoint_load"
	PhaseResumeStart    Phase = "resume_start"
	PhaseResumeComplete Phase = "resume_complete"

	// @sk-task training#T4.1: add training callback phases (AC-013)
	PhaseTrainStart     Phase = "train_start"
	PhaseTrainIteration Phase = "train_iteration"
	PhaseTrainFeedback  Phase = "train_feedback"
	PhaseTrainComplete  Phase = "train_complete"
)

Phase constants for all lifecycle events.

type StepInfo

type StepInfo struct {
	Phase     Phase
	AgentRole string
	TaskDesc  string
	Thought   string
	ToolName  string
	ToolInput string
	Output    string
	Error     string
	Duration  time.Duration
	TokenUsed int
	Metadata  map[string]any
	Timestamp time.Time

	// @sk-task production-features#T1.1: StepInfo checkpoint fields (AC-012, AC-013)
	CheckpointID string `json:"checkpoint_id,omitempty"`
	ProgressPct  int    `json:"progress_pct,omitempty"`
	NodeID       string `json:"node_id,omitempty"`
	EventType    string `json:"event_type,omitempty"`
}

StepInfo contains the context and data for a single callback invocation.

Jump to

Keyboard shortcuts

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