Help us shape the future of Go! Take the 2026 Go Developer Survey

appconfig

package
v0.11.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, cfg *Config, adapters *host.AdapterRegistry, registry *tools.Registry, workspaces *workspace.Registry) error

func ApplySkillLookups

func ApplySkillLookups(_ context.Context, cfg *Config, registry *skills.Registry) error

func ApplySkillProviders

func ApplySkillProviders(_ context.Context, cfg *Config, registry *skills.Registry, packageStores *skills.PackageStoreRegistry) error

func ApplyWithOptions

func ApplyWithOptions(ctx context.Context, cfg *Config, adapters *host.AdapterRegistry, registry *tools.Registry, workspaces *workspace.Registry, options ApplyOptions) error

func EventCallbackSink

func EventCallbackSink(cfg *Config, client *http.Client) engine.EventSink

EventCallbackSink builds the app-scoped HTTP delivery sink from the resolved application configuration. Apps without event_callbacks do not receive HTTP events; global log/NATS delivery is configured independently.

func HasEventProtocolV2

func HasEventProtocolV2(cfg *Config) bool

HasEventProtocolV2 reports whether any configured host app requires the v2 publisher. Callers use it to reject a startup that would otherwise persist v2 events without delivering them to the host projection.

func ModelCredentialManager

func ModelCredentialManager(cfg *Config, store agentcore.Store) (*modelauth.Manager, error)

func RequiresRunModelCredentials

func RequiresRunModelCredentials(cfg *Config, appID string) bool

RequiresRunModelCredentials reads trusted per-app policy. Omitted policy preserves standalone and existing host integrations' default-key behavior.

func ResolveTokenEnv

func ResolveTokenEnv(cfg *Config, getenv func(string) string)

func UsesEventProtocolV2

func UsesEventProtocolV2(cfg *Config, appID string) bool

UsesEventProtocolV2 reports whether an app opted into the durable ordered event protocol. An omitted value deliberately remains v1 for compatibility.

func Validate

func Validate(cfg *Config) error

func ValidateRunModelEndpoint

func ValidateRunModelEndpoint(cfg *Config, appID string, model *sdk.RunModel) error

ValidateRunModelEndpoint checks trusted app policy before admission and recovery.

Types

type App

type App struct {
	ModelEndpoints             []ModelEndpoint          `json:"model_endpoints,omitempty" yaml:"model_endpoints,omitempty"`
	RequireRunModelCredentials bool                     `json:"require_run_model_credentials,omitempty" yaml:"require_run_model_credentials,omitempty"`
	ModelCredentialCallback    *ModelCredentialCallback `json:"model_credential_callback,omitempty" yaml:"model_credential_callback,omitempty"`
	AppID                      string                   `json:"app_id" yaml:"app_id"`
	EventProtocol              string                   `json:"event_protocol,omitempty" yaml:"event_protocol,omitempty"`
	ContextEndpoint            string                   `json:"context_endpoint,omitempty" yaml:"context_endpoint,omitempty"`
	ContextToken               string                   `json:"context_token,omitempty" yaml:"context_token,omitempty"`
	ContextTokenEnv            string                   `json:"context_token_env,omitempty" yaml:"context_token_env,omitempty"`
	EventCallbacks             []EventCallback          `json:"event_callbacks,omitempty" yaml:"event_callbacks,omitempty"`
	MCPProviders               []MCPProvider            `json:"mcp_providers,omitempty" yaml:"mcp_providers,omitempty"`
	WorkspaceProvider          *WorkspaceProvider       `json:"workspace_provider,omitempty" yaml:"workspace_provider,omitempty"`
	SkillProvider              *SkillProvider           `json:"skill_provider,omitempty" yaml:"skill_provider,omitempty"`
	Browser                    *BrowserConfig           `json:"browser,omitempty" yaml:"browser,omitempty"`
}

type AppHealth

type AppHealth struct {
	AppID      string            `json:"app_id"`
	Components []ComponentHealth `json:"components"`
}

func CheckApp

func CheckApp(ctx context.Context, cfg *Config, appID string, client *http.Client) (*AppHealth, error)

type AppSummary

type AppSummary struct {
	ModelEndpoints             []sdk.ModelEndpoint `json:"model_endpoints,omitempty"`
	RequireRunModelCredentials bool                `json:"require_run_model_credentials"`
	AppID                      string              `json:"app_id"`
	Components                 []ComponentSummary  `json:"components"`
}

func Summaries

func Summaries(cfg *Config) []AppSummary

func SummaryForApp

func SummaryForApp(cfg *Config, appID string) *AppSummary

type ApplyOptions

type ApplyOptions struct {
	// ContinueOnRequiredProviderFailure lets a process boot while background
	// discovery works to make the provider catalog ready.
	ContinueOnRequiredProviderFailure bool
	RequiredProviderStartupTimeout    time.Duration
}

type ArtifactProvider

type ArtifactProvider struct {
	Transport      string `json:"transport,omitempty" yaml:"transport,omitempty"`
	UploadEndpoint string `json:"upload_endpoint" yaml:"upload_endpoint"`
	Token          string `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv       string `json:"token_env,omitempty" yaml:"token_env,omitempty"`
}

type BrowserConfig

type BrowserConfig struct {
	Enabled          bool              `json:"enabled" yaml:"enabled"`
	AllowedDomains   []string          `json:"allowed_domains,omitempty" yaml:"allowed_domains,omitempty"`
	ArtifactProvider *ArtifactProvider `json:"artifact_provider,omitempty" yaml:"artifact_provider,omitempty"`
}

BrowserConfig opts one host application into the shared browser runtime. Policy and artifact persistence are app-scoped so a multi-app deployment never reuses another host's domains, credentials, or storage endpoint.

type ComponentHealth

type ComponentHealth struct {
	ComponentSummary
	Status     string `json:"status"`
	HTTPStatus int    `json:"http_status,omitempty"`
	Error      string `json:"error,omitempty"`
}

type ComponentSummary

type ComponentSummary struct {
	Name           string `json:"name"`
	Kind           string `json:"kind"`
	Configured     bool   `json:"configured"`
	URL            string `json:"url,omitempty"`
	Transport      string `json:"transport,omitempty"`
	AuthConfigured bool   `json:"auth_configured"`
}

type Config

type Config struct {
	Apps []App `json:"apps" yaml:"apps"`
}

func Decode

func Decode(raw string) (*Config, error)

Decode accepts JSON or YAML. JSON remains the canonical wire format while YAML is convenient for reviewed deployment files.

func LoadFromEnv

func LoadFromEnv() (*Config, error)

type EventCallback

type EventCallback struct {
	URL        string   `json:"url" yaml:"url"`
	Token      string   `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv   string   `json:"token_env,omitempty" yaml:"token_env,omitempty"`
	EventTypes []string `json:"event_types,omitempty" yaml:"event_types,omitempty"`
}

type MCPProvider

type MCPProvider struct {
	Name                   string            `json:"name" yaml:"name"`
	Transport              string            `json:"transport" yaml:"transport"`
	URL                    string            `json:"url,omitempty" yaml:"url,omitempty"`
	Token                  string            `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv               string            `json:"token_env,omitempty" yaml:"token_env,omitempty"`
	Command                string            `json:"command,omitempty" yaml:"command,omitempty"`
	Args                   []string          `json:"args,omitempty" yaml:"args,omitempty"`
	Env                    map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
	ToolPrefix             string            `json:"tool_prefix,omitempty" yaml:"tool_prefix,omitempty"`
	ToolNamespace          string            `json:"tool_namespace,omitempty" yaml:"tool_namespace,omitempty"`
	AllowedTools           []string          `json:"allowed_tools,omitempty" yaml:"allowed_tools,omitempty"`
	RefreshInterval        string            `json:"refresh_interval,omitempty" yaml:"refresh_interval,omitempty"`
	StartupPolicy          string            `json:"startup_policy,omitempty" yaml:"startup_policy,omitempty"`
	UnknownRefreshCooldown string            `json:"unknown_refresh_cooldown,omitempty" yaml:"unknown_refresh_cooldown,omitempty"`
}

type ModelCredentialCallback

type ModelCredentialCallback struct {
	URL      string `json:"url" yaml:"url"`
	TokenEnv string `json:"token_env" yaml:"token_env"`
}

type ModelEndpoint

type ModelEndpoint struct {
	ID        string `json:"id" yaml:"id"`
	BaseURL   string `json:"base_url" yaml:"base_url"`
	AuthMode  string `json:"auth_mode" yaml:"auth_mode"`
	AllowHTTP bool   `json:"allow_http,omitempty" yaml:"allow_http,omitempty"`
}

ModelEndpoint approves one immutable destination/authentication binding. HTTP is opt-in for local/private installations; no run flag can enable it.

type SkillProvider

type SkillProvider struct {
	Transport       string `json:"transport" yaml:"transport"`
	BaseURL         string `json:"base_url" yaml:"base_url"`
	Token           string `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv        string `json:"token_env,omitempty" yaml:"token_env,omitempty"`
	PackageBaseURL  string `json:"package_base_url,omitempty" yaml:"package_base_url,omitempty"`
	PackageToken    string `json:"package_token,omitempty" yaml:"package_token,omitempty"`
	PackageTokenEnv string `json:"package_token_env,omitempty" yaml:"package_token_env,omitempty"`
}

type WorkspaceProvider

type WorkspaceProvider struct {
	Transport string `json:"transport" yaml:"transport"`
	BaseURL   string `json:"base_url" yaml:"base_url"`
	Token     string `json:"token,omitempty" yaml:"token,omitempty"`
	TokenEnv  string `json:"token_env,omitempty" yaml:"token_env,omitempty"`
	RootDir   string `json:"root_dir,omitempty" yaml:"root_dir,omitempty"`
}

Jump to

Keyboard shortcuts

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