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

space_exec

package
v0.57.25 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 84 Imported by: 0

Documentation

Index

Constants

View Source
const BuildPluginConfigID = "space-exec/build-plugin"

BuildPluginConfigID selects a native Bldr build of Space-stored source.

View Source
const ExportZipConfigID = "space-exec/export-zip"

ExportZipConfigID is the config ID for the export-zip handler.

View Source
const FileHashConfigID = "space-exec/file-hash"

FileHashConfigID is the config ID for the file-hash handler.

View Source
const NoopConfigID = space_exec_noop.ConfigID

NoopConfigID is the config ID for the noop handler.

View Source
const PluginExecConfigID = "space-exec/plugin"

PluginExecConfigID is the config ID for the plugin bridge handler.

View Source
const SRPCPluginExecServiceServiceID = "space.exec.PluginExecService"
View Source
const UnixfsReadConfigID = "space-exec/unixfs-read"

UnixfsReadConfigID is the config ID for the unixfs-read handler.

View Source
const V86ConfigID = "space-exec/v86"

V86ConfigID is the config ID for the V86 VM object handler.

Variables

View Source
var ErrUnknownConfigID = errors.New("unknown exec handler config ID")

ErrUnknownConfigID is returned when the config ID has no registered handler.

View Source
var GitCloneConfigID = forge_lib_git_clone.ConfigID

GitCloneConfigID is the config ID for the space-aware git clone handler. Matches the existing forge/lib/git/clone ConfigID so existing task targets work.

View Source
var KvtxConfigID = forge_lib_kvtx.ConfigID

KvtxConfigID is the config ID for the space-aware kvtx handler. Matches the existing forge/lib/kvtx ConfigID so existing task targets work.

Functions

func BridgeFactories

func BridgeFactories(r *Registry) []controller.Factory

BridgeFactories returns bus-compatible controller factories for all handlers in the registry. Each handler gets a BridgeFactory that responds to LoadConfigConstructorByID and LoadFactoryByConfig on the bus, making all space-exec handlers discoverable through the standard forge execution controller dispatch. Other plugins can contribute additional handlers by registering their own controller factories on the bus.

func NewNoopTarget

func NewNoopTarget() *forge_target.Target

NewNoopTarget returns a Forge target that runs through the noop bridge.

func NewSRPCPluginExecServiceHandler added in v0.51.0

func NewSRPCPluginExecServiceHandler(impl SRPCPluginExecServiceServer, serviceID string) srpc.Handler

NewSRPCPluginExecServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: space.exec.PluginExecService

func PluginFrontendProtocol

func PluginFrontendProtocol(id string) protocol.ID

PluginFrontendProtocol identifies one execution's authenticated compiler service.

func RegisterBuildPlugin

func RegisterBuildPlugin(r *Registry, b bus.Bus)

RegisterBuildPlugin exposes plugin builds to the existing Forge worker owner.

func RegisterExportZip

func RegisterExportZip(r *Registry)

RegisterExportZip registers the export-zip handler in the registry.

func RegisterFileHash

func RegisterFileHash(r *Registry)

RegisterFileHash registers the file-hash handler in the registry.

func RegisterGitClone

func RegisterGitClone(r *Registry)

RegisterGitClone registers the git clone handler in the registry.

func RegisterKvtx

func RegisterKvtx(r *Registry)

RegisterKvtx registers the kvtx handler in the registry.

func RegisterNoop

func RegisterNoop(r *Registry)

RegisterNoop registers the noop handler in the registry.

func RegisterPluginExec added in v0.51.0

func RegisterPluginExec(r *Registry, b bus.Bus)

RegisterPluginExec registers the plugin bridge handler in the registry.

func RegisterUnixfsRead

func RegisterUnixfsRead(r *Registry)

RegisterUnixfsRead registers the unixfs-read handler in the registry.

func RegisterV86 added in v0.54.0

func RegisterV86(r *Registry, b bus.Bus)

RegisterV86 registers the V86 VM object handler in the registry.

func SRPCRegisterPluginExecService added in v0.51.0

func SRPCRegisterPluginExecService(mux srpc.Mux, impl SRPCPluginExecServiceServer) error

SRPCRegisterPluginExecService registers the implementation with the mux. Uses the default serviceID: space.exec.PluginExecService

Types

type BridgeFactory

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

BridgeFactory creates a bus-compatible controller factory from a SpaceExecRegistry handler. This adapts space-aware handlers (no bus.Bus access) to work within the existing forge execution controller dispatch.

The forge execution controller resolves config IDs through the bus:

  • LoadConfigConstructorByID finds this factory (via static resolver)
  • ConstructConfig returns a SpaceExecConfig that stores raw config bytes
  • LoadFactoryByConfig finds this factory again
  • Construct creates a bridgeController delegating to the SpaceExecRegistry

This makes all space-exec handlers discoverable through the standard bus mechanism, so other plugins can also register handlers by adding their own controller factories.

func NewBridgeFactory

func NewBridgeFactory(configID string, registry *Registry) *BridgeFactory

NewBridgeFactory creates a bridge factory for the given config ID.

func (*BridgeFactory) Construct

Construct creates a bridge controller that delegates to SpaceExecRegistry.

func (*BridgeFactory) ConstructConfig

func (f *BridgeFactory) ConstructConfig() config.Config

ConstructConfig returns a SpaceExecConfig that stores raw config bytes. The forge execution controller's Resolve path calls this, then unmarshals the target's config data into the returned object.

func (*BridgeFactory) GetConfigID

func (f *BridgeFactory) GetConfigID() string

GetConfigID returns the config ID this factory handles.

func (*BridgeFactory) GetVersion

func (f *BridgeFactory) GetVersion() controller.Version

GetVersion returns the bridge factory version.

type Handler

type Handler interface {
	// Execute runs the handler to completion.
	Execute(ctx context.Context) error
}

Handler executes a single forge task within the space context. Receives inputs, performs work via the handle, sets outputs, returns. Returning nil signals successful completion. Returning an error signals failure.

func NewBuildPluginHandlerWithBus

func NewBuildPluginHandlerWithBus(_ context.Context, b bus.Bus, le *logrus.Entry, _ world.WorldState, handle forge_target.ExecControllerHandle, inputs forge_target.InputMap, data []byte) (Handler, error)

NewBuildPluginHandlerWithBus binds the build to the execution's World capability. The bus supplies the assigned device's network transport for live authoring.

func NewExportZipHandler

func NewExportZipHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewExportZipHandler constructs an export-zip space handler.

func NewFileHashHandler

func NewFileHashHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewFileHashHandler constructs a file-hash space handler.

func NewGitCloneHandler

func NewGitCloneHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewGitCloneHandler constructs a git clone space handler. Deserializes configData as the forge/lib/git/clone Config proto and executes the clone using world state directly (no bus access).

func NewKvtxHandler

func NewKvtxHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewKvtxHandler constructs a kvtx space handler. Deserializes configData as the kvtx Config proto, constructs the controller with a nil bus (unused by kvtx), and initializes it with inputs and handle.

func NewNoopHandler

func NewNoopHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewNoopHandler constructs a noop handler.

func NewUnixfsReadHandler

func NewUnixfsReadHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

NewUnixfsReadHandler constructs a unixfs-read space handler.

type HandlerFactory

type HandlerFactory func(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configData []byte,
) (Handler, error)

HandlerFactory constructs a Handler for a given exec config ID. No bus.Bus parameter: handlers access only the world state and exec handle.

func NewPluginExecHandler added in v0.51.0

func NewPluginExecHandler(b bus.Bus) HandlerFactory

NewPluginExecHandler constructs a plugin bridge handler factory.

func NewV86Handler added in v0.54.0

func NewV86Handler(b bus.Bus) HandlerFactory

NewV86Handler constructs a V86 VM object handler factory.

type PluginBuildConfig

type PluginBuildConfig struct {

	// ManifestId selects the plugin manifest for an immutable build.
	ManifestId string `protobuf:"bytes,1,opt,name=manifest_id,json=manifestId,proto3" json:"manifestId,omitempty"`
	// ConfigPath is relative to the source tree; empty selects bldr.yaml.
	ConfigPath string `protobuf:"bytes,2,opt,name=config_path,json=configPath,proto3" json:"configPath,omitempty"`
	// FrontendId grants a temporary live compiler attachment instead of building.
	// Its UUID namespaces the device RPC service for this execution only.
	FrontendId string `protobuf:"bytes,3,opt,name=frontend_id,json=frontendId,proto3" json:"frontendId,omitempty"`
	// FrontendPeerId is the only authenticated Session allowed to use that service.
	// Releasing its authoring Resource cancels the execution and this grant.
	FrontendPeerId string `protobuf:"bytes,4,opt,name=frontend_peer_id,json=frontendPeerId,proto3" json:"frontendPeerId,omitempty"`
	// FrontendRoutePrefix routes same-origin modules back to the authoring Resource.
	FrontendRoutePrefix string `protobuf:"bytes,5,opt,name=frontend_route_prefix,json=frontendRoutePrefix,proto3" json:"frontendRoutePrefix,omitempty"`
	// PlatformId is the platform of the immutable build, such as js or
	// desktop/linux/amd64. Required unless FrontendId is set.
	PlatformId string `protobuf:"bytes,6,opt,name=platform_id,json=platformId,proto3" json:"platformId,omitempty"`
	// MilliCpu is the CPU the build requests from its Worker in milli-cores.
	MilliCpu uint64 `protobuf:"varint,7,opt,name=milli_cpu,json=milliCpu,proto3" json:"milliCpu,omitempty"`
	// MemoryBytes is the memory the build requests from its Worker in bytes.
	MemoryBytes uint64 `protobuf:"varint,8,opt,name=memory_bytes,json=memoryBytes,proto3" json:"memoryBytes,omitempty"`
	// InstallerPeerId is the Session that submitted the build with the authority
	// to install plugins in the Space. When set, a successful immutable build
	// installs its manifest in the Space as that Session in the same transaction
	// that retains the build. A failed or canceled build installs nothing.
	InstallerPeerId string `protobuf:"bytes,9,opt,name=installer_peer_id,json=installerPeerId,proto3" json:"installerPeerId,omitempty"`
	// contains filtered or unexported fields
}

PluginBuildConfig builds an immutable artifact or retains a frontend compiler.

func (*PluginBuildConfig) CloneMessageVT

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

func (*PluginBuildConfig) CloneVT

func (m *PluginBuildConfig) CloneVT() *PluginBuildConfig

func (*PluginBuildConfig) EqualMessageVT

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

func (*PluginBuildConfig) EqualVT

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

func (*PluginBuildConfig) GetConfigPath

func (x *PluginBuildConfig) GetConfigPath() string

func (*PluginBuildConfig) GetFrontendId

func (x *PluginBuildConfig) GetFrontendId() string

func (*PluginBuildConfig) GetFrontendPeerId

func (x *PluginBuildConfig) GetFrontendPeerId() string

func (*PluginBuildConfig) GetFrontendRoutePrefix

func (x *PluginBuildConfig) GetFrontendRoutePrefix() string

func (*PluginBuildConfig) GetInstallerPeerId

func (x *PluginBuildConfig) GetInstallerPeerId() string

func (*PluginBuildConfig) GetManifestId

func (x *PluginBuildConfig) GetManifestId() string

func (*PluginBuildConfig) GetMemoryBytes

func (x *PluginBuildConfig) GetMemoryBytes() uint64

func (*PluginBuildConfig) GetMilliCpu

func (x *PluginBuildConfig) GetMilliCpu() uint64

func (*PluginBuildConfig) GetPlatformId

func (x *PluginBuildConfig) GetPlatformId() string

func (*PluginBuildConfig) MarshalJSON

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

MarshalJSON marshals the PluginBuildConfig to JSON.

func (*PluginBuildConfig) MarshalProtoJSON

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

MarshalProtoJSON marshals the PluginBuildConfig message to JSON.

func (*PluginBuildConfig) MarshalProtoText

func (x *PluginBuildConfig) MarshalProtoText() string

func (*PluginBuildConfig) MarshalToSizedBufferVT

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

func (*PluginBuildConfig) MarshalToVT

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

func (*PluginBuildConfig) MarshalVT

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

func (*PluginBuildConfig) ProtoMessage

func (*PluginBuildConfig) ProtoMessage()

func (*PluginBuildConfig) Reset

func (x *PluginBuildConfig) Reset()

func (*PluginBuildConfig) SizeVT

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

func (*PluginBuildConfig) String

func (x *PluginBuildConfig) String() string

func (*PluginBuildConfig) UnmarshalJSON

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

UnmarshalJSON unmarshals the PluginBuildConfig from JSON.

func (*PluginBuildConfig) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the PluginBuildConfig message from JSON.

func (*PluginBuildConfig) UnmarshalVT

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

type PluginExecConfig added in v0.51.0

type PluginExecConfig struct {

	// PluginId is the plugin to load before executing.
	PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// ControllerId is the plugin-owned execution controller id to invoke.
	ControllerId string `protobuf:"bytes,2,opt,name=controller_id,json=controllerId,proto3" json:"controllerId,omitempty"`
	// ControllerConfig is opaque config bytes for the plugin-owned controller.
	ControllerConfig []byte `protobuf:"bytes,3,opt,name=controller_config,json=controllerConfig,proto3" json:"controllerConfig,omitempty"`
	// AttachWorld grants the plugin the execution's World through a Resource
	// connection that remains alive only for this execution.
	AttachWorld bool `protobuf:"varint,4,opt,name=attach_world,json=attachWorld,proto3" json:"attachWorld,omitempty"`
	// contains filtered or unexported fields
}

PluginExecConfig configures the generic plugin execution bridge.

func (*PluginExecConfig) CloneMessageVT added in v0.51.0

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

func (*PluginExecConfig) CloneVT added in v0.51.0

func (m *PluginExecConfig) CloneVT() *PluginExecConfig

func (*PluginExecConfig) EqualMessageVT added in v0.51.0

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

func (*PluginExecConfig) EqualVT added in v0.51.0

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

func (*PluginExecConfig) EqualsConfig added in v0.51.0

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

EqualsConfig checks equality with another plugin bridge config.

func (*PluginExecConfig) GetAttachWorld

func (x *PluginExecConfig) GetAttachWorld() bool

func (*PluginExecConfig) GetConfigID added in v0.51.0

func (c *PluginExecConfig) GetConfigID() string

GetConfigID returns the config ID.

func (*PluginExecConfig) GetControllerConfig added in v0.51.0

func (x *PluginExecConfig) GetControllerConfig() []byte

func (*PluginExecConfig) GetControllerId added in v0.51.0

func (x *PluginExecConfig) GetControllerId() string

func (*PluginExecConfig) GetPluginId added in v0.51.0

func (x *PluginExecConfig) GetPluginId() string

func (*PluginExecConfig) MarshalBlock added in v0.51.0

func (c *PluginExecConfig) MarshalBlock() ([]byte, error)

MarshalBlock marshals the config as protobuf bytes.

func (*PluginExecConfig) MarshalJSON added in v0.51.0

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

MarshalJSON marshals the PluginExecConfig to JSON.

func (*PluginExecConfig) MarshalProtoJSON added in v0.51.0

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

MarshalProtoJSON marshals the PluginExecConfig message to JSON.

func (*PluginExecConfig) MarshalProtoText added in v0.51.0

func (x *PluginExecConfig) MarshalProtoText() string

func (*PluginExecConfig) MarshalToSizedBufferVT added in v0.51.0

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

func (*PluginExecConfig) MarshalToVT added in v0.51.0

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

func (*PluginExecConfig) MarshalVT added in v0.51.0

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

func (*PluginExecConfig) ProtoMessage added in v0.51.0

func (*PluginExecConfig) ProtoMessage()

func (*PluginExecConfig) Reset added in v0.51.0

func (x *PluginExecConfig) Reset()

func (*PluginExecConfig) SizeVT added in v0.51.0

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

func (*PluginExecConfig) String added in v0.51.0

func (x *PluginExecConfig) String() string

func (*PluginExecConfig) UnmarshalBlock added in v0.51.0

func (c *PluginExecConfig) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the config from protobuf bytes.

func (*PluginExecConfig) UnmarshalJSON added in v0.51.0

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

UnmarshalJSON unmarshals the PluginExecConfig from JSON.

func (*PluginExecConfig) UnmarshalProtoJSON added in v0.51.0

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

UnmarshalProtoJSON unmarshals the PluginExecConfig message from JSON.

func (*PluginExecConfig) UnmarshalVT added in v0.51.0

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

func (*PluginExecConfig) Validate added in v0.51.0

func (c *PluginExecConfig) Validate() error

Validate checks that the plugin bridge has enough routing information.

type PluginExecLog added in v0.51.0

type PluginExecLog struct {

	// Level is the log severity.
	Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"`
	// Message is the log message.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

PluginExecLog is a log entry emitted by a plugin execution controller.

func (*PluginExecLog) CloneMessageVT added in v0.51.0

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

func (*PluginExecLog) CloneVT added in v0.51.0

func (m *PluginExecLog) CloneVT() *PluginExecLog

func (*PluginExecLog) EqualMessageVT added in v0.51.0

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

func (*PluginExecLog) EqualVT added in v0.51.0

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

func (*PluginExecLog) GetLevel added in v0.51.0

func (x *PluginExecLog) GetLevel() string

func (*PluginExecLog) GetMessage added in v0.51.0

func (x *PluginExecLog) GetMessage() string

func (*PluginExecLog) MarshalJSON added in v0.51.0

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

MarshalJSON marshals the PluginExecLog to JSON.

func (*PluginExecLog) MarshalProtoJSON added in v0.51.0

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

MarshalProtoJSON marshals the PluginExecLog message to JSON.

func (*PluginExecLog) MarshalProtoText added in v0.51.0

func (x *PluginExecLog) MarshalProtoText() string

func (*PluginExecLog) MarshalToSizedBufferVT added in v0.51.0

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

func (*PluginExecLog) MarshalToVT added in v0.51.0

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

func (*PluginExecLog) MarshalVT added in v0.51.0

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

func (*PluginExecLog) ProtoMessage added in v0.51.0

func (*PluginExecLog) ProtoMessage()

func (*PluginExecLog) Reset added in v0.51.0

func (x *PluginExecLog) Reset()

func (*PluginExecLog) SizeVT added in v0.51.0

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

func (*PluginExecLog) String added in v0.51.0

func (x *PluginExecLog) String() string

func (*PluginExecLog) UnmarshalJSON added in v0.51.0

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

UnmarshalJSON unmarshals the PluginExecLog from JSON.

func (*PluginExecLog) UnmarshalProtoJSON added in v0.51.0

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

UnmarshalProtoJSON unmarshals the PluginExecLog message from JSON.

func (*PluginExecLog) UnmarshalVT added in v0.51.0

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

type PluginExecOutputFile added in v0.51.0

type PluginExecOutputFile struct {

	// Path is the slash-separated path relative to the output root.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// Data is the file contents.
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

PluginExecOutputFile is one captured output file from a plugin controller.

func (*PluginExecOutputFile) CloneMessageVT added in v0.51.0

func (*PluginExecOutputFile) CloneVT added in v0.51.0

func (*PluginExecOutputFile) EqualMessageVT added in v0.51.0

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

func (*PluginExecOutputFile) EqualVT added in v0.51.0

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

func (*PluginExecOutputFile) GetData added in v0.51.0

func (x *PluginExecOutputFile) GetData() []byte

func (*PluginExecOutputFile) GetPath added in v0.51.0

func (x *PluginExecOutputFile) GetPath() string

func (*PluginExecOutputFile) MarshalJSON added in v0.51.0

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

MarshalJSON marshals the PluginExecOutputFile to JSON.

func (*PluginExecOutputFile) MarshalProtoJSON added in v0.51.0

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

MarshalProtoJSON marshals the PluginExecOutputFile message to JSON.

func (*PluginExecOutputFile) MarshalProtoText added in v0.51.0

func (x *PluginExecOutputFile) MarshalProtoText() string

func (*PluginExecOutputFile) MarshalToSizedBufferVT added in v0.51.0

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

func (*PluginExecOutputFile) MarshalToVT added in v0.51.0

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

func (*PluginExecOutputFile) MarshalVT added in v0.51.0

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

func (*PluginExecOutputFile) ProtoMessage added in v0.51.0

func (*PluginExecOutputFile) ProtoMessage()

func (*PluginExecOutputFile) Reset added in v0.51.0

func (x *PluginExecOutputFile) Reset()

func (*PluginExecOutputFile) SizeVT added in v0.51.0

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

func (*PluginExecOutputFile) String added in v0.51.0

func (x *PluginExecOutputFile) String() string

func (*PluginExecOutputFile) UnmarshalJSON added in v0.51.0

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

UnmarshalJSON unmarshals the PluginExecOutputFile from JSON.

func (*PluginExecOutputFile) UnmarshalProtoJSON added in v0.51.0

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

UnmarshalProtoJSON unmarshals the PluginExecOutputFile message from JSON.

func (*PluginExecOutputFile) UnmarshalVT added in v0.51.0

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

type PluginExecRequest added in v0.51.0

type PluginExecRequest struct {

	// ControllerId is the plugin-owned execution controller id to invoke.
	ControllerId string `protobuf:"bytes,1,opt,name=controller_id,json=controllerId,proto3" json:"controllerId,omitempty"`
	// ControllerConfig is opaque config bytes for the plugin-owned controller.
	ControllerConfig []byte `protobuf:"bytes,2,opt,name=controller_config,json=controllerConfig,proto3" json:"controllerConfig,omitempty"`
	// Inputs are the Forge execution inputs.
	Inputs []*value.Value `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// AttachedEngineResourceId identifies the caller's attached World resource.
	// It is scoped to this Resource client generation and is never persisted.
	AttachedEngineResourceId uint32 `` /* 135-byte string literal not displayed */
	// ExecutionObjectKey identifies the Execution attempt that granted this call.
	// An access-only handle supplies its synthetic caller identity.
	ExecutionObjectKey string `protobuf:"bytes,5,opt,name=execution_object_key,json=executionObjectKey,proto3" json:"executionObjectKey,omitempty"`
	// ClaimEpoch is the Execution claim epoch granted to the caller's handle.
	// It is fixed for this invocation, even if the stored Execution is reclaimed.
	// Zero indicates an access-only handle with no Execution claim.
	ClaimEpoch uint64 `protobuf:"varint,6,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// contains filtered or unexported fields
}

PluginExecRequest asks a loaded plugin to execute a controller.

func (*PluginExecRequest) CloneMessageVT added in v0.51.0

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

func (*PluginExecRequest) CloneVT added in v0.51.0

func (m *PluginExecRequest) CloneVT() *PluginExecRequest

func (*PluginExecRequest) EqualMessageVT added in v0.51.0

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

func (*PluginExecRequest) EqualVT added in v0.51.0

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

func (*PluginExecRequest) GetAttachedEngineResourceId

func (x *PluginExecRequest) GetAttachedEngineResourceId() uint32

func (*PluginExecRequest) GetClaimEpoch

func (x *PluginExecRequest) GetClaimEpoch() uint64

func (*PluginExecRequest) GetControllerConfig added in v0.51.0

func (x *PluginExecRequest) GetControllerConfig() []byte

func (*PluginExecRequest) GetControllerId added in v0.51.0

func (x *PluginExecRequest) GetControllerId() string

func (*PluginExecRequest) GetExecutionObjectKey

func (x *PluginExecRequest) GetExecutionObjectKey() string

func (*PluginExecRequest) GetInputs added in v0.51.0

func (x *PluginExecRequest) GetInputs() []*value.Value

func (*PluginExecRequest) MarshalJSON added in v0.51.0

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

MarshalJSON marshals the PluginExecRequest to JSON.

func (*PluginExecRequest) MarshalProtoJSON added in v0.51.0

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

MarshalProtoJSON marshals the PluginExecRequest message to JSON.

func (*PluginExecRequest) MarshalProtoText added in v0.51.0

func (x *PluginExecRequest) MarshalProtoText() string

func (*PluginExecRequest) MarshalToSizedBufferVT added in v0.51.0

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

func (*PluginExecRequest) MarshalToVT added in v0.51.0

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

func (*PluginExecRequest) MarshalVT added in v0.51.0

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

func (*PluginExecRequest) ProtoMessage added in v0.51.0

func (*PluginExecRequest) ProtoMessage()

func (*PluginExecRequest) Reset added in v0.51.0

func (x *PluginExecRequest) Reset()

func (*PluginExecRequest) SizeVT added in v0.51.0

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

func (*PluginExecRequest) String added in v0.51.0

func (x *PluginExecRequest) String() string

func (*PluginExecRequest) UnmarshalJSON added in v0.51.0

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

UnmarshalJSON unmarshals the PluginExecRequest from JSON.

func (*PluginExecRequest) UnmarshalProtoJSON added in v0.51.0

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

UnmarshalProtoJSON unmarshals the PluginExecRequest message from JSON.

func (*PluginExecRequest) UnmarshalVT added in v0.51.0

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

type PluginExecResponse added in v0.51.0

type PluginExecResponse struct {

	// Logs are execution logs to append to the Forge execution.
	Logs []*PluginExecLog `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
	// Outputs are Forge execution outputs to set.
	Outputs []*value.Value `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// Error is the plugin execution failure message, if any.
	Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// OutputFiles are files to import as the default UnixFS "output" value.
	OutputFiles []*PluginExecOutputFile `protobuf:"bytes,4,rep,name=output_files,json=outputFiles,proto3" json:"outputFiles,omitempty"`
	// contains filtered or unexported fields
}

PluginExecResponse contains controller logs, outputs, and optional failure.

func (*PluginExecResponse) CloneMessageVT added in v0.51.0

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

func (*PluginExecResponse) CloneVT added in v0.51.0

func (m *PluginExecResponse) CloneVT() *PluginExecResponse

func (*PluginExecResponse) EqualMessageVT added in v0.51.0

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

func (*PluginExecResponse) EqualVT added in v0.51.0

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

func (*PluginExecResponse) GetError added in v0.51.0

func (x *PluginExecResponse) GetError() string

func (*PluginExecResponse) GetLogs added in v0.51.0

func (x *PluginExecResponse) GetLogs() []*PluginExecLog

func (*PluginExecResponse) GetOutputFiles added in v0.51.0

func (x *PluginExecResponse) GetOutputFiles() []*PluginExecOutputFile

func (*PluginExecResponse) GetOutputs added in v0.51.0

func (x *PluginExecResponse) GetOutputs() []*value.Value

func (*PluginExecResponse) MarshalJSON added in v0.51.0

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

MarshalJSON marshals the PluginExecResponse to JSON.

func (*PluginExecResponse) MarshalProtoJSON added in v0.51.0

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

MarshalProtoJSON marshals the PluginExecResponse message to JSON.

func (*PluginExecResponse) MarshalProtoText added in v0.51.0

func (x *PluginExecResponse) MarshalProtoText() string

func (*PluginExecResponse) MarshalToSizedBufferVT added in v0.51.0

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

func (*PluginExecResponse) MarshalToVT added in v0.51.0

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

func (*PluginExecResponse) MarshalVT added in v0.51.0

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

func (*PluginExecResponse) ProtoMessage added in v0.51.0

func (*PluginExecResponse) ProtoMessage()

func (*PluginExecResponse) Reset added in v0.51.0

func (x *PluginExecResponse) Reset()

func (*PluginExecResponse) SizeVT added in v0.51.0

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

func (*PluginExecResponse) String added in v0.51.0

func (x *PluginExecResponse) String() string

func (*PluginExecResponse) UnmarshalJSON added in v0.51.0

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

UnmarshalJSON unmarshals the PluginExecResponse from JSON.

func (*PluginExecResponse) UnmarshalProtoJSON added in v0.51.0

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

UnmarshalProtoJSON unmarshals the PluginExecResponse message from JSON.

func (*PluginExecResponse) UnmarshalVT added in v0.51.0

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

type PluginFrontend

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

PluginFrontend retains the compiler while its authoring Watch is open. Fetch and Send borrow that lifetime; ending Watch ends the execution grant.

func NewPluginFrontend

func NewPluginFrontend(service frontend.SRPCFrontendServer, stop context.CancelFunc) *PluginFrontend

NewPluginFrontend binds one compiler to its authoring attachment lifetime.

func (*PluginFrontend) Fetch

Fetch forwards module requests through the existing compiler service.

func (*PluginFrontend) Send

Send forwards a message to the retained compiler's current session.

func (*PluginFrontend) Watch

Watch owns the attachment until its stream ends, including startup failure.

type Registry

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

Registry maps exec config IDs to handler factories.

func NewDefaultRegistry

func NewDefaultRegistry() *Registry

NewDefaultRegistry creates a registry with all built-in space exec handlers.

func NewDefaultRegistryWithBus added in v0.51.0

func NewDefaultRegistryWithBus(b bus.Bus) *Registry

NewDefaultRegistryWithBus creates a registry with all built-in space exec handlers, including handlers that need the controller bus.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

func (*Registry) ConfigIDs

func (r *Registry) ConfigIDs() []string

ConfigIDs returns all registered config IDs.

func (*Registry) CreateHandler

func (r *Registry) CreateHandler(
	ctx context.Context,
	le *logrus.Entry,
	ws world.WorldState,
	handle forge_target.ExecControllerHandle,
	inputs forge_target.InputMap,
	configID string,
	configData []byte,
) (Handler, error)

CreateHandler looks up and constructs a handler for the given config ID.

func (*Registry) Lookup

func (r *Registry) Lookup(configID string) HandlerFactory

Lookup returns the factory for the given config ID, or nil if not found.

func (*Registry) Register

func (r *Registry) Register(configID string, factory HandlerFactory)

Register adds a handler factory for the given config ID.

type SRPCPluginExecServiceClient added in v0.51.0

type SRPCPluginExecServiceClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// Execute runs a plugin-owned execution controller.
	Execute(ctx context.Context, in *PluginExecRequest) (*PluginExecResponse, error)
	// ExecuteStream runs a plugin-owned execution controller and streams logs.
	ExecuteStream(ctx context.Context, in *PluginExecRequest) (SRPCPluginExecService_ExecuteStreamClient, error)
}

func NewSRPCPluginExecServiceClient added in v0.51.0

func NewSRPCPluginExecServiceClient(cc srpc.Client) SRPCPluginExecServiceClient

func NewSRPCPluginExecServiceClientWithServiceID added in v0.51.0

func NewSRPCPluginExecServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCPluginExecServiceClient

type SRPCPluginExecServiceHandler added in v0.51.0

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

func (SRPCPluginExecServiceHandler) GetMethodIDs added in v0.51.0

func (SRPCPluginExecServiceHandler) GetMethodIDs() []string

func (*SRPCPluginExecServiceHandler) GetServiceID added in v0.51.0

func (d *SRPCPluginExecServiceHandler) GetServiceID() string

func (*SRPCPluginExecServiceHandler) InvokeMethod added in v0.51.0

func (d *SRPCPluginExecServiceHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCPluginExecServiceHandler) InvokeMethod_Execute added in v0.51.0

func (SRPCPluginExecServiceHandler) InvokeMethod_ExecuteStream added in v0.51.2

func (SRPCPluginExecServiceHandler) InvokeMethod_ExecuteStream(impl SRPCPluginExecServiceServer, strm srpc.Stream) error

type SRPCPluginExecServiceServer added in v0.51.0

type SRPCPluginExecServiceServer interface {
	// Execute runs a plugin-owned execution controller.
	Execute(context.Context, *PluginExecRequest) (*PluginExecResponse, error)
	// ExecuteStream runs a plugin-owned execution controller and streams logs.
	ExecuteStream(*PluginExecRequest, SRPCPluginExecService_ExecuteStreamStream) error
}

type SRPCPluginExecService_ExecuteStream added in v0.51.0

type SRPCPluginExecService_ExecuteStream interface {
	srpc.Stream
}

type SRPCPluginExecService_ExecuteStreamClient added in v0.51.2

type SRPCPluginExecService_ExecuteStreamClient interface {
	srpc.Stream
	Recv() (*PluginExecResponse, error)
	RecvTo(*PluginExecResponse) error
}

type SRPCPluginExecService_ExecuteStreamStream added in v0.51.2

type SRPCPluginExecService_ExecuteStreamStream interface {
	srpc.Stream
	Send(*PluginExecResponse) error
	SendAndClose(*PluginExecResponse) error
}

type SpaceExecConfig

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

SpaceExecConfig is a generic config type for space-exec handlers. It wraps raw config data bytes and a config ID, satisfying the config.Config, protobuf_go_lite.Message, and block.Block interfaces.

The actual config deserialization happens inside each HandlerFactory, so this type just carries the raw bytes through the controllerbus config resolution pipeline (LoadConfigConstructorByID -> Resolve -> LoadFactoryByConfig -> Construct).

func NewSpaceExecConfig

func NewSpaceExecConfig(configID string) *SpaceExecConfig

NewSpaceExecConfig constructs a SpaceExecConfig with the given config ID.

func (*SpaceExecConfig) EqualsConfig

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

EqualsConfig checks equality by config ID and data.

func (*SpaceExecConfig) GetConfigID

func (c *SpaceExecConfig) GetConfigID() string

GetConfigID returns the config ID.

func (*SpaceExecConfig) MarshalBlock

func (c *SpaceExecConfig) MarshalBlock() ([]byte, error)

MarshalBlock returns the raw data for block storage.

func (*SpaceExecConfig) MarshalJSON

func (c *SpaceExecConfig) MarshalJSON() ([]byte, error)

MarshalJSON returns the raw data (assumed JSON or empty).

func (*SpaceExecConfig) MarshalToSizedBufferVT

func (c *SpaceExecConfig) MarshalToSizedBufferVT(buf []byte) (int, error)

MarshalToSizedBufferVT marshals to a pre-allocated buffer.

func (*SpaceExecConfig) MarshalVT

func (c *SpaceExecConfig) MarshalVT() ([]byte, error)

MarshalVT returns the raw data.

func (*SpaceExecConfig) Reset

func (c *SpaceExecConfig) Reset()

Reset clears the data.

func (*SpaceExecConfig) SizeVT

func (c *SpaceExecConfig) SizeVT() int

SizeVT returns the size of the data.

func (*SpaceExecConfig) UnmarshalBlock

func (c *SpaceExecConfig) UnmarshalBlock(data []byte) error

UnmarshalBlock stores the raw block data.

func (*SpaceExecConfig) UnmarshalJSON

func (c *SpaceExecConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON stores the raw JSON bytes.

func (*SpaceExecConfig) UnmarshalVT

func (c *SpaceExecConfig) UnmarshalVT(data []byte) error

UnmarshalVT stores the raw protobuf bytes.

func (*SpaceExecConfig) Validate

func (c *SpaceExecConfig) Validate() error

Validate returns nil; validation happens in the handler factory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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