File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -330,13 +330,13 @@ export class McpContext implements Context {
330330 // will be used for the tree serialization and mapping ids back to nodes.
331331 let idCounter = 0 ;
332332 const idToNode = new Map < string , TextSnapshotNode > ( ) ;
333- const assignIds = async (
334- node : SerializedAXNode ,
335- ) : Promise < TextSnapshotNode > => {
333+ const assignIds = ( node : SerializedAXNode ) : TextSnapshotNode => {
336334 const nodeWithId : TextSnapshotNode = {
337335 ...node ,
338336 id : `${ snapshotId } _${ idCounter ++ } ` ,
339- children : [ ] ,
337+ children : node . children
338+ ? node . children . map ( child => assignIds ( child ) )
339+ : [ ] ,
340340 } ;
341341
342342 // The AXNode for an option doesn't contain its `value`.
@@ -348,10 +348,6 @@ export class McpContext implements Context {
348348 }
349349 }
350350
351- nodeWithId . children = node . children
352- ? await Promise . all ( node . children . map ( child => assignIds ( child ) ) )
353- : [ ] ;
354-
355351 idToNode . set ( nodeWithId . id , nodeWithId ) ;
356352 return nodeWithId ;
357353 } ;
You can’t perform that action at this time.
0 commit comments