import type { RagStore } from './ragStore';
/** One AOSP source file the fetcher returns. License is REQUIRED;
 * undefined license rejects the file at the ingester. */
export interface AospFile {
    /** Path relative to the AOSP root, e.g.
     *  `frameworks/base/services/core/.../HwcLayer.cpp`. */
    filePath: string;
    /** Source content (typically C++ or Java). */
    content: string;
    /** Pinned git commit hash for the AOSP snapshot. Stamped onto
     *  `verifiedAt` indirectly (epoch ms approximate; commit hash
     *  carried in the `notes` field of the chunk envelope). */
    commitHash: string;
    /** Approximate epoch-ms timestamp when this snapshot was captured. */
    fetchedAt: number;
    /** License of the source file. Required — typical values are
     *  `Apache-2.0` for AOSP / `BSD-3-Clause` for Linux kernel paths. */
    license: string;
    /** Optional binary build-id for native source pinning. */
    buildId?: string;
    /** Optional codebase id when this AOSP snapshot was registered by CodebaseRegistry. */
    codebaseId?: string;
    /** Optional title; falls back to last path segment. */
    title?: string;
}
/** Pluggable source for AOSP files. Production wiring will read
 * from a pinned manifest snapshot; tests inject a stub. */
export interface AospFetcher {
    fetchFiles(opts?: {
        pathPrefix?: string;
    }): Promise<AospFile[]>;
}
export interface AospIngestOptions {
    /** Maximum characters per chunk. Defaults to 2000 (slightly
     *  larger than blog because source files have more boilerplate). */
    maxChunkChars?: number;
    /** Restrict to a path prefix (forwarded to fetcher). */
    pathPrefix?: string;
}
export interface AospIngestError {
    filePath: string;
    reason: string;
}
export interface AospIngestResult {
    filesProcessed: number;
    chunksAdded: number;
    chunksSkipped: number;
    errors: AospIngestError[];
}
interface PackedChunk {
    text: string;
    offset: number;
    startLine?: number;
    endLine?: number;
    symbol?: string;
}
/** Section-based chunker. Tries to split on function / class
 * boundaries; falls back to fixed-size when no boundaries land
 * within `maxChars * 2`. */
declare function chunkSource(text: string, maxChars: number): PackedChunk[];
declare function makeChunkId(filePath: string, offset: number): string;
export declare class AospKnowledgeIngester {
    private readonly store;
    private readonly fetcher;
    constructor(store: RagStore, fetcher: AospFetcher);
    ingest(opts?: AospIngestOptions): Promise<AospIngestResult>;
}
/** Test-only export of the chunker for boundary-detection coverage. */
export declare const __TEST_ONLY__: {
    chunkSource: typeof chunkSource;
    makeChunkId: typeof makeChunkId;
};
export {};
//# sourceMappingURL=aospKnowledgeIngester.d.ts.map