< Summary

Information
Class: Elsa.AI.Copilot.ShellFeatures.CopilotAIFeature
Assembly: Elsa.AI.Copilot
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Copilot/ShellFeatures/CopilotAIFeature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 24
Coverable lines: 24
Total lines: 49
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
.cctor()100%210%
get_RuntimePath()100%210%
get_RuntimeUrl()100%210%
get_RuntimeArguments()100%210%
get_WorkingDirectory()100%210%
get_BaseDirectory()100%210%
get_GitHubToken()100%210%
get_UseLoggedInUser()100%210%
get_Model()100%210%
get_ReasoningEffort()100%210%
get_ProviderName()100%210%
ConfigureServices(...)100%210%
ConfigureOptions(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Copilot/ShellFeatures/CopilotAIFeature.cs

#LineLine coverage
 1using CShells.Features;
 2using Elsa.AI.Copilot.Options;
 3using Elsa.Extensions;
 4using Elsa.Platform.PackageManifest.Generator.Hints;
 5using JetBrains.Annotations;
 6using Microsoft.Extensions.DependencyInjection;
 7
 8namespace Elsa.AI.Copilot.ShellFeatures;
 9
 10[ManifestFeatureCategory("AI")]
 11[ShellFeature(
 12    "CopilotAI",
 13    DisplayName = "Copilot AI Provider",
 14    Description = "Registers the Copilot adapter for Weaver AI")]
 15[UsedImplicitly]
 16public class CopilotAIFeature : IShellFeature
 17{
 018    private static readonly CopilotOptions DefaultOptions = new();
 19
 020    public string? RuntimePath { get; set; } = DefaultOptions.RuntimePath;
 021    public string? RuntimeUrl { get; set; } = DefaultOptions.RuntimeUrl;
 022    public ICollection<string> RuntimeArguments { get; set; } = [];
 023    public string? WorkingDirectory { get; set; } = DefaultOptions.WorkingDirectory;
 024    public string? BaseDirectory { get; set; } = DefaultOptions.BaseDirectory;
 025    public string? GitHubToken { get; set; } = DefaultOptions.GitHubToken;
 026    public bool? UseLoggedInUser { get; set; } = DefaultOptions.UseLoggedInUser;
 027    public string? Model { get; set; } = DefaultOptions.Model;
 028    public string? ReasoningEffort { get; set; } = DefaultOptions.ReasoningEffort;
 029    public string? ProviderName { get; set; } = DefaultOptions.ProviderName;
 30
 31    public void ConfigureServices(IServiceCollection services)
 32    {
 033        services.AddCopilotAIProvider(ConfigureOptions);
 034    }
 35
 36    private void ConfigureOptions(CopilotOptions options)
 37    {
 038        options.RuntimePath = RuntimePath;
 039        options.RuntimeUrl = RuntimeUrl;
 040        options.RuntimeArguments = RuntimeArguments;
 041        options.WorkingDirectory = WorkingDirectory;
 042        options.BaseDirectory = BaseDirectory;
 043        options.GitHubToken = GitHubToken;
 044        options.UseLoggedInUser = UseLoggedInUser;
 045        options.Model = Model;
 046        options.ReasoningEffort = ReasoningEffort;
 047        options.ProviderName = ProviderName;
 048    }
 49}