< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Workflows.Sequential.DelegateStageExecutor
Assembly: NexusLabs.Needlr.AgentFramework.Workflows
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Workflows/Sequential/DelegateStageExecutor.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 32
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%
ExecuteAsync()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Workflows/Sequential/DelegateStageExecutor.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.AgentFramework.Workflows.Sequential;
 2
 3/// <summary>
 4/// Executes a pipeline stage by invoking a caller-provided delegate.
 5/// Use for programmatic stages that do not involve an AI agent.
 6/// </summary>
 7/// <param name="step">The async delegate to execute for this stage.</param>
 8/// <example>
 9/// <code>
 10/// var executor = new DelegateStageExecutor(async (ctx, ct) =>
 11/// {
 12///     var content = ctx.Workspace.TryReadFile("draft.md");
 13///     // Transform content...
 14///     ctx.Workspace.TryWriteFile("final.md", "transformed content");
 15/// });
 16///
 17/// var result = await executor.ExecuteAsync(context, cancellationToken);
 18/// </code>
 19/// </example>
 20[DoNotAutoRegister]
 11121public sealed class DelegateStageExecutor(
 11122    Func<StageExecutionContext, CancellationToken, Task> step) : IStageExecutor
 23{
 24    /// <inheritdoc />
 25    public async Task<StageExecutionResult> ExecuteAsync(
 26        StageExecutionContext context,
 27        CancellationToken cancellationToken)
 28    {
 8329        await step(context, cancellationToken);
 8130        return StageExecutionResult.Success(context.StageName, diagnostics: null, responseText: null);
 8131    }
 32}