@vgai/engine 0.5.4 → 0.5.6

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 (448) hide show
  1. package/dist/adapter/adapter-surface.d.ts +30 -0
  2. package/dist/adapter/adapter-surface.d.ts.map +1 -0
  3. package/dist/adapter/adapter-surface.js +18 -0
  4. package/dist/adapter/authoring.d.ts +597 -0
  5. package/dist/adapter/authoring.d.ts.map +1 -0
  6. package/dist/adapter/authoring.js +22 -0
  7. package/dist/adapter/colyseus-networking-adapter.d.ts +77 -0
  8. package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
  9. package/dist/adapter/colyseus-networking-adapter.js +76 -0
  10. package/dist/adapter/first-party-systems.d.ts +23 -0
  11. package/dist/adapter/first-party-systems.d.ts.map +1 -0
  12. package/dist/adapter/first-party-systems.js +196 -0
  13. package/dist/adapter/host-context.d.ts +194 -0
  14. package/dist/adapter/host-context.d.ts.map +1 -0
  15. package/dist/adapter/host-context.js +80 -0
  16. package/dist/adapter/index.d.ts +33 -0
  17. package/dist/adapter/index.d.ts.map +1 -0
  18. package/dist/adapter/index.js +25 -0
  19. package/dist/adapter/ingest/game-contract.d.ts +53 -0
  20. package/dist/adapter/ingest/game-contract.d.ts.map +1 -0
  21. package/dist/adapter/ingest/game-contract.js +30 -0
  22. package/dist/adapter/ingest/scene-capture.d.ts +121 -0
  23. package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
  24. package/dist/adapter/ingest/scene-capture.js +270 -0
  25. package/dist/adapter/ingest/structural-ids.d.ts +64 -0
  26. package/dist/adapter/ingest/structural-ids.d.ts.map +1 -0
  27. package/dist/adapter/ingest/structural-ids.js +110 -0
  28. package/dist/adapter/ingest/upstream-pin.d.ts +44 -0
  29. package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
  30. package/dist/adapter/ingest/upstream-pin.js +47 -0
  31. package/dist/adapter/loop-gate-report.d.ts +34 -0
  32. package/dist/adapter/loop-gate-report.d.ts.map +1 -0
  33. package/dist/adapter/loop-gate-report.js +37 -0
  34. package/dist/adapter/rapier-physics-adapter.d.ts +69 -0
  35. package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
  36. package/dist/adapter/rapier-physics-adapter.js +135 -0
  37. package/dist/adapter/root-adapter.d.ts +195 -0
  38. package/dist/adapter/root-adapter.d.ts.map +1 -0
  39. package/dist/adapter/root-adapter.js +25 -0
  40. package/dist/adapter/setup-three-root-adapter.d.ts +87 -0
  41. package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -0
  42. package/dist/adapter/setup-three-root-adapter.js +791 -0
  43. package/dist/adapter/system-adapter.d.ts +453 -0
  44. package/dist/adapter/system-adapter.d.ts.map +1 -0
  45. package/dist/adapter/system-adapter.js +13 -0
  46. package/dist/adapter/transform.d.ts +18 -0
  47. package/dist/adapter/transform.d.ts.map +1 -0
  48. package/dist/adapter/transform.js +1 -0
  49. package/dist/ai/navigation.d.ts +78 -0
  50. package/dist/ai/navigation.d.ts.map +1 -0
  51. package/dist/ai/navigation.js +152 -0
  52. package/dist/animation/anim-graph-types.d.ts +25 -0
  53. package/dist/animation/anim-graph-types.d.ts.map +1 -0
  54. package/dist/animation/anim-graph-types.js +1 -0
  55. package/dist/animation/animation-clock.d.ts +213 -0
  56. package/dist/animation/animation-clock.d.ts.map +1 -0
  57. package/dist/animation/animation-clock.js +301 -0
  58. package/dist/animation/blend-node.d.ts +22 -0
  59. package/dist/animation/blend-node.d.ts.map +1 -0
  60. package/dist/animation/blend-node.js +97 -0
  61. package/dist/animation/camera-ownership.d.ts +249 -0
  62. package/dist/animation/camera-ownership.d.ts.map +1 -0
  63. package/dist/animation/camera-ownership.js +169 -0
  64. package/dist/animation/cinematic-cues.d.ts +200 -0
  65. package/dist/animation/cinematic-cues.d.ts.map +1 -0
  66. package/dist/animation/cinematic-cues.js +213 -0
  67. package/dist/animation/clip-map.d.ts +12 -0
  68. package/dist/animation/clip-map.d.ts.map +1 -0
  69. package/dist/animation/clip-map.js +31 -0
  70. package/dist/animation/cubic-spline-interpolant.d.ts +54 -0
  71. package/dist/animation/cubic-spline-interpolant.d.ts.map +1 -0
  72. package/dist/animation/cubic-spline-interpolant.js +111 -0
  73. package/dist/animation/theatre-clock-binding.d.ts +89 -0
  74. package/dist/animation/theatre-clock-binding.d.ts.map +1 -0
  75. package/dist/animation/theatre-clock-binding.js +29 -0
  76. package/dist/animation/theatre-director.d.ts +277 -0
  77. package/dist/animation/theatre-director.d.ts.map +1 -0
  78. package/dist/animation/theatre-director.js +248 -0
  79. package/dist/animation/theatre-object-binding.d.ts +305 -0
  80. package/dist/animation/theatre-object-binding.d.ts.map +1 -0
  81. package/dist/animation/theatre-object-binding.js +351 -0
  82. package/dist/animation/xstate-animation-binding.d.ts +119 -0
  83. package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
  84. package/dist/animation/xstate-animation-binding.js +349 -0
  85. package/dist/animation/xstate-animation-meta.d.ts +266 -0
  86. package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
  87. package/dist/animation/xstate-animation-meta.js +252 -0
  88. package/dist/asset-formats/camera.d.ts +15 -0
  89. package/dist/asset-formats/camera.d.ts.map +1 -0
  90. package/dist/asset-formats/camera.js +15 -0
  91. package/dist/asset-formats/collider.d.ts +21 -0
  92. package/dist/asset-formats/collider.d.ts.map +1 -0
  93. package/dist/asset-formats/collider.js +53 -0
  94. package/dist/asset-formats/index.d.ts +46 -0
  95. package/dist/asset-formats/index.d.ts.map +1 -0
  96. package/dist/asset-formats/index.js +36 -0
  97. package/dist/asset-formats/instances.d.ts +17 -0
  98. package/dist/asset-formats/instances.d.ts.map +1 -0
  99. package/dist/asset-formats/instances.js +31 -0
  100. package/dist/asset-formats/light.d.ts +21 -0
  101. package/dist/asset-formats/light.d.ts.map +1 -0
  102. package/dist/asset-formats/light.js +35 -0
  103. package/dist/asset-formats/material.d.ts +129 -0
  104. package/dist/asset-formats/material.d.ts.map +1 -0
  105. package/dist/asset-formats/material.js +88 -0
  106. package/dist/asset-formats/mesh.d.ts +22 -0
  107. package/dist/asset-formats/mesh.d.ts.map +1 -0
  108. package/dist/asset-formats/mesh.js +64 -0
  109. package/dist/asset-formats/parse.d.ts +20 -0
  110. package/dist/asset-formats/parse.d.ts.map +1 -0
  111. package/dist/asset-formats/parse.js +34 -0
  112. package/dist/asset-formats/particles.d.ts +1390 -0
  113. package/dist/asset-formats/particles.d.ts.map +1 -0
  114. package/dist/asset-formats/particles.js +319 -0
  115. package/dist/asset-formats/render-env.d.ts +387 -0
  116. package/dist/asset-formats/render-env.d.ts.map +1 -0
  117. package/dist/asset-formats/render-env.js +300 -0
  118. package/dist/asset-formats/tuples.d.ts +12 -0
  119. package/dist/asset-formats/tuples.d.ts.map +1 -0
  120. package/dist/asset-formats/tuples.js +14 -0
  121. package/dist/asset-loaders.d.ts +97 -0
  122. package/dist/asset-loaders.d.ts.map +1 -0
  123. package/dist/asset-loaders.js +209 -0
  124. package/dist/asset-parse-error.d.ts +24 -0
  125. package/dist/asset-parse-error.d.ts.map +1 -0
  126. package/dist/asset-parse-error.js +29 -0
  127. package/dist/asset-registry.d.ts +38 -0
  128. package/dist/asset-registry.d.ts.map +1 -0
  129. package/dist/asset-registry.js +66 -0
  130. package/dist/assets.d.ts +26 -0
  131. package/dist/assets.d.ts.map +1 -0
  132. package/dist/assets.js +55 -0
  133. package/dist/audio/wav-encode.d.ts +38 -0
  134. package/dist/audio/wav-encode.d.ts.map +1 -0
  135. package/dist/audio/wav-encode.js +97 -0
  136. package/dist/canvas-react/engine-bridge.d.ts +45 -0
  137. package/dist/canvas-react/engine-bridge.d.ts.map +1 -0
  138. package/dist/canvas-react/engine-bridge.js +45 -0
  139. package/dist/canvas-react/index.d.ts +42 -0
  140. package/dist/canvas-react/index.d.ts.map +1 -0
  141. package/dist/canvas-react/index.js +41 -0
  142. package/dist/canvas-react/pixi-primitive.d.ts +85 -0
  143. package/dist/canvas-react/pixi-primitive.d.ts.map +1 -0
  144. package/dist/canvas-react/pixi-primitive.js +181 -0
  145. package/dist/canvas-react/pixi-react-adapter.d.ts +71 -0
  146. package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -0
  147. package/dist/canvas-react/pixi-react-adapter.js +229 -0
  148. package/dist/canvas-react/pixi-react-root-factory.d.ts +56 -0
  149. package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -0
  150. package/dist/canvas-react/pixi-react-root-factory.js +73 -0
  151. package/dist/canvas-react/world-context.d.ts +88 -0
  152. package/dist/canvas-react/world-context.d.ts.map +1 -0
  153. package/dist/canvas-react/world-context.js +212 -0
  154. package/dist/config.d.ts +9 -0
  155. package/dist/config.d.ts.map +1 -0
  156. package/dist/config.js +8 -0
  157. package/dist/core/frame-pacing.d.ts +90 -0
  158. package/dist/core/frame-pacing.d.ts.map +1 -0
  159. package/dist/core/frame-pacing.js +89 -0
  160. package/dist/core/game-loop.d.ts +62 -0
  161. package/dist/core/game-loop.d.ts.map +1 -0
  162. package/dist/core/game-loop.js +189 -0
  163. package/dist/core/seeded-random.d.ts +69 -0
  164. package/dist/core/seeded-random.d.ts.map +1 -0
  165. package/dist/core/seeded-random.js +121 -0
  166. package/dist/core/sim-clock.d.ts +199 -0
  167. package/dist/core/sim-clock.d.ts.map +1 -0
  168. package/dist/core/sim-clock.js +291 -0
  169. package/dist/core/system-runner.d.ts +96 -0
  170. package/dist/core/system-runner.d.ts.map +1 -0
  171. package/dist/core/system-runner.js +253 -0
  172. package/dist/core/types.d.ts +111 -0
  173. package/dist/core/types.d.ts.map +1 -0
  174. package/dist/core/types.js +25 -0
  175. package/dist/data/data-asset.d.ts +101 -0
  176. package/dist/data/data-asset.d.ts.map +1 -0
  177. package/dist/data/data-asset.js +122 -0
  178. package/dist/data/data-check-core.d.ts +109 -0
  179. package/dist/data/data-check-core.d.ts.map +1 -0
  180. package/dist/data/data-check-core.js +177 -0
  181. package/dist/data/data-ref.d.ts +79 -0
  182. package/dist/data/data-ref.d.ts.map +1 -0
  183. package/dist/data/data-ref.js +130 -0
  184. package/dist/data/vite-plugin-data.d.ts +79 -0
  185. package/dist/data/vite-plugin-data.d.ts.map +1 -0
  186. package/dist/data/vite-plugin-data.js +217 -0
  187. package/dist/defaults.d.ts +233 -0
  188. package/dist/defaults.d.ts.map +1 -0
  189. package/dist/defaults.js +137 -0
  190. package/dist/dev/chrome-trace.d.ts +45 -0
  191. package/dist/dev/chrome-trace.d.ts.map +1 -0
  192. package/dist/dev/chrome-trace.js +114 -0
  193. package/dist/dev/console-bridge.d.ts +22 -0
  194. package/dist/dev/console-bridge.d.ts.map +1 -0
  195. package/dist/dev/console-bridge.js +71 -0
  196. package/dist/dev/debug-draw.d.ts +24 -0
  197. package/dist/dev/debug-draw.d.ts.map +1 -0
  198. package/dist/dev/debug-draw.js +73 -0
  199. package/dist/dev/instruments.d.ts +133 -0
  200. package/dist/dev/instruments.d.ts.map +1 -0
  201. package/dist/dev/instruments.js +231 -0
  202. package/dist/dev/logger.d.ts +30 -0
  203. package/dist/dev/logger.d.ts.map +1 -0
  204. package/dist/dev/logger.js +90 -0
  205. package/dist/dev/performance-profiler.d.ts +111 -0
  206. package/dist/dev/performance-profiler.d.ts.map +1 -0
  207. package/dist/dev/performance-profiler.js +215 -0
  208. package/dist/dev/render-debug-adapter.d.ts +57 -0
  209. package/dist/dev/render-debug-adapter.d.ts.map +1 -0
  210. package/dist/dev/render-debug-adapter.js +141 -0
  211. package/dist/dev/render-memory.d.ts +53 -0
  212. package/dist/dev/render-memory.d.ts.map +1 -0
  213. package/dist/dev/render-memory.js +190 -0
  214. package/dist/dev/webgl-frame-capture.d.ts +134 -0
  215. package/dist/dev/webgl-frame-capture.d.ts.map +1 -0
  216. package/dist/dev/webgl-frame-capture.js +270 -0
  217. package/dist/dev/webgl-gpu-timer.d.ts +8 -0
  218. package/dist/dev/webgl-gpu-timer.d.ts.map +1 -0
  219. package/dist/dev/webgl-gpu-timer.js +52 -0
  220. package/dist/ecs/scene-index.d.ts +179 -0
  221. package/dist/ecs/scene-index.d.ts.map +1 -0
  222. package/dist/ecs/scene-index.js +331 -0
  223. package/dist/ecs/scene-query.d.ts +6 -0
  224. package/dist/ecs/scene-query.d.ts.map +1 -0
  225. package/dist/ecs/scene-query.js +40 -0
  226. package/dist/ecs/user-data.d.ts +193 -0
  227. package/dist/ecs/user-data.d.ts.map +1 -0
  228. package/dist/ecs/user-data.js +145 -0
  229. package/dist/index.d.ts +35 -0
  230. package/dist/index.d.ts.map +1 -0
  231. package/dist/index.js +29 -0
  232. package/dist/input/input-manager.d.ts +944 -0
  233. package/dist/input/input-manager.d.ts.map +1 -0
  234. package/dist/input/input-manager.js +2209 -0
  235. package/dist/input/input-types.d.ts +174 -0
  236. package/dist/input/input-types.d.ts.map +1 -0
  237. package/dist/input/input-types.js +1 -0
  238. package/dist/input/prompt-labels.d.ts +21 -0
  239. package/dist/input/prompt-labels.d.ts.map +1 -0
  240. package/dist/input/prompt-labels.js +121 -0
  241. package/dist/input/rebind-controller.d.ts +59 -0
  242. package/dist/input/rebind-controller.d.ts.map +1 -0
  243. package/dist/input/rebind-controller.js +85 -0
  244. package/dist/input/schema.d.ts +16 -0
  245. package/dist/input/schema.d.ts.map +1 -0
  246. package/dist/input/schema.js +228 -0
  247. package/dist/loader.d.ts +76 -0
  248. package/dist/loader.d.ts.map +1 -0
  249. package/dist/loader.js +114 -0
  250. package/dist/manifest/editor-port.d.ts +53 -0
  251. package/dist/manifest/editor-port.d.ts.map +1 -0
  252. package/dist/manifest/editor-port.js +67 -0
  253. package/dist/manifest/filename.d.ts +14 -0
  254. package/dist/manifest/filename.d.ts.map +1 -0
  255. package/dist/manifest/filename.js +43 -0
  256. package/dist/manifest/index.d.ts +6 -0
  257. package/dist/manifest/index.d.ts.map +1 -0
  258. package/dist/manifest/index.js +9 -0
  259. package/dist/manifest/load-file.d.ts +7 -0
  260. package/dist/manifest/load-file.d.ts.map +1 -0
  261. package/dist/manifest/load-file.js +23 -0
  262. package/dist/manifest/load.d.ts +161 -0
  263. package/dist/manifest/load.d.ts.map +1 -0
  264. package/dist/manifest/load.js +269 -0
  265. package/dist/manifest/locate.d.ts +24 -0
  266. package/dist/manifest/locate.d.ts.map +1 -0
  267. package/dist/manifest/locate.js +48 -0
  268. package/dist/manifest/schema.d.ts +293 -0
  269. package/dist/manifest/schema.d.ts.map +1 -0
  270. package/dist/manifest/schema.js +633 -0
  271. package/dist/physics/collider-dimensions.d.ts +63 -0
  272. package/dist/physics/collider-dimensions.d.ts.map +1 -0
  273. package/dist/physics/collider-dimensions.js +98 -0
  274. package/dist/physics/collision-system.d.ts +41 -0
  275. package/dist/physics/collision-system.d.ts.map +1 -0
  276. package/dist/physics/collision-system.js +64 -0
  277. package/dist/physics/physics-registry.d.ts +45 -0
  278. package/dist/physics/physics-registry.d.ts.map +1 -0
  279. package/dist/physics/physics-registry.js +65 -0
  280. package/dist/physics/transform-writer.d.ts +16 -0
  281. package/dist/physics/transform-writer.d.ts.map +1 -0
  282. package/dist/physics/transform-writer.js +38 -0
  283. package/dist/pixi/authoring.d.ts +93 -0
  284. package/dist/pixi/authoring.d.ts.map +1 -0
  285. package/dist/pixi/authoring.js +207 -0
  286. package/dist/pixi/index.d.ts +16 -0
  287. package/dist/pixi/index.d.ts.map +1 -0
  288. package/dist/pixi/index.js +15 -0
  289. package/dist/pixi/ingest-iframe.d.ts +82 -0
  290. package/dist/pixi/ingest-iframe.d.ts.map +1 -0
  291. package/dist/pixi/ingest-iframe.js +166 -0
  292. package/dist/pixi/ingest.d.ts +97 -0
  293. package/dist/pixi/ingest.d.ts.map +1 -0
  294. package/dist/pixi/ingest.js +40 -0
  295. package/dist/pixi/physics-registry.d.ts +24 -0
  296. package/dist/pixi/physics-registry.d.ts.map +1 -0
  297. package/dist/pixi/physics-registry.js +38 -0
  298. package/dist/pixi/scene-capture.d.ts +43 -0
  299. package/dist/pixi/scene-capture.d.ts.map +1 -0
  300. package/dist/pixi/scene-capture.js +92 -0
  301. package/dist/pixi/system-adapters.d.ts +16 -0
  302. package/dist/pixi/system-adapters.d.ts.map +1 -0
  303. package/dist/pixi/system-adapters.js +37 -0
  304. package/dist/react/unmanaged-root-detector.d.ts +18 -0
  305. package/dist/react/unmanaged-root-detector.d.ts.map +1 -0
  306. package/dist/react/unmanaged-root-detector.js +70 -0
  307. package/dist/react/use-data.d.ts +60 -0
  308. package/dist/react/use-data.d.ts.map +1 -0
  309. package/dist/react/use-data.js +101 -0
  310. package/dist/react/use-selection.d.ts +54 -0
  311. package/dist/react/use-selection.d.ts.map +1 -0
  312. package/dist/react/use-selection.js +71 -0
  313. package/dist/react/world-state.d.ts +154 -0
  314. package/dist/react/world-state.d.ts.map +1 -0
  315. package/dist/react/world-state.js +220 -0
  316. package/dist/render/auto-batcher.d.ts +34 -0
  317. package/dist/render/auto-batcher.d.ts.map +1 -0
  318. package/dist/render/auto-batcher.js +140 -0
  319. package/dist/render/instance-mesh.d.ts +5 -0
  320. package/dist/render/instance-mesh.d.ts.map +1 -0
  321. package/dist/render/instance-mesh.js +19 -0
  322. package/dist/render/light-camera-factory.d.ts +24 -0
  323. package/dist/render/light-camera-factory.d.ts.map +1 -0
  324. package/dist/render/light-camera-factory.js +71 -0
  325. package/dist/render/lod.d.ts +13 -0
  326. package/dist/render/lod.d.ts.map +1 -0
  327. package/dist/render/lod.js +16 -0
  328. package/dist/render/material-factory.d.ts +15 -0
  329. package/dist/render/material-factory.d.ts.map +1 -0
  330. package/dist/render/material-factory.js +186 -0
  331. package/dist/render/mesh-shadow.d.ts +11 -0
  332. package/dist/render/mesh-shadow.d.ts.map +1 -0
  333. package/dist/render/mesh-shadow.js +19 -0
  334. package/dist/render/particles-factory.d.ts +99 -0
  335. package/dist/render/particles-factory.d.ts.map +1 -0
  336. package/dist/render/particles-factory.js +361 -0
  337. package/dist/render/render-batch-system.d.ts +33 -0
  338. package/dist/render/render-batch-system.d.ts.map +1 -0
  339. package/dist/render/render-batch-system.js +223 -0
  340. package/dist/render/render-features.d.ts +47 -0
  341. package/dist/render/render-features.d.ts.map +1 -0
  342. package/dist/render/render-features.js +105 -0
  343. package/dist/render/render-settings.d.ts +35 -0
  344. package/dist/render/render-settings.d.ts.map +1 -0
  345. package/dist/render/render-settings.js +51 -0
  346. package/dist/render/spark-renderer-lifecycle.d.ts +18 -0
  347. package/dist/render/spark-renderer-lifecycle.d.ts.map +1 -0
  348. package/dist/render/spark-renderer-lifecycle.js +57 -0
  349. package/dist/render/viewport-shading.d.ts +17 -0
  350. package/dist/render/viewport-shading.d.ts.map +1 -0
  351. package/dist/render/viewport-shading.js +87 -0
  352. package/dist/runtime/create-runtime.d.ts +259 -0
  353. package/dist/runtime/create-runtime.d.ts.map +1 -0
  354. package/dist/runtime/create-runtime.js +666 -0
  355. package/dist/runtime/debug-bridge.d.ts +288 -0
  356. package/dist/runtime/debug-bridge.d.ts.map +1 -0
  357. package/dist/runtime/debug-bridge.js +277 -0
  358. package/dist/runtime/debug-registry.d.ts +287 -0
  359. package/dist/runtime/debug-registry.d.ts.map +1 -0
  360. package/dist/runtime/debug-registry.js +528 -0
  361. package/dist/runtime/dev-layers.d.ts +34 -0
  362. package/dist/runtime/dev-layers.d.ts.map +1 -0
  363. package/dist/runtime/dev-layers.js +40 -0
  364. package/dist/runtime/frame-selector-cache.d.ts +41 -0
  365. package/dist/runtime/frame-selector-cache.d.ts.map +1 -0
  366. package/dist/runtime/frame-selector-cache.js +65 -0
  367. package/dist/runtime/game.d.ts +576 -0
  368. package/dist/runtime/game.d.ts.map +1 -0
  369. package/dist/runtime/game.js +1003 -0
  370. package/dist/runtime/gameplay-rng-trap.d.ts +47 -0
  371. package/dist/runtime/gameplay-rng-trap.d.ts.map +1 -0
  372. package/dist/runtime/gameplay-rng-trap.js +95 -0
  373. package/dist/runtime/input-router.d.ts +78 -0
  374. package/dist/runtime/input-router.d.ts.map +1 -0
  375. package/dist/runtime/input-router.js +171 -0
  376. package/dist/runtime/mount-game.d.ts +126 -0
  377. package/dist/runtime/mount-game.d.ts.map +1 -0
  378. package/dist/runtime/mount-game.js +159 -0
  379. package/dist/runtime/mount-manifest.d.ts +174 -0
  380. package/dist/runtime/mount-manifest.d.ts.map +1 -0
  381. package/dist/runtime/mount-manifest.js +304 -0
  382. package/dist/runtime/presentation.d.ts +85 -0
  383. package/dist/runtime/presentation.d.ts.map +1 -0
  384. package/dist/runtime/presentation.js +92 -0
  385. package/dist/runtime/render-audio-control.d.ts +126 -0
  386. package/dist/runtime/render-audio-control.d.ts.map +1 -0
  387. package/dist/runtime/render-audio-control.js +116 -0
  388. package/dist/runtime/render-control.d.ts +347 -0
  389. package/dist/runtime/render-control.d.ts.map +1 -0
  390. package/dist/runtime/render-control.js +317 -0
  391. package/dist/runtime/render-seed.d.ts +56 -0
  392. package/dist/runtime/render-seed.d.ts.map +1 -0
  393. package/dist/runtime/render-seed.js +73 -0
  394. package/dist/runtime/state-bridge.d.ts +60 -0
  395. package/dist/runtime/state-bridge.d.ts.map +1 -0
  396. package/dist/runtime/state-bridge.js +62 -0
  397. package/dist/runtime/types.d.ts +285 -0
  398. package/dist/runtime/types.d.ts.map +1 -0
  399. package/dist/runtime/types.js +1 -0
  400. package/dist/runtime/unexported-game-trap.d.ts +36 -0
  401. package/dist/runtime/unexported-game-trap.d.ts.map +1 -0
  402. package/dist/runtime/unexported-game-trap.js +80 -0
  403. package/dist/setup/setup-audio.d.ts +20 -0
  404. package/dist/setup/setup-audio.d.ts.map +1 -0
  405. package/dist/setup/setup-audio.js +41 -0
  406. package/dist/setup/setup-particles.d.ts +17 -0
  407. package/dist/setup/setup-particles.d.ts.map +1 -0
  408. package/dist/setup/setup-particles.js +16 -0
  409. package/dist/setup/setup-physics.d.ts +25 -0
  410. package/dist/setup/setup-physics.d.ts.map +1 -0
  411. package/dist/setup/setup-physics.js +51 -0
  412. package/dist/setup/setup-renderer.d.ts +82 -0
  413. package/dist/setup/setup-renderer.d.ts.map +1 -0
  414. package/dist/setup/setup-renderer.js +381 -0
  415. package/dist/world3d-react/engine-bridge.d.ts +47 -0
  416. package/dist/world3d-react/engine-bridge.d.ts.map +1 -0
  417. package/dist/world3d-react/engine-bridge.js +48 -0
  418. package/dist/world3d-react/index.d.ts +47 -0
  419. package/dist/world3d-react/index.d.ts.map +1 -0
  420. package/dist/world3d-react/index.js +46 -0
  421. package/dist/world3d-react/r3f-adapter.d.ts +51 -0
  422. package/dist/world3d-react/r3f-adapter.d.ts.map +1 -0
  423. package/dist/world3d-react/r3f-adapter.js +368 -0
  424. package/dist/world3d-react/r3f-root-factory.d.ts +62 -0
  425. package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -0
  426. package/dist/world3d-react/r3f-root-factory.js +79 -0
  427. package/dist/world3d-react/rapier-physics-bridge.d.ts +76 -0
  428. package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -0
  429. package/dist/world3d-react/rapier-physics-bridge.js +120 -0
  430. package/dist/world3d-react/renderer-config.d.ts +58 -0
  431. package/dist/world3d-react/renderer-config.d.ts.map +1 -0
  432. package/dist/world3d-react/renderer-config.js +96 -0
  433. package/dist/world3d-react/world-context.d.ts +123 -0
  434. package/dist/world3d-react/world-context.d.ts.map +1 -0
  435. package/dist/world3d-react/world-context.js +204 -0
  436. package/dist-config/config.js +303 -0
  437. package/dist-config/config.js.map +7 -0
  438. package/package.json +14 -3
  439. package/src/adapter/rapier-physics-adapter.ts +77 -34
  440. package/src/config.ts +8 -0
  441. package/src/core/frame-pacing.ts +26 -0
  442. package/src/core/game-loop.ts +4 -3
  443. package/src/dev/instruments.ts +302 -0
  444. package/src/runtime/mount-game.ts +6 -0
  445. package/src/runtime/unexported-game-trap.ts +82 -0
  446. package/src/setup/setup-renderer.ts +2 -0
  447. package/src/world3d-react/index.ts +9 -0
  448. package/src/world3d-react/rapier-physics-bridge.tsx +137 -0
@@ -0,0 +1,30 @@
1
+ /**
2
+ * `AdapterSurface` — the kinds of render surface a world can be (T7.1/T7.3/T6.2).
3
+ *
4
+ * Moved here from `runtime/game.ts`
5
+ * so `adapter/root-adapter.ts`'s kind-tagged `MountedRoot` types can name it
6
+ * without a value-level import cycle (`runtime/game.ts` type-imports from
7
+ * `adapter/root-adapter.ts` already). This is a leaf module — it imports
8
+ * nothing — so anything may import it with zero risk of a cycle.
9
+ * `runtime/game.ts` re-exports this SAME type (`export type { AdapterSurface }`),
10
+ * so no existing `import type { AdapterSurface } from '../runtime/game'` call site
11
+ * needed to change.
12
+ */
13
+ export type AdapterSurface = 'three' | 'canvas' | 'dom';
14
+ /**
15
+ * Exhaustiveness guard for `AdapterSurface` dispatch (v4 architecture-review
16
+ * §7.4-2: a hypothetical 4th kind must fail to COMPILE at every kind-dispatch
17
+ * site, not silently contribute nothing or silently default to an existing
18
+ * kind). Lives here — colocated with the kind vocabulary itself, not in a
19
+ * generic util module — so the three call sites that need it
20
+ * (`runtime/create-runtime.ts`'s mount loop, `editor/adapter-resolver.ts`'s
21
+ * `resolveAllRoots`, `editor/play-mode.ts`'s `installMultiRootAuthoring`)
22
+ * import it from the same leaf module that defines `AdapterSurface`, keeping the
23
+ * type and its guard from drifting apart. The `never` parameter is the
24
+ * compile-time half of the guard (TS refuses to call this with anything the
25
+ * compiler hasn't already narrowed to zero remaining variants); the thrown
26
+ * Error is the runtime half, in case a value's static type lied (e.g. data
27
+ * crossing a JSON boundary).
28
+ */
29
+ export declare function assertNever(value: never, context?: string): never;
30
+ //# sourceMappingURL=adapter-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-surface.d.ts","sourceRoot":"","sources":["../../src/adapter/adapter-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAIjE"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Exhaustiveness guard for `AdapterSurface` dispatch (v4 architecture-review
3
+ * §7.4-2: a hypothetical 4th kind must fail to COMPILE at every kind-dispatch
4
+ * site, not silently contribute nothing or silently default to an existing
5
+ * kind). Lives here — colocated with the kind vocabulary itself, not in a
6
+ * generic util module — so the three call sites that need it
7
+ * (`runtime/create-runtime.ts`'s mount loop, `editor/adapter-resolver.ts`'s
8
+ * `resolveAllRoots`, `editor/play-mode.ts`'s `installMultiRootAuthoring`)
9
+ * import it from the same leaf module that defines `AdapterSurface`, keeping the
10
+ * type and its guard from drifting apart. The `never` parameter is the
11
+ * compile-time half of the guard (TS refuses to call this with anything the
12
+ * compiler hasn't already narrowed to zero remaining variants); the thrown
13
+ * Error is the runtime half, in case a value's static type lied (e.g. data
14
+ * crossing a JSON boundary).
15
+ */
16
+ export function assertNever(value, context) {
17
+ throw new Error(`Unreachable${context ? ` ${context}` : ''}: unexpected value ${JSON.stringify(value)}`);
18
+ }
@@ -0,0 +1,597 @@
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 `MountedThreeRoot.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 { Transform } from './transform';
24
+ /**
25
+ * Booleans the editor UI gates affordances on (hide what an adapter can't do).
26
+ *
27
+ * Deliberately SMALL: a capability flag earns its place only when the shell
28
+ * actually branches on it. Structural affordances (create/delete/reparent) are
29
+ * gated by `structure` PROVIDER PRESENCE instead — the flag and the provider
30
+ * cannot disagree that way. (WO-2 deleted `material`/`create`/`delete`/
31
+ * `reparent`/`layout`, which no shell code ever read.)
32
+ */
33
+ export interface AuthoringCapabilities {
34
+ transform: boolean;
35
+ inspectorFields: boolean;
36
+ persist: boolean;
37
+ }
38
+ /**
39
+ * The adapter's own answer to "what is truth behind these rows, and how
40
+ * writable is it" (spec 29 §5). Provenance never varies WITHIN one adapter's
41
+ * rows — it is a property of the world boundary — so it is declared ONCE per
42
+ * adapter and rendered at the SEAM (the composite's `world:<id>` group row,
43
+ * or the panel header for a bare adapter), never per row. Only the adapter
44
+ * knows its truth: the shell must read this field, never guess from adapter
45
+ * identity (rule zero). Machine-readable operation gates stay in {@link
46
+ * AuthoringCapabilities}/provider presence — this type carries the HUMAN
47
+ * explanation those gates can point at when an affordance is present but
48
+ * unavailable.
49
+ */
50
+ export interface AuthoringProvenance {
51
+ /**
52
+ * What the rows project:
53
+ * - `document` — an authored data file the editor owns (e.g. a scene file);
54
+ * - `source-code` — the game's own source is the document (e.g. JSX);
55
+ * - `foreign` — a live tree the editor does not own (an unmodified external
56
+ * game, or any world edited only through an overlay); edits go to the
57
+ * overlay, never the source;
58
+ * - `live` — a running game adopted at play time; edits are not persisted;
59
+ * - `boundary` — a declared world with no live editing surface here.
60
+ */
61
+ source: 'document' | 'source-code' | 'foreign' | 'live' | 'boundary';
62
+ /** Short badge text the shell shows verbatim at the seam (e.g. "scene",
63
+ * "jsx", "overlay", "read-only", "live"). */
64
+ label: string;
65
+ /** One sentence explaining the truth/writability — shown as the seam
66
+ * badge's tooltip and as the reason on disabled affordances. */
67
+ detail: string;
68
+ }
69
+ /**
70
+ * Semantic place a node occupies in the universal authoring hierarchy.
71
+ *
72
+ * `kind` below remains the adapter's native kind (`mesh`, `button`,
73
+ * `pixi-container`, ...). `role` says what the row MEANS to the editor shell,
74
+ * so presentation and interaction never have to infer semantics from an id,
75
+ * label, or substrate-specific kind string.
76
+ */
77
+ export type EditorNodeRole = 'folder' | 'root' | 'document' | 'story' | 'component' | 'instance' | 'element' | 'entity' | 'boundary';
78
+ /** A node in the authoring hierarchy — format-neutral (not a `SceneEntity`). */
79
+ export interface EditorNode {
80
+ /** STABLE id — survives reload (see ingest structural-path ids). */
81
+ id: string;
82
+ label: string;
83
+ /** Adapter-declared semantic role. Optional for third-party/older adapters;
84
+ * the shell falls back to the native `kind` only for icon selection. */
85
+ role?: EditorNodeRole;
86
+ /** Optional source-owned context kept visually subordinate to `label`, such
87
+ * as `<header>` beneath a React component name or a document's file path. */
88
+ secondaryLabel?: string;
89
+ kind: 'mesh' | 'light' | 'camera' | 'group' | 'object' | (string & {});
90
+ /**
91
+ * What to CALL this node's type in the inspector header — the component or
92
+ * class an author thinks of it as, when that differs from the native `kind`
93
+ * the shell uses to pick an icon. An `<Enemy>` renders a `group`, but "group"
94
+ * is a fact about its implementation, not its identity; Godot names the class
95
+ * here and Unity names the prefab. Adapters that omit it keep showing `kind`.
96
+ */
97
+ typeLabel?: string;
98
+ parentId: string | null;
99
+ childIds: string[];
100
+ }
101
+ export interface PropertyDescriptor {
102
+ path: string;
103
+ label: string;
104
+ type: 'string' | 'number' | 'boolean' | 'vec3' | 'color' | 'enum' | 'asset' | 'json';
105
+ readonly?: boolean;
106
+ options?: unknown[];
107
+ /**
108
+ * Optional domain-shaped grouping (T3.4 slice 2): properties sharing the
109
+ * same `group` label render together under a titled sub-section in the
110
+ * generic inspector, instead of the flat property grid. Backward-compatible
111
+ * — omitted (or two descriptors with different/no `group`) renders exactly
112
+ * as before this field existed. This is the ONLY authoring-richness
113
+ * addition v1 makes; there is no schema and no new PropertyDescriptor
114
+ * `type` — a custom adapter reports its own domain concepts
115
+ * (health/score/an enum, …) through the SAME provider, merely labeled into
116
+ * a named group.
117
+ */
118
+ group?: string;
119
+ /**
120
+ * The value shown is the DECLARED DEFAULT — the document does not carry this
121
+ * property, the thing that owns it does. Every mainstream inspector
122
+ * distinguishes these (Unity greys an unmodified field and bolds an
123
+ * overridden one) because otherwise you cannot tell what a document actually
124
+ * says from what it merely inherits. Editing a defaulted property writes it
125
+ * into the document for the first time.
126
+ */
127
+ defaulted?: boolean;
128
+ /**
129
+ * This property can be REMOVED from the document, reverting it to the
130
+ * declared default — Unity's revert arrow, Godot's reset arrow. Only set when
131
+ * removal is legal: the owner declares the property optional (or gives it a
132
+ * default), so dropping it leaves a still-valid document. The inverse of
133
+ * editing a `defaulted` property.
134
+ */
135
+ resettable?: boolean;
136
+ /**
137
+ * The SOURCE TEXT of the default a revert returns this property to (`1.55`,
138
+ * `'raider'`), so the revert affordance can name its destination instead of
139
+ * saying "default" and hoping.
140
+ *
141
+ * Set ONLY when the owner actually declares a default the adapter can read.
142
+ * Absence is the honest, common case: an optional property with no declared
143
+ * default is still removable — what takes over is then the owner's own
144
+ * internal fallback or nothing at all, which this side does not know. Never
145
+ * fill it with the property's CURRENT value: that is what the author is
146
+ * discarding, not what they get back.
147
+ */
148
+ revertsTo?: string;
149
+ }
150
+ export interface HierarchyProvider {
151
+ roots(): EditorNode[];
152
+ node(id: string): EditorNode | null;
153
+ /**
154
+ * OPTIONAL, THREE-SPECIFIC — the live `Object3D` for raycast/gizmo binding
155
+ * (null for a node this adapter has no object for). A Pixi, DOM or React
156
+ * adapter has no `Object3D` at all: it OMITS this method rather than
157
+ * implementing a `() => null` stub that pretends the concept applies. Callers
158
+ * already treat `null` as "no object here", so absence and `null` mean the
159
+ * same thing to them — optional-chain it (`hierarchy.object3D?.(id) ?? null`).
160
+ */
161
+ object3D?(id: string): THREE.Object3D | null;
162
+ /** OPTIONAL, THREE-SPECIFIC — inverse of {@link object3D}. Same rule: an
163
+ * adapter with no `Object3D` tree omits it. */
164
+ idForObject3D?(o: THREE.Object3D): string | null;
165
+ }
166
+ export interface SelectionProvider {
167
+ get(): string[];
168
+ set(ids: string[]): void;
169
+ /** Resolve a raw native/render hit to the semantic authoring subject. The
170
+ * shell must not infer ownership from ancestry or substrate-specific kinds.
171
+ * Older adapters may omit this; raw ids then remain the selection ids. */
172
+ resolve?(rawId: string, options?: {
173
+ intent?: 'normal' | 'deep';
174
+ scopeId?: string | null;
175
+ }): SelectionResolution | null;
176
+ }
177
+ /** Adapter-owned result of semantic selection resolution: the raw native/render
178
+ * hit mapped to the node the author actually means. (The former
179
+ * `inspectorId`/`transformId`/`boundaryId` aliases were never read by the
180
+ * shell — deleted in WO-2.) */
181
+ export interface SelectionResolution {
182
+ /** Hierarchy selection and Inspector subject. */
183
+ id: string;
184
+ }
185
+ export type TransformChannel = 'position' | 'rotation' | 'scale';
186
+ export interface TransformEditability {
187
+ writable: boolean;
188
+ /** Human-facing explanation for a disabled gizmo/field. */
189
+ reason?: string;
190
+ }
191
+ export interface TransformProvider {
192
+ /** Honest inspector presentation for the substrate's transform vocabulary. */
193
+ dimensions?(id: string): '2d' | '3d' | null;
194
+ get(id: string): Transform;
195
+ /** Pre-gesture persistence check. Omitted means the adapter's transform
196
+ * capability applies uniformly. A false result must suppress manipulation
197
+ * before the live object is moved, never discover refusal at drag end. */
198
+ editability?(id: string, channel: TransformChannel): TransformEditability;
199
+ /** Pause whatever controller fights the gizmo (physics/script) for editing. */
200
+ beginEdit(id: string): void;
201
+ apply(id: string, t: Transform): void;
202
+ endEdit(id: string): void;
203
+ }
204
+ /**
205
+ * One transform gesture event (see {@link AuthoringAdapter.observeTransforms}).
206
+ * `live` is a mid-gesture preview pose (the gizmo's live drag path); `commit`
207
+ * closes the gesture.
208
+ */
209
+ export interface TransformObservation {
210
+ readonly id: string;
211
+ readonly transform: Transform;
212
+ readonly phase: 'live' | 'commit';
213
+ }
214
+ export interface InspectorProvider {
215
+ /** Schema-driven — NOT fixed to `SceneEntity`. */
216
+ properties(id: string): PropertyDescriptor[];
217
+ get(id: string, path: string): unknown;
218
+ set(id: string, path: string, value: unknown): void;
219
+ /**
220
+ * Optional — REMOVE a property's authored override entirely (not "set to a
221
+ * value"), letting whatever governs it in its absence take over. The one
222
+ * concrete need today: a longhand CSS override (`style.borderTopLeftRadius`)
223
+ * that a uniform edit of its shorthand (`style.borderRadius`) must clear so
224
+ * the shorthand actually wins, instead of leaving a stale longhand that
225
+ * silently overrides it on reload (spec 27 §5 C2, U2). Adapters with no
226
+ * removable-override concept simply omit it — callers optional-chain.
227
+ */
228
+ remove?(id: string, path: string): void;
229
+ }
230
+ /**
231
+ * An authored node that is itself an asset, even when its bytes are embedded
232
+ * in another source document instead of living at a standalone project path.
233
+ *
234
+ * The first concrete case is inline SVG in a DOM/React root: its `<path>` and
235
+ * `<g>` implementation is no more part of the authoring hierarchy than the
236
+ * meshes inside an imported model. The adapter owns the native-to-asset
237
+ * conversion; the shell only opens the returned image in its ordinary Asset
238
+ * Editor document.
239
+ */
240
+ export interface AuthoringAssetSubject {
241
+ readonly kind: 'image';
242
+ readonly name: string;
243
+ readonly mediaType: 'image/svg+xml';
244
+ readonly text: string;
245
+ /** Project-root-relative source definition, when the adapter can prove it. */
246
+ readonly sourcePath?: string;
247
+ }
248
+ export interface AssetSubjectProvider {
249
+ get(id: string): AuthoringAssetSubject | null;
250
+ /**
251
+ * Assets known to this authoring document even when they are not in its
252
+ * currently focused hierarchy projection. React story boards use this to
253
+ * expose SVGs mounted in inactive story frames without flattening those
254
+ * frames into the active hierarchy.
255
+ */
256
+ entries?(): ReadonlyArray<{
257
+ id: string;
258
+ subject: AuthoringAssetSubject;
259
+ }>;
260
+ }
261
+ export interface StructureProvider {
262
+ create(kind: string, parentId?: string): string;
263
+ /**
264
+ * Remove `id`. May optionally return an awaitable (`Promise<void>`) when the
265
+ * underlying write is asynchronous (e.g. a react-world source-file edit) —
266
+ * `deleteSelection` (`editor-hotkeys.ts`) awaits it per id so a same-file
267
+ * multi-delete's writes land strictly one at a time (see that function's own
268
+ * doc comment for why serialization + deletion order together are what make
269
+ * a per-id loop sound for an adapter whose OID index isn't reindexed between
270
+ * writes). An adapter with a synchronous/in-memory remove (e.g.
271
+ * `UIAuthoringAdapter`) returns `void` — `await`ing it is a harmless no-op.
272
+ */
273
+ remove(id: string): void | Promise<void>;
274
+ duplicate(id: string): string;
275
+ reparent(id: string, newParentId: string | null): void;
276
+ /** Reorder `id` to sit immediately before `beforeSiblingId` among its siblings
277
+ * (`null` = move to the end). Absent ⇒ the shell has no sibling-reorder UI
278
+ * for this adapter. */
279
+ reorder?(id: string, beforeSiblingId: string | null): void;
280
+ /**
281
+ * The kinds `create` accepts for a given parent (`null` parentId = a new
282
+ * root), each with a display label — drives the shell's creation palette.
283
+ * Absent ⇒ the palette shows nothing for this adapter, even though `create`
284
+ * itself may still work when called directly (e.g. programmatically, or by
285
+ * an adapter-specific affordance outside the generic palette).
286
+ */
287
+ creatableKinds?(parentId: string | null): {
288
+ kind: string;
289
+ label: string;
290
+ }[];
291
+ /** D3 (spec 27 §6) — wrap `id` in a new container element (default tag
292
+ * adapter-chosen, e.g. a `div`), re-parenting `id` as that container's sole
293
+ * child. Absent ⇒ the shell's context menu shows no Wrap item for this
294
+ * adapter. */
295
+ wrap?(id: string, wrapperTag?: string): void;
296
+ /** D3 (spec 27 §6) — replace `id` with its own children (the inverse of
297
+ * `wrap`). Absent ⇒ the shell's context menu shows no Unwrap item for this
298
+ * adapter. */
299
+ unwrap?(id: string): void;
300
+ /** Group sibling authoring objects beneath one new spatial parent. The
301
+ * adapter owns transform preservation, persistence, and undo semantics.
302
+ * Returns the new group id, or null when the selection cannot be grouped. */
303
+ group?(ids: readonly string[]): string | null;
304
+ /** Dissolve a plain spatial group and return the ids of its promoted
305
+ * children. Absent means this adapter has no lossless ungroup operation. */
306
+ ungroup?(id: string): string[];
307
+ /** Preflight for an Ungroup affordance. Omit when ungroup is never offered. */
308
+ canUngroup?(id: string): boolean;
309
+ /**
310
+ * D4.R2 (spec27 §6 D4 reopen) — remove every id in `ids` as ONE undoable
311
+ * op (a single Ctrl+Z restores the whole batch), instead of the caller
312
+ * looping `remove(id)` per id (which — one `remove` call = one undo push
313
+ * per adapter, by design — produces N separate undo entries: Ctrl+Z then
314
+ * restores them one at a time, asymmetric with the first-party adapter's
315
+ * own single batched multi-delete undo). Absent ⇒ the shell falls back to
316
+ * the per-id `remove` loop (today's N-entry behavior, unchanged) — an
317
+ * honest degrade, not a silent behavior change, for any adapter that
318
+ * hasn't implemented batching. May optionally return an awaitable
319
+ * (`Promise<void>`), same widening `remove` documents above and for the
320
+ * same reason (delete-order-residual fix): `deleteSelection`
321
+ * (`editor-hotkeys.ts`) awaits it so the caller can rely on the whole
322
+ * batch's write having landed before it returns. A synchronous/in-memory
323
+ * implementation (e.g. `UIAuthoringAdapter`'s) returns `void` — awaiting it
324
+ * is a harmless no-op.
325
+ */
326
+ removeMany?(ids: readonly string[]): void | Promise<void>;
327
+ }
328
+ /**
329
+ * PersistenceProvider — whether and where an adapter's edits persist (design).
330
+ * The ACTIVE adapter's provider is the ONE place this is decided — the host
331
+ * (editor) never hard-codes a destination or guards on session flags; it asks the
332
+ * provider.
333
+ */
334
+ export interface PersistenceProvider {
335
+ isDirty(): boolean;
336
+ /** Save to the adapter's OWN source of truth (.vscn / overlay file / …). */
337
+ save(): Promise<void>;
338
+ /**
339
+ * Human/agent-readable destination this provider persists to — e.g.
340
+ * `"scenes/main.vscn.json"`, `"live-only (not saved)"`, or `"ephemeral
341
+ * (discarded on stop)"`. Drives the save-status UI and makes routing
342
+ * inspectable (design §2). Implementers whose destination can change during
343
+ * the session (e.g. the first-party provider tracks the loaded `.vscn` path)
344
+ * should expose this as a live getter rather than a value captured once.
345
+ */
346
+ readonly destination: string;
347
+ /**
348
+ * The reload contract (design §5): apply an external change to this
349
+ * provider's persisted artifact into the RUNNING session (e.g. a file-watcher
350
+ * update to the `.vscn` or the overlay). Absent ⇒ the host must remount to
351
+ * pick up external changes (the honest floor). Implemented (T3.2 slice 3) by
352
+ * the first-party provider (`applyExternalUpdate`) and the ingest overlay
353
+ * provider (`applyOverlay`); absent (correctly) on the ephemeral provider.
354
+ *
355
+ * `rawContent`, when the host has it (the file-watcher SSE payload carries the
356
+ * artifact's exact bytes), is an OPTIONAL second parameter enabling own-echo
357
+ * detection — an event that is exactly what this provider itself last wrote is
358
+ * its own save reflected back, and should be skipped even outside the normal
359
+ * debounce window (see `EditorStore.applyExternalUpdate`'s doc comment). This
360
+ * stays optional/provider-specific — only the first-party provider currently
361
+ * uses it — so other implementers can ignore the parameter entirely.
362
+ */
363
+ applyExternal?(content: unknown, rawContent?: string): void;
364
+ }
365
+ /** D8 — mutually-exclusive root groups (radio roots): e.g. a "Scenes" group whose
366
+ * members are the game's scene roots, only one of which is loaded/active at a
367
+ * time (unlike ordinary sibling roots, which all coexist). */
368
+ export interface RootGroup {
369
+ id: string;
370
+ label: string;
371
+ memberRootIds: string[];
372
+ activeRootId: string | null;
373
+ }
374
+ export interface RootGroupsProvider {
375
+ groups(): RootGroup[];
376
+ activate(groupId: string, rootId: string): Promise<void> | void;
377
+ }
378
+ /** D8 — data-file → root mapping ("opening a file" = activating its root). */
379
+ export interface FileMapProvider {
380
+ /** project-relative path → node id this adapter maps it to, else null. */
381
+ rootForFile(path: string): string | null;
382
+ }
383
+ /** D12 — per-layer viewport picking. Coordinates are client (browser) px. */
384
+ export interface PickProvider {
385
+ pick(clientX: number, clientY: number): string | null;
386
+ }
387
+ /** D4 — storybook stories. */
388
+ export interface StoryRef {
389
+ id: string;
390
+ label: string;
391
+ }
392
+ export interface StoriesProvider {
393
+ storiesFor(nodeId: string): StoryRef[];
394
+ active(nodeId: string): string | null;
395
+ apply(nodeId: string, storyId: string | null): void;
396
+ /** Render ONLY this node against the story (storybook canvas); null exits. */
397
+ isolate?(nodeId: string | null, storyId?: string): void;
398
+ }
399
+ /**
400
+ * Where a drop landed, when the shell knows. The VIEWPORT knows a world point
401
+ * (its ground-plane raycast under the cursor); the hierarchy panel does not,
402
+ * and passes nothing. Optional both ways: an adapter with no placement concept
403
+ * ignores it, and a caller with no point omits it — so neither side has to
404
+ * pretend. Coordinates are world-space, in the adapter's own units.
405
+ */
406
+ export interface AssetDropContext {
407
+ readonly position?: readonly [number, number, number];
408
+ }
409
+ /** Asset drop (hierarchy + viewport). */
410
+ export interface AssetDropProvider {
411
+ accepts(nodeId: string, assetPath: string): boolean;
412
+ drop(nodeId: string, assetPath: string, context?: AssetDropContext): void | Promise<void>;
413
+ }
414
+ /** Plain-object rect shape shared by {@link RectProvider} — the same fields a real
415
+ * `DOMRect` carries (a subset, so a real `DOMRect` satisfies this structurally too).
416
+ * See {@link RectProvider} for the coordinate space (host-relative, not viewport). */
417
+ export interface DOMRectLike {
418
+ x: number;
419
+ y: number;
420
+ width: number;
421
+ height: number;
422
+ }
423
+ /** Per-node screen geometry — the KEYSTONE omission today (nothing produces rects the
424
+ * ported inspect.ts math consumes). Coordinates are **host-relative** px: relative to
425
+ * the adapter's own mounted world surface (its `position:absolute; inset:0` layer), the
426
+ * same surface the A3 selection overlay is hosted over, so the overlay can draw against
427
+ * these rects directly. (NOT viewport-client — the JSDoc formerly said so in error.) */
428
+ export interface RectProvider {
429
+ /** selectable node id → its current bounding rect, or null if unmounted/offscreen */
430
+ rect(id: string): {
431
+ x: number;
432
+ y: number;
433
+ width: number;
434
+ height: number;
435
+ } | null;
436
+ /** rects of layout-relevant neighbours, for snap/measure/box-model overlays */
437
+ contextRects?(id: string): {
438
+ parent?: DOMRectLike;
439
+ siblings?: DOMRectLike[];
440
+ paddingBox?: DOMRectLike;
441
+ };
442
+ /**
443
+ * D3 (spec 27 §6) — every currently-empty container this adapter's tree
444
+ * contains right now: no visible children, no text, a collapsed dimension
445
+ * (the `ui-source/inspect.ts:findEmptyContainers` math) — each with a
446
+ * grown-to-tappable placeholder rect and a display name, driving the
447
+ * overlay's dashed empty-container hint. Host-relative, same coordinate
448
+ * space as {@link rect}. Absent ⇒ this adapter has no "empty container"
449
+ * concept (e.g. an adapter with no structural containers at all) — no
450
+ * hints are drawn for it.
451
+ */
452
+ emptyContainers?(): {
453
+ id: string;
454
+ rect: DOMRectLike;
455
+ displayName: string;
456
+ }[];
457
+ }
458
+ /** One adapter-owned reference point rendered by the shared world overlay.
459
+ * Coordinates are host-relative px, the same frame as {@link RectProvider}.
460
+ * A provider deliberately exposes at most one point for a node so coincident
461
+ * native concepts (for example an anchor and pivot) never become ambiguous. */
462
+ export interface BoxEditReferencePoint {
463
+ /** True when the native source constrains this point (for example a
464
+ * normalized 0..1 Sprite anchor). The overlay then uses only exact native
465
+ * snap points, never an unreachable axis-aligned bounding-box target. */
466
+ bounded?: boolean;
467
+ id: string;
468
+ kind: 'anchor' | 'pivot';
469
+ label: string;
470
+ /** Exact host-space points the native reference can reach and should snap
471
+ * to. Useful for transformed corner/edge/center grids on rotated content. */
472
+ snapPoints?: ReadonlyArray<{
473
+ x: number;
474
+ y: number;
475
+ }>;
476
+ x: number;
477
+ y: number;
478
+ }
479
+ /** Spatial gesture → source/data write, for non-Object3D (DOM) nodes. Distinct from the
480
+ * 3D TransformProvider. begin/apply/end bracket a single undo step; apply is live-preview. */
481
+ export interface BoxEditProvider {
482
+ begin(id: string): void;
483
+ /** patch: any of x,y,width,height,marginTop… paddingLeft… — px deltas or absolutes.
484
+ * `referenceX`/`referenceY` are the absolute host-relative coordinates of
485
+ * the active {@link referencePoint}; only providers exposing that optional
486
+ * capability receive those keys. The provider owns conversion to native
487
+ * source units and any placement-preserving compensation. */
488
+ apply(id: string, patch: Record<string, number>): void;
489
+ end(id: string): void;
490
+ /** Optional single native anchor/pivot affordance for this node. */
491
+ referencePoint?(id: string): BoxEditReferencePoint | null;
492
+ }
493
+ /** Text-content editing — currently OFF-contract (the react adapter has an `editText(id)`
494
+ * method, react-world-authoring-adapter.ts:728, not reachable via the contract). Bring it
495
+ * on so the overlay's double-click-to-edit-text (D3) is contract-driven. */
496
+ export interface TextProvider {
497
+ /** the element's editable pure-text, or null if the body is dynamic/has child elements */
498
+ get(id: string): string | null;
499
+ set(id: string, text: string): void;
500
+ }
501
+ /**
502
+ * D3 (spec 27 §6) — background-color sampling at a viewport point, for the
503
+ * eyedropper's FALLBACK path (browsers with no native `EyeDropper` API). The
504
+ * native API, where available, samples real rendered pixels itself and needs
505
+ * none of this. Distinct from {@link PickProvider} (which returns a node id,
506
+ * not a color) and from `InspectorProvider.get('style.backgroundColor')`
507
+ * (which NORMALIZES to `#rrggbb` and so loses the "transparent" signal a
508
+ * color CHAIN walk needs — see `ui-source/inspect.ts:effectiveColorFromChain`'s
509
+ * doc comment: it walks raw, un-normalized CSS values looking for the first
510
+ * non-transparent one).
511
+ */
512
+ export interface ColorSampleProvider {
513
+ /** Raw (un-normalized) CSS `background-color` values, hit-element FIRST,
514
+ * walking up its ancestor chain — the exact shape
515
+ * `effectiveColorFromChain` consumes. `null` when nothing is hit at the
516
+ * point. Client (viewport) px, matching {@link PickProvider}. */
517
+ backgroundChainAt(clientX: number, clientY: number): string[] | null;
518
+ }
519
+ /**
520
+ * WO-IDX1 — where a node's live object was CREATED in the game's own source.
521
+ *
522
+ * `display` is the `file:line` the editor shows verbatim. The unanchored shape
523
+ * carries a `reason` rather than a blank, because "we don't know" and "a
524
+ * library built it" are different facts and neither may present as silence
525
+ * (the honest-floor rule).
526
+ */
527
+ export type NodeCreationSite = {
528
+ anchored: true;
529
+ file: string;
530
+ line: number;
531
+ col: number;
532
+ display: string;
533
+ } | {
534
+ anchored: false;
535
+ reason: string;
536
+ };
537
+ /**
538
+ * Absent ⇒ this adapter's substrate has no creation-site index at all (a
539
+ * document-backed world's truth is the document, not a construction site).
540
+ * Present ⇒ every id gets an answer, anchored or reasoned.
541
+ */
542
+ export interface CreationSiteProvider {
543
+ anchor(id: string): NodeCreationSite;
544
+ }
545
+ export interface AuthoringAdapter {
546
+ readonly capabilities: AuthoringCapabilities;
547
+ /** Spec 29 §5 — seam-level provenance ("what is truth behind these rows").
548
+ * Absent ⇒ the shell shows no provenance badge (degrade silently — never
549
+ * fabricate a claim the adapter didn't make). */
550
+ readonly provenance?: AuthoringProvenance;
551
+ readonly hierarchy: HierarchyProvider;
552
+ readonly selection?: SelectionProvider;
553
+ readonly transforms?: TransformProvider;
554
+ readonly inspector?: InspectorProvider;
555
+ /** The selected node is an atomic asset that can open in the Asset Editor. */
556
+ readonly assetSubject?: AssetSubjectProvider;
557
+ readonly structure?: StructureProvider;
558
+ readonly persistence?: PersistenceProvider;
559
+ /** D8 — mutually-exclusive root groups (radio roots). Absent ⇒ no grouped roots. */
560
+ readonly rootGroups?: RootGroupsProvider;
561
+ /** D8 — data-file → root mapping. Absent ⇒ this adapter maps no files to roots. */
562
+ readonly files?: FileMapProvider;
563
+ /** D12 — per-layer viewport picking. Absent ⇒ this adapter is not pickable. */
564
+ readonly pickable?: PickProvider;
565
+ /** T0 (spec 27 §2) — per-node screen geometry for a DOM visual editor's overlay/
566
+ * snap/measure math. Absent ⇒ this adapter produces no rects (no overlay). */
567
+ readonly rects?: RectProvider;
568
+ /** T0 (spec 27 §2) — spatial drag-resize/move → source/data write for non-Object3D
569
+ * (DOM) nodes. Absent ⇒ no box-edit gesture for this adapter. */
570
+ readonly boxEdit?: BoxEditProvider;
571
+ /** T0 (spec 27 §2) — double-click-to-edit-text on the contract (wires the react
572
+ * adapter's existing off-contract `editText`). Absent ⇒ no in-place text edit. */
573
+ readonly text?: TextProvider;
574
+ /** D3 (spec 27 §6) — eyedropper fallback color sampling. Absent ⇒ the
575
+ * canvas eyedropper swatch has no non-native path for this adapter. */
576
+ readonly colorSample?: ColorSampleProvider;
577
+ /** D4 — storybook stories. Absent ⇒ no stories for any node in this adapter. */
578
+ readonly stories?: StoriesProvider;
579
+ /** WO-IDX1 — the source location that constructed a node's live object.
580
+ * Absent ⇒ this adapter indexes no creation sites. */
581
+ readonly creationSite?: CreationSiteProvider;
582
+ /** Asset drop (hierarchy + viewport). Absent ⇒ this adapter accepts no drops. */
583
+ readonly assetDrop?: AssetDropProvider;
584
+ /** Change notification → UI refresh. */
585
+ subscribe?(listener: () => void): () => void;
586
+ /**
587
+ * Observe transform GESTURES on this adapter's nodes — the one seam the
588
+ * animation sequencer needs to record a drag as keyframes and to refresh its
589
+ * design baselines. Deliberately narrow (one event shape, one consumer, no
590
+ * general event bus): before it existed, the sequencer could only observe
591
+ * the first-party store's own `.vscn` transform path, so a live or
592
+ * source-backed world's gestures were invisible to it. Absent ⇒ this
593
+ * adapter reports no gestures.
594
+ */
595
+ observeTransforms?(listener: (event: TransformObservation) => void): () => void;
596
+ }
597
+ //# sourceMappingURL=authoring.d.ts.map