streamJsonSessionHeaderLine function
Builds the session header line (always the first stdout line).
Implementation
String streamJsonSessionHeaderLine({
required String sessionId,
required String cwd,
DateTime? timestamp,
}) {
final stamp = (timestamp ?? DateTime.now()).toUtc().toIso8601String();
return jsonEncode({
'type': 'session',
'version': streamJsonVersion,
'id': sessionId,
'timestamp': stamp,
'cwd': cwd,
});
}