@vibes.diy/prompts 2.7.1 → 3.0.1
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/cli-footer.md +2 -0
- package/llms/three-js.md +46 -6
- package/llms/webxr.md +12 -4
- package/package.json +4 -4
package/cli-footer.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
- `npx vibes-diy push --instant-join` — deploy and auto-accept sharing so anyone with the link can use it
|
|
13
13
|
- `npx vibes-diy push --app-slug other-name` — deploy to a different app slug instead of the directory name
|
|
14
|
+
- `npx vibes-diy unpublish <vibe>` — take a deployed vibe down (reversible; code and data are kept)
|
|
15
|
+
- `npx vibes-diy publish <vibe>` — make it live again, or promote a `--mode dev` draft to production
|
|
14
16
|
- `npx vibes-diy login` — authenticate this device (run once before first push)
|
|
15
17
|
- `npx vibes-diy mcp --help` — start an MCP server for AI agent data access (Claude Desktop / Cowork)
|
|
16
18
|
- `npx vibes-diy help` — show all available commands
|
package/llms/three-js.md
CHANGED
|
@@ -117,8 +117,9 @@ texture.wrapT = THREE.RepeatWrapping;
|
|
|
117
117
|
texture.repeat.set(2, 2);
|
|
118
118
|
texture.flipY = false;
|
|
119
119
|
|
|
120
|
-
// HDR textures
|
|
121
|
-
|
|
120
|
+
// HDR textures (loaders live in addons, not the core THREE namespace)
|
|
121
|
+
import { HDRLoader } from "three/addons/loaders/HDRLoader.js";
|
|
122
|
+
const hdrLoader = new HDRLoader();
|
|
122
123
|
const envMap = hdrLoader.load("environment.hdr");
|
|
123
124
|
envMap.mapping = THREE.EquirectangularReflectionMapping;
|
|
124
125
|
```
|
|
@@ -1347,6 +1348,14 @@ export default function SkyGlider() {
|
|
|
1347
1348
|
gameStateRef.current.keys[event.code] = false;
|
|
1348
1349
|
}, []);
|
|
1349
1350
|
|
|
1351
|
+
const handleResize = useCallback(() => {
|
|
1352
|
+
const state = gameStateRef.current;
|
|
1353
|
+
if (!state.camera || !state.renderer) return;
|
|
1354
|
+
state.camera.aspect = window.innerWidth / window.innerHeight;
|
|
1355
|
+
state.camera.updateProjectionMatrix();
|
|
1356
|
+
state.renderer.setSize(window.innerWidth, window.innerHeight);
|
|
1357
|
+
}, []);
|
|
1358
|
+
|
|
1350
1359
|
const updateGame = useCallback(() => {
|
|
1351
1360
|
const state = gameStateRef.current;
|
|
1352
1361
|
if (!state.gameRunning || !state.glider) return;
|
|
@@ -1430,12 +1439,29 @@ export default function SkyGlider() {
|
|
|
1430
1439
|
initThreeJS();
|
|
1431
1440
|
window.addEventListener("keydown", handleKeyDown);
|
|
1432
1441
|
window.addEventListener("keyup", handleKeyUp);
|
|
1442
|
+
window.addEventListener("resize", handleResize);
|
|
1433
1443
|
return () => {
|
|
1434
1444
|
window.removeEventListener("keydown", handleKeyDown);
|
|
1435
1445
|
window.removeEventListener("keyup", handleKeyUp);
|
|
1436
|
-
|
|
1446
|
+
window.removeEventListener("resize", handleResize);
|
|
1447
|
+
const state = gameStateRef.current;
|
|
1448
|
+
state.gameRunning = false;
|
|
1449
|
+
// Release GPU resources so remounts don't leak WebGL contexts
|
|
1450
|
+
if (state.scene) {
|
|
1451
|
+
state.scene.traverse((obj) => {
|
|
1452
|
+
if (obj.geometry) obj.geometry.dispose();
|
|
1453
|
+
if (obj.material) {
|
|
1454
|
+
const materials = Array.isArray(obj.material) ? obj.material : [obj.material];
|
|
1455
|
+
materials.forEach((material) => {
|
|
1456
|
+
if (material.map) material.map.dispose(); // CanvasTextures, etc.
|
|
1457
|
+
material.dispose();
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
if (state.renderer) state.renderer.dispose();
|
|
1437
1463
|
};
|
|
1438
|
-
}, [initThreeJS, handleKeyDown, handleKeyUp]);
|
|
1464
|
+
}, [initThreeJS, handleKeyDown, handleKeyUp, handleResize]);
|
|
1439
1465
|
|
|
1440
1466
|
return (
|
|
1441
1467
|
<div className="relative h-screen w-full bg-sky-200">
|
|
@@ -1743,8 +1769,11 @@ export default function HalftoneArtStudio() {
|
|
|
1743
1769
|
|
|
1744
1770
|
createObjects();
|
|
1745
1771
|
|
|
1746
|
-
// Animation loop
|
|
1772
|
+
// Animation loop — capture the id so cleanup can cancel it. Because this
|
|
1773
|
+
// effect re-runs on every `parameters` change, an uncancelled loop would
|
|
1774
|
+
// keep calling composer.render() on a disposed renderer.
|
|
1747
1775
|
const clock = new THREE.Clock();
|
|
1776
|
+
let animationId;
|
|
1748
1777
|
const animate = () => {
|
|
1749
1778
|
const delta = clock.getDelta();
|
|
1750
1779
|
const elapsed = clock.getElapsedTime();
|
|
@@ -1763,7 +1792,7 @@ export default function HalftoneArtStudio() {
|
|
|
1763
1792
|
|
|
1764
1793
|
controls.update();
|
|
1765
1794
|
composer.render();
|
|
1766
|
-
requestAnimationFrame(animate);
|
|
1795
|
+
animationId = requestAnimationFrame(animate);
|
|
1767
1796
|
};
|
|
1768
1797
|
|
|
1769
1798
|
animate();
|
|
@@ -1780,6 +1809,17 @@ export default function HalftoneArtStudio() {
|
|
|
1780
1809
|
|
|
1781
1810
|
return () => {
|
|
1782
1811
|
window.removeEventListener("resize", handleResize);
|
|
1812
|
+
cancelAnimationFrame(animationId);
|
|
1813
|
+
controls.dispose();
|
|
1814
|
+
// Dispose every geometry + material we created (ShaderMaterials included)
|
|
1815
|
+
sceneRef.current.objects.forEach((obj) => {
|
|
1816
|
+
obj.geometry.dispose();
|
|
1817
|
+
const materials = Array.isArray(obj.material) ? obj.material : [obj.material];
|
|
1818
|
+
materials.forEach((material) => material.dispose());
|
|
1819
|
+
});
|
|
1820
|
+
// Dispose post-processing passes + the composer's render targets
|
|
1821
|
+
composer.passes.forEach((pass) => pass.dispose?.());
|
|
1822
|
+
composer.dispose();
|
|
1783
1823
|
renderer.dispose();
|
|
1784
1824
|
};
|
|
1785
1825
|
}, [parameters]);
|
package/llms/webxr.md
CHANGED
|
@@ -75,11 +75,19 @@ xrHelper.baseExperience.onStateChangedObservable.add((state) => {
|
|
|
75
75
|
|
|
76
76
|
### VR Button
|
|
77
77
|
|
|
78
|
-
`createDefaultXRExperienceAsync` adds the "Enter VR" button automatically. To
|
|
78
|
+
`createDefaultXRExperienceAsync` adds the "Enter VR" button automatically. To use your own button instead, disable the default UI and drive the session yourself:
|
|
79
79
|
|
|
80
80
|
```javascript
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
// Build the experience without the default Enter VR button. With
|
|
82
|
+
// disableDefaultUI there's no UI to configure, so the session mode and
|
|
83
|
+
// reference space are set on enterXRAsync below, not via uiOptions.
|
|
84
|
+
const xrHelper = await scene.createDefaultXRExperienceAsync({
|
|
85
|
+
disableDefaultUI: true,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// ...then wire up your own DOM button to enter/exit the session
|
|
89
|
+
document.getElementById("enter-vr").addEventListener("click", async () => {
|
|
90
|
+
await xrHelper.baseExperience.enterXRAsync("immersive-vr", "local-floor");
|
|
83
91
|
});
|
|
84
92
|
```
|
|
85
93
|
|
|
@@ -540,7 +548,7 @@ export default function App() {
|
|
|
540
548
|
|
|
541
549
|
## Real-World Example 2: AR Passthrough — Tap to Place Glowing Orbs
|
|
542
550
|
|
|
543
|
-
Tap a real-world surface to plant a pulsing orb
|
|
551
|
+
Tap a real-world surface to plant a pulsing orb at the hit-test point. Orb positions are stored in Fireproof so they survive page reload. (Orbs are placed at the hit-test location, not world-locked to it — for true anchoring that survives device movement, wire in `WebXRAnchorSystem` as shown in the Anchors reference above.)
|
|
544
552
|
|
|
545
553
|
On devices without AR support (desktop, unsupported browsers) the app automatically enters **fixture mode**: a background photo stands in for the passthrough feed, and mouse clicks place orbs via ray-picking. The 3D scene is identical in both modes — only the background source differs.
|
|
546
554
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"description": "",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@fireproof/core-types-base": "~0.24.19",
|
|
30
30
|
"@fireproof/core-types-protocols-cloud": "~0.24.19",
|
|
31
31
|
"@fireproof/use-fireproof": "~0.24.19",
|
|
32
|
-
"@vibes.diy/call-ai-v2": "^
|
|
33
|
-
"@vibes.diy/identity": "^
|
|
34
|
-
"@vibes.diy/use-vibes-types": "^
|
|
32
|
+
"@vibes.diy/call-ai-v2": "^3.0.1",
|
|
33
|
+
"@vibes.diy/identity": "^3.0.1",
|
|
34
|
+
"@vibes.diy/use-vibes-types": "^3.0.1",
|
|
35
35
|
"arktype": "~2.2.1",
|
|
36
36
|
"json-schema-faker": "~0.6.2"
|
|
37
37
|
},
|