Help us shape the future of Go! Take the 2026 Go Developer Survey

callback

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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 replay-system#T1.2: replay and fork callback phases (AC-008)
	PhaseReplayStart    Phase = "replay_start"
	PhaseReplayComplete Phase = "replay_complete"
	PhaseReplayTaskSkip Phase = "replay_task_skip"
	PhaseForkStart      Phase = "fork_start"
	PhaseForkComplete   Phase = "fork_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"
	// @sk-task dashboard-v2#T1.3: granular agent phases for dashboard streaming (AC-001, AC-003)
	PhaseAgentThinking Phase = "agent_thinking"
	PhaseAgentToolCall Phase = "agent_tool_call"
	PhaseAgentWaiting  Phase = "agent_waiting"
	PhaseCrewPaused    Phase = "crew_paused"
	PhaseCrewResumed   Phase = "crew_resumed"
	PhaseTaskInjected  Phase = "task_injected"
	// @sk-task output-streaming#T5.2: stream chunk callback phase (AC-014)
	PhaseChunkComplete Phase = "chunk_complete"
	// @sk-task unified-memory#T1.1: memory callback phases (AC-009)
	PhaseMemoryRecall   Phase = "memory_recall"
	PhaseMemoryRemember Phase = "memory_remember"
	// @sk-task conditional-tasks#T1.2: task skip callback phase (AC-009)
	PhaseTaskSkip Phase = "task_skip"
)

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