Documentation
¶
Overview ¶
Package configtypes provides unified configuration type definitions for go-magic. All configuration structures should be defined here to avoid duplication across packages.
Index ¶
- type ASRConfig
- type AgentConfig
- type Config
- type CortexConfig
- type DisplayConfig
- type EmailConfig
- type ExecutionConfig
- type FileSecurity
- type GatewayConfig
- type ImageGenConfig
- type KanbanConfig
- type LogConfig
- type MCPConfig
- type MCPServer
- type MemoryConfig
- type NotificationCfg
- type PIIConfig
- type PlatformConfig
- type PluginConfig
- type PrivacyConfig
- type ProviderCfg
- type SMSConfig
- type SecurityConfig
- type ServerConfig
- type SubAgentConfig
- type TTSConfig
- type ToolsConfig
- type VoiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASRConfig ¶
type ASRConfig struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"`
APIKey string `json:"api_key"`
Model string `json:"model"`
}
ASRConfig defines ASR (speech recognition) configuration.
type AgentConfig ¶
type AgentConfig struct {
MaxIterations int `json:"max_iterations,omitempty"`
MaxTurns int `json:"max_turns,omitempty"`
CompressionRatio float64 `json:"compression_ratio,omitempty"`
GoalMaxTurns int `json:"goal_max_turns,omitempty"`
AutoApprove bool `json:"auto_approve,omitempty"`
EnableSubtasks bool `json:"enable_subtasks,omitempty"`
EnableHooks bool `json:"enable_hooks,omitempty"`
TruncateThreshold int `json:"truncate_threshold,omitempty"`
}
AgentConfig defines agent behavior configuration.
type Config ¶
type Config struct {
// Basic settings
Profile string `json:"profile"`
MagicHome string `json:"magic_home"`
WorkingDir string `json:"working_dir,omitempty"`
// Provider settings
Provider string `json:"provider"`
Model string `json:"model"`
Providers map[string]ProviderCfg `json:"providers"`
// Feature toggles
Tools ToolsConfig `json:"tools,omitempty"`
Gateway GatewayConfig `json:"gateway,omitempty"`
Agent AgentConfig `json:"agent,omitempty"`
Memory MemoryConfig `json:"memory,omitempty"`
Kanban KanbanConfig `json:"kanban,omitempty"`
Notification NotificationCfg `json:"notification,omitempty"`
ImageGen ImageGenConfig `json:"image_gen,omitempty"`
Security SecurityConfig `json:"security,omitempty"`
// Advanced features
Cortex CortexConfig `json:"cortex,omitempty"`
Plugin PluginConfig `json:"plugin,omitempty"`
Execution ExecutionConfig `json:"execution,omitempty"`
Log LogConfig `json:"log,omitempty"`
Server ServerConfig `json:"server,omitempty"`
MCP MCPConfig `json:"mcp,omitempty"`
SubAgent SubAgentConfig `json:"subagent,omitempty"`
Voice VoiceConfig `json:"voice,omitempty"`
Privacy PrivacyConfig `json:"privacy,omitempty"`
Display DisplayConfig `json:"display,omitempty"`
}
Config is the main configuration structure for go-magic application.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration values.
type CortexConfig ¶
type CortexConfig struct {
Enabled bool `json:"enabled"`
PerceptionModel string `json:"perception_model,omitempty"`
DecisionModel string `json:"decision_model,omitempty"`
}
CortexConfig defines cortex/cognition system configuration.
type DisplayConfig ¶
type DisplayConfig struct {
Theme string `json:"theme,omitempty"`
Language string `json:"language,omitempty"`
}
DisplayConfig defines display/UI settings.
type EmailConfig ¶
type EmailConfig struct {
Enabled bool `json:"enabled"`
SMTPHost string `json:"smtp_host"`
SMTPPort int `json:"smtp_port"`
SMTPUser string `json:"smtp_user"`
SMTPPass string `json:"smtp_pass"`
From string `json:"from"`
To string `json:"to"`
}
EmailConfig defines email notification settings.
type ExecutionConfig ¶
type ExecutionConfig struct {
MaxParallel int `json:"max_parallel,omitempty"`
CheckpointDir string `json:"checkpoint_dir,omitempty"`
EnableCheckpoint bool `json:"enable_checkpoint,omitempty"`
}
ExecutionConfig defines execution system configuration.
type FileSecurity ¶ added in v0.5.0
type FileSecurity struct {
Enabled bool `json:"enabled,omitempty"`
AllowedPaths []string `json:"allowed_paths,omitempty"`
BlockedPaths []string `json:"blocked_paths,omitempty"`
SessionIsolation bool `json:"session_isolation,omitempty"`
DefaultFileMode string `json:"default_file_mode,omitempty"`
DefaultDirMode string `json:"default_dir_mode,omitempty"`
MaxFileSizeKB int `json:"max_file_size_kb,omitempty"`
AllowSymlinks bool `json:"allow_symlinks,omitempty"`
}
FileSecurity defines file operation security configuration.
type GatewayConfig ¶
type GatewayConfig struct {
Enabled bool `json:"enabled"`
Platforms map[string]PlatformConfig `json:"platforms,omitempty"`
// Runtime settings
MaxSessions int `json:"max_sessions,omitempty"`
SessionTimeout string `json:"session_timeout,omitempty"`
EnableSlashCmd bool `json:"enable_slash_cmd,omitempty"`
PlatformTimeout string `json:"platform_timeout,omitempty"`
APIPort int `json:"api_port,omitempty"`
EnableAPI bool `json:"enable_api,omitempty"`
}
GatewayConfig defines gateway/platform integration configuration.
type ImageGenConfig ¶
type ImageGenConfig struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"`
APIKey string `json:"api_key"`
Model string `json:"model"`
}
ImageGenConfig defines image generation configuration.
type KanbanConfig ¶
KanbanConfig defines kanban system configuration.
type LogConfig ¶
type LogConfig struct {
Level string `json:"level,omitempty"`
File string `json:"file,omitempty"`
Format string `json:"format,omitempty"`
}
LogConfig defines logging configuration.
type MCPConfig ¶
type MCPConfig struct {
Enabled bool `json:"enabled"`
Servers map[string]MCPServer `json:"servers,omitempty"`
}
MCPConfig defines MCP (Model Context Protocol) configuration.
type MCPServer ¶
type MCPServer struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
}
MCPServer defines MCP server configuration.
type MemoryConfig ¶
type MemoryConfig struct {
// Basic settings
Enabled bool `json:"enabled"`
DBPath string `json:"db_path,omitempty"`
AutoRecall bool `json:"auto_recall,omitempty"`
RecallLimit int `json:"recall_limit,omitempty"`
// Storage settings
StorageDir string `json:"storage_dir,omitempty"`
MaxSizeMB int `json:"max_size_mb,omitempty"`
MaxContentLen int `json:"max_content_length,omitempty"`
MaxAgentMemLen int `json:"max_agent_mem_length,omitempty"`
MaxUserMemLen int `json:"max_user_mem_length,omitempty"`
// FTS settings
FTSEnabled bool `json:"fts_enabled,omitempty"`
FTSMaxResults int `json:"fts_max_results,omitempty"`
FTSBoostRecent bool `json:"fts_boost_recent,omitempty"`
// Decay settings
EnableDecay bool `json:"enable_decay,omitempty"`
DecayRate float64 `json:"decay_rate,omitempty"`
EnableDedup bool `json:"enable_dedup,omitempty"`
// Cleanup settings
CleanupEnabled bool `json:"cleanup_enabled,omitempty"`
CleanupInterval string `json:"cleanup_interval,omitempty"`
CleanupOlderThan string `json:"cleanup_older_than,omitempty"`
// Summarization
AutoSummarize bool `json:"auto_summarize,omitempty"`
SummarizeThreshold int `json:"summarize_threshold,omitempty"`
LLMProvider string `json:"llm_provider,omitempty"`
}
MemoryConfig defines memory system configuration. This unified structure combines all memory-related settings.
type NotificationCfg ¶
type NotificationCfg struct {
Email EmailConfig `json:"email,omitempty"`
SMS SMSConfig `json:"sms,omitempty"`
}
NotificationCfg defines notification configuration.
type PIIConfig ¶
type PIIConfig struct {
Enabled bool `json:"enabled"`
RedactPhone bool `json:"redact_phone"`
RedactEmail bool `json:"redact_email"`
RedactName bool `json:"redact_name"`
RedactCredit bool `json:"redact_credit"`
RedactSSN bool `json:"redact_ssn"`
}
PIIConfig defines PII redaction configuration.
type PlatformConfig ¶
type PlatformConfig struct {
// Authentication
Token string `json:"token,omitempty"`
Secret string `json:"secret,omitempty"`
AppKey string `json:"app_key,omitempty"`
AppSecret string `json:"app_secret,omitempty"`
CorpID string `json:"corp_id,omitempty"`
AgentID string `json:"agent_id,omitempty"`
// Settings
Enabled bool `json:"enabled"`
ProxyURL string `json:"proxy_url,omitempty"`
AllowedChannels []string `json:"allowed_channels,omitempty"`
BlockedChannels []string `json:"blocked_channels,omitempty"`
// Advanced
APIURL string `json:"api_url,omitempty"`
Region string `json:"region,omitempty"`
MessageFormat string `json:"message_format,omitempty"`
}
PlatformConfig defines platform-specific configuration.
type PluginConfig ¶
type PluginConfig struct {
Enabled bool `json:"enabled"`
Dir string `json:"dir,omitempty"`
AutoLoad bool `json:"auto_load,omitempty"`
Allowed []string `json:"allowed,omitempty"`
}
PluginConfig defines plugin system configuration.
type PrivacyConfig ¶
type PrivacyConfig struct {
Enabled bool `json:"enabled"`
RedactPII bool `json:"redact_pii"`
AnonymizeUser bool `json:"anonymize_user"`
}
PrivacyConfig defines privacy settings.
type ProviderCfg ¶
type ProviderCfg struct {
Provider string `json:"provider"`
APIKey string `json:"api_key"`
BaseURL string `json:"base_url,omitempty"`
Proxy string `json:"proxy,omitempty"`
Fallback []string `json:"fallback,omitempty"`
ExtraBody map[string]string `json:"extra_body,omitempty"`
// Extended fields for advanced configuration
APIVersion string `json:"api_version,omitempty"`
Extra map[string]string `json:"extra,omitempty"`
Models []string `json:"models,omitempty"` // List of supported models, first element is current model
MaxRPM int `json:"max_rpm,omitempty"`
MaxTPM int `json:"max_tpm,omitempty"`
}
ProviderCfg defines provider-specific configuration.
func (*ProviderCfg) GetCurrentModel ¶ added in v0.4.15
func (p *ProviderCfg) GetCurrentModel() string
GetCurrentModel returns the current model (first element of Models array)
type SMSConfig ¶
type SMSConfig struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"`
APIKey string `json:"api_key"`
Phone string `json:"phone"`
}
SMSConfig defines SMS notification settings.
type SecurityConfig ¶
type SecurityConfig struct {
PII PIIConfig `json:"pii,omitempty"`
File FileSecurity `json:"file,omitempty"`
}
SecurityConfig defines security configuration.
type ServerConfig ¶
type ServerConfig struct {
Enabled bool `json:"enabled"`
Port int `json:"port,omitempty"`
Host string `json:"host,omitempty"`
}
ServerConfig defines server configuration.
type SubAgentConfig ¶
type SubAgentConfig struct {
Enabled bool `json:"enabled"`
MaxDepth int `json:"max_depth,omitempty"`
Timeout string `json:"timeout,omitempty"`
}
SubAgentConfig defines sub-agent configuration.
type TTSConfig ¶
type TTSConfig struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"`
APIKey string `json:"api_key"`
Model string `json:"model"`
Voice string `json:"voice"`
}
TTSConfig defines TTS (text-to-speech) configuration.
type ToolsConfig ¶
type ToolsConfig struct {
Enabled []string `json:"enabled,omitempty"`
Disabled []string `json:"disabled,omitempty"`
}
ToolsConfig defines tools configuration.
type VoiceConfig ¶
type VoiceConfig struct {
Enabled bool `json:"enabled"`
ASR ASRConfig `json:"asr,omitempty"`
TTS TTSConfig `json:"tts,omitempty"`
}
VoiceConfig defines voice system configuration.