@vibes.diy/prompts 6.2.2 → 6.2.4
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/llms/calendar.md +7 -0
- package/llms/three-js.md +83 -0
- package/llms/voxel.md +6 -3
- package/package.json +4 -4
package/llms/calendar.md
CHANGED
|
@@ -7,6 +7,13 @@ add more. This is a `backend.js` feature (see the backend docs for the general
|
|
|
7
7
|
handler contract); this page is the recipe that makes subscriptions actually
|
|
8
8
|
work on real devices.
|
|
9
9
|
|
|
10
|
+
The subscription is a **live feed the phone re-fetches**: a `webcal://` link
|
|
11
|
+
backed by a `backend.js` that keeps serving each user's current items as they
|
|
12
|
+
add more. So this feature is always three pieces working together — a
|
|
13
|
+
`backend.js` (the `scheduled` tick + `fetch` handler in "Complete backend.js"
|
|
14
|
+
below), a per-user token, and a `webcal://` link in the UI. Emit all three and
|
|
15
|
+
the calendar stays in sync on the user's device automatically.
|
|
16
|
+
|
|
10
17
|
## The architecture (each piece is load-bearing)
|
|
11
18
|
|
|
12
19
|
Calendar clients (iPhone, Google) refresh subscriptions with **anonymous
|
package/llms/three-js.md
CHANGED
|
@@ -2,6 +2,89 @@
|
|
|
2
2
|
|
|
3
3
|
_Essential classes, methods, and patterns for Three.js development_
|
|
4
4
|
|
|
5
|
+
Any request for a 3D scene, model viewer, solar system, globe, spinning
|
|
6
|
+
product, or game is a Three.js app: a `THREE.Scene`, a `THREE.PerspectiveCamera`,
|
|
7
|
+
and a `THREE.WebGLRenderer`, driven from a single `useEffect(() => {…}, [])` and
|
|
8
|
+
disposed on unmount. Three.js gives you real depth, lighting, and a moving
|
|
9
|
+
camera for free.
|
|
10
|
+
|
|
11
|
+
## Complete starter — the shell every Three.js vibe begins from
|
|
12
|
+
|
|
13
|
+
This is a full, runnable `App.jsx`. Start here and grow it: the engine lives in
|
|
14
|
+
one `useEffect([])`, the animation loop is a `requestAnimationFrame`, resize
|
|
15
|
+
keeps the camera aspect correct, and the cleanup disposes geometry, material,
|
|
16
|
+
and renderer so remounts don't leak GPU memory.
|
|
17
|
+
|
|
18
|
+
App.jsx
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
import React from "react";
|
|
22
|
+
import * as THREE from "three";
|
|
23
|
+
|
|
24
|
+
export default function App() {
|
|
25
|
+
const mountRef = React.useRef(null);
|
|
26
|
+
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
const mount = mountRef.current;
|
|
29
|
+
const scene = new THREE.Scene();
|
|
30
|
+
scene.background = new THREE.Color(0x0b0f1a);
|
|
31
|
+
|
|
32
|
+
const camera = new THREE.PerspectiveCamera(60, mount.clientWidth / mount.clientHeight, 0.1, 1000);
|
|
33
|
+
camera.position.set(0, 1.2, 4);
|
|
34
|
+
|
|
35
|
+
const renderer = new THREE.WebGLRenderer({ antialias: true });
|
|
36
|
+
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
|
37
|
+
renderer.setSize(mount.clientWidth, mount.clientHeight);
|
|
38
|
+
mount.appendChild(renderer.domElement);
|
|
39
|
+
|
|
40
|
+
scene.add(new THREE.AmbientLight(0xffffff, 0.4));
|
|
41
|
+
const key = new THREE.DirectionalLight(0xffffff, 1.2);
|
|
42
|
+
key.position.set(3, 5, 2);
|
|
43
|
+
scene.add(key);
|
|
44
|
+
|
|
45
|
+
const geometry = new THREE.BoxGeometry(1.5, 1.5, 1.5);
|
|
46
|
+
const material = new THREE.MeshStandardMaterial({ color: 0x4f8cff, roughness: 0.4, metalness: 0.1 });
|
|
47
|
+
const cube = new THREE.Mesh(geometry, material);
|
|
48
|
+
scene.add(cube);
|
|
49
|
+
|
|
50
|
+
let raf = 0;
|
|
51
|
+
const clock = new THREE.Clock();
|
|
52
|
+
const animate = () => {
|
|
53
|
+
const dt = clock.getDelta();
|
|
54
|
+
cube.rotation.x += dt * 0.6;
|
|
55
|
+
cube.rotation.y += dt * 0.9;
|
|
56
|
+
renderer.render(scene, camera);
|
|
57
|
+
raf = requestAnimationFrame(animate);
|
|
58
|
+
};
|
|
59
|
+
animate();
|
|
60
|
+
|
|
61
|
+
const onResize = () => {
|
|
62
|
+
if (!mount) return;
|
|
63
|
+
camera.aspect = mount.clientWidth / mount.clientHeight;
|
|
64
|
+
camera.updateProjectionMatrix();
|
|
65
|
+
renderer.setSize(mount.clientWidth, mount.clientHeight);
|
|
66
|
+
};
|
|
67
|
+
window.addEventListener("resize", onResize);
|
|
68
|
+
|
|
69
|
+
return () => {
|
|
70
|
+
cancelAnimationFrame(raf);
|
|
71
|
+
window.removeEventListener("resize", onResize);
|
|
72
|
+
geometry.dispose();
|
|
73
|
+
material.dispose();
|
|
74
|
+
renderer.dispose();
|
|
75
|
+
if (renderer.domElement.parentNode === mount) mount.removeChild(renderer.domElement);
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
return <div ref={mountRef} className="w-full h-screen" />;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The reference below is the API surface you draw on to grow that shell — swap the
|
|
84
|
+
cube for real geometry, add `OrbitControls` or your own camera rig, load models,
|
|
85
|
+
etc. — but the lifecycle above (one `useEffect`, one loop, dispose on unmount)
|
|
86
|
+
stays the spine of every Three.js vibe.
|
|
87
|
+
|
|
5
88
|
## Core Setup
|
|
6
89
|
|
|
7
90
|
### Scene Graph Hierarchy
|
package/llms/voxel.md
CHANGED
|
@@ -18,9 +18,12 @@ shared world reset. Every pattern below is pulled from them.
|
|
|
18
18
|
## Project shape: an engine in a React shell, split across a few flat files
|
|
19
19
|
|
|
20
20
|
A voxel game is one big imperative Three.js engine wrapped in a thin React
|
|
21
|
-
shell.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
shell. Render with Three.js/WebGL: a block world runs on real 3D depth, per-face
|
|
22
|
+
lighting, and a first-person perspective camera, all of which come straight from
|
|
23
|
+
the `THREE.*` classes in the Three.js docs. Build the engine **once** inside a
|
|
24
|
+
`useEffect(() => {...}, [])` that owns the renderer, the world model, and the
|
|
25
|
+
animation loop; expose a few methods on a mutable `state` object
|
|
26
|
+
(`engineRef.current`) so React can call in. React
|
|
24
27
|
renders only the HUD, the hotbar, and overlays as normal DOM on top of the
|
|
25
28
|
`<canvas>`. Never re-create the engine on re-render, and never drive
|
|
26
29
|
per-frame values through React state — read live values through refs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"description": "",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@adviser/cement": "~0.5.34",
|
|
27
|
-
"@vibes.diy/call-ai-v2": "^6.2.
|
|
28
|
-
"@vibes.diy/identity": "^6.2.
|
|
29
|
-
"@vibes.diy/use-vibes-types": "^6.2.
|
|
27
|
+
"@vibes.diy/call-ai-v2": "^6.2.4",
|
|
28
|
+
"@vibes.diy/identity": "^6.2.4",
|
|
29
|
+
"@vibes.diy/use-vibes-types": "^6.2.4",
|
|
30
30
|
"arktype": "~2.2.3",
|
|
31
31
|
"json-schema-faker": "~0.6.2"
|
|
32
32
|
},
|