server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 25 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server supplies descriptor-locked server-realm plugins around the clean Realtime API. The application launcher starts a listener only after a compiled plugin profile exports an HTTP service; neither the graph runtime nor presentation clients own a built-in UI or privileged route.

Index

Constants

View Source
const (
	// RealtimeHTTPExport is the conventional profile export consumed by an
	// application listener. Profiles may rename it explicitly.
	RealtimeHTTPExport = "realtime_http"
)

Variables

This section is empty.

Functions

func HTTPRoutesContract

func HTTPRoutesContract() plugin.Contract

func ObservabilityEndpointsContract

func ObservabilityEndpointsContract() plugin.Contract

func RealtimeEndpointContract

func RealtimeEndpointContract() plugin.Contract

func RealtimeHTTPContract

func RealtimeHTTPContract() plugin.Contract

func SessionInspectionPlaneContract

func SessionInspectionPlaneContract() plugin.Contract

func SessionProviderContract

func SessionProviderContract() plugin.Contract

Types

type Bundle

type Bundle struct {
	Profile plugin.Profile
	Lock    plugin.Lock
	Plan    plugin.Plan
	// contains filtered or unexported fields
}

Bundle is a descriptor-locked server profile and its exact executable registrations. Constructing a Bundle compiles the entire dependency graph but acquires no provider resources and opens no listener.

func NewBundle

func NewBundle(config BundleConfig) (*Bundle, error)

NewBundle compiles the canonical clean Realtime server composition. The profile name and revision are deployment identity, not display metadata, and are therefore required rather than synthesized from mutable process state.

func (*Bundle) Mount

func (bundle *Bundle) Mount(ctx context.Context) (*Realm, error)

Mount validates all registered runtime identities, mounts the complete profile, and resolves its declared HTTP export. A caller can safely start a listener only after this method succeeds.

type BundleConfig

type BundleConfig struct {
	ProfileName     string
	ProfileRevision uint64

	Provider SessionProvider
	Gateway  gateway.Config

	ProviderArtifact inspect.ArtifactIdentity
	// GatewayArtifact identifies the linked server implementation containing
	// the gateway, stable router, inspection authority, and route plugins. Each
	// selected descriptor records it independently in live realm evidence.
	GatewayArtifact inspect.ArtifactIdentity
}

BundleConfig is the complete, immutable input to one server composition. ProviderArtifact identifies the session provider. GatewayArtifact identifies the linked server implementation; each selected router, inspection, gateway, and route descriptor records that artifact independently in live evidence even when they share executable bytes.

type GatewayFactory

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

GatewayFactory mounts the OpenRealtime protocol renderer as a replaceable server plugin. It opens no socket and serves no UI; the application obtains the exported handler only after the whole realm mounts successfully.

func NewGatewayFactory

func NewGatewayFactory(config GatewayFactoryConfig) (*GatewayFactory, error)

func (*GatewayFactory) Descriptor

func (factory *GatewayFactory) Descriptor() plugin.Descriptor

func (*GatewayFactory) Mount

func (factory *GatewayFactory) Mount(
	ctx context.Context, mount pluginruntime.MountContext,
) error

func (*GatewayFactory) PreMount

type GatewayFactoryConfig

type GatewayFactoryConfig struct {
	Gateway gateway.Config
}

GatewayFactoryConfig is private deployment configuration for the clean API gateway. Binding must remain nil because the compiled profile supplies the exact SessionProvider dependency. Other fields retain gateway's established compatibility, limits, telemetry, authorization, and management seams.

type GraphBundle

type GraphBundle struct {
	GraphPlan    *graphconfig.Plan
	Evidence     graphevidence.Document
	GraphCatalog graphcatalog.Document
	ServerBundle *Bundle
	Readiness    []graphlaunch.ReadinessCheck
	// contains filtered or unexported fields
}

GraphBundle is the immutable boundary between graph preparation and server composition. Constructing it acquires no graph resource and opens no listener. The graph plan, its single-entry immutable discovery catalog, and the server bundle retain independent fingerprints so inspection can attest each layer without collapsing their identities.

func NewGraphBundle

func NewGraphBundle(ctx context.Context, config GraphBundleConfig) (*GraphBundle, error)

NewGraphBundle prepares the exact graph-native provider and compiles the server plugin realm around it. There is no legacy binding fallback: any graph, adapter, dependency, or server-profile mismatch fails before Mount.

func NewProfileGraphBundle

func NewProfileGraphBundle(
	ctx context.Context, config ProfileGraphBundleConfig,
) (*GraphBundle, error)

NewProfileGraphBundle resolves a checked application plugin, seals its exact graph-native provider, resolves the optional server token, and then compiles the descriptor-locked server realm. It opens no listener and acquires no per-session graph resource.

func (*GraphBundle) OperatorAPIConfig

func (bundle *GraphBundle) OperatorAPIConfig(
	authorizer management.Authorizer,
) (managementserver.OperatorAPIConfig, error)

OperatorAPIConfig binds the graph bundle's exact static and in-memory authoring services to a caller-owned authority. Mounting remains explicit so a headless profile that omits operator authority exposes no operator routes.

func (*GraphBundle) OperatorGrants

func (bundle *GraphBundle) OperatorGrants() ([]management.Grant, error)

OperatorGrants returns the least-privilege process-lifetime authority for this exact graph's immutable catalog and the payload-only authoring API. It intentionally excludes session inspection, source I/O, and reconciliation.

type GraphBundleConfig

type GraphBundleConfig struct {
	Graph  graphlaunch.Config
	Server BundleConfig
}

GraphBundleConfig composes one exact graph-native session provider with the descriptor-locked Realtime server realm. Graph owns topology, values, deployment, adapter, and executable-element selection. Server owns only the stable protocol, management, observability, and listener-independent route profile.

Server.Provider must be empty. Accepting both a graph launch and an injected provider would create two competing sources of session authority.

type HTTPRouterFactory

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

HTTPRouterFactory owns the stable route registry exported to a process listener. It contains no product routes. Server and management route plugins publish into the same atomic registry under distinct exact service contracts, so an unmounted route cannot be revealed through a hidden mux.

func NewHTTPRouterFactory

func NewHTTPRouterFactory() *HTTPRouterFactory

func (*HTTPRouterFactory) Descriptor

func (factory *HTTPRouterFactory) Descriptor() plugin.Descriptor

func (*HTTPRouterFactory) Mount

func (factory *HTTPRouterFactory) Mount(
	ctx context.Context, mount pluginruntime.MountContext,
) error

func (*HTTPRouterFactory) PreMount

type ObservabilityEndpoints

type ObservabilityEndpoints interface {
	HealthHandler() http.Handler
	MetricsHandler() http.Handler
}

ObservabilityEndpoints supplies payload-only health and bounded telemetry handlers. Route ownership remains with the observability plugin.

type ObservabilityRouteFactory

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

ObservabilityRouteFactory owns health and bounded telemetry as one independently selectable, UI-free operational surface.

func NewObservabilityRouteFactory

func NewObservabilityRouteFactory() *ObservabilityRouteFactory

func (*ObservabilityRouteFactory) Descriptor

func (factory *ObservabilityRouteFactory) Descriptor() plugin.Descriptor

func (*ObservabilityRouteFactory) Mount

func (*ObservabilityRouteFactory) PreMount

type ProfileGraphBundleConfig

type ProfileGraphBundleConfig struct {
	Profile      launchprofile.Document
	Applications *launchprofile.Registry
	// GatewayArtifact is the host-installed executable identity. The profile
	// selects it, but cannot attest its own installed bytes.
	GatewayArtifact inspect.ArtifactIdentity
	Gateway         gateway.Config
	ResolveToken    TokenResolver
}

ProfileGraphBundleConfig composes a strict launch profile with a broad host plugin registry and non-behavioral observability hooks. Fields owned by the profile (provider, protocol identity, limits, validation, token, inspection plane, and effect authority) must remain empty in Gateway.

type Realm

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

Realm is one mounted clean-API server profile. A process listener consumes Handler; operators consume Live; Close releases the profile in reverse dependency order. No presentation or socket implementation is hidden here.

func (*Realm) Close

func (realm *Realm) Close(ctx context.Context) error

func (*Realm) Handler

func (realm *Realm) Handler() http.Handler

func (*Realm) Live

func (realm *Realm) Live() pluginruntime.Live

type RealtimeEndpoint

type RealtimeEndpoint interface {
	RealtimeHandler() http.Handler
}

RealtimeEndpoint is the handler implementation consumed by the independently selected realtime route plugin. It deliberately carries no route pattern.

type RealtimeHTTP

type RealtimeHTTP interface {
	Handler() http.Handler
}

RealtimeHTTP is the only service an application listener needs. The plugin realm owns the gateway lifecycle; closing the realm revokes this handler's management resources before the listener itself is shut down.

type RealtimeRouteFactory

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

RealtimeRouteFactory owns only the public OpenAI-compatible WebSocket path.

func NewRealtimeRouteFactory

func NewRealtimeRouteFactory() *RealtimeRouteFactory

func (*RealtimeRouteFactory) Descriptor

func (factory *RealtimeRouteFactory) Descriptor() plugin.Descriptor

func (*RealtimeRouteFactory) Mount

func (*RealtimeRouteFactory) PreMount

type SessionInspectionPlaneFactory

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

SessionInspectionPlaneFactory publishes one resource-free session inspection authority under the exact projections consumed by the gateway and canonical management API. Routes remain separate plugins.

func NewSessionInspectionPlaneFactory

func NewSessionInspectionPlaneFactory(
	ttl time.Duration,
) (*SessionInspectionPlaneFactory, error)

func (*SessionInspectionPlaneFactory) Descriptor

func (factory *SessionInspectionPlaneFactory) Descriptor() plugin.Descriptor

func (*SessionInspectionPlaneFactory) Mount

func (*SessionInspectionPlaneFactory) PreMount

type SessionProvider

type SessionProvider interface {
	Name() string
	Start(context.Context, binding.Options) (binding.Runtime, error)
}

SessionProvider is the exported server-plugin boundary that creates one independent realtime session. It deliberately does not expose a concrete graph, legacy preset, model client, UI implementation, or lossy ownership and capability projection. Gateway validation obtains graph-native protocol facts from the provider's exact frozen adapter profile; retained legacy providers are handled by a separate compatibility check until their launch path is deleted.

type SessionProviderFactory

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

SessionProviderFactory publishes one already prepared session provider into a server realm. The implementation registry—not this descriptor—pins the executable artifact and permits a profile to replace the provider without changing the gateway plugin.

func NewSessionProviderFactory

func NewSessionProviderFactory(provider SessionProvider) (*SessionProviderFactory, error)

func (*SessionProviderFactory) Descriptor

func (factory *SessionProviderFactory) Descriptor() plugin.Descriptor

func (*SessionProviderFactory) Mount

func (factory *SessionProviderFactory) Mount(
	ctx context.Context, mount pluginruntime.MountContext,
) error

func (*SessionProviderFactory) PreMount

type TokenResolver

type TokenResolver func(context.Context, string) (string, error)

TokenResolver resolves one explicitly named secret only after the complete application profile and graph plan have passed exact identity validation. A launcher normally supplies an environment-backed implementation; the server package deliberately does not read process environment implicitly.

Jump to

Keyboard shortcuts

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