settings

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveSettingsSources

func ActiveSettingsSources(cwd string, childArgs []string) ([]string, error)

func AuthLikeCustomHeaderNames

func AuthLikeCustomHeaderNames(value string) []string

AuthLikeCustomHeaderNames parses ANTHROPIC_CUSTOM_HEADERS using the same newline-delimited "Name: Value" shape Claude Code accepts and returns header names that should not be Claude-visible in third-party hidden mode. Values are deliberately ignored so diagnostics never expose secrets.

func CandidateSettingsPaths

func CandidateSettingsPaths(cwd string) []string

func ClaudeConfigHomeDir

func ClaudeConfigHomeDir() string

func DetectAPIKeyHelper

func DetectAPIKeyHelper(cwd string, childArgs []string) ([]string, error)

func GlobalConfigPath

func GlobalConfigPath() string

func MergeUserSettingsIntoCCWRAPSessionSettings

func MergeUserSettingsIntoCCWRAPSessionSettings(user map[string]any, ccwrapEnv map[string]string) (map[string]any, error)

Types

type EffectiveModelEnvResult

type EffectiveModelEnvResult struct {
	Env                          map[string]string `json:"env,omitempty"`
	KeySources                   map[string]string `json:"key_sources,omitempty"`
	ContributingSources          []string          `json:"contributing_sources,omitempty"`
	IgnoredProjectScopedModelEnv []EnvConflict     `json:"ignored_project_scoped_model_env,omitempty"`
}

EffectiveModelEnvResult captures model preference env that CCWRAP preserves as user intent while still running Claude Code in host-managed provider mode. These keys affect model/catalog defaults, not the provider/auth/network ownership path. Trusted settings follow the same pre-trust order as provider/auth; project/local model env is ignored before trust.

func EffectiveModelEnv

func EffectiveModelEnv(cwd string, childArgs []string, parentEnv []string) (*EffectiveModelEnvResult, error)

func EffectiveModelEnvFromInspection

func EffectiveModelEnvFromInspection(parentEnv []string, inspect *InspectionResult) (*EffectiveModelEnvResult, error)

type EffectiveProviderEnvResult

type EffectiveProviderEnvResult struct {
	Env                             map[string]string `json:"env,omitempty"`
	KeySources                      map[string]string `json:"key_sources,omitempty"`
	ContributingSources             []string          `json:"contributing_sources,omitempty"`
	IgnoredProjectScopedProviderEnv []EnvConflict     `json:"ignored_project_scoped_provider_env,omitempty"`
}

EffectiveProviderEnvResult captures the provider-routing/auth environment that CCWRAP should own when Claude Code is launched in host-managed mode. Trusted provider/auth settings follow Claude Code's pre-trust order: globalConfig, userSettings, flagSettings, then policySettings. Project and local settings are intentionally ignored for provider/auth keys because Claude Code strips them before trust has been established.

func EffectiveProviderEnv

func EffectiveProviderEnv(cwd string, childArgs []string, parentEnv []string) (*EffectiveProviderEnvResult, error)

func EffectiveProviderEnvFromInspection

func EffectiveProviderEnvFromInspection(parentEnv []string, inspect *InspectionResult) (*EffectiveProviderEnvResult, error)

type EffectiveProxyEnvResult

type EffectiveProxyEnvResult struct {
	Env                     map[string]string `json:"env,omitempty"`
	ContributingSources     []string          `json:"contributing_sources,omitempty"`
	IgnoredPolicyNetworkEnv []EnvConflict     `json:"ignored_policy_network_env,omitempty"`
}

func EffectiveProxyEnv

func EffectiveProxyEnv(cwd string, childArgs []string, parentEnv []string) (*EffectiveProxyEnvResult, error)

func EffectiveProxyEnvFromInspection

func EffectiveProxyEnvFromInspection(parentEnv []string, inspect *InspectionResult) (*EffectiveProxyEnvResult, error)

type EnvConflict

type EnvConflict struct {
	Source string   `json:"source"`
	Path   string   `json:"path"`
	Keys   []string `json:"keys"`
}

func DetectOverriddenNetworkEnv

func DetectOverriddenNetworkEnv(cwd string, childArgs []string) ([]EnvConflict, error)

func DetectPolicyNetworkEnv

func DetectPolicyNetworkEnv(cwd string, childArgs []string) ([]EnvConflict, error)

func DetectProxyAndCAConflicts

func DetectProxyAndCAConflicts(cwd string, childArgs []string) ([]EnvConflict, error)

func DetectUnsupportedEnv

func DetectUnsupportedEnv(cwd string, childArgs []string) ([]EnvConflict, error)

type InspectionResult

type InspectionResult struct {
	ParsedFlagSettings     *ParsedFlagSettings `json:"parsed_flag_settings,omitempty"`
	ActiveSources          []string            `json:"active_sources,omitempty"`
	OverriddenNetworkEnv   []EnvConflict       `json:"overridden_network_env,omitempty"`
	PolicyNetworkEnv       []EnvConflict       `json:"policy_network_env,omitempty"`
	UnsupportedEnv         []EnvConflict       `json:"unsupported_env,omitempty"`
	MalformedEnv           []MalformedEnvIssue `json:"malformed_env,omitempty"`
	APIKeyHelperHits       []string            `json:"api_key_helper_hits,omitempty"`
	DangerousShellSettings []EnvConflict       `json:"dangerous_shell_settings,omitempty"`
	CustomAuthHeaderEnv    []EnvConflict       `json:"custom_auth_header_env,omitempty"`
	ModelOverrideHits      []EnvConflict       `json:"model_override_hits,omitempty"`
	CCWRAPInternalEnvHits  []EnvConflict       `json:"ccwrap_internal_env_hits,omitempty"`
	// contains filtered or unexported fields
}

func InspectLaunch

func InspectLaunch(cwd string, childArgs []string) (*InspectionResult, error)

type MalformedEnvIssue

type MalformedEnvIssue struct {
	Source string `json:"source"`
	Path   string `json:"path"`
	Error  string `json:"error"`
}

type ParsedFlagSettings

type ParsedFlagSettings struct {
	OriginalArgValue string
	Path             string
	Inline           bool
	Settings         map[string]any
	RemainingArgs    []string
	SettingSources   *string
}

func ParseClaudeSettingsFlags

func ParseClaudeSettingsFlags(cwd string, childArgs []string) (*ParsedFlagSettings, error)

Jump to

Keyboard shortcuts

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