feat(extend): add Extend AI document processing integration#3869
feat(extend): add Extend AI document processing integration#3869waleedlatif1 merged 6 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Introduces new Adds an internal Next.js API route Written by Cursor Bugbot for commit eb90d96. Configure here. |
2928c5e to
2634fdb
Compare
Greptile SummaryThis PR adds a new Extend AI document processing integration, following the established Reducto/Pulse patterns in the codebase. It introduces a V1 (hidden, legacy) block supporting both file upload and URL input, and a V2 (user-facing) block that supports file upload in basic mode and chained block file references in advanced mode. The implementation includes a secure internal API route with DNS validation and pinned-IP fetch, Zod request validation, structured error surfacing, and proper tool/block registry entries. Key changes:
Confidence Score: 5/5Safe to merge — all functional code is correct; the only finding is a documentation output section that needs updating. All prior P1 concerns (error surfacing, icon consistency, V2 placeholder clarity) were addressed in 4830a4c. The remaining finding is a P2 documentation inaccuracy in the output section of extend.mdx, which does not affect runtime behavior. apps/docs/content/docs/en/tools/extend.mdx — output section needs to list actual tool outputs. Important Files Changed
Sequence DiagramsequenceDiagram
participant Block as ExtendV2Block
participant Tool as extendParserV2Tool
participant Route as /api/tools/extend/parse
participant FileUtils as resolveFileInputToUrl
participant DNS as validateUrlWithDNS
participant Extend as api.extend.ai/parse
Block->>Tool: params (file, apiKey, outputFormat, chunking, engine)
Tool->>Route: POST {apiKey, file, outputFormat?, chunking?, engine?}
Route->>Route: checkInternalAuth
Route->>FileUtils: resolveFileInputToUrl(file | filePath, userId)
FileUtils-->>Route: fileUrl (signed/resolved URL)
Route->>DNS: validateUrlWithDNS("https://api.extend.ai/parse")
DNS-->>Route: resolvedIP
Route->>Extend: POST {file:{fileUrl}, config?} Bearer apiKey (pinned IP)
Extend-->>Route: {id, status, chunks, blocks, pageCount, creditsUsed}
Route-->>Tool: {success: true, output: {...}}
Tool-->>Block: transformResponse → ExtendParserOutput
Reviews (3): Last reviewed commit: "lint" | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
Summary
Type of Change
Testing
Tested manually
Checklist