Implementation
@override
Tool get definition => Tool(
name: 'drag',
description: 'Drag from one glintId to another, OR pass x1,y1,x2,y2 for raw '
'coordinates (device mode: screenshot pixels; flutter mode: logical '
'points; points off the screen are refused). Same as swipe but with a longer hold (800ms default) so '
'the framework recognises it as a drag gesture rather than a fling. '
'`awaitReady` gates on the `from` endpoint. '
'With returnScene: true (default), settles and returns the new scene '
'plus changed + changeCategory.',
inputSchema: ObjectSchema(
properties: {
'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: 'Hold time in ms. Default 800.',
),
'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.',
),
},
),
);