Path: blob/main/src/vs/platform/agentHost/common/agentService.ts
13394 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Event } from '../../../base/common/event.js';6import { IReference } from '../../../base/common/lifecycle.js';7import { IAuthorizationProtectedResourceMetadata } from '../../../base/common/oauth.js';8import type { IObservable } from '../../../base/common/observable.js';9import { URI } from '../../../base/common/uri.js';10import { createDecorator } from '../../instantiation/common/instantiation.js';11import type { ISyncedCustomization } from './agentPluginManager.js';12import type { IAgentSubscription } from './state/agentSubscription.js';13import type { CreateTerminalParams, ResolveSessionConfigResult, SessionConfigCompletionsResult } from './state/protocol/commands.js';14import { ProtectedResourceMetadata, type ConfigSchema, type FileEdit, type ModelSelection, type SessionActiveClient, type ToolCallPendingConfirmationState, type ToolDefinition } from './state/protocol/state.js';15import type { ActionEnvelope, INotification, IRootConfigChangedAction, SessionAction, TerminalAction } from './state/sessionActions.js';16import type { ResourceCopyParams, ResourceCopyResult, ResourceDeleteParams, ResourceDeleteResult, ResourceListResult, ResourceMoveParams, ResourceMoveResult, ResourceReadResult, ResourceWriteParams, ResourceWriteResult, IStateSnapshot } from './state/sessionProtocol.js';17import { AttachmentType, ComponentToState, SessionInputResponseKind, SessionStatus, StateComponents, type CustomizationRef, type PendingMessage, type RootState, type SessionCustomization, type SessionInputAnswer, type SessionMeta, type ToolCallResult, type Turn, type PolicyState } from './state/sessionState.js';1819// IPC contract between the renderer and the agent host utility process.20// Defines all serializable event types, the IAgent provider interface,21// and the IAgentService / IAgentHostService service decorators.2223export const enum AgentHostIpcChannels {24/** Channel for the agent host service on the main-process side */25AgentHost = 'agentHost',26/** Channel for log forwarding from the agent host process */27Logger = 'agentHostLogger',28/** Channel for WebSocket client connection count (server process management only) */29ConnectionTracker = 'agentHostConnectionTracker',30}3132/** Configuration key that controls whether the local agent host process is spawned. */33export const AgentHostEnabledSettingId = 'chat.agentHost.enabled';3435/** Configuration key that controls whether per-host IPC traffic output channels are created. */36export const AgentHostIpcLoggingSettingId = 'chat.agentHost.ipcLoggingEnabled';3738/** Result of starting the agent host WebSocket server on-demand. */39export interface IAgentHostSocketInfo {40readonly socketPath: string;41}4243/** Inspector listener information for the agent host process. */44export interface IAgentHostInspectInfo {45readonly host: string;46readonly port: number;47/** A `devtools://` URL that can be opened with `INativeHostService.openDevToolsWindow`. */48readonly devtoolsUrl: string;49}5051/**52* IPC service exposed on the {@link AgentHostIpcChannels.ConnectionTracker}53* channel. Used by the server process for lifetime management and by the54* shared process to request a local WebSocket listener on-demand.55*/56export interface IConnectionTrackerService {57readonly onDidChangeConnectionCount: Event<number>;5859/**60* Request the agent host to start a WebSocket server on a local61* pipe/socket. Returns the socket path.62* If a server is already running, returns the existing info.63*/64startWebSocketServer(): Promise<IAgentHostSocketInfo>;6566/**67* Get inspector listener info for the agent host process. If the inspector68* is not currently active and `tryEnable` is true, opens the inspector on69* a random local port. Returns `undefined` if the inspector cannot be70* enabled (e.g. running in an environment without `node:inspector`).71*/72getInspectInfo(tryEnable: boolean): Promise<IAgentHostInspectInfo | undefined>;73}7475// ---- IPC data types (serializable across MessagePort) -----------------------7677export interface IAgentSessionMetadata {78readonly session: URI;79readonly startTime: number;80readonly modifiedTime: number;81readonly project?: IAgentSessionProjectInfo;82readonly summary?: string;83readonly status?: SessionStatus;84/** Human-readable description of what the session is currently doing. */85readonly activity?: string;86readonly model?: ModelSelection;87readonly workingDirectory?: URI;88readonly customizationDirectory?: URI;89readonly isRead?: boolean;90readonly isArchived?: boolean;91readonly diffs?: readonly FileEdit[];92/**93* Side-channel metadata mirroring {@link SessionState._meta}, propagated94* to clients via per-session state subscriptions.95* Producers SHOULD use namespaced keys; consumers MUST ignore unknown96* keys. Use the typed accessors in `sessionState.ts` (e.g.97* `readSessionGitState`) for well-known slots.98*/99readonly _meta?: SessionMeta;100}101102export interface IAgentSessionProjectInfo {103readonly uri: URI;104readonly displayName: string;105}106107export interface IAgentCreateSessionResult {108readonly session: URI;109readonly project?: IAgentSessionProjectInfo;110/** The resolved working directory, which may differ from the requested one (e.g. worktree). */111readonly workingDirectory?: URI;112}113114export type AgentProvider = string;115116/** Metadata describing an agent backend, discovered over IPC. */117export interface IAgentDescriptor {118readonly provider: AgentProvider;119readonly displayName: string;120readonly description: string;121}122123// ---- Auth types (RFC 9728 / RFC 6750 inspired) -----------------------------124125/**126* Parameters for the `authenticate` command.127* Analogous to sending `Authorization: Bearer <token>` (RFC 6750 section 2.1).128*/129export interface AuthenticateParams {130/**131* The `resource` identifier from the server's132* {@link IAuthorizationProtectedResourceMetadata} that this token targets.133*/134readonly resource: string;135136/** The bearer token value (RFC 6750). */137readonly token: string;138}139140/**141* Result of the `authenticate` command.142*/143export interface AuthenticateResult {144/** Whether the token was accepted. */145readonly authenticated: boolean;146}147148export interface IAgentCreateSessionConfig {149readonly provider?: AgentProvider;150readonly model?: ModelSelection;151readonly session?: URI;152readonly workingDirectory?: URI;153readonly config?: Record<string, unknown>;154/**155* Eagerly claim the active client role for the new session. When provided,156* the server initializes the session with this client as the active157* client, equivalent to dispatching a `session/activeClientChanged`158* action immediately after creation. The `clientId` MUST match the159* connection's own `clientId`.160*/161readonly activeClient?: SessionActiveClient;162/** Fork from an existing session at a specific turn. */163readonly fork?: {164readonly session: URI;165readonly turnIndex: number;166readonly turnId: string;167/**168* Maps old protocol turn IDs to new protocol turn IDs.169* Populated by the service layer after generating fresh UUIDs170* for the forked session's turns. Used by the agent to remap171* per-turn data (e.g. SDK event ID mappings) in the session database.172*/173readonly turnIdMapping?: ReadonlyMap<string, string>;174};175}176177export interface IAgentResolveSessionConfigParams {178readonly provider?: AgentProvider;179readonly workingDirectory?: URI;180readonly config?: Record<string, unknown>;181}182183export interface IAgentSessionConfigCompletionsParams extends IAgentResolveSessionConfigParams {184readonly property: string;185readonly query?: string;186}187188/** Serializable attachment passed alongside a message to the agent host. */189export interface IAgentAttachment {190readonly type: AttachmentType;191readonly uri: URI;192readonly displayName?: string;193/** For selections: the selected text. */194readonly text?: string;195/** For selections: line/character range. */196readonly selection?: {197readonly start: { readonly line: number; readonly character: number };198readonly end: { readonly line: number; readonly character: number };199};200}201202/** Serializable model information from the agent host. */203export interface IAgentModelInfo {204readonly provider: AgentProvider;205readonly id: string;206readonly name: string;207readonly maxContextWindow?: number;208readonly supportsVision: boolean;209readonly configSchema?: ConfigSchema;210readonly policyState?: PolicyState;211}212213// ---- Agent signals (sent via IAgent.onDidSessionProgress) -------------------214215/**216* A signal emitted by an agent during session execution.217*218* Most signals carry a protocol {@link SessionAction} directly via the219* `kind: 'action'` shape, eliminating a parallel event ontology. A small220* number of cases that have no clean protocol action (permission221* auto-approval, subagent session creation, steering message222* acknowledgment) remain as discriminated non-action signals so the host223* can perform side effects before — or instead of — dispatching an action.224*/225export type AgentSignal =226| IAgentActionSignal227| IAgentToolPendingConfirmationSignal228| IAgentSubagentStartedSignal229| IAgentSteeringConsumedSignal;230231/**232* Carries a protocol {@link SessionAction} produced by an agent. The host233* dispatches the action through the state manager after routing via234* {@link IAgentActionSignal.parentToolCallId} (if set).235*236* Agents are responsible for populating `session` and any `turnId` /237* `partId` fields on the action.238*/239export interface IAgentActionSignal {240readonly kind: 'action';241/** Top-level session URI. For inner subagent events this is the parent session — see {@link parentToolCallId}. */242readonly session: URI;243/** Protocol action to dispatch. */244readonly action: SessionAction;245/** If set, route the action to the subagent session belonging to this tool call. */246readonly parentToolCallId?: string;247}248249/**250* A tool has finished collecting parameters and needs the host to decide251* whether it should run (or, mid-execution, re-confirm). The host applies252* auto-approval logic over {@link permissionKind} / {@link permissionPath}253* (see `SessionPermissionManager.getAutoApproval`) and then dispatches the254* appropriate `SessionToolCallReady` action — with confirmation options255* baked in when the user must approve, or with `confirmed: NotNeeded` when256* the host auto-approved.257*258* Kept as a non-action signal because the host owns this approval policy;259* the agent only describes the tool call and the kind of permission being260* requested. The {@link state} field carries the protocol-shaped tool-call261* state and is dispatched verbatim into the action.262*/263export interface IAgentToolPendingConfirmationSignal {264readonly kind: 'pending_confirmation';265readonly session: URI;266/** Protocol-shaped pending-confirmation state, dispatched verbatim into `SessionToolCallReady`. */267readonly state: ToolCallPendingConfirmationState;268/** Host-only auto-approval kind (not part of the dispatched action). */269readonly permissionKind?: 'shell' | 'write' | 'mcp' | 'read' | 'url' | 'custom-tool' | 'hook' | 'memory';270/** Host-only auto-approval path target (not part of the dispatched action). */271readonly permissionPath?: string;272/**273* If set, the tool call belongs to the subagent rooted at this274* parent tool call. Used by the host to route the resulting275* `SessionToolCallReady` to the subagent session — otherwise the276* action would land on the parent session, where there is no277* matching `SessionToolCallStart`.278*/279readonly parentToolCallId?: string;280}281282/**283* A subagent was spawned by a tool call. The host creates a child session284* silently and routes subsequent inner-tool events to it.285*286* Kept as a non-action signal because subagent session creation has no287* protocol action — it's a host-side composition primitive.288*/289export interface IAgentSubagentStartedSignal {290readonly kind: 'subagent_started';291readonly session: URI;292readonly toolCallId: string;293readonly agentName: string;294readonly agentDisplayName: string;295readonly agentDescription?: string;296}297298/** A steering message was consumed (sent to the model). */299export interface IAgentSteeringConsumedSignal {300readonly kind: 'steering_consumed';301readonly session: URI;302readonly id: string;303}304305// ---- Session URI helpers ----------------------------------------------------306307export namespace AgentSession {308309/**310* Creates a session URI from a provider name and raw session ID.311* The URI scheme is the provider name (e.g., `copilot:/<rawId>`).312*/313export function uri(provider: AgentProvider, rawSessionId: string): URI {314return URI.from({ scheme: provider, path: `/${rawSessionId}` });315}316317/**318* Extracts the raw session ID from a session URI (the path without leading slash).319* Accepts both a URI object and a URI string.320*/321export function id(session: URI | string): string {322const parsed = typeof session === 'string' ? URI.parse(session) : session;323return parsed.path.substring(1);324}325326/**327* Extracts the provider name from a session URI scheme.328* Accepts both a URI object and a URI string.329*/330export function provider(session: URI | string): AgentProvider | undefined {331const parsed = typeof session === 'string' ? URI.parse(session) : session;332return parsed.scheme || undefined;333}334}335336// ---- Agent provider interface -----------------------------------------------337338/**339* Implemented by each agent backend (e.g. Copilot SDK).340* The {@link IAgentService} dispatches to the appropriate agent based on341* the agent id.342*/343export interface IAgent {344/** Unique identifier for this provider (e.g. `'copilot'`). */345readonly id: AgentProvider;346347/** Fires when the provider streams progress for a session. */348readonly onDidSessionProgress: Event<AgentSignal>;349350/** Create a new session. Returns server-owned session metadata. */351createSession(config?: IAgentCreateSessionConfig): Promise<IAgentCreateSessionResult>;352353/** Resolve the dynamic configuration schema for creating a session. */354resolveSessionConfig(params: IAgentResolveSessionConfigParams): Promise<ResolveSessionConfigResult>;355356/** Return dynamic completions for a session configuration property. */357sessionConfigCompletions(params: IAgentSessionConfigCompletionsParams): Promise<SessionConfigCompletionsResult>;358359/** Send a user message into an existing session. */360sendMessage(session: URI, prompt: string, attachments?: IAgentAttachment[], turnId?: string): Promise<void>;361362/**363* Called when the session's pending (steering) message changes.364* The agent harness decides how to react — e.g. inject steering365* mid-turn via `mode: 'immediate'`.366*367* Queued messages are consumed on the server side and are not368* forwarded to the agent; `queuedMessages` will always be empty.369*/370setPendingMessages?(session: URI, steeringMessage: PendingMessage | undefined, queuedMessages: readonly PendingMessage[]): void;371372/**373* Retrieve the reconstructed turns for a session, used when restoring374* sessions from persistent storage. Each agent owns the conversion from375* its SDK-specific event log to protocol {@link Turn}s, including376* subagent sessions (callers pass the subagent URI to retrieve the377* child session's turns).378*/379getSessionMessages(session: URI): Promise<readonly Turn[]>;380381/** Dispose a session, freeing resources. */382disposeSession(session: URI): Promise<void>;383384/** Abort the current turn, stopping any in-flight processing. */385abortSession(session: URI): Promise<void>;386387/** Change the model for an existing session. */388changeModel(session: URI, model: ModelSelection): Promise<void>;389390/** Respond to a pending permission request from the SDK. */391respondToPermissionRequest(requestId: string, approved: boolean): void;392393/** Respond to a pending user input request from the SDK's ask_user tool. */394respondToUserInputRequest(requestId: string, response: SessionInputResponseKind, answers?: Record<string, SessionInputAnswer>): void;395396/** Return the descriptor for this agent. */397getDescriptor(): IAgentDescriptor;398399/** Available models from this provider. */400readonly models: IObservable<readonly IAgentModelInfo[]>;401402/** List persisted sessions from this provider. */403listSessions(): Promise<IAgentSessionMetadata[]>;404405/** Declare protected resources this agent requires auth for (RFC 9728). */406getProtectedResources(): ProtectedResourceMetadata[];407408/**409* Fires when the agent's host-owned customizations change410* (loading state, resolution results, etc.), so infrastructure411* can republish {@link AgentInfo} and session customization state.412*/413readonly onDidCustomizationsChange?: Event<void>;414415/**416* Returns the host-owned customization refs this agent currently exposes.417*418* Used to publish baseline customization metadata on {@link AgentInfo}.419*/420getCustomizations?(): readonly CustomizationRef[];421422/**423* Returns the effective customization list for a session, including424* source, enablement, and loading/error status.425*/426getSessionCustomizations?(session: URI): Promise<readonly SessionCustomization[]>;427428/**429* Authenticate for a specific resource. Returns true if accepted.430* The `resource` matches {@link IAuthorizationProtectedResourceMetadata.resource}.431*/432authenticate(resource: string, token: string): Promise<boolean>;433434/**435* Truncate a session's history. If `turnId` is provided, keeps turns up to436* and including that turn. If omitted, all turns are removed.437* Optional — not all providers support truncation.438*/439truncateSession?(session: URI, turnId?: string): Promise<void>;440441/**442* Notifies the provider that a session's archived state has changed.443* Providers may use this to clean up or restore per-session resources444* (for example, removing a session-owned worktree on archive and445* recreating it on unarchive). Optional.446*/447onArchivedChanged?(session: URI, isArchived: boolean): Promise<void>;448449/**450* Receives client-provided customization refs and syncs them (e.g. copies451* plugin files to local storage). Returns per-customization status with452* local plugin directories.453*454* The agent MAY defer a client restart until all active sessions are idle.455*/456setClientCustomizations(clientId: string, customizations: CustomizationRef[], progress?: (results: ISyncedCustomization[]) => void): Promise<ISyncedCustomization[]>;457458/**459* Receives client-provided tool definitions to make available in a460* specific session. The agent registers these as custom tools so the461* LLM can call them; execution is routed back to the owning client.462*463* Always called on `activeClientChanged`, even with an empty array,464* to clear a previous client's tools.465*466* @param session The session URI this tool set applies to.467* @param clientId The client that owns these tools.468* @param tools The tool definitions (full replacement).469*/470setClientTools(session: URI, clientId: string, tools: ToolDefinition[]): void;471472/**473* Called when a client completes a client-provided tool call.474* Resolves the tool handler's deferred promise so the SDK can continue.475*476* @param session The session the tool call belongs to.477*/478onClientToolCallComplete(session: URI, toolCallId: string, result: ToolCallResult): void;479480/**481* Notifies the agent that a customization has been toggled on or off.482* The agent MAY restart its client before the next message is sent.483*/484setCustomizationEnabled(uri: string, enabled: boolean): void;485486/** Gracefully shut down all sessions. */487shutdown(): Promise<void>;488489/** Dispose this provider and all its resources. */490dispose(): void;491}492493// ---- Service interfaces -----------------------------------------------------494495export const IAgentService = createDecorator<IAgentService>('agentService');496497/**498* Service contract for communicating with the agent host process. Methods here499* are proxied across MessagePort via `ProxyChannel`.500*501* State is synchronized via the subscribe/unsubscribe/dispatchAction protocol.502* Clients observe root state (agents, models) and session state via subscriptions,503* and mutate state by dispatching actions (e.g. session/turnStarted, session/turnCancelled).504*/505export interface IAgentService {506readonly _serviceBrand: undefined;507508/**509* Authenticate for a protected resource on the server.510* The {@link AuthenticateParams.resource} must match a resource from511* the agent's protectedResources in root state. Analogous to RFC 6750512* bearer token delivery.513*/514authenticate(params: AuthenticateParams): Promise<AuthenticateResult>;515516/** List all available sessions from the Copilot CLI. */517listSessions(): Promise<IAgentSessionMetadata[]>;518519/** Create a new session. Returns the session URI. */520createSession(config?: IAgentCreateSessionConfig): Promise<URI>;521522/** Resolve the dynamic configuration schema for creating a session. */523resolveSessionConfig(params: IAgentResolveSessionConfigParams): Promise<ResolveSessionConfigResult>;524525/** Return dynamic completions for a session configuration property. */526sessionConfigCompletions(params: IAgentSessionConfigCompletionsParams): Promise<SessionConfigCompletionsResult>;527528/** Dispose a session in the agent host, freeing SDK resources. */529disposeSession(session: URI): Promise<void>;530531/** Create a new terminal on the agent host. */532createTerminal(params: CreateTerminalParams): Promise<void>;533534/** Dispose a terminal and kill its process if still running. */535disposeTerminal(terminal: URI): Promise<void>;536537/** Gracefully shut down all sessions and the underlying client. */538shutdown(): Promise<void>;539540// ---- Protocol methods (sessions process protocol) ----------------------541542/**543* Subscribe to state at the given URI. Returns a snapshot of the current544* state and the serverSeq at snapshot time. Subsequent actions for this545* resource arrive via {@link onDidAction}.546*/547subscribe(resource: URI): Promise<IStateSnapshot>;548549/** Unsubscribe from state updates for the given URI. */550unsubscribe(resource: URI): void;551552/**553* Fires when the server applies an action to subscribable state.554* Clients use this alongside {@link subscribe} to keep their local555* state in sync.556*/557readonly onDidAction: Event<ActionEnvelope>;558559/**560* Fires when the server broadcasts an ephemeral notification561* (e.g. sessionAdded, sessionRemoved).562*/563readonly onDidNotification: Event<INotification>;564565/**566* Dispatch a client-originated action to the server. The server applies567* it to state, triggers side effects, and echoes it back via568* {@link onDidAction} with the client's origin for reconciliation.569*/570dispatchAction(action: SessionAction | TerminalAction | IRootConfigChangedAction, clientId: string, clientSeq: number): void;571572/**573* List the contents of a directory on the agent host's filesystem.574* Used by the client to drive a remote folder picker before session creation.575*/576resourceList(uri: URI): Promise<ResourceListResult>;577578/**579* Read stored content by URI from the agent host (e.g. file edit snapshots,580* or reading files from the remote filesystem).581*/582resourceRead(uri: URI): Promise<ResourceReadResult>;583584/**585* Write content to a file on the agent host's filesystem.586* Used for undo/redo operations on file edits.587*/588resourceWrite(params: ResourceWriteParams): Promise<ResourceWriteResult>;589590/**591* Copy a resource from one URI to another on the agent host's filesystem.592*/593resourceCopy(params: ResourceCopyParams): Promise<ResourceCopyResult>;594595/**596* Delete a resource at a URI on the agent host's filesystem.597*/598resourceDelete(params: ResourceDeleteParams): Promise<ResourceDeleteResult>;599600/**601* Move (rename) a resource from one URI to another on the agent host's filesystem.602*/603resourceMove(params: ResourceMoveParams): Promise<ResourceMoveResult>;604}605606/**607* Consumer-facing connection to an agent host. Session handlers, terminal608* contributions, and other features program against this interface.609*610* Implementations wrap an {@link IAgentService} and layer subscription611* management and optimistic write-ahead on top.612*/613export interface IAgentConnection {614readonly _serviceBrand: undefined;615readonly clientId: string;616617// ---- State subscriptions ------------------------------------------------618readonly rootState: IAgentSubscription<RootState>;619getSubscription<T extends StateComponents>(kind: T, resource: URI): IReference<IAgentSubscription<ComponentToState[T]>>;620getSubscriptionUnmanaged<T extends StateComponents>(kind: T, resource: URI): IAgentSubscription<ComponentToState[T]> | undefined;621622// ---- Action dispatch ----------------------------------------------------623dispatch(action: SessionAction | TerminalAction | IRootConfigChangedAction): void;624625// ---- Events (connection-level) ------------------------------------------626readonly onDidNotification: Event<INotification>;627readonly onDidAction: Event<ActionEnvelope>;628629// ---- Session lifecycle --------------------------------------------------630authenticate(params: AuthenticateParams): Promise<AuthenticateResult>;631listSessions(): Promise<IAgentSessionMetadata[]>;632createSession(config?: IAgentCreateSessionConfig): Promise<URI>;633resolveSessionConfig(params: IAgentResolveSessionConfigParams): Promise<ResolveSessionConfigResult>;634sessionConfigCompletions(params: IAgentSessionConfigCompletionsParams): Promise<SessionConfigCompletionsResult>;635disposeSession(session: URI): Promise<void>;636637// ---- Terminal lifecycle -------------------------------------------------638createTerminal(params: CreateTerminalParams): Promise<void>;639disposeTerminal(terminal: URI): Promise<void>;640641// ---- Filesystem operations ----------------------------------------------642resourceList(uri: URI): Promise<ResourceListResult>;643resourceRead(uri: URI): Promise<ResourceReadResult>;644resourceWrite(params: ResourceWriteParams): Promise<ResourceWriteResult>;645resourceCopy(params: ResourceCopyParams): Promise<ResourceCopyResult>;646resourceDelete(params: ResourceDeleteParams): Promise<ResourceDeleteResult>;647resourceMove(params: ResourceMoveParams): Promise<ResourceMoveResult>;648}649650export const IAgentHostService = createDecorator<IAgentHostService>('agentHostService');651652/**653* The local wrapper around the agent host process (manages lifecycle, restart,654* exposes the proxied service). Consumed by the main process and workbench.655*/656export interface IAgentHostService extends IAgentConnection {657658readonly onAgentHostExit: Event<number>;659readonly onAgentHostStart: Event<void>;660661/**662* `true` while we are in the middle of authenticating against the local663* agent host (resolving tokens for any advertised `protectedResources` and664* pushing them via {@link authenticate}). Defaults to `true` at startup so665* that the period before the first auth pass is also covered.666*667* Producers (the workbench `AgentHostContribution`) flip this around their668* auth pass; consumers (e.g. the local sessions provider) read it to mark669* sessions as still loading.670*/671readonly authenticationPending: IObservable<boolean>;672673/** Update {@link authenticationPending}. Internal — only the auth driver should call this. */674setAuthenticationPending(pending: boolean): void;675676restartAgentHost(): Promise<void>;677678startWebSocketServer(): Promise<IAgentHostSocketInfo>;679680/**681* Get inspector listener info for the agent host process. If the inspector682* is not currently active and `tryEnable` is true, opens the inspector on683* a random local port. Returns `undefined` if the inspector cannot be684* enabled.685*/686getInspectInfo(tryEnable: boolean): Promise<IAgentHostInspectInfo | undefined>;687}688689690