config

package
v1.10.11 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCompletions added in v1.4.2

func GenCompletions(command *cobra.Command, shell string) error

func MaxAPIKeyFileBytesForTest added in v1.10.10

func MaxAPIKeyFileBytesForTest() int64

func ReadAPIKeyFile added in v1.10.10

func ReadAPIKeyFile(path string) (string, error)

Types

type AgentConfig added in v1.10.3

type AgentConfig struct {
	Mode    string `yaml:"mode"`
	WorkDir string `yaml:"work_dir"`
	DryRun  bool   `yaml:"dry_run"`

	// Budgets / guardrails (0 = unlimited)
	MaxSteps      int `yaml:"max_steps"`
	MaxIterations int `yaml:"max_iterations"`
	MaxWallTime   int `yaml:"max_wall_time"`
	MaxShellCalls int `yaml:"max_shell_calls"`
	MaxLLMCalls   int `yaml:"max_llm_calls"`
	MaxFileOps    int `yaml:"max_file_ops"`
	MaxLLMTokens  int `yaml:"max_llm_tokens"`

	// Safety/policy
	AllowedTools           []string `yaml:"allowed_tools"`
	DeniedShellCommands    []string `yaml:"denied_shell_commands"`
	AllowedFileOps         []string `yaml:"allowed_file_ops"`
	RestrictFilesToWorkDir bool     `yaml:"restrict_files_to_work_dir"`

	// Logging / artifacts
	WritePlanJSON bool   `yaml:"write_plan_json"`
	PlanJSONPath  string `yaml:"plan_json_path"`
}

type Config added in v1.7.6

type Config struct {
	Name                 string            `yaml:"name"`
	APIKey               string            `yaml:"api_key"`
	APIKeyFile           string            `yaml:"api_key_file"`
	Model                string            `yaml:"model"`
	MaxTokens            int               `yaml:"max_tokens"`
	ContextWindow        int               `yaml:"context_window"`
	Role                 string            `yaml:"role"`
	Temperature          float64           `yaml:"temperature"`
	TopP                 float64           `yaml:"top_p"`
	FrequencyPenalty     float64           `yaml:"frequency_penalty"`
	PresencePenalty      float64           `yaml:"presence_penalty"`
	Thread               string            `yaml:"thread"`
	OmitHistory          bool              `yaml:"omit_history"`
	URL                  string            `yaml:"url"`
	CompletionsPath      string            `yaml:"completions_path"`
	ModelsPath           string            `yaml:"models_path"`
	ResponsesPath        string            `yaml:"responses_path"`
	SpeechPath           string            `yaml:"speech_path"`
	ImageGenerationsPath string            `yaml:"image_generations_path"`
	ImageEditsPath       string            `yaml:"image_edits_path"`
	TranscriptionsPath   string            `yaml:"transcriptions_path"`
	AuthHeader           string            `yaml:"auth_header"`
	AuthTokenPrefix      string            `yaml:"auth_token_prefix"`
	CommandPrompt        string            `yaml:"command_prompt"`
	CommandPromptColor   string            `yaml:"command_prompt_color"`
	OutputPrompt         string            `yaml:"output_prompt"`
	OutputPromptColor    string            `yaml:"output_prompt_color"`
	AutoCreateNewThread  bool              `yaml:"auto_create_new_thread"`
	AutoShellTitle       bool              `yaml:"auto_shell_title"`
	TrackTokenUsage      bool              `yaml:"track_token_usage"`
	SkipTLSVerify        bool              `yaml:"skip_tls_verify"`
	HTTPTimeout          int               `yaml:"http_timeout"`
	Multiline            bool              `yaml:"multiline"`
	Web                  bool              `yaml:"web"`
	WebContextSize       string            `yaml:"web_context_size"`
	Seed                 int               `yaml:"seed"`
	Effort               string            `yaml:"effort"`
	Voice                string            `yaml:"voice"`
	UserAgent            string            `yaml:"user_agent"`
	CustomHeaders        map[string]string `yaml:"custom_headers"`
	Agent                AgentConfig       `yaml:"agent"`
}

type FileIO

type FileIO struct {
	// contains filtered or unexported fields
}

func NewStore added in v1.7.6

func NewStore() *FileIO

func (*FileIO) Delete added in v1.5.4

func (f *FileIO) Delete(pattern string) error

func (*FileIO) List added in v1.4.1

func (f *FileIO) List() ([]string, error)

func (*FileIO) Read

func (f *FileIO) Read() (Config, error)

func (*FileIO) ReadDefaults added in v1.1.0

func (f *FileIO) ReadDefaults() Config

func (*FileIO) WithConfigPath added in v1.4.1

func (f *FileIO) WithConfigPath(configFilePath string) *FileIO

func (*FileIO) WithHistoryPath added in v1.4.1

func (f *FileIO) WithHistoryPath(historyPath string) *FileIO

func (*FileIO) Write

func (f *FileIO) Write(config Config) error

type FileNotFoundError added in v1.7.10

type FileNotFoundError struct {
	Path string
}

FileNotFoundError is a custom error type for non-existent files

func (*FileNotFoundError) Error added in v1.7.10

func (e *FileNotFoundError) Error() string

type Manager added in v1.7.6

type Manager struct {
	Config Config
	// contains filtered or unexported fields
}

func NewManager added in v1.7.6

func NewManager(cs Store) *Manager

func (*Manager) APIKeyEnvVarName added in v1.7.6

func (c *Manager) APIKeyEnvVarName() string

func (*Manager) DeleteThread added in v1.7.6

func (c *Manager) DeleteThread(thread string) error

DeleteThread removes the specified thread from the configuration store. This operation is idempotent; non-existent threads do not cause errors.

func (*Manager) ListThreads added in v1.7.6

func (c *Manager) ListThreads() ([]string, error)

ListThreads retrieves a list of all threads stored in the configuration. It marks the current thread with an asterisk (*) and returns the list sorted alphabetically. If an error occurs while retrieving the threads from the config store, it returns the error.

func (*Manager) ShowConfig added in v1.7.6

func (c *Manager) ShowConfig() (string, error)

ShowConfig serializes the current configuration to a YAML string. It returns the serialized string or an error if the serialization fails.

func (*Manager) WithEnvironment added in v1.7.6

func (c *Manager) WithEnvironment() *Manager

type Store added in v1.7.6

type Store interface {
	Delete(string) error
	List() ([]string, error)
	Read() (Config, error)
	ReadDefaults() Config
	Write(Config) error
}

Jump to

Keyboard shortcuts

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