feat(cursor): add list artifacts and download artifact tools#3970
feat(cursor): add list artifacts and download artifact tools#3970waleedlatif1 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Implements a new internal API route Extends Reviewed by Cursor Bugbot for commit d98bda6. Configure here. |
Greptile SummaryThis PR adds The new download artifact flow correctly routes through an internal Key changes:
Confidence Score: 5/5Safe to merge — all three previous P0/P1 issues (type mismatch, redundant guard, hardcoded status code) have been resolved; remaining findings are P2 style suggestions. The security-critical download artifact path is correctly implemented with DNS pinning, IP locking, and internal auth. The v1/v2 split is consistent with the codebase pattern. The only remaining findings are a missing null guard in the v2 list_agents transformResponse (inconsistent with the same-PR list_artifacts pattern) and an apps/sim/tools/cursor/list_agents.ts — v2 transformResponse accesses data.agents without a fallback; minor inconsistency with the defensive pattern used in list_artifacts.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant W as Workflow Executor
participant R as Tool Registry
participant LA as listArtifactsV2Tool
participant DA as downloadArtifactV2Tool
participant IR as /api/tools/cursor/download-artifact
participant CA as api.cursor.com
participant PS as Presigned URL (Storage)
W->>R: resolve cursor_list_artifacts_v2
R->>LA: transformResponse()
LA->>CA: GET /v0/agents/{agentId}/artifacts<br/>(Authorization: Basic ...)
CA-->>LA: { artifacts: [...] }
LA-->>W: { output: { artifacts } }
W->>R: resolve cursor_download_artifact_v2
R->>DA: request to /api/tools/cursor/download-artifact
DA->>IR: POST { apiKey, agentId, path }
IR->>IR: checkInternalAuth + Zod.parse
IR->>CA: GET /v0/agents/{agentId}/artifacts/download?path=...
CA-->>IR: { url: "https://presigned..." }
IR->>IR: validateUrlWithDNS(presignedUrl)
IR->>PS: secureFetchWithPinnedIP(url, resolvedIP)
PS-->>IR: binary file content
IR-->>DA: { success, output: { file: { name, mimeType, data, size } } }
DA-->>W: { output: { file } }
Reviews (2): Last reviewed commit: "fix(cursor): address PR review feedback" | Re-trigger Greptile |
…ct types - Remove invalid wandConfig with unsupported generationType 'json-array' from promptImages subBlock - Remove invalid 'optional' property from summary output definition - Split DownloadArtifactResponse into v1 (content/metadata) and v2 (file) response types
- Remove redundant Array.isArray guards in list_artifacts.ts - Pass through actual HTTP status on presigned URL download failure instead of hardcoded 400
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d98bda6. Configure here.
Summary
cursor_list_artifactstool to list generated artifact files for a cloud agentcursor_download_artifacttool with internal API route that fetches presigned URLs from Cursor and downloads files with security validationtype: 'file'output for execution file system integration.trim()on agentId in URL paths across existing toolsprUrlfilter param to list agentsCREATINGto agent status enummode: 'advanced'on optional block fieldsType of Change
Testing
Tested manually
Checklist