/**
 * Simple token estimation utility.
 *
 * Uses a heuristic of ~4 characters per token, which is a reasonable
 * approximation for English text and JSON payloads. For more accurate
 * counting, a tokenizer like tiktoken could be used instead.
 */

/**
 * Estimate the number of tokens in a text string.
 *
 * @param text - The input text to estimate tokens for.
 * @returns Estimated token count (minimum 0).
 */
export function estimateTokens(text: string): number {
  if (text.length === 0) return 0;
  return Math.ceil(text.length / 4);
}
