@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
@@ -1,120 +0,0 @@
1
- import {
2
- STYLIZED_TREE_EXAMPLES,
3
- StylizedTree,
4
- TREE_RECIPE_SCHEMA,
5
- TREE_RECIPE_VERSION,
6
- serializableTreeOptions,
7
- } from './stylizedTree.js';
8
-
9
- const LEGACY_TREE_DEFINITIONS = Object.freeze([
10
- Object.freeze({ id: 'straight', label: 'Straight' }),
11
- Object.freeze({ id: 'leaning', label: 'Leaning' }),
12
- Object.freeze({ id: 'see-through', label: 'See-through' }),
13
- Object.freeze({ id: 'curved', label: 'Curved' }),
14
- Object.freeze({ id: 'forest-mix', label: 'Forest Mix' }),
15
- Object.freeze({ id: 'wide-crown', label: 'Wide Crown' }),
16
- Object.freeze({ id: 'autumn-blend', label: 'Autumn Blend' }),
17
- Object.freeze({ id: 'gnarled', label: 'Gnarled' }),
18
- Object.freeze({ id: 'bonsai', label: 'Bonsai' }),
19
- Object.freeze({ id: 'golden-gingko', label: 'Golden Gingko' }),
20
- Object.freeze({ id: 'sumeru-tips', label: 'Sumeru Tips' }),
21
- Object.freeze({ id: 'massive-sumeru', label: 'Massive Sumeru' }),
22
- ]);
23
-
24
- function clone(value) {
25
- if (Array.isArray(value)) return value.map(clone);
26
- if (value && typeof value === 'object') {
27
- return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, clone(entry)]));
28
- }
29
- return value;
30
- }
31
-
32
- function deepFreeze(value) {
33
- if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value;
34
- for (const entry of Object.values(value)) deepFreeze(entry);
35
- return Object.freeze(value);
36
- }
37
-
38
- function legacyOptions(example) {
39
- // `pale` and `climbable` are old showcase-scene hints, not tree generator
40
- // inputs. Preserve them as document metadata without feeding them into the
41
- // stable constructor surface.
42
- const { pale = false, climbable = false, ...options } = example;
43
- return {
44
- metadata: { climbable: Boolean(climbable), pale: Boolean(pale) },
45
- options: serializableTreeOptions(options),
46
- };
47
- }
48
-
49
- /**
50
- * The twelve pre-species ToonLab trees, now named and versioned explicitly.
51
- *
52
- * This is the supported legacy set that existed before the repository's
53
- * botanical species research. It contains only generic stylized silhouettes;
54
- * none of the documents claims a botanical species identity.
55
- */
56
- export const LEGACY_TREE_PRESETS = deepFreeze(LEGACY_TREE_DEFINITIONS.map((definition, index) => {
57
- const normalized = legacyOptions(STYLIZED_TREE_EXAMPLES[index]);
58
- return {
59
- builtIn: true,
60
- id: definition.id,
61
- label: definition.label,
62
- metadata: normalized.metadata,
63
- options: normalized.options,
64
- schema: TREE_RECIPE_SCHEMA,
65
- type: 'tree',
66
- version: TREE_RECIPE_VERSION,
67
- };
68
- }));
69
-
70
- export const LEGACY_TREE_IDS = Object.freeze(LEGACY_TREE_PRESETS.map(({ id }) => id));
71
-
72
- /** Returns one immutable legacy recipe document, or null. */
73
- export function getLegacyTreePreset(id) {
74
- return LEGACY_TREE_PRESETS.find((preset) => preset.id === id) ?? null;
75
- }
76
-
77
- /** Lists the stable legacy IDs and labels without duplicating recipe data. */
78
- export function getLegacyTreePresetOptions() {
79
- return LEGACY_TREE_PRESETS.map(({ id, label, metadata }) => ({
80
- id,
81
- label,
82
- metadata: { ...metadata },
83
- }));
84
- }
85
-
86
- /**
87
- * Creates one tree from the supported pre-species set.
88
- *
89
- * Overrides remain the ordinary StylizedTree contract, including `leafShape`,
90
- * `trunkMap`, `foliage.leafMap`, and `vegetationShader`. Nested generator and
91
- * material groups merge over the selected recipe instead of replacing it.
92
- */
93
- export function createLegacyTree(id, overrides = {}) {
94
- const preset = getLegacyTreePreset(id);
95
- if (!preset) throw new Error(`Unknown legacy tree preset "${String(id)}".`);
96
- const base = clone(preset.options);
97
- const source = overrides && typeof overrides === 'object' && !Array.isArray(overrides)
98
- ? overrides
99
- : {};
100
- const tree = new StylizedTree({
101
- ...base,
102
- ...source,
103
- canopy: { ...(base.canopy ?? {}), ...(source.canopy ?? {}) },
104
- foliage: { ...(base.foliage ?? {}), ...(source.foliage ?? {}) },
105
- skeleton: { ...(base.skeleton ?? {}), ...(source.skeleton ?? {}) },
106
- tree: {
107
- ...(base.tree ?? {}),
108
- ...(source.tree ?? {}),
109
- trunkReceiveShadow: source.tree?.trunkReceiveShadow ?? true,
110
- },
111
- trunk: { ...(base.trunk ?? {}), ...(source.trunk ?? {}) },
112
- });
113
- tree.name = `LegacyTree:${preset.id}`;
114
- tree.userData.legacyTree = {
115
- id: preset.id,
116
- label: preset.label,
117
- recipeVersion: preset.version,
118
- };
119
- return tree;
120
- }
@@ -1,22 +0,0 @@
1
- /** Returns one immutable legacy recipe document, or null. */
2
- export function getLegacyTreePreset(id: any): any;
3
- /** Lists the stable legacy IDs and labels without duplicating recipe data. */
4
- export function getLegacyTreePresetOptions(): any;
5
- /**
6
- * Creates one tree from the supported pre-species set.
7
- *
8
- * Overrides remain the ordinary StylizedTree contract, including `leafShape`,
9
- * `trunkMap`, `foliage.leafMap`, and `vegetationShader`. Nested generator and
10
- * material groups merge over the selected recipe instead of replacing it.
11
- */
12
- export function createLegacyTree(id: any, overrides?: {}): StylizedTree;
13
- /**
14
- * The twelve pre-species ToonLab trees, now named and versioned explicitly.
15
- *
16
- * This is the supported legacy set that existed before the repository's
17
- * botanical species research. It contains only generic stylized silhouettes;
18
- * none of the documents claims a botanical species identity.
19
- */
20
- export const LEGACY_TREE_PRESETS: any;
21
- export const LEGACY_TREE_IDS: any;
22
- import { StylizedTree } from './stylizedTree.js';