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

card

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(card *A2ACard) error

Validate checks that the required fields of an A2ACard are present and valid.

Types

type A2ACard

type A2ACard struct {
	ProtocolVersion    string           `json:"protocolVersion"`
	Name               string           `json:"name"`
	Description        string           `json:"description"`
	URL                string           `json:"url"`
	Version            string           `json:"version"`
	Capabilities       CardCapabilities `json:"capabilities"`
	Skills             []Skill          `json:"skills"`
	DefaultInputModes  []string         `json:"defaultInputModes"`
	DefaultOutputModes []string         `json:"defaultOutputModes"`
	Provider           *Provider        `json:"provider,omitempty"`
}

A2ACard is a valid A2A (Agent-to-Agent) agent card.

func Generate

func Generate(agent *AgentYAML) *A2ACard

Generate produces a valid A2A agent card from an AgentYAML definition.

func (*A2ACard) ToJSON

func (c *A2ACard) ToJSON() ([]byte, error)

ToJSON serialises the card to indented JSON.

type AgentYAML

type AgentYAML struct {
	Name         string           `yaml:"name"        json:"name"`
	Description  string           `yaml:"description" json:"description"`
	Version      string           `yaml:"version"     json:"version"`
	Endpoint     string           `yaml:"endpoint"    json:"endpoint"`
	Capabilities []YAMLCapability `yaml:"capabilities" json:"capabilities"`
	Pricing      YAMLPricing      `yaml:"pricing"     json:"pricing"`
	Policy       YAMLPolicy       `yaml:"policy"      json:"policy"`
	Registries   []string         `yaml:"registries"  json:"registries"`
}

AgentYAML mirrors the structure of agent.yaml for card generation.

type CardCapabilities

type CardCapabilities struct {
	Streaming         bool `json:"streaming"`
	PushNotifications bool `json:"pushNotifications"`
}

CardCapabilities describes what the agent can do at the protocol level.

type Provider

type Provider struct {
	Organization string `json:"organization,omitempty"`
	URL          string `json:"url,omitempty"`
}

Provider holds optional provider metadata.

type Skill

type Skill struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
}

Skill represents a single capability the agent offers.

type YAMLAcceptance

type YAMLAcceptance struct {
	PerTransactionLimit float64 `yaml:"per_transaction_limit,omitempty" json:"perTransactionLimit,omitempty"`
	DailyCap            float64 `yaml:"daily_cap,omitempty"             json:"dailyCap,omitempty"`
	MonthlyCap          float64 `yaml:"monthly_cap,omitempty"           json:"monthlyCap,omitempty"`
	ApprovalThreshold   float64 `yaml:"approval_above,omitempty"        json:"approvalThreshold,omitempty"`
}

Which INBOUND calls this agent takes — not a financial safeguard (being paid isn't a risk), it throttles call volume/workload exposure. See YAMLSpending for the real financial guardrail (outbound hiring spend).

type YAMLCapability

type YAMLCapability struct {
	ID          string `yaml:"id"          json:"id"`
	Description string `yaml:"description" json:"description"`
}

type YAMLPolicy

type YAMLPolicy struct {
	Acceptance YAMLAcceptance `yaml:"acceptance" json:"acceptance"`
	Spending   YAMLSpending   `yaml:"spending"   json:"spending"`
	Currency   string         `yaml:"currency"   json:"currency"`
}

type YAMLPricing

type YAMLPricing struct {
	Model    string `yaml:"model"    json:"model"`
	Amount   string `yaml:"amount"   json:"amount"`
	Currency string `yaml:"currency" json:"currency"`
}

type YAMLSpending

type YAMLSpending struct {
	PerTransactionLimit float64 `yaml:"per_transaction_limit,omitempty" json:"perTransactionLimit,omitempty"`
	DailyCap            float64 `yaml:"daily_cap,omitempty"             json:"dailyCap,omitempty"`
	MonthlyCap          float64 `yaml:"monthly_cap,omitempty"           json:"monthlyCap,omitempty"`
}

How much this agent may pay OUT of its own wallet when it hires another agent to help complete a task — real money leaving the wallet.

Jump to

Keyboard shortcuts

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