import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IAgentConnection } from "@codingame/monaco-vscode-chat-service-override/vscode/vs/platform/agentHost/common/agentService"; import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service"; import { ITerminalInstance, ITerminalLocationOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal"; import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service"; import { ITerminalService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service"; import { ITerminalProfileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service"; import { IAgentHostTerminalService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/agentHostTerminalService.service"; export interface IAgentHostTerminalCreateOptions { /** Human-readable terminal name. */ readonly name?: string; /** Initial working directory. */ readonly cwd?: URI; /** Terminal location (panel, editor, split, etc.). */ readonly location?: ITerminalLocationOptions; } export interface IAgentHostEntry { /** Display name for the profile. */ readonly name: string; /** Address or identifier for the host. */ readonly address: string; /** Getter for the connection (may be lazily resolved). */ readonly getConnection: () => IAgentConnection | undefined; } export interface IAgentHostTerminalProfileInfo { readonly extensionIdentifier: string; readonly profileId: string; readonly title: string; readonly address: string; } export declare class AgentHostTerminalService extends Disposable implements IAgentHostTerminalService { private readonly _terminalService; private readonly _terminalChatService; private readonly _terminalProfileService; private readonly _quickInputService; readonly _serviceBrand: undefined; private readonly _entries; private readonly _usedHosts; private readonly _profileRegistrations; private readonly _profiles; readonly profiles: IObservable; private _defaultCwd; /** Revived terminal instances, keyed by terminal URI string. */ private readonly _revivedInstances; /** * Active AgentHostPty instances with their owning connection clientId, * keyed by terminal URI string. Used for reconnection scoping. */ private readonly _activePtys; private readonly _reviveSequencer; constructor(_terminalService: ITerminalService, _terminalChatService: ITerminalChatService, _terminalProfileService: ITerminalProfileService, _quickInputService: IQuickInputService); registerEntry(entry: IAgentHostEntry): IDisposable; getProfileForConnection(address: string): IAgentHostTerminalProfileInfo | undefined; setDefaultCwd(cwd: URI | undefined): void; private _reconcile; private _registerProfile; createTerminalForEntry(address: string, options?: IAgentHostTerminalCreateOptions): Promise; createTerminal(connection: IAgentConnection, options?: IAgentHostTerminalCreateOptions): Promise; reviveTerminal(connection: IAgentConnection, terminalUri: URI, terminalToolSessionId: string): Promise; private _doReviveTerminal; reconnectTerminals(newConnection: IAgentConnection, oldClientId: string): Promise<{ recovered: number; total: number; }>; }