/** * Implements local PDF input validation, text extraction, metadata parsing, * and content cleanup for the runtime PDF service. * * Complete extraction accounts for every parser-declared page. Every page is * rendered for strict vision transcription and reconciliation with native text, * positioned parser evidence, and optional OCR; one failed page rejects the * complete-document result. */ import type { IAgentRuntime } from "@elizaos/core"; import { Service } from "@elizaos/core"; import type { PdfCompleteDocument, PdfCompleteExtractionOptions, PdfConversionResult, PdfDocumentInfo, PdfExtractionOptions, PdfPositionedTextDocument } from "../types/index.js"; /** * PDF spec (ISO 32000-1, 7.9.4) date string: `D:YYYYMMDDHHmmSSOHH'mm'` where * every component after the year is optional and `O` is the UT relation * (`+`, `-`, or `Z`). This is what `pdf.js`/`unpdf` actually surface in * `info.CreationDate`/`info.ModDate`, not an ISO-8601 string. The groups mirror * `PDFDateString.toDateObject` in pdf.js so real-world documents round-trip. */ export { parsePdfSpecDate } from "./pdf-date.js"; export declare class PdfService extends Service { static serviceType: "pdf"; capabilityDescription: string; static start(runtime: IAgentRuntime): Promise; static stop(runtime: IAgentRuntime): Promise; stop(): Promise; /** * Extract every declared page by rendering and vision-transcribing each page, * then reconciling that transcription with native text, positioned parser * evidence, and optional OCR. Any failed required stage rejects the whole * document; partial success is never returned under the complete contract. */ extractCompleteDocument(pdfBuffer: Buffer | Uint8Array, options?: PdfCompleteExtractionOptions): Promise; convertPdfToText(pdfBuffer: Buffer | Uint8Array): Promise; convertPdfToPositionedText(pdfBuffer: Buffer | Uint8Array): Promise; convertPdfToTextWithOptions(pdfBuffer: Buffer | Uint8Array, options?: PdfExtractionOptions): Promise; getDocumentInfo(pdfBuffer: Buffer | Uint8Array): Promise; cleanUpContent(content: string): string; } export default PdfService; //# sourceMappingURL=pdf.d.ts.map