Skip to content

Commit 8b9d2f6

Browse files
authored
indicate that all dcp protocols are supported (#11897)
1 parent 64c1bd7 commit 8b9d2f6

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

extension/src/capabilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function getSupportedCapabilities(): string[] {
4242

4343
export function getRunSessionInfo(): RunSessionInfo {
4444
return {
45-
protocols_supported: ["2024-03-03"],
45+
protocols_supported: ["2024-03-03", "2024-04-23", "2025-10-01"],
4646
supported_launch_configurations: getSupportedCapabilities()
4747
};
4848
}

extension/src/dcp/AspireDcpServer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import https from 'https';
33
import WebSocket, { WebSocketServer } from 'ws';
44
import { createSelfSignedCert, generateToken } from '../utils/security';
55
import { extensionLogOutputChannel } from '../utils/logging';
6-
import { AspireResourceDebugSession, DcpServerConnectionInfo, ErrorDetails, ErrorResponse, ProcessRestartedNotification, RunSessionNotification, RunSessionPayload, ServiceLogsNotification, SessionTerminatedNotification } from './types';
6+
import { AspireResourceDebugSession, DcpServerConnectionInfo, ErrorDetails, ErrorResponse, ProcessRestartedNotification, RunSessionNotification, RunSessionPayload, ServiceLogsNotification, SessionMessageNotification, SessionTerminatedNotification } from './types';
77
import { AspireDebugSession } from '../debugger/AspireDebugSession';
88
import { createDebugSessionConfiguration, ResourceDebuggerExtension } from '../debugger/debuggerExtensions';
99
import { timingSafeEqual } from 'crypto';
@@ -204,10 +204,14 @@ export default class AspireDcpServer {
204204
}
205205
});
206206

207-
wss.on('connection', (ws: WebSocket, req) => {
207+
wss.on('connection', (ws: WebSocket) => {
208208
ws.send(JSON.stringify({ notification_type: 'connected' }) + '\n');
209209
});
210210

211+
wss.on('message', (data) => {
212+
extensionLogOutputChannel.info(`Received message from WebSocket client: ${data}`);
213+
});
214+
211215
server.listen(0, () => {
212216
const addr = server.address();
213217
if (typeof addr === 'object' && addr) {

extension/src/dcp/types.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface DcpServerConnectionInfo {
5656
}
5757

5858
export interface RunSessionNotification {
59-
notification_type: 'processRestarted' | 'sessionTerminated' | 'serviceLogs';
59+
notification_type: 'processRestarted' | 'sessionTerminated' | 'serviceLogs' | 'sessionMessage';
6060
session_id: string;
6161
dcp_id: string;
6262
}
@@ -77,6 +77,14 @@ export interface ServiceLogsNotification extends RunSessionNotification {
7777
log_message: string;
7878
}
7979

80+
export interface SessionMessageNotification extends RunSessionNotification {
81+
notification_type: 'sessionMessage';
82+
message: string;
83+
code?: string;
84+
level: "error" | "info" | "debug";
85+
details: ErrorDetails[];
86+
}
87+
8088
export interface LaunchOptions {
8189
debug: boolean;
8290
forceBuild?: boolean;

0 commit comments

Comments
 (0)