@@ -299,6 +299,45 @@ export class CxWrapper {
299299 return output . has ( CxConstants . IDE_SCANS_KEY ) && output . get ( CxConstants . IDE_SCANS_KEY ) . toLowerCase ( ) === " true" ;
300300 }
301301
302+ async guidedRemediationEnabled ( ) : Promise < boolean > {
303+ const commands : string [ ] = [ CxConstants . CMD_UTILS , CxConstants . SUB_CMD_TENANT ] ;
304+ commands . push ( ...this . initializeCommands ( false ) ) ;
305+ const exec = new ExecutionService ( ) ;
306+ const output = await exec . executeMapTenantOutputCommands ( this . config . pathToExecutable , commands ) ;
307+ return output . has ( CxConstants . AI_GUIDED_REMEDIATION_KEY ) && output . get ( CxConstants . AI_GUIDED_REMEDIATION_KEY ) . toLowerCase ( ) === " true" ;
308+ }
309+
310+ async chat ( apikey : string , file : string , line : number , severity : string , vulnerability : string , input : string , conversationId ?: string , model ?: string ) : Promise < CxCommandOutput > {
311+ const commands : string [ ] = [
312+ CxConstants . CMD_CHAT ,
313+ CxConstants . CMD_CHAT_APIKEY , apikey ,
314+ CxConstants . CMD_CHAT_FILE , file ,
315+ CxConstants . CMD_CHAT_LINE , line . toString ( ) ,
316+ CxConstants . CMD_CHAT_SEVERITY , severity ,
317+ CxConstants . CMD_CHAT_VULNERABILITY , vulnerability ,
318+ CxConstants . CMD_CHAT_INPUT , input ,
319+ ] ;
320+ if ( conversationId ) {
321+ commands . push ( CxConstants . CMD_CHAT_CONVERSATION_ID , conversationId )
322+ }
323+ if ( model ) {
324+ commands . push ( CxConstants . CMD_CHAT_MODEL , model )
325+ }
326+ commands . push ( ...this . initializeCommands ( false ) ) ;
327+ return new ExecutionService ( ) . executeCommands ( this . config . pathToExecutable , commands , CxConstants . CHAT_TYPE ) ;
328+ }
329+
330+ async maskSecrets ( file : string ) : Promise < CxCommandOutput > {
331+ const commands : string [ ] = [
332+ CxConstants . CMD_UTILS ,
333+ CxConstants . CMD_MASK_SECRETS ,
334+ CxConstants . CMD_CHAT_FILE , file ,
335+ ] ;
336+
337+ commands . push ( ...this . initializeCommands ( false ) ) ;
338+ return new ExecutionService ( ) . executeCommands ( this . config . pathToExecutable , commands , CxConstants . MASK_TYPE ) ;
339+ }
340+
302341 prepareAdditionalParams ( additionalParameters : string ) : string [ ] {
303342 const params : string [ ] = [ ] ;
304343
0 commit comments