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