Skip to content

Commit 03fa055

Browse files
committed
Clean up
1 parent 8c8104b commit 03fa055

File tree

11 files changed

+18
-21
lines changed

11 files changed

+18
-21
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.13.0" />
9898
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.13.0" />
9999
<PackageVersion Include="Milvus.Client" Version="2.3.0-preview.1" />
100-
<PackageVersion Include="ModelContextProtocol" Version="0.4.0-preview.2" />
101-
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.4.0-preview.2" />
100+
<PackageVersion Include="ModelContextProtocol" Version="0.4.0-preview.3" />
101+
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.4.0-preview.3" />
102102
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
103103
<PackageVersion Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="2.1.0" />
104104
<PackageVersion Include="MySqlConnector.DependencyInjection" Version="2.4.0" />

src/Aspire.Dashboard/Authentication/FrontendCompositeAuthenticationHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Text.Encodings.Web;
55
using Aspire.Dashboard.Authentication.Connection;
66
using Aspire.Dashboard.Configuration;
7-
using Aspire.Dashboard.Startup;
87
using Microsoft.AspNetCore.Authentication;
98
using Microsoft.Extensions.Options;
109

src/Aspire.Dashboard/Authentication/UnsecuredAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Security.Claims;
55
using System.Text.Encodings.Web;
6-
using Aspire.Dashboard.Startup;
6+
using Aspire.Dashboard.Configuration;
77
using Microsoft.AspNetCore.Authentication;
88
using Microsoft.Extensions.Options;
99

src/Aspire.Dashboard/Components/_Imports.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
@using Aspire.Dashboard.Components
1818
@using Aspire.Dashboard.Components.Controls
1919
@using Aspire.Dashboard.Components.Layout
20+
@using Aspire.Dashboard.Configuration
2021
@using Aspire.Dashboard.Model
2122
@using Aspire.Dashboard.ServiceClient
22-
@using Aspire.Dashboard.Startup
2323
@using Microsoft.Extensions.Localization
2424

2525
@* Require authorization for all pages of the web app *@

src/Aspire.Dashboard/Configuration/EndpointInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Aspire.Dashboard.Authentication.Connection;
55
using Microsoft.AspNetCore.Server.Kestrel.Core;
66

7-
namespace Aspire.Dashboard.Startup;
7+
namespace Aspire.Dashboard.Configuration;
88

99
public record EndpointInfo(string Name, BindingAddress Address, HttpProtocols? HttpProtocols, bool RequireCertificate, ConnectionType ConnectionType)
1010
{

src/Aspire.Dashboard/Configuration/FrontendAuthenticationDefaults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace Aspire.Dashboard.Startup;
4+
namespace Aspire.Dashboard.Configuration;
55

66
public static class FrontendAuthenticationDefaults
77
{

src/Aspire.Dashboard/Configuration/FrontendAuthorizationDefaults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
namespace Aspire.Dashboard.Startup;
4+
namespace Aspire.Dashboard.Configuration;
55

66
public static class FrontendAuthorizationDefaults
77
{

src/Aspire.Dashboard/Configuration/ResolvedEndpointInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Globalization;
55
using System.Net;
66

7-
namespace Aspire.Dashboard.Startup;
7+
namespace Aspire.Dashboard.Configuration;
88

99
/// <summary>
1010
/// This endpoint info represents a resolved endpoint with its binding address, actual IP endpoint, and whether it uses HTTPS.

src/Aspire.Dashboard/DashboardWebApplication.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using Aspire.Dashboard.Otlp.Grpc;
2222
using Aspire.Dashboard.Otlp.Http;
2323
using Aspire.Dashboard.Otlp.Storage;
24-
using Aspire.Dashboard.Startup;
2524
using Aspire.Dashboard.Telemetry;
2625
using Aspire.Dashboard.Utils;
2726
using Aspire.Hosting;

src/Aspire.Dashboard/Mcp/ResourceMcpTools.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public static string GetResourceCommands(IDashboardClient dashboardClient, [Desc
232232

233233
if (resource == null)
234234
{
235-
throw new McpException($"Resource '{resourceName}' not found.", McpErrorCode.InvalidParams);
235+
throw new McpProtocolException($"Resource '{resourceName}' not found.", McpErrorCode.InvalidParams);
236236
}
237237

238238
// Only include commands that can be executed (Enabled).
@@ -247,30 +247,30 @@ public static async Task ExecuteCommand(IDashboardClient dashboardClient, [Descr
247247

248248
if (resource == null)
249249
{
250-
throw new McpException($"Resource '{resourceName}' not found.", McpErrorCode.InvalidParams);
250+
throw new McpProtocolException($"Resource '{resourceName}' not found.", McpErrorCode.InvalidParams);
251251
}
252252

253253
var command = resource.Commands.FirstOrDefault(c => string.Equals(c.Name, commandName, StringComparison.Ordinal));
254254

255255
if (command is null)
256256
{
257-
throw new McpException($"Command '{commandName}' not found for resource '{resourceName}'.", McpErrorCode.InvalidParams);
257+
throw new McpProtocolException($"Command '{commandName}' not found for resource '{resourceName}'.", McpErrorCode.InvalidParams);
258258
}
259259

260260
// Block execution when command isn't available.
261261
if (command.State == Model.CommandViewModelState.Hidden)
262262
{
263-
throw new McpException($"Command '{commandName}' is not available for resource '{resourceName}'.", McpErrorCode.InvalidParams);
263+
throw new McpProtocolException($"Command '{commandName}' is not available for resource '{resourceName}'.", McpErrorCode.InvalidParams);
264264
}
265265

266266
if (command.State == Model.CommandViewModelState.Disabled)
267267
{
268268
if (command.Name == "resource-restart" && resource.Commands.Any(c => c.Name == "resource-start" && c.State == CommandViewModelState.Enabled))
269269
{
270-
throw new McpException($"Resource '{resourceName}' is stopped. Use the 'resource-start' command instead of 'resource-restart'.", McpErrorCode.InvalidParams);
270+
throw new McpProtocolException($"Resource '{resourceName}' is stopped. Use the 'resource-start' command instead of 'resource-restart'.", McpErrorCode.InvalidParams);
271271
}
272272

273-
throw new McpException($"Command '{commandName}' is currently disabled for resource '{resourceName}'.", McpErrorCode.InvalidParams);
273+
throw new McpProtocolException($"Command '{commandName}' is currently disabled for resource '{resourceName}'.", McpErrorCode.InvalidParams);
274274
}
275275

276276
try
@@ -282,20 +282,20 @@ public static async Task ExecuteCommand(IDashboardClient dashboardClient, [Descr
282282
case Model.ResourceCommandResponseKind.Succeeded:
283283
return;
284284
case Model.ResourceCommandResponseKind.Cancelled:
285-
throw new McpException($"Command '{commandName}' was cancelled.", McpErrorCode.InternalError);
285+
throw new McpProtocolException($"Command '{commandName}' was cancelled.", McpErrorCode.InternalError);
286286
case Model.ResourceCommandResponseKind.Failed:
287287
default:
288288
var message = response.ErrorMessage is { Length: > 0 } ? response.ErrorMessage : "Unknown error. See logs for details.";
289-
throw new McpException($"Command '{commandName}' failed for resource '{resourceName}': {message}", McpErrorCode.InternalError);
289+
throw new McpProtocolException($"Command '{commandName}' failed for resource '{resourceName}': {message}", McpErrorCode.InternalError);
290290
}
291291
}
292-
catch (McpException)
292+
catch (McpProtocolException)
293293
{
294294
throw;
295295
}
296296
catch (Exception ex)
297297
{
298-
throw new McpException($"Error executing command '{commandName}' for resource '{resourceName}': {ex.Message}", McpErrorCode.InternalError);
298+
throw new McpProtocolException($"Error executing command '{commandName}' for resource '{resourceName}': {ex.Message}", McpErrorCode.InternalError);
299299
}
300300
}
301301

0 commit comments

Comments
 (0)