config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

options.go provides shared option definitions for CLI and TUI.

Index

Constants

View Source
const (
	PersonaMinimal    = "minimal"    // MVP, prototype - ship fast, iterate later
	PersonaBalanced   = "balanced"   // Pragmatic defaults - essential quality
	PersonaProduction = "production" // Enterprise-grade - comprehensive, scalable
)

Persona constants define implementation styles

View Source
const (
	ModeCreate = "create" // Create a new codebase from scratch (default)
	ModeModify = "modify" // Modify an existing codebase
)

Mode constants define execution modes

View Source
const (
	VerbosityNormal  = "normal"
	VerbosityVerbose = "verbose"
	VerbosityQuiet   = "quiet"
)

VerbosityNormal, VerbosityVerbose, VerbosityQuiet are verbosity constants

View Source
const (
	ExecutionParallel   = "parallel"
	ExecutionSequential = "sequential"
)

ExecutionParallel, ExecutionSequential are execution mode constants

View Source
const (
	ResumeModeNormal = "normal"
	ResumeModeResume = "resume"
	ResumeModeForce  = "force"
)

ResumeModeNormal, ResumeModeResume, ResumeModeForce are resume mode constants

View Source
const (
	ArchitectureConfig    = "config"
	ArchitectureStateless = "stateless"
	ArchitectureDatabase  = "database"
)

ArchitectureConfig, ArchitectureStateless, ArchitectureDatabase are architecture constants

Variables

View Source
var ArchitectureOptions = []Option{
	{Value: ArchitectureConfig, Label: "From config", Description: "Use config setting"},
	{Value: ArchitectureStateless, Label: "Stateless", Description: "Prefer stateless"},
	{Value: ArchitectureDatabase, Label: "Database", Description: "DB-backed"},
}
View Source
var ExecutionOptions = []Option{
	{Value: ExecutionParallel, Label: "Parallel", Description: "Faster, respects dependencies"},
	{Value: ExecutionSequential, Label: "Sequential", Description: "One at a time"},
}
View Source
var PersonaOptions = []Option{
	{Value: PersonaMinimal, Label: "Minimal", Description: "MVP focus"},
	{Value: PersonaBalanced, Label: "Balanced", Description: "Standard"},
	{Value: PersonaProduction, Label: "Production", Description: "Enterprise"},
}

Shared option definitions - SINGLE SOURCE OF TRUTH

View Source
var ResumeModeOptions = []Option{
	{Value: ResumeModeNormal, Label: "Normal", Description: "Regenerate all"},
	{Value: ResumeModeResume, Label: "Resume", Description: "Skip existing"},
	{Value: ResumeModeForce, Label: "Force", Description: "Overwrite all"},
}
View Source
var ValidModes = []string{ModeCreate, ModeModify}

ValidModes lists all valid mode values

ValidPersonas lists all valid persona values

View Source
var VerbosityOptions = []Option{
	{Value: VerbosityNormal, Label: "Normal", Description: "Standard output"},
	{Value: VerbosityVerbose, Label: "Verbose", Description: "Debug info"},
	{Value: VerbosityQuiet, Label: "Quiet", Description: "Errors only"},
}

Functions

func IsValidMode

func IsValidMode(m string) bool

IsValidMode checks if a mode string is valid

func IsValidPersona

func IsValidPersona(p string) bool

IsValidPersona checks if a persona string is valid

Types

type AgentConfig

type AgentConfig struct {
	Prompt     string   `yaml:"prompt"`      // Inline prompt (takes precedence)
	PromptFile string   `yaml:"prompt_file"` // Path to prompt template file
	Output     string   `yaml:"output"`
	DependsOn  []string `yaml:"depends_on"`
}

AgentConfig represents a single agent's configuration

type ArchitecturePreferences

type ArchitecturePreferences = types.ArchitecturePreferences

Type aliases for backward compatibility and convenience These reference the canonical types in the types package

func DefaultPreferences

func DefaultPreferences() ArchitecturePreferences

DefaultPreferences returns the default architecture preferences These are neutral defaults that work for most projects

type Config

type Config struct {
	OutputDir   string                  `yaml:"output_dir"`
	Timeout     int                     `yaml:"timeout"`
	Persona     string                  `yaml:"persona"`     // Implementation style: minimal, balanced, production
	Stack       TechStack               `yaml:"stack"`       // Technology stack preferences
	Preferences ArchitecturePreferences `yaml:"preferences"` // Architectural style preferences
	ResumeMode  bool                    `yaml:"-"`           // Set via CLI flag, not config file
	ForceMode   bool                    `yaml:"-"`           // Set via CLI flag, not config file
	Agents      map[string]AgentConfig  `yaml:"agents"`

	// Mode-specific configuration for existing codebase modifications
	Mode           string   `yaml:"mode"`             // "create" (default) or "modify"
	TargetCodebase string   `yaml:"target_codebase"`  // Path to existing codebase (required for modify mode)
	InputFiles     []string `yaml:"input_files"`      // Multiple input files (TRD, requirements, etc.)
	SpecsOutputDir string   `yaml:"specs_output_dir"` // Directory for spec outputs (default: output_dir)

	// Post-processing options
	PostProcessing PostProcessingConfig `yaml:"post_processing"`
}

Config represents the pagent configuration

func Default

func Default() *Config

Default returns the default configuration Prompts are loaded from embedded templates (internal/prompt/templates/) Users can override by specifying prompt_file or inline prompt in config

func Load

func Load(path string) (*Config, error)

Load reads config from file, checking multiple locations

func (*Config) ApplyEnvOverrides

func (c *Config) ApplyEnvOverrides()

ApplyEnvOverrides applies environment variable overrides to config

func (*Config) GetAgentNames

func (c *Config) GetAgentNames() []string

GetAgentNames returns sorted list of agent names

func (*Config) GetDependencies

func (c *Config) GetDependencies(agentName string) []string

GetDependencies returns the dependencies for an agent

func (*Config) GetEffectiveCodeOutputDir

func (c *Config) GetEffectiveCodeOutputDir() string

GetEffectiveCodeOutputDir returns the directory where code should be written In modify mode, this is the target codebase; in create mode, it's output_dir/code

func (*Config) GetEffectiveSpecsOutputDir

func (c *Config) GetEffectiveSpecsOutputDir() string

GetEffectiveSpecsOutputDir returns the directory where specs should be written

func (*Config) IsModifyMode

func (c *Config) IsModifyMode() bool

IsModifyMode returns true if the config is set to modify an existing codebase

type Option added in v0.1.0

type Option struct {
	Value       string
	Label       string
	Description string
}

Option represents a selectable option with value and label

type PostProcessingConfig

type PostProcessingConfig struct {
	GenerateDiffSummary   bool     `yaml:"generate_diff_summary"`   // Generate git diff summary
	GeneratePRDescription bool     `yaml:"generate_pr_description"` // Generate PR description from changes
	ValidationCommands    []string `yaml:"validation_commands"`     // Custom commands to run after implementation
}

PostProcessingConfig contains options for post-execution actions

type RunOptions added in v0.1.0

type RunOptions struct {
	InputPath    string
	Agents       []string
	Persona      string
	OutputDir    string
	Sequential   bool
	ResumeMode   string // "normal", "resume", "force"
	Architecture string // "config", "stateless", "database"
	Timeout      int
	ConfigPath   string
	Verbosity    string // "normal", "verbose", "quiet"
}

RunOptions contains all parameters for running agents. This is the single source of truth used by both CLI and TUI.

func DefaultRunOptions added in v0.1.0

func DefaultRunOptions(cfg *Config) RunOptions

DefaultRunOptions returns RunOptions with sensible defaults from config

func (RunOptions) IsQuiet added in v0.1.0

func (o RunOptions) IsQuiet() bool

IsQuiet returns true if verbosity is set to quiet

func (RunOptions) IsVerbose added in v0.1.0

func (o RunOptions) IsVerbose() bool

IsVerbose returns true if verbosity is set to verbose

type TechStack

type TechStack = types.TechStack

Type aliases for backward compatibility and convenience These reference the canonical types in the types package

func DefaultStack

func DefaultStack() TechStack

DefaultStack returns the default technology stack preferences These are widely-used, well-documented technologies

Jump to

Keyboard shortcuts

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