config

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config loads and version-routes .agentsmithy.yaml configs.

Each config schema version lives in its own sub-package (v1/, v2/, …) and satisfies the VersionSchema interface. The loader reads raw YAML, detects the "version" field, and delegates to the correct version.

Adding a new version:

  1. Create the vN/ sub-package satisfying VersionSchema
  2. Register it in the versions map in this file

Type aliases below re-export the latest version's types so that consumers can keep importing "internal/config" without change.

Index

Constants

View Source
const (
	// Provider keys mirroring v1.Provider*. Keeps callers off v1.
	ProviderOpenAI    = v1.ProviderOpenAI
	ProviderAnthropic = v1.ProviderAnthropic
	ProviderGoogle    = v1.ProviderGoogle
	ProviderBedrock   = v1.ProviderBedrock
	ProviderVertex    = v1.ProviderVertex
	ProviderBorrowed  = v1.ProviderBorrowed
)

Constant aliases; re-export values so consumers never import v1 directly.

Variables

View Source
var TypesSources = v1.TypesSources

TypesSources returns the raw Go source files for the latest version's types. Callers that only need the latest version can use this directly.

View Source
var Versions = map[string]VersionSchema{
	v1.Version: v1.Schema{},
}

Versions is the single source of truth for which schema versions are accepted. Each entry satisfies VersionSchema.

Functions

This section is empty.

Types

type Config

type Config = v1.Config

Type aliases: always point to the latest version.

func Parse

func Parse(data []byte) (*Config, error)

Parse parses raw YAML bytes, detects the version, delegates to the correct versioned parser, and converts the result to the latest Config type.

type ModelEntry

type ModelEntry = v1.ModelEntry

Type aliases: always point to the latest version.

type ModelRef

type ModelRef = v1.ModelRef

Type aliases: always point to the latest version.

type Models

type Models = v1.Models

Type aliases: always point to the latest version.

type Provider

type Provider = v1.Provider

Type aliases: always point to the latest version.

type VersionSchema

type VersionSchema interface {
	Parse([]byte) (*Config, error)
	RootType() any
	TypesSources() []string
}

VersionSchema is the contract each config version must satisfy. The Parse method must return the latest Config type (converting if needed).

Directories

Path Synopsis
Package schema provides tag-driven defaults and validation for config structs.
Package schema provides tag-driven defaults and validation for config structs.
Package v1 defines the v1 config schema types for .agentsmithy.yaml.
Package v1 defines the v1 config schema types for .agentsmithy.yaml.

Jump to

Keyboard shortcuts

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