Documentation
¶
Overview ¶
Package config manages MAXAM configuration in ~/.maxam/
Index ¶
- Constants
- Variables
- func AgentsDir() (string, error)
- func ConfigDir() (string, error)
- func EnsureInitialized(embeddedAgents map[string]string) error
- func EnsureProjectInitialized(projectDir string) error
- func GetAgentClaudeMD(name string) (string, error)
- func GetAgentClaudeMDWithProject(projectDir, name string) (string, error)
- func GetAgentDir(name string) (string, error)
- func GetAgentDirWithProject(projectDir, name string) (string, error)
- func GetEmbeddedAgents() (map[string]string, error)
- func IsProjectInitialized(projectDir string) bool
- func ListAgents() ([]string, error)
- func ListAgentsWithProject(projectDir string) ([]string, error)
- func ProjectAgentsDir(projectDir string) string
- func ProjectClaudeMD(projectDir string) string
- func ProjectConfigDir(projectDir string) string
- func Save(cfg *Config) error
- func SaveToProject(projectDir string, cfg *Config) error
- type AgentConfig
- type Config
- func (c *Config) GetAgentByInstanceKey(key string) *AgentConfig
- func (c *Config) GetAgentByRole(role string) *AgentConfig
- func (c *Config) GetAgentColor(name string) string
- func (c *Config) GetAgentInstances(name string) []AgentConfig
- func (c *Config) GetAgentsByRole(role string) []AgentConfig
- func (c *Config) GetAllInstanceKeys() []string
- func (c *Config) GetAnalysisMinMessages() int
- func (c *Config) GetContextMode() ContextMode
- func (c *Config) GetTeamName() string
- func (c *Config) GetUniqueAgentNames() []string
- func (c *Config) GetWorkersPerAgent() int
- func (c *Config) HasAgents() bool
- func (c *Config) IsMentionCheckerEnabled() bool
- func (c *Config) IsSummaryMode() bool
- func (c *Config) SetMentionCheckerEnabled(enabled bool)
- type ContextMode
Constants ¶
const DefaultAnalysisMinMessages = 10
DefaultAnalysisMinMessages is the default minimum message count for analysis
const DefaultMaxInstances = 3
TODO: Move to config.yaml when multi-instance feature is stabilized DefaultMaxInstances is the default maximum number of instances per agent
const DefaultProjectClaudeMDTemplate = `` /* 303-byte string literal not displayed */
DefaultProjectClaudeMDTemplate is the default CLAUDE.md template for projects
const DefaultProjectConfigTemplate = `` /* 214-byte string literal not displayed */
DefaultProjectConfigTemplate is the default config.yaml template for projects
const DefaultWorkersPerAgent = 1
DefaultWorkersPerAgent is the default number of workers per agent
Variables ¶
var DefaultAgents = []string{"mei", "yuki", "rin", "shiori", "priya", "amara"}
DefaultAgents is the list of default agents to install
var ErrNoAgentsConfigured = fmt.Errorf("no agents configured. Please run 'maxam team init' first")
ErrNoAgentsConfigured is returned when no agents are configured
Functions ¶
func EnsureInitialized ¶
EnsureInitialized sets up ~/.maxam/ if not present and copies default agents from the embedded data
func EnsureProjectInitialized ¶ added in v0.7.0
EnsureProjectInitialized sets up project/.maxam/ if not present Creates default config.yaml and CLAUDE.md templates Does not overwrite existing files
func GetAgentClaudeMD ¶
GetAgentClaudeMD returns the path to an agent's CLAUDE.md
func GetAgentClaudeMDWithProject ¶ added in v0.5.4
GetAgentClaudeMDWithProject returns agent's CLAUDE.md path with project priority Priority: project/.maxam/agents/{name}/ > ~/.maxam/agents/{name}/
func GetAgentDir ¶
GetAgentDir returns the directory for an agent
func GetAgentDirWithProject ¶ added in v0.5.4
GetAgentDirWithProject returns agent directory with project priority Priority: project/.maxam/agents/{name}/ > ~/.maxam/agents/{name}/
func GetEmbeddedAgents ¶
GetEmbeddedAgents returns a map of agent name to CLAUDE.md content
func IsProjectInitialized ¶ added in v0.7.0
IsProjectInitialized returns true if project/.maxam/ exists with config files
func ListAgents ¶
ListAgents returns agent names from ~/.maxam/agents/
func ListAgentsWithProject ¶ added in v0.5.4
ListAgentsWithProject returns agent names with project-local priority Priority: project/.maxam/agents/ > ~/.maxam/agents/
func ProjectAgentsDir ¶ added in v0.5.4
ProjectAgentsDir returns the path to project/.maxam/agents/
func ProjectClaudeMD ¶ added in v0.5.4
ProjectClaudeMD returns the path to project/.maxam/CLAUDE.md
func ProjectConfigDir ¶ added in v0.5.4
ProjectConfigDir returns the path to project/.maxam/
func SaveToProject ¶ added in v0.6.0
SaveToProject writes configuration to project/.maxam/config.yaml
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Name string `yaml:"name"`
FullName string `yaml:"full_name"`
Role string `yaml:"role"`
Model string `yaml:"model,omitempty"` // opus, sonnet, haiku
Color string `yaml:"color,omitempty"` // hex color code (e.g., "#FF9933")
InstanceID string `yaml:"instance_id,omitempty"` // for multi-instance support (e.g., "1", "2")
}
AgentConfig represents an agent configuration
func (*AgentConfig) GetInstanceKey ¶ added in v0.7.0
func (a *AgentConfig) GetInstanceKey() string
GetInstanceKey returns the unique key for this agent instance Format: "name" (no instance) or "name-instanceID" (with instance)
type Config ¶
type Config struct {
Version string `yaml:"version"`
TeamName string `yaml:"team_name,omitempty"`
DefaultAgent string `yaml:"default_agent,omitempty"`
Agents []AgentConfig `yaml:"agents"`
AnalysisMinMessages int `yaml:"analysis_min_messages,omitempty"`
ContextMode ContextMode `yaml:"context_mode,omitempty"`
YOLOMode bool `yaml:"yolo_mode,omitempty"`
WorkersPerAgent int `yaml:"workers_per_agent,omitempty"`
MentionCheckerEnabled *bool `yaml:"mention_checker_enabled,omitempty"`
}
Config represents the MAXAM configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration with no agents Use "maxam team init" to set up team members
func LoadProjectConfig ¶ added in v0.6.0
LoadProjectConfig loads only the project-local config (not merged)
func LoadWithProject ¶ added in v0.5.4
LoadWithProject loads configuration with project-local overrides Priority: project/.maxam/config.yaml > ~/.maxam/config.yaml > default
func (*Config) GetAgentByInstanceKey ¶ added in v0.7.0
func (c *Config) GetAgentByInstanceKey(key string) *AgentConfig
GetAgentByInstanceKey returns the agent with the specified instance key Supports both "name" and "name-instanceID" formats
func (*Config) GetAgentByRole ¶ added in v0.7.0
func (c *Config) GetAgentByRole(role string) *AgentConfig
GetAgentByRole returns the first agent with the specified role Returns nil if no agent with the role is found
func (*Config) GetAgentColor ¶ added in v0.6.0
GetAgentColor returns the color for the specified agent Returns empty string if not found or not set
func (*Config) GetAgentInstances ¶ added in v0.7.0
func (c *Config) GetAgentInstances(name string) []AgentConfig
GetAgentInstances returns all instances of the specified agent name
func (*Config) GetAgentsByRole ¶ added in v0.7.0
func (c *Config) GetAgentsByRole(role string) []AgentConfig
GetAgentsByRole returns all agents with the specified role
func (*Config) GetAllInstanceKeys ¶ added in v0.7.0
GetAllInstanceKeys returns all unique instance keys for agents
func (*Config) GetAnalysisMinMessages ¶ added in v0.3.0
GetAnalysisMinMessages returns the analysis minimum messages with default fallback
func (*Config) GetContextMode ¶ added in v0.3.0
func (c *Config) GetContextMode() ContextMode
GetContextMode returns the context mode with default fallback
func (*Config) GetTeamName ¶ added in v0.7.0
GetTeamName returns the team name with default fallback
func (*Config) GetUniqueAgentNames ¶ added in v0.7.0
GetUniqueAgentNames returns unique agent names (without instance IDs)
func (*Config) GetWorkersPerAgent ¶ added in v0.5.3
GetWorkersPerAgent returns workers per agent with default fallback
func (*Config) HasAgents ¶ added in v0.6.0
HasAgents returns true if at least one agent is configured
func (*Config) IsMentionCheckerEnabled ¶ added in v0.7.0
IsMentionCheckerEnabled returns whether mention checker is enabled (default: true)
func (*Config) IsSummaryMode ¶ added in v0.3.0
IsSummaryMode returns true if context mode is summary
func (*Config) SetMentionCheckerEnabled ¶ added in v0.7.0
SetMentionCheckerEnabled sets the mention checker enabled state
type ContextMode ¶ added in v0.3.0
type ContextMode string
ContextMode represents the context mode for system prompts
const ( ContextModeFull ContextMode = "full" ContextModeSummary ContextMode = "summary" )