@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,16 @@
|
|
|
1
|
+
import { type Result } from '@forgeax/engine-types';
|
|
2
|
+
import { type AppError as AppErrorType } from '../errors';
|
|
3
|
+
import type { BundlerOptions, CanvasDrawingBufferSize } from '../types';
|
|
4
|
+
import { type CreateAppOptions, type ExecutionApp } from '../types';
|
|
5
|
+
import type { ExecutionCapabilities, ExecutionSelection } from './types';
|
|
6
|
+
export interface CreateWorkerExecutionAppOptions {
|
|
7
|
+
readonly canvas: HTMLCanvasElement;
|
|
8
|
+
readonly appOptions: CreateAppOptions;
|
|
9
|
+
/** Host-owned resize policy applied before each frame sent to the worker. */
|
|
10
|
+
readonly syncCanvas?: () => CanvasDrawingBufferSize;
|
|
11
|
+
readonly bundler?: BundlerOptions;
|
|
12
|
+
readonly capabilities: ExecutionCapabilities;
|
|
13
|
+
readonly selection: ExecutionSelection;
|
|
14
|
+
}
|
|
15
|
+
export declare function createWorkerExecutionApp(options: CreateWorkerExecutionAppOptions): Promise<Result<ExecutionApp, AppErrorType>>;
|
|
16
|
+
//# sourceMappingURL=host-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-controller.d.ts","sourceRoot":"","sources":["../../src/execution/host-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAA2C,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAEnG,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAUlB,OAAO,KAAK,EACV,qBAAqB,EAGrB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,uBAAuB,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;CACxC;AAkCD,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CA6X7C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { ExecutionBootstrapEntry, ExecutionBootstrapHost, PreparedExecutionBootstrap, } from './bootstrap-entry';
|
|
2
|
+
export { executionBootstrapHostPlugin, loadBootstrapEntry, prepareBootstrapEntry, validateExecutionBootstrapData, } from './bootstrap-entry';
|
|
3
|
+
export { missingExecutionCapabilities, probeExecutionCapabilities, unavailableExecutionCapabilities, } from './capabilities';
|
|
4
|
+
export { cloneExecutionReport } from './control';
|
|
5
|
+
export { createExecutionReport } from './report';
|
|
6
|
+
export { EXECUTION_REPORT_SCHEMA_VERSION, isExecutionReport } from './schema';
|
|
7
|
+
export { type ExecutionSelectionInput, selectExecutionTier } from './selector';
|
|
8
|
+
export type { ExecutionBootstrapValue, ExecutionCapabilities, ExecutionCapabilityFact, ExecutionCapabilityName, ExecutionControl, ExecutionEngineHealth, ExecutionFault, ExecutionMeasurement, ExecutionOptions, ExecutionReport, ExecutionRequestedTier, ExecutionSelection, ExecutionSelectionReason, ExecutionTier, ExecutionWorldHealth, KernelDispatchReason, } from './types';
|
|
9
|
+
export { EXECUTION_CAPABILITY_NAMES, EXECUTION_REQUESTED_TIERS, EXECUTION_TIERS, } from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,KAAK,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC/E,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KernelDispatchResult, SharedKernelExecutor } from '@forgeax/engine-ecs/shared';
|
|
2
|
+
export interface KernelPool extends SharedKernelExecutor {
|
|
3
|
+
readonly laneCount: number;
|
|
4
|
+
ready(): Promise<void>;
|
|
5
|
+
takeLastDispatch(): KernelDispatchResult | null;
|
|
6
|
+
dispose(): void;
|
|
7
|
+
}
|
|
8
|
+
export interface KernelPoolOptions {
|
|
9
|
+
readonly lanes?: number;
|
|
10
|
+
readonly timeoutMs?: number;
|
|
11
|
+
readonly workerFactory?: () => Worker;
|
|
12
|
+
}
|
|
13
|
+
export declare function createKernelPool(options?: KernelPoolOptions): KernelPool;
|
|
14
|
+
//# sourceMappingURL=kernel-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-pool.d.ts","sourceRoot":"","sources":["../../src/execution/kernel-pool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,4BAA4B,CAAC;AAGpC,MAAM,WAAW,UAAW,SAAQ,oBAAoB;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,gBAAgB,IAAI,oBAAoB,GAAG,IAAI,CAAC;IAChD,OAAO,IAAI,IAAI,CAAC;CACjB;AA6BD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;CACvC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAyL5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-worker-runtime.d.ts","sourceRoot":"","sources":["../../src/execution/kernel-worker-runtime.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutionMeasurement } from './types';
|
|
2
|
+
export interface MeasurementSeries {
|
|
3
|
+
add(value: number): ExecutionMeasurement;
|
|
4
|
+
clear(): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createMeasurementSeries(capacity?: number): MeasurementSeries;
|
|
7
|
+
//# sourceMappingURL=measurement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../src/execution/measurement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAOpD,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACzC,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,SAAM,GAAG,iBAAiB,CA0BzE"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AudioIntent } from '@forgeax/engine-audio';
|
|
2
|
+
import type { InputBackendSample } from '@forgeax/engine-input';
|
|
3
|
+
import type { CanvasDrawingBufferSize } from '../types';
|
|
4
|
+
export interface ExecutionFrameMessage {
|
|
5
|
+
readonly kind: 'frame';
|
|
6
|
+
readonly worldIdentity: string;
|
|
7
|
+
readonly frameId: number;
|
|
8
|
+
readonly deltaSeconds: number;
|
|
9
|
+
readonly inputSample: InputBackendSample;
|
|
10
|
+
readonly canvasWidth: number;
|
|
11
|
+
readonly canvasHeight: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ExecutionFrameCompletion {
|
|
14
|
+
readonly kind: 'frame-complete';
|
|
15
|
+
readonly worldIdentity: string;
|
|
16
|
+
readonly frameId: number;
|
|
17
|
+
readonly engineUpdateMs: number;
|
|
18
|
+
readonly kernelWaitMs: number;
|
|
19
|
+
readonly audioIntents?: readonly AudioIntent[];
|
|
20
|
+
readonly kernelDispatch?: {
|
|
21
|
+
readonly eligible: boolean;
|
|
22
|
+
readonly usedShared: boolean;
|
|
23
|
+
readonly reason: import('./types').KernelDispatchReason;
|
|
24
|
+
readonly dispatched: number;
|
|
25
|
+
readonly completed: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type FrameCompletionDisposition = 'accepted' | 'duplicate' | 'stale-world' | 'late';
|
|
29
|
+
export declare class FrameCreditLedger {
|
|
30
|
+
readonly worldIdentity: string;
|
|
31
|
+
private nextFrameId;
|
|
32
|
+
private inFlight;
|
|
33
|
+
private completed;
|
|
34
|
+
constructor(worldIdentity: string);
|
|
35
|
+
issue(deltaSeconds: number, sampleInput: () => InputBackendSample, canvasSize: CanvasDrawingBufferSize): ExecutionFrameMessage | undefined;
|
|
36
|
+
complete(message: ExecutionFrameCompletion): FrameCompletionDisposition;
|
|
37
|
+
get hasCreditInFlight(): boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface ExecutionInitMessage {
|
|
40
|
+
readonly kind: 'init';
|
|
41
|
+
readonly canvas: OffscreenCanvas;
|
|
42
|
+
readonly bootstrapUrl: string;
|
|
43
|
+
readonly bootstrapData?: import('./types').ExecutionBootstrapValue;
|
|
44
|
+
readonly bootstrapPort?: MessagePort;
|
|
45
|
+
readonly shaderManifestUrl?: string;
|
|
46
|
+
readonly time?: import('@forgeax/engine-ecs').TimePolicy;
|
|
47
|
+
readonly tier: import('./types').ExecutionTier;
|
|
48
|
+
}
|
|
49
|
+
export interface ExecutionHostControlMessage {
|
|
50
|
+
readonly kind: 'host-control';
|
|
51
|
+
readonly command: 'set-pointer-lock-allowed';
|
|
52
|
+
readonly allowed: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface ExecutionReadyMessage {
|
|
55
|
+
readonly kind: 'ready';
|
|
56
|
+
readonly worldIdentity: string;
|
|
57
|
+
readonly realm: 'worker';
|
|
58
|
+
readonly workerWebGpu: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface ExecutionFaultMessage {
|
|
61
|
+
readonly kind: 'fault';
|
|
62
|
+
readonly worldIdentity: string | null;
|
|
63
|
+
readonly source: 'bootstrap' | 'handshake' | 'runtime' | 'kernel' | 'world' | 'rebuild';
|
|
64
|
+
readonly code: string;
|
|
65
|
+
readonly expected: string;
|
|
66
|
+
readonly hint: string;
|
|
67
|
+
readonly detail: unknown;
|
|
68
|
+
readonly partialWrite: boolean;
|
|
69
|
+
readonly retryable: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface ExecutionRebuildMessage {
|
|
72
|
+
readonly kind: 'rebuild';
|
|
73
|
+
readonly worldIdentity: string;
|
|
74
|
+
}
|
|
75
|
+
export interface ExecutionRebuiltMessage {
|
|
76
|
+
readonly kind: 'rebuilt';
|
|
77
|
+
readonly previousWorldIdentity: string;
|
|
78
|
+
readonly worldIdentity: string;
|
|
79
|
+
}
|
|
80
|
+
export type HostToEngineMessage = ExecutionInitMessage | ExecutionFrameMessage | ExecutionRebuildMessage | {
|
|
81
|
+
readonly kind: 'dispose';
|
|
82
|
+
};
|
|
83
|
+
export type EngineToHostMessage = ExecutionReadyMessage | ExecutionFrameCompletion | ExecutionFaultMessage | ExecutionRebuiltMessage | ExecutionHostControlMessage;
|
|
84
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/execution/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE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a,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,mBAAmB,GAC3B,oBAAoB,GACpB,qBAAqB,GACrB,uBAAuB,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AACjC,MAAM,MAAM,mBAAmB,GAC3B,qBAAqB,GACrB,wBAAwB,GACxB,qBAAqB,GACrB,uBAAuB,GACvB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AudioState } from '@forgeax/engine-audio';
|
|
2
|
+
import type { ExecutionCapabilities, ExecutionReport, ExecutionRequestedTier, ExecutionSelection } from './types';
|
|
3
|
+
export declare function executionAudioReport(state?: AudioState): ExecutionReport['audio'];
|
|
4
|
+
export declare function createExecutionReport(requestedTier: ExecutionRequestedTier, capabilities: ExecutionCapabilities, selection?: ExecutionSelection): ExecutionReport;
|
|
5
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/execution/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,CAgBjF;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,sBAAsB,EACrC,YAAY,EAAE,qBAAqB,EACnC,SAAS,CAAC,EAAE,kBAAkB,GAC7B,eAAe,CAkCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/execution/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,+BAA+B,EAAG,CAAU,CAAC;AAwB1D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAwI1E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Result } from '@forgeax/engine-types';
|
|
2
|
+
import { type AppError as AppErrorType } from '../errors';
|
|
3
|
+
import type { ExecutionCapabilities, ExecutionRequestedTier, ExecutionSelection } from './types';
|
|
4
|
+
export interface ExecutionSelectionInput {
|
|
5
|
+
readonly requestedTier: ExecutionRequestedTier;
|
|
6
|
+
readonly capabilities: ExecutionCapabilities;
|
|
7
|
+
readonly sharedEvidencePassed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function selectExecutionTier(input: ExecutionSelectionInput): Result<ExecutionSelection, AppErrorType>;
|
|
10
|
+
//# sourceMappingURL=selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/execution/selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAA2C,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AAEnG,OAAO,KAAK,EACV,qBAAqB,EAErB,sBAAsB,EACtB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAcjB,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC;IAC/C,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CACxC;AAeD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,uBAAuB,GAC7B,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAqD1C"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { WorldExecutionHealth } from '@forgeax/engine-ecs/shared';
|
|
2
|
+
import type { Result } from '@forgeax/engine-types';
|
|
3
|
+
import type { AppError } from '../errors';
|
|
4
|
+
export declare const EXECUTION_TIERS: readonly ["main-serial", "engine-worker", "shared"];
|
|
5
|
+
export type ExecutionTier = (typeof EXECUTION_TIERS)[number];
|
|
6
|
+
export declare const EXECUTION_REQUESTED_TIERS: readonly ["auto", "main-serial", "engine-worker", "shared"];
|
|
7
|
+
export type ExecutionRequestedTier = (typeof EXECUTION_REQUESTED_TIERS)[number];
|
|
8
|
+
export declare const EXECUTION_CAPABILITY_NAMES: readonly ["worker", "offscreenCanvas", "workerAnimationFrame", "workerWebGpu", "crossOriginIsolated", "sharedArrayBuffer", "atomicsWait"];
|
|
9
|
+
export type ExecutionCapabilityName = (typeof EXECUTION_CAPABILITY_NAMES)[number];
|
|
10
|
+
export interface ExecutionCapabilityFact {
|
|
11
|
+
readonly available: boolean;
|
|
12
|
+
readonly reason: string;
|
|
13
|
+
}
|
|
14
|
+
export type ExecutionCapabilities = Readonly<Record<ExecutionCapabilityName, ExecutionCapabilityFact>>;
|
|
15
|
+
export type ExecutionSelectionReason = 'explicit-request' | 'auto-shared' | 'auto-engine-worker' | 'auto-main-serial';
|
|
16
|
+
export interface ExecutionSelection {
|
|
17
|
+
readonly requestedTier: ExecutionRequestedTier;
|
|
18
|
+
readonly actualTier: ExecutionTier;
|
|
19
|
+
readonly selectionReason: ExecutionSelectionReason;
|
|
20
|
+
readonly missingCapabilities: readonly ExecutionCapabilityName[];
|
|
21
|
+
readonly sharedEvidencePassed: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type ExecutionEngineHealth = 'idle' | 'starting' | 'running' | 'stopped' | 'faulted';
|
|
24
|
+
export type ExecutionWorldHealth = WorldExecutionHealth;
|
|
25
|
+
export type KernelDispatchReason = 'no-eligible-kernel' | 'zero-work' | 'small-span' | 'forced-inline' | 'shared' | 'poisoned';
|
|
26
|
+
export interface ExecutionMeasurement {
|
|
27
|
+
readonly samples: number;
|
|
28
|
+
readonly p50: number;
|
|
29
|
+
readonly p95: number;
|
|
30
|
+
readonly p99: number;
|
|
31
|
+
readonly jitter: number;
|
|
32
|
+
}
|
|
33
|
+
export interface ExecutionFault {
|
|
34
|
+
readonly source: 'bootstrap' | 'handshake' | 'runtime' | 'kernel' | 'world' | 'rebuild';
|
|
35
|
+
readonly code: string;
|
|
36
|
+
readonly expected: string;
|
|
37
|
+
readonly hint: string;
|
|
38
|
+
readonly detail: unknown;
|
|
39
|
+
readonly partialWrite: boolean;
|
|
40
|
+
readonly retryable: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface ExecutionAudioReport {
|
|
43
|
+
readonly owner: 'host';
|
|
44
|
+
readonly contextState: 'running' | 'suspended' | 'closed';
|
|
45
|
+
readonly activeSourceCount: number;
|
|
46
|
+
readonly lastError: {
|
|
47
|
+
readonly code: string;
|
|
48
|
+
readonly expected: string;
|
|
49
|
+
readonly hint: string;
|
|
50
|
+
readonly detail: unknown;
|
|
51
|
+
} | null;
|
|
52
|
+
}
|
|
53
|
+
export interface ExecutionReport {
|
|
54
|
+
readonly schemaVersion: 1;
|
|
55
|
+
readonly requestedTier: ExecutionRequestedTier;
|
|
56
|
+
readonly actualTier: ExecutionTier | null;
|
|
57
|
+
readonly selectionReason: ExecutionSelectionReason | null;
|
|
58
|
+
readonly sharedEvidencePassed: boolean;
|
|
59
|
+
readonly capabilities: ExecutionCapabilities;
|
|
60
|
+
readonly engine: {
|
|
61
|
+
readonly realm: 'host' | 'worker';
|
|
62
|
+
readonly health: ExecutionEngineHealth;
|
|
63
|
+
};
|
|
64
|
+
readonly world: {
|
|
65
|
+
readonly identity: string | null;
|
|
66
|
+
readonly health: ExecutionWorldHealth;
|
|
67
|
+
readonly partialWrite: boolean;
|
|
68
|
+
readonly retryable: boolean;
|
|
69
|
+
};
|
|
70
|
+
readonly kernelDispatch: {
|
|
71
|
+
readonly eligible: boolean;
|
|
72
|
+
readonly usedShared: boolean;
|
|
73
|
+
readonly reason: KernelDispatchReason;
|
|
74
|
+
readonly dispatched: number;
|
|
75
|
+
readonly completed: number;
|
|
76
|
+
};
|
|
77
|
+
readonly performance: {
|
|
78
|
+
readonly hostFrameMs: ExecutionMeasurement | null;
|
|
79
|
+
readonly engineUpdateMs: ExecutionMeasurement | null;
|
|
80
|
+
readonly kernelWaitMs: ExecutionMeasurement | null;
|
|
81
|
+
readonly hostAudioMs: ExecutionMeasurement | null;
|
|
82
|
+
};
|
|
83
|
+
readonly audio: ExecutionAudioReport;
|
|
84
|
+
readonly fault: ExecutionFault | null;
|
|
85
|
+
}
|
|
86
|
+
export interface ExecutionOptions {
|
|
87
|
+
readonly tier?: ExecutionRequestedTier;
|
|
88
|
+
/** Absolute or import.meta.url-relative URL of an ExecutionBootstrapEntry module. */
|
|
89
|
+
readonly bootstrap: string | URL;
|
|
90
|
+
/** Structured-cloneable input supplied identically to main and Worker realms. */
|
|
91
|
+
readonly bootstrapData?: ExecutionBootstrapValue;
|
|
92
|
+
/**
|
|
93
|
+
* Realm side of an optional typed host/game channel. The engine transfers it
|
|
94
|
+
* to a Worker when needed and otherwise preserves the same port contract.
|
|
95
|
+
*/
|
|
96
|
+
readonly bootstrapPort?: MessagePort;
|
|
97
|
+
readonly startupTimeoutMs?: number;
|
|
98
|
+
readonly frameTimeoutMs?: number;
|
|
99
|
+
}
|
|
100
|
+
export type ExecutionBootstrapValue = null | boolean | number | string | readonly ExecutionBootstrapValue[] | {
|
|
101
|
+
readonly [key: string]: ExecutionBootstrapValue;
|
|
102
|
+
};
|
|
103
|
+
export interface ExecutionControl {
|
|
104
|
+
report(): ExecutionReport;
|
|
105
|
+
rebuild(): Promise<Result<ExecutionReport, AppError>>;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=types.d.ts.map
|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AAI,CAAC;QACnD,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;KACnD,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,sBAAsB,CAAC;IACvC,qFAAqF;IACrF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC;IACjC,iFAAiF;IACjF,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACjD;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,uBAAuB,GAC/B,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,uBAAuB,EAAE,GAClC;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,IAAI,eAAe,CAAC;IAC1B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { World } from '@forgeax/engine-ecs';
|
|
2
|
+
/**
|
|
3
|
+
* Ensure the neutral camera used only by hosts that have no game bootstrap.
|
|
4
|
+
* An authored scene camera wins; a resolved game owns its camera policy and
|
|
5
|
+
* must not call this helper.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureFallbackCamera(world: World, aspect?: number): ReturnType<World['spawn']> | undefined;
|
|
8
|
+
//# sourceMappingURL=fallback-camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback-camera.d.ts","sourceRoot":"","sources":["../src/fallback-camera.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAIjD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,EACZ,MAAM,SAAI,GACT,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAOxC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { AssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
2
|
+
import type { EntityHandle } from '@forgeax/engine-ecs';
|
|
3
|
+
import type { Plugin } from '@forgeax/engine-plugin';
|
|
4
|
+
import type { Renderer } from '@forgeax/engine-render';
|
|
5
|
+
import type { SceneAsset } from '@forgeax/engine-types';
|
|
6
|
+
import type { App } from './types';
|
|
7
|
+
/** JSON-shaped data a game may intentionally project through a host bridge. */
|
|
8
|
+
export type GameProjectionValue = null | boolean | number | string | GameProjectionValue[] | {
|
|
9
|
+
[key: string]: GameProjectionValue;
|
|
10
|
+
};
|
|
11
|
+
/** Lightweight, host-agnostic argument schema for a game-owned action. */
|
|
12
|
+
export interface GameActionArgsSchema {
|
|
13
|
+
readonly type?: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
14
|
+
readonly properties?: Record<string, GameActionArgsSchema>;
|
|
15
|
+
readonly required?: string[];
|
|
16
|
+
readonly enum?: GameProjectionValue[];
|
|
17
|
+
readonly items?: GameActionArgsSchema;
|
|
18
|
+
readonly nullable?: boolean;
|
|
19
|
+
readonly description?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A Play-only capability owned by game code. The host may discover and invoke it,
|
|
23
|
+
* but never supplies its gameplay semantics or reaches into the game World.
|
|
24
|
+
*/
|
|
25
|
+
export interface GameActionDef {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly title: string;
|
|
28
|
+
readonly description?: string;
|
|
29
|
+
readonly argsSchema?: GameActionArgsSchema;
|
|
30
|
+
/** Return an optional JSON-shaped result for inspection clients. */
|
|
31
|
+
readonly run: (args: GameProjectionValue) => GameProjectionValue | void | Promise<GameProjectionValue | void>;
|
|
32
|
+
}
|
|
33
|
+
/** A named, serializable Play-only read projection owned by game code. */
|
|
34
|
+
export interface GameReadDef {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly title: string;
|
|
37
|
+
readonly description?: string;
|
|
38
|
+
readonly read: () => GameProjectionValue | Promise<GameProjectionValue>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Host-provided registration sink for one Play run. Games receive this only while
|
|
42
|
+
* bootstrapping the fresh transient world; registrations are discarded when the run is disposed.
|
|
43
|
+
*/
|
|
44
|
+
export interface GameProjectionRegistrar {
|
|
45
|
+
registerAction(def: GameActionDef): () => void;
|
|
46
|
+
registerRead(def: GameReadDef): () => void;
|
|
47
|
+
}
|
|
48
|
+
/** Realm-local Host capability injected into an asset-resident game plugin. */
|
|
49
|
+
export interface GameHost {
|
|
50
|
+
/** Presentation canvas owned by this Host realm. */
|
|
51
|
+
readonly canvas: HTMLCanvasElement;
|
|
52
|
+
/** The WebGPU Renderer (optional — some hosts may not expose it). */
|
|
53
|
+
readonly renderer?: Renderer;
|
|
54
|
+
/** The AssetRegistry owned by the App realm. */
|
|
55
|
+
readonly assets: AssetRegistry;
|
|
56
|
+
/** The App handle for lifecycle introspection. */
|
|
57
|
+
readonly app: App;
|
|
58
|
+
/** Synthetic root entity of the host-instantiated defaultScene. Carries the
|
|
59
|
+
* SceneInstance component. Absent when the game has no defaultScene. */
|
|
60
|
+
readonly defaultSceneRoot?: EntityHandle;
|
|
61
|
+
/** The loaded SceneAsset payload for the defaultScene. Contains the
|
|
62
|
+
* author-side entity list with Name components. Absent when the game has
|
|
63
|
+
* no defaultScene. */
|
|
64
|
+
readonly defaultScene?: SceneAsset;
|
|
65
|
+
/**
|
|
66
|
+
* Controlled UI container for this run. Games must mount their DOM UI here
|
|
67
|
+
* (`(ctx.uiRoot ?? document.body).appendChild(el)`) instead of appending
|
|
68
|
+
* directly to `document.body`. In the embedded editor viewport the host
|
|
69
|
+
* removes this whole container when the run is disposed. Absent means game
|
|
70
|
+
* code falls back to `document.body`.
|
|
71
|
+
*/
|
|
72
|
+
readonly uiRoot?: HTMLElement;
|
|
73
|
+
/**
|
|
74
|
+
* M2 D-3: command-set pointer-lock gate. The game template calls this
|
|
75
|
+
* when the view mode changes (e.g. `setPointerLockAllowed(mode === 'fps')`
|
|
76
|
+
* to allow lock in FPS, disallow in top-down). The host wires this to
|
|
77
|
+
* App.input.setPointerLockAllowed?.() which delegates to the input backend.
|
|
78
|
+
* Absent → the host does not support pointer-lock gating (e.g. a host
|
|
79
|
+
* that only runs top-down games).
|
|
80
|
+
*/
|
|
81
|
+
readonly setPointerLockAllowed?: (allowed: boolean) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Optional Play-only projection seam. A game registers its own action and read
|
|
84
|
+
* capabilities here; the host may only discover/invoke/read those closures. It
|
|
85
|
+
* is deliberately absent outside a host that can clear registrations on disposal.
|
|
86
|
+
*/
|
|
87
|
+
readonly gameProjection?: GameProjectionRegistrar;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Provide the Host boundary to a native Cordis game plugin.
|
|
91
|
+
*/
|
|
92
|
+
export declare function gameHostPlugin(host: GameHost): Plugin;
|
|
93
|
+
declare module '@forgeax/engine-plugin' {
|
|
94
|
+
interface EngineContextServices {
|
|
95
|
+
gameHost?: GameHost;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=game-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-context.d.ts","sourceRoot":"","sources":["../src/game-context.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,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rD;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,qBAAqB;QAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type { Effect, EffectMeta, Fiber, Inject, Plugin, } from '@forgeax/engine-plugin';
|
|
2
|
+
export { Context } from '@forgeax/engine-plugin';
|
|
3
|
+
export { type AssetRuntimeAssembly, type AssetRuntimeAssemblyError, assembleAssetRuntime, } from './assets-runtime-assembly';
|
|
4
|
+
export { createApp, measureCanvasDrawingBuffer, syncCanvasDrawingBuffer } from './create-app';
|
|
5
|
+
export type { AppDetailCanvasDetached, AppDetailEmpty, AppDetailExecutionBootstrapFailed, AppDetailExecutionDeadlineExceeded, AppDetailExecutionKernelFailed, AppDetailExecutionRebuildFailed, AppDetailExecutionStaleWorld, AppDetailExecutionTierUnavailable, AppDetailPluginActivationFailed, AppDetailSystemUpdateFailed, AppErrorCode, AppErrorDetail, AppErrorDetailFor, } from './errors';
|
|
6
|
+
export { APP_ERROR_HINTS, APP_EXPECTED, AppError, isAppError, } from './errors';
|
|
7
|
+
export type { ExecutionBootstrapEntry, ExecutionBootstrapHost, ExecutionBootstrapValue, ExecutionCapabilities, ExecutionCapabilityFact, ExecutionCapabilityName, ExecutionControl, ExecutionEngineHealth, ExecutionFault, ExecutionMeasurement, ExecutionOptions, ExecutionReport, ExecutionRequestedTier, ExecutionSelection, ExecutionSelectionReason, ExecutionTier, ExecutionWorldHealth, KernelDispatchReason, PreparedExecutionBootstrap, } from './execution';
|
|
8
|
+
export { createExecutionReport, EXECUTION_CAPABILITY_NAMES, EXECUTION_REPORT_SCHEMA_VERSION, EXECUTION_REQUESTED_TIERS, EXECUTION_TIERS, executionBootstrapHostPlugin, isExecutionReport, loadBootstrapEntry, missingExecutionCapabilities, prepareBootstrapEntry, probeExecutionCapabilities, selectExecutionTier, unavailableExecutionCapabilities, validateExecutionBootstrapData, } from './execution';
|
|
9
|
+
export { ensureFallbackCamera } from './fallback-camera';
|
|
10
|
+
export type { GameActionArgsSchema, GameActionDef, GameHost, GameProjectionRegistrar, GameProjectionValue, GameReadDef, } from './game-context';
|
|
11
|
+
export { gameHostPlugin } from './game-context';
|
|
12
|
+
export { inputPlugin } from './plugin-factories';
|
|
13
|
+
import { isLoadGameError, LOAD_GAME_ERROR_HINTS, LOAD_GAME_EXPECTED, LoadGameError } from './load-game-errors';
|
|
14
|
+
export type { GamePluginResolver } from './load-game';
|
|
15
|
+
export { loadGame } from './load-game';
|
|
16
|
+
export type { LoadGameDetailImportFailed, LoadGameDetailInvalidFormat, LoadGameDetailModuleNotFound, LoadGameErrorCode, LoadGameErrorDetail, LoadGameErrorDetailFor, } from './load-game-errors';
|
|
17
|
+
export { createToolPreviewHost, replayToolPreviewCapture, type ToolPreviewCaptureResult, type ToolPreviewHost, type ToolPreviewHostError, type ToolPreviewHostOptions, type ToolPreviewResourceFacts, type ToolPreviewResourceKind, type ToolPreviewResourceRequest, type ToolPreviewRunResult, } from './tool-preview/bootstrap';
|
|
18
|
+
export { createToolPreviewEvidence, joinResourcePreviewEvidence, joinToolPreviewEvidence, type ToolPreviewEvidence, } from './tool-preview/evidence';
|
|
19
|
+
export { fitToolPreviewCameraToAabb, type ToolPreviewCameraFrame, } from './tool-preview/framing';
|
|
20
|
+
export { createToolPreviewRecipe, type ToolPreviewAction, type ToolPreviewPresentation, type ToolPreviewRecipe, type ToolPreviewRecipeOptions, type ToolPreviewTrace, type ToolPreviewTraceEvent, validateToolPreviewTrace, } from './tool-preview/recipe';
|
|
21
|
+
export type { App, AppAssembleArgs, AssembleAppError, BundlerOptions, CanvasAppError, CanvasDrawingBufferSize, CreateAppOptions, DrawSource, DrawSourceResult, ExecutionApp, } from './types';
|
|
22
|
+
export { APP_PHASE_CATALOG } from './types';
|
|
23
|
+
export { isLoadGameError, LOAD_GAME_ERROR_HINTS, LOAD_GAME_EXPECTED, LoadGameError };
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,YAAY,EACV,MAAM,EACN,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC9F,YAAY,EACV,uBAAuB,EACvB,cAAc,EACd,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,+BAA+B,EAC/B,4BAA4B,EAC5B,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,YAAY,EACZ,cAAc,EACd,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,eAAe,EACf,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,g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