@vgai/engine 0.3.0 → 0.4.0-canary.20260715.0

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 (559) hide show
  1. package/package.json +8 -2
  2. package/schemas/engine-api.json +124 -0
  3. package/schemas/engine-api.md +53 -0
  4. package/schemas/engine-capabilities.json +124 -0
  5. package/schemas/inputmap.schema.json +314 -0
  6. package/schemas/mat.schema.json +286 -0
  7. package/schemas/prefab.schema.json +10148 -0
  8. package/schemas/scn2d.schema.json +475 -0
  9. package/schemas/vgai-game.schema.json +383 -0
  10. package/schemas/vscn.schema.json +11007 -0
  11. package/src/adapter/{world-kind.ts → adapter-surface.ts} +6 -6
  12. package/src/adapter/authoring.ts +67 -0
  13. package/src/adapter/game-adapter.ts +8 -8
  14. package/src/adapter/host-context.ts +2 -4
  15. package/src/adapter/index.ts +3 -1
  16. package/src/adapter/system-adapter.ts +73 -0
  17. package/src/adapter/vgai-scene-game-adapter.ts +239 -180
  18. package/src/animation/xstate-animation-binding.ts +300 -262
  19. package/src/animation/xstate-animation-meta.ts +50 -13
  20. package/src/character/cloth-sim.ts +533 -0
  21. package/src/character/spring-chain.ts +307 -0
  22. package/src/core/game-loop.ts +41 -3
  23. package/src/core/seeded-random.ts +161 -0
  24. package/src/core/system-runner.ts +20 -3
  25. package/src/core/types.ts +37 -0
  26. package/src/data/data-asset.ts +1 -1
  27. package/src/dev/performance-profiler.ts +213 -0
  28. package/src/dev/webgl-gpu-timer.ts +53 -0
  29. package/src/ecs/component-manager.ts +45 -12
  30. package/src/ecs/game-component.ts +95 -11
  31. package/src/humanoid/bake.operation.ts +326 -0
  32. package/src/humanoid/body.ts +663 -0
  33. package/src/humanoid/clips.ts +149 -0
  34. package/src/humanoid/compose.ts +209 -0
  35. package/src/humanoid/generate.ts +189 -0
  36. package/src/humanoid/index.ts +36 -0
  37. package/src/humanoid/schema.ts +108 -0
  38. package/src/humanoid/skeleton.ts +345 -0
  39. package/src/index.ts +5 -5
  40. package/src/input/input-manager.ts +701 -22
  41. package/src/input/input-types.ts +5 -2
  42. package/src/manifest/index.ts +5 -5
  43. package/src/manifest/load.ts +125 -72
  44. package/src/manifest/schema.ts +362 -255
  45. package/src/react/game-state.tsx +135 -32
  46. package/src/react/root-adapter.tsx +49 -0
  47. package/src/react/unmanaged-root-detector.ts +66 -0
  48. package/src/react/use-data.ts +12 -2
  49. package/src/runtime/create-runtime.ts +100 -282
  50. package/src/runtime/debug-bridge.ts +483 -0
  51. package/src/runtime/debug-registry.ts +856 -0
  52. package/src/runtime/game.ts +342 -93
  53. package/src/runtime/gameplay-rng-trap.ts +134 -0
  54. package/src/runtime/input-router.ts +7 -7
  55. package/src/runtime/mount-game.ts +40 -38
  56. package/src/runtime/mount-manifest.ts +169 -37
  57. package/src/runtime/render-control.ts +13 -13
  58. package/src/runtime/render-seed.ts +1 -1
  59. package/src/runtime/state-bridge.ts +24 -10
  60. package/src/runtime/types.ts +110 -28
  61. package/src/scene/asset-registry.ts +22 -0
  62. package/src/scene/component-registry.ts +14 -3
  63. package/src/scene/defaults.ts +1 -0
  64. package/src/scene/light-camera-factory.ts +11 -3
  65. package/src/scene/scene-apply.ts +55 -4
  66. package/src/scene/scene-loader.ts +10 -27
  67. package/src/scene/scene-types.ts +0 -1
  68. package/src/scene/schema/index.ts +0 -34
  69. package/src/scene/schema/light.ts +16 -1
  70. package/src/scene/schema/material.ts +96 -91
  71. package/src/scene/schema/scene-file.ts +1 -7
  72. package/src/scene/user-data.ts +14 -1
  73. package/src/setup/setup-renderer.ts +1 -1
  74. package/src/tools/define-tool.ts +50 -11
  75. package/src/world2d/authoring-2d.ts +17 -1
  76. package/src/world2d/collision-2d.ts +1 -1
  77. package/src/world2d/pixi-game-adapter.ts +19 -17
  78. package/src/world2d/scene2d-loader.ts +1 -0
  79. package/src/world2d/types.ts +8 -2
  80. package/dist/adapter/authoring.d.ts +0 -404
  81. package/dist/adapter/authoring.d.ts.map +0 -1
  82. package/dist/adapter/authoring.js +0 -22
  83. package/dist/adapter/colyseus-networking-adapter.d.ts +0 -43
  84. package/dist/adapter/colyseus-networking-adapter.d.ts.map +0 -1
  85. package/dist/adapter/colyseus-networking-adapter.js +0 -38
  86. package/dist/adapter/first-party-systems.d.ts +0 -38
  87. package/dist/adapter/first-party-systems.d.ts.map +0 -1
  88. package/dist/adapter/first-party-systems.js +0 -77
  89. package/dist/adapter/game-adapter.d.ts +0 -133
  90. package/dist/adapter/game-adapter.d.ts.map +0 -1
  91. package/dist/adapter/game-adapter.js +0 -10
  92. package/dist/adapter/host-context.d.ts +0 -73
  93. package/dist/adapter/host-context.d.ts.map +0 -1
  94. package/dist/adapter/host-context.js +0 -16
  95. package/dist/adapter/index.d.ts +0 -22
  96. package/dist/adapter/index.d.ts.map +0 -1
  97. package/dist/adapter/index.js +0 -15
  98. package/dist/adapter/ingest/game-contract.d.ts +0 -53
  99. package/dist/adapter/ingest/game-contract.d.ts.map +0 -1
  100. package/dist/adapter/ingest/game-contract.js +0 -30
  101. package/dist/adapter/ingest/overlay-applier.d.ts +0 -118
  102. package/dist/adapter/ingest/overlay-applier.d.ts.map +0 -1
  103. package/dist/adapter/ingest/overlay-applier.js +0 -132
  104. package/dist/adapter/ingest/overlay-apply.d.ts +0 -60
  105. package/dist/adapter/ingest/overlay-apply.d.ts.map +0 -1
  106. package/dist/adapter/ingest/overlay-apply.js +0 -101
  107. package/dist/adapter/ingest/overlay-file.d.ts +0 -79
  108. package/dist/adapter/ingest/overlay-file.d.ts.map +0 -1
  109. package/dist/adapter/ingest/overlay-file.js +0 -66
  110. package/dist/adapter/ingest/overlay-report.d.ts +0 -113
  111. package/dist/adapter/ingest/overlay-report.d.ts.map +0 -1
  112. package/dist/adapter/ingest/overlay-report.js +0 -103
  113. package/dist/adapter/ingest/scene-capture.d.ts +0 -97
  114. package/dist/adapter/ingest/scene-capture.d.ts.map +0 -1
  115. package/dist/adapter/ingest/scene-capture.js +0 -248
  116. package/dist/adapter/ingest/upstream-pin.d.ts +0 -47
  117. package/dist/adapter/ingest/upstream-pin.d.ts.map +0 -1
  118. package/dist/adapter/ingest/upstream-pin.js +0 -50
  119. package/dist/adapter/loop-gate-report.d.ts +0 -34
  120. package/dist/adapter/loop-gate-report.d.ts.map +0 -1
  121. package/dist/adapter/loop-gate-report.js +0 -37
  122. package/dist/adapter/rapier-physics-adapter.d.ts +0 -12
  123. package/dist/adapter/rapier-physics-adapter.d.ts.map +0 -1
  124. package/dist/adapter/rapier-physics-adapter.js +0 -46
  125. package/dist/adapter/system-adapter.d.ts +0 -133
  126. package/dist/adapter/system-adapter.d.ts.map +0 -1
  127. package/dist/adapter/system-adapter.js +0 -13
  128. package/dist/adapter/transform.d.ts +0 -18
  129. package/dist/adapter/transform.d.ts.map +0 -1
  130. package/dist/adapter/transform.js +0 -1
  131. package/dist/adapter/vgai-scene-game-adapter.d.ts +0 -116
  132. package/dist/adapter/vgai-scene-game-adapter.d.ts.map +0 -1
  133. package/dist/adapter/vgai-scene-game-adapter.js +0 -714
  134. package/dist/adapter/world-kind.d.ts +0 -30
  135. package/dist/adapter/world-kind.d.ts.map +0 -1
  136. package/dist/adapter/world-kind.js +0 -18
  137. package/dist/ai/navigation.d.ts +0 -64
  138. package/dist/ai/navigation.d.ts.map +0 -1
  139. package/dist/ai/navigation.js +0 -133
  140. package/dist/animation/anim-graph-types.d.ts +0 -25
  141. package/dist/animation/anim-graph-types.d.ts.map +0 -1
  142. package/dist/animation/anim-graph-types.js +0 -1
  143. package/dist/animation/animation-clock.d.ts +0 -213
  144. package/dist/animation/animation-clock.d.ts.map +0 -1
  145. package/dist/animation/animation-clock.js +0 -301
  146. package/dist/animation/blend-node.d.ts +0 -22
  147. package/dist/animation/blend-node.d.ts.map +0 -1
  148. package/dist/animation/blend-node.js +0 -97
  149. package/dist/animation/camera-ownership.d.ts +0 -250
  150. package/dist/animation/camera-ownership.d.ts.map +0 -1
  151. package/dist/animation/camera-ownership.js +0 -169
  152. package/dist/animation/cinematic-cues.d.ts +0 -200
  153. package/dist/animation/cinematic-cues.d.ts.map +0 -1
  154. package/dist/animation/cinematic-cues.js +0 -213
  155. package/dist/animation/clip-map.d.ts +0 -12
  156. package/dist/animation/clip-map.d.ts.map +0 -1
  157. package/dist/animation/clip-map.js +0 -37
  158. package/dist/animation/gsap-registration.d.ts +0 -119
  159. package/dist/animation/gsap-registration.d.ts.map +0 -1
  160. package/dist/animation/gsap-registration.js +0 -92
  161. package/dist/animation/theatre-clock-binding.d.ts +0 -89
  162. package/dist/animation/theatre-clock-binding.d.ts.map +0 -1
  163. package/dist/animation/theatre-clock-binding.js +0 -29
  164. package/dist/animation/theatre-director.d.ts +0 -242
  165. package/dist/animation/theatre-director.d.ts.map +0 -1
  166. package/dist/animation/theatre-director.js +0 -235
  167. package/dist/animation/theatre-object-binding.d.ts +0 -305
  168. package/dist/animation/theatre-object-binding.d.ts.map +0 -1
  169. package/dist/animation/theatre-object-binding.js +0 -351
  170. package/dist/animation/xstate-animation-binding.d.ts +0 -111
  171. package/dist/animation/xstate-animation-binding.d.ts.map +0 -1
  172. package/dist/animation/xstate-animation-binding.js +0 -307
  173. package/dist/animation/xstate-animation-meta.d.ts +0 -228
  174. package/dist/animation/xstate-animation-meta.d.ts.map +0 -1
  175. package/dist/animation/xstate-animation-meta.js +0 -221
  176. package/dist/assets.d.ts +0 -26
  177. package/dist/assets.d.ts.map +0 -1
  178. package/dist/assets.js +0 -55
  179. package/dist/audio/index.d.ts +0 -4
  180. package/dist/audio/index.d.ts.map +0 -1
  181. package/dist/audio/index.js +0 -24
  182. package/dist/audio/tone-clock-binding.d.ts +0 -75
  183. package/dist/audio/tone-clock-binding.d.ts.map +0 -1
  184. package/dist/audio/tone-clock-binding.js +0 -29
  185. package/dist/audio/tone-context.d.ts +0 -114
  186. package/dist/audio/tone-context.d.ts.map +0 -1
  187. package/dist/audio/tone-context.js +0 -39
  188. package/dist/audio/tone-offline-render.d.ts +0 -90
  189. package/dist/audio/tone-offline-render.d.ts.map +0 -1
  190. package/dist/audio/tone-offline-render.js +0 -56
  191. package/dist/audio/wav-encode.d.ts +0 -38
  192. package/dist/audio/wav-encode.d.ts.map +0 -1
  193. package/dist/audio/wav-encode.js +0 -97
  194. package/dist/core/game-loop.d.ts +0 -21
  195. package/dist/core/game-loop.d.ts.map +0 -1
  196. package/dist/core/game-loop.js +0 -130
  197. package/dist/core/system-runner.d.ts +0 -120
  198. package/dist/core/system-runner.d.ts.map +0 -1
  199. package/dist/core/system-runner.js +0 -286
  200. package/dist/core/types.d.ts +0 -58
  201. package/dist/core/types.d.ts.map +0 -1
  202. package/dist/core/types.js +0 -25
  203. package/dist/data/data-asset.d.ts +0 -101
  204. package/dist/data/data-asset.d.ts.map +0 -1
  205. package/dist/data/data-asset.js +0 -122
  206. package/dist/data/data-check-core.d.ts +0 -110
  207. package/dist/data/data-check-core.d.ts.map +0 -1
  208. package/dist/data/data-check-core.js +0 -178
  209. package/dist/data/data-ref.d.ts +0 -79
  210. package/dist/data/data-ref.d.ts.map +0 -1
  211. package/dist/data/data-ref.js +0 -130
  212. package/dist/data/vite-plugin-data.d.ts +0 -79
  213. package/dist/data/vite-plugin-data.d.ts.map +0 -1
  214. package/dist/data/vite-plugin-data.js +0 -217
  215. package/dist/dev/console-bridge.d.ts +0 -22
  216. package/dist/dev/console-bridge.d.ts.map +0 -1
  217. package/dist/dev/console-bridge.js +0 -71
  218. package/dist/dev/debug-draw.d.ts +0 -24
  219. package/dist/dev/debug-draw.d.ts.map +0 -1
  220. package/dist/dev/debug-draw.js +0 -73
  221. package/dist/dev/logger.d.ts +0 -30
  222. package/dist/dev/logger.d.ts.map +0 -1
  223. package/dist/dev/logger.js +0 -90
  224. package/dist/ecs/component-manager.d.ts +0 -189
  225. package/dist/ecs/component-manager.d.ts.map +0 -1
  226. package/dist/ecs/component-manager.js +0 -676
  227. package/dist/ecs/game-component.d.ts +0 -97
  228. package/dist/ecs/game-component.d.ts.map +0 -1
  229. package/dist/ecs/game-component.js +0 -80
  230. package/dist/ecs/hmr-swap-report.d.ts +0 -53
  231. package/dist/ecs/hmr-swap-report.d.ts.map +0 -1
  232. package/dist/ecs/hmr-swap-report.js +0 -55
  233. package/dist/index.d.ts +0 -37
  234. package/dist/index.d.ts.map +0 -1
  235. package/dist/index.js +0 -30
  236. package/dist/input/input-manager.d.ts +0 -596
  237. package/dist/input/input-manager.d.ts.map +0 -1
  238. package/dist/input/input-manager.js +0 -1564
  239. package/dist/input/input-types.d.ts +0 -171
  240. package/dist/input/input-types.d.ts.map +0 -1
  241. package/dist/input/input-types.js +0 -1
  242. package/dist/input/prompt-labels.d.ts +0 -21
  243. package/dist/input/prompt-labels.d.ts.map +0 -1
  244. package/dist/input/prompt-labels.js +0 -121
  245. package/dist/input/rebind-controller.d.ts +0 -59
  246. package/dist/input/rebind-controller.d.ts.map +0 -1
  247. package/dist/input/rebind-controller.js +0 -85
  248. package/dist/input/schema.d.ts +0 -16
  249. package/dist/input/schema.d.ts.map +0 -1
  250. package/dist/input/schema.js +0 -228
  251. package/dist/loader.d.ts +0 -43
  252. package/dist/loader.d.ts.map +0 -1
  253. package/dist/loader.js +0 -59
  254. package/dist/manifest/index.d.ts +0 -5
  255. package/dist/manifest/index.d.ts.map +0 -1
  256. package/dist/manifest/index.js +0 -8
  257. package/dist/manifest/load-file.d.ts +0 -4
  258. package/dist/manifest/load-file.d.ts.map +0 -1
  259. package/dist/manifest/load-file.js +0 -14
  260. package/dist/manifest/load.d.ts +0 -117
  261. package/dist/manifest/load.d.ts.map +0 -1
  262. package/dist/manifest/load.js +0 -255
  263. package/dist/manifest/schema.d.ts +0 -173
  264. package/dist/manifest/schema.d.ts.map +0 -1
  265. package/dist/manifest/schema.js +0 -302
  266. package/dist/physics/collision-system.d.ts +0 -41
  267. package/dist/physics/collision-system.d.ts.map +0 -1
  268. package/dist/physics/collision-system.js +0 -64
  269. package/dist/physics/physics-registry.d.ts +0 -45
  270. package/dist/physics/physics-registry.d.ts.map +0 -1
  271. package/dist/physics/physics-registry.js +0 -65
  272. package/dist/physics/transform-writer.d.ts +0 -16
  273. package/dist/physics/transform-writer.d.ts.map +0 -1
  274. package/dist/physics/transform-writer.js +0 -38
  275. package/dist/physics/trigger-dispatch.d.ts +0 -24
  276. package/dist/physics/trigger-dispatch.d.ts.map +0 -1
  277. package/dist/physics/trigger-dispatch.js +0 -80
  278. package/dist/react/game-state.d.ts +0 -105
  279. package/dist/react/game-state.d.ts.map +0 -1
  280. package/dist/react/game-state.js +0 -144
  281. package/dist/react/use-data.d.ts +0 -60
  282. package/dist/react/use-data.d.ts.map +0 -1
  283. package/dist/react/use-data.js +0 -96
  284. package/dist/react/use-selection.d.ts +0 -75
  285. package/dist/react/use-selection.d.ts.map +0 -1
  286. package/dist/react/use-selection.js +0 -90
  287. package/dist/render/auto-batcher.d.ts +0 -34
  288. package/dist/render/auto-batcher.d.ts.map +0 -1
  289. package/dist/render/auto-batcher.js +0 -140
  290. package/dist/render/render-batch-system.d.ts +0 -33
  291. package/dist/render/render-batch-system.d.ts.map +0 -1
  292. package/dist/render/render-batch-system.js +0 -230
  293. package/dist/render/render-features.d.ts +0 -47
  294. package/dist/render/render-features.d.ts.map +0 -1
  295. package/dist/render/render-features.js +0 -105
  296. package/dist/render/render-settings.d.ts +0 -36
  297. package/dist/render/render-settings.d.ts.map +0 -1
  298. package/dist/render/render-settings.js +0 -51
  299. package/dist/runtime/create-runtime.d.ts +0 -280
  300. package/dist/runtime/create-runtime.d.ts.map +0 -1
  301. package/dist/runtime/create-runtime.js +0 -795
  302. package/dist/runtime/frame-selector-cache.d.ts +0 -41
  303. package/dist/runtime/frame-selector-cache.d.ts.map +0 -1
  304. package/dist/runtime/frame-selector-cache.js +0 -65
  305. package/dist/runtime/game.d.ts +0 -433
  306. package/dist/runtime/game.d.ts.map +0 -1
  307. package/dist/runtime/game.js +0 -569
  308. package/dist/runtime/input-router.d.ts +0 -78
  309. package/dist/runtime/input-router.d.ts.map +0 -1
  310. package/dist/runtime/input-router.js +0 -171
  311. package/dist/runtime/mount-game.d.ts +0 -129
  312. package/dist/runtime/mount-game.d.ts.map +0 -1
  313. package/dist/runtime/mount-game.js +0 -152
  314. package/dist/runtime/mount-manifest.d.ts +0 -119
  315. package/dist/runtime/mount-manifest.d.ts.map +0 -1
  316. package/dist/runtime/mount-manifest.js +0 -204
  317. package/dist/runtime/render-audio-control.d.ts +0 -110
  318. package/dist/runtime/render-audio-control.d.ts.map +0 -1
  319. package/dist/runtime/render-audio-control.js +0 -111
  320. package/dist/runtime/render-control.d.ts +0 -291
  321. package/dist/runtime/render-control.d.ts.map +0 -1
  322. package/dist/runtime/render-control.js +0 -264
  323. package/dist/runtime/render-seed.d.ts +0 -57
  324. package/dist/runtime/render-seed.d.ts.map +0 -1
  325. package/dist/runtime/render-seed.js +0 -74
  326. package/dist/runtime/scene-ui-bridge.d.ts +0 -69
  327. package/dist/runtime/scene-ui-bridge.d.ts.map +0 -1
  328. package/dist/runtime/scene-ui-bridge.js +0 -23
  329. package/dist/runtime/scene-ui-data.d.ts +0 -13
  330. package/dist/runtime/scene-ui-data.d.ts.map +0 -1
  331. package/dist/runtime/scene-ui-data.js +0 -92
  332. package/dist/runtime/state-bridge.d.ts +0 -47
  333. package/dist/runtime/state-bridge.d.ts.map +0 -1
  334. package/dist/runtime/state-bridge.js +0 -53
  335. package/dist/runtime/types.d.ts +0 -179
  336. package/dist/runtime/types.d.ts.map +0 -1
  337. package/dist/runtime/types.js +0 -1
  338. package/dist/scene/asset-loaders.d.ts +0 -79
  339. package/dist/scene/asset-loaders.d.ts.map +0 -1
  340. package/dist/scene/asset-loaders.js +0 -141
  341. package/dist/scene/asset-paths.d.ts +0 -11
  342. package/dist/scene/asset-paths.d.ts.map +0 -1
  343. package/dist/scene/asset-paths.js +0 -108
  344. package/dist/scene/asset-ref-check.d.ts +0 -88
  345. package/dist/scene/asset-ref-check.d.ts.map +0 -1
  346. package/dist/scene/asset-ref-check.js +0 -214
  347. package/dist/scene/asset-registry.d.ts +0 -30
  348. package/dist/scene/asset-registry.d.ts.map +0 -1
  349. package/dist/scene/asset-registry.js +0 -50
  350. package/dist/scene/collider-dimensions.d.ts +0 -63
  351. package/dist/scene/collider-dimensions.d.ts.map +0 -1
  352. package/dist/scene/collider-dimensions.js +0 -98
  353. package/dist/scene/component-registry.d.ts +0 -17
  354. package/dist/scene/component-registry.d.ts.map +0 -1
  355. package/dist/scene/component-registry.js +0 -28
  356. package/dist/scene/defaults.d.ts +0 -252
  357. package/dist/scene/defaults.d.ts.map +0 -1
  358. package/dist/scene/defaults.js +0 -151
  359. package/dist/scene/geometries/index.d.ts +0 -8
  360. package/dist/scene/geometries/index.d.ts.map +0 -1
  361. package/dist/scene/geometries/index.js +0 -7
  362. package/dist/scene/geometries/terrain.d.ts +0 -2
  363. package/dist/scene/geometries/terrain.d.ts.map +0 -1
  364. package/dist/scene/geometries/terrain.js +0 -37
  365. package/dist/scene/geometry-registry.d.ts +0 -24
  366. package/dist/scene/geometry-registry.d.ts.map +0 -1
  367. package/dist/scene/geometry-registry.js +0 -20
  368. package/dist/scene/instance-registry.d.ts +0 -36
  369. package/dist/scene/instance-registry.d.ts.map +0 -1
  370. package/dist/scene/instance-registry.js +0 -55
  371. package/dist/scene/instancers/grid.d.ts +0 -2
  372. package/dist/scene/instancers/grid.d.ts.map +0 -1
  373. package/dist/scene/instancers/grid.js +0 -36
  374. package/dist/scene/instancers/index.d.ts +0 -8
  375. package/dist/scene/instancers/index.d.ts.map +0 -1
  376. package/dist/scene/instancers/index.js +0 -7
  377. package/dist/scene/light-camera-factory.d.ts +0 -23
  378. package/dist/scene/light-camera-factory.d.ts.map +0 -1
  379. package/dist/scene/light-camera-factory.js +0 -68
  380. package/dist/scene/material-factory.d.ts +0 -17
  381. package/dist/scene/material-factory.d.ts.map +0 -1
  382. package/dist/scene/material-factory.js +0 -197
  383. package/dist/scene/material-registry.d.ts +0 -40
  384. package/dist/scene/material-registry.d.ts.map +0 -1
  385. package/dist/scene/material-registry.js +0 -44
  386. package/dist/scene/materials/index.d.ts +0 -8
  387. package/dist/scene/materials/index.d.ts.map +0 -1
  388. package/dist/scene/materials/index.js +0 -7
  389. package/dist/scene/materials/water.d.ts +0 -2
  390. package/dist/scene/materials/water.d.ts.map +0 -1
  391. package/dist/scene/materials/water.js +0 -54
  392. package/dist/scene/parse.d.ts +0 -23
  393. package/dist/scene/parse.d.ts.map +0 -1
  394. package/dist/scene/parse.js +0 -179
  395. package/dist/scene/particles-factory.d.ts +0 -33
  396. package/dist/scene/particles-factory.d.ts.map +0 -1
  397. package/dist/scene/particles-factory.js +0 -282
  398. package/dist/scene/scene-apply.d.ts +0 -109
  399. package/dist/scene/scene-apply.d.ts.map +0 -1
  400. package/dist/scene/scene-apply.js +0 -326
  401. package/dist/scene/scene-diff-schema.d.ts +0 -285
  402. package/dist/scene/scene-diff-schema.d.ts.map +0 -1
  403. package/dist/scene/scene-diff-schema.js +0 -92
  404. package/dist/scene/scene-diff-types.d.ts +0 -40
  405. package/dist/scene/scene-diff-types.d.ts.map +0 -1
  406. package/dist/scene/scene-diff-types.js +0 -14
  407. package/dist/scene/scene-loader.d.ts +0 -177
  408. package/dist/scene/scene-loader.d.ts.map +0 -1
  409. package/dist/scene/scene-loader.js +0 -1213
  410. package/dist/scene/scene-query.d.ts +0 -11
  411. package/dist/scene/scene-query.d.ts.map +0 -1
  412. package/dist/scene/scene-query.js +0 -63
  413. package/dist/scene/scene-types.d.ts +0 -10
  414. package/dist/scene/scene-types.d.ts.map +0 -1
  415. package/dist/scene/scene-types.js +0 -8
  416. package/dist/scene/scene-version.d.ts +0 -26
  417. package/dist/scene/scene-version.d.ts.map +0 -1
  418. package/dist/scene/scene-version.js +0 -34
  419. package/dist/scene/schema/animation.d.ts +0 -8
  420. package/dist/scene/schema/animation.d.ts.map +0 -1
  421. package/dist/scene/schema/animation.js +0 -42
  422. package/dist/scene/schema/audio.d.ts +0 -13
  423. package/dist/scene/schema/audio.d.ts.map +0 -1
  424. package/dist/scene/schema/audio.js +0 -22
  425. package/dist/scene/schema/camera.d.ts +0 -28
  426. package/dist/scene/schema/camera.d.ts.map +0 -1
  427. package/dist/scene/schema/camera.js +0 -17
  428. package/dist/scene/schema/collider.d.ts +0 -40
  429. package/dist/scene/schema/collider.d.ts.map +0 -1
  430. package/dist/scene/schema/collider.js +0 -55
  431. package/dist/scene/schema/entity-ref.d.ts +0 -31
  432. package/dist/scene/schema/entity-ref.d.ts.map +0 -1
  433. package/dist/scene/schema/entity-ref.js +0 -61
  434. package/dist/scene/schema/entity.d.ts +0 -1036
  435. package/dist/scene/schema/entity.d.ts.map +0 -1
  436. package/dist/scene/schema/entity.js +0 -153
  437. package/dist/scene/schema/environment.d.ts +0 -425
  438. package/dist/scene/schema/environment.d.ts.map +0 -1
  439. package/dist/scene/schema/environment.js +0 -357
  440. package/dist/scene/schema/index.d.ts +0 -39
  441. package/dist/scene/schema/index.d.ts.map +0 -1
  442. package/dist/scene/schema/index.js +0 -20
  443. package/dist/scene/schema/instances.d.ts +0 -14
  444. package/dist/scene/schema/instances.d.ts.map +0 -1
  445. package/dist/scene/schema/instances.js +0 -28
  446. package/dist/scene/schema/joint.d.ts +0 -23
  447. package/dist/scene/schema/joint.d.ts.map +0 -1
  448. package/dist/scene/schema/joint.js +0 -23
  449. package/dist/scene/schema/light.d.ts +0 -38
  450. package/dist/scene/schema/light.d.ts.map +0 -1
  451. package/dist/scene/schema/light.js +0 -26
  452. package/dist/scene/schema/material.d.ts +0 -199
  453. package/dist/scene/schema/material.d.ts.map +0 -1
  454. package/dist/scene/schema/material.js +0 -99
  455. package/dist/scene/schema/mesh.d.ts +0 -48
  456. package/dist/scene/schema/mesh.d.ts.map +0 -1
  457. package/dist/scene/schema/mesh.js +0 -82
  458. package/dist/scene/schema/particles.d.ts +0 -2178
  459. package/dist/scene/schema/particles.d.ts.map +0 -1
  460. package/dist/scene/schema/particles.js +0 -321
  461. package/dist/scene/schema/physics.d.ts +0 -56
  462. package/dist/scene/schema/physics.d.ts.map +0 -1
  463. package/dist/scene/schema/physics.js +0 -37
  464. package/dist/scene/schema/scene-file.d.ts +0 -304
  465. package/dist/scene/schema/scene-file.d.ts.map +0 -1
  466. package/dist/scene/schema/scene-file.js +0 -262
  467. package/dist/scene/schema/shadow.d.ts +0 -28
  468. package/dist/scene/schema/shadow.d.ts.map +0 -1
  469. package/dist/scene/schema/shadow.js +0 -20
  470. package/dist/scene/schema/spline.d.ts +0 -25
  471. package/dist/scene/schema/spline.d.ts.map +0 -1
  472. package/dist/scene/schema/spline.js +0 -15
  473. package/dist/scene/schema/tuples.d.ts +0 -12
  474. package/dist/scene/schema/tuples.d.ts.map +0 -1
  475. package/dist/scene/schema/tuples.js +0 -14
  476. package/dist/scene/schema/ui.d.ts +0 -880
  477. package/dist/scene/schema/ui.d.ts.map +0 -1
  478. package/dist/scene/schema/ui.js +0 -506
  479. package/dist/scene/user-data.d.ts +0 -171
  480. package/dist/scene/user-data.d.ts.map +0 -1
  481. package/dist/scene/user-data.js +0 -137
  482. package/dist/setup/setup-audio.d.ts +0 -20
  483. package/dist/setup/setup-audio.d.ts.map +0 -1
  484. package/dist/setup/setup-audio.js +0 -41
  485. package/dist/setup/setup-particles.d.ts +0 -17
  486. package/dist/setup/setup-particles.d.ts.map +0 -1
  487. package/dist/setup/setup-particles.js +0 -16
  488. package/dist/setup/setup-physics.d.ts +0 -25
  489. package/dist/setup/setup-physics.d.ts.map +0 -1
  490. package/dist/setup/setup-physics.js +0 -51
  491. package/dist/setup/setup-renderer.d.ts +0 -69
  492. package/dist/setup/setup-renderer.d.ts.map +0 -1
  493. package/dist/setup/setup-renderer.js +0 -363
  494. package/dist/tools/define-tool.d.ts +0 -105
  495. package/dist/tools/define-tool.d.ts.map +0 -1
  496. package/dist/tools/define-tool.js +0 -82
  497. package/dist/world2d/authoring-2d.d.ts +0 -76
  498. package/dist/world2d/authoring-2d.d.ts.map +0 -1
  499. package/dist/world2d/authoring-2d.js +0 -176
  500. package/dist/world2d/capture-to-scene2d.d.ts +0 -5
  501. package/dist/world2d/capture-to-scene2d.d.ts.map +0 -1
  502. package/dist/world2d/capture-to-scene2d.js +0 -49
  503. package/dist/world2d/collision-2d.d.ts +0 -52
  504. package/dist/world2d/collision-2d.d.ts.map +0 -1
  505. package/dist/world2d/collision-2d.js +0 -70
  506. package/dist/world2d/components-2d.d.ts +0 -47
  507. package/dist/world2d/components-2d.d.ts.map +0 -1
  508. package/dist/world2d/components-2d.js +0 -77
  509. package/dist/world2d/index.d.ts +0 -34
  510. package/dist/world2d/index.d.ts.map +0 -1
  511. package/dist/world2d/index.js +0 -32
  512. package/dist/world2d/ingest-iframe-2d.d.ts +0 -82
  513. package/dist/world2d/ingest-iframe-2d.d.ts.map +0 -1
  514. package/dist/world2d/ingest-iframe-2d.js +0 -166
  515. package/dist/world2d/ingest2d.d.ts +0 -97
  516. package/dist/world2d/ingest2d.d.ts.map +0 -1
  517. package/dist/world2d/ingest2d.js +0 -40
  518. package/dist/world2d/physics2d-registry.d.ts +0 -24
  519. package/dist/world2d/physics2d-registry.d.ts.map +0 -1
  520. package/dist/world2d/physics2d-registry.js +0 -38
  521. package/dist/world2d/pixi-game-adapter.d.ts +0 -107
  522. package/dist/world2d/pixi-game-adapter.d.ts.map +0 -1
  523. package/dist/world2d/pixi-game-adapter.js +0 -211
  524. package/dist/world2d/pixi-surface.d.ts +0 -39
  525. package/dist/world2d/pixi-surface.d.ts.map +0 -1
  526. package/dist/world2d/pixi-surface.js +0 -47
  527. package/dist/world2d/scene-capture-2d.d.ts +0 -43
  528. package/dist/world2d/scene-capture-2d.d.ts.map +0 -1
  529. package/dist/world2d/scene-capture-2d.js +0 -92
  530. package/dist/world2d/scene2d-loader.d.ts +0 -27
  531. package/dist/world2d/scene2d-loader.d.ts.map +0 -1
  532. package/dist/world2d/scene2d-loader.js +0 -274
  533. package/dist/world2d/schema/entity2d.d.ts +0 -102
  534. package/dist/world2d/schema/entity2d.d.ts.map +0 -1
  535. package/dist/world2d/schema/entity2d.js +0 -119
  536. package/dist/world2d/schema/physics2d.d.ts +0 -46
  537. package/dist/world2d/schema/physics2d.d.ts.map +0 -1
  538. package/dist/world2d/schema/physics2d.js +0 -45
  539. package/dist/world2d/schema/sprite.d.ts +0 -42
  540. package/dist/world2d/schema/sprite.d.ts.map +0 -1
  541. package/dist/world2d/schema/sprite.js +0 -63
  542. package/dist/world2d/schema/tilemap.d.ts +0 -15
  543. package/dist/world2d/schema/tilemap.d.ts.map +0 -1
  544. package/dist/world2d/schema/tilemap.js +0 -19
  545. package/dist/world2d/schema/tuples2d.d.ts +0 -20
  546. package/dist/world2d/schema/tuples2d.d.ts.map +0 -1
  547. package/dist/world2d/schema/tuples2d.js +0 -19
  548. package/dist/world2d/system-adapters-2d.d.ts +0 -16
  549. package/dist/world2d/system-adapters-2d.d.ts.map +0 -1
  550. package/dist/world2d/system-adapters-2d.js +0 -37
  551. package/dist/world2d/transform-writer-2d.d.ts +0 -16
  552. package/dist/world2d/transform-writer-2d.d.ts.map +0 -1
  553. package/dist/world2d/transform-writer-2d.js +0 -22
  554. package/dist/world2d/types.d.ts +0 -53
  555. package/dist/world2d/types.d.ts.map +0 -1
  556. package/dist/world2d/types.js +0 -1
  557. package/src/runtime/scene-ui-bridge.ts +0 -86
  558. package/src/runtime/scene-ui-data.ts +0 -119
  559. package/src/scene/schema/ui.ts +0 -602
@@ -1,404 +0,0 @@
1
- /**
2
- * AuthoringAdapter — the editor's authoring contract. The editor talks to THIS,
3
- * keyed by opaque string node ids, instead of to a concrete document format.
4
- *
5
- * `.vscn` / `SceneEntity` is the private model of ONE implementer
6
- * (`VgaiSceneAuthoringAdapter`); an ingested game's adapter implements the same
7
- * providers directly over its live `Object3D` tree. The editor sees only the
8
- * interface and the advertised `capabilities` — it never branches on which
9
- * implementer it is talking to.
10
- *
11
- * The interface lives in the engine (not the editor) so `MountedGame.authoring`
12
- * can reference it without the engine depending on the editor; implementers live
13
- * in `packages/editor/src/authoring/`.
14
- *
15
- * **Reserved inspector paths convention:** the property paths `name`, `visible`,
16
- * and `locked` are reserved — an adapter that supports them exposes them through
17
- * the ordinary `InspectorProvider.get`/`set` (no separate provider). The shell
18
- * renders the hierarchy panel's rename field, eye (visibility) toggle, and lock
19
- * toggle against these three paths, generically, for any adapter that reports
20
- * them via `InspectorProvider.properties`.
21
- */
22
- import type * as THREE from 'three';
23
- import type { SceneEntity } from '../scene/scene-types';
24
- import type { Transform, TransformOwner } from './transform';
25
- /** Booleans the editor UI gates affordances on (hide what an adapter can't do). */
26
- export interface AuthoringCapabilities {
27
- transform: boolean;
28
- material: boolean;
29
- inspectorFields: boolean;
30
- create: boolean;
31
- delete: boolean;
32
- reparent: boolean;
33
- persist: boolean;
34
- /**
35
- * UI layout authoring (anchors/offsets/pivot/flex) — distinct from 3D
36
- * `transform`. Optional so existing 3D adapters need not declare it. A UI
37
- * adapter sets this true and implements {@link LayoutProvider}; the 3D gizmo /
38
- * TransformProvider are NOT the UI manipulation path (spec K7).
39
- */
40
- layout?: boolean;
41
- }
42
- /** A node in the authoring hierarchy — format-neutral (not a `SceneEntity`). */
43
- export interface EditorNode {
44
- /** STABLE id — survives reload (see ingest structural-path ids). */
45
- id: string;
46
- label: string;
47
- kind: 'mesh' | 'light' | 'camera' | 'group' | 'object' | (string & {});
48
- parentId: string | null;
49
- childIds: string[];
50
- flags: {
51
- runtimeOnly?: boolean;
52
- locked?: boolean;
53
- transformOwner?: TransformOwner;
54
- /** D8 — member of a RootGroup, not the active one; children may be unloaded. */
55
- inactiveRoot?: boolean;
56
- };
57
- }
58
- export interface PropertyDescriptor {
59
- path: string;
60
- label: string;
61
- type: 'string' | 'number' | 'boolean' | 'vec3' | 'color' | 'enum' | 'asset' | 'json';
62
- readonly?: boolean;
63
- options?: unknown[];
64
- /**
65
- * Optional domain-shaped grouping (T3.4 slice 2, docs/ADAPTER-AUTHORING-
66
- * DESIGN.md §1.E): properties sharing the same `group` label render
67
- * together under a titled sub-section in the generic inspector, instead of
68
- * the flat property grid. Backward-compatible — omitted (or two
69
- * descriptors with different/no `group`) renders exactly as before this
70
- * field existed. This is the ONLY authoring-richness addition v1 makes;
71
- * there is no schema and no new PropertyDescriptor `type` — a custom
72
- * adapter reports its own domain concepts (health/score/an enum, …) through
73
- * the SAME provider, merely labeled into a named group.
74
- */
75
- group?: string;
76
- }
77
- export interface HierarchyProvider {
78
- roots(): EditorNode[];
79
- node(id: string): EditorNode | null;
80
- /** The live object for raycast/gizmo binding (null for non-object nodes). */
81
- object3D(id: string): THREE.Object3D | null;
82
- idForObject3D(o: THREE.Object3D): string | null;
83
- }
84
- export interface SelectionProvider {
85
- get(): string[];
86
- set(ids: string[]): void;
87
- }
88
- export interface TransformProvider {
89
- get(id: string): Transform;
90
- owner(id: string): TransformOwner;
91
- /** Pause whatever controller fights the gizmo (physics/script) for editing. */
92
- beginEdit(id: string): void;
93
- apply(id: string, t: Transform): void;
94
- endEdit(id: string): void;
95
- }
96
- export interface InspectorProvider {
97
- /** Schema-driven — NOT fixed to `SceneEntity`. */
98
- properties(id: string): PropertyDescriptor[];
99
- get(id: string, path: string): unknown;
100
- set(id: string, path: string, value: unknown): void;
101
- /**
102
- * Optional — REMOVE a property's authored override entirely (not "set to a
103
- * value"), letting whatever governs it in its absence take over. The one
104
- * concrete need today: a longhand CSS override (`style.borderTopLeftRadius`)
105
- * that a uniform edit of its shorthand (`style.borderRadius`) must clear so
106
- * the shorthand actually wins, instead of leaving a stale longhand that
107
- * silently overrides it on reload (spec 27 §5 C2, U2). Adapters with no
108
- * removable-override concept simply omit it — callers optional-chain.
109
- */
110
- remove?(id: string, path: string): void;
111
- }
112
- /**
113
- * UI layout authoring (K7) — anchors/offsets/pivot/flex props on a UI node. This
114
- * is the manipulation path for the DOM-overlay UI editor (handles, anchor presets,
115
- * flex inspector) and is deliberately SEPARATE from {@link TransformProvider}
116
- * (which is 3D position/quaternion/scale and cannot express flex/anchor layout).
117
- * The layout shape is format-neutral (a plain object the UI adapter understands).
118
- */
119
- export interface LayoutProvider {
120
- /** The node's current layout object (anchors/offsets/pivot/flex), or null. */
121
- get(id: string): Record<string, unknown> | null;
122
- /** Pause whatever drives layout (animation) before a gesture, if needed. */
123
- beginEdit(id: string): void;
124
- /** Apply a (partial) layout patch — merged onto the node's layout. */
125
- apply(id: string, layoutPatch: Record<string, unknown>): void;
126
- /** Commit the gesture (one undo step). */
127
- endEdit(id: string): void;
128
- }
129
- export interface StructureProvider {
130
- create(kind: string, parentId?: string): string;
131
- /**
132
- * Remove `id`. May optionally return an awaitable (`Promise<void>`) when the
133
- * underlying write is asynchronous (e.g. a react-world source-file edit) —
134
- * `deleteSelection` (`editor-hotkeys.ts`) awaits it per id so a same-file
135
- * multi-delete's writes land strictly one at a time (see that function's own
136
- * doc comment for why serialization + deletion order together are what make
137
- * a per-id loop sound for an adapter whose OID index isn't reindexed between
138
- * writes). An adapter with a synchronous/in-memory remove (e.g.
139
- * `UIAuthoringAdapter`) returns `void` — `await`ing it is a harmless no-op.
140
- */
141
- remove(id: string): void | Promise<void>;
142
- duplicate(id: string): string;
143
- reparent(id: string, newParentId: string | null): void;
144
- /** Reorder `id` to sit immediately before `beforeSiblingId` among its siblings
145
- * (`null` = move to the end). Absent ⇒ the shell has no sibling-reorder UI
146
- * for this adapter. */
147
- reorder?(id: string, beforeSiblingId: string | null): void;
148
- /**
149
- * The kinds `create` accepts for a given parent (`null` parentId = a new
150
- * root), each with a display label — drives the shell's creation palette.
151
- * Absent ⇒ the palette shows nothing for this adapter, even though `create`
152
- * itself may still work when called directly (e.g. programmatically, or by
153
- * an adapter-specific affordance outside the generic palette).
154
- */
155
- creatableKinds?(parentId: string | null): {
156
- kind: string;
157
- label: string;
158
- }[];
159
- /** D3 (spec 27 §6) — wrap `id` in a new container element (default tag
160
- * adapter-chosen, e.g. a `div`), re-parenting `id` as that container's sole
161
- * child. Absent ⇒ the shell's context menu shows no Wrap item for this
162
- * adapter. */
163
- wrap?(id: string, wrapperTag?: string): void;
164
- /** D3 (spec 27 §6) — replace `id` with its own children (the inverse of
165
- * `wrap`). Absent ⇒ the shell's context menu shows no Unwrap item for this
166
- * adapter. */
167
- unwrap?(id: string): void;
168
- /**
169
- * D4.R2 (spec27 §6 D4 reopen) — remove every id in `ids` as ONE undoable
170
- * op (a single Ctrl+Z restores the whole batch), instead of the caller
171
- * looping `remove(id)` per id (which — one `remove` call = one undo push
172
- * per adapter, by design — produces N separate undo entries: Ctrl+Z then
173
- * restores them one at a time, asymmetric with the first-party adapter's
174
- * own single batched multi-delete undo). Absent ⇒ the shell falls back to
175
- * the per-id `remove` loop (today's N-entry behavior, unchanged) — an
176
- * honest degrade, not a silent behavior change, for any adapter that
177
- * hasn't implemented batching. May optionally return an awaitable
178
- * (`Promise<void>`), same widening `remove` documents above and for the
179
- * same reason (delete-order-residual fix): `deleteSelection`
180
- * (`editor-hotkeys.ts`) awaits it so the caller can rely on the whole
181
- * batch's write having landed before it returns. A synchronous/in-memory
182
- * implementation (e.g. `UIAuthoringAdapter`'s) returns `void` — awaiting it
183
- * is a harmless no-op.
184
- */
185
- removeMany?(ids: readonly string[]): void | Promise<void>;
186
- }
187
- /**
188
- * PersistenceProvider — whether and where an adapter's edits persist (design:
189
- * `docs/PERSISTENCE-PROVIDER-DESIGN.md` §2). The ACTIVE adapter's provider is the
190
- * ONE place this is decided — the host (editor) never hard-codes a destination or
191
- * guards on session flags; it asks the provider.
192
- */
193
- export interface PersistenceProvider {
194
- isDirty(): boolean;
195
- /** Save to the adapter's OWN source of truth (.vscn / overlay file / …). */
196
- save(): Promise<void>;
197
- serialize(): unknown;
198
- /** Migration aid (first-party direction): pull a subtree into `.vscn` entities. */
199
- captureToVscn?(ids: string[]): SceneEntity[];
200
- /**
201
- * Human/agent-readable destination this provider persists to — e.g.
202
- * `"scenes/main.vscn.json"`, `".vgai/overlays/fps.json"`, or `"ephemeral
203
- * (discarded on stop)"`. Drives the save-status UI and makes routing
204
- * inspectable (design §2). Implementers whose destination can change during
205
- * the session (e.g. the first-party provider tracks the loaded `.vscn` path)
206
- * should expose this as a live getter rather than a value captured once.
207
- */
208
- readonly destination: string;
209
- /**
210
- * The reload contract (design §5): apply an external change to this
211
- * provider's persisted artifact into the RUNNING session (e.g. a file-watcher
212
- * update to the `.vscn` or the overlay). Absent ⇒ the host must remount to
213
- * pick up external changes (the honest floor). Implemented (T3.2 slice 3) by
214
- * the first-party provider (`applyExternalUpdate`) and the ingest overlay
215
- * provider (`applyOverlay`); absent (correctly) on the ephemeral provider.
216
- *
217
- * `rawContent`, when the host has it (the file-watcher SSE payload carries the
218
- * artifact's exact bytes), is an OPTIONAL second parameter enabling own-echo
219
- * detection — an event that is exactly what this provider itself last wrote is
220
- * its own save reflected back, and should be skipped even outside the normal
221
- * debounce window (see `EditorStore.applyExternalUpdate`'s doc comment). This
222
- * stays optional/provider-specific — only the first-party provider currently
223
- * uses it — so other implementers can ignore the parameter entirely.
224
- */
225
- applyExternal?(content: unknown, rawContent?: string): void;
226
- }
227
- /** D8 — mutually-exclusive root groups (radio roots): e.g. a "Scenes" group whose
228
- * members are the game's scene roots, only one of which is loaded/active at a
229
- * time (unlike ordinary sibling roots, which all coexist). */
230
- export interface RootGroup {
231
- id: string;
232
- label: string;
233
- memberRootIds: string[];
234
- activeRootId: string | null;
235
- }
236
- export interface RootGroupsProvider {
237
- groups(): RootGroup[];
238
- activate(groupId: string, rootId: string): Promise<void> | void;
239
- }
240
- /** D8 — data-file → root mapping ("opening a file" = activating its root). */
241
- export interface FileMapProvider {
242
- /** project-relative path → node id this adapter maps it to, else null. */
243
- rootForFile(path: string): string | null;
244
- }
245
- /** D12 — per-layer viewport picking. Coordinates are client (browser) px. */
246
- export interface PickProvider {
247
- pick(clientX: number, clientY: number): string | null;
248
- }
249
- /** D4 — storybook stories. */
250
- export interface StoryRef {
251
- id: string;
252
- label: string;
253
- }
254
- export interface StoriesProvider {
255
- storiesFor(nodeId: string): StoryRef[];
256
- active(nodeId: string): string | null;
257
- apply(nodeId: string, storyId: string | null): void;
258
- /** Render ONLY this node against the story (storybook canvas); null exits. */
259
- isolate?(nodeId: string | null, storyId?: string): void;
260
- }
261
- /** D6 (S-C) — GameComponent management; config editing stays on InspectorProvider. */
262
- export interface ComponentsProvider {
263
- available(nodeId: string): string[];
264
- list(nodeId: string): {
265
- type: string;
266
- }[];
267
- add(nodeId: string, type: string): void;
268
- remove(nodeId: string, type: string): void;
269
- /**
270
- * OPTIONAL read accessor (W3.1, docs/DATA-TOOLS-DESIGN.md §3.3): the raw
271
- * authored config record for one attached component (`list()` names the
272
- * types; this reads one type's per-entity data), or `null` when the entity
273
- * or component doesn't exist. Returns a shallow copy — callers must write
274
- * through `InspectorProvider.set('components.<Type>.<field>', v)`, never by
275
- * mutating this. Absent ⇒ config is not readable through this provider
276
- * (tools degrade to `config: null`).
277
- */
278
- config?(nodeId: string, type: string): Record<string, unknown> | null;
279
- }
280
- /** Asset drop (hierarchy + viewport). */
281
- export interface AssetDropProvider {
282
- accepts(nodeId: string, assetPath: string): boolean;
283
- drop(nodeId: string, assetPath: string): void;
284
- }
285
- /** Plain-object rect shape shared by {@link RectProvider} — the same fields a real
286
- * `DOMRect` carries (a subset, so a real `DOMRect` satisfies this structurally too).
287
- * See {@link RectProvider} for the coordinate space (host-relative, not viewport). */
288
- export interface DOMRectLike {
289
- x: number;
290
- y: number;
291
- width: number;
292
- height: number;
293
- }
294
- /** Per-node screen geometry — the KEYSTONE omission today (nothing produces rects the
295
- * ported inspect.ts math consumes). Coordinates are **host-relative** px: relative to
296
- * the adapter's own mounted world surface (its `position:absolute; inset:0` layer), the
297
- * same surface the A3 selection overlay is hosted over, so the overlay can draw against
298
- * these rects directly. (NOT viewport-client — the JSDoc formerly said so in error.) */
299
- export interface RectProvider {
300
- /** selectable node id → its current bounding rect, or null if unmounted/offscreen */
301
- rect(id: string): {
302
- x: number;
303
- y: number;
304
- width: number;
305
- height: number;
306
- } | null;
307
- /** rects of layout-relevant neighbours, for snap/measure/box-model overlays */
308
- contextRects?(id: string): {
309
- parent?: DOMRectLike;
310
- siblings?: DOMRectLike[];
311
- paddingBox?: DOMRectLike;
312
- };
313
- /**
314
- * D3 (spec 27 §6) — every currently-empty container this adapter's tree
315
- * contains right now: no visible children, no text, a collapsed dimension
316
- * (the `ui-source/inspect.ts:findEmptyContainers` math) — each with a
317
- * grown-to-tappable placeholder rect and a display name, driving the
318
- * overlay's dashed empty-container hint. Host-relative, same coordinate
319
- * space as {@link rect}. Absent ⇒ this adapter has no "empty container"
320
- * concept (e.g. an adapter with no structural containers at all) — no
321
- * hints are drawn for it.
322
- */
323
- emptyContainers?(): {
324
- id: string;
325
- rect: DOMRectLike;
326
- displayName: string;
327
- }[];
328
- }
329
- /** Spatial gesture → source/data write, for non-Object3D (DOM) nodes. Distinct from the
330
- * 3D TransformProvider. begin/apply/end bracket a single undo step; apply is live-preview. */
331
- export interface BoxEditProvider {
332
- begin(id: string): void;
333
- /** patch: any of x,y,width,height,marginTop… paddingLeft… — px deltas or absolutes */
334
- apply(id: string, patch: Record<string, number>): void;
335
- end(id: string): void;
336
- }
337
- /** Text-content editing — currently OFF-contract (the react adapter has an `editText(id)`
338
- * method, react-world-authoring-adapter.ts:728, not reachable via the contract). Bring it
339
- * on so the overlay's double-click-to-edit-text (D3) is contract-driven. */
340
- export interface TextProvider {
341
- /** the element's editable pure-text, or null if the body is dynamic/has child elements */
342
- get(id: string): string | null;
343
- set(id: string, text: string): void;
344
- }
345
- /**
346
- * D3 (spec 27 §6) — background-color sampling at a viewport point, for the
347
- * eyedropper's FALLBACK path (browsers with no native `EyeDropper` API). The
348
- * native API, where available, samples real rendered pixels itself and needs
349
- * none of this. Distinct from {@link PickProvider} (which returns a node id,
350
- * not a color) and from `InspectorProvider.get('style.backgroundColor')`
351
- * (which NORMALIZES to `#rrggbb` and so loses the "transparent" signal a
352
- * color CHAIN walk needs — see `ui-source/inspect.ts:effectiveColorFromChain`'s
353
- * doc comment: it walks raw, un-normalized CSS values looking for the first
354
- * non-transparent one).
355
- */
356
- export interface ColorSampleProvider {
357
- /** Raw (un-normalized) CSS `background-color` values, hit-element FIRST,
358
- * walking up its ancestor chain — the exact shape
359
- * `effectiveColorFromChain` consumes. `null` when nothing is hit at the
360
- * point. Client (viewport) px, matching {@link PickProvider}. */
361
- backgroundChainAt(clientX: number, clientY: number): string[] | null;
362
- }
363
- export interface AuthoringAdapter {
364
- readonly capabilities: AuthoringCapabilities;
365
- readonly hierarchy: HierarchyProvider;
366
- readonly selection?: SelectionProvider;
367
- readonly transforms?: TransformProvider;
368
- readonly inspector?: InspectorProvider;
369
- /** UI layout authoring path (K7) — present on UI adapters, absent on 3D adapters. */
370
- readonly layout?: LayoutProvider;
371
- readonly structure?: StructureProvider;
372
- readonly persistence?: PersistenceProvider;
373
- /** D8 — mutually-exclusive root groups (radio roots). Absent ⇒ no grouped roots. */
374
- readonly rootGroups?: RootGroupsProvider;
375
- /** D8 — data-file → root mapping. Absent ⇒ this adapter maps no files to roots. */
376
- readonly files?: FileMapProvider;
377
- /** D12 — per-layer viewport picking. Absent ⇒ this adapter is not pickable. */
378
- readonly pickable?: PickProvider;
379
- /** T0 (spec 27 §2) — per-node screen geometry for a DOM visual editor's overlay/
380
- * snap/measure math. Absent ⇒ this adapter produces no rects (no overlay). */
381
- readonly rects?: RectProvider;
382
- /** T0 (spec 27 §2) — spatial drag-resize/move → source/data write for non-Object3D
383
- * (DOM) nodes. Absent ⇒ no box-edit gesture for this adapter. */
384
- readonly boxEdit?: BoxEditProvider;
385
- /** T0 (spec 27 §2) — double-click-to-edit-text on the contract (wires the react
386
- * adapter's existing off-contract `editText`). Absent ⇒ no in-place text edit. */
387
- readonly text?: TextProvider;
388
- /** D3 (spec 27 §6) — eyedropper fallback color sampling. Absent ⇒ the
389
- * canvas eyedropper swatch has no non-native path for this adapter. */
390
- readonly colorSample?: ColorSampleProvider;
391
- /** D4 — storybook stories. Absent ⇒ no stories for any node in this adapter. */
392
- readonly stories?: StoriesProvider;
393
- /** D6 (S-C) — GameComponent management. Absent ⇒ no component authoring. */
394
- readonly components?: ComponentsProvider;
395
- /** Asset drop (hierarchy + viewport). Absent ⇒ this adapter accepts no drops. */
396
- readonly assetDrop?: AssetDropProvider;
397
- /** Undo/redo for this adapter's edits (first-party delegates to the store; an
398
- * ingest adapter keeps its own overlay-backed stack). Absent ⇒ host falls back. */
399
- undo?(): void;
400
- redo?(): void;
401
- /** Change notification → UI refresh. */
402
- subscribe?(listener: () => void): () => void;
403
- }
404
- //# sourceMappingURL=authoring.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../../src/adapter/authoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,WAAW,UAAU;IACzB,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACvE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EA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C,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;sEACkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACnC;uFACmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B;4EACwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAC3C,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IACzC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IACvC;wFACoF;IACpF,IAAI,CAAC,IAAI,IAAI,CAAC;IACd,IAAI,CAAC,IAAI,IAAI,CAAC;IACd,wCAAwC;IACxC,SAAS,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC9C"}
@@ -1,22 +0,0 @@
1
- /**
2
- * AuthoringAdapter — the editor's authoring contract. The editor talks to THIS,
3
- * keyed by opaque string node ids, instead of to a concrete document format.
4
- *
5
- * `.vscn` / `SceneEntity` is the private model of ONE implementer
6
- * (`VgaiSceneAuthoringAdapter`); an ingested game's adapter implements the same
7
- * providers directly over its live `Object3D` tree. The editor sees only the
8
- * interface and the advertised `capabilities` — it never branches on which
9
- * implementer it is talking to.
10
- *
11
- * The interface lives in the engine (not the editor) so `MountedGame.authoring`
12
- * can reference it without the engine depending on the editor; implementers live
13
- * in `packages/editor/src/authoring/`.
14
- *
15
- * **Reserved inspector paths convention:** the property paths `name`, `visible`,
16
- * and `locked` are reserved — an adapter that supports them exposes them through
17
- * the ordinary `InspectorProvider.get`/`set` (no separate provider). The shell
18
- * renders the hierarchy panel's rename field, eye (visibility) toggle, and lock
19
- * toggle against these three paths, generically, for any adapter that reports
20
- * them via `InspectorProvider.properties`.
21
- */
22
- export {};
@@ -1,43 +0,0 @@
1
- /**
2
- * ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
3
- * INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
4
- * "is this object replicated, who owns it, may I edit it" — and, for the network
5
- * inspector panel, "am I connected, to which room, how much replication activity
6
- * is happening" — without owning Colyseus.
7
- *
8
- * It is parameterized by accessors over the room state (rather than a fixed schema)
9
- * so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
10
- * report the local session and peers, and report connection/room/stats for the
11
- * inspector. The editor uses `authority`/`editable` to keep remote/server-
12
- * authoritative objects inspect-only (editing a replicated transform locally is
13
- * meaningless — the server overwrites it next snapshot).
14
- */
15
- import type * as THREE from 'three';
16
- import type { ConnectionState, NetPeer, NetworkingAdapter, ReplicationStats, RoomInfo, Unsubscribe } from './system-adapter';
17
- export interface ColyseusNetworkingConfig {
18
- /** The local peer's session id (objects it owns are editable). */
19
- localSessionId(): string | null;
20
- /** Peers currently in the room. */
21
- peers(): NetPeer[];
22
- /** Network id for an object, or null if it is not replicated (→ local authored). */
23
- networkId(o: THREE.Object3D): string | null;
24
- /** Owning peer/session id for a replicated object (null = server-owned). */
25
- ownerId(o: THREE.Object3D): string | null;
26
- /** True if the server is authoritative over this object (→ inspect-only). */
27
- serverAuthoritative?(o: THREE.Object3D): boolean;
28
- /** Current connection lifecycle state, for the network inspector panel.
29
- * Optional — defaults to `'disconnected'` for implementers that only need
30
- * object authority/editability (the pre-inspector config shape). */
31
- connectionState?(): ConnectionState;
32
- /** The active room's identity, or `null` when not connected to a room.
33
- * Optional — defaults to `null`. */
34
- roomInfo?(): RoomInfo | null;
35
- /** Replication activity snapshot (entity count + msg rates), for the inspector.
36
- * Optional — defaults to all-zero stats. */
37
- replicationStats?(): ReplicationStats;
38
- /** Subscribe to changes in connection state / room / replication stats.
39
- * Optional — defaults to a no-op subscription. */
40
- subscribe?(cb: () => void): Unsubscribe;
41
- }
42
- export declare function createColyseusNetworkingAdapter(cfg: ColyseusNetworkingConfig): NetworkingAdapter;
43
- //# sourceMappingURL=colyseus-networking-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"colyseus-networking-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/colyseus-networking-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,cAAc,IAAI,MAAM,GAAG,IAAI,CAAC;IAChC,mCAAmC;IACnC,KAAK,IAAI,OAAO,EAAE,CAAC;IACnB,oFAAoF;IACpF,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,4EAA4E;IAC5E,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,6EAA6E;IAC7E,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACjD;;yEAEqE;IACrE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC;yCACqC;IACrC,QAAQ,CAAC,IAAI,QAAQ,GAAG,IAAI,CAAC;IAC7B;iDAC6C;IAC7C,gBAAgB,CAAC,IAAI,gBAAgB,CAAC;IACtC;uDACmD;IACnD,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;CACzC;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,wBAAwB,GAAG,iBAAiB,CAoBhG"}
@@ -1,38 +0,0 @@
1
- /**
2
- * ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
3
- * INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
4
- * "is this object replicated, who owns it, may I edit it" — and, for the network
5
- * inspector panel, "am I connected, to which room, how much replication activity
6
- * is happening" — without owning Colyseus.
7
- *
8
- * It is parameterized by accessors over the room state (rather than a fixed schema)
9
- * so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
10
- * report the local session and peers, and report connection/room/stats for the
11
- * inspector. The editor uses `authority`/`editable` to keep remote/server-
12
- * authoritative objects inspect-only (editing a replicated transform locally is
13
- * meaningless — the server overwrites it next snapshot).
14
- */
15
- export function createColyseusNetworkingAdapter(cfg) {
16
- return {
17
- peers: () => cfg.peers(),
18
- networkId: (o) => cfg.networkId(o),
19
- authority: (o) => {
20
- if (cfg.networkId(o) == null)
21
- return 'local'; // not replicated → local authored
22
- if (cfg.serverAuthoritative?.(o))
23
- return 'server';
24
- return cfg.ownerId(o) === cfg.localSessionId() ? 'local' : 'remote';
25
- },
26
- editable: (o) => {
27
- if (cfg.networkId(o) == null)
28
- return true; // local authored object
29
- if (cfg.serverAuthoritative?.(o))
30
- return false; // server owns it → inspect-only
31
- return cfg.ownerId(o) === cfg.localSessionId(); // only your own peer's objects
32
- },
33
- getConnectionState: () => cfg.connectionState?.() ?? 'disconnected',
34
- getRoomInfo: () => cfg.roomInfo?.() ?? null,
35
- getReplicationStats: () => cfg.replicationStats?.() ?? { entities: 0, msgsInPerSec: 0, msgsOutPerSec: 0 },
36
- subscribe: (cb) => cfg.subscribe?.(cb) ?? (() => { }),
37
- };
38
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * First-party implementations of the remaining `SystemAdapters` — input, assets,
3
- * navigation — each a thin coordination/introspection boundary over the real
4
- * engine subsystem (the original vision named these as first-class System
5
- * adapters; physics + networking shipped earlier). The editor speaks only the
6
- * interfaces; these wrap `InputManager`, the asset loader, and `NavMeshManager`
7
- * so an external game could supply its own equivalents. (The former
8
- * `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
9
- * removed by E5 — AnimGraph no longer exists; see
10
- * docs/AI-NATIVE-AUTHORING-IMPLEMENTATION-SPEC.md §3.3/§11 E5.)
11
- */
12
- import type { NavMeshManager } from '../ai/navigation';
13
- import type { InputManager } from '../input/input-manager';
14
- import type { AudioContext as GameAudio } from '../setup/setup-audio';
15
- import type { AssetAdapter, AudioAdapter, InputAdapter, NavigationAdapter } from './system-adapter';
16
- /** First-party `InputAdapter` over the engine `InputManager`. Reads each action through
17
- * `InputManager.readAction`, dispatched on that action's OWN declared `valueType`
18
- * (`getActionValueType`) — never a hardcoded getter — so a scalar/Vector2/pointer action
19
- * surfaces its real typed value instead of being coerced through `isPressed` (F1-followup;
20
- * `readAction` on the wrong type would throw, so dispatch must follow the declared type). */
21
- export declare function createInputManagerAdapter(input: InputManager): InputAdapter;
22
- /** First-party `AssetAdapter` — resolves URLs through the engine loader (which
23
- * applies the project base + downloaded-asset remap). External/ingest games can
24
- * supply their own to redirect relative paths. */
25
- export declare function createVgaiAssetAdapter(): AssetAdapter;
26
- /**
27
- * First-party `AudioAdapter` over the engine's master-gain bus
28
- * (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
29
- * (D10, T7.6) calls to silence a first-party world's audio. Restoring after a
30
- * mute puts the gain back at whatever value it held right before muting (not
31
- * a hardcoded `1`) — this composes correctly with an independent manual mute
32
- * (the editor's `MuteButton`, `PlayBar.tsx`): pausing while already
33
- * user-muted resumes muted, exactly as a user would expect.
34
- */
35
- export declare function createAudioSystemAdapter(audio: GameAudio): AudioAdapter;
36
- /** First-party `NavigationAdapter` over the engine `NavMeshManager`. */
37
- export declare function createNavigationAdapter(nav: NavMeshManager): NavigationAdapter;
38
- //# sourceMappingURL=first-party-systems.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"first-party-systems.d.ts","sourceRoot":"","sources":["../../src/adapter/first-party-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAEV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAE1B;;;;8FAI8F;AAC9F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAiB3E;AAED;;mDAEmD;AACnD,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAgBvE;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,CAM9E"}
@@ -1,77 +0,0 @@
1
- /**
2
- * First-party implementations of the remaining `SystemAdapters` — input, assets,
3
- * navigation — each a thin coordination/introspection boundary over the real
4
- * engine subsystem (the original vision named these as first-class System
5
- * adapters; physics + networking shipped earlier). The editor speaks only the
6
- * interfaces; these wrap `InputManager`, the asset loader, and `NavMeshManager`
7
- * so an external game could supply its own equivalents. (The former
8
- * `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
9
- * removed by E5 — AnimGraph no longer exists; see
10
- * docs/AI-NATIVE-AUTHORING-IMPLEMENTATION-SPEC.md §3.3/§11 E5.)
11
- */
12
- import { resolveUrl } from '../loader';
13
- /** First-party `InputAdapter` over the engine `InputManager`. Reads each action through
14
- * `InputManager.readAction`, dispatched on that action's OWN declared `valueType`
15
- * (`getActionValueType`) — never a hardcoded getter — so a scalar/Vector2/pointer action
16
- * surfaces its real typed value instead of being coerced through `isPressed` (F1-followup;
17
- * `readAction` on the wrong type would throw, so dispatch must follow the declared type). */
18
- export function createInputManagerAdapter(input) {
19
- return {
20
- poll: () => input.poll(),
21
- actions: () => {
22
- const out = {};
23
- for (const name of input.actionNames()) {
24
- const type = input.getActionValueType(name);
25
- // `readAction`'s return type is inferred from a literal `expectedType`; with `type`
26
- // widened to `ActionValueType` here it collapses to `boolean | number | Vector2`, so
27
- // digital's `boolean` is normalized to the adapter's 1/0 the same way the old digital-
28
- // only adapter did — every other value type already reads as `number | Vector2`.
29
- const raw = input.readAction(name, type);
30
- out[name] = { type, value: typeof raw === 'boolean' ? (raw ? 1 : 0) : raw };
31
- }
32
- return out;
33
- },
34
- };
35
- }
36
- /** First-party `AssetAdapter` — resolves URLs through the engine loader (which
37
- * applies the project base + downloaded-asset remap). External/ingest games can
38
- * supply their own to redirect relative paths. */
39
- export function createVgaiAssetAdapter() {
40
- return { resolve: (url) => resolveUrl(url) };
41
- }
42
- /**
43
- * First-party `AudioAdapter` over the engine's master-gain bus
44
- * (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
45
- * (D10, T7.6) calls to silence a first-party world's audio. Restoring after a
46
- * mute puts the gain back at whatever value it held right before muting (not
47
- * a hardcoded `1`) — this composes correctly with an independent manual mute
48
- * (the editor's `MuteButton`, `PlayBar.tsx`): pausing while already
49
- * user-muted resumes muted, exactly as a user would expect.
50
- */
51
- export function createAudioSystemAdapter(audio) {
52
- let muted = false;
53
- let priorGain = audio.masterGain.gain.value;
54
- return {
55
- setMuted(next) {
56
- if (next === muted)
57
- return;
58
- muted = next;
59
- if (next) {
60
- priorGain = audio.masterGain.gain.value;
61
- audio.masterGain.gain.value = 0;
62
- }
63
- else {
64
- audio.masterGain.gain.value = priorGain;
65
- }
66
- },
67
- isMuted: () => muted,
68
- };
69
- }
70
- /** First-party `NavigationAdapter` over the engine `NavMeshManager`. */
71
- export function createNavigationAdapter(nav) {
72
- return {
73
- hasNavMesh: () => nav.hasNavMesh(),
74
- findPath: (start, end) => nav.findPath(start, end),
75
- debugMesh: (scene) => nav.getDebugMesh(scene),
76
- };
77
- }