import { IAction } from "../../base/common/actions.js"; import { INotificationTelemetrySource, NotificationActionTelemetryId } from "../../platform/notification/common/notificationTelemetry.js"; import { ITelemetryService } from "../../platform/telemetry/common/telemetry.service.js"; import type { INotificationViewItem } from "./notifications.js"; export type NotificationTelemetrySurface = "toast" | "center" | "accessibleView"; export type NotificationInteraction = "primaryAction" | "secondaryAction" | "progressCancel" | "dismiss" | "clearAll" | "expand" | "collapse" | "copy" | "configure" | "link"; export type NotificationShownEvent = INotificationTelemetrySource & { instanceId: number; surface: NotificationTelemetrySurface | "unknown"; severity: "info" | "warning" | "error" | "unknown"; hasProgress: boolean; cancellable: boolean; }; export type NotificationShownClassification = { owner: "benibenj"; comment: "A workbench notification was rendered in a visible viewport, once per logical notification and surface."; origin: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Core, extension, or unknown attribution."; }; notificationId: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Audited code-defined core or extension notification type; extension IDs are allowlisted per originating extension and message/progress kind. Never derived from content."; }; extensionId: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Publisher.extension from a trusted extension bridge, or none/unknown. Never a display source."; }; instanceId: { classification: "SystemMetaData"; purpose: "FeatureInsight"; isMeasurement: true; comment: "Ephemeral renderer-local sequence for joining exposures and interactions; not persisted."; }; surface: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Invoking or last observed surface: toast, notification center, accessible view, or unknown."; }; severity: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Info, warning, error, or unknown."; }; hasProgress: { classification: "SystemMetaData"; purpose: "FeatureInsight"; isMeasurement: true; comment: "Whether the notification currently has active progress."; }; cancellable: { classification: "SystemMetaData"; purpose: "FeatureInsight"; isMeasurement: true; comment: "Whether an enabled, explicitly annotated progress cancellation action is available."; }; }; export type NotificationInteractionEvent = NotificationShownEvent & { interaction: NotificationInteraction; actionId: NotificationActionTelemetryId | "unknown"; actionRole: "primary" | "secondary" | "none"; extensionButtonIndex: number; timeSinceShownMs: number; }; export type NotificationInteractionClassification = Omit & { comment: "An explicit workbench notification interaction was invoked, not necessarily completed successfully. Do not add legacy workbenchActionExecuted counts."; interaction: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Bounded user interaction; automatic removal, layout changes, and timeout are excluded."; }; actionId: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Audited action semantic ID or unknown, never an arbitrary IAction.id or label."; }; actionRole: { classification: "SystemMetaData"; purpose: "FeatureInsight"; comment: "Primary, secondary, or none for non-action interactions."; }; extensionButtonIndex: { classification: "SystemMetaData"; purpose: "FeatureInsight"; isMeasurement: true; comment: "Extension message button position, or -1. Position conveys no semantic meaning."; }; timeSinceShownMs: { classification: "SystemMetaData"; purpose: "FeatureInsight"; isMeasurement: true; comment: "Milliseconds since first actual exposure on any surface, or -1 if never exposed."; }; }; /** Deduplication can replace a view item without presenting a new logical notification. */ export declare function inheritNotificationTelemetry(duplicate: INotificationViewItem, replacement: INotificationViewItem): void; export declare function logNotificationShown(telemetryService: ITelemetryService, item: INotificationViewItem, surface: NotificationTelemetrySurface): void; export declare function logNotificationInteraction(telemetryService: ITelemetryService, item: INotificationViewItem, interaction: NotificationInteraction, surface?: NotificationTelemetrySurface, action?: IAction, actionRole?: "primary" | "secondary" | "none"): void; export declare function logNotificationAction(telemetryService: ITelemetryService, item: INotificationViewItem, action: IAction, surface?: NotificationTelemetrySurface): void; export declare function logNotificationExpansion(telemetryService: ITelemetryService, item: INotificationViewItem, expanded: boolean, surface?: NotificationTelemetrySurface): void;