Class ClaudeCodeLogFormat

java.lang.Object
io.jenkins.plugins.aiagentjob.claudecode.ClaudeCodeLogFormat
All Implemented Interfaces:
AiAgentLogFormat

public final class ClaudeCodeLogFormat extends Object implements AiAgentLogFormat
Format-specific log classification for Claude Code stream-json output. Handles content arrays (tool_use, tool_result, thinking, text) and stream_event deltas.

Used by both ClaudeCodeAgentHandler and GeminiCliAgentHandler since they share the same stream-json format.

  • Field Details

  • Method Details

    • classify

      public AiAgentLogParser.ParsedLine classify(long lineNumber, net.sf.json.JSONObject json)
      Description copied from interface: AiAgentLogFormat
      Attempt to classify a single JSON object into a parsed event.
      Specified by:
      classify in interface AiAgentLogFormat
      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
    • classifyAll

      public List<AiAgentLogParser.ParsedLine> classifyAll(long lineNumber, net.sf.json.JSONObject json)
      Description copied from interface: AiAgentLogFormat
      Attempt to classify a JSON object that may contain multiple displayable events.

      Implementations that emit at most one event can rely on this default. Returning null still means the format did not recognize the input; an empty list means it recognized the input but intentionally produced no visible events.

      Specified by:
      classifyAll in interface AiAgentLogFormat
    • classifyContentArray

      public static AiAgentLogParser.ParsedLine classifyContentArray(long lineNumber, String parentType, net.sf.json.JSONArray contentArr, String rawDetails)
    • classifyStreamEvent

      public static AiAgentLogParser.ParsedLine classifyStreamEvent(long lineNumber, net.sf.json.JSONObject event, String rawDetails)