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