File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -384,21 +384,14 @@ export class PlanDataService {
384384 . replace ( / \\ " / g, '"' ) || '' ;
385385
386386 const steps : MPlanData [ 'steps' ] = [ ] ;
387- const stepRegex = / M S t e p \( ( [ ^ ) ] * ?) \) / g;
387+ const stepRegex = / M S t e p \( \s * a g e n t = ( [ ' " ] ) ( [ \s \S ] * ?) \1 \s * , \s * a c t i o n = ( [ ' " ] ) ( [ \s \S ] * ? ) \3 \s * \) / g;
388388 let stepMatch : RegExpExecArray | null ;
389389 let idx = 1 ;
390390 const seen = new Set < string > ( ) ;
391391 while ( ( stepMatch = stepRegex . exec ( body ) ) !== null ) {
392- const chunk = stepMatch [ 1 ] ;
393- const agent =
394- chunk . match ( / a g e n t = ' ( [ ^ ' ] + ) ' / ) ?. [ 1 ] ||
395- chunk . match ( / a g e n t = " ( [ ^ " ] + ) " / ) ?. [ 1 ] ||
396- 'System' ;
397- const actionRaw =
398- chunk . match ( / a c t i o n = ' ( [ ^ ' ] + ) ' / ) ?. [ 1 ] ||
399- chunk . match ( / a c t i o n = " ( [ ^ " ] + ) " / ) ?. [ 1 ] ||
400- '' ;
401- if ( ! actionRaw ) continue ;
392+ const agent = stepMatch [ 2 ] || 'System' ;
393+ const actionRaw = stepMatch [ 4 ] || '' ;
394+ if ( ! actionRaw . trim ( ) ) continue ;
402395
403396 const cleanAction = actionRaw
404397 . replace ( / \* \* / g, '' )
You can’t perform that action at this time.
0 commit comments