/** * Watch for Claude Code sessions that are genuinely waiting for user input. * * Strategy: Only track sessions modified in the last 2 minutes. * Only emit 'waiting' after `idleSeconds` of zero changes (default 60s). * Max one notification per session until the file changes again. */ import { EventEmitter } from 'node:events'; export interface SessionEvent { type: 'waiting'; sessionId: string; projectPath?: string; content?: string; timestamp: number; } export declare class SessionWatcher extends EventEmitter { private claudeDir; private pollInterval; private sessions; private idleThresholdMs; constructor(); start(pollMs?: number, idleSeconds?: number): void; stop(): void; private getProjectDirs; private poll; /** Read the last assistant message from a session transcript. */ private getLastAssistantMessage; } /** * Pull the plain text out of a Claude Code JSONL `message.content` field. * CC's wire format is either a bare string (old sessions) or an array of * content blocks where `{ type: 'text', text: '...' }` carries the chat * text. Tool-use and tool-result blocks are skipped — they're not the * "last thing Claude said" a human would want to see in a Discord ping. */ export declare function extractText(content: unknown): string; /** * Project directory name → human-readable breadcrumb. * CC encodes a project's full path in the directory name by replacing * `/` with `-` (e.g. `-Users-alice-src-foo` for `/Users/alice/src/foo`). * On Windows CC prefixes the drive letter as `C--`. We reverse both and * render as a `>`-separated breadcrumb, capped at 60 chars for Discord. */ export declare function projectName(dir: string): string;