/**
 * Conversation indexing tool.
 *
 * Scans a directory for JSONL session files, extracts conversation turn symbols,
 * and registers them into the CodeSift index so they are searchable via BM25.
 */
import { type BM25Index } from "../search/bm25.js";
export declare function loadConversationEmbeddingsCached(embeddingPath: string): Promise<Map<string, Float32Array>>;
/** Test hook — clear the embeddings cache. */
export declare function clearConversationEmbeddingsCacheForTesting(): void;
/** Get the cached BM25 index for a conversation repo (used by search tools). */
export declare function getConversationBM25Index(repoName: string): BM25Index | null;
export interface IndexConversationsResult {
    /** Number of JSONL session files found and processed. */
    sessions_found: number;
    /** Total conversation_turn symbols indexed across all sessions. */
    turns_indexed: number;
    /** Number of noise records skipped (tool results, etc.). */
    skipped_noise_records: number;
    /** Number of sessions that contained compacted summaries. */
    compacted_sessions: number;
    /** Wall-clock time for the entire operation (ms). */
    elapsed_ms: number;
}
/**
 * Convert a project root path into Claude Code's per-project conversation path.
 * Claude stores conversation JSONL files under `~/.claude/projects/<encoded-cwd>`.
 */
export declare function getClaudeConversationProjectPath(cwd: string, homeDir?: string): string;
/**
 * Index all JSONL conversation session files found in `projectPath`.
 *
 * - Filters to `.jsonl` files only
 * - Skips files larger than 10 MB
 * - Extracts conversation_turn symbols via `extractConversationSymbols`
 * - Saves to the CodeSift index store and registers in the registry
 * - Caches the BM25 index in module memory for search use
 */
export declare function indexConversations(projectPath?: string): Promise<IndexConversationsResult>;
export interface ConversationSearchResult {
    session_id: string;
    timestamp: string;
    git_branch: string;
    user_question: string;
    assistant_answer: string;
    score: number;
    file: string;
    turn_index: number;
    project?: string;
}
export interface SearchConversationsResult {
    results: ConversationSearchResult[];
    total_matches: number;
}
/**
 * Search indexed conversation turns using hybrid BM25 + semantic search.
 *
 * When embeddings are available, fuses BM25 keyword results with semantic
 * similarity via RRF (Reciprocal Rank Fusion). Falls back to BM25-only
 * when no embedding provider is configured.
 */
export declare function searchConversations(query: string, projectPath?: string, limit?: number, internalOpts?: {
    /** Precomputed query embedding — lets searchAllConversations embed the
     * query once instead of once per conversation repo. */
    queryVec?: Float32Array;
}): Promise<SearchConversationsResult>;
/**
 * Search ALL indexed conversation projects at once.
 * Iterates over all `conversations/*` repos in the registry,
 * searches each, merges and re-ranks results.
 */
export declare function searchAllConversations(query: string, limit?: number): Promise<SearchConversationsResult & {
    projects_searched: number;
}>;
export interface FindConversationsForSymbolResult {
    symbol: {
        name: string;
        file: string;
        kind: string;
    };
    conversations: ConversationSearchResult[];
    session_count: number;
}
/**
 * Find conversation turns that mention a given symbol name.
 *
 * Resolves the symbol in the code repo first, then searches the matching
 * Claude Code conversation directory for discussions of that symbol.
 */
export declare function findConversationsForSymbol(symbolName: string, repo: string, limit?: number): Promise<FindConversationsForSymbolResult>;
/**
 * Encode a filesystem path for use as a Claude project directory name.
 * Claude stores per-project files under `~/.claude/projects/<encoded-cwd>`,
 * where each `/` in the path is replaced with `-`.
 */
export declare function encodeCwdToClaudePath(cwd: string): string;
/**
 * Install a session-end hook into `<projectRoot>/.claude/settings.local.json`.
 *
 * The hook runs `codesift index-conversations --quiet` whenever Claude stops,
 * keeping the conversation index up-to-date automatically. Idempotent — will
 * not add a duplicate if the codesift hook is already present.
 */
export declare function installSessionEndHook(projectRoot: string): Promise<void>;
/**
 * Auto-discover and index conversation files for the current project at startup.
 *
 * Looks up `~/.claude/projects/<encoded-cwd>` for JSONL session files,
 * indexes them incrementally, then installs the session-end hook so the
 * index stays fresh going forward. Silently does nothing when no conversation
 * directory exists for the project.
 */
export declare function autoDiscoverConversations(cwd: string): Promise<void>;
//# sourceMappingURL=conversation-tools.d.ts.map