export type AiUsage = {
  promptTokens: number | null;
  completionTokens: number | null;
  totalTokens: number | null;
};

export type AiWarning = {
  code: string;
  message: string;
};

export type AiConfidence = "low" | "medium" | "high";

export type AiSuggestionStatus = "GENERATED" | "ACCEPTED" | "DISMISSED" | "EXPIRED";

export type AiDecision = "accept" | "dismiss";

export type AiEngine = "openai_json_schema" | "openai_json_object" | "empty_assist";

export type AiEnvelope<T> = {
  data: T | null;
  engine: AiEngine;
  model: string | null;
  usage: AiUsage | null;
  warnings: AiWarning[];
  confidence: AiConfidence | null;
  promptVersion: string;
  truncated: boolean;
  requestJson: Record<string, unknown>;
  responseJson: Record<string, unknown> | null;
};
