toJson method
Wire form with stable key order (zap first — the envelope reads
top-down).
Implementation
@override
Map<String, Object?> toJson() => <String, Object?>{
'zap': zapProtocolVersion,
'type': type,
'id': id,
'ts': ts,
'missionId': missionId,
'agent': agent,
'goal': goal,
if (feature != null) 'feature': feature,
'budget': {'maxSteps': maxSteps},
'policy': {'riskTier': riskTier, 'toolAllowlist': toolAllowlist},
'steps': [for (final s in steps) s.toJson()],
};