import { Event } from "../../../../../base/common/event.js"; import { Disposable } from "../../../../../base/common/lifecycle.js"; import { AgentHostClientConnectionKind } from "../../../../../platform/agentHost/common/agentHostTelemetry.js"; import { type IProtocolTransport } from "../../../../../platform/agentHost/common/state/sessionTransport.js"; import { IRemoteAgentHostService } from "../../../../../platform/agentHost/common/remoteAgentHostService.service.js"; import type { ProtocolMessage, AhpServerNotification, JsonRpcResponse } from "../../../../../platform/agentHost/common/state/sessionProtocol.js"; import { type ICachedTunnel, type ITunnelInfo, type ITunnelDiscoveryOptions, type ITunnelVisibility, type TunnelAutoConnectMode } from "../../../../../platform/agentHost/common/tunnelAgentHost.js"; import { ITunnelAgentHostService } from "../../../../../platform/agentHost/common/tunnelAgentHost.service.js"; import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { ILogService } from "../../../../../platform/log/common/log.service.js"; import { IStorageService } from "../../../../../platform/storage/common/storage.service.js"; import type { ITunnelConnection } from "../../../../../workbench/browser/web.api.js"; import { IBrowserWorkbenchEnvironmentService } from "../../../../../workbench/services/environment/browser/environmentService.service.js"; import { IAuthenticationService } from "../../../../../workbench/services/authentication/common/authentication.service.js"; /** * Web (browser) implementation of {@link ITunnelAgentHostService}. * * Delegates to the embedder's {@link ITunnelDiscoveryProvider} (provided via * `IWorkbenchConstructionOptions.tunnelDiscoveryProvider`) for: * - **Discovery**: listing available agent host tunnels * - **Relay address**: obtaining the WebSocket proxy URL for connecting * * This decouples VS Code core from any specific embedder (vscode.dev, * github.dev, etc.). The embedder handles the actual Dev Tunnels API * calls and relay proxying. */ export declare class WebTunnelAgentHostService extends Disposable implements ITunnelAgentHostService { private readonly _remoteAgentHostService; private readonly _logService; private readonly _instantiationService; private readonly _configurationService; private readonly _authenticationService; private readonly _storageService; readonly _serviceBrand: undefined; private readonly _storage; private readonly _connectionFactory; readonly onDidChangeTunnels: Event; private readonly _discoveryProvider; constructor(_remoteAgentHostService: IRemoteAgentHostService, environmentService: IBrowserWorkbenchEnvironmentService, _logService: ILogService, _instantiationService: IInstantiationService, _configurationService: IConfigurationService, _authenticationService: IAuthenticationService, _storageService: IStorageService); listTunnels(options?: ITunnelDiscoveryOptions): Promise; private _toTunnelInfo; getAutoConnectMode(): TunnelAutoConnectMode; connect(tunnel: ITunnelInfo, authProvider?: "github" | "microsoft", options?: { readonly userInitiated?: boolean; }): Promise; private _createConnection; get canDeleteTunnels(): boolean; deleteTunnel(tunnel: ITunnelInfo): Promise; disconnect(address: string): Promise; getAuthProvider(options?: { silent?: boolean; }): Promise<"github" | "microsoft" | undefined>; getCachedTunnels(): ICachedTunnel[]; cacheTunnel(tunnel: ITunnelInfo, authProvider?: "github" | "microsoft"): void; removeCachedTunnel(tunnelId: string): void; isTunnelDismissed(tunnelId: string): boolean; getTunnelVisibility(): ITunnelVisibility; dismissTunnel(tunnelId: string): void; clearTunnelDismissal(tunnelId: string): void; isAutoConnectSuppressed(tunnelId: string): boolean; suppressAutoConnect(tunnelId: string): void; clearAutoConnectSuppression(tunnelId: string): void; } /** * Adapts an {@link ITunnelConnection} (embedder-provided) into an * {@link IProtocolTransport} for {@link AgentHostProtocolClient}. * * The connection is already established by the time this adapter is created, * so there is no `connect()` method — the protocol client skips that step. */ export declare class TunnelConnectionTransport extends Disposable implements IProtocolTransport { private readonly _connection; private readonly _address; private readonly _logService; readonly clientConnectionKind = AgentHostClientConnectionKind.DevTunnel; private readonly _onMessage; readonly onMessage: Event; private readonly _onClose; readonly onClose: Event; private _malformedFrames; private readonly _connectedAt; private _lastMessageAt; private _closeRequested; constructor(_connection: ITunnelConnection, _address: string, _logService: ILogService); send(message: ProtocolMessage | AhpServerNotification | JsonRpcResponse): void; dispose(): void; }