Documentation
¶
Overview ¶
Package scaffold provides project scaffolding and template generation functionality.
Package scaffold provides project scaffolding and template generation functionality.
Package scaffold provides project scaffolding and template generation functionality.
Index ¶
- Constants
- func RenderTemplate(templatePath string, data TemplateData) (string, error)
- type AdvancedGenerator
- type ConfigDrivenGenerator
- type GenerateOptions
- type MCPToolsGenerator
- type MultiAgentGenerator
- type QuickstartGenerator
- type Service
- type SingleAgentGenerator
- type TemplateData
- type TemplateGenerator
- type TemplateMetadata
- type TemplateRegistry
- type TemplateType
- type WorkflowGenerator
Constants ¶
const ( DefaultGpt4Turbo = "gpt-4-turbo" ProviderAnthropic = "anthropic" ProviderOllama = "ollama" ProviderOpenAI = "openai" ProviderAzure = "azure" )
Variables ¶
This section is empty.
Functions ¶
func RenderTemplate ¶
func RenderTemplate(templatePath string, data TemplateData) (string, error)
RenderTemplate renders a template file with the provided data
Types ¶
type AdvancedGenerator ¶
type AdvancedGenerator struct{}
AdvancedGenerator generates an advanced template
func NewAdvancedGenerator ¶
func NewAdvancedGenerator() *AdvancedGenerator
func (*AdvancedGenerator) Generate ¶
func (g *AdvancedGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*AdvancedGenerator) GetMetadata ¶
func (g *AdvancedGenerator) GetMetadata() TemplateMetadata
type ConfigDrivenGenerator ¶
type ConfigDrivenGenerator struct{}
ConfigDrivenGenerator generates a config-driven template
func NewConfigDrivenGenerator ¶
func NewConfigDrivenGenerator() *ConfigDrivenGenerator
func (*ConfigDrivenGenerator) Generate ¶
func (g *ConfigDrivenGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*ConfigDrivenGenerator) GetMetadata ¶
func (g *ConfigDrivenGenerator) GetMetadata() TemplateMetadata
type GenerateOptions ¶
type GenerateOptions struct {
ProjectName string
ProjectPath string
Template string
Interactive bool
Force bool
Description string
LLMProvider string
AgentType string
}
GenerateOptions contains options for project generation
type MCPToolsGenerator ¶
type MCPToolsGenerator struct{}
MCPToolsGenerator generates an MCP-enabled agent template
func NewMCPToolsGenerator ¶
func NewMCPToolsGenerator() *MCPToolsGenerator
func (*MCPToolsGenerator) Generate ¶
func (g *MCPToolsGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*MCPToolsGenerator) GetMetadata ¶
func (g *MCPToolsGenerator) GetMetadata() TemplateMetadata
type MultiAgentGenerator ¶
type MultiAgentGenerator struct{}
MultiAgentGenerator generates a multi-agent template
func NewMultiAgentGenerator ¶
func NewMultiAgentGenerator() *MultiAgentGenerator
func (*MultiAgentGenerator) Generate ¶
func (g *MultiAgentGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*MultiAgentGenerator) GetMetadata ¶
func (g *MultiAgentGenerator) GetMetadata() TemplateMetadata
type QuickstartGenerator ¶
type QuickstartGenerator struct{}
QuickstartGenerator implements TemplateGenerator for quickstart template
func NewQuickstartGenerator ¶
func NewQuickstartGenerator() *QuickstartGenerator
func (*QuickstartGenerator) Generate ¶
func (g *QuickstartGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*QuickstartGenerator) GetMetadata ¶
func (g *QuickstartGenerator) GetMetadata() TemplateMetadata
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles project scaffolding and generation
func NewService ¶
NewService creates a new scaffold service
func (*Service) GenerateProject ¶
func (s *Service) GenerateProject(ctx context.Context, opts GenerateOptions) error
GenerateProject generates a new project with the given options
type SingleAgentGenerator ¶
type SingleAgentGenerator struct{}
SingleAgentGenerator generates a single-agent template
func NewSingleAgentGenerator ¶
func NewSingleAgentGenerator() *SingleAgentGenerator
func (*SingleAgentGenerator) Generate ¶
func (g *SingleAgentGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*SingleAgentGenerator) GetMetadata ¶
func (g *SingleAgentGenerator) GetMetadata() TemplateMetadata
type TemplateData ¶
type TemplateData struct {
ProjectName string
WorkflowName string
LLMModel string
LLMProvider string
Description string
AgentType string
APIKeyEnv string
}
TemplateData holds data for template rendering
type TemplateGenerator ¶
type TemplateGenerator interface {
// Generate creates the project structure and files for the template
Generate(ctx context.Context, opts GenerateOptions) error
// GetMetadata returns metadata about the template
GetMetadata() TemplateMetadata
}
TemplateGenerator defines the interface for template generators
func GetTemplateGenerator ¶
func GetTemplateGenerator(templateType TemplateType) (TemplateGenerator, error)
GetTemplateGenerator returns the appropriate template generator for the given template type
type TemplateMetadata ¶
type TemplateMetadata struct {
Name string
Description string
Complexity string
FileCount int
Features []string
}
TemplateMetadata contains information about a template
func GetAllTemplates ¶
func GetAllTemplates() []TemplateMetadata
GetAllTemplates returns all available templates
type TemplateRegistry ¶
type TemplateRegistry struct{}
TemplateRegistry provides information about all available templates
func NewTemplateRegistry ¶
func NewTemplateRegistry() *TemplateRegistry
NewTemplateRegistry creates a new template registry
func (*TemplateRegistry) GetTemplate ¶
func (r *TemplateRegistry) GetTemplate(templateType TemplateType) (TemplateMetadata, error)
GetTemplate returns metadata for a specific template
func (*TemplateRegistry) ListTemplates ¶
func (r *TemplateRegistry) ListTemplates() []TemplateMetadata
ListTemplates returns all available templates
type TemplateType ¶
type TemplateType string
TemplateType represents the type of template to generate
const ( TemplateQuickstart TemplateType = "quickstart" TemplateSingleAgent TemplateType = "single-agent" TemplateMultiAgent TemplateType = "multi-agent" TemplateConfigDriven TemplateType = "config-driven" TemplateAdvanced TemplateType = "advanced" TemplateMCPTools TemplateType = "mcp-tools" TemplateWorkflow TemplateType = "workflow" )
Template type constants
func ValidateTemplate ¶
func ValidateTemplate(templateStr string) (TemplateType, error)
ValidateTemplate validates and returns a TemplateType from a string
type WorkflowGenerator ¶
type WorkflowGenerator struct{}
WorkflowGenerator generates a streaming workflow template
func NewWorkflowGenerator ¶
func NewWorkflowGenerator() *WorkflowGenerator
func (*WorkflowGenerator) Generate ¶
func (g *WorkflowGenerator) Generate(ctx context.Context, opts GenerateOptions) error
func (*WorkflowGenerator) GetMetadata ¶
func (g *WorkflowGenerator) GetMetadata() TemplateMetadata