Documentation
¶
Index ¶
- func GetDefaultProviderID() string
- func ResolveAgentsDir(path string) string
- type Agent
- type AgentContext
- type AgentInfo
- type BinaryTool
- type Config
- type Enricher
- type InstanceConfig
- type MCPServer
- type Mode
- type ModeInfo
- type ModeTransition
- type ProviderInfo
- type SlackUIConfig
- type TelegramUIConfig
- type ToolConfig
- type ToolDisplayConfig
- type ToolDisplayToolConfig
- type ToolInput
- type ToolRequirements
- type Trigger
- type UIConfig
- type WebUIConfig
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultProviderID ¶
func GetDefaultProviderID() string
GetDefaultProviderID returns the configured default provider ID.
func ResolveAgentsDir ¶
ResolveAgentsDir determines the base directory for agents configuration. If path is empty, it returns $XDG_CONFIG_HOME/dux/agents strictly.
Types ¶
type Agent ¶
type Agent struct {
Name string `yaml:"name"`
Provider string `yaml:"provider"`
Context *AgentContext `yaml:"context,omitempty"`
Workflow *Workflow `yaml:"workflow,omitempty"`
Triggers []Trigger `yaml:"triggers,omitempty"`
}
Agent defines a distinct interactive role combining a provider and dynamic context.
func LoadAgents ¶
LoadAgents enumerates all folders within agentsDir, expecting an agent.yaml inside.
type AgentContext ¶
type AgentContext struct {
Enrichers []Enricher `yaml:"enrichers,omitempty"`
Tools []ToolConfig `yaml:"tools,omitempty"`
System string `yaml:"system,omitempty"`
}
AgentContext defines dynamic and static context to configure an agent's memory before interaction.
type AgentInfo ¶
AgentInfo holds display-ready agent data.
func ListAgents ¶
ListAgents returns all configured agents with display metadata.
type BinaryTool ¶
type BinaryTool struct {
Description string `yaml:"description"`
Executable string `yaml:"executable"`
Args []string `yaml:"args"`
Inputs map[string]ToolInput `yaml:"inputs,omitempty"`
}
BinaryTool defines execution requirements for a custom command line binary.
type Config ¶
type Config struct {
DefaultProvider string `mapstructure:"default_provider"`
Providers []InstanceConfig `mapstructure:"providers"`
}
Config represents the top-level configuration for the LLM subsystem.
type InstanceConfig ¶
type InstanceConfig struct {
ID string `mapstructure:"id"`
Type string `mapstructure:"type"`
Config map[string]interface{} `mapstructure:"config"` // Polymorphic config
}
InstanceConfig holds the generic mapping for any provider instance.
func LoadLLMProvider ¶
func LoadLLMProvider(targetID string) (InstanceConfig, error)
LoadLLMProvider reads the LLM deployment mappings from the current Viper context. It applies a generous suite of fallback configurations if the tree is completely missing, and resolves a single instance representation based on target request strings.
func LoadLLMProviders ¶
func LoadLLMProviders() ([]InstanceConfig, error)
LoadLLMProviders returns all configured LLM providers.
type MCPServer ¶
type MCPServer struct {
Transport string `yaml:"transport,omitempty"`
Command string `yaml:"command,omitempty"`
Args []string `yaml:"args,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
URL string `yaml:"url,omitempty"`
Headers map[string]string `yaml:"headers,omitempty"`
}
MCPServer defines configuration for an external Model Context Protocol server. It supports stdio (Command/Args), streamable_http (URL), or explicitly sse (URL) transports.
type Mode ¶
type Mode struct {
Name string `yaml:"name"`
Use string `yaml:"use,omitempty"`
Provider string `yaml:"provider,omitempty"`
Context *AgentContext `yaml:"context,omitempty"`
Transitions []ModeTransition `yaml:"transitions,omitempty"`
}
Mode represents a specific state in an agent's workflow graph.
type ModeTransition ¶
ModeTransition defines an automated tool injection to transition between workflow modes.
type ProviderInfo ¶
ProviderInfo holds display-ready provider data.
func ListProviders ¶
func ListProviders() ([]ProviderInfo, error)
ListProviders returns all configured LLM providers with display metadata.
type SlackUIConfig ¶
type SlackUIConfig struct {
AppToken string `mapstructure:"app_token"`
BotToken string `mapstructure:"bot_token"`
SigningSecret string `mapstructure:"signing_secret"`
WebhookURL string `mapstructure:"webhook_url"`
WebhookAddress string `mapstructure:"webhook_address"`
ReplyMode string `mapstructure:"reply_mode"`
}
type TelegramUIConfig ¶
type ToolConfig ¶
type ToolConfig struct {
Name string `yaml:"name"`
Enabled bool `yaml:"enabled"`
TimeoutSeconds *int `yaml:"timeout_seconds,omitempty"`
Requirements ToolRequirements `yaml:"requirements,omitempty"`
MCP *MCPServer `yaml:"mcp,omitempty"`
Binary *BinaryTool `yaml:"binary,omitempty"`
Tools []ToolConfig `yaml:"tools,omitempty"`
}
ToolConfig maps a specific tool and its deployment requirements. A tool can be either a locally built-in tool, an external MCP server, or a declarative binary tool. It can also act as a logical "toolset" grouping by nesting additional configurations inside 'Tools'.
func LoadGlobalTools ¶
func LoadGlobalTools() []ToolConfig
LoadGlobalTools retrieves the application-wide defined tools, securely injecting missing mandatory defaults (e.g. 'time').
type ToolDisplayConfig ¶
type ToolDisplayConfig struct {
Enabled bool `mapstructure:"enabled"`
DefaultIcon string `mapstructure:"default_icon"`
Tools map[string]ToolDisplayToolConfig `mapstructure:"tools"`
}
func LoadToolDisplayConfig ¶
func LoadToolDisplayConfig() ToolDisplayConfig
type ToolDisplayToolConfig ¶
type ToolInput ¶
type ToolInput struct {
Type string `yaml:"type"`
Description string `yaml:"description"`
Required bool `yaml:"required,omitempty"`
}
ToolInput defines single input parameter expected for a binary tool.
type ToolRequirements ¶
type ToolRequirements struct {
Supervision any `yaml:"supervision,omitempty"` // Boolean or CEL string
Sandbox *bool `yaml:"sandbox,omitempty"`
}
ToolRequirements details specific execution protections for a given tool.
type Trigger ¶
type Trigger struct {
Type string `yaml:"type"`
Config map[string]string `yaml:"config,omitempty"`
}
Trigger represents a configuration for defining how an agent starts.
type UIConfig ¶
type UIConfig struct {
Type string `mapstructure:"type"`
Agent string `mapstructure:"agent"`
Provider string `mapstructure:"provider"`
Configuration map[string]interface{} `mapstructure:"configuration"`
}
func (*UIConfig) ParseSlackConfig ¶
func (c *UIConfig) ParseSlackConfig() (*SlackUIConfig, error)
func (*UIConfig) ParseTelegramConfig ¶
func (c *UIConfig) ParseTelegramConfig() (*TelegramUIConfig, error)
func (*UIConfig) ParseWebConfig ¶
func (c *UIConfig) ParseWebConfig() (*WebUIConfig, error)
type WebUIConfig ¶
type WebUIConfig struct {
Address string `mapstructure:"address"`
}