@@ -55,6 +55,9 @@ export class CxWrapper {
5555 if ( cxScanConfig . additionalParameters ) {
5656 this . config . additionalParameters = cxScanConfig . additionalParameters ;
5757 }
58+ if ( cxScanConfig . agentName ) {
59+ this . config . agentName = cxScanConfig . agentName ;
60+ }
5861 }
5962
6063
@@ -89,6 +92,10 @@ export class CxWrapper {
8992 list . push ( param )
9093 } )
9194 }
95+ if ( this . config . agentName ) {
96+ list . push ( CxConstants . AGENT ) ;
97+ list . push ( this . config . agentName ) ;
98+ }
9299 if ( formatRequired ) {
93100 list . push ( CxConstants . FORMAT ) ;
94101 list . push ( CxConstants . FORMAT_JSON ) ;
@@ -130,7 +137,6 @@ export class CxWrapper {
130137 async scanAsca (
131138 sourceFile : string ,
132139 updateVersion = false ,
133- agent ?: string | null ,
134140 ignoredFilePath ?: string
135141) : Promise < CxCommandOutput > {
136142 const commands : string [ ] = [
@@ -144,12 +150,6 @@ export class CxWrapper {
144150 commands . push ( CxConstants . ASCA_UPDATE_VERSION ) ;
145151 }
146152
147- if ( agent ) {
148- commands . push ( CxConstants . AGENT , agent ) ;
149- } else {
150- commands . push ( CxConstants . AGENT , '"js-wrapper"' ) ;
151- }
152-
153153 if ( ignoredFilePath ) {
154154 commands . push ( CxConstants . IGNORE__FILE_PATH , ignoredFilePath ) ;
155155 }
@@ -352,8 +352,8 @@ export class CxWrapper {
352352 return exec . executeResultsCommandsFile ( scanId , CxConstants . FORMAT_HTML , CxConstants . FORMAT_HTML_FILE , commands , this . config . pathToExecutable , fileName ) ;
353353 }
354354
355- async getResults ( scanId : string , resultType : string , outputFileName : string , outputFilePath : string , agent ?: string | null ) {
356- const commands = this . resultsShow ( scanId , resultType , outputFileName , outputFilePath , agent )
355+ async getResults ( scanId : string , resultType : string , outputFileName : string , outputFilePath : string ) {
356+ const commands = this . resultsShow ( scanId , resultType , outputFileName , outputFilePath )
357357 const exec = new ExecutionService ( ) ;
358358 return await exec . executeCommands ( this . config . pathToExecutable , commands ) ;
359359 }
@@ -365,7 +365,7 @@ export class CxWrapper {
365365 return await exec . executeCommands ( this . config . pathToExecutable , commands , CxConstants . CODE_BASHING_TYPE ) ;
366366 }
367367
368- resultsShow ( scanId : string , reportFormat : string , outputFileName : string , outputPath : string , agent ?: string | null ) : string [ ] {
368+ resultsShow ( scanId : string , reportFormat : string , outputFileName : string , outputPath : string ) : string [ ] {
369369 const commands : string [ ] = [ CxConstants . CMD_RESULT , CxConstants . SUB_CMD_SHOW , CxConstants . SCAN_ID , scanId , CxConstants . REPORT_FORMAT , reportFormat ] ;
370370 if ( outputFileName ) {
371371 commands . push ( CxConstants . OUTPUT_NAME ) ;
@@ -375,10 +375,6 @@ export class CxWrapper {
375375 commands . push ( CxConstants . OUTPUT_PATH ) ;
376376 commands . push ( outputPath ) ;
377377 }
378- if ( agent ) {
379- commands . push ( CxConstants . AGENT ) ;
380- commands . push ( agent ) ;
381- }
382378 commands . push ( ...this . initializeCommands ( false ) ) ;
383379 return commands ;
384380 }
@@ -466,6 +462,27 @@ export class CxWrapper {
466462 return value ?. toLowerCase ( ) === "true" ;
467463 }
468464
465+ async standaloneEnabled ( ) : Promise < boolean > {
466+ const commands : string [ ] = [ CxConstants . CMD_UTILS , CxConstants . SUB_CMD_TENANT ] ;
467+ commands . push ( ...this . initializeCommands ( false ) ) ;
468+
469+ const exec = new ExecutionService ( ) ;
470+ const output = await exec . executeMapTenantOutputCommands ( this . config . pathToExecutable , commands ) ;
471+
472+ const value = getTrimmedMapValue ( output , CxConstants . STANDALONE_KEY ) ;
473+ return value ?. toLowerCase ( ) === "true" ;
474+ }
475+
476+ async cxOneAssistEnabled ( ) : Promise < boolean > {
477+ const commands : string [ ] = [ CxConstants . CMD_UTILS , CxConstants . SUB_CMD_TENANT ] ;
478+ commands . push ( ...this . initializeCommands ( false ) ) ;
479+
480+ const exec = new ExecutionService ( ) ;
481+ const output = await exec . executeMapTenantOutputCommands ( this . config . pathToExecutable , commands ) ;
482+
483+ const value = getTrimmedMapValue ( output , CxConstants . ASSIST_KEY ) ;
484+ return value ?. toLowerCase ( ) === "true" ;
485+ }
469486
470487 async aiMcpServerEnabled ( ) : Promise < boolean > {
471488 const commands : string [ ] = [ CxConstants . CMD_UTILS , CxConstants . SUB_CMD_TENANT ] ;
@@ -530,12 +547,11 @@ export class CxWrapper {
530547 return new ExecutionService ( ) . executeCommands ( this . config . pathToExecutable , commands , CxConstants . MASK_TYPE ) ;
531548 }
532549
533- telemetryAIEvent ( aiProvider : string , agent : string , eventType : string , subType : string , engine : string , problemSeverity : string , scanType : string , status : string , totalCount : number ) : Promise < CxCommandOutput > {
550+ telemetryAIEvent ( aiProvider : string , eventType : string , subType : string , engine : string , problemSeverity : string , scanType : string , status : string , totalCount : number ) : Promise < CxCommandOutput > {
534551 const commands : string [ ] = [
535552 CxConstants . TELEMETRY ,
536553 CxConstants . SUB_CMD_TELEMETRY_AI ,
537554 CxConstants . AI_PROVIDER , aiProvider ,
538- CxConstants . AGENT , agent ,
539555 CxConstants . TYPE , eventType ,
540556 CxConstants . SUB_TYPE , subType ,
541557 CxConstants . ENGINE , engine ,
0 commit comments