Skip to content

IAgentDiagnosticsWriter

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Diagnostics

IAgentDiagnosticsWriter Interface

Write-side interface for storing diagnostics captured by middleware. Separated from IAgentDiagnosticsAccessor (the read-side) so that middleware can resolve this from DI without casting to a concrete type.

public interface IAgentDiagnosticsWriter

Remarks

Registered as a singleton by UsingAgentFramework(). The default implementation shares a backing store with IAgentDiagnosticsAccessor, so calling Set(IAgentRunDiagnostics) makes the diagnostics immediately available via LastRunDiagnostics.

Consumer middleware that captures agent diagnostics (e.g., a custom DiagnosticsAgentRunMiddleware) should resolve this interface and call Set(IAgentRunDiagnostics) after building an IAgentRunDiagnostics via AgentRunDiagnosticsBuilder.

Methods

IAgentDiagnosticsWriter.Set(IAgentRunDiagnostics) Method

Stores completed diagnostics into the current capture scope. Called by the diagnostics middleware after an agent run completes.

void Set(NexusLabs.Needlr.AgentFramework.Diagnostics.IAgentRunDiagnostics diagnostics);

Parameters

diagnostics IAgentRunDiagnostics