draw2agent 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/bin/draw2agent.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14115 -0
- package/dist/index.js.map +1 -0
- package/overlay/dist/draw2agent-overlay.css +1 -0
- package/overlay/dist/draw2agent-overlay.js +3032 -0
- package/package.json +41 -0
- package/prompts/agent-close-instructions.txt +5 -0
- package/prompts/agent-error-instructions.txt +9 -0
- package/prompts/agent-instructions.txt +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# draw2agent ✏️
|
|
2
|
+
|
|
3
|
+
Draw on your website. Your AI agent sees it.
|
|
4
|
+
|
|
5
|
+
**draw2agent** is an MCP server that lets you draw annotations directly on top of your local dev page. When you submit, your IDE agent receives a screenshot, structured DOM data, and annotation context to make precise code edits.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### 1. Add to your IDE (one-time)
|
|
10
|
+
|
|
11
|
+
**Cursor** (`~/.cursor/mcp.json`):
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"mcpServers": {
|
|
15
|
+
"draw2agent": {
|
|
16
|
+
"command": "npx",
|
|
17
|
+
"args": ["-y", "draw2agent"]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Use it
|
|
24
|
+
|
|
25
|
+
Tell your agent:
|
|
26
|
+
> "Use draw2agent to fix the navbar"
|
|
27
|
+
|
|
28
|
+
1. 🌐 Agent opens your browser with drawing tools on your page
|
|
29
|
+
2. ✏️ Draw circles, arrows, text directly on your website
|
|
30
|
+
3. 📸 Click **Submit**
|
|
31
|
+
4. 🤖 Agent reads the visual context and applies code changes
|
|
32
|
+
|
|
33
|
+
## How It Works
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Your Dev Page (proxied)
|
|
37
|
+
├── Your original page content
|
|
38
|
+
└── Excalidraw overlay (transparent, on top)
|
|
39
|
+
├── Draw mode: annotate directly on the page
|
|
40
|
+
├── Select mode: interact with the page normally (Esc)
|
|
41
|
+
└── Submit: screenshot + DOM + annotations → agent
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The MCP server exposes two tools:
|
|
45
|
+
|
|
46
|
+
| Tool | Description |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `launch_canvas` | Opens your dev page with the drawing overlay |
|
|
49
|
+
| `get_drawing_state` | Returns screenshot, DOM nodes, and annotations |
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/dist/index.d.ts
ADDED