@displayxr/inline3d-tools 0.1.7 → 0.1.8

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/AGENTS.md CHANGED
@@ -15,11 +15,11 @@ sandboxed agent, prefer the MCP server** (below): MCP servers run outside the sa
15
15
  sandbox. Otherwise run them as shell commands:
16
16
 
17
17
  ```sh
18
- npx -y @displayxr/inline3d-tools@0.1.7 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
19
- npx -y @displayxr/inline3d-tools@0.1.7 assets <file.glb> [--target tablet|desktop]
20
- npx -y @displayxr/inline3d-tools@0.1.7 assets prep <in> <out.glb> [--metres 0.01] [--decimate 0.5]
21
- npx -y @displayxr/inline3d-tools@0.1.7 scaffold <esm|vite> <target-dir> --title "<page title>"
22
- npx -y @displayxr/inline3d-tools@0.1.7 gen providers | gen run <adapter> ... --confirm-paid | gen provenance --file ...
18
+ npx -y @displayxr/inline3d-tools@0.1.8 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
19
+ npx -y @displayxr/inline3d-tools@0.1.8 assets <file.glb> [--target tablet|desktop]
20
+ npx -y @displayxr/inline3d-tools@0.1.8 assets prep <in> <out.glb> [--metres 0.01] [--decimate 0.5]
21
+ npx -y @displayxr/inline3d-tools@0.1.8 scaffold <esm|vite> <target-dir> --title "<page title>"
22
+ npx -y @displayxr/inline3d-tools@0.1.8 gen providers | gen run <adapter> ... --confirm-paid | gen provenance --file ...
23
23
  ```
24
24
 
25
25
  or, with the MCP server configured (`inline3d-tools mcp`; config snippets for Codex, Cursor and
@@ -58,6 +58,11 @@ the buffer, clamp it to the device, frame the subject on the glass, and validate
58
58
  three or PlayCanvas: use PlayCanvas for models and splats (the default, the most tested path); use
59
59
  three when the page already is a three.js app (`addScene` + `EyeCamera`, see
60
60
  `docs/porting-three-js-apps.md`).
61
+ An **animated character** (a rigged glTF that idles, hops, waves, reacts): `addScene` + `EyeCamera`
62
+ with three's `GLTFLoader` and `THREE.AnimationMixer` (`mixer.update(dt)` in your per-frame update,
63
+ which runs for both the 3D and the 2D path). Play the clips the file actually has (list
64
+ `gltf.animations` names; a model rarely has every gesture the user named, so pick the nearest clip,
65
+ such as a jump for "say hi", and say so). `addModel` does not drive clips.
61
66
 
62
67
  ### 2. Pick the rig by what the user moves
63
68
 
@@ -195,10 +200,25 @@ world per frame. Shrinking depth: rotate or scale uniformly, never squash z.
195
200
  drop legacy calls. The checker scrolls the page and reports chrome that passes over a tile.
196
201
  - HUD text and values: HTML beside or over the tile, readable size, not drawn into the 3D scene.
197
202
 
203
+ **Input: tap, pointer, tracked hands.** Taps, clicks and drags are ordinary pointer events on the
204
+ canvas, in 3D and 2D alike: `canvas.addEventListener('pointerdown', …)`. There are no controllers and
205
+ no `select` events. **Tracked hands** (DisplayXR Browser 1.8.0+ on Windows with a hand tracker; none
206
+ anywhere else, so always give the same action a tap too) come from `@displayxr/inline3d/hands`
207
+ (import-map entry `…/inline3d@1.60.2/js/inline3d-hands.js`; types in `hands.d.ts`):
208
+ - a model or splat: `addModel(wall, canvas, url, { hands: true })` (pinch to turn, two pinches to zoom);
209
+ - your own scene: `watchHands(wall, (f) => { const h = f.right || f.left; … })` after `addScene`.
210
+ Each frame gives `f.left` / `f.right` (null when not seen), with `wrist`, `thumbTip`, `indexTip`,
211
+ `joint(name)` and `palmLength`, in metres in the rig frame (the eye views' frame: x right, y up, z
212
+ toward the viewer). "Hold up your hand" = a hand appears (`h && !hadHand`); follow it with
213
+ `h.wrist[0]`; a pinch = `PinchDetector` on the thumb-to-index distance.
214
+ `f.gate` is `'available'` or why hands are withheld (`'camera-rig'`, `'not-fullscreen'`,
215
+ `'scaled-rig'`, …): use a display rig. The checker simulates no hands, so a PASS says nothing
216
+ about the hand path: say so, and ask the user to try it on the display.
217
+
198
218
  ### 6. Pins (exact versions, no `^`)
199
219
 
200
- `@displayxr/inline3d` **1.60.1**, `playcanvas` **2.24.0** (exact; `>=2.22.3 <3` is the supported
201
- range), `three` **0.180.0**. CDN import maps pin the same: `https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.1/js/inline3d.js`,
220
+ `@displayxr/inline3d` **1.60.2**, `playcanvas` **2.24.0** (exact; `>=2.22.3 <3` is the supported
221
+ range), `three` **0.180.0**. CDN import maps pin the same: `https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.2/js/inline3d.js`,
202
222
  `https://cdn.jsdelivr.net/npm/playcanvas@2.24.0/build/playcanvas.mjs`,
203
223
  `https://cdn.jsdelivr.net/npm/three@0.180.0/build/three.module.js`. If a newer SDK is installed, its
204
224
  `CHANGELOG.md` says what changed; prefer the installed version's docs over this list.
@@ -206,7 +226,7 @@ range), `three` **0.180.0**. CDN import maps pin the same: `https://cdn.jsdelivr
206
226
  ### 7. Before you say done: run the checker
207
227
 
208
228
  ```sh
209
- npx -y @displayxr/inline3d-tools@0.1.7 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
229
+ npx -y @displayxr/inline3d-tools@0.1.8 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
210
230
  ```
211
231
 
212
232
  This runs the exact-pinned `@displayxr/inline3d-tools` package from npm (the first run downloads it;
@@ -234,8 +254,8 @@ The templates ship in the exact-pinned `@displayxr/inline3d-tools` npm package;
234
254
  command copies them (the first run downloads the package; the user may be asked to approve the command):
235
255
 
236
256
  ```sh
237
- npx -y @displayxr/inline3d-tools@0.1.7 scaffold esm <target-dir> --title "<page title>"
238
- npx -y @displayxr/inline3d-tools@0.1.7 scaffold vite <target-dir> --title "<page title>" [--name <npm-name>]
257
+ npx -y @displayxr/inline3d-tools@0.1.8 scaffold esm <target-dir> --title "<page title>"
258
+ npx -y @displayxr/inline3d-tools@0.1.8 scaffold vite <target-dir> --title "<page title>" [--name <npm-name>]
239
259
  ```
240
260
 
241
261
  It never overwrites an existing file (`--force` replaces). What it writes:
@@ -245,7 +265,7 @@ It never overwrites an existing file (`--force` replaces). What it writes:
245
265
  | `app.js` | the page logic (shared by both flavours): a three.js scene on `addScene` with `EyeCamera`, display rig, validate-before-clear with last-good replay, buffer sized 2× the box (dpr ≤ 2, clamped to the GPU), cover removed on `handle.firstWoven` + a 4 s timeout + `catch`, a mono 2D fallback |
246
266
  | `style.css` | page styles; the canvas and its ancestors carry no CSS effects |
247
267
  | `index.html` (esm) | no build step: an import map with exact CDN pins |
248
- | `index.html` + `package.json` (vite) | Vite: exact npm pins (`@displayxr/inline3d` 1.60.1, `three` 0.180.0) |
268
+ | `index.html` + `package.json` (vite) | Vite: exact npm pins (`@displayxr/inline3d` 1.60.2, `three` 0.180.0) |
249
269
 
250
270
  ### Steps
251
271
 
@@ -276,7 +296,7 @@ It never overwrites an existing file (`--force` replaces). What it writes:
276
296
  without `player.firstWoven`, wait for the first frame and then ~1200 ms more.
277
297
 
278
298
  Add `"playcanvas": "https://cdn.jsdelivr.net/npm/playcanvas@2.24.0/build/playcanvas.mjs"` and
279
- `"@displayxr/inline3d/model": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.1/js/inline3d-model-entry.js"`
299
+ `"@displayxr/inline3d/model": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.2/js/inline3d-model-entry.js"`
280
300
  (or `.../js/inline3d-splat-pc-entry.js` for `/splat/playcanvas`) to the import map, or
281
301
  `"playcanvas": "2.24.0"` to `package.json`. Images and video use `wall.addImage(canvas, 'pic_2x1.jpg')`
282
302
  / `wall.addVideo(canvas, videoEl)` in the 3D branch and an `<img>` of the left half (or a mono
@@ -287,8 +307,8 @@ It never overwrites an existing file (`--force` replaces). What it writes:
287
307
  5. **Run the checker before saying done**, and fix every FAIL:
288
308
 
289
309
  ```sh
290
- npx -y @displayxr/inline3d-tools@0.1.7 check <target-dir> # esm
291
- npx -y @displayxr/inline3d-tools@0.1.7 check http://localhost:5173/ # vite dev server
310
+ npx -y @displayxr/inline3d-tools@0.1.8 check <target-dir> # esm
311
+ npx -y @displayxr/inline3d-tools@0.1.8 check http://localhost:5173/ # vite dev server
292
312
  ```
293
313
 
294
314
  The untouched template passes every check (verdict PASS). If your change makes a check fail, the
@@ -305,19 +325,29 @@ Tools, in the order to reach for them:
305
325
 
306
326
  | Tool | When | Install |
307
327
  |---|---|---|
308
- | `inline3d-tools assets` | always, last | `npx -y @displayxr/inline3d-tools@0.1.7 assets` (exact pin, from npm; Node only) |
328
+ | `inline3d-tools assets` | always, last | `npx -y @displayxr/inline3d-tools@0.1.8 assets` (exact pin, from npm; Node only) |
309
329
  | glTF-Transform CLI | glTF/GLB in, glTF/GLB out: inspect, resize, compress, simplify, centre | `npx -y @gltf-transform/cli@4.3.0` (pinned; nothing installed globally) |
310
330
  | Blender (headless) | any other format (FBX, OBJ, STL, PLY, DAE, .blend), units/axis fixes, heavy decimation | **only if already installed**; never install it |
311
- | `inline3d-tools gen` | no asset exists and the user wants one generated | `npx -y @displayxr/inline3d-tools@0.1.7 gen`; needs the user's own API key in the environment; every call is paid and needs the user's yes |
331
+ | `inline3d-tools gen` | no asset exists and the user wants one generated | `npx -y @displayxr/inline3d-tools@0.1.8 gen`; needs the user's own API key in the environment; every call is paid and needs the user's yes |
312
332
 
313
333
  ### 1. Get it
314
334
 
315
335
  In order of preference:
316
336
 
317
337
  1. **The user's own asset** (in the project, or a path they gave). Record it:
318
- `npx -y @displayxr/inline3d-tools@0.1.7 gen provenance --file assets/x.glb --source "supplied by the user" --license "user's"`.
319
- 2. **A library asset with a clear licence** (CC0 / CC-BY, e.g. the Khronos glTF sample models,
320
- Poly Haven). Record the URL, author and licence; CC-BY needs visible credit on the page.
338
+ `npx -y @displayxr/inline3d-tools@0.1.8 gen provenance --file assets/x.glb --source "supplied by the user" --license "user's"`.
339
+ 2. **A library asset with a clear licence** (CC0 / CC-BY). Record the URL, author and licence;
340
+ CC-BY needs visible credit on the page (credit CC0 too, it costs nothing). Where to look:
341
+ - **Poly Pizza** (`https://poly.pizza`, low-poly, many CC0 and **rigged and animated** characters
342
+ and animals by Quaternius: dinosaurs, pets, people, robots). Search it with
343
+ `https://poly.pizza/api/search/<word>` (JSON: `title`, `creator`, `licence`, `url`); the
344
+ model page `https://poly.pizza<url>` carries the GLB as `https://static.poly.pizza/<uuid>.glb`
345
+ (CORS open, loads straight into a page). Example: T-Rex by Quaternius, CC0,
346
+ `https://static.poly.pizza/34eed102-48f0-43dd-bc6f-ef7a6dfddfbb.glb` (336 KB; clips Idle, Walk,
347
+ Run, Jump, Attack, Death).
348
+ - **Khronos glTF sample models** (`https://github.com/KhronosGroup/glTF-Sample-Assets`, served
349
+ from `raw.githubusercontent.com`): test and showcase models (Fox is rigged and animated).
350
+ - **Poly Haven** (`https://polyhaven.com`): CC0 props, textures and HDRIs, no characters.
321
351
  3. **A placeholder you build** (primitives in three.js/PlayCanvas) when nothing fits and the user
322
352
  did not ask for generation. Say so in your notes.
323
353
  4. **Generation**, only when the user asked for it or agreed. See §4.
@@ -345,7 +375,7 @@ fetches decoders from a CDN). Other fixes: `$GT simplify in.glb out.glb --ratio
345
375
  **Anything else (Blender, if present).** Detect it, don't install it:
346
376
 
347
377
  ```sh
348
- npx -y @displayxr/inline3d-tools@0.1.7 assets prep in.fbx out.glb [--metres 0.01] [--decimate 0.5] [--blender <path>]
378
+ npx -y @displayxr/inline3d-tools@0.1.8 assets prep in.fbx out.glb [--metres 0.01] [--decimate 0.5] [--blender <path>]
349
379
  ```
350
380
 
351
381
  It looks for Blender (`--blender`, `$BLENDER`, `PATH`, the default install location), never installs
@@ -362,8 +392,8 @@ helmet is ~0.3 m, not 2 m).
362
392
  ### 3. Check it (before the page uses it)
363
393
 
364
394
  ```sh
365
- npx -y @displayxr/inline3d-tools@0.1.7 assets out.glb # tablet budget (default)
366
- npx -y @displayxr/inline3d-tools@0.1.7 assets out.glb --target desktop
395
+ npx -y @displayxr/inline3d-tools@0.1.8 assets out.glb # tablet budget (default)
396
+ npx -y @displayxr/inline3d-tools@0.1.8 assets out.glb --target desktop
367
397
  ```
368
398
 
369
399
  It reports: missing external files, decoders the page must provide, triangles (both eyes draw
@@ -377,7 +407,7 @@ animations. Fix every FAIL; act on WARNs or say why not. Then run the page check
377
407
  ### 4. Generate it (optional, paid, the user's keys)
378
408
 
379
409
  ```sh
380
- npx -y @displayxr/inline3d-tools@0.1.7 gen providers # which adapters have a key (names only)
410
+ npx -y @displayxr/inline3d-tools@0.1.8 gen providers # which adapters have a key (names only)
381
411
  ```
382
412
 
383
413
  Adapters: `meshy` and `tripo` (text-to-3d, image-to-3d → GLB), `openai` (image → PNG, for
@@ -398,7 +428,7 @@ textures, posters and backdrops). Each reads its key from the environment (`MESH
398
428
  shippable.
399
429
 
400
430
  ```sh
401
- npx -y @displayxr/inline3d-tools@0.1.7 gen run meshy --kind text-to-3d --prompt "a brass desk lamp, PBR" --out assets/lamp-raw.glb --confirm-paid
431
+ npx -y @displayxr/inline3d-tools@0.1.8 gen run meshy --kind text-to-3d --prompt "a brass desk lamp, PBR" --out assets/lamp-raw.glb --confirm-paid
402
432
  ```
403
433
 
404
434
  ### 5. ASSETS.md
package/README.md CHANGED
@@ -9,7 +9,7 @@ same operations. [`AGENTS.md`](AGENTS.md) is the matching authoring checklist fo
9
9
  Needs Node ≥ 18. `check` also needs a local Chrome or Chromium. Always run an **exact version**:
10
10
 
11
11
  ```sh
12
- npx -y @displayxr/inline3d-tools@0.1.7 <command> ...
12
+ npx -y @displayxr/inline3d-tools@0.1.8 <command> ...
13
13
  ```
14
14
 
15
15
  ## CLI
@@ -47,7 +47,7 @@ environment only and are redacted from every tool result.
47
47
  ### Claude Code
48
48
 
49
49
  ```sh
50
- claude mcp add inline3d-tools -- npx -y @displayxr/inline3d-tools@0.1.7 mcp
50
+ claude mcp add inline3d-tools -- npx -y @displayxr/inline3d-tools@0.1.8 mcp
51
51
  ```
52
52
 
53
53
  or in a project's `.mcp.json`:
@@ -57,7 +57,7 @@ or in a project's `.mcp.json`:
57
57
  "mcpServers": {
58
58
  "inline3d-tools": {
59
59
  "command": "npx",
60
- "args": ["-y", "@displayxr/inline3d-tools@0.1.7", "mcp"]
60
+ "args": ["-y", "@displayxr/inline3d-tools@0.1.8", "mcp"]
61
61
  }
62
62
  }
63
63
  }
@@ -77,7 +77,7 @@ needs you to approve running it outside the sandbox. In `~/.codex/config.toml` (
77
77
  ```toml
78
78
  [mcp_servers.inline3d-tools]
79
79
  command = "npx"
80
- args = ["-y", "@displayxr/inline3d-tools@0.1.7", "mcp"]
80
+ args = ["-y", "@displayxr/inline3d-tools@0.1.8", "mcp"]
81
81
  # cwd = "/path/to/your/project" # relative paths in tool calls resolve here
82
82
  startup_timeout_sec = 30 # first run downloads the package (default 10)
83
83
  tool_timeout_sec = 180 # a page check takes 10-60 s; generation can take minutes (default 60)
@@ -85,11 +85,11 @@ tool_timeout_sec = 180 # a page check takes 10-60 s; generation can t
85
85
  # env_vars = ["MESHY_API_KEY", "TRIPO_API_KEY", "OPENAI_API_KEY"]
86
86
  ```
87
87
 
88
- or `codex mcp add inline3d-tools -- npx -y @displayxr/inline3d-tools@0.1.7 mcp`. The
88
+ or `codex mcp add inline3d-tools -- npx -y @displayxr/inline3d-tools@0.1.8 mcp`. The
89
89
  [`displayxr-inline3d-codex` plugin](https://github.com/DisplayXR/displayxr-web/tree/main/plugins/displayxr-inline3d-codex)
90
90
  sets the server up for you in Codex.
91
91
 
92
- **Fetch the package once before the first Codex session:** `npx -y @displayxr/inline3d-tools@0.1.7 --version`.
92
+ **Fetch the package once before the first Codex session:** `npx -y @displayxr/inline3d-tools@0.1.8 --version`.
93
93
  Codex starts MCP servers when a session starts and can stop one before a cold `npx` download
94
94
  finishes. The interrupted download leaves a broken entry in npm's `_npx` cache (`node_modules`
95
95
  without a `package.json`), and from then on the server fails at every start with
@@ -109,7 +109,7 @@ In `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):
109
109
  "mcpServers": {
110
110
  "inline3d-tools": {
111
111
  "command": "npx",
112
- "args": ["-y", "@displayxr/inline3d-tools@0.1.7", "mcp"]
112
+ "args": ["-y", "@displayxr/inline3d-tools@0.1.8", "mcp"]
113
113
  }
114
114
  }
115
115
  }
@@ -151,7 +151,7 @@ forwarding). Never paste a key into an agent chat.
151
151
  ## check
152
152
 
153
153
  ```sh
154
- npx -y @displayxr/inline3d-tools@0.1.7 check <url | dir | page.html> [--root <dir>] [--max-texture 4096] [--json] [--out report.json]
154
+ npx -y @displayxr/inline3d-tools@0.1.8 check <url | dir | page.html> [--root <dir>] [--max-texture 4096] [--json] [--out report.json]
155
155
  ```
156
156
 
157
157
  Needs Node ≥ 18 and a local Chrome (`CHROME=/path/to/chrome` overrides the default location). It
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@displayxr/inline3d-tools",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Agent-agnostic tools for @displayxr/inline3d pages: a headless checker (fake DisplayXR Browser + plain 2D run), a glTF/GLB asset check, page scaffolds, optional asset generation with provenance, and a stdio MCP server exposing the same operations.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,8 +10,9 @@
10
10
  { "imports": {
11
11
  "three": "https://cdn.jsdelivr.net/npm/three@0.180.0/build/three.module.js",
12
12
  "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.180.0/examples/jsm/",
13
- "@displayxr/inline3d": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.1/js/inline3d.js",
14
- "@displayxr/inline3d/three": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.1/js/inline3d-three.js"
13
+ "@displayxr/inline3d": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.2/js/inline3d.js",
14
+ "@displayxr/inline3d/three": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.2/js/inline3d-three.js",
15
+ "@displayxr/inline3d/hands": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.2/js/inline3d-hands.js"
15
16
  } }
16
17
  </script>
17
18
  </head>
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@displayxr/inline3d": "1.60.1",
12
+ "@displayxr/inline3d": "1.60.2",
13
13
  "three": "0.180.0"
14
14
  },
15
15
  "devDependencies": {