@fleox/agent3d 0.3.0 → 0.4.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 (72) hide show
  1. package/README.md +11 -11
  2. package/changelog.json +21 -0
  3. package/dist/agent/agent3d.mjs +36 -18
  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-CEX5DFLo.mjs} +83 -5
  7. package/dist/agent/chunks/{package-d5e08XSG.mjs → package-DjRnLzcU.mjs} +2 -2
  8. package/dist/agent/chunks/{tools-Cv6N_YBI.mjs → tools-CZyIc4zw.mjs} +16 -6
  9. package/dist/runtime/agent3d-photo.js +31 -0
  10. package/dist/runtime/agent3d-runtime.js +41 -41
  11. package/dist/runtime/agent3d-runtime.single.js +252 -247
  12. package/dist/runtime/chunks/assets-kC2Z1Xy_.js +1 -0
  13. package/dist/runtime/chunks/game-CbQaEB4q.js +20 -0
  14. package/dist/runtime/chunks/materials-jwhXlLYl.js +107 -0
  15. package/dist/runtime/chunks/model-CG5T_jcB.js +1 -0
  16. package/dist/runtime/chunks/num-CQNAlL82.js +1 -0
  17. package/dist/runtime/chunks/{photo-BlDYgYFM.js → photo-w6dwHX7j.js} +27 -22
  18. package/dist/runtime/chunks/physicsHost-BU-2V-CZ.js +1 -0
  19. package/dist/runtime/chunks/{postfx-Cbf_vvOr.js → postfx-DnIeKXAh.js} +1 -1
  20. package/dist/runtime/chunks/postfx-ylpcQcVK.js +1 -0
  21. package/dist/runtime/chunks/svg-fYjsY-rV.js +1 -0
  22. package/dist/runtime/chunks/{text-rSo_2Luk.js → text-CySfj5sH.js} +1 -1
  23. package/dist/runtime/chunks/util-BEflQURG.js +1 -0
  24. package/dist/studio/assets/assets--ehPZf8R.js +1 -0
  25. package/dist/studio/assets/camera-C0sxfRxy.js +2 -0
  26. package/dist/studio/assets/{editor-BjgHj9g8.js → editor-DzyukvQl.js} +1 -1
  27. package/dist/studio/assets/game-DNpTN_Ga.js +19 -0
  28. package/dist/studio/assets/{generators-DqkPMEzm.js → generators-BuVeRXnC.js} +5 -5
  29. package/dist/studio/assets/index-C2nMYSoW.js +479 -0
  30. package/dist/studio/assets/model-DQgOrTs4.js +2 -0
  31. package/dist/studio/assets/num-CQNAlL82.js +1 -0
  32. package/dist/studio/assets/{params-gVpEEiSK.js → params-D-Ul6GSt.js} +1 -1
  33. package/dist/studio/assets/{photo-DRoVO5iZ.js → photo-Dx2IBJ11.js} +27 -22
  34. package/dist/studio/assets/physicsHost-z9qn_mpg.js +1 -0
  35. package/dist/studio/assets/{postfx-JFUGdY0d.js → postfx-B3jDEaEK.js} +13 -13
  36. package/dist/studio/assets/runtime-rd9RW3WH.js +572 -0
  37. package/dist/studio/assets/{shaders-C7u6rN_6.js → shaders-bFhELLmD.js} +1 -1
  38. package/dist/studio/assets/svg-BkV9LeqP.js +2 -0
  39. package/dist/studio/assets/{text-LISSAism.js → text-Dp8gdjSA.js} +1 -1
  40. package/dist/studio/index.html +1 -1
  41. package/package.json +2 -2
  42. package/plugin/.claude-plugin/plugin.json +1 -1
  43. package/plugin/skills/agent3d-assets/SKILL.md +27 -27
  44. package/plugin/skills/agent3d-create/SKILL.md +28 -27
  45. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  46. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  47. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  48. package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
  49. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  50. package/plugin/skills/agent3d-publish/SKILL.md +24 -22
  51. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
  52. package/templates/hero-photo-3d/assets/depth/street-depth.png +0 -0
  53. package/templates/hero-photo-3d/assets/manifest.json +3 -3
  54. package/templates/hero-photo-3d/assets/textures/street.webp +0 -0
  55. package/templates/hero-photo-3d/scene.json +1 -1
  56. package/dist/runtime/chunks/assets-qnxDnVkj.js +0 -1
  57. package/dist/runtime/chunks/game-BoEiyZrL.js +0 -20
  58. package/dist/runtime/chunks/materials-dC4vDNHh.js +0 -107
  59. package/dist/runtime/chunks/model-BCAl_NRl.js +0 -1
  60. package/dist/runtime/chunks/physicsHost-ChPgysMQ.js +0 -1
  61. package/dist/runtime/chunks/postfx-CFucYRev.js +0 -1
  62. package/dist/runtime/chunks/svg-CLUxY6Zy.js +0 -1
  63. package/dist/runtime/chunks/util-CyaW1fcW.js +0 -1
  64. package/dist/studio/assets/assets-BFJsr9Oo.js +0 -1
  65. package/dist/studio/assets/camera-DT0xHipx.js +0 -2
  66. package/dist/studio/assets/game-BXZEc9HN.js +0 -19
  67. package/dist/studio/assets/index-DVTzVcBD.js +0 -479
  68. package/dist/studio/assets/model-BqQW4Dg-.js +0 -2
  69. package/dist/studio/assets/physicsHost-DNdZ7AsT.js +0 -1
  70. package/dist/studio/assets/runtime-CMAP4azF.js +0 -572
  71. package/dist/studio/assets/svg-DkIOJjzS.js +0 -2
  72. package/templates/hero-photo-3d/assets/textures/street.jpg +0 -0
@@ -1,4 +1,4 @@
1
- import{In as e,Ln as t,on as n,x as r}from"./three.module-CnI50X0U.js";import{r as i}from"./params-gVpEEiSK.js";import{n as a,r as o}from"./runtime-CMAP4azF.js";var s=`
1
+ import{In as e,Ln as t,on as n,x as r}from"./three.module-CnI50X0U.js";import{r as i}from"./params-D-Ul6GSt.js";import{n as a,r as o}from"./runtime-rd9RW3WH.js";var s=`
2
2
  varying vec2 vUv;
3
3
  varying vec3 vPos;
4
4
  varying vec3 vNormalV;
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SVGLoader-CIYl0nEy.js","./three.module-CnI50X0U.js","./BufferGeometryUtils-CAlXAboW.js"])))=>i.map(i=>d[i]);
2
+ import{I as e,In as t,P as n,U as r,h as i,ln as a,m as o,rn as s,u as c,x as l,xt as u}from"./three.module-CnI50X0U.js";import{n as d}from"./assets--ehPZf8R.js";import{r as f}from"./num-CQNAlL82.js";import{i as p,n as m,r as h,t as g}from"./extrude-9bG8hr2C.js";import{a as _,s as v}from"./runtime-rd9RW3WH.js";import{h as y}from"./index-C2nMYSoW.js";var b=e=>!!e&&e!==`none`&&e!==`transparent`;function x(e,t,n){if(e===`currentColor`)return n;let r=/^url\(\s*['"]?#([^'")]+)['"]?\s*\)/.exec(e);if(r){let e=t.userData?.gradients?.[r[1]]?.stops??[];if(!e.length)return n;let i=new l(e[0].color),a=new l(e[e.length-1].color);return`#${i.lerp(a,.5).getHexString()}`}try{let t=new l;return t.setStyle(e,s),`#${t.getHexString(s)}`}catch{return n}}function S(e,t){let n=new c;for(let t of e.paths)for(let e of t.subPaths)for(let t of e.getPoints(4))n.expandByPoint(t);return(n.isEmpty()?100:Math.max(n.max.x-n.min.x,n.max.y-n.min.y,1e-6))/(t*10)}function C(e,t,n={}){let r=[],i=Math.max(1,Math.round(f(n.curveSegments,12))),a=S(e,i),o=n.currentColor??`#1f2330`;for(let s of e.paths){let e=s.userData?.style??{};if(e.visibility===`hidden`||e.visibility===`collapse`)continue;let c=f(e.opacity,1);if(b(e.fill)){let t=s.toShapes().map(e=>h(e,a));t.length&&r.push({kind:`fill`,color:x(e.fill,s,o),opacity:f(e.fillOpacity,1)*c,shapes:t})}if(n.strokes!==!1&&b(e.stroke)&&f(e.strokeWidth,1)>0){let n=t.getStrokeStyle(f(e.strokeWidth,1),`#000`,e.strokeLineJoin??`miter`,e.strokeLineCap??`butt`,f(e.strokeMiterLimit,4)),l=[];for(let e of s.subPaths){let r=m(e,a);if(r.length<2)continue;let o=t.pointsToStroke(r,n,i);o&&l.push(o)}if(l.length){let t=l.length===1?l[0]:w(l);r.push({kind:`stroke`,color:x(e.stroke,s,o),opacity:f(e.strokeOpacity,1)*c,stroke:t})}}}return r}function w(e){let t=0;for(let n of e)t+=n.getAttribute(`position`).count;let n=new Float32Array(t*3),r=0;for(let t of e){let e=t.getAttribute(`position`).array;n.set(e,r),r+=e.length,t.dispose()}let a=new i;return a.setAttribute(`position`,new o(n,3)),a}function T(e,n=12){let r=new c;for(let i of e){if(i.shapes)for(let e of i.shapes)for(let t of e.getPoints(n))r.expandByPoint(t);if(i.stroke){let e=i.stroke.getAttribute(`position`);for(let n=0;n<e.count;n++)r.expandByPoint(new t(e.getX(n),e.getY(n)))}}return r}function E(e,t,r,i,o){if(e.kind===`stroke`)return e.stroke?g(e.stroke,t):null;if(!e.shapes?.length)return null;if(t<=0)return new a(e.shapes,i);let s=Math.min(r,t*.45),c=new n(e.shapes,{depth:Math.max(t-s*2,t*.05),curveSegments:i,bevelEnabled:s>0,bevelThickness:s,bevelSize:s*.6,bevelOffset:0,bevelSegments:3});return c.translate(0,0,s),c.clearGroups(),p(c,50*Math.PI/180,o)}async function D(t,n){let[{SVGLoader:i},a]=await Promise.all([y(()=>import(`./SVGLoader-CIYl0nEy.js`),__vite__mapDeps([0,1]),import.meta.url),y(()=>import(`./BufferGeometryUtils-CAlXAboW.js`).then(e=>e.t),__vite__mapDeps([2,1]),import.meta.url)]),o=t.src.trim().startsWith(`<`)?t.src:await d(n.resolveAsset(t.src)),s=new i().parse(o),c=t.material?v(t.material):void 0,l=typeof c?.color==`string`?c.color:void 0,p=Math.max(1,Math.round(f(t.curveSegments,12))),m=C(s,i,{strokes:t.strokes,curveSegments:p,currentColor:l}),h=new r,g=T(m,p);if(!m.length||g.isEmpty())return h;let b=f(t.size,2),x=Math.max(g.max.x-g.min.x,1e-6),S=Math.max(g.max.y-g.min.y,1e-6),w=t.fit??`width`,D=b/(w===`height`?S:w===`max`?Math.max(x,S):x),O=Math.max(0,f(t.depth,.2)),k=O/D,A=f(t.bevel,0)/D,j=f(t.layerGap,O>0?O*.02:b*.002),M=t.keepColors??!t.material,N=new Map,P=async(e,r)=>{let i=M?`${e}|${r}`:`|${r}`,a=N.get(i);if(!a){let o=M?{roughness:.4,metalness:.1,...t.material??{},color:e,...r<1?{opacity:r}:{}}:t.material?{...t.material,...r<1?{opacity:r}:{}}:{color:`#dddddd`,roughness:.4,metalness:.1};a=await _(o,n,{defaultColor:e}),r<1&&(a.transparent=!0),O<=0&&(a.side=2),N.set(i,a)}return a},F=[];for(let e of m){let t=E(e,k,A,p,a);if(!t)continue;t.getAttribute(`normal`)||t.computeVertexNormals();let n=M?`${e.color}|${e.opacity}`:`|${e.opacity}`,r=F[F.length-1];r&&r.key===n?r.geos.push(t):F.push({key:n,color:e.color,opacity:e.opacity,geos:[t]})}let I=new r;for(let[t,n]of F.entries()){for(let t of n.geos){for(let e of Object.keys(t.attributes))[`position`,`normal`,`uv`].includes(e)||t.deleteAttribute(e);t.getAttribute(`uv`)||t.setAttribute(`uv`,new e(new Float32Array(t.getAttribute(`position`).count*2),2))}let r=n.geos.length===1?n.geos[0]:a.mergeGeometries(n.geos.map(e=>e.index?e.toNonIndexed():e),!1)??n.geos[0],i=new u(r,await P(n.color,n.opacity));i.position.z=t*j/D,I.add(i)}let L=(g.min.x+g.max.x)/2,R=(g.min.y+g.max.y)/2;return I.scale.set(D,-D,D),I.position.set(-L*D,R*D,-(O+Math.max(0,F.length-1)*j)/2),h.add(I),h}export{D as buildSvg};
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FontLoader-Bzjx8mXt.js","./three.module-CnI50X0U.js","./BufferGeometryUtils-CAlXAboW.js"])))=>i.map(i=>d[i]);
2
- import{In as e,Lt as t,P as n,St as r,U as i,cn as a,h as o,ln as s,xt as c}from"./three.module-CnI50X0U.js";import{n as l}from"./assets-BFJsr9Oo.js";import{h as u,t as d}from"./index-DVTzVcBD.js";import{v as f}from"./camera-DT0xHipx.js";import{i as p,r as m}from"./extrude-9bG8hr2C.js";import{a as h}from"./runtime-CMAP4azF.js";var g=new Map;function _(e){let t=g.get(e);return t||(t=Promise.all([u(()=>import(`./FontLoader-Bzjx8mXt.js`),__vite__mapDeps([0,1]),import.meta.url),l(e)]).then(([e,t])=>new e.FontLoader().parse(t)),t.catch(()=>g.delete(e)),g.set(e,t)),t}var v=e=>{let t=e.normalize(`NFD`);return t.length>1?t[0]:e};function y(e,t,n){let r=e.kerning;if(!r)return 0;let i=r[t]?.[n];if(i!==void 0)return i;let a=v(t),o=v(n);return a===t&&o===n?0:r[a]?.[o]??0}function b(e,t){let n=t.em/e.resolution,r=f(t.letterSpacing,0),i=f(t.lineHeight,1.25)*t.em,a=t.kerning!==!1,o=t=>(e.glyphs[t]??e.glyphs[`?`])?.ha??e.resolution*.5,s=t=>{let i=[],s=0;return t.forEach((c,l)=>{l>0&&(s+=r+(a?y(e,t[l-1],c)*n:0)),i.push(s),s+=o(c)*n}),{xs:i,width:s}},c=[],l=typeof t.maxWidth==`number`&&t.maxWidth>0?t.maxWidth:1/0;for(let e of String(t.text??``).split(`
2
+ import{In as e,Lt as t,P as n,St as r,U as i,cn as a,h as o,ln as s,xt as c}from"./three.module-CnI50X0U.js";import{t as l}from"./assets--ehPZf8R.js";import{h as u,t as d}from"./index-C2nMYSoW.js";import{r as f}from"./num-CQNAlL82.js";import{i as p,r as m}from"./extrude-9bG8hr2C.js";import{a as h}from"./runtime-rd9RW3WH.js";var g=new Map;function _(e){let t=g.get(e);return t||(t=Promise.all([u(()=>import(`./FontLoader-Bzjx8mXt.js`),__vite__mapDeps([0,1]),import.meta.url),l(e)]).then(([e,t])=>new e.FontLoader().parse(t)),t.catch(()=>g.delete(e)),g.set(e,t)),t}var v=e=>{let t=e.normalize(`NFD`);return t.length>1?t[0]:e};function y(e,t,n){let r=e.kerning;if(!r)return 0;let i=r[t]?.[n];if(i!==void 0)return i;let a=v(t),o=v(n);return a===t&&o===n?0:r[a]?.[o]??0}function b(e,t){let n=t.em/e.resolution,r=f(t.letterSpacing,0),i=f(t.lineHeight,1.25)*t.em,a=t.kerning!==!1,o=t=>(e.glyphs[t]??e.glyphs[`?`])?.ha??e.resolution*.5,s=t=>{let i=[],s=0;return t.forEach((c,l)=>{l>0&&(s+=r+(a?y(e,t[l-1],c)*n:0)),i.push(s),s+=o(c)*n}),{xs:i,width:s}},c=[],l=typeof t.maxWidth==`number`&&t.maxWidth>0?t.maxWidth:1/0;for(let e of String(t.text??``).split(`
3
3
  `)){if(l===1/0){c.push(Array.from(e));continue}let t=e.split(/ +/),n=[];for(let e of t){let t=n.length?[...n,` `,...Array.from(e)]:Array.from(e);n.length&&s(t).width>l?(c.push(n),n=Array.from(e)):n=t}c.push(n)}let u=[],d=[],p=0;return c.forEach((e,n)=>{for(;e.length&&e[e.length-1]===` `;)e.pop();let{xs:r,width:a}=s(e);p=Math.max(p,a);let o=t.align===`left`?0:t.align===`right`?-a:-a/2;e.forEach((e,t)=>{e.trim()&&u.push({ch:e,x:r[t]+o,line:n})}),d.push({width:a,y:-n*i})}),{glyphs:u,lines:d,lineHeight:i,width:p}}function x(e){let t=e.data;if(t.capHeight&&t.resolution)return t.capHeight/t.resolution;let n=e.generateShapes(`H`,1);if(!n.length)return .72;let r=new s(n);r.computeBoundingBox();let i=r.boundingBox.max.y-r.boundingBox.min.y;return r.dispose(),i>0?i:.72}function S(e,t){let n=e.data,r=f(t.size,1),i=r/x(e),a=Math.max(0,f(t.depth,.2)),o=a>0?Math.max(0,Math.min(f(t.bevel,Math.min(a*.3,r*.035)),a*.45,r*.08)):0,s=Math.round(Math.max(2,Math.min(32,f(t.curveSegments,a>0?5+r*3:8+r*4)))),c=b(n,{text:t.text,em:i,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,align:t.align??`center`,maxWidth:t.maxWidth,kerning:t.kerning});return{size:r,em:i,depth:a,bevel:o,curveSegments:s,layout:c,offsetY:-(r+(c.lines.length?c.lines[c.lines.length-1].y:0))/2,frontZ:a/2,backZ:-a/2}}function C(e){let t=e.bevel;return{depth:Math.max(e.depth-t*2,1e-4),curveSegments:e.curveSegments,bevelEnabled:t>0,bevelThickness:t,bevelSize:t*.6,bevelOffset:0,bevelSegments:3}}function w(e,t,n){let r=n.em/(n.curveSegments*5);return e.generateShapes(t,n.em).map(e=>m(e,r,1,n.curveSegments))}function T(e,t,r,i){let a=w(e,t,r);if(!a.length)return null;if(r.depth<=0)return new s(a,r.curveSegments);let o=new n(a,C(r));return o.translate(0,0,r.backZ+r.bevel),o.clearGroups(),p(o,50*Math.PI/180,i)}function E(e,t){let n=e.outline;if(!n)return null;let r=n===!0?{}:n,i=Math.max(1e-4,f(r.width,t.size*.06)),a=t.depth>0?t.depth*.5:t.size*.01,o=t.frontZ-a;return{width:i,frontZ:o,backZ:o-Math.max(f(r.depth,t.depth>0?t.depth*.6:t.size*.01),1e-4),material:r.material,color:r.color??`#111111`}}function D(e){let t=0;for(let n=0,r=e.length-1;n<e.length;r=n++)t+=(e[r].x-e[n].x)*(e[r].y+e[n].y);return t/2}function O(t,n,r=2){let i=t.filter((e,n)=>{let r=t[(n+1)%t.length];return Math.hypot(r.x-e.x,r.y-e.y)>1e-9}),a=i.length,o=[];if(a<3)return i.map(t=>new e(t.x,t.y));let s=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.hypot(n,r)||1;return{x:r/i,y:-n/i}};for(let t=0;t<a;t++){let c=i[(t-1+a)%a],l=i[t],u=i[(t+1)%a],d=s(c,l),f=s(l,u),p=(l.x-c.x)*(u.y-l.y)-(l.y-c.y)*(u.x-l.x),m=d.x*f.x+d.y*f.y;if(p>0&&m<.995){let t=Math.atan2(d.y,d.x),r=Math.atan2(f.y,f.x);for(;r<t;)r+=Math.PI*2;for(;r>t+Math.PI*2;)r-=Math.PI*2;let i=Math.max(1,Math.ceil(Math.abs(r-t)/(Math.PI/8)));for(let a=0;a<=i;a++){let s=t+(r-t)*a/i;o.push(new e(l.x+Math.cos(s)*n,l.y+Math.sin(s)*n))}}else{let t=d.x+f.x,i=d.y+f.y,a=Math.hypot(t,i)||1;t/=a,i/=a;let s=Math.max(t*d.x+i*d.y,1/r);o.push(new e(l.x+t*n/s,l.y+i*n/s))}}return o}function k(e,n){let r=[];for(let i of e){let{shape:e,holes:o}=i.extractPoints(1),s=e.slice();D(s)<0&&(s=s.reverse());let c=new a(O(s,n));for(let e of o){let r=e.slice(),i=Math.abs(D(r));D(r)>0&&(r=r.reverse());let a=r.map(e=>e.x),o=r.map(e=>e.y);if(Math.max(...a)-Math.min(...a)<=2*n||Math.max(...o)-Math.min(...o)<=2*n)continue;let s=O(r,n),l=D(s);l<0&&-l>i*.02&&c.holes.push(new t(s))}r.push(c)}return r}function A(e,t,r,i,a){let o=w(e,t,r);if(!o.length)return null;let s=new n(k(o,i.width),{depth:i.frontZ-i.backZ,curveSegments:1,bevelEnabled:!1});return s.translate(0,0,i.backZ),s.clearGroups(),p(s,40*Math.PI/180,a)}function j(e,t,n){let r=new Map,i=[];for(let n of e.layout.glyphs){r.has(n.ch)||r.set(n.ch,t(n.ch));let a=r.get(n.ch);if(!a)continue;let o=a.clone();o.translate(n.x,e.layout.lines[n.line].y+e.offsetY,0),i.push(o)}for(let e of r.values())e?.dispose();let a;if(!i.length)a=new o;else{a=(i.length===1?i[0].clone():n.mergeGeometries(i,!1))??new o;for(let e of i)e.dispose()}return a.computeBoundingBox(),a.computeBoundingSphere(),a}function M(e,t,n){let r=f(e.stagger,.04),i=t;if(e.order===`reverse`)i=n-1-t;else if(e.order===`center`)i=Math.abs(t-(n-1)/2);else if(e.order===`random`){let e=(t+1)*2654435761;e=(e^e>>>13)>>>0,i=e%1e3/1e3*(n-1)}return f(e.delay,0)+i*r}function N(e,t){return(n,r)=>{let i=e.effect??`rise`,a=Math.max(f(e.duration,.6),.001),o=e.ease??(i===`scale`||i===`spin`?`outBack`:`outCubic`),s=i!==`scale`,c=[],l=[];if(s){let e=[];r.object.traverse(t=>{let n=t.material;if(n&&!t.userData.depthTwin){e.push(t);for(let e of Array.isArray(n)?n:[n])e.userData.baseOpacity===void 0&&(e.userData.baseOpacity=e.opacity),e.userData.baseTransparent===void 0&&(e.userData.baseTransparent=e.transparent),c.push(e)}});for(let t of e)l.push(F(t))}return{update(e){let n=Math.min(Math.max(e/a,0),1),u=d(o,n),f=r.object;if(s){let e=d(`outCubic`,Math.min(1,n*1.6));for(let t of c)t.opacity=t.userData.baseOpacity*e,t.transparent=e<1||t.userData.baseTransparent;for(let t of l)t.visible=e>0&&e<1}switch(n<=0&&(f.visible=!1),i){case`rise`:f.position.y-=(1-u)*t*.6;break;case`drop`:f.position.y+=(1-u)*t*1.2;break;case`scale`:f.scale.multiplyScalar(Math.max(1e-4,u));break;case`spin`:f.rotation.y+=(1-u)*Math.PI,f.scale.multiplyScalar(Math.max(1e-4,Math.min(1,n*2)))}}}}}var P=null;function F(e){P??=new r({colorWrite:!1,depthWrite:!0});let t=new c(e.geometry,P);return t.name=`${e.name}#depth`,t.visible=!1,t.castShadow=!1,t.receiveShadow=!1,t.renderOrder=-1,t.userData.helper=!0,t.userData.depthTwin=!0,e.add(t),t}function I(e,t){let n=e.font??`sans-bold`;return t.resolveAsset(n.includes(`/`)||n.includes(`:`)?n:`library:fonts/${n}`)}function L(e,t,n){let r=e.userData.gradient;r&&(r.uGradMin.value=t,r.uGradMax.value=n)}async function R(e,t){let[n,r]=await Promise.all([_(I(e,t)),u(()=>import(`./BufferGeometryUtils-CAlXAboW.js`).then(e=>e.t),__vite__mapDeps([2,1]),import.meta.url)]),a=S(n,e),o=E(e,a),s=!!e.splitLetters||!!e.reveal,l=a.depth<=0,d=()=>h(e.material,t,{defaultColor:`#ffffff`}),f=()=>o?h(o.material??{color:o.color,roughness:.55},t):null,p=(a.layout.lines.length?a.layout.lines[a.layout.lines.length-1].y:0)+a.offsetY,m=a.size+a.offsetY,g=e=>(l&&(e.side=2),e);if(!s){let t=j(a,e=>T(n,e,a,r),r),i=g(await d());L(i,p,m);let s=new c(t,i);if(o){let t=j(a,e=>A(n,e,a,o,r),r),i=await f();if(i){L(i,p,m);let n=new c(t,i);n.name=`${e.id}/outline`,s.add(n)}}return{object:s,letters:[]}}let v=new i,y=new Map,b=new Map,x=a.size/2,C=[],w=a.layout.glyphs.length,D=0;for(let t of a.layout.glyphs){if(!y.has(t.ch)){let e=T(n,t.ch,a,r),i=0;if(e&&(e.computeBoundingBox(),i=(e.boundingBox.min.x+e.boundingBox.max.x)/2,e.translate(-i,-x,0),e.computeBoundingSphere()),y.set(t.ch,e),o){let e=A(n,t.ch,a,o,r);e?.translate(-i,-x,0),b.set(t.ch,e)}e&&(e.userData.cx=i)}let i=y.get(t.ch);if(!i)continue;let s=i.userData.cx,l=a.layout.lines[t.line].y+a.offsetY,u=g(await d());L(u,p-l-x,m-l-x);let h=new c(i,u);h.position.set(t.x+s,l+x,0);let _=`${e.id}/${D}`;h.name=_,h.userData.a3dId=_;let S=b.get(t.ch);if(S){let e=await f();if(e){L(e,p-l-x,m-l-x);let t=new c(S,e);t.name=`${_}/outline`,h.add(t)}}v.add(h);let E={id:_,object:h,def:{id:_,kind:`text`,text:t.ch}};e.reveal&&(E.reveal={def:{type:`appear`,when:`visible`,delay:M(e.reveal,D,w)},impl:N(e.reveal,a.size)}),C.push(E),D++}return{object:v,letters:C}}export{R as buildText};
@@ -6,7 +6,7 @@
6
6
  <meta name="color-scheme" content="dark" />
7
7
  <title>Agent3D Studio</title>
8
8
  <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%232a2a30'/%3E%3Cstop offset='1' stop-color='%230c0c0f'/%3E%3C/linearGradient%3E%3ClinearGradient id='d' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%237aa5ff'/%3E%3Cstop offset='1' stop-color='%233d6bff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='32' height='32' rx='7.5' fill='url(%23g)'/%3E%3Cpath d='M16.00 8.00L23.45 12.30L23.45 20.90L16.00 25.20L8.55 20.90L8.55 12.30ZM12.62 14.65L8.55 12.30M19.38 14.65L23.45 12.30M16.00 20.50L16.00 25.20' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='16' cy='16.6' r='2.2' fill='url(%23d)'/%3E%3C/svg%3E" />
9
- <script type="module" crossorigin src="./assets/index-DVTzVcBD.js"></script>
9
+ <script type="module" crossorigin src="./assets/index-C2nMYSoW.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="./assets/three.module-CnI50X0U.js">
11
11
  <link rel="stylesheet" crossorigin href="./assets/index-BQT0otii.css">
12
12
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleox/agent3d",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "The 3D studio your AI agent can run: describe a scene as JSON (banners, characters, landscapes, mini games), preview and screenshot it headless, and export a self-contained embed for any website. No server, no account.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.agent.json",
27
27
  "test": "vitest run",
28
28
  "test:watch": "vitest",
29
- "build:runtime": "vite build --config vite.runtime.config.ts && vite build --config vite.runtime.config.ts --mode single",
29
+ "build:runtime": "vite build --config vite.runtime.config.ts && vite build --config vite.runtime.config.ts --mode single && vite build --config vite.runtime.config.ts --mode photo",
30
30
  "build:studio": "vite build",
31
31
  "build:agent": "vite build --config vite.agent.config.ts",
32
32
  "build": "npm run build:runtime && npm run build:studio && npm run build:agent && node scripts/write-version.mjs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent3d",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Skills to run Agent3D (the 3D studio your AI agent can run): create, edit, preview with headless screenshots the agent looks at, check and publish 3D elements for web pages — animated banners, heroes, product shots, characters, landscapes and mini games — exported as a self-contained Web Component for any site, with no server and no account.",
5
5
  "author": {
6
6
  "name": "fleox"
@@ -4,7 +4,7 @@ description: Find and add 3D assets to an Agent3D project - the built-in CC0 lib
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.3.0"
7
+ version: "0.4.0"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -13,7 +13,7 @@ allowed-tools: Bash Read Write
13
13
 
14
14
  **Language:** talk to the user in their language; keep commands, ids and files in English.
15
15
 
16
- Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
16
+ Every command is `npx -y @fleox/agent3d@0.4.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
17
17
 
18
18
  ## Pick the cheapest thing that looks right
19
19
 
@@ -25,16 +25,16 @@ Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` with `--project
25
25
  ## The built-in library
26
26
 
27
27
  ```bash
28
- npx -y @fleox/agent3d@0.3.0 assets library --query tree --json
29
- npx -y @fleox/agent3d@0.3.0 assets library --kind hdri --json
30
- npx -y @fleox/agent3d@0.3.0 assets library --query character --kind model --json
28
+ npx -y @fleox/agent3d@0.4.0 assets library --query tree --json
29
+ npx -y @fleox/agent3d@0.4.0 assets library --kind hdri --json
30
+ npx -y @fleox/agent3d@0.4.0 assets library --query character --kind model --json
31
31
  ```
32
32
 
33
33
  The answer lists the matches in `data.assets[]` (with `data.total` and `data.more`; `assets search` below names its list `data.hits[]` instead). Each entry has `ref` (use it as is in the scene), `description` (with the bounding box), `tags`, `license`, `kb`, and for models `triangles`, `size` (bounding box w × h × d in model units, Y-up) and `animations` (the clip names of animated models). Listings show 50 results per page: narrow with `--query` and `--kind`; when `more` is true, page with `--offset 50` (or `--limit 100`, `--all`).
34
34
 
35
35
  ```bash
36
- npx -y @fleox/agent3d@0.3.0 assets library --kind model --offset 50 --json
37
- npx -y @fleox/agent3d@0.3.0 assets library --kind model --all --json
36
+ npx -y @fleox/agent3d@0.4.0 assets library --kind model --offset 50 --json
37
+ npx -y @fleox/agent3d@0.4.0 assets library --kind model --all --json
38
38
  ```
39
39
 
40
40
  ```json
@@ -51,9 +51,9 @@ npx -y @fleox/agent3d@0.3.0 assets library --kind model --all --json
51
51
  ## Searching free sources (network)
52
52
 
53
53
  ```bash
54
- npx -y @fleox/agent3d@0.3.0 assets search "wood planks" --kind texture --project my-scene --json
55
- npx -y @fleox/agent3d@0.3.0 assets search sunset --kind hdri --source polyhaven --project my-scene --json
56
- npx -y @fleox/agent3d@0.3.0 assets search fox --source khronos --project my-scene --json
54
+ npx -y @fleox/agent3d@0.4.0 assets search "wood planks" --kind texture --project my-scene --json
55
+ npx -y @fleox/agent3d@0.4.0 assets search sunset --kind hdri --source polyhaven --project my-scene --json
56
+ npx -y @fleox/agent3d@0.4.0 assets search fox --source khronos --project my-scene --json
57
57
  ```
58
58
 
59
59
  The answer lists the matches in `data.hits[]`; each hit has `source`, `id`, `title`, `kind`, `license`, `author`, `attribution` (when the licence needs one), `previewUrl` (show it to the user or open it), `pageUrl`, `downloads` (resolutions / formats). Per-source failures come in `data.errors` without failing the search. Search terms match titles and tags: try synonyms ("planks", "wood floor") when a search is poor.
@@ -61,13 +61,13 @@ The answer lists the matches in `data.hits[]`; each hit has `source`, `id`, `tit
61
61
  Download one hit into the project (licence recorded in `assets/manifest.json`):
62
62
 
63
63
  ```bash
64
- npx -y @fleox/agent3d@0.3.0 assets add --hit @hit.json --resolution 1k --project my-scene --json
64
+ npx -y @fleox/agent3d@0.4.0 assets add --hit @hit.json --resolution 1k --project my-scene --json
65
65
  ```
66
66
 
67
67
  `@hit.json` is a file holding one hit object from the search (or pass the JSON inline). Models come back with `data.asset.bounds`: `size` (w × h × d in model units, node transforms applied), `center`, `min` / `max` and `upAxis` (`"y"`, or `"z?"` when the model is much deeper than tall — it may lie on its back; check it with `render --isolate <objectId>`, which renders that object alone from the front (+Z) on a neutral background). Local `.glb` / `.gltf` files added with `assets add <file>` return the same `bounds`. Textures from ambientCG / Poly Haven download the whole set (colour, normal, roughness, AO) and return `data.asset.suggestion.material`, a ready material to `set` on an object. Poly Haven models download as `.gltf` + `.bin` + textures in a folder: use the returned `path` as the model `src`. Keep `--resolution 1k` for the web (2k only for a hero close-up). Sources start at 1k: `--resolution 512` (or `256`) downloads 1k and downscales every texture to that size with headless Chrome (`data.asset.optimized`); `--max-size <px>` does the same for any resolution.
68
68
 
69
69
  ```bash
70
- npx -y @fleox/agent3d@0.3.0 assets add --hit @hit.json --resolution 512 --project my-banner --json
70
+ npx -y @fleox/agent3d@0.4.0 assets add --hit @hit.json --resolution 512 --project my-banner --json
71
71
  ```
72
72
 
73
73
  ## Kenney and Quaternius packs (manual zip)
@@ -75,7 +75,7 @@ npx -y @fleox/agent3d@0.3.0 assets add --hit @hit.json --resolution 512 --projec
75
75
  Their hits are `manual: true`: there is no direct download (the hit's `note` says so). Ask the user to download the pack zip from `pageUrl` (free, no account), then import it with `assets add <file.zip>` (the zip importer extracts only `.glb` / `.gltf` + textures; `--filter` keeps the models whose path contains the word, repeat it for several words; `--name` sets the folder under `assets/models/`):
76
76
 
77
77
  ```bash
78
- npx -y @fleox/agent3d@0.3.0 assets add ~/Downloads/kenney_platformer-kit.zip --source kenney --license CC0-1.0 --filter coin --filter flag --name platformer --project my-game --json
78
+ npx -y @fleox/agent3d@0.4.0 assets add ~/Downloads/kenney_platformer-kit.zip --source kenney --license CC0-1.0 --filter coin --filter flag --name platformer --project my-game --json
79
79
  ```
80
80
 
81
81
  The answer lists the imported model paths (`models`) to use as `src`, plus `totalKb`. Importing a whole pack can add megabytes: always filter to what the scene uses. (MCP clients: the `assets_add` tool takes `{ "file", "source", "license", "filter": [...] }`.)
@@ -83,9 +83,9 @@ The answer lists the imported model paths (`models`) to use as `src`, plus `tota
83
83
  ## The user's own files
84
84
 
85
85
  ```bash
86
- npx -y @fleox/agent3d@0.3.0 assets add ./logo.svg --license proprietary --project my-banner --json
87
- npx -y @fleox/agent3d@0.3.0 assets add ./bottle.glb --license proprietary --author "Acme" --project my-banner --json
88
- npx -y @fleox/agent3d@0.3.0 assets add ./jingle.mp3 --kind audio --license CC-BY-4.0 --author "Jane Doe" --source-url https://example.com/jingle --project my-game --json
86
+ npx -y @fleox/agent3d@0.4.0 assets add ./logo.svg --license proprietary --project my-banner --json
87
+ npx -y @fleox/agent3d@0.4.0 assets add ./bottle.glb --license proprietary --author "Acme" --project my-banner --json
88
+ npx -y @fleox/agent3d@0.4.0 assets add ./jingle.mp3 --kind audio --license CC-BY-4.0 --author "Jane Doe" --source-url https://example.com/jingle --project my-game --json
89
89
  ```
90
90
 
91
91
  `--license` is required (an SPDX id such as `CC0-1.0`, `CC-BY-4.0`, or `proprietary` for the user's own work). Files go to `assets/models/`, `assets/textures/`, `assets/hdri/`, `assets/audio/`, `assets/fonts/`, `assets/svg/` or `assets/other/` by kind, unless `--path` says otherwise. SVG logos become 3D with an `svg` object; product models with a `model` object and `fit`; audio with `audio.sounds` / `audio.music` (`{ "src": "assets/audio/jingle.mp3" }`).
@@ -103,11 +103,11 @@ Each path keeps its SVG colour (`keepColors`: default `true` without a `material
103
103
  When the user gives a photo and wants it to move in 3D (a "3D photo", parallax photo, "bring this picture to life"), the photo needs a **depth map**: a grey PNG, white = near, black = far, the same aspect as the photo. Estimate it locally:
104
104
 
105
105
  ```bash
106
- npx -y @fleox/agent3d@0.3.0 assets add ./street.jpg --license CC0-1.0 --author "Jane Doe" --project my-hero --json
107
- npx -y @fleox/agent3d@0.3.0 assets depth assets/textures/street.jpg --project my-hero --json
106
+ npx -y @fleox/agent3d@0.4.0 assets add ./street.jpg --license CC0-1.0 --author "Jane Doe" --project my-hero --json
107
+ npx -y @fleox/agent3d@0.4.0 assets depth assets/textures/street.jpg --project my-hero --json
108
108
  ```
109
109
 
110
- - **Output.** `data.path` = `assets/depth/<photo name>-depth.png` (`--out` to change), at the photo size capped at 2048 px (`--max-size`), transparent on depth jumps (the runtime hides stretched edges there). `data.suggestion` is a ready `{ "kind": "photo", "src", "depth" }` object; `data.ms` the time taken (about 1-1.5 s per photo plus ~2 s to start Chrome). `--size` is the model input long side (default 518; up to 1036 for finer edges, about 4× slower).
110
+ - **Output.** `data.path` = `assets/depth/<photo name>-depth.png` (`--out` to change), at the photo size capped at 1024 px (`--max-size`; the model works at 518 px, so a bigger map only adds bytes), transparent on depth jumps (the runtime hides stretched edges there). `data.suggestion` is a ready `{ "kind": "photo", "src", "depth" }` object; `data.ms` the time taken (about 1-1.5 s per photo plus ~2 s to start Chrome). `--size` is the model input long side (default 518; up to 1036 for finer edges, about 4× slower).
111
111
  - **Model.** Depth Anything V2 Small (27 MB, Apache-2.0), run in headless Chrome like `render` (WebAssembly, no GPU, no account). The **first run downloads it once** into `~/.agent3d/models/` (the `AGENT3D_MODELS` environment variable moves that folder); every later run works **offline**. Offline before the first download: the error hint gives the model URL and the folder to put it in, or paint a depth map by hand (grey PNG, white = near) and set it as `depth`. The model never goes into exports: only the PNG does.
112
112
  - **Licence.** The depth map is registered in `assets/manifest.json` with the **photo's** licence and author (add the photo with `assets add --license … --author …` first; a photo missing from the manifest gives `derived`) and an attribution line naming the model. Ask the user who took the photo and under which licence before using it.
113
113
  - Use it on a `photo` object (`src` = the photo, `depth` = `data.path`); skill `agent3d-create` covers the modes, motion and framing. Keep depth maps as PNG: `check` warns on a JPEG depth map (`photo-depth-lossy`), and `assets optimize` only resizes PNG depth maps losslessly.
@@ -116,9 +116,9 @@ npx -y @fleox/agent3d@0.3.0 assets depth assets/textures/street.jpg --project my
116
116
  ## Listing and removing
117
117
 
118
118
  ```bash
119
- npx -y @fleox/agent3d@0.3.0 assets list --project my-scene --json
120
- npx -y @fleox/agent3d@0.3.0 assets remove assets/textures/old.jpg --project my-scene --json
121
- npx -y @fleox/agent3d@0.3.0 assets remove assets/textures/old.jpg --yes --project my-scene --json
119
+ npx -y @fleox/agent3d@0.4.0 assets list --project my-scene --json
120
+ npx -y @fleox/agent3d@0.4.0 assets remove assets/textures/old.jpg --project my-scene --json
121
+ npx -y @fleox/agent3d@0.4.0 assets remove assets/textures/old.jpg --yes --project my-scene --json
122
122
  ```
123
123
 
124
124
  `assets list` shows each file's size on disk, licence, whether it exists and which objects use it (`usedBy`); it is read-only: entries whose recorded size differs from the file on disk are listed in `stale` (`assets optimize` / `assets add` rewrite the manifest). `remove` prints a plan (with `usedBy`) unless `--yes`: fix the references first.
@@ -128,11 +128,11 @@ npx -y @fleox/agent3d@0.3.0 assets remove assets/textures/old.jpg --yes --projec
128
128
  When `check` reports `budget` or `optimizable`, or before exporting a scene with project textures / `.glb` models, run `assets optimize`. Without `--yes` it prints the plan (no Chrome needed): for every file the size it will get and **why** (target kind, the object's size on screen, the camera distance, the texture role). Show the plan to the user, then apply:
129
129
 
130
130
  ```bash
131
- npx -y @fleox/agent3d@0.3.0 assets optimize --all --project my-hero --json
132
- npx -y @fleox/agent3d@0.3.0 assets optimize --all --dry-run --project my-hero --json
133
- npx -y @fleox/agent3d@0.3.0 assets optimize --all --yes --project my-hero --json
134
- npx -y @fleox/agent3d@0.3.0 assets optimize assets/models/robot.glb --simplify 0.5 --yes --project my-game --json
135
- npx -y @fleox/agent3d@0.3.0 assets optimize assets/textures/wood_planks --max-size 512 --format jpeg --yes --project my-banner --json
131
+ npx -y @fleox/agent3d@0.4.0 assets optimize --all --project my-hero --json
132
+ npx -y @fleox/agent3d@0.4.0 assets optimize --all --dry-run --project my-hero --json
133
+ npx -y @fleox/agent3d@0.4.0 assets optimize --all --yes --project my-hero --json
134
+ npx -y @fleox/agent3d@0.4.0 assets optimize assets/models/robot.glb --simplify 0.5 --yes --project my-game --json
135
+ npx -y @fleox/agent3d@0.4.0 assets optimize assets/textures/wood_planks --max-size 512 --format jpeg --yes --project my-banner --json
136
136
  ```
137
137
 
138
138
  - **Smart size (default).** Each texture gets the smallest tier (256 / 512 / 1024 / 2048; up to 4096 for an equirect background) that still gives about one texel per screen pixel where the scene shows it: canvas size from the target (a hero ≈ 2880×1620 device px), object size (`fit`, geometry, scale) and closest camera distance (orbit zoom, scroll paths and timeline camera keys count), divided by `repeat`. Normal maps get ~0.75× and roughness ~0.5× of the colour size; a model's atlas ~1.5× its on-screen size. Heroes never go below 512 for colour maps; games and cards are capped at 1024. Textures not placed in `scene.json` (scripts, unused) get 1024. `--max-size <px>` forces one size for everything. Never upscales.
@@ -4,7 +4,7 @@ description: Build a 3D element for a web page from a brief with Agent3D - an an
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.3.0"
7
+ version: "0.4.0"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -15,9 +15,9 @@ Agent3D turns a JSON **scene** (`scene.json` in a project folder) into a 3D elem
15
15
 
16
16
  **Language:** talk to the user in their language; keep commands, ids and files in English.
17
17
 
18
- Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` and prints one object: `{"ok": true, "data": …}` or `{"ok": false, "error": {"code", "message", "hint"}}`. Read `error.hint` when `ok` is false: it says what to do. `npx -y @fleox/agent3d@0.3.0 help scene --json` lists any command's actions and options. Pass `--project <dir>` to every project command (default: the current directory).
18
+ Every command is `npx -y @fleox/agent3d@0.4.0 <command> --json` and prints one object: `{"ok": true, "data": …}` or `{"ok": false, "error": {"code", "message", "hint"}}`. Read `error.hint` when `ok` is false: it says what to do. `npx -y @fleox/agent3d@0.4.0 help scene --json` lists any command's actions and options. Pass `--project <dir>` to every project command (default: the current directory).
19
19
 
20
- First run on a machine: `npx -y @fleox/agent3d@0.3.0 doctor --json` checks Node, Chrome and does a test render: `{ ok: true, data: { checks } }` when everything required passes, else `{ ok: false, error: { code: "doctor-failed", hint } }` (exit 1) with one hint per failed check and every check in `error.details.checks`. Without Chrome, renders and posters fail with a hint (install Chrome, or set `AGENT3D_CHROME`); `export --no-poster` still works.
20
+ First run on a machine: `npx -y @fleox/agent3d@0.4.0 doctor --json` checks Node, Chrome and does a test render: `{ ok: true, data: { checks } }` when everything required passes, else `{ ok: false, error: { code: "doctor-failed", hint } }` (exit 1) with one hint per failed check and every check in `error.details.checks`. Without Chrome, renders and posters fail with a hint (install Chrome, or set `AGENT3D_CHROME`); `export --no-poster` still works.
21
21
 
22
22
  ## The loop
23
23
 
@@ -28,23 +28,23 @@ First run on a machine: `npx -y @fleox/agent3d@0.3.0 doctor --json` checks Node,
28
28
  - **Motion**: calm ambient loop (default for banners), interactive (follow the pointer, hover, orbit), scroll-driven, or a game.
29
29
  2. **Start** from a template or from the starter for the target:
30
30
  ```bash
31
- npx -y @fleox/agent3d@0.3.0 templates list --json
32
- npx -y @fleox/agent3d@0.3.0 new bakery-banner --target banner --title "Golden Crust Bakery" --json
33
- npx -y @fleox/agent3d@0.3.0 new bakery-banner --template banner-neon-title --title "Golden Crust Bakery" --json
31
+ npx -y @fleox/agent3d@0.4.0 templates list --json
32
+ npx -y @fleox/agent3d@0.4.0 new bakery-banner --target banner --title "Golden Crust Bakery" --json
33
+ npx -y @fleox/agent3d@0.4.0 new bakery-banner --template banner-neon-title --title "Golden Crust Bakery" --json
34
34
  ```
35
35
  Without `--template`, `new` writes an attractive valid starter for the target (banner: gradient background, studio lights, a floating 3D title, a few props, dust particles, a slow loop; game: + `scripts/game.js`). `--aspect 21:9` overrides the aspect.
36
36
  3. **Learn what exists** before writing anything. Never guess ids or parameter names:
37
37
  ```bash
38
- npx -y @fleox/agent3d@0.3.0 catalog --json
39
- npx -y @fleox/agent3d@0.3.0 catalog generators terrain --json
40
- npx -y @fleox/agent3d@0.3.0 catalog behaviours --json
41
- npx -y @fleox/agent3d@0.3.0 catalog postfx look --json
42
- npx -y @fleox/agent3d@0.3.0 scene summary --project bakery-banner --json
38
+ npx -y @fleox/agent3d@0.4.0 catalog --json
39
+ npx -y @fleox/agent3d@0.4.0 catalog generators terrain --json
40
+ npx -y @fleox/agent3d@0.4.0 catalog behaviours --json
41
+ npx -y @fleox/agent3d@0.4.0 catalog postfx look --json
42
+ npx -y @fleox/agent3d@0.4.0 scene summary --project bakery-banner --json
43
43
  ```
44
44
  Sections: geometries, materialPresets, shaders, textures (procedural, zero bytes), lightRigs, behaviours, generators, particlePresets, postfx (with the `look` presets and each effect's GPU cost), fonts, sounds. Built-in models, textures and HDRIs: `assets library --query <word>` (skill `agent3d-assets`). The field-by-field scene format is in the `agent3d-edit` skill (`references/patch-ops.md`).
45
45
  4. **Build with patches** (small, reviewable, ids stay stable). Write the ops to a file and apply them:
46
46
  ```bash
47
- npx -y @fleox/agent3d@0.3.0 scene patch --project bakery-banner --file ops.json --json
47
+ npx -y @fleox/agent3d@0.4.0 scene patch --project bakery-banner --file ops.json --json
48
48
  ```
49
49
  ```json
50
50
  [
@@ -61,7 +61,7 @@ First run on a machine: `npx -y @fleox/agent3d@0.3.0 doctor --json` checks Node,
61
61
  - **Gotcha:** `updateObject` and `merge` deep-merge. Switching `material.preset` with `updateObject` keeps the old `color` / `roughness` overrides (gold stays white). To change a look, **replace** the material: `{ "op": "set", "path": "objects#title.material", "value": { "preset": "gold" } }`.
62
62
  5. **Render and LOOK** (this is the step that makes it good):
63
63
  ```bash
64
- npx -y @fleox/agent3d@0.3.0 render --project bakery-banner --sheet --count 4 --json
64
+ npx -y @fleox/agent3d@0.4.0 render --project bakery-banner --sheet --count 4 --json
65
65
  ```
66
66
  Then open `data.sheet` (a PNG contact sheet with time labels; paths are relative to the project folder `data.dir`) with the Read tool and judge it like an art director:
67
67
  - **Framing at the aspect ratio**: nothing important cut at the edges; the subject reads at a glance; wide banners keep content in the central ~80% of the width.
@@ -76,22 +76,22 @@ First run on a machine: `npx -y @fleox/agent3d@0.3.0 doctor --json` checks Node,
76
76
  - To show the user the motion: `--gif renders/preview.gif --duration 4` (or `--video <file>.mp4`, `--webp <file>.webp`); the path is relative to the project folder.
77
77
  - `--isolate <objectId>` renders one object alone (no behaviours, scripts or UI), at the origin, auto-framed from the front three-quarter view (+Z front) on a neutral grey background, and returns `data.isolated.size`: the fastest way to check that a downloaded model faces +Z, stands upright and has a sensible size.
78
78
  ```bash
79
- npx -y @fleox/agent3d@0.3.0 render --project bakery-banner --isolate croissant-left --json
79
+ npx -y @fleox/agent3d@0.4.0 render --project bakery-banner --isolate croissant-left --json
80
80
  ```
81
81
  - Transparent scenes (`target.transparent`): frames keep their alpha and the contact sheet gets a checkerboard behind them; `--bg "#ffffff"` (any CSS colour) previews the scene over the host page's colour, frames included; `--bg none` turns it off.
82
82
  6. **Fix and repeat** until it looks finished. Two or three iterations are normal; say what you changed and why.
83
83
  7. **Check** until there are no errors and no warnings:
84
84
  ```bash
85
- npx -y @fleox/agent3d@0.3.0 check --project bakery-banner --render --json
85
+ npx -y @fleox/agent3d@0.4.0 check --project bakery-banner --render --json
86
86
  ```
87
87
  It validates the scene, missing assets and scripts, the script sandbox, the triangle and KB budgets for the target, framing (with `--render`) and web settings (aria label, reduced motion, lazy start, pixel ratio cap), and lists licences that need attribution (`infos` with code `attribution`: keep those credits; the export writes `CREDITS.txt`).
88
88
  - `data.budget.gpu` is the post-processing cost: `effects` (each with its `gpu` tier and passes), `passes`, `level` (`none`, `light`, `moderate`, `heavy`) and `dropped.low` (effects the `low` quality tier switches off on weak devices). A `postfx-cost` issue means too many fullscreen passes (a warning on games and fullscreen targets, an info elsewhere) or `ao` / `dof` on a game: keep the effects that change the image the most. Grading, vignette, film, chromatic and sharpen merge into one nearly free pass.
89
89
  - Over the KB budget: `assets optimize` (skill `agent3d-assets`) shrinks project textures and models. Library assets are never shrunk there: the photographic `.hdr` files weigh 0.35 to 1.9 MB, so on banners and cards prefer a procedural `lighting` preset (`studio`, `soft`, `sunset`, `night`: zero bytes) plus a light rig.
90
90
  8. **Export** and hand over:
91
91
  ```bash
92
- npx -y @fleox/agent3d@0.3.0 export --project bakery-banner --json
92
+ npx -y @fleox/agent3d@0.4.0 export --project bakery-banner --json
93
93
  ```
94
- `data.snippet` is what goes in the page; `data.out` holds `agent3d-runtime/` (shared by every scene of the site), `<name>/` (scene, assets, poster, `CREDITS.txt`), `index.html` (a demo page), `snippet.html`, `head.html`, `EMBED.md` and `frameworks/` (React / Vue / Svelte wrappers). A second export into the same folder needs `--yes`. Give the user: the snippet, the folder to upload, the total size, the credits, and offer `serve` for a live look (`npx -y @fleox/agent3d@0.3.0 serve --project bakery-banner --open`). Other formats (zip, single HTML file, poster image, MP4 / WebM video, GIF) and site integration: skill `agent3d-publish`.
94
+ `data.snippet` is what goes in the page; `data.out` holds `agent3d-runtime/` (shared by every scene of the site), `<name>/` (scene, assets, poster, `CREDITS.txt`), `index.html` (a demo page), `snippet.html`, `head.html`, `EMBED.md` and `frameworks/` (React / Vue / Svelte wrappers). A second export into the same folder needs `--yes`. Give the user: the snippet, the folder to upload, the total size, the credits, and offer `serve` for a live look (`npx -y @fleox/agent3d@0.4.0 serve --project bakery-banner --open`). Other formats (zip, single HTML file, poster image, MP4 / WebM video, GIF) and site integration: skill `agent3d-publish`.
95
95
 
96
96
  ## Bring a photo to life (3D photo)
97
97
 
@@ -99,24 +99,24 @@ When the user gives a photo or an image and wants it in 3D, with parallax, "movi
99
99
 
100
100
  1. **Copy the image into the project** with its licence (ask who took it and under which licence; skill `agent3d-assets`):
101
101
  ```bash
102
- npx -y @fleox/agent3d@0.3.0 new my-hero --template hero-photo-3d --title "Old Town Tours" --json
103
- npx -y @fleox/agent3d@0.3.0 assets add ./photo.jpg --license CC0-1.0 --author "Jane Doe" --project my-hero --json
102
+ npx -y @fleox/agent3d@0.4.0 new my-hero --template hero-photo-3d --title "Old Town Tours" --json
103
+ npx -y @fleox/agent3d@0.4.0 assets add ./photo.jpg --license CC0-1.0 --author "Jane Doe" --project my-hero --json
104
104
  ```
105
105
  2. **Estimate its depth map** (local, ~1-3 s; the first run downloads the 27 MB model once, then it works offline):
106
106
  ```bash
107
- npx -y @fleox/agent3d@0.3.0 assets depth assets/textures/photo.jpg --project my-hero --json
107
+ npx -y @fleox/agent3d@0.4.0 assets depth assets/textures/photo.jpg --project my-hero --json
108
108
  ```
109
109
  It writes `assets/depth/photo-depth.png` (white = near) and returns `data.suggestion` (`{ "kind": "photo", "src", "depth" }`). Open the PNG with the Read tool: the subject should be lighter than the background.
110
110
  3. **Point the photo object at it** (or add one with `object add --json-def`):
111
111
  ```json
112
- [{ "op": "updateObject", "id": "photo", "set": { "src": "assets/textures/photo.jpg", "depth": "assets/depth/photo-depth.png", "strength": 0.3, "focus": 0.5 } }]
112
+ [{ "op": "updateObject", "id": "photo", "set": { "src": "assets/textures/photo.jpg", "depth": "assets/depth/photo-depth.png", "strength": 0.5, "focus": 0.5 } }]
113
113
  ```
114
114
  Cover the frame: with the camera at fov 35 and distance 10, a 16:9 frame is about 11.2 × 6.3 units, so a 3:2 photo needs `width` ≈ 11.9 (a 4:3 photo ≈ 11.2; a portrait photo needs `height` ≈ 6.6 and leaves side bars, so prefer a portrait `target.aspect` or a card). Keep the camera still: the photo's shader moves the view.
115
115
  4. **Choose the mode**: `parallax` (default, 2 triangles) for hero banners and small motions; `mesh` (a displaced grid) when the view moves more, e.g. `motion.auto: "orbit"`; `layers` (depth slices) for a pop-up-book look. `motion`: `pointer` (0..1), `gyro` (phones), `auto` (`sway` default, `orbit`, `zoom`, `none`: plays in renders, videos and on touch screens), `speed`, `scroll`.
116
116
  5. **Render and look**, then move the pointer to see the depth:
117
117
  ```bash
118
- npx -y @fleox/agent3d@0.3.0 render --project my-hero --count 4 --sheet --json
119
- npx -y @fleox/agent3d@0.3.0 render --project my-hero --frames 0.5,1,1.5,2 --sheet --input '[{"t": 0.1, "pointer": [-1, 0]}, {"t": 0.9, "pointer": [1, 0]}, {"t": 1.4, "pointer": [0, 1]}, {"t": 1.9, "pointer": [0, -1]}]' --json
118
+ npx -y @fleox/agent3d@0.4.0 render --project my-hero --count 4 --sheet --json
119
+ npx -y @fleox/agent3d@0.4.0 render --project my-hero --frames 0.5,1,1.5,2 --sheet --input '[{"t": 0.1, "pointer": [-1, 0]}, {"t": 0.9, "pointer": [1, 0]}, {"t": 1.4, "pointer": [0, 1]}, {"t": 1.9, "pointer": [0, -1]}]' --json
120
120
  ```
121
121
  Near things should slide against far things between frames, without smeared or doubled edges around the subject.
122
122
 
@@ -125,19 +125,20 @@ Tips:
125
125
  - `strength`: 0.5 by default; parallax holds a bold 0.7-0.9 (hero banners), mesh ~0.7 with the photo slightly wider than the frame (its border shows otherwise), layers ~0.6 (halos around subjects above that). Lower it first when silhouettes smear, and check with `render --input` pointer moves to the corners.
126
126
  - `focus` = the subject's depth (0 far … 1 near, read it from the depth map: a mid-grey subject ≈ 0.5): the subject stays put and the rest moves around it, which reads as depth instead of wobble.
127
127
  - Headlines: put them over a calm area of the photo (sky, wall, blurred background), use `"material": { "type": "basic", "color": "#ffffff" }` and `target.toneMapping: "none"` so white stays white (photos themselves are never tone mapped), and check the contrast in the render. A kerned 3D title (`depth` > 0, lit material) also works over a darker photo.
128
- - `check` reports `photo-depth-aspect` (regenerate the depth map after cropping the photo), `photo-heavy` (over 1.5 MB: `assets optimize`), `photo-depth-lossy` (keep the depth map a PNG), and the covering photo as a `clipped` info (expected).
128
+ - `check` reports `photo-depth-aspect` (regenerate the depth map after cropping the photo), `photo-heavy` (over 1.5 MB: `assets optimize`) and `photo-depth-lossy` (keep the depth map a PNG). A covering photo is never reported as `clipped`.
129
+ - **Web weight**: before exporting, run `npx -y @fleox/agent3d@0.4.0 assets optimize --all --yes --project my-hero --json`: the photo becomes WebP at the size the hero needs (about 40 % lighter; the scene path is rewritten) and the depth map stays a lossless PNG (already ≤ 1024 px from `assets depth`: the model works at 518 px). A photo-only hero then weighs about 0.4 MB of images plus the runtime.
129
130
  - Exports copy the photo and its depth map like any asset; the model never ships.
130
131
 
131
132
  ## Other front doors: MCP and the Studio
132
133
 
133
134
  Everything above also works without the shell:
134
135
 
135
- - **MCP server** — `agent3d mcp` serves one project folder over stdio: the same tools as `tools list` (scene_patch, check, export…) plus `render_preview`, whose contact sheet comes back as an image the client can look at. Claude Code: `claude mcp add agent3d -- npx -y @fleox/agent3d@0.3.0 mcp --project /path/to/my-banner` (add `--scope project` to write `.mcp.json` for the repository). Claude Desktop / Cursor: in `claude_desktop_config.json` / `.cursor/mcp.json`:
136
+ - **MCP server** — `agent3d mcp` serves one project folder over stdio: the same tools as `tools list` (scene_patch, check, export…) plus `render_preview`, whose contact sheet comes back as an image the client can look at. Claude Code: `claude mcp add agent3d -- npx -y @fleox/agent3d@0.4.0 mcp --project /path/to/my-banner` (add `--scope project` to write `.mcp.json` for the repository). Claude Desktop / Cursor: in `claude_desktop_config.json` / `.cursor/mcp.json`:
136
137
  ```json
137
- { "mcpServers": { "agent3d": { "command": "npx", "args": ["-y", "@fleox/agent3d@0.3.0", "mcp", "--project", "/Users/me/agent3d/my-banner"] } } }
138
+ { "mcpServers": { "agent3d": { "command": "npx", "args": ["-y", "@fleox/agent3d@0.4.0", "mcp", "--project", "/Users/me/agent3d/my-banner"] } } }
138
139
  ```
139
140
  `--read-only` exposes only the tools that don't write. Desktop apps may not see the shell's `PATH`: use the absolute path of `npx` as `command` if the server doesn't start.
140
- - **Studio** — `npx -y @fleox/agent3d@0.3.0 studio --project bakery-banner` opens a visual editor on the same folder (viewport with move / rotate / scale gizmos, outliner, inspector, timeline, catalog and library, templates, check, render and export dialogs; English or French). It prints its local URL and runs until stopped. Edits go through the same validated tools, and changes you make from the CLI appear live in it, so the user can watch and tweak your work. The viewport starts in edit mode (scripts don't run, the timeline is paused and scrubbed); interact mode (`I`) runs the scene as the website does: scripts, hover / click / scroll triggers.
141
+ - **Studio** — `npx -y @fleox/agent3d@0.4.0 studio --project bakery-banner` opens a visual editor on the same folder (viewport with move / rotate / scale gizmos, outliner, inspector, timeline, catalog and library, templates, check, render and export dialogs; English or French). It prints its local URL and runs until stopped. Edits go through the same validated tools, and changes you make from the CLI appear live in it, so the user can watch and tweak your work. The viewport starts in edit mode (scripts don't run, the timeline is paused and scrubbed); interact mode (`I`) runs the scene as the website does: scripts, hover / click / scroll triggers.
141
142
 
142
143
  ## Art direction that looks professional
143
144
 
@@ -3,9 +3,9 @@
3
3
  Numbers that work with the Agent3D runtime (ACES tone mapping by default, physically based lights, units ≈ metres). Start from them, render, look, adjust. Exact parameters live in the catalog — never guess them:
4
4
 
5
5
  ```bash
6
- npx -y @fleox/agent3d@0.3.0 catalog lightRigs --json
7
- npx -y @fleox/agent3d@0.3.0 catalog postfx look --json
8
- npx -y @fleox/agent3d@0.3.0 catalog materialPresets --json
6
+ npx -y @fleox/agent3d@0.4.0 catalog lightRigs --json
7
+ npx -y @fleox/agent3d@0.4.0 catalog postfx look --json
8
+ npx -y @fleox/agent3d@0.4.0 catalog materialPresets --json
9
9
  ```
10
10
 
11
11
  Complete, rendered scenes for each idea below: [recipes.md](recipes.md).
@@ -3,14 +3,14 @@
3
3
  Each scene below passed `scene validate` (no errors, no warnings) and `check --render`, and was rendered and looked at (the README images in `docs/images/recipe-*.jpg` come from them). Start from the closest one, then change the brand parts (text, colours, model, URLs) with `scene patch` and render again:
4
4
 
5
5
  ```bash
6
- npx -y @fleox/agent3d@0.3.0 new my-scene --target hero --json
7
- npx -y @fleox/agent3d@0.3.0 scene validate --project my-scene --file recipe.json --json
8
- npx -y @fleox/agent3d@0.3.0 scene apply --project my-scene --file recipe.json --yes --json
9
- npx -y @fleox/agent3d@0.3.0 check --render --project my-scene --json
10
- npx -y @fleox/agent3d@0.3.0 render --project my-scene --sheet --count 4 --json
6
+ npx -y @fleox/agent3d@0.4.0 new my-scene --target hero --json
7
+ npx -y @fleox/agent3d@0.4.0 scene validate --project my-scene --file recipe.json --json
8
+ npx -y @fleox/agent3d@0.4.0 scene apply --project my-scene --file recipe.json --yes --json
9
+ npx -y @fleox/agent3d@0.4.0 check --render --project my-scene --json
10
+ npx -y @fleox/agent3d@0.4.0 render --project my-scene --sheet --count 4 --json
11
11
  ```
12
12
 
13
- Exact parameters of every rig, look, material, shader, generator and behaviour: `npx -y @fleox/agent3d@0.3.0 catalog <section> [id] --json`. Premium starting points per target kind: [art-direction.md](art-direction.md#premium-defaults).
13
+ Exact parameters of every rig, look, material, shader, generator and behaviour: `npx -y @fleox/agent3d@0.4.0 catalog <section> [id] --json`. Premium starting points per target kind: [art-direction.md](art-direction.md#premium-defaults).
14
14
 
15
15
  ## Product shot (1:1): softbox packshot
16
16
 
@@ -4,7 +4,7 @@ description: Change an existing Agent3D project - summarise the scene, then patc
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.3.0"
7
+ version: "0.4.0"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -15,23 +15,23 @@ A project is a folder with `agent3d.json`, `scene.json` (the scene), `assets/` (
15
15
 
16
16
  **Language:** talk to the user in their language; keep commands, ids and files in English.
17
17
 
18
- Every command is `npx -y @fleox/agent3d@0.3.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
18
+ Every command is `npx -y @fleox/agent3d@0.4.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
19
19
 
20
20
  ## 1. Understand before changing
21
21
 
22
22
  ```bash
23
- npx -y @fleox/agent3d@0.3.0 info --project my-banner --json
24
- npx -y @fleox/agent3d@0.3.0 scene summary --project my-banner --json
25
- npx -y @fleox/agent3d@0.3.0 render --project my-banner --sheet --json
23
+ npx -y @fleox/agent3d@0.4.0 info --project my-banner --json
24
+ npx -y @fleox/agent3d@0.4.0 scene summary --project my-banner --json
25
+ npx -y @fleox/agent3d@0.4.0 render --project my-banner --sheet --json
26
26
  ```
27
27
 
28
28
  Look at the sheet (Read the `data.sheet` PNG, relative to the project folder `data.dir`), then tell the user in two or three sentences what the scene contains (target and aspect, the main objects, the motion) before proposing changes. Read details on demand:
29
29
 
30
30
  ```bash
31
- npx -y @fleox/agent3d@0.3.0 object get title --project my-banner --json
32
- npx -y @fleox/agent3d@0.3.0 scene get --path objects#title.material --project my-banner --json
33
- npx -y @fleox/agent3d@0.3.0 timeline get --project my-banner --json
34
- npx -y @fleox/agent3d@0.3.0 catalog behaviours float --json
31
+ npx -y @fleox/agent3d@0.4.0 object get title --project my-banner --json
32
+ npx -y @fleox/agent3d@0.4.0 scene get --path objects#title.material --project my-banner --json
33
+ npx -y @fleox/agent3d@0.4.0 timeline get --project my-banner --json
34
+ npx -y @fleox/agent3d@0.4.0 catalog behaviours float --json
35
35
  ```
36
36
 
37
37
  ## 2. Patch
@@ -39,8 +39,8 @@ npx -y @fleox/agent3d@0.3.0 catalog behaviours float --json
39
39
  Put the ops in a file (or pass them inline as one JSON argument) and apply:
40
40
 
41
41
  ```bash
42
- npx -y @fleox/agent3d@0.3.0 scene patch --project my-banner --file ops.json --dry-run --json
43
- npx -y @fleox/agent3d@0.3.0 scene patch --project my-banner --file ops.json --json
42
+ npx -y @fleox/agent3d@0.4.0 scene patch --project my-banner --file ops.json --dry-run --json
43
+ npx -y @fleox/agent3d@0.4.0 scene patch --project my-banner --file ops.json --json
44
44
  ```
45
45
 
46
46
  | Op | Shape | Use |
@@ -63,11 +63,11 @@ npx -y @fleox/agent3d@0.3.0 scene patch --project my-banner --file ops.json --js
63
63
  Shortcuts for one object (same validation, same plans):
64
64
 
65
65
  ```bash
66
- npx -y @fleox/agent3d@0.3.0 object update title --set material.color="#ffd166" --set size=0.9 --project my-banner --json
67
- npx -y @fleox/agent3d@0.3.0 object add --id ball --geometry sphere --set geometry.radius=0.4 --set 'position=[3,0,0]' --project my-banner --json
68
- npx -y @fleox/agent3d@0.3.0 object move gem --parent props --project my-banner --json
69
- npx -y @fleox/agent3d@0.3.0 object remove pill --project my-banner --json
70
- npx -y @fleox/agent3d@0.3.0 object remove pill --yes --project my-banner --json
66
+ npx -y @fleox/agent3d@0.4.0 object update title --set material.color="#ffd166" --set size=0.9 --project my-banner --json
67
+ npx -y @fleox/agent3d@0.4.0 object add --id ball --geometry sphere --set geometry.radius=0.4 --set 'position=[3,0,0]' --project my-banner --json
68
+ npx -y @fleox/agent3d@0.4.0 object move gem --parent props --project my-banner --json
69
+ npx -y @fleox/agent3d@0.4.0 object remove pill --project my-banner --json
70
+ npx -y @fleox/agent3d@0.4.0 object remove pill --yes --project my-banner --json
71
71
  ```
72
72
 
73
73
  `--set` takes dotted keys and JSON values (`--set 'position=[0,1,0]'`, `--set visible=false`). More recipes per task (materials, lights, camera, timeline, behaviours, post effects): [references/patch-ops.md](references/patch-ops.md).
@@ -80,10 +80,10 @@ npx -y @fleox/agent3d@0.3.0 object remove pill --yes --project my-banner --json
80
80
  - property: `position`, `position.x`, `rotation.y` (degrees), `scale`, `visible`, `material.opacity` / `color` / `emissiveIntensity` / `roughness`…, `material.uniforms.<name>`; lights `intensity`, `color`; camera `position`, `target`, `fov`, `focus`; `environment.fog.density`, `environment.exposure`; `postfx.<type>.<param>` (an effect written in `postfx` or brought by a `look` preset, e.g. `postfx.bloom.strength` with `{ "type": "look", "preset": "product" }`); models `morph.<name>`, `animation.<clip>.weight`.
81
81
  - **Keys** are `[time, value]` or `[time, value, ease]` (the ease shapes the segment ending at that key) sorted by time. Values: numbers, `[x, y, z]`, colours, booleans, or relative strings `"+=0.5"`, `"-=1"`, `"*=1.2"` (from the rest value). The track `ease` (default `linear`) is `step`, `in` / `out` / `inOut` + `Quad`, `Cubic`, `Quart`, `Quint`, `Sine`, `Expo`, `Circ`, `Back`, `Elastic`, `Bounce`, or `"cubicBezier(0.16, 1, 0.3, 1)"`, `"spring(170, 12)"`, `"steps(4)"`. Multi-target selectors take `stagger` (seconds between targets) and `staggerFrom` (`start`, `end`, `center`, `edges`, `random`). Colour keys blend in OKLCh (saturated midpoints); `"colorSpace": "rgb"|"oklab"|"hsl"` on the track changes it.
82
82
  ```bash
83
- npx -y @fleox/agent3d@0.3.0 timeline set --duration 10 --loop true --trigger visible --project my-banner --json
84
- npx -y @fleox/agent3d@0.3.0 timeline add-track --target logo.rotation.y --keys "[[0,0],[10,360]]" --project my-banner --json
85
- npx -y @fleox/agent3d@0.3.0 timeline add-track --target gem.position.y --keys '[[0,"+=0"],[1,"+=0.6","outBack"],[2,"+=0","inOutSine"]]' --project my-banner --json
86
- npx -y @fleox/agent3d@0.3.0 timeline remove-track --target logo.rotation.y --yes --project my-banner --json
83
+ npx -y @fleox/agent3d@0.4.0 timeline set --duration 10 --loop true --trigger visible --project my-banner --json
84
+ npx -y @fleox/agent3d@0.4.0 timeline add-track --target logo.rotation.y --keys "[[0,0],[10,360]]" --project my-banner --json
85
+ npx -y @fleox/agent3d@0.4.0 timeline add-track --target gem.position.y --keys '[[0,"+=0"],[1,"+=0.6","outBack"],[2,"+=0","inOutSine"]]' --project my-banner --json
86
+ npx -y @fleox/agent3d@0.4.0 timeline remove-track --target logo.rotation.y --yes --project my-banner --json
87
87
  ```
88
88
  - Loops: the last key equals the first. Triggers: `load`, `visible` (default), `hover`, `click`, `scroll` (time = scroll progress; tune with `timeline.scroll`), `manual` (only interactions move it).
89
89
  - **Markers and segments** name moments and ranges (`markers: { "lifted": 2.6 }`, `segments: { "hover-in": [2, "lifted"] }`); `autoplay: "intro"` plays only that segment on the trigger. **Interactions** (`scene.interactions`) wire hover / click / scroll / key / marker events to actions: play or toggle a segment, tween a property (`set`), `openUrl` (click / key only), emit an event, play a model clip. Agents on MCP or `tools call` can use the `interactions_set` tool (`{ "add": [...] }` or `{ "interactions": [...] }`, `dryRun`).
@@ -104,14 +104,14 @@ npx -y @fleox/agent3d@0.3.0 object remove pill --yes --project my-banner --json
104
104
  The embed keeps the scene's aspect ratio at every width. A 4:1 banner is only ~98 px tall on a 390 px phone:
105
105
 
106
106
  ```bash
107
- npx -y @fleox/agent3d@0.3.0 render --project my-banner --size 390x98 --scale 2 --frames 2 --json
107
+ npx -y @fleox/agent3d@0.4.0 render --project my-banner --size 390x98 --scale 2 --frames 2 --json
108
108
  ```
109
109
 
110
110
  If the title becomes unreadable: shorter text, bigger `size`, fewer props, or a separate mobile version (a copy of the project with `target.aspect` "4:3" or `target.height`, exported under another `--name`, switched with CSS media queries on the page).
111
111
 
112
112
  ## 6. Finish
113
113
 
114
- `npx -y @fleox/agent3d@0.3.0 check --project my-banner --render --json` until no errors and no warnings, then re-export (`export --yes` overwrites the previous export folder; tell the user to re-upload `<name>/` and, after an Agent3D update, `agent3d-runtime/`). Skill `agent3d-publish` covers the site side.
114
+ `npx -y @fleox/agent3d@0.4.0 check --project my-banner --render --json` until no errors and no warnings, then re-export (`export --yes` overwrites the previous export folder; tell the user to re-upload `<name>/` and, after an Agent3D update, `agent3d-runtime/`). Skill `agent3d-publish` covers the site side.
115
115
 
116
116
  ## Rules
117
117
 
@@ -1,6 +1,6 @@
1
1
  # Patch ops cookbook
2
2
 
3
- Apply with `npx -y @fleox/agent3d@0.3.0 scene patch --project <dir> --file ops.json --json` (add `--dry-run` to preview, `--yes` when the plan removes something or replaces a whole collection such as `lights`, `postfx`, `objects`, `timeline.tracks` or `ui.elements`: `plan.replaces` lists them). Ops run in order on a copy; the result is validated; on any error nothing is written and the error names the failing op (`details.opIndex`).
3
+ Apply with `npx -y @fleox/agent3d@0.4.0 scene patch --project <dir> --file ops.json --json` (add `--dry-run` to preview, `--yes` when the plan removes something or replaces a whole collection such as `lights`, `postfx`, `objects`, `timeline.tracks` or `ui.elements`: `plan.replaces` lists them). Ops run in order on a copy; the result is validated; on any error nothing is written and the error names the failing op (`details.opIndex`).
4
4
 
5
5
  ## Paths
6
6
 
@@ -244,7 +244,7 @@ These play the segments of the markers block above (a segment must exist before
244
244
  - Segments named in `play` / `toggle` must exist in `timeline.segments` (validation says so). Targets get a pointer cursor.
245
245
  - Without patches (MCP or the CLI tool runner): `interactions_set` appends with `add` or replaces with `interactions`:
246
246
  ```bash
247
- npx -y @fleox/agent3d@0.3.0 tools call interactions_set --input '{"add": [{"on": "click", "target": "blob", "do": [{"toggle": "hover-in"}]}], "dryRun": true}' --project my-hero --json
247
+ npx -y @fleox/agent3d@0.4.0 tools call interactions_set --input '{"add": [{"on": "click", "target": "blob", "do": [{"toggle": "hover-in"}]}], "dryRun": true}' --project my-hero --json
248
248
  ```
249
249
  - Check hover states headless: `render --input '[{"t": 1.9, "pointer": [0, -0.3]}]' --frames 2,3`.
250
250