agentcard

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentStatus

type AgentStatus string

AgentStatus represents the current status of an agent.

const (
	StatusOnline   AgentStatus = "online"
	StatusOffline  AgentStatus = "offline"
	StatusDegraded AgentStatus = "degraded"
)

type AuthInfo

type AuthInfo struct {
	Type   string            `json:"type,omitempty"` // bearer, mtls, api_key, none
	Params map[string]string `json:"params,omitempty"`
}

AuthInfo describes the authentication method for an agent.

type Card

type Card struct {
	ID            string              `json:"id"`
	Name          string              `json:"name"`
	Description   string              `json:"description,omitempty"`
	Version       string              `json:"version,omitempty"`
	PublicKey     string              `json:"public_key,omitempty"`
	Capabilities  []string            `json:"capabilities,omitempty"`
	Skills        []Skill             `json:"skills,omitempty"` // A2A-compatible structured skills
	Tools         []Tool              `json:"tools,omitempty"`  // MCP-compatible tool definitions
	Endpoint      Endpoint            `json:"endpoint"`
	Protocols     []protocol.Protocol `json:"protocols"`
	Auth          AuthInfo            `json:"auth,omitempty"`
	Metadata      map[string]string   `json:"metadata,omitempty"`
	PeerClaw      PeerClawExtension   `json:"peerclaw,omitempty"`
	Status        AgentStatus         `json:"status"`
	RegisteredAt  time.Time           `json:"registered_at"`
	LastHeartbeat time.Time           `json:"last_heartbeat"`
}

Card represents an AI agent's identity and capabilities, compatible with the A2A Agent Card standard with PeerClaw extensions.

func (*Card) HasCapability

func (c *Card) HasCapability(cap string) bool

HasCapability checks if the agent advertises a given capability.

func (*Card) HasSkill

func (c *Card) HasSkill(name string) bool

HasSkill checks if the agent advertises a given skill by name.

func (*Card) HasTool

func (c *Card) HasTool(name string) bool

HasTool checks if the agent advertises a given tool by name.

func (*Card) SupportsProtocol

func (c *Card) SupportsProtocol(p protocol.Protocol) bool

SupportsProtocol checks if the agent supports a given protocol.

type Endpoint

type Endpoint struct {
	URL       string             `json:"url"`
	Host      string             `json:"host,omitempty"`
	Port      int                `json:"port,omitempty"`
	Transport protocol.Transport `json:"transport,omitempty"`
}

Endpoint defines the network location for reaching an agent.

type PeerClawExtension

type PeerClawExtension struct {
	NATType         string   `json:"nat_type,omitempty"`         // full_cone, restricted, symmetric, none
	RelayPreference string   `json:"relay_preference,omitempty"` // direct, relay, auto
	Priority        int      `json:"priority,omitempty"`
	Tags            []string `json:"tags,omitempty"`
	NostrPubKey     string   `json:"nostr_pubkey,omitempty"`
	DHTNodeID       string   `json:"dht_node_id,omitempty"`
	ReputationScore float64  `json:"reputation_score,omitempty"`
	NostrRelays     []string `json:"nostr_relays,omitempty"`
	InboxRelays     []string `json:"inbox_relays,omitempty"` // Nostr relay URLs for offline mailbox (NIP-65 style)
	IdentityAnchor  string   `json:"identity_anchor,omitempty"`
	PublicEndpoint  bool     `json:"public_endpoint,omitempty"` // Owner opts-in to expose endpoint URL publicly
}

PeerClawExtension contains PeerClaw-specific fields beyond the A2A standard.

type Skill

type Skill struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	InputModes  []string `json:"input_modes,omitempty"`
	OutputModes []string `json:"output_modes,omitempty"`
}

Skill represents a structured capability the agent can perform (A2A-compatible).

type Tool

type Tool struct {
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	InputSchema json.RawMessage `json:"input_schema,omitempty"`
}

Tool represents an MCP-compatible tool definition.

Jump to

Keyboard shortcuts

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