import { ProviderId } from "../../../../../../editor/common/languages.js"; import { EditDeltaInfo, EditSuggestionId } from "../../../../../../editor/common/textModelEditSource.js"; export interface IEditTelemetryBaseData { suggestionId: EditSuggestionId | undefined; feature: /** Code suggestions generated in the sidebar chat panel */ "sideBarChat" /** Code suggestions generated through inline chat within the editor */ | "inlineChat" /** Inline code completion suggestions */ | "inlineSuggestion" | undefined; presentation: /** Code displayed in a code block within chat responses. Only possible when feature is `sideBarChat` or `inlineChat`. */ "codeBlock" /** Code already applied to the editor and highlighted with diff-style formatting. Only possible when feature is `sideBarChat` or `inlineChat`. */ | "highlightedEdit" /** Code suggested inline as completion text. Only possible when feature is `inlineSuggestion`. */ | "inlineCompletion" /** Code shown as next edit suggestion. Only possible when feature is `nextEditSuggestion`. */ | "nextEditSuggestion"; source: ProviderId | undefined; languageId: string | undefined; editDeltaInfo: EditDeltaInfo | undefined; modeId: /** User asking questions without requesting code changes */ "ask" /** User requesting direct code edits or modifications */ | "edit" /** AI agent mode for autonomous task completion and multi-file edits */ | "agent" /** Custom mode defined by extensions or user settings */ | "custom" /** Applying a previously suggested code block */ | "applyCodeBlock" | undefined; applyCodeBlockSuggestionId: EditSuggestionId | undefined; modelId: string | undefined; /** Source controlled id. For chat edits and code-block actions this is the originating chat request id. */ sourceRequestId: string | undefined; /** Whether the edit was generated by an Agent Host-backed chat session. */ isAgentHostSession?: boolean; } export interface IEditTelemetryCodeSuggestedData extends IEditTelemetryBaseData { /** The agent implementation that produced the code block. */ provider?: string; } export interface IEditTelemetryCodeAcceptedData extends IEditTelemetryBaseData { /** Owning Agent Host session ID, omitted for suggestions without an Agent Host owner. */ agentSessionId?: string; /** The agent implementation that produced the code block. */ provider?: string; /** Canonical workbench chat ID, matching chat request telemetry. */ chatSessionId?: string; acceptanceMethod: /** Insert code at the current cursor position in the active editor. Only possible when presentation is `codeBlock`. */ "insertAtCursor" /** Create a new file and insert the code there. Only possible when presentation is `codeBlock`. */ | "insertInNewFile" /** User manually copied the code. Only possible when presentation is `codeBlock`. */ | "copyManual" /** User clicked a copy button to copy the code. Only possible when presentation is `codeBlock`. */ | "copyButton" /** User accepted the suggestion by clicking 'keep' (when presentation is `highlightedEdit`) or pressing Tab (when feature is `inlineSuggestion`) */ | "accept"; } export interface IEditTelemetryCodeRejectedData extends IEditTelemetryBaseData { agentSessionId?: string; chatSessionId?: string; rejectionMethod: /** User explicitly rejected/undid the suggestion (when presentation is `highlightedEdit`) or pressed Escape (when feature is `inlineSuggestion`) */ "reject"; }