app

package
v0.0.0-...-a766d22 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// These variables should be set during build time using -ldflags
	Version   = version.Version
	GitCommit = version.GitCommit
	BuildDate = version.BuildDate
)

Functions

func LoadFromEnv

func LoadFromEnv(fs *flag.FlagSet) error

LoadFromEnv loads configuration values from environment variables. Flag names are converted to uppercase with underscores (e.g., metrics-bind-address -> METRICS_BIND_ADDRESS).

func Start

func Start(getExtensionConfig GetExtensionConfig, migrationRunner MigrationRunner)

Types

type BootstrapConfig

type BootstrapConfig struct {
	Ctx      context.Context
	Manager  manager.Manager
	Router   *mux.Router
	DbClient dbpkg.Client
	Config   *Config
}

type Config

type Config struct {
	Metrics struct {
		Addr     string
		CertPath string
		CertName string
		CertKey  string
	}
	Webhook struct {
		CertPath string
		CertName string
		CertKey  string
	}
	Proxy struct {
		URL string
	}
	Auth struct {
		Mode        string
		UserIDClaim string
	}
	LeaderElection     bool
	ProbeAddr          string
	SecureMetrics      bool
	EnableHTTP2        bool
	DefaultModelConfig types.NamespacedName
	HttpServerAddr     string
	WatchNamespaces    string
	A2ABaseUrl         string

	// MCPEgressPlaintext, when set, gates the egress URL rewrite: agent tool
	// URLs and the controller's tool-discovery dial that point at a
	// RemoteMCPServer are rewritten from https://host[:port] to
	// http://host:<port-or-443> so traffic egresses in plaintext to a proxy
	// that originates TLS upstream. Off by default;
	MCPEgressPlaintext bool
	Database           struct {
		Url           string
		UrlFile       string
		VectorEnabled bool
	}
	Openshell struct {
		GatewayURL  string
		Token       string
		TokenFile   string
		CAFile      string
		Insecure    bool
		DialTimeout time.Duration
		CallTimeout time.Duration
	}
	Substrate struct {
		AteAPIEndpoint             string
		AteAPITokenFile            string
		AtenetRouterURL            string
		Insecure                   bool
		DialTimeout                time.Duration
		CallTimeout                time.Duration
		DefaultWorkerPoolNamespace string
		DefaultWorkerPoolName      string
		PauseImage                 string
		RunscAMD64URL              string
		RunscAMD64SHA256           string
		RunscARM64URL              string
		RunscARM64SHA256           string
	}
}

func (*Config) SetFlags

func (cfg *Config) SetFlags(commandLine *flag.FlagSet)

type CtrlManagerConfigFunc

type CtrlManagerConfigFunc func(manager.Manager) error

type ExtensionConfig

type ExtensionConfig struct {
	Authenticator    auth.AuthProvider
	Authorizer       auth.Authorizer
	AgentPlugins     []agent_translator.TranslatorPlugin
	MCPServerPlugins []translator.MCPTranslatorPlugin
	SandboxBackend   sandboxbackend.Backend
}

type GetExtensionConfig

type GetExtensionConfig func(bootstrap BootstrapConfig) (*ExtensionConfig, error)

type MapValue

type MapValue struct {
	Target *map[string]string
}

MapValue implements flag.Value for a map[string]string. It parses comma-separated key=value pairs (e.g. "team=platform,env=prod").

func (*MapValue) Set

func (m *MapValue) Set(raw string) error

func (*MapValue) String

func (m *MapValue) String() string

type MigrationRunner

type MigrationRunner func(ctx context.Context, url string, vectorEnabled bool) error

MigrationRunner applies database migrations given the resolved connection URL. vectorEnabled mirrors the --database-vector-enabled flag; custom runners can use it to conditionally apply vector-specific migrations. Returning a non-nil error causes the app to exit.

Pass nil to Start to use the default migration runner (migrations.RunUp with migrations.FS). Provide a custom runner to take over the migration process entirely. Custom runners that want to include the built-in migrations can call migrations.RunUp directly.

Jump to

Keyboard shortcuts

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