/**
 * CJK-aware token estimation.
 *
 * The upstream `estimateTokens` from `@earendil-works/pi-coding-agent` uses a
 * simple `chars / 4` heuristic which works well for English / ASCII text but
 * drastically under-estimates Chinese, Japanese, and Korean text where each
 * character typically maps to 1–2 tokens (vs. ~0.25 for ASCII).
 *
 * For a conversation with 200K Chinese characters the upstream heuristic would
 * estimate ~50K tokens (well within a 200K context window) when the real count
 * is closer to 300–400K — causing compaction to never trigger and the API to
 * return `context_window_exceeded`.
 *
 * This module provides drop-in replacements that detect CJK code-points and
 * apply a per-character ratio that matches real tokenizer behaviour more
 * closely.
 *
 * Ratios (conservative, slightly over-estimate to stay safe):
 *   ASCII / Latin / other:   1 token per 4 chars  (unchanged)
 *   CJK Unified Ideographs:  1 token per 1.5 chars  (~0.67 token/char)
 *   CJK Extensions / Kana /  1 token per 1.5 chars   (~0.67 token/char)
 *   Hangul Syllables:
 */
import type { AgentMessage } from "@earendil-works/pi-agent-core";
/**
 * Estimate the token count for a plain-text string, accounting for CJK
 * characters that tokenize much more densely than ASCII.
 */
export declare function estimateTextTokens(text: string): number;
/**
 * Estimate token count for an `AgentMessage`, accounting for CJK text.
 *
 * This is a drop-in replacement for `estimateTokens` from
 * `@earendil-works/pi-coding-agent` that fixes the severe under-estimation for
 * Chinese / Japanese / Korean text.
 */
export declare function estimateMessageTokens(message: AgentMessage): number;
/**
 * Effective chars-per-token ratio for a given text, used by callers that
 * convert between token budgets and character budgets.
 *
 * For pure ASCII this returns 4 (upstream default).  For CJK-heavy text it
 * returns a lower ratio, reflecting that fewer characters fit in one token.
 */
export declare function effectiveCharsPerToken(text: string): number;
