agent

package
v0.0.0-...-a766d22 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MCPServiceLabel              = "kagent.dev/mcp-service"
	MCPServicePathAnnotation     = "kagent.dev/mcp-service-path"
	MCPServicePortAnnotation     = "kagent.dev/mcp-service-port"
	MCPServiceProtocolAnnotation = "kagent.dev/mcp-service-protocol"

	MCPServicePathDefault     = "/mcp"
	MCPServiceProtocolDefault = v1alpha2.RemoteMCPServerProtocolStreamableHttp

	ProxyHostHeader = "x-kagent-host"

	// DefaultMCPServerTimeout is the fallback connection timeout applied when
	// an MCPServer CRD resource does not have an explicit Timeout set (e.g.
	// objects created before the field was introduced). This value mirrors
	// the kubebuilder default on MCPServerSpec.Timeout in the kmcp CRD.
	DefaultMCPServerTimeout = 30 * time.Second
)
View Source
const MAX_DEPTH = 10
View Source
const SkillsInitConfigMapSuffix = "-skills-init"

SkillsInitConfigMapSuffix is appended to the Agent name to form the ConfigMap that carries the skills-init container's JSON config.

Variables

View Source
var DefaultAgentBindHost = "0.0.0.0"

DefaultAgentBindHost is the host address agent pods bind to. Defaults to "0.0.0.0" (IPv4 only). Set to "::" for dual-stack (IPv4+IPv6) support.

View Source
var DefaultAgentPodLabels map[string]string

DefaultAgentPodLabels is a set of labels applied to all agent pod templates. Per-agent labels from the Agent CRD spec take precedence over these defaults.

View Source
var DefaultImageConfig = ImageConfig{
	Registry:   "cr.kagent.dev",
	Tag:        version.Get().Version,
	PullPolicy: string(corev1.PullIfNotPresent),
	PullSecret: "",
	Repository: "kagent-dev/kagent/app",
}
View Source
var DefaultServiceAccountName string

DefaultServiceAccountName is the global default ServiceAccount name for agent pods. When set, agent pods that don't specify an explicit serviceAccountName will use this instead of auto-creating a per-agent ServiceAccount.

View Source
var DefaultSkillsInitImageConfig = ImageConfig{
	Registry:   "cr.kagent.dev",
	Tag:        version.Get().Version,
	PullPolicy: string(corev1.PullIfNotPresent),
	Repository: "kagent-dev/kagent/skills-init",
}

DefaultSkillsInitImageConfig is the image config for the skills-init container that clones skill repositories from Git and pulls OCI skill images.

View Source
var GoADKFullImageDigest string
View Source
var GoADKImageDigest string
View Source
var PythonADKImageDigest string

PythonADKImageDigest, GoADKImageDigest, and GoADKFullImageDigest are set at controller link time from the pushed runtime image manifest digests.

Functions

func ConvertMCPServerToRemoteMCPServer

func ConvertMCPServerToRemoteMCPServer(mcpServer *v1alpha1.MCPServer) (*v1alpha2.RemoteMCPServer, error)

func ConvertServiceToRemoteMCPServer

func ConvertServiceToRemoteMCPServer(svc *corev1.Service) (*v1alpha2.RemoteMCPServer, error)

func GetA2AAgentCard

func GetA2AAgentCard(agent v1alpha2.AgentObject) *a2atype.AgentCard

func NewValidationError

func NewValidationError(format string, args ...any) error

NewValidationError creates a new ValidationError

func SkillsInitConfigMapName

func SkillsInitConfigMapName(agentName string) string

SkillsInitConfigMapName returns the name of the skills-init ConfigMap for the given Agent.

Types

type AdkApiTranslator

type AdkApiTranslator interface {
	CompileAgent(
		ctx context.Context,
		agent v1alpha2.AgentObject,
	) (*AgentManifestInputs, error)
	BuildManifest(
		ctx context.Context,
		agent v1alpha2.AgentObject,
		inputs *AgentManifestInputs,
	) (*AgentOutputs, error)
	GetOwnedResourceTypes() []client.Object
}

func NewAdkApiTranslator

func NewAdkApiTranslator(kube client.Client, defaultModelConfig types.NamespacedName, plugins []TranslatorPlugin, globalProxyURL string, sandboxBackend sandboxbackend.Backend) AdkApiTranslator

func NewAdkApiTranslatorWithWatchedNamespaces

func NewAdkApiTranslatorWithWatchedNamespaces(kube client.Client, watchedNamespaces []string, defaultModelConfig types.NamespacedName, plugins []TranslatorPlugin, globalProxyURL string, sandboxBackend sandboxbackend.Backend, mcpEgressPlaintext bool) AdkApiTranslator

type AgentManifestInputs

type AgentManifestInputs struct {
	Config          *adk.AgentConfig
	Sandbox         *v1alpha2.SandboxConfig
	Deployment      *resolvedDeployment
	AgentCard       *a2a.AgentCard
	SecretHashBytes []byte
}

AgentManifestInputs holds the translated data needed to emit Kubernetes resources.

type AgentOutputs

type AgentOutputs = translator.AgentOutputs

TODO(ilackarms): migrate this whole package to pkg/translator

func TranslateAgent

func TranslateAgent(
	ctx context.Context,
	translator AdkApiTranslator,
	agent v1alpha2.AgentObject,
) (*AgentOutputs, error)

type ImageConfig

type ImageConfig struct {
	Registry   string `json:"registry,omitempty"`
	Tag        string `json:"tag,omitempty"`
	Digest     string `json:"digest,omitempty"` // OCI manifest digest (sha256:...), set at link time
	PullPolicy string `json:"pullPolicy,omitempty"`
	PullSecret string `json:"pullSecret,omitempty"`
	Repository string `json:"repository,omitempty"`
}

func (ImageConfig) Image

func (c ImageConfig) Image() string

Image returns the fully qualified image reference (registry/repository:tag).

func (ImageConfig) PinnedImage

func (c ImageConfig) PinnedImage() string

PinnedImage returns registry/repository@sha256:... when Digest is set, otherwise Image().

type PromptTemplateContext

type PromptTemplateContext struct {
	// AgentName is the metadata.name of the Agent resource.
	AgentName string
	// AgentNamespace is the metadata.namespace of the Agent resource.
	AgentNamespace string
	// Description is the spec.description of the Agent resource.
	Description string
	// ToolNames is the list of tool names from all MCP server tools configured on the agent.
	ToolNames []string
	// SkillNames is the list of skill identifiers configured on the agent.
	SkillNames []string
}

PromptTemplateContext holds the variables available to system message templates.

type TranslatorPlugin

type TranslatorPlugin = translator.TranslatorPlugin

type ValidationError

type ValidationError struct {
	Err error
}

ValidationError indicates a configuration error that requires user action to fix. These errors should not trigger exponential backoff retries.

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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