Documentation
¶
Overview ¶
Package config is the configuration layer: project config files, the SENIOR_DEV_* environment surface and their merge.
Index ¶
- Variables
- func FileInDirectory(dir, name string) []string
- func ParseBoolean(mode BoolMode, raw *string) bool
- func ParseJSONC(text, source string) (any, error)
- func ProjectFiles(name, directory, worktree string) []string
- func Substitute(input SubstituteInput) (string, error)
- type BoolMode
- type Env
- type Info
- type InvalidError
- type Loader
- type Lookup
- type OrderedEntry
- type OrderedObject
- type Service
- type SubstituteInput
Constants ¶
This section is empty.
Variables ¶
var VariableNames = []string{
"SENIOR_DEV_CLIENT",
"SENIOR_DEV_CONFIG",
"SENIOR_DEV_CONFIG_CONTENT",
"SENIOR_DEV_CONFIG_DIR",
"SENIOR_DEV_DISABLE_AUTOCOMPACT",
"SENIOR_DEV_DISABLE_MODELS_FETCH",
"SENIOR_DEV_DISABLE_PROJECT_CONFIG",
"SENIOR_DEV_DISABLE_PRUNE",
"SENIOR_DEV_EAGER_COMMIT",
"SENIOR_DEV_ENABLE_EXA",
"SENIOR_DEV_ENABLE_PARALLEL",
"SENIOR_DEV_ENABLE_QUESTION_TOOL",
"SENIOR_DEV_ENV_SIGNALS",
"SENIOR_DEV_EXPERIMENTAL",
"SENIOR_DEV_EXPERIMENTAL_EXA",
"SENIOR_DEV_EXPERIMENTAL_OXFMT",
"SENIOR_DEV_EXPERIMENTAL_PARALLEL",
"SENIOR_DEV_MODELS_PATH",
"SENIOR_DEV_MODELS_URL",
"SENIOR_DEV_OUTPUT_TOKEN_MAX",
"SENIOR_DEV_PERMISSION",
"SENIOR_DEV_SCRATCH_MAX_GB",
"SENIOR_DEV_SCRATCH_ROOT",
"SENIOR_DEV_SCRATCH_TTL_H",
"SENIOR_DEV_SHARED_BUILD_CACHE",
"SENIOR_DEV_WEBSEARCH_PROVIDER",
"SENIOR_DEV_MAX_COST_USD",
"SENIOR_DEV_MAX_WALL_H",
}
VariableNames is the environment surface the config layer snapshots. A variable not listed here is invisible to Env.Get.
Functions ¶
func FileInDirectory ¶
FileInDirectory returns the candidate paths for name, JSON before JSONC.
func ParseBoolean ¶
ParseBoolean applies one of the exact boolean comparisons. raw=nil represents an absent environment entry.
func ParseJSONC ¶
ParseJSONC parses comments and trailing commas while preserving the source path in errors.
func ProjectFiles ¶
ProjectFiles finds config files from the project boundary inward.
func Substitute ¶
func Substitute(input SubstituteInput) (string, error)
Substitute applies {env:VAR} and {file:path} substitutions. A file reference on a line that starts with // is left alone; a missing file is an error.
Types ¶
type BoolMode ¶
type BoolMode string
BoolMode identifies how a boolean environment variable is spelled. The spellings are deliberately asymmetric (an opt-out reads "0", an opt-in reads "1", a truthy flag reads "true"/"1"), so they are not replaced with strconv.ParseBool.
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env snapshots an environment without mutating the process-global map.
type Info ¶
Info is the deliberately open config object. The known fields sit next to several extensible record surfaces; retaining JSON values avoids lossy re-encoding during merges.
type InvalidError ¶
func (*InvalidError) Error ¶
func (e *InvalidError) Error() string
type OrderedEntry ¶
OrderedEntry is one insertion-ordered JSON object field.
type OrderedObject ¶
type OrderedObject struct {
// contains filtered or unexported fields
}
OrderedObject preserves source key order for the precedence-sensitive permission and tools objects.
func NewOrderedObject ¶
func NewOrderedObject() *OrderedObject
func NormalizePermission ¶
func NormalizePermission(value any) (*OrderedObject, bool)
NormalizePermission expands the action shorthand to the "*" rule.
func (*OrderedObject) Entries ¶
func (o *OrderedObject) Entries() []OrderedEntry
func (*OrderedObject) MarshalJSON ¶
func (o *OrderedObject) MarshalJSON() ([]byte, error)
func (*OrderedObject) Set ¶
func (o *OrderedObject) Set(key string, value any)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service caches per-directory config and supports explicit invalidation.