@fleox/agent3d 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -10
- package/changelog.json +9 -0
- package/dist/agent/agent3d.mjs +2 -2
- package/dist/agent/chunks/{package-Dkr2v4or.mjs → package-fw4h5vsh.mjs} +1 -1
- package/dist/runtime/agent3d-runtime.js +1 -1
- package/dist/runtime/agent3d-runtime.single.js +1 -1
- package/dist/studio/assets/{camera-braC-Y4j.js → camera-Be6lnp3k.js} +1 -1
- package/dist/studio/assets/{editor-DwKj0yf_.js → editor-Mpnz-b2E.js} +1 -1
- package/dist/studio/assets/{game-Bd0sO8CA.js → game-WMgRSJUD.js} +3 -3
- package/dist/studio/assets/{generators-CFiebqmG.js → generators-DozXE7ta.js} +1 -1
- package/dist/studio/assets/{index-C87jPees.js → index-tSGZFEt5.js} +4 -4
- package/dist/studio/assets/{model-Bg7e4Z-9.js → model-C2bZTK7-.js} +1 -1
- package/dist/studio/assets/{physicsHost-CwJdYJ2g.js → physicsHost-CTRsIvfu.js} +1 -1
- package/dist/studio/assets/{postfx-CGkvYb03.js → postfx-DQtp0JIy.js} +1 -1
- package/dist/studio/assets/{runtime-DNb5FyOS.js → runtime-NGp1VdnH.js} +4 -4
- package/dist/studio/assets/{shaders-Brwuj1zc.js → shaders-BOb6Uter.js} +1 -1
- package/dist/studio/assets/{svg-Db96jdHi.js → svg-CnUMpv_N.js} +1 -1
- package/dist/studio/assets/{text-DqnNIq0M.js → text-CGIZs8HE.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agent3d-assets/SKILL.md +24 -24
- package/plugin/skills/agent3d-create/SKILL.md +20 -20
- package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
- package/plugin/skills/agent3d-create/references/recipes.md +6 -6
- package/plugin/skills/agent3d-edit/SKILL.md +22 -22
- package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
- package/plugin/skills/agent3d-game/SKILL.md +7 -7
- package/plugin/skills/agent3d-publish/SKILL.md +21 -21
- package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
|
@@ -4,7 +4,7 @@ description: Find and add 3D assets to an Agent3D project - the built-in CC0 lib
|
|
|
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.2.
|
|
7
|
+
version: "0.2.3"
|
|
8
8
|
repository: "https://github.com/fleox/agent3d"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -13,7 +13,7 @@ allowed-tools: Bash Read Write
|
|
|
13
13
|
|
|
14
14
|
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
15
15
|
|
|
16
|
-
Every command is `npx -y @fleox/agent3d@0.2.
|
|
16
|
+
Every command is `npx -y @fleox/agent3d@0.2.3 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
17
17
|
|
|
18
18
|
## Pick the cheapest thing that looks right
|
|
19
19
|
|
|
@@ -25,16 +25,16 @@ Every command is `npx -y @fleox/agent3d@0.2.2 <command> --json` with `--project
|
|
|
25
25
|
## The built-in library
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npx -y @fleox/agent3d@0.2.
|
|
29
|
-
npx -y @fleox/agent3d@0.2.
|
|
30
|
-
npx -y @fleox/agent3d@0.2.
|
|
28
|
+
npx -y @fleox/agent3d@0.2.3 assets library --query tree --json
|
|
29
|
+
npx -y @fleox/agent3d@0.2.3 assets library --kind hdri --json
|
|
30
|
+
npx -y @fleox/agent3d@0.2.3 assets library --query character --kind model --json
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
The answer lists the matches in `data.assets[]` (with `data.total` and `data.more`; `assets search` below names its list `data.hits[]` instead). Each entry has `ref` (use it as is in the scene), `description` (with the bounding box), `tags`, `license`, `kb`, and for models `triangles`, `size` (bounding box w × h × d in model units, Y-up) and `animations` (the clip names of animated models). Listings show 50 results per page: narrow with `--query` and `--kind`; when `more` is true, page with `--offset 50` (or `--limit 100`, `--all`).
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npx -y @fleox/agent3d@0.2.
|
|
37
|
-
npx -y @fleox/agent3d@0.2.
|
|
36
|
+
npx -y @fleox/agent3d@0.2.3 assets library --kind model --offset 50 --json
|
|
37
|
+
npx -y @fleox/agent3d@0.2.3 assets library --kind model --all --json
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
```json
|
|
@@ -51,9 +51,9 @@ npx -y @fleox/agent3d@0.2.2 assets library --kind model --all --json
|
|
|
51
51
|
## Searching free sources (network)
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
npx -y @fleox/agent3d@0.2.
|
|
55
|
-
npx -y @fleox/agent3d@0.2.
|
|
56
|
-
npx -y @fleox/agent3d@0.2.
|
|
54
|
+
npx -y @fleox/agent3d@0.2.3 assets search "wood planks" --kind texture --project my-scene --json
|
|
55
|
+
npx -y @fleox/agent3d@0.2.3 assets search sunset --kind hdri --source polyhaven --project my-scene --json
|
|
56
|
+
npx -y @fleox/agent3d@0.2.3 assets search fox --source khronos --project my-scene --json
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
The answer lists the matches in `data.hits[]`; each hit has `source`, `id`, `title`, `kind`, `license`, `author`, `attribution` (when the licence needs one), `previewUrl` (show it to the user or open it), `pageUrl`, `downloads` (resolutions / formats). Per-source failures come in `data.errors` without failing the search. Search terms match titles and tags: try synonyms ("planks", "wood floor") when a search is poor.
|
|
@@ -61,13 +61,13 @@ The answer lists the matches in `data.hits[]`; each hit has `source`, `id`, `tit
|
|
|
61
61
|
Download one hit into the project (licence recorded in `assets/manifest.json`):
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
npx -y @fleox/agent3d@0.2.
|
|
64
|
+
npx -y @fleox/agent3d@0.2.3 assets add --hit @hit.json --resolution 1k --project my-scene --json
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
`@hit.json` is a file holding one hit object from the search (or pass the JSON inline). Models come back with `data.asset.bounds`: `size` (w × h × d in model units, node transforms applied), `center`, `min` / `max` and `upAxis` (`"y"`, or `"z?"` when the model is much deeper than tall — it may lie on its back; check it with `render --isolate <objectId>`, which renders that object alone from the front (+Z) on a neutral background). Local `.glb` / `.gltf` files added with `assets add <file>` return the same `bounds`. Textures from ambientCG / Poly Haven download the whole set (colour, normal, roughness, AO) and return `data.asset.suggestion.material`, a ready material to `set` on an object. Poly Haven models download as `.gltf` + `.bin` + textures in a folder: use the returned `path` as the model `src`. Keep `--resolution 1k` for the web (2k only for a hero close-up). Sources start at 1k: `--resolution 512` (or `256`) downloads 1k and downscales every texture to that size with headless Chrome (`data.asset.optimized`); `--max-size <px>` does the same for any resolution.
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
npx -y @fleox/agent3d@0.2.
|
|
70
|
+
npx -y @fleox/agent3d@0.2.3 assets add --hit @hit.json --resolution 512 --project my-banner --json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
## Kenney and Quaternius packs (manual zip)
|
|
@@ -75,7 +75,7 @@ npx -y @fleox/agent3d@0.2.2 assets add --hit @hit.json --resolution 512 --projec
|
|
|
75
75
|
Their hits are `manual: true`: there is no direct download (the hit's `note` says so). Ask the user to download the pack zip from `pageUrl` (free, no account), then import it with `assets add <file.zip>` (the zip importer extracts only `.glb` / `.gltf` + textures; `--filter` keeps the models whose path contains the word, repeat it for several words; `--name` sets the folder under `assets/models/`):
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
npx -y @fleox/agent3d@0.2.
|
|
78
|
+
npx -y @fleox/agent3d@0.2.3 assets add ~/Downloads/kenney_platformer-kit.zip --source kenney --license CC0-1.0 --filter coin --filter flag --name platformer --project my-game --json
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The answer lists the imported model paths (`models`) to use as `src`, plus `totalKb`. Importing a whole pack can add megabytes: always filter to what the scene uses. (MCP clients: the `assets_add` tool takes `{ "file", "source", "license", "filter": [...] }`.)
|
|
@@ -83,9 +83,9 @@ The answer lists the imported model paths (`models`) to use as `src`, plus `tota
|
|
|
83
83
|
## The user's own files
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
|
-
npx -y @fleox/agent3d@0.2.
|
|
87
|
-
npx -y @fleox/agent3d@0.2.
|
|
88
|
-
npx -y @fleox/agent3d@0.2.
|
|
86
|
+
npx -y @fleox/agent3d@0.2.3 assets add ./logo.svg --license proprietary --project my-banner --json
|
|
87
|
+
npx -y @fleox/agent3d@0.2.3 assets add ./bottle.glb --license proprietary --author "Acme" --project my-banner --json
|
|
88
|
+
npx -y @fleox/agent3d@0.2.3 assets add ./jingle.mp3 --kind audio --license CC-BY-4.0 --author "Jane Doe" --source-url https://example.com/jingle --project my-game --json
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
`--license` is required (an SPDX id such as `CC0-1.0`, `CC-BY-4.0`, or `proprietary` for the user's own work). Files go to `assets/models/`, `assets/textures/`, `assets/hdri/`, `assets/audio/`, `assets/fonts/`, `assets/svg/` or `assets/other/` by kind, unless `--path` says otherwise. SVG logos become 3D with an `svg` object; product models with a `model` object and `fit`; audio with `audio.sounds` / `audio.music` (`{ "src": "assets/audio/jingle.mp3" }`).
|
|
@@ -101,9 +101,9 @@ Each path keeps its SVG colour (`keepColors`: default `true` without a `material
|
|
|
101
101
|
## Listing and removing
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
npx -y @fleox/agent3d@0.2.
|
|
105
|
-
npx -y @fleox/agent3d@0.2.
|
|
106
|
-
npx -y @fleox/agent3d@0.2.
|
|
104
|
+
npx -y @fleox/agent3d@0.2.3 assets list --project my-scene --json
|
|
105
|
+
npx -y @fleox/agent3d@0.2.3 assets remove assets/textures/old.jpg --project my-scene --json
|
|
106
|
+
npx -y @fleox/agent3d@0.2.3 assets remove assets/textures/old.jpg --yes --project my-scene --json
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
`assets list` shows each file's size on disk, licence, whether it exists and which objects use it (`usedBy`); it is read-only: entries whose recorded size differs from the file on disk are listed in `stale` (`assets optimize` / `assets add` rewrite the manifest). `remove` prints a plan (with `usedBy`) unless `--yes`: fix the references first.
|
|
@@ -113,11 +113,11 @@ npx -y @fleox/agent3d@0.2.2 assets remove assets/textures/old.jpg --yes --projec
|
|
|
113
113
|
When `check` reports `budget` or `optimizable`, or before exporting a scene with project textures / `.glb` models, run `assets optimize`. Without `--yes` it prints the plan (no Chrome needed): for every file the size it will get and **why** (target kind, the object's size on screen, the camera distance, the texture role). Show the plan to the user, then apply:
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
npx -y @fleox/agent3d@0.2.
|
|
117
|
-
npx -y @fleox/agent3d@0.2.
|
|
118
|
-
npx -y @fleox/agent3d@0.2.
|
|
119
|
-
npx -y @fleox/agent3d@0.2.
|
|
120
|
-
npx -y @fleox/agent3d@0.2.
|
|
116
|
+
npx -y @fleox/agent3d@0.2.3 assets optimize --all --project my-hero --json
|
|
117
|
+
npx -y @fleox/agent3d@0.2.3 assets optimize --all --dry-run --project my-hero --json
|
|
118
|
+
npx -y @fleox/agent3d@0.2.3 assets optimize --all --yes --project my-hero --json
|
|
119
|
+
npx -y @fleox/agent3d@0.2.3 assets optimize assets/models/robot.glb --simplify 0.5 --yes --project my-game --json
|
|
120
|
+
npx -y @fleox/agent3d@0.2.3 assets optimize assets/textures/wood_planks --max-size 512 --format jpeg --yes --project my-banner --json
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
- **Smart size (default).** Each texture gets the smallest tier (256 / 512 / 1024 / 2048; up to 4096 for an equirect background) that still gives about one texel per screen pixel where the scene shows it: canvas size from the target (a hero ≈ 2880×1620 device px), object size (`fit`, geometry, scale) and closest camera distance (orbit zoom, scroll paths and timeline camera keys count), divided by `repeat`. Normal maps get ~0.75× and roughness ~0.5× of the colour size; a model's atlas ~1.5× its on-screen size. Heroes never go below 512 for colour maps; games and cards are capped at 1024. Textures not placed in `scene.json` (scripts, unused) get 1024. `--max-size <px>` forces one size for everything. Never upscales.
|
|
@@ -4,7 +4,7 @@ description: Build a 3D element for a web page from a brief with Agent3D - an an
|
|
|
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.2.
|
|
7
|
+
version: "0.2.3"
|
|
8
8
|
repository: "https://github.com/fleox/agent3d"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -15,9 +15,9 @@ Agent3D turns a JSON **scene** (`scene.json` in a project folder) into a 3D elem
|
|
|
15
15
|
|
|
16
16
|
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
17
17
|
|
|
18
|
-
Every command is `npx -y @fleox/agent3d@0.2.
|
|
18
|
+
Every command is `npx -y @fleox/agent3d@0.2.3 <command> --json` and prints one object: `{"ok": true, "data": …}` or `{"ok": false, "error": {"code", "message", "hint"}}`. Read `error.hint` when `ok` is false: it says what to do. `npx -y @fleox/agent3d@0.2.3 help scene --json` lists any command's actions and options. Pass `--project <dir>` to every project command (default: the current directory).
|
|
19
19
|
|
|
20
|
-
First run on a machine: `npx -y @fleox/agent3d@0.2.
|
|
20
|
+
First run on a machine: `npx -y @fleox/agent3d@0.2.3 doctor --json` checks Node, Chrome and does a test render: `{ ok: true, data: { checks } }` when everything required passes, else `{ ok: false, error: { code: "doctor-failed", hint } }` (exit 1) with one hint per failed check and every check in `error.details.checks`. Without Chrome, renders and posters fail with a hint (install Chrome, or set `AGENT3D_CHROME`); `export --no-poster` still works.
|
|
21
21
|
|
|
22
22
|
## The loop
|
|
23
23
|
|
|
@@ -28,23 +28,23 @@ First run on a machine: `npx -y @fleox/agent3d@0.2.2 doctor --json` checks Node,
|
|
|
28
28
|
- **Motion**: calm ambient loop (default for banners), interactive (follow the pointer, hover, orbit), scroll-driven, or a game.
|
|
29
29
|
2. **Start** from a template or from the starter for the target:
|
|
30
30
|
```bash
|
|
31
|
-
npx -y @fleox/agent3d@0.2.
|
|
32
|
-
npx -y @fleox/agent3d@0.2.
|
|
33
|
-
npx -y @fleox/agent3d@0.2.
|
|
31
|
+
npx -y @fleox/agent3d@0.2.3 templates list --json
|
|
32
|
+
npx -y @fleox/agent3d@0.2.3 new bakery-banner --target banner --title "Golden Crust Bakery" --json
|
|
33
|
+
npx -y @fleox/agent3d@0.2.3 new bakery-banner --template banner-neon-title --title "Golden Crust Bakery" --json
|
|
34
34
|
```
|
|
35
35
|
Without `--template`, `new` writes an attractive valid starter for the target (banner: gradient background, studio lights, a floating 3D title, a few props, dust particles, a slow loop; game: + `scripts/game.js`). `--aspect 21:9` overrides the aspect.
|
|
36
36
|
3. **Learn what exists** before writing anything. Never guess ids or parameter names:
|
|
37
37
|
```bash
|
|
38
|
-
npx -y @fleox/agent3d@0.2.
|
|
39
|
-
npx -y @fleox/agent3d@0.2.
|
|
40
|
-
npx -y @fleox/agent3d@0.2.
|
|
41
|
-
npx -y @fleox/agent3d@0.2.
|
|
42
|
-
npx -y @fleox/agent3d@0.2.
|
|
38
|
+
npx -y @fleox/agent3d@0.2.3 catalog --json
|
|
39
|
+
npx -y @fleox/agent3d@0.2.3 catalog generators terrain --json
|
|
40
|
+
npx -y @fleox/agent3d@0.2.3 catalog behaviours --json
|
|
41
|
+
npx -y @fleox/agent3d@0.2.3 catalog postfx look --json
|
|
42
|
+
npx -y @fleox/agent3d@0.2.3 scene summary --project bakery-banner --json
|
|
43
43
|
```
|
|
44
44
|
Sections: geometries, materialPresets, shaders, textures (procedural, zero bytes), lightRigs, behaviours, generators, particlePresets, postfx (with the `look` presets and each effect's GPU cost), fonts, sounds. Built-in models, textures and HDRIs: `assets library --query <word>` (skill `agent3d-assets`). The field-by-field scene format is in the `agent3d-edit` skill (`references/patch-ops.md`).
|
|
45
45
|
4. **Build with patches** (small, reviewable, ids stay stable). Write the ops to a file and apply them:
|
|
46
46
|
```bash
|
|
47
|
-
npx -y @fleox/agent3d@0.2.
|
|
47
|
+
npx -y @fleox/agent3d@0.2.3 scene patch --project bakery-banner --file ops.json --json
|
|
48
48
|
```
|
|
49
49
|
```json
|
|
50
50
|
[
|
|
@@ -61,7 +61,7 @@ First run on a machine: `npx -y @fleox/agent3d@0.2.2 doctor --json` checks Node,
|
|
|
61
61
|
- **Gotcha:** `updateObject` and `merge` deep-merge. Switching `material.preset` with `updateObject` keeps the old `color` / `roughness` overrides (gold stays white). To change a look, **replace** the material: `{ "op": "set", "path": "objects#title.material", "value": { "preset": "gold" } }`.
|
|
62
62
|
5. **Render and LOOK** (this is the step that makes it good):
|
|
63
63
|
```bash
|
|
64
|
-
npx -y @fleox/agent3d@0.2.
|
|
64
|
+
npx -y @fleox/agent3d@0.2.3 render --project bakery-banner --sheet --count 4 --json
|
|
65
65
|
```
|
|
66
66
|
Then open `data.sheet` (a PNG contact sheet with time labels; paths are relative to the project folder `data.dir`) with the Read tool and judge it like an art director:
|
|
67
67
|
- **Framing at the aspect ratio**: nothing important cut at the edges; the subject reads at a glance; wide banners keep content in the central ~80% of the width.
|
|
@@ -76,33 +76,33 @@ First run on a machine: `npx -y @fleox/agent3d@0.2.2 doctor --json` checks Node,
|
|
|
76
76
|
- To show the user the motion: `--gif renders/preview.gif --duration 4` (or `--video <file>.mp4`, `--webp <file>.webp`); the path is relative to the project folder.
|
|
77
77
|
- `--isolate <objectId>` renders one object alone (no behaviours, scripts or UI), at the origin, auto-framed from the front three-quarter view (+Z front) on a neutral grey background, and returns `data.isolated.size`: the fastest way to check that a downloaded model faces +Z, stands upright and has a sensible size.
|
|
78
78
|
```bash
|
|
79
|
-
npx -y @fleox/agent3d@0.2.
|
|
79
|
+
npx -y @fleox/agent3d@0.2.3 render --project bakery-banner --isolate croissant-left --json
|
|
80
80
|
```
|
|
81
81
|
- Transparent scenes (`target.transparent`): frames keep their alpha and the contact sheet gets a checkerboard behind them; `--bg "#ffffff"` (any CSS colour) previews the scene over the host page's colour, frames included; `--bg none` turns it off.
|
|
82
82
|
6. **Fix and repeat** until it looks finished. Two or three iterations are normal; say what you changed and why.
|
|
83
83
|
7. **Check** until there are no errors and no warnings:
|
|
84
84
|
```bash
|
|
85
|
-
npx -y @fleox/agent3d@0.2.
|
|
85
|
+
npx -y @fleox/agent3d@0.2.3 check --project bakery-banner --render --json
|
|
86
86
|
```
|
|
87
87
|
It validates the scene, missing assets and scripts, the script sandbox, the triangle and KB budgets for the target, framing (with `--render`) and web settings (aria label, reduced motion, lazy start, pixel ratio cap), and lists licences that need attribution (`infos` with code `attribution`: keep those credits; the export writes `CREDITS.txt`).
|
|
88
88
|
- `data.budget.gpu` is the post-processing cost: `effects` (each with its `gpu` tier and passes), `passes`, `level` (`none`, `light`, `moderate`, `heavy`) and `dropped.low` (effects the `low` quality tier switches off on weak devices). A `postfx-cost` issue means too many fullscreen passes (a warning on games and fullscreen targets, an info elsewhere) or `ao` / `dof` on a game: keep the effects that change the image the most. Grading, vignette, film, chromatic and sharpen merge into one nearly free pass.
|
|
89
89
|
- Over the KB budget: `assets optimize` (skill `agent3d-assets`) shrinks project textures and models. Library assets are never shrunk there: the photographic `.hdr` files weigh 0.35 to 1.9 MB, so on banners and cards prefer a procedural `lighting` preset (`studio`, `soft`, `sunset`, `night`: zero bytes) plus a light rig.
|
|
90
90
|
8. **Export** and hand over:
|
|
91
91
|
```bash
|
|
92
|
-
npx -y @fleox/agent3d@0.2.
|
|
92
|
+
npx -y @fleox/agent3d@0.2.3 export --project bakery-banner --json
|
|
93
93
|
```
|
|
94
|
-
`data.snippet` is what goes in the page; `data.out` holds `agent3d-runtime/` (shared by every scene of the site), `<name>/` (scene, assets, poster, `CREDITS.txt`), `index.html` (a demo page), `snippet.html`, `head.html`, `EMBED.md` and `frameworks/` (React / Vue / Svelte wrappers). A second export into the same folder needs `--yes`. Give the user: the snippet, the folder to upload, the total size, the credits, and offer `serve` for a live look (`npx -y @fleox/agent3d@0.2.
|
|
94
|
+
`data.snippet` is what goes in the page; `data.out` holds `agent3d-runtime/` (shared by every scene of the site), `<name>/` (scene, assets, poster, `CREDITS.txt`), `index.html` (a demo page), `snippet.html`, `head.html`, `EMBED.md` and `frameworks/` (React / Vue / Svelte wrappers). A second export into the same folder needs `--yes`. Give the user: the snippet, the folder to upload, the total size, the credits, and offer `serve` for a live look (`npx -y @fleox/agent3d@0.2.3 serve --project bakery-banner --open`). Other formats (zip, single HTML file, poster image, MP4 / WebM video, GIF) and site integration: skill `agent3d-publish`.
|
|
95
95
|
|
|
96
96
|
## Other front doors: MCP and the Studio
|
|
97
97
|
|
|
98
98
|
Everything above also works without the shell:
|
|
99
99
|
|
|
100
|
-
- **MCP server** — `agent3d mcp` serves one project folder over stdio: the same tools as `tools list` (scene_patch, check, export…) plus `render_preview`, whose contact sheet comes back as an image the client can look at. Claude Code: `claude mcp add agent3d -- npx -y @fleox/agent3d@0.2.
|
|
100
|
+
- **MCP server** — `agent3d mcp` serves one project folder over stdio: the same tools as `tools list` (scene_patch, check, export…) plus `render_preview`, whose contact sheet comes back as an image the client can look at. Claude Code: `claude mcp add agent3d -- npx -y @fleox/agent3d@0.2.3 mcp --project /path/to/my-banner` (add `--scope project` to write `.mcp.json` for the repository). Claude Desktop / Cursor: in `claude_desktop_config.json` / `.cursor/mcp.json`:
|
|
101
101
|
```json
|
|
102
|
-
{ "mcpServers": { "agent3d": { "command": "npx", "args": ["-y", "@fleox/agent3d@0.2.
|
|
102
|
+
{ "mcpServers": { "agent3d": { "command": "npx", "args": ["-y", "@fleox/agent3d@0.2.3", "mcp", "--project", "/Users/me/agent3d/my-banner"] } } }
|
|
103
103
|
```
|
|
104
104
|
`--read-only` exposes only the tools that don't write. Desktop apps may not see the shell's `PATH`: use the absolute path of `npx` as `command` if the server doesn't start.
|
|
105
|
-
- **Studio** — `npx -y @fleox/agent3d@0.2.
|
|
105
|
+
- **Studio** — `npx -y @fleox/agent3d@0.2.3 studio --project bakery-banner` opens a visual editor on the same folder (viewport with move / rotate / scale gizmos, outliner, inspector, timeline, catalog and library, templates, check, render and export dialogs; English or French). It prints its local URL and runs until stopped. Edits go through the same validated tools, and changes you make from the CLI appear live in it, so the user can watch and tweak your work. The viewport starts in edit mode (scripts don't run, the timeline is paused and scrubbed); interact mode (`I`) runs the scene as the website does: scripts, hover / click / scroll triggers.
|
|
106
106
|
|
|
107
107
|
## Art direction that looks professional
|
|
108
108
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Numbers that work with the Agent3D runtime (ACES tone mapping by default, physically based lights, units ≈ metres). Start from them, render, look, adjust. Exact parameters live in the catalog — never guess them:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx -y @fleox/agent3d@0.2.
|
|
7
|
-
npx -y @fleox/agent3d@0.2.
|
|
8
|
-
npx -y @fleox/agent3d@0.2.
|
|
6
|
+
npx -y @fleox/agent3d@0.2.3 catalog lightRigs --json
|
|
7
|
+
npx -y @fleox/agent3d@0.2.3 catalog postfx look --json
|
|
8
|
+
npx -y @fleox/agent3d@0.2.3 catalog materialPresets --json
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Complete, rendered scenes for each idea below: [recipes.md](recipes.md).
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Each scene below passed `scene validate` (no errors, no warnings) and `check --render`, and was rendered and looked at (the README images in `docs/images/recipe-*.jpg` come from them). Start from the closest one, then change the brand parts (text, colours, model, URLs) with `scene patch` and render again:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx -y @fleox/agent3d@0.2.
|
|
7
|
-
npx -y @fleox/agent3d@0.2.
|
|
8
|
-
npx -y @fleox/agent3d@0.2.
|
|
9
|
-
npx -y @fleox/agent3d@0.2.
|
|
10
|
-
npx -y @fleox/agent3d@0.2.
|
|
6
|
+
npx -y @fleox/agent3d@0.2.3 new my-scene --target hero --json
|
|
7
|
+
npx -y @fleox/agent3d@0.2.3 scene validate --project my-scene --file recipe.json --json
|
|
8
|
+
npx -y @fleox/agent3d@0.2.3 scene apply --project my-scene --file recipe.json --yes --json
|
|
9
|
+
npx -y @fleox/agent3d@0.2.3 check --render --project my-scene --json
|
|
10
|
+
npx -y @fleox/agent3d@0.2.3 render --project my-scene --sheet --count 4 --json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Exact parameters of every rig, look, material, shader, generator and behaviour: `npx -y @fleox/agent3d@0.2.
|
|
13
|
+
Exact parameters of every rig, look, material, shader, generator and behaviour: `npx -y @fleox/agent3d@0.2.3 catalog <section> [id] --json`. Premium starting points per target kind: [art-direction.md](art-direction.md#premium-defaults).
|
|
14
14
|
|
|
15
15
|
## Product shot (1:1): softbox packshot
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@ description: Change an existing Agent3D project - summarise the scene, then patc
|
|
|
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.2.
|
|
7
|
+
version: "0.2.3"
|
|
8
8
|
repository: "https://github.com/fleox/agent3d"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -15,23 +15,23 @@ A project is a folder with `agent3d.json`, `scene.json` (the scene), `assets/` (
|
|
|
15
15
|
|
|
16
16
|
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
17
17
|
|
|
18
|
-
Every command is `npx -y @fleox/agent3d@0.2.
|
|
18
|
+
Every command is `npx -y @fleox/agent3d@0.2.3 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
19
19
|
|
|
20
20
|
## 1. Understand before changing
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx -y @fleox/agent3d@0.2.
|
|
24
|
-
npx -y @fleox/agent3d@0.2.
|
|
25
|
-
npx -y @fleox/agent3d@0.2.
|
|
23
|
+
npx -y @fleox/agent3d@0.2.3 info --project my-banner --json
|
|
24
|
+
npx -y @fleox/agent3d@0.2.3 scene summary --project my-banner --json
|
|
25
|
+
npx -y @fleox/agent3d@0.2.3 render --project my-banner --sheet --json
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
Look at the sheet (Read the `data.sheet` PNG, relative to the project folder `data.dir`), then tell the user in two or three sentences what the scene contains (target and aspect, the main objects, the motion) before proposing changes. Read details on demand:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npx -y @fleox/agent3d@0.2.
|
|
32
|
-
npx -y @fleox/agent3d@0.2.
|
|
33
|
-
npx -y @fleox/agent3d@0.2.
|
|
34
|
-
npx -y @fleox/agent3d@0.2.
|
|
31
|
+
npx -y @fleox/agent3d@0.2.3 object get title --project my-banner --json
|
|
32
|
+
npx -y @fleox/agent3d@0.2.3 scene get --path objects#title.material --project my-banner --json
|
|
33
|
+
npx -y @fleox/agent3d@0.2.3 timeline get --project my-banner --json
|
|
34
|
+
npx -y @fleox/agent3d@0.2.3 catalog behaviours float --json
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## 2. Patch
|
|
@@ -39,8 +39,8 @@ npx -y @fleox/agent3d@0.2.2 catalog behaviours float --json
|
|
|
39
39
|
Put the ops in a file (or pass them inline as one JSON argument) and apply:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx -y @fleox/agent3d@0.2.
|
|
43
|
-
npx -y @fleox/agent3d@0.2.
|
|
42
|
+
npx -y @fleox/agent3d@0.2.3 scene patch --project my-banner --file ops.json --dry-run --json
|
|
43
|
+
npx -y @fleox/agent3d@0.2.3 scene patch --project my-banner --file ops.json --json
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
| Op | Shape | Use |
|
|
@@ -63,11 +63,11 @@ npx -y @fleox/agent3d@0.2.2 scene patch --project my-banner --file ops.json --js
|
|
|
63
63
|
Shortcuts for one object (same validation, same plans):
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npx -y @fleox/agent3d@0.2.
|
|
67
|
-
npx -y @fleox/agent3d@0.2.
|
|
68
|
-
npx -y @fleox/agent3d@0.2.
|
|
69
|
-
npx -y @fleox/agent3d@0.2.
|
|
70
|
-
npx -y @fleox/agent3d@0.2.
|
|
66
|
+
npx -y @fleox/agent3d@0.2.3 object update title --set material.color="#ffd166" --set size=0.9 --project my-banner --json
|
|
67
|
+
npx -y @fleox/agent3d@0.2.3 object add --id ball --geometry sphere --set geometry.radius=0.4 --set 'position=[3,0,0]' --project my-banner --json
|
|
68
|
+
npx -y @fleox/agent3d@0.2.3 object move gem --parent props --project my-banner --json
|
|
69
|
+
npx -y @fleox/agent3d@0.2.3 object remove pill --project my-banner --json
|
|
70
|
+
npx -y @fleox/agent3d@0.2.3 object remove pill --yes --project my-banner --json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
`--set` takes dotted keys and JSON values (`--set 'position=[0,1,0]'`, `--set visible=false`). More recipes per task (materials, lights, camera, timeline, behaviours, post effects): [references/patch-ops.md](references/patch-ops.md).
|
|
@@ -80,10 +80,10 @@ npx -y @fleox/agent3d@0.2.2 object remove pill --yes --project my-banner --json
|
|
|
80
80
|
- property: `position`, `position.x`, `rotation.y` (degrees), `scale`, `visible`, `material.opacity` / `color` / `emissiveIntensity` / `roughness`…, `material.uniforms.<name>`; lights `intensity`, `color`; camera `position`, `target`, `fov`, `focus`; `environment.fog.density`, `environment.exposure`; `postfx.<type>.<param>` (an effect written in `postfx` or brought by a `look` preset, e.g. `postfx.bloom.strength` with `{ "type": "look", "preset": "product" }`); models `morph.<name>`, `animation.<clip>.weight`.
|
|
81
81
|
- **Keys** are `[time, value]` or `[time, value, ease]` (the ease shapes the segment ending at that key) sorted by time. Values: numbers, `[x, y, z]`, colours, booleans, or relative strings `"+=0.5"`, `"-=1"`, `"*=1.2"` (from the rest value). The track `ease` (default `linear`) is `step`, `in` / `out` / `inOut` + `Quad`, `Cubic`, `Quart`, `Quint`, `Sine`, `Expo`, `Circ`, `Back`, `Elastic`, `Bounce`, or `"cubicBezier(0.16, 1, 0.3, 1)"`, `"spring(170, 12)"`, `"steps(4)"`. Multi-target selectors take `stagger` (seconds between targets) and `staggerFrom` (`start`, `end`, `center`, `edges`, `random`). Colour keys blend in OKLCh (saturated midpoints); `"colorSpace": "rgb"|"oklab"|"hsl"` on the track changes it.
|
|
82
82
|
```bash
|
|
83
|
-
npx -y @fleox/agent3d@0.2.
|
|
84
|
-
npx -y @fleox/agent3d@0.2.
|
|
85
|
-
npx -y @fleox/agent3d@0.2.
|
|
86
|
-
npx -y @fleox/agent3d@0.2.
|
|
83
|
+
npx -y @fleox/agent3d@0.2.3 timeline set --duration 10 --loop true --trigger visible --project my-banner --json
|
|
84
|
+
npx -y @fleox/agent3d@0.2.3 timeline add-track --target logo.rotation.y --keys "[[0,0],[10,360]]" --project my-banner --json
|
|
85
|
+
npx -y @fleox/agent3d@0.2.3 timeline add-track --target gem.position.y --keys '[[0,"+=0"],[1,"+=0.6","outBack"],[2,"+=0","inOutSine"]]' --project my-banner --json
|
|
86
|
+
npx -y @fleox/agent3d@0.2.3 timeline remove-track --target logo.rotation.y --yes --project my-banner --json
|
|
87
87
|
```
|
|
88
88
|
- Loops: the last key equals the first. Triggers: `load`, `visible` (default), `hover`, `click`, `scroll` (time = scroll progress; tune with `timeline.scroll`), `manual` (only interactions move it).
|
|
89
89
|
- **Markers and segments** name moments and ranges (`markers: { "lifted": 2.6 }`, `segments: { "hover-in": [2, "lifted"] }`); `autoplay: "intro"` plays only that segment on the trigger. **Interactions** (`scene.interactions`) wire hover / click / scroll / key / marker events to actions: play or toggle a segment, tween a property (`set`), `openUrl` (click / key only), emit an event, play a model clip. Agents on MCP or `tools call` can use the `interactions_set` tool (`{ "add": [...] }` or `{ "interactions": [...] }`, `dryRun`).
|
|
@@ -104,14 +104,14 @@ npx -y @fleox/agent3d@0.2.2 object remove pill --yes --project my-banner --json
|
|
|
104
104
|
The embed keeps the scene's aspect ratio at every width. A 4:1 banner is only ~98 px tall on a 390 px phone:
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
npx -y @fleox/agent3d@0.2.
|
|
107
|
+
npx -y @fleox/agent3d@0.2.3 render --project my-banner --size 390x98 --scale 2 --frames 2 --json
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
If the title becomes unreadable: shorter text, bigger `size`, fewer props, or a separate mobile version (a copy of the project with `target.aspect` "4:3" or `target.height`, exported under another `--name`, switched with CSS media queries on the page).
|
|
111
111
|
|
|
112
112
|
## 6. Finish
|
|
113
113
|
|
|
114
|
-
`npx -y @fleox/agent3d@0.2.
|
|
114
|
+
`npx -y @fleox/agent3d@0.2.3 check --project my-banner --render --json` until no errors and no warnings, then re-export (`export --yes` overwrites the previous export folder; tell the user to re-upload `<name>/` and, after an Agent3D update, `agent3d-runtime/`). Skill `agent3d-publish` covers the site side.
|
|
115
115
|
|
|
116
116
|
## Rules
|
|
117
117
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Patch ops cookbook
|
|
2
2
|
|
|
3
|
-
Apply with `npx -y @fleox/agent3d@0.2.
|
|
3
|
+
Apply with `npx -y @fleox/agent3d@0.2.3 scene patch --project <dir> --file ops.json --json` (add `--dry-run` to preview, `--yes` when the plan removes something or replaces a whole collection such as `lights`, `postfx`, `objects`, `timeline.tracks` or `ui.elements`: `plan.replaces` lists them). Ops run in order on a copy; the result is validated; on any error nothing is written and the error names the failing op (`details.opIndex`).
|
|
4
4
|
|
|
5
5
|
## Paths
|
|
6
6
|
|
|
@@ -236,7 +236,7 @@ These play the segments of the markers block above (a segment must exist before
|
|
|
236
236
|
- Segments named in `play` / `toggle` must exist in `timeline.segments` (validation says so). Targets get a pointer cursor.
|
|
237
237
|
- Without patches (MCP or the CLI tool runner): `interactions_set` appends with `add` or replaces with `interactions`:
|
|
238
238
|
```bash
|
|
239
|
-
npx -y @fleox/agent3d@0.2.
|
|
239
|
+
npx -y @fleox/agent3d@0.2.3 tools call interactions_set --input '{"add": [{"on": "click", "target": "blob", "do": [{"toggle": "hover-in"}]}], "dryRun": true}' --project my-hero --json
|
|
240
240
|
```
|
|
241
241
|
- Check hover states headless: `render --input '[{"t": 1.9, "pointer": [0, -0.3]}]' --frames 2,3`.
|
|
242
242
|
|
|
@@ -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.2.
|
|
7
|
+
version: "0.2.3"
|
|
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.2.
|
|
18
|
+
Every command is `npx -y @fleox/agent3d@0.2.3 <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.2.
|
|
24
|
-
npx -y @fleox/agent3d@0.2.
|
|
23
|
+
npx -y @fleox/agent3d@0.2.3 new dodge --target game --title "Dodge" --json
|
|
24
|
+
npx -y @fleox/agent3d@0.2.3 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.2.
|
|
58
|
+
4. Validate and lint: `npx -y @fleox/agent3d@0.2.3 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.2.
|
|
61
|
+
npx -y @fleox/agent3d@0.2.3 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.2.
|
|
66
|
+
npx -y @fleox/agent3d@0.2.3 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.2.
|
|
7
|
+
version: "0.2.3"
|
|
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.2.
|
|
16
|
+
Every command is `npx -y @fleox/agent3d@0.2.3 <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.2.
|
|
21
|
+
npx -y @fleox/agent3d@0.2.3 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.
|
|
@@ -37,15 +37,15 @@ No errors, no warnings (or warnings the user accepted). Keep the `licences` list
|
|
|
37
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
38
|
|
|
39
39
|
```bash
|
|
40
|
-
npx -y @fleox/agent3d@0.2.
|
|
41
|
-
npx -y @fleox/agent3d@0.2.
|
|
42
|
-
npx -y @fleox/agent3d@0.2.
|
|
43
|
-
npx -y @fleox/agent3d@0.2.
|
|
44
|
-
npx -y @fleox/agent3d@0.2.
|
|
45
|
-
npx -y @fleox/agent3d@0.2.
|
|
46
|
-
npx -y @fleox/agent3d@0.2.
|
|
47
|
-
npx -y @fleox/agent3d@0.2.
|
|
48
|
-
npx -y @fleox/agent3d@0.2.
|
|
40
|
+
npx -y @fleox/agent3d@0.2.3 export --project my-banner --json
|
|
41
|
+
npx -y @fleox/agent3d@0.2.3 export --project my-banner --name spring-banner --out ./site/agent3d --json
|
|
42
|
+
npx -y @fleox/agent3d@0.2.3 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
|
|
43
|
+
npx -y @fleox/agent3d@0.2.3 export --project my-banner --optimize --json
|
|
44
|
+
npx -y @fleox/agent3d@0.2.3 export --format zip --project my-banner --json
|
|
45
|
+
npx -y @fleox/agent3d@0.2.3 export --format single-html --project my-banner --json
|
|
46
|
+
npx -y @fleox/agent3d@0.2.3 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
|
|
47
|
+
npx -y @fleox/agent3d@0.2.3 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
|
|
48
|
+
npx -y @fleox/agent3d@0.2.3 export --format gif --duration 4 --project my-banner --json
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Embed / zip options:
|
|
@@ -68,11 +68,11 @@ Embed / zip options:
|
|
|
68
68
|
Media straight from `render` (frame-exact, any size / fps; LOOK at a few frames of the result):
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
npx -y @fleox/agent3d@0.2.
|
|
72
|
-
npx -y @fleox/agent3d@0.2.
|
|
73
|
-
npx -y @fleox/agent3d@0.2.
|
|
74
|
-
npx -y @fleox/agent3d@0.2.
|
|
75
|
-
npx -y @fleox/agent3d@0.2.
|
|
71
|
+
npx -y @fleox/agent3d@0.2.3 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
|
|
72
|
+
npx -y @fleox/agent3d@0.2.3 render --gif renders/banner.gif --duration 4 --project my-banner --json
|
|
73
|
+
npx -y @fleox/agent3d@0.2.3 render --webp renders/banner.webp --duration 4 --project my-banner --json
|
|
74
|
+
npx -y @fleox/agent3d@0.2.3 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
|
|
75
|
+
npx -y @fleox/agent3d@0.2.3 render --scroll 0.5 --project my-scroll-story --json
|
|
76
76
|
```
|
|
77
77
|
|
|
78
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).
|
|
@@ -80,8 +80,8 @@ npx -y @fleox/agent3d@0.2.2 render --scroll 0.5 --project my-scroll-story --json
|
|
|
80
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
81
|
|
|
82
82
|
```bash
|
|
83
|
-
npx -y @fleox/agent3d@0.2.
|
|
84
|
-
npx -y @fleox/agent3d@0.2.
|
|
83
|
+
npx -y @fleox/agent3d@0.2.3 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
|
|
84
|
+
npx -y @fleox/agent3d@0.2.3 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
`--reduced-motion` renders what visitors with prefers-reduced-motion see.
|
|
@@ -112,7 +112,7 @@ Always paste the snippet from the export result (hashes and file names change wi
|
|
|
112
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
113
|
|
|
114
114
|
```bash
|
|
115
|
-
npx -y @fleox/agent3d@0.2.
|
|
115
|
+
npx -y @fleox/agent3d@0.2.3 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
```html
|
|
@@ -125,7 +125,7 @@ Placeholders work in text objects' `text`, any object's `href` and HUD texts. `{
|
|
|
125
125
|
|
|
126
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
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.
|
|
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.3 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
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
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
131
|
- **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.2.
|
|
10
|
+
Export straight into that layout with `npx -y @fleox/agent3d@0.2.3 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
|
|