@fleox/agent3d 0.0.0-stage → 0.2.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 (455) hide show
  1. package/LICENSE +143 -0
  2. package/README.md +396 -2
  3. package/changelog.json +68 -0
  4. package/dist/agent/agent3d.mjs +11242 -0
  5. package/dist/agent/chunks/assets-BUUM9TUB.mjs +2448 -0
  6. package/dist/agent/chunks/browser-t_JL_B82.mjs +226 -0
  7. package/dist/agent/chunks/cdp-Bdtm4fBN.mjs +178 -0
  8. package/dist/agent/chunks/check-CBO3Ekx1.mjs +971 -0
  9. package/dist/agent/chunks/export-BCI8vKw8.mjs +1130 -0
  10. package/dist/agent/chunks/gif-DQznzHTL.mjs +319 -0
  11. package/dist/agent/chunks/gltf-f_f0-OiV.mjs +207 -0
  12. package/dist/agent/chunks/imageCodec-Dz9PFxi9.mjs +101 -0
  13. package/dist/agent/chunks/jsonPath-DUCe1JpS.mjs +155 -0
  14. package/dist/agent/chunks/meshoptimizer-C-tN9jn5.mjs +1165 -0
  15. package/dist/agent/chunks/mp4-aOALfp3s.mjs +130 -0
  16. package/dist/agent/chunks/objects-DBAws7uf.mjs +53 -0
  17. package/dist/agent/chunks/optimizeSizing-CkZ3fZRp.mjs +540 -0
  18. package/dist/agent/chunks/package-BOIyp_2B.mjs +75 -0
  19. package/dist/agent/chunks/png-DXfSGJZt.mjs +91 -0
  20. package/dist/agent/chunks/render-CN4mgGLQ.mjs +1511 -0
  21. package/dist/agent/chunks/rolldown-runtime-ebOQtxsr.mjs +18 -0
  22. package/dist/agent/chunks/scene-BgajNvBf.mjs +444 -0
  23. package/dist/agent/chunks/server-CACCerkZ.mjs +237 -0
  24. package/dist/agent/chunks/suggest-Cpcgv1RP.mjs +46 -0
  25. package/dist/agent/chunks/tools-DT2tetIK.mjs +1412 -0
  26. package/dist/agent/chunks/tree-BrNYGui2.mjs +75 -0
  27. package/dist/agent/chunks/webpAnim-qaq9YgKl.mjs +132 -0
  28. package/dist/runtime/agent3d-runtime.js +373 -0
  29. package/dist/runtime/agent3d-runtime.single.js +7360 -0
  30. package/dist/runtime/chunks/BufferGeometryUtils-XmME4f7Z.js +1 -0
  31. package/dist/runtime/chunks/EXRLoader-CBdIpBMT.js +1 -0
  32. package/dist/runtime/chunks/FontLoader-dVu9WH2X.js +2 -0
  33. package/dist/runtime/chunks/GLTFLoader-Z9Inv-Xm.js +1 -0
  34. package/dist/runtime/chunks/GroundedSkybox-g1ASZWNu.js +1 -0
  35. package/dist/runtime/chunks/HDRLoader-DBOMWa7O.js +5 -0
  36. package/dist/runtime/chunks/OrbitControls-BIpWXK4x.js +1 -0
  37. package/dist/runtime/chunks/RectAreaLightUniformsLib-4ZzgX9vp.js +1 -0
  38. package/dist/runtime/chunks/RoomEnvironment-CXgfLJdO.js +1 -0
  39. package/dist/runtime/chunks/RoundedBoxGeometry-BViRogcJ.js +1 -0
  40. package/dist/runtime/chunks/SVGLoader-CV0U1EIF.js +1 -0
  41. package/dist/runtime/chunks/SkeletonUtils-DHlReJx3.js +1 -0
  42. package/dist/runtime/chunks/Sky-DGJXlPb_.js +243 -0
  43. package/dist/runtime/chunks/audio-DbVNbf-r.js +1 -0
  44. package/dist/runtime/chunks/catalog-DL6sgPay.js +1 -0
  45. package/dist/runtime/chunks/easing-CXSz2e6P.js +1 -0
  46. package/dist/runtime/chunks/extrude-D6WnITQq.js +1 -0
  47. package/dist/runtime/chunks/game-BoEiyZrL.js +20 -0
  48. package/dist/runtime/chunks/generators-D5JUo0jp.js +331 -0
  49. package/dist/runtime/chunks/materials-Dn-bYrZd.js +107 -0
  50. package/dist/runtime/chunks/meshGradient.glsl-BMatplLA.js +88 -0
  51. package/dist/runtime/chunks/meshopt_decoder.module-DXTYc6wn.js +1 -0
  52. package/dist/runtime/chunks/model-BCVF3QzB.js +1 -0
  53. package/dist/runtime/chunks/params-C2uoUDJ0.js +1 -0
  54. package/dist/runtime/chunks/physicsHost-ChPgysMQ.js +1 -0
  55. package/dist/runtime/chunks/postfx-UgKCbmZs.js +1527 -0
  56. package/dist/runtime/chunks/postfx-i_J5Vf-l.js +1 -0
  57. package/dist/runtime/chunks/random-eeej60NW.js +1 -0
  58. package/dist/runtime/chunks/shaders-Dw6zHdu_.js +443 -0
  59. package/dist/runtime/chunks/svg-CmlFY_8O.js +1 -0
  60. package/dist/runtime/chunks/text-D1EQpdSU.js +2 -0
  61. package/dist/runtime/chunks/three.module-DnaBiDAJ.js +4225 -0
  62. package/dist/runtime/chunks/toon-BsvVk_nK.js +6 -0
  63. package/dist/runtime/chunks/util-CyaW1fcW.js +1 -0
  64. package/dist/studio/assets/BufferGeometryUtils-CAlXAboW.js +1 -0
  65. package/dist/studio/assets/EXRLoader-BKkzlNd8.js +1 -0
  66. package/dist/studio/assets/FontLoader-Bzjx8mXt.js +2 -0
  67. package/dist/studio/assets/GLTFLoader-1Zd9N406.js +1 -0
  68. package/dist/studio/assets/GroundedSkybox-BEMqNCBD.js +1 -0
  69. package/dist/studio/assets/HDRLoader-DxB0kxPH.js +5 -0
  70. package/dist/studio/assets/OrbitControls-MlE9XiCg.js +1 -0
  71. package/dist/studio/assets/RectAreaLightUniformsLib-ClHrtYY6.js +1 -0
  72. package/dist/studio/assets/RoomEnvironment-MJ-jIEC8.js +1 -0
  73. package/dist/studio/assets/SVGLoader-CIYl0nEy.js +1 -0
  74. package/dist/studio/assets/SkeletonUtils-CG5akqME.js +1 -0
  75. package/dist/studio/assets/Sky-DNMfpp92.js +243 -0
  76. package/dist/studio/assets/audio-JD1kyX0A.js +1 -0
  77. package/dist/studio/assets/camera-7sEn13L-.js +2 -0
  78. package/dist/studio/assets/editor-CnbvVkhU.js +53 -0
  79. package/dist/studio/assets/extrude-9bG8hr2C.js +1 -0
  80. package/dist/studio/assets/game-B04KGAK0.js +19 -0
  81. package/dist/studio/assets/generators-LSni1Yfc.js +331 -0
  82. package/dist/studio/assets/index-3LL5NEIH.js +479 -0
  83. package/dist/studio/assets/index-BQT0otii.css +1 -0
  84. package/dist/studio/assets/meshopt_decoder.module-DXTYc6wn.js +1 -0
  85. package/dist/studio/assets/meshoptimizer-BCSwHBL3.js +1 -0
  86. package/dist/studio/assets/model-CNddhwmA.js +2 -0
  87. package/dist/studio/assets/physicsHost-hMU_SDiX.js +1 -0
  88. package/dist/studio/assets/postfx-BcCZS0Bq.js +1527 -0
  89. package/dist/studio/assets/runtime-DY_KqD1x.js +572 -0
  90. package/dist/studio/assets/shaders-BhMCstyv.js +443 -0
  91. package/dist/studio/assets/svg-CNKK-h7H.js +2 -0
  92. package/dist/studio/assets/text-BSPI7dk1.js +3 -0
  93. package/dist/studio/assets/three.module-CnI50X0U.js +4225 -0
  94. package/dist/studio/index.html +16 -0
  95. package/library/LICENSES.md +77 -0
  96. package/library/fonts/LICENSES.md +42 -0
  97. package/library/fonts/anton.typeface.json +1 -0
  98. package/library/fonts/bebas-neue.typeface.json +1 -0
  99. package/library/fonts/display.typeface.json +1 -0
  100. package/library/fonts/inter-black.typeface.json +1 -0
  101. package/library/fonts/lobster.typeface.json +1 -0
  102. package/library/fonts/mono.typeface.json +1 -0
  103. package/library/fonts/montserrat-extrabold.typeface.json +1 -0
  104. package/library/fonts/pacifico.typeface.json +1 -0
  105. package/library/fonts/sans-bold.typeface.json +1 -0
  106. package/library/fonts/sans.typeface.json +1 -0
  107. package/library/fonts/serif-bold.typeface.json +1 -0
  108. package/library/fonts/serif.typeface.json +1 -0
  109. package/library/fonts/space-grotesk-bold.typeface.json +1 -0
  110. package/library/hdri/beach.hdr +0 -0
  111. package/library/hdri/beach.jpg +0 -0
  112. package/library/hdri/city.hdr +0 -0
  113. package/library/hdri/city.jpg +0 -0
  114. package/library/hdri/forest.hdr +0 -0
  115. package/library/hdri/forest.jpg +0 -0
  116. package/library/hdri/night-city.hdr +0 -0
  117. package/library/hdri/night-city.jpg +0 -0
  118. package/library/hdri/night.hdr +0 -0
  119. package/library/hdri/night.jpg +0 -0
  120. package/library/hdri/sky.hdr +0 -0
  121. package/library/hdri/sky.jpg +0 -0
  122. package/library/hdri/softbox.hdr +0 -0
  123. package/library/hdri/softbox.jpg +0 -0
  124. package/library/hdri/studio.hdr +0 -0
  125. package/library/hdri/studio.jpg +0 -0
  126. package/library/hdri/sunset.hdr +0 -0
  127. package/library/hdri/sunset.jpg +0 -0
  128. package/library/hdri/warehouse.hdr +0 -0
  129. package/library/hdri/warehouse.jpg +0 -0
  130. package/library/index.json +5510 -0
  131. package/library/models/animals/fish.glb +0 -0
  132. package/library/models/animals/fox.glb +0 -0
  133. package/library/models/buildings/castle.glb +0 -0
  134. package/library/models/buildings/house.glb +0 -0
  135. package/library/models/buildings/market.glb +0 -0
  136. package/library/models/buildings/tavern.glb +0 -0
  137. package/library/models/buildings/tower.glb +0 -0
  138. package/library/models/buildings/windmill.glb +0 -0
  139. package/library/models/characters/barbarian.glb +0 -0
  140. package/library/models/characters/knight.glb +0 -0
  141. package/library/models/characters/mage.glb +0 -0
  142. package/library/models/characters/mini-soldier.glb +0 -0
  143. package/library/models/characters/platformer-hero.glb +0 -0
  144. package/library/models/characters/robot.glb +0 -0
  145. package/library/models/characters/rogue.glb +0 -0
  146. package/library/models/characters/skeleton.glb +0 -0
  147. package/library/models/city/building-a.glb +0 -0
  148. package/library/models/city/building-b.glb +0 -0
  149. package/library/models/city/building-tall.glb +0 -0
  150. package/library/models/city/fire-hydrant.glb +0 -0
  151. package/library/models/city/road-corner.glb +0 -0
  152. package/library/models/city/road-crossing.glb +0 -0
  153. package/library/models/city/road-junction.glb +0 -0
  154. package/library/models/city/road-straight.glb +0 -0
  155. package/library/models/city/streetlight.glb +0 -0
  156. package/library/models/city/suburban-house.glb +0 -0
  157. package/library/models/city/traffic-light.glb +0 -0
  158. package/library/models/city/water-tower.glb +0 -0
  159. package/library/models/food/apple.glb +0 -0
  160. package/library/models/food/avocado.glb +0 -0
  161. package/library/models/food/baguette.glb +0 -0
  162. package/library/models/food/bread-loaf.glb +0 -0
  163. package/library/models/food/burger.glb +0 -0
  164. package/library/models/food/carrot.glb +0 -0
  165. package/library/models/food/cheese.glb +0 -0
  166. package/library/models/food/cookie.glb +0 -0
  167. package/library/models/food/croissant.glb +0 -0
  168. package/library/models/food/cupcake.glb +0 -0
  169. package/library/models/food/dinner-plate.glb +0 -0
  170. package/library/models/food/donut.glb +0 -0
  171. package/library/models/food/ketchup.glb +0 -0
  172. package/library/models/food/mug.glb +0 -0
  173. package/library/models/food/pain-au-chocolat.glb +0 -0
  174. package/library/models/food/stew.glb +0 -0
  175. package/library/models/food/tomato.glb +0 -0
  176. package/library/models/food/veggie-burger.glb +0 -0
  177. package/library/models/nature/bush.glb +0 -0
  178. package/library/models/nature/cactus.glb +0 -0
  179. package/library/models/nature/cloud.glb +0 -0
  180. package/library/models/nature/fir-tree.glb +0 -0
  181. package/library/models/nature/forest-patch.glb +0 -0
  182. package/library/models/nature/grass-small.glb +0 -0
  183. package/library/models/nature/grass.glb +0 -0
  184. package/library/models/nature/hex-grass.glb +0 -0
  185. package/library/models/nature/hex-water.glb +0 -0
  186. package/library/models/nature/hills.glb +0 -0
  187. package/library/models/nature/mountain.glb +0 -0
  188. package/library/models/nature/pine-autumn.glb +0 -0
  189. package/library/models/nature/pine-tree.glb +0 -0
  190. package/library/models/nature/pumpkin.glb +0 -0
  191. package/library/models/nature/rock-flat.glb +0 -0
  192. package/library/models/nature/rock.glb +0 -0
  193. package/library/models/nature/tree-dead.glb +0 -0
  194. package/library/models/nature/tree-slim.glb +0 -0
  195. package/library/models/nature/trees-cluster.glb +0 -0
  196. package/library/models/nature/waterlily.glb +0 -0
  197. package/library/models/platformer/blaster.glb +0 -0
  198. package/library/models/platformer/block-coin.glb +0 -0
  199. package/library/models/platformer/brick.glb +0 -0
  200. package/library/models/platformer/coin.glb +0 -0
  201. package/library/models/platformer/enemy-flying.glb +0 -0
  202. package/library/models/platformer/flag.glb +0 -0
  203. package/library/models/platformer/platform-falling.glb +0 -0
  204. package/library/models/platformer/platform-grass-round.glb +0 -0
  205. package/library/models/platformer/platform-large.glb +0 -0
  206. package/library/models/platformer/platform-medium.glb +0 -0
  207. package/library/models/platformer/platform.glb +0 -0
  208. package/library/models/platformer/target.glb +0 -0
  209. package/library/models/platformer/track-corner.glb +0 -0
  210. package/library/models/platformer/track-straight.glb +0 -0
  211. package/library/models/platformer/wall-low.glb +0 -0
  212. package/library/models/products/boombox.glb +0 -0
  213. package/library/models/products/iridescent-lamp.glb +0 -0
  214. package/library/models/products/lantern.glb +0 -0
  215. package/library/models/products/lounge-chair.glb +0 -0
  216. package/library/models/products/sneaker.glb +0 -0
  217. package/library/models/products/velvet-sofa.glb +0 -0
  218. package/library/models/products/water-bottle.glb +0 -0
  219. package/library/models/props/alarm-clock.glb +0 -0
  220. package/library/models/props/armchair.glb +0 -0
  221. package/library/models/props/barrel.glb +0 -0
  222. package/library/models/props/bench.glb +0 -0
  223. package/library/models/props/brass-vase.glb +0 -0
  224. package/library/models/props/chest.glb +0 -0
  225. package/library/models/props/coffee-table.glb +0 -0
  226. package/library/models/props/coin-stack.glb +0 -0
  227. package/library/models/props/coin.glb +0 -0
  228. package/library/models/props/couch.glb +0 -0
  229. package/library/models/props/crate.glb +0 -0
  230. package/library/models/props/flag.glb +0 -0
  231. package/library/models/props/gravestone.glb +0 -0
  232. package/library/models/props/key.glb +0 -0
  233. package/library/models/props/lamp.glb +0 -0
  234. package/library/models/props/lantern.glb +0 -0
  235. package/library/models/props/marble-bust.glb +0 -0
  236. package/library/models/props/modern-armchair.glb +0 -0
  237. package/library/models/props/potted-succulent.glb +0 -0
  238. package/library/models/props/rubber-duck.glb +0 -0
  239. package/library/models/props/shield.glb +0 -0
  240. package/library/models/props/sword-shield.glb +0 -0
  241. package/library/models/props/sword.glb +0 -0
  242. package/library/models/props/table.glb +0 -0
  243. package/library/models/props/tent.glb +0 -0
  244. package/library/models/props/torch.glb +0 -0
  245. package/library/models/props/trophy.glb +0 -0
  246. package/library/models/space/base-module.glb +0 -0
  247. package/library/models/space/lander.glb +0 -0
  248. package/library/models/space/landing-pad.glb +0 -0
  249. package/library/models/space/rocks.glb +0 -0
  250. package/library/models/space/solar-panel.glb +0 -0
  251. package/library/models/space/space-truck.glb +0 -0
  252. package/library/models/space/wind-turbine.glb +0 -0
  253. package/library/models/vehicles/car.glb +0 -0
  254. package/library/models/vehicles/hatchback.glb +0 -0
  255. package/library/models/vehicles/motorcycle.glb +0 -0
  256. package/library/models/vehicles/police-car.glb +0 -0
  257. package/library/models/vehicles/taxi.glb +0 -0
  258. package/library/models/vehicles/truck.glb +0 -0
  259. package/library/sources.json +2856 -0
  260. package/library/textures/brick-color.jpg +0 -0
  261. package/library/textures/brick-normal.jpg +0 -0
  262. package/library/textures/brick-roughness.jpg +0 -0
  263. package/library/textures/concrete-color.jpg +0 -0
  264. package/library/textures/concrete-normal.jpg +0 -0
  265. package/library/textures/concrete-roughness.jpg +0 -0
  266. package/library/textures/fabric-color.jpg +0 -0
  267. package/library/textures/fabric-normal.jpg +0 -0
  268. package/library/textures/fabric-roughness.jpg +0 -0
  269. package/library/textures/grass-ground-color.jpg +0 -0
  270. package/library/textures/grass-ground-normal.jpg +0 -0
  271. package/library/textures/grass-ground-roughness.jpg +0 -0
  272. package/library/textures/rusty-metal-color.jpg +0 -0
  273. package/library/textures/rusty-metal-normal.jpg +0 -0
  274. package/library/textures/rusty-metal-roughness.jpg +0 -0
  275. package/library/textures/wood-planks-color.jpg +0 -0
  276. package/library/textures/wood-planks-normal.jpg +0 -0
  277. package/library/textures/wood-planks-roughness.jpg +0 -0
  278. package/package.json +67 -4
  279. package/plugin/.claude-plugin/plugin.json +19 -0
  280. package/plugin/skills/agent3d-assets/SKILL.md +140 -0
  281. package/plugin/skills/agent3d-assets/references/sources.md +33 -0
  282. package/plugin/skills/agent3d-create/SKILL.md +141 -0
  283. package/plugin/skills/agent3d-create/references/art-direction.md +144 -0
  284. package/plugin/skills/agent3d-create/references/recipes.md +1357 -0
  285. package/plugin/skills/agent3d-edit/SKILL.md +121 -0
  286. package/plugin/skills/agent3d-edit/references/patch-ops.md +278 -0
  287. package/plugin/skills/agent3d-game/SKILL.md +111 -0
  288. package/plugin/skills/agent3d-game/references/game-patterns.md +262 -0
  289. package/plugin/skills/agent3d-game/references/script-api.md +211 -0
  290. package/plugin/skills/agent3d-publish/SKILL.md +161 -0
  291. package/plugin/skills/agent3d-publish/references/integrations.md +221 -0
  292. package/templates/banner-aurora-night/README.md +15 -0
  293. package/templates/banner-aurora-night/agent3d.json +8 -0
  294. package/templates/banner-aurora-night/preview.png +0 -0
  295. package/templates/banner-aurora-night/scene.json +327 -0
  296. package/templates/banner-aurora-night/template.json +24 -0
  297. package/templates/banner-data-bars/README.md +15 -0
  298. package/templates/banner-data-bars/agent3d.json +8 -0
  299. package/templates/banner-data-bars/preview.png +0 -0
  300. package/templates/banner-data-bars/scene.json +222 -0
  301. package/templates/banner-data-bars/template.json +25 -0
  302. package/templates/banner-floating-shapes/README.md +15 -0
  303. package/templates/banner-floating-shapes/agent3d.json +8 -0
  304. package/templates/banner-floating-shapes/preview.png +0 -0
  305. package/templates/banner-floating-shapes/scene.json +703 -0
  306. package/templates/banner-floating-shapes/template.json +24 -0
  307. package/templates/banner-gradient-blob/README.md +16 -0
  308. package/templates/banner-gradient-blob/agent3d.json +8 -0
  309. package/templates/banner-gradient-blob/preview.png +0 -0
  310. package/templates/banner-gradient-blob/scene.json +330 -0
  311. package/templates/banner-gradient-blob/template.json +21 -0
  312. package/templates/banner-liquid-chrome/README.md +16 -0
  313. package/templates/banner-liquid-chrome/agent3d.json +8 -0
  314. package/templates/banner-liquid-chrome/preview.png +0 -0
  315. package/templates/banner-liquid-chrome/scene.json +290 -0
  316. package/templates/banner-liquid-chrome/template.json +24 -0
  317. package/templates/banner-logo-extrude/README.md +24 -0
  318. package/templates/banner-logo-extrude/agent3d.json +8 -0
  319. package/templates/banner-logo-extrude/assets/logo.svg +6 -0
  320. package/templates/banner-logo-extrude/assets/manifest.json +13 -0
  321. package/templates/banner-logo-extrude/preview.png +0 -0
  322. package/templates/banner-logo-extrude/scene.json +332 -0
  323. package/templates/banner-logo-extrude/template.json +22 -0
  324. package/templates/banner-neon-title/README.md +18 -0
  325. package/templates/banner-neon-title/agent3d.json +8 -0
  326. package/templates/banner-neon-title/preview.png +0 -0
  327. package/templates/banner-neon-title/scene.json +494 -0
  328. package/templates/banner-neon-title/template.json +25 -0
  329. package/templates/banner-wave-grid/README.md +18 -0
  330. package/templates/banner-wave-grid/agent3d.json +8 -0
  331. package/templates/banner-wave-grid/preview.png +0 -0
  332. package/templates/banner-wave-grid/scene.json +217 -0
  333. package/templates/banner-wave-grid/template.json +23 -0
  334. package/templates/card-hover-3d/README.md +16 -0
  335. package/templates/card-hover-3d/agent3d.json +8 -0
  336. package/templates/card-hover-3d/preview.png +0 -0
  337. package/templates/card-hover-3d/scene.json +359 -0
  338. package/templates/card-hover-3d/template.json +21 -0
  339. package/templates/card-product-tilt/README.md +14 -0
  340. package/templates/card-product-tilt/agent3d.json +8 -0
  341. package/templates/card-product-tilt/preview.png +0 -0
  342. package/templates/card-product-tilt/scene.json +296 -0
  343. package/templates/card-product-tilt/template.json +23 -0
  344. package/templates/character-mascot-hero/README.md +19 -0
  345. package/templates/character-mascot-hero/agent3d.json +8 -0
  346. package/templates/character-mascot-hero/preview.png +0 -0
  347. package/templates/character-mascot-hero/scene.json +512 -0
  348. package/templates/character-mascot-hero/template.json +8 -0
  349. package/templates/character-showcase/README.md +27 -0
  350. package/templates/character-showcase/agent3d.json +8 -0
  351. package/templates/character-showcase/preview.png +0 -0
  352. package/templates/character-showcase/scene.json +440 -0
  353. package/templates/character-showcase/template.json +24 -0
  354. package/templates/diorama-city/README.md +21 -0
  355. package/templates/diorama-city/agent3d.json +8 -0
  356. package/templates/diorama-city/preview.png +0 -0
  357. package/templates/diorama-city/scene.json +432 -0
  358. package/templates/diorama-city/template.json +21 -0
  359. package/templates/game-basket/README.md +25 -0
  360. package/templates/game-basket/agent3d.json +8 -0
  361. package/templates/game-basket/preview.png +0 -0
  362. package/templates/game-basket/scene.json +640 -0
  363. package/templates/game-basket/scripts/basket.js +176 -0
  364. package/templates/game-basket/template.json +8 -0
  365. package/templates/game-coin-collector/README.md +28 -0
  366. package/templates/game-coin-collector/agent3d.json +8 -0
  367. package/templates/game-coin-collector/preview.png +0 -0
  368. package/templates/game-coin-collector/scene.json +900 -0
  369. package/templates/game-coin-collector/scripts/collector.js +210 -0
  370. package/templates/game-coin-collector/template.json +19 -0
  371. package/templates/game-maze/README.md +24 -0
  372. package/templates/game-maze/agent3d.json +8 -0
  373. package/templates/game-maze/preview.png +0 -0
  374. package/templates/game-maze/scene.json +315 -0
  375. package/templates/game-maze/scripts/maze.js +168 -0
  376. package/templates/game-maze/template.json +18 -0
  377. package/templates/game-physics-playground/README.md +30 -0
  378. package/templates/game-physics-playground/agent3d.json +8 -0
  379. package/templates/game-physics-playground/preview.png +0 -0
  380. package/templates/game-physics-playground/scene.json +1712 -0
  381. package/templates/game-physics-playground/scripts/playground.js +151 -0
  382. package/templates/game-physics-playground/template.json +19 -0
  383. package/templates/game-platformer/README.md +26 -0
  384. package/templates/game-platformer/agent3d.json +8 -0
  385. package/templates/game-platformer/preview.png +0 -0
  386. package/templates/game-platformer/scene.json +1063 -0
  387. package/templates/game-platformer/scripts/platformer.js +222 -0
  388. package/templates/game-platformer/template.json +8 -0
  389. package/templates/game-runner/README.md +30 -0
  390. package/templates/game-runner/agent3d.json +8 -0
  391. package/templates/game-runner/preview.png +0 -0
  392. package/templates/game-runner/scene.json +1317 -0
  393. package/templates/game-runner/scripts/runner.js +263 -0
  394. package/templates/game-runner/template.json +18 -0
  395. package/templates/game-tap-targets/README.md +21 -0
  396. package/templates/game-tap-targets/agent3d.json +8 -0
  397. package/templates/game-tap-targets/preview.png +0 -0
  398. package/templates/game-tap-targets/scene.json +924 -0
  399. package/templates/game-tap-targets/scripts/targets.js +159 -0
  400. package/templates/game-tap-targets/template.json +19 -0
  401. package/templates/hero-floating-island/README.md +18 -0
  402. package/templates/hero-floating-island/agent3d.json +8 -0
  403. package/templates/hero-floating-island/preview.png +0 -0
  404. package/templates/hero-floating-island/scene.json +658 -0
  405. package/templates/hero-floating-island/template.json +8 -0
  406. package/templates/hero-perfume-luxury/README.md +18 -0
  407. package/templates/hero-perfume-luxury/agent3d.json +8 -0
  408. package/templates/hero-perfume-luxury/preview.png +0 -0
  409. package/templates/hero-perfume-luxury/scene.json +529 -0
  410. package/templates/hero-perfume-luxury/template.json +27 -0
  411. package/templates/hero-product-turntable/README.md +16 -0
  412. package/templates/hero-product-turntable/agent3d.json +8 -0
  413. package/templates/hero-product-turntable/preview.png +0 -0
  414. package/templates/hero-product-turntable/scene.json +225 -0
  415. package/templates/hero-product-turntable/template.json +21 -0
  416. package/templates/hero-saas-globe/README.md +16 -0
  417. package/templates/hero-saas-globe/agent3d.json +8 -0
  418. package/templates/hero-saas-globe/preview.png +0 -0
  419. package/templates/hero-saas-globe/scene.json +318 -0
  420. package/templates/hero-saas-globe/template.json +24 -0
  421. package/templates/hero-scroll-story/README.md +26 -0
  422. package/templates/hero-scroll-story/agent3d.json +8 -0
  423. package/templates/hero-scroll-story/preview.png +0 -0
  424. package/templates/hero-scroll-story/scene.json +642 -0
  425. package/templates/hero-scroll-story/template.json +22 -0
  426. package/templates/hero-sneaker-showcase/README.md +19 -0
  427. package/templates/hero-sneaker-showcase/agent3d.json +8 -0
  428. package/templates/hero-sneaker-showcase/preview.png +0 -0
  429. package/templates/hero-sneaker-showcase/scene.json +523 -0
  430. package/templates/hero-sneaker-showcase/template.json +23 -0
  431. package/templates/hero-space-planet/README.md +17 -0
  432. package/templates/hero-space-planet/agent3d.json +8 -0
  433. package/templates/hero-space-planet/preview.png +0 -0
  434. package/templates/hero-space-planet/scene.json +330 -0
  435. package/templates/hero-space-planet/template.json +21 -0
  436. package/templates/landscape-island/README.md +21 -0
  437. package/templates/landscape-island/agent3d.json +8 -0
  438. package/templates/landscape-island/preview.png +0 -0
  439. package/templates/landscape-island/scene.json +716 -0
  440. package/templates/landscape-island/template.json +24 -0
  441. package/templates/landscape-night-galaxy/README.md +25 -0
  442. package/templates/landscape-night-galaxy/agent3d.json +8 -0
  443. package/templates/landscape-night-galaxy/preview.png +0 -0
  444. package/templates/landscape-night-galaxy/scene.json +403 -0
  445. package/templates/landscape-night-galaxy/template.json +8 -0
  446. package/templates/landscape-valley-sunset/README.md +20 -0
  447. package/templates/landscape-valley-sunset/agent3d.json +8 -0
  448. package/templates/landscape-valley-sunset/preview.png +0 -0
  449. package/templates/landscape-valley-sunset/scene.json +265 -0
  450. package/templates/landscape-valley-sunset/template.json +22 -0
  451. package/templates/scene-cozy-room/README.md +21 -0
  452. package/templates/scene-cozy-room/agent3d.json +8 -0
  453. package/templates/scene-cozy-room/preview.png +0 -0
  454. package/templates/scene-cozy-room/scene.json +728 -0
  455. package/templates/scene-cozy-room/template.json +8 -0
@@ -0,0 +1,540 @@
1
+ import { createRequire as __a3dRequire } from "node:module";
2
+ import { fileURLToPath as __a3dPath } from "node:url";
3
+ import { dirname as __a3dDirname } from "node:path";
4
+ __a3dRequire(import.meta.url);
5
+ const __filename = __a3dPath(import.meta.url);
6
+ __a3dDirname(__filename);
7
+ import { S as CATALOG, b as isLibraryRef, f as DEFAULT_ASPECT, m as MATERIAL_TEXTURE_SLOTS, x as libraryId, y as findLibraryAsset } from "../agent3d.mjs";
8
+ import { o as walkObjects } from "./tree-BrNYGui2.mjs";
9
+ import { r as modelFileBounds, t as glbJson } from "./gltf-f_f0-OiV.mjs";
10
+ // src/ops/refs.ts
11
+ function visitAssetRefs(scene, visit) {
12
+ const env = scene.environment;
13
+ if (env) {
14
+ const bg = env.background;
15
+ if (bg && typeof bg === "object" && typeof bg.hdri === "string") {
16
+ const r = visit(bg.hdri, "environment.background.hdri", "hdri");
17
+ if (typeof r === "string") bg.hdri = r;
18
+ }
19
+ const lighting = env.lighting;
20
+ if (lighting && typeof lighting === "object" && typeof lighting.hdri === "string") {
21
+ const r = visit(lighting.hdri, "environment.lighting.hdri", "hdri");
22
+ if (typeof r === "string") lighting.hdri = r;
23
+ }
24
+ }
25
+ const material = (m, at) => {
26
+ if (!m || typeof m !== "object") return;
27
+ const mat = m;
28
+ for (const k of MATERIAL_TEXTURE_SLOTS) if (typeof mat[k] === "string") {
29
+ const r = visit(mat[k], `${at}.${k}`, "texture");
30
+ if (typeof r === "string") mat[k] = r;
31
+ }
32
+ };
33
+ walkObjects(scene.objects, (o) => {
34
+ const at = `objects#${o.id}`;
35
+ if (o.kind === "model" && typeof o.src === "string") {
36
+ const r = visit(o.src, `${at}.src`, "model");
37
+ if (typeof r === "string") o.src = r;
38
+ }
39
+ if (o.kind === "svg" && typeof o.src === "string" && !o.src.trim().startsWith("<")) {
40
+ const r = visit(o.src, `${at}.src`, "svg");
41
+ if (typeof r === "string") o.src = r;
42
+ }
43
+ if (o.kind === "text") {
44
+ const font = typeof o.font === "string" && o.font ? o.font : "sans-bold";
45
+ const r = visit(font.includes("/") || font.includes(":") ? font : `library:fonts/${font}.typeface.json`, `${at}.font`, "font");
46
+ if (typeof r === "string") o.font = r;
47
+ }
48
+ if ("material" in o) material(o.material, `${at}.material`);
49
+ });
50
+ const audio = scene.audio;
51
+ if (audio?.sounds) {
52
+ for (const [name, s] of Object.entries(audio.sounds)) if (s && typeof s === "object" && "src" in s && typeof s.src === "string") {
53
+ const r = visit(s.src, `audio.sounds.${name}.src`, "audio");
54
+ if (typeof r === "string") s.src = r;
55
+ }
56
+ }
57
+ if (audio?.music && typeof audio.music.src === "string") {
58
+ const r = visit(audio.music.src, "audio.music.src", "audio");
59
+ if (typeof r === "string") audio.music.src = r;
60
+ }
61
+ }
62
+ function collectAssetRefs(scene) {
63
+ const refs = [];
64
+ visitAssetRefs(scene, (path, at, kind) => void refs.push({
65
+ path,
66
+ at,
67
+ kind
68
+ }));
69
+ return refs;
70
+ }
71
+ function kindFromPath(path) {
72
+ const ext = path.toLowerCase().split("?")[0].split(".").pop() ?? "";
73
+ if ([
74
+ "glb",
75
+ "gltf",
76
+ "bin"
77
+ ].includes(ext)) return "model";
78
+ if (["hdr", "exr"].includes(ext)) return "hdri";
79
+ if ([
80
+ "png",
81
+ "jpg",
82
+ "jpeg",
83
+ "webp",
84
+ "ktx2",
85
+ "avif"
86
+ ].includes(ext)) return "texture";
87
+ if ([
88
+ "mp3",
89
+ "ogg",
90
+ "wav",
91
+ "m4a",
92
+ "aac",
93
+ "opus"
94
+ ].includes(ext)) return "audio";
95
+ if ([
96
+ "ttf",
97
+ "otf",
98
+ "woff",
99
+ "woff2",
100
+ "typeface"
101
+ ].includes(ext) || path.endsWith(".typeface.json")) return "font";
102
+ if (ext === "svg") return "svg";
103
+ return "other";
104
+ }
105
+ function mimeFromPath(path) {
106
+ return {
107
+ glb: "model/gltf-binary",
108
+ gltf: "model/gltf+json",
109
+ bin: "application/octet-stream",
110
+ png: "image/png",
111
+ jpg: "image/jpeg",
112
+ jpeg: "image/jpeg",
113
+ webp: "image/webp",
114
+ avif: "image/avif",
115
+ ktx2: "image/ktx2",
116
+ svg: "image/svg+xml",
117
+ hdr: "image/vnd.radiance",
118
+ exr: "image/x-exr",
119
+ mp3: "audio/mpeg",
120
+ ogg: "audio/ogg",
121
+ wav: "audio/wav",
122
+ m4a: "audio/mp4",
123
+ aac: "audio/aac",
124
+ opus: "audio/opus",
125
+ js: "text/javascript",
126
+ mjs: "text/javascript",
127
+ json: "application/json",
128
+ ttf: "font/ttf",
129
+ otf: "font/otf",
130
+ woff: "font/woff",
131
+ woff2: "font/woff2"
132
+ }[path.toLowerCase().split("?")[0].split(".").pop() ?? ""] ?? "application/octet-stream";
133
+ }
134
+ function gltfDependencies(gltfPath, gltfText) {
135
+ let json;
136
+ try {
137
+ json = JSON.parse(gltfText);
138
+ } catch {
139
+ return [];
140
+ }
141
+ const dir = gltfPath.includes("/") ? gltfPath.slice(0, gltfPath.lastIndexOf("/") + 1) : "";
142
+ const out = [];
143
+ for (const item of [...json.buffers ?? [], ...json.images ?? []]) {
144
+ const uri = item?.uri;
145
+ if (typeof uri !== "string" || uri.startsWith("data:") || /^[a-z]+:/i.test(uri)) continue;
146
+ out.push(joinPath(dir, decodeURIComponent(uri)));
147
+ }
148
+ return [...new Set(out)];
149
+ }
150
+ function joinPath(dir, rel) {
151
+ const parts = `${dir}${rel}`.split("/");
152
+ const out = [];
153
+ for (const p of parts) {
154
+ if (p === "" || p === ".") continue;
155
+ if (p === "..") out.pop();
156
+ else out.push(p);
157
+ }
158
+ return out.join("/");
159
+ }
160
+ // src/ops/optimizeSizing.ts
161
+ var TEXTURE_TIERS = [
162
+ 256,
163
+ 512,
164
+ 1024,
165
+ 2048
166
+ ];
167
+ var BACKGROUND_TIERS = [
168
+ 512,
169
+ 1024,
170
+ 2048,
171
+ 4096
172
+ ];
173
+ var FALLBACK_MAX_SIZE = 1024;
174
+ var REF_CSS_WIDTH = {
175
+ banner: 1440,
176
+ hero: 1440,
177
+ fullscreen: 1920,
178
+ inline: 800,
179
+ card: 400,
180
+ square: 600,
181
+ game: 1280
182
+ };
183
+ var MIN_COLOR_TIER = {
184
+ banner: 256,
185
+ hero: 512,
186
+ fullscreen: 512,
187
+ inline: 256,
188
+ card: 256,
189
+ square: 256,
190
+ game: 256
191
+ };
192
+ var MAX_TIER = {
193
+ banner: 2048,
194
+ hero: 2048,
195
+ fullscreen: 2048,
196
+ inline: 2048,
197
+ card: 1024,
198
+ square: 2048,
199
+ game: 1024
200
+ };
201
+ var ROLE_FACTOR = {
202
+ color: 1,
203
+ normal: .75,
204
+ data: .5,
205
+ background: 1,
206
+ lighting: 1
207
+ };
208
+ var MODEL_ATLAS_FACTOR = 1.5;
209
+ var MARGIN = 1.15;
210
+ function sceneViewport(scene) {
211
+ const kind = scene.target?.kind && scene.target.kind in REF_CSS_WIDTH ? scene.target.kind : "hero";
212
+ const dpr = Math.min(2, Math.max(1, Number(scene.target?.maxDpr) || 2));
213
+ const [aw, ah] = String(scene.target?.aspect ?? DEFAULT_ASPECT[kind]).split(":").map(Number);
214
+ const aspect = aw > 0 && ah > 0 ? aw / ah : 16 / 9;
215
+ const cssW = REF_CSS_WIDTH[kind];
216
+ let cssH = cssW / aspect;
217
+ const h = /^(\d+(?:\.\d+)?)(px|vh|svh|dvh|lvh)$/.exec(String(scene.target?.height ?? "").trim());
218
+ if (h) cssH = h[2] === "px" ? Number(h[1]) : 900 * Number(h[1]) / 100;
219
+ return {
220
+ width: Math.round(cssW * dpr),
221
+ height: Math.round(cssH * dpr),
222
+ dpr,
223
+ kind
224
+ };
225
+ }
226
+ function pickTier(pixels, tiers, min, max) {
227
+ const need = pixels / 1.12;
228
+ const t = tiers.find((x) => x >= need) ?? tiers[tiers.length - 1];
229
+ return Math.max(min, Math.min(max, t));
230
+ }
231
+ var v3 = (v, d) => Array.isArray(v) && v.length === 3 && v.every((x) => typeof x === "number") ? v : [
232
+ d,
233
+ d,
234
+ d
235
+ ];
236
+ var scaleOf = (s) => typeof s === "number" ? Math.abs(s) : Array.isArray(s) ? Math.max(...s.map((x) => Math.abs(Number(x) || 0))) || 1 : 1;
237
+ var dist = (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
238
+ var GEOMETRY_DEFAULTS = new Map(CATALOG.geometries.map((g) => [g.id, Object.fromEntries(g.params.map((p) => [p.name, p.default]))]));
239
+ function geometrySize(geometry) {
240
+ if (!geometry) return 1;
241
+ const p = {
242
+ ...GEOMETRY_DEFAULTS.get(String(geometry.type)) ?? {},
243
+ ...geometry
244
+ };
245
+ const n = (k) => typeof p[k] === "number" ? p[k] : 0;
246
+ const s = Math.max(n("width"), n("height"), n("depth"), n("length") + 2 * n("radius"), 2 * n("radius") + 2 * n("tube"), 2 * n("outerRadius"), 2 * n("radiusTop"), 2 * n("radiusBottom"), n("size"));
247
+ return s > 0 ? s : 1;
248
+ }
249
+ function placeObjects(scene) {
250
+ const out = [];
251
+ const visit = (objects, origin, parentScale) => {
252
+ for (const o of objects ?? []) {
253
+ if (!o || typeof o !== "object") continue;
254
+ const p = v3(o.position, 0);
255
+ const world = [
256
+ origin[0] + p[0] * parentScale,
257
+ origin[1] + p[1] * parentScale,
258
+ origin[2] + p[2] * parentScale
259
+ ];
260
+ const scale = parentScale * scaleOf(o.scale);
261
+ out.push({
262
+ object: o,
263
+ world,
264
+ scale
265
+ });
266
+ visit(o.children, world, scale);
267
+ }
268
+ };
269
+ visit(scene.objects, [
270
+ 0,
271
+ 0,
272
+ 0
273
+ ], 1);
274
+ return out;
275
+ }
276
+ function trackValues(scene, target) {
277
+ return (scene.timeline?.tracks ?? []).filter((t) => t?.target === target).flatMap((t) => (t.keys ?? []).map((k) => k?.[1]));
278
+ }
279
+ function cameraPositions(scene) {
280
+ const cam = scene.camera;
281
+ const list = [v3(cam?.position, 5)];
282
+ for (const s of cam?.scrollPath ?? []) if (Array.isArray(s?.position)) list.push(v3(s.position, 5));
283
+ for (const v of trackValues(scene, "camera.position")) if (Array.isArray(v) && v.length === 3) list.push(v);
284
+ return list;
285
+ }
286
+ function closestDistance(scene, point, objectId, radius) {
287
+ const cam = scene.camera;
288
+ let d = Math.min(...cameraPositions(scene).map((c) => dist(c, point)));
289
+ let note;
290
+ if (cam?.controls === "follow" && cam.follow) {
291
+ const off = v3(cam.follow.offset, 0);
292
+ const f = Math.hypot(...off) || d;
293
+ if (cam.follow.target === objectId) d = f;
294
+ else d = Math.min(d, f);
295
+ note = "follow camera";
296
+ }
297
+ if (cam?.controls === "orbit" && cam.orbitZoom !== false) {
298
+ const min = Number(cam.orbitLimits?.minDistance);
299
+ const zoomed = Number.isFinite(min) && min > 0 ? min : d * .6;
300
+ if (zoomed < d) {
301
+ d = zoomed;
302
+ note = "orbit zoom";
303
+ }
304
+ }
305
+ if (cam?.controls === "parallax") d *= .9;
306
+ return {
307
+ d: Math.max(d - radius * .5, radius * .35, Number(cam?.near) || .1),
308
+ note
309
+ };
310
+ }
311
+ function projectedPixels(scene, vp, size, d) {
312
+ const cam = scene.camera;
313
+ if (cam?.type === "orthographic") {
314
+ const visible = Number(cam.zoom) > 0 ? Number(cam.zoom) : 10;
315
+ return size * vp.height / visible;
316
+ }
317
+ const fovs = [Number(cam?.fov) || 45, ...trackValues(scene, "camera.fov").map(Number).filter((x) => x > 0)];
318
+ const fov = Math.min(...fovs);
319
+ const visible = 2 * d * Math.tan(fov * Math.PI / 180 / 2);
320
+ return size * vp.height / Math.max(visible, .001);
321
+ }
322
+ async function objectSize(fs, o, ctx) {
323
+ switch (o.kind) {
324
+ case "mesh": return geometrySize(o.geometry);
325
+ case "text": return Math.max(1, (Number(o.size) || 1) * Math.max(1, String(o.text ?? "").split("\n").reduce((m, l) => Math.max(m, l.length), 0)) * .65);
326
+ case "model":
327
+ if (typeof o.fit === "number" && o.fit > 0) return o.fit;
328
+ if (isLibraryRef(o.src)) {
329
+ const s = findLibraryAsset(ctx.library, libraryId(o.src))?.size;
330
+ if (s) return Math.max(...s);
331
+ } else {
332
+ const b = await modelFileBounds(fs, String(o.src ?? "")).catch(() => null);
333
+ if (b) return Math.max(...b.size);
334
+ }
335
+ return 1;
336
+ default: return 1;
337
+ }
338
+ }
339
+ function decide(cur, use, tiers, min, max) {
340
+ const tier = pickTier(use.pixels, tiers, min, max);
341
+ if (!cur) return {
342
+ maxSize: tier,
343
+ reason: `${use.why} → ${tier} px`,
344
+ uses: [use]
345
+ };
346
+ const uses = [...cur.uses, use];
347
+ const head = tier > cur.maxSize ? `${use.why} → ${tier} px` : cur.reason.replace(/ \(largest of \d+ uses\)$/, "");
348
+ return {
349
+ maxSize: Math.max(tier, cur.maxSize),
350
+ reason: `${head} (largest of ${uses.length} uses)`,
351
+ uses
352
+ };
353
+ }
354
+ function addUse(map, path, use, tiers, min, max) {
355
+ map.set(path, decide(map.get(path), use, tiers, min, max));
356
+ }
357
+ var round = (n) => Math.round(n);
358
+ async function planTextureSizes(fs, scene, ctx = {}) {
359
+ const vp = sceneViewport(scene);
360
+ const files = /* @__PURE__ */ new Map();
361
+ const modelRoles = /* @__PURE__ */ new Map();
362
+ const max = MAX_TIER[vp.kind];
363
+ const where = `${vp.kind} ${vp.width}x${vp.height}`;
364
+ for (const { object: o, world, scale } of placeObjects(scene)) {
365
+ const base = await objectSize(fs, o, ctx) * scale;
366
+ const scaleKeys = trackValues(scene, `${o.id}.scale`).map(scaleOf);
367
+ const grown = base * Math.max(1, ...scaleKeys);
368
+ const points = [world, ...trackValues(scene, `${o.id}.position`).filter((v) => Array.isArray(v) && v.length === 3).map((v) => v)];
369
+ let best = { d: Infinity };
370
+ for (const p of points) {
371
+ const c = closestDistance(scene, p, o.id, grown);
372
+ if (c.d < best.d) best = c;
373
+ }
374
+ const projected = Math.min(projectedPixels(scene, vp, grown, best.d), Math.max(vp.width, vp.height) * 1.5);
375
+ const dist = `${grown.toFixed(2)} u at ${best.d.toFixed(1)} u${best.note ? ` (${best.note})` : ""}`;
376
+ if (o.kind === "model" && typeof o.src === "string" && (ctx.includeLibrary || !isLibraryRef(o.src)) && /\.glb$/i.test(o.src)) {
377
+ const roles = modelRoles.get(o.src) ?? {};
378
+ for (const role of [
379
+ "color",
380
+ "normal",
381
+ "data"
382
+ ]) {
383
+ const pixels = projected * MODEL_ATLAS_FACTOR * ROLE_FACTOR[role] * MARGIN;
384
+ const use = {
385
+ at: `objects#${o.id}.src`,
386
+ role,
387
+ pixels: round(pixels),
388
+ why: `${role} atlas of model "${o.id}", ${dist} ≈ ${round(projected)} px on a ${where} canvas`
389
+ };
390
+ roles[role] = decide(roles[role], use, TEXTURE_TIERS, role === "color" ? MIN_COLOR_TIER[vp.kind] : 256, max);
391
+ }
392
+ modelRoles.set(o.src, roles);
393
+ addUse(files, o.src, {
394
+ at: `objects#${o.id}.src`,
395
+ role: "color",
396
+ pixels: round(projected * MODEL_ATLAS_FACTOR * MARGIN),
397
+ why: `model "${o.id}", ${dist} ≈ ${round(projected)} px on a ${where} canvas`
398
+ }, TEXTURE_TIERS, MIN_COLOR_TIER[vp.kind], max);
399
+ }
400
+ const mat = o.material;
401
+ if (mat && typeof mat === "object") {
402
+ const rep = Array.isArray(mat.repeat) ? Math.max(1, ...mat.repeat.map((x) => Math.abs(Number(x) || 1))) : 1;
403
+ for (const [k, role] of [
404
+ ["map", "color"],
405
+ ["normalMap", "normal"],
406
+ ["roughnessMap", "data"]
407
+ ]) {
408
+ const path = mat[k];
409
+ if (typeof path !== "string" || isLibraryRef(path) && !ctx.includeLibrary) continue;
410
+ const pixels = projected / rep * ROLE_FACTOR[role] * MARGIN;
411
+ addUse(files, path, {
412
+ at: `objects#${o.id}.material.${k}`,
413
+ role,
414
+ pixels: round(pixels),
415
+ why: `${k} of "${o.id}", ${dist}${rep > 1 ? `, repeat ${rep}` : ""} ≈ ${round(projected / rep)} px per tile on a ${where} canvas`
416
+ }, TEXTURE_TIERS, role === "color" ? MIN_COLOR_TIER[vp.kind] : 256, max);
417
+ }
418
+ }
419
+ }
420
+ const env = scene.environment;
421
+ const bg = env?.background;
422
+ if (bg && typeof bg === "object" && typeof bg.hdri === "string" && (ctx.includeLibrary || !isLibraryRef(bg.hdri))) {
423
+ const fov = Number(scene.camera?.fov) || 45;
424
+ const hfov = 2 * Math.atan(Math.tan(fov * Math.PI / 180 / 2) * (vp.width / vp.height)) * 180 / Math.PI;
425
+ const blur = Math.max(0, Number(bg.blur) || 0);
426
+ const pixels = vp.width * 360 / Math.max(hfov, 10) / (1 + blur * 8);
427
+ addUse(files, bg.hdri, {
428
+ at: "environment.background.hdri",
429
+ role: "background",
430
+ pixels: round(pixels),
431
+ why: `equirect background seen ${round(hfov)}° wide on a ${where} canvas${blur ? `, blur ${blur}` : ""} needs ≈ ${round(pixels)} px`
432
+ }, BACKGROUND_TIERS, 1024, 4096);
433
+ }
434
+ const lighting = env?.lighting;
435
+ if (lighting && typeof lighting === "object" && typeof lighting.hdri === "string" && (ctx.includeLibrary || !isLibraryRef(lighting.hdri))) addUse(files, lighting.hdri, {
436
+ at: "environment.lighting.hdri",
437
+ role: "lighting",
438
+ pixels: 1024,
439
+ why: "image-based lighting only (prefiltered to a 256 px cube map)"
440
+ }, BACKGROUND_TIERS, 1024, 1024);
441
+ return {
442
+ viewport: vp,
443
+ files,
444
+ modelRoles
445
+ };
446
+ }
447
+ function imageHeader(bytes) {
448
+ const b = bytes;
449
+ const dv = new DataView(b.buffer, b.byteOffset, b.byteLength);
450
+ if (b.byteLength > 24 && b[0] === 137 && b[1] === 80 && b[2] === 78 && b[3] === 71) {
451
+ const colorType = b[25];
452
+ return {
453
+ width: dv.getUint32(16),
454
+ height: dv.getUint32(20),
455
+ mimeType: "image/png",
456
+ alpha: colorType === 4 || colorType === 6 ? "maybe" : colorType === 3 ? "maybe" : false
457
+ };
458
+ }
459
+ if (b.byteLength > 4 && b[0] === 255 && b[1] === 216) {
460
+ let off = 2;
461
+ while (off + 9 < b.byteLength) {
462
+ if (b[off] !== 255) {
463
+ off++;
464
+ continue;
465
+ }
466
+ const marker = b[off + 1];
467
+ if (marker === 216 || marker === 1 || marker >= 208 && marker <= 215) {
468
+ off += 2;
469
+ continue;
470
+ }
471
+ const len = dv.getUint16(off + 2);
472
+ if (marker >= 192 && marker <= 207 && marker !== 196 && marker !== 200 && marker !== 204) return {
473
+ height: dv.getUint16(off + 5),
474
+ width: dv.getUint16(off + 7),
475
+ mimeType: "image/jpeg",
476
+ alpha: false
477
+ };
478
+ off += 2 + len;
479
+ }
480
+ return null;
481
+ }
482
+ if (b.byteLength > 30 && String.fromCharCode(b[0], b[1], b[2], b[3]) === "RIFF" && String.fromCharCode(b[8], b[9], b[10], b[11]) === "WEBP") {
483
+ const chunk = String.fromCharCode(b[12], b[13], b[14], b[15]);
484
+ if (chunk === "VP8 ") return {
485
+ width: dv.getUint16(26, true) & 16383,
486
+ height: dv.getUint16(28, true) & 16383,
487
+ mimeType: "image/webp",
488
+ alpha: false
489
+ };
490
+ if (chunk === "VP8L") {
491
+ const v = dv.getUint32(21, true);
492
+ return {
493
+ width: (v & 16383) + 1,
494
+ height: (v >> 14 & 16383) + 1,
495
+ mimeType: "image/webp",
496
+ alpha: v >> 28 & 1 ? "maybe" : false
497
+ };
498
+ }
499
+ if (chunk === "VP8X") return {
500
+ width: 1 + (b[24] | b[25] << 8 | b[26] << 16),
501
+ height: 1 + (b[27] | b[28] << 8 | b[29] << 16),
502
+ mimeType: "image/webp",
503
+ alpha: b[20] & 16 ? "maybe" : false
504
+ };
505
+ }
506
+ return null;
507
+ }
508
+ var kb = (n) => Math.round(n / 102.4) / 10;
509
+ async function optimizeSuggestions(fs, scene, opts = {}) {
510
+ const out = {
511
+ models: [],
512
+ textures: []
513
+ };
514
+ const files = (await fs.list("assets/")).filter((f) => /\.(png|jpe?g|webp|glb)$/i.test(f));
515
+ if (!files.length) return out;
516
+ const sizing = await planTextureSizes(fs, scene, opts);
517
+ for (const path of files) {
518
+ const bytes = await fs.readBytes(path);
519
+ if (/\.glb$/i.test(path)) {
520
+ if (bytes.byteLength < 51200) continue;
521
+ const json = glbJson(bytes);
522
+ const used = json?.extensionsUsed ?? [];
523
+ if (json && json.meshes?.length && !used.includes("EXT_meshopt_compression") && !used.includes("KHR_draco_mesh_compression") && !(json.accessors ?? []).some((a) => a.sparse)) out.models.push({
524
+ path,
525
+ kb: kb(bytes.byteLength)
526
+ });
527
+ continue;
528
+ }
529
+ const h = imageHeader(bytes);
530
+ const d = sizing.files.get(path);
531
+ if (h && d && Math.max(h.width, h.height) >= d.maxSize * 2) out.textures.push({
532
+ path,
533
+ size: Math.max(h.width, h.height),
534
+ maxSize: d.maxSize,
535
+ kb: kb(bytes.byteLength)
536
+ });
537
+ }
538
+ return out;
539
+ }
540
+ export { collectAssetRefs as a, mimeFromPath as c, planTextureSizes as i, visitAssetRefs as l, imageHeader as n, gltfDependencies as o, optimizeSuggestions as r, kindFromPath as s, FALLBACK_MAX_SIZE as t };
@@ -0,0 +1,75 @@
1
+ import { createRequire as __a3dRequire } from "node:module";
2
+ import { fileURLToPath as __a3dPath } from "node:url";
3
+ import { dirname as __a3dDirname } from "node:path";
4
+ __a3dRequire(import.meta.url);
5
+ const __filename = __a3dPath(import.meta.url);
6
+ __a3dDirname(__filename);
7
+ import { t as __exportAll } from "./rolldown-runtime-ebOQtxsr.mjs";
8
+ // package.json
9
+ var package_exports = /* @__PURE__ */ __exportAll({ default: () => package_default });
10
+ var name = "@fleox/agent3d";
11
+ var version = "0.2.1";
12
+ var package_default = {
13
+ name,
14
+ version,
15
+ type: "module",
16
+ 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.",
17
+ license: "SEE LICENSE IN LICENSE",
18
+ engines: { "node": ">=20" },
19
+ bin: { "agent3d": "dist/agent/agent3d.mjs" },
20
+ files: [
21
+ "dist/agent",
22
+ "dist/runtime",
23
+ "dist/studio",
24
+ "library",
25
+ "templates",
26
+ "plugin",
27
+ "changelog.json",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ scripts: {
32
+ "dev": "vite",
33
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.agent.json",
34
+ "test": "vitest run",
35
+ "test:watch": "vitest",
36
+ "build:runtime": "vite build --config vite.runtime.config.ts && vite build --config vite.runtime.config.ts --mode single",
37
+ "build:studio": "vite build",
38
+ "build:agent": "vite build --config vite.agent.config.ts",
39
+ "build": "npm run build:runtime && npm run build:studio && npm run build:agent && node scripts/write-version.mjs",
40
+ "check:skills": "node scripts/check-skills.mjs",
41
+ "hermes:build": "node scripts/build-hermes.mjs",
42
+ "check:hermes": "node scripts/build-hermes.mjs --check && python3 -m unittest discover -s hermes/tests",
43
+ "docs:cli": "node scripts/build-cli-docs.mjs",
44
+ "check:docs": "node scripts/build-cli-docs.mjs --check",
45
+ "version": "node scripts/sync-version.mjs && npm run build && node scripts/build-hermes.mjs && node scripts/build-cli-docs.mjs && git add -A plugin hermes .claude-plugin README.md docs integrations/agentcms/README.md",
46
+ "prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:skills"
47
+ },
48
+ devDependencies: {
49
+ "@types/node": "^26.6.6",
50
+ "@types/react": "^19.3.0",
51
+ "@types/react-dom": "^19.3.0",
52
+ "@types/three": "^0.187.0",
53
+ "@vitejs/plugin-react": "^6.3.0",
54
+ "autoprefixer": "^10.7.0",
55
+ "cannon-es": "^0.20.0",
56
+ "clsx": "^2.1.1",
57
+ "happy-dom": "^21.0.4",
58
+ "lucide-react": "^1.77.0",
59
+ "meshoptimizer": "~1.1.1",
60
+ "postcss": "^8.5.33",
61
+ "react": "^19.3.1",
62
+ "react-dom": "^19.3.1",
63
+ "tailwindcss": "^3.4.19",
64
+ "three": "^0.187.0",
65
+ "typescript": "^7.0.2",
66
+ "vite": "^8.3.8",
67
+ "vitest": "^5.1.1"
68
+ },
69
+ repository: {
70
+ "type": "git",
71
+ "url": "git+https://github.com/fleox/agent3d.git"
72
+ },
73
+ publishConfig: { "access": "public" }
74
+ };
75
+ export { package_exports as n, version as r, package_default as t };