import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service"; import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service"; import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service"; import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service"; import { type IAgentConnection } from "../common/agentService.js"; import { type IRemoteAgentHostConnectionInfo, type IRemoteAgentHostEntry } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService"; import { IRemoteAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service"; import { type IVscodeUpgradeResult } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocolUpgrade"; export declare class RemoteAgentHostService extends Disposable implements IRemoteAgentHostService { private readonly _configurationService; private readonly _instantiationService; private readonly _logService; private readonly _labelService; private readonly _environmentService; private readonly _storageService; private static readonly ConnectionWaitTimeout; /** Initial reconnect delay in milliseconds. */ private static readonly ReconnectInitialDelay; /** Maximum reconnect delay in milliseconds. */ private static readonly ReconnectMaxDelay; /** * How long to wait for a server-upgrade trigger to be acknowledged. * The CLI awaits the binary download synchronously before responding, * so this needs to accommodate first-time downloads on slow networks. */ private static readonly UpgradeRequestTimeout; readonly _serviceBrand: undefined; private readonly _onDidChangeConnections; readonly onDidChangeConnections: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event; private readonly _entries; private readonly _names; private readonly _tokens; /** * Stores the original {@link IRemoteAgentHostEntry} for connections * registered via {@link addManagedConnection}. This is needed because * tunnel entries are not persisted to settings and therefore don't * appear in {@link configuredEntries}. */ private readonly _registeredEntries; private readonly _pendingConnectionWaits; /** Pending reconnect timeouts, keyed by normalized address. */ private readonly _reconnectTimeouts; /** Current reconnect attempt count per address for exponential backoff. */ private readonly _reconnectAttempts; /** * Per-address {@link ILabelService} formatter handles for the * {@link AGENT_HOST_SCHEME}. The formatter advertises the entry's * human-readable name as the host label so any UI looking up the host * label for an agent host URI gets the friendly name. */ private readonly _labelFormatters; constructor(_configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ILogService, _labelService: ILabelService, _environmentService: IEnvironmentService, _storageService: IStorageService); get connections(): readonly IRemoteAgentHostConnectionInfo[]; get configuredEntries(): readonly IRemoteAgentHostEntry[]; getConnection(address: string): IAgentConnection | undefined; getEntryByAddress(address: string): IRemoteAgentHostEntry | undefined; triggerServerUpgrade(address: string, method: string): Promise; reconnect(address: string): void; addRemoteAgentHost(input: IRemoteAgentHostEntry): Promise; addManagedConnection(entry: IRemoteAgentHostEntry, connection: IAgentConnection, transportDisposable?: IDisposable): Promise; removeRemoteAgentHost(address: string): Promise; private _removeConnection; private _reconcileConnections; private _connectTo; /** * Schedule a reconnect attempt with exponential backoff. * Only reconnects if the address is still in the configured entries. */ private _scheduleReconnect; /** Cancel a pending reconnect timeout for the given address. */ private _cancelReconnect; /** Check whether the given normalized address is still in the configured entries. */ private _isAddressConfigured; private _getConnectionInfo; private _getConfiguredEntries; private _upsertConfiguredEntry; private _getConfigurationTarget; private _storeConfiguredEntries; private _getConfiguredSettingEntries; private _getConfiguredSettingEntriesForTarget; private _getConfiguredRawEntriesForTarget; private _getStoredSSHEntries; private _storeStoredSSHEntries; private _migrateSSHEntriesFromSetting; private _mergeConfiguredEntries; private _getOrCreateConnectionWait; private _resolvePendingConnectionWait; private _rejectPendingConnectionWait; /** * Register (or re-register) the {@link AGENT_HOST_SCHEME} label formatter * for the given address so that {@link ILabelService.getHostLabel} resolves * to the entry's human-readable name. Called when an entry is added or its * name changes. */ private _updateHostLabelFormatter; private _clearHostLabelFormatter; dispose(): void; }