handle method
Implementation
@override
Future<StructuredResponse> handle(GlintSession session, CallToolRequest request) async {
final args = request.arguments ?? const {};
final app = session.active;
if (app == null) throw SessionNotAttachedError(missing: 'breakpoint');
if (app.deviceMode) {
return StructuredResponse.error(
summary: 'device mode has no VM connection, so there are no app logs to break on',
errorKind: GlintErrorKind.flutterModeRequired,
nextSteps: const ['attach to the Flutter debug app (without mode:"device")'],
);
}
final bps = app.breakpoints;
final op = (args['op'] as String?) ?? 'status';
return switch (op) {
'set' => _set(bps, args),
'wait' => _wait(session, request, app, args),
'status' => _status(bps),
'resume' => _resume(bps, force: argBool(args, 'force') == true),
'list' => _list(bps),
'clear' => _clear(bps, args['id'] as String?),
_ => StructuredResponse.error(
summary: 'unknown op: $op',
errorKind: GlintErrorKind.invalidArgument,
nextSteps: const ['use set, wait, status, resume, list or clear'],
),
};
}