1- import { PlanWithSteps , Step , AgentType , ProcessedPlanData } from '@/models' ;
1+ import { PlanWithSteps , Step , AgentType , ProcessedPlanData , PlanMessage } from '@/models' ;
22import { apiService } from '@/api' ;
33
44
@@ -13,8 +13,8 @@ export class PlanDataService { /**
1313 static async fetchPlanData ( planId : string ) : Promise < ProcessedPlanData > {
1414 try {
1515 // Use optimized getPlanById method for better performance
16- const plan = await apiService . getPlanById ( planId ) ;
17- return this . processPlanData ( plan ) ;
16+ const planBody = await apiService . getPlanById ( planId ) ;
17+ return this . processPlanData ( planBody . plan_with_steps , planBody . messages || [ ] ) ;
1818 } catch ( error ) {
1919 console . error ( 'Failed to fetch plan data:' , error ) ;
2020 throw error ;
@@ -26,7 +26,7 @@ export class PlanDataService { /**
2626 * @param plan PlanWithSteps object to process
2727 * @returns Processed plan data
2828 */
29- static processPlanData ( plan : PlanWithSteps ) : ProcessedPlanData {
29+ static processPlanData ( plan : PlanWithSteps , messages : PlanMessage [ ] ) : ProcessedPlanData {
3030 // Extract unique agents from steps
3131 const uniqueAgents = new Set < AgentType > ( ) ;
3232 plan . steps . forEach ( step => {
@@ -49,7 +49,8 @@ export class PlanDataService { /**
4949 plan,
5050 agents,
5151 steps,
52- hasHumanClarificationRequest
52+ hasHumanClarificationRequest,
53+ messages
5354 } ;
5455 }
5556
0 commit comments