Documentation
¶
Overview ¶
Package mesnadaconfig handles Mesnada application configuration.
Index ¶
- func InitConfig(path string) error
- type ACPAgentConfig
- type ACPCapabilities
- type ACPConfig
- type ACPServerConfig
- type Config
- func (c *Config) Address() string
- func (c *Config) GetDefaultModelForEngine(engine string) string
- func (c *Config) GetModelByID(id string) *ModelConfig
- func (c *Config) GetModelForEngine(engine, modelID string) *ModelConfig
- func (c *Config) GetModelIDsForEngine(engine string) []string
- func (c *Config) GetModelsForEngine(engine string) []ModelConfig
- func (c *Config) Save(path string) error
- func (c *Config) Validate() error
- func (c *Config) ValidateModel(id string) bool
- func (c *Config) ValidateModelForEngine(engine, modelID string) bool
- type EngineConfig
- type MCPServerRef
- type ModelConfig
- type OrchestratorConfig
- type ServerConfig
- type TUIConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
InitConfig creates a new configuration file using the embedded template. If path is empty, it uses the default path (~/.mesnada/config.yaml).
Types ¶
type ACPAgentConfig ¶
type ACPAgentConfig struct {
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
Command string `json:"command" yaml:"command"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
MCPServers []MCPServerRef `json:"mcp_servers,omitempty" yaml:"mcp_servers,omitempty"`
Capabilities ACPCapabilities `json:"capabilities" yaml:"capabilities"`
}
ACPAgentConfig configuration for a specific ACP agent.
type ACPCapabilities ¶
type ACPCapabilities struct {
Terminals bool `json:"terminals" yaml:"terminals"`
FileAccess bool `json:"file_access" yaml:"file_access"`
Permissions bool `json:"permissions" yaml:"permissions"`
}
ACPCapabilities defines what an ACP agent can do.
type ACPConfig ¶
type ACPConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
DefaultAgent string `json:"default_agent,omitempty" yaml:"default_agent,omitempty"`
DefaultMode string `json:"default_mode,omitempty" yaml:"default_mode,omitempty"`
Agents map[string]ACPAgentConfig `json:"agents,omitempty" yaml:"agents,omitempty"`
AutoPermission bool `json:"auto_permission" yaml:"auto_permission"`
Server ACPServerConfig `json:"server,omitempty" yaml:"server,omitempty"`
}
ACPConfig global ACP configuration.
type ACPServerConfig ¶ added in v0.7.0
type ACPServerConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Transports []string `json:"transports" yaml:"transports"` // ["stdio", "http"]
Host string `json:"host" yaml:"host"`
Port int `json:"port" yaml:"port"`
MaxSessions int `json:"max_sessions" yaml:"max_sessions"`
SessionTimeout string `json:"session_timeout" yaml:"session_timeout"`
RequireAuth bool `json:"require_auth" yaml:"require_auth"`
}
ACPServerConfig holds configuration for the ACP server.
type Config ¶
type Config struct {
DefaultModel string `json:"default_model" yaml:"default_model"`
Models []ModelConfig `json:"models" yaml:"models"`
Engines map[string]EngineConfig `json:"engines,omitempty" yaml:"engines,omitempty"`
ACP ACPConfig `json:"acp,omitempty" yaml:"acp,omitempty"`
TUI TUIConfig `json:"tui,omitempty" yaml:"tui,omitempty"`
Server ServerConfig `json:"server" yaml:"server"`
Orchestrator OrchestratorConfig `json:"orchestrator" yaml:"orchestrator"`
}
Config holds the application configuration.
func (*Config) GetDefaultModelForEngine ¶
GetDefaultModelForEngine returns the default model for an engine.
func (*Config) GetModelByID ¶
func (c *Config) GetModelByID(id string) *ModelConfig
GetModelByID returns a model configuration by ID.
func (*Config) GetModelForEngine ¶
func (c *Config) GetModelForEngine(engine, modelID string) *ModelConfig
GetModelForEngine returns a specific model config for an engine.
func (*Config) GetModelIDsForEngine ¶
GetModelIDsForEngine returns a list of model IDs for an engine.
func (*Config) GetModelsForEngine ¶
func (c *Config) GetModelsForEngine(engine string) []ModelConfig
GetModelsForEngine returns the list of available models for a specific engine. If engine-specific models are configured, returns those; otherwise returns the global models list.
func (*Config) ValidateModel ¶
ValidateModel checks if a model ID is valid.
func (*Config) ValidateModelForEngine ¶
ValidateModelForEngine checks if a model ID is valid for a specific engine.
type EngineConfig ¶
type EngineConfig struct {
DefaultModel string `json:"default_model" yaml:"default_model"`
Models []ModelConfig `json:"models" yaml:"models"`
}
EngineConfig holds engine-specific configuration.
type MCPServerRef ¶
type MCPServerRef struct {
Name string `json:"name" yaml:"name"`
Command string `json:"command" yaml:"command"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
}
MCPServerRef references an MCP server for ACP agents.
type ModelConfig ¶
type ModelConfig struct {
ID string `json:"id" yaml:"id"`
Description string `json:"description" yaml:"description"`
}
ModelConfig defines a model with its description.
type OrchestratorConfig ¶
type OrchestratorConfig struct {
StorePath string `json:"store_path" yaml:"store_path"`
LogDir string `json:"log_dir" yaml:"log_dir"`
MaxParallel int `json:"max_parallel" yaml:"max_parallel"`
DefaultMCPConfig string `json:"default_mcp_config" yaml:"default_mcp_config"`
DefaultEngine string `json:"default_engine" yaml:"default_engine"`
PersonaPath string `json:"persona_path,omitempty" yaml:"persona_path,omitempty"`
}
OrchestratorConfig holds orchestrator configuration.
type ServerConfig ¶
type ServerConfig struct {
Host string `json:"host" yaml:"host"`
Port int `json:"port" yaml:"port"`
}
ServerConfig holds HTTP server configuration.
type TUIConfig ¶
type TUIConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
WebUI bool `json:"webui" yaml:"webui"`
AutoDetectTerminal bool `json:"auto_detect_terminal" yaml:"auto_detect_terminal"`
ConfirmQuitWithRunningTasks bool `json:"confirm_quit_with_running_tasks" yaml:"confirm_quit_with_running_tasks"`
}
TUIConfig holds TUI/WebUI integration settings.