@call-me-sensei/toonlab 0.4.19 → 0.4.21

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 (123) hide show
  1. package/NPM-LIBRARY.md +230 -0
  2. package/README.md +78 -36
  3. package/agents/PROMPTS.md +91 -0
  4. package/agents/README.md +9 -14
  5. package/agents/claude/CLAUDE.md +8 -0
  6. package/agents/codex/AGENTS.md +161 -0
  7. package/agents/cursor/toonlab.mdc +37 -0
  8. package/agents/references/mcp-asset-discovery.md +12 -9
  9. package/agents/references/runtime-entry-points.md +5 -4
  10. package/agents/skills/claude/asset-sourcing/SKILL.md +9 -6
  11. package/agents/skills/claude/rock-ground-shaders/SKILL.md +16 -0
  12. package/agents/skills/claude/vegetation-sky/SKILL.md +7 -4
  13. package/agents/skills/codex/asset-sourcing/SKILL.md +9 -6
  14. package/agents/skills/codex/rock-ground-shaders/SKILL.md +16 -0
  15. package/agents/skills/codex/vegetation-sky/SKILL.md +7 -4
  16. package/cli/toonlab.mjs +3 -2
  17. package/database/fal-patina.mjs +131 -0
  18. package/database/generation-service.mjs +108 -7
  19. package/database/migrations/0007_creation_revisions.sql +80 -0
  20. package/database/migrations/0008_creation_revision_hardening.sql +98 -0
  21. package/database/migrations/0009_creation_revision_delete_integrity.sql +11 -0
  22. package/database/migrations/0010_external_catalog_assets.sql +28 -0
  23. package/database/providers.mjs +195 -16
  24. package/database/repository.mjs +518 -70
  25. package/database/seeds/catalog/0003_2026-08-open-assets.sql +159086 -0
  26. package/database/seeds/catalog/0004_2026-08-c7-rocks.sql +39405 -0
  27. package/mcp/public-catalog.mjs +4 -52
  28. package/mcp/server.mjs +175 -12
  29. package/mcp/vite-plugin.mjs +78 -2
  30. package/package.json +32 -12
  31. package/scripts/generate-catalog-seed.mjs +34 -7
  32. package/src/asset-policy/catalogLicenses.js +64 -6
  33. package/src/assetlib/loadImported.js +15 -1
  34. package/src/catalog/officialCatalogAssetRuntime.js +13 -2
  35. package/src/catalog/officialCatalogLod.js +34 -1
  36. package/src/catalog/officialCatalogPlacement.js +29 -14
  37. package/src/character/animationRetarget.js +2 -0
  38. package/src/character/characterRig.js +6 -1
  39. package/src/character/characterRuntime.js +175 -7
  40. package/src/environment/environmentMaterialAdapter.js +30 -0
  41. package/src/environment/environmentPresets.js +90 -0
  42. package/src/environment/environmentSunShadowPass.js +42 -0
  43. package/src/environment/toonLabSurfaceLighting.js +108 -10
  44. package/src/environment/urbanPropMaterial.js +104 -2
  45. package/src/lighting/lightingSystem.js +65 -10
  46. package/src/renderer/index.js +7 -0
  47. package/src/renderer/styleComparison.js +985 -0
  48. package/src/rock-shader/index.js +5 -0
  49. package/src/rock-shader/rockGeometryDetail.js +701 -0
  50. package/src/rock-shader/rockMaterial.js +782 -39
  51. package/src/rock-shader/rockRegionRuntime.js +185 -0
  52. package/src/rock-shader/rockSemanticMaterialRuntime.js +337 -0
  53. package/src/rock-shader/rockShaderRuntime.js +354 -67
  54. package/src/rock-shader/rockShaderSettings.js +246 -16
  55. package/src/rock-shader/rockTangentIntegrity.js +136 -0
  56. package/src/rock-shader/rockTextureIntegrity.js +115 -0
  57. package/src/rockgen/index.js +1 -0
  58. package/src/rockgen/rockDocument.js +27 -3
  59. package/src/rockgen/surface/c7GeologySurface.js +372 -0
  60. package/src/shaders-tsl/water.js +8 -0
  61. package/src/sky/cloudShadow.js +25 -1
  62. package/src/sky/skySystem.js +9 -0
  63. package/src/styles/index.js +23 -0
  64. package/src/styles/neutralStylePresets.js +712 -0
  65. package/src/styles/sceneStyleRuntime.js +51 -4
  66. package/src/styles/styleAdapters.js +13 -2
  67. package/src/styles/styleBundle.js +1 -1
  68. package/src/texgen/evaluateTexture.js +30 -3
  69. package/src/texgen/textureGenerators.js +63 -31
  70. package/src/texgen/textureSettings.js +25 -8
  71. package/src/toon/toonSettings.js +96 -2
  72. package/src/vegetation/branchTree.js +327 -42
  73. package/src/vegetation/index.js +24 -2
  74. package/src/vegetation/scatter.js +372 -1
  75. package/src/vegetation/stylizedTree.js +312 -126
  76. package/src/vegetation/stylizedTreeFoliage.js +229 -7
  77. package/src/vegetation/treeSurfaceTextures.js +328 -0
  78. package/src/version.js +1 -1
  79. package/src/water/waterSettings.js +15 -7
  80. package/types/asset-policy/catalogLicenses.d.ts +2 -0
  81. package/types/asset-policy/index.d.ts +2 -0
  82. package/types/assetlib/loadImported.d.ts +3 -1
  83. package/types/catalog/officialCatalogLod.d.ts +63 -5
  84. package/types/character/characterRig.d.ts +59 -0
  85. package/types/character/characterRuntime.d.ts +1 -0
  86. package/types/environment/environmentMaterialAdapter.d.ts +3 -1
  87. package/types/environment/toonLabSurfaceLighting.d.ts +20 -3
  88. package/types/index.d.ts +89 -7
  89. package/types/lighting/lightingSystem.d.ts +7 -0
  90. package/types/react/index.d.ts +20 -0
  91. package/types/renderer/index.d.ts +1 -0
  92. package/types/renderer/styleComparison.d.ts +409 -0
  93. package/types/rock-shader/index.d.ts +5 -0
  94. package/types/rock-shader/rockGeometryDetail.d.ts +300 -0
  95. package/types/rock-shader/rockMaterial.d.ts +3 -0
  96. package/types/rock-shader/rockRegionRuntime.d.ts +86 -0
  97. package/types/rock-shader/rockSemanticMaterialRuntime.d.ts +29 -0
  98. package/types/rock-shader/rockShaderRuntime.d.ts +2 -0
  99. package/types/rock-shader/rockShaderSettings.d.ts +19 -5
  100. package/types/rock-shader/rockTangentIntegrity.d.ts +51 -0
  101. package/types/rock-shader/rockTextureIntegrity.d.ts +61 -0
  102. package/types/rockgen/index.d.ts +1 -0
  103. package/types/rockgen/rockDocument.d.ts +29 -1
  104. package/types/rockgen/surface/c7GeologySurface.d.ts +8 -0
  105. package/types/sky/cloudShadow.d.ts +1 -0
  106. package/types/styles/index.d.ts +1 -0
  107. package/types/styles/neutralStylePresets.d.ts +944 -0
  108. package/types/styles/sceneStyleRuntime.d.ts +20 -0
  109. package/types/vegetation/branchTree.d.ts +4 -0
  110. package/types/vegetation/index.d.ts +9 -7
  111. package/types/vegetation/scatter.d.ts +1 -0
  112. package/types/vegetation/stylizedTree.d.ts +1 -2
  113. package/types/vegetation/stylizedTreeFoliage.d.ts +1 -0
  114. package/types/version.d.ts +1 -1
  115. package/agents/references/geology-playbook.md +0 -118
  116. package/agents/skills/claude/karst-cliff-construction/SKILL.md +0 -258
  117. package/agents/skills/claude/outdoor-world/SKILL.md +0 -492
  118. package/agents/skills/claude/outdoor-world/references/coastal-landform-formation.md +0 -100
  119. package/agents/skills/codex/karst-cliff-construction/SKILL.md +0 -258
  120. package/agents/skills/codex/outdoor-world/SKILL.md +0 -492
  121. package/agents/skills/codex/outdoor-world/references/coastal-landform-formation.md +0 -100
  122. package/src/vegetation/legacyTreePresets.js +0 -120
  123. package/types/vegetation/legacyTreePresets.d.ts +0 -22
package/NPM-LIBRARY.md ADDED
@@ -0,0 +1,230 @@
1
+ # ToonLab npm library guide
2
+
3
+ This guide is included in `@call-me-sensei/toonlab`. It is the package-first
4
+ reference for version 0.4.21 and does not require access to the source
5
+ repository.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @call-me-sensei/toonlab three
11
+ ```
12
+
13
+ ToonLab requires Node.js 18 or newer for its command-line and local MCP tools.
14
+ The rendering library targets the Three.js TSL/NodeMaterial stack and is
15
+ WebGPU-first with a WebGL2 fallback through the same public materials.
16
+
17
+ ## Supported product surface
18
+
19
+ The public package follows the 15 Labs currently shown in ToonLab Pro. Several
20
+ Labs share one runtime because they author different scopes of the same
21
+ portable document.
22
+
23
+ | ToonLab Pro Lab | npm runtime |
24
+ | --- | --- |
25
+ | Character & Creature Shader | `@call-me-sensei/toonlab/toon` |
26
+ | Tree Shader | `@call-me-sensei/toonlab/vegetation-shaders` |
27
+ | Grass Shader | `@call-me-sensei/toonlab/vegetation-shaders` |
28
+ | Flower Shader | `@call-me-sensei/toonlab/vegetation-shaders` |
29
+ | Rock & Geology Shader | `@call-me-sensei/toonlab/rock-shader` |
30
+ | Terrain & Ground Shader | `@call-me-sensei/toonlab/ground-shader` |
31
+ | Manufactured Surface Shader | `@call-me-sensei/toonlab/environment` |
32
+ | Water & Liquid Shader | `@call-me-sensei/toonlab/water` |
33
+ | Sky Shader | `@call-me-sensei/toonlab/sky` |
34
+ | Cloud Shader | `@call-me-sensei/toonlab/cloud` |
35
+ | Sky & Cloud | `@call-me-sensei/toonlab/sky` and `/cloud` |
36
+ | Rock & Cliff Generation | `@call-me-sensei/toonlab/rockgen` |
37
+ | Tree & Shrub Generation | `@call-me-sensei/toonlab/vegetation` |
38
+ | Grass & Groundcover Generation | `@call-me-sensei/toonlab/vegetation` |
39
+ | Texture & Material Map Generation | `@call-me-sensei/toonlab/texgen` |
40
+
41
+ These stable support entry points are also public because the visible Labs,
42
+ Library, Gallery, style-bundle workflow, or integration examples depend on
43
+ them:
44
+
45
+ - `@call-me-sensei/toonlab/styles` for portable bundles, strict labels,
46
+ auditing, and coordinated application;
47
+ - `@call-me-sensei/toonlab/assetlib`, `/asset-policy`, and
48
+ `/official-catalog` for policy-aware local/released-catalog integration;
49
+ - `@call-me-sensei/toonlab/character` and `/loaders` for supported preview and
50
+ host-model integration;
51
+ - `@call-me-sensei/toonlab/runtime`, `/renderer`, `/lighting`, and
52
+ `/world-collision` for the shared scene contract used by the documented
53
+ integration examples;
54
+ - `@call-me-sensei/toonlab/post` for the coordinated optional post pipeline;
55
+ - focused aliases such as `/toon-settings`, `/water-settings`, `/grass`,
56
+ `/grass-palettes`, `/post-processing`, and `/vegetation-shaders` when a
57
+ consumer does not want a larger barrel.
58
+
59
+ The package deliberately does not export Weather, Climate, Biome, Landscape,
60
+ path/building/village generation, debris generation, fauna, ambient effects,
61
+ game feel, camera behavior, soundscape, or gameplay VFX. Those areas may exist
62
+ as repository experiments or host examples, but they are not npm APIs in this
63
+ release. A one-asset Node rock annotation compiler is also repository-only.
64
+
65
+ ## What the package contains
66
+
67
+ The npm artifact contains four supported layers:
68
+
69
+ 1. The JavaScript runtime and TypeScript declarations for the public imports.
70
+ 2. Text-only agent guides, prompts, references, and paired Codex/Claude skills
71
+ under `agents/`.
72
+ 3. The `toonlab` manifest audit CLI and `toonlab-mcp` local stdio MCP server.
73
+ 4. The local MCP database/catalog support required for Library and asset
74
+ discovery workflows.
75
+
76
+ It does not contain the ToonLab website, Lab application UIs, examples,
77
+ screenshots, models, textures, or other binary media. Optional public fixtures
78
+ are identified by immutable `https://assets.toonlab.io` metadata rather than
79
+ being bundled. Authored tree recipes are assets too: the reviewed public tree
80
+ collection remains in the Gallery and is discovered through MCP instead of
81
+ being hard-coded into the JavaScript runtime.
82
+
83
+ ## Use a focused runtime
84
+
85
+ ```js
86
+ import {
87
+ applyToonShader,
88
+ createToonSettings,
89
+ } from '@call-me-sensei/toonlab/toon';
90
+
91
+ const settings = createToonSettings({
92
+ rimLight: { intensity: 0.35, mode: 'depth' },
93
+ outline: { thickness: 1.6 },
94
+ skinTone: { skinShadowBrightness: 0.94 },
95
+ });
96
+
97
+ applyToonShader(characterRoot, { settings });
98
+ ```
99
+
100
+ For a multi-domain scene, label roots and materials before applying a bundle.
101
+ Strict mode preflights the complete plan and stops before mutation when a
102
+ target, material role, or adapter is missing.
103
+
104
+ ```js
105
+ import {
106
+ CALL_ME_SENSEI_STYLE_BUNDLE,
107
+ createSceneStyleRuntime,
108
+ } from '@call-me-sensei/toonlab/styles';
109
+
110
+ const look = createSceneStyleRuntime({ renderer, scene, sky, water, post });
111
+ await look.apply(CALL_ME_SENSEI_STYLE_BUNDLE, {
112
+ discovery: 'scene-labels',
113
+ mode: 'strict',
114
+ });
115
+
116
+ renderer.setAnimationLoop(() => {
117
+ const delta = clock.getDelta();
118
+ look.update(delta, camera);
119
+ renderer.render(scene, camera);
120
+ });
121
+ ```
122
+
123
+ The host application still owns renderer creation, geometry and XZ layout,
124
+ cameras, controls, gameplay, dynamic physics, navigation, persistence, and the
125
+ frame loop. ToonLab does not turn a prompt into a finished world.
126
+
127
+ ## Install the agent guidance
128
+
129
+ Everything in this section is present in the installed npm package.
130
+
131
+ ### Codex
132
+
133
+ ```bash
134
+ cp node_modules/@call-me-sensei/toonlab/agents/codex/AGENTS.md ./AGENTS.md
135
+ mkdir -p .agents/skills
136
+ cp -R node_modules/@call-me-sensei/toonlab/agents/skills/codex/* .agents/skills/
137
+ ```
138
+
139
+ ### Claude Code
140
+
141
+ ```bash
142
+ cp node_modules/@call-me-sensei/toonlab/agents/claude/CLAUDE.md ./CLAUDE.md
143
+ mkdir -p .claude/skills
144
+ cp -R node_modules/@call-me-sensei/toonlab/agents/skills/claude/* .claude/skills/
145
+ ```
146
+
147
+ ### Cursor
148
+
149
+ ```bash
150
+ mkdir -p .cursor/rules
151
+ cp node_modules/@call-me-sensei/toonlab/agents/cursor/toonlab.mdc .cursor/rules/
152
+ ```
153
+
154
+ Use `agents/PROMPTS.md` for ready-to-paste prompts. Begin with `game-dev` for
155
+ an existing scene and add `asset-sourcing` when Library, Gallery, or MCP asset
156
+ discovery is involved.
157
+
158
+ ## Connect MCP
159
+
160
+ ### Local npm MCP
161
+
162
+ The package executable runs as a local stdio server. With no `DATABASE_URL`,
163
+ it uses the disk workspace passed through `--workspace`; no account is needed.
164
+
165
+ ```json
166
+ {
167
+ "mcpServers": {
168
+ "toonlab-local": {
169
+ "command": "npx",
170
+ "args": [
171
+ "-y",
172
+ "@call-me-sensei/toonlab@0.4.21",
173
+ "--workspace",
174
+ "/absolute/path/to/your-game/.toonlab"
175
+ ],
176
+ "env": {
177
+ "TOONLAB_LEGACY_WORKSPACE": "1"
178
+ }
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ This server provides the anime-game profile, runtime guide, live-Lab
185
+ contracts, deterministic document creation and mutation, policy validation,
186
+ public Gallery search/retrieval, local Library operations, and optional
187
+ provider-backed generation when the developer supplies server-side provider
188
+ keys. Authored tree recipes are not bundled. Call `search_public_gallery` with
189
+ `{ query: "tree", type: "tree-recipe" }`, then use
190
+ `get_public_gallery_asset` to retrieve the reviewed portable recipe.
191
+
192
+ ### ToonLab Pro MCP
193
+
194
+ Add `https://toonlab.io/mcp` as a remote MCP server and authorize in the
195
+ browser. The hosted server adds the signed-in Pro Library, published Gallery,
196
+ stored characters, and managed generation. Local and remote servers may be
197
+ connected at the same time; inspect the tool description before choosing one
198
+ when names overlap.
199
+
200
+ Full live setup and tool documentation is available at
201
+ <https://toonlab.io/docs/mcp>.
202
+
203
+ ## CLI
204
+
205
+ The `toonlab` executable audits JSON scene manifests without starting a
206
+ renderer:
207
+
208
+ ```bash
209
+ npx toonlab audit --input scene.json --bundle call-me-sensei --mode strict --pretty
210
+ ```
211
+
212
+ Supported operations are `inspect`, `audit`, `plan`, `apply`, and `verify`.
213
+ Use `--out` to write a report. `apply --write-manifest` is the only operation
214
+ that replaces the input file and should be used only after reviewing the plan.
215
+
216
+ ## Documentation without the source repository
217
+
218
+ - This installed guide is the complete npm boundary and setup reference.
219
+ - `README.md` provides the longer runtime tour.
220
+ - `agents/README.md` explains the packaged agent resource layout.
221
+ - `agents/PROMPTS.md` contains supported prompts.
222
+ - `agents/references/` contains the machine-readable runtime, style, sourcing,
223
+ and MCP contracts used by the skills.
224
+ - <https://toonlab.io/docs> provides hosted user documentation.
225
+ - <https://toonlab.io/docs/labs> documents all 15 public Labs.
226
+ - <https://toonlab.io/docs/reference> and
227
+ <https://toonlab.io/docs/reference.md> provide the settings reference.
228
+
229
+ GitHub access is not required for npm installation, agent setup, MCP setup, or
230
+ the supported runtime workflows above.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Use ToonLab as a focused runtime library (`@call-me-sensei/toonlab` on npm), as
19
19
  an asset/preset authoring workspace, or as an asset-discovery service—not as a
20
20
  one-shot world generator.
21
21
 
22
- ## Versioned expectation: 0.4.19
22
+ ## Versioned expectation: 0.4.21
23
23
 
24
24
  For a correctly constructed and semantically labeled scene, one strict Call Me
25
25
  Sensei bundle application is expected to establish the supported visual
@@ -34,12 +34,11 @@ and reversible per-domain inspection.
34
34
 
35
35
  The host still authors the level, geometry, asset selection and placement,
36
36
  material labels, cameras, gameplay, dynamic physics, and navigation. Labeled
37
- solid objects receive conservative static collision by default. Arbitrary imported assets are
38
- not guaranteed to route automatically; strict mode blocks uncertain contracts
39
- instead of guessing. See [What ToonLab 0.4.19 can and cannot
40
- do](https://github.com/call-me-sensei/toonlab/blob/main/docs/capability-status.md)
41
- for the complete public contract, measured imported-asset readiness, and the
42
- required verification sequence.
37
+ solid objects receive conservative static collision by default. Arbitrary
38
+ imported assets are not guaranteed to route automatically; strict mode blocks
39
+ uncertain contracts instead of guessing. The installed
40
+ [npm library guide](./NPM-LIBRARY.md) defines the complete shipped surface,
41
+ exclusions, agent setup, MCP setup, and package-first documentation paths.
43
42
 
44
43
  ## Recommended scope today
45
44
 
@@ -61,9 +60,8 @@ The recommended production workflow is:
61
60
 
62
61
  Whole-world generation, terrain/biome/coast/cliff formation, automatic set
63
62
  dressing, Weather/Climate composition, gameplay systems, and autonomous scene
64
- classification belong under experimentation. See
65
- [What ToonLab is ready for today](https://github.com/call-me-sensei/toonlab/blob/main/docs/capability-status.md)
66
- for the exact boundary and a recommended agent brief.
63
+ classification belong under experimentation. The exact supported boundary and
64
+ a recommended agent brief ship in `NPM-LIBRARY.md` and `agents/PROMPTS.md`.
67
65
 
68
66
  ## Quickstart
69
67
 
@@ -86,6 +84,19 @@ permissive signatures only where inference cannot produce a valid public type.
86
84
  Package verification compiles a clean packed consumer with `strict: true` and
87
85
  `skipLibCheck: false`.
88
86
 
87
+ The npm artifact is self-documenting when the source repository is unavailable:
88
+
89
+ - `NPM-LIBRARY.md` is the versioned install, runtime, agent, MCP, and support
90
+ boundary guide.
91
+ - `agents/PROMPTS.md` contains ready-to-paste supported prompts.
92
+ - The Codex, Claude Code, and Cursor guidance files are included under
93
+ `agents/` alongside their paired feature skills.
94
+ - Live user documentation remains available at
95
+ [toonlab.io/docs](https://toonlab.io/docs), including the
96
+ [15 public Labs](https://toonlab.io/docs/labs),
97
+ [MCP setup](https://toonlab.io/docs/mcp), and
98
+ [settings reference](https://toonlab.io/docs/reference).
99
+
89
100
  ```ts
90
101
  import {
91
102
  CALL_ME_SENSEI_STYLE_BUNDLE,
@@ -159,6 +170,7 @@ TRIPO_API_KEY=
159
170
  MESHY_API_KEY=
160
171
  MESHY_API_KEYS=
161
172
  GEMINI_API_KEY=
173
+ FAL_KEY=
162
174
  OPENAI_API_KEY=
163
175
  ARK_API_KEY=
164
176
  POLYPIZZA_API_KEY=
@@ -178,6 +190,9 @@ safe to run again.
178
190
 
179
191
  The local MCP server exposes the same configured image/3D providers through
180
192
  `generate_ai_asset`, `get_generation_job(s)`, and `save_generated_asset`.
193
+ With `FAL_KEY`, `kind: "material"` creates a seamless Fal Patina preview and a
194
+ durable grouped PBR bundle (basecolor, normal, roughness, metalness, and height)
195
+ at 1K–8K instead of flattening the maps into unrelated image jobs.
181
196
  Meshy text mode first generates a concept with the selected `image_model`,
182
197
  then submits that PNG/JPEG to Meshy 7 as one trackable MCP job. The existing
183
198
  `generate_asset` tool remains the deterministic procedural-recipe contract.
@@ -220,6 +235,18 @@ opaque objects under `.toonlab/objects`; Postgres stores their metadata and
220
235
  generation history. Saved generated assets appear in `/library/` with preview,
221
236
  Open, asset-download, JSON-export, and delete actions.
222
237
 
238
+ Every meaningful Library save also creates an immutable local revision. Open a
239
+ creation in `/library/` to browse or download earlier documents, give important
240
+ versions a unique name, add version-only tags and notes, pin milestones, or
241
+ restore an earlier snapshot. Identical saves are deduplicated, and restore
242
+ always creates a new head revision instead of rewriting history. This revision
243
+ number is Library history; a document's own `version` field remains its portable
244
+ schema version. Style-bundle revisions also record the exact revisions of saved
245
+ documents referenced by their slots. Local runtimes can request the locked,
246
+ self-contained bundle with
247
+ `fetchStyleBundle('/api/toonlab/library/<bundle-id>/resolved')`; a missing lock
248
+ fails explicitly instead of substituting a newer dependency.
249
+
223
250
  ### Updating an existing installation
224
251
 
225
252
  Use the same update sequence for every ToonLab release, whether it contains
@@ -249,7 +276,9 @@ seed batches in order. Existing installations apply only newer batches.
249
276
  Catalog data therefore does **not** use a separate downloadable “current
250
277
  seed,” and new datasets are **not** schema migrations. Keeping every released
251
278
  batch in the repository gives fresh and upgraded installations the same final
252
- catalog while preserving a simple, auditable upgrade path.
279
+ catalog while preserving a simple, auditable upgrade path. The checked-in
280
+ catalog currently contains 8,163 official assets: 480 first-party ToonLab
281
+ rocks plus 7,683 verified open assets.
253
282
 
254
283
  Applied filenames and SHA-256 digests are recorded in `schema_migrations` and
255
284
  `catalog_seed_batches`. Never edit, rename, or replace a released migration or
@@ -281,10 +310,13 @@ npm run dev
281
310
  # In an MCP client, use the command/config shown at /settings/.
282
311
  ```
283
312
 
284
- The local server can search the built-in procedural catalog and public CC0
285
- sources, read your saved presets and exported files, generate seeded recipes,
286
- and import assets into the project. It uses stdio, requires no account or
287
- OAuth, and keeps work local. See [Local MCP and workspace](https://github.com/call-me-sensei/toonlab/blob/main/docs/mcp.md) and
313
+ The local server can search your workspace, the public ToonLab Gallery, the
314
+ released official catalog, and public CC0 sources; read saved presets and
315
+ exported files; generate approved seeded recipes; and import assets into the
316
+ project. Authored Gallery recipes are fetched with their public license and
317
+ provenance instead of being copied into the npm package. The server uses stdio,
318
+ requires no account or OAuth for public discovery, and keeps local work local.
319
+ See [Local MCP and workspace](https://github.com/call-me-sensei/toonlab/blob/main/docs/mcp.md) and
288
320
  [Local database and public asset releases](https://github.com/call-me-sensei/toonlab/blob/main/docs/local-database-and-public-assets.md).
289
321
 
290
322
  ## The labs
@@ -346,7 +378,7 @@ camera behavior, and game feel remain host-owned or pre-beta.
346
378
  | Toon character shading | `@call-me-sensei/toonlab/toon` | Modern anime character shader: cel bands with art-directed face lighting, skin-tone shadow management, shadow-color HSV control, scene/self/contact shadows, average-shadow smoothing, rim light (fresnel or screen-space depth), stylized + anisotropic hair highlights, eye catchlights, role-aware specular, source map routing (normal/AO/emissive/MatCap/ramp/detail), inverted-hull outlines, glitter, stickers, perspective removal, shell fur, dither fades — 23 settings groups, all preset-serializable. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/toon-shading.md) |
347
379
  | Environment shading | `@call-me-sensei/toonlab/environment` | Modern anime-style scene shader for texture packs, standard glTF, and untextured scenes: material-role classification, wrapped lighting, packed-map hints, window cutouts, sun/lamp rigs, time-of-day, six-direction ambient probe, planar floor reflections, BVH vertex-AO baking, height fog, cloud shadows. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/environment.md) |
348
380
  | Water | `@call-me-sensei/toonlab/water` | Focused water treatment for a host-authored water footprint, continuous shore, and closed seabed: Gerstner waves, absorption color, refraction/caustics/foam, ripples, splashes, wakes, kelp, underwater treatment, and CPU buoyancy sampling. It does not design the coast or underwater habitat. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/water.md) |
349
- | Vegetation | `@call-me-sensei/toonlab/vegetation` | Instanced grass and flower fields; the 12 named pre-species legacy trees; and a focused procedural broadleaf `BranchTree` with deterministic branching, five leaf silhouettes, caller-supplied leaf/bark textures, and a portable recipe. Package-generated Call Me Sensei trees preserve authored bark first and otherwise select a registered deterministic bark surface instead of a bare trunk. The 165-species research roster remains repository-only experimental work. Independent Tree, Grass, and Flower shader profiles share one semantic-role renderer family. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/vegetation-sky.md) |
381
+ | Vegetation | `@call-me-sensei/toonlab/vegetation` | Tree/grass/flower construction and shader runtimes, including the focused procedural broadleaf `BranchTree` with deterministic branching, five leaf silhouettes, caller-supplied leaf/bark textures, and a portable recipe. No authored tree asset collection is bundled or exported: reviewed tree recipes remain searchable Gallery assets delivered through MCP with their CC0 metadata. Package-generated trees preserve authored bark first and otherwise select a registered deterministic bark surface instead of a bare trunk. The experimental species roster remains repository-only. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/vegetation-sky.md) |
350
382
  | Rock shader | `@call-me-sensei/toonlab/rock-shader` | Detailed, versioned rock-material profiles with projected detail, distance tint, normal fading, striping, moss and optional top layers, plus explicit source-albedo and vertex-color/AO integration. Call Me Sensei is the default. Geometry generation remains separate in `rockgen`. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/rock-shader.md) |
351
383
  | Ground shader | `@call-me-sensei/toonlab/ground-shader` | Splat-weighted anime terrain with slope/cliff detail, shoreline and weather response, HDR sun/shade controls, safe shadow defaults, and flat-albedo ground-field output for vegetation adoption. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/ground-shader.md) |
352
384
  | Sky | `@call-me-sensei/toonlab/sky` | Reusable atmosphere, palette, sun, moon, stars, and god-ray settings authored by Sky Lab and Sky & Cloud Lab. Your application coordinates final lighting and scene state. [Docs](https://github.com/call-me-sensei/toonlab/blob/main/docs/sky.md) |
@@ -431,21 +463,21 @@ profile parameters for other authored styles. Its recipe-v3 LOD0/1/2 topology
431
463
  uses 40/14/6 primary blades and compensates retained stroke width so zooming
432
464
  does not make the underlying terrain appear to change color.
433
465
 
434
- The supported tree set is intentionally the proven pre-species surface.
435
- Use a named legacy silhouette directly:
466
+ ToonLab does not ship predefined tree assets in npm. Search reviewed public
467
+ tree recipes through MCP, then pass the retrieved portable recipe options to
468
+ the runtime:
436
469
 
437
470
  ```js
438
- import {
439
- LEGACY_TREE_IDS,
440
- createLegacyTree,
441
- } from '@call-me-sensei/toonlab/vegetation';
471
+ import { StylizedTree } from '@call-me-sensei/toonlab/vegetation';
442
472
 
443
- console.log(LEGACY_TREE_IDS); // straight, leaning, see-through, ...
444
- const legacyTree = createLegacyTree('golden-gingko', {
473
+ // treeRecipe is the document returned by get_public_gallery_asset after
474
+ // search_public_gallery({ query: 'tree', type: 'tree-recipe' }).
475
+ const tree = new StylizedTree({
476
+ ...treeRecipe.options,
445
477
  trunkMap: barkTexture,
446
478
  vegetationShader: { preset: 'call_me_sensei' },
447
479
  });
448
- scene.add(legacyTree);
480
+ scene.add(tree);
449
481
  ```
450
482
 
451
483
  For a configurable recursive branch-type broadleaf, use the focused wrapper:
@@ -466,7 +498,8 @@ scene.add(tree);
466
498
  shapes. Botanical species generation is not a public package claim.
467
499
 
468
500
  Water, sky, flowers, trees, grass, and splashes keep procedural defaults, while
469
- legacy trees and BranchTree may use caller-owned leaf and bark textures. The
501
+ Gallery tree recipes, `StylizedTree`, and `BranchTree` may use caller-owned
502
+ leaf and bark textures. The
470
503
  Call Me Sensei tree path resolves bark in this order: explicit
471
504
  `trunkSurfaceProfile`, authored `trunkMap`, then the registered
472
505
  `call-me-sensei-bark-v1` fallback. Use `getTreeSurfaceProfileOptions()` when a
@@ -497,6 +530,10 @@ separators; maximum 10 tags and 32 characters each) and are
497
530
  stored independently from the portable document so they remain searchable
498
531
  after reload and edits.
499
532
 
533
+ Revision history is unlimited in the local workspace. Creation tags above are
534
+ separate from version tags: creation tags remain discovery metadata, while
535
+ version tags describe a particular immutable snapshot.
536
+
500
537
  Start by loading one style bundle, explicitly labeling the scene targets, and
501
538
  preflighting the complete routing plan. Strict mode is atomic: if any target
502
539
  is unlabeled, unsupported, or missing an adapter, nothing is mutated.
@@ -637,9 +674,8 @@ visual assets.
637
674
  The skills teach the agent the runtime boundary, asset-discovery order,
638
675
  frame-loop contract, and each focused subsystem API. Start with `game-dev` for
639
676
  integration into an existing scene and `asset-sourcing` for Gallery/MCP work.
640
- `outdoor-world`, `karst-cliff-construction`, and current Sky/Cloud guidance are
641
- experimental research aids: use them to qualify a bounded experiment or record
642
- a gap, not as a promise that an agent can build a polished world in one pass.
677
+ Experimental whole-world, natural-cliff, Weather/Climate, camera, game-feel,
678
+ and gameplay-VFX skills are intentionally not included in the npm artifact.
643
679
 
644
680
  ```bash
645
681
  # Claude Code — feature skills + project guidance
@@ -658,30 +694,36 @@ cp node_modules/@call-me-sensei/toonlab/agents/cursor/toonlab.mdc .cursor/rules/
658
694
  ```
659
695
 
660
696
  See [`agents/README.md`](agents/README.md) for the full layout.
697
+ Ready-to-paste supported prompts are included in
698
+ [`agents/PROMPTS.md`](agents/PROMPTS.md).
661
699
 
662
700
  ### 2. Connect MCP for asset discovery
663
701
 
664
702
  Two servers, and they compose:
665
703
 
666
704
  **Local (free, no account).** The stdio server included in this package
667
- searches the built-in procedural catalog and public CC0 sources, reads your
668
- saved presets and lab exports, generates seeded recipes, and imports assets
669
- into a disk-backed `.toonlab/` workspace:
705
+ searches local/project content, reviewed public Gallery recipes, the released
706
+ official catalog, and public CC0 sources; reads saved presets and Lab exports;
707
+ generates approved seeded recipes; and imports assets into a disk-backed
708
+ `.toonlab/` workspace. Use `search_public_gallery` for authored assets such as
709
+ the public tree collection—those recipes are not npm built-ins:
670
710
 
671
711
  ```json
672
712
  {
673
713
  "mcpServers": {
674
714
  "toonlab-local": {
675
715
  "command": "npx",
676
- "args": ["-y", "@call-me-sensei/toonlab@latest", "--workspace", "/absolute/path/to/your-game/.toonlab"]
716
+ "args": ["-y", "@call-me-sensei/toonlab@latest", "--workspace", "/absolute/path/to/your-game/.toonlab"],
717
+ "env": { "TOONLAB_LEGACY_WORKSPACE": "1" }
677
718
  }
678
719
  }
679
720
  }
680
721
  ```
681
722
 
682
- If you run the labs from a checkout (`npm run dev`), open
683
- `http://localhost:5175/settings/` for a ready-made config instead. See
684
- [Local MCP and workspace](https://github.com/call-me-sensei/toonlab/blob/main/docs/mcp.md).
723
+ The npm server defaults to this disk workspace when `DATABASE_URL` is absent.
724
+ See [the installed npm guide](./NPM-LIBRARY.md) and
725
+ [live MCP documentation](https://toonlab.io/docs/mcp) for the complete local
726
+ and hosted setup.
685
727
 
686
728
  **ToonLab Pro (remote, OAuth).** [toonlab.io](https://toonlab.io) hosts a
687
729
  remote MCP server that adds an indexed CC0 asset search with ToonLab-styled
@@ -0,0 +1,91 @@
1
+ # ToonLab agent prompts
2
+
3
+ These prompts are included with the npm package. They use only the supported
4
+ 0.4.21 runtime, agent skills, and MCP workflows.
5
+
6
+ ## Existing-scene integration
7
+
8
+ ```text
9
+ Using the ToonLab game-dev skill, integrate @call-me-sensei/toonlab into this
10
+ existing Three.js scene. Inventory every renderable root and material. Assign
11
+ stable ToonLab target ids, rendering domains, material ids, and semantic roles.
12
+ Apply the Call Me Sensei bundle in strict mode through the documented focused
13
+ runtimes for the domains actually present. Preserve the scene's geometry, XZ
14
+ layout, cameras, gameplay, dynamic physics, navigation, and frame loop. Run the
15
+ app's typecheck, tests, build, and visual smoke check. Finish only when the
16
+ style audit is ready or report each remaining blocker with a concrete fix.
17
+ ```
18
+
19
+ ## Character or manufactured-material before/after
20
+
21
+ ```text
22
+ Using the ToonLab toon-shading or environment skill as appropriate, create a
23
+ true before/after comparison for the supplied model. The before side must use
24
+ its normal Three.js PBR material and the same camera, pose, lights, exposure,
25
+ background, and source textures as the after side. The after side may change
26
+ only the selected ToonLab shader/profile. Do not flatten, unlight, or otherwise
27
+ degrade the before side. Verify that the comparison demonstrates the shader's
28
+ effect rather than a scene-lighting difference.
29
+ ```
30
+
31
+ ## Policy-aware asset discovery
32
+
33
+ ```text
34
+ Using the ToonLab asset-sourcing skill and whichever ToonLab MCP servers are
35
+ connected, load get_anime_game_profile and confirm the project's sourcing
36
+ policy. Search project/local Library first, then ToonLab Gallery, then allowed
37
+ external open sources. Validate provenance, license, anime-style support, and
38
+ policy decision before selection. Generate only after the searches fail and a
39
+ custom asset gap has been recorded and approved. Report the selected stable id,
40
+ source, license, dimensions, semantic domain, and material-role readiness.
41
+ ```
42
+
43
+ ## Author a portable Lab document
44
+
45
+ ```text
46
+ Use ToonLab MCP to call list_live_labs, choose the named public Lab, and call
47
+ get_lab_features before editing. Create a schema-valid starter with
48
+ create_lab_document, make only requested semantic changes, and validate the
49
+ result. Save it to my Library only if I asked for persistence. Keep preview
50
+ camera, stage, lighting, playback, and comparison state out of the portable
51
+ document.
52
+ ```
53
+
54
+ ## Tree or grass generation
55
+
56
+ ```text
57
+ Using the ToonLab vegetation-sky skill, create the requested tree, shrub,
58
+ grass, or groundcover. For an existing authored tree, search the public Gallery
59
+ through MCP first and retrieve its portable recipe; the npm package contains
60
+ tree construction/shader capability but no predefined tree asset collection.
61
+ Author a new `StylizedTree` or `BranchTree` only when requested or when accepted
62
+ discovery does not close the role. Keep recipe, seed, geometry, palette, and
63
+ placement separate from the Tree/Grass/Flower shader profile. Emit stable
64
+ modeled-part and material-role labels, preserve the recipe for regeneration,
65
+ and verify LOD and shadow behavior. Do not use the repository-only experimental
66
+ species engine.
67
+ ```
68
+
69
+ ## Rock generation and shader separation
70
+
71
+ ```text
72
+ Using the ToonLab rockgen and rock-ground-shaders skills, create or edit the
73
+ requested rock asset with @call-me-sensei/toonlab/rockgen and style it with
74
+ @call-me-sensei/toonlab/rock-shader. Keep geometry identity, seed, LOD,
75
+ collision, and baked channels in the rock document; keep reusable appearance in
76
+ the rock shader profile. Validate the portable documents and verify the result
77
+ from multiple useful views. Do not deep-import repository compilers or test
78
+ fixtures.
79
+ ```
80
+
81
+ ## Apply a Style Bundle
82
+
83
+ ```text
84
+ Using the ToonLab scene-style-application skill, load the selected portable
85
+ Style Bundle. Inventory and explicitly label only the domains present in this
86
+ scene, audit in strict mode, and stop before mutation if any target, material
87
+ role, required mask, or adapter is missing. Apply the accepted plan atomically,
88
+ preserve asset identity and current scene conditions, then verify that every
89
+ populated slot has an owning runtime and that teardown restores the source
90
+ materials.
91
+ ```
package/agents/README.md CHANGED
@@ -4,11 +4,11 @@ These are downloadable AI coding agent resources for developers using ToonLab
4
4
  runtime features in their own apps. They are not maintenance instructions for
5
5
  this repository.
6
6
 
7
- The recommended agent workflow starts from an existing scene: apply focused
8
- shaders/vegetation/water/post, find assets through Gallery or MCP, and author
9
- bounded portable outputs. `outdoor-world`, `karst-cliff-construction`, and
10
- current Sky/Cloud guidance are experimental research/qualification resources,
11
- not a promise of reliable one-shot scene construction.
7
+ The recommended agent workflow starts from an existing scene: apply the
8
+ focused character, manufactured, ground, rock, vegetation, water, sky, cloud,
9
+ lighting, and post runtimes; find assets through Gallery or MCP; and author
10
+ bounded portable outputs. The package does not promise reliable one-shot scene
11
+ construction.
12
12
 
13
13
  Layout:
14
14
 
@@ -33,18 +33,13 @@ integration and `asset-sourcing` for Gallery/MCP work):
33
33
  - `rockgen`
34
34
  - `style-presets`
35
35
  - `toon-shading`
36
- - `vegetation-sky` (vegetation path; its Sky/Cloud path is experimental)
36
+ - `vegetation-sky`
37
37
  - `visual-verification`
38
38
  - `water`
39
39
 
40
- Experimental or host-owned boundary skills:
41
-
42
- - `camera`
43
- - `game-feel`
44
- - `karst-cliff-construction`
45
- - `lighting`
46
- - `outdoor-world`
47
- - `weather`
40
+ Experimental and host-owned skills are intentionally omitted from the npm
41
+ artifact. This includes whole-world construction, natural cliff formation,
42
+ Weather/Climate composition, camera behavior, game feel, and gameplay VFX.
48
43
 
49
44
  These text-only resources ship with the npm package beside the runtime source.
50
45
  The package does not include ToonLab lab applications, examples, review
@@ -0,0 +1,8 @@
1
+ @node_modules/@call-me-sensei/toonlab/agents/codex/AGENTS.md
2
+
3
+ ## Claude Code
4
+
5
+ - Use `agents/skills/claude/` as the user-facing usage guides for ToonLab
6
+ runtime features.
7
+ - Keep this file short; shared guidance belongs in `agents/codex/AGENTS.md`.
8
+ - Keep these downloadable resources focused on runtime usage.