import type { RequestFormat } from "../../../proxy/schemas";

export type RequestAnalysis = {
  parsed: unknown | null;
  comparisonValue: unknown;
  messageCount: number | null;
  toolCount: number | null;
};

export type ResponseAnalysis = {
  parsed: unknown | null;
  toolNames: string[] | null;
};

export type LogFormatAdapter = {
  readonly format: RequestFormat;
  analyzeRequest(rawBody: string | null): RequestAnalysis;
  analyzeResponse(responseText: string | null): ResponseAnalysis;
};

export function emptyRequestAnalysis(rawBody: string | null): RequestAnalysis {
  return {
    parsed: null,
    comparisonValue: rawBody,
    messageCount: null,
    toolCount: null,
  };
}

export const EMPTY_RESPONSE_ANALYSIS: ResponseAnalysis = {
  parsed: null,
  toolNames: null,
};
