@dcl-regenesislabs/opendcl 0.1.4-22809399016.commit-8d4acb4 → 0.1.4-22810336737.commit-ccefb95
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/extensions/dcl-screenshot.ts +17 -29
- package/package.json +2 -2
- package/skills/visual-feedback/SKILL.md +18 -43
|
@@ -52,10 +52,8 @@ interface Action {
|
|
|
52
52
|
ms?: number;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/** Default pixels to drag for look actions. */
|
|
56
|
-
const LOOK_DRAG_PX = 200;
|
|
57
55
|
/** Default duration (ms) to hold movement keys. */
|
|
58
|
-
const MOVE_HOLD_MS =
|
|
56
|
+
const MOVE_HOLD_MS = 300;
|
|
59
57
|
/** Process registry key for the screenshot browser. */
|
|
60
58
|
const PROCESS_NAME = "screenshot-browser";
|
|
61
59
|
/** Relative position of the "Explore as Guest" button on the Bevy-Web renderer welcome canvas.
|
|
@@ -123,33 +121,20 @@ async function executeActions(page: Page, actions: Action[]): Promise<void> {
|
|
|
123
121
|
await page.waitForTimeout(action.ms ?? 1000);
|
|
124
122
|
break;
|
|
125
123
|
|
|
126
|
-
// Camera look (
|
|
124
|
+
// Camera look (arrow keys) and WASD movement (key holds)
|
|
127
125
|
case "lookLeft":
|
|
128
126
|
case "lookRight":
|
|
129
127
|
case "lookUp":
|
|
130
|
-
case "lookDown":
|
|
131
|
-
const c = getViewportCenter(page);
|
|
132
|
-
const px = action.dx ? Math.abs(action.dx) : LOOK_DRAG_PX;
|
|
133
|
-
const targets: Record<string, { x: number; y: number }> = {
|
|
134
|
-
lookLeft: { x: c.x - px, y: c.y },
|
|
135
|
-
lookRight: { x: c.x + px, y: c.y },
|
|
136
|
-
lookUp: { x: c.x, y: c.y - px },
|
|
137
|
-
lookDown: { x: c.x, y: c.y + px },
|
|
138
|
-
};
|
|
139
|
-
const target = targets[action.type];
|
|
140
|
-
await page.mouse.move(c.x, c.y);
|
|
141
|
-
await page.mouse.down();
|
|
142
|
-
await page.mouse.move(target.x, target.y, { steps: 10 });
|
|
143
|
-
await page.mouse.up();
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// WASD movement (key holds)
|
|
128
|
+
case "lookDown":
|
|
148
129
|
case "moveForward":
|
|
149
130
|
case "moveBack":
|
|
150
131
|
case "moveLeft":
|
|
151
132
|
case "moveRight": {
|
|
152
133
|
const keyMap: Record<string, string> = {
|
|
134
|
+
lookLeft: "ArrowLeft",
|
|
135
|
+
lookRight: "ArrowRight",
|
|
136
|
+
lookUp: "ArrowUp",
|
|
137
|
+
lookDown: "ArrowDown",
|
|
153
138
|
moveForward: "w",
|
|
154
139
|
moveBack: "s",
|
|
155
140
|
moveLeft: "a",
|
|
@@ -320,12 +305,15 @@ The browser stays open between calls — only the first screenshot navigates and
|
|
|
320
305
|
## Actions (optional, performed before capture)
|
|
321
306
|
Low-level: click (x,y coords), key (press/hold), mouse (relative drag), wait
|
|
322
307
|
High-level helpers:
|
|
323
|
-
- lookLeft / lookRight / lookUp / lookDown — camera rotation (
|
|
324
|
-
- moveForward / moveBack / moveLeft / moveRight — WASD movement (holdMs duration, default
|
|
308
|
+
- lookLeft / lookRight / lookUp / lookDown — arrow key camera rotation (holdMs duration, default 300ms)
|
|
309
|
+
- moveForward / moveBack / moveLeft / moveRight — WASD movement (holdMs duration, default 300ms)
|
|
310
|
+
|
|
311
|
+
Movement speed is ~6m/s. Each parcel is 16m. Keep movements small (holdMs: 300). Stay within scene boundaries. If you see empty/gray space or no scene content, you've left the scene — stop moving.
|
|
325
312
|
|
|
326
|
-
|
|
313
|
+
IMPORTANT: Use sparingly. Make code changes first, then take 1-2 screenshots to verify. Do not use screenshots to explore the scene.`,
|
|
327
314
|
promptGuidelines: [
|
|
328
|
-
"
|
|
315
|
+
"Use screenshot sparingly — only to verify the final result after making code changes, not to explore or navigate. Take 1-2 screenshots per task, not after every small change.",
|
|
316
|
+
"Each screenshot consumes significant tokens. Make all your code changes first, then take one screenshot to verify.",
|
|
329
317
|
"If the screenshot tool fails (no Chrome, browser crash, user declined), continue working normally without vision. Tell the user what happened and suggest they check the preview manually.",
|
|
330
318
|
"Don't retry screenshot more than once if it fails — fall back to asking the user to verify visually.",
|
|
331
319
|
],
|
|
@@ -358,13 +346,13 @@ Movement speed is ~6m/s. Camera always faces north in headless mode.`,
|
|
|
358
346
|
y: Type.Optional(Type.Number({ description: "Y pixel coordinate for click" })),
|
|
359
347
|
key: Type.Optional(Type.String({ description: "Key to press (for key action)" })),
|
|
360
348
|
holdMs: Type.Optional(
|
|
361
|
-
Type.Number({ description: "Hold duration in ms (key or
|
|
349
|
+
Type.Number({ description: "Hold duration in ms (key, movement, or look, default 300ms)" }),
|
|
362
350
|
),
|
|
363
351
|
dx: Type.Optional(
|
|
364
|
-
Type.Number({ description: "Relative X pixels (mouse drag
|
|
352
|
+
Type.Number({ description: "Relative X pixels (mouse drag)" }),
|
|
365
353
|
),
|
|
366
354
|
dy: Type.Optional(
|
|
367
|
-
Type.Number({ description: "Relative Y pixels (mouse drag
|
|
355
|
+
Type.Number({ description: "Relative Y pixels (mouse drag)" }),
|
|
368
356
|
),
|
|
369
357
|
ms: Type.Optional(
|
|
370
358
|
Type.Number({ description: "Wait duration in ms (for wait action)" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl-regenesislabs/opendcl",
|
|
3
|
-
"version": "0.1.4-
|
|
3
|
+
"version": "0.1.4-22810336737.commit-ccefb95",
|
|
4
4
|
"description": "AI coding assistant for Decentraland SDK7 scene development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"prompts/",
|
|
68
68
|
"context/"
|
|
69
69
|
],
|
|
70
|
-
"commit": "
|
|
70
|
+
"commit": "ccefb9582a7d0dedb41c3a0c8326a23cade8def2"
|
|
71
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: visual-feedback
|
|
3
|
-
description: Use the screenshot tool to see the running Decentraland preview
|
|
3
|
+
description: Use the screenshot tool to see the running Decentraland preview and verify scene changes visually. Use when the preview is running and you need to check what the scene looks like after making code changes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Visual Feedback — Seeing Your Scene
|
|
@@ -11,12 +11,11 @@ The `screenshot` tool lets you capture what the Decentraland preview looks like
|
|
|
11
11
|
|
|
12
12
|
## When to Use Screenshots
|
|
13
13
|
|
|
14
|
-
- **After
|
|
15
|
-
- **After changing materials/colors** — confirm the visual result matches intent
|
|
16
|
-
- **After downloading 3D models** — check they loaded and look right
|
|
14
|
+
- **After completing code changes** — verify the final result looks correct
|
|
17
15
|
- **When the user asks "how does it look?"** — show them and describe what you see
|
|
18
|
-
- **When debugging** — "the tree is invisible" → screenshot to see what's actually rendering
|
|
19
|
-
|
|
16
|
+
- **When debugging visual issues** — "the tree is invisible" → screenshot to see what's actually rendering
|
|
17
|
+
|
|
18
|
+
**Do NOT** use screenshots to explore or navigate the scene. Make all code changes first, then take 1-2 screenshots to verify.
|
|
20
19
|
|
|
21
20
|
## Basic Usage
|
|
22
21
|
|
|
@@ -28,7 +27,7 @@ Use the screenshot tool with no actions to capture the current scene view.
|
|
|
28
27
|
|
|
29
28
|
The tool returns the image directly — you'll see it and can describe what's visible.
|
|
30
29
|
|
|
31
|
-
## Movement &
|
|
30
|
+
## Movement & Camera
|
|
32
31
|
|
|
33
32
|
The scene camera **always faces north** in headless mode. Movement is relative to compass direction, not camera:
|
|
34
33
|
|
|
@@ -39,22 +38,11 @@ The scene camera **always faces north** in headless mode. Movement is relative t
|
|
|
39
38
|
| `moveRight` | East (toward right) | D |
|
|
40
39
|
| `moveLeft` | West (toward left) | A |
|
|
41
40
|
|
|
42
|
-
Movement speed is ~6 meters/second. Default `holdMs` is
|
|
43
|
-
|
|
44
|
-
### Exploring a scene
|
|
45
|
-
|
|
46
|
-
To see objects from different angles, chain movement actions before capturing:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
screenshot with actions:
|
|
50
|
-
1. moveForward (holdMs: 1000) — walk 6m north
|
|
51
|
-
2. moveRight (holdMs: 500) — strafe 3m east
|
|
52
|
-
→ captures screenshot from the new position
|
|
53
|
-
```
|
|
41
|
+
Movement speed is ~6 meters/second. Default `holdMs` is 300ms (~1.8 meters).
|
|
54
42
|
|
|
55
43
|
### Camera rotation
|
|
56
44
|
|
|
57
|
-
Use look actions to rotate the camera view:
|
|
45
|
+
Use look actions to rotate the camera view (arrow key holds):
|
|
58
46
|
|
|
59
47
|
| Action | Effect |
|
|
60
48
|
|--------|--------|
|
|
@@ -63,7 +51,7 @@ Use look actions to rotate the camera view:
|
|
|
63
51
|
| `lookUp` | Tilt camera up |
|
|
64
52
|
| `lookDown` | Tilt camera down |
|
|
65
53
|
|
|
66
|
-
Default rotation is
|
|
54
|
+
Default rotation hold is 300ms. Use `holdMs` for more or less rotation.
|
|
67
55
|
|
|
68
56
|
## Interacting Before Capture
|
|
69
57
|
|
|
@@ -86,27 +74,14 @@ screenshot with actions:
|
|
|
86
74
|
→ captures the overhead editor view
|
|
87
75
|
```
|
|
88
76
|
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
When building or modifying a scene, use this loop:
|
|
77
|
+
## Workflow
|
|
92
78
|
|
|
93
|
-
1. **Make code changes** (write to `src/index.ts`)
|
|
94
|
-
2. **
|
|
95
|
-
3. **
|
|
96
|
-
4. **
|
|
97
|
-
5. **Fix and repeat** — up to 5 iterations
|
|
79
|
+
1. **Make all code changes** (write to `src/index.ts`)
|
|
80
|
+
2. **Take one screenshot** with `wait: 2000` to let hot-reload settle
|
|
81
|
+
3. **Evaluate** — describe honestly: what works, what's wrong
|
|
82
|
+
4. **Fix if needed** — then take one more screenshot to confirm
|
|
98
83
|
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
1. Write code to add a red cube at (8, 1, 8)
|
|
102
|
-
2. screenshot with actions: [wait 2000ms]
|
|
103
|
-
→ "I can see a red cube floating 1m above the ground at the center. It looks correct."
|
|
104
|
-
3. Write code to add a blue sphere next to it
|
|
105
|
-
4. screenshot with actions: [wait 2000ms]
|
|
106
|
-
→ "The blue sphere is there but it's intersecting the cube. Let me adjust the position."
|
|
107
|
-
5. Fix the position, screenshot again
|
|
108
|
-
→ "Both objects are now properly placed side by side."
|
|
109
|
-
```
|
|
84
|
+
Keep it to 1-2 screenshots per task. Each screenshot consumes significant tokens.
|
|
110
85
|
|
|
111
86
|
## Scene Layout Awareness
|
|
112
87
|
|
|
@@ -114,9 +89,8 @@ Example flow:
|
|
|
114
89
|
- **Y is up**. Ground level is Y=0.
|
|
115
90
|
- The avatar **spawns near the south-west corner** (low X, low Z).
|
|
116
91
|
- Objects at the **center** of a 1×1 scene are at roughly (8, 0, 8).
|
|
117
|
-
- The **minimap** in the top-left corner shows coordinates and a compass.
|
|
118
92
|
|
|
119
|
-
|
|
93
|
+
**WARNING:** If you see empty/gray space, "No scene", or no content — you've walked outside the scene boundaries. STOP moving. Keep movements small (holdMs: 300).
|
|
120
94
|
|
|
121
95
|
## Troubleshooting
|
|
122
96
|
|
|
@@ -127,11 +101,12 @@ For a 2×2 scene (32×32m), center is (16, 0, 16) and the avatar needs to walk ~
|
|
|
127
101
|
| Objects not visible | They may be behind the camera (south of avatar) — use `moveBack` or `lookLeft`/`lookRight` to find them |
|
|
128
102
|
| Scene looks different after code change | Hot reload takes ~1-2s — add a `wait` action of 2000ms |
|
|
129
103
|
| "No preview server running" | Start it with `/preview` first |
|
|
104
|
+
| Empty/gray space, no scene content | You've left the scene boundaries — stop moving |
|
|
130
105
|
|
|
131
106
|
## Tips
|
|
132
107
|
|
|
133
108
|
- **First screenshot is slow** (~15s) because it launches a browser and enters the scene. After that, screenshots are instant.
|
|
134
109
|
- **The browser persists** across all screenshot calls in the session — no repeated logins.
|
|
135
|
-
- **
|
|
110
|
+
- **Keep movements small** — use `holdMs: 300` (default) to avoid walking out of the scene.
|
|
136
111
|
- **Hot reload** — after writing code, wait ~2s before screenshotting to let the scene update.
|
|
137
112
|
- **Describe honestly** — if something looks wrong, say so. The user trusts your visual assessment.
|