Documentation
¶
Overview ¶
Package chart knows the agent chart: where it lives, which version a Flux OCIRepository tracking the configured semver range resolves to right now, and the values.schema.json of that version — the contract every agent's values are validated against before anything is applied. The registry is the source of truth; an embedded copy of the schema (the chart version the service was built against) is the fallback when the registry cannot be reached, and the API says which one is in use.
Index ¶
Constants ¶
const ( SourceRegistry = "registry" SourceEmbedded = "embedded" )
Source names where a schema came from.
const EmbeddedSchemaVersion = "1.0.0"
EmbeddedSchemaVersion is the agent chart version whose values.schema.json is compiled into the binary (internal/chart/embedded/): the Generic chart 1.x values contract — one release renders a kagent.dev/v1alpha3 AgentTemplate plus the agent's muster RemoteMCPServer; skills are a list of commit- or digest-pinned sources (bundled $defs/skill.schema.json); `agent.harness`, `muster.url`, `muster.tools`, `muster.discovery`; none of the 0.x runtime keys. The copy is the chart's own values.schema.json at the commit that made the contract final (giantswarm/agent, chart-1-0-agenttemplate @ 82815864).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Info ¶
type Info struct {
// OCIURL is the chart's OCI URL as the OCIRepository carries it.
OCIURL string `json:"ociUrl"`
// Semver is the range the OCIRepository tracks (1.x: every 1.x release).
Semver string `json:"semver"`
// LatestVersion is the newest published version inside that range, or ""
// when the registry could not be read.
LatestVersion string `json:"latestVersion,omitempty"`
// SchemaVersion is the chart version whose values.schema.json validates
// agent values right now.
SchemaVersion string `json:"schemaVersion"`
// SchemaSource is registry or embedded.
SchemaSource string `json:"schemaSource"`
// ResolvedAt is when the registry was last read successfully.
ResolvedAt *time.Time `json:"resolvedAt,omitempty"`
// Error is the last registry error, when the embedded fallback is in use.
Error string `json:"error,omitempty"`
}
Info is what GET /info reports about the chart.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver reads the chart from the registry and caches the result.
func NewResolver ¶
func NewResolver(ociURL, semverRange string, refresh time.Duration, registry *oci.Registry, log *slog.Logger) (*Resolver, error)
NewResolver builds a resolver for ociURL tracking semverRange, re-reading the registry every refresh.
func (*Resolver) Schema ¶
Schema returns the current schema: the registry's for the latest version in range when it can be read (cached for the refresh period), else the embedded copy. It never fails: validation must work offline.
func (*Resolver) SemverRange ¶
SemverRange is the configured range.
type Schema ¶
Schema is a parsed values.schema.json with its provenance.
func EmbeddedSchema ¶
func EmbeddedSchema() Schema
EmbeddedSchema is the compiled-in values.schema.json of the agent chart at EmbeddedSchemaVersion — the offline fallback, and what tests validate with.