Add DAP protocol message types and service interfaces

This commit is contained in:
Francesco Renzi
2026-03-11 08:55:17 -07:00
committed by GitHub
parent 8b1b23b5ce
commit cca15de3b3
3 changed files with 1184 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
using System.Threading;
using System.Threading.Tasks;
using GitHub.Runner.Common;
namespace GitHub.Runner.Worker.Dap
{
public enum DapSessionState
{
WaitingForConnection,
Initializing,
Ready,
Paused,
Running,
Terminated
}
[ServiceLocator(Default = typeof(DapDebugSession))]
public interface IDapDebugSession : IRunnerService
{
bool IsActive { get; }
DapSessionState State { get; }
void SetDapServer(IDapServer server);
Task WaitForHandshakeAsync(CancellationToken cancellationToken);
Task OnStepStartingAsync(IStep step, IExecutionContext jobContext, bool isFirstStep, CancellationToken cancellationToken);
void OnStepCompleted(IStep step);
void OnJobCompleted();
void CancelSession();
void HandleClientConnected();
void HandleClientDisconnected();
Task HandleMessageAsync(string messageJson, CancellationToken cancellationToken);
}
}

View File

@@ -0,0 +1,18 @@
using System.Threading;
using System.Threading.Tasks;
using GitHub.Runner.Common;
namespace GitHub.Runner.Worker.Dap
{
[ServiceLocator(Default = typeof(DapServer))]
public interface IDapServer : IRunnerService
{
void SetSession(IDapDebugSession session);
Task StartAsync(int port, CancellationToken cancellationToken);
Task WaitForConnectionAsync(CancellationToken cancellationToken);
Task StopAsync();
void SendMessage(ProtocolMessage message);
void SendEvent(Event evt);
void SendResponse(Response response);
}
}