@forgeax/engine-app 0.0.0-dev.8d955ade1c79

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 (348) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +424 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/__tests__/animation-asset-lookup.unit.test.d.ts +2 -0
  5. package/dist/__tests__/animation-asset-lookup.unit.test.d.ts.map +1 -0
  6. package/dist/__tests__/callback-deletion.unit.test.d.ts +2 -0
  7. package/dist/__tests__/callback-deletion.unit.test.d.ts.map +1 -0
  8. package/dist/__tests__/callback-inference.test-d.d.ts +2 -0
  9. package/dist/__tests__/callback-inference.test-d.d.ts.map +1 -0
  10. package/dist/__tests__/component-introspection.unit.test.d.ts +2 -0
  11. package/dist/__tests__/component-introspection.unit.test.d.ts.map +1 -0
  12. package/dist/__tests__/consumer-migration.unit.test.d.ts +2 -0
  13. package/dist/__tests__/consumer-migration.unit.test.d.ts.map +1 -0
  14. package/dist/__tests__/create-app-error-retention.integration.test.d.ts +2 -0
  15. package/dist/__tests__/create-app-error-retention.integration.test.d.ts.map +1 -0
  16. package/dist/__tests__/create-app-features.test.d.ts +2 -0
  17. package/dist/__tests__/create-app-features.test.d.ts.map +1 -0
  18. package/dist/__tests__/create-app-listener-sync.test.d.ts +2 -0
  19. package/dist/__tests__/create-app-listener-sync.test.d.ts.map +1 -0
  20. package/dist/__tests__/create-app-lock-provider.test.d.ts +2 -0
  21. package/dist/__tests__/create-app-lock-provider.test.d.ts.map +1 -0
  22. package/dist/__tests__/create-app-physics-plugin-failure.integration.test.d.ts +2 -0
  23. package/dist/__tests__/create-app-physics-plugin-failure.integration.test.d.ts.map +1 -0
  24. package/dist/__tests__/create-app-plugin.test.d.ts +2 -0
  25. package/dist/__tests__/create-app-plugin.test.d.ts.map +1 -0
  26. package/dist/__tests__/create-app-stop.test.d.ts +2 -0
  27. package/dist/__tests__/create-app-stop.test.d.ts.map +1 -0
  28. package/dist/__tests__/create-app-time.unit.test.d.ts +2 -0
  29. package/dist/__tests__/create-app-time.unit.test.d.ts.map +1 -0
  30. package/dist/__tests__/create-app.test-d.d.ts +2 -0
  31. package/dist/__tests__/create-app.test-d.d.ts.map +1 -0
  32. package/dist/__tests__/create-app.test.d.ts +2 -0
  33. package/dist/__tests__/create-app.test.d.ts.map +1 -0
  34. package/dist/__tests__/create-renderer-error.integration.test.d.ts +2 -0
  35. package/dist/__tests__/create-renderer-error.integration.test.d.ts.map +1 -0
  36. package/dist/__tests__/create-renderer-lifecycle.integration.test.d.ts +2 -0
  37. package/dist/__tests__/create-renderer-lifecycle.integration.test.d.ts.map +1 -0
  38. package/dist/__tests__/docs-gate-green.unit.test.d.ts +2 -0
  39. package/dist/__tests__/docs-gate-green.unit.test.d.ts.map +1 -0
  40. package/dist/__tests__/draw-source-injected-world-update-visibility.test.d.ts +2 -0
  41. package/dist/__tests__/draw-source-injected-world-update-visibility.test.d.ts.map +1 -0
  42. package/dist/__tests__/draw-source-single-world-regression.test.d.ts +2 -0
  43. package/dist/__tests__/draw-source-single-world-regression.test.d.ts.map +1 -0
  44. package/dist/__tests__/engine-worker-bootstrap-channel.unit.test.d.ts +2 -0
  45. package/dist/__tests__/engine-worker-bootstrap-channel.unit.test.d.ts.map +1 -0
  46. package/dist/__tests__/engine-worker-world-swap.unit.test.d.ts +2 -0
  47. package/dist/__tests__/engine-worker-world-swap.unit.test.d.ts.map +1 -0
  48. package/dist/__tests__/errors-pointer-lock-failed.test.d.ts +2 -0
  49. package/dist/__tests__/errors-pointer-lock-failed.test.d.ts.map +1 -0
  50. package/dist/__tests__/execution-bootstrap-isolation.unit.test.d.ts +2 -0
  51. package/dist/__tests__/execution-bootstrap-isolation.unit.test.d.ts.map +1 -0
  52. package/dist/__tests__/execution-error-detail.test-d.d.ts +2 -0
  53. package/dist/__tests__/execution-error-detail.test-d.d.ts.map +1 -0
  54. package/dist/__tests__/execution-error-detail.unit.test.d.ts +2 -0
  55. package/dist/__tests__/execution-error-detail.unit.test.d.ts.map +1 -0
  56. package/dist/__tests__/execution-frame-order.unit.test.d.ts +2 -0
  57. package/dist/__tests__/execution-frame-order.unit.test.d.ts.map +1 -0
  58. package/dist/__tests__/execution-frame-protocol.unit.test.d.ts +2 -0
  59. package/dist/__tests__/execution-frame-protocol.unit.test.d.ts.map +1 -0
  60. package/dist/__tests__/execution-input-sample.contract.test.d.ts +2 -0
  61. package/dist/__tests__/execution-input-sample.contract.test.d.ts.map +1 -0
  62. package/dist/__tests__/execution-measurement.unit.test.d.ts +2 -0
  63. package/dist/__tests__/execution-measurement.unit.test.d.ts.map +1 -0
  64. package/dist/__tests__/execution-public-api.test-d.d.ts +2 -0
  65. package/dist/__tests__/execution-public-api.test-d.d.ts.map +1 -0
  66. package/dist/__tests__/execution-public-api.unit.test.d.ts +2 -0
  67. package/dist/__tests__/execution-public-api.unit.test.d.ts.map +1 -0
  68. package/dist/__tests__/execution-rebuild.contract.test.d.ts +2 -0
  69. package/dist/__tests__/execution-rebuild.contract.test.d.ts.map +1 -0
  70. package/dist/__tests__/execution-report.contract.test.d.ts +2 -0
  71. package/dist/__tests__/execution-report.contract.test.d.ts.map +1 -0
  72. package/dist/__tests__/execution-report.types.test-d.d.ts +2 -0
  73. package/dist/__tests__/execution-report.types.test-d.d.ts.map +1 -0
  74. package/dist/__tests__/execution-schema-freshness.unit.test.d.ts +2 -0
  75. package/dist/__tests__/execution-schema-freshness.unit.test.d.ts.map +1 -0
  76. package/dist/__tests__/execution-selector.unit.test.d.ts +2 -0
  77. package/dist/__tests__/execution-selector.unit.test.d.ts.map +1 -0
  78. package/dist/__tests__/execution-shared-kernel.unit.test.d.ts +2 -0
  79. package/dist/__tests__/execution-shared-kernel.unit.test.d.ts.map +1 -0
  80. package/dist/__tests__/fallback-camera.unit.test.d.ts +2 -0
  81. package/dist/__tests__/fallback-camera.unit.test.d.ts.map +1 -0
  82. package/dist/__tests__/frame-loop-time-elapsed.test.d.ts +2 -0
  83. package/dist/__tests__/frame-loop-time-elapsed.test.d.ts.map +1 -0
  84. package/dist/__tests__/frame-loop-time.unit.test.d.ts +2 -0
  85. package/dist/__tests__/frame-loop-time.unit.test.d.ts.map +1 -0
  86. package/dist/__tests__/frame-loop-world-array.test.d.ts +2 -0
  87. package/dist/__tests__/frame-loop-world-array.test.d.ts.map +1 -0
  88. package/dist/__tests__/kernel-worker-runtime.unit.test.d.ts +2 -0
  89. package/dist/__tests__/kernel-worker-runtime.unit.test.d.ts.map +1 -0
  90. package/dist/__tests__/migration-surface-inventory.unit.test.d.ts +2 -0
  91. package/dist/__tests__/migration-surface-inventory.unit.test.d.ts.map +1 -0
  92. package/dist/__tests__/plugin-policy.integration.test.d.ts +2 -0
  93. package/dist/__tests__/plugin-policy.integration.test.d.ts.map +1 -0
  94. package/dist/__tests__/plugin-profiles.unit.test.d.ts +2 -0
  95. package/dist/__tests__/plugin-profiles.unit.test.d.ts.map +1 -0
  96. package/dist/__tests__/profiler-default-off.test.d.ts +2 -0
  97. package/dist/__tests__/profiler-default-off.test.d.ts.map +1 -0
  98. package/dist/__tests__/profiler-frame-token.test.d.ts +2 -0
  99. package/dist/__tests__/profiler-frame-token.test.d.ts.map +1 -0
  100. package/dist/__tests__/profiler-phase-catalog.test.d.ts +2 -0
  101. package/dist/__tests__/profiler-phase-catalog.test.d.ts.map +1 -0
  102. package/dist/__tests__/profiler-phase-integration.test.d.ts +2 -0
  103. package/dist/__tests__/profiler-phase-integration.test.d.ts.map +1 -0
  104. package/dist/__tests__/profiler-remote-bridge.test.d.ts +2 -0
  105. package/dist/__tests__/profiler-remote-bridge.test.d.ts.map +1 -0
  106. package/dist/__tests__/remote-integration.test.d.ts +2 -0
  107. package/dist/__tests__/remote-integration.test.d.ts.map +1 -0
  108. package/dist/__tests__/rhi-capture-capability.test-d.d.ts +2 -0
  109. package/dist/__tests__/rhi-capture-capability.test-d.d.ts.map +1 -0
  110. package/dist/__tests__/rhi-capture-host.integration.test.d.ts +2 -0
  111. package/dist/__tests__/rhi-capture-host.integration.test.d.ts.map +1 -0
  112. package/dist/__tests__/rhi-capture.browser.test.d.ts +2 -0
  113. package/dist/__tests__/rhi-capture.browser.test.d.ts.map +1 -0
  114. package/dist/__tests__/surface-handoff.test.d.ts +2 -0
  115. package/dist/__tests__/surface-handoff.test.d.ts.map +1 -0
  116. package/dist/__tests__/types-m2.test-d.d.ts +2 -0
  117. package/dist/__tests__/types-m2.test-d.d.ts.map +1 -0
  118. package/dist/__tests__/visibility-remote.integration.test.d.ts +2 -0
  119. package/dist/__tests__/visibility-remote.integration.test.d.ts.map +1 -0
  120. package/dist/__tests__/worker-execution-stop.test.d.ts +2 -0
  121. package/dist/__tests__/worker-execution-stop.test.d.ts.map +1 -0
  122. package/dist/animation-asset-lookup.d.ts +7 -0
  123. package/dist/animation-asset-lookup.d.ts.map +1 -0
  124. package/dist/browser-frame-signal.d.ts +17 -0
  125. package/dist/browser-frame-signal.d.ts.map +1 -0
  126. package/dist/canvas-policy.d.ts +4 -0
  127. package/dist/canvas-policy.d.ts.map +1 -0
  128. package/dist/create-app.d.ts +78 -0
  129. package/dist/create-app.d.ts.map +1 -0
  130. package/dist/engine-worker-runtime.mjs +827 -0
  131. package/dist/engine-worker-runtime.mjs.map +1 -0
  132. package/dist/errors.d.ts +254 -0
  133. package/dist/errors.d.ts.map +1 -0
  134. package/dist/execution/attached-world-swap.d.ts +10 -0
  135. package/dist/execution/attached-world-swap.d.ts.map +1 -0
  136. package/dist/execution/bootstrap-entry.d.ts +30 -0
  137. package/dist/execution/bootstrap-entry.d.ts.map +1 -0
  138. package/dist/execution/bootstrap-url.d.ts +5 -0
  139. package/dist/execution/bootstrap-url.d.ts.map +1 -0
  140. package/dist/execution/capabilities.d.ts +5 -0
  141. package/dist/execution/capabilities.d.ts.map +1 -0
  142. package/dist/execution/control.d.ts +12 -0
  143. package/dist/execution/control.d.ts.map +1 -0
  144. package/dist/execution/engine-worker-runtime.d.ts +2 -0
  145. package/dist/execution/engine-worker-runtime.d.ts.map +1 -0
  146. package/dist/execution/engine-worker.d.ts +24 -0
  147. package/dist/execution/engine-worker.d.ts.map +1 -0
  148. package/dist/execution/host-controller.d.ts +16 -0
  149. package/dist/execution/host-controller.d.ts.map +1 -0
  150. package/dist/execution/index.d.ts +10 -0
  151. package/dist/execution/index.d.ts.map +1 -0
  152. package/dist/execution/kernel-pool.d.ts +14 -0
  153. package/dist/execution/kernel-pool.d.ts.map +1 -0
  154. package/dist/execution/kernel-worker-runtime.d.ts +2 -0
  155. package/dist/execution/kernel-worker-runtime.d.ts.map +1 -0
  156. package/dist/execution/measurement.d.ts +7 -0
  157. package/dist/execution/measurement.d.ts.map +1 -0
  158. package/dist/execution/protocol.d.ts +87 -0
  159. package/dist/execution/protocol.d.ts.map +1 -0
  160. package/dist/execution/report.d.ts +5 -0
  161. package/dist/execution/report.d.ts.map +1 -0
  162. package/dist/execution/schema.d.ts +4 -0
  163. package/dist/execution/schema.d.ts.map +1 -0
  164. package/dist/execution/selector.d.ts +10 -0
  165. package/dist/execution/selector.d.ts.map +1 -0
  166. package/dist/execution/types.d.ts +123 -0
  167. package/dist/execution/types.d.ts.map +1 -0
  168. package/dist/fallback-camera.d.ts +8 -0
  169. package/dist/fallback-camera.d.ts.map +1 -0
  170. package/dist/game-context.d.ts +98 -0
  171. package/dist/game-context.d.ts.map +1 -0
  172. package/dist/index.d.ts +27 -0
  173. package/dist/index.d.ts.map +1 -0
  174. package/dist/index.mjs +3980 -0
  175. package/dist/index.mjs.map +1 -0
  176. package/dist/input-map-plugin.d.ts +5 -0
  177. package/dist/input-map-plugin.d.ts.map +1 -0
  178. package/dist/input-plugin.d.ts +4 -0
  179. package/dist/input-plugin.d.ts.map +1 -0
  180. package/dist/internal/assembled-engine-profile.d.ts +5 -0
  181. package/dist/internal/assembled-engine-profile.d.ts.map +1 -0
  182. package/dist/internal/assets-world-plugin.d.ts +7 -0
  183. package/dist/internal/assets-world-plugin.d.ts.map +1 -0
  184. package/dist/internal/browser-remote-bridge.d.ts +24 -0
  185. package/dist/internal/browser-remote-bridge.d.ts.map +1 -0
  186. package/dist/internal/browser-rhi-debug-runtime.d.ts +18 -0
  187. package/dist/internal/browser-rhi-debug-runtime.d.ts.map +1 -0
  188. package/dist/internal/component-introspection.d.ts +24 -0
  189. package/dist/internal/component-introspection.d.ts.map +1 -0
  190. package/dist/internal/debug-draw.d.ts +9 -0
  191. package/dist/internal/debug-draw.d.ts.map +1 -0
  192. package/dist/internal/ecs-import.d.ts +6 -0
  193. package/dist/internal/ecs-import.d.ts.map +1 -0
  194. package/dist/internal/engine-profile-common.d.ts +9 -0
  195. package/dist/internal/engine-profile-common.d.ts.map +1 -0
  196. package/dist/internal/error-fanout.d.ts +66 -0
  197. package/dist/internal/error-fanout.d.ts.map +1 -0
  198. package/dist/internal/frame-loop.d.ts +38 -0
  199. package/dist/internal/frame-loop.d.ts.map +1 -0
  200. package/dist/internal/input-attach.d.ts +44 -0
  201. package/dist/internal/input-attach.d.ts.map +1 -0
  202. package/dist/internal/main-engine-profile.d.ts +19 -0
  203. package/dist/internal/main-engine-profile.d.ts.map +1 -0
  204. package/dist/internal/remote-serve-flag.d.ts +19 -0
  205. package/dist/internal/remote-serve-flag.d.ts.map +1 -0
  206. package/dist/internal/remote-server-plugin.d.ts +8 -0
  207. package/dist/internal/remote-server-plugin.d.ts.map +1 -0
  208. package/dist/internal/rhi-capture.d.ts +19 -0
  209. package/dist/internal/rhi-capture.d.ts.map +1 -0
  210. package/dist/internal/rhi-debug-flag.d.ts +18 -0
  211. package/dist/internal/rhi-debug-flag.d.ts.map +1 -0
  212. package/dist/internal/worker-engine-profile.d.ts +15 -0
  213. package/dist/internal/worker-engine-profile.d.ts.map +1 -0
  214. package/dist/kernel-worker-runtime.mjs +69 -0
  215. package/dist/kernel-worker-runtime.mjs.map +1 -0
  216. package/dist/load-game-errors.d.ts +131 -0
  217. package/dist/load-game-errors.d.ts.map +1 -0
  218. package/dist/load-game.d.ts +34 -0
  219. package/dist/load-game.d.ts.map +1 -0
  220. package/dist/plugin-factories.d.ts +3 -0
  221. package/dist/plugin-factories.d.ts.map +1 -0
  222. package/dist/renderer-plugin.d.ts +25 -0
  223. package/dist/renderer-plugin.d.ts.map +1 -0
  224. package/dist/tool-preview/bootstrap.d.ts +113 -0
  225. package/dist/tool-preview/bootstrap.d.ts.map +1 -0
  226. package/dist/tool-preview/evidence.d.ts +20 -0
  227. package/dist/tool-preview/evidence.d.ts.map +1 -0
  228. package/dist/tool-preview/framing.d.ts +13 -0
  229. package/dist/tool-preview/framing.d.ts.map +1 -0
  230. package/dist/tool-preview/recipe.d.ts +54 -0
  231. package/dist/tool-preview/recipe.d.ts.map +1 -0
  232. package/dist/types.d.ts +404 -0
  233. package/dist/types.d.ts.map +1 -0
  234. package/package.json +85 -0
  235. package/schema/execution-report.schema.json +168 -0
  236. package/src/__tests__/animation-asset-lookup.unit.test.ts +20 -0
  237. package/src/__tests__/callback-deletion.unit.test.ts +14 -0
  238. package/src/__tests__/callback-inference.test-d.ts +36 -0
  239. package/src/__tests__/component-introspection.unit.test.ts +56 -0
  240. package/src/__tests__/consumer-migration.unit.test.ts +34 -0
  241. package/src/__tests__/create-app-error-retention.integration.test.ts +125 -0
  242. package/src/__tests__/create-app-features.test.ts +51 -0
  243. package/src/__tests__/create-app-listener-sync.test.ts +381 -0
  244. package/src/__tests__/create-app-lock-provider.test.ts +212 -0
  245. package/src/__tests__/create-app-physics-plugin-failure.integration.test.ts +142 -0
  246. package/src/__tests__/create-app-plugin.test.ts +217 -0
  247. package/src/__tests__/create-app-stop.test.ts +609 -0
  248. package/src/__tests__/create-app-time.unit.test.ts +26 -0
  249. package/src/__tests__/create-app.test-d.ts +83 -0
  250. package/src/__tests__/create-app.test.ts +287 -0
  251. package/src/__tests__/create-renderer-error.integration.test.ts +25 -0
  252. package/src/__tests__/create-renderer-lifecycle.integration.test.ts +24 -0
  253. package/src/__tests__/docs-gate-green.unit.test.ts +61 -0
  254. package/src/__tests__/draw-source-injected-world-update-visibility.test.ts +176 -0
  255. package/src/__tests__/draw-source-single-world-regression.test.ts +184 -0
  256. package/src/__tests__/engine-worker-bootstrap-channel.unit.test.ts +82 -0
  257. package/src/__tests__/engine-worker-world-swap.unit.test.ts +69 -0
  258. package/src/__tests__/errors-pointer-lock-failed.test.ts +265 -0
  259. package/src/__tests__/execution-bootstrap-isolation.unit.test.ts +79 -0
  260. package/src/__tests__/execution-error-detail.test-d.ts +13 -0
  261. package/src/__tests__/execution-error-detail.unit.test.ts +35 -0
  262. package/src/__tests__/execution-frame-order.unit.test.ts +38 -0
  263. package/src/__tests__/execution-frame-protocol.unit.test.ts +60 -0
  264. package/src/__tests__/execution-input-sample.contract.test.ts +23 -0
  265. package/src/__tests__/execution-measurement.unit.test.ts +20 -0
  266. package/src/__tests__/execution-public-api.test-d.ts +14 -0
  267. package/src/__tests__/execution-public-api.unit.test.ts +9 -0
  268. package/src/__tests__/execution-rebuild.contract.test.ts +36 -0
  269. package/src/__tests__/execution-report.contract.test.ts +50 -0
  270. package/src/__tests__/execution-report.types.test-d.ts +16 -0
  271. package/src/__tests__/execution-schema-freshness.unit.test.ts +20 -0
  272. package/src/__tests__/execution-selector.unit.test.ts +72 -0
  273. package/src/__tests__/execution-shared-kernel.unit.test.ts +180 -0
  274. package/src/__tests__/fallback-camera.unit.test.ts +32 -0
  275. package/src/__tests__/frame-loop-time-elapsed.test.ts +115 -0
  276. package/src/__tests__/frame-loop-time.unit.test.ts +61 -0
  277. package/src/__tests__/frame-loop-world-array.test.ts +450 -0
  278. package/src/__tests__/kernel-worker-runtime.unit.test.ts +50 -0
  279. package/src/__tests__/migration-surface-inventory.unit.test.ts +13 -0
  280. package/src/__tests__/plugin-policy.integration.test.ts +15 -0
  281. package/src/__tests__/plugin-profiles.unit.test.ts +190 -0
  282. package/src/__tests__/profiler-default-off.test.ts +53 -0
  283. package/src/__tests__/profiler-frame-token.test.ts +235 -0
  284. package/src/__tests__/profiler-phase-catalog.test.ts +30 -0
  285. package/src/__tests__/profiler-phase-integration.test.ts +117 -0
  286. package/src/__tests__/profiler-remote-bridge.test.ts +31 -0
  287. package/src/__tests__/remote-integration.test.ts +224 -0
  288. package/src/__tests__/rhi-capture-capability.test-d.ts +22 -0
  289. package/src/__tests__/rhi-capture-host.integration.test.ts +157 -0
  290. package/src/__tests__/rhi-capture.browser.test.ts +51 -0
  291. package/src/__tests__/surface-handoff.test.ts +89 -0
  292. package/src/__tests__/types-m2.test-d.ts +81 -0
  293. package/src/__tests__/visibility-remote.integration.test.ts +116 -0
  294. package/src/__tests__/worker-execution-stop.test.ts +173 -0
  295. package/src/animation-asset-lookup.ts +13 -0
  296. package/src/browser-frame-signal.ts +44 -0
  297. package/src/canvas-policy.ts +16 -0
  298. package/src/create-app.ts +1264 -0
  299. package/src/errors.ts +442 -0
  300. package/src/execution/attached-world-swap.ts +33 -0
  301. package/src/execution/bootstrap-entry.ts +122 -0
  302. package/src/execution/bootstrap-url.ts +25 -0
  303. package/src/execution/capabilities.ts +102 -0
  304. package/src/execution/control.ts +48 -0
  305. package/src/execution/engine-worker-runtime.ts +383 -0
  306. package/src/execution/engine-worker.ts +163 -0
  307. package/src/execution/host-controller.ts +460 -0
  308. package/src/execution/index.ts +44 -0
  309. package/src/execution/kernel-pool.ts +236 -0
  310. package/src/execution/kernel-worker-runtime.ts +103 -0
  311. package/src/execution/measurement.ts +39 -0
  312. package/src/execution/protocol.ts +134 -0
  313. package/src/execution/report.ts +66 -0
  314. package/src/execution/schema.ts +168 -0
  315. package/src/execution/selector.ts +98 -0
  316. package/src/execution/types.ts +163 -0
  317. package/src/fallback-camera.ts +20 -0
  318. package/src/game-context.ts +126 -0
  319. package/src/index.ts +190 -0
  320. package/src/input-map-plugin.ts +21 -0
  321. package/src/input-plugin.ts +26 -0
  322. package/src/internal/assembled-engine-profile.ts +14 -0
  323. package/src/internal/assets-world-plugin.ts +33 -0
  324. package/src/internal/browser-remote-bridge.ts +269 -0
  325. package/src/internal/browser-rhi-debug-runtime.ts +67 -0
  326. package/src/internal/component-introspection.ts +116 -0
  327. package/src/internal/debug-draw.ts +38 -0
  328. package/src/internal/ecs-import.ts +41 -0
  329. package/src/internal/engine-profile-common.ts +9 -0
  330. package/src/internal/error-fanout.ts +129 -0
  331. package/src/internal/frame-loop.ts +539 -0
  332. package/src/internal/input-attach.ts +104 -0
  333. package/src/internal/main-engine-profile.ts +84 -0
  334. package/src/internal/remote-serve-flag.ts +41 -0
  335. package/src/internal/remote-server-plugin.ts +16 -0
  336. package/src/internal/rhi-capture.ts +211 -0
  337. package/src/internal/rhi-debug-flag.ts +40 -0
  338. package/src/internal/worker-engine-profile.ts +47 -0
  339. package/src/load-game-errors.ts +211 -0
  340. package/src/load-game.ts +115 -0
  341. package/src/plugin-factories.ts +2 -0
  342. package/src/renderer-plugin.ts +96 -0
  343. package/src/tool-preview/bootstrap.ts +835 -0
  344. package/src/tool-preview/evidence.ts +59 -0
  345. package/src/tool-preview/framing.ts +52 -0
  346. package/src/tool-preview/recipe.ts +137 -0
  347. package/src/types.ts +450 -0
  348. package/src/vite-env.d.ts +10 -0
package/src/types.ts ADDED
@@ -0,0 +1,450 @@
1
+ // @forgeax/engine-app -- shared types for createApp double-SSOT entry.
2
+ //
3
+ // AI users: see packages/app/src/index.ts for the public surface and
4
+ // packages/app/src/create-app.ts for the runtime implementation.
5
+ //
6
+ // M1 (this milestone) ships the skeleton: interfaces are final-shape, but
7
+ // start / stop / pause / resume / onError on the returned App are stubs
8
+ // that return Result.ok(undefined) and a no-op unsubscribe. The rAF main
9
+ // loop, dt clamp, error fan-out, and input attach internals land in
10
+ // later milestones (M2..M5 per plan-strategy section 7).
11
+
12
+ import type { AssetRegistry } from '@forgeax/engine-assets-runtime';
13
+ import type { AudioBackend } from '@forgeax/engine-audio';
14
+ import type { DebugDraw } from '@forgeax/engine-debug-draw';
15
+ import type { TimePolicy, World } from '@forgeax/engine-ecs';
16
+ import type {
17
+ ActionConfig,
18
+ InputBackend,
19
+ PointerLockProvider,
20
+ VirtualJoystickConfig,
21
+ } from '@forgeax/engine-input';
22
+ import type { PhysicsWorld, PhysicsWorld2D } from '@forgeax/engine-physics';
23
+ import type { Context, Plugin } from '@forgeax/engine-plugin';
24
+ import type { Profiler } from '@forgeax/engine-profiler';
25
+ import type { RenderError, Renderer, RenderFeature, RenderProfile } from '@forgeax/engine-render';
26
+ import type { RhiBackendInstrumentation } from '@forgeax/engine-render/internal/construct-renderer';
27
+ import type { RhiError, RhiInstance } from '@forgeax/engine-rhi';
28
+ import type { EngineEnvironmentError } from '@forgeax/engine-runtime';
29
+ import type { ImportTransport, Result } from '@forgeax/engine-types';
30
+
31
+ import type { AppError, AppErrorCode } from './errors';
32
+ import type { ExecutionControl, ExecutionOptions } from './execution';
33
+ import type { RhiCapture } from './internal/rhi-capture';
34
+
35
+ // Re-export AppError + AppErrorCode (the canonical SSOT lives in
36
+ // `./errors`). Pre-M5 (M1..M4) referenced these as type-only declarations
37
+ // inside this file; M5 collapses to the single SSOT in `./errors.ts` per
38
+ // plan-strategy section 7 + research section 2.7.
39
+ export type { AppError, AppErrorCode };
40
+
41
+ /**
42
+ * Structured error union surfaced through the App `onError` fan-out + the
43
+ * assemble-form construction Result. Derived from the `Renderer.onError`
44
+ * channel contract `RendererError` (feat-20260704-runtime-tier1-decomposition
45
+ * M2 / w14 / D-4) so a runtime-layer error fanned out by the renderer (e.g.
46
+ * `'equirect-projection-failed'`) reaches host App listeners verbatim, plus the
47
+ * App-layer `AppError`. `RendererError` = `RhiError | RenderError |
48
+ * AssetRuntimeError | SkinError | PostProcessError`, so this equals the
49
+ * pre-decomposition `AppError | RhiError | RuntimeError | PostProcessError`
50
+ * exactly (RuntimeError was RenderError | AssetRuntimeError | SkinError). AI
51
+ * users `switch (err.code)` over the union: the disjoint `AppErrorCode` /
52
+ * `RhiErrorCode` / per-cluster `*ErrorCode` / `PostProcessErrorCode` literal
53
+ * sets let TS narrow each arm to the concrete class.
54
+ */
55
+ export type AppDispatchError = AppError | RenderError;
56
+
57
+ /**
58
+ * Per-frame draw description pulled from the host each frame
59
+ * (feat-20260709-editor-world-partition-editorworld-super-composite / M2 / D-3).
60
+ *
61
+ * - `worlds` — the exact world list to render this frame, in draw order.
62
+ * - `cameraOwner` — index into `worlds` whose cameras drive the frame.
63
+ * - `resourceOwner`— index into `worlds` whose singleton render resources
64
+ * (skylight / skybox / postProcessParams) drive the frame.
65
+ *
66
+ * The two owners are independent (M1 owner-split): an editor can render a scene
67
+ * world's geometry through an editor world's camera while sourcing lighting from
68
+ * a third. `cameraOwner === resourceOwner` is the single-owner degenerate case.
69
+ *
70
+ * @see {@link DrawSource}
71
+ */
72
+ export interface DrawSourceResult {
73
+ readonly worlds: readonly World[];
74
+ readonly cameraOwner: number;
75
+ readonly resourceOwner: number;
76
+ }
77
+
78
+ /**
79
+ * Stable frame-loop phase vocabulary for opt-in performance diagnostics.
80
+ *
81
+ * Local and Worker execution record these phases through the same optional
82
+ * Profiler capability. When omitted, the frame loop keeps its normal path and
83
+ * does not allocate capture records.
84
+ */
85
+ export const APP_PHASE_CATALOG = [
86
+ 'frame-total',
87
+ 'draw-source',
88
+ 'world-update-primary',
89
+ 'world-update-injected',
90
+ 'renderer-draw',
91
+ 'host-frame',
92
+ 'engine-update',
93
+ 'kernel-wait',
94
+ 'host-audio',
95
+ ] as const;
96
+
97
+ /**
98
+ * Optional per-frame draw-source injection seam
99
+ * (feat-20260709-editor-world-partition-editorworld-super-composite / M2 / D-3).
100
+ *
101
+ * The frame-loop invokes this callback once per frame (a "pull"). It lets a host
102
+ * (e.g. the editor) decide, each frame, WHICH worlds to render and which owner
103
+ * indices to use — without the engine knowing anything about editor world
104
+ * partitioning.
105
+ *
106
+ * - Returns `undefined` → the frame-loop degrades to the single-world path,
107
+ * byte-identical to `renderer.draw([world], { cameraOwner: 0, resourceOwner: 0 })` where `world` is
108
+ * the App's own world (the single-world AI-user default). A host that wires
109
+ * the seam but has nothing multi-world to inject this frame returns
110
+ * `undefined`.
111
+ * - Returns a {@link DrawSourceResult} → the frame-loop runs `world.update(1 / 60).unwrap()`
112
+ * on EVERY returned world (so transform propagation writes each world's
113
+ * derived `Transform.world` mat4 before extract reads it — no stale matrix),
114
+ * then calls `renderer.draw(worlds, { cameraOwner, resourceOwner })`.
115
+ *
116
+ * When omitted entirely, the App never consults a seam and always renders its
117
+ * own single world (legacy behaviour unchanged).
118
+ */
119
+ export type DrawSource = () => DrawSourceResult | undefined;
120
+
121
+ /**
122
+ * Options for the assemble-form entry createApp({ renderer, world, ... }).
123
+ *
124
+ * Field semantics (final shape -- runtime use lands in M2..M5):
125
+ * - renderer: caller-owned Renderer (host already invoked createRenderer).
126
+ * - world: caller-owned World (host already invoked new World()).
127
+ * - input: InputBackend handle the host-side attached. When omitted the
128
+ * assemble entry skips input attach (caller manages input).
129
+ * - silenceUnhandledErrors: when true, suppresses the console.error
130
+ * fallback inside the error fan-out (M4).
131
+ */
132
+ export interface AppAssembleArgs {
133
+ readonly renderer: Renderer;
134
+ /** Host-owned asset catalogue paired with the renderer construction. */
135
+ readonly assets?: AssetRegistry;
136
+ readonly world: World;
137
+ /** Unified plugin list (M1 feat-20260623-plugin-system-unify-build-world-protocol). */
138
+ readonly plugins?: readonly Plugin[];
139
+ readonly silenceUnhandledErrors?: boolean;
140
+ /**
141
+ * Per-frame draw-source injection seam (M2 / D-3). When supplied, the
142
+ * frame-loop pulls it each frame to decide which worlds to render + which
143
+ * owner indices to use; when omitted the App renders its own single world
144
+ * (legacy behaviour). See {@link DrawSource}.
145
+ */
146
+ readonly drawSource?: DrawSource;
147
+ /** Explicit profiler capability shared by the host and renderer. */
148
+ readonly profiler?: Profiler;
149
+ }
150
+
151
+ /** Effective physical canvas size transported to an Engine Worker frame. */
152
+ export interface CanvasDrawingBufferSize {
153
+ readonly width: number;
154
+ readonly height: number;
155
+ }
156
+
157
+ /**
158
+ * Options for the canvas-form thin wrapper createApp(canvas, opts?, bundler?).
159
+ *
160
+ * feat-20260608-create-app-param-surface-trim / M2 / D-3: self-describing
161
+ * surface -- no longer `extends RendererOptions`. The 7 app-only fields
162
+ * (input / audio / physics / silenceUnhandledErrors) plus the RHI escape-hatch
163
+ * field (rhi) are
164
+ * listed inline, so IDE autocomplete shows AI users a clean surface
165
+ * without inheriting now-disallowed slots like clearColor (M1, on Camera)
166
+ * and shaderManifestUrl (M2, on BundlerOptions / 3rd arg). The escape
167
+ * hatches stay discoverable for the RHI debugging path (charter P1 -- not
168
+ * default noise, but reachable when the AI user scrolls the type).
169
+ */
170
+ export interface CreateAppOptions {
171
+ /** Opt into realm-local engine execution. Omission preserves the existing local assembly path. */
172
+ readonly execution?: ExecutionOptions;
173
+ /** Host-owned UI root whose events do not enter gameplay input. */
174
+ readonly uiRoot?: Node;
175
+ /** Producer-owned render features forwarded to the renderer unchanged. */
176
+ readonly features?: readonly RenderFeature<unknown>[];
177
+ /** Standard profile forwarded to the single renderer-owned pipeline. */
178
+ readonly standardProfile?: RenderProfile;
179
+ /** Unified plugin list (M1 feat-20260623-plugin-system-unify-build-world-protocol). */
180
+ readonly plugins?: readonly Plugin[];
181
+ /**
182
+ * A host-owned input backend for this canvas. When supplied, createApp inserts
183
+ * it into the World instead of attaching a second browser listener set. The
184
+ * host retains its lifecycle; this app only consumes snapshots from the view.
185
+ */
186
+ readonly input?: InputBackend;
187
+ /**
188
+ * World-owned time policy supplied to the canvas-form World constructor.
189
+ * Assemble-form callers retain their pre-existing World policy.
190
+ */
191
+ readonly time?: TimePolicy;
192
+ /**
193
+ * When true, suppresses the console.error fallback inside the error
194
+ * fan-out for hosts that prefer total silence (M4 default: false).
195
+ */
196
+ readonly silenceUnhandledErrors?: boolean;
197
+ /**
198
+ * RHI escape hatch -- forwarded verbatim to createRenderer. Same semantics
199
+ * as `RendererOptions.rhi` (the createRenderer third-party-RHI-instance
200
+ * injection point). Use only for testing / pinning a specific backend /
201
+ * advanced AI users that ship their own RhiInstance shim.
202
+ */
203
+ readonly rhi?: RhiInstance | undefined;
204
+ /** Optional host-owned RHI lifecycle instrumentation, such as recording. */
205
+ readonly rhiInstrumentation?: RhiBackendInstrumentation;
206
+ /**
207
+ * Neutral PointerLock gate forwarded verbatim to the canvas-form input
208
+ * attach (attachInputAuto → attachBrowserInputBackend). When it returns
209
+ * false, a canvas click does NOT capture the cursor. Absent => always-lock
210
+ * (standalone game behaviour). The engine never learns WHY locking is
211
+ * (dis)allowed — the host owns that decision (e.g. an editor viewport that
212
+ * only allows lock in its play·game quadrant). Ignored by the assemble form
213
+ * (host-managed input owns its own lock policy).
214
+ */
215
+ readonly pointerLockAllowed?: () => boolean;
216
+ /**
217
+ * Virtual joystick configs forwarded verbatim to the canvas-form input
218
+ * attach (attachInputAuto -> attachBrowserInputBackend). Each config derives
219
+ * a normalized 2D axis readable via `snap.virtualAxis(name)`. Absent => no
220
+ * virtual joysticks. Ignored by the assemble form (host-managed input wires
221
+ * its own backend). Mirrors `pointerLockAllowed`: the canvas-form entry must
222
+ * expose every backend option the standard recipe needs, or the config path
223
+ * dead-ends before reaching the backend that already supports it.
224
+ */
225
+ readonly virtualJoysticks?: readonly VirtualJoystickConfig[];
226
+ /**
227
+ * Action mapping configuration (M1: action semantic abstraction layer).
228
+ *
229
+ * Declares named actions (e.g. 'jump', 'moveRight') bound to raw input sources
230
+ * (key, mouseButton, gamepadButton, gamepadAxis). The engine derives per-frame
231
+ * action states via `deriveActionStates()` and exposes them via
232
+ * `snap.action(name).isPressed()`. Duplicate action names follow last-wins
233
+ * semantics (D-8).
234
+ *
235
+ * This is canvas-form only. Assemble-form hosts insert the
236
+ * `INPUT_MAP_KEY` Resource directly.
237
+ */
238
+ readonly inputMap?: readonly ActionConfig[] | undefined;
239
+ /**
240
+ * M2: pointer-lock provider injected by the host (e.g. editor play-runtime).
241
+ * Forwarded verbatim through InputAttachOptions to BrowserInputBackendOptions.
242
+ * When absent, the backend falls back to the W3C requestPointerLock() path.
243
+ * Type SSOT is @forgeax/engine-input's PointerLockProvider.
244
+ * Ignored by the assemble form (host-managed input owns its own lock policy).
245
+ */
246
+ readonly lockProvider?: PointerLockProvider;
247
+ /**
248
+ * Per-frame draw-source injection seam (M2 / D-3). When supplied, the
249
+ * frame-loop pulls it each frame to decide which worlds to render + which
250
+ * owner indices to use; when omitted the canvas-form App renders its own
251
+ * single world (legacy behaviour unchanged). See {@link DrawSource}.
252
+ */
253
+ readonly drawSource?: DrawSource;
254
+ /** Explicit profiler capability shared by the host and renderer. */
255
+ readonly profiler?: Profiler;
256
+ }
257
+
258
+ /**
259
+ * Bundler-layer injection for the canvas-form createApp(canvas, opts, bundler?)
260
+ * and createRenderer(canvas, opts, bundler?).
261
+ *
262
+ * feat-20260608-create-app-param-surface-trim / M2 / D-3: this is the SSOT
263
+ * for build-tool emit knowledge that the engine consumes at runtime.
264
+ * Aggregates two host-injected channels:
265
+ *
266
+ * - importTransport: dev-only ImportTransport that the engine threads to
267
+ * the AssetRegistry third ctor slot so a DDC miss can lazy-import.
268
+ * Absent => shipped form (DDC miss fails fast with `asset-not-imported`).
269
+ *
270
+ * - shaderManifestUrl: the path the host's vite-plugin-shader emit step
271
+ * wrote `manifest.json` to. Absent (or `BundlerOptions` itself omitted)
272
+ * => createRenderer falls back to '/shaders/manifest.json'
273
+ * (createRenderer.ts D-2 q5-A) so the LO 1.1 zero-config takeoff path
274
+ * keeps working without any explicit injection.
275
+ *
276
+ * Both fields are optional so `BundlerOptions = {}` is a valid call shape.
277
+ * M3 collapses the typical demo callsite to `forgeaxBundlerAdapter()` (a
278
+ * factory exported by `virtual:forgeax/bundler`), which returns an object
279
+ * with this same structural shape -- type compatibility is enforced by
280
+ * TypeScript structural typing (D-4: vite-plugin-shader does NOT import
281
+ * `@forgeax/engine-app`, so this interface is the consumer-side SSOT).
282
+ */
283
+ export interface BundlerOptions {
284
+ /**
285
+ * Dev-only ImportTransport forwarded verbatim to createRenderer (and thence
286
+ * to the AssetRegistry third ctor slot). Absent => shipped form (a DDC miss
287
+ * fails fast with `asset-not-imported`).
288
+ *
289
+ * The `| undefined` widening is necessary because exactOptionalPropertyTypes
290
+ * is enabled at the workspace level (tsconfig.base.json); it lets tests
291
+ * (and demos that gate on a build-mode flag) write `{ importTransport:
292
+ * undefined }` without a TS2379 error.
293
+ */
294
+ readonly importTransport?: ImportTransport | undefined;
295
+ /**
296
+ * vite-plugin-shader emit URL (the path the build wrote `manifest.json`
297
+ * to). Absent => createRenderer falls back to '/shaders/manifest.json'.
298
+ * Tests can inject via a `data:application/json,...` URL to bypass fetch.
299
+ *
300
+ * The `| undefined` widening lets tests opt into the zero-entry mode by
301
+ * writing `{ shaderManifestUrl: undefined }` (the createRenderer body
302
+ * checks `'shaderManifestUrl' in bundler` to distinguish "absent" from
303
+ * "explicitly undefined"; see D-2 q5-A in plan-strategy).
304
+ */
305
+ readonly shaderManifestUrl?: string | undefined;
306
+ }
307
+
308
+ /**
309
+ * App handle returned by createApp(...). Host owns the lifecycle and
310
+ * interacts with the rAF loop through start / stop / pause / resume +
311
+ * the structured error fan-out via onError.
312
+ *
313
+ * M1 skeleton: start / stop / pause / resume return Result.ok(undefined)
314
+ * synchronously and onError returns a no-op unsubscribe. The 4-state
315
+ * machine + idempotent transitions land in M2 (plan-strategy section 7).
316
+ */
317
+ export interface App {
318
+ /** Caller-owned Renderer (reference equality with the assemble input). */
319
+ readonly renderer: Renderer;
320
+ /** Host-owned asset catalogue paired with this renderer lease. */
321
+ readonly assets?: AssetRegistry;
322
+ /** Caller-owned World (reference equality with the assemble input). */
323
+ readonly world: World;
324
+ /** Host-side lifecycle and immutable diagnostics for the selected execution tier. */
325
+ readonly execution: ExecutionControl;
326
+ /**
327
+ * Pause frame submission and relinquish the renderer presentation surface
328
+ * without replacing World, Renderer, AssetRegistry, plugins, or history.
329
+ */
330
+ releaseSurfacePreserveWorld(): Promise<Result<void, RhiError | RenderError>>;
331
+ /** Restore the same surface and resume only when release paused a running App. */
332
+ restoreSurface(): Promise<Result<void, RhiError | RenderError>>;
333
+ /** Native Cordis realm that owns this App's capability fibers and effects. */
334
+ readonly pluginContext: Context;
335
+ /** InputBackend handle when input attach is enabled; undefined otherwise. */
336
+ readonly input?: InputBackend;
337
+ /** AudioBackend handle when audio attach is enabled; undefined otherwise. */
338
+ readonly audio?: AudioBackend;
339
+ /**
340
+ * PhysicsWorld handle when physicsPlugin is loaded; undefined
341
+ * otherwise. physicsPlugin.build awaits the WASM import -- createApp
342
+ * resolves ONLY after the WASM module is loaded, so this field is
343
+ * populated immediately when createApp returns (AC-06: no timing gap).
344
+ */
345
+ readonly physics?: PhysicsWorld | PhysicsWorld2D | undefined;
346
+ /**
347
+ * Immediate-mode debug-draw overlay instance (feat-20260615 debug-draw M5).
348
+ *
349
+ * Created automatically during createApp (canvas form). AI users call
350
+ * `app.debugDraw.line(a, b, RED)` in any system and the overlay renders
351
+ * at frame-end via the render-graph's debug-overlay pass. Shape calls are
352
+ * immediate-mode — vertices accumulate per-frame and are flushed at the
353
+ * tonemap suffix; stale data from frame N-1 is never visible in frame N.
354
+ *
355
+ * Undefined when debug-draw is not wired (assemble-form createApp with
356
+ * no explicit debugDraw creation — the auto-attach is canvas-form only).
357
+ */
358
+ readonly debugDraw?: DebugDraw | undefined;
359
+ /**
360
+ * Begin rAF scheduling. Idempotent guard lands in M2:
361
+ * - first call: Result.ok(undefined)
362
+ * - second call (already running): Result.err({ code: 'app-already-running' })
363
+ * M1 stub returns Result.ok(undefined) unconditionally.
364
+ */
365
+ start(): Result<void, AppError>;
366
+ /**
367
+ * Stop rAF scheduling. State-machine semantics land in M2:
368
+ * - 'idle' / 'stopped' state: Result.err({ code: 'app-not-started' })
369
+ * - 'running' / 'paused' state: Result.ok(undefined)
370
+ * M1 stub returns Result.ok(undefined) unconditionally.
371
+ */
372
+ stop(): Result<void, AppError>;
373
+ /** Tear down plugins, host resources, and renderer ownership. */
374
+ dispose(): Promise<Result<void, AppError>>;
375
+ /**
376
+ * Pause rAF scheduling. Idempotent in 'paused' state. M1 stub returns
377
+ * Result.ok(undefined) unconditionally; full state machine in M2.
378
+ */
379
+ pause(): Result<void, AppError>;
380
+ /**
381
+ * Resume rAF scheduling from paused state. M1 stub returns
382
+ * Result.ok(undefined) unconditionally; full state machine in M2.
383
+ */
384
+ resume(): Result<void, AppError>;
385
+ /**
386
+ * Advance one complete update/draw frame through the App-owned frame authority.
387
+ * The App must be paused; deterministic tools supply the explicit delta.
388
+ */
389
+ stepFrame(deltaSeconds: number): Result<void, AppDispatchError>;
390
+ /**
391
+ * Subscribe to structured errors fan-out from the rAF loop. Returns an
392
+ * unsubscribe handle. The callback signature deliberately excludes raw
393
+ * Error (charter P3 -- AI users walk .code, not message strings).
394
+ *
395
+ * M1 stub: registers nothing and returns a no-op unsubscribe; full
396
+ * fan-out registry lands in M4 (plan-strategy section 7).
397
+ */
398
+ onError(cb: (err: AppDispatchError) => void): () => void;
399
+ /**
400
+ * Replace the per-frame world routing pull. `undefined` restores the
401
+ * single-world path; an injected result updates every returned secondary
402
+ * World before drawing it with the declared owners. This changes routing,
403
+ * not scheduling or time ownership.
404
+ */
405
+ setDrawSource(drawSource: DrawSource | undefined): void;
406
+ /**
407
+ * Most recent dispatched error retained for host self-inspection without
408
+ * requiring an onError listener up front.
409
+ */
410
+ readonly lastError?: AppDispatchError | undefined;
411
+ /** Optional single-frame RHI capture capability owned by the App host. */
412
+ readonly rhiCapture?: RhiCapture;
413
+ /**
414
+ * Handle for the remote eval server started by createApp (dev mode).
415
+ *
416
+ * `undefined` in production builds and headless/dawn-node without explicit
417
+ * opt-in. When present, the host can read `app.remote.port` for WS connection
418
+ * details or call `await app.remote.close()` to tear down the server
419
+ * (feat-20260629-inspector-two-layer-model M4 / w20).
420
+ *
421
+ * Typed as {@link RemoteHandle} from `@forgeax/engine-types` — a neutral
422
+ * package with no dependency on `@forgeax/engine-remote`.
423
+ */
424
+ readonly remote?: import('@forgeax/engine-types').RemoteHandle | undefined;
425
+ }
426
+
427
+ /** Host control returned by the unified execution path. Engine-owned objects remain realm-local. */
428
+ export type ExecutionApp = Pick<
429
+ App,
430
+ 'execution' | 'input' | 'audio' | 'start' | 'stop' | 'pause' | 'resume' | 'onError' | 'lastError'
431
+ >;
432
+
433
+ /**
434
+ * Error union returned by the assemble-form entry. The canvas-form thin
435
+ * wrapper widens this with EngineEnvironmentError (createRenderer
436
+ * construction-time failure path -- plan-strategy D-5 / requirements AC-01).
437
+ *
438
+ * Cordis activation failures are projected into AppError at this boundary.
439
+ */
440
+ export type AssembleAppError = AppError | RhiError;
441
+
442
+ /**
443
+ * Error union returned by the canvas-form thin wrapper. Extends
444
+ * AssembleAppError with EngineEnvironmentError to surface
445
+ * createRenderer construction-time failures unchanged (preserves
446
+ * .detail.webgpuError per requirements section 6.1).
447
+ *
448
+ * The canvas form adds renderer construction failures.
449
+ */
450
+ export type CanvasAppError = AssembleAppError | EngineEnvironmentError;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Vite replaces this one import-meta key in browser hosts. The app package
3
+ * also ships to Dawn/Node, where the property is simply absent at runtime.
4
+ */
5
+ interface ImportMeta {
6
+ readonly env?: {
7
+ readonly DEV?: boolean;
8
+ readonly FORGEAX_ENGINE_RHI_DEBUG?: string;
9
+ };
10
+ }