kinds

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package kinds defines public payloads for each Compozy event kind.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactUpdatedPayload added in v0.1.11

type ArtifactUpdatedPayload struct {
	Path         string `json:"path"`
	BytesWritten int    `json:"bytes_written,omitempty"`
	ChangeKind   string `json:"change_kind,omitempty"`
	Checksum     string `json:"checksum,omitempty"`
}

ArtifactUpdatedPayload describes a host-managed artifact write.

type ContentBlock

type ContentBlock struct {
	Type ContentBlockType `json:"type"`
	Data json.RawMessage  `json:"-"`
}

ContentBlock stores one typed content payload in its canonical JSON form.

func NewContentBlock

func NewContentBlock(block any) (ContentBlock, error)

NewContentBlock encodes a typed block into the generic ContentBlock envelope.

func (ContentBlock) AsDiff

func (b ContentBlock) AsDiff() (DiffBlock, error)

AsDiff decodes the block as a DiffBlock.

func (ContentBlock) AsImage

func (b ContentBlock) AsImage() (ImageBlock, error)

AsImage decodes the block as an ImageBlock.

func (ContentBlock) AsTerminalOutput

func (b ContentBlock) AsTerminalOutput() (TerminalOutputBlock, error)

AsTerminalOutput decodes the block as a TerminalOutputBlock.

func (ContentBlock) AsText

func (b ContentBlock) AsText() (TextBlock, error)

AsText decodes the block as a TextBlock.

func (ContentBlock) AsToolResult

func (b ContentBlock) AsToolResult() (ToolResultBlock, error)

AsToolResult decodes the block as a ToolResultBlock.

func (ContentBlock) AsToolUse

func (b ContentBlock) AsToolUse() (ToolUseBlock, error)

AsToolUse decodes the block as a ToolUseBlock.

func (ContentBlock) Decode

func (b ContentBlock) Decode() (any, error)

Decode unmarshals the envelope into its typed block payload.

func (ContentBlock) MarshalJSON

func (b ContentBlock) MarshalJSON() ([]byte, error)

MarshalJSON preserves the canonical JSON payload stored in Data.

func (*ContentBlock) UnmarshalJSON

func (b *ContentBlock) UnmarshalJSON(data []byte) error

UnmarshalJSON validates the payload and stores its canonical JSON form.

type ContentBlockType

type ContentBlockType string

ContentBlockType identifies the serialized content block variant.

const (
	// BlockText carries plain text or markdown content.
	BlockText ContentBlockType = "text"
	// BlockToolUse carries a tool invocation announcement.
	BlockToolUse ContentBlockType = "tool_use"
	// BlockToolResult carries tool output that is not represented by a richer block.
	BlockToolResult ContentBlockType = "tool_result"
	// BlockDiff carries file modification details.
	BlockDiff ContentBlockType = "diff"
	// BlockTerminalOutput carries terminal execution output.
	BlockTerminalOutput ContentBlockType = "terminal_output"
	// BlockImage carries inline image data.
	BlockImage ContentBlockType = "image"
)

type DiffBlock

type DiffBlock struct {
	Type     ContentBlockType `json:"type"`
	FilePath string           `json:"file_path"`
	Diff     string           `json:"diff"`
	OldText  *string          `json:"old_text,omitempty"`
	NewText  string           `json:"new_text,omitempty"`
}

DiffBlock carries file modification details.

type ExtensionEventPayload added in v0.1.11

type ExtensionEventPayload struct {
	Extension string          `json:"extension,omitempty"`
	Kind      string          `json:"kind"`
	Payload   json.RawMessage `json:"payload,omitempty"`
}

ExtensionEventPayload describes a custom event emitted through host.events.publish.

type ExtensionFailedPayload added in v0.1.11

type ExtensionFailedPayload struct {
	Extension string `json:"extension"`
	Source    string `json:"source,omitempty"`
	Version   string `json:"version,omitempty"`
	Phase     string `json:"phase"`
	Error     string `json:"error"`
}

ExtensionFailedPayload describes a lifecycle failure for one extension.

type ExtensionLoadedPayload added in v0.1.11

type ExtensionLoadedPayload struct {
	Extension    string `json:"extension"`
	Source       string `json:"source,omitempty"`
	Version      string `json:"version,omitempty"`
	ManifestPath string `json:"manifest_path,omitempty"`
}

ExtensionLoadedPayload describes an extension entering the manager lifecycle.

type ExtensionReadyPayload added in v0.1.11

type ExtensionReadyPayload struct {
	Extension            string   `json:"extension"`
	Source               string   `json:"source,omitempty"`
	Version              string   `json:"version,omitempty"`
	ProtocolVersion      string   `json:"protocol_version"`
	AcceptedCapabilities []string `json:"accepted_capabilities,omitempty"`
	SupportedHookEvents  []string `json:"supported_hook_events,omitempty"`
}

ExtensionReadyPayload describes a successfully initialized extension session.

type ImageBlock

type ImageBlock struct {
	Type     ContentBlockType `json:"type"`
	Data     string           `json:"data"`
	MimeType string           `json:"mime_type"`
	URI      *string          `json:"uri,omitempty"`
}

ImageBlock carries inline image data.

type JobAttemptFinishedPayload

type JobAttemptFinishedPayload struct {
	JobAttemptInfo
	Status    string `json:"status,omitempty"`
	ExitCode  int    `json:"exit_code,omitempty"`
	Retryable bool   `json:"retryable,omitempty"`
	Error     string `json:"error,omitempty"`
}

JobAttemptFinishedPayload describes the end of one job attempt.

type JobAttemptInfo

type JobAttemptInfo struct {
	Index       int `json:"index"`
	Attempt     int `json:"attempt,omitempty"`
	MaxAttempts int `json:"max_attempts,omitempty"`
}

JobAttemptInfo carries shared attempt counters for job lifecycle payloads.

type JobAttemptStartedPayload

type JobAttemptStartedPayload struct {
	JobAttemptInfo
}

JobAttemptStartedPayload describes the start of one job attempt.

type JobCancelledPayload

type JobCancelledPayload struct {
	JobAttemptInfo
	Reason string `json:"reason,omitempty"`
}

JobCancelledPayload describes a canceled job.

type JobCompletedPayload

type JobCompletedPayload struct {
	JobAttemptInfo
	ExitCode   int   `json:"exit_code,omitempty"`
	DurationMs int64 `json:"duration_ms,omitempty"`
}

JobCompletedPayload describes a completed job.

type JobFailedPayload

type JobFailedPayload struct {
	JobAttemptInfo
	CodeFile string `json:"code_file,omitempty"`
	ExitCode int    `json:"exit_code,omitempty"`
	OutLog   string `json:"out_log,omitempty"`
	ErrLog   string `json:"err_log,omitempty"`
	Error    string `json:"error,omitempty"`
}

JobFailedPayload describes a failed job.

type JobQueuedPayload

type JobQueuedPayload struct {
	Index           int      `json:"index"`
	CodeFile        string   `json:"code_file,omitempty"`
	CodeFiles       []string `json:"code_files,omitempty"`
	Issues          int      `json:"issues,omitempty"`
	TaskTitle       string   `json:"task_title,omitempty"`
	TaskType        string   `json:"task_type,omitempty"`
	SafeName        string   `json:"safe_name,omitempty"`
	IDE             string   `json:"ide,omitempty"`
	Model           string   `json:"model,omitempty"`
	ReasoningEffort string   `json:"reasoning_effort,omitempty"`
	AccessMode      string   `json:"access_mode,omitempty"`
	OutLog          string   `json:"out_log,omitempty"`
	ErrLog          string   `json:"err_log,omitempty"`
}

JobQueuedPayload describes a queued job.

type JobRetryScheduledPayload

type JobRetryScheduledPayload struct {
	JobAttemptInfo
	Reason string `json:"reason,omitempty"`
}

JobRetryScheduledPayload describes a retry decision.

type JobStartedPayload

type JobStartedPayload struct {
	JobAttemptInfo
	IDE             string `json:"ide,omitempty"`
	Model           string `json:"model,omitempty"`
	ReasoningEffort string `json:"reasoning_effort,omitempty"`
	AccessMode      string `json:"access_mode,omitempty"`
}

JobStartedPayload describes a started job.

type ProviderCallCompletedPayload

type ProviderCallCompletedPayload struct {
	CallID       string `json:"call_id"`
	Provider     string `json:"provider"`
	Endpoint     string `json:"endpoint,omitempty"`
	Method       string `json:"method,omitempty"`
	StatusCode   int    `json:"status_code,omitempty"`
	DurationMs   int64  `json:"duration_ms,omitempty"`
	PayloadBytes int    `json:"payload_bytes,omitempty"`
}

ProviderCallCompletedPayload describes a successful provider call.

type ProviderCallFailedPayload

type ProviderCallFailedPayload struct {
	CallID       string `json:"call_id"`
	Provider     string `json:"provider"`
	Endpoint     string `json:"endpoint,omitempty"`
	Method       string `json:"method,omitempty"`
	StatusCode   int    `json:"status_code,omitempty"`
	DurationMs   int64  `json:"duration_ms,omitempty"`
	PayloadBytes int    `json:"payload_bytes,omitempty"`
	Error        string `json:"error,omitempty"`
}

ProviderCallFailedPayload describes a failed provider call.

type ProviderCallStartedPayload

type ProviderCallStartedPayload struct {
	CallID     string `json:"call_id"`
	Provider   string `json:"provider"`
	Endpoint   string `json:"endpoint,omitempty"`
	Method     string `json:"method,omitempty"`
	PR         string `json:"pr,omitempty"`
	IssueCount int    `json:"issue_count,omitempty"`
}

ProviderCallStartedPayload describes the start of an external provider call.

type ReusableAgentBlockedReason added in v0.1.11

type ReusableAgentBlockedReason string

ReusableAgentBlockedReason classifies a blocked reusable-agent execution.

const (
	// ReusableAgentBlockedReasonDepthLimit indicates the nested depth ceiling was reached.
	ReusableAgentBlockedReasonDepthLimit ReusableAgentBlockedReason = "depth-limit"
	// ReusableAgentBlockedReasonCycleDetected indicates the nested agent path would recurse.
	ReusableAgentBlockedReasonCycleDetected ReusableAgentBlockedReason = "cycle-detected"
	// ReusableAgentBlockedReasonAccessDenied indicates the parent runtime denied the requested access.
	ReusableAgentBlockedReasonAccessDenied ReusableAgentBlockedReason = "access-denied"
	// ReusableAgentBlockedReasonInvalidAgent indicates the selected agent could not be resolved or validated.
	ReusableAgentBlockedReasonInvalidAgent ReusableAgentBlockedReason = "invalid-agent"
	// ReusableAgentBlockedReasonInvalidMCP indicates the resolved agent MCP configuration is invalid.
	ReusableAgentBlockedReasonInvalidMCP ReusableAgentBlockedReason = "invalid-mcp"
)

type ReusableAgentLifecyclePayload added in v0.1.11

type ReusableAgentLifecyclePayload struct {
	Stage             ReusableAgentLifecycleStage `json:"stage"`
	AgentName         string                      `json:"agent_name,omitempty"`
	AgentSource       string                      `json:"agent_source,omitempty"`
	ParentAgentName   string                      `json:"parent_agent_name,omitempty"`
	AvailableAgents   int                         `json:"available_agents,omitempty"`
	SystemPromptBytes int                         `json:"system_prompt_bytes,omitempty"`
	MCPServers        []string                    `json:"mcp_servers,omitempty"`
	Resumed           bool                        `json:"resumed,omitempty"`
	ToolCallID        string                      `json:"tool_call_id,omitempty"`
	NestedDepth       int                         `json:"nested_depth"`
	MaxNestedDepth    int                         `json:"max_nested_depth"`
	OutputRunID       string                      `json:"output_run_id,omitempty"`
	Success           bool                        `json:"success"`
	Blocked           bool                        `json:"blocked"`
	BlockedReason     ReusableAgentBlockedReason  `json:"blocked_reason,omitempty"`
	Error             string                      `json:"error,omitempty"`
}

ReusableAgentLifecyclePayload describes one reusable-agent lifecycle signal.

type ReusableAgentLifecycleStage added in v0.1.11

type ReusableAgentLifecycleStage string

ReusableAgentLifecycleStage identifies one reusable-agent lifecycle phase.

const (
	// ReusableAgentLifecycleStageResolved marks successful agent resolution.
	ReusableAgentLifecycleStageResolved ReusableAgentLifecycleStage = "resolved"
	// ReusableAgentLifecycleStagePromptAssembled marks canonical system-prompt assembly.
	ReusableAgentLifecycleStagePromptAssembled ReusableAgentLifecycleStage = "prompt-assembled"
	// ReusableAgentLifecycleStageMCPMerged marks the resolved MCP server merge result.
	ReusableAgentLifecycleStageMCPMerged ReusableAgentLifecycleStage = "mcp-merged"
	// ReusableAgentLifecycleStageNestedStarted marks a nested `run_agent` invocation.
	ReusableAgentLifecycleStageNestedStarted ReusableAgentLifecycleStage = "nested-started"
	// ReusableAgentLifecycleStageNestedCompleted marks a completed nested `run_agent` invocation.
	ReusableAgentLifecycleStageNestedCompleted ReusableAgentLifecycleStage = "nested-completed"
	// ReusableAgentLifecycleStageNestedBlocked marks a blocked nested `run_agent` invocation.
	ReusableAgentLifecycleStageNestedBlocked ReusableAgentLifecycleStage = "nested-blocked"
)

type ReviewIssueResolvedPayload

type ReviewIssueResolvedPayload struct {
	ReviewsDir     string    `json:"reviews_dir"`
	IssueID        string    `json:"issue_id"`
	FilePath       string    `json:"file_path,omitempty"`
	Provider       string    `json:"provider,omitempty"`
	PR             string    `json:"pr,omitempty"`
	ProviderRef    string    `json:"provider_ref,omitempty"`
	ProviderPosted bool      `json:"provider_posted,omitempty"`
	PostedAt       time.Time `json:"posted_at,omitzero"`
}

ReviewIssueResolvedPayload describes a resolved provider-backed issue.

type ReviewRoundRefreshedPayload

type ReviewRoundRefreshedPayload struct {
	ReviewsDir string    `json:"reviews_dir"`
	Provider   string    `json:"provider,omitempty"`
	PR         string    `json:"pr,omitempty"`
	Round      int       `json:"round,omitempty"`
	CreatedAt  time.Time `json:"created_at,omitzero"`
	Total      int       `json:"total,omitempty"`
	Resolved   int       `json:"resolved,omitempty"`
	Unresolved int       `json:"unresolved,omitempty"`
}

ReviewRoundRefreshedPayload describes refreshed review round metadata.

type ReviewStatusFinalizedPayload

type ReviewStatusFinalizedPayload struct {
	ReviewsDir string   `json:"reviews_dir"`
	IssueIDs   []string `json:"issue_ids,omitempty"`
}

ReviewStatusFinalizedPayload describes finalized review issue statuses.

type ReviewWatchPayload added in v0.2.0

type ReviewWatchPayload struct {
	Provider        string `json:"provider,omitempty"`
	PR              string `json:"pr,omitempty"`
	Workflow        string `json:"workflow,omitempty"`
	Round           int    `json:"round,omitempty"`
	RunID           string `json:"run_id,omitempty"`
	ChildRunID      string `json:"child_run_id,omitempty"`
	HeadSHA         string `json:"head_sha,omitempty"`
	ReviewID        string `json:"review_id,omitempty"`
	ReviewState     string `json:"review_state,omitempty"`
	Status          string `json:"status,omitempty"`
	Remote          string `json:"remote,omitempty"`
	Branch          string `json:"branch,omitempty"`
	Total           int    `json:"total,omitempty"`
	Resolved        int    `json:"resolved,omitempty"`
	Unresolved      int    `json:"unresolved,omitempty"`
	Dirty           bool   `json:"dirty,omitempty"`
	UnpushedCommits int    `json:"unpushed_commits,omitempty"`
	Error           string `json:"error,omitempty"`
}

ReviewWatchPayload describes daemon review-watch lifecycle events.

type RunCancelledPayload

type RunCancelledPayload struct {
	Reason      string `json:"reason,omitempty"`
	RequestedBy string `json:"requested_by,omitempty"`
	DurationMs  int64  `json:"duration_ms,omitempty"`
}

RunCancelledPayload describes a canceled run.

type RunCompletedPayload

type RunCompletedPayload struct {
	ArtifactsDir   string `json:"artifacts_dir,omitempty"`
	JobsTotal      int    `json:"jobs_total,omitempty"`
	JobsSucceeded  int    `json:"jobs_succeeded,omitempty"`
	JobsFailed     int    `json:"jobs_failed,omitempty"`
	JobsCancelled  int    `json:"jobs_canceled,omitempty"`
	DurationMs     int64  `json:"duration_ms,omitempty"`
	ResultPath     string `json:"result_path,omitempty"`
	SummaryMessage string `json:"summary_message,omitempty"`
}

RunCompletedPayload describes a completed run.

type RunCrashedPayload added in v0.2.0

type RunCrashedPayload struct {
	ArtifactsDir string `json:"artifacts_dir,omitempty"`
	DurationMs   int64  `json:"duration_ms,omitempty"`
	Error        string `json:"error,omitempty"`
	ResultPath   string `json:"result_path,omitempty"`
}

RunCrashedPayload describes a run that was interrupted before it reached a terminal state and had to be reconciled after daemon restart or shutdown.

type RunFailedPayload

type RunFailedPayload struct {
	ArtifactsDir string `json:"artifacts_dir,omitempty"`
	DurationMs   int64  `json:"duration_ms,omitempty"`
	Error        string `json:"error,omitempty"`
	ResultPath   string `json:"result_path,omitempty"`
}

RunFailedPayload describes a failed run.

type RunQueuedPayload

type RunQueuedPayload struct {
	Mode            string `json:"mode,omitempty"`
	Name            string `json:"name,omitempty"`
	WorkspaceRoot   string `json:"workspace_root,omitempty"`
	IDE             string `json:"ide,omitempty"`
	Model           string `json:"model,omitempty"`
	ReasoningEffort string `json:"reasoning_effort,omitempty"`
	AccessMode      string `json:"access_mode,omitempty"`
}

RunQueuedPayload describes a queued run.

type RunStartedPayload

type RunStartedPayload struct {
	Mode            string `json:"mode,omitempty"`
	Name            string `json:"name,omitempty"`
	WorkspaceRoot   string `json:"workspace_root,omitempty"`
	IDE             string `json:"ide,omitempty"`
	Model           string `json:"model,omitempty"`
	ReasoningEffort string `json:"reasoning_effort,omitempty"`
	AccessMode      string `json:"access_mode,omitempty"`
	ArtifactsDir    string `json:"artifacts_dir,omitempty"`
	JobsTotal       int    `json:"jobs_total,omitempty"`
}

RunStartedPayload describes a started run.

type SessionAvailableCommand

type SessionAvailableCommand struct {
	Name         string `json:"name"`
	Description  string `json:"description,omitempty"`
	ArgumentHint string `json:"argument_hint,omitempty"`
}

SessionAvailableCommand describes one slash-command style action.

type SessionCompletedPayload

type SessionCompletedPayload struct {
	Index int   `json:"index"`
	Usage Usage `json:"usage,omitempty"`
}

SessionCompletedPayload describes a completed session.

type SessionFailedPayload

type SessionFailedPayload struct {
	Index int    `json:"index"`
	Error string `json:"error,omitempty"`
	Usage Usage  `json:"usage,omitempty"`
}

SessionFailedPayload describes a failed session.

type SessionPlanEntry

type SessionPlanEntry struct {
	Content  string `json:"content"`
	Priority string `json:"priority"`
	Status   string `json:"status"`
}

SessionPlanEntry describes one plan entry.

type SessionStartedPayload

type SessionStartedPayload struct {
	Index          int    `json:"index"`
	ACPSessionID   string `json:"acp_session_id"`
	AgentSessionID string `json:"agent_session_id,omitempty"`
	Resumed        bool   `json:"resumed,omitempty"`
}

SessionStartedPayload describes a new attached session.

type SessionStatus

type SessionStatus string

SessionStatus describes the lifecycle state of a streamed session update.

const (
	// StatusRunning marks an in-flight session update.
	StatusRunning SessionStatus = "running"
	// StatusCompleted marks a completed session.
	StatusCompleted SessionStatus = "completed"
	// StatusFailed marks a failed or canceled session.
	StatusFailed SessionStatus = "failed"
)

type SessionUpdate

type SessionUpdate struct {
	Kind              SessionUpdateKind         `json:"kind,omitempty"`
	ToolCallID        string                    `json:"tool_call_id,omitempty"`
	ToolCallState     ToolCallState             `json:"tool_call_state,omitempty"`
	Blocks            []ContentBlock            `json:"blocks,omitempty"`
	ThoughtBlocks     []ContentBlock            `json:"thought_blocks,omitempty"`
	PlanEntries       []SessionPlanEntry        `json:"plan_entries,omitempty"`
	AvailableCommands []SessionAvailableCommand `json:"available_commands,omitempty"`
	CurrentModeID     string                    `json:"current_mode_id,omitempty"`
	Usage             Usage                     `json:"usage,omitempty"`
	Status            SessionStatus             `json:"status"`
}

SessionUpdate is the public view of one streamed ACP update.

type SessionUpdateKind

type SessionUpdateKind string

SessionUpdateKind identifies the semantic variant of a session update.

const (
	// UpdateKindUnknown marks an update with no additional semantic classification.
	UpdateKindUnknown SessionUpdateKind = ""
	// UpdateKindUserMessageChunk marks a streamed user message chunk.
	UpdateKindUserMessageChunk SessionUpdateKind = "user_message_chunk"
	// UpdateKindAgentMessageChunk marks a streamed agent message chunk.
	UpdateKindAgentMessageChunk SessionUpdateKind = "agent_message_chunk"
	// UpdateKindAgentThoughtChunk marks a streamed agent thought chunk.
	UpdateKindAgentThoughtChunk SessionUpdateKind = "agent_thought_chunk"
	// UpdateKindToolCallStarted marks the start of a tool call lifecycle.
	UpdateKindToolCallStarted SessionUpdateKind = "tool_call_started"
	// UpdateKindToolCallUpdated marks an update to an existing tool call lifecycle.
	UpdateKindToolCallUpdated SessionUpdateKind = "tool_call_updated"
	// UpdateKindPlanUpdated marks a plan update.
	UpdateKindPlanUpdated SessionUpdateKind = "plan_updated"
	// UpdateKindAvailableCommandsUpdated marks an available commands update.
	UpdateKindAvailableCommandsUpdated SessionUpdateKind = "available_commands_updated"
	// UpdateKindCurrentModeUpdated marks a current mode update.
	UpdateKindCurrentModeUpdated SessionUpdateKind = "current_mode_updated"
)

type SessionUpdatePayload

type SessionUpdatePayload struct {
	Index  int           `json:"index"`
	Update SessionUpdate `json:"update"`
}

SessionUpdatePayload carries one streamed session update.

type ShutdownBase

type ShutdownBase struct {
	Source      string    `json:"source,omitempty"`
	RequestedAt time.Time `json:"requested_at,omitzero"`
	DeadlineAt  time.Time `json:"deadline_at,omitzero"`
}

ShutdownBase carries shared shutdown timestamps and source metadata.

type ShutdownDrainingPayload

type ShutdownDrainingPayload struct {
	ShutdownBase
}

ShutdownDrainingPayload describes a draining shutdown.

type ShutdownRequestedPayload

type ShutdownRequestedPayload struct {
	ShutdownBase
}

ShutdownRequestedPayload describes a requested shutdown.

type ShutdownTerminatedPayload

type ShutdownTerminatedPayload struct {
	ShutdownBase
	Forced bool `json:"forced,omitempty"`
}

ShutdownTerminatedPayload describes a terminated shutdown.

type TaskFileSkippedPayload added in v0.2.2

type TaskFileSkippedPayload struct {
	TasksDir        string                `json:"tasks_dir"`
	TaskName        string                `json:"task_name"`
	FilePath        string                `json:"file_path"`
	PreservedStatus string                `json:"preserved_status,omitempty"`
	Reason          TaskFileSkippedReason `json:"reason"`
}

TaskFileSkippedPayload describes a task completion that was deliberately suppressed because no positive evidence of progress was observed.

type TaskFileSkippedReason added in v0.2.2

type TaskFileSkippedReason string

TaskFileSkippedReason categorizes why a task completion was suppressed.

const (
	// TaskFileSkippedReasonNoWorkspaceChanges is emitted when the agent
	// session ended cleanly but did not modify any file in the workspace.
	// The task file is left at its prior status and will be re-dispatched
	// on the next run.
	TaskFileSkippedReasonNoWorkspaceChanges TaskFileSkippedReason = "no_workspace_changes"
)

type TaskFileUpdatedPayload

type TaskFileUpdatedPayload struct {
	TasksDir  string `json:"tasks_dir"`
	TaskName  string `json:"task_name"`
	FilePath  string `json:"file_path"`
	OldStatus string `json:"old_status,omitempty"`
	NewStatus string `json:"new_status,omitempty"`
}

TaskFileUpdatedPayload describes a rewritten task file.

type TaskMemoryUpdatedPayload added in v0.1.11

type TaskMemoryUpdatedPayload struct {
	Workflow     string `json:"workflow,omitempty"`
	TaskFile     string `json:"task_file,omitempty"`
	Path         string `json:"path"`
	Mode         string `json:"mode,omitempty"`
	BytesWritten int    `json:"bytes_written,omitempty"`
}

TaskMemoryUpdatedPayload describes a workflow or task memory document write.

type TaskMetadataRefreshedPayload

type TaskMetadataRefreshedPayload struct {
	TasksDir  string    `json:"tasks_dir"`
	CreatedAt time.Time `json:"created_at,omitzero"`
	UpdatedAt time.Time `json:"updated_at,omitzero"`
	Total     int       `json:"total,omitempty"`
	Completed int       `json:"completed,omitempty"`
	Pending   int       `json:"pending,omitempty"`
}

TaskMetadataRefreshedPayload describes refreshed task workflow metadata.

type TaskRunMultiplePayload added in v0.2.7

type TaskRunMultiplePayload struct {
	RunID      string   `json:"run_id,omitempty"`
	Mode       string   `json:"mode,omitempty"`
	Slug       string   `json:"slug,omitempty"`
	Slugs      []string `json:"slugs,omitempty"`
	Index      int      `json:"index,omitempty"`
	Total      int      `json:"total,omitempty"`
	Status     string   `json:"status,omitempty"`
	ChildRunID string   `json:"child_run_id,omitempty"`
	Error      string   `json:"error,omitempty"`
}

TaskRunMultiplePayload describes daemon-owned multi-task queue lifecycle events.

type TerminalOutputBlock

type TerminalOutputBlock struct {
	Type       ContentBlockType `json:"type"`
	Command    string           `json:"command,omitempty"`
	Output     string           `json:"output,omitempty"`
	ExitCode   int              `json:"exit_code"`
	TerminalID string           `json:"terminal_id,omitempty"`
}

TerminalOutputBlock carries terminal execution details.

type TextBlock

type TextBlock struct {
	Type ContentBlockType `json:"type"`
	Text string           `json:"text"`
}

TextBlock carries plain text or markdown output.

type ToolCallFailedPayload

type ToolCallFailedPayload struct {
	Index      int           `json:"index"`
	ToolCallID string        `json:"tool_call_id"`
	State      ToolCallState `json:"state,omitempty"`
	Error      string        `json:"error,omitempty"`
}

ToolCallFailedPayload describes a failed tool call.

type ToolCallStartedPayload

type ToolCallStartedPayload struct {
	Index      int             `json:"index"`
	ToolCallID string          `json:"tool_call_id"`
	Name       string          `json:"name"`
	Title      string          `json:"title,omitempty"`
	ToolName   string          `json:"tool_name,omitempty"`
	Input      json.RawMessage `json:"input,omitempty"`
	RawInput   json.RawMessage `json:"raw_input,omitempty"`
}

ToolCallStartedPayload describes the start of a tool call.

type ToolCallState

type ToolCallState string

ToolCallState describes the lifecycle state of a tool call entry.

const (
	// ToolCallStateUnknown marks a tool call without an explicit lifecycle state.
	ToolCallStateUnknown ToolCallState = ""
	// ToolCallStatePending marks a pending tool call.
	ToolCallStatePending ToolCallState = "pending"
	// ToolCallStateInProgress marks an in-flight tool call.
	ToolCallStateInProgress ToolCallState = "in_progress"
	// ToolCallStateCompleted marks a completed tool call.
	ToolCallStateCompleted ToolCallState = "completed"
	// ToolCallStateFailed marks a failed tool call.
	ToolCallStateFailed ToolCallState = "failed"
	// ToolCallStateWaitingForConfirmation is reserved for future permission-aware UX.
	ToolCallStateWaitingForConfirmation ToolCallState = "waiting_for_confirmation"
)

type ToolCallUpdatedPayload

type ToolCallUpdatedPayload struct {
	Index      int             `json:"index"`
	ToolCallID string          `json:"tool_call_id"`
	State      ToolCallState   `json:"state,omitempty"`
	Input      json.RawMessage `json:"input,omitempty"`
	RawInput   json.RawMessage `json:"raw_input,omitempty"`
}

ToolCallUpdatedPayload describes an update to a tool call.

type ToolResultBlock

type ToolResultBlock struct {
	Type      ContentBlockType `json:"type"`
	ToolUseID string           `json:"tool_use_id"`
	Content   string           `json:"content"`
	IsError   bool             `json:"is_error,omitempty"`
}

ToolResultBlock carries tool output when a richer block type is not available.

type ToolUseBlock

type ToolUseBlock struct {
	Type     ContentBlockType `json:"type"`
	ID       string           `json:"id"`
	Name     string           `json:"name"`
	Title    string           `json:"title,omitempty"`
	ToolName string           `json:"tool_name,omitempty"`
	Input    json.RawMessage  `json:"input,omitempty"`
	RawInput json.RawMessage  `json:"raw_input,omitempty"`
}

ToolUseBlock describes the start of a tool invocation.

type Usage

type Usage struct {
	InputTokens  int `json:"input_tokens,omitempty"`
	OutputTokens int `json:"output_tokens,omitempty"`
	TotalTokens  int `json:"total_tokens,omitempty"`
	CacheReads   int `json:"cache_reads,omitempty"`
	CacheWrites  int `json:"cache_writes,omitempty"`
}

Usage tracks token consumption in public event payloads.

func (*Usage) Add

func (u *Usage) Add(other Usage)

Add accumulates usage from another value into the receiver.

func (Usage) Total

func (u Usage) Total() int

Total returns the stored total or derives it from inputs and outputs.

type UsageAggregatedPayload

type UsageAggregatedPayload struct {
	Usage Usage `json:"usage"`
}

UsageAggregatedPayload carries run-level usage totals.

type UsageUpdatedPayload

type UsageUpdatedPayload struct {
	Index int   `json:"index"`
	Usage Usage `json:"usage"`
}

UsageUpdatedPayload carries per-job usage deltas.

Jump to

Keyboard shortcuts

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