api

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentStatus

type AgentStatus struct {
	// Core identification
	Name   string `json:"name"`
	Status string `json:"status"` // "running", "stopped", "error", "unavailable"

	// Variant: "local" (container-based) or "remote" (A2A only)
	Variant string `json:"variant"`

	// Container fields (populated for local/container-based agents)
	Image       string                `json:"image,omitempty"`
	ContainerID string                `json:"containerId,omitempty"`
	Uses        []config.ToolSelector `json:"uses,omitempty"`

	// A2A fields (populated when agent has A2A capability)
	HasA2A      bool     `json:"hasA2A"`
	Role        string   `json:"role,omitempty"`        // "local" or "remote"
	URL         string   `json:"url,omitempty"`         // A2A endpoint URL
	Endpoint    string   `json:"endpoint,omitempty"`    // A2A RPC endpoint
	SkillCount  int      `json:"skillCount,omitempty"`  // Number of A2A skills
	Skills      []string `json:"skills,omitempty"`      // A2A skill names
	Description string   `json:"description,omitempty"` // Agent description
}

AgentStatus contains unified status for all agents (local containers and remote A2A). This merges container state with A2A protocol state into a single representation.

type MCPServerStatus

type MCPServerStatus struct {
	Name         string   `json:"name"`
	Transport    string   `json:"transport"`
	Endpoint     string   `json:"endpoint"`
	Initialized  bool     `json:"initialized"`
	ToolCount    int      `json:"toolCount"`
	Tools        []string `json:"tools"`
	External     bool     `json:"external"`
	LocalProcess bool     `json:"localProcess"`
	SSH          bool     `json:"ssh"`
	SSHHost      string   `json:"sshHost,omitempty"`
}

MCPServerStatus mirrors the mcp.MCPServerStatus type for API responses.

type ResourceStatus

type ResourceStatus struct {
	Name   string `json:"name"`
	Image  string `json:"image"`
	Status string `json:"status"`
}

ResourceStatus contains status information for a resource container.

type Server

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

Server provides the combined API server for gridctl.

func NewServer

func NewServer(gateway *mcp.Gateway, staticFS fs.FS) *Server

NewServer creates a new API server.

func (*Server) A2AGateway

func (s *Server) A2AGateway() *a2a.Gateway

A2AGateway returns the A2A gateway.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the main HTTP handler.

func (*Server) SetA2AGateway

func (s *Server) SetA2AGateway(a2aGateway *a2a.Gateway)

SetA2AGateway sets the A2A gateway for agent-to-agent communication.

func (*Server) SetDockerClient

func (s *Server) SetDockerClient(cli dockerclient.DockerClient)

SetDockerClient sets the Docker client for container operations.

func (*Server) SetStackName

func (s *Server) SetStackName(name string)

SetStackName sets the stack name for container lookups.

type ServerInfo

type ServerInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

ServerInfo mirrors the mcp.ServerInfo type for API responses.

Jump to

Keyboard shortcuts

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