@fleox/agent3d 0.5.0 → 0.5.2

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 (31) hide show
  1. package/README.md +39 -10
  2. package/changelog.json +9 -0
  3. package/dist/agent/agent3d.mjs +2 -2
  4. package/dist/agent/chunks/{package-DzXqX5Oe.mjs → package-Bn7PKfXn.mjs} +1 -1
  5. package/dist/runtime/agent3d-runtime.js +1 -1
  6. package/dist/runtime/agent3d-runtime.single.js +1 -1
  7. package/dist/studio/assets/{assets-DnOt59SU.js → assets-DICv7P37.js} +1 -1
  8. package/dist/studio/assets/{camera-DrubOxWu.js → camera-HsMeC1mn.js} +1 -1
  9. package/dist/studio/assets/{editor-V--luWVq.js → editor-BZLIZJC8.js} +1 -1
  10. package/dist/studio/assets/{game-43BhY_EE.js → game-DnnuBk26.js} +1 -1
  11. package/dist/studio/assets/{generators-lG93qWTO.js → generators-C4n9MsXd.js} +1 -1
  12. package/dist/studio/assets/{index-BPVRhKVV.js → index-cDbmaVDl.js} +4 -4
  13. package/dist/studio/assets/{model-D8-inS_D.js → model-CkPfLOl0.js} +1 -1
  14. package/dist/studio/assets/{photo-BuVK-UvQ.js → photo-CPGGCRa-.js} +1 -1
  15. package/dist/studio/assets/{postfx-Bcnem9ci.js → postfx-Dp7mgfGJ.js} +1 -1
  16. package/dist/studio/assets/{runtime-5Ti8UJJR.js → runtime-ByR4qfyV.js} +4 -4
  17. package/dist/studio/assets/{shaders-WM5brr9C.js → shaders-DoRMwJE_.js} +1 -1
  18. package/dist/studio/assets/{svg-CJ_RtiER.js → svg-n3rkKAm5.js} +1 -1
  19. package/dist/studio/assets/{text-NO7lyCoH.js → text-BkPPDghK.js} +1 -1
  20. package/dist/studio/index.html +1 -1
  21. package/package.json +1 -1
  22. package/plugin/.claude-plugin/plugin.json +1 -1
  23. package/plugin/skills/agent3d-assets/SKILL.md +28 -28
  24. package/plugin/skills/agent3d-create/SKILL.md +30 -30
  25. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  26. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  27. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  28. package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
  29. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  30. package/plugin/skills/agent3d-publish/SKILL.md +23 -23
  31. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
@@ -4,7 +4,7 @@ description: Build a mini game or an interactive 3D experience for a web page wi
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.5.0"
7
+ version: "0.5.2"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -15,13 +15,13 @@ A game is an ordinary scene (`target.kind: "game"`) plus **scripts**: ES modules
15
15
 
16
16
  **Language:** talk to the user in their language; keep commands, ids, code and files in English.
17
17
 
18
- Every command is `npx -y @fleox/agent3d@0.5.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
18
+ Every command is `npx -y @fleox/agent3d@0.5.2 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
19
19
 
20
20
  ## Start
21
21
 
22
22
  ```bash
23
- npx -y @fleox/agent3d@0.5.0 new dodge --target game --title "Dodge" --json
24
- npx -y @fleox/agent3d@0.5.0 scene summary --project dodge --json
23
+ npx -y @fleox/agent3d@0.5.2 new dodge --target game --title "Dodge" --json
24
+ npx -y @fleox/agent3d@0.5.2 scene summary --project dodge --json
25
25
  ```
26
26
 
27
27
  The game starter has a `kinematic` player moved by position, coins with a `coin` tag, a follow camera, a score HUD, a coin sound and `scripts/game.js` (move with arrows / WASD, collect coins). Game templates to start from (`templates list --json`): `game-coin-collector`, `game-runner`, `game-maze`, `game-tap-targets`, `game-physics-playground` (rigid bodies, impulses, impact sounds) — `new my-game --template game-physics-playground --json`. A complete validated example (lane runner: lanes, spawning by cloning, difficulty ramp, best score, attract mode) is in skill `agent3d-create` → `references/recipes.md` ("Lane runner game"; "Physics toss game" for rigid bodies); patterns in [references/game-patterns.md](references/game-patterns.md); the full API in [references/script-api.md](references/script-api.md).
@@ -55,15 +55,15 @@ Scripts only get `api`. `check` fails (`forbidden-script`) on `fetch`, `XMLHttpR
55
55
  1. Design the loop with the user in one paragraph: goal, controls (keyboard + touch), how you lose, what the score counts, how long a round lasts (30–90 s for a web page).
56
56
  2. Declare the scene: player and obstacle templates (hidden, with `tags` and a `body`), camera, HUD elements per phase, sounds (`catalog sounds`), `data` for tuning.
57
57
  3. Write the script (patterns below). Keep it under ~200 lines; one file is fine.
58
- 4. Validate and lint: `npx -y @fleox/agent3d@0.5.0 check --project dodge --json` (sandbox errors carry the line: `scripts/game.js:12`).
58
+ 4. Validate and lint: `npx -y @fleox/agent3d@0.5.2 check --project dodge --json` (sandbox errors carry the line: `scripts/game.js:12`).
59
59
  5. Render several moments and LOOK:
60
60
  ```bash
61
- npx -y @fleox/agent3d@0.5.0 render --project dodge --sheet --frames 0,2,4,6 --json
61
+ npx -y @fleox/agent3d@0.5.2 render --project dodge --sheet --frames 0,2,4,6 --json
62
62
  ```
63
63
  Plain renders have no player input, so the game must show something on its own: an **attract mode** (an autopilot plays during the `ready` phase, behind the title and Play button). The HUD is captured because the scene has a `ui` (`--capture page` forces it); posters (`export --format poster`, the embed's `poster.webp`) and videos show the canvas only, without the HUD. Check `data.issues` and `data.consoleErrors` for `script-error`. `data.state` is the script's `api.state` after the last frame (e.g. `{ "score": 0, "phase": "ready" }`); frame and sheet paths are relative to the project folder `data.dir`.
64
64
  6. **Play it headlessly** with `--input`: a JSON script of simulated keys / clicks applied while seeking (frames are rendered in time order), then check `data.state` and the frames:
65
65
  ```bash
66
- npx -y @fleox/agent3d@0.5.0 render --project dodge --sheet --frames 0,1,2,3 --input '[{"t": 0.2, "click": [0, -0.3]}, {"t": 0.5, "key": "ArrowLeft", "hold": 0.6}, {"t": 1.5, "key": "Space", "down": true}, {"t": 1.6, "key": "Space", "down": false}]' --json
66
+ npx -y @fleox/agent3d@0.5.2 render --project dodge --sheet --frames 0,1,2,3 --input '[{"t": 0.2, "click": [0, -0.3]}, {"t": 0.5, "key": "ArrowLeft", "hold": 0.6}, {"t": 1.5, "key": "Space", "down": true}, {"t": 1.6, "key": "Space", "down": false}]' --json
67
67
  ```
68
68
  Events: `{ "t", "key", "down" }` (`key` is a `KeyboardEvent.code`: `ArrowLeft`, `KeyA`, `Space`…; `down: false` releases), `{ "t", "key", "hold": seconds }` (press and release), `{ "t", "click": [x, y] }`, `{ "t", "pointer": [x, y] }` (add `"down": true` / `false` to press / release there), `{ "t", "pointerDown": [x, y] }` and `{ "t", "pointerUp": [x, y] }` (hold the pointer: `api.input.pointer.down`), `{ "t", "drag": { "from": [x, y], "to": [x, y], "duration": 0.4 } }` (press, move, release), `{ "t", "swipe": "left" | "right" | "up" | "down" }` (what `api.input.swipe()` returns next step), `{ "t", "scroll": 0.5 }` (page scroll progress, scroll-driven scenes), `{ "t", "ui": "retryBtn" }` (click that HUD button by id — a warning in `inputWarnings` when it is hidden at that time), `{ "t", "emit": "retry" }` (emit the event / button action directly), `{ "t", "segment": "intro" }` (play a timeline segment) — canvas coordinates −1..1, y up (a canvas `click` never presses a HUD button: use `ui`). Unknown fields are rejected (exit 2, the hint lists the valid shapes). Test the touch controls too, e.g. `--input '[{"t": 0.5, "swipe": "left"}, {"t": 1.2, "drag": {"from": [0, -0.5], "to": [0, 0.3], "duration": 0.3}}]'`. Use `@inputs.json` for longer scripts. MCP: `render_preview` takes the same events as `input`.
69
69
  7. To test a state that is hard to reach with input (game over screen, high score), temporarily set the starting phase in `api.data` (e.g. `"startPhase": "over"`), render, then restore it.
@@ -4,7 +4,7 @@ description: Export an Agent3D scene and put it on a website - embed folder (Web
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.5.0"
7
+ version: "0.5.2"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -13,12 +13,12 @@ allowed-tools: Bash Read Write
13
13
 
14
14
  **Language:** talk to the user in their language; keep commands, code and files in English.
15
15
 
16
- Every command is `npx -y @fleox/agent3d@0.5.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
16
+ Every command is `npx -y @fleox/agent3d@0.5.2 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
17
17
 
18
18
  ## Before exporting
19
19
 
20
20
  ```bash
21
- npx -y @fleox/agent3d@0.5.0 check --project my-banner --render --json
21
+ npx -y @fleox/agent3d@0.5.2 check --project my-banner --render --json
22
22
  ```
23
23
 
24
24
  No errors, no warnings (or warnings the user accepted). Keep the `licences` list: credits ship in the export.
@@ -39,21 +39,21 @@ Every asset the scene uses is copied into the export (never hotlinked): a 3D pho
39
39
  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.
40
40
 
41
41
  ```bash
42
- npx -y @fleox/agent3d@0.5.0 export --project my-banner --json
43
- npx -y @fleox/agent3d@0.5.0 export --project my-banner --name spring-banner --out ./site/agent3d --json
44
- npx -y @fleox/agent3d@0.5.0 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
45
- npx -y @fleox/agent3d@0.5.0 export --project my-banner --optimize --json
46
- npx -y @fleox/agent3d@0.5.0 export --format zip --project my-banner --json
47
- npx -y @fleox/agent3d@0.5.0 export --format single-html --project my-banner --json
48
- npx -y @fleox/agent3d@0.5.0 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
49
- npx -y @fleox/agent3d@0.5.0 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
50
- npx -y @fleox/agent3d@0.5.0 export --format gif --duration 4 --project my-banner --json
42
+ npx -y @fleox/agent3d@0.5.2 export --project my-banner --json
43
+ npx -y @fleox/agent3d@0.5.2 export --project my-banner --name spring-banner --out ./site/agent3d --json
44
+ npx -y @fleox/agent3d@0.5.2 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
45
+ npx -y @fleox/agent3d@0.5.2 export --project my-banner --optimize --json
46
+ npx -y @fleox/agent3d@0.5.2 export --format zip --project my-banner --json
47
+ npx -y @fleox/agent3d@0.5.2 export --format single-html --project my-banner --json
48
+ npx -y @fleox/agent3d@0.5.2 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
49
+ npx -y @fleox/agent3d@0.5.2 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
50
+ npx -y @fleox/agent3d@0.5.2 export --format gif --duration 4 --project my-banner --json
51
51
  ```
52
52
 
53
53
  **Social video** (LinkedIn, Instagram, TikTok, YouTube): `--preset vertical` (1080×1920), `square` (1080×1080), `landscape` (1920×1080) or `story` (1080×1920, max 15 s) gives an H.264 MP4 at 30 fps and ~10 Mbit/s whose length is **one seamless loop** of the 3D photo's `motion.auto` move (set `dolly`, `pan`, `rise` or `vertigo` for a cinematic camera move — skill `agent3d-create`), with a **cover fit**: the photo fills the frame whatever the scene's aspect, its edges never show. Read `notes` in the result (what was cropped, how much the camera was tightened), and look at three frames before posting — text laid out for 16:9 gets cut in 9:16:
54
54
  ```bash
55
- npx -y @fleox/agent3d@0.5.0 render --preset vertical --count 4 --sheet --project my-hero --json # check the framing
56
- npx -y @fleox/agent3d@0.5.0 export --format video --preset vertical --project my-hero --json # dist/video-vertical.mp4
55
+ npx -y @fleox/agent3d@0.5.2 render --preset vertical --count 4 --sheet --project my-hero --json # check the framing
56
+ npx -y @fleox/agent3d@0.5.2 export --format video --preset vertical --project my-hero --json # dist/video-vertical.mp4
57
57
  ```
58
58
  The `export` AI tool takes the same `preset` (format `video`).
59
59
 
@@ -79,11 +79,11 @@ Embed / zip options:
79
79
  Media straight from `render` (frame-exact, any size / fps; LOOK at a few frames of the result):
80
80
 
81
81
  ```bash
82
- npx -y @fleox/agent3d@0.5.0 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
83
- npx -y @fleox/agent3d@0.5.0 render --gif renders/banner.gif --duration 4 --project my-banner --json
84
- npx -y @fleox/agent3d@0.5.0 render --webp renders/banner.webp --duration 4 --project my-banner --json
85
- npx -y @fleox/agent3d@0.5.0 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
86
- npx -y @fleox/agent3d@0.5.0 render --scroll 0.5 --project my-scroll-story --json
82
+ npx -y @fleox/agent3d@0.5.2 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
83
+ npx -y @fleox/agent3d@0.5.2 render --gif renders/banner.gif --duration 4 --project my-banner --json
84
+ npx -y @fleox/agent3d@0.5.2 render --webp renders/banner.webp --duration 4 --project my-banner --json
85
+ npx -y @fleox/agent3d@0.5.2 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
86
+ npx -y @fleox/agent3d@0.5.2 render --scroll 0.5 --project my-scroll-story --json
87
87
  ```
88
88
 
89
89
  `--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).
@@ -91,8 +91,8 @@ npx -y @fleox/agent3d@0.5.0 render --scroll 0.5 --project my-scroll-story --json
91
91
  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):
92
92
 
93
93
  ```bash
94
- npx -y @fleox/agent3d@0.5.0 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
95
- npx -y @fleox/agent3d@0.5.0 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
94
+ npx -y @fleox/agent3d@0.5.2 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
95
+ npx -y @fleox/agent3d@0.5.2 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
96
96
  ```
97
97
 
98
98
  `--reduced-motion` renders what visitors with prefers-reduced-motion see.
@@ -123,7 +123,7 @@ Always paste the snippet from the export result (hashes and file names change wi
123
123
  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:
124
124
 
125
125
  ```bash
126
- npx -y @fleox/agent3d@0.5.0 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
126
+ npx -y @fleox/agent3d@0.5.2 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
127
127
  ```
128
128
 
129
129
  ```html
@@ -136,7 +136,7 @@ Placeholders work in text objects' `text`, any object's `href` and HUD texts. `{
136
136
 
137
137
  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:
138
138
 
139
- - **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.5.0 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).
139
+ - **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.5.2 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).
140
140
  - **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.
141
141
  - **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.
142
142
  - **Squarespace / Wix / Framer**: `single-html` in an `<iframe>`.
@@ -7,7 +7,7 @@ All examples assume the embed export was uploaded to `/agent3d/` at the root of
7
7
  /agent3d/spring-banner/scene.json (+ assets/, scripts/, poster.webp, og-image.png, CREDITS.txt)
8
8
  ```
9
9
 
10
- Export straight into that layout with `npx -y @fleox/agent3d@0.5.0 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.
10
+ Export straight into that layout with `npx -y @fleox/agent3d@0.5.2 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
11
 
12
12
  ## Plain HTML
13
13