< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.ServiceCollectionAgentFrameworkExtensions
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/ServiceCollectionAgentFrameworkExtensions.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 45
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddNeedlrAgentFramework(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/ServiceCollectionAgentFrameworkExtensions.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2
 3namespace NexusLabs.Needlr.AgentFramework;
 4
 5/// <summary>
 6/// Extension methods for <see cref="IServiceCollection"/> that register the Needlr Agent Framework
 7/// infrastructure directly, without requiring the <see cref="Injection.ConfiguredSyringe"/> fluent builder.
 8/// </summary>
 9/// <remarks>
 10/// <para>
 11/// Use this when registering the agent framework from an <see cref="IServiceCollectionPlugin"/>
 12/// so that feature projects can self-register without modifying the composition root:
 13/// </para>
 14/// <code>
 15/// public sealed class AgentFrameworkPlugin : IServiceCollectionPlugin
 16/// {
 17///     public void Configure(ServiceCollectionPluginOptions options)
 18///     {
 19///         options.Services.AddNeedlrAgentFramework();
 20///     }
 21/// }
 22/// </code>
 23/// <para>
 24/// This calls the same code path as
 25/// <see cref="SyringeExtensionsForAgentFramework.UsingAgentFramework(Injection.ConfiguredSyringe)"/>
 26/// — zero duplication, zero drift between the two entry points.
 27/// </para>
 28/// </remarks>
 29public static class ServiceCollectionAgentFrameworkExtensions
 30{
 31    /// <summary>
 32    /// Registers the full Needlr Agent Framework infrastructure on the service collection.
 33    /// </summary>
 34    /// <param name="services">The service collection to register into.</param>
 35    /// <returns>The same <paramref name="services"/> instance for chaining.</returns>
 36    public static IServiceCollection AddNeedlrAgentFramework(
 37        this IServiceCollection services)
 38    {
 47339        ArgumentNullException.ThrowIfNull(services);
 40
 47341        SyringeExtensionsForAgentFramework.RegisterAgentFrameworkCore(services);
 42
 47343        return services;
 44    }
 45}