Interface AiAgentLogFormat

All Known Implementing Classes:
ClaudeCodeLogFormat, CodexLogFormat, CursorLogFormat, OpenCodeLogFormat

public interface AiAgentLogFormat
Strategy interface for classifying a JSON log line emitted by an AI agent into a AiAgentLogParser.ParsedLine.

Each AiAgentTypeHandler returns its own AiAgentLogFormat via AiAgentTypeHandler.getLogFormat(), allowing third-party agent handlers to supply custom log parsing without modifying the core parser.

Implementations should return null for any JSON structure they do not recognise; the parser will then fall through to the shared format and generic fallback.

  • Method Summary

    Modifier and Type
    Method
    Description
    classify(long lineNumber, net.sf.json.JSONObject json)
    Attempt to classify a single JSON object into a parsed event.
  • Method Details

    • classify

      AiAgentLogParser.ParsedLine classify(long lineNumber, net.sf.json.JSONObject json)
      Attempt to classify a single JSON object into a parsed event.
      Parameters:
      lineNumber - 1-based line number in the raw log file
      json - the parsed JSON object for this line
      Returns:
      a classified AiAgentLogParser.ParsedLine, or null if this format does not handle the given JSON structure