< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.AgentSequenceMemberAttribute
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/AgentSequenceMemberAttribute.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 39
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%
get_PipelineName()100%11100%
get_Order()100%11100%

File(s)

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

#LineLine coverage
 1namespace NexusLabs.Needlr.AgentFramework;
 2
 3/// <summary>
 4/// Marks an agent class as a member of a named sequential pipeline, specifying its position.
 5/// The source generator reads these declarations to emit a strongly-typed
 6/// <c>Create{PipelineName}SequentialWorkflow()</c> extension method on <see cref="IWorkflowFactory"/>.
 7/// </summary>
 8/// <remarks>
 9/// Apply multiple instances of this attribute on different agent classes with the same
 10/// <paramref name="pipelineName"/> to declare the full sequence. Agents are executed in ascending
 11/// <paramref name="order"/> — output from each agent is passed as input to the next.
 12/// </remarks>
 13/// <example>
 14/// <code>
 15/// [NeedlrAiAgent(Instructions = "Extract key facts from the user's input.")]
 16/// [AgentSequenceMember("ContentPipeline", order: 0)]
 17/// public class ExtractorAgent { }
 18///
 19/// [NeedlrAiAgent(Instructions = "Summarize extracted facts into a concise paragraph.")]
 20/// [AgentSequenceMember("ContentPipeline", order: 1)]
 21/// public class SummarizerAgent { }
 22///
 23/// [NeedlrAiAgent(Instructions = "Format the summary as a structured JSON report.")]
 24/// [AgentSequenceMember("ContentPipeline", order: 2)]
 25/// public class FormatterAgent { }
 26///
 27/// // The source generator emits:
 28/// //   workflowFactory.CreateContentPipelineSequentialWorkflow()
 29/// </code>
 30/// </example>
 31[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
 60032public sealed class AgentSequenceMemberAttribute(string pipelineName, int order) : Attribute
 33{
 34    /// <summary>The name of the sequential pipeline this agent belongs to.</summary>
 61535    public string PipelineName { get; } = pipelineName;
 36
 37    /// <summary>The zero-based position of this agent within the pipeline sequence.</summary>
 61238    public int Order { get; } = order;
 39}