import type { Task, TaskPriority } from "../types/index.js";
import type { Database } from "bun:sqlite";
export declare const EXTRACT_TAGS: readonly ["TODO", "FIXME", "HACK", "XXX", "BUG", "NOTE"];
export type ExtractTag = (typeof EXTRACT_TAGS)[number];
export interface ExtractedComment {
    tag: ExtractTag;
    message: string;
    file: string;
    line: number;
    /** Full line content from the source file */
    raw: string;
    /** Stable fingerprint used to dedupe across line moves */
    fingerprint: string;
    /** Nearest enclosing or preceding symbol, when recognized locally */
    symbol?: string;
    symbol_kind?: SourceSymbolKind;
}
export type SourceSymbolKind = "function" | "class" | "interface" | "type" | "variable" | "method";
export interface SourceSymbol {
    name: string;
    kind: SourceSymbolKind;
    file: string;
    line: number;
    raw: string;
}
export interface SourceIndexFile {
    file: string;
    checksum: string;
    symbols: SourceSymbol[];
    comments: ExtractedComment[];
}
export interface CodebaseIndex {
    root: string;
    generated_at: string;
    files: SourceIndexFile[];
    total_comments: number;
    total_symbols: number;
    respects_gitignore: boolean;
    excludes: string[];
}
export interface ExtractOptions {
    /** Directory or file to scan */
    path: string;
    /** Comment tags to look for (default: all) */
    patterns?: ExtractTag[];
    /** Project ID to assign tasks to */
    project_id?: string;
    /** Task list ID */
    task_list_id?: string;
    /** Extra tags to add to created tasks */
    tags?: string[];
    /** Agent to assign tasks to */
    assigned_to?: string;
    /** Agent ID performing the extraction */
    agent_id?: string;
    /** If true, return extracted comments without creating tasks */
    dry_run?: boolean;
    /** File extensions to scan (default: common code extensions) */
    extensions?: string[];
    /** Extra glob-ish path patterns to exclude */
    exclude?: string[];
    /** Respect .gitignore files from the scanned root (default true) */
    respect_gitignore?: boolean;
    /** Include a local codebase index in the result */
    include_index?: boolean;
}
export interface ExtractResult {
    /** All comments found */
    comments: ExtractedComment[];
    /** Tasks created (empty if dry_run) */
    tasks: Task[];
    /** Number of duplicates skipped */
    skipped: number;
    /** Local codebase index, when requested */
    index?: CodebaseIndex;
}
export interface WatchSourceTodosOptions extends ExtractOptions {
    /** Poll interval for repeated local scans */
    interval_ms?: number;
    /** Run a single scan and return */
    once?: boolean;
    /** Maximum scans before returning. Defaults to 1 when once=true, otherwise Infinity. */
    max_runs?: number;
}
export interface SourceTodoWatchRun {
    run: number;
    scanned_at: string;
    changed_files: string[];
    result: ExtractResult;
}
export interface SourceTodoWatchResult {
    root: string;
    interval_ms: number;
    runs: SourceTodoWatchRun[];
}
/** Priority mapping from comment tag */
export declare function tagToPriority(tag: ExtractTag): TaskPriority;
/**
 * Extract TODO-style comments from a single file's contents.
 */
export declare function extractFromSource(source: string, filePath: string, tags?: ExtractTag[]): ExtractedComment[];
export declare function buildCodebaseIndex(options: ExtractOptions): CodebaseIndex;
/**
 * Scan a directory or file for TODO-style comments and optionally create tasks.
 */
export declare function extractTodos(options: ExtractOptions, db?: Database): ExtractResult;
export declare function watchSourceTodos(options: WatchSourceTodosOptions, onRun?: (run: SourceTodoWatchRun) => void | Promise<void>): Promise<SourceTodoWatchResult>;
//# sourceMappingURL=extract.d.ts.map