config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupNamesForTask

func GroupNamesForTask(groups map[string]Group, taskName string) []string

func RunExprRefs

func RunExprRefs(expr RunExpr) []string

func RunExprString added in v0.5.2

func RunExprString(expr RunExpr) string

RunExprString serializes a run expression back to its string form.

func Suggest added in v0.5.0

func Suggest(cfg *Config) []string

Types

type AgentConfig

type AgentConfig struct {
	AccrueKnowledge bool `yaml:"accrue_knowledge"`
}

type ArchitectureConfig

type ArchitectureConfig struct {
	Layers  []string                      `yaml:"layers"`
	Domains map[string]ArchitectureDomain `yaml:"domains"`
	Rules   []ArchitectureRule            `yaml:"rules"`
}

type ArchitectureDomain

type ArchitectureDomain struct {
	Root   string   `yaml:"root"`
	Layers []string `yaml:"layers"`
}

type ArchitectureRule

type ArchitectureRule struct {
	Direction    string `yaml:"direction"`
	CrossDomain  string `yaml:"cross_domain"`
	CrossCutting string `yaml:"cross_cutting"`
}

type CodemapConfig

type CodemapConfig struct {
	Packages    map[string]CodemapPackage `yaml:"packages"`
	Conventions []string                  `yaml:"conventions"`
	Glossary    map[string]string         `yaml:"glossary"`
}

type CodemapPackage

type CodemapPackage struct {
	Desc        string   `yaml:"desc"`
	KeyTypes    []string `yaml:"key_types"`
	EntryPoints []string `yaml:"entry_points"`
	Conventions []string `yaml:"conventions"`
	DependsOn   []string `yaml:"depends_on"`
}

type Config

type Config struct {
	Project      string                `yaml:"project"`
	Description  string                `yaml:"description"`
	Default      string                `yaml:"default"`
	Includes     IncludeList           `yaml:"includes"`
	Vars         Vars                  `yaml:"vars"`
	Secrets      map[string]SecretSpec `yaml:"secrets"`
	Templates    Templates             `yaml:"templates"`
	Profiles     Profiles              `yaml:"profiles"`
	Defaults     DefaultsConfig        `yaml:"defaults"`
	EnvFile      string                `yaml:"env_file"`
	Tasks        map[string]Task       `yaml:"tasks"`
	Aliases      map[string]string     `yaml:"aliases"`
	Groups       map[string]Group      `yaml:"groups"`
	Guards       map[string]Guard      `yaml:"guards"`
	Scopes       map[string]Scope      `yaml:"scopes"`
	Prompts      map[string]Prompt     `yaml:"prompts"`
	Agent        AgentConfig           `yaml:"agent"`
	Context      ContextConfig         `yaml:"context"`
	Codemap      CodemapConfig         `yaml:"codemap"`
	Serve        ServeConfig           `yaml:"serve"`
	Watch        WatchConfig           `yaml:"watch"`
	Architecture ArchitectureConfig    `yaml:"architecture"`
	// contains filtered or unexported fields
}

func Load

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

func LoadWithProfile

func LoadWithProfile(path, profile string) (*Config, error)

func LoadWithProfiles added in v0.5.0

func LoadWithProfiles(path string, profiles []string) (*Config, error)

func (*Config) ActiveProfile added in v0.5.0

func (c *Config) ActiveProfile() string

func (*Config) ActiveProfiles added in v0.5.0

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

func (*Config) ApplyProfiles added in v0.5.0

func (c *Config) ApplyProfiles(profiles []string) error

func (*Config) ResolveTaskName

func (c *Config) ResolveTaskName(name string) (string, bool)

func (*Config) SecretValues added in v0.5.0

func (c *Config) SecretValues() map[string]string

func (*Config) Validate

func (c *Config) Validate(repoRoot string) error

type ContextCaps

type ContextCaps struct {
	FileTreeEntries int `yaml:"file_tree_entries"`
	FilesMax        int `yaml:"files_max"`
	FileLines       int `yaml:"file_lines"`
	GitLogLines     int `yaml:"git_log_lines"`
	GitDiffLines    int `yaml:"git_diff_lines"`
	TodosMax        int `yaml:"todos_max"`
	AgentFileLines  int `yaml:"agent_file_lines"`
	DependencyLines int `yaml:"dependency_lines"`
}

type ContextConfig

type ContextConfig struct {
	FileTree     *bool       `yaml:"file_tree"`
	GitLogLines  int         `yaml:"git_log_lines"`
	GitDiff      bool        `yaml:"git_diff"`
	Todos        bool        `yaml:"todos"`
	Dependencies *bool       `yaml:"dependencies"`
	AgentFiles   []string    `yaml:"agent_files"`
	Files        []string    `yaml:"files"`
	Include      []string    `yaml:"include"`
	Exclude      []string    `yaml:"exclude"`
	Caps         ContextCaps `yaml:"caps"`
}

type DefaultsConfig

type DefaultsConfig struct {
	Dir string `yaml:"dir"`
}

type Group

type Group struct {
	Desc  string   `yaml:"desc,omitempty"`
	Tasks []string `yaml:"tasks"`
}

type Guard

type Guard struct {
	Steps []string `yaml:"steps"`
}

type IncludeEntry added in v0.5.2

type IncludeEntry struct {
	Path      string // file path, glob pattern, or directory
	Namespace string // non-empty for namespaced includes (e.g. "ml")
}

IncludeEntry represents a single include directive — either a plain file/glob path or a namespaced directory.

type IncludeList added in v0.5.2

type IncludeList []IncludeEntry

IncludeList is a custom YAML type that accepts both list and map forms:

# list form (plain paths and globs)
includes:
  - tasks/backend.yaml
  - tasks/**/*.yaml

# map form (namespaced directories)
includes:
  ml: tasks/ml/
  data: tasks/data/

func (*IncludeList) UnmarshalYAML added in v0.5.2

func (il *IncludeList) UnmarshalYAML(value *yaml.Node) error

type Param

type Param struct {
	Desc     string `yaml:"desc"`
	Env      string `yaml:"env"`
	Required bool   `yaml:"required"`
	Default  string `yaml:"default"`
	Position int    `yaml:"position,omitempty"`
	Variadic bool   `yaml:"variadic,omitempty"`
}

type Profile

type Profile struct {
	Vars  map[string]string      `yaml:"vars"`
	Tasks map[string]ProfileTask `yaml:"tasks"`
}

type ProfileTask

type ProfileTask struct {
	When    string            `yaml:"when"`
	Timeout string            `yaml:"timeout"`
	Env     map[string]string `yaml:"env"`
}

type Profiles added in v0.5.0

type Profiles struct {
	Default string
	Entries map[string]Profile
}

func (*Profiles) UnmarshalYAML added in v0.5.0

func (p *Profiles) UnmarshalYAML(value *yaml.Node) error

type Prompt

type Prompt struct {
	Desc     string `yaml:"desc"`
	Template string `yaml:"template"`
}

type RunExpr

type RunExpr interface {
	// contains filtered or unexported methods
}

func ParseRunExpr

func ParseRunExpr(input string) (RunExpr, error)

func RunExprRenameRefs added in v0.5.2

func RunExprRenameRefs(expr RunExpr, rename map[string]string) RunExpr

RunExprRenameRefs returns a copy of expr with task references renamed according to the rename map. References not in the map are left unchanged.

type RunPar

type RunPar struct {
	Nodes []RunExpr
}

type RunRef

type RunRef struct {
	Name string
}

type RunSeq

type RunSeq struct {
	Nodes []RunExpr
}

type RunSwitch added in v0.5.0

type RunSwitch struct {
	Expr  string
	Cases []RunSwitchCase
}

type RunSwitchCase added in v0.5.0

type RunSwitchCase struct {
	Value string
	Expr  RunExpr
}

type RunWhen

type RunWhen struct {
	Expr  string
	True  RunExpr
	False RunExpr
}

type Scope

type Scope struct {
	Desc  string   `yaml:"desc,omitempty"`
	Paths []string `yaml:"paths,omitempty"`
}

func (*Scope) UnmarshalYAML

func (s *Scope) UnmarshalYAML(value *yaml.Node) error

type SecretSpec added in v0.5.0

type SecretSpec struct {
	From string `yaml:"from"`
	Env  string `yaml:"env"`
	Path string `yaml:"path"`
	Key  string `yaml:"key"`
}

type ServeConfig

type ServeConfig struct {
	Transport string `yaml:"transport"`
	Port      int    `yaml:"port"`
	TokenEnv  string `yaml:"token_env"`
}

type Task

type Task struct {
	NodeType        string            `yaml:"type"`
	Desc            string            `yaml:"desc"`
	Cmd             string            `yaml:"cmd"`
	Steps           []string          `yaml:"steps"`
	Run             string            `yaml:"run"`
	When            string            `yaml:"when"`
	Cache           *TaskCache        `yaml:"cache"`
	Silent          bool              `yaml:"silent"`
	Defer           string            `yaml:"defer"`
	Needs           []string          `yaml:"needs"`
	Parallel        bool              `yaml:"parallel"`
	Params          map[string]Param  `yaml:"params"`
	Env             map[string]string `yaml:"env"`
	Dir             string            `yaml:"dir"`
	Shell           string            `yaml:"shell"`
	ShellArgs       []string          `yaml:"shell_args"`
	Safety          string            `yaml:"safety"`
	ErrorFormat     string            `yaml:"error_format"`
	Retry           int               `yaml:"retry"`
	RetryDelay      string            `yaml:"retry_delay"`
	RetryBackoff    string            `yaml:"retry_backoff"`
	RetryOn         []string          `yaml:"retry_on"`
	Timeout         string            `yaml:"timeout"`
	ContinueOnError bool              `yaml:"continue_on_error"`
	Agent           *bool             `yaml:"agent"`
	Scope           string            `yaml:"scope"`
	Use             string            `yaml:"use"`
	TemplateArgs    map[string]any    `yaml:"-"`
	Override        TaskUseOverride   `yaml:"override"`
}

func (Task) AgentEnabled

func (t Task) AgentEnabled() bool

func (Task) CacheEnabled

func (t Task) CacheEnabled() bool

func (Task) CachePaths added in v0.5.0

func (t Task) CachePaths() []string

func (Task) SafetyLevel

func (t Task) SafetyLevel() string

func (Task) Type

func (t Task) Type() string

func (*Task) UnmarshalYAML added in v0.5.0

func (t *Task) UnmarshalYAML(value *yaml.Node) error

type TaskCache added in v0.5.0

type TaskCache struct {
	Enabled bool     `yaml:"enabled"`
	Paths   []string `yaml:"paths"`
}

func (*TaskCache) UnmarshalYAML added in v0.5.0

func (c *TaskCache) UnmarshalYAML(value *yaml.Node) error

type TaskTemplate added in v0.5.0

type TaskTemplate struct {
	Params map[string]TemplateParam `yaml:"params"`
	Tasks  map[string]Task          `yaml:"tasks"`
}

type TaskUseOverride added in v0.5.0

type TaskUseOverride struct {
	Tasks map[string]ProfileTask `yaml:"tasks"`
}

type TemplateParam added in v0.5.0

type TemplateParam struct {
	Type     string `yaml:"type"`
	Required bool   `yaml:"required"`
	Default  any    `yaml:"default"`
}

type Templates added in v0.5.0

type Templates struct {
	Snippets map[string]string
	Tasks    map[string]TaskTemplate
}

func (*Templates) UnmarshalYAML added in v0.5.0

func (t *Templates) UnmarshalYAML(value *yaml.Node) error

type VarSpec added in v0.5.0

type VarSpec struct {
	Value string
	Sh    string
}

func (*VarSpec) UnmarshalYAML added in v0.5.0

func (v *VarSpec) UnmarshalYAML(value *yaml.Node) error

type Vars added in v0.5.0

type Vars map[string]string

func (*Vars) UnmarshalYAML added in v0.5.0

func (v *Vars) UnmarshalYAML(value *yaml.Node) error

type WatchConfig

type WatchConfig struct {
	DebounceMS int      `yaml:"debounce_ms"`
	Paths      []string `yaml:"paths"`
}

Jump to

Keyboard shortcuts

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