summaryrefslogtreecommitdiff
path: root/internal/appconfig/app_feature_sections.go
blob: da944d36b1b23b9aa93375e95225dd393b191c89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package appconfig

import "slices"

// This file provides fine-grained, read-only accessors for the individual
// feature subsystems embedded in FeatureConfig. They let a consumer depend on
// just the subsystem config it needs (e.g. the MCP server only needs MCPConfig)
// instead of receiving the whole App God-struct. Each accessor returns a deep
// copy so callers cannot mutate App's internal slices.

// IgnoreSection returns a copy of the gitignore-aware filtering settings.
func (a *App) IgnoreSection() IgnoreConfig {
	c := a.IgnoreConfig
	c.IgnoreExtraPatterns = slices.Clone(a.IgnoreExtraPatterns)
	return c
}

// StatsSection returns the usage statistics settings.
func (a *App) StatsSection() StatsConfig {
	return a.StatsConfig
}

// TmuxActionSection returns a copy of the tmux action menu settings.
func (a *App) TmuxActionSection() TmuxActionConfig {
	c := a.TmuxActionConfig
	c.TmuxActionMenu = append([]TmuxActionMenuEntry{}, a.TmuxActionMenu...)
	return c
}

// MCPSection returns the Model Context Protocol server settings.
func (a *App) MCPSection() MCPConfig {
	return a.MCPConfig
}