/// Represents an output action with its parameters class ActionOutput { final String action; final Map parameters; const ActionOutput({ required this.action, required this.parameters, }); /// Create from JSON factory ActionOutput.fromJson(Map json) { return ActionOutput( action: json['action'] as String, parameters: Map.from(json['parameters'] as Map? ?? {}), ); } /// Convert to JSON Map toJson() { return { 'action': action, 'parameters': parameters, }; } /// Create a copy with updated values ActionOutput copyWith({ String? action, Map? parameters, }) { return ActionOutput( action: action ?? this.action, parameters: parameters ?? this.parameters, ); } @override bool operator ==(Object other) { if (identical(this, other)) return true; return other is ActionOutput && other.action == action && _mapsEqual(other.parameters, parameters); } @override int get hashCode => action.hashCode ^ parameters.hashCode; bool _mapsEqual(Map a, Map b) { if (a.length != b.length) return false; for (var key in a.keys) { if (!b.containsKey(key) || a[key] != b[key]) return false; } return true; } }