nemo-relay-plugin
nemo-relay-plugin
Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
Stable native plugin ABI and Rust authoring helpers for NeMo Relay.
This crate intentionally does not depend on the nemo-relay runtime crate. Native plugins built with it communicate with a host through versioned C-compatible tables and host-owned string handles.
Macros
- nemo_relay_plugin: Exports a concrete plugin constructor as a native plugin entry symbol body.
Structs
- AnnotatedLlmRequest: Structured view of an LLM request, produced by a Codec from opaque
LlmRequestcontent. - AnnotatedLlmResponse: Structured view of an LLM response, produced by a response codec from raw JSON API output.
- CategoryProfile: Category-specific profile data.
- ConfigDiagnostic: Structured validation diagnostic for plugin validation.
- EventCategory: Semantic category carried by ATOF
category. - LlmAttributes: Bitflags that modify LLM-call behavior and observability.
- LlmNext: Typed continuation passed to LLM execution intercepts.
- LlmRequest: JSON-shaped LLM request payload passed through the runtime.
- LlmRequestInterceptOutcome: Result of an LLM request intercept that can schedule lifecycle marks.
- LlmStream: Host- or plugin-owned stream returned across the native LLM stream ABI.
- LlmStreamNext: Typed continuation passed to LLM stream execution intercepts.
- NemoRelayNativeHostApiV1: Versioned host API table passed to native plugin entry symbols.
- NemoRelayNativeLlmStreamV1: Native LLM JSON stream handle table.
- NemoRelayNativePluginContext: Opaque plugin registration context borrowed from the host during registration.
- NemoRelayNativePluginV1: Versioned plugin descriptor returned by native plugin entry symbols.
- NemoRelayNativeScopeHandle: Opaque host-owned scope handle.
- NemoRelayNativeScopeStack: Opaque host-owned scope stack handle.
- NemoRelayNativeScopeStackBinding: Opaque host-owned captured scope-stack binding.
- NemoRelayNativeString: Opaque host-owned UTF-8 string or JSON byte buffer.
- PendingMarkSpec: Mark requested by middleware for materialization by a lifecycle owner.
- PluginContext: Borrowed safe wrapper around a host plugin registration context.
- PluginRuntime: Cloneable high-level runtime handle for host APIs available to native plugins.
- ScopeAttributes: Bitflags that modify scope behavior and observability.
- ScopeGuard: RAII guard for a host scope opened by
PluginRuntime::scope. - ScopeHandle: Host-owned scope handle returned by native scope APIs.
- ScopeStack: Host-owned isolated scope stack returned by native scope-stack APIs.
- ScopeStackBinding: Captured thread-local scope-stack binding.
- ThreadScopeStackGuard: RAII guard that restores the previous thread-local scope stack on drop.
- ToolAttributes: Bitflags that modify tool-call behavior and observability.
- ToolExecutionInterceptOutcome: Canonical result returned by a tool execution intercept.
- ToolNext: Typed continuation passed to tool execution intercepts.
Enums
- DiagnosticLevel: Diagnostic severity returned by plugin validation.
- Event: Tagged union covering the two ATOF event kinds emitted by the runtime.
- HandleAttributes: Attribute bitflags attached to a concrete handle kind.
- NemoRelayNativeScopeType: Scope category used by native plugins when opening scopes.
- NemoRelayStatus: Status codes returned by stable native ABI functions.
- ScopeCategory: Agent Trajectory Observability Format (ATOF) lifecycle phase for a scope event.
- ScopeType: Semantic category attached to a scope lifecycle span.
Constants
- NEMO_RELAY_NATIVE_ABI_VERSION: Native plugin ABI version supported by this crate.
Traits
- NativePlugin: Trait implemented by Rust native plugins.
Functions
- capture_scope_stack_thread: Captures the current thread-local scope-stack binding.
- create_scope_stack: Creates a new independent scope stack.
- current_scope: Retrieves the current scope handle.
- emit_mark: Emits a mark event under the current scope.
- export_plugin: Initializes a native plugin descriptor for a Rust SDK plugin value.
- pop_scope: Pops a scope and emits its end event.
- push_scope: Pushes a scope and emits its start event.
Type Aliases
- Json: Type alias for
serde_json::Value, used as the universal JSON representation throughout NeMo Relay APIs. - LlmJsonStream: Synchronous JSON chunk stream used by native LLM stream intercept helpers.
- NemoRelayNativeEventSubscriberCb: Native event subscriber callback.
- NemoRelayNativeFreeFn: Optional destructor for user data captured by native callbacks.
- NemoRelayNativeJsonCb: Native JSON transform callback for LLM response sanitizers.
- NemoRelayNativeLlmConditionalCb: Native LLM conditional-execution callback.
- NemoRelayNativeLlmExecutionCb: Native LLM execution intercept callback.
- NemoRelayNativeLlmNextFn: Runtime-provided continuation for LLM execution intercepts.
- NemoRelayNativeLlmRequestCb: Native LLM request transform callback for request sanitizers.
- NemoRelayNativeLlmRequestInterceptCb: Native LLM request intercept callback.
- NemoRelayNativeLlmStreamCancelFn: Optional native stream cancellation callback.
- NemoRelayNativeLlmStreamDropFn: Optional native stream destructor callback.
- NemoRelayNativeLlmStreamExecutionCb: Native LLM stream execution intercept callback.
- NemoRelayNativeLlmStreamNextFn: Runtime-provided continuation for LLM stream execution intercepts.
- NemoRelayNativeLlmStreamPollFn: Native stream poll callback.
- NemoRelayNativePluginDropFn: Native plugin drop callback.
- NemoRelayNativePluginEntry: Native entry symbol type loaded by the host.
- NemoRelayNativePluginRegisterFn: Native plugin registration callback.
- NemoRelayNativePluginValidateFn: Native plugin validation callback.
- NemoRelayNativeToolConditionalCb: Native tool conditional-execution callback.
- NemoRelayNativeToolExecutionCb: Native tool execution intercept callback.
- NemoRelayNativeToolJsonCb: Native JSON transform callback for tool request/response sanitizers and tool request intercepts.
- NemoRelayNativeToolNextFn: Runtime-provided continuation for tool execution intercepts.
- NemoRelayNativeWithScopeStackCb: Native callback executed while a host scope stack is temporarily active.
- Result: Result type used by the Rust native plugin SDK.