matchApps method
Sessions matching target (device id, app name/package/bundle id, or a
device-name prefix). An exact device-id or full-label hit wins alone.
Implementation
List<AppSession> matchApps(String target) {
final q = target.trim().toLowerCase();
final exact = _pool.values.where((a) =>
a.id.toLowerCase() == q ||
a.package?.toLowerCase() == q ||
a.displayName?.toLowerCase() == q ||
a.bundleId?.toLowerCase() == q);
if (exact.isNotEmpty) return exact.toList();
return _pool.values.where((a) => a.matches(target)).toList();
}