Files
RoslynBridge/RoslynBridge.WebApi/Models/VSInstanceInfo.cs
AJ Isaacs 1cbfba3893 Add WebAPI middleware for multi-instance Roslyn Bridge routing
Add RoslynBridge.WebApi - ASP.NET Core 8.0 middleware that:
- Provides a centralized REST API for accessing multiple VS instances
- Manages instance registry with discovery by port, solution, or PID
- Proxies requests to the appropriate VS instance
- Tracks request/response history for debugging
- Auto-cleanup of stale instances via background service

Features:
- Health endpoints: /api/health, /api/health/ping
- Roslyn endpoints: /api/roslyn/projects, /api/roslyn/diagnostics, etc.
- Instance management: /api/instances (register, heartbeat, unregister)
- History tracking: /api/history, /api/history/stats
- Swagger UI at root (/) for API documentation
- CORS enabled for web applications

Services:
- InstanceRegistryService: Thread-safe registry of VS instances
- HistoryService: In-memory request/response history (max 1000 entries)
- InstanceCleanupService: Background service to remove stale instances
- RoslynBridgeClient: HTTP client for proxying to VS instances

Update RoslynBridge.sln to include RoslynBridge.WebApi project.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 23:51:33 -04:00

43 lines
1.1 KiB
C#

namespace RoslynBridge.WebApi.Models;
/// <summary>
/// Information about a registered Visual Studio instance
/// </summary>
public class VSInstanceInfo
{
/// <summary>
/// The port number where this VS instance is listening
/// </summary>
public int Port { get; set; }
/// <summary>
/// The process ID of the Visual Studio instance
/// </summary>
public int ProcessId { get; set; }
/// <summary>
/// The solution file path (if any solution is open)
/// </summary>
public string? SolutionPath { get; set; }
/// <summary>
/// The solution name (if any solution is open)
/// </summary>
public string? SolutionName { get; set; }
/// <summary>
/// When this instance was registered
/// </summary>
public DateTime RegisteredAt { get; set; }
/// <summary>
/// Last heartbeat time
/// </summary>
public DateTime LastHeartbeat { get; set; }
/// <summary>
/// List of project names in the solution
/// </summary>
public List<string> Projects { get; set; } = new();
}