config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ButlerConfig

type ButlerConfig struct {
	Enabled          *bool               `json:"enabled"` // nil treated as true (kill switch)
	Project          ProjectMeta         `json:"project"`
	Capabilities     Capabilities        `json:"capabilities"`
	DocPaths         []string            `json:"doc_paths"`
	Upstream         []UpstreamDep       `json:"upstream"`
	Synthesis        SynthesisConfig     `json:"synthesis"`
	ShadowRepo       string              `json:"shadow_repo"`
	Thresholds       map[string]float64  `json:"thresholds"`
	MaxDailyLLMCalls int                 `json:"max_daily_llm_calls"`
	ResearchBrief    ResearchBriefConfig `json:"research_brief"`
}

func DefaultConfig

func DefaultConfig() ButlerConfig

func Parse

func Parse(data []byte) (ButlerConfig, error)

func (ButlerConfig) IsEnabled

func (c ButlerConfig) IsEnabled() bool

IsEnabled returns false only when Enabled is explicitly set to false.

func (ButlerConfig) Validate added in v0.1.1

func (c ButlerConfig) Validate() []string

Validate checks a ButlerConfig for common misconfigurations and returns a list of warnings. An empty list means the config is valid.

type Cache

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

Cache provides a TTL-based cache for butler config.

func NewCache

func NewCache(ttl time.Duration, fetch FetchFunc) *Cache

NewCache creates a new config cache with the given TTL and fetch function.

func (*Cache) Get

func (c *Cache) Get() (ButlerConfig, error)

Get returns the cached config, fetching it if the cache is stale or empty.

func (*Cache) Invalidate

func (c *Cache) Invalidate()

Invalidate forces the next Get() call to re-fetch.

type Capabilities

type Capabilities struct {
	Triage         bool `json:"triage"`
	Research       bool `json:"research"`
	Synthesis      bool `json:"synthesis"`
	AutoIngest     bool `json:"auto_ingest"`
	CodeNavigation bool `json:"code_navigation"`
}

type FetchFunc

type FetchFunc func() ([]byte, error)

FetchFunc fetches the raw config file content. Returns nil, nil if the file doesn't exist.

type ProjectMeta added in v0.1.1

type ProjectMeta struct {
	Name         string `json:"name"`          // human-readable project name (e.g. "Teams for Linux")
	Description  string `json:"description"`   // architecture description for research prompts
	DocsURL      string `json:"docs_url"`      // base URL for project documentation site
	DebugCommand string `json:"debug_command"` // shell command users run to capture debug logs
}

ProjectMeta holds per-repo metadata used to parameterize LLM prompts and bot output. Defaults match the teams-for-linux deployment for backward compatibility; other repos override these in their butler.json.

type ResearchBriefConfig added in v0.1.1

type ResearchBriefConfig struct {
	Enabled  bool   `json:"enabled"`
	HatsPath string `json:"hats_path"`
}

type SynthesisConfig

type SynthesisConfig struct {
	Frequency string `json:"frequency"`
	Day       string `json:"day"`
}

type UpstreamDep

type UpstreamDep struct {
	Repo    string `json:"repo"`
	DocType string `json:"doc_type"`
	Track   string `json:"track"`
}

Jump to

Keyboard shortcuts

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