Documentation
¶
Index ¶
- func GetLoomDataDir() string
- func GetLoomSubDir(subdir string) string
- func LoadProject(path string) (*loomv1.Project, error)
- func ValidateProject(project *loomv1.Project) error
- type AgentReferenceYAML
- type BackendReferenceYAML
- type EvalReferenceYAML
- type GlobalSettingsYAML
- type MCPConfigYAML
- type MCPServerConfigYAML
- type MCPServersConfigYAML
- type MCPToolSelectionYAML
- type ObservabilityConfigYAML
- type PatternReferenceYAML
- type ProjectMetadataYAML
- type ProjectSpecYAML
- type ProjectYAML
- type PromptsConfigYAML
- type WorkflowReferenceYAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoomDataDir ¶
func GetLoomDataDir() string
GetLoomDataDir returns the Loom data directory.
Priority: 1. LOOM_DATA_DIR environment variable (if set and non-empty) 2. ~/.loom (default)
The returned path is always absolute. Tilde (~) in LOOM_DATA_DIR is expanded to the user's home directory. Relative paths in LOOM_DATA_DIR are converted to absolute paths.
This function is called during bootstrap (before config file is loaded) to locate the config file itself. After config is loaded, use config.DataDir for consistency.
Examples:
LOOM_DATA_DIR=/custom/loom -> /custom/loom LOOM_DATA_DIR=~/my-loom -> /home/user/my-loom LOOM_DATA_DIR=relative/path -> /current/dir/relative/path LOOM_DATA_DIR not set -> /home/user/.loom
Note: This function reads directly from os.Getenv(), not from viper, to avoid circular dependency during config initialization.
func GetLoomSubDir ¶
GetLoomSubDir returns a subdirectory within the Loom data directory. Example: GetLoomSubDir("agents") returns ~/.loom/agents
func LoadProject ¶
LoadProject loads a project configuration from a YAML file
func ValidateProject ¶
ValidateProject validates a project configuration
Types ¶
type AgentReferenceYAML ¶
type AgentReferenceYAML struct {
ConfigFile string `yaml:"config_file"`
}
type BackendReferenceYAML ¶
type BackendReferenceYAML struct {
ConfigFile string `yaml:"config_file"`
}
type EvalReferenceYAML ¶
type EvalReferenceYAML struct {
ConfigFile string `yaml:"config_file"`
}
type GlobalSettingsYAML ¶
type MCPConfigYAML ¶
type MCPConfigYAML struct {
ConfigFile string `yaml:"config_file"`
Inline *MCPServersConfigYAML `yaml:"inline"`
}
type MCPServerConfigYAML ¶
type MCPServersConfigYAML ¶
type MCPServersConfigYAML struct {
Servers map[string]MCPServerConfigYAML `yaml:"servers"`
}
type MCPToolSelectionYAML ¶
type ObservabilityConfigYAML ¶
type PatternReferenceYAML ¶
type PatternReferenceYAML struct {
ConfigFile string `yaml:"config_file"`
}
type ProjectMetadataYAML ¶
type ProjectSpecYAML ¶
type ProjectSpecYAML struct {
Observability ObservabilityConfigYAML `yaml:"observability"`
Prompts PromptsConfigYAML `yaml:"prompts"`
MCP MCPConfigYAML `yaml:"mcp"`
Backends []BackendReferenceYAML `yaml:"backends"`
Agents []AgentReferenceYAML `yaml:"agents"`
Workflows []WorkflowReferenceYAML `yaml:"workflows"`
Evals []EvalReferenceYAML `yaml:"evals"`
Patterns []PatternReferenceYAML `yaml:"patterns"`
Settings GlobalSettingsYAML `yaml:"settings"`
}
type ProjectYAML ¶
type ProjectYAML struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata ProjectMetadataYAML `yaml:"metadata"`
Spec ProjectSpecYAML `yaml:"spec"`
}
ProjectYAML represents the YAML structure for project configuration
type PromptsConfigYAML ¶
type WorkflowReferenceYAML ¶
type WorkflowReferenceYAML struct {
ConfigFile string `yaml:"config_file"`
}