@displayxr/inline3d-tools 0.1.5 → 0.1.7

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.5 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
19
- npx -y @displayxr/inline3d-tools@0.1.5 assets <file.glb> [--target tablet|desktop]
20
- npx -y @displayxr/inline3d-tools@0.1.5 assets prep <in> <out.glb> [--metres 0.01] [--decimate 0.5]
21
- npx -y @displayxr/inline3d-tools@0.1.5 scaffold <esm|vite> <target-dir> --title "<page title>"
22
- npx -y @displayxr/inline3d-tools@0.1.5 gen providers | gen run <adapter> ... --confirm-paid | gen provenance --file ...
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 ...
23
23
  ```
24
24
 
25
25
  or, with the MCP server configured (`inline3d-tools mcp`; config snippets for Codex, Cursor and
@@ -147,8 +147,16 @@ world per frame. Shrinking depth: rotate or scale uniformly, never squash z.
147
147
  `onLayerLost: viewer.onLayerLost`; `addSplat` / `addModel` / `addPlayer` handle it themselves.
148
148
  - [ ] **Nothing opaque above the canvas**; backgrounds and black go *under* it. Never overlap two
149
149
  woven canvases (hide the lower one with `display: none`).
150
+ - [ ] **Size before the first woven frame** (1.59.0+): the store is already side-by-side when the layer
151
+ delivers its first frame. Size it in the same task as `addScene`, never after an `await` or in a
152
+ later `requestAnimationFrame`. Take the first size from `wall.displayInfo` (sync; may be `null` or
153
+ `cached: true`, both fine), then refine once `handle.getDisplayInfo()` resolves:
154
+ `let viewInfo = wall.displayInfo; size(); const handle = wall.addScene(…);
155
+ handle.getDisplayInfo().then((i) => { viewInfo = i; size(); })`. A store still shaped for flat on
156
+ those frames gives each eye half the scene; the SDK warns once (`[inline3d] this woven scene
157
+ canvas's store is …`) and holds `firstWoven` until it is right, but never resizes it for you.
150
158
  - [ ] **Buffer = 2 × eye width, from `sceneBufferSize`** (core, 1.58.0+): an `addScene` page sizes its
151
- canvas with `sceneBufferSize(canvas, { sbs, viewScale: sbs ? await handle.getDisplayInfo() : null })` (set
159
+ canvas with `sceneBufferSize(canvas, { sbs, viewScale: sbs ? viewInfo : null })` (set
152
160
  `canvas.width/height`, or `renderer.setSize(s.width, s.height, false)`, only when they change;
153
161
  camera aspect from `s.eyeWidth / s.eyeHeight`), never `clientWidth × devicePixelRatio × 2`. Per eye
154
162
  it is window device px × the runtime's view scale (dpr ≤ 2 without one), fitted to the GL limits
@@ -189,8 +197,8 @@ world per frame. Shrinking depth: rotate or scale uniformly, never squash z.
189
197
 
190
198
  ### 6. Pins (exact versions, no `^`)
191
199
 
192
- `@displayxr/inline3d` **1.58.0**, `playcanvas` **2.24.0** (exact; `>=2.22.3 <3` is the supported
193
- range), `three` **0.180.0**. CDN import maps pin the same: `https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.58.0/js/inline3d.js`,
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`,
194
202
  `https://cdn.jsdelivr.net/npm/playcanvas@2.24.0/build/playcanvas.mjs`,
195
203
  `https://cdn.jsdelivr.net/npm/three@0.180.0/build/three.module.js`. If a newer SDK is installed, its
196
204
  `CHANGELOG.md` says what changed; prefer the installed version's docs over this list.
@@ -198,7 +206,7 @@ range), `three` **0.180.0**. CDN import maps pin the same: `https://cdn.jsdelivr
198
206
  ### 7. Before you say done: run the checker
199
207
 
200
208
  ```sh
201
- npx -y @displayxr/inline3d-tools@0.1.5 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
209
+ npx -y @displayxr/inline3d-tools@0.1.7 check <url | dir | page.html> [--root <project>] [--max-texture 4096]
202
210
  ```
203
211
 
204
212
  This runs the exact-pinned `@displayxr/inline3d-tools` package from npm (the first run downloads it;
@@ -226,8 +234,8 @@ The templates ship in the exact-pinned `@displayxr/inline3d-tools` npm package;
226
234
  command copies them (the first run downloads the package; the user may be asked to approve the command):
227
235
 
228
236
  ```sh
229
- npx -y @displayxr/inline3d-tools@0.1.5 scaffold esm <target-dir> --title "<page title>"
230
- npx -y @displayxr/inline3d-tools@0.1.5 scaffold vite <target-dir> --title "<page title>" [--name <npm-name>]
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>]
231
239
  ```
232
240
 
233
241
  It never overwrites an existing file (`--force` replaces). What it writes:
@@ -237,7 +245,7 @@ It never overwrites an existing file (`--force` replaces). What it writes:
237
245
  | `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 |
238
246
  | `style.css` | page styles; the canvas and its ancestors carry no CSS effects |
239
247
  | `index.html` (esm) | no build step: an import map with exact CDN pins |
240
- | `index.html` + `package.json` (vite) | Vite: exact npm pins (`@displayxr/inline3d` 1.58.0, `three` 0.180.0) |
248
+ | `index.html` + `package.json` (vite) | Vite: exact npm pins (`@displayxr/inline3d` 1.60.1, `three` 0.180.0) |
241
249
 
242
250
  ### Steps
243
251
 
@@ -268,7 +276,7 @@ It never overwrites an existing file (`--force` replaces). What it writes:
268
276
  without `player.firstWoven`, wait for the first frame and then ~1200 ms more.
269
277
 
270
278
  Add `"playcanvas": "https://cdn.jsdelivr.net/npm/playcanvas@2.24.0/build/playcanvas.mjs"` and
271
- `"@displayxr/inline3d/model": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.58.0/js/inline3d-model-entry.js"`
279
+ `"@displayxr/inline3d/model": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.60.1/js/inline3d-model-entry.js"`
272
280
  (or `.../js/inline3d-splat-pc-entry.js` for `/splat/playcanvas`) to the import map, or
273
281
  `"playcanvas": "2.24.0"` to `package.json`. Images and video use `wall.addImage(canvas, 'pic_2x1.jpg')`
274
282
  / `wall.addVideo(canvas, videoEl)` in the 3D branch and an `<img>` of the left half (or a mono
@@ -279,8 +287,8 @@ It never overwrites an existing file (`--force` replaces). What it writes:
279
287
  5. **Run the checker before saying done**, and fix every FAIL:
280
288
 
281
289
  ```sh
282
- npx -y @displayxr/inline3d-tools@0.1.5 check <target-dir> # esm
283
- npx -y @displayxr/inline3d-tools@0.1.5 check http://localhost:5173/ # vite dev server
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
284
292
  ```
285
293
 
286
294
  The untouched template passes every check (verdict PASS). If your change makes a check fail, the
@@ -297,17 +305,17 @@ Tools, in the order to reach for them:
297
305
 
298
306
  | Tool | When | Install |
299
307
  |---|---|---|
300
- | `inline3d-tools assets` | always, last | `npx -y @displayxr/inline3d-tools@0.1.5 assets` (exact pin, from npm; Node only) |
308
+ | `inline3d-tools assets` | always, last | `npx -y @displayxr/inline3d-tools@0.1.7 assets` (exact pin, from npm; Node only) |
301
309
  | 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) |
302
310
  | Blender (headless) | any other format (FBX, OBJ, STL, PLY, DAE, .blend), units/axis fixes, heavy decimation | **only if already installed**; never install it |
303
- | `inline3d-tools gen` | no asset exists and the user wants one generated | `npx -y @displayxr/inline3d-tools@0.1.5 gen`; needs the user's own API key in the environment; every call is paid and needs the user's yes |
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 |
304
312
 
305
313
  ### 1. Get it
306
314
 
307
315
  In order of preference:
308
316
 
309
317
  1. **The user's own asset** (in the project, or a path they gave). Record it:
310
- `npx -y @displayxr/inline3d-tools@0.1.5 gen provenance --file assets/x.glb --source "supplied by the user" --license "user's"`.
318
+ `npx -y @displayxr/inline3d-tools@0.1.7 gen provenance --file assets/x.glb --source "supplied by the user" --license "user's"`.
311
319
  2. **A library asset with a clear licence** (CC0 / CC-BY, e.g. the Khronos glTF sample models,
312
320
  Poly Haven). Record the URL, author and licence; CC-BY needs visible credit on the page.
313
321
  3. **A placeholder you build** (primitives in three.js/PlayCanvas) when nothing fits and the user
@@ -337,7 +345,7 @@ fetches decoders from a CDN). Other fixes: `$GT simplify in.glb out.glb --ratio
337
345
  **Anything else (Blender, if present).** Detect it, don't install it:
338
346
 
339
347
  ```sh
340
- npx -y @displayxr/inline3d-tools@0.1.5 assets prep in.fbx out.glb [--metres 0.01] [--decimate 0.5] [--blender <path>]
348
+ npx -y @displayxr/inline3d-tools@0.1.7 assets prep in.fbx out.glb [--metres 0.01] [--decimate 0.5] [--blender <path>]
341
349
  ```
342
350
 
343
351
  It looks for Blender (`--blender`, `$BLENDER`, `PATH`, the default install location), never installs
@@ -354,8 +362,8 @@ helmet is ~0.3 m, not 2 m).
354
362
  ### 3. Check it (before the page uses it)
355
363
 
356
364
  ```sh
357
- npx -y @displayxr/inline3d-tools@0.1.5 assets out.glb # tablet budget (default)
358
- npx -y @displayxr/inline3d-tools@0.1.5 assets out.glb --target desktop
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
359
367
  ```
360
368
 
361
369
  It reports: missing external files, decoders the page must provide, triangles (both eyes draw
@@ -369,7 +377,7 @@ animations. Fix every FAIL; act on WARNs or say why not. Then run the page check
369
377
  ### 4. Generate it (optional, paid, the user's keys)
370
378
 
371
379
  ```sh
372
- npx -y @displayxr/inline3d-tools@0.1.5 gen providers # which adapters have a key (names only)
380
+ npx -y @displayxr/inline3d-tools@0.1.7 gen providers # which adapters have a key (names only)
373
381
  ```
374
382
 
375
383
  Adapters: `meshy` and `tripo` (text-to-3d, image-to-3d → GLB), `openai` (image → PNG, for
@@ -390,7 +398,7 @@ textures, posters and backdrops). Each reads its key from the environment (`MESH
390
398
  shippable.
391
399
 
392
400
  ```sh
393
- npx -y @displayxr/inline3d-tools@0.1.5 gen run meshy --kind text-to-3d --prompt "a brass desk lamp, PBR" --out assets/lamp-raw.glb --confirm-paid
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
394
402
  ```
395
403
 
396
404
  ### 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.5 <command> ...
12
+ npx -y @displayxr/inline3d-tools@0.1.7 <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.5 mcp
50
+ claude mcp add inline3d-tools -- npx -y @displayxr/inline3d-tools@0.1.7 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.5", "mcp"]
60
+ "args": ["-y", "@displayxr/inline3d-tools@0.1.7", "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.5", "mcp"]
80
+ args = ["-y", "@displayxr/inline3d-tools@0.1.7", "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.5 mcp`. The
88
+ or `codex mcp add inline3d-tools -- npx -y @displayxr/inline3d-tools@0.1.7 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.5 --version`.
92
+ **Fetch the package once before the first Codex session:** `npx -y @displayxr/inline3d-tools@0.1.7 --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.5", "mcp"]
112
+ "args": ["-y", "@displayxr/inline3d-tools@0.1.7", "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.5 check <url | dir | page.html> [--root <dir>] [--max-texture 4096] [--json] [--out report.json]
154
+ npx -y @displayxr/inline3d-tools@0.1.7 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.5",
3
+ "version": "0.1.7",
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": {
package/templates/app.js CHANGED
@@ -129,6 +129,7 @@ function onFrame(views, layer) {
129
129
  async function start() {
130
130
  const wall = await createInline3D();
131
131
  if (!wall.supported) return start2D('no inline 3D here');
132
+ viewInfo = wall.displayInfo || null; // last read on this origin, or null; refined below
132
133
  sizeBuffer(true); // size before registering (woven-canvas rule 4)
133
134
  const handle = wall.addScene(canvas, onFrame, {
134
135
  virtualDisplayHeight: VIRTUAL_DISPLAY_HEIGHT,
@@ -10,8 +10,8 @@
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.58.0/js/inline3d.js",
14
- "@displayxr/inline3d/three": "https://cdn.jsdelivr.net/npm/@displayxr/inline3d@1.58.0/js/inline3d-three.js"
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"
15
15
  } }
16
16
  </script>
17
17
  </head>
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "@displayxr/inline3d": "1.58.0",
12
+ "@displayxr/inline3d": "1.60.1",
13
13
  "three": "0.180.0"
14
14
  },
15
15
  "devDependencies": {