hostconfig

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MCPToolAllowListEnvKey = "_goclaw_mcp_allow"

Variables

This section is empty.

Functions

func CoalesceDinoFromHost

func CoalesceDinoFromHost(in *dino.Config, host *HostAppConfig, brand *HostDinoBrand) *dino.Config

func ExpandConfigPath

func ExpandConfigPath(p string) string

func MCPHeadersFromTool

func MCPHeadersFromTool(m MCPToolConfig) map[string]string

func MemoryPersistDirectory

func MemoryPersistDirectory(cfg *dino.Config) string

func MemoryPersistFileName

func MemoryPersistFileName(cfg *dino.Config, host *HostAppConfig, brand *HostDinoBrand) string

func MemoryStoreSpec

func MemoryStoreSpec(cfg *dino.Config, host *HostAppConfig, brand *HostDinoBrand) (dir, sqliteFile string)

func MergeMCPServersIntoDino

func MergeMCPServersIntoDino(out *dino.Config, entries []MCPToolConfig)

func NeedLLMSetup added in v1.9.1

func NeedLLMSetup(host *HostAppConfig) bool

func NormalizeMCPTransport

func NormalizeMCPTransport(s string) string

Types

type AudioConfig

type AudioConfig struct {
	Enabled  bool   `mapstructure:"enabled"`
	MaxBytes int    `mapstructure:"max_bytes"`
	Provider string `mapstructure:"provider"`
}

type CanvasConfig

type CanvasConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Port    int    `mapstructure:"port"`
	Root    string `mapstructure:"root"`
}

type ConsoleConfig

type ConsoleConfig struct {
	Enabled          bool   `mapstructure:"enabled"`
	ChatUserID       string `mapstructure:"chat_user_id"`
	ChatRoleID       string `mapstructure:"chat_role_id"`
	ChatRoleName     string `mapstructure:"chat_role_name"`
	Language         string `mapstructure:"language"`
	ServerURL        string `mapstructure:"server_url"`
	AutoStartBackend bool   `mapstructure:"auto_start_backend"`
}

type CortexConfig

type CortexConfig struct {
	DefaultModel   string           `mapstructure:"default_model"`
	ImageInputMode string           `mapstructure:"image_input_mode"`
	AuthProfile    string           `mapstructure:"auth_profile"`
	Timeout        string           `mapstructure:"timeout"`
	MaxIterations  int              `mapstructure:"max_iterations"`
	SystemPrompt   string           `mapstructure:"system_prompt"`
	LLM            LLMConfig        `mapstructure:"llm"`
	ToolConfig     ToolConfig       `mapstructure:"tool_config"`
	SkillsRoot     string           `mapstructure:"skills_root"`
	AgentsDir      string           `mapstructure:"agents_dir"`
	DefaultAgent   string           `mapstructure:"default_agent"`
	Subagent       SubagentSettings `mapstructure:"subagent"`
	Memory         MemorySettings   `mapstructure:"memory"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Driver   string `mapstructure:"driver"`
	DSN      string `mapstructure:"dsn"`
	LogLevel string `mapstructure:"log_level"`
}

type EmailToolConfig

type EmailToolConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

type FFmpegConfig

type FFmpegConfig struct {
	Path string `mapstructure:"path"`
}

type GatewayConfig

type GatewayConfig struct {
	Enabled      bool   `mapstructure:"enabled"`
	AuthToken    string `mapstructure:"auth_token"`
	MaxFrameSize int    `mapstructure:"max_frame_size"`
	Bind         string `mapstructure:"bind"`
}

type HostAppConfig

type HostAppConfig struct {
	Server    ServerConfig    `mapstructure:"server"`
	Workspace WorkspaceConfig `mapstructure:"workspace"`
	Database  DatabaseConfig  `mapstructure:"database"`
	Tasks     TasksConfig     `mapstructure:"tasks"`
	Profile   ProfileConfig   `mapstructure:"profile"`
}

type HostDinoBrand

type HostDinoBrand struct {
	MemoryToolName    string
	ExtraAllowedTools []string
	DefaultWebTools   bool
	PromptMarker      string
	PromptAddendum    string
}

type LLMConfig

type LLMConfig struct {
	Provider  string                    `mapstructure:"provider"`
	Providers map[string]ProviderConfig `mapstructure:"providers"`
	OpenAI    ProviderConfig            `mapstructure:"openai"`
	DeepSeek  ProviderConfig            `mapstructure:"deepseek"`
	Volce     ProviderConfig            `mapstructure:"volce"`
	Gemini    ProviderConfig            `mapstructure:"gemini"`
	Anthropic ProviderConfig            `mapstructure:"anthropic"`
}

type LogConfig

type LogConfig struct {
	Level    string `mapstructure:"level"`
	Output   string `mapstructure:"output"`
	FilePath string `mapstructure:"file_path"`
}

type MCPCapabilityTool

type MCPCapabilityTool struct {
	Server string
	ID     string
	Name   string
	Desc   string
}

func ListMCPTools

func ListMCPTools(ctx context.Context, servers []MCPServer) []MCPCapabilityTool

func ListMCPToolsFromToolConfigs

func ListMCPToolsFromToolConfigs(ctx context.Context, entries []MCPToolConfig) []MCPCapabilityTool

type MCPServer

type MCPServer struct {
	Name       string
	URL        string
	Disabled   bool
	Transport  string
	Headers    map[string]string
	ToolsAllow []string
}

type MCPToolConfig

type MCPToolConfig struct {
	Name           string            `mapstructure:"name"`
	Disabled       bool              `mapstructure:"disabled"`
	URL            string            `mapstructure:"url"`
	Transport      string            `mapstructure:"transport"`
	Headers        map[string]string `mapstructure:"headers"`
	Tools          []string          `mapstructure:"tools"`
	AuthType       string            `mapstructure:"auth_type"`
	BearerToken    string            `mapstructure:"bearer_token"`
	AuthHeaderName string            `mapstructure:"auth_header_name"`
	AuthHeaderVal  string            `mapstructure:"auth_header_value"`
}

type MediaConfig

type MediaConfig struct {
	Audio   AudioConfig   `mapstructure:"audio"`
	FFmpeg  FFmpegConfig  `mapstructure:"ffmpeg"`
	Whisper WhisperConfig `mapstructure:"whisper"`
}

type MemoryIngestConfig

type MemoryIngestConfig struct {
	Enabled             bool               `mapstructure:"enabled"`
	Interval            string             `mapstructure:"interval"`
	BatchMaxMessages    int                `mapstructure:"batch_max_messages"`
	MinNewMessages      int                `mapstructure:"min_new_messages"`
	Model               string             `mapstructure:"model"`
	SystemExtra         string             `mapstructure:"system_extra"`
	Rules               []MemoryIngestRule `mapstructure:"rules"`
	TrivialPhrases      []string           `mapstructure:"trivial_phrases"`
	MinContentLength    int                `mapstructure:"min_content_length"`
	EnableContentFilter bool               `mapstructure:"enable_content_filter"`
}

type MemoryIngestRule

type MemoryIngestRule struct {
	Name            string   `mapstructure:"name"`
	Action          string   `mapstructure:"action"`
	MaxTotalChars   int      `mapstructure:"max_total_chars"`
	MinTotalChars   int      `mapstructure:"min_total_chars"`
	PhrasesAny      []string `mapstructure:"phrases_any"`
	MaxUserMessages int      `mapstructure:"max_user_messages"`
}

type MemorySettings

type MemorySettings struct {
	MaxBudgetTokens   int `mapstructure:"max_budget_tokens"`
	CompactAfterTurns int `mapstructure:"compact_after_turns"`
	CompressThreshold int `mapstructure:"compress_threshold"`
}

type MessagesConfig

type MessagesConfig struct {
	Queue QueueConfig `mapstructure:"queue"`
}

type ProfileConfig

type ProfileConfig struct {
	Enabled            bool     `mapstructure:"enabled"`
	ExtractInterval    string   `mapstructure:"extract_interval"`
	MinMessages        int      `mapstructure:"min_messages"`
	WindowMessages     int      `mapstructure:"window_messages"`
	MaxMessageChars    int      `mapstructure:"max_message_chars"`
	SummaryInterval    string   `mapstructure:"summary_interval"`
	AllowedKeys        []string `mapstructure:"allowed_keys"`
	PendingThreshold   float64  `mapstructure:"pending_threshold"`
	ConfirmedThreshold float64  `mapstructure:"confirmed_threshold"`
}

type ProviderConfig

type ProviderConfig struct {
	APIKey  string   `mapstructure:"api_key"`
	BaseURL string   `mapstructure:"base_url"`
	Model   string   `mapstructure:"model"`
	Models  []string `mapstructure:"models"`
	OrgID   string   `mapstructure:"org_id"`
	APIType string   `mapstructure:"api_type"`
}

func HostLLMProvider added in v1.9.1

func HostLLMProvider(host *HostAppConfig, provider string) *ProviderConfig

func LLMProvider added in v1.9.1

func LLMProvider(llm *LLMConfig, provider string) *ProviderConfig

type QueueConfig

type QueueConfig struct {
	Mode       string `mapstructure:"mode"`
	DebounceMS int    `mapstructure:"debounce_ms"`
	Cap        int    `mapstructure:"cap"`
}

type ServerConfig

type ServerConfig struct {
	Port         int                `mapstructure:"port"`
	Mode         string             `mapstructure:"mode"`
	GracePeriod  string             `mapstructure:"grace_period"`
	Gateway      GatewayConfig      `mapstructure:"gateway"`
	Canvas       CanvasConfig       `mapstructure:"canvas"`
	Console      ConsoleConfig      `mapstructure:"console"`
	Cortex       CortexConfig       `mapstructure:"cortex"`
	Log          LogConfig          `mapstructure:"log"`
	Messages     MessagesConfig     `mapstructure:"messages"`
	MemoryIngest MemoryIngestConfig `mapstructure:"memory_ingest"`
}

type SubagentSettings

type SubagentSettings struct {
	Enabled          bool                     `mapstructure:"enabled"`
	TriggerOnKeyword bool                     `mapstructure:"trigger_on_keyword"`
	Triggers         []SubagentTriggerSetting `mapstructure:"triggers"`
}

type SubagentTriggerSetting

type SubagentTriggerSetting struct {
	AgentName string   `mapstructure:"agent_name"`
	Keywords  []string `mapstructure:"keywords"`
	Patterns  []string `mapstructure:"patterns"`
	Priority  int      `mapstructure:"priority"`
}

type TasksConfig

type TasksConfig struct {
	StuckJobTimeout string `mapstructure:"stuck_job_timeout"`
	Locker          string `mapstructure:"locker"`
}

type TelegramConfig

type TelegramConfig struct {
	Enabled bool   `mapstructure:"enabled"`
	Token   string `mapstructure:"token"`
	Debug   bool   `mapstructure:"debug"`
}

type ToolConfig

type ToolConfig struct {
	Builtin               []string         `mapstructure:"builtin"`
	MCP                   []MCPToolConfig  `mapstructure:"mcp"`
	SafeBinaries          []string         `mapstructure:"safe_binaries"`
	Env                   []string         `mapstructure:"env"`
	ApprovalRequiredTools []string         `mapstructure:"approval_required_tools"`
	EmailConfig           *EmailToolConfig `mapstructure:"email_config"`
}

type WhisperConfig

type WhisperConfig struct {
	Provider string `mapstructure:"provider"`
	APIKey   string `mapstructure:"api_key"`
	BaseURL  string `mapstructure:"base_url"`
	Model    string `mapstructure:"model"`
}

type WorkspaceConfig

type WorkspaceConfig struct {
	Root         string `mapstructure:"root"`
	AutoReload   bool   `mapstructure:"auto_reload"`
	Unrestricted bool   `mapstructure:"unrestricted"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL