import type { ContextPercentProbe } from './auto-compact-types.js'; export interface ReadContextPercentInput { readonly projectRoot: string; readonly sessionId: string; readonly env?: NodeJS.ProcessEnv | undefined; } /** * Read env-var-based context percentage. Returns `null` when the env * is absent or unparseable. Adapter-driven: the caller passes the * env-var name from `IdeAdapter.compact.envVarForContextPercent`, * so the function itself has no hard-coded IDE names. */ declare function readEnvPercent(env: NodeJS.ProcessEnv, varName: string): number | null; /** * Read the IDE-specific statusline state. MVP path is Claude Code's * `~/.claude/statusline-state.json`; other IDEs are intentionally * left for future slices (each IDE will expose its own * `compact.postCompactDetectCommand` to drive this). */ declare function readClaudeStatuslinePercent(): number | null; /** * Conservative transcript-size fallback. Walks * `~/.claude/projects//.jsonl` and estimates * `ratio = bytesUsed / 256K`. Returns the bytes seen so the * orchestrator can show "estimated from 124KB of 256KB transcript" * in the envelope. Tagged `'conservative-fallback'` so callers * know NOT to treat this as a hard gate. */ declare function readClaudeTranscriptFallback(sessionId: string): { ratio: number; bytes: number; } | null; /** * Probe the current AI CLI's context-fill ratio. Adapter-driven: * looks up the registered `IdeAdapter.compact` profile via * `getIdeAdapter(detectIdeFromEnv(env))` and reads the * adapter-declared env-var. Falls back to statusline poll + * transcript estimate ONLY for adapters that opt in * (`adapter.id === 'claude-code'` for the MVP); other adapters * without an env-var hit return `source: 'conservative-fallback'` * with `ratio: 0` so the orchestrator never auto-fires on a * missing signal. */ export declare function readContextPercent(input: ReadContextPercentInput): ContextPercentProbe; /** Re-export the env-var probe for unit tests. */ export declare const _internal: { readEnvPercent: typeof readEnvPercent; readClaudeStatuslinePercent: typeof readClaudeStatuslinePercent; readClaudeTranscriptFallback: typeof readClaudeTranscriptFallback; }; export {};