progress

package
v0.0.0-...-75ec8e3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(cb Callback, update Update) error

Dispatch normalizes and sends the update if the callback is set.

Types

type Callback

type Callback func(Update) error

Callback receives progress updates.

type ReportMode

type ReportMode int
const (
	// ReportNoStatus streams only (no status indicator).
	ReportNoStatus ReportMode = iota
	// ReportJustStatus reports to status indicator only.
	ReportJustStatus
	// ReportStreamAndStatus reports to both stream and status indicator.
	ReportStreamAndStatus
)

type Update

type Update struct {
	// Message is the content to deliver to the UI or client.
	Message string
	// Reasoning is the reasoning/thinking content (for extended thinking models).
	Reasoning string
	// AddNewLine appends a newline to Message if one is not already present.
	AddNewLine bool
	// Mode controls where the message should be surfaced.
	Mode ReportMode
	// Ephemeral marks the update as transient (should not persist once superseded).
	Ephemeral bool
	// VerificationAgent indicates this update is from the verification agent and should replace
	// previous verification agent messages (compact display mode).
	VerificationAgent bool
}

Update describes a progress or streaming message emitted by the orchestrator or tools.

func Normalize

func Normalize(update Update) Update

Normalize ensures the update reflects requested formatting (currently newline handling).

func VerificationAgentUpdate

func VerificationAgentUpdate(message string, mode ReportMode) Update

VerificationAgentUpdate creates a progress update marked as coming from the verification agent. This indicates the UI should display this message in compact mode (replacing previous verification messages).

func (Update) ShouldStatus

func (u Update) ShouldStatus() bool

ShouldStatus returns true if the update should be shown in a status indicator.

func (Update) ShouldStream

func (u Update) ShouldStream() bool

ShouldStream returns true if the update should be streamed to the user-facing content channel.

Jump to

Keyboard shortcuts

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