@fleox/agent3d 0.2.3 → 0.3.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 (70) hide show
  1. package/README.md +20 -13
  2. package/changelog.json +15 -0
  3. package/dist/agent/agent3d.mjs +228 -53
  4. package/dist/agent/chunks/{assets-BUUM9TUB.mjs → assets-YBkgdfgy.mjs} +27 -8
  5. package/dist/agent/chunks/{browser-Br1tURgt.mjs → browser-Dil7VM5m.mjs} +1 -1
  6. package/dist/agent/chunks/{cdp-Bdtm4fBN.mjs → cdp-DLEis_Z3.mjs} +1 -1
  7. package/dist/agent/chunks/{check-CfZcfaPs.mjs → check-DP9fRYbK.mjs} +64 -4
  8. package/dist/agent/chunks/depth-0bZsQn6N.mjs +190 -0
  9. package/dist/agent/chunks/depth-Dih8jLqx.mjs +483 -0
  10. package/dist/agent/chunks/{export-BHugc2H7.mjs → export-Cdqt3mt_.mjs} +8 -4
  11. package/dist/agent/chunks/{imageCodec-QM0EXQDJ.mjs → imageCodec-DeGfmBp3.mjs} +3 -3
  12. package/dist/agent/chunks/{objects-DBAws7uf.mjs → objects-DuytRxiC.mjs} +3 -3
  13. package/dist/agent/chunks/{optimizeSizing-CkZ3fZRp.mjs → optimizeSizing-B-BBiUkD.mjs} +51 -3
  14. package/dist/agent/chunks/{package-fw4h5vsh.mjs → package-d5e08XSG.mjs} +2 -1
  15. package/dist/agent/chunks/{render-EHb40avl.mjs → render-B05DU4Q5.mjs} +4 -4
  16. package/dist/agent/chunks/{scene-BgajNvBf.mjs → scene-DWgXH6As.mjs} +2 -2
  17. package/dist/agent/chunks/{server-CACCerkZ.mjs → server-Dt_YFvN7.mjs} +6 -2
  18. package/dist/agent/chunks/{tools-DKxgjQSJ.mjs → tools-Cv6N_YBI.mjs} +60 -6
  19. package/dist/agent/chunks/{tree-BrNYGui2.mjs → tree-CqSj-o8T.mjs} +1 -0
  20. package/dist/agent/ort/LICENSE.txt +9 -0
  21. package/dist/agent/ort/ort-wasm-simd-threaded.wasm +0 -0
  22. package/dist/agent/ort/ort.wasm.bundle.min.mjs +9 -0
  23. package/dist/runtime/agent3d-runtime.js +6 -6
  24. package/dist/runtime/agent3d-runtime.single.js +311 -62
  25. package/dist/runtime/chunks/assets-qnxDnVkj.js +1 -0
  26. package/dist/runtime/chunks/materials-dC4vDNHh.js +107 -0
  27. package/dist/runtime/chunks/{model-DbfZaLni.js → model-BCAl_NRl.js} +1 -1
  28. package/dist/runtime/chunks/photo-BlDYgYFM.js +250 -0
  29. package/dist/runtime/chunks/svg-CLUxY6Zy.js +1 -0
  30. package/dist/runtime/chunks/{text-BaON-ISS.js → text-rSo_2Luk.js} +2 -2
  31. package/dist/studio/assets/assets-BFJsr9Oo.js +1 -0
  32. package/dist/studio/assets/{camera-Be6lnp3k.js → camera-DT0xHipx.js} +1 -1
  33. package/dist/studio/assets/{editor-Mpnz-b2E.js → editor-BjgHj9g8.js} +1 -1
  34. package/dist/studio/assets/{game-WMgRSJUD.js → game-BXZEc9HN.js} +3 -3
  35. package/dist/studio/assets/{generators-DozXE7ta.js → generators-DqkPMEzm.js} +1 -1
  36. package/dist/studio/assets/index-DVTzVcBD.js +479 -0
  37. package/dist/studio/assets/{model-C2bZTK7-.js → model-BqQW4Dg-.js} +1 -1
  38. package/dist/studio/assets/params-gVpEEiSK.js +1 -0
  39. package/dist/studio/assets/photo-DRoVO5iZ.js +250 -0
  40. package/dist/studio/assets/{physicsHost-CTRsIvfu.js → physicsHost-DNdZ7AsT.js} +1 -1
  41. package/dist/studio/assets/{postfx-DQtp0JIy.js → postfx-JFUGdY0d.js} +1 -1
  42. package/dist/studio/assets/runtime-CMAP4azF.js +572 -0
  43. package/dist/studio/assets/{shaders-BOb6Uter.js → shaders-C7u6rN_6.js} +12 -12
  44. package/dist/studio/assets/svg-DkIOJjzS.js +2 -0
  45. package/dist/studio/assets/{text-CGIZs8HE.js → text-LISSAism.js} +2 -2
  46. package/dist/studio/index.html +1 -1
  47. package/package.json +2 -1
  48. package/plugin/.claude-plugin/plugin.json +1 -1
  49. package/plugin/skills/agent3d-assets/SKILL.md +40 -25
  50. package/plugin/skills/agent3d-create/SKILL.md +56 -21
  51. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  52. package/plugin/skills/agent3d-create/references/recipes.md +71 -6
  53. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  54. package/plugin/skills/agent3d-edit/references/patch-ops.md +11 -3
  55. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  56. package/plugin/skills/agent3d-publish/SKILL.md +23 -21
  57. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
  58. package/templates/hero-photo-3d/README.md +28 -0
  59. package/templates/hero-photo-3d/agent3d.json +8 -0
  60. package/templates/hero-photo-3d/assets/depth/street-depth.png +0 -0
  61. package/templates/hero-photo-3d/assets/manifest.json +25 -0
  62. package/templates/hero-photo-3d/assets/textures/street.jpg +0 -0
  63. package/templates/hero-photo-3d/preview.png +0 -0
  64. package/templates/hero-photo-3d/scene.json +120 -0
  65. package/templates/hero-photo-3d/template.json +8 -0
  66. package/dist/runtime/chunks/materials-w3EW0g-7.js +0 -107
  67. package/dist/runtime/chunks/svg-CfPIQnDG.js +0 -1
  68. package/dist/studio/assets/index-tSGZFEt5.js +0 -479
  69. package/dist/studio/assets/runtime-NGp1VdnH.js +0 -572
  70. package/dist/studio/assets/svg-CnUMpv_N.js +0 -2
@@ -1,2 +0,0 @@
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{a as d,f,s as p}from"./runtime-NGp1VdnH.js";import{v as m}from"./camera-Be6lnp3k.js";import{i as h,n as g,r as _,t as v}from"./extrude-9bG8hr2C.js";import{h as y}from"./index-tSGZFEt5.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(m(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=m(e.opacity,1);if(b(e.fill)){let t=s.toShapes().map(e=>_(e,a));t.length&&r.push({kind:`fill`,color:x(e.fill,s,o),opacity:m(e.fillOpacity,1)*c,shapes:t})}if(n.strokes!==!1&&b(e.stroke)&&m(e.strokeWidth,1)>0){let n=t.getStrokeStyle(m(e.strokeWidth,1),`#000`,e.strokeLineJoin??`miter`,e.strokeLineCap??`butt`,m(e.strokeMiterLimit,4)),l=[];for(let e of s.subPaths){let r=g(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:m(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?v(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(),h(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 f(n.resolveAsset(t.src)),s=new i().parse(o),c=t.material?p(t.material):void 0,l=typeof c?.color==`string`?c.color:void 0,h=Math.max(1,Math.round(m(t.curveSegments,12))),g=C(s,i,{strokes:t.strokes,curveSegments:h,currentColor:l}),_=new r,v=T(g,h);if(!g.length||v.isEmpty())return _;let b=m(t.size,2),x=Math.max(v.max.x-v.min.x,1e-6),S=Math.max(v.max.y-v.min.y,1e-6),w=t.fit??`width`,D=b/(w===`height`?S:w===`max`?Math.max(x,S):x),O=Math.max(0,m(t.depth,.2)),k=O/D,A=m(t.bevel,0)/D,j=m(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 d(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 g){let t=E(e,k,A,h,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=(v.min.x+v.max.x)/2,R=(v.min.y+v.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),_.add(I),_}export{D as buildSvg};