import fs from "node:fs"; import { type DiagnosticEvent } from "../diagnostics/error-codes.js"; import { type ProvenanceReport } from "../provenance/resolver.js"; import { type ParsedSession } from "./parser.js"; import { type RootRegistry } from "./root-registry.js"; /** * P1 只读索引管道:parse → provenance → policy → chunks。 */ export type ProvenanceLabel = "verified" | "unresolved"; export interface CanonicalChunk { sourceKey: string; sessionId: string; entryId: string; blockIndex: number; chunkIndex: number; role: string; occurredAt: string; originProjectKey: string; provenance: ProvenanceLabel; contentHash: string; text: string; autoEligible: boolean; persistDisposition: "allow" | "redacted"; chunkerVersion: string; policyVersion: string; } export interface IndexSessionResult { sessionId: string | null; chunks: CanonicalChunk[]; diagnostics: DiagnosticEvent[]; unresolvedCopiedCount: number; parsed: ParsedSession; provenance?: ProvenanceReport; } /** * 索引单个 session 文件,产出可快照的 canonical chunks(不含 path)。 */ export declare function indexSessionFile(sessionFile: string, options?: { registry?: RootRegistry; readFileSync?: typeof fs.readFileSync; existsSync?: typeof fs.existsSync; lstatSync?: typeof fs.lstatSync; }): IndexSessionResult; /** * 索引 session 文本(便于单测注入)。 */ export declare function indexSessionText(text: string, options: { sessionFile: string; registry: RootRegistry; readFileSync?: typeof fs.readFileSync; existsSync?: typeof fs.existsSync; }): IndexSessionResult; /** * 生成可快照摘要(不含 path,正文可保留合成 fixture)。 */ export declare function toChunkSnapshot(result: IndexSessionResult): unknown; //# sourceMappingURL=pipeline.d.ts.map