Documentation
¶
Overview ¶
Package config parses and composes the first-slice Wirecmd configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is the complete source-syntax-independent configuration model consumed by execution.
func Compose ¶
Compose combines sources from weakest to strongest and validates the effective result. Scalars use the strongest present value. Named servers and environment entries retain first-introduction order while later sources replace matching entries.
func LoadEffective ¶
LoadEffective loads paths from weakest to strongest, composes their partial sources, and validates the resulting complete configuration.
func LoadEffectiveDiscovered ¶
LoadEffectiveDiscovered validates workspace wirecmd.kdl files without changing the behavior of trusted global or explicitly supplied files.
type Environment ¶
type Environment struct {
Name string
Value Value
Provenance
}
Environment assigns a value to a child process environment name.
type HTTP ¶
type HTTP struct {
Endpoint string
EndpointProvenance Provenance
Query []HTTPField
Headers []HTTPField
OAuth *OAuth
Provenance
}
HTTP describes one complete modern Streamable HTTP transport.
type HTTPField ¶
type HTTPField struct {
Name string
Value Value
Provenance
}
HTTPField is one named HTTP query or header value. Name retains the spelling from the source while composition uses the appropriate case-sensitivity for the field collection.
type HTTPSource ¶
type HTTPSource struct {
Endpoint *string
EndpointProvenance Provenance
Query []HTTPField
Headers []HTTPField
OAuth *OAuthSource
Provenance
}
HTTPSource is a potentially partial HTTP transport layer. A present source selects HTTP even when it omits the endpoint to inherit one from a weaker HTTP layer.
type LSP ¶
type LSP struct {
Name string
Scope Scope
ScopeProvenance Provenance
ImplementationID string
ImplementationIDProvenance Provenance
Selectors []LSPSelector
Stdio Stdio
Provenance
}
LSP is a named complete local language-server definition. Its name is a configuration and instance identity; routine LSP operations select matching effective workspace definitions rather than exposing a name as an argument.
type LSPSelector ¶
type LSPSelector struct {
LanguageID string
LanguageIDProvenance Provenance
Pattern string
PatternProvenance Provenance
Provenance Provenance
}
LSPSelector routes files matching Pattern to an LSP using LanguageID for text-document synchronization. Pattern is workspace-relative and uses doublestar path syntax.
type LSPSource ¶
type LSPSource struct {
Name string
Scope *Scope
ScopeProvenance Provenance
ImplementationID *string
ImplementationIDProvenance Provenance
Selectors []LSPSelector
Stdio *StdioSource
Provenance
}
LSPSource is a potentially partial language-server layer.
type OAuth ¶
type OAuth struct {
ClientID string
ClientIDProvenance Provenance
ClientSecret *Value
RedirectURI string
RedirectURIProvenance Provenance
Provenance
}
OAuth describes a complete preregistered OAuth client for an HTTP server. When OAuth is nil, execution may use dynamic client registration instead.
type OAuthSource ¶
type OAuthSource struct {
ClientID *string
ClientIDProvenance Provenance
ClientSecret *Value
RedirectURI *string
RedirectURIProvenance Provenance
Provenance
}
OAuthSource is a potentially partial preregistered OAuth client layer. ClientSecret is optional even in a complete OAuth configuration.
type Provenance ¶
Provenance identifies the configuration source and semantic location that supplied a model value.
type ResolvedValue ¶
ResolvedValue is a value ready for a destination. Sensitive marks values that must be kept out of normal diagnostics.
type Root ¶
type Root struct {
Path string
Provenance
}
Root is a configured workspace root. Resolving relative paths and applying caller overrides are daemon concerns, not configuration composition.
type Scope ¶
type Scope string
Scope identifies the context that owns a configured server instance.
const ( // ScopeWorkspace makes a server instance specific to its effective workspace. ScopeWorkspace Scope = "workspace" )
type Server ¶
type Server struct {
Name string
Scope Scope
ScopeProvenance Provenance
Stdio Stdio
HTTP *HTTP
Provenance
}
Server is a named complete configured capability source.
type ServerSource ¶
type ServerSource struct {
Name string
Scope *Scope
ScopeProvenance Provenance
Stdio *StdioSource
HTTP *HTTPSource
Provenance
}
ServerSource is a potentially partial server layer.
type Source ¶
type Source struct {
Root *Root
Servers []ServerSource
LSPs []LSPSource
Provenance
}
Source is one partially specified KDL configuration layer. It is valid for a source to omit fields that are supplied by a weaker layer.
func ParseString ¶
ParseString is Parse for source text already held in memory.
type Stdio ¶
type Stdio struct {
Command string
CommandProvenance Provenance
Args []Value
Env []Environment
Provenance
}
Stdio describes one complete local command transport.
type StdioSource ¶
type StdioSource struct {
Command *string
CommandProvenance Provenance
Args []Value
Env []Environment
Provenance
}
StdioSource is a potentially partial stdio layer. A non-empty Args slice replaces inherited arguments; Env entries merge by name.
type Value ¶
type Value struct {
Kind ValueKind
Text string
Provenance
}
Value is a textual literal or an annotated secret reference. Text is the literal text for ValueLiteral and the unresolved reference for ValueSecretReference.
func (Value) ResolveEnv ¶
ResolveEnv resolves the only first-slice secret provider, env://. lookup must preserve os.LookupEnv's distinction between an unset name and a name set to the empty string.