@@ -537,6 +537,54 @@ public MaskResult maskSecrets(@NonNull String filePath) throws CxException, IOEx
537537 return Execution .executeCommand (withConfigArguments (arguments ), logger , MaskResult ::fromLine );
538538 }
539539
540+ /**
541+ * Executes telemetry AI command to collect telemetry data for user interactions related to AI features.
542+ *
543+ * @param aiProvider AI provider name (e.g., "Cursor")
544+ * @param agent Agent name
545+ * @param eventType Event type (e.g., "click")
546+ * @param subType Event subtype (e.g., "ast-results.viewPackageDetails")
547+ * @param engine Engine type (e.g., "secrets")
548+ * @param problemSeverity Severity level (e.g., "high")
549+ * @param scanType Type of scan
550+ * @param status Status information
551+ * @param totalCount Number count
552+ * @return Command output as string
553+ * @throws IOException if I/O error occurs
554+ * @throws InterruptedException if command execution is interrupted
555+ * @throws CxException if CLI command fails
556+ */
557+ public String telemetryAIEvent (String aiProvider , String agent , String eventType , String subType ,
558+ String engine , String problemSeverity , String scanType , String status ,
559+ Integer totalCount ) throws IOException , InterruptedException , CxException {
560+ this .logger .info ("Executing telemetry AI event with provider: {}, type: {}, subType: {}" ,
561+ aiProvider , eventType , subType );
562+
563+ List <String > arguments = new ArrayList <>();
564+ arguments .add (CxConstants .CMD_TELEMETRY );
565+ arguments .add (CxConstants .SUB_CMD_TELEMETRY_AI );
566+ arguments .add (CxConstants .AI_PROVIDER );
567+ arguments .add (aiProvider );
568+ arguments .add (CxConstants .AGENT );
569+ arguments .add (agent );
570+ arguments .add (CxConstants .TYPE );
571+ arguments .add (eventType );
572+ arguments .add (CxConstants .SUB_TYPE );
573+ arguments .add (subType );
574+ arguments .add (CxConstants .ENGINE );
575+ arguments .add (engine );
576+ arguments .add (CxConstants .PROBLEM_SEVERITY );
577+ arguments .add (problemSeverity );
578+ arguments .add (CxConstants .SCAN_TYPE_FLAG );
579+ arguments .add (scanType );
580+ arguments .add (CxConstants .STATUS );
581+ arguments .add (status );
582+ arguments .add (CxConstants .TOTAL_COUNT );
583+ arguments .add (totalCount .toString ());
584+
585+ return Execution .executeCommand (withConfigArguments (arguments ), logger , line -> line );
586+ }
587+
540588 private int getIndexOfBfLNode (List <Node > bflNodes , List <Node > resultNodes ) {
541589
542590 int bflNodeNotFound = -1 ;
0 commit comments