lint

package
v0.0.0-...-089f37a Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 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 lint grades an A2A agent card against the A2A 1.0 AgentCard definition.

It reads the raw JSON instead of a decoded a2a.AgentCard. The most common real-world failures (an array where an object belongs, a 0.x field layout) are exactly the ones a typed decoder either rejects with one opaque error or silently drops.

Index

Constants

View Source
const (
	// WellKnownPath is where A2A 1.0 clients look for a card (spec 8.2, 14).
	WellKnownPath = "/.well-known/agent-card.json"
	// LegacyWellKnownPath is the pre-1.0 location that 1.0 clients don't check.
	LegacyWellKnownPath = "/.well-known/agent.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetched

type Fetched struct {
	// CardURL is the URL that served the card.
	CardURL string
	Raw     []byte
	Latency time.Duration
	// Report already includes findings about where the card was served.
	Report Report
}

Fetched is a card as it was served.

func Fetch

func Fetch(ctx context.Context, client *http.Client, target string) (*Fetched, error)

Fetch downloads and checks the card for an agent. target is either the agent's base URL, in which case the well-known path is tried and then the legacy path, or a full card URL.

type Finding

type Finding struct {
	Severity Severity `json:"severity"`
	// Path points at the offending field, for example "skills[0].tags".
	Path    string `json:"path"`
	Message string `json:"message"`
}

Finding is one problem found in a card.

type Grade

type Grade string

Grade summarizes a Report.

const (
	// GradeConformant means no findings at all.
	GradeConformant Grade = "conformant"
	// GradeNearConformant means only warnings.
	GradeNearConformant Grade = "near-conformant"
	// GradeNonConformant means at least one error.
	GradeNonConformant Grade = "non-conformant"
)

type Report

type Report struct {
	Grade    Grade     `json:"grade"`
	Findings []Finding `json:"findings"`
}

Report is the result of checking one card.

func Check

func Check(raw []byte) Report

Check grades the raw JSON of an agent card.

func (Report) Count

func (r Report) Count(s Severity) int

Count returns the number of findings with the given severity.

type Severity

type Severity string

Severity says whether a finding breaks clients or only weakens the card.

const (
	// SeverityError means an A2A 1.0 client can't reliably consume the card.
	SeverityError Severity = "error"
	// SeverityWarning means the card is usable but misses something the spec asks for.
	SeverityWarning Severity = "warning"
)

Jump to

Keyboard shortcuts

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