Documentation
¶
Index ¶
- Constants
- func BuiltInGnarEdge() string
- func ConfiguredGnarAccount(value string) string
- func DefaultGnarAccountForHost(hostName string) string
- func DefaultPath() string
- func EffectiveGnarAccount(configured, hostName string) string
- func NormalizeConfiguredGnarAccount(value string) (string, error)
- func NormalizedGnarAccount(value string) string
- func Save(path string, value Settings) error
- type Settings
Constants ¶
const DefaultGnarAccount = "warren"
DefaultGnarAccount is the last-resort account label used when the host name cannot be converted to a gnar v1.7 account name. It is a label only; gnar owns the account token.
const DefaultRuntimeKind = RuntimeGhostline
DefaultRuntimeKind is used when neither the settings file nor --runtime selects one.
const MaxGnarAccountLength = 16
MaxGnarAccountLength is enforced by gnar v1.7 for account names.
const (
RuntimeGhostline = "ghostline"
)
Runtime kinds supported by the headless daemon.
Variables ¶
This section is empty.
Functions ¶
func BuiltInGnarEdge ¶
func BuiltInGnarEdge() string
BuiltInGnarEdge returns the Edge URL injected into the current Warren release. It is not persisted in settings, so upgrading Warren can change the default for users who have not configured an override.
func ConfiguredGnarAccount ¶
ConfiguredGnarAccount returns only the persisted user override. It never substitutes the system-name default, which lets callers distinguish an omitted account from an explicit override.
func DefaultGnarAccountForHost ¶
DefaultGnarAccountForHost converts a Warren Host/system name into the account syntax accepted by gnar v1.7. Non-ASCII and punctuation runs become a single hyphen; the result is trimmed and capped at 16 characters.
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the conventional settings file location.
func EffectiveGnarAccount ¶
EffectiveGnarAccount resolves a persisted override first, then the Warren Host/system name, and finally the safe fallback. HostName may be empty in embedded/test callers; os.Hostname supplies the platform value then.
func NormalizeConfiguredGnarAccount ¶
NormalizeConfiguredGnarAccount validates an explicitly configured account name against gnar v1.7's contract. gnar lowercases names itself, so Warren accepts uppercase input and stores the canonical lowercase form. Empty means that no user override is configured.
func NormalizedGnarAccount ¶
NormalizedGnarAccount returns a safe account label for the gnar CLI. Empty or malformed values retain the historical safe fallback; callers handling explicit user input should use NormalizeConfiguredGnarAccount so invalid values can be reported instead of silently changed.
Types ¶
type Settings ¶
type Settings struct {
// DefaultRuntime is the engine used for sessions created without an
// explicit runtimeKind. Ghostline is the only supported runtime.
DefaultRuntime string `json:"defaultRuntime"`
// RuntimeEnv overrides environment variables inherited by ghostline
// runtime children. It is applied after the
// daemon's built-in environment sanitization, so explicit values win;
// an empty value unsets the variable instead of passing an empty string.
RuntimeEnv map[string]string `json:"runtimeEnv,omitempty"`
// GnarEdge is the optional user-selected gnar Edge URL used for Public
// Access. Empty selects Warren's release/launcher default, which is
// https://tunnel.example.com in source builds and can be replaced at link
// time for a release.
GnarEdge string `json:"gnarEdge,omitempty"`
// GnarAccount is the non-secret account label passed to gnar login.
GnarAccount string `json:"gnarAccount,omitempty"`
// TunnelEnabled records which reachability adapters the user wants
// running. The daemon restores them after a restart so Public Access
// recovers until the user explicitly disables it.
TunnelEnabled map[string]bool `json:"tunnelEnabled,omitempty"`
// AutoOpenShell controls whether opening an empty workspace creates a
// default Shell session. Explicit New Session/Shell actions are unaffected.
AutoOpenShell bool `json:"autoOpenShell"`
// AutoStartAI controls whether entering an empty workspace starts the first
// AI preset. Explicit session actions are unaffected.
AutoStartAI bool `json:"autoStartAI"`
}
Settings is the headless daemon configuration. Runtime selection is a headless-side decision: it controls which engine owns newly created sessions, not what clients render.
func (Settings) ApplyRuntimeEnv ¶
func (s Settings) ApplyRuntimeEnv()
ApplyRuntimeEnv applies RuntimeEnv to the current process environment so runtime children inherit the configured values. Empty values unset the variable, which matters for tools that treat an empty override (for example GIT_PAGER=) as "disable paging" rather than "use the default".
func (Settings) Normalized ¶
Normalized returns the effective default runtime kind.