@@ -72,9 +72,9 @@ const initializeResearchStep = createStep({
7272 await writer ?. custom ( {
7373 type : 'data-tool-progress' ,
7474 data : {
75- status : "in-progress" ,
76- message : `Researching topic: ${ inputData . topics } ...` ,
77- stage : "researchAgent" ,
75+ status : "in-progress" ,
76+ message : `Researching topic: ${ inputData . topics } ...` ,
77+ stage : "researchAgent" ,
7878 } ,
7979 id : 'initialize-research' ,
8080 } ) ;
@@ -84,7 +84,7 @@ const initializeResearchStep = createStep({
8484 maxSources : inputData . maxSourcesPerTopic ,
8585 } ) ) ;
8686
87-
87+
8888 logStepEnd ( 'initialize-research' , { topicsCount : topics . length } , Date . now ( ) - startTime ) ;
8989
9090 return topics ;
@@ -109,7 +109,7 @@ const researchTopicStep = createStep({
109109 data : {
110110 status : 'in-progress' ,
111111 message : `Researching topic: ${ inputData . topic } ...` ,
112- stage : 'workflow ' ,
112+ stage : 'research-topic-item ' ,
113113 } ,
114114 id : 'research-topic-item' ,
115115 } ) ;
@@ -128,7 +128,7 @@ const researchTopicStep = createStep({
128128 data : {
129129 status : 'in-progress' ,
130130 message : `Researching topic: ${ inputData . topic } ...` ,
131- stage : 'workflow ' ,
131+ stage : 'research-topic-item ' ,
132132 } ,
133133 id : 'research-topic-item' ,
134134 } ) ;
@@ -189,7 +189,7 @@ const researchTopicStep = createStep({
189189 data : {
190190 status : 'done' ,
191191 message : `Research completed for ${ inputData . topic } ...` ,
192- stage : 'workflow ' ,
192+ stage : 'research-topic-item ' ,
193193 } ,
194194 id : 'research-topic-item' ,
195195 } ) ;
@@ -211,9 +211,9 @@ const researchTopicStep = createStep({
211211 await writer ?. custom ( {
212212 type : 'data-tool-progress' ,
213213 data : {
214- status : 'in-progress ' ,
214+ status : 'done ' ,
215215 message : `Research error for ${ inputData . topic } ...` ,
216- stage : 'researchAgent ' ,
216+ stage : 'research-topic-item ' ,
217217 } ,
218218 id : 'research-topic-item' ,
219219 } ) ;
@@ -255,6 +255,7 @@ const synthesizeResearchStep = createStep({
255255 data : {
256256 status : 'in-progress' ,
257257 message : 'Synthesizing research across topics...' ,
258+ stage : 'synthesize-research' ,
258259 } ,
259260 id : 'synthesize-research' ,
260261 } ) ;
@@ -269,6 +270,7 @@ const synthesizeResearchStep = createStep({
269270 data : {
270271 status : 'in-progress' ,
271272 message : 'AI synthesizing findings...' ,
273+ stage : 'synthesize-research' ,
272274 } ,
273275 id : 'synthesize-research' ,
274276 } ) ;
@@ -352,6 +354,7 @@ Provide:
352354 data : {
353355 status : 'done' ,
354356 message : 'Synthesis complete...' ,
357+ stage : 'synthesize-research' ,
355358 } ,
356359 id : 'synthesize-research' ,
357360 } ) ;
@@ -376,7 +379,7 @@ Provide:
376379 span . setAttribute ( 'responseTimeMs' , Date . now ( ) - startTime ) ;
377380 span . end ( ) ;
378381
379-
382+
380383 logStepEnd ( 'synthesize-research' , { themesCount : synthesis . commonThemes . length } , Date . now ( ) - startTime ) ;
381384 return result ;
382385 } catch ( error ) {
@@ -386,10 +389,11 @@ Provide:
386389 logError ( 'synthesize-research' , error ) ;
387390
388391 await writer ?. custom ( {
389- type : 'data-workflow-step-error ' ,
392+ type : 'data-tool-progress ' ,
390393 data : {
391- stepId : 'synthesize-research' ,
394+ stage : 'synthesize-research' ,
392395 error : error instanceof Error ? error . message : 'Unknown error' ,
396+ status : 'done' ,
393397 } ,
394398 id : 'synthesize-research' ,
395399 } ) ;
@@ -421,6 +425,7 @@ const generateResearchReportStep = createStep({
421425 data : {
422426 status : 'in-progress' ,
423427 message : 'Generating research report...' ,
428+ stage : 'generate-research-report' ,
424429 } ,
425430 id : 'generate-research-report' ,
426431 } ) ;
@@ -434,6 +439,7 @@ const generateResearchReportStep = createStep({
434439 data : {
435440 status : 'in-progress' ,
436441 message : 'AI generating comprehensive report...' ,
442+ stage : 'generate-research-report' ,
437443 } ,
438444 id : 'generate-research-report' ,
439445 } ) ;
@@ -502,7 +508,7 @@ ${inputData.synthesis.gaps?.map(g => `- ${g}`).join('\n') ?? 'No significant gap
502508 data : {
503509 status : 'done' ,
504510 message : 'Report generation complete...' ,
505- stage : 'workflow ' ,
511+ stage : 'generate-research-report ' ,
506512 } ,
507513 id : 'generate-research-report' ,
508514 } ) ;
@@ -523,7 +529,7 @@ ${inputData.synthesis.gaps?.map(g => `- ${g}`).join('\n') ?? 'No significant gap
523529 span . setAttribute ( 'responseTimeMs' , Date . now ( ) - startTime ) ;
524530 span . end ( ) ;
525531
526-
532+
527533 logStepEnd ( 'generate-research-report' , { reportLength : report . length } , Date . now ( ) - startTime ) ;
528534 return result ;
529535 } catch ( error ) {
@@ -533,11 +539,11 @@ ${inputData.synthesis.gaps?.map(g => `- ${g}`).join('\n') ?? 'No significant gap
533539 logError ( 'generate-research-report' , error ) ;
534540
535541 await writer ?. custom ( {
536- type : 'data-workflow-step-error ' ,
542+ type : 'data-tool-progress ' ,
537543 data : {
538- stepId : 'generate-research-report' ,
544+ stage : 'generate-research-report' ,
539545 error : error instanceof Error ? error . message : 'Unknown error' ,
540- stage : 'workflow' ,
546+ status : 'done'
541547 } ,
542548 id : 'generate-research-report' ,
543549 } ) ;
0 commit comments