import { Disposable, IDisposable } from "../../../../base/common/lifecycle.js"; import { URI } from "../../../../base/common/uri.js"; import { ILogService } from "../../../../platform/log/common/log.service.js"; import { ITelemetryService } from "../../../../platform/telemetry/common/telemetry.service.js"; import { IChatWidget } from "./chat.js"; import { IChatUserInteractionOTelService } from "./chatUserInteractionOTel.service.js"; import { IChatProgress } from "../common/chatService/chatService.js"; import { ChatAgentLocation, ChatPermissionLevel } from "../common/constants.js"; import { ILanguageModelsService } from "../common/languageModels.service.js"; import { IChatProgressResponseContent, IChatResponseModel } from "../common/model/chatModel.js"; export type ChatUserInteractionTimingResult = "success" | "cancelled" | "error" | "completedWithoutProgress" | "notDispatched" | "queued" | "navigated" | "hidden" | "disposed"; export interface IChatUserInteractionTelemetryContext { readonly requestId?: string; readonly chatSessionId?: string; readonly agent?: string; readonly agentExtensionId?: string; readonly location?: ChatAgentLocation; readonly model?: string; readonly permissionLevel?: ChatPermissionLevel; readonly chatMode?: string; readonly sessionType?: string; readonly harness?: string; } export interface IChatUserInteractionOptions { readonly window: Window; readonly visible: boolean; readonly context?: IChatUserInteractionTelemetryContext; readonly getSessionResource?: () => URI | undefined; readonly now?: () => number; } export declare function isChatFirstVisibleProgress(part: IChatProgress | IChatProgressResponseContent): boolean; /** One submission owns its clock, response observation, render acknowledgement and reporting. */ export declare class ChatUserInteraction extends Disposable { private readonly _options; private readonly _telemetryService; private readonly _logService; private readonly _otelService; private readonly _languageModelsService; private static _nextId; readonly id: number; readonly startedAt: number; private readonly _now; private readonly _onDidFinish; readonly onDidFinish: import("../../../../base/common/event.js").Event; private readonly _render; private _active; private _context; private _response; private _requestPhase; private _getWidget; private _renderWidget; private readonly _otelIdentity; constructor(_options: IChatUserInteractionOptions, _telemetryService: ITelemetryService, _logService: ILogService, _otelService: IChatUserInteractionOTelService, _languageModelsService: ILanguageModelsService); get isActive(): boolean; addDisposable(disposable: IDisposable): void; setContext(context: IChatUserInteractionTelemetryContext): void; /** Accept only the response created for this submission; never infer it from focus or prompt text. */ observeResponse(response: IChatResponseModel | undefined, getWidget: () => IChatWidget | undefined): void; resetRender(): void; /** Shared by existing chat widgets and the Agents composer's response-view handoff. */ checkResponse(): void; cancel(result: Exclude): void; private _finish; private _getTelemetryModel; dispose(): void; }