Implementation
@override
Tool get definition => Tool(
name: 'swipe',
description: 'Swipe from one glintId to another, OR pass x1,y1,x2,y2 to swipe '
'between raw coordinates (device mode: screenshot pixels; flutter '
'mode: logical points, as in every reply; points off the screen are '
'refused); coordinates bypass glintId resolution. '
'`awaitReady` gates on the `from` endpoint — the `to` only needs '
'to resolve, not be hittable. '
'With returnScene: true (default), settles and returns the new scene '
'plus changed + changeCategory.',
inputSchema: ObjectSchema(
properties: {
'edge': Schema.string(
description: 'A system gesture from a screen edge instead of a swipe: left (back), bottom (home), '
'bottomHold (app switcher), topLeft (Notification Center), topRight (Control Center). Physical iPhone.',
),
'fromGlintId': Schema.string(
description: 'Start point — stable id from get_scene.',
),
'toGlintId': Schema.string(
description: 'End point — stable id from get_scene.',
),
'x1': Schema.num(description: 'Start x in logical points (device mode: screen pixels), with y1,x2,y2.'),
'y1': Schema.num(description: 'Start y, same unit.'),
'x2': Schema.num(description: 'End x, same unit.'),
'y2': Schema.num(description: 'End y, same unit.'),
'durationMs': Schema.int(
description: 'Coordinate swipe duration. Default 300.',
),
'awaitReady': Schema.bool(
description: 'Wait until fromGlintId is on screen and hittable, then act. Default false.',
),
'readyTimeoutMs': Schema.int(
description: 'Ceiling for awaitReady. Default 5000.',
),
'returnScene': Schema.bool(
description: 'Settle, then report changed and changeCategory. Default true.',
),
'fetchScene': Schema.bool(
description: 'Also return the new scene text as postScene. Default false.',
),
},
),
);