Documentation
¶
Index ¶
- func ConvertCommandToTool(desc *cmds.CommandDescription) (protocol.Tool, error)
- func GetDefaultProfilesPath() (string, error)
- func GetProfilesPath(configFile string) (string, error)
- type Config
- type ConfigEditor
- func (c *ConfigEditor) AddProfile(name, description string) error
- func (c *ConfigEditor) AddToolDirectory(profile, path string, defaults map[string]interface{}) error
- func (c *ConfigEditor) AddToolFile(profile, path string) error
- func (c *ConfigEditor) DuplicateProfile(source, target, description string) error
- func (c *ConfigEditor) GetDefaultProfile() (string, error)
- func (c *ConfigEditor) GetProfile(name string) (*yaml.Node, error)
- func (c *ConfigEditor) GetProfiles() (map[string]string, error)
- func (c *ConfigEditor) Save() error
- func (c *ConfigEditor) SetDefaultProfile(profile string) error
- type ConfigPromptProvider
- type ConfigToolProvider
- type ConfigToolProviderOption
- type LayerParameters
- type ParameterFilter
- type Profile
- type PromptSources
- type SourceConfig
- type ToolSources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCommandToTool ¶
func ConvertCommandToTool(desc *cmds.CommandDescription) (protocol.Tool, error)
func GetDefaultProfilesPath ¶ added in v0.0.4
GetDefaultProfilesPath returns the default path for the profiles configuration file
func GetProfilesPath ¶ added in v0.0.4
GetProfilesPath returns the profiles path from either the provided path or the default location
Types ¶
type Config ¶
type Config struct {
Version string `yaml:"version"`
DefaultProfile string `yaml:"defaultProfile"`
Profiles map[string]*Profile `yaml:"profiles"`
}
Config represents the root configuration
func LoadFromFile ¶
LoadFromFile loads a configuration from a YAML file
type ConfigEditor ¶ added in v0.0.4
type ConfigEditor struct {
// contains filtered or unexported fields
}
func NewConfigEditor ¶ added in v0.0.4
func NewConfigEditor(path string) (*ConfigEditor, error)
func (*ConfigEditor) AddProfile ¶ added in v0.0.4
func (c *ConfigEditor) AddProfile(name, description string) error
func (*ConfigEditor) AddToolDirectory ¶ added in v0.0.4
func (c *ConfigEditor) AddToolDirectory(profile, path string, defaults map[string]interface{}) error
func (*ConfigEditor) AddToolFile ¶ added in v0.0.4
func (c *ConfigEditor) AddToolFile(profile, path string) error
func (*ConfigEditor) DuplicateProfile ¶ added in v0.0.4
func (c *ConfigEditor) DuplicateProfile(source, target, description string) error
func (*ConfigEditor) GetDefaultProfile ¶ added in v0.0.4
func (c *ConfigEditor) GetDefaultProfile() (string, error)
func (*ConfigEditor) GetProfile ¶ added in v0.0.4
func (c *ConfigEditor) GetProfile(name string) (*yaml.Node, error)
func (*ConfigEditor) GetProfiles ¶ added in v0.0.4
func (c *ConfigEditor) GetProfiles() (map[string]string, error)
func (*ConfigEditor) Save ¶ added in v0.0.4
func (c *ConfigEditor) Save() error
func (*ConfigEditor) SetDefaultProfile ¶ added in v0.0.4
func (c *ConfigEditor) SetDefaultProfile(profile string) error
type ConfigPromptProvider ¶
type ConfigPromptProvider struct {
// contains filtered or unexported fields
}
ConfigPromptProvider implements pkg.PromptProvider interface
func NewConfigPromptProvider ¶
func NewConfigPromptProvider(config *Config, profile string) (*ConfigPromptProvider, error)
func (*ConfigPromptProvider) GetPrompt ¶
func (p *ConfigPromptProvider) GetPrompt(name string, arguments map[string]string) (*protocol.PromptMessage, error)
GetPrompt implements pkg.PromptProvider interface
func (*ConfigPromptProvider) ListPrompts ¶
ListPrompts implements pkg.PromptProvider interface
type ConfigToolProvider ¶
type ConfigToolProvider struct {
// contains filtered or unexported fields
}
ConfigToolProvider implements pkg.ToolProvider interface
func NewConfigToolProvider ¶
func NewConfigToolProvider(options ...ConfigToolProviderOption) (*ConfigToolProvider, error)
NewConfigToolProvider creates a new ConfigToolProvider with the given options
func (*ConfigToolProvider) CallTool ¶
func (p *ConfigToolProvider) CallTool(ctx context.Context, name string, arguments map[string]interface{}) (*protocol.ToolResult, error)
CallTool implements pkg.ToolProvider interface
type ConfigToolProviderOption ¶
type ConfigToolProviderOption func(*ConfigToolProvider) error
func WithConfig ¶
func WithConfig(config *Config, profile string) ConfigToolProviderOption
func WithDebug ¶
func WithDebug(debug bool) ConfigToolProviderOption
func WithDirectories ¶
func WithDirectories(directories []repositories.Directory) ConfigToolProviderOption
func WithTracingDir ¶
func WithTracingDir(dir string) ConfigToolProviderOption
type LayerParameters ¶
LayerParameters maps layer names to their parameter settings
type ParameterFilter ¶
ParameterFilter maps layer names to lists of parameter names
type Profile ¶
type Profile struct {
Description string `yaml:"description"`
Tools *ToolSources `yaml:"tools"`
Prompts *PromptSources `yaml:"prompts"`
}
Profile represents a named configuration profile
type PromptSources ¶
type PromptSources struct {
Directories []SourceConfig `yaml:"directories,omitempty"`
Files []SourceConfig `yaml:"files,omitempty"`
Pinocchio *struct {
Command string `yaml:"command"`
Args []string `yaml:"args,omitempty"`
SourceConfig `yaml:",inline"`
} `yaml:"pinocchio,omitempty"`
}
PromptSources configures where prompts are loaded from
type SourceConfig ¶
type SourceConfig struct {
Path string `yaml:"path"`
Defaults LayerParameters `yaml:"defaults,omitempty"`
Overrides LayerParameters `yaml:"overrides,omitempty"`
Blacklist ParameterFilter `yaml:"blacklist,omitempty"`
Whitelist ParameterFilter `yaml:"whitelist,omitempty"`
}
Common source configuration for both tools and prompts
type ToolSources ¶
type ToolSources struct {
Directories []SourceConfig `yaml:"directories,omitempty"`
Files []SourceConfig `yaml:"files,omitempty"`
ExternalCommands []struct {
Command string `yaml:"command"`
Args []string `yaml:"args,omitempty"`
SourceConfig `yaml:",inline"`
} `yaml:"external_commands,omitempty"`
}
ToolSources configures where tools are loaded from