@bendyline/molen-tooling 0.0.2 → 0.0.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.
Files changed (76) hide show
  1. package/dist/capture/harness.js +216 -216
  2. package/dist/capture/worldgen-preview.js +288 -288
  3. package/dist/cli.mjs +110 -10
  4. package/dist/docs-src/guide/3d-model-assets.md +35 -3
  5. package/dist/docs-src/guide/adaptive-performance.md +4 -0
  6. package/dist/docs-src/guide/agent-loop.md +6 -6
  7. package/dist/docs-src/guide/aircraft.md +16 -7
  8. package/dist/docs-src/guide/audio.md +247 -0
  9. package/dist/docs-src/guide/browser-mount.md +3 -1
  10. package/dist/docs-src/guide/building-interiors.md +5 -4
  11. package/dist/docs-src/guide/determinism.md +12 -12
  12. package/dist/docs-src/guide/earth-view.md +444 -0
  13. package/dist/docs-src/guide/entities.md +1 -1
  14. package/dist/docs-src/guide/examples.md +2 -1
  15. package/dist/docs-src/guide/game-samples.md +21 -4
  16. package/dist/docs-src/guide/graphics-performance.md +40 -8
  17. package/dist/docs-src/guide/input.md +9 -0
  18. package/dist/docs-src/guide/markers.md +52 -0
  19. package/dist/docs-src/guide/materials.md +10 -3
  20. package/dist/docs-src/guide/navigation.md +144 -0
  21. package/dist/docs-src/guide/project.md +1 -1
  22. package/dist/docs-src/guide/quickstart.md +2 -2
  23. package/dist/docs-src/guide/recognizable-places.md +3 -2
  24. package/dist/docs-src/guide/scripting.md +4 -2
  25. package/dist/docs-src/guide/sky.md +16 -0
  26. package/dist/docs-src/guide/source-bundles.md +0 -1
  27. package/dist/docs-src/guide/structure-library.md +2 -2
  28. package/dist/docs-src/guide/terrain.md +45 -2
  29. package/dist/docs-src/guide/vehicles.md +18 -9
  30. package/dist/docs-src/guide/worldgen.md +3 -3
  31. package/dist/docs-src/llms.txt +10 -4
  32. package/dist/docs-src/schemas/README.md +3 -0
  33. package/dist/docs-src/schemas/archive-set.md +175 -0
  34. package/dist/docs-src/schemas/components.md +1104 -1
  35. package/dist/docs-src/schemas/matgraph.md +6 -0
  36. package/dist/docs-src/schemas/soundbank.md +251 -0
  37. package/dist/docs-src/schemas/structure-placements.md +496 -0
  38. package/dist/docs-src/schemas/terrain-package.md +120 -0
  39. package/dist/index.d.mts +5 -1
  40. package/dist/index.mjs +1 -1
  41. package/dist/{mcp-AOfIp89b.mjs → mcp-BTVwVKFb.mjs} +67 -3
  42. package/dist/{ops-C4BvDgP-.mjs → ops-BPdHodFR.mjs} +915 -29
  43. package/dist/templates/city-courier/README.md +13 -0
  44. package/dist/templates/city-courier/delivery-run.replay.json +151 -151
  45. package/dist/templates/city-courier/gen/molen-types.ts +142 -4
  46. package/dist/templates/city-courier/package.json +1 -0
  47. package/dist/templates/city-courier/scene.json +79 -0
  48. package/dist/templates/city-courier/scripts/game.ts +5 -1
  49. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +167 -4
  50. package/dist/templates/city-courier/src/audio.ts +96 -0
  51. package/dist/templates/city-courier/src/game-shell.css +8 -0
  52. package/dist/templates/city-courier/src/main.ts +3 -0
  53. package/dist/templates/city-courier/test/headless.test.ts +1 -1
  54. package/dist/templates/index.json +3 -0
  55. package/dist/templates/skybound/README.md +13 -0
  56. package/dist/templates/skybound/first-leap.replay.json +152 -152
  57. package/dist/templates/skybound/gen/molen-types.ts +142 -4
  58. package/dist/templates/skybound/package.json +1 -0
  59. package/dist/templates/skybound/scene.json +40 -0
  60. package/dist/templates/skybound/scripts/game.ts +8 -5
  61. package/dist/templates/skybound/scripts/molen-scripts.d.ts +167 -4
  62. package/dist/templates/skybound/src/audio.ts +96 -0
  63. package/dist/templates/skybound/src/game-shell.css +8 -0
  64. package/dist/templates/skybound/src/main.ts +3 -0
  65. package/dist/templates/skybound/test/headless.test.ts +1 -1
  66. package/dist/templates/top-down-arena/README.md +14 -1
  67. package/dist/templates/top-down-arena/arena-skirmish.replay.json +152 -152
  68. package/dist/templates/top-down-arena/package.json +1 -0
  69. package/dist/templates/top-down-arena/scene.json +20 -0
  70. package/dist/templates/top-down-arena/scripts/combat.ts +1 -0
  71. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +167 -4
  72. package/dist/templates/top-down-arena/src/audio.ts +96 -0
  73. package/dist/templates/top-down-arena/src/gen/molen-types.ts +142 -4
  74. package/dist/templates/top-down-arena/src/main.ts +3 -0
  75. package/dist/templates/top-down-arena/test/headless.test.ts +1 -1
  76. package/package.json +11 -11
@@ -4,7 +4,7 @@
4
4
  > three.js rendering client, authored through JSON schemas, a small typed API, and a headless
5
5
  > dev loop. This bundle is version-locked to the engine release.
6
6
 
7
- Engine version: 0.0.2. three.js peer range: >=0.184.0 <0.187.0 (developed against 0.184.0). Node ≥ 22.13, ESM only.
7
+ Engine version: 0.0.3. three.js peer range: >=0.184.0 <0.187.0 (developed against 0.184.0). Node ≥ 22.13, ESM only.
8
8
 
9
9
  ## Start here
10
10
 
@@ -27,9 +27,13 @@ downloads them into a project and pins them in project.json.
27
27
  - [Determinism](guide/determinism.md): the contract — what reproduces and at what level per subsystem, what breaks it, what `STATE_FORMAT` means for save files and recorded replays, and what is explicitly not promised.
28
28
  - [Browser mount](guide/browser-mount.md): `buildWorld` in a Worker + `await mountExperience` on the page; events and state for HUDs.
29
29
  - [Input profiles and joysticks](guide/input.md): keyboard/controller remapping, raw axes, walking/driving/flying profiles, analog commands, and optional React controls.
30
+ - [Camera navigation](guide/navigation.md): orbit, fly, walk (capsule collision against streamed geometry) and follow cameras for `createViewer` hosts; one input model across keys, gamepad, pointer gestures and an on-screen touch stick.
31
+ - [World markers](guide/markers.md): screen-sized photo pins and labels pinned to world positions, ground-snapped, occluded, faded, budgeted and pickable.
32
+ - [Earth view](guide/earth-view.md): `mountEarthView` from `@bendyline/molen-earth` — real-world terrain, buildings, orbit/walk/drive, drivable cars, lat/lon markers, credits and adaptive quality in one call.
30
33
  - [WebGPU and WebGL](guide/rendering-backends.md): the `backend` option ('auto' | 'webgl' | 'webgpu') on the asynchronous client factories, legacy WebGL fallback, compatible materials, and world-explorer comparisons.
31
34
  - [Earth and authored skies](guide/sky.md): day/night cycles, geographic Sun/Moon positions and lunar phases, catalog stars, simulation clocks, custom-world palettes, and the sky observatory.
32
35
  - [Weather and physical atmosphere](guide/weather.md): independent clouds, precipitation and visibility; profiles, temperature/pressure/wind for simulation and aircraft physics; cloud/rain/snow rendering.
36
+ - [Sound and music](guide/audio.md): sound banks, `audioEnvironment`/`audioSource`/`audioZone` rules driven by weather, sky, listener and entity signals, `molen.audio.*` in scripts, `molen audio plan` to hear a scene headlessly, and the CC0 `molen.sounds` pack.
33
37
  - [Graphics performance](guide/graphics-performance.md): sparse transforms, static instancing, worker preparation, staged uploads, animation/light policy and terrain transitions.
34
38
  - [Terrain and world explorer](guide/terrain.md): fixed-grid and screen-space pyramid streaming,
35
39
  projected Earth coordinates, optional semantic tile layers, the installable tiled-world package
@@ -38,7 +42,7 @@ downloads them into a project and pins them in project.json.
38
42
  - [Worldgen: styled buildings and scatter](guide/worldgen.md): any outline → a styled building; `worldgenBuilding` component, `molen.worldgen.*` script queries, worker + cache for map tiles
39
43
  (footprint analysis, roofs, walls), labeled polygons → deterministic props, style packs, and the
40
44
  Earth binding (region atlas, terrain-semantics adapter, tile renderers).
41
- - [Default structure library](guide/structure-library.md): 120 resizable buildings in 13 taxonomies, 45 shared construction materials, regional placement and the interactive model sheet.
45
+ - [Default structure library](guide/structure-library.md): 120 resizable buildings in 13 taxonomies, 51 shared construction materials, regional placement and the interactive model sheet.
42
46
  - [Recognizable places](guide/recognizable-places.md): store identity matching, reusable signs, tenant facades and mapped outdoor props.
43
47
  - [Building interiors](guide/building-interiors.md): deterministic layouts by use, real entrances and frontage windows, lazy rendering and walk collision.
44
48
  - [3D art guidelines](guide/3d-art-guidelines.md): shared polygonal fidelity, scale, material library, LOD and visual review for static and procedural models.
@@ -87,6 +91,7 @@ Schema + example, generated from the registry) live in [schemas/](schemas/README
87
91
  - [Command envelope](schemas/command.md) · [Assertions](schemas/assert.md)
88
92
  - [Keyframe](schemas/keyframe.md) · [Delta](schemas/delta.md) · [Replay](schemas/replay.md)
89
93
  - [Components](schemas/components.md) — every component with units and axis conventions
94
+ - [Sound bank](schemas/soundbank.md) (`molen/soundbank@1`: sound ids → clips, loops, gain, pitch, bus, provenance)
90
95
 
91
96
  ## The API surface
92
97
 
@@ -102,7 +107,8 @@ Schema + example, generated from the registry) live in [schemas/](schemas/README
102
107
  - `molen validate <file> [--kind k] [--project p]` — validate an asset (pinpoint, fixable errors; scene `type` refs resolve through the project)
103
108
  - `molen sim run <scene|name> --ticks N [--setup m] [--commands f] [--assert f] [--hash]`
104
109
  - `molen asset import <file.glb> [--id <id>] [--trimesh]` · `asset inspect <ref> [--verify]` · `asset list` · `asset shot <ref> --out-dir d [--variant ktx2]`
105
- - `molen pack build <dir> --out-dir d` · `pack inspect|verify <pack>` · `pack extract <pack> --out-dir d` · `pack fetch <url> [--project p]` — content packs (deterministic zips with a manifest); CLI ops find them via project.json `packs` and `MOLEN_PACKS`
110
+ - `molen pack build <dir> --out-dir d` · `pack inspect|verify <pack>` · `pack extract <pack> --out-dir d` · `pack fetch <url> [ids…] [--out-dir d] [--project p]` — content packs (deterministic zips with a manifest); CLI ops find them via project.json `packs` and `MOLEN_PACKS`
111
+ - `molen audio plan <scene> --ticks N [--bank b.json] [--commands f] [--weather w] [--mode m]` — list the loops and one-shots a scene would play, headlessly · `audio import <file> --id <id> --bank <bank.json> --license <spdx>` · `audio check <bank.json>`
106
112
  - `molen asset pack <ref>|--all` — runtime GLB variant (KTX2 textures + mips, 4-8x less GPU memory) · `asset stage --out-dir d [--variant ktx2]` — browser bundle + assets.index.json
107
113
  - `molen drive <scene> --actions f --out-dir d [--assert f]` — PLAY a scene: commands in, frames out (deterministic)
108
114
  - `molen play <built-app-dir> --scenario f --out-dir d` — PLAY a browser experience: UI inputs in, screenshots/probes/diagnostics out
@@ -128,7 +134,7 @@ Schema + example, generated from the registry) live in [schemas/](schemas/README
128
134
  `check_types`, `reserve_type`, `generate_types`, `import_asset`, `inspect_asset`, `pack_asset`, `stage_assets`,
129
135
  `list_assets`, `drive_scene` (returns frames as IMAGES), `play_experience` (plays a built browser app and returns frames as IMAGES), `screenshot_asset` (turntable images),
130
136
  `test_types`, `worldgen_preview` (generated buildings as IMAGES), `worldgen_bake`, `worldgen_stats`,
131
- `figure_preview` (figures as IMAGES), `list_figure_presets`. Call `describe_op` for I/O contracts.
137
+ `figure_preview` (figures as IMAGES), `list_figure_presets`, `plan_audio`, `import_sound`, `check_soundbank`. Call `describe_op` for I/O contracts.
132
138
 
133
139
 
134
140
  ## Design reference (for deeper questions; the historical design plan, on GitHub)
@@ -3,6 +3,7 @@
3
3
  Autogenerated from the schema registry `molen validate` checks against; `molen schema list` and `molen schema get <kind>` print the same set at runtime.
4
4
 
5
5
  - [Components](components.md) — the component vocabulary (`molen components`)
6
+ - [Archive set](archive-set.md) — `molen/archive-set@1`
6
7
  - [Architectural style](archstyle.md) — `molen/archstyle@1`
7
8
  - [Assertion document](assert.md) — `molen/assert@1`
8
9
  - [Asset sidecar](asset.md) — `molen/asset@1`
@@ -27,7 +28,9 @@ Autogenerated from the schema registry `molen validate` checks against; `molen s
27
28
  - [Replay fixture](replay.md) — `molen/replay@1`
28
29
  - [Scatter rules](scatter.md) — `molen/scatter@1`
29
30
  - [Scene manifest](scene.md) — `molen/scene@3`
31
+ - [Sound bank](soundbank.md) — `molen/soundbank@1`
30
32
  - [Logical source bundle](source-bundle.md) — `molen/source-bundle@1`
33
+ - [Geographic structure placements](structure-placements.md) — `molen/structure-placements@1`
31
34
  - [Style pack manifest](stylepack.md) — `molen/stylepack@1`
32
35
  - [Terrain descriptor](terrain.md) — `molen/terrain@2`
33
36
  - [Terrain package manifest](terrain-package.md) — `molen/terrain-package@1`
@@ -0,0 +1,175 @@
1
+ # Archive set (`molen/archive-set@1`)
2
+
3
+ One tile pyramid split across PMTiles archives: a coarse base plus detail archives partitioned by the tile at a fixed level.
4
+
5
+ ## Example
6
+
7
+ ```json
8
+ {
9
+ "format": "molen/archive-set@1",
10
+ "name": "world-features",
11
+ "tileType": "mvt",
12
+ "partitionLevel": 7,
13
+ "base": {
14
+ "url": "base.pmtiles",
15
+ "minLevel": 0,
16
+ "maxLevel": 7
17
+ },
18
+ "archives": [
19
+ {
20
+ "id": "pacific-northwest-01",
21
+ "url": "2026-09/pacific-northwest-01.pmtiles",
22
+ "minLevel": 8,
23
+ "maxLevel": 13,
24
+ "partitions": "2600-2603,2728-2731"
25
+ }
26
+ ]
27
+ }
28
+ ```
29
+
30
+ ## JSON Schema
31
+
32
+ ```json
33
+ {
34
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
35
+ "type": "object",
36
+ "properties": {
37
+ "format": {
38
+ "type": "string",
39
+ "const": "molen/archive-set@1",
40
+ "description": "Format envelope; always 'molen/archive-set@1'."
41
+ },
42
+ "name": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "description": "Archive set name."
46
+ },
47
+ "tileType": {
48
+ "type": "string",
49
+ "enum": [
50
+ "png",
51
+ "mvt"
52
+ ],
53
+ "description": "Payload type shared by every archive: 'png' (e.g. PNG16 elevation) or 'mvt'."
54
+ },
55
+ "partitionLevel": {
56
+ "type": "integer",
57
+ "minimum": 0,
58
+ "maximum": 10,
59
+ "description": "Level whose tiles partition the detail archives; a detail tile belongs to the archive listing its ancestor at this level."
60
+ },
61
+ "base": {
62
+ "type": "object",
63
+ "properties": {
64
+ "url": {
65
+ "type": "string",
66
+ "minLength": 1,
67
+ "description": "Archive URL, relative to this document or absolute (http/https)."
68
+ },
69
+ "minLevel": {
70
+ "type": "integer",
71
+ "minimum": 0,
72
+ "maximum": 30,
73
+ "description": "Coarsest level the base archive serves."
74
+ },
75
+ "maxLevel": {
76
+ "type": "integer",
77
+ "minimum": 0,
78
+ "maximum": 30,
79
+ "description": "Finest level the base archive serves."
80
+ },
81
+ "bytes": {
82
+ "type": "integer",
83
+ "minimum": 0,
84
+ "maximum": 9007199254740991,
85
+ "description": "Archive size in bytes."
86
+ },
87
+ "sha256": {
88
+ "type": "string",
89
+ "pattern": "^[0-9a-f]{64}$",
90
+ "description": "Hex sha256 of the archive."
91
+ }
92
+ },
93
+ "required": [
94
+ "url",
95
+ "minLevel",
96
+ "maxLevel"
97
+ ],
98
+ "additionalProperties": false,
99
+ "description": "Optional coarse archive serving every level up to its maxLevel."
100
+ },
101
+ "archives": {
102
+ "type": "array",
103
+ "items": {
104
+ "type": "object",
105
+ "properties": {
106
+ "id": {
107
+ "type": "string",
108
+ "minLength": 1,
109
+ "description": "Unique archive id, e.g. \"pacific-northwest-02\"."
110
+ },
111
+ "url": {
112
+ "type": "string",
113
+ "minLength": 1,
114
+ "description": "Archive URL, relative to this document or absolute (http/https)."
115
+ },
116
+ "minLevel": {
117
+ "type": "integer",
118
+ "minimum": 0,
119
+ "maximum": 30,
120
+ "description": "Coarsest level the archive serves (at least partitionLevel)."
121
+ },
122
+ "maxLevel": {
123
+ "type": "integer",
124
+ "minimum": 0,
125
+ "maximum": 30,
126
+ "description": "Finest level the archive serves."
127
+ },
128
+ "partitions": {
129
+ "type": "string",
130
+ "pattern": "^(\\d+(-\\d+)?(,\\d+(-\\d+)?)*)?$",
131
+ "description": "Run-length list of partition cells it owns, as indices y * 2^partitionLevel + x (e.g. \"40-44,60\")."
132
+ },
133
+ "bounds": {
134
+ "minItems": 4,
135
+ "maxItems": 4,
136
+ "type": "array",
137
+ "items": {
138
+ "type": "number"
139
+ },
140
+ "description": "Informational [west, south, east, north] in degrees."
141
+ },
142
+ "bytes": {
143
+ "type": "integer",
144
+ "minimum": 0,
145
+ "maximum": 9007199254740991,
146
+ "description": "Archive size in bytes."
147
+ },
148
+ "sha256": {
149
+ "type": "string",
150
+ "pattern": "^[0-9a-f]{64}$",
151
+ "description": "Hex sha256 of the archive."
152
+ }
153
+ },
154
+ "required": [
155
+ "id",
156
+ "url",
157
+ "minLevel",
158
+ "maxLevel",
159
+ "partitions"
160
+ ],
161
+ "additionalProperties": false
162
+ },
163
+ "description": "Detail archives, each owning a disjoint set of partition cells."
164
+ }
165
+ },
166
+ "required": [
167
+ "format",
168
+ "name",
169
+ "tileType",
170
+ "partitionLevel",
171
+ "archives"
172
+ ],
173
+ "additionalProperties": false
174
+ }
175
+ ```