const TOKEN_USAGE_FIELDS = [
  "inputTokens",
  "outputTokens",
  "reasoningTokens",
  "cacheReadTokens",
  "cacheWriteTokens",
  "totalTokens"
];
let exitStats = null;
function setExitStats(stats) {
  exitStats = stats;
}
function getExitStats() {
  return exitStats;
}
function clearExitStats() {
  exitStats = null;
}
function hasMeaningfulTokenUsage(tokenUsage) {
  if (!tokenUsage) {
    return false;
  }
  return TOKEN_USAGE_FIELDS.some((field) => (tokenUsage[field] ?? 0) > 0);
}
export {
  clearExitStats,
  getExitStats,
  hasMeaningfulTokenUsage,
  setExitStats
};
