Documentation
¶
Overview ¶
Package config parses and composes the first-slice Wirecmd configuration.
Index ¶
- func LoadEffectiveSources(paths []string, discovered bool) (*Config, []*Source, error)
- func ValidateMaterializedServer(server Server) (string, error)
- type AgeIdentity
- type AgeSecrets
- type AgeSecretsSource
- type Config
- type Environment
- type GitRoot
- type HTTP
- type HTTPField
- type HTTPSource
- type HTTPTransportKind
- type JSONValue
- type LSP
- type LSPSelector
- type LSPSource
- type OAuth
- type OAuthSource
- type Provenance
- type ResolvedValue
- type Root
- type Scope
- type Secrets
- type SecretsSource
- type Server
- type ServerSource
- type Source
- type Stdio
- type StdioSource
- type Value
- type ValueKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadEffectiveSources ¶ added in v0.5.0
LoadEffectiveSources loads and composes paths while also returning the exact parsed sources from that same read. Runtime context resolution uses the source list to distinguish the nearest workspace declaration from weaker roots without reopening configuration files.
func ValidateMaterializedServer ¶ added in v0.5.0
ValidateMaterializedServer checks destinations whose syntax can only be validated after invocation-context templates have been expanded.
Types ¶
type AgeIdentity ¶ added in v0.4.0
type AgeIdentity struct {
Path string
Provenance
}
AgeIdentity identifies one user-managed age identity file.
type AgeSecrets ¶ added in v0.4.0
type AgeSecrets struct {
Identities []AgeIdentity
Provenance Provenance
}
AgeSecrets configures the fixed age executable's identity files.
type AgeSecretsSource ¶ added in v0.4.0
type AgeSecretsSource struct {
Identities []AgeIdentity
Provenance Provenance
}
AgeSecretsSource is a potentially partial age configuration layer. A non-empty identity list replaces weaker lists during composition.
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/config.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 GitRoot ¶ added in v0.5.0
type GitRoot struct {
Enabled bool
Provenance
}
GitRoot controls whether automatic invocation-context resolution may use the current Git worktree as an implicit project-root candidate.
type HTTP ¶
type HTTP struct {
Kind HTTPTransportKind
Endpoint Value
EndpointProvenance Provenance
Query []HTTPField
Headers []HTTPField
OAuth *OAuth
Provenance
}
HTTP describes one complete HTTP-family 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 {
Kind HTTPTransportKind
Endpoint *Value
EndpointProvenance Provenance
Query []HTTPField
Headers []HTTPField
OAuth *OAuthSource
Provenance
}
HTTPSource is a potentially partial HTTP-family transport layer. A present source selects its transport even when it omits the endpoint to inherit one from a weaker layer of the same kind.
type HTTPTransportKind ¶ added in v0.3.0
type HTTPTransportKind string
HTTPTransportKind identifies the protocol carried by an HTTP endpoint. Its zero value is Streamable HTTP so existing programmatic HTTP configuration remains compatible.
const ( HTTPTransportHTTP HTTPTransportKind = "" HTTPTransportSSE HTTPTransportKind = "sse" )
type JSONValue ¶ added in v0.5.0
type JSONValue struct {
Raw []byte
Template bool
Provenance
}
JSONValue is one validated arbitrary JSON value. Template marks a document whose string values require invocation-context materialization.
type LSP ¶
type LSP struct {
Name string
Scope Scope
ScopeProvenance Provenance
ImplementationID string
ImplementationIDProvenance Provenance
Selectors []LSPSelector
InitializationOptions *JSONValue
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
InitializationOptions *JSONValue
Stdio *StdioSource
Provenance
}
LSPSource is a potentially partial language-server layer.
type OAuth ¶
type OAuth struct {
ClientID Value
ClientIDProvenance Provenance
ClientSecret *Value
RedirectURI Value
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 *Value
ClientIDProvenance Provenance
ClientSecret *Value
RedirectURI *Value
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 Secrets ¶ added in v0.4.0
type Secrets struct {
Age *AgeSecrets
}
Secrets is the complete secret-provider configuration consumed by secret resolution. Nil providers are not configured.
type SecretsSource ¶ added in v0.4.0
type SecretsSource struct {
Age *AgeSecretsSource
Provenance Provenance
}
SecretsSource is a potentially partial secret-provider configuration layer.
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
GitRoot *GitRoot
Secrets *SecretsSource
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 LoadDiscovered ¶ added in v0.5.0
LoadDiscovered safely loads one automatically discovered workspace source. It rejects symlinks and pathname replacement while retaining the opened file descriptor used for parsing.
func ParseString ¶
ParseString is Parse for source text already held in memory.
type Stdio ¶
type Stdio struct {
Command Value
CommandProvenance Provenance
Args []Value
Env []Environment
Provenance
}
Stdio describes one complete local command transport.
type StdioSource ¶
type StdioSource struct {
Command *Value
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, secret reference, or context template.
func (Value) IsTemplate ¶ added in v0.5.0
IsTemplate reports whether the value requires invocation-context expansion.