< Summary

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

File(s)

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

#LineLine coverage
 1using NexusLabs.Needlr.AgentFramework.Progress;
 2
 3namespace NexusLabs.Needlr.AgentFramework;
 4
 5/// <summary>
 6/// Declares which <see cref="IProgressSink"/> types should receive progress events when
 7/// this agent runs. The source generator discovers this attribute and emits a companion
 8/// method that returns the sink types for use by orchestrators when creating reporters.
 9/// </summary>
 10/// <remarks>
 11/// <para>
 12/// Apply alongside <see cref="NeedlrAiAgentAttribute"/> on agent classes:
 13/// </para>
 14/// <code>
 15/// [NeedlrAiAgent(Instructions = "...")]
 16/// [ProgressSinks(typeof(CostTrackingSink), typeof(AuditSink))]
 17/// public partial class WriterAgent { }
 18/// </code>
 19/// <para>
 20/// The generator emits a <c>GetWriterAgentProgressSinkTypes()</c> extension method
 21/// on <c>IAgentFactory</c> that returns the declared types. Orchestrators use this
 22/// to create reporters with the correct sinks for each agent.
 23/// </para>
 24/// </remarks>
 25[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
 26public sealed class ProgressSinksAttribute : Attribute
 27{
 28    /// <summary>Gets the sink types declared for this agent.</summary>
 029    public Type[] SinkTypes { get; }
 30
 31    /// <param name="sinkTypes">
 32    /// The <see cref="IProgressSink"/> types to use for this agent's progress reporting.
 33    /// </param>
 034    public ProgressSinksAttribute(params Type[] sinkTypes)
 35    {
 036        ArgumentNullException.ThrowIfNull(sinkTypes);
 037        SinkTypes = sinkTypes;
 038    }
 39}