@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.
- package/LICENSE +202 -0
- package/README.md +424 -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__/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-error-retention.integration.test.d.ts +2 -0
- package/dist/__tests__/create-app-error-retention.integration.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-physics-plugin-failure.integration.test.d.ts +2 -0
- package/dist/__tests__/create-app-physics-plugin-failure.integration.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-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__/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__/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__/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 +7 -0
- package/dist/animation-asset-lookup.d.ts.map +1 -0
- package/dist/browser-frame-signal.d.ts +17 -0
- package/dist/browser-frame-signal.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 +78 -0
- package/dist/create-app.d.ts.map +1 -0
- package/dist/engine-worker-runtime.mjs +827 -0
- package/dist/engine-worker-runtime.mjs.map +1 -0
- package/dist/errors.d.ts +254 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/execution/attached-world-swap.d.ts +10 -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/bootstrap-url.d.ts +5 -0
- package/dist/execution/bootstrap-url.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 +12 -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 +24 -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 +87 -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 +123 -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 +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +3980 -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 +7 -0
- package/dist/internal/assets-world-plugin.d.ts.map +1 -0
- package/dist/internal/browser-remote-bridge.d.ts +24 -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/debug-draw.d.ts +9 -0
- package/dist/internal/debug-draw.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 +38 -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 +19 -0
- package/dist/internal/main-engine-profile.d.ts.map +1 -0
- package/dist/internal/remote-serve-flag.d.ts +19 -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 +15 -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/renderer-plugin.d.ts +25 -0
- package/dist/renderer-plugin.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 +404 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +85 -0
- package/schema/execution-report.schema.json +168 -0
- package/src/__tests__/animation-asset-lookup.unit.test.ts +20 -0
- package/src/__tests__/callback-deletion.unit.test.ts +14 -0
- package/src/__tests__/callback-inference.test-d.ts +36 -0
- package/src/__tests__/component-introspection.unit.test.ts +56 -0
- package/src/__tests__/consumer-migration.unit.test.ts +34 -0
- package/src/__tests__/create-app-error-retention.integration.test.ts +125 -0
- package/src/__tests__/create-app-features.test.ts +51 -0
- package/src/__tests__/create-app-listener-sync.test.ts +381 -0
- package/src/__tests__/create-app-lock-provider.test.ts +212 -0
- package/src/__tests__/create-app-physics-plugin-failure.integration.test.ts +142 -0
- package/src/__tests__/create-app-plugin.test.ts +217 -0
- package/src/__tests__/create-app-stop.test.ts +609 -0
- package/src/__tests__/create-app-time.unit.test.ts +26 -0
- package/src/__tests__/create-app.test-d.ts +83 -0
- package/src/__tests__/create-app.test.ts +287 -0
- package/src/__tests__/create-renderer-error.integration.test.ts +25 -0
- package/src/__tests__/create-renderer-lifecycle.integration.test.ts +24 -0
- package/src/__tests__/docs-gate-green.unit.test.ts +61 -0
- package/src/__tests__/draw-source-injected-world-update-visibility.test.ts +176 -0
- package/src/__tests__/draw-source-single-world-regression.test.ts +184 -0
- package/src/__tests__/engine-worker-bootstrap-channel.unit.test.ts +82 -0
- package/src/__tests__/engine-worker-world-swap.unit.test.ts +69 -0
- package/src/__tests__/errors-pointer-lock-failed.test.ts +265 -0
- package/src/__tests__/execution-bootstrap-isolation.unit.test.ts +79 -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 +60 -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 +14 -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__/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 +450 -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 +235 -0
- package/src/__tests__/profiler-phase-catalog.test.ts +30 -0
- package/src/__tests__/profiler-phase-integration.test.ts +117 -0
- package/src/__tests__/profiler-remote-bridge.test.ts +31 -0
- package/src/__tests__/remote-integration.test.ts +224 -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 +89 -0
- package/src/__tests__/types-m2.test-d.ts +81 -0
- package/src/__tests__/visibility-remote.integration.test.ts +116 -0
- package/src/__tests__/worker-execution-stop.test.ts +173 -0
- package/src/animation-asset-lookup.ts +13 -0
- package/src/browser-frame-signal.ts +44 -0
- package/src/canvas-policy.ts +16 -0
- package/src/create-app.ts +1264 -0
- package/src/errors.ts +442 -0
- package/src/execution/attached-world-swap.ts +33 -0
- package/src/execution/bootstrap-entry.ts +122 -0
- package/src/execution/bootstrap-url.ts +25 -0
- package/src/execution/capabilities.ts +102 -0
- package/src/execution/control.ts +48 -0
- package/src/execution/engine-worker-runtime.ts +383 -0
- package/src/execution/engine-worker.ts +163 -0
- package/src/execution/host-controller.ts +460 -0
- package/src/execution/index.ts +44 -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 +134 -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 +163 -0
- package/src/fallback-camera.ts +20 -0
- package/src/game-context.ts +126 -0
- package/src/index.ts +190 -0
- package/src/input-map-plugin.ts +21 -0
- package/src/input-plugin.ts +26 -0
- package/src/internal/assembled-engine-profile.ts +14 -0
- package/src/internal/assets-world-plugin.ts +33 -0
- package/src/internal/browser-remote-bridge.ts +269 -0
- package/src/internal/browser-rhi-debug-runtime.ts +67 -0
- package/src/internal/component-introspection.ts +116 -0
- package/src/internal/debug-draw.ts +38 -0
- package/src/internal/ecs-import.ts +41 -0
- package/src/internal/engine-profile-common.ts +9 -0
- package/src/internal/error-fanout.ts +129 -0
- package/src/internal/frame-loop.ts +539 -0
- package/src/internal/input-attach.ts +104 -0
- package/src/internal/main-engine-profile.ts +84 -0
- package/src/internal/remote-serve-flag.ts +41 -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/renderer-plugin.ts +96 -0
- package/src/tool-preview/bootstrap.ts +835 -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 +450 -0
- package/src/vite-env.d.ts +10 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type Component, componentDefinition, type FieldReflection } from '@forgeax/engine-ecs';
|
|
2
|
+
import { componentSchema } from '@forgeax/engine-ecs/internal';
|
|
3
|
+
|
|
4
|
+
export type JsonValue =
|
|
5
|
+
| null
|
|
6
|
+
| boolean
|
|
7
|
+
| number
|
|
8
|
+
| string
|
|
9
|
+
| readonly JsonValue[]
|
|
10
|
+
| { readonly [key: string]: JsonValue };
|
|
11
|
+
|
|
12
|
+
export interface ComponentIntrospectionField {
|
|
13
|
+
readonly type: string;
|
|
14
|
+
readonly default?: JsonValue;
|
|
15
|
+
readonly shape?: string;
|
|
16
|
+
readonly transient?: boolean;
|
|
17
|
+
readonly arrayMeta?: {
|
|
18
|
+
readonly elementType: string;
|
|
19
|
+
readonly length?: number;
|
|
20
|
+
};
|
|
21
|
+
readonly labels?: Readonly<Record<string, number>>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ComponentIntrospectionDescriptor {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly schema: Readonly<Record<string, string>>;
|
|
27
|
+
readonly fields: Readonly<Record<string, ComponentIntrospectionField>>;
|
|
28
|
+
readonly meta: Readonly<Record<string, JsonValue>>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function projectJson(value: unknown, seen: Set<object>): JsonValue | undefined {
|
|
32
|
+
if (value === null) return null;
|
|
33
|
+
if (typeof value === 'boolean' || typeof value === 'string') return value;
|
|
34
|
+
if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;
|
|
35
|
+
if (typeof value !== 'object') return undefined;
|
|
36
|
+
if (seen.has(value)) return undefined;
|
|
37
|
+
seen.add(value);
|
|
38
|
+
|
|
39
|
+
if (ArrayBuffer.isView(value)) {
|
|
40
|
+
const values = Array.from(value as unknown as ArrayLike<unknown>);
|
|
41
|
+
const projected = values.map((entry) => projectJson(entry, seen));
|
|
42
|
+
seen.delete(value);
|
|
43
|
+
return projected.every((entry) => entry !== undefined) ? (projected as JsonValue[]) : undefined;
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
const projected = value.map((entry) => projectJson(entry, seen));
|
|
47
|
+
seen.delete(value);
|
|
48
|
+
return projected.every((entry) => entry !== undefined) ? (projected as JsonValue[]) : undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const object: Record<string, JsonValue> = {};
|
|
52
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
53
|
+
const projected = projectJson(entry, seen);
|
|
54
|
+
if (projected !== undefined) object[key] = projected;
|
|
55
|
+
}
|
|
56
|
+
seen.delete(value);
|
|
57
|
+
return object;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isJsonRecord(
|
|
61
|
+
value: JsonValue | undefined,
|
|
62
|
+
): value is { readonly [key: string]: JsonValue } {
|
|
63
|
+
return (
|
|
64
|
+
value !== undefined && value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function projectMeta(meta: Readonly<Record<string, unknown>>): Readonly<Record<string, JsonValue>> {
|
|
69
|
+
const projected = projectJson(meta, new Set<object>());
|
|
70
|
+
return isJsonRecord(projected) ? projected : {};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function projectField(reflection: FieldReflection): ComponentIntrospectionField {
|
|
74
|
+
const field: ComponentIntrospectionField = { type: reflection.type };
|
|
75
|
+
const defaultValue = projectJson(reflection.default, new Set<object>());
|
|
76
|
+
if (defaultValue !== undefined) Object.assign(field, { default: defaultValue });
|
|
77
|
+
if (reflection.shape !== undefined) Object.assign(field, { shape: reflection.shape });
|
|
78
|
+
if (reflection.transient !== undefined) Object.assign(field, { transient: reflection.transient });
|
|
79
|
+
if (reflection.arrayMeta !== undefined) {
|
|
80
|
+
Object.assign(field, {
|
|
81
|
+
arrayMeta: {
|
|
82
|
+
elementType: reflection.arrayMeta.elementType,
|
|
83
|
+
...(reflection.arrayMeta.length !== undefined
|
|
84
|
+
? { length: reflection.arrayMeta.length }
|
|
85
|
+
: {}),
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (reflection.labels !== undefined) Object.assign(field, { labels: { ...reflection.labels } });
|
|
90
|
+
return Object.freeze(field);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function projectComponent(component: Component): ComponentIntrospectionDescriptor {
|
|
94
|
+
const definition = componentDefinition(component);
|
|
95
|
+
const fields: Record<string, ComponentIntrospectionField> = {};
|
|
96
|
+
for (const [name, reflection] of Object.entries(definition.fields)) {
|
|
97
|
+
fields[name] = projectField(reflection);
|
|
98
|
+
}
|
|
99
|
+
return Object.freeze({
|
|
100
|
+
name: component.name,
|
|
101
|
+
schema: Object.freeze({ ...componentSchema(component) }),
|
|
102
|
+
fields: Object.freeze(fields),
|
|
103
|
+
meta: Object.freeze(projectMeta(definition.policy.meta)),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Project one World-local component catalog into transport-safe data. */
|
|
108
|
+
export function projectComponentIntrospection(
|
|
109
|
+
components: ReadonlyMap<string, Component>,
|
|
110
|
+
): readonly ComponentIntrospectionDescriptor[] {
|
|
111
|
+
return Object.freeze(
|
|
112
|
+
[...components.values()]
|
|
113
|
+
.sort((left, right) => left.name.localeCompare(right.name))
|
|
114
|
+
.map(projectComponent),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DebugDraw } from '@forgeax/engine-debug-draw';
|
|
2
|
+
import { createDebugDraw } from '@forgeax/engine-debug-draw';
|
|
3
|
+
import type { RendererHostAssembly } from '@forgeax/engine-render/internal/construct-renderer';
|
|
4
|
+
import type { TextureFormat } from '@forgeax/engine-rhi';
|
|
5
|
+
import { selectSwapChainFormat } from '../../../render/src/record/render-context';
|
|
6
|
+
|
|
7
|
+
export type RendererDebugDrawHost = Pick<
|
|
8
|
+
RendererHostAssembly['debugDrawHost'],
|
|
9
|
+
'initialization' | 'device' | '_internal_createShaderModule' | '_internal_setRenderOverlay'
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
/** Create the App-owned debug overlay after the renderer has initialized. */
|
|
13
|
+
export async function createDebugDrawOnReady(
|
|
14
|
+
context: RendererDebugDrawHost,
|
|
15
|
+
format?: TextureFormat,
|
|
16
|
+
): Promise<DebugDraw> {
|
|
17
|
+
const ready = await context.initialization;
|
|
18
|
+
if (!ready.ok) throw ready.error;
|
|
19
|
+
|
|
20
|
+
const resolvedFormat =
|
|
21
|
+
format ??
|
|
22
|
+
(selectSwapChainFormat(context.device.caps.storageBuffer).view as unknown as TextureFormat);
|
|
23
|
+
const result = await createDebugDraw({
|
|
24
|
+
device: context.device,
|
|
25
|
+
queue: context.device.queue,
|
|
26
|
+
createShaderModule: context._internal_createShaderModule,
|
|
27
|
+
format: resolvedFormat,
|
|
28
|
+
});
|
|
29
|
+
if (!result.ok) throw result.error;
|
|
30
|
+
context._internal_setRenderOverlay(result.value);
|
|
31
|
+
return result.value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Release the App-owned debug overlay and clear its Render capability. */
|
|
35
|
+
export function releaseDebugDraw(context: RendererDebugDrawHost, debugDraw: DebugDraw): void {
|
|
36
|
+
context._internal_setRenderOverlay(undefined);
|
|
37
|
+
debugDraw.destroy();
|
|
38
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// @forgeax/engine-app/internal/ecs-import — host-owned capability projection.
|
|
2
|
+
//
|
|
3
|
+
// The remote transport deliberately has no engine-package vocabulary. Hosts
|
|
4
|
+
// that expose ECS to eval inject this narrow projection at the transport seam,
|
|
5
|
+
// keeping the ECS wire surface and its dependency ownership in one place.
|
|
6
|
+
|
|
7
|
+
const ECS_MODULE_SPECIFIER = '@forgeax/engine-ecs';
|
|
8
|
+
|
|
9
|
+
export const ECS_PUBLIC_SYMBOLS = Object.freeze([
|
|
10
|
+
'World',
|
|
11
|
+
'Entity',
|
|
12
|
+
'Update',
|
|
13
|
+
'FixedUpdate',
|
|
14
|
+
'Time',
|
|
15
|
+
'FixedTime',
|
|
16
|
+
] as const);
|
|
17
|
+
|
|
18
|
+
export type EcsPublicSymbol = (typeof ECS_PUBLIC_SYMBOLS)[number];
|
|
19
|
+
export type EcsPublicModule = Readonly<Partial<Record<EcsPublicSymbol, unknown>>>;
|
|
20
|
+
|
|
21
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
22
|
+
return value !== null && typeof value === 'object';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function projectEcsPublicModule(value: unknown): EcsPublicModule {
|
|
26
|
+
if (!isRecord(value)) return {};
|
|
27
|
+
const projected: Record<string, unknown> = {};
|
|
28
|
+
for (const symbol of ECS_PUBLIC_SYMBOLS) {
|
|
29
|
+
if (symbol in value) projected[symbol] = value[symbol];
|
|
30
|
+
}
|
|
31
|
+
return projected;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function createEcsImportModule(
|
|
35
|
+
importModule: (specifier: string) => Promise<unknown>,
|
|
36
|
+
): (specifier: string) => Promise<unknown> {
|
|
37
|
+
return async (specifier: string): Promise<unknown> => {
|
|
38
|
+
const moduleValue = await importModule(specifier);
|
|
39
|
+
return specifier === ECS_MODULE_SPECIFIER ? projectEcsPublicModule(moduleValue) : moduleValue;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import type { Plugin } from '@forgeax/engine-plugin';
|
|
3
|
+
import type { Renderer } from '@forgeax/engine-render';
|
|
4
|
+
|
|
5
|
+
export interface EngineProfileBase {
|
|
6
|
+
readonly renderer: Renderer;
|
|
7
|
+
readonly assets?: AssetRegistry;
|
|
8
|
+
readonly extensions?: readonly Plugin[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// @forgeax/engine-app -- error fan-out registry + console.error fallback (M4 / w11).
|
|
2
|
+
//
|
|
3
|
+
// Public surface (consumed only by createApp + frame-loop -- this module
|
|
4
|
+
// lives under `internal/` and is not re-exported from the package barrel):
|
|
5
|
+
//
|
|
6
|
+
// const fan = new ErrorFanoutRegistry({ silenceUnhandledErrors: false });
|
|
7
|
+
// const off = fan.add(cb); // add listener; returns idempotent unsubscribe
|
|
8
|
+
// off(); // remove listener (safe to call twice)
|
|
9
|
+
// fan.fire(err); // fan out to all listeners; if none AND
|
|
10
|
+
// // silenceUnhandledErrors !== true, call
|
|
11
|
+
// // console.error(err)
|
|
12
|
+
//
|
|
13
|
+
// Wiring (per plan-strategy D-9 + research section 7.3
|
|
14
|
+
// createRenderer.ts:532-566 LostListenerRegistry side-evidence):
|
|
15
|
+
//
|
|
16
|
+
// - Listener set is a Set so duplicate add() is idempotent (set semantics).
|
|
17
|
+
// - fire() iterates over a snapshot so a listener that calls .add()/.remove()
|
|
18
|
+
// mid-fire does not perturb the iteration.
|
|
19
|
+
// - When the listener set is empty AND silenceUnhandledErrors !== true,
|
|
20
|
+
// console.error(err) is invoked once with the structured error object as
|
|
21
|
+
// the single argument. Tests pin reference equality via mock.calls[0][0]
|
|
22
|
+
// so the AI-user contract (.code / .expected / .hint structure preserved)
|
|
23
|
+
// is observable in browser devtools.
|
|
24
|
+
// - late-attach replay is deliberately NOT implemented. rAF errors are
|
|
25
|
+
// frame-time stream (each tick generates a fresh event); a replay
|
|
26
|
+
// semantic would surface stale state to a freshly registered listener.
|
|
27
|
+
// This is a deliberate divergence from runtime/createRenderer.ts:337-345
|
|
28
|
+
// LostListenerRegistry which DOES replay (because device.lost is a
|
|
29
|
+
// one-shot lifecycle event); see plan-strategy D-9 for the divergence
|
|
30
|
+
// rationale.
|
|
31
|
+
//
|
|
32
|
+
// Architecture principle SSOT: the listener set + the silence flag are the
|
|
33
|
+
// only state owned by this module; createApp passes the silence flag in via
|
|
34
|
+
// constructor options and never reads it again, so the SSOT is the Registry
|
|
35
|
+
// instance state.
|
|
36
|
+
|
|
37
|
+
import type { AppDispatchError } from '../types';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Listener callback for app-shell error fan-out.
|
|
41
|
+
*
|
|
42
|
+
* The narrow union (`AppDispatchError` = AppError | RhiError | RuntimeError)
|
|
43
|
+
* deliberately excludes raw `Error` (charter P3 explicit failure: AI users
|
|
44
|
+
* walk `.code` not message strings). `RuntimeError` is included so a
|
|
45
|
+
* runtime-layer error fanned out by `Renderer.onError` (e.g.
|
|
46
|
+
* `'equirect-projection-failed'`) reaches host App listeners verbatim
|
|
47
|
+
* (feat-20260531-skybox-env-background F-1). `EngineEnvironmentError` does not
|
|
48
|
+
* appear here because construction-time failure flows through
|
|
49
|
+
* `Promise<Result<App, ...>>` of `createApp(canvas)` before the App handle
|
|
50
|
+
* exists; once an App handle is alive, only frame-time errors (this union)
|
|
51
|
+
* reach onError.
|
|
52
|
+
*/
|
|
53
|
+
export type ErrorFanoutListener = (err: AppDispatchError) => void;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Constructor options for ErrorFanoutRegistry. Mirrors the
|
|
57
|
+
* `silenceUnhandledErrors` field on CreateAppOptions / AppAssembleArgs;
|
|
58
|
+
* createApp threads the field down into the registry verbatim.
|
|
59
|
+
*/
|
|
60
|
+
export interface ErrorFanoutOptions {
|
|
61
|
+
readonly silenceUnhandledErrors?: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* ErrorFanoutRegistry shares its shape with the LostListenerRegistry
|
|
66
|
+
* implementation in `packages/runtime/src/createRenderer.ts:532-566` per
|
|
67
|
+
* plan-strategy D-9 -- listener set + fan-out fire + idempotent unsubscribe.
|
|
68
|
+
* The two divergences from the runtime registry are intentional:
|
|
69
|
+
*
|
|
70
|
+
* 1. Late-attach replay is NOT implemented -- rAF errors are a frame-time
|
|
71
|
+
* stream (each tick produces fresh state) so replay semantics are
|
|
72
|
+
* meaningless and would mislead newly registered listeners.
|
|
73
|
+
* 2. `console.error(err)` fallback fires when the listener set is empty
|
|
74
|
+
* and `silenceUnhandledErrors !== true` -- a charter P3 tribute that
|
|
75
|
+
* makes "unhandled" errors loud rather than silent.
|
|
76
|
+
*/
|
|
77
|
+
export class ErrorFanoutRegistry {
|
|
78
|
+
private readonly listeners: Set<ErrorFanoutListener> = new Set();
|
|
79
|
+
private readonly silenceUnhandledErrors: boolean;
|
|
80
|
+
|
|
81
|
+
constructor(opts: ErrorFanoutOptions = {}) {
|
|
82
|
+
this.silenceUnhandledErrors = opts.silenceUnhandledErrors === true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Register a listener. Returns an unsubscribe function. Calling
|
|
87
|
+
* unsubscribe more than once is a safe no-op (Set.delete returns
|
|
88
|
+
* false on the second call but does not throw). Re-registering the
|
|
89
|
+
* same listener function is a no-op (Set semantics).
|
|
90
|
+
*/
|
|
91
|
+
add(cb: ErrorFanoutListener): () => void {
|
|
92
|
+
this.listeners.add(cb);
|
|
93
|
+
return () => {
|
|
94
|
+
this.listeners.delete(cb);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Iterate over a snapshot of the listener set so a listener that
|
|
100
|
+
* mutates the set mid-fire does not perturb the iteration. When the
|
|
101
|
+
* set is empty AND silenceUnhandledErrors !== true, call
|
|
102
|
+
* console.error(err) so the unhandled error is visible in devtools
|
|
103
|
+
* (charter P3 explicit failure: silent drop is a footgun).
|
|
104
|
+
*/
|
|
105
|
+
fire(err: AppDispatchError): void {
|
|
106
|
+
if (this.listeners.size === 0) {
|
|
107
|
+
if (!this.silenceUnhandledErrors) {
|
|
108
|
+
// eslint-disable-next-line no-console -- charter P3 fallback
|
|
109
|
+
console.error(err);
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const snapshot = Array.from(this.listeners);
|
|
114
|
+
for (const cb of snapshot) {
|
|
115
|
+
cb(err);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Number of currently registered listeners. Reserved for diagnostics +
|
|
121
|
+
* test fixtures (e.g. asserting cleanup paths reach the registry); not
|
|
122
|
+
* part of the public app-shell surface.
|
|
123
|
+
*
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
_size(): number {
|
|
127
|
+
return this.listeners.size;
|
|
128
|
+
}
|
|
129
|
+
}
|