@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.
- package/LICENSE +202 -0
- package/README.md +418 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/animation-asset-lookup.unit.test.d.ts +2 -0
- package/dist/__tests__/animation-asset-lookup.unit.test.d.ts.map +1 -0
- package/dist/__tests__/app-rebuild.test.d.ts +2 -0
- package/dist/__tests__/app-rebuild.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-types.test-d.d.ts +2 -0
- package/dist/__tests__/asset-registry-types.test-d.d.ts.map +1 -0
- package/dist/__tests__/assets-runtime-assembly.integration.test.d.ts +2 -0
- package/dist/__tests__/assets-runtime-assembly.integration.test.d.ts.map +1 -0
- package/dist/__tests__/callback-deletion.unit.test.d.ts +2 -0
- package/dist/__tests__/callback-deletion.unit.test.d.ts.map +1 -0
- package/dist/__tests__/callback-inference.test-d.d.ts +2 -0
- package/dist/__tests__/callback-inference.test-d.d.ts.map +1 -0
- package/dist/__tests__/component-introspection.unit.test.d.ts +2 -0
- package/dist/__tests__/component-introspection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/consumer-migration.unit.test.d.ts +2 -0
- package/dist/__tests__/consumer-migration.unit.test.d.ts.map +1 -0
- package/dist/__tests__/create-app-features.test.d.ts +2 -0
- package/dist/__tests__/create-app-features.test.d.ts.map +1 -0
- package/dist/__tests__/create-app-listener-sync.test.d.ts +2 -0
- package/dist/__tests__/create-app-listener-sync.test.d.ts.map +1 -0
- package/dist/__tests__/create-app-lock-provider.test.d.ts +2 -0
- package/dist/__tests__/create-app-lock-provider.test.d.ts.map +1 -0
- package/dist/__tests__/create-app-plugin.test.d.ts +2 -0
- package/dist/__tests__/create-app-plugin.test.d.ts.map +1 -0
- package/dist/__tests__/create-app-stop.test.d.ts +2 -0
- package/dist/__tests__/create-app-stop.test.d.ts.map +1 -0
- package/dist/__tests__/create-app-time.unit.test.d.ts +2 -0
- package/dist/__tests__/create-app-time.unit.test.d.ts.map +1 -0
- package/dist/__tests__/create-app.test-d.d.ts +2 -0
- package/dist/__tests__/create-app.test-d.d.ts.map +1 -0
- package/dist/__tests__/create-app.test.d.ts +2 -0
- package/dist/__tests__/create-app.test.d.ts.map +1 -0
- package/dist/__tests__/create-renderer-error.integration.test.d.ts +2 -0
- package/dist/__tests__/create-renderer-error.integration.test.d.ts.map +1 -0
- package/dist/__tests__/create-renderer-lifecycle.integration.test.d.ts +2 -0
- package/dist/__tests__/create-renderer-lifecycle.integration.test.d.ts.map +1 -0
- package/dist/__tests__/docs-gate-green.unit.test.d.ts +2 -0
- package/dist/__tests__/docs-gate-green.unit.test.d.ts.map +1 -0
- package/dist/__tests__/draw-source-headless-full-chain.test.d.ts +2 -0
- package/dist/__tests__/draw-source-headless-full-chain.test.d.ts.map +1 -0
- package/dist/__tests__/draw-source-injected-world-update-visibility.test.d.ts +2 -0
- package/dist/__tests__/draw-source-injected-world-update-visibility.test.d.ts.map +1 -0
- package/dist/__tests__/draw-source-single-world-regression.test.d.ts +2 -0
- package/dist/__tests__/draw-source-single-world-regression.test.d.ts.map +1 -0
- package/dist/__tests__/ecs-import.unit.test.d.ts +2 -0
- package/dist/__tests__/ecs-import.unit.test.d.ts.map +1 -0
- package/dist/__tests__/engine-worker-bootstrap-channel.unit.test.d.ts +2 -0
- package/dist/__tests__/engine-worker-bootstrap-channel.unit.test.d.ts.map +1 -0
- package/dist/__tests__/engine-worker-world-swap.unit.test.d.ts +2 -0
- package/dist/__tests__/engine-worker-world-swap.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors-pointer-lock-failed.test.d.ts +2 -0
- package/dist/__tests__/errors-pointer-lock-failed.test.d.ts.map +1 -0
- package/dist/__tests__/execution-bootstrap-isolation.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-bootstrap-isolation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-error-detail.test-d.d.ts +2 -0
- package/dist/__tests__/execution-error-detail.test-d.d.ts.map +1 -0
- package/dist/__tests__/execution-error-detail.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-error-detail.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-frame-order.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-frame-order.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-frame-protocol.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-frame-protocol.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-input-sample.contract.test.d.ts +2 -0
- package/dist/__tests__/execution-input-sample.contract.test.d.ts.map +1 -0
- package/dist/__tests__/execution-measurement.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-measurement.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-public-api.test-d.d.ts +2 -0
- package/dist/__tests__/execution-public-api.test-d.d.ts.map +1 -0
- package/dist/__tests__/execution-public-api.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-public-api.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-rebuild.contract.test.d.ts +2 -0
- package/dist/__tests__/execution-rebuild.contract.test.d.ts.map +1 -0
- package/dist/__tests__/execution-report.contract.test.d.ts +2 -0
- package/dist/__tests__/execution-report.contract.test.d.ts.map +1 -0
- package/dist/__tests__/execution-report.types.test-d.d.ts +2 -0
- package/dist/__tests__/execution-report.types.test-d.d.ts.map +1 -0
- package/dist/__tests__/execution-schema-freshness.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-schema-freshness.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-selector.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-selector.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-shared-kernel.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-shared-kernel.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-world-health-owner.test-d.d.ts +2 -0
- package/dist/__tests__/execution-world-health-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/fallback-camera.unit.test.d.ts +2 -0
- package/dist/__tests__/fallback-camera.unit.test.d.ts.map +1 -0
- package/dist/__tests__/frame-loop-time-elapsed.test.d.ts +2 -0
- package/dist/__tests__/frame-loop-time-elapsed.test.d.ts.map +1 -0
- package/dist/__tests__/frame-loop-time.unit.test.d.ts +2 -0
- package/dist/__tests__/frame-loop-time.unit.test.d.ts.map +1 -0
- package/dist/__tests__/frame-loop-world-array.test.d.ts +2 -0
- package/dist/__tests__/frame-loop-world-array.test.d.ts.map +1 -0
- package/dist/__tests__/kernel-worker-runtime.unit.test.d.ts +2 -0
- package/dist/__tests__/kernel-worker-runtime.unit.test.d.ts.map +1 -0
- package/dist/__tests__/migration-surface-inventory.unit.test.d.ts +2 -0
- package/dist/__tests__/migration-surface-inventory.unit.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-policy.integration.test.d.ts +2 -0
- package/dist/__tests__/plugin-policy.integration.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-profiles.unit.test.d.ts +2 -0
- package/dist/__tests__/plugin-profiles.unit.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-default-off.test.d.ts +2 -0
- package/dist/__tests__/profiler-default-off.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-frame-token.test.d.ts +2 -0
- package/dist/__tests__/profiler-frame-token.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-catalog.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-catalog.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-phase-integration.test.d.ts +2 -0
- package/dist/__tests__/profiler-phase-integration.test.d.ts.map +1 -0
- package/dist/__tests__/profiler-remote-bridge.test.d.ts +2 -0
- package/dist/__tests__/profiler-remote-bridge.test.d.ts.map +1 -0
- package/dist/__tests__/remote-integration.test.d.ts +2 -0
- package/dist/__tests__/remote-integration.test.d.ts.map +1 -0
- package/dist/__tests__/remote-serve-flag.test.d.ts +2 -0
- package/dist/__tests__/remote-serve-flag.test.d.ts.map +1 -0
- package/dist/__tests__/rhi-capture-capability.test-d.d.ts +2 -0
- package/dist/__tests__/rhi-capture-capability.test-d.d.ts.map +1 -0
- package/dist/__tests__/rhi-capture-host.integration.test.d.ts +2 -0
- package/dist/__tests__/rhi-capture-host.integration.test.d.ts.map +1 -0
- package/dist/__tests__/rhi-capture.browser.test.d.ts +2 -0
- package/dist/__tests__/rhi-capture.browser.test.d.ts.map +1 -0
- package/dist/__tests__/surface-handoff.test.d.ts +2 -0
- package/dist/__tests__/surface-handoff.test.d.ts.map +1 -0
- package/dist/__tests__/types-m2.test-d.d.ts +2 -0
- package/dist/__tests__/types-m2.test-d.d.ts.map +1 -0
- package/dist/__tests__/visibility-remote.integration.test.d.ts +2 -0
- package/dist/__tests__/visibility-remote.integration.test.d.ts.map +1 -0
- package/dist/__tests__/worker-execution-stop.test.d.ts +2 -0
- package/dist/__tests__/worker-execution-stop.test.d.ts.map +1 -0
- package/dist/animation-asset-lookup.d.ts +8 -0
- package/dist/animation-asset-lookup.d.ts.map +1 -0
- package/dist/assets-runtime-assembly.d.ts +19 -0
- package/dist/assets-runtime-assembly.d.ts.map +1 -0
- package/dist/canvas-policy.d.ts +4 -0
- package/dist/canvas-policy.d.ts.map +1 -0
- package/dist/create-app.d.ts +57 -0
- package/dist/create-app.d.ts.map +1 -0
- package/dist/engine-worker-runtime.mjs +884 -0
- package/dist/engine-worker-runtime.mjs.map +1 -0
- package/dist/errors.d.ts +263 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/execution/attached-world-swap.d.ts +21 -0
- package/dist/execution/attached-world-swap.d.ts.map +1 -0
- package/dist/execution/bootstrap-entry.d.ts +30 -0
- package/dist/execution/bootstrap-entry.d.ts.map +1 -0
- package/dist/execution/capabilities.d.ts +5 -0
- package/dist/execution/capabilities.d.ts.map +1 -0
- package/dist/execution/control.d.ts +14 -0
- package/dist/execution/control.d.ts.map +1 -0
- package/dist/execution/engine-worker-runtime.d.ts +2 -0
- package/dist/execution/engine-worker-runtime.d.ts.map +1 -0
- package/dist/execution/engine-worker.d.ts +23 -0
- package/dist/execution/engine-worker.d.ts.map +1 -0
- package/dist/execution/host-controller.d.ts +16 -0
- package/dist/execution/host-controller.d.ts.map +1 -0
- package/dist/execution/index.d.ts +10 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/kernel-pool.d.ts +14 -0
- package/dist/execution/kernel-pool.d.ts.map +1 -0
- package/dist/execution/kernel-worker-runtime.d.ts +2 -0
- package/dist/execution/kernel-worker-runtime.d.ts.map +1 -0
- package/dist/execution/measurement.d.ts +7 -0
- package/dist/execution/measurement.d.ts.map +1 -0
- package/dist/execution/protocol.d.ts +84 -0
- package/dist/execution/protocol.d.ts.map +1 -0
- package/dist/execution/report.d.ts +5 -0
- package/dist/execution/report.d.ts.map +1 -0
- package/dist/execution/schema.d.ts +4 -0
- package/dist/execution/schema.d.ts.map +1 -0
- package/dist/execution/selector.d.ts +10 -0
- package/dist/execution/selector.d.ts.map +1 -0
- package/dist/execution/types.d.ts +107 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/fallback-camera.d.ts +8 -0
- package/dist/fallback-camera.d.ts.map +1 -0
- package/dist/game-context.d.ts +98 -0
- package/dist/game-context.d.ts.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +3985 -0
- package/dist/index.mjs.map +1 -0
- package/dist/input-map-plugin.d.ts +5 -0
- package/dist/input-map-plugin.d.ts.map +1 -0
- package/dist/input-plugin.d.ts +4 -0
- package/dist/input-plugin.d.ts.map +1 -0
- package/dist/internal/assembled-engine-profile.d.ts +5 -0
- package/dist/internal/assembled-engine-profile.d.ts.map +1 -0
- package/dist/internal/assets-world-plugin.d.ts +21 -0
- package/dist/internal/assets-world-plugin.d.ts.map +1 -0
- package/dist/internal/browser-remote-bridge.d.ts +25 -0
- package/dist/internal/browser-remote-bridge.d.ts.map +1 -0
- package/dist/internal/browser-rhi-debug-runtime.d.ts +18 -0
- package/dist/internal/browser-rhi-debug-runtime.d.ts.map +1 -0
- package/dist/internal/component-introspection.d.ts +24 -0
- package/dist/internal/component-introspection.d.ts.map +1 -0
- package/dist/internal/ecs-import.d.ts +6 -0
- package/dist/internal/ecs-import.d.ts.map +1 -0
- package/dist/internal/engine-profile-common.d.ts +9 -0
- package/dist/internal/engine-profile-common.d.ts.map +1 -0
- package/dist/internal/error-fanout.d.ts +66 -0
- package/dist/internal/error-fanout.d.ts.map +1 -0
- package/dist/internal/frame-loop.d.ts +35 -0
- package/dist/internal/frame-loop.d.ts.map +1 -0
- package/dist/internal/input-attach.d.ts +44 -0
- package/dist/internal/input-attach.d.ts.map +1 -0
- package/dist/internal/main-engine-profile.d.ts +15 -0
- package/dist/internal/main-engine-profile.d.ts.map +1 -0
- package/dist/internal/remote-serve-flag.d.ts +23 -0
- package/dist/internal/remote-serve-flag.d.ts.map +1 -0
- package/dist/internal/remote-server-plugin.d.ts +8 -0
- package/dist/internal/remote-server-plugin.d.ts.map +1 -0
- package/dist/internal/rhi-capture.d.ts +19 -0
- package/dist/internal/rhi-capture.d.ts.map +1 -0
- package/dist/internal/rhi-debug-flag.d.ts +18 -0
- package/dist/internal/rhi-debug-flag.d.ts.map +1 -0
- package/dist/internal/worker-engine-profile.d.ts +13 -0
- package/dist/internal/worker-engine-profile.d.ts.map +1 -0
- package/dist/kernel-worker-runtime.mjs +69 -0
- package/dist/kernel-worker-runtime.mjs.map +1 -0
- package/dist/load-game-errors.d.ts +131 -0
- package/dist/load-game-errors.d.ts.map +1 -0
- package/dist/load-game.d.ts +34 -0
- package/dist/load-game.d.ts.map +1 -0
- package/dist/plugin-factories.d.ts +3 -0
- package/dist/plugin-factories.d.ts.map +1 -0
- package/dist/tool-preview/bootstrap.d.ts +113 -0
- package/dist/tool-preview/bootstrap.d.ts.map +1 -0
- package/dist/tool-preview/evidence.d.ts +20 -0
- package/dist/tool-preview/evidence.d.ts.map +1 -0
- package/dist/tool-preview/framing.d.ts +13 -0
- package/dist/tool-preview/framing.d.ts.map +1 -0
- package/dist/tool-preview/recipe.d.ts +54 -0
- package/dist/tool-preview/recipe.d.ts.map +1 -0
- package/dist/types.d.ts +444 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +86 -0
- package/schema/execution-report.schema.json +168 -0
- package/src/__tests__/animation-asset-lookup.unit.test.ts +20 -0
- package/src/__tests__/app-rebuild.test.ts +31 -0
- package/src/__tests__/asset-registry-types.test-d.ts +16 -0
- package/src/__tests__/assets-runtime-assembly.integration.test.ts +68 -0
- package/src/__tests__/callback-deletion.unit.test.ts +14 -0
- package/src/__tests__/callback-inference.test-d.ts +32 -0
- package/src/__tests__/component-introspection.unit.test.ts +56 -0
- package/src/__tests__/consumer-migration.unit.test.ts +21 -0
- package/src/__tests__/create-app-features.test.ts +40 -0
- package/src/__tests__/create-app-listener-sync.test.ts +377 -0
- package/src/__tests__/create-app-lock-provider.test.ts +212 -0
- package/src/__tests__/create-app-plugin.test.ts +217 -0
- package/src/__tests__/create-app-stop.test.ts +617 -0
- package/src/__tests__/create-app-time.unit.test.ts +26 -0
- package/src/__tests__/create-app.test-d.ts +82 -0
- package/src/__tests__/create-app.test.ts +346 -0
- package/src/__tests__/create-renderer-error.integration.test.ts +24 -0
- package/src/__tests__/create-renderer-lifecycle.integration.test.ts +19 -0
- package/src/__tests__/docs-gate-green.unit.test.ts +61 -0
- package/src/__tests__/draw-source-headless-full-chain.test.ts +226 -0
- package/src/__tests__/draw-source-injected-world-update-visibility.test.ts +182 -0
- package/src/__tests__/draw-source-single-world-regression.test.ts +185 -0
- package/src/__tests__/ecs-import.unit.test.ts +40 -0
- package/src/__tests__/engine-worker-bootstrap-channel.unit.test.ts +74 -0
- package/src/__tests__/engine-worker-world-swap.unit.test.ts +76 -0
- package/src/__tests__/errors-pointer-lock-failed.test.ts +268 -0
- package/src/__tests__/execution-bootstrap-isolation.unit.test.ts +80 -0
- package/src/__tests__/execution-error-detail.test-d.ts +13 -0
- package/src/__tests__/execution-error-detail.unit.test.ts +35 -0
- package/src/__tests__/execution-frame-order.unit.test.ts +38 -0
- package/src/__tests__/execution-frame-protocol.unit.test.ts +61 -0
- package/src/__tests__/execution-input-sample.contract.test.ts +23 -0
- package/src/__tests__/execution-measurement.unit.test.ts +20 -0
- package/src/__tests__/execution-public-api.test-d.ts +10 -0
- package/src/__tests__/execution-public-api.unit.test.ts +9 -0
- package/src/__tests__/execution-rebuild.contract.test.ts +36 -0
- package/src/__tests__/execution-report.contract.test.ts +50 -0
- package/src/__tests__/execution-report.types.test-d.ts +16 -0
- package/src/__tests__/execution-schema-freshness.unit.test.ts +20 -0
- package/src/__tests__/execution-selector.unit.test.ts +72 -0
- package/src/__tests__/execution-shared-kernel.unit.test.ts +180 -0
- package/src/__tests__/execution-world-health-owner.test-d.ts +9 -0
- package/src/__tests__/fallback-camera.unit.test.ts +32 -0
- package/src/__tests__/frame-loop-time-elapsed.test.ts +115 -0
- package/src/__tests__/frame-loop-time.unit.test.ts +61 -0
- package/src/__tests__/frame-loop-world-array.test.ts +441 -0
- package/src/__tests__/kernel-worker-runtime.unit.test.ts +50 -0
- package/src/__tests__/migration-surface-inventory.unit.test.ts +13 -0
- package/src/__tests__/plugin-policy.integration.test.ts +15 -0
- package/src/__tests__/plugin-profiles.unit.test.ts +190 -0
- package/src/__tests__/profiler-default-off.test.ts +53 -0
- package/src/__tests__/profiler-frame-token.test.ts +248 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +30 -0
- package/src/__tests__/profiler-phase-integration.test.ts +129 -0
- package/src/__tests__/profiler-remote-bridge.test.ts +31 -0
- package/src/__tests__/remote-integration.test.ts +224 -0
- package/src/__tests__/remote-serve-flag.test.ts +24 -0
- package/src/__tests__/rhi-capture-capability.test-d.ts +22 -0
- package/src/__tests__/rhi-capture-host.integration.test.ts +157 -0
- package/src/__tests__/rhi-capture.browser.test.ts +51 -0
- package/src/__tests__/surface-handoff.test.ts +92 -0
- package/src/__tests__/types-m2.test-d.ts +81 -0
- package/src/__tests__/visibility-remote.integration.test.ts +119 -0
- package/src/__tests__/worker-execution-stop.test.ts +116 -0
- package/src/animation-asset-lookup.ts +13 -0
- package/src/assets-runtime-assembly.ts +70 -0
- package/src/canvas-policy.ts +16 -0
- package/src/create-app.ts +1351 -0
- package/src/errors.ts +454 -0
- package/src/execution/attached-world-swap.ts +67 -0
- package/src/execution/bootstrap-entry.ts +122 -0
- package/src/execution/capabilities.ts +102 -0
- package/src/execution/control.ts +52 -0
- package/src/execution/engine-worker-runtime.ts +400 -0
- package/src/execution/engine-worker.ts +161 -0
- package/src/execution/host-controller.ts +454 -0
- package/src/execution/index.ts +43 -0
- package/src/execution/kernel-pool.ts +236 -0
- package/src/execution/kernel-worker-runtime.ts +103 -0
- package/src/execution/measurement.ts +39 -0
- package/src/execution/protocol.ts +131 -0
- package/src/execution/report.ts +66 -0
- package/src/execution/schema.ts +168 -0
- package/src/execution/selector.ts +98 -0
- package/src/execution/types.ts +146 -0
- package/src/fallback-camera.ts +20 -0
- package/src/game-context.ts +126 -0
- package/src/index.ts +176 -0
- package/src/input-map-plugin.ts +21 -0
- package/src/input-plugin.ts +26 -0
- package/src/internal/assembled-engine-profile.ts +22 -0
- package/src/internal/assets-world-plugin.ts +79 -0
- package/src/internal/browser-remote-bridge.ts +267 -0
- package/src/internal/browser-rhi-debug-runtime.ts +67 -0
- package/src/internal/component-introspection.ts +116 -0
- package/src/internal/ecs-import.ts +41 -0
- package/src/internal/engine-profile-common.ts +10 -0
- package/src/internal/error-fanout.ts +129 -0
- package/src/internal/frame-loop.ts +525 -0
- package/src/internal/input-attach.ts +104 -0
- package/src/internal/main-engine-profile.ts +80 -0
- package/src/internal/remote-serve-flag.ts +50 -0
- package/src/internal/remote-server-plugin.ts +16 -0
- package/src/internal/rhi-capture.ts +211 -0
- package/src/internal/rhi-debug-flag.ts +40 -0
- package/src/internal/worker-engine-profile.ts +47 -0
- package/src/load-game-errors.ts +211 -0
- package/src/load-game.ts +115 -0
- package/src/plugin-factories.ts +2 -0
- package/src/tool-preview/bootstrap.ts +848 -0
- package/src/tool-preview/evidence.ts +59 -0
- package/src/tool-preview/framing.ts +52 -0
- package/src/tool-preview/recipe.ts +137 -0
- package/src/types.ts +505 -0
- package/src/vite-env.d.ts +12 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// create-app-plugin.test.ts -- createApp + Cordis integration.
|
|
2
|
+
//
|
|
3
|
+
// Covers:
|
|
4
|
+
// - The canvas-form default plugin set registers the expected world systems.
|
|
5
|
+
// - AC-02: physics + audio plugins register the expected world system set
|
|
6
|
+
// (physics tick systems + 'PhysicsWorld' resource; audio-tick).
|
|
7
|
+
// - A failing plugin activation surfaces as an AppError with its cause.
|
|
8
|
+
// - physicsPlugin's async apply completes BEFORE createApp resolves
|
|
9
|
+
// (no post-resolve timing gap -- app.physics is populated immediately).
|
|
10
|
+
//
|
|
11
|
+
// Environment: the assemble form is driven with a renderer stub (no WebGPU),
|
|
12
|
+
// exercising the real createApp -> Context.plugin path. The rapier 3D WASM backend
|
|
13
|
+
// loads in dawn-node, so the physics path runs for real; if it ever becomes
|
|
14
|
+
// unavailable the physics-dependent cases skip with a reason (per plan-strategy
|
|
15
|
+
// section 5.4 no-skip-by-default).
|
|
16
|
+
//
|
|
17
|
+
// charter awareness:
|
|
18
|
+
// P2 structured > prose: assertions read world.inspect().systems (a
|
|
19
|
+
// machine-readable enumeration), not pixels.
|
|
20
|
+
// P3 explicit failure: activation failures assert structured AppError detail.
|
|
21
|
+
|
|
22
|
+
import { animationPlugin } from '@forgeax/engine-animation';
|
|
23
|
+
import {
|
|
24
|
+
AUDIO_ENGINE_RESOURCE_KEY,
|
|
25
|
+
AUDIO_TICK_SYSTEM_NAME,
|
|
26
|
+
audioBackendPlugin,
|
|
27
|
+
audioPlugin,
|
|
28
|
+
createAudioIntentBackend,
|
|
29
|
+
} from '@forgeax/engine-audio';
|
|
30
|
+
import { createWorldContext, World } from '@forgeax/engine-ecs';
|
|
31
|
+
import { inputBackendPlugin } from '@forgeax/engine-input';
|
|
32
|
+
import { physicsPlugin } from '@forgeax/engine-physics';
|
|
33
|
+
import type { Plugin } from '@forgeax/engine-plugin';
|
|
34
|
+
import type { Renderer } from '@forgeax/engine-render';
|
|
35
|
+
import { scenePlugin } from '@forgeax/engine-scene';
|
|
36
|
+
import { statePlugin } from '@forgeax/engine-state';
|
|
37
|
+
import { beforeAll, describe, expect, it } from 'vitest';
|
|
38
|
+
import { createApp } from '../create-app';
|
|
39
|
+
import { inputPlugin } from '../plugin-factories';
|
|
40
|
+
|
|
41
|
+
function makeRendererStub(): Renderer {
|
|
42
|
+
const ready: Promise<{ ok: true; value: undefined }> = Promise.resolve({
|
|
43
|
+
ok: true,
|
|
44
|
+
value: undefined,
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
backend: 'webgpu' as const,
|
|
48
|
+
ready,
|
|
49
|
+
draw: (): { ok: true; value: undefined } => ({ ok: true, value: undefined }),
|
|
50
|
+
onError: (): (() => void) => () => {},
|
|
51
|
+
onLost: (): (() => void) => () => {},
|
|
52
|
+
assets: {},
|
|
53
|
+
dispose: (): void => {},
|
|
54
|
+
} as unknown as Renderer;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function systemNames(world: World): string[] {
|
|
58
|
+
return world.inspect().systems.map((s) => s.name);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Probe whether the rapier 3D WASM backend loads in this environment.
|
|
62
|
+
// Physics-dependent cases skip explicitly (it.skipIf) when unavailable,
|
|
63
|
+
// rather than silently returning from the test body (charter P3: explicit
|
|
64
|
+
// failure > silent behaviour).
|
|
65
|
+
let rapierAvailable = false;
|
|
66
|
+
beforeAll(async () => {
|
|
67
|
+
try {
|
|
68
|
+
const m = await import('@forgeax/engine-physics-rapier3d');
|
|
69
|
+
const rapier = await m.loadRapier3D();
|
|
70
|
+
m.createRapier3DPhysicsWorld(rapier);
|
|
71
|
+
rapierAvailable = true;
|
|
72
|
+
} catch {
|
|
73
|
+
rapierAvailable = false;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
describe('createApp plugin runner -- default set (AC-03)', () => {
|
|
78
|
+
it('the canvas default set is transform/animation/state/input', async () => {
|
|
79
|
+
// The canvas form's default set, run directly against a World (no renderer
|
|
80
|
+
// needed). INPUT_BACKEND_KEY is pre-inserted so inputPlugin registers its
|
|
81
|
+
// scan system (mirrors createApp's app-layer input attach).
|
|
82
|
+
const world = new World();
|
|
83
|
+
const defaultSet: Plugin[] = [
|
|
84
|
+
inputBackendPlugin({ sample: () => ({}) } as never),
|
|
85
|
+
scenePlugin(),
|
|
86
|
+
animationPlugin(),
|
|
87
|
+
statePlugin(),
|
|
88
|
+
inputPlugin(),
|
|
89
|
+
];
|
|
90
|
+
const ctx = await createWorldContext(world, defaultSet);
|
|
91
|
+
expect([...ctx.registry.values()].map((runtime) => runtime.name)).toEqual([
|
|
92
|
+
'world',
|
|
93
|
+
'input-backend',
|
|
94
|
+
'scene',
|
|
95
|
+
'animation',
|
|
96
|
+
'state',
|
|
97
|
+
'input',
|
|
98
|
+
]);
|
|
99
|
+
|
|
100
|
+
// World systems registered by the default set.
|
|
101
|
+
const names = systemNames(world);
|
|
102
|
+
expect(names).toContain('propagateTransforms');
|
|
103
|
+
expect(names).toContain('advanceAnimationPlayer');
|
|
104
|
+
expect(names).toContain('transitionStates');
|
|
105
|
+
expect(names).toContain('input-frame-start-scan');
|
|
106
|
+
|
|
107
|
+
await ctx.fiber.dispose();
|
|
108
|
+
const disposedNames = systemNames(world);
|
|
109
|
+
expect(disposedNames).not.toContain('propagateTransforms');
|
|
110
|
+
expect(disposedNames).not.toContain('advanceAnimationPlayer');
|
|
111
|
+
expect(disposedNames).not.toContain('transitionStates');
|
|
112
|
+
expect(disposedNames).not.toContain('input-frame-start-scan');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('inputPlugin remains pending while its backend service is unavailable', async () => {
|
|
116
|
+
const world = new World();
|
|
117
|
+
const ctx = await createWorldContext(world, [inputPlugin()]);
|
|
118
|
+
expect(ctx.input).toBeUndefined();
|
|
119
|
+
expect(systemNames(world)).not.toContain('input-frame-start-scan');
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe('createApp plugin runner -- physics + audio system set (AC-02)', () => {
|
|
124
|
+
it('audioPlugin registers the audio-tick system when the backend resource is present', async () => {
|
|
125
|
+
const world = new World();
|
|
126
|
+
const ctx = await createWorldContext(world, [
|
|
127
|
+
audioBackendPlugin(createAudioIntentBackend({ emit: () => undefined })),
|
|
128
|
+
audioPlugin(),
|
|
129
|
+
]);
|
|
130
|
+
expect(systemNames(world)).toContain(AUDIO_TICK_SYSTEM_NAME);
|
|
131
|
+
await ctx.fiber.dispose();
|
|
132
|
+
expect(systemNames(world)).not.toContain(AUDIO_TICK_SYSTEM_NAME);
|
|
133
|
+
expect(world.hasResource(AUDIO_ENGINE_RESOURCE_KEY)).toBe(false);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('physicsPlugin inserts PhysicsWorld + registers physics systems on success', {
|
|
137
|
+
skip: !rapierAvailable,
|
|
138
|
+
}, async () => {
|
|
139
|
+
const world = new World();
|
|
140
|
+
const ctx = await createWorldContext(world, [physicsPlugin('rapier-3d')]);
|
|
141
|
+
expect(world.hasResource('PhysicsWorld')).toBe(true);
|
|
142
|
+
// AC-02: physics registers its three-phase tick systems. Assert the
|
|
143
|
+
// expected system names are present (plan-strategy section 5.2
|
|
144
|
+
// enumeration vs. old opts path system set).
|
|
145
|
+
const names = systemNames(world);
|
|
146
|
+
expect(names).toContain('physicsSyncBackend');
|
|
147
|
+
expect(names).toContain('physicsStepSimulation');
|
|
148
|
+
expect(names).toContain('physicsWriteback');
|
|
149
|
+
await ctx.fiber.dispose();
|
|
150
|
+
expect(world.hasResource('PhysicsWorld')).toBe(false);
|
|
151
|
+
expect(systemNames(world)).not.toContain('physicsSyncBackend');
|
|
152
|
+
expect(systemNames(world)).not.toContain('physicsStepSimulation');
|
|
153
|
+
expect(systemNames(world)).not.toContain('physicsWriteback');
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
describe('createApp Cordis registry identity', () => {
|
|
158
|
+
it('permits separate fibers to share a diagnostic name', async () => {
|
|
159
|
+
const result = await createApp({
|
|
160
|
+
renderer: makeRendererStub(),
|
|
161
|
+
world: new World(),
|
|
162
|
+
plugins: [audioPlugin(), audioPlugin()],
|
|
163
|
+
});
|
|
164
|
+
expect(result.ok).toBe(true);
|
|
165
|
+
if (!result.ok) return;
|
|
166
|
+
expect(
|
|
167
|
+
[...result.value.pluginContext.registry.values()].filter(
|
|
168
|
+
(runtime) => runtime.name === 'audio',
|
|
169
|
+
),
|
|
170
|
+
).toHaveLength(2);
|
|
171
|
+
await result.value.dispose();
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
describe('createApp plugin runner -- build failure (AC-05)', () => {
|
|
176
|
+
it('createApp(assemble) surfaces plugin-apply-failed with detail.cause', async () => {
|
|
177
|
+
const failing: Plugin = {
|
|
178
|
+
name: 'boom',
|
|
179
|
+
apply() {
|
|
180
|
+
throw new Error('simulated WASM failure');
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const result = await createApp({
|
|
184
|
+
renderer: makeRendererStub(),
|
|
185
|
+
world: new World(),
|
|
186
|
+
plugins: [failing],
|
|
187
|
+
});
|
|
188
|
+
expect(result.ok).toBe(false);
|
|
189
|
+
if (result.ok) return;
|
|
190
|
+
expect(result.error.code).toBe('app-plugin-activation-failed');
|
|
191
|
+
if (result.error.code !== 'app-plugin-activation-failed') return;
|
|
192
|
+
expect(result.error.detail.cause).toBeInstanceOf(Error);
|
|
193
|
+
expect((result.error.detail.cause as Error).message).toBe('simulated WASM failure');
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
describe('createApp plugin runner -- physics async timing (AC-06)', () => {
|
|
198
|
+
it('app.physics is populated immediately after createApp resolves (no timing gap)', {
|
|
199
|
+
skip: !rapierAvailable,
|
|
200
|
+
}, async () => {
|
|
201
|
+
const result = await createApp({
|
|
202
|
+
renderer: makeRendererStub(),
|
|
203
|
+
world: new World(),
|
|
204
|
+
plugins: [physicsPlugin('rapier-3d')],
|
|
205
|
+
});
|
|
206
|
+
expect(result.ok).toBe(true);
|
|
207
|
+
if (!result.ok) return;
|
|
208
|
+
// Because Context.plugin awaits physicsPlugin's async apply before createApp
|
|
209
|
+
// resolves, the 'PhysicsWorld' resource is already present -- app.physics
|
|
210
|
+
// reads it back synchronously with no post-resolve fire-and-forget gap.
|
|
211
|
+
expect(result.value.physics).toBeDefined();
|
|
212
|
+
// Verify the resource is present in the World (not just on the App handle,
|
|
213
|
+
// confirming the physicsPlugin build fully populated it before resolve).
|
|
214
|
+
expect(result.value.world.hasResource('PhysicsWorld')).toBe(true);
|
|
215
|
+
await result.value.dispose();
|
|
216
|
+
});
|
|
217
|
+
});
|