Documentation
¶
Overview ¶
Package config handles loading and validating the config.yaml configuration.
Index ¶
- Constants
- func ConfigPath() (string, error)
- func GitHubAuthConfigured(cfg GithubConfig) bool
- func GitHubAuthSource(cfg GithubConfig) string
- func GitLabAuthConfigured(cfg GitlabConfig) bool
- func GitLabAuthSource(cfg GitlabConfig) string
- func GlobalDBPath() (string, error)
- func GlobalDir() (string, error)
- func HarnessCredentialFields() map[string][]string
- func HarnessFieldAllowed(harness, key string) bool
- func HasGitHubCLI() bool
- func HasGlabCLI() bool
- func HasSentryCLI() bool
- func ListSentryCLIOrganizations(cfg SentryConfig) []string
- func LoadSecrets(cfg *Config, store SecretStore) error
- func NormalizeProjects(projects []string) []string
- func NormalizeSentryBaseURL(raw string) string
- func RunHarnessAction(ctx context.Context, runner adapter.HarnessActionRunner, ...) (adapter.HarnessActionResult, error)
- func SaveSecrets(cfg *Config, store SecretStore) error
- func SecretKeys() map[string]string
- func SentryAuthConfigured(cfg SentryConfig) bool
- func SentryAuthSource(cfg SentryConfig) string
- func SentryCLIEnvironment(baseURL string) []string
- func SentryRootURL(raw string) string
- func SessionsDir() (string, error)
- type AdaptersConfig
- type ClaudeCodeConfig
- type CodexConfig
- type CommitConfig
- type CommitMessageFormat
- type CommitStrategy
- type Config
- type ForemanConfig
- type GithubConfig
- type GitlabConfig
- type GlabConfig
- type HarnessConfig
- type HarnessName
- type HarnessPhaseConfig
- type LinearConfig
- type OSKeychainStore
- type OhMyPiConfig
- type PassThreshold
- type PlanConfig
- type RepoConfig
- type ResolvedSentryAuth
- type ResolvedSentryContext
- type ReviewConfig
- type SecretStore
- type SentryConfig
Constants ¶
const DefaultSentryBaseURL = "https://sentry.io/api/0"
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath returns the path to the configuration file.
func GitHubAuthConfigured ¶
func GitHubAuthConfigured(cfg GithubConfig) bool
func GitHubAuthSource ¶
func GitHubAuthSource(cfg GithubConfig) string
func GitLabAuthConfigured ¶
func GitLabAuthConfigured(cfg GitlabConfig) bool
GitLabAuthConfigured reports whether GitLab authentication is available. It mirrors GitHubAuthConfigured: a token in config, a keychain reference, or the glab CLI on PATH is sufficient.
func GitLabAuthSource ¶
func GitLabAuthSource(cfg GitlabConfig) string
GitLabAuthSource returns a human-readable label describing the active GitLab auth source ("config token", "glab cli", or "unset").
func GlobalDBPath ¶
GlobalDBPath returns the path to the global SQLite database.
func GlobalDir ¶
GlobalDir returns the path to the global Substrate directory. It respects the SUBSTRATE_HOME environment variable if set. Tilde (~) is expanded and relative paths are resolved to absolute.
func HarnessCredentialFields ¶
func HarnessFieldAllowed ¶
func HasGitHubCLI ¶
func HasGitHubCLI() bool
func HasSentryCLI ¶
func HasSentryCLI() bool
func ListSentryCLIOrganizations ¶
func ListSentryCLIOrganizations(cfg SentryConfig) []string
ListSentryCLIOrganizations returns the slugs of all Sentry organizations accessible via the authenticated sentry CLI. Returns nil when the CLI is not available or the call fails.
func LoadSecrets ¶
func LoadSecrets(cfg *Config, store SecretStore) error
func NormalizeProjects ¶
func NormalizeSentryBaseURL ¶
func RunHarnessAction ¶
func RunHarnessAction(ctx context.Context, runner adapter.HarnessActionRunner, req adapter.HarnessActionRequest) (adapter.HarnessActionResult, error)
func SaveSecrets ¶
func SaveSecrets(cfg *Config, store SecretStore) error
func SecretKeys ¶
func SentryAuthConfigured ¶
func SentryAuthConfigured(cfg SentryConfig) bool
func SentryAuthSource ¶
func SentryAuthSource(cfg SentryConfig) string
func SentryCLIEnvironment ¶
func SentryRootURL ¶
func SessionsDir ¶
SessionsDir returns the path to the sessions directory.
Types ¶
type AdaptersConfig ¶
type AdaptersConfig struct {
OhMyPi OhMyPiConfig `yaml:"ohmypi"`
ClaudeCode ClaudeCodeConfig `yaml:"claude_code"`
Codex CodexConfig `yaml:"codex"`
Linear LinearConfig `yaml:"linear"`
Glab GlabConfig `yaml:"glab"`
GitLab GitlabConfig `yaml:"gitlab"`
GitHub GithubConfig `yaml:"github"`
Sentry SentryConfig `yaml:"sentry"`
}
AdaptersConfig contains per-adapter configuration.
type ClaudeCodeConfig ¶
type CodexConfig ¶
type CommitConfig ¶
type CommitConfig struct {
Strategy CommitStrategy `yaml:"strategy"`
MessageFormat CommitMessageFormat `yaml:"message_format"`
MessageTemplate string `yaml:"message_template"`
}
CommitConfig controls agent commit behavior.
type CommitMessageFormat ¶
type CommitMessageFormat string
CommitMessageFormat controls the format of commit messages.
const ( CommitMessageAIGenerated CommitMessageFormat = "ai-generated" CommitMessageConventional CommitMessageFormat = "conventional" CommitMessageCustom CommitMessageFormat = "custom" )
type CommitStrategy ¶
type CommitStrategy string
CommitStrategy controls how often agents commit during a session.
const ( CommitStrategyGranular CommitStrategy = "granular" CommitStrategySemiRegular CommitStrategy = "semi-regular" CommitStrategySingle CommitStrategy = "single" )
type Config ¶
type Config struct {
Commit CommitConfig `yaml:"commit"`
Plan PlanConfig `yaml:"plan"`
Review ReviewConfig `yaml:"review"`
Harness HarnessConfig `yaml:"harness"`
Adapters AdaptersConfig `yaml:"adapters"`
Foreman ForemanConfig `yaml:"foreman"`
Repos map[string]RepoConfig `yaml:"repos"`
}
Config is the top-level configuration loaded from config.yaml.
type ForemanConfig ¶
type ForemanConfig struct {
QuestionTimeout string `yaml:"question_timeout"`
}
ForemanConfig controls the foreman question-answering system.
type GithubConfig ¶
type GithubConfig struct {
TokenRef string `yaml:"token_ref"` // optional keychain reference; gh auth token remains fallback
Token string `yaml:"-"`
BaseURL string `yaml:"base_url"` // default: https://api.github.com
Assignee string `yaml:"assignee"` // username filter for Watch; "me" resolves via /user
PollInterval string `yaml:"poll_interval"` // default: 60s
Reviewers []string `yaml:"reviewers"`
Labels []string `yaml:"labels"`
StateMappings map[string]string `yaml:"state_mappings"`
}
type GitlabConfig ¶
type GitlabConfig struct {
TokenRef string `yaml:"token_ref"` // keychain reference for GitLab REST API
Token string `yaml:"-"`
BaseURL string `yaml:"base_url"` // default: https://gitlab.com
Assignee string `yaml:"assignee"` // username filter for Watch
PollInterval string `yaml:"poll_interval"` // default: 60s
StateMappings map[string]string `yaml:"state_mappings"`
}
type GlabConfig ¶
type GlabConfig struct {
// Reviewers is a list of GitLab usernames added as reviewers to created MRs.
Reviewers []string `yaml:"reviewers"`
// Labels is a list of GitLab label names added to created MRs.
Labels []string `yaml:"labels"`
}
GlabConfig configures the glab CLI adapter. All fields are optional; the adapter is always registered regardless.
type HarnessConfig ¶
type HarnessConfig struct {
Default HarnessName `yaml:"default"`
Phase HarnessPhaseConfig `yaml:"phase"`
}
type HarnessName ¶
type HarnessName string
const ( HarnessOhMyPi HarnessName = "ohmypi" HarnessClaudeCode HarnessName = "claude-code" HarnessCodex HarnessName = "codex" )
type HarnessPhaseConfig ¶
type HarnessPhaseConfig struct {
Planning HarnessName `yaml:"planning"`
Implementation HarnessName `yaml:"implementation"`
Review HarnessName `yaml:"review"`
Foreman HarnessName `yaml:"foreman"`
}
type LinearConfig ¶
type LinearConfig struct {
APIKeyRef string `yaml:"api_key_ref"`
APIKey string `yaml:"-"` //nolint:gosec // credential field name, not a hardcoded value
TeamID string `yaml:"team_id"`
AssigneeFilter string `yaml:"assignee_filter"` // "me" or explicit user ID
PollInterval string `yaml:"poll_interval"` // e.g. "30s"; default "30s"
StateMappings map[string]string `yaml:"state_mappings"` // TrackerState -> Linear workflow state UUID
}
LinearConfig configures the Linear GraphQL adapter.
type OSKeychainStore ¶
type OSKeychainStore struct{}
func (OSKeychainStore) Delete ¶
func (OSKeychainStore) Delete(key string) error
func (OSKeychainStore) Set ¶
func (OSKeychainStore) Set(key, value string) error
type OhMyPiConfig ¶
type OhMyPiConfig struct {
BunPath string `yaml:"bun_path"`
BridgePath string `yaml:"bridge_path"`
ThinkingLevel string `yaml:"thinking_level"`
}
OhMyPiConfig configures the oh-my-pi agent harness.
type PassThreshold ¶
type PassThreshold string
PassThreshold controls how strict the review pipeline is.
const ( PassThresholdNitOnly PassThreshold = "nit_only" PassThresholdMinorOK PassThreshold = "minor_ok" PassThresholdNoCritiques PassThreshold = "no_critiques" )
type PlanConfig ¶
type PlanConfig struct {
MaxParseRetries *int `yaml:"max_parse_retries"`
}
PlanConfig controls the planning pipeline.
type RepoConfig ¶
type RepoConfig struct {
// DocPaths are documentation paths to include in planning context.
DocPaths []string `yaml:"doc_paths"`
}
RepoConfig contains per-repo overrides.
type ResolvedSentryAuth ¶
type ResolvedSentryAuth struct {
Token string
BaseURL string
Organization string
Projects []string
Source string
UseCLI bool
}
func ResolveSentryAuth ¶
func ResolveSentryAuth(ctx context.Context, cfg SentryConfig) (ResolvedSentryAuth, error)
type ResolvedSentryContext ¶
func ResolveSentryContext ¶
func ResolveSentryContext(cfg SentryConfig) ResolvedSentryContext
type ReviewConfig ¶
type ReviewConfig struct {
PassThreshold PassThreshold `yaml:"pass_threshold"`
MaxCycles *int `yaml:"max_cycles"`
Timeout *string `yaml:"timeout"`
AutoFeedbackLoop *bool `yaml:"auto_feedback_loop"`
}
ReviewConfig controls the review pipeline.
func (ReviewConfig) ReviewTimeout ¶
func (r ReviewConfig) ReviewTimeout() time.Duration
ReviewTimeout returns the parsed review session timeout duration. Falls back to 1 hour if parsing fails.
type SecretStore ¶
type SentryConfig ¶
type SentryConfig struct {
TokenRef string `yaml:"token_ref"`
Token string `yaml:"-"`
BaseURL string `yaml:"base_url"`
BaseURLExplicit bool `yaml:"-"`
Organization string `yaml:"organization"`
Projects []string `yaml:"projects"`
}
func (*SentryConfig) UnmarshalYAML ¶
func (c *SentryConfig) UnmarshalYAML(value *yaml.Node) error