Documentation
¶
Overview ¶
Package plugin adapts frozen capability runtime artifacts into N.O.R.E.'s in-process CapabilityRuntime contract. A ResolvedCapabilityRuntime is hosted by a runtime backend (process, wasm) selected by the artifact's declared runtime kind.
The plugin package is the boundary between the frozen capability runtime set persisted with a registered assembly and the runtime backends in nore/internal/backend. It owns no process, socket, or WASM machinery itself; it only maps a ResolvedCapabilityRuntime to a runtime backend instance.
Index ¶
- func CloseSharedRuntimes(ctx context.Context) error
- func DecodeResolvedCapabilityRuntimes(payload any) ([]capabilityrt.ResolvedCapabilityRuntime, error)
- func NewAdapter(resolved capabilityrt.ResolvedCapabilityRuntime) (contracts.CapabilityRuntime, error)
- func RegisterResolvedCapabilityRuntimes(reg contracts.CapabilityRuntimeRegistry, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseSharedRuntimes ¶
CloseSharedRuntimes releases the resources the capability runtime backends hold for the whole process, and is the last step of a graceful N.O.R.E. shutdown.
Instances stop first, because that is where each of them gives up its own reference on the backend instance it used. What remains is the state a backend keeps with no per-instance handle: the process backend's worker pools, and the WASM backend's compiled-module cache and sandbox runtime, which is created once and cannot be recreated after being closed. Leaving that state behind would keep worker processes alive after the daemon that owned them is gone.
func DecodeResolvedCapabilityRuntimes ¶
func DecodeResolvedCapabilityRuntimes(payload any) ([]capabilityrt.ResolvedCapabilityRuntime, error)
DecodeResolvedCapabilityRuntimes extracts the frozen capability runtime set from the opaque ExecutionConfigurations payload stored on a RegisteredAssembly. The payload is JSON-round-tripped so it works for both typed values and values re-read from disk as map[string]any.
Only the frozen set crosses the module boundary today; every other configuration key stays opaque to the runtime. The key itself comes from shared so the CLI that writes it and the runtime that reads it cannot drift apart.
func NewAdapter ¶
func NewAdapter(resolved capabilityrt.ResolvedCapabilityRuntime) (contracts.CapabilityRuntime, error)
NewAdapter builds the runtime adapter matching a frozen capability runtime's runtime kind. It rejects kinds this build cannot host. An empty kind defaults to the process backend (the original capability runtime model).
func RegisterResolvedCapabilityRuntimes ¶
func RegisterResolvedCapabilityRuntimes(reg contracts.CapabilityRuntimeRegistry, resolved []capabilityrt.ResolvedCapabilityRuntime) error
RegisterResolvedCapabilityRuntimes registers a runtime adapter for every frozen type that does not already have an in-process capability runtime (core capability runtimes win). The adapter is chosen by the capability runtime's runtime kind.
Types ¶
This section is empty.