< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.FunctionScanners.GeneratedAgentFunctionScanner
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/FunctionScanners/GeneratedAgentFunctionScanner.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 26
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
.ctor(...)100%11100%
ScanForFunctionTypes()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/FunctionScanners/GeneratedAgentFunctionScanner.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.AgentFramework.FunctionScanners;
 2
 3/// <summary>
 4/// Source-generation-friendly agent function scanner that uses compile-time generated function type lists.
 5/// </summary>
 6/// <remarks>
 7/// When using source generation, the generator emits a
 8/// <c>NexusLabs.Needlr.Generated.AgentFrameworkFunctions</c> class with
 9/// <c>AllFunctionTypes</c> containing all types with <see cref="AgentFunctionAttribute"/> methods.
 10///
 11/// For AOT/trimmed applications, use
 12/// <see cref="AgentFrameworkSyringeExtensions.AddAgentFunctionsFromGenerated"/> directly
 13/// (which requires no reflection for discovery) rather than this scanner.
 14/// </remarks>
 15public sealed class GeneratedAgentFunctionScanner : IAgentFrameworkFunctionScanner
 16{
 17    private readonly IReadOnlyList<Type> _functionTypes;
 18
 319    public GeneratedAgentFunctionScanner(IReadOnlyList<Type> functionTypes)
 20    {
 321        ArgumentNullException.ThrowIfNull(functionTypes);
 222        _functionTypes = functionTypes;
 223    }
 24
 225    public IReadOnlyList<Type> ScanForFunctionTypes() => _functionTypes;
 26}