feat(13-01): implement aiCoordsToPagePdfSpace and AI field utilities
- Install openai 6.32.0 (npm package, listed in dependencies) - Create src/lib/ai/extract-text.ts — pdfjs-dist legacy build server-side text extraction - extractPdfText(filePath) returning PageText[] with page, text, width, height - GlobalWorkerOptions.workerSrc = '' for Node.js fake-worker mode - Text per page capped at 2000 chars for GPT-4o-mini context limit - Create src/lib/ai/field-placement.ts — GPT-4o-mini structured output + coord conversion - aiCoordsToPagePdfSpace() converts AI top-left pct coords to PDF bottom-left points - classifyFieldsWithAI() uses manual json_schema (NOT zodResponseFormat — broken with Zod v4) - Standard field sizes: checkbox=24x24pt, others=144x36pt - textFillData keyed by field UUID (not label) per Phase 12.1 design - All 3 unit tests pass (GREEN phase confirmed)
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
"next": "16.2.0",
|
||||
"next-auth": "5.0.0-beta.30",
|
||||
"nodemailer": "^7.0.13",
|
||||
"openai": "^6.32.0",
|
||||
"postgres": "^3.4.8",
|
||||
"react": "19.2.4",
|
||||
"react-dom": "19.2.4",
|
||||
|
||||
Reference in New Issue
Block a user