plugin_space

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the config identifier.

View Source
const ControllerID = "plugin/space"

ControllerID is the controller ID.

Variables

View Source
var ErrEmptySpaceID = errors.New("space_id must be specified")

ErrEmptySpaceID is returned when space_id is empty.

View Source
var Version = semver.MustParse("0.0.1")

Version is the version of this controller.

Functions

func NewFactory

func NewFactory(b bus.Bus) controller.Factory

NewFactory constructs the component factory.

Types

type Config

type Config struct {

	// SpaceId is the Space identifier for approval lookups.
	SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"spaceId,omitempty"`
	// PluginIds lists manifest IDs of plugins to load (from SpaceSettings).
	PluginIds []string `protobuf:"bytes,2,rep,name=plugin_ids,json=pluginIds,proto3" json:"pluginIds,omitempty"`
	// VolumeId is the volume ID for the PlatformAccount object store.
	// If empty, uses the default bldr plugin volume.
	VolumeId string `protobuf:"bytes,3,opt,name=volume_id,json=volumeId,proto3" json:"volumeId,omitempty"`
	// ObjectStoreId is the object store ID within the volume.
	// If empty, uses "platform-account".
	ObjectStoreId string `protobuf:"bytes,4,opt,name=object_store_id,json=objectStoreId,proto3" json:"objectStoreId,omitempty"`
	// EngineId is the Hydra engine ID for watching the Space world.
	// Required for FetchManifest resolution.
	EngineId string `protobuf:"bytes,5,opt,name=engine_id,json=engineId,proto3" json:"engineId,omitempty"`
	// ObjectKeys is the list of object keys to collect manifests from.
	ObjectKeys []string `protobuf:"bytes,6,rep,name=object_keys,json=objectKeys,proto3" json:"objectKeys,omitempty"`
	// SessionPeerId is the base58-encoded peer ID of the local session.
	// Used by ObjectType factories that need session-scoped behavior
	// (e.g., ForgeWorkerFactory checks if this session should run the worker).
	SessionPeerId string `protobuf:"bytes,7,opt,name=session_peer_id,json=sessionPeerId,proto3" json:"sessionPeerId,omitempty"`
	// contains filtered or unexported fields
}

Config configures the Space Plugin Controller. Loads approved plugins and resolves FetchManifest directives by watching the Space world with approval gating.

func (*Config) CloneMessageVT

func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

func (this *Config) EqualMessageVT(thatMsg any) bool

func (*Config) EqualVT

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the config is equal to another.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type.

func (*Config) GetEngineId

func (x *Config) GetEngineId() string

func (*Config) GetObjectKeys

func (x *Config) GetObjectKeys() []string

func (*Config) GetObjectStoreId

func (x *Config) GetObjectStoreId() string

func (*Config) GetPluginIds

func (x *Config) GetPluginIds() []string

func (*Config) GetSessionPeerId

func (x *Config) GetSessionPeerId() string

func (*Config) GetSpaceId

func (x *Config) GetSpaceId() string

func (*Config) GetVolumeId

func (x *Config) GetVolumeId() string

func (*Config) MarshalJSON

func (x *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Config to JSON.

func (*Config) MarshalProtoJSON

func (x *Config) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalProtoText

func (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

func (x *Config) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Config from JSON.

func (*Config) UnmarshalProtoJSON

func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Controller

type Controller struct {
	*bus.BusController[*Config]
	// contains filtered or unexported fields
}

Controller loads approved plugins for a Space and resolves FetchManifest directives by watching the Space world with approval gating.

Watches SpaceSettings in the Space world reactively. When plugin_ids change in SpaceSettings, reconciles LoadPlugin directives: adds directives for newly-approved plugins, releases directives for removed plugins.

For FetchManifest: resolves FetchManifest directives for manifest IDs matching the current SpaceSettings plugin_ids. Checks approval before returning manifest values. Uses a shared world watch loop with broadcast to handle resolver set changes.

Also reconciles process bindings: starts approved persistent processes and stops processes that are removed or unapproved.

func StartControllerWithConfig

func StartControllerWithConfig(
	ctx context.Context,
	b bus.Bus,
	conf *Config,
	rel func(),
) (*Controller, directive.Instance, directive.Reference, error)

StartControllerWithConfig starts the space plugin controller with a config. Waits for the controller to start running. Returns a Release function to close the controller when done.

func (*Controller) Execute

func (c *Controller) Execute(ctx context.Context) error

Execute executes the controller goroutine.

func (*Controller) HandleDirective

func (c *Controller) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)

HandleDirective asks if the handler can resolve the directive.

func (*Controller) NotifyChanged

func (c *Controller) NotifyChanged()

NotifyChanged wakes the watch loop to reconcile approval-backed state.

Jump to

Keyboard shortcuts

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