nemo-relay-plugin
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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.
Shared in-process plugin contracts, stable native ABI, and Rust authoring helpers.
This crate intentionally does not depend on the nemo-relay runtime crate. Native plugins built with it communicate with a host through versioned checked ABI-safe values and foreign futures.
Re-exports
pub use nemo_relay_plugin_abi as abi;
Modules
- abi_value: Lossless SDK JSON conversions. Typed JSON conversion without encoding or parsing JSON text.
- component: Shared built-in component contracts. In-process plugin contracts shared by built-in components and runtime hosts.
- diagnostics: Diagnostic submission and authorized reads. Native diagnostic authoring and explicitly authorized canonical reads. Recording is synchronous, state-only, and independent of operational logs. Disabled/unsupported facades skip factories. Diagnostic errors must not be propagated as plugin execution failures unless the application chooses so.
Macros
- nemo_relay_checked_plugin: Export a native plugin with SDK-derived checked contract metadata.
- nemo_relay_plugin: Export a checked native plugin with its SDK-required contract version.
- relay_debug: Emit a formatted debug-level native-plugin record through the Relay host.
- relay_error: Emit a formatted error-level native-plugin record through the Relay host.
- relay_info: Emit a formatted info-level native-plugin record through the Relay host.
- relay_trace: Emit a formatted trace-level native-plugin record through the Relay host.
- relay_warn: Emit a formatted warn-level native-plugin record through the Relay host.
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.
- ApplicationExecutionContext: Concrete invocation-local context owned by Relay.
- CategoryProfile: Category-specific profile data.
- ConditionalMiddlewareGuardrailHandle
- ConfigDiagnostic: Structured diagnostic reported while validating or activating plugin configuration.
- ContentSnapshot: Owned snapshot; materialization copies selected content for transport or independent retention.
- CostEstimate: Normalized LLM response cost.
- DataSchema: Identifier for the schema that describes an event’s opaque
datapayload. - EmitMarkOptions: Optional event parent, time, schema, and severity for a native mark.
- EventCategory: Semantic category carried by ATOF
category. - EventSanitizeFields: Observability fields that event sanitizers may rewrite.
- LlmApplicationExecutionContext: Application data passed to execution intercepts for one LLM call. Application context for one LLM call.
- LlmAttributes: Bitflags that modify LLM-call behavior and observability.
- LlmExecutionContext
- LlmInputStream: Downstream LLM stream that reports whether its cleanup succeeded.
- LlmNext
- LlmOptimizationContribution: One optimizer’s evidence for a change to an LLM call.
- LlmOptimizationKind: Open, forward-compatible optimization classification.
- LlmOptimizationModel: Model identity used for counterfactual and effective pricing.
- LlmOptimizationModelTransition: A model change proposed or applied by an optimizer.
- LlmOptimizationSummary: Close-time accounting attached to the normalized LLM response.
- LlmOptimizationTokenImpact: Shared token evidence that Relay can aggregate without understanding a plugin payload.
- LlmOptimizationTokens: Token quantities retained independently from pricing arithmetic.
- LlmRequest: JSON-shaped LLM request payload passed through the runtime.
- LlmRequestContext
- LlmRequestInterceptOutcome: Result of an LLM request intercept that can schedule lifecycle marks.
- LlmResponseContext
- LlmSanitizeRequestContext
- LlmSanitizeResponseContext
- LlmStreamNext
- Map: Represents a JSON key/value type.
- MetricEnvelope: Payload stored in a mark using
METRIC_DATA_SCHEMA_NAME. - MetricMeasurement: One recording operation in a Relay metric mark.
- NativeExecutorConfig: Configuration used when a native plugin opts into a shared Tokio runtime.
- PendingMarkSpec: Mark requested by middleware for materialization by a lifecycle owner.
- PluginContext
- PluginRuntime
- PluginTaskSpawner: Cloneable admission handle for background tasks owned by one native component.
- RuntimeDiagnostic: One bounded runtime diagnostic reported by the Relay host.
- RuntimeDiagnostics: Bounded snapshot of active host runtime diagnostics.
- RuntimeRegistrationIdentity: Structured identity for a global gateable runtime registration.
- RuntimeRegistrationOwner: Discovery metadata describing the owner of a runtime registration.
- ScopeAttributes: Bitflags that modify scope behavior and observability.
- ScopeGuard
- ScopeHandle
- ScopeOptions: Optional parent, behavior flags, and start time for a native scope.
- ScopeStack
- ScopeStackBinding
- ScopeStackEntry: Identity of one entry in the visible Relay scope stack.
- ScopeStackSnapshot: Owned root-to-top values from one coherent read of a visible scope stack.
- ThreadScopeStackGuard
- ToolAttributes: Bitflags that modify tool-call behavior and observability.
- ToolExecutionContext: Transport-independent input supplied to a plugin tool execution interceptor.
- ToolExecutionInterceptOutcome: Canonical result returned by a tool execution intercept.
- ToolExecutionResult: Canonical application-visible result of tool execution.
- ToolNext
- Usage: Token usage statistics from an LLM API response.
Enums
- BuiltinLlmCodec: Relay’s built-in LLM codec identities.
- ContentSelection: Selection applied before extraction. Invalid source/selection pairs are errors.
- ContentSource: Borrowed normalized input for content inspection; no provider decoding occurs.
- DiagnosticLevel: Severity of a plugin configuration or activation diagnostic.
- Event: Tagged union covering the two ATOF event kinds emitted by the runtime.
- HandleAttributes: Attribute bitflags attached to a concrete handle kind.
- LlmCodecIdentity: Per-call LLM codec identity supplied to sanitizer and SDK callbacks.
- LlmOptimizationEvidenceQuality: Whether token evidence was observed directly or estimated.
- LlmOptimizationSummaryStatus: Completeness of close-time optimization accounting.
- LogSeverity: Severity attached to a mark that may be projected as an OpenTelemetry log.
- MetricKind: OpenTelemetry instrument kind represented by a metric measurement mark.
- MetricValueType: Numeric representation used by a metric measurement.
- PluginError: Error type for generic plugin operations.
- PluginLogLevel: Operational log severity routed through the component runtime.
- RuntimeRegistrationKind: A global runtime registration surface that can be selected by a conditional middleware guardrail.
- RuntimeRegistrationOwnerKind: The owner category reported for a global runtime registration.
- ScopeCategory: Agent Trajectory Observability Format (ATOF) lifecycle phase for a scope event.
- ScopeType: Semantic category attached to a scope lifecycle span.
Constants
- METRIC_DATA_SCHEMA_NAME: Relay-owned schema name for mark payloads containing metric measurements.
- METRIC_DATA_SCHEMA_VERSION: Current Relay-owned metric measurement schema version.
- TOOL_EXECUTION_INTERCEPT_OUTCOME_SCHEMA: Versioned native-plugin JSON envelope schema for
ToolExecutionInterceptOutcome. - TOOL_EXECUTION_RESULT_SCHEMA: Versioned native-plugin JSON envelope schema for
ToolExecutionResult.
Traits
- LlmOptimizationPayload: Trait implemented by typed plugin payloads embedded in an optimization contribution.
- NativePlugin
- Plugin
Functions
- http_error_message: Formats an upstream HTTP error for transport through string-based plugin callbacks.
Type Aliases
- Json: Type alias for
serde_json::Value, used as the universal JSON representation throughout NeMo Relay APIs. - LlmJsonAsyncStream
- PluginFuture: Shared future returned by Rust plugin activation methods.
- Result: Result returned by native SDK helpers.