ui

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: 21 Imported by: 0

Documentation

Overview

Package ui provides completion system for interactive CLI generation.

This file implements the CompletionSystem which provides completion summaries, next steps guidance, and final project information after successful generation.

Package ui provides interactive configuration management for the CLI generator.

This file implements the InteractiveConfigurationManager which handles saving, loading, and managing interactive configurations through the UI system.

Package ui provides default value management for project configuration.

This file implements the DefaultManager which handles sensible default values for optional metadata fields and provides comprehensive validation for all project configuration fields.

Package ui provides interactive user interface components for directory selection and validation.

This file implements the DirectorySelector which handles interactive selection of output directories with path validation, existence checking, and conflict handling.

Package ui provides display components for tables, trees, and progress tracking.

This file contains implementations for visual display components that complement the interactive UI framework with formatted output capabilities.

Package ui provides enhanced interactive UI with comprehensive navigation and help systems.

This file implements the EnhancedInteractiveUI which integrates the NavigationSystem and HelpSystem to provide a complete interactive experience with breadcrumbs, context-sensitive help, and comprehensive error handling.

Package ui provides error handling and recovery components for the interactive UI.

This file contains implementations for error display, recovery options, and user-friendly error handling with actionable suggestions.

Package ui provides context-sensitive help system for interactive CLI generation.

This file implements the HelpSystem which provides context-aware help information, error recovery options, and completion summaries throughout the interactive project generation workflow.

Package ui provides interactive user interface components for the CLI generator.

This package implements comprehensive interactive functionality including:

  • Menu navigation with keyboard shortcuts
  • Input collection with validation and error recovery
  • Progress tracking and visual feedback
  • Context-sensitive help system
  • Session management and state persistence

Package ui provides interactive flow management for the CLI generator.

This file implements the InteractiveFlowManager which orchestrates the complete interactive project generation workflow including template selection, configuration collection, directory selection, and preview generation.

Package ui provides the main interactive template selection interface.

Package ui provides metadata processing for template incorporation.

This file implements the MetadataProcessor which handles incorporation of project metadata into template processing and file generation.

Package ui provides comprehensive navigation system for interactive CLI generation.

This file implements the NavigationSystem which provides breadcrumb navigation, keyboard shortcuts, help system, and navigation state management throughout the interactive project generation workflow.

Package ui provides preview navigation functionality for interactive CLI generation.

Package ui provides interactive user interface components for project configuration collection.

This file implements the ProjectConfigCollector which handles interactive collection of project metadata including name, description, organization, author, and license with comprehensive validation and preview functionality.

Package ui provides integration functionality for project structure preview and navigation.

Package ui provides project structure preview functionality for interactive CLI generation.

Package ui provides scrollable menu functionality for better navigation in long lists.

This file implements scrollable menu components that handle proper keyboard navigation and viewport management for lists that exceed the terminal height.

Package ui provides template preview and combination logic for interactive CLI generation.

Package ui provides template selection components for interactive CLI generation.

Package ui provides input validation and error recovery functionality.

This file contains validation utilities, common validators, and error recovery mechanisms for interactive UI components.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProjectNamePattern validates project names (alphanumeric, hyphens, underscores)
	ProjectNamePattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]$`)

	// PackageNamePattern validates package names (lowercase, hyphens)
	PackageNamePattern = regexp.MustCompile(`^[a-z][a-z0-9-]*[a-z0-9]$`)

	// VersionPattern validates semantic version numbers
	VersionPattern = regexp.MustCompile(`^v?(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*))?(?:\+([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*))?$`)

	// URLPattern validates HTTP/HTTPS URLs
	URLPattern = regexp.MustCompile(`^https?://[a-zA-Z0-9.-]+(?:\.[a-zA-Z]{2,})?(?:/[^\s]*)?$`)

	// GitHubRepoPattern validates GitHub repository names
	GitHubRepoPattern = regexp.MustCompile(`^[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+$`)
)

Common validation patterns

Functions

func CreateDefaultValueRecovery

func CreateDefaultValueRecovery(defaultValue string) interfaces.RecoveryOption

CreateDefaultValueRecovery creates a recovery option that sets a default value

func CreateRecoveryOption

func CreateRecoveryOption(label, description string, action func() error, safe bool) interfaces.RecoveryOption

CreateRecoveryOption creates a recovery option with the specified parameters

func CreateSkipFieldRecovery

func CreateSkipFieldRecovery(fieldName string) interfaces.RecoveryOption

CreateSkipFieldRecovery creates a recovery option that skips the field

func CreateSuggestionRecovery

func CreateSuggestionRecovery(suggestion string) interfaces.RecoveryOption

CreateSuggestionRecovery creates a recovery option that applies a suggestion

func CreateValidationError

func CreateValidationError(field, value, message string, suggestions []string, recoveryOptions []interfaces.RecoveryOption) *interfaces.ValidationError

CreateValidationError creates a validation error with suggestions and recovery options

func ExampleProjectStructureIntegrationUsage

func ExampleProjectStructureIntegrationUsage(ctx context.Context, ui interfaces.InteractiveUIInterface, templateManager interfaces.TemplateManager, logger interfaces.Logger) error

Example usage function for documentation purposes

func NewEnhancedInteractiveUI

func NewEnhancedInteractiveUI(logger interfaces.Logger, config *EnhancedUIConfig) interfaces.InteractiveUIInterface

NewEnhancedInteractiveUI creates a new enhanced interactive UI

func NewInteractiveUI

func NewInteractiveUI(logger interfaces.Logger, config *UIConfig) interfaces.InteractiveUIInterface

NewInteractiveUI creates a new interactive UI instance

func SanitizeInput

func SanitizeInput(input string) string

SanitizeInput sanitizes user input by trimming whitespace and normalizing

func SuggestCorrection

func SuggestCorrection(input, pattern string) string

SuggestCorrection suggests a correction for invalid input

func ValidateAndSuggest

func ValidateAndSuggest(input string, chain *ValidationChain) (string, []string, error)

ValidateAndSuggest validates input and provides suggestions if invalid

Types

type CombinedTemplatePreview

type CombinedTemplatePreview struct {
	Templates        []TemplateSelection
	ProjectStructure *ProjectStructure
	FileConflicts    []FileConflict
	Dependencies     []string
	EstimatedSize    int64
	TotalFiles       int
	Warnings         []string
}

CombinedTemplatePreview represents a preview of multiple templates combined

type CompletionConfig

type CompletionConfig struct {
	ShowGeneratedFiles    bool `json:"show_generated_files"`
	ShowNextSteps         bool `json:"show_next_steps"`
	ShowCommands          bool `json:"show_commands"`
	ShowTroubleshooting   bool `json:"show_troubleshooting"`
	ShowAdditionalInfo    bool `json:"show_additional_info"`
	EnableInteractiveHelp bool `json:"enable_interactive_help"`
}

CompletionConfig defines configuration for the completion system

type CompletionSummary

type CompletionSummary struct {
	Title          string                 `json:"title"`
	Description    string                 `json:"description"`
	GeneratedItems []GeneratedItem        `json:"generated_items"`
	NextSteps      []NextStep             `json:"next_steps"`
	AdditionalInfo []string               `json:"additional_info"`
	Metadata       map[string]interface{} `json:"metadata"`
}

CompletionSummary represents a completion summary

type CompletionSystem

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

CompletionSystem manages completion summaries and next steps

func NewCompletionSystem

func NewCompletionSystem(ui interfaces.InteractiveUIInterface, helpSystem *HelpSystem, logger interfaces.Logger, config *CompletionConfig) *CompletionSystem

NewCompletionSystem creates a new completion system

func (*CompletionSystem) ShowCompletionSummary

func (cs *CompletionSystem) ShowCompletionSummary(ctx context.Context, result *GenerationResult) error

ShowCompletionSummary displays a comprehensive completion summary

type ComponentTemplateMapping

type ComponentTemplateMapping struct {
	Component     string   `json:"component"`
	Directory     string   `json:"directory"`
	Templates     []string `json:"templates"`
	Description   string   `json:"description"`
	FileCount     int      `json:"file_count"`
	EstimatedSize int64    `json:"estimated_size"`
}

ComponentTemplateMapping shows which templates contribute to each component

type ConfigurationLoadOptions

type ConfigurationLoadOptions struct {
	AllowModification bool
	ShowPreview       bool
	ConfirmLoad       bool
}

ConfigurationLoadOptions contains options for loading configurations

type ConfigurationSaveOptions

type ConfigurationSaveOptions struct {
	Name        string
	Description string
	Tags        []string
	Overwrite   bool
}

ConfigurationSaveOptions contains options for saving configurations

type DefaultManager

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

DefaultManager manages default values for project configuration

func NewDefaultManager

func NewDefaultManager(logger interfaces.Logger) *DefaultManager

NewDefaultManager creates a new default manager

func (*DefaultManager) GetDefaultSources

func (dm *DefaultManager) GetDefaultSources() map[string]DefaultValue

GetDefaultSources returns information about where defaults come from

func (*DefaultManager) GetDefaultsForProject

func (dm *DefaultManager) GetDefaultsForProject(projectName string) *ProjectConfigDefaults

GetDefaultsForProject returns default values for a new project

func (*DefaultManager) GetUserDefaults

func (dm *DefaultManager) GetUserDefaults() *UserDefaults

GetUserDefaults returns the current user defaults

func (*DefaultManager) SaveUserDefaults

func (dm *DefaultManager) SaveUserDefaults(defaults *UserDefaults) error

SaveUserDefaults saves user defaults to configuration file

func (*DefaultManager) ValidateDefaults

func (dm *DefaultManager) ValidateDefaults() error

ValidateDefaults validates all default values

type DefaultSource

type DefaultSource string

DefaultSource represents where a default value comes from

const (
	DefaultSourceSystem      DefaultSource = "system"
	DefaultSourceUser        DefaultSource = "user"
	DefaultSourceEnvironment DefaultSource = "environment"
	DefaultSourceGit         DefaultSource = "git"
	DefaultSourceInferred    DefaultSource = "inferred"
)

type DefaultValue

type DefaultValue struct {
	Value  string        `json:"value"`
	Source DefaultSource `json:"source"`
	Reason string        `json:"reason"`
}

DefaultValue represents a default value with its source

type DirectoryNode

type DirectoryNode struct {
	Name        string
	Path        string
	Children    []*DirectoryNode
	Files       []*FileNode
	Source      string // which template created this directory
	Description string
}

DirectoryNode represents a directory in the project structure

type DirectorySelectionResult

type DirectorySelectionResult struct {
	Path               string
	Exists             bool
	RequiresCreation   bool
	ConflictResolution string // "overwrite", "backup", "merge", "cancel"
	BackupPath         string
	Cancelled          bool
}

DirectorySelectionResult contains the result of directory selection

type DirectorySelector

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

DirectorySelector handles interactive selection and validation of output directories

func NewDirectorySelector

func NewDirectorySelector(ui interfaces.InteractiveUIInterface, logger interfaces.Logger) *DirectorySelector

NewDirectorySelector creates a new directory selector

func (*DirectorySelector) CreateBackup

func (ds *DirectorySelector) CreateBackup(sourcePath, backupPath string) error

CreateBackup creates a backup of the existing directory

func (*DirectorySelector) CreateDirectory

func (ds *DirectorySelector) CreateDirectory(path string) error

CreateDirectory creates the directory and any necessary parent directories

func (*DirectorySelector) SelectOutputDirectory

func (ds *DirectorySelector) SelectOutputDirectory(ctx context.Context, defaultPath string) (*DirectorySelectionResult, error)

SelectOutputDirectory interactively selects and validates an output directory

type DirectoryValidator

type DirectoryValidator struct {
}

DirectoryValidator provides validation for directory paths and operations

func (*DirectoryValidator) ValidateDirectoryPath

func (v *DirectoryValidator) ValidateDirectoryPath(path string) error

ValidateDirectoryPath validates the directory path format and accessibility

func (*DirectoryValidator) ValidateParentDirectory

func (v *DirectoryValidator) ValidateParentDirectory(parentPath string) error

ValidateParentDirectory validates that the parent directory exists and is writable

type EnhancedInteractiveUI

type EnhancedInteractiveUI struct {
	*InteractiveUI
	// contains filtered or unexported fields
}

EnhancedInteractiveUI extends the basic InteractiveUI with navigation and help systems

func (*EnhancedInteractiveUI) GetHelpSystem

func (eui *EnhancedInteractiveUI) GetHelpSystem() *HelpSystem

GetHelpSystem returns the help system

func (*EnhancedInteractiveUI) GetNavigationSystem

func (eui *EnhancedInteractiveUI) GetNavigationSystem() *NavigationSystem

GetNavigationSystem returns the navigation system

func (*EnhancedInteractiveUI) PromptConfirm

PromptConfirm displays an enhanced confirmation prompt with navigation and help

func (*EnhancedInteractiveUI) PromptText

PromptText displays an enhanced text prompt with navigation and help

func (*EnhancedInteractiveUI) SetNavigationStep

func (eui *EnhancedInteractiveUI) SetNavigationStep(stepName string, stepIndex, totalSteps int)

SetNavigationStep sets the current navigation step

func (*EnhancedInteractiveUI) ShowBreadcrumb

func (eui *EnhancedInteractiveUI) ShowBreadcrumb(ctx context.Context, path []string) error

ShowBreadcrumb displays breadcrumb navigation

func (*EnhancedInteractiveUI) ShowCompletionSummary

func (eui *EnhancedInteractiveUI) ShowCompletionSummary(ctx context.Context, summary *CompletionSummary) error

ShowCompletionSummary displays a completion summary

func (*EnhancedInteractiveUI) ShowError

ShowError displays an enhanced error with recovery options

func (*EnhancedInteractiveUI) ShowHelp

func (eui *EnhancedInteractiveUI) ShowHelp(ctx context.Context, helpContext string) error

ShowHelp displays context-sensitive help

func (*EnhancedInteractiveUI) ShowMenu

ShowMenu displays an enhanced menu with navigation and help

func (*EnhancedInteractiveUI) ShowMultiSelect

ShowMultiSelect displays an enhanced multi-select with navigation and help

type EnhancedUIConfig

type EnhancedUIConfig struct {
	*UIConfig
	NavigationConfig  *NavigationConfig `json:"navigation_config"`
	HelpConfig        *HelpConfig       `json:"help_config"`
	EnableBreadcrumbs bool              `json:"enable_breadcrumbs"`
	EnableStepCounter bool              `json:"enable_step_counter"`
	EnableContextHelp bool              `json:"enable_context_help"`
}

EnhancedUIConfig defines configuration for the enhanced interactive UI

type ErrorHandler

type ErrorHandler struct {
	ErrorType       string                      `json:"error_type"`
	RecoveryOptions []interfaces.RecoveryOption `json:"recovery_options"`
	HelpText        string                      `json:"help_text"`
	AutoRecover     bool                        `json:"auto_recover"`
}

ErrorHandler defines how to handle specific types of errors

type FileConflict

type FileConflict struct {
	Path       string
	Templates  []string
	Severity   string // "error", "warning", "info"
	Message    string
	Resolvable bool
}

FileConflict represents a conflict between templates

type FileMetadata

type FileMetadata struct {
	// Common metadata
	*TemplateMetadata

	// File-specific metadata
	FileName     string `json:"file_name"`
	FileType     string `json:"file_type"`
	RelativePath string `json:"relative_path"`

	// Language-specific metadata
	GoPackage    string `json:"go_package,omitempty"`
	JSModule     string `json:"js_module,omitempty"`
	PythonModule string `json:"python_module,omitempty"`
}

FileMetadata represents metadata for specific file types

type FileNode

type FileNode struct {
	Name        string
	Path        string
	Size        int64
	Source      string // which template created this file
	Templated   bool   // whether this is a template file
	Executable  bool
	Description string
}

FileNode represents a file in the project structure

type GeneratedFileInfo

type GeneratedFileInfo struct {
	Path         string `json:"path"`
	RelativePath string `json:"relative_path"`
	Type         string `json:"type"` // "file", "directory", "symlink"
	Size         int64  `json:"size"`
	Template     string `json:"template"`
	Category     string `json:"category"`
}

GeneratedFileInfo contains information about a generated file

type GeneratedItem

type GeneratedItem struct {
	Type        string `json:"type"`
	Name        string `json:"name"`
	Path        string `json:"path"`
	Description string `json:"description"`
	Size        string `json:"size,omitempty"`
}

GeneratedItem represents an item that was generated

type GenerationResult

type GenerationResult struct {
	ProjectConfig     *models.ProjectConfig `json:"project_config"`
	OutputDirectory   string                `json:"output_directory"`
	SelectedTemplates []TemplateSelection   `json:"selected_templates"`
	GeneratedFiles    []GeneratedFileInfo   `json:"generated_files"`
	TotalFiles        int                   `json:"total_files"`
	TotalSize         int64                 `json:"total_size"`
	Duration          string                `json:"duration"`
	Errors            []string              `json:"errors,omitempty"`
	Warnings          []string              `json:"warnings,omitempty"`
}

GenerationResult contains the results of project generation

type HelpConfig

type HelpConfig struct {
	ShowContextualHelp    bool `json:"show_contextual_help"`
	ShowExamples          bool `json:"show_examples"`
	ShowTroubleshooting   bool `json:"show_troubleshooting"`
	ShowRecoveryOptions   bool `json:"show_recovery_options"`
	AutoShowOnError       bool `json:"auto_show_on_error"`
	DetailedErrorMessages bool `json:"detailed_error_messages"`
}

HelpConfig defines configuration for the help system

type HelpContext

type HelpContext struct {
	Name            string                        `json:"name"`
	Title           string                        `json:"title"`
	Description     string                        `json:"description"`
	Instructions    []string                      `json:"instructions"`
	Examples        []HelpExample                 `json:"examples"`
	Shortcuts       []interfaces.KeyboardShortcut `json:"shortcuts"`
	Troubleshooting []TroubleshootingItem         `json:"troubleshooting"`
	RelatedTopics   []string                      `json:"related_topics"`
	Metadata        map[string]interface{}        `json:"metadata"`
}

HelpContext defines help information for a specific context

type HelpExample

type HelpExample struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Input       string `json:"input"`
	Output      string `json:"output"`
	Notes       string `json:"notes,omitempty"`
}

HelpExample represents a help example

type HelpSystem

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

HelpSystem manages context-sensitive help and error recovery

func NewHelpSystem

func NewHelpSystem(ui interfaces.InteractiveUIInterface, logger interfaces.Logger, config *HelpConfig) *HelpSystem

NewHelpSystem creates a new help system

func (*HelpSystem) AddErrorHandler

func (hs *HelpSystem) AddErrorHandler(handler ErrorHandler)

AddErrorHandler adds a new error handler

func (*HelpSystem) AddHelpContext

func (hs *HelpSystem) AddHelpContext(context *HelpContext)

AddHelpContext adds a new help context

func (*HelpSystem) GetHelpContext

func (hs *HelpSystem) GetHelpContext(name string) (*HelpContext, bool)

GetHelpContext retrieves a help context by name

func (*HelpSystem) HandleError

func (hs *HelpSystem) HandleError(ctx context.Context, err error, errorType string) (*interfaces.ErrorResult, error)

HandleError handles errors with recovery options

func (*HelpSystem) ShowCompletionSummary

func (hs *HelpSystem) ShowCompletionSummary(ctx context.Context, summary *CompletionSummary) error

ShowCompletionSummary displays a completion summary

func (*HelpSystem) ShowContextHelp

func (hs *HelpSystem) ShowContextHelp(ctx context.Context, contextName string, additionalInfo ...string) error

ShowContextHelp displays help for a specific context

type InteractiveConfigurationManager

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

InteractiveConfigurationManager handles interactive configuration operations

func NewInteractiveConfigurationManager

func NewInteractiveConfigurationManager(
	ui interfaces.InteractiveUIInterface,
	configDir string,
	logger interfaces.Logger,
) *InteractiveConfigurationManager

NewInteractiveConfigurationManager creates a new interactive configuration manager

func (*InteractiveConfigurationManager) LoadConfigurationInteractively

func (icm *InteractiveConfigurationManager) LoadConfigurationInteractively(
	ctx context.Context,
	options *ConfigurationLoadOptions,
) (*LoadedConfiguration, error)

LoadConfigurationInteractively prompts the user to load a saved configuration

func (*InteractiveConfigurationManager) ManageConfigurationsInteractively

func (icm *InteractiveConfigurationManager) ManageConfigurationsInteractively(ctx context.Context) error

ManageConfigurationsInteractively provides an interactive configuration management interface

func (*InteractiveConfigurationManager) SaveConfigurationInteractively

func (icm *InteractiveConfigurationManager) SaveConfigurationInteractively(
	ctx context.Context,
	projectConfig *models.ProjectConfig,
	selectedTemplates []TemplateSelection,
) (string, error)

SaveConfigurationInteractively prompts the user to save a configuration

type InteractiveFlowManager

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

InteractiveFlowManager orchestrates the interactive project generation workflow

func NewInteractiveFlowManager

func NewInteractiveFlowManager(
	ui interfaces.InteractiveUIInterface,
	templateManager interfaces.TemplateManager,
	configManager interfaces.ConfigManager,
	validator interfaces.ValidationEngine,
	logger interfaces.Logger,
) *InteractiveFlowManager

NewInteractiveFlowManager creates a new interactive flow manager

func (*InteractiveFlowManager) LoadConfigurationInteractively

func (ifm *InteractiveFlowManager) LoadConfigurationInteractively(ctx context.Context) (*LoadedConfiguration, error)

LoadConfigurationInteractively loads a saved configuration interactively

func (*InteractiveFlowManager) ManageConfigurationsInteractively

func (ifm *InteractiveFlowManager) ManageConfigurationsInteractively(ctx context.Context) error

ManageConfigurationsInteractively provides configuration management interface

func (*InteractiveFlowManager) RunInteractiveGeneration

RunInteractiveGeneration runs the complete interactive generation workflow

func (*InteractiveFlowManager) RunInteractiveGenerationFromConfig

func (ifm *InteractiveFlowManager) RunInteractiveGenerationFromConfig(
	ctx context.Context,
	loadedConfig *LoadedConfiguration,
	generationConfig *InteractiveGenerationConfig,
) (*InteractiveGenerationResult, error)

RunInteractiveGenerationFromConfig runs generation using a loaded configuration

type InteractiveGenerationConfig

type InteractiveGenerationConfig struct {
	DefaultOutputPath string
	AllowBack         bool
	AllowQuit         bool
	ShowHelp          bool
	AutoSave          bool
	SkipPreview       bool
}

InteractiveGenerationConfig contains configuration for interactive generation

type InteractiveGenerationResult

type InteractiveGenerationResult struct {
	ProjectConfig      *models.ProjectConfig
	SelectedTemplates  []TemplateSelection
	OutputDirectory    *DirectorySelectionResult
	PreviewAccepted    bool
	Cancelled          bool
	SavedConfiguration string
}

InteractiveGenerationResult contains the result of interactive generation

type InteractiveTemplateSelection

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

InteractiveTemplateSelection provides the main interface for interactive template selection

func NewInteractiveTemplateSelection

func NewInteractiveTemplateSelection(ui interfaces.InteractiveUIInterface, templateManager interfaces.TemplateManager, logger interfaces.Logger) *InteractiveTemplateSelection

NewInteractiveTemplateSelection creates a new interactive template selection interface

func (*InteractiveTemplateSelection) GetTemplateInfo

func (its *InteractiveTemplateSelection) GetTemplateInfo(ctx context.Context, templateName string) error

GetTemplateInfo provides detailed information about a specific template

func (*InteractiveTemplateSelection) ListAvailableTemplates

func (its *InteractiveTemplateSelection) ListAvailableTemplates(ctx context.Context) error

ListAvailableTemplates shows all available templates organized by category

func (*InteractiveTemplateSelection) SelectTemplatesInteractively

func (its *InteractiveTemplateSelection) SelectTemplatesInteractively(ctx context.Context, config *models.ProjectConfig) (*TemplateSelectionResult, error)

SelectTemplatesInteractively runs the complete interactive template selection flow

type InteractiveUI

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

InteractiveUI implements the InteractiveUIInterface for terminal-based interaction

func (*InteractiveUI) EndSession

func (ui *InteractiveUI) EndSession(ctx context.Context, session *interfaces.UISession) error

EndSession ends the current UI session

func (*InteractiveUI) HandleGenericError

func (ui *InteractiveUI) HandleGenericError(ctx context.Context, err error, allowRetry, allowIgnore bool) (*interfaces.ErrorResult, error)

HandleGenericError handles a generic error with basic recovery options

func (*InteractiveUI) HandleValidationError

func (ui *InteractiveUI) HandleValidationError(ctx context.Context, err *interfaces.ValidationError) (*interfaces.ErrorResult, error)

HandleValidationError handles a validation error with user-friendly display

func (*InteractiveUI) PromptConfirm

PromptConfirm displays a confirmation prompt

func (*InteractiveUI) PromptSelect

PromptSelect displays a single selection prompt

func (*InteractiveUI) PromptText

PromptText displays a text input prompt with validation

func (*InteractiveUI) RestoreSessionState

func (ui *InteractiveUI) RestoreSessionState(ctx context.Context, sessionID string) (*interfaces.UISession, error)

RestoreSessionState restores a session from saved state

func (*InteractiveUI) SaveSessionState

func (ui *InteractiveUI) SaveSessionState(ctx context.Context, session *interfaces.UISession) error

SaveSessionState saves the current session state

func (*InteractiveUI) ShowBreadcrumb

func (ui *InteractiveUI) ShowBreadcrumb(ctx context.Context, path []string) error

ShowBreadcrumb displays navigation breadcrumbs

func (*InteractiveUI) ShowCheckboxList

func (ui *InteractiveUI) ShowCheckboxList(ctx context.Context, config interfaces.CheckboxConfig) (*interfaces.CheckboxResult, error)

ShowCheckboxList displays a checkbox list interface

func (*InteractiveUI) ShowError

ShowError displays an error with recovery options and handles user response

func (*InteractiveUI) ShowHelp

func (ui *InteractiveUI) ShowHelp(ctx context.Context, helpContext string) error

ShowHelp displays context-sensitive help information

func (*InteractiveUI) ShowMenu

ShowMenu displays an interactive menu and handles user selection

func (*InteractiveUI) ShowMultiSelect

ShowMultiSelect displays a multi-selection interface

func (*InteractiveUI) ShowProgress

ShowProgress creates and returns a progress tracker

func (*InteractiveUI) ShowTable

func (ui *InteractiveUI) ShowTable(ctx context.Context, config interfaces.TableConfig) error

ShowTable displays a formatted table with optional pagination and sorting

func (*InteractiveUI) ShowTree

func (ui *InteractiveUI) ShowTree(ctx context.Context, config interfaces.TreeConfig) error

ShowTree displays a tree structure with optional expansion

func (*InteractiveUI) StartSession

func (ui *InteractiveUI) StartSession(ctx context.Context, config interfaces.SessionConfig) (*interfaces.UISession, error)

StartSession starts a new UI session

type LoadedConfiguration

type LoadedConfiguration struct {
	Name               string                     `json:"name"`
	ProjectConfig      *models.ProjectConfig      `json:"project_config"`
	SelectedTemplates  []TemplateSelection        `json:"selected_templates"`
	GenerationSettings *config.GenerationSettings `json:"generation_settings"`
	UserPreferences    *config.UserPreferences    `json:"user_preferences"`
	LoadedAt           time.Time                  `json:"loaded_at"`
	AllowModification  bool                       `json:"allow_modification"`
}

LoadedConfiguration represents a loaded configuration with metadata

type MetadataProcessor

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

MetadataProcessor handles incorporation of metadata into templates

func NewMetadataProcessor

func NewMetadataProcessor(logger interfaces.Logger) *MetadataProcessor

NewMetadataProcessor creates a new metadata processor

func (*MetadataProcessor) GetMetadataForTemplate

func (mp *MetadataProcessor) GetMetadataForTemplate(metadata *TemplateMetadata) map[string]interface{}

GetMetadataForTemplate returns metadata formatted for template usage

func (*MetadataProcessor) ProcessFileMetadata

func (mp *MetadataProcessor) ProcessFileMetadata(templateMetadata *TemplateMetadata, filePath string) (*FileMetadata, error)

ProcessFileMetadata creates file-specific metadata

func (*MetadataProcessor) ProcessMetadata

func (mp *MetadataProcessor) ProcessMetadata(config *models.ProjectConfig) (*TemplateMetadata, error)

ProcessMetadata converts project configuration to template metadata

func (*MetadataProcessor) ValidateMetadata

func (mp *MetadataProcessor) ValidateMetadata(metadata *TemplateMetadata) error

ValidateMetadata validates the processed metadata

type NavigationAction struct {
	Key         string `json:"key"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Available   bool   `json:"available"`
	Global      bool   `json:"global"`
}

NavigationAction represents available navigation actions

type NavigationConfig struct {
	ShowBreadcrumbs   bool `json:"show_breadcrumbs"`
	ShowShortcuts     bool `json:"show_shortcuts"`
	ShowStepCounter   bool `json:"show_step_counter"`
	ShowProgress      bool `json:"show_progress"`
	EnableHistory     bool `json:"enable_history"`
	MaxHistorySize    int  `json:"max_history_size"`
	AutoShowHelp      bool `json:"auto_show_help"`
	ConfirmNavigation bool `json:"confirm_navigation"`
}

NavigationConfig defines configuration for the navigation system

type NavigationState struct {
	CurrentStep      string                 `json:"current_step"`
	StepIndex        int                    `json:"step_index"`
	TotalSteps       int                    `json:"total_steps"`
	Breadcrumbs      []string               `json:"breadcrumbs"`
	AvailableActions []NavigationAction     `json:"available_actions"`
	Context          map[string]interface{} `json:"context"`
	CanGoBack        bool                   `json:"can_go_back"`
	CanGoNext        bool                   `json:"can_go_next"`
	CanQuit          bool                   `json:"can_quit"`
	CanShowHelp      bool                   `json:"can_show_help"`
}

NavigationState tracks the current navigation state

type NavigationStep struct {
	StepName    string                 `json:"step_name"`
	StepIndex   int                    `json:"step_index"`
	Timestamp   string                 `json:"timestamp"`
	Action      string                 `json:"action"`
	Data        map[string]interface{} `json:"data,omitempty"`
	Breadcrumbs []string               `json:"breadcrumbs"`
}

NavigationStep represents a step in the navigation history

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

NavigationSystem manages navigation state and provides navigation functionality

func NewNavigationSystem

func NewNavigationSystem(ui interfaces.InteractiveUIInterface, logger interfaces.Logger, config *NavigationConfig) *NavigationSystem

NewNavigationSystem creates a new navigation system

func (ns *NavigationSystem) AddToHistory(action string, data map[string]interface{})

AddToHistory adds a navigation step to the history

func (ns *NavigationSystem) CanNavigateBack() bool

CanNavigateBack returns true if back navigation is available

func (ns *NavigationSystem) CanNavigateNext() bool

CanNavigateNext returns true if next navigation is available

func (ns *NavigationSystem) CanQuit() bool

CanQuit returns true if quit is available

func (ns *NavigationSystem) CanShowHelp() bool

CanShowHelp returns true if help is available

func (ns *NavigationSystem) GetContext(key string) (interface{}, bool)

GetContext gets context data from the current navigation state

func (ns *NavigationSystem) GetCurrentState() *NavigationState

GetCurrentState returns the current navigation state

func (ns *NavigationSystem) GetHistory() []NavigationStep

GetHistory returns the navigation history

func (ns *NavigationSystem) HandleNavigationInput(input string) (interfaces.NavigationAction, error)

HandleNavigationInput processes navigation input and returns the action

func (ns *NavigationSystem) Reset()

Reset resets the navigation system to initial state

func (ns *NavigationSystem) SetAvailableActions(actions []NavigationAction)

SetAvailableActions sets the available navigation actions for the current step

func (ns *NavigationSystem) SetContext(key string, value interface{})

SetContext sets context data for the current navigation state

func (ns *NavigationSystem) SetCurrentStep(stepName string, stepIndex, totalSteps int)

SetCurrentStep sets the current navigation step

func (ns *NavigationSystem) ShowBreadcrumbs(ctx context.Context) error

ShowBreadcrumbs displays the current breadcrumb navigation

func (ns *NavigationSystem) ShowNavigationFooter(ctx context.Context) error

ShowNavigationFooter displays available navigation actions and shortcuts

func (ns *NavigationSystem) ShowNavigationHeader(ctx context.Context, title, description string) error

ShowNavigationHeader displays the navigation header with breadcrumbs and step info

func (ns *NavigationSystem) ShowNavigationHelp(ctx context.Context) error

ShowNavigationHelp displays help for navigation commands

type NextStep

type NextStep struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Command     string `json:"command,omitempty"`
	Optional    bool   `json:"optional"`
}

NextStep represents a suggested next step

type PreviewGenerator

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

PreviewGenerator handles project structure preview generation

func NewPreviewGenerator

func NewPreviewGenerator(ui interfaces.InteractiveUIInterface, logger interfaces.Logger) *PreviewGenerator

NewPreviewGenerator creates a new preview generator

func (*PreviewGenerator) GenerateAndShowPreview

func (pg *PreviewGenerator) GenerateAndShowPreview(ctx context.Context, result *InteractiveGenerationResult) (bool, error)

GenerateAndShowPreview generates and displays the project structure preview

type PreviewNavigationManager

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

PreviewNavigationManager handles navigation and modification of project structure previews

func NewPreviewNavigationManager

func NewPreviewNavigationManager(ui interfaces.InteractiveUIInterface, previewGenerator *ProjectStructurePreviewGenerator, logger interfaces.Logger) *PreviewNavigationManager

NewPreviewNavigationManager creates a new preview navigation manager

func (*PreviewNavigationManager) GetCurrentPreview

func (pnm *PreviewNavigationManager) GetCurrentPreview() *ProjectStructurePreview

GetCurrentPreview returns the current preview

func (*PreviewNavigationManager) GetModifiedConfig

func (pnm *PreviewNavigationManager) GetModifiedConfig() *models.ProjectConfig

GetModifiedConfig returns the current project configuration

func (*PreviewNavigationManager) GetModifiedOutputDir

func (pnm *PreviewNavigationManager) GetModifiedOutputDir() string

GetModifiedOutputDir returns the current output directory

func (*PreviewNavigationManager) GetModifiedSelections

func (pnm *PreviewNavigationManager) GetModifiedSelections() []TemplateSelection

GetModifiedSelections returns the current template selections

func (*PreviewNavigationManager) ShowPreviewWithNavigation

func (pnm *PreviewNavigationManager) ShowPreviewWithNavigation(ctx context.Context, config *models.ProjectConfig, selections []TemplateSelection, outputDir string) (*PreviewNavigationResult, error)

ShowPreviewWithNavigation displays the project structure preview with navigation options

type PreviewNavigationResult

type PreviewNavigationResult struct {
	Action             string                `json:"action"` // "confirm", "modify", "back", "quit"
	ModifiedSelections []TemplateSelection   `json:"modified_selections,omitempty"`
	ModifiedConfig     *models.ProjectConfig `json:"modified_config,omitempty"`
	ModifiedOutputDir  string                `json:"modified_output_dir,omitempty"`
	Confirmed          bool                  `json:"confirmed"`
	Cancelled          bool                  `json:"cancelled"`
}

PreviewNavigationResult represents the result of preview navigation

type ProgressTracker

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

ProgressTracker implements the ProgressTracker interface

func (*ProgressTracker) AddLog

func (pt *ProgressTracker) AddLog(message string) error

AddLog adds a log message

func (*ProgressTracker) Close

func (pt *ProgressTracker) Close() error

Close closes the progress tracker

func (*ProgressTracker) Complete

func (pt *ProgressTracker) Complete() error

Complete marks the progress as complete

func (*ProgressTracker) Fail

func (pt *ProgressTracker) Fail(err error) error

Fail marks the progress as failed

func (*ProgressTracker) IsCancelled

func (pt *ProgressTracker) IsCancelled() bool

IsCancelled checks if the operation was cancelled

func (*ProgressTracker) SetCurrentStep

func (pt *ProgressTracker) SetCurrentStep(step int, description string) error

SetCurrentStep sets the current step

func (*ProgressTracker) SetProgress

func (pt *ProgressTracker) SetProgress(progress float64) error

SetProgress updates the progress value (0.0 to 1.0)

type ProjectConfigCollector

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

ProjectConfigCollector handles interactive collection of project configuration

func NewProjectConfigCollector

func NewProjectConfigCollector(ui interfaces.InteractiveUIInterface, logger interfaces.Logger) *ProjectConfigCollector

NewProjectConfigCollector creates a new project configuration collector

func (*ProjectConfigCollector) CollectProjectConfiguration

func (pcc *ProjectConfigCollector) CollectProjectConfiguration(ctx context.Context) (*models.ProjectConfig, error)

CollectProjectConfiguration interactively collects project configuration

func (*ProjectConfigCollector) GetDefaults

func (pcc *ProjectConfigCollector) GetDefaults() *ProjectConfigDefaults

GetDefaults returns the current default values

func (*ProjectConfigCollector) LoadDefaultsFromEnvironment

func (pcc *ProjectConfigCollector) LoadDefaultsFromEnvironment()

LoadDefaultsFromEnvironment loads default values from environment variables

func (*ProjectConfigCollector) SetDefaults

func (pcc *ProjectConfigCollector) SetDefaults(defaults *ProjectConfigDefaults)

SetDefaults sets default values for the configuration collector

type ProjectConfigDefaults

type ProjectConfigDefaults struct {
	License      string
	Author       string
	Email        string
	Organization string
}

ProjectConfigDefaults provides default values for project configuration

type ProjectConfigValidator

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

ProjectConfigValidator provides validation for project configuration fields

func (*ProjectConfigValidator) ValidateAuthor

func (v *ProjectConfigValidator) ValidateAuthor(author string) error

ValidateAuthor validates the author name

func (*ProjectConfigValidator) ValidateDescription

func (v *ProjectConfigValidator) ValidateDescription(description string) error

ValidateDescription validates the project description

func (*ProjectConfigValidator) ValidateEmail

func (v *ProjectConfigValidator) ValidateEmail(email string) error

ValidateEmail validates the email address format

func (*ProjectConfigValidator) ValidateLicense

func (v *ProjectConfigValidator) ValidateLicense(license string) error

ValidateLicense validates the license identifier

func (*ProjectConfigValidator) ValidateOrganization

func (v *ProjectConfigValidator) ValidateOrganization(organization string) error

ValidateOrganization validates the organization name

func (*ProjectConfigValidator) ValidateProjectName

func (v *ProjectConfigValidator) ValidateProjectName(name string) error

ValidateProjectName validates the project name according to naming conventions

func (*ProjectConfigValidator) ValidateRepository

func (v *ProjectConfigValidator) ValidateRepository(repository string) error

ValidateRepository validates the repository URL

type ProjectStructure

type ProjectStructure struct {
	Root        *DirectoryNode
	Directories map[string]*DirectoryNode
	Files       map[string]*FileNode
}

ProjectStructure represents the combined project directory structure

type ProjectStructureIntegration

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

ProjectStructureIntegration provides a complete integration of project structure preview and navigation

func NewProjectStructureIntegration

func NewProjectStructureIntegration(ui interfaces.InteractiveUIInterface, templateManager interfaces.TemplateManager, logger interfaces.Logger) *ProjectStructureIntegration

NewProjectStructureIntegration creates a new project structure integration

func (*ProjectStructureIntegration) DisplayProjectStructurePreviewOnly

func (psi *ProjectStructureIntegration) DisplayProjectStructurePreviewOnly(ctx context.Context, preview *ProjectStructurePreview) error

DisplayProjectStructurePreviewOnly displays a preview without navigation options

func (*ProjectStructureIntegration) GenerateProjectStructurePreviewOnly

func (psi *ProjectStructureIntegration) GenerateProjectStructurePreviewOnly(ctx context.Context, config *models.ProjectConfig, selections []TemplateSelection, outputDir string) (*ProjectStructurePreview, error)

GenerateProjectStructurePreviewOnly generates a preview without navigation (for display-only purposes)

func (*ProjectStructureIntegration) GetNavigationManager

func (psi *ProjectStructureIntegration) GetNavigationManager() *PreviewNavigationManager

GetNavigationManager returns the navigation manager for advanced usage

func (*ProjectStructureIntegration) GetPreviewGenerator

GetPreviewGenerator returns the preview generator for advanced usage

func (*ProjectStructureIntegration) ShowProjectStructurePreviewWithNavigation

func (psi *ProjectStructureIntegration) ShowProjectStructurePreviewWithNavigation(ctx context.Context, config *models.ProjectConfig, selections []TemplateSelection, outputDir string) (*ProjectStructureResult, error)

ShowProjectStructurePreviewWithNavigation displays the complete project structure preview workflow

func (*ProjectStructureIntegration) ValidateProjectStructure

ValidateProjectStructure validates the project structure for potential issues

type ProjectStructurePreview

type ProjectStructurePreview struct {
	ProjectName       string                     `json:"project_name"`
	OutputDirectory   string                     `json:"output_directory"`
	SelectedTemplates []TemplateSelection        `json:"selected_templates"`
	DirectoryTree     *StandardDirectoryTree     `json:"directory_tree"`
	ComponentMapping  []ComponentTemplateMapping `json:"component_mapping"`
	Summary           ProjectSummary             `json:"summary"`
	Warnings          []string                   `json:"warnings"`
	Conflicts         []FileConflict             `json:"conflicts"`
}

ProjectStructurePreview represents a complete project structure preview

type ProjectStructurePreviewGenerator

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

ProjectStructurePreviewGenerator handles generation and display of project structure previews

func NewProjectStructurePreviewGenerator

func NewProjectStructurePreviewGenerator(ui interfaces.InteractiveUIInterface, templateManager interfaces.TemplateManager, logger interfaces.Logger) *ProjectStructurePreviewGenerator

NewProjectStructurePreviewGenerator creates a new project structure preview generator

func (*ProjectStructurePreviewGenerator) DisplayProjectStructurePreview

func (pspg *ProjectStructurePreviewGenerator) DisplayProjectStructurePreview(ctx context.Context, preview *ProjectStructurePreview) error

DisplayProjectStructurePreview shows the project structure preview to the user

func (*ProjectStructurePreviewGenerator) GenerateProjectStructurePreview

func (pspg *ProjectStructurePreviewGenerator) GenerateProjectStructurePreview(ctx context.Context, config *models.ProjectConfig, selections []TemplateSelection, outputDir string) (*ProjectStructurePreview, error)

GenerateProjectStructurePreview creates a comprehensive project structure preview

type ProjectStructureResult

type ProjectStructureResult struct {
	Preview         *ProjectStructurePreview `json:"preview"`
	FinalConfig     *models.ProjectConfig    `json:"final_config"`
	FinalSelections []TemplateSelection      `json:"final_selections"`
	FinalOutputDir  string                   `json:"final_output_dir"`
	UserConfirmed   bool                     `json:"user_confirmed"`
	Action          string                   `json:"action"` // "confirmed", "cancelled", "back"
}

ProjectStructureResult represents the final result of the project structure workflow

type ProjectStructureValidationResult

type ProjectStructureValidationResult struct {
	Valid       bool              `json:"valid"`
	Issues      []ValidationIssue `json:"issues"`
	Warnings    []ValidationIssue `json:"warnings"`
	Suggestions []string          `json:"suggestions"`
}

ProjectStructureValidationResult represents the result of project structure validation

type ProjectSummary

type ProjectSummary struct {
	TotalDirectories int      `json:"total_directories"`
	TotalFiles       int      `json:"total_files"`
	EstimatedSize    int64    `json:"estimated_size"`
	Technologies     []string `json:"technologies"`
	Categories       []string `json:"categories"`
	Dependencies     []string `json:"dependencies"`
}

ProjectSummary provides overall project statistics

type ScrollableMenu

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

ScrollableMenu provides a scrollable menu interface with proper keyboard navigation

func NewScrollableMenu

func NewScrollableMenu(ui *InteractiveUI) *ScrollableMenu

NewScrollableMenu creates a new scrollable menu instance

func (*ScrollableMenu) ShowScrollableMenu

func (sm *ScrollableMenu) ShowScrollableMenu(ctx context.Context, config interfaces.MenuConfig) (*interfaces.MenuResult, error)

ShowScrollableMenu displays a scrollable menu with proper navigation

func (*ScrollableMenu) ShowScrollableMultiSelect

func (sm *ScrollableMenu) ShowScrollableMultiSelect(ctx context.Context, config interfaces.MultiSelectConfig) (*interfaces.MultiSelectResult, error)

ShowScrollableMultiSelect displays a scrollable multi-selection interface

type StandardDirectoryTree

type StandardDirectoryTree struct {
	Root         *DirectoryNode `json:"root"`
	App          *DirectoryNode `json:"app,omitempty"`
	CommonServer *DirectoryNode `json:"common_server,omitempty"`
	Mobile       *DirectoryNode `json:"mobile,omitempty"`
	Deploy       *DirectoryNode `json:"deploy,omitempty"`
	Docs         *DirectoryNode `json:"docs"`
	Scripts      *DirectoryNode `json:"scripts"`
	GitHub       *DirectoryNode `json:"github"`
}

StandardDirectoryTree represents the standardized project directory structure

type SystemDefaults

type SystemDefaults struct {
	License      string
	Organization string
	OutputPath   string
}

SystemDefaults contains system-level default values

type TemplateCategory

type TemplateCategory struct {
	Name        string
	DisplayName string
	Description string
	Icon        string
	Templates   []interfaces.TemplateInfo
}

TemplateCategory represents a category of templates

type TemplateMetadata

type TemplateMetadata struct {
	// Project information
	ProjectName        string `json:"project_name"`
	ProjectDescription string `json:"project_description"`
	ProjectSlug        string `json:"project_slug"`  // URL-friendly version
	ProjectTitle       string `json:"project_title"` // Display-friendly version

	// Author information
	Author       string `json:"author"`
	Email        string `json:"email"`
	Organization string `json:"organization"`

	// Legal information
	License       string `json:"license"`
	Copyright     string `json:"copyright"`
	CopyrightYear string `json:"copyright_year"`

	// Repository information
	Repository    string `json:"repository"`
	RepositoryURL string `json:"repository_url"`
	ModuleName    string `json:"module_name"`  // For Go modules
	PackageName   string `json:"package_name"` // For npm packages

	// Generation metadata
	GeneratedAt      string `json:"generated_at"`
	GeneratorVersion string `json:"generator_version"`

	// Computed values
	AuthorWithEmail string `json:"author_with_email"`
	LicenseFile     string `json:"license_file"`
	HasRepository   bool   `json:"has_repository"`
	HasOrganization bool   `json:"has_organization"`
}

TemplateMetadata represents metadata available to templates

type TemplatePreviewManager

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

TemplatePreviewManager handles template preview and combination logic

func NewTemplatePreviewManager

func NewTemplatePreviewManager(ui interfaces.InteractiveUIInterface, templateManager interfaces.TemplateManager, logger interfaces.Logger) *TemplatePreviewManager

NewTemplatePreviewManager creates a new template preview manager

func (*TemplatePreviewManager) PreviewCombinedTemplates

func (tpm *TemplatePreviewManager) PreviewCombinedTemplates(ctx context.Context, selections []TemplateSelection, config *models.ProjectConfig) (*CombinedTemplatePreview, error)

PreviewCombinedTemplates shows a preview of multiple templates combined

func (*TemplatePreviewManager) PreviewIndividualTemplate

func (tpm *TemplatePreviewManager) PreviewIndividualTemplate(ctx context.Context, template interfaces.TemplateInfo, config *models.ProjectConfig) error

PreviewIndividualTemplate shows a preview of a single template

type TemplateSelection

type TemplateSelection struct {
	Template interfaces.TemplateInfo
	Selected bool
	Options  map[string]interface{}
}

TemplateSelection represents a selected template with options

type TemplateSelectionResult

type TemplateSelectionResult struct {
	Selections      []TemplateSelection
	PreviewAccepted bool
	UserCancelled   bool
}

TemplateSelectionResult contains the result of interactive template selection

type TemplateSelector

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

TemplateSelector provides interactive template selection functionality

func NewTemplateSelector

func NewTemplateSelector(ui interfaces.InteractiveUIInterface, templateManager interfaces.TemplateManager, logger interfaces.Logger) *TemplateSelector

NewTemplateSelector creates a new template selector instance

func (*TemplateSelector) SelectTemplatesInteractively

func (ts *TemplateSelector) SelectTemplatesInteractively(ctx context.Context) ([]TemplateSelection, error)

SelectTemplatesInteractively provides an interactive template selection interface

func (*TemplateSelector) ShowTemplateInfo

func (ts *TemplateSelector) ShowTemplateInfo(ctx context.Context, template interfaces.TemplateInfo) error

ShowTemplateInfo displays detailed information about a template

func (*TemplateSelector) ValidateTemplateSelections

func (ts *TemplateSelector) ValidateTemplateSelections(selections []TemplateSelection) error

ValidateTemplateSelections validates that selected templates are compatible

type TroubleshootingItem

type TroubleshootingItem struct {
	Problem    string   `json:"problem"`
	Cause      string   `json:"cause"`
	Solutions  []string `json:"solutions"`
	Prevention string   `json:"prevention,omitempty"`
}

TroubleshootingItem represents a troubleshooting entry

type UIConfig

type UIConfig struct {
	EnableColors    bool          `json:"enable_colors"`
	EnableUnicode   bool          `json:"enable_unicode"`
	PageSize        int           `json:"page_size"`
	Timeout         time.Duration `json:"timeout"`
	AutoSave        bool          `json:"auto_save"`
	ShowBreadcrumbs bool          `json:"show_breadcrumbs"`
	ShowShortcuts   bool          `json:"show_shortcuts"`
	ConfirmOnQuit   bool          `json:"confirm_on_quit"`
}

UIConfig defines configuration for the interactive UI

type UserDefaults

type UserDefaults struct {
	Author       string
	Email        string
	Organization string
	License      string
	Repository   string
}

UserDefaults contains user-specific default values

type ValidationChain

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

ValidationChain allows chaining multiple validation rules

func EmailConfigValidation

func EmailConfigValidation(required bool) *ValidationChain

EmailConfigValidation creates a validation chain for email input

func NewValidationChain

func NewValidationChain() *ValidationChain

NewValidationChain creates a new validation chain

func ProjectConfigValidation

func ProjectConfigValidation() *ValidationChain

ProjectConfigValidation creates a validation chain for project configuration

func URLConfigValidation

func URLConfigValidation(required bool) *ValidationChain

URLConfigValidation creates a validation chain for URL input

func VersionConfigValidation

func VersionConfigValidation(required bool) *ValidationChain

VersionConfigValidation creates a validation chain for version input

func (*ValidationChain) Add

Add adds a validation rule to the chain

func (*ValidationChain) Validate

func (vc *ValidationChain) Validate(input string) error

Validate runs all validation rules in the chain

type ValidationIssue

type ValidationIssue struct {
	Type       string `json:"type"`     // "conflict", "warning", "error"
	Severity   string `json:"severity"` // "error", "warning", "info"
	Message    string `json:"message"`
	Path       string `json:"path,omitempty"`
	Resolvable bool   `json:"resolvable"`
}

ValidationIssue represents a validation issue

type ValidationRule

type ValidationRule struct {
	Name        string
	Validator   ValidatorFunc
	Message     string
	Suggestions []string
	Recovery    []interfaces.RecoveryOption
}

ValidationRule defines a validation rule with error messages and recovery options

func AlphanumericValidator

func AlphanumericValidator(fieldName string, allowSpaces bool) ValidationRule

AlphanumericValidator validates alphanumeric input

func CustomValidator

func CustomValidator(name, message string, validator ValidatorFunc, suggestions []string, recovery []interfaces.RecoveryOption) ValidationRule

CustomValidator creates a custom validation rule

func EmailValidator

func EmailValidator() ValidationRule

EmailValidator validates email addresses

func GitHubRepoValidator

func GitHubRepoValidator() ValidationRule

GitHubRepoValidator validates GitHub repository names

func IntegerValidator

func IntegerValidator(fieldName string, min, max int) ValidationRule

IntegerValidator validates integer input

func LengthValidator

func LengthValidator(fieldName string, min, max int) ValidationRule

LengthValidator validates input length

func NumericValidator

func NumericValidator(fieldName string, min, max float64) ValidationRule

NumericValidator validates numeric input

func PatternValidator

func PatternValidator(fieldName string, pattern *regexp.Regexp, message string) ValidationRule

PatternValidator validates input against a regular expression

func ProjectNameValidator

func ProjectNameValidator() ValidationRule

ProjectNameValidator validates project names

func RequiredValidator

func RequiredValidator(fieldName string) ValidationRule

RequiredValidator validates that input is not empty

func URLValidator

func URLValidator() ValidationRule

URLValidator validates HTTP/HTTPS URLs

func VersionValidator

func VersionValidator() ValidationRule

VersionValidator validates semantic version numbers

type ValidatorFunc

type ValidatorFunc func(input string) error

ValidatorFunc defines a function type for input validation

type ViewportManager

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

ViewportManager manages the visible portion of a long list

Jump to

Keyboard shortcuts

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