@fleox/agent3d 0.3.0 → 0.3.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.
Files changed (43) hide show
  1. package/README.md +10 -10
  2. package/changelog.json +11 -0
  3. package/dist/agent/agent3d.mjs +11 -11
  4. package/dist/agent/chunks/{depth-Dih8jLqx.mjs → depth-BZT4gseQ.mjs} +1 -1
  5. package/dist/agent/chunks/{depth-0bZsQn6N.mjs → depth-CD_ql3QJ.mjs} +1 -1
  6. package/dist/agent/chunks/{export-Cdqt3mt_.mjs → export-bJwh2SqG.mjs} +4 -2
  7. package/dist/agent/chunks/{package-d5e08XSG.mjs → package-fMbw9UGh.mjs} +1 -1
  8. package/dist/agent/chunks/{tools-Cv6N_YBI.mjs → tools-Cm4BqDkO.mjs} +4 -4
  9. package/dist/runtime/agent3d-runtime.js +2 -2
  10. package/dist/runtime/agent3d-runtime.single.js +75 -75
  11. package/dist/runtime/chunks/{photo-BlDYgYFM.js → photo-DNf14X7B.js} +9 -9
  12. package/dist/studio/assets/{assets-BFJsr9Oo.js → assets-BW5lQkYR.js} +1 -1
  13. package/dist/studio/assets/{camera-DT0xHipx.js → camera-BgzPVnn-.js} +1 -1
  14. package/dist/studio/assets/{editor-BjgHj9g8.js → editor-NkBUKsDB.js} +1 -1
  15. package/dist/studio/assets/{game-BXZEc9HN.js → game-DARpu0ah.js} +3 -3
  16. package/dist/studio/assets/{generators-DqkPMEzm.js → generators-BjIs-kHx.js} +1 -1
  17. package/dist/studio/assets/{index-DVTzVcBD.js → index-L-N-e2KM.js} +8 -8
  18. package/dist/studio/assets/{model-BqQW4Dg-.js → model-CqI8j03Z.js} +1 -1
  19. package/dist/studio/assets/{params-gVpEEiSK.js → params-DhsDKSDs.js} +1 -1
  20. package/dist/studio/assets/{photo-DRoVO5iZ.js → photo-DAHd1yNF.js} +9 -9
  21. package/dist/studio/assets/{physicsHost-DNdZ7AsT.js → physicsHost-tEUto2-_.js} +1 -1
  22. package/dist/studio/assets/{postfx-JFUGdY0d.js → postfx-BGu30OJK.js} +1 -1
  23. package/dist/studio/assets/{runtime-CMAP4azF.js → runtime-C_qkIpAK.js} +4 -4
  24. package/dist/studio/assets/{shaders-C7u6rN_6.js → shaders-Dt6FGXH_.js} +1 -1
  25. package/dist/studio/assets/{svg-DkIOJjzS.js → svg-ZZt5MdNf.js} +1 -1
  26. package/dist/studio/assets/{text-LISSAism.js → text-B-HM422i.js} +1 -1
  27. package/dist/studio/index.html +1 -1
  28. package/package.json +1 -1
  29. package/plugin/.claude-plugin/plugin.json +1 -1
  30. package/plugin/skills/agent3d-assets/SKILL.md +27 -27
  31. package/plugin/skills/agent3d-create/SKILL.md +28 -27
  32. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  33. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  34. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  35. package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
  36. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  37. package/plugin/skills/agent3d-publish/SKILL.md +21 -21
  38. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
  39. package/templates/hero-photo-3d/assets/depth/street-depth.png +0 -0
  40. package/templates/hero-photo-3d/assets/manifest.json +3 -3
  41. package/templates/hero-photo-3d/assets/textures/street.webp +0 -0
  42. package/templates/hero-photo-3d/scene.json +1 -1
  43. package/templates/hero-photo-3d/assets/textures/street.jpg +0 -0
package/README.md CHANGED
@@ -109,19 +109,19 @@ Once the scene exists, changing it is a conversation:
109
109
  ### Without an agent
110
110
 
111
111
  ```bash
112
- npx -y @fleox/agent3d@0.3.0 new bakery --target banner --title "Golden Crust"
113
- npx -y @fleox/agent3d@0.3.0 studio --project bakery
112
+ npx -y @fleox/agent3d@0.3.1 new bakery --target banner --title "Golden Crust"
113
+ npx -y @fleox/agent3d@0.3.1 studio --project bakery
114
114
  ```
115
115
 
116
- The first command creates a project folder with an attractive starter scene for its target (banner, hero, card, square, fullscreen, inline or game); add `--template <id>` to start from one of the [templates](#templates). The second opens the [Studio](#the-studio) on it. You need **Node.js 22+** and **Google Chrome** (or Chromium / Edge / Brave) for renders; `npx -y @fleox/agent3d@0.3.0 doctor` checks your setup with a test render.
116
+ The first command creates a project folder with an attractive starter scene for its target (banner, hero, card, square, fullscreen, inline or game); add `--template <id>` to start from one of the [templates](#templates). The second opens the [Studio](#the-studio) on it. You need **Node.js 22+** and **Google Chrome** (or Chromium / Edge / Brave) for renders; `npx -y @fleox/agent3d@0.3.1 doctor` checks your setup with a test render.
117
117
 
118
118
  The whole loop from a terminal:
119
119
 
120
120
  ```bash
121
- npx -y @fleox/agent3d@0.3.0 scene patch --project bakery '[{"op":"set","path":"objects#title.material","value":{"preset":"gold"}}]'
122
- npx -y @fleox/agent3d@0.3.0 render --project bakery --sheet # → renders/…-sheet.png
123
- npx -y @fleox/agent3d@0.3.0 check --project bakery
124
- npx -y @fleox/agent3d@0.3.0 export --project bakery # → dist/embed/ + the snippet
121
+ npx -y @fleox/agent3d@0.3.1 scene patch --project bakery '[{"op":"set","path":"objects#title.material","value":{"preset":"gold"}}]'
122
+ npx -y @fleox/agent3d@0.3.1 render --project bakery --sheet # → renders/…-sheet.png
123
+ npx -y @fleox/agent3d@0.3.1 check --project bakery
124
+ npx -y @fleox/agent3d@0.3.1 export --project bakery # → dist/embed/ + the snippet
125
125
  ```
126
126
 
127
127
  Step by step: [docs/getting-started.md](https://github.com/fleox/agent3d/blob/main/docs/getting-started.md).
@@ -194,7 +194,7 @@ Step by step: [docs/getting-started.md](https://github.com/fleox/agent3d/blob/ma
194
194
  A visual editor for when you want to see and touch the scene yourself, on the same files and the same validated tools as the agent. Changes your agent makes in a terminal appear live in the open Studio.
195
195
 
196
196
  ```bash
197
- npx -y @fleox/agent3d@0.3.0 studio --project bakery
197
+ npx -y @fleox/agent3d@0.3.1 studio --project bakery
198
198
  ```
199
199
 
200
200
  <p align="center">
@@ -323,7 +323,7 @@ Pick Spline when a designer wants a hosted visual tool, hand-written Three.js wh
323
323
 
324
324
  ## The `agent3d` CLI
325
325
 
326
- The same engine the agents use, by hand: `npx -y @fleox/agent3d@0.3.0 help`. Every command accepts `--json` and prints exactly one `{ ok, data }` or `{ ok: false, error }` object with an actionable hint, and commands that replace or overwrite something print a plan until you add `--yes`.
326
+ The same engine the agents use, by hand: `npx -y @fleox/agent3d@0.3.1 help`. Every command accepts `--json` and prints exactly one `{ ok, data }` or `{ ok: false, error }` object with an actionable hint, and commands that replace or overwrite something print a plan until you add `--yes`.
327
327
 
328
328
  <p align="center">
329
329
  <img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/demo-cli.gif" width="820" alt="Terminal running the agent3d CLI: a project from the gradient-blob template, its scene summary, a gold torus added, a behaviour patch rejected with an actionable error then fixed, and the pre-export check">
@@ -361,7 +361,7 @@ Full reference: [docs/cli.md](https://github.com/fleox/agent3d/blob/main/docs/cl
361
361
  ## MCP server
362
362
 
363
363
  ```bash
364
- claude mcp add agent3d -- npx -y @fleox/agent3d@0.3.0 mcp --project ~/agent3d/my-banner
364
+ claude mcp add agent3d -- npx -y @fleox/agent3d@0.3.1 mcp --project ~/agent3d/my-banner
365
365
  ```
366
366
 
367
367
  <p align="center">
package/changelog.json CHANGED
@@ -1,5 +1,16 @@
1
1
  {
2
2
  "versions": [
3
+ {
4
+ "version": "0.3.1",
5
+ "date": "2026-11-26",
6
+ "breaking": false,
7
+ "changes": [
8
+ "3D photos load faster: `assets depth` writes the depth map at 1024 px by default (the model works at 518 px; the template's map went from 185 KB to 80 KB at the same look), and the `hero-photo-3d` template ships its photo as WebP (552 KB → 330 KB). Skills recommend `assets optimize --all` before exporting a photo hero.",
9
+ "Parallax photos spend fewer shader steps on weak devices (quality tiers) and with gentle depth.",
10
+ "Exports: heroes and full-screen scenes give their poster `fetchpriority=\"high\"` (it is usually the page's largest image)."
11
+ ],
12
+ "actions": []
13
+ },
3
14
  {
4
15
  "version": "0.3.0",
5
16
  "date": "2026-11-26",
@@ -6,7 +6,7 @@ __a3dRequire(import.meta.url);
6
6
  const __filename = __a3dPath(import.meta.url);
7
7
  __a3dDirname(__filename);
8
8
  import { t as __exportAll } from "./chunks/rolldown-runtime-ebOQtxsr.mjs";
9
- import { r as version, t as package_default } from "./chunks/package-d5e08XSG.mjs";
9
+ import { r as version, t as package_default } from "./chunks/package-fMbw9UGh.mjs";
10
10
  import { n as didYouMean, r as listOptions, t as closest } from "./chunks/suggest-Cpcgv1RP.mjs";
11
11
  import { format, parseArgs } from "node:util";
12
12
  import { createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
@@ -8295,8 +8295,8 @@ var assetsCommand = {
8295
8295
  },
8296
8296
  {
8297
8297
  name: "depth",
8298
- usage: "assets depth <image> [--out assets/depth/<name>-depth.png] [--size 518] [--max-size 2048]",
8299
- summary: "Estimate a depth map for a photo of the project (or \"library:<id>\") with Depth Anything V2 Small, run locally in headless Chrome (onnxruntime-web, WASM). Writes a grey PNG (white = near, transparent on depth jumps) at the photo size (capped by --max-size, default 2048) to use as a photo object's `depth`, registered in assets/manifest.json with the photo's licence. The model (27 MB, Apache-2.0) is downloaded once into ~/.agent3d/models (AGENT3D_MODELS overrides); later runs work offline. --size is the model input long side (default 518, up to 1036 for finer edges, slower).",
8298
+ usage: "assets depth <image> [--out assets/depth/<name>-depth.png] [--size 518] [--max-size 1024]",
8299
+ summary: "Estimate a depth map for a photo of the project (or \"library:<id>\") with Depth Anything V2 Small, run locally in headless Chrome (onnxruntime-web, WASM). Writes a grey PNG (white = near, transparent on depth jumps) at the photo size (capped by --max-size, default 1024) to use as a photo object's `depth`, registered in assets/manifest.json with the photo's licence. The model (27 MB, Apache-2.0) is downloaded once into ~/.agent3d/models (AGENT3D_MODELS overrides); later runs work offline. --size is the model input long side (default 518, up to 1036 for finer edges, slower).",
8300
8300
  writes: true
8301
8301
  },
8302
8302
  {
@@ -8368,7 +8368,7 @@ var assetsCommand = {
8368
8368
  {
8369
8369
  name: "max-size",
8370
8370
  type: "string",
8371
- description: "optimize / add --hit: longest texture side in pixels, for every texture (optimize default: a smart size per texture from the scene; never upscales). depth: longest side of the depth map (default 2048)."
8371
+ description: "optimize / add --hit: longest texture side in pixels, for every texture (optimize default: a smart size per texture from the scene; never upscales). depth: longest side of the depth map (default 1024)."
8372
8372
  },
8373
8373
  {
8374
8374
  name: "quality",
@@ -8636,7 +8636,7 @@ var assetsCommand = {
8636
8636
  }
8637
8637
  if (action === "depth") {
8638
8638
  const image = positional(rest, 0, "image (project path or library:<id>)", "assets depth assets/textures/photo.jpg");
8639
- const { checkDepthRequest, estimateDepth } = await import("./chunks/depth-Dih8jLqx.mjs").then((n) => n.r);
8639
+ const { checkDepthRequest, estimateDepth } = await import("./chunks/depth-BZT4gseQ.mjs").then((n) => n.r);
8640
8640
  const { deflateSync } = await import("node:zlib");
8641
8641
  const req = {
8642
8642
  image: image.replace(/^\.\//, ""),
@@ -8648,7 +8648,7 @@ var assetsCommand = {
8648
8648
  };
8649
8649
  if (req.maxSize !== void 0 && !(req.maxSize >= 16 && req.maxSize <= 8192)) usage(`--max-size must be between 16 and 8192, got ${req.maxSize}.`, "e.g. --max-size 1024 (default 2048).");
8650
8650
  await checkDepthRequest(fs, req);
8651
- const { withDepthEstimator } = await import("./chunks/depth-0bZsQn6N.mjs");
8651
+ const { withDepthEstimator } = await import("./chunks/depth-CD_ql3QJ.mjs");
8652
8652
  const r = await withDepthEstimator((estimator) => estimateDepth(fs, req, estimator), { log: log$1 });
8653
8653
  return printResult(io, {
8654
8654
  ...r,
@@ -9650,8 +9650,8 @@ var exportCommand = {
9650
9650
  warnings.push(`No poster: ${err.message}${err.hint ? ` (${err.hint})` : ""} — the export works without it (no image before load / without WebGL).`);
9651
9651
  }
9652
9652
  const runtime = { files: readRuntimeFiles(format) };
9653
- const { buildExport } = await import("./chunks/export-Cdqt3mt_.mjs").then((n) => n.n);
9654
- const { version } = (await import("./chunks/package-d5e08XSG.mjs").then((n) => n.n)).default;
9653
+ const { buildExport } = await import("./chunks/export-bJwh2SqG.mjs").then((n) => n.n);
9654
+ const { version } = (await import("./chunks/package-fMbw9UGh.mjs").then((n) => n.n)).default;
9655
9655
  let exportFs = fs;
9656
9656
  let exportLibrary = libraryProvider();
9657
9657
  let optimizeReport;
@@ -10417,7 +10417,7 @@ function nodeHost(fs) {
10417
10417
  return withImageCodec(fn, { log: (m) => void process.stderr.write(`${m}\n`) });
10418
10418
  },
10419
10419
  async withDepthEstimator(fn) {
10420
- const { withDepthEstimator } = await import("./chunks/depth-0bZsQn6N.mjs");
10420
+ const { withDepthEstimator } = await import("./chunks/depth-CD_ql3QJ.mjs");
10421
10421
  return withDepthEstimator(fn, { log: (m) => void process.stderr.write(`${m}\n`) });
10422
10422
  },
10423
10423
  deflate: (data) => new Uint8Array(deflateSync(data)),
@@ -10432,7 +10432,7 @@ function toolContext(fs) {
10432
10432
  };
10433
10433
  }
10434
10434
  async function listTools(opts = {}) {
10435
- const { listAiTools } = await import("./chunks/tools-Cv6N_YBI.mjs");
10435
+ const { listAiTools } = await import("./chunks/tools-Cm4BqDkO.mjs");
10436
10436
  const host = nodeHost(null);
10437
10437
  return listAiTools(opts.render === false ? host : {
10438
10438
  ...host,
@@ -10445,7 +10445,7 @@ async function listTools(opts = {}) {
10445
10445
  }));
10446
10446
  }
10447
10447
  async function callTool(fs, name, input) {
10448
- const { callAiTool } = await import("./chunks/tools-Cv6N_YBI.mjs");
10448
+ const { callAiTool } = await import("./chunks/tools-Cm4BqDkO.mjs");
10449
10449
  return callAiTool(toolContext(fs), name, input);
10450
10450
  }
10451
10451
  function previewImages(name, result, root = ".") {
@@ -431,7 +431,7 @@ async function estimateDepth(fs, opts, estimator) {
431
431
  if (r.depth.length !== r.width * r.height) throw new OpsError("io", `The depth estimator returned ${r.depth.length} values for ${r.width}x${r.height}.`);
432
432
  const srcW = r.srcWidth || header.width;
433
433
  const srcH = r.srcHeight || header.height;
434
- const k = Math.min(opts.maxSize ?? 2048, Math.max(srcW, srcH)) / Math.max(srcW, srcH);
434
+ const k = Math.min(opts.maxSize ?? 1024, Math.max(srcW, srcH)) / Math.max(srcW, srcH);
435
435
  const map = postprocessDepth(r.depth, r.width, r.height, {
436
436
  width: Math.max(1, Math.round(srcW * k)),
437
437
  height: Math.max(1, Math.round(srcH * k)),
@@ -4,7 +4,7 @@ import { dirname as __a3dDirname, dirname, join, resolve } from "node:path";
4
4
  __a3dRequire(import.meta.url);
5
5
  const __filename = __a3dPath(import.meta.url);
6
6
  __a3dDirname(__filename);
7
- import { i as ensureDepthModel, t as DEPTH_MODEL } from "./depth-Dih8jLqx.mjs";
7
+ import { i as ensureDepthModel, t as DEPTH_MODEL } from "./depth-BZT4gseQ.mjs";
8
8
  import { H as CliError, L as ORT_FILES, r as startLocalServer, t as mimeOf, z as ortDir } from "../agent3d.mjs";
9
9
  import { launchBrowser, requireBrowser } from "./browser-Dil7VM5m.mjs";
10
10
  import { t as CdpClient } from "./cdp-DLEis_Z3.mjs";
@@ -703,7 +703,8 @@ function resolveRel(dir, rel) {
703
703
  }
704
704
  function posterMarkup(p) {
705
705
  const dims = p.size ? ` width="${Math.round(p.size.width)}" height="${Math.round(p.size.height)}"` : "";
706
- const img = (slot) => `<img${slot ? " slot=\"poster\"" : ""} src="${escapeHtml(p.src)}" alt="${escapeHtml(p.alt)}"${dims} decoding="async" style="display:block;width:100%;height:auto">`;
706
+ const prio = p.priority ? " fetchpriority=\"high\"" : "";
707
+ const img = (slot) => `<img${slot ? " slot=\"poster\"" : ""} src="${escapeHtml(p.src)}" alt="${escapeHtml(p.alt)}"${dims}${prio} decoding="async" style="display:block;width:100%;height:auto">`;
707
708
  if (!p.avif) return img(true);
708
709
  return `<picture slot="poster"><source type="image/avif" srcset="${escapeHtml(p.avif)}">${img(false)}</picture>`;
709
710
  }
@@ -899,7 +900,8 @@ async function buildExport(fs, opts) {
899
900
  src: url(posterRel) + posterQ,
900
901
  avif: opts.posterAvif ? url(`${name}/poster.avif`) + posterQ : void 0,
901
902
  alt: label,
902
- size: opts.posterSize
903
+ size: opts.posterSize,
904
+ priority: kind === "hero" || kind === "fullscreen"
903
905
  }) : "";
904
906
  snippet = [
905
907
  ...preloads,
@@ -8,7 +8,7 @@ import { t as __exportAll } from "./rolldown-runtime-ebOQtxsr.mjs";
8
8
  // package.json
9
9
  var package_exports = /* @__PURE__ */ __exportAll({ default: () => package_default });
10
10
  var name = "@fleox/agent3d";
11
- var version = "0.3.0";
11
+ var version = "0.3.1";
12
12
  var package_default = {
13
13
  name,
14
14
  version,
@@ -8,8 +8,8 @@ import { A as OpsError, C as CATALOG, _ as validateScene, a as listTemplates, d
8
8
  import { t as closest } from "./suggest-Cpcgv1RP.mjs";
9
9
  import { a as listAssets, f as optimizedExportSources, i as importAssetZip, l as searchAssetsDetailed, o as listLibrary, p as SOURCE_IDS, r as downloadAsset, s as parseResolution, t as addAsset, u as optimizeAssets } from "./assets-YBkgdfgy.mjs";
10
10
  import { r as modelFileBounds } from "./gltf-f_f0-OiV.mjs";
11
- import { a as estimateDepth, n as checkDepthRequest } from "./depth-Dih8jLqx.mjs";
12
- import { r as prefixFiles, t as buildExport } from "./export-Cdqt3mt_.mjs";
11
+ import { a as estimateDepth, n as checkDepthRequest } from "./depth-BZT4gseQ.mjs";
12
+ import { r as prefixFiles, t as buildExport } from "./export-bJwh2SqG.mjs";
13
13
  import { i as getAt, t as PathError } from "./jsonPath-DUCe1JpS.mjs";
14
14
  import { n as checkProject } from "./check-DP9fRYbK.mjs";
15
15
  import { a as updateObject, i as removeObject, n as listObjects, t as addObject } from "./objects-DuytRxiC.mjs";
@@ -1021,7 +1021,7 @@ var ASSET_TOOLS = [
1021
1021
  },
1022
1022
  {
1023
1023
  name: "image_depth",
1024
- description: "Estimate a depth map for a photo (the \"3D photo\" effect: a photo object with `depth`). Runs Depth Anything V2 Small locally (CLI / MCP host: headless Chrome, ~1-3 s per image; the 27 MB Apache-2.0 model is downloaded once into the user cache, later runs work offline). Writes a grey PNG (white = near, transparent where depth jumps) at the photo size (max 2048 px) under assets/depth/, registered in assets/manifest.json with the photo's licence. Returns { path, width, height, ms, model, suggestion: { kind: \"photo\", src, depth } } — then add or update the photo object with `depth: path`. Without a host that can run it, paint a depth map by hand instead.",
1024
+ description: "Estimate a depth map for a photo (the \"3D photo\" effect: a photo object with `depth`). Runs Depth Anything V2 Small locally (CLI / MCP host: headless Chrome, ~1-3 s per image; the 27 MB Apache-2.0 model is downloaded once into the user cache, later runs work offline). Writes a grey PNG (white = near, transparent where depth jumps) at the photo size (max 1024 px) under assets/depth/, registered in assets/manifest.json with the photo's licence. Returns { path, width, height, ms, model, suggestion: { kind: \"photo\", src, depth } } — then add or update the photo object with `depth: path`. Without a host that can run it, paint a depth map by hand instead.",
1025
1025
  inputSchema: {
1026
1026
  type: "object",
1027
1027
  properties: {
@@ -1043,7 +1043,7 @@ var ASSET_TOOLS = [
1043
1043
  type: "integer",
1044
1044
  minimum: 16,
1045
1045
  maximum: 8192,
1046
- description: "Longest side of the written depth map (default: the photo size, capped at 2048)."
1046
+ description: "Longest side of the written depth map (default: the photo size, capped at 1024)."
1047
1047
  }
1048
1048
  },
1049
1049
  required: ["image"]