overlay

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMCPInstallationSettingsKey

func IsMCPInstallationSettingsKey(value string) bool

Types

type BundleOverlay

type BundleOverlay struct {
	SchemaVersion  string `json:"schemaVersion"`
	Revision       uint64 `json:"revision"`
	RuntimeEnabled bool   `json:"runtimeEnabled"`
}

func (BundleOverlay) Validate added in v0.2.21

func (value BundleOverlay) Validate() error

type OverlayRepository

type OverlayRepository interface {
	GetServerOverlay(
		ctx context.Context,
		ref artifact.ArtifactRef,
	) (ServerOverlay, bool, error)

	GetBundleOverlay(
		ctx context.Context,
		rootID root.RootID,
		collectionID collection.CollectionID,
	) (BundleOverlay, bool, error)

	PutServerOverlay(
		ctx context.Context,
		ref artifact.ArtifactRef,
		expectedRevision uint64,
		value ServerOverlay,
	) error

	PutBundleOverlay(
		ctx context.Context,
		rootID root.RootID,
		collectionID collection.CollectionID,
		expectedRevision uint64,
		value BundleOverlay,
	) error

	DeleteServerOverlay(
		ctx context.Context,
		ref artifact.ArtifactRef,
		expectedRevision uint64,
	) error

	DeleteBundleOverlay(
		ctx context.Context,
		rootID root.RootID,
		collectionID collection.CollectionID,
		expectedRevision uint64,
	) error
}

type ServerOverlay

type ServerOverlay struct {
	SchemaVersion  string                     `json:"schemaVersion"`
	Revision       uint64                     `json:"revision"`
	RuntimeEnabled bool                       `json:"runtimeEnabled"`
	ServerData     mcpDomainServer.ServerData `json:"serverData"`
}

ServerOverlay intentionally stores ServerData as a named nested value. Anonymous embedding would produce two schemaVersion fields at JSON encoding time and causes the embedded ServerData schemaVersion to decode as empty.

func (ServerOverlay) Validate added in v0.2.21

func (value ServerOverlay) Validate() error

type SettingsOverlayRepository

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

SettingsOverlayRepository implements OverlayRepository over application settings. It contains only installation metadata and opaque secret refs.

func NewSettingsOverlayRepository

func NewSettingsOverlayRepository(
	values SettingsValueStore,
) (*SettingsOverlayRepository, error)

func (*SettingsOverlayRepository) DeleteBundleOverlay

func (r *SettingsOverlayRepository) DeleteBundleOverlay(
	ctx context.Context,
	rootID root.RootID,
	collectionID collection.CollectionID,
	expectedRevision uint64,
) error

func (*SettingsOverlayRepository) DeleteServerOverlay

func (r *SettingsOverlayRepository) DeleteServerOverlay(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
) error

func (*SettingsOverlayRepository) GetBundleOverlay

func (r *SettingsOverlayRepository) GetBundleOverlay(
	ctx context.Context,
	rootID root.RootID,
	collectionID collection.CollectionID,
) (BundleOverlay, bool, error)

func (*SettingsOverlayRepository) GetServerOverlay

func (*SettingsOverlayRepository) PurgeRoot

func (r *SettingsOverlayRepository) PurgeRoot(
	ctx context.Context,
	rootID root.RootID,
) error

PurgeRoot is intentionally available only through trusted protected hydration. It removes local overlays before a stale protected topology is rebuilt with a new static registration set.

func (*SettingsOverlayRepository) PutBundleOverlay

func (r *SettingsOverlayRepository) PutBundleOverlay(
	ctx context.Context,
	rootID root.RootID,
	collectionID collection.CollectionID,
	expectedRevision uint64,
	value BundleOverlay,
) error

func (*SettingsOverlayRepository) PutServerOverlay

func (r *SettingsOverlayRepository) PutServerOverlay(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedRevision uint64,
	value ServerOverlay,
) error

type SettingsPrefixValueStore

type SettingsPrefixValueStore interface {
	SettingsValueStore

	DeleteMCPInstallationPrefix(
		ctx context.Context,
		prefix string,
	) error
}

SettingsPrefixValueStore is optional. It is used by protected hydration to remove stale installation overlays for a reset protected Root.

type SettingsValueStore

type SettingsValueStore interface {
	GetMCPInstallationValue(
		ctx context.Context,
		key string,
	) (json.RawMessage, bool, error)

	PutMCPInstallationValue(
		ctx context.Context,
		key string,
		expectedRevision uint64,
		value json.RawMessage,
	) error

	DeleteMCPInstallationValue(
		ctx context.Context,
		key string,
		expectedRevision uint64,
	) error
}

SettingsValueStore is the narrow application-settings port required by MCP installation overlays. The application adapter must persist values through the existing Setting Store and implement compare-and-swap atomically.

Jump to

Keyboard shortcuts

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