@forgeax/engine-app 0.1.2

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