common

package
v0.0.0-...-232ca4f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestFileName = "kagent.yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	Name          string
	Directory     string
	Verbose       bool
	Instruction   string
	ModelProvider string
	ModelName     string
	Framework     string
	Language      string
	KagentVersion string
	McpServers    []McpServerType
	EnvVars       []string
}

AgentConfig holds the configuration for agent project generation

func (AgentConfig) GetDirectory

func (c AgentConfig) GetDirectory() string

Implement ProjectConfig interface for AgentConfig

func (AgentConfig) IsVerbose

func (c AgentConfig) IsVerbose() bool

func (AgentConfig) ShouldInitGit

func (c AgentConfig) ShouldInitGit() bool

func (AgentConfig) ShouldSkipPath

func (c AgentConfig) ShouldSkipPath(path string) bool

type AgentManifest

type AgentManifest struct {
	Name          string          `yaml:"agentName"`
	Language      string          `yaml:"language"`
	Framework     string          `yaml:"framework"`
	ModelProvider string          `yaml:"modelProvider"`
	ModelName     string          `yaml:"modelName"`
	Description   string          `yaml:"description"`
	McpServers    []McpServerType `yaml:"mcpServers,omitempty" json:"mcpServers,omitempty"`
	UpdatedAt     time.Time       `yaml:"updatedAt,omitempty"`
}

AgentManifest represents the agent project configuration and metadata

func NewProjectManifest

func NewProjectManifest(agentName, language, framework, modelProvider, modelName, description string, mcpServers []McpServerType) *AgentManifest

NewProjectManifest creates a new AgentManifest with the given values

type BaseGenerator

type BaseGenerator struct {
	*generator.BaseGenerator
}

BaseGenerator provides common functionality for all project generators. This now wraps the shared generator.BaseGenerator.

func NewBaseGenerator

func NewBaseGenerator(templateFiles fs.FS) *BaseGenerator

NewBaseGenerator creates a new base generator that uses the shared generator

func (*BaseGenerator) GenerateProject

func (g *BaseGenerator) GenerateProject(config AgentConfig) error

GenerateProject generates a new project using the provided templates. This delegates to the shared generator implementation.

func (*BaseGenerator) RenderTemplate

func (g *BaseGenerator) RenderTemplate(tmplContent string, data any) (string, error)

RenderTemplate renders a template string with the provided data. This delegates to the shared generator implementation.

type Manager

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

Manager handles loading and saving of agent manifests

func NewManifestManager

func NewManifestManager(projectRoot string) *Manager

NewManifestManager creates a new manifest manager for the given project root

func (*Manager) Load

func (m *Manager) Load() (*AgentManifest, error)

Load reads and parses the kagent.yaml file

func (*Manager) Save

func (m *Manager) Save(manifest *AgentManifest) error

Save writes the manifest to kagent.yaml

func (*Manager) Validate

func (m *Manager) Validate(manifest *AgentManifest) error

Validate checks if the manifest is valid

type McpServerType

type McpServerType struct {
	Type    string            `yaml:"type" json:"type"`
	Name    string            `yaml:"name" json:"name"`
	Image   string            `yaml:"image,omitempty" json:"image,omitempty"`
	Build   string            `yaml:"build,omitempty" json:"build,omitempty"`
	Command string            `yaml:"command,omitempty" json:"command,omitempty"`
	Args    []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Env     []string          `yaml:"env,omitempty" json:"env,omitempty"`
	URL     string            `yaml:"url,omitempty" json:"url,omitempty"`
	Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
}

McpServerType represents a single MCP server configuration

Jump to

Keyboard shortcuts

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