incanto 0.45.1 → 0.47.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.
Files changed (38) hide show
  1. package/bin/incanto-check.mjs +5 -1
  2. package/bin/incanto-feel.mjs +5 -1
  3. package/bin/incanto-frame.mjs +57 -6
  4. package/bin/incanto-model.mjs +79 -10
  5. package/bin/incanto-playtest.mjs +5 -1
  6. package/bin/incanto-verify.mjs +214 -0
  7. package/dist/2d.d.ts +1 -1
  8. package/dist/2d.js +1 -1
  9. package/dist/3d.d.ts +90 -5
  10. package/dist/3d.js +92 -5
  11. package/dist/{create-game-DFRbG0Bj.js → create-game-CniOiWzN.js} +1 -1
  12. package/dist/{create-game-Gifrjhnz.js → create-game-D16MVIPO.js} +24 -5
  13. package/dist/{editor-switch-DVwIGZdK.d.ts → editor-switch-DAvWQeld.d.ts} +1 -1
  14. package/dist/editor.js +4674 -4346
  15. package/dist/{environment-presets-DUsBqvtk.js → environment-presets-D1b0ydTS.js} +5 -4
  16. package/dist/{frame-report-Ct8XgsmV.d.ts → frame-report-DZ70IY26.d.ts} +25 -0
  17. package/dist/{frame-report-Lr3VO24R.js → frame-report-njybhZon.js} +130 -3
  18. package/dist/index.js +1 -1
  19. package/dist/{physics-3d-DFqMtBUD.js → physics-3d-CSoGjM8P.js} +1 -1
  20. package/dist/react.js +1 -1
  21. package/dist/{src-DUxGnvq3.js → src-Ca3oV1fe.js} +1 -1
  22. package/dist/{teardown-yePMOE1K.js → teardown-BKTCzLek.js} +3 -2
  23. package/dist/{test-DD5scWfm.js → test-E4-otKqK.js} +54 -7
  24. package/dist/test.d.ts +55 -1
  25. package/dist/test.js +2 -2
  26. package/dist/vite.d.ts +34 -3
  27. package/dist/vite.js +104 -12
  28. package/editor/assets/{agent8-B25qJ5Wo.js → agent8-_007gPF8.js} +1 -1
  29. package/editor/assets/{debug-CUsz-pT8.js → debug-0DI_MJaq.js} +1 -1
  30. package/editor/assets/{index-3u3GVteP.js → index-B-6eYZEi.js} +173 -96
  31. package/editor/index.html +1 -1
  32. package/package.json +3 -2
  33. package/skills/incanto-3d-models.md +30 -0
  34. package/skills/incanto-editor.md +6 -1
  35. package/skills/incanto-verifying-your-game.md +60 -1
  36. package/templates-app/beacon-isle-3d/package.json +1 -1
  37. package/templates-app/tps-3d/package.json +1 -1
  38. package/templates-app/village-quest-3d/package.json +1 -1
package/editor/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Incanto Scene Editor</title>
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='%236ee7dc'/><text x='8' y='12' text-anchor='middle' font-size='11' font-family='monospace' fill='%230e1018'>i</text></svg>" />
8
- <script type="module" crossorigin src="./assets/index-3u3GVteP.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-B-6eYZEi.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/GameServer-C56iOUgF.js">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incanto",
3
- "version": "0.45.1",
3
+ "version": "0.47.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -98,6 +98,7 @@
98
98
  "incanto-playtest": "bin/incanto-playtest.mjs",
99
99
  "incanto-feel": "bin/incanto-feel.mjs",
100
100
  "incanto-new": "bin/incanto-new.mjs",
101
- "incanto-frame": "bin/incanto-frame.mjs"
101
+ "incanto-frame": "bin/incanto-frame.mjs",
102
+ "incanto-verify": "./bin/incanto-verify.mjs"
102
103
  }
103
104
  }
@@ -19,6 +19,7 @@ bunx incanto-model public/models/knight.glb
19
19
  # anim Idle: 2.4s
20
20
  # anim Run: 0.8s ← exact clip names for `animation`
21
21
  bunx incanto-model avatar.vrm --json # full machine-readable report
22
+ bunx incanto-model https://.../goblin.glb # a URL works anywhere a path does
22
23
  ```
23
24
 
24
25
  The report gives you: the TRANSFORMED scene bounding box (size/center/min/max — skinned
@@ -63,6 +64,35 @@ tint), `castShadow`/`receiveShadow`, plus the usual Node3D transform.
63
64
 
64
65
  ## Animating named sub-nodes (wheels, turrets, doors) — `poseNode`
65
66
 
67
+ ## What the file will DO here
68
+
69
+ `incanto-model` ends with a verdict, and it answers the three questions that
70
+ cost the most time. Finding an asset is the agent8 library's job — its search
71
+ matches meaning. This says whether what it found works in YOUR scene:
72
+
73
+ ```
74
+ mixamorig rig — the 3d/animations clips play on this as they are
75
+ stands 1.5 units tall
76
+ ```
77
+ ```
78
+ skinned, but NOT a mixamorig rig — the 3d/animations clips will not bind to it
79
+ (bones are matched by name; a mismatch keeps the bind pose and only warns)
80
+ stands 28.45 units tall — not a character's size; set targetHeight (1.7) to fix it
81
+ clips in the file: die, idle, walk, normal_attack, … (play by name, no asset needed)
82
+ ```
83
+ ```
84
+ does NOT stand on its own origin — it sits 10.1 units above the origin. A node at
85
+ [0,0,0] puts it there too; offset the node, or expect an empty-looking frame
86
+ ```
87
+ ```
88
+ an animation CLIP — no mesh of its own. It plays ON a character: declare it as
89
+ {"type":"animation"} and point a ModelInstance3D's `animation` at it. Used as a
90
+ `model` it draws nothing at all, with no error
91
+ ```
92
+
93
+ It then prints the scene JSON to paste — the asset entry and the node, with
94
+ `targetHeight` already set when the raw size calls for it.
95
+
66
96
  Many GLBs ship articulated parts as NAMED nodes (`bunx incanto-model <file>` lists them —
67
97
  e.g. the Kenney vehicles have `wheel-front-left` … `wheel-back-right`). From a behavior,
68
98
  rotate one per frame with `poseNode(name, [rxDeg, ryDeg, rzDeg])` (local Euler XYZ):
@@ -253,9 +253,14 @@ so the page cannot call it directly — `incanto-editor` proxies it at
253
253
  ```bash
254
254
  bunx incanto-editor --token <v8 access token>
255
255
  INCANTO_V8_TOKEN=<token> bunx incanto-editor # same thing
256
+ # either way the panel header shows WHICH token is in use, wallet-style
257
+ # (`v8_abc…wxyz · INCANTO_V8_TOKEN`) — enough to recognise, never enough to use
256
258
  ```
257
259
 
258
- With no token the 📚 panel asks for one and keeps it in the browser
260
+ With no token the 📚 panel offers **sign in with Verse8** the same device flow
261
+ agent8's own local-dev login uses. It opens the Verse8 approval page in a new
262
+ tab, shows you the code to approve, and stores the token it comes back with in
263
+ this browser
259
264
  (`localStorage`), which is the right answer for a shared machine — the token is
260
265
  sent only to your own editor server, never written to disk by it, and forwarded
261
266
  upstream as a bearer. `INCANTO_LIBRARY_URL` points the proxy somewhere else
@@ -26,6 +26,34 @@ A run that finishes is not a run that worked. `runScript()` fails the run when
26
26
  `stats().errors` is non-zero, and prints the engine's warnings under the
27
27
  failures — but `framing` and `assetErrors()` you have to ASK for.
28
28
 
29
+ ## 0. The whole ladder, one command: `incanto-verify`
30
+
31
+ ```
32
+ $ bunx incanto-verify # finds your scene
33
+ ✓ loads — the scene is legal and its assets resolve
34
+ ? plays — nothing declares a win — 8 runs played without error, and there was no end to reach
35
+ ? draws — the dev server is running on :5173, but no page answered
36
+
37
+ passes what was measured — plays, draws not measured.
38
+ next: if it is meant to be finishable, emit `won` (GameFlow, ScoreKeeper, or your own behaviour)
39
+ ```
40
+
41
+ Runs the rungs below in order and says the ONE thing to do next. Three rules it
42
+ encodes so you do not have to remember them:
43
+
44
+ - a **failed** rung makes the ones above it meaningless, so only the first is
45
+ worth reading — the rest are marked `·` skipped;
46
+ - an **unmeasured** rung (`?`) is not a failure. "No dev server" means the
47
+ question was never asked; treating that as a broken game sends you editing a
48
+ scene that is fine;
49
+ - a scene that declares **no win** is not a scene that cannot be won. A
50
+ walkabout has no end, and that is reported as unmeasured, not failed.
51
+
52
+ Exit 1 only when a rung actually failed. `--behaviors src/behaviors.ts` matters:
53
+ without it your game logic is stubbed and only the structure is played.
54
+
55
+ The sections below are the same rungs one at a time, for when you need the detail.
56
+
29
57
  ## 1. After EVERY scene edit: `incanto-check`
30
58
 
31
59
  ```bash
@@ -329,6 +357,22 @@ black screen, a material that failed, or a shader drawing where it should not.
329
357
  ```
330
358
  $ bunx incanto-frame
331
359
  frame 1280×720 · luminance 0.62
360
+ subject 412×690 at 434,18 · fills 21.4% of frame
361
+ ```
362
+
363
+ `subject` is what the frame is OF: everything that is not the background,
364
+ measured from the frame's own edges. It answers the question `black` and
365
+ `uniform` cannot — **is the thing IN the shot, and can you see it**:
366
+
367
+ ```
368
+ nothing but background — the camera is pointed away from everything in the scene
369
+ ```
370
+ ```
371
+ the subject fills almost nothing (0.3%) — the camera is too far back, or what
372
+ you meant to see is not what got drawn
373
+ ```
374
+ ```
375
+ subject 1280×720 at 0,0 · fills 84.1% of frame · CLIPPED by the frame edge
332
376
  ```
333
377
 
334
378
  ```
@@ -342,7 +386,22 @@ browser, not in the dev server.** You do not have to tell it where anything is
342
386
  it reads the ports that are actually listening, asks each one whether it is an
343
387
  incanto dev server, and asks that page for a frame over vite's own HMR channel.
344
388
 
345
- It writes **no files**. `--json` gives the full report, including a 16×9 grid of
389
+ #### Look at it
390
+
391
+ ```
392
+ $ bunx incanto-frame --out shot.png
393
+ frame 1280×720 · luminance 0.62
394
+ subject 412×690 at 434,18 · fills 21.4% of frame
395
+ wrote shot.png — open it, or read it
396
+ ```
397
+
398
+ `--out` writes the frame as a PNG (`--size N` sets the longest side, default
399
+ 512). Read it like any other image. The numbers above are cheaper and are what
400
+ you should assert on, but when a report says a scene is fine and it plainly is
401
+ not, a picture settles it in one look — and there is still no browser to install
402
+ and nothing headless involved: the page that is already open does the drawing.
403
+
404
+ Without `--out` it writes **no files**. `--json` gives the full report, including a 16×9 grid of
346
405
  mean cell colours — enough to answer *where* the frame changed, small enough to
347
406
  read. From game code or the console, `game.frame()` returns the same object.
348
407
 
@@ -14,7 +14,7 @@
14
14
  "@dimforge/rapier2d-compat": "0.19.3",
15
15
  "@dimforge/rapier3d-compat": "0.19.3",
16
16
  "@pixiv/three-vrm": "^3.5.3",
17
- "incanto": "^0.45.1",
17
+ "incanto": "^0.47.0",
18
18
  "three": "^0.184.0"
19
19
  },
20
20
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.45.1",
16
+ "incanto": "^0.47.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.45.1",
16
+ "incanto": "^0.47.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {