config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config owns environment parsing and validated process configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobCache

type BlobCache struct {
	Directory string
	MaxBytes  int64
}

BlobCache configures the disposable local large-value cache.

type Config

type Config struct {
	HTTP      *HTTP
	Events    *Events
	Dex       *Dex
	BlobCache *BlobCache
	MCP       *MCP
	Providers *Providers
}

Config is the immutable validated application configuration.

func Load

func Load() (*Config, error)

Load reads and validates process configuration.

func (*Config) Validate

func (config *Config) Validate() error

Validate rejects unsafe or unusable process configuration.

type Dex

type Dex struct {
	FlowServiceAddress string
	WorkerBindAddress  string
	WorkerTarget       string
}

Dex configures the FlowService and application Worker.

type EnvironmentVariable

type EnvironmentVariable string

EnvironmentVariable identifies one supported process setting.

const (
	EnvHTTPAddress           EnvironmentVariable = "SUPERAGENT_HTTP_ADDRESS"
	EnvHTTPAllowedOrigins    EnvironmentVariable = "SUPERAGENT_HTTP_ALLOWED_ORIGINS"
	EnvStreamRecoveryLimit   EnvironmentVariable = "SUPERAGENT_STREAM_RECOVERY_LIMIT"
	EnvDexFlowServiceAddress EnvironmentVariable = "DEX_FLOW_SERVICE_ADDRESS"
	EnvDexWorkerBindAddress  EnvironmentVariable = "DEX_WORKER_BIND_ADDRESS"
	EnvDexWorkerTarget       EnvironmentVariable = "DEX_WORKER_TARGET"
	EnvBlobCacheDirectory    EnvironmentVariable = "DEX_BLOB_CACHE_DIR"
	EnvBlobCacheMaxBytes     EnvironmentVariable = "DEX_BLOB_CACHE_MAX_BYTES"
	EnvMCPConfig             EnvironmentVariable = "DEX_AGENT_MCP_CONFIG"
	EnvOpenAIAPIKey          EnvironmentVariable = "OPENAI_API_KEY"    //nolint:gosec // Environment variable name, not a credential.
	EnvAnthropicAPIKey       EnvironmentVariable = "ANTHROPIC_API_KEY" //nolint:gosec // Environment variable name, not a credential.
	EnvGeminiAPIKey          EnvironmentVariable = "GEMINI_API_KEY"    //nolint:gosec // Environment variable name, not a credential.
	EnvGroqAPIKey            EnvironmentVariable = "GROQ_API_KEY"      //nolint:gosec // Environment variable name, not a credential.
	EnvOpenAIBaseURL         EnvironmentVariable = "OPENAI_BASE_URL"
	EnvAnthropicBaseURL      EnvironmentVariable = "ANTHROPIC_BASE_URL"
	EnvGeminiBaseURL         EnvironmentVariable = "GEMINI_BASE_URL"
	EnvGroqBaseURL           EnvironmentVariable = "GROQ_BASE_URL"
)

type Events added in v0.2.0

type Events struct {
	// RecoveryLimit defaults to 1000, accepts 1 through 1000, is immutable, and bounds refresh recovery per Stream.
	RecoveryLimit int
}

Events configures best-effort Stream recovery reads.

type HTTP

type HTTP struct {
	Address           string
	AllowedOrigins    []Origin
	ReadHeaderTimeout time.Duration
	IdleTimeout       time.Duration
	ShutdownTimeout   time.Duration
}

HTTP configures the public OpenAPI server.

type Lookup

type Lookup func(string) (string, bool)

Lookup reads one environment variable.

type MCP

type MCP struct {
	ConfigPath string
}

MCP configures optional trusted MCP discovery.

type Origin

type Origin string

Origin is one canonical browser origin allowed to call the API.

type Provider

type Provider struct {
	APIKey  string
	BaseURL string
}

Provider contains one provider's process credential and optional origin override.

type Providers

type Providers struct {
	OpenAI         *Provider
	Anthropic      *Provider
	Gemini         *Provider
	Groq           *Provider
	RequestTimeout time.Duration
}

Providers configures credentials and trusted API origins.

Jump to

Keyboard shortcuts

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