Documentation
¶
Overview ¶
Package config manages application configuration from various sources.
Index ¶
- Constants
- func DeleteLSP(language string) error
- func DeleteMCPServer(name string) error
- func LoadGitHubToken() (string, error)
- func MarkProjectInitialized() error
- func ShouldShowInitDialog() (bool, error)
- func UpdateAgentModel(agentName AgentName, modelID models.ModelID) error
- func UpdateAutoCompact(enabled bool) error
- func UpdateDebug(enabled bool) error
- func UpdateLSP(language string, lsp LSPConfig) error
- func UpdateMCPServer(name string, server MCPServer) error
- func UpdateMesnada(mesnadaCfg MesnadaConfig) error
- func UpdateProvider(name models.ModelProvider, apiKey string, disabled bool) error
- func UpdateShell(path string, args []string) error
- func UpdateSkillsEnabled(enabled bool) error
- func UpdateTheme(themeName string) error
- func Validate() error
- func WorkingDirectory() string
- type Agent
- type AgentName
- type Config
- type Data
- type LSPConfig
- type MCPServer
- type MCPType
- type MesnadaACPConfig
- type MesnadaConfig
- type MesnadaOrchestratorConfig
- type MesnadaServerConfig
- type MesnadaTUIConfig
- type ProjectInitFlag
- type Provider
- type ShellConfig
- type SkillsConfig
- type TUIConfig
Constants ¶
const (
// InitFlagFilename is the name of the file that indicates whether the project has been initialized
InitFlagFilename = "init"
)
const (
MaxTokensFallbackDefault = 4096
)
Application constants
Variables ¶
This section is empty.
Functions ¶
func DeleteMCPServer ¶
func LoadGitHubToken ¶
Tries to load Github token from all possible locations
func MarkProjectInitialized ¶
func MarkProjectInitialized() error
MarkProjectInitialized marks the current project as initialized
func ShouldShowInitDialog ¶
ShouldShowInitDialog checks if the initialization dialog should be shown for the current directory
func UpdateAutoCompact ¶
func UpdateDebug ¶
func UpdateMCPServer ¶
func UpdateMesnada ¶
func UpdateMesnada(mesnadaCfg MesnadaConfig) error
func UpdateProvider ¶
func UpdateProvider(name models.ModelProvider, apiKey string, disabled bool) error
func UpdateShell ¶
func UpdateSkillsEnabled ¶
func UpdateTheme ¶
UpdateTheme updates the theme in the configuration and writes it to the config file.
func Validate ¶
func Validate() error
Validate checks if the configuration is valid and applies defaults where needed.
func WorkingDirectory ¶
func WorkingDirectory() string
WorkingDirectory returns the current working directory from the configuration.
Types ¶
type Agent ¶
type Agent struct {
Model models.ModelID `json:"model"`
MaxTokens int64 `json:"maxTokens"`
ReasoningEffort string `json:"reasoningEffort"` // For openai models low,medium,heigh
}
Agent defines configuration for different LLM models and their token limits.
type Config ¶
type Config struct {
Data Data `json:"data"`
WorkingDir string `json:"wd,omitempty"`
MCPServers map[string]MCPServer `json:"mcpServers,omitempty"`
Providers map[models.ModelProvider]Provider `json:"providers,omitempty"`
LSP map[string]LSPConfig `json:"lsp,omitempty"`
Agents map[AgentName]Agent `json:"agents,omitempty"`
Debug bool `json:"debug,omitempty"`
DebugLSP bool `json:"debugLSP,omitempty"`
ContextPaths []string `json:"contextPaths,omitempty"`
Skills SkillsConfig `json:"skills,omitempty"`
TUI TUIConfig `json:"tui"`
Mesnada MesnadaConfig `json:"mesnada,omitempty"`
Shell ShellConfig `json:"shell,omitempty"`
AutoCompact bool `json:"autoCompact,omitempty"`
}
Config is the main configuration structure for the application.
type Data ¶
type Data struct {
Directory string `json:"directory,omitempty"`
}
Data defines storage configuration.
type LSPConfig ¶
type LSPConfig struct {
Disabled bool `json:"enabled"`
Command string `json:"command"`
Args []string `json:"args"`
Options any `json:"options"`
}
LSPConfig defines configuration for Language Server Protocol integration.
type MCPServer ¶
type MCPServer struct {
Command string `json:"command"`
Env []string `json:"env"`
Args []string `json:"args"`
Type MCPType `json:"type"`
URL string `json:"url"`
Headers map[string]string `json:"headers"`
}
MCPServer defines the configuration for a Model Control Protocol server.
type MesnadaACPConfig ¶
type MesnadaACPConfig struct {
Enabled bool `json:"enabled,omitempty"`
DefaultAgent string `json:"defaultAgent,omitempty"`
AutoPermission bool `json:"autoPermission,omitempty"`
}
MesnadaACPConfig holds ACP agent configuration
type MesnadaConfig ¶
type MesnadaConfig struct {
Enabled bool `json:"enabled,omitempty"`
Server MesnadaServerConfig `json:"server,omitempty"`
Orchestrator MesnadaOrchestratorConfig `json:"orchestrator,omitempty"`
ACP MesnadaACPConfig `json:"acp,omitempty"`
TUI MesnadaTUIConfig `json:"tui,omitempty"`
}
MesnadaConfig holds all mesnada integration configuration
type MesnadaOrchestratorConfig ¶
type MesnadaOrchestratorConfig struct {
StorePath string `json:"storePath,omitempty"`
LogDir string `json:"logDir,omitempty"`
MaxParallel int `json:"maxParallel,omitempty"`
DefaultEngine string `json:"defaultEngine,omitempty"`
DefaultMCPConfig string `json:"defaultMcpConfig,omitempty"`
PersonaPath string `json:"personaPath,omitempty"`
}
MesnadaOrchestratorConfig holds orchestrator settings
type MesnadaServerConfig ¶
type MesnadaServerConfig struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
}
MesnadaServerConfig holds mesnada HTTP server configuration
type MesnadaTUIConfig ¶
type MesnadaTUIConfig struct {
Enabled bool `json:"enabled,omitempty"`
WebUI bool `json:"webui,omitempty"`
}
MesnadaTUIConfig holds mesnada TUI settings
type ProjectInitFlag ¶
type ProjectInitFlag struct {
Initialized bool `json:"initialized"`
}
ProjectInitFlag represents the initialization status for a project directory
type ShellConfig ¶
type ShellConfig struct {
Path string `json:"path,omitempty"`
Args []string `json:"args,omitempty"`
}
ShellConfig defines the configuration for the shell used by the bash tool.
type SkillsConfig ¶
type SkillsConfig struct {
Enabled bool `json:"enabled,omitempty"`
Paths []string `json:"paths,omitempty"`
}
SkillsConfig defines configuration for skill discovery and prompt injection.