@@ -60,7 +60,7 @@ const ScrollOffsets = {
6060 . describe ( "Vertical scroll distance in points; positive scrolls down, negative up. Defaults to 0." ) ,
6161} ;
6262
63- const hasScrollDistance = ( input : { deltaX ?: number ; deltaY ?: number } ) =>
63+ const hasScrollDistance = ( input : { deltaX ?: number | undefined ; deltaY ?: number | undefined } ) =>
6464 input . deltaX !== undefined || input . deltaY !== undefined ;
6565
6666/** Strict branches require an observed, unambiguous target before native input. */
@@ -96,8 +96,12 @@ export const ComputerUseSchema = z.union([
9696 elementId : ElementId . optional ( ) . describe ( "Focus this element from the snapshot before pressing the key." ) ,
9797 key : z . string ( ) . min ( 1 ) . max ( 128 ) . describe ( "One key or chord, such as Enter, Tab, Escape, or Cmd+A." ) ,
9898 } ) ,
99- z . strictObject ( { action : z . literal ( "scroll" ) , ...ElementTarget , ...ObserveAfter , ...ScrollOffsets } ) . refine ( hasScrollDistance , "Scroll needs deltaX or deltaY." ) ,
100- z . strictObject ( { action : z . literal ( "scroll" ) , ...PointTarget , ...ObserveAfter , ...ScrollOffsets } ) . refine ( hasScrollDistance , "Scroll needs deltaX or deltaY." ) ,
99+ z
100+ . strictObject ( { action : z . literal ( "scroll" ) , ...ElementTarget , ...ObserveAfter , ...ScrollOffsets } )
101+ . refine ( hasScrollDistance , "Scroll needs deltaX or deltaY." ) ,
102+ z
103+ . strictObject ( { action : z . literal ( "scroll" ) , ...PointTarget , ...ObserveAfter , ...ScrollOffsets } )
104+ . refine ( hasScrollDistance , "Scroll needs deltaX or deltaY." ) ,
101105 z . strictObject ( {
102106 action : z . literal ( "drag" ) ,
103107 ...PointTarget ,
0 commit comments