Skip to content

Class InstalledKernel

Namespace: DotBoxD.Plugins.Kernel
Assembly: DotBoxD.Plugins.dll

Request/response invocation for a server extension kernel: the path that runs a verified batch entrypoint server-side in one call and returns its result. Kept in a partial alongside the event ShouldHandle/Handle path in DotBoxD.Plugins.Kernel.InstalledKernel.

public sealed class InstalledKernel

objectInstalledKernel

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

public string? CallbackSubscriptionId { get; }

string?

public IReadOnlyList<PluginExecutionObservation> ExecutionObservations { get; }

IReadOnlyList<PluginExecutionObservation>

public string InstallId { get; }

string

public bool IsRevoked { get; }

bool

public Exception? LastAsyncUpdateError { get; }

Exception?

public PluginExecutionObservation? LastExecution { get; }

PluginExecutionObservation?

public PluginManifest Manifest { get; }

PluginManifest

Opaque owner token of the session that installed this kernel, or null for kernels installed directly on the server (no session). Used by DotBoxD.Plugins.KernelRegistry to reject cross-owner id reuse so one plugin cannot replace another plugin’s kernel.

public object? OwnerId { get; }

object?

public PluginPackage Package { get; }

PluginPackage

public LiveSettingStore Value { get; }

LiveSettingStore

public TypedInstalledKernel<TSettings> As<TSettings>() where TSettings : class

TypedInstalledKernel<TSettings>

TSettings

public ValueTask FlushUpdatesAsync(CancellationToken cancellationToken = default)

cancellationToken CancellationToken

ValueTask

HandleAsync<TEvent>(IPluginEventAdapter<TEvent>, TEvent, CancellationToken)

Section titled “ HandleAsync<TEvent>(IPluginEventAdapter<TEvent>, TEvent, CancellationToken)”
public ValueTask HandleAsync<TEvent>(IPluginEventAdapter<TEvent> adapter, TEvent e, CancellationToken cancellationToken = default)

adapter IPluginEventAdapter<TEvent>

e TEvent

cancellationToken CancellationToken

ValueTask

TEvent

InvokeServerExtensionAsync(IReadOnlyList<SandboxValue>, CancellationToken)

Section titled “ InvokeServerExtensionAsync(IReadOnlyList<SandboxValue>, CancellationToken)”

Invokes the kernel’s server-extension entrypoint request/response: the caller arguments are bound to the entrypoint’s leading parameters (live settings fill the trailing ones), the verified IR runs once under the execution gate, and its result value is returned. Unlike DotBoxD.Plugins.Kernel.InstalledKernel.HandleAsync(DotBoxD.Abstractions.IPluginEventAdapter{},,System.Threading.CancellationToken) the result is not discarded. The kernel must have been installed via DotBoxD.Plugins.PluginServer.InstallServerExtensionAsync(DotBoxD.Plugins.PluginPackage,DotBoxD.Kernels.SandboxPolicy,System.Threading.CancellationToken) (its manifest declares the rpcEntrypoint).

public ValueTask<SandboxValue> InvokeServerExtensionAsync(IReadOnlyList<SandboxValue> arguments, CancellationToken cancellationToken = default)

arguments IReadOnlyList<SandboxValue>

cancellationToken CancellationToken

ValueTask<SandboxValue>

InvokeServerExtensionRpcAsync(byte[], CancellationToken)

Section titled “ InvokeServerExtensionRpcAsync(byte[], CancellationToken)”

Invokes this server extension over the RPC wire codec in one step: decodes the caller arguments from arguments, converts each to a sandbox value against the verified entrypoint’s parameter types, runs DotBoxD.Plugins.Kernel.InstalledKernel.InvokeServerExtensionAsync(System.Collections.Generic.IReadOnlyList{DotBoxD.Kernels.Sandbox.SandboxValue},System.Threading.CancellationToken), and encodes the result back to bytes. This is the marshalling ceremony every host used to hand-write; the host keeps only the ownership/authz check (e.g. DotBoxD.Plugins.PluginSession.Owns(System.String)) before calling it. The result is encoded directly from its sandbox value through the byte-identical wire codec, avoiding an intermediate DotBoxD.Plugins.KernelRpcValue tree.

public ValueTask<byte[]> InvokeServerExtensionRpcAsync(byte[] arguments, CancellationToken cancellationToken = default)

arguments byte[]

cancellationToken CancellationToken

ValueTask<byte[]>

ModifySettingsAsync(IReadOnlyDictionary<string, object?>, bool, CancellationToken)

Section titled “ ModifySettingsAsync(IReadOnlyDictionary<string, object?>, bool, CancellationToken)”
public ValueTask ModifySettingsAsync(IReadOnlyDictionary<string, object?> values, bool atomic = false, CancellationToken cancellationToken = default)

values IReadOnlyDictionary<string, object?>

atomic bool

cancellationToken CancellationToken

ValueTask

public void Revoke()

ShouldHandleAsync<TEvent>(IPluginEventAdapter<TEvent>, TEvent, CancellationToken)

Section titled “ ShouldHandleAsync<TEvent>(IPluginEventAdapter<TEvent>, TEvent, CancellationToken)”
public ValueTask<bool> ShouldHandleAsync<TEvent>(IPluginEventAdapter<TEvent> adapter, TEvent e, CancellationToken cancellationToken = default)

adapter IPluginEventAdapter<TEvent>

e TEvent

cancellationToken CancellationToken

ValueTask<bool>

TEvent