providers

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package providers owns the projection from operator inference settings to compiled adapter configuration.

Index

Constants

View Source
const DefaultReconcileTimeout = 10 * time.Second

DefaultReconcileTimeout bounds one provider source operation when the caller does not configure a deployment-specific deadline.

Variables

View Source
var (
	// ErrReconcilerRequired reports an absent provider reconciler dependency.
	ErrReconcilerRequired = errors.New("provider reconciler dependency is required")
	// ErrCatalogViewRequired reports an incomplete catalog generation view.
	ErrCatalogViewRequired = errors.New("provider reconciliation catalog view is required")
)
View Source
var (
	// ErrProviderMissingCatalog reports configured runtime state without an
	// exact catalog provider.
	ErrProviderMissingCatalog = errors.New("configured provider is missing from Starmap")
)

Functions

func Availability

func Availability(activations []Activation) []runtimecatalog.AdapterAvailability

Availability projects active adapters into the runtime catalog contract.

func Configurations

func Configurations(
	configs config.ProvidersConfig,
) map[catalogs.ProviderID]Configuration

Configurations projects external settings by exact Starmap provider ID. The connector projection contains operational values only.

func CredentialFailureDetail added in v1.1.0

func CredentialFailureDetail(err error) string

CredentialFailureDetail renders a secret-free description of one source failure for operator surfaces. Typed source errors are safe by construction; any other error collapses to its classification so raw internal text never reaches an HTTP response.

Types

type Activation added in v1.0.2

type Activation struct {
	ProviderID      catalogs.ProviderID
	Configuration   Configuration
	Operations      []catalogs.ProviderOperation
	EndpointTypes   []catalogs.EndpointType
	RequiresAuth    bool
	Anonymous       credentials.Material
	OperatorBaseURL string
}

Activation is the intersection of one catalog provider and Starport's compiled transport and authentication primitives. Operator state is optional.

func Activate added in v1.0.2

func Activate(
	catalog *catalogs.Catalog,
	transports *connectors.TransportRegistry,
	authentication *providerauth.Registry,
	configurations map[catalogs.ProviderID]Configuration,
) ([]Activation, error)

Activate derives every executable runtime provider from catalog facts. A provider ID labels the activation but never selects compiled behavior.

type Assessment added in v1.0.3

type Assessment struct {
	Observation providerstate.AdapterObservation
	Activation  *Activation
}

Assessment reports compiled adapter support for every catalog provider and carries an activation only when the provider is executable.

func Assess added in v1.0.3

func Assess(
	catalog *catalogs.Catalog,
	transports *connectors.TransportRegistry,
	authentication *providerauth.Registry,
	configurations map[catalogs.ProviderID]Configuration,
) ([]Assessment, error)

Assess derives adapter support without using a provider ID to select compiled behavior.

type CatalogSource added in v1.0.3

type CatalogSource func() (CatalogView, error)

CatalogSource returns the current immutable provider contract view.

type CatalogView added in v1.0.3

type CatalogView struct {
	GenerationID    string
	PayloadChecksum string
	Providers       []catalogs.Provider
}

CatalogView binds provider contracts to the immutable Starmap generation from which they came.

type Configuration added in v1.0.2

type Configuration struct {
	Connector        connectors.ProviderConfig
	CredentialSource credentials.MaterialSource
}

Configuration binds optional operator settings and one request-time material source to an exact catalog provider. It contains no credential value and does not determine provider membership.

type CredentialRuntimeResolver added in v1.0.3

type CredentialRuntimeResolver interface {
	ValidateProviderCredentialContracts([]catalogs.Provider) error
	ResolveProviderRuntime(
		context.Context,
		catalogs.Provider,
		config.ProviderConfig,
		bool,
	) (config.ProviderConfig, bool, error)
}

CredentialRuntimeResolver resolves deployment material from Starmap-owned inference credential contracts.

type ReconcileFailure added in v1.0.3

type ReconcileFailure struct {
	ProviderID catalogs.ProviderID
	Err        error
}

ReconcileFailure records one isolated provider-local failure.

type ReconcileReport added in v1.0.3

type ReconcileReport struct {
	Revision            uint64
	Changed             bool
	ConfiguredProviders []catalogs.ProviderID
	Failures            []ReconcileFailure
}

ReconcileReport describes one completed provider reconciliation without exposing credential material.

type Reconciler added in v1.0.3

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler resolves all catalog providers outside the inference hot path and publishes only an effective configuration change.

func NewReconciler added in v1.0.3

func NewReconciler(
	source CatalogSource,
	resolver CredentialRuntimeResolver,
	settings config.ProvidersConfig,
	publish RuntimePublisher,
	timeout time.Duration,
	states providerstate.CredentialPublisher,
) (*Reconciler, error)

NewReconciler creates a provider reconciliation boundary. Timeout applies to each provider independently, so one provider cannot consume another provider's resolution window.

func (*Reconciler) Adopt added in v1.0.3

func (r *Reconciler) Adopt(view CatalogView, current config.ProvidersConfig) error

Adopt records a configuration that another complete runtime transaction already published, such as startup or a catalog generation change.

func (*Reconciler) Reconcile added in v1.0.3

func (r *Reconciler) Reconcile(
	ctx context.Context,
	force bool,
) (ReconcileReport, error)

Reconcile shares concurrent work. A forced manual reconciliation waits for an in-flight interval pass and retries if that pass did not force sources.

func (*Reconciler) Snapshot added in v1.0.3

func (r *Reconciler) Snapshot() ReconcileReport

Snapshot returns the latest accepted provider reconciliation state.

type RuntimePublisher added in v1.0.3

type RuntimePublisher func(context.Context, CatalogView, config.ProvidersConfig) error

RuntimePublisher atomically publishes provider configuration against the exact catalog view used to resolve it.

Directories

Path Synopsis
Package auth applies catalog-declared authentication primitives to provider inference requests.
Package auth applies catalog-declared authentication primitives to provider inference requests.
Package connectors provides interfaces and types for LLM provider integrations
Package connectors provides interfaces and types for LLM provider integrations
Package keyring stores and resolves the provider credentials a request can spend.
Package keyring stores and resolves the provider credentials a request can spend.
Package state projects safe provider runtime state from its concept owners.
Package state projects safe provider runtime state from its concept owners.
Package statuspage observes provider service incidents from each provider's own published health API.
Package statuspage observes provider service incidents from each provider's own published health API.

Jump to

Keyboard shortcuts

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