@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.
- package/LICENSE +143 -0
- package/README.md +396 -2
- package/changelog.json +68 -0
- package/dist/agent/agent3d.mjs +11242 -0
- package/dist/agent/chunks/assets-BUUM9TUB.mjs +2448 -0
- package/dist/agent/chunks/browser-t_JL_B82.mjs +226 -0
- package/dist/agent/chunks/cdp-Bdtm4fBN.mjs +178 -0
- package/dist/agent/chunks/check-CBO3Ekx1.mjs +971 -0
- package/dist/agent/chunks/export-BCI8vKw8.mjs +1130 -0
- package/dist/agent/chunks/gif-DQznzHTL.mjs +319 -0
- package/dist/agent/chunks/gltf-f_f0-OiV.mjs +207 -0
- package/dist/agent/chunks/imageCodec-Dz9PFxi9.mjs +101 -0
- package/dist/agent/chunks/jsonPath-DUCe1JpS.mjs +155 -0
- package/dist/agent/chunks/meshoptimizer-C-tN9jn5.mjs +1165 -0
- package/dist/agent/chunks/mp4-aOALfp3s.mjs +130 -0
- package/dist/agent/chunks/objects-DBAws7uf.mjs +53 -0
- package/dist/agent/chunks/optimizeSizing-CkZ3fZRp.mjs +540 -0
- package/dist/agent/chunks/package-BOIyp_2B.mjs +75 -0
- package/dist/agent/chunks/png-DXfSGJZt.mjs +91 -0
- package/dist/agent/chunks/render-CN4mgGLQ.mjs +1511 -0
- package/dist/agent/chunks/rolldown-runtime-ebOQtxsr.mjs +18 -0
- package/dist/agent/chunks/scene-BgajNvBf.mjs +444 -0
- package/dist/agent/chunks/server-CACCerkZ.mjs +237 -0
- package/dist/agent/chunks/suggest-Cpcgv1RP.mjs +46 -0
- package/dist/agent/chunks/tools-DT2tetIK.mjs +1412 -0
- package/dist/agent/chunks/tree-BrNYGui2.mjs +75 -0
- package/dist/agent/chunks/webpAnim-qaq9YgKl.mjs +132 -0
- package/dist/runtime/agent3d-runtime.js +373 -0
- package/dist/runtime/agent3d-runtime.single.js +7360 -0
- package/dist/runtime/chunks/BufferGeometryUtils-XmME4f7Z.js +1 -0
- package/dist/runtime/chunks/EXRLoader-CBdIpBMT.js +1 -0
- package/dist/runtime/chunks/FontLoader-dVu9WH2X.js +2 -0
- package/dist/runtime/chunks/GLTFLoader-Z9Inv-Xm.js +1 -0
- package/dist/runtime/chunks/GroundedSkybox-g1ASZWNu.js +1 -0
- package/dist/runtime/chunks/HDRLoader-DBOMWa7O.js +5 -0
- package/dist/runtime/chunks/OrbitControls-BIpWXK4x.js +1 -0
- package/dist/runtime/chunks/RectAreaLightUniformsLib-4ZzgX9vp.js +1 -0
- package/dist/runtime/chunks/RoomEnvironment-CXgfLJdO.js +1 -0
- package/dist/runtime/chunks/RoundedBoxGeometry-BViRogcJ.js +1 -0
- package/dist/runtime/chunks/SVGLoader-CV0U1EIF.js +1 -0
- package/dist/runtime/chunks/SkeletonUtils-DHlReJx3.js +1 -0
- package/dist/runtime/chunks/Sky-DGJXlPb_.js +243 -0
- package/dist/runtime/chunks/audio-DbVNbf-r.js +1 -0
- package/dist/runtime/chunks/catalog-DL6sgPay.js +1 -0
- package/dist/runtime/chunks/easing-CXSz2e6P.js +1 -0
- package/dist/runtime/chunks/extrude-D6WnITQq.js +1 -0
- package/dist/runtime/chunks/game-BoEiyZrL.js +20 -0
- package/dist/runtime/chunks/generators-D5JUo0jp.js +331 -0
- package/dist/runtime/chunks/materials-Dn-bYrZd.js +107 -0
- package/dist/runtime/chunks/meshGradient.glsl-BMatplLA.js +88 -0
- package/dist/runtime/chunks/meshopt_decoder.module-DXTYc6wn.js +1 -0
- package/dist/runtime/chunks/model-BCVF3QzB.js +1 -0
- package/dist/runtime/chunks/params-C2uoUDJ0.js +1 -0
- package/dist/runtime/chunks/physicsHost-ChPgysMQ.js +1 -0
- package/dist/runtime/chunks/postfx-UgKCbmZs.js +1527 -0
- package/dist/runtime/chunks/postfx-i_J5Vf-l.js +1 -0
- package/dist/runtime/chunks/random-eeej60NW.js +1 -0
- package/dist/runtime/chunks/shaders-Dw6zHdu_.js +443 -0
- package/dist/runtime/chunks/svg-CmlFY_8O.js +1 -0
- package/dist/runtime/chunks/text-D1EQpdSU.js +2 -0
- package/dist/runtime/chunks/three.module-DnaBiDAJ.js +4225 -0
- package/dist/runtime/chunks/toon-BsvVk_nK.js +6 -0
- package/dist/runtime/chunks/util-CyaW1fcW.js +1 -0
- package/dist/studio/assets/BufferGeometryUtils-CAlXAboW.js +1 -0
- package/dist/studio/assets/EXRLoader-BKkzlNd8.js +1 -0
- package/dist/studio/assets/FontLoader-Bzjx8mXt.js +2 -0
- package/dist/studio/assets/GLTFLoader-1Zd9N406.js +1 -0
- package/dist/studio/assets/GroundedSkybox-BEMqNCBD.js +1 -0
- package/dist/studio/assets/HDRLoader-DxB0kxPH.js +5 -0
- package/dist/studio/assets/OrbitControls-MlE9XiCg.js +1 -0
- package/dist/studio/assets/RectAreaLightUniformsLib-ClHrtYY6.js +1 -0
- package/dist/studio/assets/RoomEnvironment-MJ-jIEC8.js +1 -0
- package/dist/studio/assets/SVGLoader-CIYl0nEy.js +1 -0
- package/dist/studio/assets/SkeletonUtils-CG5akqME.js +1 -0
- package/dist/studio/assets/Sky-DNMfpp92.js +243 -0
- package/dist/studio/assets/audio-JD1kyX0A.js +1 -0
- package/dist/studio/assets/camera-7sEn13L-.js +2 -0
- package/dist/studio/assets/editor-CnbvVkhU.js +53 -0
- package/dist/studio/assets/extrude-9bG8hr2C.js +1 -0
- package/dist/studio/assets/game-B04KGAK0.js +19 -0
- package/dist/studio/assets/generators-LSni1Yfc.js +331 -0
- package/dist/studio/assets/index-3LL5NEIH.js +479 -0
- package/dist/studio/assets/index-BQT0otii.css +1 -0
- package/dist/studio/assets/meshopt_decoder.module-DXTYc6wn.js +1 -0
- package/dist/studio/assets/meshoptimizer-BCSwHBL3.js +1 -0
- package/dist/studio/assets/model-CNddhwmA.js +2 -0
- package/dist/studio/assets/physicsHost-hMU_SDiX.js +1 -0
- package/dist/studio/assets/postfx-BcCZS0Bq.js +1527 -0
- package/dist/studio/assets/runtime-DY_KqD1x.js +572 -0
- package/dist/studio/assets/shaders-BhMCstyv.js +443 -0
- package/dist/studio/assets/svg-CNKK-h7H.js +2 -0
- package/dist/studio/assets/text-BSPI7dk1.js +3 -0
- package/dist/studio/assets/three.module-CnI50X0U.js +4225 -0
- package/dist/studio/index.html +16 -0
- package/library/LICENSES.md +77 -0
- package/library/fonts/LICENSES.md +42 -0
- package/library/fonts/anton.typeface.json +1 -0
- package/library/fonts/bebas-neue.typeface.json +1 -0
- package/library/fonts/display.typeface.json +1 -0
- package/library/fonts/inter-black.typeface.json +1 -0
- package/library/fonts/lobster.typeface.json +1 -0
- package/library/fonts/mono.typeface.json +1 -0
- package/library/fonts/montserrat-extrabold.typeface.json +1 -0
- package/library/fonts/pacifico.typeface.json +1 -0
- package/library/fonts/sans-bold.typeface.json +1 -0
- package/library/fonts/sans.typeface.json +1 -0
- package/library/fonts/serif-bold.typeface.json +1 -0
- package/library/fonts/serif.typeface.json +1 -0
- package/library/fonts/space-grotesk-bold.typeface.json +1 -0
- package/library/hdri/beach.hdr +0 -0
- package/library/hdri/beach.jpg +0 -0
- package/library/hdri/city.hdr +0 -0
- package/library/hdri/city.jpg +0 -0
- package/library/hdri/forest.hdr +0 -0
- package/library/hdri/forest.jpg +0 -0
- package/library/hdri/night-city.hdr +0 -0
- package/library/hdri/night-city.jpg +0 -0
- package/library/hdri/night.hdr +0 -0
- package/library/hdri/night.jpg +0 -0
- package/library/hdri/sky.hdr +0 -0
- package/library/hdri/sky.jpg +0 -0
- package/library/hdri/softbox.hdr +0 -0
- package/library/hdri/softbox.jpg +0 -0
- package/library/hdri/studio.hdr +0 -0
- package/library/hdri/studio.jpg +0 -0
- package/library/hdri/sunset.hdr +0 -0
- package/library/hdri/sunset.jpg +0 -0
- package/library/hdri/warehouse.hdr +0 -0
- package/library/hdri/warehouse.jpg +0 -0
- package/library/index.json +5510 -0
- package/library/models/animals/fish.glb +0 -0
- package/library/models/animals/fox.glb +0 -0
- package/library/models/buildings/castle.glb +0 -0
- package/library/models/buildings/house.glb +0 -0
- package/library/models/buildings/market.glb +0 -0
- package/library/models/buildings/tavern.glb +0 -0
- package/library/models/buildings/tower.glb +0 -0
- package/library/models/buildings/windmill.glb +0 -0
- package/library/models/characters/barbarian.glb +0 -0
- package/library/models/characters/knight.glb +0 -0
- package/library/models/characters/mage.glb +0 -0
- package/library/models/characters/mini-soldier.glb +0 -0
- package/library/models/characters/platformer-hero.glb +0 -0
- package/library/models/characters/robot.glb +0 -0
- package/library/models/characters/rogue.glb +0 -0
- package/library/models/characters/skeleton.glb +0 -0
- package/library/models/city/building-a.glb +0 -0
- package/library/models/city/building-b.glb +0 -0
- package/library/models/city/building-tall.glb +0 -0
- package/library/models/city/fire-hydrant.glb +0 -0
- package/library/models/city/road-corner.glb +0 -0
- package/library/models/city/road-crossing.glb +0 -0
- package/library/models/city/road-junction.glb +0 -0
- package/library/models/city/road-straight.glb +0 -0
- package/library/models/city/streetlight.glb +0 -0
- package/library/models/city/suburban-house.glb +0 -0
- package/library/models/city/traffic-light.glb +0 -0
- package/library/models/city/water-tower.glb +0 -0
- package/library/models/food/apple.glb +0 -0
- package/library/models/food/avocado.glb +0 -0
- package/library/models/food/baguette.glb +0 -0
- package/library/models/food/bread-loaf.glb +0 -0
- package/library/models/food/burger.glb +0 -0
- package/library/models/food/carrot.glb +0 -0
- package/library/models/food/cheese.glb +0 -0
- package/library/models/food/cookie.glb +0 -0
- package/library/models/food/croissant.glb +0 -0
- package/library/models/food/cupcake.glb +0 -0
- package/library/models/food/dinner-plate.glb +0 -0
- package/library/models/food/donut.glb +0 -0
- package/library/models/food/ketchup.glb +0 -0
- package/library/models/food/mug.glb +0 -0
- package/library/models/food/pain-au-chocolat.glb +0 -0
- package/library/models/food/stew.glb +0 -0
- package/library/models/food/tomato.glb +0 -0
- package/library/models/food/veggie-burger.glb +0 -0
- package/library/models/nature/bush.glb +0 -0
- package/library/models/nature/cactus.glb +0 -0
- package/library/models/nature/cloud.glb +0 -0
- package/library/models/nature/fir-tree.glb +0 -0
- package/library/models/nature/forest-patch.glb +0 -0
- package/library/models/nature/grass-small.glb +0 -0
- package/library/models/nature/grass.glb +0 -0
- package/library/models/nature/hex-grass.glb +0 -0
- package/library/models/nature/hex-water.glb +0 -0
- package/library/models/nature/hills.glb +0 -0
- package/library/models/nature/mountain.glb +0 -0
- package/library/models/nature/pine-autumn.glb +0 -0
- package/library/models/nature/pine-tree.glb +0 -0
- package/library/models/nature/pumpkin.glb +0 -0
- package/library/models/nature/rock-flat.glb +0 -0
- package/library/models/nature/rock.glb +0 -0
- package/library/models/nature/tree-dead.glb +0 -0
- package/library/models/nature/tree-slim.glb +0 -0
- package/library/models/nature/trees-cluster.glb +0 -0
- package/library/models/nature/waterlily.glb +0 -0
- package/library/models/platformer/blaster.glb +0 -0
- package/library/models/platformer/block-coin.glb +0 -0
- package/library/models/platformer/brick.glb +0 -0
- package/library/models/platformer/coin.glb +0 -0
- package/library/models/platformer/enemy-flying.glb +0 -0
- package/library/models/platformer/flag.glb +0 -0
- package/library/models/platformer/platform-falling.glb +0 -0
- package/library/models/platformer/platform-grass-round.glb +0 -0
- package/library/models/platformer/platform-large.glb +0 -0
- package/library/models/platformer/platform-medium.glb +0 -0
- package/library/models/platformer/platform.glb +0 -0
- package/library/models/platformer/target.glb +0 -0
- package/library/models/platformer/track-corner.glb +0 -0
- package/library/models/platformer/track-straight.glb +0 -0
- package/library/models/platformer/wall-low.glb +0 -0
- package/library/models/products/boombox.glb +0 -0
- package/library/models/products/iridescent-lamp.glb +0 -0
- package/library/models/products/lantern.glb +0 -0
- package/library/models/products/lounge-chair.glb +0 -0
- package/library/models/products/sneaker.glb +0 -0
- package/library/models/products/velvet-sofa.glb +0 -0
- package/library/models/products/water-bottle.glb +0 -0
- package/library/models/props/alarm-clock.glb +0 -0
- package/library/models/props/armchair.glb +0 -0
- package/library/models/props/barrel.glb +0 -0
- package/library/models/props/bench.glb +0 -0
- package/library/models/props/brass-vase.glb +0 -0
- package/library/models/props/chest.glb +0 -0
- package/library/models/props/coffee-table.glb +0 -0
- package/library/models/props/coin-stack.glb +0 -0
- package/library/models/props/coin.glb +0 -0
- package/library/models/props/couch.glb +0 -0
- package/library/models/props/crate.glb +0 -0
- package/library/models/props/flag.glb +0 -0
- package/library/models/props/gravestone.glb +0 -0
- package/library/models/props/key.glb +0 -0
- package/library/models/props/lamp.glb +0 -0
- package/library/models/props/lantern.glb +0 -0
- package/library/models/props/marble-bust.glb +0 -0
- package/library/models/props/modern-armchair.glb +0 -0
- package/library/models/props/potted-succulent.glb +0 -0
- package/library/models/props/rubber-duck.glb +0 -0
- package/library/models/props/shield.glb +0 -0
- package/library/models/props/sword-shield.glb +0 -0
- package/library/models/props/sword.glb +0 -0
- package/library/models/props/table.glb +0 -0
- package/library/models/props/tent.glb +0 -0
- package/library/models/props/torch.glb +0 -0
- package/library/models/props/trophy.glb +0 -0
- package/library/models/space/base-module.glb +0 -0
- package/library/models/space/lander.glb +0 -0
- package/library/models/space/landing-pad.glb +0 -0
- package/library/models/space/rocks.glb +0 -0
- package/library/models/space/solar-panel.glb +0 -0
- package/library/models/space/space-truck.glb +0 -0
- package/library/models/space/wind-turbine.glb +0 -0
- package/library/models/vehicles/car.glb +0 -0
- package/library/models/vehicles/hatchback.glb +0 -0
- package/library/models/vehicles/motorcycle.glb +0 -0
- package/library/models/vehicles/police-car.glb +0 -0
- package/library/models/vehicles/taxi.glb +0 -0
- package/library/models/vehicles/truck.glb +0 -0
- package/library/sources.json +2856 -0
- package/library/textures/brick-color.jpg +0 -0
- package/library/textures/brick-normal.jpg +0 -0
- package/library/textures/brick-roughness.jpg +0 -0
- package/library/textures/concrete-color.jpg +0 -0
- package/library/textures/concrete-normal.jpg +0 -0
- package/library/textures/concrete-roughness.jpg +0 -0
- package/library/textures/fabric-color.jpg +0 -0
- package/library/textures/fabric-normal.jpg +0 -0
- package/library/textures/fabric-roughness.jpg +0 -0
- package/library/textures/grass-ground-color.jpg +0 -0
- package/library/textures/grass-ground-normal.jpg +0 -0
- package/library/textures/grass-ground-roughness.jpg +0 -0
- package/library/textures/rusty-metal-color.jpg +0 -0
- package/library/textures/rusty-metal-normal.jpg +0 -0
- package/library/textures/rusty-metal-roughness.jpg +0 -0
- package/library/textures/wood-planks-color.jpg +0 -0
- package/library/textures/wood-planks-normal.jpg +0 -0
- package/library/textures/wood-planks-roughness.jpg +0 -0
- package/package.json +67 -4
- package/plugin/.claude-plugin/plugin.json +19 -0
- package/plugin/skills/agent3d-assets/SKILL.md +140 -0
- package/plugin/skills/agent3d-assets/references/sources.md +33 -0
- package/plugin/skills/agent3d-create/SKILL.md +141 -0
- package/plugin/skills/agent3d-create/references/art-direction.md +144 -0
- package/plugin/skills/agent3d-create/references/recipes.md +1357 -0
- package/plugin/skills/agent3d-edit/SKILL.md +121 -0
- package/plugin/skills/agent3d-edit/references/patch-ops.md +278 -0
- package/plugin/skills/agent3d-game/SKILL.md +111 -0
- package/plugin/skills/agent3d-game/references/game-patterns.md +262 -0
- package/plugin/skills/agent3d-game/references/script-api.md +211 -0
- package/plugin/skills/agent3d-publish/SKILL.md +161 -0
- package/plugin/skills/agent3d-publish/references/integrations.md +221 -0
- package/templates/banner-aurora-night/README.md +15 -0
- package/templates/banner-aurora-night/agent3d.json +8 -0
- package/templates/banner-aurora-night/preview.png +0 -0
- package/templates/banner-aurora-night/scene.json +327 -0
- package/templates/banner-aurora-night/template.json +24 -0
- package/templates/banner-data-bars/README.md +15 -0
- package/templates/banner-data-bars/agent3d.json +8 -0
- package/templates/banner-data-bars/preview.png +0 -0
- package/templates/banner-data-bars/scene.json +222 -0
- package/templates/banner-data-bars/template.json +25 -0
- package/templates/banner-floating-shapes/README.md +15 -0
- package/templates/banner-floating-shapes/agent3d.json +8 -0
- package/templates/banner-floating-shapes/preview.png +0 -0
- package/templates/banner-floating-shapes/scene.json +703 -0
- package/templates/banner-floating-shapes/template.json +24 -0
- package/templates/banner-gradient-blob/README.md +16 -0
- package/templates/banner-gradient-blob/agent3d.json +8 -0
- package/templates/banner-gradient-blob/preview.png +0 -0
- package/templates/banner-gradient-blob/scene.json +330 -0
- package/templates/banner-gradient-blob/template.json +21 -0
- package/templates/banner-liquid-chrome/README.md +16 -0
- package/templates/banner-liquid-chrome/agent3d.json +8 -0
- package/templates/banner-liquid-chrome/preview.png +0 -0
- package/templates/banner-liquid-chrome/scene.json +290 -0
- package/templates/banner-liquid-chrome/template.json +24 -0
- package/templates/banner-logo-extrude/README.md +24 -0
- package/templates/banner-logo-extrude/agent3d.json +8 -0
- package/templates/banner-logo-extrude/assets/logo.svg +6 -0
- package/templates/banner-logo-extrude/assets/manifest.json +13 -0
- package/templates/banner-logo-extrude/preview.png +0 -0
- package/templates/banner-logo-extrude/scene.json +332 -0
- package/templates/banner-logo-extrude/template.json +22 -0
- package/templates/banner-neon-title/README.md +18 -0
- package/templates/banner-neon-title/agent3d.json +8 -0
- package/templates/banner-neon-title/preview.png +0 -0
- package/templates/banner-neon-title/scene.json +494 -0
- package/templates/banner-neon-title/template.json +25 -0
- package/templates/banner-wave-grid/README.md +18 -0
- package/templates/banner-wave-grid/agent3d.json +8 -0
- package/templates/banner-wave-grid/preview.png +0 -0
- package/templates/banner-wave-grid/scene.json +217 -0
- package/templates/banner-wave-grid/template.json +23 -0
- package/templates/card-hover-3d/README.md +16 -0
- package/templates/card-hover-3d/agent3d.json +8 -0
- package/templates/card-hover-3d/preview.png +0 -0
- package/templates/card-hover-3d/scene.json +359 -0
- package/templates/card-hover-3d/template.json +21 -0
- package/templates/card-product-tilt/README.md +14 -0
- package/templates/card-product-tilt/agent3d.json +8 -0
- package/templates/card-product-tilt/preview.png +0 -0
- package/templates/card-product-tilt/scene.json +296 -0
- package/templates/card-product-tilt/template.json +23 -0
- package/templates/character-mascot-hero/README.md +19 -0
- package/templates/character-mascot-hero/agent3d.json +8 -0
- package/templates/character-mascot-hero/preview.png +0 -0
- package/templates/character-mascot-hero/scene.json +512 -0
- package/templates/character-mascot-hero/template.json +8 -0
- package/templates/character-showcase/README.md +27 -0
- package/templates/character-showcase/agent3d.json +8 -0
- package/templates/character-showcase/preview.png +0 -0
- package/templates/character-showcase/scene.json +440 -0
- package/templates/character-showcase/template.json +24 -0
- package/templates/diorama-city/README.md +21 -0
- package/templates/diorama-city/agent3d.json +8 -0
- package/templates/diorama-city/preview.png +0 -0
- package/templates/diorama-city/scene.json +432 -0
- package/templates/diorama-city/template.json +21 -0
- package/templates/game-basket/README.md +25 -0
- package/templates/game-basket/agent3d.json +8 -0
- package/templates/game-basket/preview.png +0 -0
- package/templates/game-basket/scene.json +640 -0
- package/templates/game-basket/scripts/basket.js +176 -0
- package/templates/game-basket/template.json +8 -0
- package/templates/game-coin-collector/README.md +28 -0
- package/templates/game-coin-collector/agent3d.json +8 -0
- package/templates/game-coin-collector/preview.png +0 -0
- package/templates/game-coin-collector/scene.json +900 -0
- package/templates/game-coin-collector/scripts/collector.js +210 -0
- package/templates/game-coin-collector/template.json +19 -0
- package/templates/game-maze/README.md +24 -0
- package/templates/game-maze/agent3d.json +8 -0
- package/templates/game-maze/preview.png +0 -0
- package/templates/game-maze/scene.json +315 -0
- package/templates/game-maze/scripts/maze.js +168 -0
- package/templates/game-maze/template.json +18 -0
- package/templates/game-physics-playground/README.md +30 -0
- package/templates/game-physics-playground/agent3d.json +8 -0
- package/templates/game-physics-playground/preview.png +0 -0
- package/templates/game-physics-playground/scene.json +1712 -0
- package/templates/game-physics-playground/scripts/playground.js +151 -0
- package/templates/game-physics-playground/template.json +19 -0
- package/templates/game-platformer/README.md +26 -0
- package/templates/game-platformer/agent3d.json +8 -0
- package/templates/game-platformer/preview.png +0 -0
- package/templates/game-platformer/scene.json +1063 -0
- package/templates/game-platformer/scripts/platformer.js +222 -0
- package/templates/game-platformer/template.json +8 -0
- package/templates/game-runner/README.md +30 -0
- package/templates/game-runner/agent3d.json +8 -0
- package/templates/game-runner/preview.png +0 -0
- package/templates/game-runner/scene.json +1317 -0
- package/templates/game-runner/scripts/runner.js +263 -0
- package/templates/game-runner/template.json +18 -0
- package/templates/game-tap-targets/README.md +21 -0
- package/templates/game-tap-targets/agent3d.json +8 -0
- package/templates/game-tap-targets/preview.png +0 -0
- package/templates/game-tap-targets/scene.json +924 -0
- package/templates/game-tap-targets/scripts/targets.js +159 -0
- package/templates/game-tap-targets/template.json +19 -0
- package/templates/hero-floating-island/README.md +18 -0
- package/templates/hero-floating-island/agent3d.json +8 -0
- package/templates/hero-floating-island/preview.png +0 -0
- package/templates/hero-floating-island/scene.json +658 -0
- package/templates/hero-floating-island/template.json +8 -0
- package/templates/hero-perfume-luxury/README.md +18 -0
- package/templates/hero-perfume-luxury/agent3d.json +8 -0
- package/templates/hero-perfume-luxury/preview.png +0 -0
- package/templates/hero-perfume-luxury/scene.json +529 -0
- package/templates/hero-perfume-luxury/template.json +27 -0
- package/templates/hero-product-turntable/README.md +16 -0
- package/templates/hero-product-turntable/agent3d.json +8 -0
- package/templates/hero-product-turntable/preview.png +0 -0
- package/templates/hero-product-turntable/scene.json +225 -0
- package/templates/hero-product-turntable/template.json +21 -0
- package/templates/hero-saas-globe/README.md +16 -0
- package/templates/hero-saas-globe/agent3d.json +8 -0
- package/templates/hero-saas-globe/preview.png +0 -0
- package/templates/hero-saas-globe/scene.json +318 -0
- package/templates/hero-saas-globe/template.json +24 -0
- package/templates/hero-scroll-story/README.md +26 -0
- package/templates/hero-scroll-story/agent3d.json +8 -0
- package/templates/hero-scroll-story/preview.png +0 -0
- package/templates/hero-scroll-story/scene.json +642 -0
- package/templates/hero-scroll-story/template.json +22 -0
- package/templates/hero-sneaker-showcase/README.md +19 -0
- package/templates/hero-sneaker-showcase/agent3d.json +8 -0
- package/templates/hero-sneaker-showcase/preview.png +0 -0
- package/templates/hero-sneaker-showcase/scene.json +523 -0
- package/templates/hero-sneaker-showcase/template.json +23 -0
- package/templates/hero-space-planet/README.md +17 -0
- package/templates/hero-space-planet/agent3d.json +8 -0
- package/templates/hero-space-planet/preview.png +0 -0
- package/templates/hero-space-planet/scene.json +330 -0
- package/templates/hero-space-planet/template.json +21 -0
- package/templates/landscape-island/README.md +21 -0
- package/templates/landscape-island/agent3d.json +8 -0
- package/templates/landscape-island/preview.png +0 -0
- package/templates/landscape-island/scene.json +716 -0
- package/templates/landscape-island/template.json +24 -0
- package/templates/landscape-night-galaxy/README.md +25 -0
- package/templates/landscape-night-galaxy/agent3d.json +8 -0
- package/templates/landscape-night-galaxy/preview.png +0 -0
- package/templates/landscape-night-galaxy/scene.json +403 -0
- package/templates/landscape-night-galaxy/template.json +8 -0
- package/templates/landscape-valley-sunset/README.md +20 -0
- package/templates/landscape-valley-sunset/agent3d.json +8 -0
- package/templates/landscape-valley-sunset/preview.png +0 -0
- package/templates/landscape-valley-sunset/scene.json +265 -0
- package/templates/landscape-valley-sunset/template.json +22 -0
- package/templates/scene-cozy-room/README.md +21 -0
- package/templates/scene-cozy-room/agent3d.json +8 -0
- package/templates/scene-cozy-room/preview.png +0 -0
- package/templates/scene-cozy-room/scene.json +728 -0
- package/templates/scene-cozy-room/template.json +8 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent3d-publish
|
|
3
|
+
description: Export an Agent3D scene and put it on a website - embed folder (Web Component + static files + generated React / Vue / Svelte wrappers and EMBED.md), zip, single HTML file, poster, MP4 / WebM video, GIF or animated WebP; paste the snippet in plain HTML, WordPress, Webflow, Shopify, AgentCMS, React / Next.js / Astro / Vue / Svelte; personalise texts with data-* attributes, drive it from JavaScript (play, pause, seek, setData, events), base URL, cache-busting, integrity, performance and accessibility checklist, and the Content-Security-Policy the runtime needs. Use when the user wants to publish, embed, ship, download or share a 3D scene they built with Agent3D, or asks why it does not show on their site.
|
|
4
|
+
license: PolyForm-Noncommercial-1.0.0
|
|
5
|
+
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
|
|
6
|
+
metadata:
|
|
7
|
+
version: "0.2.1"
|
|
8
|
+
repository: "https://github.com/fleox/agent3d"
|
|
9
|
+
allowed-tools: Bash Read Write
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Publish an Agent3D scene
|
|
13
|
+
|
|
14
|
+
**Language:** talk to the user in their language; keep commands, code and files in English.
|
|
15
|
+
|
|
16
|
+
Every command is `npx -y @fleox/agent3d@0.2.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
17
|
+
|
|
18
|
+
## Before exporting
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx -y @fleox/agent3d@0.2.1 check --project my-banner --render --json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
No errors, no warnings (or warnings the user accepted). Keep the `licences` list: credits ship in the export.
|
|
25
|
+
|
|
26
|
+
## Formats
|
|
27
|
+
|
|
28
|
+
| Format | Command | Gives | Use it for |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| `embed` (default) | `export --project my-banner` | `<project>/dist/embed/`: `agent3d-runtime/` (shared), `<name>/` (scene.json, assets, scripts, poster.webp, og-image.png, CREDITS.txt), `index.html` (demo), `snippet.html`, `head.html`, `EMBED.md` (for the website owner), `frameworks/` (React / Vue / Svelte wrappers + `agent3d-scene.d.ts`) | Any website you can upload files to; several scenes share one runtime |
|
|
31
|
+
| `zip` | `export --format zip --project my-banner` | the embed folder as one `dist/zip/<name>-embed.zip` | Handing the export to someone, uploading through a file manager |
|
|
32
|
+
| `single-html` | `export --format single-html --project my-banner` | one `dist/single-html/<name>.html` with the runtime, the scene and the assets inline (data: URIs) — about 2 MB minimum (the runtime is not split) | Sending a file, a standalone page, an `<iframe>` in Squarespace / Wix / Framer |
|
|
33
|
+
| `poster` | `export --format poster --project my-banner` | `dist/poster.webp` at `target.posterTime` (`--time 2`), 2× pixel ratio (`--scale`); `--image png\|jpeg`, `--quality high\|ultra`, `--transparent` (png / webp) | Social images, email, a fallback |
|
|
34
|
+
| `video` | `export --format video --project my-banner` | `dist/video.webm` (VP9), or MP4 (H.264) when `--out` ends in `.mp4`; `--duration`, `--fps`, `--size`, `--quality` | Social posts, presentations, places that can't run WebGL |
|
|
35
|
+
| `gif` | `export --format gif --project my-banner` | `dist/animation.gif` (looping, 640 px wide, 15 fps by default) | Email, chat, READMEs |
|
|
36
|
+
|
|
37
|
+
Default outputs land in `<project>/dist/`. A relative `--out` is resolved from the **project folder** (like every output path of `render` and `export`): `--project my-banner --out dist/promo.mp4` writes `my-banner/dist/promo.mp4`; absolute paths are kept.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx -y @fleox/agent3d@0.2.1 export --project my-banner --json
|
|
41
|
+
npx -y @fleox/agent3d@0.2.1 export --project my-banner --name spring-banner --out ./site/agent3d --json
|
|
42
|
+
npx -y @fleox/agent3d@0.2.1 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
|
|
43
|
+
npx -y @fleox/agent3d@0.2.1 export --project my-banner --optimize --json
|
|
44
|
+
npx -y @fleox/agent3d@0.2.1 export --format zip --project my-banner --json
|
|
45
|
+
npx -y @fleox/agent3d@0.2.1 export --format single-html --project my-banner --json
|
|
46
|
+
npx -y @fleox/agent3d@0.2.1 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
|
|
47
|
+
npx -y @fleox/agent3d@0.2.1 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
|
|
48
|
+
npx -y @fleox/agent3d@0.2.1 export --format gif --duration 4 --project my-banner --json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Embed / zip options:
|
|
52
|
+
|
|
53
|
+
| Option | Effect |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `--name <slug>` | The scene folder / file name (default: the project name) |
|
|
56
|
+
| `--base-url <url>` | The snippet, the framework wrappers and EMBED.md use this base (the folder's final location: `/wp-content/uploads/agent3d/`, `https://cdn.example.com/3d/`), so the snippet works from pages at any depth or another origin |
|
|
57
|
+
| `--cache-bust` | Runtime in `agent3d-runtime-<hash>/` and `scene.json?v=<hash>`: serve both with `Cache-Control: max-age=31536000, immutable` |
|
|
58
|
+
| `--no-integrity` | Drops the Subresource Integrity hashes (`integrity="sha384-…"` on the runtime script and preloads, default on) |
|
|
59
|
+
| `--optimize` | Optimised copies of the assets in the export only (the project is untouched): textures resized to what the scene needs, `.glb` geometry meshopt-compressed with WebP textures (the result's `optimized` lists before / after bytes). Texture work needs Chrome. Meshopt models need `'wasm-unsafe-eval'` in a CSP (below) |
|
|
60
|
+
| `--no-poster` | No poster nor og-image (no Chrome needed). The element then shows nothing until the first frame and has no fallback without WebGL: prefer keeping it |
|
|
61
|
+
| `--no-og` | No `<name>/og-image.png` (1200×630 social preview). To use it, add `<meta property="og:image" content="https://<site>/…/<name>/og-image.png">` and `<meta name="twitter:card" content="summary_large_image">` to the page head — crawlers need an absolute URL (the demo `index.html` uses a relative one) |
|
|
62
|
+
| `--no-extras` | No `EMBED.md` and no `frameworks/` |
|
|
63
|
+
|
|
64
|
+
- **Page weight**: for a brief like "under 300 KB", quote `pageKb` / `pageKbGzip` from the export result (what a visitor downloads for this scene, runtime chunks included — `folderKb` counts every file written, unused chunks too). `--prune-runtime` copies only the chunks this scene loads (a smaller folder to upload) — only when this runtime folder serves this scene alone; other scenes sharing `agent3d-runtime/` may need the chunks it leaves out.
|
|
65
|
+
- Exporting again into a non-empty folder prints a plan (`needsConfirmation`, with the existing entries): re-run with `--yes` after the user agreed.
|
|
66
|
+
- The result gives `snippet`, `head` (all modulepreload links), `integrity`, `runtimeDir`, `out`, `entry` (the demo page, or the zip / html file), `pageKb` / `pageKbGzip` (what a visitor downloads for this scene: the runtime entry + the lazy chunks it uses + scene, assets, scripts, poster — quote this one as the page weight), `folderKb` (= `totalKb`, every file written, all chunks and og-image included), `page` (runtime files loaded / chunks skipped), `sizes` (`runtimeKb`, `sceneKb`, `assetsKb`, `scriptsKb`, `posterKb`), `credits`, `issues` (+ `optimized` with `--optimize`). Media formats return `{ format, path, codec?, frames?, fps?, duration?, size, bytes }`.
|
|
67
|
+
|
|
68
|
+
Media straight from `render` (frame-exact, any size / fps; LOOK at a few frames of the result):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx -y @fleox/agent3d@0.2.1 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
|
|
72
|
+
npx -y @fleox/agent3d@0.2.1 render --gif renders/banner.gif --duration 4 --project my-banner --json
|
|
73
|
+
npx -y @fleox/agent3d@0.2.1 render --webp renders/banner.webp --duration 4 --project my-banner --json
|
|
74
|
+
npx -y @fleox/agent3d@0.2.1 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
|
|
75
|
+
npx -y @fleox/agent3d@0.2.1 render --scroll 0.5 --project my-scroll-story --json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`--quality high|ultra` supersamples 2× / 3× (smoother edges), `--transparent` gives alpha PNG / GIF / WebP, `--scroll 0.5` holds a scroll-driven scene at that scroll progress, `--fps` / `--start` / `--bitrate` tune videos, `--yes` overwrites an existing media file. `--video`, `--gif` and `--webp` paths (like `--out`) are relative to the project folder. MP4 needs Google Chrome or Edge (H.264 encoder); with Chromium, render `.webm`. Videos and posters capture the WebGL canvas only (no HUD).
|
|
79
|
+
|
|
80
|
+
Scenes whose timeline waits for the visitor (`autoplay: false`, `trigger: "manual"` / `"click"`, segments played by interactions) are still at t = 0 in a plain render: film the segment with `--segment`, or play the interaction with `--input` (frames, `--video`, `--gif` and `--webp` all apply it):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx -y @fleox/agent3d@0.2.1 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
|
|
84
|
+
npx -y @fleox/agent3d@0.2.1 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`--reduced-motion` renders what visitors with prefers-reduced-motion see.
|
|
88
|
+
|
|
89
|
+
## The snippet
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<link rel="modulepreload" href="./agent3d-runtime/chunks/three.module-….js" integrity="sha384-…">
|
|
93
|
+
<script type="module" src="./agent3d-runtime/agent3d-runtime.js" integrity="sha384-…"></script>
|
|
94
|
+
<agent3d-scene src="./my-banner/scene.json" aspect="4:1" role="img" aria-label="Golden Crust Bakery: a warm 3D title with floating pastries">
|
|
95
|
+
<img slot="poster" src="./my-banner/poster.webp" alt="Golden Crust Bakery: a warm 3D title with floating pastries" width="1200" height="300" decoding="async" style="display:block;width:100%;height:auto">
|
|
96
|
+
</agent3d-scene>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Always paste the snippet from the export result (hashes and file names change with every runtime build).
|
|
100
|
+
|
|
101
|
+
- Paths are relative to the page unless the export used `--base-url`. Asset paths inside the scene resolve against the `scene.json` URL, so the `<name>/` folder must stay intact.
|
|
102
|
+
- The `<img slot="poster">` shows before the runtime loads, without JavaScript / WebGL and when printing, at the right size (no layout shift); keep it.
|
|
103
|
+
- The element is `display: block; width: 100%` and keeps the scene's aspect ratio, or `target.height` when set. Size it with its container (`max-width`, grid column…); CSS on the element wins.
|
|
104
|
+
- It loads lazily (starts when visible), pauses off-screen, caps the pixel ratio, freezes on the poster frame for visitors who prefer reduced motion, recovers from a lost GPU context, frees everything when removed (SPAs).
|
|
105
|
+
- Attributes: `src`, `poster` (or the `<img slot="poster">`), `aspect` (reserved before scene.json loads), `alt`, `autoplay="false"`, `paused`, `loop="false|true|pingpong"`, `quality="low|medium|high|auto"` (pixel-ratio cap 1 / 1.5 / 2; `low` also drops antialiasing, shadows and post effects), `interactive="false"` (page scroll and clicks pass through), `library-base`, `aria-label`, `data-*` (below). The element reflects `status="loading|ready|error|unsupported"`.
|
|
106
|
+
- JavaScript: `const player = await el.ready` (after the first frame), `el.play()`, `el.pause()`, `await el.seek(t)`, `await el.setData({...})`, `el.data`, `el.trigger(name, payload)` (scene scripts' `api.on(name)`, `{ "on": "event" }` interactions), `await el.reload()`. Events (bubbling): `agent3d:ready` (`{ player }`), `agent3d:error` (`{ code, message, path? }`), `agent3d:event` (`{ name, payload }`: scripts' `api.emit`, HUD actions, timeline markers, interaction `emit`), `agent3d:click` (`{ id, x, y }`: the object clicked, `null` for the background), `agent3d:progress` (`{ loaded, total }`).
|
|
107
|
+
- Styling: `::part(poster)`, `::part(loading)`, `::part(loading-bar)`, `::part(fallback)`, `--agent3d-background`, `--agent3d-loading-color`, `--agent3d-poster-fit`, `--agent3d-fade`; a child with `slot="fallback"` replaces the no-WebGL fallback.
|
|
108
|
+
- The same runtime folder serves every scene of the site: upload it once, re-upload it after updating Agent3D.
|
|
109
|
+
|
|
110
|
+
## Personalised scenes (data bindings)
|
|
111
|
+
|
|
112
|
+
Write `{data.key}` in a text object's `text` (or an `href`), give defaults in `scene.data`, and the page fills them per embed — no re-export:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npx -y @fleox/agent3d@0.2.1 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```html
|
|
119
|
+
<agent3d-scene src="./my-banner/scene.json" data-title="Summer sale −30%"></agent3d-scene>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Placeholders work in text objects' `text`, any object's `href` and HUD texts. `{data.cta|Shop now}` has a fallback; `data-cta-label` maps to `ctaLabel`; `data-json='{"price": 9}'` merges an object; `el.setData({ title: "…" })` changes it live; scripts read the merged values as `api.data`. Renders and posters show the `scene.data` defaults (the poster is rendered once, at export): pick defaults that look right on their own. Leave layout room for the longest value a page may pass — a longer `data-title` widens the text (or wraps with `maxWidth`, growing the block up and down around its position). Keep the scene `title` / `ariaLabel` free of placeholders: the export copies them as written into the snippet's `aria-label` / `alt`, `index.html` and EMBED.md.
|
|
123
|
+
|
|
124
|
+
## Where it goes
|
|
125
|
+
|
|
126
|
+
Step-by-step per platform (plain HTML, WordPress, AgentCMS, React / Next.js, Astro, Vue / Nuxt, Svelte, static hosts and CDNs): [references/integrations.md](references/integrations.md). In short:
|
|
127
|
+
|
|
128
|
+
- **Plain HTML / static hosts** (Netlify, GitHub Pages, Cloudflare Pages, S3): copy the export folder next to the page, paste the snippet. Open `index.html` of the export through a local server (`npx -y @fleox/agent3d@0.2.1 serve --project my-banner` previews the project; module scripts don't run from `file://`: opened that way, the demo page only shows the poster and a note asking for a web server).
|
|
129
|
+
- **WordPress**: export with `--base-url /wp-content/uploads/agent3d/`, upload the export folder there (SFTP / the host's file manager), then a **Custom HTML** block with the snippet. The media library refuses `.js` / `.json` files.
|
|
130
|
+
- **Webflow / Shopify**: host the folder on a static host or CDN, export with `--base-url https://…/`, paste the snippet in an Embed element / Custom Liquid section.
|
|
131
|
+
- **Squarespace / Wix / Framer**: `single-html` in an `<iframe>`.
|
|
132
|
+
- **AgentCMS**: install the **Agent3D scene** plugin (`integrations/agentcms/agent3d-scene.zip` in the Agent3D repository): it uploads an export folder from its settings page and adds an "Agent3D scene" editor block.
|
|
133
|
+
- **React / Next.js / Vue / Svelte**: the export's `frameworks/` folder has ready components (`Agent3DScene.tsx` is a typed, SSR-safe client component); Astro: the snippet with `is:inline`. Details in the reference; the export's `EMBED.md` has the same for the website owner.
|
|
134
|
+
|
|
135
|
+
## Checklist before handing over
|
|
136
|
+
|
|
137
|
+
- [ ] `check` clean; rendered and looked at; the poster frame is complete (nothing hidden by an entrance animation).
|
|
138
|
+
- [ ] `aria-label` describes the scene in one sentence (from `ariaLabel` or `title`); purely decorative scenes can say so ("Decorative animated background").
|
|
139
|
+
- [ ] Important text is also in the HTML of the page (search engines and screen readers don't read WebGL).
|
|
140
|
+
- [ ] `target.reducedMotion` is `static` for banners and heroes (default), `ignore` only for games.
|
|
141
|
+
- [ ] Size: `sizes` minus `runtimeKb` is within the target budget (`export --optimize` shrinks textures and models); the poster is a few tens of KB.
|
|
142
|
+
- [ ] Phones: rendered at phone width (`render --size 390x98` for a 4:1 banner) and the text is readable.
|
|
143
|
+
- [ ] Credits: `CREDITS.txt` lines are shown on the site when a licence requires attribution.
|
|
144
|
+
- [ ] The page's Content-Security-Policy allows the runtime (below).
|
|
145
|
+
|
|
146
|
+
## Content-Security-Policy
|
|
147
|
+
|
|
148
|
+
The runtime never calls third-party hosts, uses no `eval` / `new Function`, and needs no web fonts: no `'unsafe-eval'`, ever. `'wasm-unsafe-eval'` is needed only for meshopt-compressed models (`export --optimize`, `assets optimize`). What a CSP must allow:
|
|
149
|
+
|
|
150
|
+
| Export | Directives |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `embed` | `script-src 'self'` (the module and its lazy chunks, plus scene scripts, loaded from the site); `connect-src 'self'` (scene.json, fonts, models, HDRIs, audio are fetched); `img-src 'self' blob:` (poster, textures; glTF embedded textures use blob: URLs); `style-src 'unsafe-inline'` only when the scene has a HUD (`ui`: the HUD injects a `<style>` element; the element's own styles are constructable stylesheets); `'wasm-unsafe-eval'` in script-src only for meshopt-compressed models (`export --optimize`) |
|
|
153
|
+
| `single-html` | the above plus `script-src 'unsafe-inline' blob:` (the inline module runtime, and scene scripts run as blob: modules), `connect-src data:` and `img-src data: blob:` (assets are inlined as data: URIs) |
|
|
154
|
+
|
|
155
|
+
If the runtime and scenes live on another origin (a CDN or an assets subdomain), add that origin to `script-src`, `connect-src` and `img-src`, and serve the files with CORS (`Access-Control-Allow-Origin`). Details: [references/integrations.md](references/integrations.md).
|
|
156
|
+
|
|
157
|
+
## Rules
|
|
158
|
+
|
|
159
|
+
- Don't hotlink the runtime or assets from another site: everything ships in the export folder.
|
|
160
|
+
- Overwriting an existing export, or a site's files, needs the user's go: show what will be replaced.
|
|
161
|
+
- Never put secrets or personal data in `scene.json` or scripts: they are public files.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Integrations
|
|
2
|
+
|
|
3
|
+
All examples assume the embed export was uploaded to `/agent3d/` at the root of the site:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
/agent3d/agent3d-runtime/agent3d-runtime.js (+ chunks/)
|
|
7
|
+
/agent3d/spring-banner/scene.json (+ assets/, scripts/, poster.webp, og-image.png, CREDITS.txt)
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Export straight into that layout with `npx -y @fleox/agent3d@0.2.1 export --project spring-banner --out ./public/agent3d --base-url /agent3d/ --json` (the `<name>` folder defaults to the project name; `--name` changes it; `--base-url` writes root-absolute URLs in the snippet, the wrappers and EMBED.md). Paste the `snippet` of the result: the examples below shorten the integrity hashes and the poster markup.
|
|
11
|
+
|
|
12
|
+
## Plain HTML
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<script type="module" src="/agent3d/agent3d-runtime/agent3d-runtime.js"></script>
|
|
16
|
+
|
|
17
|
+
<section class="hero">
|
|
18
|
+
<div class="hero-text">
|
|
19
|
+
<h1>Fresh bread every morning</h1>
|
|
20
|
+
<a class="button" href="/order">Order now</a>
|
|
21
|
+
</div>
|
|
22
|
+
<agent3d-scene src="/agent3d/spring-banner/scene.json" poster="/agent3d/spring-banner/poster.webp"
|
|
23
|
+
aria-label="Golden Crust Bakery: a warm 3D title with floating pastries"></agent3d-scene>
|
|
24
|
+
</section>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- One `<script type="module">` per page is enough for any number of scenes; browsers run a module URL once.
|
|
28
|
+
- Overlaying HTML text on the scene: see [Hero with HTML text](#hero-with-html-text) below.
|
|
29
|
+
- Transparent scenes (`target.transparent: true`) let the page background show through.
|
|
30
|
+
- Caching: the runtime's chunk files have content hashes; `agent3d-runtime.js` and `scene.json` don't. Export with `--cache-bust` (runtime in `agent3d-runtime-<hash>/`, `scene.json?v=<hash>`) to cache the runtime and the scene for a year; otherwise long cache headers are safe for `chunks/` only. The poster and the files under `<name>/assets/` keep their names in both cases: give them a short cache, or re-export under a new `--name` when they change.
|
|
31
|
+
- Personalise per page with `data-*` attributes (`data-title="Summer sale"` fills `{data.title}` in the scene) or `document.querySelector("agent3d-scene").setData({ title: "…" })`.
|
|
32
|
+
- `head.html` lists `<link rel="modulepreload">` for every module the runtime needs up front: put it in the `<head>` of pages with scenes for the fastest start (the snippet already preloads three.js).
|
|
33
|
+
|
|
34
|
+
## Hero with HTML text
|
|
35
|
+
|
|
36
|
+
Keep the headline, copy and buttons in HTML (readable by search engines and screen readers, styled by the site) and let the scene fill the hero behind them. Compose the scene for it: subject on one third (x ≈ +2 to +2.5 in a 16:9 hero at fov 30–35), the other half empty, no 3D text. Then stack both in one grid cell:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<section class="hero3d">
|
|
40
|
+
<agent3d-scene src="/agent3d/bottle-hero/scene.json" aspect="16:9" role="img" aria-label="…">
|
|
41
|
+
<img slot="poster" src="/agent3d/bottle-hero/poster.webp" alt="…" width="1200" height="675" style="display:block;width:100%;height:auto">
|
|
42
|
+
</agent3d-scene>
|
|
43
|
+
<div class="hero3d-text">
|
|
44
|
+
<h1>Water that goes where you go</h1>
|
|
45
|
+
<p>Insulated steel, 24 h cold.</p>
|
|
46
|
+
<a class="button" href="/shop">Shop the bottle</a>
|
|
47
|
+
</div>
|
|
48
|
+
</section>
|
|
49
|
+
|
|
50
|
+
<style>
|
|
51
|
+
.hero3d { display: grid; grid-template-columns: minmax(0, 1fr); }
|
|
52
|
+
.hero3d > * { grid-area: 1 / 1; } /* scene and text share one cell */
|
|
53
|
+
.hero3d-text { z-index: 1; align-self: center; max-width: 42%; padding: 0 5%; pointer-events: none; }
|
|
54
|
+
.hero3d-text a, .hero3d-text button { pointer-events: auto; }
|
|
55
|
+
@media (max-width: 640px) { /* phones: text below the scene */
|
|
56
|
+
.hero3d > * { grid-area: auto; }
|
|
57
|
+
.hero3d-text { max-width: none; padding: 1.5rem 1rem; }
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- `minmax(0, 1fr)` stops the poster's `width="1200"` from widening the grid on small screens.
|
|
63
|
+
- `pointer-events: none` on the text layer lets drags, hovers and clicks reach the scene everywhere except the links and buttons, which turn it back on. If the scene should not react at all, add `interactive="false"` to the element instead.
|
|
64
|
+
- The scene keeps its aspect ratio, so the hero's height follows its width; an absolutely positioned text layer (`position: relative` on the section, `position: absolute; inset: 0` on the text) works the same way.
|
|
65
|
+
- On phones the empty half is wasted: stack the text below (as above), or export a second, centred composition for small screens.
|
|
66
|
+
|
|
67
|
+
## WordPress
|
|
68
|
+
|
|
69
|
+
1. Export with `--base-url /wp-content/uploads/agent3d/` and upload the export folder there: SFTP, the host's file manager, or a file-manager plugin (the media library refuses `.js` and `.json`).
|
|
70
|
+
2. Edit the page, add a **Custom HTML** block and paste the snippet from the export result (it already has the absolute URLs):
|
|
71
|
+
```html
|
|
72
|
+
<script type="module" src="/wp-content/uploads/agent3d/agent3d-runtime/agent3d-runtime.js" integrity="sha384-…"></script>
|
|
73
|
+
<agent3d-scene src="/wp-content/uploads/agent3d/spring-banner/scene.json" aspect="4:1" role="img" aria-label="…">
|
|
74
|
+
<img slot="poster" src="/wp-content/uploads/agent3d/spring-banner/poster.webp" alt="…" width="1200" height="300" style="display:block;width:100%;height:auto">
|
|
75
|
+
</agent3d-scene>
|
|
76
|
+
```
|
|
77
|
+
3. Page builders (Elementor, Divi…) have an equivalent HTML widget. Full-width: put the block in a full-width group / section.
|
|
78
|
+
4. Security plugins that add a CSP: allow the directives from the skill's CSP table. Caching / optimisation plugins must not "combine" or "defer" the module script (exclude `agent3d-runtime`).
|
|
79
|
+
5. No file access at all (some hosted plans): export `single-html`, host the file elsewhere you control and embed it with an `<iframe src="…/spring-banner.html" style="width:100%;aspect-ratio:4/1;border:0" title="…" loading="lazy"></iframe>`.
|
|
80
|
+
|
|
81
|
+
## AgentCMS
|
|
82
|
+
|
|
83
|
+
The Agent3D repository ships an AgentCMS plugin (`integrations/agentcms/`, packed as `agent3d-scene.zip`):
|
|
84
|
+
|
|
85
|
+
1. In the AgentCMS admin: **Plugins → Install**, drop `agent3d-scene.zip` (or, for a site this computer manages: `npx -y @agent-cms/agentcms@0.3.13 ext install agent3d-scene.zip --site <alias> --json`, then the same with `--yes` after showing the plan).
|
|
86
|
+
2. **Settings → Agent3D scenes**: pick the export folder (`dist/embed` of the project). The plugin uploads it to `agent3d/` on the site's hosting and lists the scenes it found.
|
|
87
|
+
3. In the post editor, insert the **Agent3D scene** block ("+" or `/`), choose a scene in the Block tab (or paste a `scene.json` URL), set the accessible label and an optional caption.
|
|
88
|
+
4. Publish. The published page contains the `<agent3d-scene>` element and the runtime module script; sites hosted in a sub-folder are handled.
|
|
89
|
+
|
|
90
|
+
The editor shows the poster as a preview (the live scene runs on the published page and in the admin's page preview).
|
|
91
|
+
|
|
92
|
+
## Webflow, Shopify, Squarespace, Wix
|
|
93
|
+
|
|
94
|
+
- **Webflow**: Webflow can't host `.js` / `.json` files. Upload the export folder to a static host or CDN you control (Netlify, Cloudflare Pages, S3), export with `--base-url https://<that host>/agent3d/`, serve with CORS (`Access-Control-Allow-Origin: *`), and paste the snippet in an **Embed** element.
|
|
95
|
+
- **Shopify**: same hosting as Webflow, then a **Custom Liquid** section (or a theme snippet) with the snippet.
|
|
96
|
+
- **Squarespace, Wix, Framer, Google Sites**: their embed boxes run in an iframe. Export `single-html`, host the file, embed it with `<iframe src="…/spring-banner.html" style="width:100%;aspect-ratio:4/1;border:0" title="…" loading="lazy"></iframe>`.
|
|
97
|
+
|
|
98
|
+
## React
|
|
99
|
+
|
|
100
|
+
Copy `frameworks/react/Agent3DScene.tsx` from the export into the app (it already points at the export's runtime URL):
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { Agent3DScene } from "./Agent3DScene";
|
|
104
|
+
|
|
105
|
+
<Agent3DScene
|
|
106
|
+
src="/agent3d/spring-banner/scene.json"
|
|
107
|
+
poster="/agent3d/spring-banner/poster.webp"
|
|
108
|
+
aspect="4:1"
|
|
109
|
+
data={{ title: "Summer sale" }}
|
|
110
|
+
onReady={(el) => el.pause()}
|
|
111
|
+
onSceneClick={(e) => console.log(e.id)}
|
|
112
|
+
/>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- Props: `src`, `poster`, `aspect`, `alt`, `ariaLabel`, `data` (applied live with `setData`), `autoplay`, `paused`, `loop` (`true | false | "pingpong"`), `quality`, `interactive`, `runtimeSrc`, `className`, `style`; callbacks `onReady(el)`, `onError({ code, message, path })`, `onSceneEvent({ name, payload })`, `onSceneClick({ id, x, y })`.
|
|
116
|
+
- It loads the runtime once with a module script (never bundled; with its integrity hash when `runtimeSrc` is the exported one) and works with React 17–19.
|
|
117
|
+
- Without the wrapper: `<agent3d-scene src=… aspect=…>` as a plain custom element; `frameworks/agent3d-scene.d.ts` types the element and its events.
|
|
118
|
+
|
|
119
|
+
## Next.js
|
|
120
|
+
|
|
121
|
+
- Put the export under `public/agent3d/` (export with `--out ./public/agent3d --base-url /agent3d/`).
|
|
122
|
+
- Use the React wrapper: it is a client component (`"use client"`) and loads the runtime in an effect, so it is SSR-safe. Server rendering outputs the element; the scene starts after hydration.
|
|
123
|
+
- Don't `import()` the runtime URL from your code: the bundler would try to bundle it.
|
|
124
|
+
|
|
125
|
+
## Astro
|
|
126
|
+
|
|
127
|
+
```astro
|
|
128
|
+
<agent3d-scene src="/agent3d/spring-banner/scene.json" poster="/agent3d/spring-banner/poster.webp" aria-label="…"></agent3d-scene>
|
|
129
|
+
<script is:inline type="module" src="/agent3d/agent3d-runtime/agent3d-runtime.js"></script>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`is:inline` stops Astro from bundling the script. Inside a framework island, use `client:only` (the element has no server rendering).
|
|
133
|
+
|
|
134
|
+
## Vue / Nuxt
|
|
135
|
+
|
|
136
|
+
Tell the compiler it is a custom element:
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
// vite.config.js (Vue)
|
|
140
|
+
vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.startsWith("agent3d-") } } })
|
|
141
|
+
// nuxt.config.ts
|
|
142
|
+
export default defineNuxtConfig({ vue: { compilerOptions: { isCustomElement: (tag) => tag.startsWith("agent3d-") } } });
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Then use `frameworks/vue/Agent3DScene.vue` from the export — props `src`, `poster`, `aspect`, `alt`, `data` (live), `paused`, `quality`, `runtimeSrc`; events `@ready`, `@error`, `@scene-event`, `@scene-click`:
|
|
146
|
+
|
|
147
|
+
```vue
|
|
148
|
+
<Agent3DScene src="/agent3d/spring-banner/scene.json" aspect="4:1" :data="{ title: 'Summer sale' }" @scene-event="(e) => console.log(e.name)" />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Or use the element directly with a module script in `index.html` / `app.head`. In Nuxt, wrap it in `<ClientOnly>`.
|
|
152
|
+
|
|
153
|
+
## Svelte / SvelteKit
|
|
154
|
+
|
|
155
|
+
`frameworks/svelte/Agent3DScene.svelte` from the export (props `src`, `poster`, `aspect`, `alt`, `data`, `paused`, `quality`, `runtimeSrc`; events `on:ready`, `on:error`, `on:sceneevent`, `on:sceneclick`; the runtime loads in `onMount`, so SvelteKit SSR is fine), or `<agent3d-scene src=… aspect=… aria-label=…></agent3d-scene>` as is with the runtime loaded in `onMount` (or `<svelte:head><script type="module" src=…></script></svelte:head>`).
|
|
156
|
+
|
|
157
|
+
## Angular
|
|
158
|
+
|
|
159
|
+
Add `CUSTOM_ELEMENTS_SCHEMA` to the component's `schemas`, load the runtime with a module script in `index.html`, and use the snippet.
|
|
160
|
+
|
|
161
|
+
## JavaScript API and events
|
|
162
|
+
|
|
163
|
+
```js
|
|
164
|
+
const el = document.querySelector("agent3d-scene");
|
|
165
|
+
const player = await el.ready; // resolves after the first frame
|
|
166
|
+
el.pause(); el.play(); await el.seek(2);
|
|
167
|
+
await el.setData({ title: "Winter sale" }); // rebinds {data.*} placeholders
|
|
168
|
+
console.log(el.data); // scene.data + data-* + setData
|
|
169
|
+
el.trigger("start", { level: 2 }); // scene scripts' api.on("start"), { "on": "event" } interactions
|
|
170
|
+
await el.reload(); // re-fetch scene.json
|
|
171
|
+
el.addEventListener("agent3d:click", (e) => console.log("3d-click", e.detail.id, e.detail.x, e.detail.y));
|
|
172
|
+
el.addEventListener("agent3d:event", (e) => console.log(e.detail.name, e.detail.payload));
|
|
173
|
+
el.addEventListener("agent3d:error", (e) => console.warn(e.detail.code, e.detail.message));
|
|
174
|
+
el.addEventListener("agent3d:progress", (e) => console.log(e.detail.loaded, "/", e.detail.total));
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`agent3d:event` carries everything the scene announces: scripts' `api.emit(name, payload)` (a game's score: `api.emit("score", { score })`), HUD button actions, timeline markers (`{ marker, time }`), interaction `emit` actions and `openUrl` (`{ url, blocked }`). That is how a page hooks its own analytics — the scene itself never calls the network.
|
|
178
|
+
|
|
179
|
+
Attributes: `src`, `poster`, `aspect`, `alt`, `autoplay="false"`, `paused`, `loop="false|true|pingpong"`, `quality="low|medium|high|auto"`, `interactive="false"`, `library-base`, `aria-label`, `data-*` / `data-json`. Styling: `::part(poster)`, `::part(poster-image)`, `::part(loading)`, `::part(loading-bar)`, `::part(fallback)`, `--agent3d-background`, `--agent3d-loading-color`, `--agent3d-poster-fit`, `--agent3d-fade`; a `slot="fallback"` child replaces the no-WebGL fallback; `status="loading|ready|error|unsupported"` on the element for CSS hooks.
|
|
180
|
+
|
|
181
|
+
## Social preview
|
|
182
|
+
|
|
183
|
+
The export renders `<name>/og-image.png` (1200×630, skip with `--no-og`). Add it to the page head with an absolute URL — crawlers ignore relative ones:
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<meta property="og:image" content="https://www.example.com/agent3d/spring-banner/og-image.png">
|
|
187
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Content-Security-Policy in detail
|
|
191
|
+
|
|
192
|
+
What the runtime does, and the directive it needs:
|
|
193
|
+
|
|
194
|
+
| Runtime behaviour | Directive |
|
|
195
|
+
|---|---|
|
|
196
|
+
| `<script type="module" src>` + lazy `import()` of `chunks/*.js` | `script-src` with the runtime's origin (`'self'`) |
|
|
197
|
+
| Scene scripts (games) imported by URL from `<name>/scripts/` | `script-src` (same origin) |
|
|
198
|
+
| Scene scripts in single-html exports and the Studio: imported from a `blob:` URL | `script-src blob:` |
|
|
199
|
+
| single-html: the runtime is an inline `<script type="module">` | `script-src 'unsafe-inline'` (or its hash) |
|
|
200
|
+
| `fetch` of scene.json, fonts (typeface JSON), models, HDRIs, SVGs, audio | `connect-src` with the files' origin (`data:` for single-html) |
|
|
201
|
+
| Textures and the poster as images; glTF embedded textures as `blob:` URLs | `img-src 'self' blob:` (`data:` for single-html) |
|
|
202
|
+
| HUD (`ui`): one injected `<style>` element | `style-src 'unsafe-inline'` |
|
|
203
|
+
| The element's own styles | nothing (constructable stylesheets) |
|
|
204
|
+
| meshopt-compressed models (`export --optimize`, `assets optimize`): WebAssembly decoder | `script-src 'wasm-unsafe-eval'` (never `'unsafe-eval'`: the runtime has no `eval` / `new Function`) |
|
|
205
|
+
| WebGL, WebAudio | nothing |
|
|
206
|
+
|
|
207
|
+
Example for an embed with a HUD: `Content-Security-Policy: default-src 'self'; script-src 'self'; connect-src 'self'; img-src 'self' blob:; style-src 'self' 'unsafe-inline'`. The same with `--optimize` models: `script-src 'self' 'wasm-unsafe-eval'`. Subresource Integrity (`integrity="sha384-…"` on the runtime script and preloads) works with policies that require it; the lazy chunks are same-origin files of the same folder.
|
|
208
|
+
|
|
209
|
+
## Troubleshooting
|
|
210
|
+
|
|
211
|
+
| Symptom | Cause | Fix |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| Blank area, console "Failed to load module script" | Wrong runtime URL, or the server sends `.js` as `text/plain` | Fix the path; serve `.js` as `text/javascript` |
|
|
214
|
+
| Poster stays, `agent3d:error` `scene-load` | Wrong `src`, or the scene's folder moved | Check the URL of `scene.json` in the browser |
|
|
215
|
+
| Console "Failed to find a valid digest in the 'integrity' attribute" | The runtime folder was replaced (Agent3D update) but the page kept the old snippet | Paste the new snippet (or export with `--no-integrity`) |
|
|
216
|
+
| Missing model or texture | The `<name>/assets/` folder was not uploaded, or renamed | Upload the whole `<name>/` folder |
|
|
217
|
+
| Works locally, not on the site | CSP | Allow the directives above |
|
|
218
|
+
| Nothing at all from `file://` | Browsers block module scripts on `file://` | Use a local server (`serve`, or any static server) |
|
|
219
|
+
| Poster forever on some devices | WebGL unavailable (`webgl-unavailable`) | Expected fallback; keep a good poster |
|
|
220
|
+
| Models missing only on the live site, console mentions WebAssembly / CSP | meshopt models (`--optimize`) blocked by the CSP | Add `'wasm-unsafe-eval'` to `script-src`, or export without `--optimize` |
|
|
221
|
+
| Screen readers announce `{data.title}` | Placeholder in the scene `title` / `ariaLabel`, copied as is into the snippet | Write a literal `aria-label` / `alt` in the snippet (and a literal `title` / `ariaLabel` in the scene) |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Aurora night banner
|
|
2
|
+
|
|
3
|
+
A 4:1 night banner: an `aurora` shader sky plane rippling behind low-poly `terrain` mountains (dark silhouettes with snowy peaks), twinkling stars, falling snow motes, two glowing `crystals` clusters (cyan left, violet right) casting coloured light pools on the snow, and a Montserrat ExtraBold headline that fades in letter by letter. Bloom, cool grade, grain, pointer parallax. Zero asset bytes besides the font.
|
|
4
|
+
|
|
5
|
+
## What to tweak
|
|
6
|
+
|
|
7
|
+
| Change | Where |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Headline | `data.title` (or `data-title` on the embed). ~15 characters at `size` 0.8; reduce it for longer text |
|
|
10
|
+
| Aurora colours / speed | `objects#sky.material.uniforms` (`colors`, `speed`, `intensity`; keep `background` = `environment.background`) |
|
|
11
|
+
| Crystal colours | `objects#crystalsL.params.colors`, `objects#crystalsR.params.colors` (+ the matching `lights#glowL` / `glowR` colours) |
|
|
12
|
+
| Mountains | `objects#mountains.params` (`seed` on the object for another range, `height`, `palette`) |
|
|
13
|
+
| Letter animation | `objects#title.reveal` (`fade` here; `rise`, `drop`, `scale`, `spin`) |
|
|
14
|
+
|
|
15
|
+
Reduced motion shows the frame at 3 s (headline complete).
|
|
Binary file
|