Documentation
¶
Overview ¶
Package settings provides configuration loading for Entire. This package is separate from cli to allow strategy package to import it without creating an import cycle (cli imports strategy).
Index ¶
- Constants
- func IsCheckpointsV2Enabled(ctx context.Context) bool
- func IsExternalAgentsEnabled(ctx context.Context) bool
- func IsFilteredFetchesEnabled(ctx context.Context) bool
- func IsPushV2RefsEnabled(ctx context.Context) bool
- func IsSetUp(ctx context.Context) bool
- func IsSetUpAndEnabled(ctx context.Context) bool
- func IsSetUpAny(ctx context.Context) bool
- func IsSummarizeEnabled(ctx context.Context) bool
- func Save(ctx context.Context, settings *EntireSettings) error
- func SaveLocal(ctx context.Context, settings *EntireSettings) error
- type CheckpointRemoteConfig
- type EntireSettings
- func (s *EntireSettings) GetCheckpointRemote() *CheckpointRemoteConfig
- func (s *EntireSettings) GetCommitLinking() string
- func (s *EntireSettings) IsCheckpointsV2Enabled() bool
- func (s *EntireSettings) IsFilteredFetchesEnabled() bool
- func (s *EntireSettings) IsPushSessionsDisabled() bool
- func (s *EntireSettings) IsPushV2RefsEnabled() bool
- func (s *EntireSettings) IsSummarizeEnabled() bool
- type PIISettings
- type RedactionSettings
Constants ¶
const ( // EntireSettingsFile is the path to the Entire settings file EntireSettingsFile = ".entire/settings.json" // EntireSettingsLocalFile is the path to the local settings override file (not committed) EntireSettingsLocalFile = ".entire/settings.local.json" )
const ( // CommitLinkingAlways auto-links commits to sessions without prompting. CommitLinkingAlways = "always" // CommitLinkingPrompt prompts the user on each commit (default for existing users). CommitLinkingPrompt = "prompt" )
Commit linking mode constants.
Variables ¶
This section is empty.
Functions ¶
func IsCheckpointsV2Enabled ¶ added in v0.5.2
IsCheckpointsV2Enabled checks if checkpoints v2 is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.
func IsExternalAgentsEnabled ¶ added in v0.5.0
IsExternalAgentsEnabled checks if external agent discovery is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.
func IsFilteredFetchesEnabled ¶ added in v0.5.5
IsFilteredFetchesEnabled checks if filtered fetches should be used. When enabled, filtered fetches always resolve remote names to URLs first so git does not persist promisor settings onto named remotes in local config. Returns false by default.
func IsPushV2RefsEnabled ¶ added in v0.5.4
IsPushV2RefsEnabled checks if pushing v2 refs is enabled in settings. Returns false by default if settings cannot be loaded or flags are missing.
func IsSetUp ¶ added in v0.4.6
IsSetUp returns true if Entire has been set up in the current repository. This checks if .entire/settings.json exists. Use this to avoid creating files/directories in repos where Entire was never enabled.
func IsSetUpAndEnabled ¶ added in v0.4.6
IsSetUpAndEnabled returns true if Entire is both set up and enabled. This checks if .entire/settings.json exists AND has enabled: true. Use this for hooks that should be no-ops when Entire is not active.
func IsSetUpAny ¶ added in v0.5.1
IsSetUpAny returns true if Entire has been set up in the current repository, checking both .entire/settings.json and .entire/settings.local.json. Use this to detect any prior setup, even if only local settings exist.
func IsSummarizeEnabled ¶
IsSummarizeEnabled checks if auto-summarize is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.
Types ¶
type CheckpointRemoteConfig ¶ added in v0.5.1
type CheckpointRemoteConfig struct {
Provider string // e.g., "github"
Repo string // e.g., "org/checkpoints-repo"
}
CheckpointRemoteConfig holds the structured checkpoint remote configuration. Stored in strategy_options.checkpoint_remote as {"provider": "github", "repo": "org/repo"}.
func (*CheckpointRemoteConfig) Owner ¶ added in v0.5.1
func (c *CheckpointRemoteConfig) Owner() string
Owner returns the owner portion of the repo field (before the slash). Returns empty string if the repo field doesn't contain a slash.
type EntireSettings ¶
type EntireSettings struct {
// Enabled indicates whether Entire is active. When false, CLI commands
// show a disabled message and hooks exit silently. Defaults to true.
Enabled bool `json:"enabled"`
// LocalDev indicates whether to use "go run" instead of the "entire" binary
// This is used for development when the binary is not installed
LocalDev bool `json:"local_dev,omitempty"`
// LogLevel sets the logging verbosity (debug, info, warn, error).
// Can be overridden by ENTIRE_LOG_LEVEL environment variable.
// Defaults to "info".
LogLevel string `json:"log_level,omitempty"`
// StrategyOptions contains strategy-specific configuration
StrategyOptions map[string]any `json:"strategy_options,omitempty"`
// AbsoluteGitHookPath embeds the full binary path in git hooks instead of
// bare "entire". This is needed for GUI git clients (Xcode, Tower, etc.)
// that don't source shell profiles and can't find "entire" on PATH.
AbsoluteGitHookPath bool `json:"absolute_git_hook_path,omitempty"`
// Telemetry controls anonymous usage analytics.
// nil = not asked yet (show prompt), true = opted in, false = opted out
Telemetry *bool `json:"telemetry,omitempty"`
// Redaction configures PII redaction behavior for transcripts and metadata.
Redaction *RedactionSettings `json:"redaction,omitempty"`
// CommitLinking controls how commits are linked to agent sessions.
// "always" = auto-link without prompting, "prompt" = ask on each commit.
// Defaults to "prompt" (preserves existing user behavior).
CommitLinking string `json:"commit_linking,omitempty"`
// ExternalAgents enables discovery and registration of external agent
// plugins (entire-agent-* binaries on $PATH). Defaults to false.
ExternalAgents bool `json:"external_agents,omitempty"`
// Deprecated: no longer used. Exists to tolerate old settings files
// that still contain "strategy": "auto-commit" or similar.
Strategy string `json:"strategy,omitempty"`
}
EntireSettings represents the .entire/settings.json configuration
func Load ¶
func Load(ctx context.Context) (*EntireSettings, error)
Load loads the Entire settings from .entire/settings.json, then applies any overrides from .entire/settings.local.json if it exists. Returns default settings if neither file exists. Works correctly from any subdirectory within the repository.
func LoadFromBytes ¶ added in v0.5.4
func LoadFromBytes(data []byte) (*EntireSettings, error)
LoadFromBytes parses settings from raw JSON bytes without merging local overrides. Use this when you have settings content from a non-file source (e.g., git show).
func LoadFromFile ¶ added in v0.3.12
func LoadFromFile(filePath string) (*EntireSettings, error)
LoadFromFile loads settings from a specific file path without merging local overrides. Returns default settings if the file doesn't exist. Use this when you need to display individual settings files separately.
func (*EntireSettings) GetCheckpointRemote ¶ added in v0.5.1
func (s *EntireSettings) GetCheckpointRemote() *CheckpointRemoteConfig
GetCheckpointRemote returns the configured checkpoint remote. Expects a structured object: {"provider": "github", "repo": "org/repo"}. Returns nil if not configured, wrong type, or missing required fields.
func (*EntireSettings) GetCommitLinking ¶ added in v0.4.8
func (s *EntireSettings) GetCommitLinking() string
GetCommitLinking returns the effective commit linking mode. Returns the explicit value if set, otherwise defaults to "prompt" to preserve existing user behavior.
func (*EntireSettings) IsCheckpointsV2Enabled ¶ added in v0.5.2
func (s *EntireSettings) IsCheckpointsV2Enabled() bool
IsCheckpointsV2Enabled checks if checkpoints v2 (dual-write to refs/entire/) is enabled. Returns false by default if the key is missing or not a bool.
func (*EntireSettings) IsFilteredFetchesEnabled ¶ added in v0.5.5
func (s *EntireSettings) IsFilteredFetchesEnabled() bool
IsFilteredFetchesEnabled checks if fetches should use --filter=blob:none. When enabled, filtered fetches always use resolved URLs rather than remote names to avoid persisting promisor settings onto named remotes.
func (*EntireSettings) IsPushSessionsDisabled ¶ added in v0.3.12
func (s *EntireSettings) IsPushSessionsDisabled() bool
IsPushSessionsDisabled checks if push_sessions is disabled in settings. Returns true if push_sessions is explicitly set to false.
func (*EntireSettings) IsPushV2RefsEnabled ¶ added in v0.5.4
func (s *EntireSettings) IsPushV2RefsEnabled() bool
IsPushV2RefsEnabled checks if pushing v2 refs is enabled. Requires both checkpoints_v2 and push_v2_refs to be true.
func (*EntireSettings) IsSummarizeEnabled ¶
func (s *EntireSettings) IsSummarizeEnabled() bool
IsSummarizeEnabled checks if auto-summarize is enabled in this settings instance.
type PIISettings ¶ added in v0.5.1
type PIISettings struct {
Enabled bool `json:"enabled"`
Email *bool `json:"email,omitempty"`
Phone *bool `json:"phone,omitempty"`
Address *bool `json:"address,omitempty"`
CustomPatterns map[string]string `json:"custom_patterns,omitempty"`
}
PIISettings configures PII detection categories. When Enabled is true, email and phone default to true; address defaults to false.
type RedactionSettings ¶ added in v0.5.1
type RedactionSettings struct {
PII *PIISettings `json:"pii,omitempty"`
}
RedactionSettings configures redaction behavior beyond the default secret detection.