Table of Contents

Namespace Oscova.Agents.Middleware

Classes

AgentRunObserverAccessor

Holds a mutable reference to the current Oscova.Agents.Middleware.IAgentRunObserver. Set before each agent run and cleared after, allowing a cached agent's middleware to target the per-run observer without rebuilding the pipeline.

AgentRunObserverMiddleware

Adds an Oscova.Agents.Middleware.IAgentRunObserver intercept point to the chat client pipeline. Must be placed before Microsoft.Extensions.AI.FunctionInvokingChatClient in the builder chain so the observer fires once per model round-trip inside the tool loop, not once per full agent run.

FunctionInvocationComposition

Composes function-invocation middleware onto a single Microsoft.Extensions.AI.FunctionInvokingChatClient. Each call to UseFunctionInvocation creates a new FICC, and once a FICC sees a Microsoft.Extensions.AI.FunctionCallContent it buffers every later streaming update until the inner stream completes. Stacking FICCs therefore makes the outer ones hold back the entire post-tool answer and release it in one burst. Routing the per-tool configurators through a single FICC keeps the stream flowing while preserving the existing invoker composition.

ToolTrackingMiddleware

Extension method that adds tool execution tracking to an Microsoft.Extensions.AI.IChatClient pipeline via Microsoft.Extensions.AI.FunctionInvokingChatClient.

ToolTrackingObserverAccessor

Holds a mutable reference to the current Oscova.Agents.Middleware.IToolTrackingObserver. Set before each agent run and cleared after, allowing a cached agent's middleware to observe the per-request parser instance.

WorkspacePathValidationMiddleware

Validates workspace-scoped tool arguments at function invocation time using the public Microsoft.Extensions.AI.FunctionInvokingChatClient middleware hook.

Interfaces

IAgentRunObserver

Observes each model API call made by an agent during a run. Implemented by consumers that need live visibility into the agent pipeline.

IToolTrackingObserver

Observer that receives tool execution lifecycle notifications from the tracking middleware. Callbacks receive the full Microsoft.Extensions.AI.FunctionCallContent so observers can inspect the call id and arguments in addition to the function name.