import { IConfigurationService } from '../../../platform/configuration/common/configurationService'; import { AggressivenessLevel, UserHappinessScoreConfiguration } from '../../../platform/inlineEdits/common/dataTypes/xtabPromptOptions'; import { ILogService } from '../../../platform/log/common/logService'; import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService'; import { ITelemetryService } from '../../../platform/telemetry/common/telemetry'; import { DelaySession } from './delay'; export declare enum ActionKind { Accepted = "accepted", Rejected = "rejected", Ignored = "ignored" } /** * Represents a user interaction wrt an inline edit suggestion. */ export interface NESUserAction { time: number; kind: ActionKind; } export declare const MAX_INTERACTIONS_CONSIDERED = 10; export declare const MAX_INTERACTIONS_STORED = 30; /** * Get window of actions with ignored action limiting via window expansion. * * When ignored limit is reached, skip excess ignored actions but expand window * further back to still get MAX_INTERACTIONS_CONSIDERED items. */ export declare function getWindowWithIgnoredLimit(actions: NESUserAction[], config: UserHappinessScoreConfiguration): NESUserAction[]; /** * Calculate user happiness score from actions. * Value between 0 and 1 indicating user happiness. * 1 means very happy, 0 means very unhappy. * * Uses position-weighted scoring with ignored action limiting: * - More recent actions have higher weight * - Ignored actions can be limited (consecutive or total) to prevent score dilution * - Score is adjusted towards neutral (0.5) based on data confidence */ export declare function getUserHappinessScore(actions: NESUserAction[], config: UserHappinessScoreConfiguration): number; export declare class UserInteractionMonitor { private readonly _configurationService; private readonly _experimentationService; private readonly _logService; private readonly _telemetryService; /** * Used for aggressiveness level calculation. * Includes all action types (accepted, rejected, ignored). */ protected _recentUserActionsForAggressiveness: NESUserAction[]; /** * Used for timing/debounce calculation. * Only includes accepted and rejected actions (ignored actions don't affect timing). */ protected _recentUserActionsForTiming: (NESUserAction & { kind: ActionKind.Accepted | ActionKind.Rejected; })[]; private _lastActionWasAcceptance; constructor(_configurationService: IConfigurationService, _experimentationService: IExperimentationService, _logService: ILogService, _telemetryService: ITelemetryService); handleAcceptance(): void; handleRejection(): void; handleIgnored(): void; /** * Returns true if the last recorded user action was an acceptance. * Used to skip aggressiveness min-response-time delay after accepts. */ get wasLastActionAcceptance(): boolean; private _recordUserAction; createDelaySession(requestTime: number | undefined): DelaySession; private _getExpectedTotalTime; /** * Returns the aggressiveness level and the user happiness score that was used to derive it. * The score is returned to avoid race conditions when logging telemetry. */ getAggressivenessLevel(): { aggressivenessLevel: AggressivenessLevel; userHappinessScore: number | undefined; }; protected _getUserHappinessScoreConfiguration(): UserHappinessScoreConfiguration; private _getUserHappinessScore; } //# sourceMappingURL=userInteractionMonitor.d.ts.map