launchcfg

package
v1.5.132 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package launchcfg owns the provider-facing part of launch configuration that every Golder front-end shares. It deliberately stops before run assembly: the CLI, TUI and GUI may build different views, but they must agree on flag/file precedence and on where a credential came from.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalProviderName added in v1.5.79

func CanonicalProviderName(name string) string

CanonicalProviderName resolves aliases before looking up saved settings.

func LegacyProviderName added in v1.5.79

func LegacyProviderName(cfg config.FileConfig) string

LegacyProviderName identifies the owner of pre-profile connection settings.

func ProviderConnection added in v1.5.79

func ProviderConnection(cfg config.FileConfig, name string) (config.ProviderProfile, string, bool)

ProviderConnection returns the settings owned by name. The legacy literal key is returned separately and must not be displayed or copied to a profile.

func SavedProviderProfile added in v1.5.79

func SavedProviderProfile(cfg config.FileConfig, name string) (config.ProviderProfile, bool)

SavedProviderProfile looks up a provider's saved settings. A protocol previously pinned to a different default no longer applies.

Types

type Changed

type Changed func(name string) bool

Changed reports whether a command-line flag was explicitly supplied. A nil function means no flag was supplied, which is what a settings-only GUI uses.

type CredentialResult

type CredentialResult struct {
	Status   CredentialStatus
	Warnings []string
	// contains filtered or unexported fields
}

CredentialResult is the launch-time credential resolution. A value is returned only for an explicit value or a successfully loaded named reference; ambient environment credentials stay ambient and are read by CredentialStore.

func ResolveCredential

func ResolveCredential(providerName, apiKey, credentialRef string) CredentialResult

ResolveCredential applies the shared static credential precedence: explicit/config api_key > named credential > inherited provider environment. A broken named reference warns and falls through to the environment, matching the CLI's historical behavior.

func (CredentialResult) ResolvedValue

func (r CredentialResult) ResolvedValue() string

ResolvedValue returns the launch-only secret for passing into the provider store. Callers must not display or persist it.

type CredentialSource

type CredentialSource string

CredentialSource is safe display metadata. It never contains the credential.

const (
	CredentialMissing     CredentialSource = "missing"
	CredentialExplicit    CredentialSource = "explicit"
	CredentialNamed       CredentialSource = "named"
	CredentialEnvironment CredentialSource = "environment"
)

type CredentialStatus

type CredentialStatus struct {
	Available bool
	Source    CredentialSource
	// Name is the named-credential reference when Source is named.
	Name string
	// EnvVar is the inherited environment variable when Source is environment.
	EnvVar string
}

CredentialStatus tells a UI whether authentication is available and where it came from, without revealing a value.

type Values

type Values struct {
	Model         string
	Provider      string
	BaseURL       string
	Protocol      string
	APIKey        string
	CredentialRef string
	ThinkingLevel string
}

Values is the provider-facing launch state after defaults but before the config file is overlaid. APIKey is secret and must never be formatted or logged; the other fields are ordinary settings.

func Overlay

func Overlay(v Values, cfg config.FileConfig, changed Changed) Values

Overlay applies the shared CLI > config.toml > built-in precedence for the provider-facing fields. A literal api_key wins over a named reference for backward compatibility, but new writers should save only CredentialRef.

Jump to

Keyboard shortcuts

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