feat(box): add Box and Box Sign integrations#3660
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Introduces Updates docs to include Written by Cursor Bugbot for commit 8bd8170. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Greptile SummaryThis PR adds a comprehensive Box integration (10 file management tools) and Box Sign e-signature integration (5 tools) via a unified block config, an internal upload API route, OAuth provider registration, and generated documentation. The implementation closely follows the existing Dropbox/Attio patterns and addresses several issues raised in prior review rounds (silent signer JSON failure, empty file ID filtering, docs link fix, tags split guard). Two new functional issues were identified during this review: the
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User / LLM
participant Block as Box Block (box.ts)
participant UploadRoute as /api/tools/box/upload
participant BoxUpload as upload.box.com
participant BoxAPI as api.box.com
participant BoxSign as api.box.com/sign_requests
User->>Block: Select operation + provide params
Block->>Block: tool() → box_${op}
Block->>Block: params() → baseParams with accessToken
alt upload_file
Block->>UploadRoute: POST {accessToken, parentFolderId, file}
UploadRoute->>UploadRoute: checkInternalAuth()
UploadRoute->>UploadRoute: processFilesToUserFiles()
UploadRoute->>UploadRoute: downloadFileFromStorage()
UploadRoute->>BoxUpload: POST multipart/form-data
BoxUpload-->>UploadRoute: 201 {entries[0]}
UploadRoute-->>Block: {success, output}
else download_file / get_file_info / list / create / delete / copy / search / update
Block->>BoxAPI: GET/POST/PUT/DELETE with Bearer token
BoxAPI-->>Block: JSON response
else sign_create_request
Block->>BoxSign: POST /sign_requests {source_files, signers, …}
BoxSign-->>Block: Sign request object
else sign_get / sign_list / sign_cancel / sign_resend
Block->>BoxSign: GET/POST /sign_requests/{id}
BoxSign-->>Block: Response (object or 202 no-body)
end
Block-->>User: Structured output
|
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile review |
|
@greptile review |
Add complete Box integration with file management (upload, download, get info, list folders, create/delete folders, copy, search, update metadata) and Box Sign e-signature support (create/get/list/cancel/resend sign requests). Includes OAuth provider setup, internal upload API route following the Dropbox pattern, block configurations, icon, and generated docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix docsLink for Box Sign: use underscore (box_sign) to match docs URL - Move normalizeFileInput from tool() to params() in Box block config to match Dropbox pattern - Throw error on invalid additionalSigners JSON instead of silently dropping signers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Box Sign cancel endpoint (POST /sign_requests/{id}/cancel) does not
accept a request body per the API specification. Remove the misleading
reason parameter from the tool, types, block config, and docs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The params function must reference canonical IDs (params.file), not raw subBlock IDs (uploadFile/fileRef) which are deleted after canonical transformation. Matches the Dropbox block pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename "Uploaded file ID/name" to "File ID/name" in UPLOAD_FILE_OUTPUT_PROPERTIES since the constant is shared by both upload and copy operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename the output field from "items" to "entries" to match Box API naming and avoid collision with JSON schema "items" keyword that prevented the docs generator from rendering the nested array structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add .filter(Boolean) after splitting sourceFileIds to prevent empty strings from trailing/double commas being sent as invalid file IDs to the Box Sign API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Combine Box and Box Sign into one unified block with all 15 operations accessible via a single dropdown, removing the separate box_sign block. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
961783e to
2c0ed6b
Compare
|
@greptile |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Box's OAuth2 token endpoint does not return a scope field in the response, so Better Auth stores nothing in the DB. This causes the credential selector to always show "Additional permissions required". Fix by populating the scope from the requested scopes in the account.create.before hook. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Box Sign API requires the sign_requests.readwrite scope in addition to root_readwrite. Without it, sign requests fail with "The request requires higher privileges than provided by the access token." Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Summary
root_readwritescope, token refresh support, and user info via Box API/api/tools/box/upload) following the Dropbox pattern for proper UserFile handlingTest plan
/tools/boxand/tools/box_sign