@fleox/agent3d 0.2.1 → 0.2.3

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 (47) hide show
  1. package/README.md +11 -10
  2. package/changelog.json +22 -0
  3. package/dist/agent/agent3d.mjs +58 -47
  4. package/dist/agent/chunks/{browser-t_JL_B82.mjs → browser-Br1tURgt.mjs} +21 -2
  5. package/dist/agent/chunks/{check-CBO3Ekx1.mjs → check-CfZcfaPs.mjs} +12 -0
  6. package/dist/agent/chunks/{export-BCI8vKw8.mjs → export-BHugc2H7.mjs} +1 -1
  7. package/dist/agent/chunks/{imageCodec-Dz9PFxi9.mjs → imageCodec-QM0EXQDJ.mjs} +1 -1
  8. package/dist/agent/chunks/{package-BOIyp_2B.mjs → package-fw4h5vsh.mjs} +2 -2
  9. package/dist/agent/chunks/{render-CN4mgGLQ.mjs → render-EHb40avl.mjs} +1 -1
  10. package/dist/agent/chunks/{tools-DT2tetIK.mjs → tools-DKxgjQSJ.mjs} +2 -2
  11. package/dist/runtime/agent3d-runtime.js +2 -2
  12. package/dist/runtime/agent3d-runtime.single.js +2 -2
  13. package/dist/runtime/chunks/catalog--OTp4gjy.js +1 -0
  14. package/dist/runtime/chunks/{generators-D5JUo0jp.js → generators--kOFg1G_.js} +1 -1
  15. package/dist/runtime/chunks/{materials-Dn-bYrZd.js → materials-w3EW0g-7.js} +1 -1
  16. package/dist/runtime/chunks/{model-BCVF3QzB.js → model-DbfZaLni.js} +1 -1
  17. package/dist/runtime/chunks/{params-C2uoUDJ0.js → params-BCNrVCYZ.js} +1 -1
  18. package/dist/runtime/chunks/{postfx-i_J5Vf-l.js → postfx-CFucYRev.js} +1 -1
  19. package/dist/runtime/chunks/{postfx-UgKCbmZs.js → postfx-Cbf_vvOr.js} +1 -1
  20. package/dist/runtime/chunks/{shaders-Dw6zHdu_.js → shaders-Ba3v6Xnj.js} +1 -1
  21. package/dist/runtime/chunks/{svg-CmlFY_8O.js → svg-CfPIQnDG.js} +1 -1
  22. package/dist/runtime/chunks/{text-D1EQpdSU.js → text-BaON-ISS.js} +1 -1
  23. package/dist/studio/assets/{camera-7sEn13L-.js → camera-Be6lnp3k.js} +1 -1
  24. package/dist/studio/assets/{editor-CnbvVkhU.js → editor-Mpnz-b2E.js} +1 -1
  25. package/dist/studio/assets/{game-B04KGAK0.js → game-WMgRSJUD.js} +3 -3
  26. package/dist/studio/assets/{generators-LSni1Yfc.js → generators-DozXE7ta.js} +1 -1
  27. package/dist/studio/assets/{index-3LL5NEIH.js → index-tSGZFEt5.js} +5 -5
  28. package/dist/studio/assets/{model-CNddhwmA.js → model-C2bZTK7-.js} +1 -1
  29. package/dist/studio/assets/{physicsHost-hMU_SDiX.js → physicsHost-CTRsIvfu.js} +1 -1
  30. package/dist/studio/assets/{postfx-BcCZS0Bq.js → postfx-DQtp0JIy.js} +1 -1
  31. package/dist/studio/assets/{runtime-DY_KqD1x.js → runtime-NGp1VdnH.js} +4 -4
  32. package/dist/studio/assets/{shaders-BhMCstyv.js → shaders-BOb6Uter.js} +1 -1
  33. package/dist/studio/assets/{svg-CNKK-h7H.js → svg-CnUMpv_N.js} +1 -1
  34. package/dist/studio/assets/{text-BSPI7dk1.js → text-CGIZs8HE.js} +1 -1
  35. package/dist/studio/index.html +1 -1
  36. package/package.json +2 -2
  37. package/plugin/.claude-plugin/plugin.json +1 -1
  38. package/plugin/skills/agent3d-assets/SKILL.md +24 -24
  39. package/plugin/skills/agent3d-create/SKILL.md +20 -20
  40. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  41. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  42. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  43. package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
  44. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  45. package/plugin/skills/agent3d-publish/SKILL.md +21 -21
  46. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
  47. package/dist/runtime/chunks/catalog-DL6sgPay.js +0 -1
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GLTFLoader-1Zd9N406.js","./three.module-CnI50X0U.js","./BufferGeometryUtils-CAlXAboW.js","./SkeletonUtils-CG5akqME.js"])))=>i.map(i=>d[i]);
2
- import{Ln as e,U as t,c as n,d as r,ht as i,mt as a}from"./three.module-CnI50X0U.js";import{v as o}from"./camera-7sEn13L-.js";import{o as s}from"./runtime-DY_KqD1x.js";import{h as c}from"./index-3LL5NEIH.js";var l=new Map;function u(e){let t=new Uint8Array(e),n;if(t.byteLength>=20&&new DataView(e).getUint32(0,!0)===1179937895){let r=new DataView(e).getUint32(12,!0);n=new TextDecoder().decode(t.subarray(20,20+r))}else n=new TextDecoder().decode(t);try{let e=JSON.parse(n);return Array.isArray(e.extensionsUsed)?e.extensionsUsed.filter(e=>typeof e==`string`):[]}catch{return[]}}async function d(e){let t=l.get(e);return t||(t=(async()=>{let[{GLTFLoader:t},n]=await Promise.all([c(()=>import(`./GLTFLoader-1Zd9N406.js`),__vite__mapDeps([0,1,2,3]),import.meta.url),fetch(e)]);if(!n.ok)throw Error(`HTTP ${n.status} for ${e}`);let r=await n.arrayBuffer(),i=u(r);if(i.includes(`KHR_draco_mesh_compression`))throw Error(`${e} uses Draco compression (KHR_draco_mesh_compression), which the Agent3D runtime does not decode. Re-export it without Draco (Blender: uncheck "Compression"), or convert it to meshopt with gltfpack (\`gltfpack -i in.glb -o out.glb -cc\`), then run \`agent3d assets optimize\`.`);let a=new t;if(i.includes(`EXT_meshopt_compression`)){let{MeshoptDecoder:e}=await c(async()=>{let{MeshoptDecoder:e}=await import(`./meshopt_decoder.module-DXTYc6wn.js`);return{MeshoptDecoder:e}},[],import.meta.url);await e.ready,a.setMeshoptDecoder(e)}let o=e.slice(0,e.lastIndexOf(`/`)+1);return a.parseAsync(r,/^data:/.test(e)?``:o)})(),t.catch(()=>l.delete(e)),l.set(e,t)),t}function f(e,t){e.traverse(e=>{let n=e;if(n.isMesh&&n.morphTargetDictionary&&n.morphTargetInfluences)for(let[e,r]of Object.entries(t)){let t=n.morphTargetDictionary[e];t!==void 0&&typeof r==`number`&&(n.morphTargetInfluences[t]=r)}})}async function p(l,u){let p=await d(u.resolveAsset(l.src)),{clone:m}=await c(async()=>{let{clone:e}=await import(`./SkeletonUtils-CG5akqME.js`);return{clone:e}},[],import.meta.url),h=m(p.scene),g=new t;g.add(h),h.updateMatrixWorld(!0);let _=new r().setFromObject(h);if(!_.isEmpty()){let t=_.getSize(new e),n=Math.max(t.x,t.y,t.z),r=l.fit&&n>0?l.fit/n:1;if(h.scale.multiplyScalar(r),l.center!==!1){let t=_.getCenter(new e);h.position.set(-t.x*r,-_.min.y*r,-t.z*r)}}h.traverse(e=>{let t=e;t.isMesh&&(t.castShadow=l.castShadow??!0,t.receiveShadow=l.receiveShadow??!1)}),l.material&&await s(h,l.material,u),l.morph&&f(h,l.morph);let v;if(p.animations.length){let e=new n(h),t=null,r=e=>typeof e==`number`||/^\d+$/.test(String(e))?p.animations[Number(e)]:p.animations.find(t=>t.name===e)??p.animations.find(t=>t.name.toLowerCase().includes(String(e).toLowerCase())),s=new Set,c=e=>{let t=r(e);return!t&&!s.has(String(e))&&(s.add(String(e)),u.issue(`asset-load`,`Model ${l.id} has no animation clip "${e}" (clips: ${p.animations.map(e=>e.name).join(`, `)})`,`objects#${l.id}.animation.clip`)),t},d=(n,r={})=>{let s=c(n);if(!s)return;let l=e.clipAction(s);l.setLoop(r.loop===!1?a:i,1/0),l.clampWhenFinished=r.loop===!1,l.timeScale=o(r.speed,1),l.enabled=!0,t&&t!==l?(l.reset().setEffectiveWeight(1).play(),t.crossFadeTo(l,o(r.crossfade,.3),!1)):l.setEffectiveWeight(1).play(),t=l},f=t=>{let n=c(t);if(!n)return null;let r=e.clipAction(n);return r.isRunning()||(r.enabled=!0,r.setLoop(i,1/0),r.play()),r},m={weight(e,t){f(e)?.setEffectiveWeight(Math.max(0,t))},speed(e,t){let n=f(e);n&&(n.timeScale=t)},time(e,t){let n=f(e);n&&(n.paused=!0,n.time=Math.max(0,t))}},g=l.animation??{},_=()=>{e.stopAllAction(),t=null,d(g.clip??0,g),g.offset&&t&&(t.time=Math.max(0,g.offset));for(let[e,t]of Object.entries(g.blend??{}))m.weight(e,t);e.update(0)};v={mixer:e,clips:p.animations,play:d,control:m,reset:_},_()}return{object:g,animator:v}}export{p as buildModel};
2
+ import{Ln as e,U as t,c as n,d as r,ht as i,mt as a}from"./three.module-CnI50X0U.js";import{v as o}from"./camera-Be6lnp3k.js";import{o as s}from"./runtime-NGp1VdnH.js";import{h as c}from"./index-tSGZFEt5.js";var l=new Map;function u(e){let t=new Uint8Array(e),n;if(t.byteLength>=20&&new DataView(e).getUint32(0,!0)===1179937895){let r=new DataView(e).getUint32(12,!0);n=new TextDecoder().decode(t.subarray(20,20+r))}else n=new TextDecoder().decode(t);try{let e=JSON.parse(n);return Array.isArray(e.extensionsUsed)?e.extensionsUsed.filter(e=>typeof e==`string`):[]}catch{return[]}}async function d(e){let t=l.get(e);return t||(t=(async()=>{let[{GLTFLoader:t},n]=await Promise.all([c(()=>import(`./GLTFLoader-1Zd9N406.js`),__vite__mapDeps([0,1,2,3]),import.meta.url),fetch(e)]);if(!n.ok)throw Error(`HTTP ${n.status} for ${e}`);let r=await n.arrayBuffer(),i=u(r);if(i.includes(`KHR_draco_mesh_compression`))throw Error(`${e} uses Draco compression (KHR_draco_mesh_compression), which the Agent3D runtime does not decode. Re-export it without Draco (Blender: uncheck "Compression"), or convert it to meshopt with gltfpack (\`gltfpack -i in.glb -o out.glb -cc\`), then run \`agent3d assets optimize\`.`);let a=new t;if(i.includes(`EXT_meshopt_compression`)){let{MeshoptDecoder:e}=await c(async()=>{let{MeshoptDecoder:e}=await import(`./meshopt_decoder.module-DXTYc6wn.js`);return{MeshoptDecoder:e}},[],import.meta.url);await e.ready,a.setMeshoptDecoder(e)}let o=e.slice(0,e.lastIndexOf(`/`)+1);return a.parseAsync(r,/^data:/.test(e)?``:o)})(),t.catch(()=>l.delete(e)),l.set(e,t)),t}function f(e,t){e.traverse(e=>{let n=e;if(n.isMesh&&n.morphTargetDictionary&&n.morphTargetInfluences)for(let[e,r]of Object.entries(t)){let t=n.morphTargetDictionary[e];t!==void 0&&typeof r==`number`&&(n.morphTargetInfluences[t]=r)}})}async function p(l,u){let p=await d(u.resolveAsset(l.src)),{clone:m}=await c(async()=>{let{clone:e}=await import(`./SkeletonUtils-CG5akqME.js`);return{clone:e}},[],import.meta.url),h=m(p.scene),g=new t;g.add(h),h.updateMatrixWorld(!0);let _=new r().setFromObject(h);if(!_.isEmpty()){let t=_.getSize(new e),n=Math.max(t.x,t.y,t.z),r=l.fit&&n>0?l.fit/n:1;if(h.scale.multiplyScalar(r),l.center!==!1){let t=_.getCenter(new e);h.position.set(-t.x*r,-_.min.y*r,-t.z*r)}}h.traverse(e=>{let t=e;t.isMesh&&(t.castShadow=l.castShadow??!0,t.receiveShadow=l.receiveShadow??!1)}),l.material&&await s(h,l.material,u),l.morph&&f(h,l.morph);let v;if(p.animations.length){let e=new n(h),t=null,r=e=>typeof e==`number`||/^\d+$/.test(String(e))?p.animations[Number(e)]:p.animations.find(t=>t.name===e)??p.animations.find(t=>t.name.toLowerCase().includes(String(e).toLowerCase())),s=new Set,c=e=>{let t=r(e);return!t&&!s.has(String(e))&&(s.add(String(e)),u.issue(`asset-load`,`Model ${l.id} has no animation clip "${e}" (clips: ${p.animations.map(e=>e.name).join(`, `)})`,`objects#${l.id}.animation.clip`)),t},d=(n,r={})=>{let s=c(n);if(!s)return;let l=e.clipAction(s);l.setLoop(r.loop===!1?a:i,1/0),l.clampWhenFinished=r.loop===!1,l.timeScale=o(r.speed,1),l.enabled=!0,t&&t!==l?(l.reset().setEffectiveWeight(1).play(),t.crossFadeTo(l,o(r.crossfade,.3),!1)):l.setEffectiveWeight(1).play(),t=l},f=t=>{let n=c(t);if(!n)return null;let r=e.clipAction(n);return r.isRunning()||(r.enabled=!0,r.setLoop(i,1/0),r.play()),r},m={weight(e,t){f(e)?.setEffectiveWeight(Math.max(0,t))},speed(e,t){let n=f(e);n&&(n.timeScale=t)},time(e,t){let n=f(e);n&&(n.paused=!0,n.time=Math.max(0,t))}},g=l.animation??{},_=()=>{e.stopAllAction(),t=null,d(g.clip??0,g),g.offset&&t&&(t.time=Math.max(0,g.offset));for(let[e,t]of Object.entries(g.blend??{}))m.weight(e,t);e.update(0)};v={mixer:e,clips:p.animations,play:d,control:m,reset:_},_()}return{object:g,animator:v}}export{p as buildModel};