Documentation
¶
Overview ¶
Package scaffold creates new agents and pipelines from embedded templates.
Index ¶
- Variables
- func CopyAgent(ctx context.Context, agentsDir, from, to string, force bool) error
- func CreateAgent(ctx context.Context, opts CreateOptions) error
- func CreatePipeline(ctx context.Context, opts CreatePipelineOptions) error
- func IsValidAgentName(name string) bool
- func ListTemplates() ([]string, error)
- func Render(name string, data AgentData) (string, error)
- func ToTitleCase(name string) string
- type AgentData
- type CreateOptions
- type CreatePipelineOptions
- type PipelineData
Constants ¶
This section is empty.
Variables ¶
var AgentTemplates embed.FS
AgentTemplates holds the embedded scaffolding templates used to generate new agents and pipelines.
var LangFilePatterns = map[string]string{
"go": "**/*.go",
"python": "**/*.py",
"bash": "**/*.sh",
"ansible": "**/*.yml",
"generic": "**/*",
}
LangFilePatterns maps language to glob patterns for scaffolded agents.
var LangVerifyCommands = map[string]string{
"go": "go build ./... && go test ./...",
"python": "ruff check . && python -m py_compile *.py",
"bash": "shellcheck *.sh",
"ansible": "ansible-lint",
"generic": "",
}
LangVerifyCommands maps language to verification commands for scaffolded agents.
Functions ¶
func CreateAgent ¶
func CreateAgent(ctx context.Context, opts CreateOptions) error
CreateAgent scaffolds a new agent from templates.
func CreatePipeline ¶
func CreatePipeline(ctx context.Context, opts CreatePipelineOptions) error
CreatePipeline scaffolds a new pipeline config from templates.
func IsValidAgentName ¶
IsValidAgentName reports whether name is a valid agent name.
func ListTemplates ¶
ListTemplates returns the names of all embedded template files.
func ToTitleCase ¶
ToTitleCase converts hyphenated-name to Title Case.
Types ¶
type AgentData ¶
type AgentData struct {
Name string // e.g. "xss-testing"
NameTitle string // e.g. "XSS Testing"
Description string // e.g. "XSS vulnerability scanner"
Lang string // e.g. "go", "python", "bash", "ansible", "generic"
Version string // e.g. "0.1.0"
}
AgentData contains the data for rendering agent templates.
type CreateOptions ¶
type CreateOptions struct {
Name string
Lang string
Description string
AgentsDir string
Force bool
}
CreateOptions configures agent scaffolding.
type CreatePipelineOptions ¶
CreatePipelineOptions configures pipeline scaffolding.
type PipelineData ¶
type PipelineData struct {
Name string // e.g. "security-pipeline"
Description string // e.g. "Security analysis pipeline"
}
PipelineData contains the data for rendering pipeline templates.