Documentation
¶
Overview ¶
Package projects handles multi-project discovery, resolution, and budget allocation. Supports explicit project paths, glob patterns, and priority-based budget splitting.
Index ¶
- func DiscoverProjectsInDir(dir string) ([]string, error)
- func ExpandGlobPatterns(patterns, excludes []string) ([]string, error)
- func IsProjectPath(path string) bool
- func MergeProjectConfig(globalCfg *config.Config, projectPath string) (*config.Config, error)
- type BudgetAllocation
- type Project
- type ProjectSummary
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverProjectsInDir ¶
DiscoverProjectsInDir finds projects in a directory (non-recursive).
func ExpandGlobPatterns ¶
ExpandGlobPatterns expands glob patterns and filters out excluded paths.
func IsProjectPath ¶
IsProjectPath checks if a path looks like a valid project directory. Checks for common project indicators like .git, go.mod, package.json, etc.
Types ¶
type BudgetAllocation ¶
type BudgetAllocation struct {
Project Project
Tokens int64 // Allocated token budget
Percentage float64 // Percentage of total budget
}
BudgetAllocation contains budget info for a project.
func AllocateBudget ¶
func AllocateBudget(projects []Project, totalBudget int64) []BudgetAllocation
AllocateBudget distributes the total budget across projects by priority weight. Projects with higher priority get proportionally more budget.
type Project ¶
type Project struct {
Path string // Absolute path to project
Priority int // Priority for ordering (higher = more important)
Config *config.Config // Merged configuration for this project
Weight float64 // Normalized weight for budget allocation
}
Project represents a resolved project with merged configuration.
func FilterNotProcessedSince ¶
FilterNotProcessedSince returns projects not processed within the given duration.
func FilterProcessedToday ¶
FilterProcessedToday removes projects that were already processed today.
func SelectNext ¶
SelectNext picks the next project to process based on priority and staleness. Returns nil if no projects are available.
func SortByPriority ¶
SortByPriority orders projects by priority (highest first).
type ProjectSummary ¶
type ProjectSummary struct {
Path string
Priority int
LastRun time.Time
RunCount int
ProcessedToday bool
}
ProjectSummary provides summary info for a project.
func GetProjectSummaries ¶
func GetProjectSummaries(projects []Project, s *state.State) []ProjectSummary
GetProjectSummaries returns summary info for all projects.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver handles project discovery and configuration merging.
func NewResolver ¶
NewResolver creates a resolver with the given global configuration.
func (*Resolver) DiscoverProjects ¶
DiscoverProjects resolves all projects from configuration. Expands glob patterns, excludes specified paths, and merges per-project configs.