Expand description
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§
- Annotated
LlmRequest - Structured view of an LLM request, produced by a Codec from opaque
LlmRequestcontent. - Annotated
LlmResponse - Structured view of an LLM response, produced by a response codec from raw JSON API output.
- Category
Profile - Category-specific profile data.
- Config
Diagnostic - Structured validation diagnostic for plugin validation.
- Event
Category - 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.
- LlmRequest
Intercept Outcome - Result of an LLM request intercept that can schedule lifecycle marks.
- LlmStream
- Host- or plugin-owned stream returned across the native LLM stream ABI.
- LlmStream
Next - Typed continuation passed to LLM stream execution intercepts.
- Nemo
Relay Native Host ApiV1 - Versioned host API table passed to native plugin entry symbols.
- Nemo
Relay Native LlmStream V1 - Native LLM JSON stream handle table.
- Nemo
Relay Native Plugin Context - Opaque plugin registration context borrowed from the host during registration.
- Nemo
Relay Native Plugin V1 - Versioned plugin descriptor returned by native plugin entry symbols.
- Nemo
Relay Native Scope Handle - Opaque host-owned scope handle.
- Nemo
Relay Native Scope Stack - Opaque host-owned scope stack handle.
- Nemo
Relay Native Scope Stack Binding - Opaque host-owned captured scope-stack binding.
- Nemo
Relay Native String - Opaque host-owned UTF-8 string or JSON byte buffer.
- Pending
Mark Spec - Mark requested by middleware for materialization by a lifecycle owner.
- Plugin
Context - Borrowed safe wrapper around a host plugin registration context.
- Plugin
Runtime - Cloneable high-level runtime handle for host APIs available to native plugins.
- Scope
Attributes - Bitflags that modify scope behavior and observability.
- Scope
Guard - RAII guard for a host scope opened by
PluginRuntime::scope. - Scope
Handle - Host-owned scope handle returned by native scope APIs.
- Scope
Stack - Host-owned isolated scope stack returned by native scope-stack APIs.
- Scope
Stack Binding - Captured thread-local scope-stack binding.
- Thread
Scope Stack Guard - RAII guard that restores the previous thread-local scope stack on drop.
- Tool
Attributes - Bitflags that modify tool-call behavior and observability.
- Tool
Execution Intercept Outcome - Canonical result returned by a tool execution intercept.
- Tool
Next - Typed continuation passed to tool execution intercepts.
Enums§
- Diagnostic
Level - Diagnostic severity returned by plugin validation.
- Event
- Tagged union covering the two ATOF event kinds emitted by the runtime.
- Handle
Attributes - Attribute bitflags attached to a concrete handle kind.
- Nemo
Relay Native Scope Type - Scope category used by native plugins when opening scopes.
- Nemo
Relay Status - Status codes returned by stable native ABI functions.
- Scope
Category - Agent Trajectory Observability Format (ATOF) lifecycle phase for a scope event.
- Scope
Type - Semantic category attached to a scope lifecycle span.
Constants§
- NEMO_
RELAY_ NATIVE_ ABI_ VERSION - Native plugin ABI version supported by this crate.
Traits§
- Native
Plugin - 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. - LlmJson
Stream - Synchronous JSON chunk stream used by native LLM stream intercept helpers.
- Nemo
Relay Native Event Subscriber Cb - Native event subscriber callback.
- Nemo
Relay Native Free Fn - Optional destructor for user data captured by native callbacks.
- Nemo
Relay Native Json Cb - Native JSON transform callback for LLM response sanitizers.
- Nemo
Relay Native LlmConditional Cb - Native LLM conditional-execution callback.
- Nemo
Relay Native LlmExecution Cb - Native LLM execution intercept callback.
- Nemo
Relay Native LlmNext Fn - Runtime-provided continuation for LLM execution intercepts.
- Nemo
Relay Native LlmRequest Cb - Native LLM request transform callback for request sanitizers.
- Nemo
Relay Native LlmRequest Intercept Cb - Native LLM request intercept callback.
- Nemo
Relay Native LlmStream Cancel Fn - Optional native stream cancellation callback.
- Nemo
Relay Native LlmStream Drop Fn - Optional native stream destructor callback.
- Nemo
Relay Native LlmStream Execution Cb - Native LLM stream execution intercept callback.
- Nemo
Relay Native LlmStream Next Fn - Runtime-provided continuation for LLM stream execution intercepts.
- Nemo
Relay Native LlmStream Poll Fn - Native stream poll callback.
- Nemo
Relay Native Plugin Drop Fn - Native plugin drop callback.
- Nemo
Relay Native Plugin Entry - Native entry symbol type loaded by the host.
- Nemo
Relay Native Plugin Register Fn - Native plugin registration callback.
- Nemo
Relay Native Plugin Validate Fn - Native plugin validation callback.
- Nemo
Relay Native Tool Conditional Cb - Native tool conditional-execution callback.
- Nemo
Relay Native Tool Execution Cb - Native tool execution intercept callback.
- Nemo
Relay Native Tool Json Cb - Native JSON transform callback for tool request/response sanitizers and tool request intercepts.
- Nemo
Relay Native Tool Next Fn - Runtime-provided continuation for tool execution intercepts.
- Nemo
Relay Native With Scope Stack Cb - Native callback executed while a host scope stack is temporarily active.
- Result
- Result type used by the Rust native plugin SDK.