@@ -23,16 +23,12 @@ import type {
2323 Bot ,
2424 BotVersion ,
2525 BotTemplate ,
26- GenAiPlanner ,
2726 BotDialogGroup ,
27+ GenAiPlannerBundle ,
2828 ConversationDefinitionGoal ,
2929 ConversationVariable ,
3030} from '@salesforce/types/metadata' ;
3131
32- export type GenAiPlannerBundleExt = {
33- GenAiPlannerBundle : GenAiPlanner & { botTemplate ?: string } ;
34- } ;
35-
3632export type BotTemplateExt = {
3733 '?xml' : { '@_version' : '1.0' ; '@_encoding' : 'UTF-8' } ;
3834 BotTemplate : Omit < BotTemplate , 'botDialogGroups' | 'conversationGoals' | 'conversationVariables' > & {
@@ -114,18 +110,18 @@ export default class AgentGenerateTemplate extends SfCommand<AgentGenerateTempla
114110 // Parse the metadata files as JSON
115111 const botJson = xmlToJson < BotExt > ( join ( botDir , `${ botName } .bot-meta.xml` ) , parser ) ;
116112 const botVersionJson = xmlToJson < BotVersionExt > ( join ( botDir , `v${ botVersion } .botVersion-meta.xml` ) , parser ) ;
117- const genAiPlannerBundleMetaJson = xmlToJson < GenAiPlannerBundleExt > (
113+ const genAiPlannerBundleMetaJson = xmlToJson < GenAiPlannerBundle > (
118114 join ( genAiPlannerBundleDir , botName , `${ botName } .genAiPlannerBundle` ) ,
119115 parser
120116 ) ;
121117
122118 // Modify the metadata files for final output
123119 // TODO: Confirm this name (might be conversationDefinitionPlanners)
124- genAiPlannerBundleMetaJson . GenAiPlannerBundle . botTemplate = finalFilename ;
120+ genAiPlannerBundleMetaJson . botTemplate = finalFilename ;
125121 const botTemplate = convertBotToBotTemplate ( botJson , botVersionJson , finalFilename , botTemplateFilePath ) ;
126122
127123 // Build and save the metadata files
128- jsonToXml < GenAiPlannerBundleExt > ( clonedGenAiPlannerBundleFilePath , genAiPlannerBundleMetaJson , builder ) ;
124+ jsonToXml < GenAiPlannerBundle > ( clonedGenAiPlannerBundleFilePath , genAiPlannerBundleMetaJson , builder ) ;
129125 jsonToXml < BotTemplateExt > ( botTemplateFilePath , botTemplate , builder ) ;
130126
131127 this . log ( `\nSaved BotTemplate to:\n - ${ botTemplateFilePath } ` ) ;
0 commit comments