application

package
v0.212.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AgentContainerPrefix is the naming prefix for agent containers
	AgentContainerPrefix = "inference-agent-"
)

Variables

This section is empty.

Functions

func AgentNameFromURL added in v0.207.0

func AgentNameFromURL(url string) string

AgentNameFromURL derives a display name (the bare host) from an agent URL.

func ExternalAgents added in v0.207.0

func ExternalAgents(cfg *config.Config, agents *config.AgentsConfig) map[string]string

ExternalAgents returns the agents probed over the network rather than started here, keyed by display name. It mirrors A2AClient.GetConfiguredAgents: INFER_A2A_AGENTS when set (it overrides agents.yaml for the tools too), else the run: false entries of agents.yaml (run: true ones are probed as local).

Types

type A2AAgentService

type A2AAgentService interface {
	GetAgentCards(ctx context.Context) ([]*CachedAgentCard, error)
	GetConfiguredAgents() []string
}

A2AAgentService manages A2A agent operations

type A2AClient added in v0.207.0

type A2AClient struct {
	// contains filtered or unexported fields
}

func NewA2AAgentService added in v0.178.1

func NewA2AAgentService(cfg *config.Config) *A2AClient

func (*A2AClient) GetAgentCard added in v0.207.0

func (s *A2AClient) GetAgentCard(ctx context.Context, agentURL string) (*adk.AgentCard, error)

func (*A2AClient) GetAgentCards added in v0.207.0

func (s *A2AClient) GetAgentCards(ctx context.Context) ([]*CachedAgentCard, error)

func (*A2AClient) GetConfiguredAgents added in v0.207.0

func (s *A2AClient) GetConfiguredAgents() []string

type AgentStatus added in v0.195.0

type AgentStatus struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	State string `json:"state"`
	Error string `json:"error,omitempty"`
}

AgentStatus is the probe result for one configured A2A agent.

type AgentSupervisor added in v0.207.0

type AgentSupervisor struct {
	// contains filtered or unexported fields
}

AgentSupervisor manages the lifecycle of A2A agent containers (local and external)

func NewAgentSupervisor added in v0.207.0

func NewAgentSupervisor(sessionID convdomain.SessionID, cfg *config.Config, agentsConfig *config.AgentsConfig, runtime containerruntime.ContainerRuntime, a2aService A2AAgentService) *AgentSupervisor

NewAgentSupervisor creates a new agent manager

func (*AgentSupervisor) IsRunning added in v0.207.0

func (am *AgentSupervisor) IsRunning() bool

IsRunning returns whether any agents are running

func (*AgentSupervisor) SetPullProgressCallback added in v0.207.0

func (am *AgentSupervisor) SetPullProgressCallback(callback func(agentName string, done, total int))

SetPullProgressCallback sets the callback function for image pull progress updates

func (*AgentSupervisor) SetStatusCallback added in v0.207.0

func (am *AgentSupervisor) SetStatusCallback(callback func(agentName string, state agentdomain.AgentState, message string, url string, image string))

SetStatusCallback sets the callback function for agent status updates

func (*AgentSupervisor) StartAgent added in v0.207.0

func (am *AgentSupervisor) StartAgent(ctx context.Context, agent config.AgentEntry) error

StartAgent starts a single agent container with status updates

func (*AgentSupervisor) StartAgents added in v0.207.0

func (am *AgentSupervisor) StartAgents(ctx context.Context) error

StartAgents starts all local agents (run: true) and monitors external agents

func (*AgentSupervisor) StopAgent added in v0.207.0

func (am *AgentSupervisor) StopAgent(ctx context.Context, agentName string) error

StopAgent stops a single agent container

func (*AgentSupervisor) StopAgentByName added in v0.207.0

func (am *AgentSupervisor) StopAgentByName(ctx context.Context, agentName string) error

StopAgentByName stops this session's container for the agent even when this process did not start it. With the shared session id it stops the detached container started by `infer agents start`.

func (*AgentSupervisor) StopAgents added in v0.207.0

func (am *AgentSupervisor) StopAgents(ctx context.Context) error

StopAgents stops all running agent containers, cancels liveness probes, and cleans up the network

func (*AgentSupervisor) WaitForAgentsReady added in v0.207.0

func (am *AgentSupervisor) WaitForAgentsReady(ctx context.Context)

WaitForAgentsReady blocks until every run:true agent started by StartAgents has settled (ready or failed), or ctx is done. Headless mode calls this before the first LLM turn so the model never races an agent whose 3GB image is still pulling; failed agents settle too, so a broken agent can't block forever. Chat mode never calls it (the TUI streams status instead).

type AgentsStatusReport added in v0.195.0

type AgentsStatusReport struct {
	TotalAgents int           `json:"total_agents"`
	ReadyAgents int           `json:"ready_agents"`
	Agents      []AgentStatus `json:"agents"`
}

AgentsStatusReport mirrors the TUI's "A2A: ready/total" indicator plus a per-agent breakdown.

func ProbeAgents added in v0.195.0

func ProbeAgents(ctx context.Context, agents []config.AgentEntry, externalURLs []string) AgentsStatusReport

ProbeAgents fetches each agent's card once, the same check the liveness probes use, and reports what a fresh session would see. Local run:true agents are only reachable while a session (or a detached container) has them running.

type CachedAgentCard

type CachedAgentCard struct {
	Card      *adk.AgentCard `json:"card"`
	URL       string         `json:"url"`
	FetchedAt time.Time      `json:"fetched_at"`
}

CachedAgentCard represents a cached agent card with metadata

Jump to

Keyboard shortcuts

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