feat: add Warp plugin using Warp URI scheme#467
feat: add Warp plugin using Warp URI scheme#467devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
| if (!isAwaitingCopy) return; | ||
| isAwaitingCopy = false; | ||
| openWarp(); | ||
| }, |
There was a problem hiding this comment.
Opens Warp after failed copy
Medium Severity
The Warp plugin’s onAfterCopy hook opens Warp whenever isAwaitingCopy is set, but it ignores the success argument from runCopyFlow. A failed or empty copy still triggers onAfterCopy with success false, so Warp can launch with nothing useful on the clipboard.
Reviewed by Cursor Bugbot for commit 2baee95. Configure here.
| if (!isAwaitingCopy) return; | ||
| isAwaitingCopy = false; | ||
| openWarp(); | ||
| }, |
There was a problem hiding this comment.
Stale flag opens Warp later
Medium Severity
isAwaitingCopy is set when the Warp action calls context.copy(), but it is only cleared inside onAfterCopy. Some copy paths never run runCopyFlow, so that hook never fires and the flag stays true until an unrelated later copy completes and unexpectedly opens Warp.
Reviewed by Cursor Bugbot for commit 2baee95. Configure here.
| @@ -0,0 +1,39 @@ | |||
| import type { Plugin, WarpPluginOptions } from "../../types.js"; | |||
Co-Authored-By: Aiden Bai <aiden.bai05@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d9d158e. Configure here.
| @@ -0,0 +1,4 @@ | |||
| export const getDirectoryPath = (filePath: string): string => { | |||
| const lastSlashIndex = filePath.lastIndexOf("/"); | |||
| return lastSlashIndex > 0 ? filePath.slice(0, lastSlashIndex) : filePath; | |||
There was a problem hiding this comment.
Directory path extraction incorrect
Low Severity
getDirectoryPath only strips the final segment when lastIndexOf("/") is greater than zero. Root-level absolute paths like /App.tsx keep the full file path, and paths with no slash return the filename, so the default Warp path query can point at a file instead of its directory.
Reviewed by Cursor Bugbot for commit d9d158e. Configure here.


Summary
Adds a built-in Warp plugin that hooks into react-grab's plugin system. The "Warp" context-menu/toolbar action copies the grabbed element context to the clipboard, then opens Warp via its URI scheme — in the grabbed component's source directory by default — so you can paste the context straight into Warp's agent.
Warp's URI scheme has no payload/prompt parameter (only
new_window/new_tab/launch/tab_configwith an optionalpath), so the design is copy-then-open: navigation is deferred until theonAfterCopyplugin hook fires, guaranteeing the clipboard is populated before Warp opens.Usage
Or customize:
Source
packages/react-grab/src/core/plugins/warp.ts:packages/react-grab/src/utils/build-warp-uri.ts:Generated URI examples
src/components/Button.tsxwarp://action/new_tab?path=src%2Fcomponents{}(no source info)warp://action/new_tab{ newWindow: true }warp://action/new_window{ path: "/Users/me/project" }warp://action/new_tab?path=%2FUsers%2Fme%2Fproject{ launchConfig: "my config" }warp://launch/my%20config{ tabConfig: "my_tab", newWindow: true }warp://tab_config/my_tab?new_window=true{ usePreview: true }warppreview://action/new_tabAlso exports
WarpPluginOptionsfromtypes.ts, adds a README "Plugins > Warp" section, and a changeset (react-grabpatch).Link to Devin session: https://app.devin.ai/sessions/0510545c8f05421db80929b4a19509a6
Requested by: @aidenybai