config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

func Validate

func Validate(cfg *Config) error

Validate checks that a loaded config has sane values.

Types

type BudgetConfig

type BudgetConfig struct {
	PerSessionUSD float64 `yaml:"per_session_usd"`
	PerHourUSD    float64 `yaml:"per_hour_usd"`
	PerDayUSD     float64 `yaml:"per_day_usd"`
	WarnAtPercent int     `yaml:"warn_at_percent"`
}

type Config

type Config struct {
	Budget        BudgetConfig               `yaml:"budget"`
	SpinDetection SpinDetectionConfig        `yaml:"spin_detection"`
	Enforcement   EnforcementConfig          `yaml:"enforcement"`
	Notifications NotificationConfig         `yaml:"notifications"`
	Sources       SourcesConfig              `yaml:"sources"`
	Traces        TracesConfig               `yaml:"traces"`
	Logging       LoggingConfig              `yaml:"logging"`
	Pricing       map[string]PricingOverride `yaml:"pricing"`
}

func Default

func Default() *Config

func Load

func Load(path string) (*Config, error)

type EnforcementConfig

type EnforcementConfig struct {
	Action           string `yaml:"action"`
	SentinelFallback bool   `yaml:"sentinel_fallback"`
}

type LoggingConfig

type LoggingConfig struct {
	Level      string `yaml:"level"`
	File       string `yaml:"file"`
	MaxSizeMB  int    `yaml:"max_size_mb"`
	MaxBackups int    `yaml:"max_backups"`
	MaxAgeDays int    `yaml:"max_age_days"`
	Compress   bool   `yaml:"compress"`
}

type NotificationConfig

type NotificationConfig struct {
	Desktop bool `yaml:"desktop"`
	Sound   bool `yaml:"sound"`
}

type PricingOverride

type PricingOverride struct {
	InputPerMTok      float64 `yaml:"input_per_mtok"`
	OutputPerMTok     float64 `yaml:"output_per_mtok"`
	CacheReadPerMTok  float64 `yaml:"cache_read_per_mtok"`
	CacheWritePerMTok float64 `yaml:"cache_write_per_mtok"`
}

PricingOverride allows users to override or add model pricing in config.yaml. Values are in USD per million tokens.

type SourcesConfig

type SourcesConfig struct {
	ClaudeCode string   `yaml:"claude_code"`
	Codex      string   `yaml:"codex"`
	Gemini     string   `yaml:"gemini"`
	Custom     []string `yaml:"custom"`
}

type SpinDetectionConfig

type SpinDetectionConfig struct {
	RepeatedCalls      int     `yaml:"repeated_calls"`
	ErrorEcho          int     `yaml:"error_echo"`
	StallMinutes       int     `yaml:"stall_minutes"`
	CostVelocityPerMin float64 `yaml:"cost_velocity_per_min"`
	ContextFillPercent int     `yaml:"context_fill_percent"`
}

type TracesConfig

type TracesConfig struct {
	Enabled   bool   `yaml:"enabled"`
	OutputDir string `yaml:"output_dir"`
}

Jump to

Keyboard shortcuts

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