Skip to content

Namespace DotBoxD.Abstractions

CapabilityAttribute

Gates an event property behind a capability. Reading the property from kernel IR contributes DotBoxD.Abstractions.CapabilityAttribute.Id to the manifest’s required capabilities, so a kernel that touches the property only installs under a policy granting it. Unannotated properties stay ungated (default-allow).

GeneratePluginRegistrationAccumulatorAttribute

Requests a generated client-side registration accumulator for a control type. The generated accumulator queues calls to DotBoxD.Abstractions.GeneratePluginRegistrationAccumulatorAttribute.MethodName and flushes them in order when the plugin builder starts.

GeneratePluginRegistrationRootAccumulatorAttribute

Requests a generated root registration accumulator that exposes child accumulators for annotated child control properties.

GeneratePluginServerAttribute

Requests a generated plugin facade and builder for the annotated partial class.

GeneratedKernelMethodDescriptorAttribute

Analyzer-visible generated IR for server-authored SDK context [KernelMethod] helpers.

GeneratedPluginServerRegistryAttribute

Identifies a generated plugin-server hook or subscription registry and the context type its parameterless On<TEvent> method uses.

HandleSubtypeAttribute

Declares one supported subtype for a DotBoxD.Abstractions.PolymorphicHandleAttribute handle. The analyzer lowers handle is T local to {BindingPrefix}.is(key), and instance host-binding calls on the declared subtype receive that key as their leading sandbox argument.

HookAttribute

Associates a hook context type with a stable hook name and exactly one result type, so context.Server.Hooks.On<TContext>() can resolve the result type from the context alone (rather than requiring a second generic argument at the call site). The analyzer reads this attribute to validate that a .Register(…) / .RegisterLocal(…) terminal produces DotBoxD.Abstractions.HookAttribute.ResultType, and persists DotBoxD.Abstractions.HookAttribute.Name as the runtime hook-point identity.

The `DotBoxD.Abstractions.HookAttribute.ResultType` must be a readonly partial record struct decorated with `DotBoxD.Abstractions.HookResultAttribute` that declares a bool Success and a string? Reason field (see that attribute for the contract).

HookContext

HookResultAttribute

Marks a readonly partial record struct as a hook result: a value a .Register(…) / .RegisterLocal(…) terminal returns and the host applies. The DotBoxD generator emits builder members the user did not declare manually — Ok(), Reject(string? reason = null), and a With<Field>(value) per non-discriminator field — so result construction reads fluently and lowers to verified record.new IR.

A hook result must be a top-level readonly partial record struct that declares a bool Success field and a string? Reason field. Success = false means "abstain, fall through to the next matching registration"; a successful result may still carry a domain veto such as CanDie = false, so abstain and veto never overload the same field.

HostBindingAttribute

Marks a host-service method as a sandbox binding the DotBoxD.Kernels generator may call from verified IR. A kernel reaches the service through DotBoxD.Abstractions.HookContext.Host or a constructor-injected service field; the generator lowers that call to a CallExpression(bindingId, …), records the capability and effects, and expects the host to register a matching binding. Set DotBoxD.Abstractions.HostBindingAttribute.IsAsync when that registered binding declares asynchronous host work.

HostBindingIgnoreAttribute

Excludes a method from explicit, automatic, and DotBoxD.Abstractions.HostBindingObjectAttribute host binding resolution.

HostBindingObjectAttribute

Exposes eligible public instance methods declared by an SDK value object as receiver-forwarding host bindings. Binding ids derive from DotBoxD.Abstractions.HostBindingObjectAttribute.BindingPrefix, the method name, and parameter types; methods inherit the default capability and effects unless they declare DotBoxD.Abstractions.HostBindingAttribute.

HostCapabilityAttribute

Declares the capability and host-state effects required by an analyzer-visible host binding contract.

IRBodyOfAttribute

Marks an optional DotBoxD.Abstractions.IRFunc parameter as the generated IR body of another delegate parameter on the same method.

IRExpressionBuilder

Builds sandbox IR expressions for hand-authored lowered pipeline steps.

IRFunc<TInput, TContext, TOutput>

Typed public carrier for an IR body generated from a delegate that receives an element and context.

IRFunc<TInput, TOutput>

Typed public carrier for the IR body generated from a delegate argument.

IRInvocation<TDelegate, TReturn>

Public carrier for a generated anonymous server invocation. The generated plugin facade consumes the package factory as its concrete plugin package type, while abstractions remain independent of the plugin hosting assembly.

IRInvocation<TCaptures, TDelegate, TReturn>

Public carrier for a generated anonymous server invocation whose delegate is paired with an explicit capture bag.

InMemoryPluginMessageSink

KernelMethodAttribute

Marks a reusable helper method whose body the DotBoxD.Kernels generator inlines into the kernel/hook IR at every call site, so plugin authors can factor shared gate/handler logic out of a Where/Select/Run lambda (or a kernel-class ShouldHandle/Handle) without leaving the sandbox. The helper can be a static method, or an instance method called on the generated server-context parameter. For example:

server.Hooks.On<MonsterAggroEvent>()
    .Where((e, ctx) => IsBullying(e.MonsterLevel, e.PlayerLevel))
    .Run((e, ctx) => ctx.Messages.Send(e.MonsterId, "calm"));

[KernelMethod]
public static bool IsBullying(int monsterLevel, int playerLevel) => monsterLevel - playerLevel >= 3;

The call lowers exactly as if the body were written inline: each parameter is replaced by its already-lowered argument IR, and any [HostBinding] calls or [Capability]-gated reads inside the body contribute their capabilities to the calling kernel’s manifest.

Static helpers may be called through ordinary static-call syntax or extension-method syntax, and named arguments plus supported optional parameter defaults are bound before lowering.

Constraints (verified at generation time; a violation fails the chain/kernel safely rather than miscompiling): the method must be static or called on the server-context parameter, have an expression body or a single return statement, and use types the kernel marshaller can represent in the current lowering surface (scalars, supported nullable scalars, enums, GUIDs, records/DTOs, lists, and maps where that surface supports them). Recursion, generic helpers, ref/out/in parameters, and params arrays are not allowed.

LiveSettingAttribute

LowerToIrAttribute

Marks a delegate parameter whose lambda body should be lowered into a mergeable IR step. The method must expose a sibling overload accepting DotBoxD.Abstractions.LoweredPipelineStep.

LowerToIrMethodAttribute

Marks a method whose lambda argument should be lowered into a generated anonymous IR package.

LoweredPipelineComposer

Merges an ordered sequence of mergeable-IR DotBoxD.Abstractions.LoweredPipelineStep fragments into one complete, verifiable DotBoxD.Kernels.SandboxModule. This is the runtime counterpart to the source generator’s build-time hook-chain fusion: a consumer that collected steps from a custom pipeline surface can combine them by hand, which is exactly what “delete the attribute and hand-write it” requires.

LoweredPipelineComposition

Inputs for DotBoxD.Abstractions.LoweredPipelineComposer.Compose(DotBoxD.Abstractions.LoweredPipelineComposition). Carries the ordered mergeable-IR DotBoxD.Abstractions.LoweredPipelineStep fragments plus the small amount of module identity a fragment deliberately does not know (see docs/design/mergeable-ir-fragments).

LoweredPipelineStep

Experimental public carrier for one lowered pipeline stage. A later composer can merge ordered steps into a complete DotBoxD.Kernels.SandboxModule.

NativeOnlyAttribute

Marks a server-authored context helper as native-only and unavailable to lowered IR.

PipelineSurfaceAttribute

Marks a fluent pipeline/stage type as a recognized event-pipeline surface, replacing the generator’s hardcoded receiver-type allow-list. Stage and terminal calls on a marked surface expose explicit IR companion parameters; the source generator supplies those companions through interceptors.

PluginAttribute

PluginMessage

PolymorphicHandleAttribute

Marks a polymorphic host handle type whose sandbox representation is the scalar value stored in the configured key member. Hook contexts may expose the handle type, while generated verified IR receives only the key and calls host bindings to discriminate or query the concrete host-side entity.

ServerExtensionAttribute

Marks a class as a server extension: a batch operation the plugin ships as verified IR and the server runs request/response in a single roundtrip, so a loop over many entities executes server-side (calling the host’s existing bindings) instead of one network call per entity. The generator lowers the class’s single public batch method — its body may use locals, a foreach over a list parameter, host bindings via ctx.Host<T>() or constructor-injected service fields, and may build and return complex objects (records/DTOs) and lists of them. For example:

[ServerExtension("monster-killer", typeof(IMonsterKillerService))]
public sealed partial class MonsterKillerKernel
{
    private readonly IGameWorld _world;
    public MonsterKillerKernel(IGameWorld world) => _world = world;

    public List<KillResult> KillMonsters(List<int> monsterIds, HookContext ctx)
    {
        var results = new List<KillResult>();
        foreach (var id in monsterIds)
            results.Add(new KillResult(id, _world.Kill(id)));
        return results;
    }
}
public readonly record struct KillResult(int MonsterId, bool Success);

The trailing DotBoxD.Abstractions.HookContext parameter is the lowering marker for host bindings (as in a kernel’s Handle) and is not part of the wire signature. Parameters, return type, and DTO fields must use supported scalar types, lists, or nested DTOs. Supplying the optional service interface type lets the analyzer emit a source-generated plugin-side client that marshals directly to compact server-extension value bytes instead of using a reflection proxy.

ServerExtensionClientAttribute

Requests a generated C# 14 extension property on receiverType that resolves the source-generated server extension client for this service. The receiver type must expose a ServerExtensions property whose value can invoke server extensions and resolve the installed service id.

ServerExtensionMethodAttribute

Requests a generated C# 14 extension method on receiverType that forwards to the source-generated server extension client. When name is omitted, the kernel method name is used; supply a custom name to make the receiver’s domain API read naturally or avoid conflicts.

IEventKernel<TEvent>

IExtensibleControl

A domain control that can host plugin-owned server extensions.

IHookResult

The runtime contract every hook result satisfies so dispatch can apply the abstain/fallthrough rule without reflecting on the concrete type: Success == false means “abstain, fall through to the next matching registration”. The DotBoxD generator adds this interface to every DotBoxD.Abstractions.HookResultAttribute record (its Success field implements the member), so authors never write it by hand.

ILiveSettingsHandle<TKernel>

Strongly typed live-settings tuner for an installed kernel.

IPluginEventAdapter<TEvent>

IPluginEventValueWriter<TEvent>

Optional low-allocation event adapter path. Implement this when event values can be written directly into the runtime input buffer; DotBoxD.Abstractions.IPluginEventValueWriter.EventValueCount must match DotBoxD.Abstractions.IPluginEventAdapter.Parameters.

IPluginMessageSink

IPluginServer<TWorld>

Lifecycle and anonymous server-side invocation surface mixed into a generated plugin facade.

IServerExtensionClientAccessor

IServerExtensionClientRegistry

Registry used by generated domain controls to resolve server-extension clients.

IServerExtensionWireClient

Wire client used by generated server-extension proxies.

IServiceControl

The root plugin-service control verbs exposed by a generated plugin facade.

GeneratedPluginServerRegistryKind

HostBindingEffect

Explicit host-service effects for analyzer-visible auto bindings.

LoweredIrMethodKind

Describes method-level source-generator lowering into verified IR.

LoweredPipelineStepKind

Describes the pipeline semantics of a delegate argument lowered into a mergeable IR step.

PipelineTransport

Whether a pipeline surface runs entirely in-host or ships its lowered kernel across the remote transport.

RemoteServerInvocation<TWorld, TCaptures, TReturn>

Lambda shape for the explicit capture-bag invoke overload on DotBoxD.Abstractions.IPluginServer.