import { SessionState, Terminal } from '../../types/index.js'; import { BaseStateDetector } from './base.js'; export declare const IDLE_DEBOUNCE_MS = 1500; export declare class ClaudeStateDetector extends BaseStateDetector { private lastContentHash; private contentStableSince; /** * Debounce idle transitions: only return 'idle' when the terminal * content has been unchanged for IDLE_DEBOUNCE_MS. * Returns currentState if output is still changing. * * This is a workaround for Claude Code occasionally showing idle-like * terminal output while still busy (e.g. during screen redraws). */ private debounceIdle; /** * Extract content above the prompt box. * The prompt box is delimited by ─ border lines: * content above prompt box * ─────────────── (top border) * ❯ (prompt line) * ─────────────── (bottom border) * * If no prompt box is found, returns all content as fallback. */ private getContentAbovePromptBox; /** * Claude Code frequently redraws the lower pane using cursor-addressed updates. * xterm's buffer can retain transient fragments from those redraws outside the * latest visible content block, so busy detection should only inspect the most * recent contiguous block directly above the prompt box. */ private getRecentContentAbovePromptBox; detectState(terminal: Terminal, currentState: SessionState): SessionState; detectBackgroundTask(terminal: Terminal): number; detectTeamMembers(terminal: Terminal): number; }