### Epic: JSON Formatter & Event Schema **Card:** t_8fc3132c ### Contains - US-1: Single-Command JSON Output (NDJSON) - US-4: Pretty JSON Mode ### Technical Notes - JsonFormatter helper class in cortex/agent.py or new file - Nargs=? on --json argparse with const="ndjson", choices=["ndjson","pretty"] - Envelope schema: type + timestamp + data - 5 event types: session_start, tool_call, tool_result, say, error - Rich output completely suppressed when --json is active - --json is opt-in (default=None, current behavior unchanged) ### Files Changed - cortex/cli/__init__.py (~15 lines) - cortex/agent.py (~50 lines) ### Definition of Done - [ ] --json flag accepted by argparse - [ ] JsonFormatter emits NDJSON and pretty JSON - [ ] session_start event emitted on startup - [ ] say event emitted as final response - [ ] All Rich output suppressed in JSON mode - [ ] Existing tests pass unchanged
Epic: JSON Formatter & Event Schema
Card: t_8fc3132c
Contains
Technical Notes
Files Changed
Definition of Done