toAutoClassifierInput method
Generate classifier input for auto-permission decisions. Returns empty string to skip classification.
Implementation
@override
String toAutoClassifierInput(Map<String, dynamic> input) {
final to = input['to'] as String? ?? '';
final message = input['message'];
if (message is String) {
return 'to $to: $message';
}
if (message is Map) {
final type = message['type'] as String? ?? '';
switch (type) {
case 'shutdown_request':
return 'shutdown_request to $to';
case 'shutdown_response':
final approve = message['approve'] as bool? ?? false;
final requestId = message['request_id'] as String? ?? '';
return 'shutdown_response ${approve ? 'approve' : 'reject'} '
'$requestId';
case 'plan_approval_response':
final approve = message['approve'] as bool? ?? false;
return 'plan_approval ${approve ? 'approve' : 'reject'} to $to';
}
}
return 'message to $to';
}