82 references to AgentConfigurationScope
aspire (30)
Agents\AgentClient.cs (6)
98public string GetSkillBaseDirectory(AgentConfigurationScope scope, DirectoryInfo workspaceRoot, CliExecutionContext executionContext, IEnvironment environment) 100return scope is AgentConfigurationScope.Project 105public string GetMcpConfigPath(AgentConfigurationScope scope, DirectoryInfo workspaceRoot, CliExecutionContext executionContext, IEnvironment environment) 107return scope is AgentConfigurationScope.Project 112public IEnumerable<(string Path, string ServersPropertyName, bool ConfigureServer)> GetMcpConfigPaths(AgentConfigurationScope scope, DirectoryInfo workspaceRoot, CliExecutionContext executionContext, IEnvironment environment) 115if (scope is AgentConfigurationScope.Project)
Agents\McpConfigFileHelper.cs (4)
19AgentConfigurationScope scope, 26(scope is AgentConfigurationScope.Project || 97AgentConfigurationScope scope, 117var serverConfiguration = scope is AgentConfigurationScope.Global
Commands\AgentInitCommand.cs (18)
63internal static readonly Option<AgentConfigurationScope> s_scopeOption = CreateScopeOption(); 128private static Option<AgentConfigurationScope> CreateScopeOption() 130var option = new Option<AgentConfigurationScope>("--scope") 141Enum.TryParse<AgentConfigurationScope>(result.Tokens[0].Value, ignoreCase: true, out _) && 142!Enum.GetNames<AgentConfigurationScope>().Contains(result.Tokens[0].Value, StringComparer.OrdinalIgnoreCase)) 178PromptBinding<AgentConfigurationScope> scopeBinding, 210PromptBinding.Create(parseResult, s_scopeOption, AgentConfigurationScope.Project), 250PromptBinding<AgentConfigurationScope> scopeBinding, 386var scope = scopeProvided ? requestedScope : scopeBinding.DefaultValue; 393new[] { AgentConfigurationScope.Project, AgentConfigurationScope.Global }, 394value => value is AgentConfigurationScope.Project 400if (scope is AgentConfigurationScope.Global && detectedEnvironments is null) 556if (scope is AgentConfigurationScope.Global) 873private string GetDisplayConfigurationPath(string path, AgentConfigurationScope scope, DirectoryInfo workspaceRoot) 875var root = scope is AgentConfigurationScope.Project ? workspaceRoot : ExecutionContext.HomeDirectory; 887return scope is AgentConfigurationScope.Global ? $"~/{displayRelativePath}" : displayRelativePath; 890private void DisplayInstallationLocations(IReadOnlyList<AgentClient> clients, AgentConfigurationScope scope, DirectoryInfo workspaceRoot, bool installSkills, bool configureMcp)
Commands\InitCommand.cs (1)
187PromptBinding.Create(parseResult, AgentInitCommand.s_scopeOption, AgentConfigurationScope.Project),
Commands\NewCommand.cs (1)
617PromptBinding.Create(parseResult, AgentInitCommand.s_scopeOption, AgentConfigurationScope.Project),
Aspire.Cli.Tests (52)
Commands\AgentInitClientSelectionTests.cs (50)
176var selectedScope = scope == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 193(installSkills || configureMcp) && selectedScope is AgentConfigurationScope.Global && detectedEnvironment is { } detected && 278[InlineData("PrOjEcT", nameof(AgentConfigurationScope.Project))] 279[InlineData("GlObAl", nameof(AgentConfigurationScope.Global))] 288Assert.Equal(Enum.Parse<AgentConfigurationScope>(expected), result.GetValue<AgentConfigurationScope>("--scope")); 412Assert.Equal([AgentConfigurationScope.Project, AgentConfigurationScope.Global], choices.Cast<AgentConfigurationScope>()); 414return AgentConfigurationScope.Global; 505var selectedScope = scope == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 507var root = selectedScope is AgentConfigurationScope.Project ? workspace.WorkspaceRoot : homeDirectory; 648var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 696var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 750var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 783jsoncPath, AgentClient.OpenCode, AgentConfigurationScope.Project, new TestEnvironment(), CancellationToken.None); 829var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 880var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 948var path = client.GetMcpConfigPath(AgentConfigurationScope.Global, workspace.WorkspaceRoot, executionContext, environment); 979var path = client.GetMcpConfigPath(AgentConfigurationScope.Global, workspace.WorkspaceRoot, executionContext, new TestEnvironment()); 1009var path = client.GetMcpConfigPath(AgentConfigurationScope.Global, workspace.WorkspaceRoot, executionContext, new TestEnvironment()); 1042var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 1095var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 1128var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 1156var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global; 1194var scope = scopeName == "project" ? AgentConfigurationScope.Project : AgentConfigurationScope.Global;
Commands\AgentInitCommandTests.cs (2)
737PromptBinding.CreateDefault(AgentConfigurationScope.Project), 772PromptBinding.CreateDefault(AgentConfigurationScope.Project),