feat: add file format extraction tools (docx, pptx, xlsx, pdf, etc.) - #770
Conversation
- Add shared ZIP/XML extraction utility (adm-zip) - Implement DOCX → markdown parser (headings, lists, tables, inline formatting) - Implement PPTX → markdown parser (slide titles, bullets, speaker notes) - Implement XLSX → markdown tables and XLSX → JSON converter - Implement PDF → markdown text extraction (pdf-parse) - Register all tools in src/tools/index.js with permissions and classifications - Add comprehensive unit tests for all modules - Add pdf-parse and xml2js dependencies
- Move OpenSpec change to archive/2026-08-12-file-format-extraction-tools/ - Apply spec deltas to openspec/specs/ (5 new capabilities) - 9 spec lines added
- Remove unused buffer variables (dead code) - Remove unused imports (extractZipXml, ZipExtractionError, getExtension) - Merge duplicate imports in docxParser.js - Fix unused catch parameter in zipExtractor.js - Fix redundant const comparison in xlsxParser.js - Prefix unused variables with _ (listType, isListItem)
…xtraction-tools # Conflicts: # src/tools/index.js
PR Audit: file-format-extraction-toolsScope: Implementation audit against OpenSpec design, specs, and tasks. ✅ Completed
🔴 Bugs (must fix before merge)1. 2. 3. 🟡 Spec Gaps (should address)4. docx-extraction: inline formatting not implemented 5. xlsx-extraction: merged cells not handled 6. pptx-extraction: slides without titles 7. file-extraction: password-protected ZIP not distinguished 8. file-extraction: 9. pdf-extraction: empty PDF returns error, not empty string 🟢 Minor / Observations10. Tests cover only error paths 11. No fixture files 12. Silent catch blocks 13. Summary
The core architecture is solid — shared ZIP extraction, format validation, and tool registration are well-structured. The three bugs (especially the |
Critical bugs: - Fix isListItem() reference error in docxParser.js (was _isListItem) - Fix listType/_listType variable mismatch in docxParser.js - Fix pdf-parse API usage (was class, is a function) Spec gaps: - Add inline formatting (bold, italic, code) to docx parser - Handle merged cells in xlsx parser - Numbered slide separator for pptx slides without titles - Password-protected ZIP detection in getZipFileNames - Empty PDF returns empty string, not error Minor: - Replace silent catch blocks with named parameters (_err) - Update tool_index test for new file extraction tools (8→12 tools) - Remove unused PDFParse import from pdfParser.js
Summary
Add tools for extracting and converting common office and personal file formats into structured, queryable text (markdown, JSON, tables).
What Changed
Capabilities
New Capabilities
Impact
OpenSpec
This change follows the OpenSpec-driven development workflow:
Related
Fixes #767