settings

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRuntimeKind = RuntimeGhostline

DefaultRuntimeKind is used when neither the settings file nor --runtime selects one.

View Source
const (
	RuntimeGhostline = "ghostline"
)

Runtime kinds supported by the headless daemon.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns the conventional settings file location.

func Save

func Save(path string, value Settings) error

Save persists settings atomically.

func ValidateRuntimeEnv added in v0.12.0

func ValidateRuntimeEnv(runtimeEnv map[string]string) error

ValidateRuntimeEnv checks user-provided session overrides before they reach a PTY. Warren-owned binding variables must remain authoritative, and keys must follow the platform environment naming rules used by exec.Cmd.

Types

type PairedClient added in v0.13.0

type PairedClient struct {
	ClientID  string    `json:"clientID"`
	Name      string    `json:"name,omitempty"`
	TokenHash string    `json:"tokenHash"`
	CreatedAt time.Time `json:"createdAt"`
}

PairedClient is a scoped client credential issued by the Host pairing window. ClientID is stable for the device, while TokenHash is never sent to clients or included in discovery metadata.

type PublicTunnelSettings added in v0.12.0

type PublicTunnelSettings struct {
	Enabled        bool   `json:"enabled"`
	RouteID        string `json:"routeID,omitempty"`
	Owner          string `json:"owner,omitempty"`
	PublicHostname string `json:"publicHostname,omitempty"`
	PathPrefix     string `json:"pathPrefix,omitempty"`
	AuthMode       string `json:"authMode,omitempty"`
}

type RelaySettings added in v0.12.0

type RelaySettings struct {
	Enabled    bool   `json:"enabled"`
	URL        string `json:"url,omitempty"`
	HostID     string `json:"hostID,omitempty"`
	RouteID    string `json:"routeID,omitempty"`
	RelayKeyID string `json:"relayKeyID,omitempty"`
	RelayKey   string `json:"relayKey,omitempty"`
	LastError  string `json:"lastError,omitempty"`
}

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 for newly created session
	// shells. The daemon itself never applies these values to its process
	// environment. An empty value requests an unset in the session shell.
	RuntimeEnv map[string]string `json:"runtimeEnv,omitempty"`
	// Relay contains the non-secret Relay lifecycle and route metadata. The
	// canonical daemon token remains in token-file/platform credentials and is
	// never duplicated here.
	Relay        RelaySettings        `json:"relay,omitempty"`
	PublicTunnel PublicTunnelSettings `json:"publicTunnel,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"`
	// OpenAIBaseURL, OpenAIModel, and OpenAIKey configure the optional
	// capability used for automatic session titles. The key is never returned
	// by the settings APIs.
	OpenAIBaseURL      string `json:"openaiBaseURL,omitempty"`
	OpenAIModel        string `json:"openaiModel,omitempty"`
	OpenAIKey          string `json:"openaiKey,omitempty"`
	OpenAITitleEnabled bool   `json:"openaiTitleEnabled"`
	// PairedClients contains metadata for explicitly paired native clients.
	// Only a SHA-256 token hash is persisted; bearer tokens are returned once
	// over the temporary LAN pairing exchange and remain on the client.
	PairedClients []PairedClient `json:"pairedClients,omitempty"`
}

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 Load

func Load(path string) (Settings, error)

Load reads settings from path. A missing file yields defaults.

func (Settings) ApplyRuntimeEnv

func (s Settings) ApplyRuntimeEnv()

ApplyRuntimeEnv applies RuntimeEnv to the current process environment for callers that explicitly own that process. The Warren daemon does not call this helper: session overrides are passed to the session boundary instead.

func (Settings) Normalized

func (s Settings) Normalized() string

Normalized returns the effective default runtime kind.

Jump to

Keyboard shortcuts

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