report

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package report is Lagrange's convention for a run's situation report: what a run is doing and, at the end, what it built, in a form every Lagrange client can show (the Runs page, Telegram, a terminal) without knowing the agent.

An agent publishes the report as an artifact of the run's root task, named "report" (ID "report"), with one data part {Key: {...}} (see Report). Each new report replaces the last one. The relay records it in the activity log as data.report of the artifact entry, so a run's latest report is in its entries.

Notice is for the person who started the run: Lagrange forwards each report that carries one to their notification channels (Telegram), so set it on the report that announces something (a failure, the run landing) and leave it empty on the next ones.

Index

Constants

View Source
const (
	// ArtifactName is the name of a report artifact, and its ID.
	ArtifactName = "report"
	// Key is the data part key of a report.
	Key = "https://threeagents.dev/ext/report"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Title  string `json:"title"`
	Detail string `json:"detail,omitempty"`
}

Item is one thing a run built.

type Progress

type Progress struct {
	Done  int `json:"done"`
	Total int `json:"total"`
}

Progress is how many of a run's steps are done.

type Report

type Report struct {
	// Headline is what the run is about, in a line: its goal.
	Headline string `json:"headline"`
	// Status is where the run stands, in a word or two ("working", "landed", "failed").
	Status string `json:"status,omitempty"`
	// Progress counts the run's steps, when it has countable ones.
	Progress *Progress `json:"progress,omitempty"`
	// Built is what the run made, one item per piece.
	Built []Item `json:"built,omitempty"`
	// Stats are the numbers worth seeing, in order ("Wall time": "14m").
	Stats []Stat `json:"stats,omitempty"`
	// Outcome is how the run ended, in words.
	Outcome string `json:"outcome,omitempty"`
	// Notice, when set, is forwarded to whoever started the run.
	Notice string    `json:"notice,omitempty"`
	At     time.Time `json:"at"`
}

Report is a run's situation report.

func Find

func Find(parts []*a2a.Part) (Report, bool)

Find returns the report in parts.

func FromMap

func FromMap(v any) (Report, bool)

FromMap reads a report from its JSON object (as the activity log keeps it).

func (Report) Event

Event returns the artifact event that publishes r on the task info names (the run's root task), replacing any earlier report.

func (Report) Final

func (r Report) Final() bool

Final reports whether the report describes a run that ended.

func (Report) Map

func (r Report) Map() map[string]any

Map returns r as the JSON object of the report data part.

func (Report) Markdown

func (r Report) Markdown() string

Markdown renders the report to paste anywhere: the headline, status and progress, the outcome, a bullet per built item, then the stats.

func (Report) Part

func (r Report) Part() *a2a.Part

Part returns r as a data part.

type Stat

type Stat struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

Stat is one labeled number.

Jump to

Keyboard shortcuts

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