interfaces

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package interfaces defines audit interfaces.

This file contains interfaces for comprehensive project auditing including security, quality, license, and performance auditing.

Package interfaces defines cache management interfaces.

This file contains interfaces for comprehensive cache management including caching operations, offline mode support, and cache statistics.

Package interfaces defines the core contracts and interfaces for the Open Source Project Generator components.

This package contains interface definitions that enable dependency injection, testing, and modular architecture throughout the application.

Package interfaces defines interactive UI contracts for the CLI generator.

This file contains interface definitions for interactive user interface components that enable guided project generation with menus, selections, and input validation.

Package interfaces defines security-related interfaces for the Open Source Project Generator.

Index

Constants

View Source
const (
	AuditCategorySecurity      = "security"
	AuditCategoryQuality       = "quality"
	AuditCategoryLicense       = "license"
	AuditCategoryPerformance   = "performance"
	AuditCategoryCompliance    = "compliance"
	AuditCategoryBestPractices = "best_practices"
)

AuditCategory defines categories for audit rules

View Source
const (
	AuditSeverityCritical = "critical"
	AuditSeverityHigh     = "high"
	AuditSeverityMedium   = "medium"
	AuditSeverityLow      = "low"
	AuditSeverityInfo     = "info"
)

AuditSeverity defines severity levels for audit issues

View Source
const (
	EvictionReasonTTL      = "ttl"
	EvictionReasonSize     = "size"
	EvictionReasonCapacity = "capacity"
	EvictionReasonManual   = "manual"
	EvictionReasonError    = "error"
)

CacheEvictionReason defines reasons for cache eviction

View Source
const (
	CacheStatusHealthy   = "healthy"
	CacheStatusDegraded  = "degraded"
	CacheStatusUnhealthy = "unhealthy"
	CacheStatusOffline   = "offline"
)

CacheStatus defines cache status values

View Source
const (
	CacheIssueTypeCorruption    = "corruption"
	CacheIssueTypePermission    = "permission"
	CacheIssueTypeDiskSpace     = "disk_space"
	CacheIssueTypePerformance   = "performance"
	CacheIssueTypeConfiguration = "configuration"
)

CacheIssueType defines types of cache issues

View Source
const (
	CacheWarningTypeSize        = "size"
	CacheWarningTypeHitRate     = "hit_rate"
	CacheWarningTypePerformance = "performance"
	CacheWarningTypeExpiration  = "expiration"
)

CacheWarningType defines types of cache warnings

View Source
const (
	ErrorTypeValidation    = "validation"
	ErrorTypeConfiguration = "configuration"
	ErrorTypeTemplate      = "template"
	ErrorTypeNetwork       = "network"
	ErrorTypeFileSystem    = "filesystem"
	ErrorTypePermission    = "permission"
	ErrorTypeCache         = "cache"
	ErrorTypeVersion       = "version"
	ErrorTypeAudit         = "audit"
	ErrorTypeGeneration    = "generation"
	ErrorTypeInternal      = "internal"
)

Error types for categorization

View Source
const (
	ErrorCodeSuccess              = 0
	ErrorCodeGeneral              = 1
	ErrorCodeValidationFailed     = 2
	ErrorCodeConfigurationInvalid = 3
	ErrorCodeTemplateNotFound     = 4
	ErrorCodeNetworkError         = 5
	ErrorCodeFileSystemError      = 6
	ErrorCodePermissionDenied     = 7
	ErrorCodeCacheError           = 8
	ErrorCodeVersionError         = 9
	ErrorCodeAuditFailed          = 10
	ErrorCodeGenerationFailed     = 11
	ErrorCodeInternalError        = 99
)

Error codes for programmatic handling

View Source
const (
	ValidationCategoryStructure     = "structure"
	ValidationCategoryDependencies  = "dependencies"
	ValidationCategorySecurity      = "security"
	ValidationCategoryQuality       = "quality"
	ValidationCategoryConfiguration = "configuration"
	ValidationCategoryTemplate      = "template"
	ValidationCategoryNaming        = "naming"
	ValidationCategoryPermissions   = "permissions"
)

ValidationRuleCategory defines categories for validation rules

View Source
const (
	ValidationSeverityError   = "error"
	ValidationSeverityWarning = "warning"
	ValidationSeverityInfo    = "info"
)

ValidationSeverity defines severity levels for validation issues

View Source
const (
	FixActionReplace = "replace"
	FixActionInsert  = "insert"
	FixActionDelete  = "delete"
	FixActionRename  = "rename"
	FixActionMove    = "move"
	FixActionCreate  = "create"
)

FixAction defines types of fix actions

View Source
const (
	UpdateChannelStable  = "stable"
	UpdateChannelBeta    = "beta"
	UpdateChannelAlpha   = "alpha"
	UpdateChannelNightly = "nightly"
)

UpdateChannel defines update channels

View Source
const (
	UpdateTypeMajor = "major"
	UpdateTypeMinor = "minor"
	UpdateTypePatch = "patch"
)

UpdateType defines types of updates

View Source
const (
	VersionSeverityCritical = "critical"
	VersionSeverityHigh     = "high"
	VersionSeverityMedium   = "medium"
	VersionSeverityLow      = "low"
)

VersionSeverity defines severity levels for version issues

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedOptions

type AdvancedOptions struct {
	GenerateOptions

	// Security options
	EnableSecurityScanning bool     `json:"enable_security_scanning" yaml:"enable_security_scanning"`
	SecurityPolicies       []string `json:"security_policies" yaml:"security_policies"`

	// Quality options
	EnableQualityChecks bool     `json:"enable_quality_checks" yaml:"enable_quality_checks"`
	QualityRules        []string `json:"quality_rules" yaml:"quality_rules"`

	// Performance options
	EnablePerformanceOptimization bool `json:"enable_performance_optimization" yaml:"enable_performance_optimization"`
	BundleOptimization            bool `json:"bundle_optimization" yaml:"bundle_optimization"`

	// Documentation options
	GenerateDocumentation bool     `json:"generate_documentation" yaml:"generate_documentation"`
	DocumentationFormats  []string `json:"documentation_formats" yaml:"documentation_formats"`

	// CI/CD options
	EnableCICD     bool     `json:"enable_cicd" yaml:"enable_cicd"`
	CICDProviders  []string `json:"cicd_providers" yaml:"cicd_providers"`
	DeploymentType string   `json:"deployment_type" yaml:"deployment_type"`

	// Monitoring options
	EnableMonitoring  bool     `json:"enable_monitoring" yaml:"enable_monitoring"`
	MonitoringTools   []string `json:"monitoring_tools" yaml:"monitoring_tools"`
	LoggingFrameworks []string `json:"logging_frameworks" yaml:"logging_frameworks"`
}

AdvancedOptions contains advanced options for project generation

type AuditEngine

type AuditEngine interface {
	// Security auditing
	AuditSecurity(path string) (*SecurityAuditResult, error)
	ScanVulnerabilities(path string) (*VulnerabilityReport, error)
	CheckSecurityPolicies(path string) (*PolicyComplianceResult, error)
	DetectSecrets(path string) (*SecretScanResult, error)

	// Quality auditing
	AuditCodeQuality(path string) (*QualityAuditResult, error)
	CheckBestPractices(path string) (*BestPracticesResult, error)
	AnalyzeDependencies(path string) (*DependencyAnalysisResult, error)
	MeasureComplexity(path string) (*ComplexityAnalysisResult, error)

	// License auditing
	AuditLicenses(path string) (*LicenseAuditResult, error)
	CheckLicenseCompatibility(path string) (*LicenseCompatibilityResult, error)
	ScanLicenseViolations(path string) (*LicenseViolationResult, error)

	// Performance auditing
	AuditPerformance(path string) (*PerformanceAuditResult, error)
	AnalyzeBundleSize(path string) (*BundleAnalysisResult, error)
	CheckPerformanceMetrics(path string) (*PerformanceMetricsResult, error)

	// Comprehensive auditing
	AuditProject(path string, options *AuditOptions) (*AuditResult, error)
	GenerateAuditReport(result *AuditResult, format string) ([]byte, error)
	GetAuditSummary(results []*AuditResult) (*AuditSummary, error)

	// Audit configuration
	SetAuditRules(rules []AuditRule) error
	GetAuditRules() []AuditRule
	AddAuditRule(rule AuditRule) error
	RemoveAuditRule(ruleID string) error
}

AuditEngine defines the interface for comprehensive project auditing operations.

This interface provides enterprise-grade auditing capabilities including:

  • Security vulnerability scanning and policy compliance
  • Code quality analysis and best practices checking
  • License compliance and compatibility checking
  • Performance analysis and optimization recommendations
  • Comprehensive reporting and scoring

type AuditOptions

type AuditOptions struct {
	Security     bool   `json:"security"`
	Quality      bool   `json:"quality"`
	Licenses     bool   `json:"licenses"`
	Performance  bool   `json:"performance"`
	OutputFormat string `json:"output_format"`
	OutputFile   string `json:"output_file"`
	Detailed     bool   `json:"detailed"`
}

AuditOptions defines options for project auditing

type AuditResult

type AuditResult struct {
	ProjectPath     string                  `json:"project_path"`
	AuditTime       time.Time               `json:"audit_time"`
	Security        *SecurityAuditResult    `json:"security,omitempty"`
	Quality         *QualityAuditResult     `json:"quality,omitempty"`
	Licenses        *LicenseAuditResult     `json:"licenses,omitempty"`
	Performance     *PerformanceAuditResult `json:"performance,omitempty"`
	OverallScore    float64                 `json:"overall_score"`
	Recommendations []string                `json:"recommendations"`
}

AuditResult contains the result of project auditing

type AuditRule

type AuditRule struct {
	ID          string         `json:"id"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Category    string         `json:"category"`
	Type        string         `json:"type"` // security, quality, license, performance
	Severity    string         `json:"severity"`
	Enabled     bool           `json:"enabled"`
	Config      map[string]any `json:"config,omitempty"`
	Pattern     string         `json:"pattern,omitempty"`
	FileTypes   []string       `json:"file_types,omitempty"`
}

AuditRule defines an audit rule configuration

type AuditSummary

type AuditSummary struct {
	TotalProjects    int           `json:"total_projects"`
	AverageScore     float64       `json:"average_score"`
	SecurityScore    float64       `json:"security_score"`
	QualityScore     float64       `json:"quality_score"`
	LicenseScore     float64       `json:"license_score"`
	PerformanceScore float64       `json:"performance_score"`
	CommonIssues     []CommonIssue `json:"common_issues"`
	Trends           []AuditTrend  `json:"trends"`
}

AuditSummary contains summary information across multiple audits

type AuditTrend

type AuditTrend struct {
	Metric    string    `json:"metric"`
	Direction string    `json:"direction"` // improving, declining, stable
	Change    float64   `json:"change"`
	Period    string    `json:"period"`
	Timestamp time.Time `json:"timestamp"`
}

AuditTrend represents trends in audit results over time

type BackupInfo

type BackupInfo struct {
	OriginalPath string    `json:"original_path"`
	BackupPath   string    `json:"backup_path"`
	Timestamp    time.Time `json:"timestamp"`
	Size         int64     `json:"size"`
}

BackupInfo contains information about a backup

type BackupResult

type BackupResult struct {
	OriginalPath string    `json:"original_path"`
	BackupPath   string    `json:"backup_path"`
	Success      bool      `json:"success"`
	Error        string    `json:"error,omitempty"`
	Timestamp    time.Time `json:"timestamp"`
	FileSize     int64     `json:"file_size"`
	Checksum     string    `json:"checksum,omitempty"`
}

BackupResult contains information about a backup operation

type BestPracticeCheck

type BestPracticeCheck struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Category    string  `json:"category"`
	Technology  string  `json:"technology"`
	Compliant   bool    `json:"compliant"`
	Score       float64 `json:"score"`
	Details     string  `json:"details"`
}

BestPracticeCheck represents a best practice check

type BestPracticeViolation

type BestPracticeViolation struct {
	Practice    string `json:"practice"`
	File        string `json:"file"`
	Line        int    `json:"line"`
	Description string `json:"description"`
	Severity    string `json:"severity"`
	Suggestion  string `json:"suggestion"`
}

BestPracticeViolation represents a best practice violation

type BestPracticesResult

type BestPracticesResult struct {
	Score      float64                 `json:"score"`
	Practices  []BestPracticeCheck     `json:"practices"`
	Violations []BestPracticeViolation `json:"violations"`
	Summary    BestPracticesSummary    `json:"summary"`
}

BestPracticesResult contains best practices analysis results

type BestPracticesSummary

type BestPracticesSummary struct {
	TotalPractices     int     `json:"total_practices"`
	CompliantPractices int     `json:"compliant_practices"`
	Violations         int     `json:"violations"`
	OverallScore       float64 `json:"overall_score"`
}

BestPracticesSummary contains best practices statistics

type BreakingChange

type BreakingChange struct {
	Title       string         `json:"title"`
	Description string         `json:"description"`
	Component   string         `json:"component"`
	Migration   *MigrationStep `json:"migration,omitempty"`
	Workaround  string         `json:"workaround,omitempty"`
}

BreakingChange represents a breaking change in a release

type BundleAnalysisResult

type BundleAnalysisResult struct {
	TotalSize   int64                 `json:"total_size"`
	GzippedSize int64                 `json:"gzipped_size"`
	Assets      []BundleAsset         `json:"assets"`
	Chunks      []BundleChunk         `json:"chunks"`
	Summary     BundleAnalysisSummary `json:"summary"`
}

BundleAnalysisResult contains bundle size analysis results

type BundleAnalysisSummary

type BundleAnalysisSummary struct {
	TotalAssets      int      `json:"total_assets"`
	TotalChunks      int      `json:"total_chunks"`
	CompressionRatio float64  `json:"compression_ratio"`
	LargestAsset     string   `json:"largest_asset"`
	Recommendations  []string `json:"recommendations"`
}

BundleAnalysisSummary contains bundle analysis statistics

type BundleAsset

type BundleAsset struct {
	Name        string  `json:"name"`
	Size        int64   `json:"size"`
	GzippedSize int64   `json:"gzipped_size"`
	Type        string  `json:"type"`
	Percentage  float64 `json:"percentage"`
}

BundleAsset represents an asset in the bundle

type BundleChunk

type BundleChunk struct {
	Name    string   `json:"name"`
	Size    int64    `json:"size"`
	Files   []string `json:"files"`
	Entry   bool     `json:"entry"`
	Initial bool     `json:"initial"`
}

BundleChunk represents a chunk in the bundle

type CLIError

type CLIError struct {
	Type        string         `json:"type"`
	Message     string         `json:"message"`
	Code        int            `json:"code"`
	Details     map[string]any `json:"details,omitempty"`
	Suggestions []string       `json:"suggestions,omitempty"`
	Context     *ErrorContext  `json:"context,omitempty"`
}

CLIError represents a CLI error with detailed information

func NewCLIError

func NewCLIError(errorType, message string, code int) *CLIError

NewCLIError creates a new CLI error with the specified type and message

func (*CLIError) Error

func (e *CLIError) Error() string

Implement error interface for CLIError

func (*CLIError) WithContext

func (e *CLIError) WithContext(ctx *ErrorContext) *CLIError

WithContext adds context to a CLI error

func (*CLIError) WithDetails

func (e *CLIError) WithDetails(key string, value any) *CLIError

WithDetails adds details to a CLI error

func (*CLIError) WithSuggestions

func (e *CLIError) WithSuggestions(suggestions ...string) *CLIError

WithSuggestions adds suggestions to a CLI error

type CLIInterface

type CLIInterface interface {
	// Core operations
	Run(args []string) error

	// Interactive operations
	PromptProjectDetails() (*models.ProjectConfig, error)
	ConfirmGeneration(*models.ProjectConfig) bool

	// Advanced interactive operations
	PromptAdvancedOptions() (*AdvancedOptions, error)
	ConfirmAdvancedGeneration(*models.ProjectConfig, *AdvancedOptions) bool
	SelectTemplateInteractively(filter TemplateFilter) (*TemplateInfo, error)

	// Non-interactive operations
	GenerateFromConfig(path string, options GenerateOptions) error
	ValidateProject(path string, options ValidationOptions) (*ValidationResult, error)
	AuditProject(path string, options AuditOptions) (*AuditResult, error)

	// Advanced non-interactive operations
	GenerateWithAdvancedOptions(config *models.ProjectConfig, options *AdvancedOptions) error
	ValidateProjectAdvanced(path string, options *ValidationOptions) (*ValidationResult, error)
	AuditProjectAdvanced(path string, options *AuditOptions) (*AuditResult, error)

	// Template operations
	ListTemplates(filter TemplateFilter) ([]TemplateInfo, error)
	GetTemplateInfo(name string) (*TemplateInfo, error)
	ValidateTemplate(path string) (*TemplateValidationResult, error)

	// Template management operations
	SearchTemplates(query string) ([]TemplateInfo, error)
	GetTemplateMetadata(name string) (*TemplateMetadata, error)
	GetTemplateDependencies(name string) ([]string, error)
	ValidateCustomTemplate(path string) (*TemplateValidationResult, error)

	// Configuration operations
	ShowConfig() error
	SetConfig(key, value string) error
	EditConfig() error
	ValidateConfig() error
	ExportConfig(path string) error

	// Configuration management operations
	LoadConfiguration(sources []string) (*models.ProjectConfig, error)
	MergeConfigurations(configs []*models.ProjectConfig) (*models.ProjectConfig, error)
	ValidateConfigurationSchema(config *models.ProjectConfig) error
	GetConfigurationSources() ([]ConfigSource, error)

	// Version and update operations
	ShowVersion(options VersionOptions) error
	CheckUpdates() (*UpdateInfo, error)
	InstallUpdates() error

	// Advanced version operations
	GetPackageVersions() (map[string]string, error)
	GetLatestPackageVersions() (map[string]string, error)
	CheckCompatibility(path string) (*CompatibilityResult, error)

	// Cache operations
	ShowCache() error
	ClearCache() error
	CleanCache() error

	// Cache management operations
	GetCacheStats() (*CacheStats, error)
	ValidateCache() error
	RepairCache() error
	EnableOfflineMode() error
	DisableOfflineMode() error

	// Utility operations
	ShowLogs() error

	// Logging and debugging operations
	SetLogLevel(level string) error
	GetLogLevel() string
	ShowRecentLogs(lines int, level string) error
	GetLogFileLocations() ([]string, error)

	// Automation and integration operations
	RunNonInteractive(config *models.ProjectConfig, options *AdvancedOptions) error
	GenerateReport(reportType string, format string, outputFile string) error
	GetExitCode() int
	SetExitCode(code int)

	// Component access operations
	GetVersionManager() VersionManager
}

CLIInterface defines the contract for command-line interface operations.

This interface abstracts CLI functionality to enable testing and different CLI implementations. It covers comprehensive user interaction workflow for project configuration collection, generation, validation, and management.

Implementations should provide:

  • Interactive project configuration
  • Template-based code generation
  • Project validation and auditing
  • Configuration management
  • Offline mode support
  • Comprehensive documentation generation

type CacheConfig

type CacheConfig struct {
	// Storage configuration
	Location   string        `json:"location"`
	MaxSize    int64         `json:"max_size"`
	MaxEntries int           `json:"max_entries"`
	DefaultTTL time.Duration `json:"default_ttl"`

	// Eviction policy
	EvictionPolicy string  `json:"eviction_policy"` // lru, lfu, fifo, ttl
	EvictionRatio  float64 `json:"eviction_ratio"`

	// Compression
	EnableCompression bool   `json:"enable_compression"`
	CompressionLevel  int    `json:"compression_level"`
	CompressionType   string `json:"compression_type"` // gzip, lz4, snappy

	// Persistence
	PersistToDisk   bool          `json:"persist_to_disk"`
	SyncInterval    time.Duration `json:"sync_interval"`
	BackupInterval  time.Duration `json:"backup_interval"`
	BackupRetention int           `json:"backup_retention"`

	// Performance
	ConcurrencyLevel int  `json:"concurrency_level"`
	EnableMetrics    bool `json:"enable_metrics"`
	EnableProfiling  bool `json:"enable_profiling"`

	// Offline mode
	OfflineMode    bool          `json:"offline_mode"`
	OfflineTTL     time.Duration `json:"offline_ttl"`
	OfflineMaxSize int64         `json:"offline_max_size"`
	PreloadKeys    []string      `json:"preload_keys"`
}

CacheConfig defines configuration options for the cache

func DefaultCacheConfig

func DefaultCacheConfig() *CacheConfig

DefaultCacheConfig returns default cache configuration

type CacheEntry

type CacheEntry struct {
	Key         string         `json:"key"`
	Value       any            `json:"value"`
	Size        int64          `json:"size"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	AccessedAt  time.Time      `json:"accessed_at"`
	ExpiresAt   *time.Time     `json:"expires_at,omitempty"`
	TTL         time.Duration  `json:"ttl"`
	AccessCount int64          `json:"access_count"`
	Compressed  bool           `json:"compressed"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

CacheEntry represents a cache entry with metadata

type CacheHealth

type CacheHealth struct {
	Status          string         `json:"status"` // healthy, degraded, unhealthy
	LastCheck       time.Time      `json:"last_check"`
	Issues          []CacheIssue   `json:"issues"`
	Warnings        []CacheWarning `json:"warnings"`
	Recommendations []string       `json:"recommendations"`
}

CacheHealth represents the health status of the cache

type CacheIssue

type CacheIssue struct {
	Type        string    `json:"type"`
	Severity    string    `json:"severity"`
	Description string    `json:"description"`
	DetectedAt  time.Time `json:"detected_at"`
	Resolution  string    `json:"resolution"`
	Fixable     bool      `json:"fixable"`
}

CacheIssue represents a cache issue

type CacheManager

type CacheManager interface {
	// Basic cache operations
	Get(key string) (any, error)
	Set(key string, value any, ttl time.Duration) error
	Delete(key string) error
	Exists(key string) bool
	Clear() error
	Clean() error

	// Cache information
	GetStats() (*CacheStats, error)
	GetSize() (int64, error)
	GetLocation() string
	GetKeys() ([]string, error)
	GetKeysByPattern(pattern string) ([]string, error)

	// Cache validation and maintenance
	ValidateCache() error
	RepairCache() error
	CompactCache() error
	BackupCache(path string) error
	RestoreCache(path string) error

	// Offline support
	EnableOfflineMode() error
	DisableOfflineMode() error
	IsOfflineMode() bool
	SyncCache() error

	// TTL management
	SetTTL(key string, ttl time.Duration) error
	GetTTL(key string) (time.Duration, error)
	RefreshTTL(key string) error
	GetExpiredKeys() ([]string, error)

	// Cache configuration
	SetCacheConfig(config *CacheConfig) error
	GetCacheConfig() (*CacheConfig, error)
	SetMaxSize(size int64) error
	SetDefaultTTL(ttl time.Duration) error

	// Cache events and monitoring
	OnCacheHit(callback func(key string))
	OnCacheMiss(callback func(key string))
	OnCacheEviction(callback func(key string, reason string))
	GetHitRate() float64
	GetMissRate() float64
}

CacheManager defines the interface for cache management operations.

This interface provides comprehensive cache management including:

  • Cache operations (get, set, delete, clear)
  • Cache statistics and monitoring
  • Cache validation and repair
  • Offline mode support
  • TTL (Time To Live) management

type CacheMetrics

type CacheMetrics struct {
	// Hit/Miss statistics
	Hits     int64   `json:"hits"`
	Misses   int64   `json:"misses"`
	HitRate  float64 `json:"hit_rate"`
	MissRate float64 `json:"miss_rate"`

	// Operation statistics
	Gets      int64 `json:"gets"`
	Sets      int64 `json:"sets"`
	Deletes   int64 `json:"deletes"`
	Evictions int64 `json:"evictions"`

	// Size statistics
	CurrentSize    int64 `json:"current_size"`
	MaxSize        int64 `json:"max_size"`
	CurrentEntries int   `json:"current_entries"`
	MaxEntries     int   `json:"max_entries"`

	// Performance statistics
	AverageGetTime  time.Duration `json:"average_get_time"`
	AverageSetTime  time.Duration `json:"average_set_time"`
	TotalOperations int64         `json:"total_operations"`

	// Maintenance statistics
	LastCleanup    time.Time `json:"last_cleanup"`
	LastCompaction time.Time `json:"last_compaction"`
	LastBackup     time.Time `json:"last_backup"`
}

CacheMetrics contains cache performance metrics

type CacheOperation

type CacheOperation struct {
	Type      string        `json:"type"` // get, set, delete, clear, clean
	Key       string        `json:"key"`
	Success   bool          `json:"success"`
	Duration  time.Duration `json:"duration"`
	Size      int64         `json:"size"`
	Error     string        `json:"error,omitempty"`
	Timestamp time.Time     `json:"timestamp"`
}

CacheOperation represents a cache operation for logging/monitoring

type CacheStats

type CacheStats struct {
	TotalEntries   int       `json:"total_entries"`
	TotalSize      int64     `json:"total_size"`
	HitRate        float64   `json:"hit_rate"`
	ExpiredEntries int       `json:"expired_entries"`
	LastCleanup    time.Time `json:"last_cleanup"`
	CacheLocation  string    `json:"cache_location"`
	OfflineMode    bool      `json:"offline_mode"`
	CacheHealth    string    `json:"cache_health"` // healthy, corrupted, missing
}

CacheStats contains cache statistics and information

type CacheWarning

type CacheWarning struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	Threshold   any    `json:"threshold"`
	Current     any    `json:"current"`
	Suggestion  string `json:"suggestion"`
}

CacheWarning represents a cache warning

type Change

type Change struct {
	Type        string    `json:"type"` // feature, bugfix, breaking, security
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Component   string    `json:"component"`
	Impact      string    `json:"impact"`
	Date        time.Time `json:"date"`
	Author      string    `json:"author"`
	PRNumber    int       `json:"pr_number,omitempty"`
	IssueNumber int       `json:"issue_number,omitempty"`
}

Change represents a single change in the changelog

type ChangeLog

type ChangeLog struct {
	FromVersion string        `json:"from_version"`
	ToVersion   string        `json:"to_version"`
	Changes     []Change      `json:"changes"`
	Summary     ChangeSummary `json:"summary"`
}

ChangeLog contains changes between versions

type ChangeSummary

type ChangeSummary struct {
	TotalChanges    int `json:"total_changes"`
	Features        int `json:"features"`
	BugFixes        int `json:"bug_fixes"`
	BreakingChanges int `json:"breaking_changes"`
	SecurityFixes   int `json:"security_fixes"`
}

ChangeSummary contains summary statistics for changes

type CheckboxConfig

type CheckboxConfig struct {
	Title       string         `json:"title"`
	Description string         `json:"description,omitempty"`
	Items       []CheckboxItem `json:"items"`
	AllowBack   bool           `json:"allow_back"`
	AllowQuit   bool           `json:"allow_quit"`
	ShowHelp    bool           `json:"show_help"`
	HelpText    string         `json:"help_text,omitempty"`
}

CheckboxConfig defines configuration for checkbox list

type CheckboxItem

type CheckboxItem struct {
	Label       string                 `json:"label"`
	Description string                 `json:"description,omitempty"`
	Value       interface{}            `json:"value"`
	Checked     bool                   `json:"checked"`
	Disabled    bool                   `json:"disabled"`
	Required    bool                   `json:"required"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

CheckboxItem represents a checkbox item

type CheckboxResult

type CheckboxResult struct {
	CheckedIndices []int         `json:"checked_indices"`
	CheckedValues  []interface{} `json:"checked_values"`
	Action         string        `json:"action"` // "confirm", "back", "quit", "help"
	Cancelled      bool          `json:"cancelled"`
}

CheckboxResult contains the result of checkbox selection

type CodeSmell

type CodeSmell struct {
	Type        string `json:"type"`
	Severity    string `json:"severity"`
	Description string `json:"description"`
	File        string `json:"file"`
	Line        int    `json:"line"`
}

CodeSmell represents a code quality issue

type CommonIssue

type CommonIssue struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	Frequency   int    `json:"frequency"`
	Severity    string `json:"severity"`
	Category    string `json:"category"`
}

CommonIssue represents a commonly found issue across projects

type CompatibilityInfo

type CompatibilityInfo struct {
	MinGeneratorVersion string               `json:"min_generator_version"`
	MaxGeneratorVersion string               `json:"max_generator_version"`
	SupportedPlatforms  []string             `json:"supported_platforms"`
	RequiredFeatures    []string             `json:"required_features"`
	Dependencies        []TemplateDependency `json:"dependencies"`
	Conflicts           []string             `json:"conflicts"`
}

CompatibilityInfo contains template compatibility information

type CompatibilityIssue

type CompatibilityIssue struct {
	Type        string `json:"type"`        // version, dependency, configuration
	Severity    string `json:"severity"`    // error, warning, info
	Component   string `json:"component"`   // component name
	Current     string `json:"current"`     // current version
	Required    string `json:"required"`    // required version
	Description string `json:"description"` // issue description
	Fixable     bool   `json:"fixable"`     // whether automatically fixable
}

CompatibilityIssue represents a compatibility issue

type CompatibilityResult

type CompatibilityResult struct {
	Compatible       bool                    `json:"compatible"`
	GeneratorVersion string                  `json:"generator_version"`
	ProjectVersion   string                  `json:"project_version"`
	Issues           []CompatibilityIssue    `json:"issues"`
	Recommendations  []string                `json:"recommendations"`
	PackageVersions  map[string]VersionCheck `json:"package_versions"`
}

CompatibilityResult contains compatibility check results

type CompatibilitySummary

type CompatibilitySummary struct {
	TotalChecks   int `json:"total_checks"`
	PassedChecks  int `json:"passed_checks"`
	FailedChecks  int `json:"failed_checks"`
	SkippedChecks int `json:"skipped_checks"`
}

CompatibilitySummary contains compatibility check statistics

type ComplexityAnalysisResult

type ComplexityAnalysisResult struct {
	Files     []FileComplexity          `json:"files"`
	Functions []FunctionComplexity      `json:"functions"`
	Summary   ComplexityAnalysisSummary `json:"summary"`
}

ComplexityAnalysisResult contains code complexity analysis results

type ComplexityAnalysisSummary

type ComplexityAnalysisSummary struct {
	TotalFiles          int     `json:"total_files"`
	TotalFunctions      int     `json:"total_functions"`
	AverageComplexity   float64 `json:"average_complexity"`
	HighComplexityFiles int     `json:"high_complexity_files"`
	TechnicalDebtHours  float64 `json:"technical_debt_hours"`
}

ComplexityAnalysisSummary contains complexity analysis statistics

type ComplexityIssue

type ComplexityIssue struct {
	Type       string `json:"type"` // cyclomatic, cognitive, npath
	File       string `json:"file"`
	Function   string `json:"function"`
	Line       int    `json:"line"`
	Complexity int    `json:"complexity"`
	Threshold  int    `json:"threshold"`
	Severity   string `json:"severity"`
}

ComplexityIssue represents a code complexity issue

type ComponentSummary

type ComponentSummary struct {
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	Description  string   `json:"description"`
	Files        []string `json:"files"`
	Dependencies []string `json:"dependencies"`
}

ComponentSummary represents a summary of a project component

type ConfigManager

type ConfigManager interface {
	// Basic configuration operations
	LoadDefaults() (*models.ProjectConfig, error)
	ValidateConfig(*models.ProjectConfig) error
	SaveConfig(config *models.ProjectConfig, path string) error
	LoadConfig(path string) (*models.ProjectConfig, error)

	// Settings management
	GetSetting(key string) (any, error)
	SetSetting(key string, value any) error
	ValidateSettings() error

	// Configuration sources
	LoadFromFile(path string) (*models.ProjectConfig, error)
	LoadFromEnvironment() (*models.ProjectConfig, error)
	MergeConfigurations(configs ...*models.ProjectConfig) *models.ProjectConfig

	// Configuration validation
	GetConfigSchema() *ConfigSchema
	ValidateConfigFromFile(path string) (*ConfigValidationResult, error)

	// Configuration management
	GetConfigSources() ([]ConfigSource, error)
	GetConfigLocation() string
	CreateDefaultConfig(path string) error
	BackupConfig(path string) error
	RestoreConfig(backupPath string) error

	// Environment integration
	LoadEnvironmentVariables() map[string]string
	SetEnvironmentDefaults() error
	GetEnvironmentPrefix() string
}

ConfigManager defines the contract for comprehensive configuration management operations

type ConfigSchema

type ConfigSchema struct {
	Properties  map[string]PropertySchema `json:"properties"`
	Required    []string                  `json:"required"`
	Version     string                    `json:"version"`
	Title       string                    `json:"title"`
	Description string                    `json:"description"`
}

ConfigSchema defines the structure and validation rules for configuration

type ConfigSource

type ConfigSource struct {
	Type     string `json:"type"`     // file, environment, defaults
	Location string `json:"location"` // file path or environment variable name
	Priority int    `json:"priority"` // higher number = higher priority
	Valid    bool   `json:"valid"`    // whether the source is valid
}

ConfigSource represents a configuration source

type ConfigValidationError

type ConfigValidationError struct {
	Field      string `json:"field"`
	Value      string `json:"value"`
	Type       string `json:"type"`
	Message    string `json:"message"`
	Suggestion string `json:"suggestion,omitempty"`
	Severity   string `json:"severity"`
	Rule       string `json:"rule"`
}

ConfigValidationError represents a configuration validation error

type ConfigValidationResult

type ConfigValidationResult struct {
	Valid    bool                    `json:"valid"`
	Errors   []ConfigValidationError `json:"errors"`
	Warnings []ConfigValidationError `json:"warnings"`
	Summary  ConfigValidationSummary `json:"summary"`
}

ConfigValidationResult contains the result of configuration validation

type ConfigValidationSummary

type ConfigValidationSummary struct {
	TotalProperties int `json:"total_properties"`
	ValidProperties int `json:"valid_properties"`
	ErrorCount      int `json:"error_count"`
	WarningCount    int `json:"warning_count"`
	MissingRequired int `json:"missing_required"`
}

ConfigValidationSummary contains validation statistics

type ConfigurationOptions

type ConfigurationOptions struct {
	// Loading options
	Sources       []string `json:"sources"`
	IgnoreMissing bool     `json:"ignore_missing"`
	IgnoreInvalid bool     `json:"ignore_invalid"`
	MergeStrategy string   `json:"merge_strategy"` // override, merge, append

	// Validation options
	StrictValidation bool     `json:"strict_validation"`
	AllowUnknown     bool     `json:"allow_unknown"`
	ValidateSchema   bool     `json:"validate_schema"`
	Rules            []string `json:"rules"`

	// Output options
	Format       string `json:"format"` // yaml, json, toml
	Indent       int    `json:"indent"`
	SortKeys     bool   `json:"sort_keys"`
	IncludeEmpty bool   `json:"include_empty"`

	// Environment options
	EnvPrefix    string `json:"env_prefix"`
	EnvSeparator string `json:"env_separator"`
	EnvTransform string `json:"env_transform"` // upper, lower, none
}

ConfigurationOptions defines options for configuration operations

func DefaultConfigurationOptions

func DefaultConfigurationOptions() *ConfigurationOptions

DefaultConfigurationOptions returns default configuration options

type ConfirmConfig

type ConfirmConfig struct {
	Prompt       string `json:"prompt"`
	Description  string `json:"description,omitempty"`
	DefaultValue bool   `json:"default_value"`
	YesLabel     string `json:"yes_label,omitempty"`
	NoLabel      string `json:"no_label,omitempty"`
	AllowBack    bool   `json:"allow_back"`
	AllowQuit    bool   `json:"allow_quit"`
	ShowHelp     bool   `json:"show_help"`
	HelpText     string `json:"help_text,omitempty"`
}

ConfirmConfig defines configuration for confirmation prompt

type ConfirmResult

type ConfirmResult struct {
	Confirmed bool   `json:"confirmed"`
	Action    string `json:"action"` // "confirm", "back", "quit", "help"
	Cancelled bool   `json:"cancelled"`
}

ConfirmResult contains the result of confirmation

type ConfirmationResult

type ConfirmationResult struct {
	Confirmed      bool      `json:"confirmed"`
	UserInput      string    `json:"user_input"`
	Timestamp      time.Time `json:"timestamp"`
	NonInteractive bool      `json:"non_interactive"`
	TimedOut       bool      `json:"timed_out"`
	DefaultUsed    bool      `json:"default_used"`
}

ConfirmationResult represents the result of a confirmation request

type CoverageInfo

type CoverageInfo struct {
	LinesCovered     int     `json:"lines_covered"`
	LinesTotal       int     `json:"lines_total"`
	LineCoverage     float64 `json:"line_coverage"`
	BranchesCovered  int     `json:"branches_covered"`
	BranchesTotal    int     `json:"branches_total"`
	BranchCoverage   float64 `json:"branch_coverage"`
	FunctionsCovered int     `json:"functions_covered"`
	FunctionsTotal   int     `json:"functions_total"`
	FunctionCoverage float64 `json:"function_coverage"`
}

CoverageInfo represents test coverage information

type DependencyAnalysisResult

type DependencyAnalysisResult struct {
	Dependencies    []DependencyInfo          `json:"dependencies"`
	Vulnerabilities []DependencyVulnerability `json:"vulnerabilities"`
	Licenses        []DependencyLicense       `json:"licenses"`
	Outdated        []OutdatedDependency      `json:"outdated"`
	Summary         DependencyAnalysisSummary `json:"summary"`
}

DependencyAnalysisResult contains dependency analysis results

type DependencyAnalysisSummary

type DependencyAnalysisSummary struct {
	TotalDependencies  int     `json:"total_dependencies"`
	DirectDependencies int     `json:"direct_dependencies"`
	Vulnerabilities    int     `json:"vulnerabilities"`
	OutdatedCount      int     `json:"outdated_count"`
	LicenseIssues      int     `json:"license_issues"`
	AverageAge         float64 `json:"average_age_days"`
}

DependencyAnalysisSummary contains dependency analysis statistics

type DependencyChange

type DependencyChange struct {
	Name       string `json:"name"`
	Type       string `json:"type"` // added, updated, removed
	OldVersion string `json:"old_version,omitempty"`
	NewVersion string `json:"new_version,omitempty"`
	Reason     string `json:"reason"`
	Breaking   bool   `json:"breaking"`
}

DependencyChange represents a dependency change in a release

type DependencyConflict

type DependencyConflict struct {
	Dependency1 string `json:"dependency1"`
	Version1    string `json:"version1"`
	Dependency2 string `json:"dependency2"`
	Version2    string `json:"version2"`
	Reason      string `json:"reason"`
	Severity    string `json:"severity"`
}

DependencyConflict represents a dependency conflict

type DependencyInfo

type DependencyInfo struct {
	Name           string    `json:"name"`
	Version        string    `json:"version"`
	Type           string    `json:"type"` // direct, transitive
	License        string    `json:"license"`
	Repository     string    `json:"repository"`
	Homepage       string    `json:"homepage"`
	LastUpdated    time.Time `json:"last_updated"`
	Maintainers    []string  `json:"maintainers"`
	SecurityIssues int       `json:"security_issues"`
	QualityScore   float64   `json:"quality_score"`
}

DependencyInfo contains information about a dependency

type DependencyLicense

type DependencyLicense struct {
	Dependency string `json:"dependency"`
	License    string `json:"license"`
	SPDXID     string `json:"spdx_id"`
	Compatible bool   `json:"compatible"`
	Risk       string `json:"risk"` // low, medium, high
}

DependencyLicense contains license information for a dependency

type DependencyValidation

type DependencyValidation struct {
	Name           string `json:"name"`
	Version        string `json:"version"`
	Type           string `json:"type"` // direct, transitive
	Valid          bool   `json:"valid"`
	Available      bool   `json:"available"`
	LatestVersion  string `json:"latest_version"`
	SecurityIssues int    `json:"security_issues"`
	LicenseIssues  int    `json:"license_issues"`
}

DependencyValidation represents validation result for a dependency

type DependencyValidationResult

type DependencyValidationResult struct {
	Valid           bool                        `json:"valid"`
	Dependencies    []DependencyValidation      `json:"dependencies"`
	Vulnerabilities []DependencyVulnerability   `json:"vulnerabilities"`
	Outdated        []OutdatedDependency        `json:"outdated"`
	Conflicts       []DependencyConflict        `json:"conflicts"`
	Summary         DependencyValidationSummary `json:"summary"`
}

DependencyValidationResult contains dependency validation results

type DependencyValidationSummary

type DependencyValidationSummary struct {
	TotalDependencies int `json:"total_dependencies"`
	ValidDependencies int `json:"valid_dependencies"`
	Vulnerabilities   int `json:"vulnerabilities"`
	OutdatedCount     int `json:"outdated_count"`
	ConflictCount     int `json:"conflict_count"`
}

DependencyValidationSummary contains dependency validation statistics

type DependencyVulnerability

type DependencyVulnerability struct {
	Dependency  string  `json:"dependency"`
	Version     string  `json:"version"`
	CVEID       string  `json:"cve_id"`
	Severity    string  `json:"severity"`
	Description string  `json:"description"`
	FixedIn     string  `json:"fixed_in,omitempty"`
	CVSS        float64 `json:"cvss"`
}

DependencyVulnerability represents a vulnerability in a dependency

type DirValidationResult

type DirValidationResult struct {
	Path      string            `json:"path"`
	Required  bool              `json:"required"`
	Exists    bool              `json:"exists"`
	Valid     bool              `json:"valid"`
	Issues    []ValidationIssue `json:"issues"`
	FileCount int               `json:"file_count"`
	Mode      string            `json:"mode"`
}

DirValidationResult represents validation result for a directory

type DirectoryNode

type DirectoryNode struct {
	Name        string          `json:"name"`
	Type        string          `json:"type"` // "directory" or "file"
	Children    []DirectoryNode `json:"children,omitempty"`
	Source      string          `json:"source,omitempty"` // which template generated this
	Description string          `json:"description,omitempty"`
}

DirectoryNode represents a node in the directory structure

type DryRunOperation

type DryRunOperation struct {
	Type        string                 `json:"type"`
	Description string                 `json:"description"`
	Path        string                 `json:"path"`
	Details     map[string]interface{} `json:"details"`
	Timestamp   time.Time              `json:"timestamp"`
	Impact      string                 `json:"impact"` // "safe", "warning", "destructive"
	Size        int64                  `json:"size,omitempty"`
}

DryRunOperation represents a planned operation in dry-run mode

type Duplication

type Duplication struct {
	Files      []string `json:"files"`
	Lines      int      `json:"lines"`
	Tokens     int      `json:"tokens"`
	Percentage float64  `json:"percentage"`
}

Duplication represents code duplication

type DuplicationFile

type DuplicationFile struct {
	Path      string `json:"path"`
	StartLine int    `json:"start_line"`
	EndLine   int    `json:"end_line"`
}

DuplicationFile represents a file involved in duplication

type ErrorConfig

type ErrorConfig struct {
	Title           string           `json:"title,omitempty"`
	Message         string           `json:"message"`
	Details         string           `json:"details,omitempty"`
	ErrorType       string           `json:"error_type,omitempty"`
	Suggestions     []string         `json:"suggestions,omitempty"`
	RecoveryOptions []RecoveryOption `json:"recovery_options,omitempty"`
	ShowStack       bool             `json:"show_stack"`
	AllowRetry      bool             `json:"allow_retry"`
	AllowIgnore     bool             `json:"allow_ignore"`
	AllowBack       bool             `json:"allow_back"`
	AllowQuit       bool             `json:"allow_quit"`
}

ErrorConfig defines configuration for error display

type ErrorContext

type ErrorContext struct {
	Command     string            `json:"command"`
	Arguments   []string          `json:"arguments"`
	Flags       map[string]string `json:"flags"`
	WorkingDir  string            `json:"working_dir"`
	Timestamp   time.Time         `json:"timestamp"`
	Environment map[string]string `json:"environment,omitempty"`
}

ErrorContext provides context information for errors

type ErrorResult

type ErrorResult struct {
	Action           string `json:"action"` // "retry", "ignore", "back", "quit", "recovery"
	RecoverySelected int    `json:"recovery_selected,omitempty"`
	Cancelled        bool   `json:"cancelled"`
}

ErrorResult contains the result of error handling

type FileChange

type FileChange struct {
	File        string `json:"file"`
	Action      string `json:"action"`
	LinesBefore int    `json:"lines_before"`
	LinesAfter  int    `json:"lines_after"`
	Preview     string `json:"preview"`
}

FileChange represents a change to be made to a file

type FileComplexity

type FileComplexity struct {
	Path                 string  `json:"path"`
	Lines                int     `json:"lines"`
	CyclomaticComplexity int     `json:"cyclomatic_complexity"`
	CognitiveComplexity  int     `json:"cognitive_complexity"`
	Maintainability      float64 `json:"maintainability"`
	TechnicalDebt        string  `json:"technical_debt"`
}

FileComplexity contains complexity metrics for a file

type FileOperationResult

type FileOperationResult struct {
	Success      bool      `json:"success"`
	FilePath     string    `json:"file_path"`
	Operation    string    `json:"operation"`
	BytesWritten int64     `json:"bytes_written,omitempty"`
	BytesRead    int64     `json:"bytes_read,omitempty"`
	Checksum     string    `json:"checksum,omitempty"`
	Permissions  string    `json:"permissions,omitempty"`
	Error        string    `json:"error,omitempty"`
	Warnings     []string  `json:"warnings,omitempty"`
	Timestamp    time.Time `json:"timestamp"`
}

FileOperationResult contains the result of a secure file operation

type FileSystemGenerator

type FileSystemGenerator interface {
	// CreateProject creates the complete project structure based on configuration
	CreateProject(config *models.ProjectConfig, outputPath string) error

	// CreateDirectory creates a directory with proper permissions
	CreateDirectory(path string) error

	// WriteFile writes content to a file with specified permissions
	WriteFile(path string, content []byte, perm os.FileMode) error

	// CopyAssets copies binary assets from source to destination
	CopyAssets(srcDir, destDir string) error

	// CreateSymlink creates a symbolic link
	CreateSymlink(target, link string) error

	// FileExists checks if a file exists at the given path
	FileExists(path string) bool

	// EnsureDirectory ensures a directory exists, creating it if necessary
	EnsureDirectory(path string) error
}

FileSystemGenerator defines the contract for file system operations

type FileValidationResult

type FileValidationResult struct {
	Path     string            `json:"path"`
	Required bool              `json:"required"`
	Exists   bool              `json:"exists"`
	Valid    bool              `json:"valid"`
	Issues   []ValidationIssue `json:"issues"`
	Size     int64             `json:"size"`
	Mode     string            `json:"mode"`
}

FileValidationResult represents validation result for a file

type Fix

type Fix struct {
	ID          string         `json:"id"`
	Type        string         `json:"type"`
	Description string         `json:"description"`
	File        string         `json:"file"`
	Line        int            `json:"line"`
	Column      int            `json:"column"`
	Action      string         `json:"action"` // replace, insert, delete, rename
	Content     string         `json:"content"`
	Parameters  map[string]any `json:"parameters,omitempty"`
	Automatic   bool           `json:"automatic"`
}

Fix represents a fix that can be applied

type FixFailure

type FixFailure struct {
	Fix   Fix    `json:"fix"`
	Error string `json:"error"`
}

FixFailure represents a failed fix attempt

type FixPreview

type FixPreview struct {
	Fixes   []Fix        `json:"fixes"`
	Changes []FileChange `json:"changes"`
	Summary FixSummary   `json:"summary"`
}

FixPreview contains a preview of fixes to be applied

type FixResult

type FixResult struct {
	Applied []Fix        `json:"applied"`
	Failed  []FixFailure `json:"failed"`
	Skipped []Fix        `json:"skipped"`
	Summary FixSummary   `json:"summary"`
}

FixResult contains the result of applying fixes

type FixSuggestion

type FixSuggestion struct {
	Issue       ValidationIssue `json:"issue"`
	Description string          `json:"description"`
	AutoFixable bool            `json:"auto_fixable"`
	Command     string          `json:"command,omitempty"`
}

FixSuggestion represents a suggested fix for a validation issue

type FixSummary

type FixSummary struct {
	TotalFixes    int `json:"total_fixes"`
	AppliedFixes  int `json:"applied_fixes"`
	FailedFixes   int `json:"failed_fixes"`
	SkippedFixes  int `json:"skipped_fixes"`
	FilesModified int `json:"files_modified"`
}

FixSummary contains fix statistics

type FunctionComplexity

type FunctionComplexity struct {
	Name                 string `json:"name"`
	File                 string `json:"file"`
	Line                 int    `json:"line"`
	CyclomaticComplexity int    `json:"cyclomatic_complexity"`
	CognitiveComplexity  int    `json:"cognitive_complexity"`
	Parameters           int    `json:"parameters"`
	Lines                int    `json:"lines"`
}

FunctionComplexity contains complexity metrics for a function

type GenerateOptions

type GenerateOptions struct {
	Force           bool     `json:"force" yaml:"force"`
	Minimal         bool     `json:"minimal" yaml:"minimal"`
	Offline         bool     `json:"offline" yaml:"offline"`
	UpdateVersions  bool     `json:"update_versions" yaml:"update_versions"`
	SkipValidation  bool     `json:"skip_validation" yaml:"skip_validation"`
	BackupExisting  bool     `json:"backup_existing" yaml:"backup_existing"`
	IncludeExamples bool     `json:"include_examples" yaml:"include_examples"`
	Templates       []string `json:"templates" yaml:"templates"`
	OutputPath      string   `json:"output_path" yaml:"output_path"`
	DryRun          bool     `json:"dry_run" yaml:"dry_run"`
	NonInteractive  bool     `json:"non_interactive" yaml:"non_interactive"`
}

GenerateOptions defines options for project generation

type InteractiveUIInterface

type InteractiveUIInterface interface {
	// Menu and selection operations
	ShowMenu(ctx context.Context, config MenuConfig) (*MenuResult, error)
	ShowMultiSelect(ctx context.Context, config MultiSelectConfig) (*MultiSelectResult, error)
	ShowCheckboxList(ctx context.Context, config CheckboxConfig) (*CheckboxResult, error)

	// Input collection operations
	PromptText(ctx context.Context, config TextPromptConfig) (*TextResult, error)
	PromptConfirm(ctx context.Context, config ConfirmConfig) (*ConfirmResult, error)
	PromptSelect(ctx context.Context, config SelectConfig) (*SelectResult, error)

	// Display and formatting operations
	ShowTable(ctx context.Context, config TableConfig) error
	ShowTree(ctx context.Context, config TreeConfig) error
	ShowProgress(ctx context.Context, config ProgressConfig) (ProgressTracker, error)

	// Navigation and help operations
	ShowBreadcrumb(ctx context.Context, path []string) error
	ShowHelp(ctx context.Context, helpContext string) error
	ShowError(ctx context.Context, config ErrorConfig) (*ErrorResult, error)

	// Session management
	StartSession(ctx context.Context, config SessionConfig) (*UISession, error)
	EndSession(ctx context.Context, session *UISession) error
	SaveSessionState(ctx context.Context, session *UISession) error
	RestoreSessionState(ctx context.Context, sessionID string) (*UISession, error)
}

InteractiveUIInterface defines the contract for interactive user interface operations.

This interface provides comprehensive interactive functionality including:

  • Menu navigation and selection
  • Input collection with validation
  • Progress tracking and feedback
  • Error handling with recovery options
  • Context-sensitive help system

type KeyboardShortcut

type KeyboardShortcut struct {
	Key         string `json:"key"`
	Description string `json:"description"`
	Action      string `json:"action"`
	Global      bool   `json:"global"` // Available in all contexts
}

KeyboardShortcut defines a keyboard shortcut

type LicenseAuditResult

type LicenseAuditResult struct {
	Score           float64       `json:"score"`
	Compatible      bool          `json:"compatible"`
	Licenses        []LicenseInfo `json:"licenses"`
	Conflicts       []LicenseInfo `json:"conflicts"`
	Recommendations []string      `json:"recommendations"`
}

LicenseAuditResult contains license audit results

type LicenseCompatibilityResult

type LicenseCompatibilityResult struct {
	Compatible      bool                        `json:"compatible"`
	ProjectLicense  string                      `json:"project_license"`
	Dependencies    []DependencyLicense         `json:"dependencies"`
	Conflicts       []LicenseConflict           `json:"conflicts"`
	Recommendations []LicenseRecommendation     `json:"recommendations"`
	Summary         LicenseCompatibilitySummary `json:"summary"`
}

LicenseCompatibilityResult contains license compatibility analysis results

type LicenseCompatibilitySummary

type LicenseCompatibilitySummary struct {
	TotalLicenses      int    `json:"total_licenses"`
	CompatibleLicenses int    `json:"compatible_licenses"`
	Conflicts          int    `json:"conflicts"`
	RiskLevel          string `json:"risk_level"`
}

LicenseCompatibilitySummary contains license compatibility statistics

type LicenseConflict

type LicenseConflict struct {
	Dependency1 string `json:"dependency1"`
	License1    string `json:"license1"`
	Dependency2 string `json:"dependency2"`
	License2    string `json:"license2"`
	Reason      string `json:"reason"`
	Severity    string `json:"severity"`
	Resolution  string `json:"resolution"`
}

LicenseConflict represents a license compatibility conflict

type LicenseInfo

type LicenseInfo struct {
	Name       string `json:"name"`
	SPDXID     string `json:"spdx_id"`
	Package    string `json:"package"`
	Compatible bool   `json:"compatible"`
}

LicenseInfo represents license information

type LicenseRecommendation

type LicenseRecommendation struct {
	Type        string `json:"type"` // change, add, remove
	Target      string `json:"target"`
	Current     string `json:"current"`
	Recommended string `json:"recommended"`
	Reason      string `json:"reason"`
	Impact      string `json:"impact"`
}

LicenseRecommendation represents a license recommendation

type LicenseViolation

type LicenseViolation struct {
	Type       string `json:"type"` // missing, incompatible, restricted
	Dependency string `json:"dependency"`
	License    string `json:"license"`
	Violation  string `json:"violation"`
	Severity   string `json:"severity"`
	File       string `json:"file,omitempty"`
	Line       int    `json:"line,omitempty"`
	Resolution string `json:"resolution"`
}

LicenseViolation represents a license violation

type LicenseViolationResult

type LicenseViolationResult struct {
	Violations []LicenseViolation      `json:"violations"`
	Summary    LicenseViolationSummary `json:"summary"`
}

LicenseViolationResult contains license violation scan results

type LicenseViolationSummary

type LicenseViolationSummary struct {
	TotalViolations    int `json:"total_violations"`
	CriticalViolations int `json:"critical_violations"`
	HighViolations     int `json:"high_violations"`
	MediumViolations   int `json:"medium_violations"`
	LowViolations      int `json:"low_violations"`
}

LicenseViolationSummary contains license violation statistics

type LogEntry

type LogEntry struct {
	Timestamp time.Time              `json:"timestamp"`
	Level     string                 `json:"level"`
	Component string                 `json:"component"`
	Message   string                 `json:"message"`
	Fields    map[string]interface{} `json:"fields,omitempty"`
	Caller    string                 `json:"caller,omitempty"`
	Error     string                 `json:"error,omitempty"`
}

LogEntry represents a structured log entry

type Logger

type Logger interface {
	// Basic logging methods
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Fatal(msg string, args ...interface{})

	// Structured logging methods
	DebugWithFields(msg string, fields map[string]interface{})
	InfoWithFields(msg string, fields map[string]interface{})
	WarnWithFields(msg string, fields map[string]interface{})
	ErrorWithFields(msg string, fields map[string]interface{})
	FatalWithFields(msg string, fields map[string]interface{})

	// Error logging with error objects
	ErrorWithError(msg string, err error, fields map[string]interface{})

	// Operation tracking
	StartOperation(operation string, fields map[string]interface{}) *OperationContext
	LogOperationStart(operation string, fields map[string]interface{})
	LogOperationSuccess(operation string, duration time.Duration, fields map[string]interface{})
	LogOperationError(operation string, err error, fields map[string]interface{})
	FinishOperation(ctx *OperationContext, additionalFields map[string]interface{})
	FinishOperationWithError(ctx *OperationContext, err error, additionalFields map[string]interface{})

	// Performance logging
	LogPerformanceMetrics(operation string, metrics map[string]interface{})
	LogMemoryUsage(operation string)

	// Configuration methods
	SetLevel(level int)
	GetLevel() int
	SetJSONOutput(enable bool)
	SetCallerInfo(enable bool)
	IsDebugEnabled() bool
	IsInfoEnabled() bool

	// Context methods
	WithComponent(component string) Logger
	WithFields(fields map[string]interface{}) LoggerContext

	// Log management
	GetLogDir() string
	GetRecentEntries(limit int) []LogEntry
	FilterEntries(level string, component string, since time.Time, limit int) []LogEntry
	GetLogFiles() ([]string, error)
	ReadLogFile(filename string) ([]byte, error)

	// Lifecycle
	Close() error
}

Logger provides comprehensive logging functionality

type LoggerContext

type LoggerContext interface {
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	ErrorWithError(msg string, err error)
}

LoggerContext provides temporary logging context with additional fields

type MenuConfig struct {
	Title       string       `json:"title"`
	Description string       `json:"description,omitempty"`
	Options     []MenuOption `json:"options"`
	DefaultItem int          `json:"default_item,omitempty"`
	AllowBack   bool         `json:"allow_back"`
	AllowQuit   bool         `json:"allow_quit"`
	ShowHelp    bool         `json:"show_help"`
	HelpText    string       `json:"help_text,omitempty"`
	MaxHeight   int          `json:"max_height,omitempty"`
}

MenuConfig defines configuration for menu display

type MenuOption struct {
	Label       string                 `json:"label"`
	Description string                 `json:"description,omitempty"`
	Value       interface{}            `json:"value"`
	Disabled    bool                   `json:"disabled"`
	Icon        string                 `json:"icon,omitempty"`
	Shortcut    string                 `json:"shortcut,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

MenuOption represents a single menu option

type MenuResult struct {
	SelectedIndex int         `json:"selected_index"`
	SelectedValue interface{} `json:"selected_value"`
	Action        string      `json:"action"` // "select", "back", "quit", "help"
	Cancelled     bool        `json:"cancelled"`
}

MenuResult contains the result of menu selection

type MigrationGuide

type MigrationGuide struct {
	Title         string          `json:"title"`
	Description   string          `json:"description"`
	Steps         []MigrationStep `json:"steps"`
	Automated     bool            `json:"automated"`
	EstimatedTime string          `json:"estimated_time"`
}

MigrationGuide contains migration information for a release

type MigrationStep

type MigrationStep struct {
	Order       int    `json:"order"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Command     string `json:"command,omitempty"`
	Manual      bool   `json:"manual"`
	Required    bool   `json:"required"`
}

MigrationStep represents a step in a migration guide

type MultiSelectConfig

type MultiSelectConfig struct {
	Title         string           `json:"title"`
	Description   string           `json:"description,omitempty"`
	Options       []SelectOption   `json:"options"`
	MinSelection  int              `json:"min_selection,omitempty"`
	MaxSelection  int              `json:"max_selection,omitempty"`
	AllowBack     bool             `json:"allow_back"`
	AllowQuit     bool             `json:"allow_quit"`
	ShowHelp      bool             `json:"show_help"`
	HelpText      string           `json:"help_text,omitempty"`
	SearchEnabled bool             `json:"search_enabled"`
	Categories    map[string][]int `json:"categories,omitempty"`
}

MultiSelectConfig defines configuration for multi-selection interface

type MultiSelectResult

type MultiSelectResult struct {
	SelectedIndices []int         `json:"selected_indices"`
	SelectedValues  []interface{} `json:"selected_values"`
	Action          string        `json:"action"` // "confirm", "back", "quit", "help"
	Cancelled       bool          `json:"cancelled"`
	SearchQuery     string        `json:"search_query,omitempty"`
}

MultiSelectResult contains the result of multi-selection

type NamingValidationIssue

type NamingValidationIssue struct {
	Path       string `json:"path"`
	Type       string `json:"type"` // file, directory, variable, function
	Current    string `json:"current"`
	Expected   string `json:"expected"`
	Convention string `json:"convention"`
	Severity   string `json:"severity"`
	Fixable    bool   `json:"fixable"`
}

NamingValidationIssue represents a naming convention issue

type NavigationAction string

NavigationAction represents navigation actions

const (
	NavigationActionBack   NavigationAction = "back"
	NavigationActionNext   NavigationAction = "next"
	NavigationActionQuit   NavigationAction = "quit"
	NavigationActionHelp   NavigationAction = "help"
	NavigationActionRetry  NavigationAction = "retry"
	NavigationActionIgnore NavigationAction = "ignore"
	NavigationActionCancel NavigationAction = "cancel"
)

type OperationContext

type OperationContext struct {
	Operation string
	StartTime time.Time
	Fields    map[string]interface{}
}

OperationContext holds context for tracking operations

type OutdatedDependency

type OutdatedDependency struct {
	Name           string `json:"name"`
	CurrentVersion string `json:"current_version"`
	LatestVersion  string `json:"latest_version"`
	Type           string `json:"type"`
	Severity       string `json:"severity"`
	UpdateType     string `json:"update_type"` // major, minor, patch
	Breaking       bool   `json:"breaking"`
}

OutdatedDependency represents an outdated dependency

type PackageInfo

type PackageInfo struct {
	Name         string            `json:"name"`
	Version      string            `json:"version"`
	Description  string            `json:"description"`
	Homepage     string            `json:"homepage"`
	Repository   string            `json:"repository"`
	License      string            `json:"license"`
	Author       string            `json:"author"`
	Maintainers  []string          `json:"maintainers"`
	Keywords     []string          `json:"keywords"`
	Dependencies map[string]string `json:"dependencies"`
	PublishedAt  time.Time         `json:"published_at"`
	UpdatedAt    time.Time         `json:"updated_at"`
	Downloads    int64             `json:"downloads"`
	Stars        int               `json:"stars"`
	Issues       int               `json:"issues"`
	Metadata     map[string]any    `json:"metadata"`
}

PackageInfo contains information about a package

type PackageUpdate

type PackageUpdate struct {
	Package        string    `json:"package"`
	CurrentVersion string    `json:"current_version"`
	LatestVersion  string    `json:"latest_version"`
	UpdateType     string    `json:"update_type"` // major, minor, patch
	Breaking       bool      `json:"breaking"`
	Security       bool      `json:"security"`
	ReleaseDate    time.Time `json:"release_date"`
	ChangeLog      string    `json:"changelog"`
	Recommended    bool      `json:"recommended"`
}

PackageUpdate contains information about a package update

type PerformanceAuditResult

type PerformanceAuditResult struct {
	Score           float64            `json:"score"`
	BundleSize      int64              `json:"bundle_size"`
	LoadTime        time.Duration      `json:"load_time"`
	Issues          []PerformanceIssue `json:"issues"`
	Recommendations []string           `json:"recommendations"`
}

PerformanceAuditResult contains performance audit results

type PerformanceIssue

type PerformanceIssue struct {
	Type        string `json:"type"`
	Severity    string `json:"severity"`
	Description string `json:"description"`
	Impact      string `json:"impact"`
	File        string `json:"file,omitempty"`
}

PerformanceIssue represents a performance issue

type PerformanceMetricsResult

type PerformanceMetricsResult struct {
	LoadTime              time.Duration             `json:"load_time"`
	FirstPaint            time.Duration             `json:"first_paint"`
	FirstContentful       time.Duration             `json:"first_contentful"`
	LargestContentful     time.Duration             `json:"largest_contentful"`
	TimeToInteractive     time.Duration             `json:"time_to_interactive"`
	CumulativeLayoutShift float64                   `json:"cumulative_layout_shift"`
	Issues                []PerformanceIssue        `json:"issues"`
	Summary               PerformanceMetricsSummary `json:"summary"`
}

PerformanceMetricsResult contains performance metrics analysis results

type PerformanceMetricsSummary

type PerformanceMetricsSummary struct {
	OverallScore     float64  `json:"overall_score"`
	PerformanceGrade string   `json:"performance_grade"`
	IssueCount       int      `json:"issue_count"`
	Recommendations  []string `json:"recommendations"`
}

PerformanceMetricsSummary contains performance metrics statistics

type PermissionIssue

type PermissionIssue struct {
	Path     string `json:"path"`
	Current  string `json:"current"`
	Expected string `json:"expected"`
	Type     string `json:"type"` // file, directory
	Security bool   `json:"security"`
	Severity string `json:"severity"`
	Fixable  bool   `json:"fixable"`
}

PermissionIssue represents a file permission issue

type PolicyCheck

type PolicyCheck struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Category    string `json:"category"`
	Severity    string `json:"severity"`
	Compliant   bool   `json:"compliant"`
	Details     string `json:"details"`
}

PolicyCheck represents a security policy check

type PolicyComplianceResult

type PolicyComplianceResult struct {
	Compliant  bool                    `json:"compliant"`
	Policies   []PolicyCheck           `json:"policies"`
	Violations []PolicyViolation       `json:"violations"`
	Score      float64                 `json:"score"`
	Summary    PolicyComplianceSummary `json:"summary"`
}

PolicyComplianceResult contains security policy compliance results

type PolicyComplianceSummary

type PolicyComplianceSummary struct {
	TotalPolicies      int `json:"total_policies"`
	CompliantPolicies  int `json:"compliant_policies"`
	Violations         int `json:"violations"`
	CriticalViolations int `json:"critical_violations"`
}

PolicyComplianceSummary contains policy compliance statistics

type PolicyViolation

type PolicyViolation struct {
	Policy      string `json:"policy"`
	Severity    string `json:"severity"`
	Description string `json:"description"`
	File        string `json:"file"`
	Line        int    `json:"line"`
}

PolicyViolation represents a security policy violation

type ProgressConfig

type ProgressConfig struct {
	Title       string   `json:"title"`
	Description string   `json:"description,omitempty"`
	Steps       []string `json:"steps,omitempty"`
	ShowPercent bool     `json:"show_percent"`
	ShowETA     bool     `json:"show_eta"`
	Cancellable bool     `json:"cancellable"`
}

ProgressConfig defines configuration for progress tracking

type ProgressTracker

type ProgressTracker interface {
	// Update progress (0.0 to 1.0)
	SetProgress(progress float64) error

	// Set current step
	SetCurrentStep(step int, description string) error

	// Add log message
	AddLog(message string) error

	// Mark as complete
	Complete() error

	// Mark as failed
	Fail(err error) error

	// Check if cancelled
	IsCancelled() bool

	// Close the progress tracker
	Close() error
}

ProgressTracker interface for progress tracking operations

type ProjectStructurePreview

type ProjectStructurePreview struct {
	RootDirectory string             `json:"root_directory"`
	Structure     []DirectoryNode    `json:"structure"`
	FileCount     int                `json:"file_count"`
	EstimatedSize int64              `json:"estimated_size"`
	Components    []ComponentSummary `json:"components"`
}

ProjectStructurePreview represents a preview of the project structure

type PropertySchema

type PropertySchema struct {
	Type        string   `json:"type"`
	Description string   `json:"description"`
	Default     any      `json:"default"`
	Enum        []string `json:"enum,omitempty"`
	Pattern     string   `json:"pattern,omitempty"`
	MinLength   *int     `json:"min_length,omitempty"`
	MaxLength   *int     `json:"max_length,omitempty"`
	Minimum     *float64 `json:"minimum,omitempty"`
	Maximum     *float64 `json:"maximum,omitempty"`
	Required    bool     `json:"required"`
	Deprecated  bool     `json:"deprecated"`
	Examples    []string `json:"examples,omitempty"`
}

PropertySchema defines validation rules for individual configuration properties

type QualityAuditResult

type QualityAuditResult struct {
	Score           float64       `json:"score"`
	CodeSmells      []CodeSmell   `json:"code_smells"`
	Duplications    []Duplication `json:"duplications"`
	TestCoverage    float64       `json:"test_coverage"`
	Recommendations []string      `json:"recommendations"`
}

QualityAuditResult contains quality audit results

type QualityValidationResult

type QualityValidationResult struct {
	Valid       bool                     `json:"valid"`
	CodeSmells  []CodeSmell              `json:"code_smells"`
	Complexity  []ComplexityIssue        `json:"complexity"`
	Duplication []Duplication            `json:"duplication"`
	Coverage    *CoverageInfo            `json:"coverage,omitempty"`
	Summary     QualityValidationSummary `json:"summary"`
}

QualityValidationResult contains code quality validation results

type QualityValidationSummary

type QualityValidationSummary struct {
	TotalIssues       int     `json:"total_issues"`
	CodeSmells        int     `json:"code_smells"`
	ComplexityIssues  int     `json:"complexity_issues"`
	DuplicationIssues int     `json:"duplication_issues"`
	QualityScore      float64 `json:"quality_score"`
	Maintainability   string  `json:"maintainability"`
}

QualityValidationSummary contains quality validation statistics

type RecoveryOption

type RecoveryOption struct {
	Label       string                 `json:"label"`
	Description string                 `json:"description"`
	Action      func() error           `json:"-"`
	Safe        bool                   `json:"safe"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

RecoveryOption represents a recovery action for errors

type ReleaseBugFix

type ReleaseBugFix struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Severity    string   `json:"severity"`
	Components  []string `json:"components"`
	IssueNumber int      `json:"issue_number,omitempty"`
	PRNumber    int      `json:"pr_number,omitempty"`
}

ReleaseBugFix represents a bug fix in a release

type ReleaseFeature

type ReleaseFeature struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Category    string   `json:"category"`
	Impact      string   `json:"impact"` // major, minor, patch
	Components  []string `json:"components"`
	PRNumber    int      `json:"pr_number,omitempty"`
}

ReleaseFeature represents a new feature in a release

type ReleaseNotes

type ReleaseNotes struct {
	Version      string             `json:"version"`
	ReleaseDate  time.Time          `json:"release_date"`
	Title        string             `json:"title"`
	Description  string             `json:"description"`
	Features     []ReleaseFeature   `json:"features"`
	BugFixes     []ReleaseBugFix    `json:"bug_fixes"`
	Breaking     []BreakingChange   `json:"breaking"`
	Security     []SecurityFix      `json:"security"`
	Dependencies []DependencyChange `json:"dependencies"`
	Migration    *MigrationGuide    `json:"migration,omitempty"`
	Links        map[string]string  `json:"links"`
}

ReleaseNotes contains release notes for a version

type SanitizationResult

type SanitizationResult struct {
	Original    string   `json:"original"`
	Sanitized   string   `json:"sanitized"`
	IsValid     bool     `json:"is_valid"`
	Errors      []string `json:"errors"`
	Warnings    []string `json:"warnings"`
	WasModified bool     `json:"was_modified"`
}

SanitizationResult contains the result of input sanitization

type SecretDetection

type SecretDetection struct {
	Type       string  `json:"type"`
	File       string  `json:"file"`
	Line       int     `json:"line"`
	Column     int     `json:"column"`
	Secret     string  `json:"secret"`
	Confidence float64 `json:"confidence"`
	Rule       string  `json:"rule"`
	Pattern    string  `json:"pattern"`
	Masked     string  `json:"masked"`
}

SecretDetection represents a detected secret

type SecretScanResult

type SecretScanResult struct {
	ScanTime time.Time         `json:"scan_time"`
	Secrets  []SecretDetection `json:"secrets"`
	Summary  SecretScanSummary `json:"summary"`
}

SecretScanResult contains secret detection results

type SecretScanSummary

type SecretScanSummary struct {
	TotalSecrets     int `json:"total_secrets"`
	HighConfidence   int `json:"high_confidence"`
	MediumConfidence int `json:"medium_confidence"`
	LowConfidence    int `json:"low_confidence"`
	FilesScanned     int `json:"files_scanned"`
}

SecretScanSummary contains secret scan statistics

type SecurityAdvisory

type SecurityAdvisory struct {
	ID               string    `json:"id"`
	Title            string    `json:"title"`
	Description      string    `json:"description"`
	Severity         string    `json:"severity"`
	CVEID            string    `json:"cve_id"`
	CVSS             float64   `json:"cvss"`
	PublishedAt      time.Time `json:"published_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	AffectedVersions []string  `json:"affected_versions"`
	FixedInVersion   string    `json:"fixed_in_version"`
	Workaround       string    `json:"workaround,omitempty"`
	References       []string  `json:"references"`
}

SecurityAdvisory contains security advisory information

type SecurityAuditResult

type SecurityAuditResult struct {
	Score            float64           `json:"score"`
	Vulnerabilities  []Vulnerability   `json:"vulnerabilities"`
	PolicyViolations []PolicyViolation `json:"policy_violations"`
	Recommendations  []string          `json:"recommendations"`
}

SecurityAuditResult contains security audit results

type SecurityConfig

type SecurityConfig struct {
	Component   string `json:"component"`
	Setting     string `json:"setting"`
	Current     string `json:"current"`
	Recommended string `json:"recommended"`
	Severity    string `json:"severity"`
	Description string `json:"description"`
	Fixable     bool   `json:"fixable"`
}

SecurityConfig represents security configuration validation

type SecurityFix

type SecurityFix struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Severity    string   `json:"severity"`
	CVEID       string   `json:"cve_id,omitempty"`
	CVSS        float64  `json:"cvss,omitempty"`
	Components  []string `json:"components"`
}

SecurityFix represents a security fix in a release

type SecurityIssue

type SecurityIssue struct {
	Type        string `json:"type"`
	Severity    string `json:"severity"`
	Title       string `json:"title"`
	Description string `json:"description"`
	File        string `json:"file"`
	Line        int    `json:"line"`
	Column      int    `json:"column"`
	Rule        string `json:"rule"`
	CWE         string `json:"cwe,omitempty"`
	Fixable     bool   `json:"fixable"`
}

SecurityIssue represents a security issue

type SecurityManager

type SecurityManager interface {
	// Input sanitization
	SanitizeString(input string, fieldName string) *SanitizationResult
	SanitizeProjectName(name string) *SanitizationResult
	SanitizeFilePath(path string, fieldName string) *SanitizationResult
	SanitizeURL(urlStr string, fieldName string) *SanitizationResult
	SanitizeEmail(email string, fieldName string) *SanitizationResult
	ValidateAndSanitizeMap(data map[string]interface{}, prefix string) map[string]*SanitizationResult

	// Template security
	ValidateTemplateContent(content string, filePath string) *TemplateSecurityResult
	ValidateTemplateFile(filePath string) (*TemplateSecurityResult, error)
	ScanTemplateDirectory(dirPath string) (map[string]*TemplateSecurityResult, error)

	// File operations security
	SecureReadFile(path string) (*FileOperationResult, []byte, error)
	SecureWriteFile(path string, data []byte, perm os.FileMode) (*FileOperationResult, error)
	SecureCopyFile(srcPath, dstPath string) (*FileOperationResult, error)
	SecureCreateDirectory(path string, perm os.FileMode) (*FileOperationResult, error)
	ValidateFilePath(path string, operation string) error
	GetFilePermissions(path string) (map[string]interface{}, error)

	// Backup management
	BackupFile(filePath string) (*BackupResult, error)
	BackupDirectory(dirPath string) (map[string]*BackupResult, error)
	RestoreFile(originalPath string, backupTimestamp time.Time) (*BackupResult, error)
	ListBackups(originalPath string) ([]BackupInfo, error)
	SetBackupEnabled(enabled bool)
	IsBackupEnabled() bool

	// Dry-run operations
	SetDryRunMode(enabled bool)
	IsDryRunMode() bool
	RecordFileWrite(path string, data []byte, overwrite bool)
	RecordFileDelete(path string)
	RecordDirectoryCreate(path string)
	RecordDirectoryDelete(path string)
	RecordFileCopy(srcPath, dstPath string, overwrite bool)
	RecordTemplateProcess(templatePath, outputPath string, variables map[string]interface{})
	GetDryRunOperations() []DryRunOperation
	GetDryRunSummary() map[string]interface{}
	GenerateDryRunReport(format string) (string, error)

	// User confirmation
	SetNonInteractive(nonInteractive bool)
	IsNonInteractive() bool
	ConfirmFileOverwrite(filePath string, fileSize int64) (*ConfirmationResult, error)
	ConfirmDirectoryDelete(dirPath string, fileCount int, totalSize int64) (*ConfirmationResult, error)
	ConfirmBulkOperation(operationType string, itemCount int, details []string) (*ConfirmationResult, error)
	ConfirmSecurityRisk(riskDescription string, riskLevel string, details []string) (*ConfirmationResult, error)
	ConfirmWithDryRun(dryRunSummary map[string]interface{}) (*ConfirmationResult, error)

	// Security configuration
	SetSecurityConfig(config map[string]interface{}) error
	GetSecurityConfig() map[string]interface{}
}

SecurityManager provides comprehensive security management capabilities

type SecurityValidationResult

type SecurityValidationResult struct {
	Valid          bool                      `json:"valid"`
	SecurityIssues []SecurityIssue           `json:"security_issues"`
	Secrets        []SecretDetection         `json:"secrets"`
	Permissions    []PermissionIssue         `json:"permissions"`
	Configurations []SecurityConfig          `json:"configurations"`
	Summary        SecurityValidationSummary `json:"summary"`
}

SecurityValidationResult contains security validation results

type SecurityValidationSummary

type SecurityValidationSummary struct {
	TotalIssues    int `json:"total_issues"`
	HighSeverity   int `json:"high_severity"`
	MediumSeverity int `json:"medium_severity"`
	LowSeverity    int `json:"low_severity"`
	SecretsFound   int `json:"secrets_found"`
	ConfigIssues   int `json:"config_issues"`
}

SecurityValidationSummary contains security validation statistics

type SelectConfig

type SelectConfig struct {
	Prompt      string   `json:"prompt"`
	Description string   `json:"description,omitempty"`
	Options     []string `json:"options"`
	DefaultItem int      `json:"default_item,omitempty"`
	AllowBack   bool     `json:"allow_back"`
	AllowQuit   bool     `json:"allow_quit"`
	ShowHelp    bool     `json:"show_help"`
	HelpText    string   `json:"help_text,omitempty"`
}

SelectConfig defines configuration for single selection

type SelectOption

type SelectOption struct {
	Label       string                 `json:"label"`
	Description string                 `json:"description,omitempty"`
	Value       interface{}            `json:"value"`
	Selected    bool                   `json:"selected"`
	Disabled    bool                   `json:"disabled"`
	Icon        string                 `json:"icon,omitempty"`
	Category    string                 `json:"category,omitempty"`
	Tags        []string               `json:"tags,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

SelectOption represents a selectable option

type SelectResult

type SelectResult struct {
	SelectedIndex int    `json:"selected_index"`
	SelectedValue string `json:"selected_value"`
	Action        string `json:"action"` // "select", "back", "quit", "help"
	Cancelled     bool   `json:"cancelled"`
}

SelectResult contains the result of selection

type SessionAction

type SessionAction struct {
	Timestamp time.Time              `json:"timestamp"`
	Action    string                 `json:"action"`
	Component string                 `json:"component"`
	Data      map[string]interface{} `json:"data,omitempty"`
}

SessionAction represents an action taken during a session

type SessionConfig

type SessionConfig struct {
	SessionID   string                 `json:"session_id,omitempty"`
	Title       string                 `json:"title"`
	Description string                 `json:"description,omitempty"`
	Timeout     time.Duration          `json:"timeout,omitempty"`
	AutoSave    bool                   `json:"auto_save"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

SessionConfig defines configuration for UI session

type StandardizedStructureGenerator

type StandardizedStructureGenerator interface {
	// GenerateStandardizedStructure creates the complete standardized project structure
	GenerateStandardizedStructure(config *models.ProjectConfig, outputPath string) error

	// CreateFrontendDirectoryStructure creates App/ directory with main/, home/, admin/, shared-components/ subdirectories
	CreateFrontendDirectoryStructure(projectPath string, config *models.ProjectConfig) error

	// CreateBackendDirectoryStructure creates CommonServer/ directory with cmd/, internal/, pkg/, migrations/, docs/ structure
	CreateBackendDirectoryStructure(projectPath string, config *models.ProjectConfig) error

	// CreateMobileDirectoryStructure creates Mobile/ directory with android/, ios/, shared/ subdirectories
	CreateMobileDirectoryStructure(projectPath string, config *models.ProjectConfig) error

	// CreateInfrastructureDirectoryStructure creates Deploy/ directory with docker/, k8s/, terraform/, monitoring/ subdirectories
	CreateInfrastructureDirectoryStructure(projectPath string, config *models.ProjectConfig) error

	// CreateCommonDirectoryStructure creates Docs/, Scripts/, and .github/ directories with appropriate content
	CreateCommonDirectoryStructure(projectPath string, config *models.ProjectConfig) error

	// GenerateStandardProjectFiles generates standard project files (README.md, CONTRIBUTING.md, LICENSE, .gitignore, Makefile)
	GenerateStandardProjectFiles(projectPath string, config *models.ProjectConfig) error
}

StandardizedStructureGenerator defines the contract for standardized directory structure generation

type StructureValidationResult

type StructureValidationResult struct {
	Valid            bool                       `json:"valid"`
	RequiredFiles    []FileValidationResult     `json:"required_files"`
	RequiredDirs     []DirValidationResult      `json:"required_dirs"`
	NamingIssues     []NamingValidationIssue    `json:"naming_issues"`
	PermissionIssues []PermissionIssue          `json:"permission_issues"`
	Summary          StructureValidationSummary `json:"summary"`
}

StructureValidationResult contains project structure validation results

type StructureValidationSummary

type StructureValidationSummary struct {
	TotalFiles       int `json:"total_files"`
	ValidFiles       int `json:"valid_files"`
	TotalDirectories int `json:"total_directories"`
	ValidDirectories int `json:"valid_directories"`
	NamingIssues     int `json:"naming_issues"`
	PermissionIssues int `json:"permission_issues"`
}

StructureValidationSummary contains structure validation statistics

type TableConfig

type TableConfig struct {
	Title      string     `json:"title,omitempty"`
	Headers    []string   `json:"headers"`
	Rows       [][]string `json:"rows"`
	MaxWidth   int        `json:"max_width,omitempty"`
	Pagination bool       `json:"pagination"`
	PageSize   int        `json:"page_size,omitempty"`
	Sortable   bool       `json:"sortable"`
	Searchable bool       `json:"searchable"`
}

TableConfig defines configuration for table display

type TemplateDependency

type TemplateDependency struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Type        string `json:"type"` // template, package, tool
	Required    bool   `json:"required"`
	Description string `json:"description"`
}

TemplateDependency represents a template dependency

type TemplateEngine

type TemplateEngine interface {
	// Core template processing
	ProcessTemplate(path string, config *models.ProjectConfig) ([]byte, error)
	ProcessDirectory(templatePath string, outputPath string, config *models.ProjectConfig) error

	// Template loading and rendering
	LoadTemplate(path string) (*template.Template, error)
	RenderTemplate(tmpl *template.Template, data any) ([]byte, error)
	RegisterFunctions(funcMap template.FuncMap)
}

TemplateEngine defines the contract for low-level template processing operations.

The TemplateEngine interface provides core template processing capabilities:

  • Single template file processing with variable substitution
  • Recursive directory processing for complete project generation
  • Custom function registration for extended template functionality
  • Template loading, parsing, and rendering

Implementations should provide:

  • Robust error handling and validation
  • Security considerations for template processing
  • Integration with version management systems

type TemplateFilter

type TemplateFilter struct {
	Category   string   `json:"category,omitempty"`
	Technology string   `json:"technology,omitempty"`
	Tags       []string `json:"tags,omitempty"`
	MinVersion string   `json:"min_version,omitempty"`
	MaxVersion string   `json:"max_version,omitempty"`
}

TemplateFilter defines filtering options for template listing

type TemplateInfo

type TemplateInfo struct {
	Name         string           `json:"name"`
	DisplayName  string           `json:"display_name"`
	Description  string           `json:"description"`
	Category     string           `json:"category"`
	Technology   string           `json:"technology"`
	Version      string           `json:"version"`
	Tags         []string         `json:"tags"`
	Dependencies []string         `json:"dependencies"`
	Metadata     TemplateMetadata `json:"metadata"`
}

TemplateInfo contains information about a template

type TemplateInstallOptions

type TemplateInstallOptions struct {
	Source       string `json:"source"`       // git, http, file, registry
	Version      string `json:"version"`      // specific version or branch
	Force        bool   `json:"force"`        // force reinstall
	Verify       bool   `json:"verify"`       // verify signature/checksum
	Cache        bool   `json:"cache"`        // cache for offline use
	Dependencies bool   `json:"dependencies"` // install dependencies
}

TemplateInstallOptions defines options for template installation

func DefaultTemplateInstallOptions

func DefaultTemplateInstallOptions() *TemplateInstallOptions

DefaultTemplateInstallOptions returns default template installation options

type TemplateManager

type TemplateManager interface {
	// Template processing (high-level, uses template names/IDs)
	ProcessTemplate(templateName string, config *models.ProjectConfig, outputPath string) error
	ProcessCustomTemplate(path string, config *models.ProjectConfig, outputPath string) error
	PreviewTemplate(templateName string, config *models.ProjectConfig) (*TemplatePreview, error)

	// Template discovery
	ListTemplates(filter TemplateFilter) ([]TemplateInfo, error)
	GetTemplateInfo(name string) (*TemplateInfo, error)
	SearchTemplates(query string) ([]TemplateInfo, error)
	GetTemplatesByCategory(category string) ([]TemplateInfo, error)
	GetTemplatesByTechnology(technology string) ([]TemplateInfo, error)

	// Template validation
	ValidateTemplate(path string) (*TemplateValidationResult, error)
	ValidateTemplateStructure(template *TemplateInfo) error
	ValidateTemplateMetadata(metadata *TemplateMetadata) error
	ValidateCustomTemplate(path string) (*TemplateValidationResult, error)

	// Template metadata
	GetTemplateMetadata(name string) (*TemplateMetadata, error)
	GetTemplateDependencies(name string) ([]string, error)
	GetTemplateCompatibility(name string) (*CompatibilityInfo, error)
	GetTemplateVariables(name string) (map[string]TemplateVariable, error)

	// Template management
	InstallTemplate(source string, name string) error
	UninstallTemplate(name string) error
	UpdateTemplate(name string) error
	GetTemplateLocation(name string) (string, error)

	// Template caching
	CacheTemplate(name string) error
	GetCachedTemplates() ([]TemplateInfo, error)
	ClearTemplateCache() error
	RefreshTemplateCache() error
}

TemplateManager defines the interface for high-level template management operations.

This interface provides comprehensive template management including:

  • Template discovery and listing with filtering
  • Template validation and structure checking
  • Template metadata management and caching
  • Custom template support and installation
  • High-level template processing using TemplateEngine

TemplateManager uses TemplateEngine for low-level processing while providing higher-level management capabilities like discovery, validation, and caching.

type TemplateMetadata

type TemplateMetadata struct {
	Author      string            `json:"author"`
	License     string            `json:"license"`
	Repository  string            `json:"repository"`
	Homepage    string            `json:"homepage"`
	Keywords    []string          `json:"keywords"`
	Maintainers []string          `json:"maintainers"`
	Created     time.Time         `json:"created"`
	Updated     time.Time         `json:"updated"`
	Variables   map[string]string `json:"variables"`
}

TemplateMetadata contains metadata about a template

type TemplatePreview

type TemplatePreview struct {
	TemplateName string                 `json:"template_name"`
	OutputPath   string                 `json:"output_path"`
	Files        []TemplatePreviewFile  `json:"files"`
	Variables    map[string]any         `json:"variables"`
	Summary      TemplatePreviewSummary `json:"summary"`
}

TemplatePreview contains a preview of template processing results

type TemplatePreviewFile

type TemplatePreviewFile struct {
	Path        string `json:"path"`
	Type        string `json:"type"` // file, directory, symlink
	Size        int64  `json:"size"`
	Templated   bool   `json:"templated"`
	Executable  bool   `json:"executable"`
	Content     string `json:"content,omitempty"` // for small files
	ContentHash string `json:"content_hash"`
}

TemplatePreviewFile represents a file in the template preview

type TemplatePreviewSummary

type TemplatePreviewSummary struct {
	TotalFiles       int   `json:"total_files"`
	TotalDirectories int   `json:"total_directories"`
	TotalSize        int64 `json:"total_size"`
	TemplatedFiles   int   `json:"templated_files"`
	ExecutableFiles  int   `json:"executable_files"`
}

TemplatePreviewSummary contains summary information about the template preview

type TemplateProcessingOptions

type TemplateProcessingOptions struct {
	// Processing options
	DryRun         bool           `json:"dry_run"`
	Force          bool           `json:"force"`
	BackupExisting bool           `json:"backup_existing"`
	Variables      map[string]any `json:"variables"`

	// Output options
	OutputPath     string `json:"output_path"`
	CreateDirs     bool   `json:"create_dirs"`
	PreservePerms  bool   `json:"preserve_perms"`
	FollowSymlinks bool   `json:"follow_symlinks"`

	// Filtering options
	IncludePatterns []string `json:"include_patterns"`
	ExcludePatterns []string `json:"exclude_patterns"`
	IgnoreFiles     []string `json:"ignore_files"`

	// Validation options
	ValidateOutput bool `json:"validate_output"`
	StrictMode     bool `json:"strict_mode"`
}

TemplateProcessingOptions defines options for template processing

func DefaultTemplateProcessingOptions

func DefaultTemplateProcessingOptions() *TemplateProcessingOptions

DefaultTemplateProcessingOptions returns default template processing options

type TemplateSecurityResult

type TemplateSecurityResult struct {
	IsSecure        bool     `json:"is_secure"`
	SecurityIssues  []string `json:"security_issues"`
	Warnings        []string `json:"warnings"`
	BlockedPatterns []string `json:"blocked_patterns"`
	FilePath        string   `json:"file_path"`
	FileSize        int64    `json:"file_size"`
}

TemplateSecurityResult contains the result of template security validation

type TemplateSelection

type TemplateSelection struct {
	Template TemplateInfo           `json:"template"`
	Selected bool                   `json:"selected"`
	Options  map[string]interface{} `json:"options,omitempty"`
}

TemplateSelection represents a selected template with options

type TemplateValidationResult

type TemplateValidationResult struct {
	Valid    bool              `json:"valid"`
	Issues   []ValidationIssue `json:"issues"`
	Warnings []ValidationIssue `json:"warnings"`
	Summary  ValidationSummary `json:"summary"`
}

TemplateValidationResult contains the result of template validation

type TemplateVariable

type TemplateVariable struct {
	Name        string              `json:"name"`
	Type        string              `json:"type"`
	Description string              `json:"description"`
	Default     any                 `json:"default,omitempty"`
	Required    bool                `json:"required"`
	Validation  *VariableValidation `json:"validation,omitempty"`
	Examples    []string            `json:"examples,omitempty"`
	Deprecated  bool                `json:"deprecated"`
}

TemplateVariable defines a template variable with validation rules

type TextPromptConfig

type TextPromptConfig struct {
	Prompt       string             `json:"prompt"`
	Description  string             `json:"description,omitempty"`
	DefaultValue string             `json:"default_value,omitempty"`
	Placeholder  string             `json:"placeholder,omitempty"`
	Required     bool               `json:"required"`
	Multiline    bool               `json:"multiline"`
	Masked       bool               `json:"masked"` // for passwords
	Validator    func(string) error `json:"-"`
	Suggestions  []string           `json:"suggestions,omitempty"`
	AllowBack    bool               `json:"allow_back"`
	AllowQuit    bool               `json:"allow_quit"`
	ShowHelp     bool               `json:"show_help"`
	HelpText     string             `json:"help_text,omitempty"`
	MaxLength    int                `json:"max_length,omitempty"`
	MinLength    int                `json:"min_length,omitempty"`
}

TextPromptConfig defines configuration for text input

type TextResult

type TextResult struct {
	Value     string `json:"value"`
	Action    string `json:"action"` // "submit", "back", "quit", "help"
	Cancelled bool   `json:"cancelled"`
}

TextResult contains the result of text input

type TreeConfig

type TreeConfig struct {
	Title      string   `json:"title,omitempty"`
	Root       TreeNode `json:"root"`
	Expandable bool     `json:"expandable"`
	ShowIcons  bool     `json:"show_icons"`
	MaxDepth   int      `json:"max_depth,omitempty"`
}

TreeConfig defines configuration for tree display

type TreeNode

type TreeNode struct {
	Label      string                 `json:"label"`
	Value      interface{}            `json:"value,omitempty"`
	Icon       string                 `json:"icon,omitempty"`
	Children   []TreeNode             `json:"children,omitempty"`
	Expanded   bool                   `json:"expanded"`
	Selectable bool                   `json:"selectable"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
}

TreeNode represents a node in a tree structure

type UISession

type UISession struct {
	ID         string                 `json:"id"`
	Title      string                 `json:"title"`
	StartTime  time.Time              `json:"start_time"`
	LastActive time.Time              `json:"last_active"`
	State      map[string]interface{} `json:"state"`
	History    []SessionAction        `json:"history"`
	Context    context.Context        `json:"-"`
	CancelFunc context.CancelFunc     `json:"-"`
}

UISession represents an interactive UI session

type UpdateInfo

type UpdateInfo struct {
	CurrentVersion  string    `json:"current_version"`
	LatestVersion   string    `json:"latest_version"`
	UpdateAvailable bool      `json:"update_available"`
	ReleaseNotes    string    `json:"release_notes"`
	DownloadURL     string    `json:"download_url"`
	ReleaseDate     time.Time `json:"release_date"`
	Breaking        bool      `json:"breaking"`
	Security        bool      `json:"security"`
	Recommended     bool      `json:"recommended"`
	Size            int64     `json:"size"`
	Checksum        string    `json:"checksum"`
	SignatureURL    string    `json:"signature_url"`
}

UpdateInfo contains information about available updates

type ValidationEngine

type ValidationEngine interface {
	// Basic validation methods
	ValidateProject(path string) (*models.ValidationResult, error)
	ValidatePackageJSON(path string) error
	ValidateGoMod(path string) error
	ValidateDockerfile(path string) error
	ValidateYAML(path string) error
	ValidateJSON(path string) error
	ValidateTemplate(path string) error

	// Enhanced project validation
	ValidateProjectStructure(path string) (*StructureValidationResult, error)
	ValidateProjectDependencies(path string) (*DependencyValidationResult, error)
	ValidateProjectSecurity(path string) (*SecurityValidationResult, error)
	ValidateProjectQuality(path string) (*QualityValidationResult, error)

	// Configuration validation
	ValidateConfiguration(config *models.ProjectConfig) (*ConfigValidationResult, error)
	ValidateConfigurationSchema(config any, schema *ConfigSchema) error
	ValidateConfigurationValues(config *models.ProjectConfig) (*ConfigValidationResult, error)

	// Template validation (enhanced versions)
	ValidateTemplateAdvanced(path string) (*TemplateValidationResult, error)
	ValidateTemplateMetadata(metadata *TemplateMetadata) error
	ValidateTemplateStructure(path string) (*StructureValidationResult, error)
	ValidateTemplateVariables(variables map[string]TemplateVariable) error

	// Validation options
	SetValidationRules(rules []ValidationRule) error
	GetValidationRules() []ValidationRule
	AddValidationRule(rule ValidationRule) error
	RemoveValidationRule(ruleID string) error

	// Auto-fix capabilities
	FixValidationIssues(path string, issues []ValidationIssue) (*FixResult, error)
	GetFixableIssues(issues []ValidationIssue) []ValidationIssue
	PreviewFixes(path string, issues []ValidationIssue) (*FixPreview, error)
	ApplyFix(path string, fix Fix) error

	// Validation reporting
	GenerateValidationReport(result *ValidationResult, format string) ([]byte, error)
	GetValidationSummary(results []*ValidationResult) (*ValidationSummary, error)
}

ValidationEngine defines the contract for comprehensive project validation operations.

The ValidationEngine interface provides essential validation capabilities for generated projects, templates, and configurations. It ensures that generated projects meet quality standards and are free from common configuration issues.

The validation engine covers:

  • Project structure and dependency validation
  • Configuration validation with schema checking
  • Template validation and structure checking
  • Auto-fix capabilities for common issues
  • Validation rule management and customization

Implementations should provide:

  • Comprehensive validation results with actionable feedback
  • Validation rules for core functionality and best practices
  • Auto-fix capabilities where possible

type ValidationError

type ValidationError struct {
	Field           string           `json:"field"`
	Value           string           `json:"value"`
	Message         string           `json:"message"`
	Code            string           `json:"code"`
	Suggestions     []string         `json:"suggestions,omitempty"`
	RecoveryOptions []RecoveryOption `json:"recovery_options,omitempty"`
}

ValidationError represents a validation error with recovery options

func NewValidationError

func NewValidationError(field, value, message, code string) *ValidationError

NewValidationError creates a new validation error

func (*ValidationError) Error

func (v *ValidationError) Error() string

Error implements the error interface

func (*ValidationError) WithRecoveryOptions

func (v *ValidationError) WithRecoveryOptions(options ...RecoveryOption) *ValidationError

WithRecoveryOptions adds recovery options to a validation error

func (*ValidationError) WithSuggestions

func (v *ValidationError) WithSuggestions(suggestions ...string) *ValidationError

WithSuggestions adds suggestions to a validation error

type ValidationIssue

type ValidationIssue struct {
	Type     string            `json:"type"`
	Severity string            `json:"severity"`
	Message  string            `json:"message"`
	File     string            `json:"file,omitempty"`
	Line     int               `json:"line,omitempty"`
	Column   int               `json:"column,omitempty"`
	Rule     string            `json:"rule"`
	Fixable  bool              `json:"fixable"`
	Metadata map[string]string `json:"metadata,omitempty"`
}

ValidationIssue represents a validation issue

type ValidationOptions

type ValidationOptions struct {
	Verbose        bool     `json:"verbose"`
	Fix            bool     `json:"fix"`
	Report         bool     `json:"report"`
	ReportFormat   string   `json:"report_format"`
	Rules          []string `json:"rules"`
	IgnoreWarnings bool     `json:"ignore_warnings"`
	OutputFile     string   `json:"output_file"`
}

ValidationOptions defines options for project validation

type ValidationResult

type ValidationResult struct {
	Valid          bool              `json:"valid"`
	Issues         []ValidationIssue `json:"issues"`
	Warnings       []ValidationIssue `json:"warnings"`
	Summary        ValidationSummary `json:"summary"`
	FixSuggestions []FixSuggestion   `json:"fix_suggestions"`
}

ValidationResult contains the result of project validation

type ValidationRule

type ValidationRule struct {
	ID          string         `json:"id"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Category    string         `json:"category"`
	Severity    string         `json:"severity"`
	Enabled     bool           `json:"enabled"`
	Config      map[string]any `json:"config,omitempty"`
	Pattern     string         `json:"pattern,omitempty"`
	FileTypes   []string       `json:"file_types,omitempty"`
	Fixable     bool           `json:"fixable"`
}

ValidationRule defines a validation rule with its configuration

type ValidationSummary

type ValidationSummary struct {
	TotalFiles   int `json:"total_files"`
	ValidFiles   int `json:"valid_files"`
	ErrorCount   int `json:"error_count"`
	WarningCount int `json:"warning_count"`
	FixableCount int `json:"fixable_count"`
}

ValidationSummary contains validation statistics

type VariableValidation

type VariableValidation struct {
	Pattern   string   `json:"pattern,omitempty"`
	MinLength *int     `json:"min_length,omitempty"`
	MaxLength *int     `json:"max_length,omitempty"`
	Minimum   *float64 `json:"minimum,omitempty"`
	Maximum   *float64 `json:"maximum,omitempty"`
	Enum      []string `json:"enum,omitempty"`
}

VariableValidation defines validation rules for template variables

type VersionCheck

type VersionCheck struct {
	Current    string `json:"current"`
	Latest     string `json:"latest"`
	Compatible bool   `json:"compatible"`
	UpdateType string `json:"update_type"` // major, minor, patch
}

VersionCheck represents a version compatibility check

type VersionConfig

type VersionConfig struct {
	// Update settings
	AutoUpdate          bool          `json:"auto_update"`
	UpdateChannel       string        `json:"update_channel"` // stable, beta, alpha
	CheckInterval       time.Duration `json:"check_interval"`
	UpdateNotifications bool          `json:"update_notifications"`

	// Cache settings
	CacheVersions bool          `json:"cache_versions"`
	CacheTTL      time.Duration `json:"cache_ttl"`
	OfflineMode   bool          `json:"offline_mode"`

	// Security settings
	VerifySignatures bool     `json:"verify_signatures"`
	TrustedSources   []string `json:"trusted_sources"`
	AllowPrerelease  bool     `json:"allow_prerelease"`

	// Package settings
	PackageRegistries []string      `json:"package_registries"`
	PackageTimeout    time.Duration `json:"package_timeout"`
	PackageRetries    int           `json:"package_retries"`
}

VersionConfig defines configuration for version management

func DefaultVersionConfig

func DefaultVersionConfig() *VersionConfig

DefaultVersionConfig returns default version configuration

type VersionConflict

type VersionConflict struct {
	Package1   string `json:"package1"`
	Version1   string `json:"version1"`
	Package2   string `json:"package2"`
	Version2   string `json:"version2"`
	Reason     string `json:"reason"`
	Severity   string `json:"severity"`
	Resolution string `json:"resolution"`
}

VersionConflict represents a version conflict

type VersionInfo

type VersionInfo struct {
	Version      string            `json:"version"`
	BuildDate    time.Time         `json:"build_date"`
	GitCommit    string            `json:"git_commit"`
	GitBranch    string            `json:"git_branch"`
	GoVersion    string            `json:"go_version"`
	Platform     string            `json:"platform"`
	Architecture string            `json:"architecture"`
	BuildTags    []string          `json:"build_tags"`
	Metadata     map[string]string `json:"metadata"`
}

VersionInfo contains detailed version information

type VersionManager

type VersionManager interface {
	// Basic version operations
	GetLatestNodeVersion() (string, error)
	GetLatestGoVersion() (string, error)
	GetLatestNPMPackage(packageName string) (string, error)
	GetLatestGoModule(moduleName string) (string, error)
	UpdateVersionsConfig() (*models.VersionConfig, error)
	GetLatestGitHubRelease(owner, repo string) (string, error)
	GetVersionHistory(packageName string) ([]string, error)

	// Enhanced version information
	GetCurrentVersion() string
	GetLatestVersion() (*VersionInfo, error)
	GetAllPackageVersions() (map[string]string, error)
	GetLatestPackageVersions() (map[string]string, error)
	GetDetailedVersionHistory() ([]VersionInfo, error)

	// Update management
	CheckForUpdates() (*UpdateInfo, error)
	DownloadUpdate(version string) error
	InstallUpdate(version string) error
	GetUpdateChannel() string
	SetUpdateChannel(channel string) error

	// Version compatibility
	CheckCompatibility(projectPath string) (*CompatibilityResult, error)
	GetSupportedVersions() (map[string][]string, error)
	ValidateVersionRequirements(requirements map[string]string) (*VersionValidationResult, error)

	// Version caching
	CacheVersionInfo(info *VersionInfo) error
	GetCachedVersionInfo() (*VersionInfo, error)
	RefreshVersionCache() error
	ClearVersionCache() error

	// Release information
	GetReleaseNotes(version string) (*ReleaseNotes, error)
	GetChangeLog(fromVersion, toVersion string) (*ChangeLog, error)
	GetSecurityAdvisories(version string) ([]SecurityAdvisory, error)

	// Package management
	GetPackageInfo(packageName string) (*PackageInfo, error)
	GetPackageVersions(packageName string) ([]string, error)
	CheckPackageUpdates(packages map[string]string) (map[string]PackageUpdate, error)

	// Version configuration
	SetVersionConfig(config *VersionConfig) error
	GetVersionConfig() (*VersionConfig, error)
	SetAutoUpdate(enabled bool) error
	SetUpdateNotifications(enabled bool) error
}

VersionManager defines the contract for comprehensive version management operations

type VersionOptions

type VersionOptions struct {
	ShowPackages  bool   `json:"show_packages"`
	CheckUpdates  bool   `json:"check_updates"`
	ShowBuildInfo bool   `json:"show_build_info"`
	OutputFormat  string `json:"output_format"`
}

VersionOptions defines options for version display

type VersionRequirement

type VersionRequirement struct {
	Package    string `json:"package"`
	Required   string `json:"required"`
	Current    string `json:"current"`
	Available  string `json:"available"`
	Satisfied  bool   `json:"satisfied"`
	UpdateType string `json:"update_type"` // major, minor, patch
}

VersionRequirement represents a version requirement check

type VersionValidationResult

type VersionValidationResult struct {
	Valid        bool                     `json:"valid"`
	Requirements []VersionRequirement     `json:"requirements"`
	Conflicts    []VersionConflict        `json:"conflicts"`
	Missing      []string                 `json:"missing"`
	Summary      VersionValidationSummary `json:"summary"`
}

VersionValidationResult contains version validation results

type VersionValidationSummary

type VersionValidationSummary struct {
	TotalRequirements     int `json:"total_requirements"`
	SatisfiedRequirements int `json:"satisfied_requirements"`
	ConflictCount         int `json:"conflict_count"`
	MissingCount          int `json:"missing_count"`
	UpdatesAvailable      int `json:"updates_available"`
}

VersionValidationSummary contains version validation statistics

type Vulnerability

type Vulnerability struct {
	ID          string `json:"id"`
	Severity    string `json:"severity"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Package     string `json:"package"`
	Version     string `json:"version"`
	FixedIn     string `json:"fixed_in,omitempty"`
}

Vulnerability represents a security vulnerability

type VulnerabilityReport

type VulnerabilityReport struct {
	ScanTime        time.Time            `json:"scan_time"`
	Vulnerabilities []Vulnerability      `json:"vulnerabilities"`
	Summary         VulnerabilitySummary `json:"summary"`
	Recommendations []string             `json:"recommendations"`
}

VulnerabilityReport contains detailed vulnerability scan results

type VulnerabilitySummary

type VulnerabilitySummary struct {
	Total    int `json:"total"`
	Critical int `json:"critical"`
	High     int `json:"high"`
	Medium   int `json:"medium"`
	Low      int `json:"low"`
	Fixed    int `json:"fixed"`
	Ignored  int `json:"ignored"`
}

VulnerabilitySummary contains vulnerability statistics

Jump to

Keyboard shortcuts

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