@bendyline/molen-tooling 0.0.1

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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +15 -0
  3. package/README.md +91 -0
  4. package/dist/capture/THIRD-PARTY-NOTICES.md +223 -0
  5. package/dist/capture/basis/LICENSE.txt +55 -0
  6. package/dist/capture/basis/basis_transcoder.js +19 -0
  7. package/dist/capture/basis/basis_transcoder.wasm +0 -0
  8. package/dist/capture/capture.html +15 -0
  9. package/dist/capture/harness.js +4671 -0
  10. package/dist/capture/worldgen-preview.html +15 -0
  11. package/dist/capture/worldgen-preview.js +4617 -0
  12. package/dist/cli.d.mts +1 -0
  13. package/dist/cli.mjs +1276 -0
  14. package/dist/docs-src/guide/3d-art-guidelines.md +157 -0
  15. package/dist/docs-src/guide/3d-model-assets.md +286 -0
  16. package/dist/docs-src/guide/adaptive-performance.md +89 -0
  17. package/dist/docs-src/guide/agent-loop.md +156 -0
  18. package/dist/docs-src/guide/aircraft.md +225 -0
  19. package/dist/docs-src/guide/browser-mount.md +185 -0
  20. package/dist/docs-src/guide/building-interiors.md +175 -0
  21. package/dist/docs-src/guide/capability-authoring.md +69 -0
  22. package/dist/docs-src/guide/determinism.md +285 -0
  23. package/dist/docs-src/guide/entities.md +47 -0
  24. package/dist/docs-src/guide/examples.md +58 -0
  25. package/dist/docs-src/guide/experience-playback.md +57 -0
  26. package/dist/docs-src/guide/figures.md +164 -0
  27. package/dist/docs-src/guide/game-samples.md +100 -0
  28. package/dist/docs-src/guide/graphics-performance.md +167 -0
  29. package/dist/docs-src/guide/input.md +205 -0
  30. package/dist/docs-src/guide/materials.md +125 -0
  31. package/dist/docs-src/guide/project.md +157 -0
  32. package/dist/docs-src/guide/quickstart.md +63 -0
  33. package/dist/docs-src/guide/recognizable-places.md +158 -0
  34. package/dist/docs-src/guide/rendering-backends.md +231 -0
  35. package/dist/docs-src/guide/scripting.md +330 -0
  36. package/dist/docs-src/guide/sky.md +192 -0
  37. package/dist/docs-src/guide/source-bundles.md +42 -0
  38. package/dist/docs-src/guide/structure-library.md +114 -0
  39. package/dist/docs-src/guide/surface-rendering.md +203 -0
  40. package/dist/docs-src/guide/terrain.md +389 -0
  41. package/dist/docs-src/guide/three-surface.md +70 -0
  42. package/dist/docs-src/guide/vehicle-interiors.md +126 -0
  43. package/dist/docs-src/guide/vehicles.md +110 -0
  44. package/dist/docs-src/guide/weather.md +123 -0
  45. package/dist/docs-src/guide/worldgen.md +434 -0
  46. package/dist/docs-src/llms.txt +129 -0
  47. package/dist/docs-src/schemas/README.md +36 -0
  48. package/dist/docs-src/schemas/archstyle.md +2340 -0
  49. package/dist/docs-src/schemas/assert.md +169 -0
  50. package/dist/docs-src/schemas/asset.md +543 -0
  51. package/dist/docs-src/schemas/business-catalog.md +162 -0
  52. package/dist/docs-src/schemas/cameratrack.md +132 -0
  53. package/dist/docs-src/schemas/command.md +112 -0
  54. package/dist/docs-src/schemas/components.md +5826 -0
  55. package/dist/docs-src/schemas/delta.md +204 -0
  56. package/dist/docs-src/schemas/experience-play.md +452 -0
  57. package/dist/docs-src/schemas/figure.md +290 -0
  58. package/dist/docs-src/schemas/interior-catalog.md +230 -0
  59. package/dist/docs-src/schemas/keyframe.md +314 -0
  60. package/dist/docs-src/schemas/landmark-catalog.md +56 -0
  61. package/dist/docs-src/schemas/landmark.md +293 -0
  62. package/dist/docs-src/schemas/matgraph.md +1163 -0
  63. package/dist/docs-src/schemas/pack-index.md +82 -0
  64. package/dist/docs-src/schemas/pack-source.md +139 -0
  65. package/dist/docs-src/schemas/pack.md +225 -0
  66. package/dist/docs-src/schemas/pixelgrid.md +108 -0
  67. package/dist/docs-src/schemas/prefab.md +106 -0
  68. package/dist/docs-src/schemas/project.md +271 -0
  69. package/dist/docs-src/schemas/region-atlas.md +612 -0
  70. package/dist/docs-src/schemas/replay.md +807 -0
  71. package/dist/docs-src/schemas/scatter.md +541 -0
  72. package/dist/docs-src/schemas/scene.md +1152 -0
  73. package/dist/docs-src/schemas/source-bundle.md +266 -0
  74. package/dist/docs-src/schemas/stylepack.md +420 -0
  75. package/dist/docs-src/schemas/terrain-package.md +731 -0
  76. package/dist/docs-src/schemas/terrain.md +313 -0
  77. package/dist/docs-src/schemas/types.md +218 -0
  78. package/dist/docs-src/schemas/uvpaint.md +149 -0
  79. package/dist/docs-src/schemas/worldgen-batch.md +743 -0
  80. package/dist/index.d.mts +1271 -0
  81. package/dist/index.mjs +78 -0
  82. package/dist/mcp-BFnCWrg0.mjs +796 -0
  83. package/dist/ops-BGxhSP6w.mjs +7246 -0
  84. package/package.json +96 -0
@@ -0,0 +1,1152 @@
1
+ # Scene manifest (`molen/scene@3`)
2
+
3
+ Root document an experience boots from; instantiates into ECS state at tick 0.
4
+
5
+ ## Example
6
+
7
+ ```json
8
+ {
9
+ "format": "molen/scene@3",
10
+ "name": "demo",
11
+ "seed": "demo-1",
12
+ "tickRate": 30,
13
+ "prefabs": {
14
+ "cube": {
15
+ "components": {
16
+ "transform": {
17
+ "pos": [
18
+ 0,
19
+ 0,
20
+ 0
21
+ ],
22
+ "rot": [
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 1
27
+ ]
28
+ },
29
+ "spin": {
30
+ "axis": [
31
+ 0,
32
+ 1,
33
+ 0
34
+ ],
35
+ "radPerTick": 0.05
36
+ }
37
+ }
38
+ }
39
+ },
40
+ "entities": [
41
+ {
42
+ "id": "cube-1",
43
+ "prefab": "cube"
44
+ }
45
+ ],
46
+ "components": {
47
+ "spin": {
48
+ "description": "Continuous rotation about an axis, applied by the spin script.",
49
+ "examples": [
50
+ {
51
+ "axis": [
52
+ 0,
53
+ 1,
54
+ 0
55
+ ],
56
+ "radPerTick": 0.05
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ "commands": {
62
+ "move": {
63
+ "doc": "Set the planar move direction [x, z] (-1..1 per axis).",
64
+ "payload": {
65
+ "type": "object",
66
+ "properties": {
67
+ "dir": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "number"
71
+ },
72
+ "minItems": 2,
73
+ "maxItems": 2
74
+ }
75
+ },
76
+ "required": [
77
+ "dir"
78
+ ],
79
+ "additionalProperties": false
80
+ }
81
+ }
82
+ },
83
+ "scripts": [
84
+ {
85
+ "id": "control",
86
+ "code": "molen.onCommand('move', (p) => molen.patch('cube-1', 'transform', { pos: [p.dir[0], 0, p.dir[1]] }));"
87
+ }
88
+ ],
89
+ "camera": {
90
+ "mode": "fixed",
91
+ "position": [
92
+ 0,
93
+ 6,
94
+ 16
95
+ ],
96
+ "lookAt": [
97
+ 0,
98
+ 0,
99
+ 0
100
+ ]
101
+ },
102
+ "input": {
103
+ "bindings": {
104
+ "KeyW": "up",
105
+ "KeyS": "down",
106
+ "KeyA": "left",
107
+ "KeyD": "right"
108
+ },
109
+ "emit": [
110
+ {
111
+ "kind": "axis2d",
112
+ "xNeg": "left",
113
+ "xPos": "right",
114
+ "yNeg": "up",
115
+ "yPos": "down",
116
+ "command": "move",
117
+ "field": "dir"
118
+ }
119
+ ]
120
+ }
121
+ }
122
+ ```
123
+
124
+ ## JSON Schema
125
+
126
+ ```json
127
+ {
128
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
129
+ "type": "object",
130
+ "properties": {
131
+ "format": {
132
+ "type": "string",
133
+ "const": "molen/scene@3",
134
+ "description": "Format envelope; always 'molen/scene@3'."
135
+ },
136
+ "name": {
137
+ "type": "string",
138
+ "minLength": 1,
139
+ "description": "Human-readable scene name."
140
+ },
141
+ "seed": {
142
+ "default": 0,
143
+ "description": "Deterministic RNG seed (string or number; default 0).",
144
+ "type": [
145
+ "string",
146
+ "number"
147
+ ]
148
+ },
149
+ "tickRate": {
150
+ "default": 30,
151
+ "type": "integer",
152
+ "minimum": 1,
153
+ "maximum": 240,
154
+ "description": "Simulation ticks per second, 1..240 (default 30); dt = 1/tickRate seconds."
155
+ },
156
+ "lateCommands": {
157
+ "default": "rewrite",
158
+ "type": "string",
159
+ "enum": [
160
+ "rewrite",
161
+ "reject"
162
+ ],
163
+ "description": "Commands that arrive for a past tick: rewrite to the current tick (default) or reject."
164
+ },
165
+ "keyframeInterval": {
166
+ "default": 60,
167
+ "type": "integer",
168
+ "minimum": 1,
169
+ "maximum": 9007199254740991,
170
+ "description": "Ticks between full keyframe snapshots (default 60)."
171
+ },
172
+ "prefabs": {
173
+ "default": {},
174
+ "type": "object",
175
+ "propertyNames": {
176
+ "type": "string"
177
+ },
178
+ "additionalProperties": {
179
+ "type": "object",
180
+ "properties": {
181
+ "format": {
182
+ "type": "string",
183
+ "const": "molen/prefab@1",
184
+ "description": "Format envelope 'molen/prefab@1' (optional when the prefab is inlined in a scene)."
185
+ },
186
+ "extends": {
187
+ "type": "string",
188
+ "minLength": 1,
189
+ "description": "Name of a prefab in the same manifest to inherit components from (deep-merged)."
190
+ },
191
+ "type": {
192
+ "type": "string",
193
+ "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
194
+ "description": "Project-registry type id this prefab specializes, e.g. 'train.locomotive'."
195
+ },
196
+ "components": {
197
+ "default": {},
198
+ "type": "object",
199
+ "propertyNames": {
200
+ "type": "string"
201
+ },
202
+ "additionalProperties": {
203
+ "type": "object",
204
+ "propertyNames": {
205
+ "type": "string"
206
+ },
207
+ "additionalProperties": {
208
+ "$ref": "#/$defs/__schema0"
209
+ }
210
+ },
211
+ "description": "Component name to pure-JSON component data (deep-merged over the extends/type base)."
212
+ }
213
+ },
214
+ "additionalProperties": false
215
+ },
216
+ "description": "Prefab name to prefab (entity templates instantiated by entities[].prefab)."
217
+ },
218
+ "entities": {
219
+ "default": [],
220
+ "type": "array",
221
+ "items": {
222
+ "type": "object",
223
+ "properties": {
224
+ "id": {
225
+ "type": "string",
226
+ "minLength": 1,
227
+ "pattern": "^(?!e\\d+$)(?!\\d+$)(?!\\$)",
228
+ "description": "Authored entity id, stable across save/load; omitted = runtime id 'e<n>'."
229
+ },
230
+ "type": {
231
+ "type": "string",
232
+ "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
233
+ "description": "Project-registry type id to instantiate, e.g. 'train.locomotive'."
234
+ },
235
+ "prefab": {
236
+ "type": "string",
237
+ "minLength": 1,
238
+ "description": "Name of a prefab in this scene to instantiate."
239
+ },
240
+ "components": {
241
+ "type": "object",
242
+ "propertyNames": {
243
+ "type": "string"
244
+ },
245
+ "additionalProperties": {
246
+ "type": "object",
247
+ "propertyNames": {
248
+ "type": "string"
249
+ },
250
+ "additionalProperties": {
251
+ "$ref": "#/$defs/__schema0"
252
+ }
253
+ },
254
+ "description": "Component name to component data, layered over the type/prefab base (a partial when a base is present)."
255
+ }
256
+ },
257
+ "additionalProperties": false
258
+ },
259
+ "description": "Entities instantiated at tick 0, in order."
260
+ },
261
+ "scripts": {
262
+ "default": [],
263
+ "type": "array",
264
+ "items": {
265
+ "type": "object",
266
+ "properties": {
267
+ "checkpoint": {
268
+ "type": "string",
269
+ "const": "state",
270
+ "description": "Opt into checkpoint restore: keep all durable state in molen.state, components, or snapshot providers, never mutable closures. Without this declaration replay seeks from the beginning."
271
+ },
272
+ "id": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "description": "Script id, unique within the scene."
276
+ },
277
+ "code": {
278
+ "type": "string",
279
+ "minLength": 1,
280
+ "description": "Inline JavaScript source (exactly one of code or path)."
281
+ },
282
+ "path": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "allOf": [
286
+ {
287
+ "pattern": "^(?![A-Za-z]:|[/\\\\])(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$"
288
+ },
289
+ {
290
+ "pattern": "\\.(?:js|ts)$"
291
+ }
292
+ ],
293
+ "description": "Scene-relative path to a script file, .js or .ts (exactly one of code or path). A .ts file has its types erased when the scene is loaded."
294
+ },
295
+ "config": {
296
+ "default": {},
297
+ "type": "object",
298
+ "propertyNames": {
299
+ "type": "string"
300
+ },
301
+ "additionalProperties": {
302
+ "$ref": "#/$defs/__schema0"
303
+ },
304
+ "description": "Frozen JSON config exposed to the script as `config`."
305
+ }
306
+ },
307
+ "required": [
308
+ "id"
309
+ ],
310
+ "additionalProperties": false
311
+ },
312
+ "description": "Deterministic scene scripts (inline code or file refs). Evaluated with the authority of the host process, so treat a manifest like source code."
313
+ },
314
+ "commands": {
315
+ "default": {},
316
+ "type": "object",
317
+ "propertyNames": {
318
+ "type": "string",
319
+ "minLength": 1
320
+ },
321
+ "additionalProperties": {
322
+ "type": "object",
323
+ "properties": {
324
+ "doc": {
325
+ "type": "string",
326
+ "description": "Human/agent description of what the command does."
327
+ },
328
+ "payload": {
329
+ "type": "object",
330
+ "propertyNames": {
331
+ "type": "string"
332
+ },
333
+ "additionalProperties": {
334
+ "$ref": "#/$defs/__schema0"
335
+ },
336
+ "description": "JSON Schema (object/array/number/integer/string/boolean subset) the payload must satisfy; omitted = any JSON."
337
+ }
338
+ },
339
+ "additionalProperties": false
340
+ },
341
+ "description": "Command types this scene accepts, with optional doc and payload schema (scripts attach handlers via molen.onCommand)."
342
+ },
343
+ "components": {
344
+ "default": {},
345
+ "type": "object",
346
+ "propertyNames": {
347
+ "type": "string",
348
+ "pattern": "^[a-zA-Z]\\w*$"
349
+ },
350
+ "additionalProperties": {
351
+ "type": "object",
352
+ "properties": {
353
+ "description": {
354
+ "type": "string",
355
+ "minLength": 1,
356
+ "description": "One-line human/agent description of the component."
357
+ },
358
+ "examples": {
359
+ "minItems": 1,
360
+ "type": "array",
361
+ "items": {
362
+ "$ref": "#/$defs/__schema0"
363
+ },
364
+ "description": "At least one valid example of the component data (feeds hints and docs)."
365
+ },
366
+ "schema": {
367
+ "type": "object",
368
+ "propertyNames": {
369
+ "type": "string"
370
+ },
371
+ "additionalProperties": {
372
+ "$ref": "#/$defs/__schema0"
373
+ },
374
+ "description": "JSON Schema (object/array/number/integer/string/boolean subset) for the component data; omitted = any object."
375
+ }
376
+ },
377
+ "required": [
378
+ "description",
379
+ "examples"
380
+ ],
381
+ "additionalProperties": false
382
+ },
383
+ "description": "Custom component vocabulary this scene introduces (description + examples, optional schema); known to validation and docs."
384
+ },
385
+ "camera": {
386
+ "oneOf": [
387
+ {
388
+ "type": "object",
389
+ "properties": {
390
+ "mode": {
391
+ "type": "string",
392
+ "const": "follow",
393
+ "description": "Perspective camera tracking an interpolated entity transform; works in live play and capture."
394
+ },
395
+ "entity": {
396
+ "type": "string",
397
+ "minLength": 1,
398
+ "description": "Entity to follow (need not have a renderable)."
399
+ },
400
+ "offset": {
401
+ "minItems": 3,
402
+ "maxItems": 3,
403
+ "type": "array",
404
+ "items": {
405
+ "type": "number"
406
+ },
407
+ "description": "Camera offset [x,y,z] in meters from the target."
408
+ },
409
+ "lookOffset": {
410
+ "minItems": 3,
411
+ "maxItems": 3,
412
+ "type": "array",
413
+ "items": {
414
+ "type": "number"
415
+ },
416
+ "description": "Look-at offset from the target; must differ from offset."
417
+ },
418
+ "space": {
419
+ "type": "string",
420
+ "enum": [
421
+ "world",
422
+ "local"
423
+ ],
424
+ "description": "World-axis offsets (default), or offsets rotated by the target quaternion (first person/chase)."
425
+ },
426
+ "fov": {
427
+ "type": "number",
428
+ "minimum": 1,
429
+ "maximum": 179,
430
+ "description": "Vertical field of view in degrees."
431
+ }
432
+ },
433
+ "required": [
434
+ "mode",
435
+ "entity",
436
+ "offset",
437
+ "lookOffset"
438
+ ],
439
+ "additionalProperties": false
440
+ },
441
+ {
442
+ "type": "object",
443
+ "properties": {
444
+ "mode": {
445
+ "type": "string",
446
+ "const": "fixed",
447
+ "description": "Static perspective camera."
448
+ },
449
+ "position": {
450
+ "minItems": 3,
451
+ "maxItems": 3,
452
+ "type": "array",
453
+ "items": {
454
+ "type": "number"
455
+ },
456
+ "description": "Camera position [x, y, z] in meters (Y-up)."
457
+ },
458
+ "lookAt": {
459
+ "minItems": 3,
460
+ "maxItems": 3,
461
+ "type": "array",
462
+ "items": {
463
+ "type": "number"
464
+ },
465
+ "description": "Point [x, y, z] in meters the camera looks at (default: the origin)."
466
+ },
467
+ "fov": {
468
+ "type": "number",
469
+ "minimum": 1,
470
+ "maximum": 179,
471
+ "description": "Vertical field of view in degrees."
472
+ }
473
+ },
474
+ "required": [
475
+ "mode",
476
+ "position"
477
+ ],
478
+ "additionalProperties": false
479
+ },
480
+ {
481
+ "type": "object",
482
+ "properties": {
483
+ "mode": {
484
+ "type": "string",
485
+ "const": "free-fly",
486
+ "description": "Perspective camera the user flies with keyboard/mouse."
487
+ },
488
+ "position": {
489
+ "minItems": 3,
490
+ "maxItems": 3,
491
+ "type": "array",
492
+ "items": {
493
+ "type": "number"
494
+ },
495
+ "description": "Camera position [x, y, z] in meters (Y-up)."
496
+ },
497
+ "lookAt": {
498
+ "minItems": 3,
499
+ "maxItems": 3,
500
+ "type": "array",
501
+ "items": {
502
+ "type": "number"
503
+ },
504
+ "description": "Point [x, y, z] in meters the camera looks at (default: the origin)."
505
+ },
506
+ "fov": {
507
+ "type": "number",
508
+ "minimum": 1,
509
+ "maximum": 179,
510
+ "description": "Vertical field of view in degrees."
511
+ },
512
+ "moveSpeed": {
513
+ "default": 10,
514
+ "type": "number",
515
+ "exclusiveMinimum": 0,
516
+ "description": "Base fly speed in meters per second (default 10)."
517
+ },
518
+ "boost": {
519
+ "default": 4,
520
+ "type": "number",
521
+ "exclusiveMinimum": 0,
522
+ "description": "Speed multiplier while the boost key is held (default 4)."
523
+ }
524
+ },
525
+ "required": [
526
+ "mode",
527
+ "position"
528
+ ],
529
+ "additionalProperties": false
530
+ },
531
+ {
532
+ "type": "object",
533
+ "properties": {
534
+ "mode": {
535
+ "type": "string",
536
+ "const": "top-down-ortho",
537
+ "description": "Orthographic camera looking straight down (-Y); screen-up is -z (north), screen-down is +z (south)."
538
+ },
539
+ "center": {
540
+ "minItems": 2,
541
+ "maxItems": 2,
542
+ "type": "array",
543
+ "items": {
544
+ "type": "number"
545
+ },
546
+ "description": "World [x, z] in meters the view centers on."
547
+ },
548
+ "viewHeight": {
549
+ "type": "number",
550
+ "exclusiveMinimum": 0,
551
+ "description": "World-space height in meters of the visible area; width follows the viewport aspect."
552
+ },
553
+ "cameraHeight": {
554
+ "type": "number",
555
+ "exclusiveMinimum": 0,
556
+ "description": "Camera height in meters above the y = 0 plane (default 200)."
557
+ }
558
+ },
559
+ "required": [
560
+ "mode",
561
+ "center",
562
+ "viewHeight"
563
+ ],
564
+ "additionalProperties": false
565
+ }
566
+ ],
567
+ "description": "Initial client camera."
568
+ },
569
+ "input": {
570
+ "type": "object",
571
+ "properties": {
572
+ "bindings": {
573
+ "type": "object",
574
+ "propertyNames": {
575
+ "type": "string",
576
+ "minLength": 1
577
+ },
578
+ "additionalProperties": {
579
+ "type": "string",
580
+ "minLength": 1
581
+ },
582
+ "description": "KeyboardEvent.code (e.g. 'KeyW') to input action name."
583
+ },
584
+ "axes": {
585
+ "type": "array",
586
+ "items": {
587
+ "type": "object",
588
+ "properties": {
589
+ "action": {
590
+ "type": "string",
591
+ "minLength": 1,
592
+ "description": "Named action receiving the numeric axis value."
593
+ },
594
+ "axis": {
595
+ "type": "integer",
596
+ "minimum": 0,
597
+ "maximum": 9007199254740991,
598
+ "description": "Raw zero-based axis index; no standard mapping required."
599
+ },
600
+ "device": {
601
+ "type": "object",
602
+ "properties": {
603
+ "id": {
604
+ "type": "string",
605
+ "minLength": 1,
606
+ "description": "Exact browser Gamepad.id; omit to match any ID."
607
+ },
608
+ "index": {
609
+ "type": "integer",
610
+ "minimum": 0,
611
+ "maximum": 9007199254740991,
612
+ "description": "Browser Gamepad.index; may change on reconnect."
613
+ }
614
+ },
615
+ "additionalProperties": false
616
+ },
617
+ "mode": {
618
+ "type": "string",
619
+ "enum": [
620
+ "signed",
621
+ "positive",
622
+ "negative",
623
+ "unit"
624
+ ],
625
+ "description": "signed -1..1 (default), positive/negative half axis 0..1, or unit full travel 0..1."
626
+ },
627
+ "invert": {
628
+ "type": "boolean",
629
+ "description": "Reverse calibrated travel before applying the mode."
630
+ },
631
+ "deadZone": {
632
+ "type": "number",
633
+ "minimum": 0,
634
+ "exclusiveMaximum": 1,
635
+ "description": "Rescaled dead zone; default 0.12 (unit: 0)."
636
+ },
637
+ "curve": {
638
+ "type": "number",
639
+ "exclusiveMinimum": 0,
640
+ "description": "Response exponent; default 1 (linear)."
641
+ },
642
+ "min": {
643
+ "type": "number",
644
+ "description": "Raw minimum; default -1. Must be below center."
645
+ },
646
+ "center": {
647
+ "type": "number",
648
+ "description": "Raw center; default 0. Must lie between min and max."
649
+ },
650
+ "max": {
651
+ "type": "number",
652
+ "description": "Raw maximum; default 1. Must be above center."
653
+ }
654
+ },
655
+ "required": [
656
+ "action",
657
+ "axis"
658
+ ],
659
+ "additionalProperties": false
660
+ },
661
+ "description": "Mappings for arbitrary browser-exposed joystick axes."
662
+ },
663
+ "buttons": {
664
+ "type": "array",
665
+ "items": {
666
+ "type": "object",
667
+ "properties": {
668
+ "action": {
669
+ "type": "string",
670
+ "minLength": 1,
671
+ "description": "Named action receiving button presses and releases."
672
+ },
673
+ "button": {
674
+ "type": "integer",
675
+ "minimum": 0,
676
+ "maximum": 9007199254740991,
677
+ "description": "Raw zero-based button index."
678
+ },
679
+ "device": {
680
+ "type": "object",
681
+ "properties": {
682
+ "id": {
683
+ "type": "string",
684
+ "minLength": 1,
685
+ "description": "Exact browser Gamepad.id; omit to match any ID."
686
+ },
687
+ "index": {
688
+ "type": "integer",
689
+ "minimum": 0,
690
+ "maximum": 9007199254740991,
691
+ "description": "Browser Gamepad.index; may change on reconnect."
692
+ }
693
+ },
694
+ "additionalProperties": false
695
+ },
696
+ "threshold": {
697
+ "type": "number",
698
+ "exclusiveMinimum": 0,
699
+ "maximum": 1,
700
+ "description": "Analog button press threshold; default 0.5."
701
+ }
702
+ },
703
+ "required": [
704
+ "action",
705
+ "button"
706
+ ],
707
+ "additionalProperties": false
708
+ },
709
+ "description": "Mappings for arbitrary browser-exposed controller buttons."
710
+ },
711
+ "profiles": {
712
+ "type": "object",
713
+ "propertyNames": {
714
+ "type": "string",
715
+ "minLength": 1
716
+ },
717
+ "additionalProperties": {
718
+ "type": "object",
719
+ "properties": {
720
+ "bindings": {
721
+ "type": "object",
722
+ "propertyNames": {
723
+ "type": "string",
724
+ "minLength": 1
725
+ },
726
+ "additionalProperties": {
727
+ "type": "string",
728
+ "minLength": 1
729
+ },
730
+ "description": "KeyboardEvent.code or Mouse<button> to action name."
731
+ },
732
+ "axes": {
733
+ "type": "array",
734
+ "items": {
735
+ "type": "object",
736
+ "properties": {
737
+ "action": {
738
+ "type": "string",
739
+ "minLength": 1,
740
+ "description": "Named action receiving the numeric axis value."
741
+ },
742
+ "axis": {
743
+ "type": "integer",
744
+ "minimum": 0,
745
+ "maximum": 9007199254740991,
746
+ "description": "Raw zero-based axis index; no standard mapping required."
747
+ },
748
+ "device": {
749
+ "type": "object",
750
+ "properties": {
751
+ "id": {
752
+ "type": "string",
753
+ "minLength": 1,
754
+ "description": "Exact browser Gamepad.id; omit to match any ID."
755
+ },
756
+ "index": {
757
+ "type": "integer",
758
+ "minimum": 0,
759
+ "maximum": 9007199254740991,
760
+ "description": "Browser Gamepad.index; may change on reconnect."
761
+ }
762
+ },
763
+ "additionalProperties": false
764
+ },
765
+ "mode": {
766
+ "type": "string",
767
+ "enum": [
768
+ "signed",
769
+ "positive",
770
+ "negative",
771
+ "unit"
772
+ ],
773
+ "description": "signed -1..1 (default), positive/negative half axis 0..1, or unit full travel 0..1."
774
+ },
775
+ "invert": {
776
+ "type": "boolean",
777
+ "description": "Reverse calibrated travel before applying the mode."
778
+ },
779
+ "deadZone": {
780
+ "type": "number",
781
+ "minimum": 0,
782
+ "exclusiveMaximum": 1,
783
+ "description": "Rescaled dead zone; default 0.12 (unit: 0)."
784
+ },
785
+ "curve": {
786
+ "type": "number",
787
+ "exclusiveMinimum": 0,
788
+ "description": "Response exponent; default 1 (linear)."
789
+ },
790
+ "min": {
791
+ "type": "number",
792
+ "description": "Raw minimum; default -1. Must be below center."
793
+ },
794
+ "center": {
795
+ "type": "number",
796
+ "description": "Raw center; default 0. Must lie between min and max."
797
+ },
798
+ "max": {
799
+ "type": "number",
800
+ "description": "Raw maximum; default 1. Must be above center."
801
+ }
802
+ },
803
+ "required": [
804
+ "action",
805
+ "axis"
806
+ ],
807
+ "additionalProperties": false
808
+ },
809
+ "description": "Mappings for arbitrary browser-exposed joystick axes."
810
+ },
811
+ "buttons": {
812
+ "type": "array",
813
+ "items": {
814
+ "type": "object",
815
+ "properties": {
816
+ "action": {
817
+ "type": "string",
818
+ "minLength": 1,
819
+ "description": "Named action receiving button presses and releases."
820
+ },
821
+ "button": {
822
+ "type": "integer",
823
+ "minimum": 0,
824
+ "maximum": 9007199254740991,
825
+ "description": "Raw zero-based button index."
826
+ },
827
+ "device": {
828
+ "type": "object",
829
+ "properties": {
830
+ "id": {
831
+ "type": "string",
832
+ "minLength": 1,
833
+ "description": "Exact browser Gamepad.id; omit to match any ID."
834
+ },
835
+ "index": {
836
+ "type": "integer",
837
+ "minimum": 0,
838
+ "maximum": 9007199254740991,
839
+ "description": "Browser Gamepad.index; may change on reconnect."
840
+ }
841
+ },
842
+ "additionalProperties": false
843
+ },
844
+ "threshold": {
845
+ "type": "number",
846
+ "exclusiveMinimum": 0,
847
+ "maximum": 1,
848
+ "description": "Analog button press threshold; default 0.5."
849
+ }
850
+ },
851
+ "required": [
852
+ "action",
853
+ "button"
854
+ ],
855
+ "additionalProperties": false
856
+ },
857
+ "description": "Mappings for arbitrary browser-exposed controller buttons."
858
+ }
859
+ },
860
+ "required": [
861
+ "bindings"
862
+ ],
863
+ "additionalProperties": false
864
+ },
865
+ "description": "Named complete binding sets for walking, flying, driving, or other use cases."
866
+ },
867
+ "profile": {
868
+ "type": "string",
869
+ "minLength": 1,
870
+ "description": "Initial profile name; absent uses the root bindings."
871
+ },
872
+ "emit": {
873
+ "default": [],
874
+ "type": "array",
875
+ "items": {
876
+ "oneOf": [
877
+ {
878
+ "type": "object",
879
+ "properties": {
880
+ "kind": {
881
+ "type": "string",
882
+ "const": "axis",
883
+ "description": "Emit a numeric action value when it changes."
884
+ },
885
+ "action": {
886
+ "type": "string",
887
+ "minLength": 1,
888
+ "description": "Input action name produced by keyboard, button, or axis bindings whose numeric value drives the axis."
889
+ },
890
+ "negative": {
891
+ "type": "string",
892
+ "minLength": 1,
893
+ "description": "Input action name produced by keyboard, button, or axis bindings to subtract from the value (optional keyboard opposite)."
894
+ },
895
+ "command": {
896
+ "type": "string",
897
+ "minLength": 1,
898
+ "description": "Command type to emit; must be declared under the scene `commands`."
899
+ },
900
+ "field": {
901
+ "default": "value",
902
+ "type": "string",
903
+ "minLength": 1,
904
+ "description": "Payload field receiving the number (default 'value')."
905
+ }
906
+ },
907
+ "required": [
908
+ "kind",
909
+ "action",
910
+ "command"
911
+ ],
912
+ "additionalProperties": false
913
+ },
914
+ {
915
+ "type": "object",
916
+ "properties": {
917
+ "kind": {
918
+ "type": "string",
919
+ "const": "press",
920
+ "description": "Emit once when the action becomes active."
921
+ },
922
+ "action": {
923
+ "type": "string",
924
+ "minLength": 1,
925
+ "description": "Input action name produced by keyboard, button, or axis bindings that triggers the command."
926
+ },
927
+ "command": {
928
+ "type": "string",
929
+ "minLength": 1,
930
+ "description": "Command type to emit; must be declared under the scene `commands`."
931
+ },
932
+ "payload": {
933
+ "default": {},
934
+ "type": "object",
935
+ "propertyNames": {
936
+ "type": "string"
937
+ },
938
+ "additionalProperties": {
939
+ "$ref": "#/$defs/__schema0"
940
+ },
941
+ "description": "Fixed JSON payload sent with the command."
942
+ }
943
+ },
944
+ "required": [
945
+ "kind",
946
+ "action",
947
+ "command"
948
+ ],
949
+ "additionalProperties": false
950
+ },
951
+ {
952
+ "type": "object",
953
+ "properties": {
954
+ "kind": {
955
+ "type": "string",
956
+ "const": "release",
957
+ "description": "Emit once when the action becomes inactive."
958
+ },
959
+ "action": {
960
+ "type": "string",
961
+ "minLength": 1,
962
+ "description": "Input action name produced by keyboard, button, or axis bindings that triggers the command."
963
+ },
964
+ "command": {
965
+ "type": "string",
966
+ "minLength": 1,
967
+ "description": "Command type to emit; must be declared under the scene `commands`."
968
+ },
969
+ "payload": {
970
+ "default": {},
971
+ "type": "object",
972
+ "propertyNames": {
973
+ "type": "string"
974
+ },
975
+ "additionalProperties": {
976
+ "$ref": "#/$defs/__schema0"
977
+ },
978
+ "description": "Fixed JSON payload sent with the command."
979
+ }
980
+ },
981
+ "required": [
982
+ "kind",
983
+ "action",
984
+ "command"
985
+ ],
986
+ "additionalProperties": false
987
+ },
988
+ {
989
+ "type": "object",
990
+ "properties": {
991
+ "kind": {
992
+ "type": "string",
993
+ "const": "axis2d",
994
+ "description": "Emit the command whenever the [x, y] axis vector built from four actions changes."
995
+ },
996
+ "xNeg": {
997
+ "type": "string",
998
+ "minLength": 1,
999
+ "description": "Input action name produced by keyboard, button, or axis bindings that drives x toward -1 (west)."
1000
+ },
1001
+ "xPos": {
1002
+ "type": "string",
1003
+ "minLength": 1,
1004
+ "description": "Input action name produced by keyboard, button, or axis bindings that drives x toward +1 (east)."
1005
+ },
1006
+ "yNeg": {
1007
+ "type": "string",
1008
+ "minLength": 1,
1009
+ "description": "Input action name produced by keyboard, button, or axis bindings that drives y toward -1 (north / screen-up)."
1010
+ },
1011
+ "yPos": {
1012
+ "type": "string",
1013
+ "minLength": 1,
1014
+ "description": "Input action name produced by keyboard, button, or axis bindings that drives y toward +1 (south / screen-down, i.e. +z)."
1015
+ },
1016
+ "command": {
1017
+ "type": "string",
1018
+ "minLength": 1,
1019
+ "description": "Command type to emit; must be declared under the scene `commands`."
1020
+ },
1021
+ "field": {
1022
+ "default": "dir",
1023
+ "type": "string",
1024
+ "minLength": 1,
1025
+ "description": "Payload field that receives the [x, y] vector (default 'dir')."
1026
+ }
1027
+ },
1028
+ "required": [
1029
+ "kind",
1030
+ "xNeg",
1031
+ "xPos",
1032
+ "yNeg",
1033
+ "yPos",
1034
+ "command"
1035
+ ],
1036
+ "additionalProperties": false
1037
+ }
1038
+ ]
1039
+ },
1040
+ "description": "Rules that turn input actions into commands."
1041
+ }
1042
+ },
1043
+ "required": [
1044
+ "bindings"
1045
+ ],
1046
+ "additionalProperties": false,
1047
+ "description": "Keyboard bindings and the rules that turn them into commands."
1048
+ },
1049
+ "terrain": {
1050
+ "type": "object",
1051
+ "properties": {
1052
+ "descriptor": {
1053
+ "type": "string",
1054
+ "minLength": 1,
1055
+ "pattern": "^(?![A-Za-z]:|[/\\\\])(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
1056
+ "description": "Scene-relative path to the molen/terrain descriptor JSON."
1057
+ },
1058
+ "heightmap": {
1059
+ "type": "string",
1060
+ "minLength": 1,
1061
+ "pattern": "^(?![A-Za-z]:|[/\\\\])(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
1062
+ "description": "Scene-relative path to a PNG16 heightmap used for headless ground sampling / collision."
1063
+ }
1064
+ },
1065
+ "required": [
1066
+ "descriptor"
1067
+ ],
1068
+ "additionalProperties": false,
1069
+ "description": "Streamed heightmap terrain attached to the scene."
1070
+ },
1071
+ "physics": {
1072
+ "type": "object",
1073
+ "properties": {
1074
+ "engine": {
1075
+ "type": "string",
1076
+ "enum": [
1077
+ "none",
1078
+ "kinematics",
1079
+ "platformer",
1080
+ "rapier"
1081
+ ],
1082
+ "description": "Physics engine: none, kinematics (cross-platform deterministic 2.5D in the XZ plane), platformer (cross-platform deterministic XY swept boxes), or rapier (same-platform deterministic 3D)."
1083
+ },
1084
+ "gravity": {
1085
+ "minItems": 3,
1086
+ "maxItems": 3,
1087
+ "type": "array",
1088
+ "items": {
1089
+ "type": "number"
1090
+ },
1091
+ "description": "Gravity [x, y, z] in meters per second squared (rapier; default [0, -9.81, 0])."
1092
+ },
1093
+ "ground": {
1094
+ "type": "string",
1095
+ "enum": [
1096
+ "flat",
1097
+ "terrain"
1098
+ ],
1099
+ "description": "Ground for kinematic bodies: flat y = 0 (default) or the scene's terrain heightfield."
1100
+ },
1101
+ "character": {
1102
+ "type": "boolean",
1103
+ "description": "Install the kernel character controller (character + moveIntent components); not allowed with rapier."
1104
+ }
1105
+ },
1106
+ "required": [
1107
+ "engine"
1108
+ ],
1109
+ "additionalProperties": false,
1110
+ "description": "Physics engine selection and settings."
1111
+ }
1112
+ },
1113
+ "required": [
1114
+ "format",
1115
+ "name"
1116
+ ],
1117
+ "additionalProperties": false,
1118
+ "$defs": {
1119
+ "__schema0": {
1120
+ "anyOf": [
1121
+ {
1122
+ "type": "string"
1123
+ },
1124
+ {
1125
+ "type": "number"
1126
+ },
1127
+ {
1128
+ "type": "boolean"
1129
+ },
1130
+ {
1131
+ "type": "null"
1132
+ },
1133
+ {
1134
+ "type": "array",
1135
+ "items": {
1136
+ "$ref": "#/$defs/__schema0"
1137
+ }
1138
+ },
1139
+ {
1140
+ "type": "object",
1141
+ "propertyNames": {
1142
+ "type": "string"
1143
+ },
1144
+ "additionalProperties": {
1145
+ "$ref": "#/$defs/__schema0"
1146
+ }
1147
+ }
1148
+ ]
1149
+ }
1150
+ }
1151
+ }
1152
+ ```