diff --git a/src/vs/platform/agentHost/common/state/sessionActions.ts b/src/vs/platform/agentHost/common/state/sessionActions.ts index 42f872196df..293e5a426fd 100644 --- a/src/vs/platform/agentHost/common/state/sessionActions.ts +++ b/src/vs/platform/agentHost/common/state/sessionActions.ts @@ -66,8 +66,10 @@ import type { ISessionModelChangedAction, ISessionReasoningAction, ISessionResponsePartAction, + ISessionToolCallApprovedAction, ISessionToolCallCompleteAction, ISessionToolCallConfirmedAction, + ISessionToolCallDeniedAction, ISessionToolCallDeltaAction, ISessionToolCallReadyAction, ISessionToolCallResultConfirmedAction, @@ -102,8 +104,8 @@ export type IResponsePartAction = ISessionResponsePartAction; export type IToolCallStartAction = ISessionToolCallStartAction; export type IToolCallDeltaAction = ISessionToolCallDeltaAction; export type IToolCallReadyAction = ISessionToolCallReadyAction; -export type IToolCallApprovedAction = import('./protocol/actions.js').ISessionToolCallApprovedAction; -export type IToolCallDeniedAction = import('./protocol/actions.js').ISessionToolCallDeniedAction; +export type IToolCallApprovedAction = ISessionToolCallApprovedAction; +export type IToolCallDeniedAction = ISessionToolCallDeniedAction; export type IToolCallConfirmedAction = ISessionToolCallConfirmedAction; export type IToolCallCompleteAction = ISessionToolCallCompleteAction; export type IToolCallResultConfirmedAction = ISessionToolCallResultConfirmedAction; diff --git a/src/vs/platform/agentHost/electron-browser/remoteAgentHostServiceImpl.ts b/src/vs/platform/agentHost/electron-browser/remoteAgentHostServiceImpl.ts index 773f0dfbe1c..3815b1cf79a 100644 --- a/src/vs/platform/agentHost/electron-browser/remoteAgentHostServiceImpl.ts +++ b/src/vs/platform/agentHost/electron-browser/remoteAgentHostServiceImpl.ts @@ -221,7 +221,7 @@ export class RemoteAgentHostService extends Disposable implements IRemoteAgentHo this._resolvePendingConnectionWait(address); this._onDidChangeConnections.fire(); }).catch(err => { - this._logService.error(`[RemoteAgentHost] Failed to connect to ${address}`, err); + this._logService.error(`[RemoteAgentHost] Failed to connect to ${address}. Verify address and connectionToken`, err); this._rejectPendingConnectionWait(address, err); guardedRemove(); }); diff --git a/src/vs/platform/agentHost/node/webSocketTransport.ts b/src/vs/platform/agentHost/node/webSocketTransport.ts index 450204d5bb8..42aef7bdfc7 100644 --- a/src/vs/platform/agentHost/node/webSocketTransport.ts +++ b/src/vs/platform/agentHost/node/webSocketTransport.ts @@ -12,6 +12,9 @@ import { connectionTokenQueryName } from '../../../base/common/network.js'; import { ILogService } from '../../log/common/log.js'; import { JSON_RPC_PARSE_ERROR, type IAhpServerNotification, type IJsonRpcResponse, type IProtocolMessage } from '../common/state/sessionProtocol.js'; import type { IProtocolServer, IProtocolTransport } from '../common/state/sessionTransport.js'; +import type * as wsTypes from 'ws'; +import type * as httpTypes from 'http'; +import type * as urlTypes from 'url'; /** * Options for creating a {@link WebSocketProtocolServer}. @@ -46,8 +49,8 @@ export class WebSocketProtocolTransport extends Disposable implements IProtocolT readonly onClose = this._onClose.event; constructor( - private readonly _ws: import('ws').WebSocket, - private readonly _WebSocket: typeof import('ws').WebSocket, + private readonly _ws: wsTypes.WebSocket, + private readonly _WebSocket: typeof wsTypes.WebSocket, ) { super(); @@ -94,9 +97,9 @@ export class WebSocketProtocolTransport extends Disposable implements IProtocolT */ export class WebSocketProtocolServer extends Disposable implements IProtocolServer { - private readonly _wss: import('ws').WebSocketServer; - private readonly _httpServer: import('http').Server | undefined; - private readonly _WebSocket: typeof import('ws').WebSocket; + private readonly _wss: wsTypes.WebSocketServer; + private readonly _httpServer: httpTypes.Server | undefined; + private readonly _WebSocket: typeof wsTypes.WebSocket; private readonly _onConnection = this._register(new Emitter()); readonly onConnection = this._onConnection.event; @@ -128,9 +131,9 @@ export class WebSocketProtocolServer extends Disposable implements IProtocolServ private constructor( options: IWebSocketServerOptions | number, private readonly _logService: ILogService, - ws: typeof import('ws'), - http: typeof import('http'), - url: typeof import('url'), + ws: typeof wsTypes, + http: typeof httpTypes, + url: typeof urlTypes, ) { super(); @@ -141,7 +144,7 @@ export class WebSocketProtocolServer extends Disposable implements IProtocolServ const host = opts.host ?? '127.0.0.1'; const verifyClient = opts.connectionTokenValidate - ? (info: { req: import('http').IncomingMessage }, cb: (res: boolean, code?: number, message?: string) => void) => { + ? (info: { req: httpTypes.IncomingMessage }, cb: (res: boolean, code?: number, message?: string) => void) => { const parsedUrl = url.parse(info.req.url ?? '', true); const token = parsedUrl.query[connectionTokenQueryName]; if (!opts.connectionTokenValidate!(token)) {