@vgai/engine 0.2.0 → 0.3.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 (541) hide show
  1. package/README.md +3 -1
  2. package/dist/adapter/authoring.d.ts +404 -0
  3. package/dist/adapter/authoring.d.ts.map +1 -0
  4. package/dist/adapter/authoring.js +22 -0
  5. package/dist/adapter/colyseus-networking-adapter.d.ts +43 -0
  6. package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
  7. package/dist/adapter/colyseus-networking-adapter.js +38 -0
  8. package/dist/adapter/first-party-systems.d.ts +38 -0
  9. package/dist/adapter/first-party-systems.d.ts.map +1 -0
  10. package/dist/adapter/first-party-systems.js +77 -0
  11. package/dist/adapter/game-adapter.d.ts +133 -0
  12. package/dist/adapter/game-adapter.d.ts.map +1 -0
  13. package/dist/adapter/game-adapter.js +10 -0
  14. package/dist/adapter/host-context.d.ts +73 -0
  15. package/dist/adapter/host-context.d.ts.map +1 -0
  16. package/dist/adapter/host-context.js +16 -0
  17. package/dist/adapter/index.d.ts +22 -0
  18. package/dist/adapter/index.d.ts.map +1 -0
  19. package/dist/adapter/index.js +15 -0
  20. package/dist/adapter/ingest/game-contract.d.ts +53 -0
  21. package/dist/adapter/ingest/game-contract.d.ts.map +1 -0
  22. package/dist/adapter/ingest/game-contract.js +30 -0
  23. package/dist/adapter/ingest/overlay-applier.d.ts +118 -0
  24. package/dist/adapter/ingest/overlay-applier.d.ts.map +1 -0
  25. package/dist/adapter/ingest/overlay-applier.js +132 -0
  26. package/dist/adapter/ingest/overlay-apply.d.ts +60 -0
  27. package/dist/adapter/ingest/overlay-apply.d.ts.map +1 -0
  28. package/dist/adapter/ingest/overlay-apply.js +101 -0
  29. package/dist/adapter/ingest/overlay-file.d.ts +79 -0
  30. package/dist/adapter/ingest/overlay-file.d.ts.map +1 -0
  31. package/dist/adapter/ingest/overlay-file.js +66 -0
  32. package/dist/adapter/ingest/overlay-report.d.ts +113 -0
  33. package/dist/adapter/ingest/overlay-report.d.ts.map +1 -0
  34. package/dist/adapter/ingest/overlay-report.js +103 -0
  35. package/dist/adapter/ingest/scene-capture.d.ts +97 -0
  36. package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
  37. package/dist/adapter/ingest/scene-capture.js +248 -0
  38. package/dist/adapter/ingest/upstream-pin.d.ts +47 -0
  39. package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
  40. package/dist/adapter/ingest/upstream-pin.js +50 -0
  41. package/dist/adapter/loop-gate-report.d.ts +34 -0
  42. package/dist/adapter/loop-gate-report.d.ts.map +1 -0
  43. package/dist/adapter/loop-gate-report.js +37 -0
  44. package/dist/adapter/rapier-physics-adapter.d.ts +12 -0
  45. package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
  46. package/dist/adapter/rapier-physics-adapter.js +46 -0
  47. package/dist/adapter/system-adapter.d.ts +133 -0
  48. package/dist/adapter/system-adapter.d.ts.map +1 -0
  49. package/dist/adapter/system-adapter.js +13 -0
  50. package/dist/adapter/transform.d.ts +18 -0
  51. package/dist/adapter/transform.d.ts.map +1 -0
  52. package/dist/adapter/transform.js +1 -0
  53. package/dist/adapter/vgai-scene-game-adapter.d.ts +116 -0
  54. package/dist/adapter/vgai-scene-game-adapter.d.ts.map +1 -0
  55. package/dist/adapter/vgai-scene-game-adapter.js +714 -0
  56. package/dist/adapter/world-kind.d.ts +30 -0
  57. package/dist/adapter/world-kind.d.ts.map +1 -0
  58. package/dist/adapter/world-kind.js +18 -0
  59. package/dist/ai/navigation.d.ts +64 -0
  60. package/dist/ai/navigation.d.ts.map +1 -0
  61. package/dist/ai/navigation.js +133 -0
  62. package/dist/animation/anim-graph-types.d.ts +25 -0
  63. package/dist/animation/anim-graph-types.d.ts.map +1 -0
  64. package/dist/animation/anim-graph-types.js +1 -0
  65. package/dist/animation/animation-clock.d.ts +213 -0
  66. package/dist/animation/animation-clock.d.ts.map +1 -0
  67. package/dist/animation/animation-clock.js +301 -0
  68. package/dist/animation/blend-node.d.ts +22 -0
  69. package/dist/animation/blend-node.d.ts.map +1 -0
  70. package/dist/animation/blend-node.js +97 -0
  71. package/dist/animation/camera-ownership.d.ts +250 -0
  72. package/dist/animation/camera-ownership.d.ts.map +1 -0
  73. package/dist/animation/camera-ownership.js +169 -0
  74. package/dist/animation/cinematic-cues.d.ts +200 -0
  75. package/dist/animation/cinematic-cues.d.ts.map +1 -0
  76. package/dist/animation/cinematic-cues.js +213 -0
  77. package/dist/animation/clip-map.d.ts +12 -0
  78. package/dist/animation/clip-map.d.ts.map +1 -0
  79. package/dist/animation/clip-map.js +37 -0
  80. package/dist/animation/gsap-registration.d.ts +119 -0
  81. package/dist/animation/gsap-registration.d.ts.map +1 -0
  82. package/dist/animation/gsap-registration.js +92 -0
  83. package/dist/animation/theatre-clock-binding.d.ts +89 -0
  84. package/dist/animation/theatre-clock-binding.d.ts.map +1 -0
  85. package/dist/animation/theatre-clock-binding.js +29 -0
  86. package/dist/animation/theatre-director.d.ts +242 -0
  87. package/dist/animation/theatre-director.d.ts.map +1 -0
  88. package/dist/animation/theatre-director.js +235 -0
  89. package/dist/animation/theatre-object-binding.d.ts +305 -0
  90. package/dist/animation/theatre-object-binding.d.ts.map +1 -0
  91. package/dist/animation/theatre-object-binding.js +351 -0
  92. package/dist/animation/xstate-animation-binding.d.ts +111 -0
  93. package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
  94. package/dist/animation/xstate-animation-binding.js +307 -0
  95. package/dist/animation/xstate-animation-meta.d.ts +228 -0
  96. package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
  97. package/dist/animation/xstate-animation-meta.js +221 -0
  98. package/dist/assets.d.ts +26 -0
  99. package/dist/assets.d.ts.map +1 -0
  100. package/dist/assets.js +55 -0
  101. package/dist/audio/index.d.ts +4 -0
  102. package/dist/audio/index.d.ts.map +1 -0
  103. package/dist/audio/index.js +24 -0
  104. package/dist/audio/tone-clock-binding.d.ts +75 -0
  105. package/dist/audio/tone-clock-binding.d.ts.map +1 -0
  106. package/dist/audio/tone-clock-binding.js +29 -0
  107. package/dist/audio/tone-context.d.ts +114 -0
  108. package/dist/audio/tone-context.d.ts.map +1 -0
  109. package/dist/audio/tone-context.js +39 -0
  110. package/dist/audio/tone-offline-render.d.ts +90 -0
  111. package/dist/audio/tone-offline-render.d.ts.map +1 -0
  112. package/dist/audio/tone-offline-render.js +56 -0
  113. package/dist/audio/wav-encode.d.ts +38 -0
  114. package/dist/audio/wav-encode.d.ts.map +1 -0
  115. package/dist/audio/wav-encode.js +97 -0
  116. package/dist/core/game-loop.d.ts +21 -0
  117. package/dist/core/game-loop.d.ts.map +1 -0
  118. package/dist/core/game-loop.js +130 -0
  119. package/dist/core/system-runner.d.ts +120 -0
  120. package/dist/core/system-runner.d.ts.map +1 -0
  121. package/dist/core/system-runner.js +286 -0
  122. package/dist/core/types.d.ts +58 -0
  123. package/dist/core/types.d.ts.map +1 -0
  124. package/dist/core/types.js +25 -0
  125. package/dist/data/data-asset.d.ts +101 -0
  126. package/dist/data/data-asset.d.ts.map +1 -0
  127. package/dist/data/data-asset.js +122 -0
  128. package/dist/data/data-check-core.d.ts +110 -0
  129. package/dist/data/data-check-core.d.ts.map +1 -0
  130. package/dist/data/data-check-core.js +178 -0
  131. package/dist/data/data-ref.d.ts +79 -0
  132. package/dist/data/data-ref.d.ts.map +1 -0
  133. package/dist/data/data-ref.js +130 -0
  134. package/dist/data/vite-plugin-data.d.ts +79 -0
  135. package/dist/data/vite-plugin-data.d.ts.map +1 -0
  136. package/dist/data/vite-plugin-data.js +217 -0
  137. package/dist/dev/console-bridge.d.ts +22 -0
  138. package/dist/dev/console-bridge.d.ts.map +1 -0
  139. package/dist/dev/console-bridge.js +71 -0
  140. package/dist/dev/debug-draw.d.ts +24 -0
  141. package/dist/dev/debug-draw.d.ts.map +1 -0
  142. package/dist/dev/debug-draw.js +73 -0
  143. package/dist/dev/logger.d.ts +30 -0
  144. package/dist/dev/logger.d.ts.map +1 -0
  145. package/dist/dev/logger.js +90 -0
  146. package/dist/ecs/component-manager.d.ts +189 -0
  147. package/dist/ecs/component-manager.d.ts.map +1 -0
  148. package/dist/ecs/component-manager.js +676 -0
  149. package/dist/ecs/game-component.d.ts +97 -0
  150. package/dist/ecs/game-component.d.ts.map +1 -0
  151. package/dist/ecs/game-component.js +80 -0
  152. package/dist/ecs/hmr-swap-report.d.ts +53 -0
  153. package/dist/ecs/hmr-swap-report.d.ts.map +1 -0
  154. package/dist/ecs/hmr-swap-report.js +55 -0
  155. package/dist/index.d.ts +37 -0
  156. package/dist/index.d.ts.map +1 -0
  157. package/dist/index.js +30 -0
  158. package/dist/input/input-manager.d.ts +596 -0
  159. package/dist/input/input-manager.d.ts.map +1 -0
  160. package/dist/input/input-manager.js +1564 -0
  161. package/dist/input/input-types.d.ts +171 -0
  162. package/dist/input/input-types.d.ts.map +1 -0
  163. package/dist/input/input-types.js +1 -0
  164. package/dist/input/prompt-labels.d.ts +21 -0
  165. package/dist/input/prompt-labels.d.ts.map +1 -0
  166. package/dist/input/prompt-labels.js +121 -0
  167. package/dist/input/rebind-controller.d.ts +59 -0
  168. package/dist/input/rebind-controller.d.ts.map +1 -0
  169. package/dist/input/rebind-controller.js +85 -0
  170. package/dist/input/schema.d.ts +16 -0
  171. package/dist/input/schema.d.ts.map +1 -0
  172. package/dist/input/schema.js +228 -0
  173. package/dist/loader.d.ts +43 -0
  174. package/dist/loader.d.ts.map +1 -0
  175. package/dist/loader.js +59 -0
  176. package/dist/manifest/index.d.ts +5 -0
  177. package/dist/manifest/index.d.ts.map +1 -0
  178. package/dist/manifest/index.js +8 -0
  179. package/dist/manifest/load-file.d.ts +4 -0
  180. package/dist/manifest/load-file.d.ts.map +1 -0
  181. package/dist/manifest/load-file.js +14 -0
  182. package/dist/manifest/load.d.ts +117 -0
  183. package/dist/manifest/load.d.ts.map +1 -0
  184. package/dist/manifest/load.js +255 -0
  185. package/dist/manifest/schema.d.ts +173 -0
  186. package/dist/manifest/schema.d.ts.map +1 -0
  187. package/dist/manifest/schema.js +302 -0
  188. package/dist/physics/collision-system.d.ts +41 -0
  189. package/dist/physics/collision-system.d.ts.map +1 -0
  190. package/dist/physics/collision-system.js +64 -0
  191. package/dist/physics/physics-registry.d.ts +45 -0
  192. package/dist/physics/physics-registry.d.ts.map +1 -0
  193. package/dist/physics/physics-registry.js +65 -0
  194. package/dist/physics/transform-writer.d.ts +16 -0
  195. package/dist/physics/transform-writer.d.ts.map +1 -0
  196. package/dist/physics/transform-writer.js +38 -0
  197. package/dist/physics/trigger-dispatch.d.ts +24 -0
  198. package/dist/physics/trigger-dispatch.d.ts.map +1 -0
  199. package/dist/physics/trigger-dispatch.js +80 -0
  200. package/dist/react/game-state.d.ts +105 -0
  201. package/dist/react/game-state.d.ts.map +1 -0
  202. package/dist/react/game-state.js +144 -0
  203. package/dist/react/use-data.d.ts +60 -0
  204. package/dist/react/use-data.d.ts.map +1 -0
  205. package/dist/react/use-data.js +96 -0
  206. package/dist/react/use-selection.d.ts +75 -0
  207. package/dist/react/use-selection.d.ts.map +1 -0
  208. package/dist/react/use-selection.js +90 -0
  209. package/dist/render/auto-batcher.d.ts +34 -0
  210. package/dist/render/auto-batcher.d.ts.map +1 -0
  211. package/dist/render/auto-batcher.js +140 -0
  212. package/dist/render/render-batch-system.d.ts +33 -0
  213. package/dist/render/render-batch-system.d.ts.map +1 -0
  214. package/dist/render/render-batch-system.js +230 -0
  215. package/dist/render/render-features.d.ts +47 -0
  216. package/dist/render/render-features.d.ts.map +1 -0
  217. package/dist/render/render-features.js +105 -0
  218. package/dist/render/render-settings.d.ts +36 -0
  219. package/dist/render/render-settings.d.ts.map +1 -0
  220. package/dist/render/render-settings.js +51 -0
  221. package/dist/runtime/create-runtime.d.ts +280 -0
  222. package/dist/runtime/create-runtime.d.ts.map +1 -0
  223. package/dist/runtime/create-runtime.js +795 -0
  224. package/dist/runtime/frame-selector-cache.d.ts +41 -0
  225. package/dist/runtime/frame-selector-cache.d.ts.map +1 -0
  226. package/dist/runtime/frame-selector-cache.js +65 -0
  227. package/dist/runtime/game.d.ts +433 -0
  228. package/dist/runtime/game.d.ts.map +1 -0
  229. package/dist/runtime/game.js +569 -0
  230. package/dist/runtime/input-router.d.ts +78 -0
  231. package/dist/runtime/input-router.d.ts.map +1 -0
  232. package/dist/runtime/input-router.js +171 -0
  233. package/dist/runtime/mount-game.d.ts +129 -0
  234. package/dist/runtime/mount-game.d.ts.map +1 -0
  235. package/dist/runtime/mount-game.js +152 -0
  236. package/dist/runtime/mount-manifest.d.ts +119 -0
  237. package/dist/runtime/mount-manifest.d.ts.map +1 -0
  238. package/dist/runtime/mount-manifest.js +204 -0
  239. package/dist/runtime/render-audio-control.d.ts +110 -0
  240. package/dist/runtime/render-audio-control.d.ts.map +1 -0
  241. package/dist/runtime/render-audio-control.js +111 -0
  242. package/dist/runtime/render-control.d.ts +291 -0
  243. package/dist/runtime/render-control.d.ts.map +1 -0
  244. package/dist/runtime/render-control.js +264 -0
  245. package/dist/runtime/render-seed.d.ts +57 -0
  246. package/dist/runtime/render-seed.d.ts.map +1 -0
  247. package/dist/runtime/render-seed.js +74 -0
  248. package/dist/runtime/scene-ui-bridge.d.ts +69 -0
  249. package/dist/runtime/scene-ui-bridge.d.ts.map +1 -0
  250. package/dist/runtime/scene-ui-bridge.js +23 -0
  251. package/dist/runtime/scene-ui-data.d.ts +13 -0
  252. package/dist/runtime/scene-ui-data.d.ts.map +1 -0
  253. package/dist/runtime/scene-ui-data.js +92 -0
  254. package/dist/runtime/state-bridge.d.ts +47 -0
  255. package/dist/runtime/state-bridge.d.ts.map +1 -0
  256. package/dist/runtime/state-bridge.js +53 -0
  257. package/dist/runtime/types.d.ts +179 -0
  258. package/dist/runtime/types.d.ts.map +1 -0
  259. package/dist/runtime/types.js +1 -0
  260. package/dist/scene/asset-loaders.d.ts +79 -0
  261. package/dist/scene/asset-loaders.d.ts.map +1 -0
  262. package/dist/scene/asset-loaders.js +141 -0
  263. package/dist/scene/asset-paths.d.ts +11 -0
  264. package/dist/scene/asset-paths.d.ts.map +1 -0
  265. package/dist/scene/asset-paths.js +108 -0
  266. package/dist/scene/asset-ref-check.d.ts +88 -0
  267. package/dist/scene/asset-ref-check.d.ts.map +1 -0
  268. package/dist/scene/asset-ref-check.js +214 -0
  269. package/dist/scene/asset-registry.d.ts +30 -0
  270. package/dist/scene/asset-registry.d.ts.map +1 -0
  271. package/dist/scene/asset-registry.js +50 -0
  272. package/dist/scene/collider-dimensions.d.ts +63 -0
  273. package/dist/scene/collider-dimensions.d.ts.map +1 -0
  274. package/dist/scene/collider-dimensions.js +98 -0
  275. package/dist/scene/component-registry.d.ts +17 -0
  276. package/dist/scene/component-registry.d.ts.map +1 -0
  277. package/dist/scene/component-registry.js +28 -0
  278. package/dist/scene/defaults.d.ts +252 -0
  279. package/dist/scene/defaults.d.ts.map +1 -0
  280. package/dist/scene/defaults.js +151 -0
  281. package/dist/scene/geometries/index.d.ts +8 -0
  282. package/dist/scene/geometries/index.d.ts.map +1 -0
  283. package/dist/scene/geometries/index.js +7 -0
  284. package/dist/scene/geometries/terrain.d.ts +2 -0
  285. package/dist/scene/geometries/terrain.d.ts.map +1 -0
  286. package/dist/scene/geometries/terrain.js +37 -0
  287. package/dist/scene/geometry-registry.d.ts +24 -0
  288. package/dist/scene/geometry-registry.d.ts.map +1 -0
  289. package/dist/scene/geometry-registry.js +20 -0
  290. package/dist/scene/instance-registry.d.ts +36 -0
  291. package/dist/scene/instance-registry.d.ts.map +1 -0
  292. package/dist/scene/instance-registry.js +55 -0
  293. package/dist/scene/instancers/grid.d.ts +2 -0
  294. package/dist/scene/instancers/grid.d.ts.map +1 -0
  295. package/dist/scene/instancers/grid.js +36 -0
  296. package/dist/scene/instancers/index.d.ts +8 -0
  297. package/dist/scene/instancers/index.d.ts.map +1 -0
  298. package/dist/scene/instancers/index.js +7 -0
  299. package/dist/scene/light-camera-factory.d.ts +23 -0
  300. package/dist/scene/light-camera-factory.d.ts.map +1 -0
  301. package/dist/scene/light-camera-factory.js +68 -0
  302. package/dist/scene/material-factory.d.ts +17 -0
  303. package/dist/scene/material-factory.d.ts.map +1 -0
  304. package/dist/scene/material-factory.js +197 -0
  305. package/dist/scene/material-registry.d.ts +40 -0
  306. package/dist/scene/material-registry.d.ts.map +1 -0
  307. package/dist/scene/material-registry.js +44 -0
  308. package/dist/scene/materials/index.d.ts +8 -0
  309. package/dist/scene/materials/index.d.ts.map +1 -0
  310. package/dist/scene/materials/index.js +7 -0
  311. package/dist/scene/materials/water.d.ts +2 -0
  312. package/dist/scene/materials/water.d.ts.map +1 -0
  313. package/dist/scene/materials/water.js +54 -0
  314. package/dist/scene/parse.d.ts +23 -0
  315. package/dist/scene/parse.d.ts.map +1 -0
  316. package/dist/scene/parse.js +179 -0
  317. package/dist/scene/particles-factory.d.ts +33 -0
  318. package/dist/scene/particles-factory.d.ts.map +1 -0
  319. package/dist/scene/particles-factory.js +282 -0
  320. package/dist/scene/scene-apply.d.ts +109 -0
  321. package/dist/scene/scene-apply.d.ts.map +1 -0
  322. package/dist/scene/scene-apply.js +326 -0
  323. package/dist/scene/scene-diff-schema.d.ts +285 -0
  324. package/dist/scene/scene-diff-schema.d.ts.map +1 -0
  325. package/dist/scene/scene-diff-schema.js +92 -0
  326. package/dist/scene/scene-diff-types.d.ts +40 -0
  327. package/dist/scene/scene-diff-types.d.ts.map +1 -0
  328. package/dist/scene/scene-diff-types.js +14 -0
  329. package/dist/scene/scene-loader.d.ts +177 -0
  330. package/dist/scene/scene-loader.d.ts.map +1 -0
  331. package/dist/scene/scene-loader.js +1213 -0
  332. package/dist/scene/scene-query.d.ts +11 -0
  333. package/dist/scene/scene-query.d.ts.map +1 -0
  334. package/dist/scene/scene-query.js +63 -0
  335. package/dist/scene/scene-types.d.ts +10 -0
  336. package/dist/scene/scene-types.d.ts.map +1 -0
  337. package/dist/scene/scene-types.js +8 -0
  338. package/dist/scene/scene-version.d.ts +26 -0
  339. package/dist/scene/scene-version.d.ts.map +1 -0
  340. package/dist/scene/scene-version.js +34 -0
  341. package/dist/scene/schema/animation.d.ts +8 -0
  342. package/dist/scene/schema/animation.d.ts.map +1 -0
  343. package/dist/scene/schema/animation.js +42 -0
  344. package/dist/scene/schema/audio.d.ts +13 -0
  345. package/dist/scene/schema/audio.d.ts.map +1 -0
  346. package/dist/scene/schema/audio.js +22 -0
  347. package/dist/scene/schema/camera.d.ts +28 -0
  348. package/dist/scene/schema/camera.d.ts.map +1 -0
  349. package/dist/scene/schema/camera.js +17 -0
  350. package/dist/scene/schema/collider.d.ts +40 -0
  351. package/dist/scene/schema/collider.d.ts.map +1 -0
  352. package/dist/scene/schema/collider.js +55 -0
  353. package/dist/scene/schema/entity-ref.d.ts +31 -0
  354. package/dist/scene/schema/entity-ref.d.ts.map +1 -0
  355. package/dist/scene/schema/entity-ref.js +61 -0
  356. package/dist/scene/schema/entity.d.ts +1036 -0
  357. package/dist/scene/schema/entity.d.ts.map +1 -0
  358. package/dist/scene/schema/entity.js +153 -0
  359. package/dist/scene/schema/environment.d.ts +425 -0
  360. package/dist/scene/schema/environment.d.ts.map +1 -0
  361. package/dist/scene/schema/environment.js +357 -0
  362. package/dist/scene/schema/index.d.ts +39 -0
  363. package/dist/scene/schema/index.d.ts.map +1 -0
  364. package/dist/scene/schema/index.js +20 -0
  365. package/dist/scene/schema/instances.d.ts +14 -0
  366. package/dist/scene/schema/instances.d.ts.map +1 -0
  367. package/dist/scene/schema/instances.js +28 -0
  368. package/dist/scene/schema/joint.d.ts +23 -0
  369. package/dist/scene/schema/joint.d.ts.map +1 -0
  370. package/dist/scene/schema/joint.js +23 -0
  371. package/dist/scene/schema/light.d.ts +38 -0
  372. package/dist/scene/schema/light.d.ts.map +1 -0
  373. package/dist/scene/schema/light.js +26 -0
  374. package/dist/scene/schema/material.d.ts +199 -0
  375. package/dist/scene/schema/material.d.ts.map +1 -0
  376. package/dist/scene/schema/material.js +99 -0
  377. package/dist/scene/schema/mesh.d.ts +48 -0
  378. package/dist/scene/schema/mesh.d.ts.map +1 -0
  379. package/dist/scene/schema/mesh.js +82 -0
  380. package/dist/scene/schema/particles.d.ts +2178 -0
  381. package/dist/scene/schema/particles.d.ts.map +1 -0
  382. package/dist/scene/schema/particles.js +321 -0
  383. package/dist/scene/schema/physics.d.ts +56 -0
  384. package/dist/scene/schema/physics.d.ts.map +1 -0
  385. package/dist/scene/schema/physics.js +37 -0
  386. package/dist/scene/schema/scene-file.d.ts +304 -0
  387. package/dist/scene/schema/scene-file.d.ts.map +1 -0
  388. package/dist/scene/schema/scene-file.js +262 -0
  389. package/dist/scene/schema/shadow.d.ts +28 -0
  390. package/dist/scene/schema/shadow.d.ts.map +1 -0
  391. package/dist/scene/schema/shadow.js +20 -0
  392. package/dist/scene/schema/spline.d.ts +25 -0
  393. package/dist/scene/schema/spline.d.ts.map +1 -0
  394. package/dist/scene/schema/spline.js +15 -0
  395. package/dist/scene/schema/tuples.d.ts +12 -0
  396. package/dist/scene/schema/tuples.d.ts.map +1 -0
  397. package/dist/scene/schema/tuples.js +14 -0
  398. package/dist/scene/schema/ui.d.ts +880 -0
  399. package/dist/scene/schema/ui.d.ts.map +1 -0
  400. package/dist/scene/schema/ui.js +506 -0
  401. package/dist/scene/user-data.d.ts +171 -0
  402. package/dist/scene/user-data.d.ts.map +1 -0
  403. package/dist/scene/user-data.js +137 -0
  404. package/dist/setup/setup-audio.d.ts +20 -0
  405. package/dist/setup/setup-audio.d.ts.map +1 -0
  406. package/dist/setup/setup-audio.js +41 -0
  407. package/dist/setup/setup-particles.d.ts +17 -0
  408. package/dist/setup/setup-particles.d.ts.map +1 -0
  409. package/dist/setup/setup-particles.js +16 -0
  410. package/dist/setup/setup-physics.d.ts +25 -0
  411. package/dist/setup/setup-physics.d.ts.map +1 -0
  412. package/dist/setup/setup-physics.js +51 -0
  413. package/dist/setup/setup-renderer.d.ts +69 -0
  414. package/dist/setup/setup-renderer.d.ts.map +1 -0
  415. package/dist/setup/setup-renderer.js +363 -0
  416. package/dist/tools/define-tool.d.ts +105 -0
  417. package/dist/tools/define-tool.d.ts.map +1 -0
  418. package/dist/tools/define-tool.js +82 -0
  419. package/dist/world2d/authoring-2d.d.ts +76 -0
  420. package/dist/world2d/authoring-2d.d.ts.map +1 -0
  421. package/dist/world2d/authoring-2d.js +176 -0
  422. package/dist/world2d/capture-to-scene2d.d.ts +5 -0
  423. package/dist/world2d/capture-to-scene2d.d.ts.map +1 -0
  424. package/dist/world2d/capture-to-scene2d.js +49 -0
  425. package/dist/world2d/collision-2d.d.ts +52 -0
  426. package/dist/world2d/collision-2d.d.ts.map +1 -0
  427. package/dist/world2d/collision-2d.js +70 -0
  428. package/dist/world2d/components-2d.d.ts +47 -0
  429. package/dist/world2d/components-2d.d.ts.map +1 -0
  430. package/dist/world2d/components-2d.js +77 -0
  431. package/dist/world2d/index.d.ts +34 -0
  432. package/dist/world2d/index.d.ts.map +1 -0
  433. package/dist/world2d/index.js +32 -0
  434. package/dist/world2d/ingest-iframe-2d.d.ts +82 -0
  435. package/dist/world2d/ingest-iframe-2d.d.ts.map +1 -0
  436. package/dist/world2d/ingest-iframe-2d.js +166 -0
  437. package/dist/world2d/ingest2d.d.ts +97 -0
  438. package/dist/world2d/ingest2d.d.ts.map +1 -0
  439. package/dist/world2d/ingest2d.js +40 -0
  440. package/dist/world2d/physics2d-registry.d.ts +24 -0
  441. package/dist/world2d/physics2d-registry.d.ts.map +1 -0
  442. package/dist/world2d/physics2d-registry.js +38 -0
  443. package/dist/world2d/pixi-game-adapter.d.ts +107 -0
  444. package/dist/world2d/pixi-game-adapter.d.ts.map +1 -0
  445. package/dist/world2d/pixi-game-adapter.js +211 -0
  446. package/dist/world2d/pixi-surface.d.ts +39 -0
  447. package/dist/world2d/pixi-surface.d.ts.map +1 -0
  448. package/dist/world2d/pixi-surface.js +47 -0
  449. package/dist/world2d/scene-capture-2d.d.ts +43 -0
  450. package/dist/world2d/scene-capture-2d.d.ts.map +1 -0
  451. package/dist/world2d/scene-capture-2d.js +92 -0
  452. package/dist/world2d/scene2d-loader.d.ts +27 -0
  453. package/dist/world2d/scene2d-loader.d.ts.map +1 -0
  454. package/dist/world2d/scene2d-loader.js +274 -0
  455. package/dist/world2d/schema/entity2d.d.ts +102 -0
  456. package/dist/world2d/schema/entity2d.d.ts.map +1 -0
  457. package/dist/world2d/schema/entity2d.js +119 -0
  458. package/dist/world2d/schema/physics2d.d.ts +46 -0
  459. package/dist/world2d/schema/physics2d.d.ts.map +1 -0
  460. package/dist/world2d/schema/physics2d.js +45 -0
  461. package/dist/world2d/schema/sprite.d.ts +42 -0
  462. package/dist/world2d/schema/sprite.d.ts.map +1 -0
  463. package/dist/world2d/schema/sprite.js +63 -0
  464. package/dist/world2d/schema/tilemap.d.ts +15 -0
  465. package/dist/world2d/schema/tilemap.d.ts.map +1 -0
  466. package/dist/world2d/schema/tilemap.js +19 -0
  467. package/dist/world2d/schema/tuples2d.d.ts +20 -0
  468. package/dist/world2d/schema/tuples2d.d.ts.map +1 -0
  469. package/dist/world2d/schema/tuples2d.js +19 -0
  470. package/dist/world2d/system-adapters-2d.d.ts +16 -0
  471. package/dist/world2d/system-adapters-2d.d.ts.map +1 -0
  472. package/dist/world2d/system-adapters-2d.js +37 -0
  473. package/dist/world2d/transform-writer-2d.d.ts +16 -0
  474. package/dist/world2d/transform-writer-2d.d.ts.map +1 -0
  475. package/dist/world2d/transform-writer-2d.js +22 -0
  476. package/dist/world2d/types.d.ts +53 -0
  477. package/dist/world2d/types.d.ts.map +1 -0
  478. package/dist/world2d/types.js +1 -0
  479. package/package.json +18 -4
  480. package/src/adapter/authoring.ts +10 -0
  481. package/src/adapter/first-party-systems.ts +23 -34
  482. package/src/adapter/index.ts +1 -3
  483. package/src/adapter/system-adapter.ts +15 -22
  484. package/src/adapter/vgai-scene-game-adapter.ts +5 -14
  485. package/src/animation/anim-graph-types.ts +12 -43
  486. package/src/animation/animation-clock.ts +479 -0
  487. package/src/animation/camera-ownership.ts +467 -0
  488. package/src/animation/cinematic-cues.ts +451 -0
  489. package/src/animation/clip-map.ts +41 -0
  490. package/src/animation/gsap-registration.ts +184 -0
  491. package/src/animation/theatre-clock-binding.ts +111 -0
  492. package/src/animation/theatre-director.ts +347 -0
  493. package/src/animation/theatre-object-binding.ts +661 -0
  494. package/src/animation/xstate-animation-binding.ts +398 -0
  495. package/src/animation/xstate-animation-meta.ts +282 -0
  496. package/src/audio/index.ts +39 -7
  497. package/src/audio/tone-clock-binding.ts +98 -0
  498. package/src/audio/tone-context.ts +129 -0
  499. package/src/audio/tone-offline-render.ts +167 -0
  500. package/src/audio/wav-encode.ts +119 -0
  501. package/src/core/game-loop.ts +17 -0
  502. package/src/core/types.ts +13 -0
  503. package/src/data/data-asset.ts +167 -0
  504. package/src/data/data-check-core.ts +242 -0
  505. package/src/data/data-ref.ts +145 -0
  506. package/src/data/vite-plugin-data.ts +290 -0
  507. package/src/index.ts +48 -0
  508. package/src/input/input-manager.ts +1206 -32
  509. package/src/input/input-types.ts +155 -3
  510. package/src/input/prompt-labels.ts +122 -0
  511. package/src/input/rebind-controller.ts +105 -0
  512. package/src/input/schema.ts +206 -52
  513. package/src/react/use-data.ts +114 -0
  514. package/src/react/use-selection.tsx +135 -0
  515. package/src/runtime/create-runtime.ts +30 -9
  516. package/src/runtime/render-audio-control.ts +168 -0
  517. package/src/runtime/render-control.ts +522 -0
  518. package/src/runtime/render-seed.ts +79 -0
  519. package/src/runtime/types.ts +0 -5
  520. package/src/scene/asset-loaders.ts +10 -36
  521. package/src/scene/asset-paths.ts +0 -2
  522. package/src/scene/asset-ref-check.ts +248 -0
  523. package/src/scene/parse.ts +133 -0
  524. package/src/scene/scene-loader.ts +81 -96
  525. package/src/scene/schema/animation.ts +30 -79
  526. package/src/scene/schema/entity.ts +20 -0
  527. package/src/scene/schema/index.ts +2 -12
  528. package/src/scene/user-data.ts +8 -9
  529. package/src/setup/setup-renderer.ts +9 -2
  530. package/src/tools/define-tool.ts +152 -0
  531. package/src/animation/anim-graph.ts +0 -406
  532. package/src/animation/anim-system.ts +0 -28
  533. package/src/animation/property-track.ts +0 -178
  534. package/src/animation/schema.ts +0 -204
  535. package/src/audio/ambient.ts +0 -300
  536. package/src/audio/impacts.ts +0 -212
  537. package/src/audio/movement.ts +0 -140
  538. package/src/audio/musical.ts +0 -200
  539. package/src/audio/ui-sounds.ts +0 -171
  540. package/src/audio/vehicle.ts +0 -235
  541. package/src/audio/weapons.ts +0 -152
package/README.md CHANGED
@@ -4,7 +4,9 @@ The vgai game engine: the game loop and phase scheduler, the
4
4
  `GameComponent` model (the world node *is* the entity — no ECS, no mirror
5
5
  tree), Rapier physics integration, the `.vscn.json` scene loader with its
6
6
  Zod schemas (the single source of truth for the scene format), animation
7
- (mixer + `AnimGraph` state machines), audio, input, the adapter seam
7
+ (native `THREE.AnimationMixer` actions bound to XState state machines via
8
+ `bindXStateAnimation` — see `src/animation/xstate-animation-binding.ts`),
9
+ audio, input, the adapter seam
8
10
  (`src/adapter/` — how the editor hosts non-native and unmodified games),
9
11
  and the world2d PixiJS stack.
10
12
 
@@ -0,0 +1,404 @@
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
@@ -0,0 +1 @@
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,MAA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E,iBAAiB,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAC3C,oFAAoF;IACpF,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IACzC,mFAAmF;IACnF,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC;mFAC+E;IAC/E,QAAQ,CAAC,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"}
@@ -0,0 +1,22 @@
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 {};
@@ -0,0 +1,43 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,38 @@
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
+ }
@@ -0,0 +1,38 @@
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
@@ -0,0 +1 @@
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"}