@fps-games/editor 0.2.1-beta.1 → 0.2.1-beta.3
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/dist/agent-bridge/capabilities/ui-regions.d.ts.map +1 -1
- package/dist/agent-bridge/capabilities/ui-regions.js +16 -0
- package/dist/agent-bridge/capabilities/ui-regions.js.map +1 -1
- package/dist/build-info.json +46 -46
- package/dist/internal/material-preview.d.ts +22 -0
- package/dist/internal/material-preview.d.ts.map +1 -0
- package/dist/internal/material-preview.js +186 -0
- package/dist/internal/material-preview.js.map +1 -0
- package/dist/internal/project-model-preview.d.ts +4 -0
- package/dist/internal/project-model-preview.d.ts.map +1 -0
- package/dist/internal/project-model-preview.js +359 -0
- package/dist/internal/project-model-preview.js.map +1 -0
- package/dist/local-editor-agent-context.d.ts +12 -1
- package/dist/local-editor-agent-context.d.ts.map +1 -1
- package/dist/local-editor-agent-context.js +47 -0
- package/dist/local-editor-agent-context.js.map +1 -1
- package/dist/local-editor-harness.d.ts +15 -2
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +326 -28
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/local-editor-tools.d.ts +1 -0
- package/dist/local-editor-tools.d.ts.map +1 -1
- package/dist/local-editor-tools.js +3 -0
- package/dist/local-editor-tools.js.map +1 -1
- package/dist/playable-babylon-rendering.d.ts +8 -7
- package/dist/playable-babylon-rendering.d.ts.map +1 -1
- package/dist/playable-babylon-rendering.js +77 -32
- package/dist/playable-babylon-rendering.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +4 -0
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js +27 -0
- package/dist/playable-local-editor-host.js.map +1 -1
- package/dist/playable-product-projection-preview.d.ts +2 -0
- package/dist/playable-product-projection-preview.d.ts.map +1 -1
- package/dist/playable-product-projection-preview.js +7 -4
- package/dist/playable-product-projection-preview.js.map +1 -1
- package/dist/playable-product-scene-capabilities.d.ts.map +1 -1
- package/dist/playable-product-scene-capabilities.js +9 -3
- package/dist/playable-product-scene-capabilities.js.map +1 -1
- package/dist/playable-sdk.d.ts +1 -1
- package/dist/playable-sdk.d.ts.map +1 -1
- package/dist/playable-sdk.js +1 -1
- package/dist/playable-sdk.js.map +1 -1
- package/dist/playable-standard-project.d.ts +0 -1
- package/dist/playable-standard-project.d.ts.map +1 -1
- package/dist/playable-standard-project.js +17 -5
- package/dist/playable-standard-project.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.d.ts +4 -2
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.js +301 -121
- package/node_modules/@fps-games/babylon-renderer/dist/environment/environment-texture-controller.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/profile.js +5 -4
- package/node_modules/@fps-games/babylon-renderer/dist/environment/profile.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.d.ts +4 -4
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.js +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/environment/types.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.d.ts +2 -0
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.js +12 -1
- package/node_modules/@fps-games/babylon-renderer/dist/game-world-plugin-lifecycle.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.d.ts +6 -3
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.js +100 -39
- package/node_modules/@fps-games/babylon-renderer/dist/plugin.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/reference.d.ts +1 -3
- package/node_modules/@fps-games/babylon-renderer/dist/reference.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/reference.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +11 -8
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js +24 -0
- package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +10 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +96 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.js +85 -22
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts +2 -0
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js +150 -4
- package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +249 -15
- package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/types.d.ts +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/types.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +6 -6
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts +5 -0
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js +3 -0
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.d.ts +35 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.js +136 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.d.ts +46 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.js +283 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.d.ts +12 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.js +67 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.d.ts +6 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.js +9 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.d.ts +7 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.js +20 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.d.ts +9 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.js +219 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.d.ts +14 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.js +42 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js +2 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.d.ts +27 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.js +288 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +29 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +20 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +321 -60
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts +2 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +4 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +63 -3
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts +9 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js +88 -16
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +2 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +1463 -356
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.d.ts +13 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.js +15 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/package.json +7 -7
- package/node_modules/@fps-games/editor-core/dist/editor-tools.d.ts +1 -0
- package/node_modules/@fps-games/editor-core/dist/editor-tools.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/editor-tools.js +3 -1
- package/node_modules/@fps-games/editor-core/dist/editor-tools.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts +11 -2
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js +12 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js.map +1 -1
- package/node_modules/@fps-games/editor-core/package.json +6 -6
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js +10 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.js +15 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.d.ts +6 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/package-resolution/aliases.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.js +10 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.js +86 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.d.ts +9 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.js +76 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.d.ts +34 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js +4 -4
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js +1 -5
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +40 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js +53 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.d.ts +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/types.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js +94 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.d.ts +14 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.js +101 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.d.ts +23 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.js +180 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +23 -3
- package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/package.json +2 -2
- package/node_modules/@fps-games/editor-tooling/package.json +3 -3
- package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.js +103 -10
- package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.js.map +1 -1
- package/node_modules/@fps-games/editor-ui/package.json +1 -1
- package/node_modules/@fps-games/playable-assets/dist/identity.d.ts +1 -0
- package/node_modules/@fps-games/playable-assets/dist/identity.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/identity.js +1 -1
- package/node_modules/@fps-games/playable-assets/dist/identity.js.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/playable-assets/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/index.js +1 -0
- package/node_modules/@fps-games/playable-assets/dist/index.js.map +1 -1
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.d.ts +46 -0
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.d.ts.map +1 -0
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.js +109 -0
- package/node_modules/@fps-games/playable-assets/dist/resource-resolver.js.map +1 -0
- package/node_modules/@fps-games/playable-assets/package.json +1 -1
- package/node_modules/@fps-games/playable-contracts/package.json +1 -1
- package/node_modules/@fps-games/playable-rendering/package.json +2 -2
- package/node_modules/@fps-games/playable-runtime/dist/runtime.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-runtime/dist/runtime.js +5 -0
- package/node_modules/@fps-games/playable-runtime/dist/runtime.js.map +1 -1
- package/node_modules/@fps-games/playable-runtime/dist/types.d.ts +2 -0
- package/node_modules/@fps-games/playable-runtime/dist/types.d.ts.map +1 -1
- package/node_modules/@fps-games/playable-runtime/dist/types.js.map +1 -1
- package/node_modules/@fps-games/playable-runtime/package.json +12 -12
- package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
- package/node_modules/@fps-games/playable-scene/package.json +2 -2
- package/node_modules/@fps-games/plugin-api/package.json +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/reference.d.ts.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/reference.js +11 -4
- package/node_modules/@fps-games/plugin-assets/dist/reference.js.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/renderer.d.ts +8 -0
- package/node_modules/@fps-games/plugin-assets/dist/renderer.d.ts.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/renderer.js +13 -0
- package/node_modules/@fps-games/plugin-assets/dist/renderer.js.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.d.ts +12 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.d.ts.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.js +8 -0
- package/node_modules/@fps-games/plugin-assets/dist/resources.js.map +1 -0
- package/node_modules/@fps-games/plugin-assets/dist/runtime.d.ts +2 -1
- package/node_modules/@fps-games/plugin-assets/dist/runtime.d.ts.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/runtime.js +3 -0
- package/node_modules/@fps-games/plugin-assets/dist/runtime.js.map +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-assets/package.json +32 -8
- package/node_modules/@fps-games/plugin-hierarchy/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-hierarchy/package.json +5 -5
- package/node_modules/@fps-games/plugin-host/package.json +2 -2
- package/node_modules/@fps-games/plugin-markers/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-markers/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-markers/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-markers/package.json +5 -5
- package/node_modules/@fps-games/plugin-materials/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-materials/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-materials/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-materials/package.json +5 -5
- package/node_modules/@fps-games/plugin-rendering/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-rendering/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-rendering/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-rendering/package.json +5 -5
- package/node_modules/@fps-games/plugin-scene/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-scene/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-scene/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-scene/package.json +5 -5
- package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-shadow-map-experiment/package.json +5 -5
- package/node_modules/@fps-games/plugin-shadows/dist/version.d.ts +1 -1
- package/node_modules/@fps-games/plugin-shadows/dist/version.js +1 -1
- package/node_modules/@fps-games/plugin-shadows/dist/version.js.map +1 -1
- package/node_modules/@fps-games/plugin-shadows/package.json +7 -7
- package/package.json +24 -22
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { PLAYABLE_EDITOR_DEFAULT_EXTENSIONS, getPlayableEditorAssetPathExtension, } from './identity.js';
|
|
2
|
+
export function createPlayableAssetResourceResolver(catalog) {
|
|
3
|
+
const entries = new Map();
|
|
4
|
+
for (const [catalogAssetId, input] of Object.entries(catalog)) {
|
|
5
|
+
const entry = normalizeCatalogEntry(catalogAssetId, input);
|
|
6
|
+
if (entries.has(entry.assetId))
|
|
7
|
+
throw new Error(`Duplicate generated asset catalog id: ${entry.assetId}`);
|
|
8
|
+
entries.set(entry.assetId, entry);
|
|
9
|
+
}
|
|
10
|
+
return Object.freeze({
|
|
11
|
+
resolve(reference) {
|
|
12
|
+
const assetId = normalizeOptionalString(reference.assetId);
|
|
13
|
+
const url = normalizeOptionalString(reference.url);
|
|
14
|
+
if (assetId) {
|
|
15
|
+
const entry = entries.get(assetId);
|
|
16
|
+
if (!entry)
|
|
17
|
+
return failed('asset.resource.not-found', assetId, null, null, url);
|
|
18
|
+
return resolved({
|
|
19
|
+
assetId: entry.assetId,
|
|
20
|
+
url: entry.url,
|
|
21
|
+
format: entry.format,
|
|
22
|
+
transport: getPlayableAssetResourceTransport(entry.url),
|
|
23
|
+
relativePath: entry.relativePath,
|
|
24
|
+
originalFileName: entry.originalFileName ?? null,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (!url)
|
|
28
|
+
return failed('asset.resource.invalid-reference', null, null, null, null);
|
|
29
|
+
const transport = getPlayableAssetResourceTransport(url);
|
|
30
|
+
if (transport === 'data-url' || transport === 'blob-url') {
|
|
31
|
+
return failed('asset.resource.format-missing', null, null, transport, url);
|
|
32
|
+
}
|
|
33
|
+
const format = getPlayableAssetFormat(url);
|
|
34
|
+
if (!format)
|
|
35
|
+
return failed('asset.resource.format-missing', null, null, transport, url);
|
|
36
|
+
if (!isPlayableAssetFormatSupported(format)) {
|
|
37
|
+
return failed('asset.resource.format-unsupported', null, format, transport, url);
|
|
38
|
+
}
|
|
39
|
+
return resolved({ assetId: null, url, format, transport, relativePath: null, originalFileName: null });
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function getPlayableAssetFormat(value) {
|
|
44
|
+
const extension = getPlayableEditorAssetPathExtension(String(value ?? ''));
|
|
45
|
+
return extension ? extension : null;
|
|
46
|
+
}
|
|
47
|
+
export function isPlayableAssetFormatSupported(format) {
|
|
48
|
+
return PLAYABLE_EDITOR_DEFAULT_EXTENSIONS.includes(format);
|
|
49
|
+
}
|
|
50
|
+
export function getPlayableAssetResourceTransport(url) {
|
|
51
|
+
if (/^data:/i.test(url))
|
|
52
|
+
return 'data-url';
|
|
53
|
+
if (/^blob:/i.test(url))
|
|
54
|
+
return 'blob-url';
|
|
55
|
+
if (/^https?:/i.test(url))
|
|
56
|
+
return 'http-url';
|
|
57
|
+
return 'path-url';
|
|
58
|
+
}
|
|
59
|
+
function normalizeCatalogEntry(catalogAssetId, input) {
|
|
60
|
+
const assetId = normalizeRequiredString(input?.assetId, `Generated asset catalog entry ${catalogAssetId} assetId`);
|
|
61
|
+
if (assetId !== catalogAssetId)
|
|
62
|
+
throw new Error(`Generated asset catalog key/id mismatch: ${catalogAssetId}`);
|
|
63
|
+
const url = normalizeRequiredString(input.url, `Generated asset catalog entry ${assetId} url`);
|
|
64
|
+
const relativePath = normalizeRequiredString(input.relativePath, `Generated asset catalog entry ${assetId} relativePath`);
|
|
65
|
+
const format = normalizeFormat(input.format, `Generated asset catalog entry ${assetId} format`);
|
|
66
|
+
const derivedFormat = getPlayableAssetFormat(relativePath);
|
|
67
|
+
if (derivedFormat !== format)
|
|
68
|
+
throw new Error(`Generated asset catalog entry ${assetId} format must match relativePath.`);
|
|
69
|
+
if (!isPlayableAssetFormatSupported(format))
|
|
70
|
+
throw new Error(`Generated asset catalog entry ${assetId} has unsupported format: ${format}`);
|
|
71
|
+
const originalFileName = normalizeOptionalString(input.originalFileName);
|
|
72
|
+
return Object.freeze({ assetId, url, format, relativePath, ...(originalFileName ? { originalFileName } : {}) });
|
|
73
|
+
}
|
|
74
|
+
function normalizeFormat(value, label) {
|
|
75
|
+
const format = getPlayableAssetFormat(String(value ?? ''));
|
|
76
|
+
if (!format || format !== String(value).trim().toLowerCase())
|
|
77
|
+
throw new Error(`${label} must be a normalized file extension.`);
|
|
78
|
+
return format;
|
|
79
|
+
}
|
|
80
|
+
function normalizeRequiredString(value, label) {
|
|
81
|
+
const result = normalizeOptionalString(value);
|
|
82
|
+
if (!result)
|
|
83
|
+
throw new Error(`${label} is required.`);
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
function normalizeOptionalString(value) {
|
|
87
|
+
if (typeof value !== 'string')
|
|
88
|
+
return null;
|
|
89
|
+
const result = value.trim();
|
|
90
|
+
return result || null;
|
|
91
|
+
}
|
|
92
|
+
function resolved(resource) {
|
|
93
|
+
return Object.freeze({ ok: true, resource: Object.freeze(resource) });
|
|
94
|
+
}
|
|
95
|
+
function failed(code, assetId, format, transport, url) {
|
|
96
|
+
return Object.freeze({ ok: false, diagnostic: Object.freeze({
|
|
97
|
+
code, assetId, format, transport, urlSummary: summarizeUrl(url),
|
|
98
|
+
}) });
|
|
99
|
+
}
|
|
100
|
+
function summarizeUrl(url) {
|
|
101
|
+
if (!url)
|
|
102
|
+
return null;
|
|
103
|
+
if (/^data:/i.test(url))
|
|
104
|
+
return 'data:<redacted>';
|
|
105
|
+
if (/^blob:/i.test(url))
|
|
106
|
+
return 'blob:<redacted>';
|
|
107
|
+
return url.length <= 160 ? url : `${url.slice(0, 157)}...`;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=resource-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-resolver.js","sourceRoot":"","sources":["../src/resource-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,eAAe,CAAC;AAmDvB,MAAM,UAAU,mCAAmC,CACjD,OAAqE;IAErE,MAAM,OAAO,GAAG,IAAI,GAAG,EAA8C,CAAC;IACtE,KAAK,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAG,qBAAqB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;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AAiB,CAAC;IAClD,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC;AAC7D,CAAC","sourcesContent":["import {\n PLAYABLE_EDITOR_DEFAULT_EXTENSIONS,\n getPlayableEditorAssetPathExtension,\n} from './identity.js';\n\nexport type PlayableAssetFormat = `.${string}`;\nexport type PlayableAssetResourceTransport = 'path-url' | 'http-url' | 'data-url' | 'blob-url';\n\n/** The browser-safe subset emitted by the generated project asset catalog. */\nexport interface PlayableGeneratedAssetCatalogEntry {\n readonly assetId: string;\n readonly url: string;\n readonly format: PlayableAssetFormat;\n readonly relativePath: string;\n readonly originalFileName?: string;\n}\n\nexport interface PlayableResolvedAssetResource {\n readonly assetId: string | null;\n readonly url: string;\n readonly format: PlayableAssetFormat;\n readonly transport: PlayableAssetResourceTransport;\n readonly relativePath: string | null;\n readonly originalFileName: string | null;\n}\n\nexport interface PlayableAssetResourceReference {\n readonly assetId?: string | null;\n readonly url?: string | null;\n}\n\nexport type PlayableAssetResourceResolutionCode =\n | 'asset.resource.not-found'\n | 'asset.resource.format-missing'\n | 'asset.resource.format-unsupported'\n | 'asset.resource.invalid-reference';\n\nexport interface PlayableAssetResourceResolutionDiagnostic {\n readonly code: PlayableAssetResourceResolutionCode;\n readonly assetId: string | null;\n readonly format: PlayableAssetFormat | null;\n readonly transport: PlayableAssetResourceTransport | null;\n /** A safe bounded URL description. It never includes a data/blob payload. */\n readonly urlSummary: string | null;\n}\n\nexport type PlayableAssetResourceResolution =\n | Readonly<{ ok: true; resource: PlayableResolvedAssetResource }>\n | Readonly<{ ok: false; diagnostic: PlayableAssetResourceResolutionDiagnostic }>;\n\nexport interface PlayableAssetResourceResolver {\n resolve(reference: PlayableAssetResourceReference): PlayableAssetResourceResolution;\n}\n\nexport function createPlayableAssetResourceResolver(\n catalog: Readonly<Record<string, PlayableGeneratedAssetCatalogEntry>>,\n): PlayableAssetResourceResolver {\n const entries = new Map<string, PlayableGeneratedAssetCatalogEntry>();\n for (const [catalogAssetId, input] of Object.entries(catalog)) {\n const entry = normalizeCatalogEntry(catalogAssetId, input);\n if (entries.has(entry.assetId)) throw new Error(`Duplicate generated asset catalog id: ${entry.assetId}`);\n entries.set(entry.assetId, entry);\n }\n return Object.freeze({\n resolve(reference: PlayableAssetResourceReference) {\n const assetId = normalizeOptionalString(reference.assetId);\n const url = normalizeOptionalString(reference.url);\n if (assetId) {\n const entry = entries.get(assetId);\n if (!entry) return failed('asset.resource.not-found', assetId, null, null, url);\n return resolved({\n assetId: entry.assetId,\n url: entry.url,\n format: entry.format,\n transport: getPlayableAssetResourceTransport(entry.url),\n relativePath: entry.relativePath,\n originalFileName: entry.originalFileName ?? null,\n });\n }\n if (!url) return failed('asset.resource.invalid-reference', null, null, null, null);\n const transport = getPlayableAssetResourceTransport(url);\n if (transport === 'data-url' || transport === 'blob-url') {\n return failed('asset.resource.format-missing', null, null, transport, url);\n }\n const format = getPlayableAssetFormat(url);\n if (!format) return failed('asset.resource.format-missing', null, null, transport, url);\n if (!isPlayableAssetFormatSupported(format)) {\n return failed('asset.resource.format-unsupported', null, format, transport, url);\n }\n return resolved({ assetId: null, url, format, transport, relativePath: null, originalFileName: null });\n },\n });\n}\n\nexport function getPlayableAssetFormat(value: unknown): PlayableAssetFormat | null {\n const extension = getPlayableEditorAssetPathExtension(String(value ?? ''));\n return extension ? extension as PlayableAssetFormat : null;\n}\n\nexport function isPlayableAssetFormatSupported(format: PlayableAssetFormat): boolean {\n return (PLAYABLE_EDITOR_DEFAULT_EXTENSIONS as readonly string[]).includes(format);\n}\n\nexport function getPlayableAssetResourceTransport(url: string): PlayableAssetResourceTransport {\n if (/^data:/i.test(url)) return 'data-url';\n if (/^blob:/i.test(url)) return 'blob-url';\n if (/^https?:/i.test(url)) return 'http-url';\n return 'path-url';\n}\n\nfunction normalizeCatalogEntry(\n catalogAssetId: string,\n input: PlayableGeneratedAssetCatalogEntry,\n): PlayableGeneratedAssetCatalogEntry {\n const assetId = normalizeRequiredString(input?.assetId, `Generated asset catalog entry ${catalogAssetId} assetId`);\n if (assetId !== catalogAssetId) throw new Error(`Generated asset catalog key/id mismatch: ${catalogAssetId}`);\n const url = normalizeRequiredString(input.url, `Generated asset catalog entry ${assetId} url`);\n const relativePath = normalizeRequiredString(input.relativePath, `Generated asset catalog entry ${assetId} relativePath`);\n const format = normalizeFormat(input.format, `Generated asset catalog entry ${assetId} format`);\n const derivedFormat = getPlayableAssetFormat(relativePath);\n if (derivedFormat !== format) throw new Error(`Generated asset catalog entry ${assetId} format must match relativePath.`);\n if (!isPlayableAssetFormatSupported(format)) throw new Error(`Generated asset catalog entry ${assetId} has unsupported format: ${format}`);\n const originalFileName = normalizeOptionalString(input.originalFileName);\n return Object.freeze({ assetId, url, format, relativePath, ...(originalFileName ? { originalFileName } : {}) });\n}\n\nfunction normalizeFormat(value: unknown, label: string): PlayableAssetFormat {\n const format = getPlayableAssetFormat(String(value ?? ''));\n if (!format || format !== String(value).trim().toLowerCase()) throw new Error(`${label} must be a normalized file extension.`);\n return format;\n}\n\nfunction normalizeRequiredString(value: unknown, label: string): string {\n const result = normalizeOptionalString(value);\n if (!result) throw new Error(`${label} is required.`);\n return result;\n}\n\nfunction normalizeOptionalString(value: unknown): string | null {\n if (typeof value !== 'string') return null;\n const result = value.trim();\n return result || null;\n}\n\nfunction resolved(resource: PlayableResolvedAssetResource): PlayableAssetResourceResolution {\n return Object.freeze({ ok: true, resource: Object.freeze(resource) });\n}\n\nfunction failed(\n code: PlayableAssetResourceResolutionCode,\n assetId: string | null,\n format: PlayableAssetFormat | null,\n transport: PlayableAssetResourceTransport | null,\n url: string | null,\n): PlayableAssetResourceResolution {\n return Object.freeze({ ok: false, diagnostic: Object.freeze({\n code, assetId, format, transport, urlSummary: summarizeUrl(url),\n }) });\n}\n\nfunction summarizeUrl(url: string | null): string | null {\n if (!url) return null;\n if (/^data:/i.test(url)) return 'data:<redacted>';\n if (/^blob:/i.test(url)) return 'blob:<redacted>';\n return url.length <= 160 ? url : `${url.slice(0, 157)}...`;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fps-games/playable-rendering",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Environment-neutral rendering and shadow contracts and resolution logic.",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@fps-games/playable-contracts": "0.2.1-beta.
|
|
21
|
+
"@fps-games/playable-contracts": "0.2.1-beta.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAE3B,MAAM,YAAY,CAAC;AAEpB,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAa9F;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,0BAA0B,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAkC/G;AA+BD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAiHvE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineFpsPluginEntry, defineFpsPluginManifest } from '@fps-games/plugin-api';
|
|
2
2
|
import { createFpsPluginHost } from '@fps-games/plugin-host';
|
|
3
|
+
import { FPS_ASSET_CATALOG_SOURCE } from '@fps-games/plugin-assets/resources';
|
|
3
4
|
import { assertFpsRuntimePluginDataContracts, createFpsRuntimeDataSnapshot } from './runtime-data.js';
|
|
4
5
|
import { createFpsStandardRuntimePlugins } from './standard-plugins.js';
|
|
5
6
|
import { FPS_RUNTIME_DATA, FPS_RUNTIME_PROJECT, FPS_RUNTIME_SCENE_ID, } from './tokens.js';
|
|
@@ -135,6 +136,10 @@ export function createFpsRuntime(options) {
|
|
|
135
136
|
initialServices: [
|
|
136
137
|
{ token: FPS_RUNTIME_PROJECT, value: project },
|
|
137
138
|
{ token: FPS_RUNTIME_DATA, value: runtimeData },
|
|
139
|
+
{
|
|
140
|
+
token: FPS_ASSET_CATALOG_SOURCE,
|
|
141
|
+
value: Object.freeze({ catalog: options.assetCatalog }),
|
|
142
|
+
},
|
|
138
143
|
],
|
|
139
144
|
loadEntry: async (manifest) => pluginById.get(manifest.id)?.runtime ?? null,
|
|
140
145
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mCAAmC,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AASrB,MAAM,UAAU,gBAAgB,CAAC,OAA6B;IAC5D,uBAAuB,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAC7F,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,E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;QAC9D,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { defineFpsPluginEntry, defineFpsPluginManifest } from '@fps-games/plugin-api';\nimport type { FpsServiceToken } from '@fps-games/plugin-api';\nimport { createFpsPluginHost } from '@fps-games/plugin-host';\nimport { assertFpsRuntimePluginDataContracts, createFpsRuntimeDataSnapshot } from './runtime-data.js';\nimport { createFpsStandardRuntimePlugins } from './standard-plugins.js';\nimport {\n FPS_RUNTIME_DATA,\n FPS_RUNTIME_PROJECT,\n FPS_RUNTIME_SCENE_ID,\n} from './tokens.js';\nimport type {\n FpsProjectDefinition,\n FpsRuntime,\n FpsRuntimeOptions,\n FpsRuntimePluginDefinition,\n FpsRuntimeSceneScope,\n} from './types.js';\n\nexport function defineFpsProject(project: FpsProjectDefinition): Readonly<FpsProjectDefinition> {\n assertRuntimePluginKeys(project, ['projectId', 'projectName', 'plugins'], 'Runtime project');\n if (typeof project.projectId !== 'string' || !project.projectId.trim()) throw new Error('Project id is required.');\n if (typeof project.projectName !== 'string' || !project.projectName.trim()) throw new Error('Project name is required.');\n const hasPlugins = Object.prototype.hasOwnProperty.call(project, 'plugins');\n const plugins = hasPlugins\n ? readRuntimeDataArray(project.plugins, 'Runtime project plugins').map(plugin => defineFpsRuntimePlugin(plugin as FpsRuntimePluginDefinition))\n : undefined;\n return Object.freeze({\n projectId: project.projectId,\n projectName: project.projectName,\n ...(plugins ? { plugins: Object.freeze(plugins) } : {}),\n });\n}\n\nexport function defineFpsRuntimePlugin(plugin: FpsRuntimePluginDefinition): Readonly<FpsRuntimePluginDefinition> {\n assertRuntimePluginKeys(plugin, ['manifest', 'runtime', 'scope', 'data'], 'Runtime plugin definition');\n const hasData = Object.prototype.hasOwnProperty.call(plugin, 'data');\n const manifest = defineFpsPluginManifest(plugin.manifest);\n const entry = defineFpsPluginEntry(plugin.runtime);\n if (manifest.id !== entry.pluginId) throw new Error(`Runtime plugin id mismatch: ${manifest.id}`);\n if (entry.environment !== 'runtime') throw new Error(`Runtime plugin has invalid environment: ${manifest.id}`);\n if (!manifest.entries.runtime) throw new Error(`Runtime plugin manifest entry is required: ${manifest.id}`);\n if (plugin.scope !== undefined && !['application', 'project', 'scene'].includes(plugin.scope)) {\n throw new Error(`Runtime plugin has invalid scope: ${plugin.manifest.id}`);\n }\n if (hasData) assertRuntimePluginKeys(plugin.data, ['schemaVersion', 'required', 'validate'], 'Runtime plugin data contract');\n if (hasData && (!Number.isInteger(plugin.data!.schemaVersion) || plugin.data!.schemaVersion < 1)) {\n throw new Error(`Runtime plugin data schemaVersion must be a positive integer: ${manifest.id}`);\n }\n if (hasData) {\n if (plugin.data!.required !== undefined && typeof plugin.data!.required !== 'boolean') {\n throw new Error(`Runtime plugin data required must be boolean: ${manifest.id}`);\n }\n if (typeof plugin.data!.validate !== 'function') throw new Error(`Runtime plugin data validator is required: ${manifest.id}`);\n if (plugin.data!.validate.constructor.name === 'AsyncFunction') {\n throw new Error(`Runtime plugin data validator must be synchronous: ${manifest.id}`);\n }\n }\n return Object.freeze({\n manifest,\n runtime: entry,\n ...(plugin.scope ? { scope: plugin.scope } : {}),\n ...(hasData ? { data: Object.freeze({\n schemaVersion: plugin.data!.schemaVersion,\n ...(plugin.data!.required === undefined ? {} : { required: plugin.data!.required }),\n validate: plugin.data!.validate,\n }) } : {}),\n });\n}\n\nfunction assertRuntimePluginKeys(value: unknown, keys: readonly string[], label: string): void {\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error(`${label} must be an object.`);\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) throw new Error(`${label} must be a plain object.`);\n const allowed = new Set(keys);\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== 'string' || !allowed.has(key)) throw new Error(`${label} contains unknown field: ${String(key)}`);\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (!descriptor?.enumerable || !('value' in descriptor)) throw new Error(`${label} must contain enumerable data fields only: ${key}`);\n }\n}\n\nfunction readRuntimeDataArray(value: unknown, label: string): readonly unknown[] {\n if (!Array.isArray(value)) throw new Error(`${label} must be an array.`);\n const result: unknown[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n if (!descriptor?.enumerable || !('value' in descriptor)) throw new Error(`${label} must be a dense data array.`);\n result.push(descriptor.value);\n }\n for (const key of Reflect.ownKeys(value)) {\n if (key === 'length') continue;\n if (typeof key !== 'string' || !/^(0|[1-9][0-9]*)$/.test(key) || Number(key) >= value.length) {\n throw new Error(`${label} contains unsupported property: ${String(key)}`);\n }\n }\n return result;\n}\n\nexport function createFpsRuntime(options: FpsRuntimeOptions): FpsRuntime {\n const runtimeData = createFpsRuntimeDataSnapshot(options.data);\n const project = defineFpsProject(options.project);\n const plugins = [...createFpsStandardRuntimePlugins(), ...(project.plugins ?? []), ...(options.plugins ?? [])]\n .map(plugin => defineFpsRuntimePlugin(plugin));\n const pluginById = new Map<string, FpsRuntimePluginDefinition>();\n for (const plugin of plugins) {\n if (pluginById.has(plugin.manifest.id)) throw new Error(`Duplicate runtime plugin id: ${plugin.manifest.id}`);\n pluginById.set(plugin.manifest.id, plugin);\n }\n assertFpsRuntimePluginDataContracts(runtimeData, plugins);\n const applicationPlugins = plugins.filter(plugin => plugin.scope === 'application');\n const projectPlugins = plugins.filter(plugin => (plugin.scope ?? 'project') === 'project');\n const scenePlugins = plugins.filter(plugin => plugin.scope === 'scene');\n const applicationHost = createFpsPluginHost({\n environment: 'runtime',\n apiVersion: 1,\n manifests: applicationPlugins.map(plugin => plugin.manifest),\n loadEntry: async manifest => pluginById.get(manifest.id)?.runtime ?? null,\n report: options.report,\n });\n let projectHost: ReturnType<typeof createFpsPluginHost> | null = null;\n let state: FpsRuntime['state'] = 'created';\n let transitioning = false;\n\n return {\n get state() { return state; },\n get services() { return state === 'started' ? projectHost?.services ?? null : null; },\n async start() {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state !== 'created') throw new Error(`Runtime cannot start from state: ${state}`);\n transitioning = true;\n try {\n await applicationHost.start();\n projectHost = applicationHost.createScope({\n scope: 'project',\n manifests: projectPlugins.map(plugin => plugin.manifest),\n initialServices: [\n { token: FPS_RUNTIME_PROJECT as FpsServiceToken<unknown>, value: project },\n { token: FPS_RUNTIME_DATA as FpsServiceToken<unknown>, value: runtimeData },\n ],\n loadEntry: async manifest => pluginById.get(manifest.id)?.runtime ?? null,\n });\n await projectHost.start();\n state = 'started';\n } catch (error) {\n let cleanupFailed = false;\n let cleanupError: unknown;\n try {\n if (applicationHost.state !== 'disposed') await applicationHost.dispose();\n }\n catch (cleanupCause) { cleanupFailed = true; cleanupError = cleanupCause; }\n finally {\n if (!cleanupFailed) projectHost = null;\n state = cleanupFailed ? 'cleanup-failed' : 'disposed';\n }\n if (cleanupFailed) {\n const combined = new Error(`Runtime startup failed and cleanup reported an error: ${String((error as Error)?.message ?? error)}; ${String((cleanupError as Error)?.message ?? cleanupError)}`);\n Object.assign(combined, { errors: [error, cleanupError] });\n throw combined;\n }\n throw error;\n } finally {\n transitioning = false;\n }\n },\n async stop() {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state !== 'started' && state !== 'cleanup-failed') return;\n transitioning = true;\n try { await applicationHost.stop(); }\n finally {\n if (applicationHost.state === 'stopped') state = 'stopped';\n else if (applicationHost.state === 'cleanup-failed') state = 'cleanup-failed';\n else if (applicationHost.state === 'disposed') {\n projectHost = null;\n state = 'disposed';\n }\n transitioning = false;\n }\n },\n async dispose() {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state === 'disposed') return;\n transitioning = true;\n try { await applicationHost.dispose(); }\n finally {\n if (applicationHost.state === 'disposed') {\n projectHost = null;\n state = 'disposed';\n }\n else if (applicationHost.state === 'cleanup-failed') state = 'cleanup-failed';\n transitioning = false;\n }\n },\n async createSceneScope(sceneId: string): Promise<FpsRuntimeSceneScope> {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state !== 'started' || !projectHost) throw new Error(`Runtime scene scope requires started state, got: ${state}`);\n if (!sceneId.trim()) throw new Error('Runtime scene id is required.');\n const host = projectHost.createScope({\n scope: 'scene',\n manifests: scenePlugins.map(plugin => plugin.manifest),\n initialServices: [{ token: FPS_RUNTIME_SCENE_ID as FpsServiceToken<unknown>, value: sceneId }],\n loadEntry: async manifest => pluginById.get(manifest.id)?.runtime ?? null,\n });\n await host.start();\n return { id: sceneId, host, dispose: () => host.dispose() };\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,mCAAmC,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AASrB,MAAM,UAAU,gBAAgB,CAAC,OAA6B;IAC5D,uBAAuB,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAC7F,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnH,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACzH,MAAM,UAAU,GAAG,MAAM,CAAC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ServiceToken } from '@fps-games/plugin-api';\nimport { createFpsPluginHost } from '@fps-games/plugin-host';\nimport { FPS_ASSET_CATALOG_SOURCE } from '@fps-games/plugin-assets/resources';\nimport { assertFpsRuntimePluginDataContracts, createFpsRuntimeDataSnapshot } from './runtime-data.js';\nimport { createFpsStandardRuntimePlugins } from './standard-plugins.js';\nimport {\n FPS_RUNTIME_DATA,\n FPS_RUNTIME_PROJECT,\n FPS_RUNTIME_SCENE_ID,\n} from './tokens.js';\nimport type {\n FpsProjectDefinition,\n FpsRuntime,\n FpsRuntimeOptions,\n FpsRuntimePluginDefinition,\n FpsRuntimeSceneScope,\n} from './types.js';\n\nexport function defineFpsProject(project: FpsProjectDefinition): Readonly<FpsProjectDefinition> {\n assertRuntimePluginKeys(project, ['projectId', 'projectName', 'plugins'], 'Runtime project');\n if (typeof project.projectId !== 'string' || !project.projectId.trim()) throw new Error('Project id is required.');\n if (typeof project.projectName !== 'string' || !project.projectName.trim()) throw new Error('Project name is required.');\n const hasPlugins = Object.prototype.hasOwnProperty.call(project, 'plugins');\n const plugins = hasPlugins\n ? readRuntimeDataArray(project.plugins, 'Runtime project plugins').map(plugin => defineFpsRuntimePlugin(plugin as FpsRuntimePluginDefinition))\n : undefined;\n return Object.freeze({\n projectId: project.projectId,\n projectName: project.projectName,\n ...(plugins ? { plugins: Object.freeze(plugins) } : {}),\n });\n}\n\nexport function defineFpsRuntimePlugin(plugin: FpsRuntimePluginDefinition): Readonly<FpsRuntimePluginDefinition> {\n assertRuntimePluginKeys(plugin, ['manifest', 'runtime', 'scope', 'data'], 'Runtime plugin definition');\n const hasData = Object.prototype.hasOwnProperty.call(plugin, 'data');\n const manifest = defineFpsPluginManifest(plugin.manifest);\n const entry = defineFpsPluginEntry(plugin.runtime);\n if (manifest.id !== entry.pluginId) throw new Error(`Runtime plugin id mismatch: ${manifest.id}`);\n if (entry.environment !== 'runtime') throw new Error(`Runtime plugin has invalid environment: ${manifest.id}`);\n if (!manifest.entries.runtime) throw new Error(`Runtime plugin manifest entry is required: ${manifest.id}`);\n if (plugin.scope !== undefined && !['application', 'project', 'scene'].includes(plugin.scope)) {\n throw new Error(`Runtime plugin has invalid scope: ${plugin.manifest.id}`);\n }\n if (hasData) assertRuntimePluginKeys(plugin.data, ['schemaVersion', 'required', 'validate'], 'Runtime plugin data contract');\n if (hasData && (!Number.isInteger(plugin.data!.schemaVersion) || plugin.data!.schemaVersion < 1)) {\n throw new Error(`Runtime plugin data schemaVersion must be a positive integer: ${manifest.id}`);\n }\n if (hasData) {\n if (plugin.data!.required !== undefined && typeof plugin.data!.required !== 'boolean') {\n throw new Error(`Runtime plugin data required must be boolean: ${manifest.id}`);\n }\n if (typeof plugin.data!.validate !== 'function') throw new Error(`Runtime plugin data validator is required: ${manifest.id}`);\n if (plugin.data!.validate.constructor.name === 'AsyncFunction') {\n throw new Error(`Runtime plugin data validator must be synchronous: ${manifest.id}`);\n }\n }\n return Object.freeze({\n manifest,\n runtime: entry,\n ...(plugin.scope ? { scope: plugin.scope } : {}),\n ...(hasData ? { data: Object.freeze({\n schemaVersion: plugin.data!.schemaVersion,\n ...(plugin.data!.required === undefined ? {} : { required: plugin.data!.required }),\n validate: plugin.data!.validate,\n }) } : {}),\n });\n}\n\nfunction assertRuntimePluginKeys(value: unknown, keys: readonly string[], label: string): void {\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error(`${label} must be an object.`);\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) throw new Error(`${label} must be a plain object.`);\n const allowed = new Set(keys);\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== 'string' || !allowed.has(key)) throw new Error(`${label} contains unknown field: ${String(key)}`);\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (!descriptor?.enumerable || !('value' in descriptor)) throw new Error(`${label} must contain enumerable data fields only: ${key}`);\n }\n}\n\nfunction readRuntimeDataArray(value: unknown, label: string): readonly unknown[] {\n if (!Array.isArray(value)) throw new Error(`${label} must be an array.`);\n const result: unknown[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n if (!descriptor?.enumerable || !('value' in descriptor)) throw new Error(`${label} must be a dense data array.`);\n result.push(descriptor.value);\n }\n for (const key of Reflect.ownKeys(value)) {\n if (key === 'length') continue;\n if (typeof key !== 'string' || !/^(0|[1-9][0-9]*)$/.test(key) || Number(key) >= value.length) {\n throw new Error(`${label} contains unsupported property: ${String(key)}`);\n }\n }\n return result;\n}\n\nexport function createFpsRuntime(options: FpsRuntimeOptions): FpsRuntime {\n const runtimeData = createFpsRuntimeDataSnapshot(options.data);\n const project = defineFpsProject(options.project);\n const plugins = [...createFpsStandardRuntimePlugins(), ...(project.plugins ?? []), ...(options.plugins ?? [])]\n .map(plugin => defineFpsRuntimePlugin(plugin));\n const pluginById = new Map<string, FpsRuntimePluginDefinition>();\n for (const plugin of plugins) {\n if (pluginById.has(plugin.manifest.id)) throw new Error(`Duplicate runtime plugin id: ${plugin.manifest.id}`);\n pluginById.set(plugin.manifest.id, plugin);\n }\n assertFpsRuntimePluginDataContracts(runtimeData, plugins);\n const applicationPlugins = plugins.filter(plugin => plugin.scope === 'application');\n const projectPlugins = plugins.filter(plugin => (plugin.scope ?? 'project') === 'project');\n const scenePlugins = plugins.filter(plugin => plugin.scope === 'scene');\n const applicationHost = createFpsPluginHost({\n environment: 'runtime',\n apiVersion: 1,\n manifests: applicationPlugins.map(plugin => plugin.manifest),\n loadEntry: async manifest => pluginById.get(manifest.id)?.runtime ?? null,\n report: options.report,\n });\n let projectHost: ReturnType<typeof createFpsPluginHost> | null = null;\n let state: FpsRuntime['state'] = 'created';\n let transitioning = false;\n\n return {\n get state() { return state; },\n get services() { return state === 'started' ? projectHost?.services ?? null : null; },\n async start() {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state !== 'created') throw new Error(`Runtime cannot start from state: ${state}`);\n transitioning = true;\n try {\n await applicationHost.start();\n projectHost = applicationHost.createScope({\n scope: 'project',\n manifests: projectPlugins.map(plugin => plugin.manifest),\n initialServices: [\n { token: FPS_RUNTIME_PROJECT as FpsServiceToken<unknown>, value: project },\n { token: FPS_RUNTIME_DATA as FpsServiceToken<unknown>, value: runtimeData },\n {\n token: FPS_ASSET_CATALOG_SOURCE as FpsServiceToken<unknown>,\n value: Object.freeze({ catalog: options.assetCatalog }),\n },\n ],\n loadEntry: async manifest => pluginById.get(manifest.id)?.runtime ?? null,\n });\n await projectHost.start();\n state = 'started';\n } catch (error) {\n let cleanupFailed = false;\n let cleanupError: unknown;\n try {\n if (applicationHost.state !== 'disposed') await applicationHost.dispose();\n }\n catch (cleanupCause) { cleanupFailed = true; cleanupError = cleanupCause; }\n finally {\n if (!cleanupFailed) projectHost = null;\n state = cleanupFailed ? 'cleanup-failed' : 'disposed';\n }\n if (cleanupFailed) {\n const combined = new Error(`Runtime startup failed and cleanup reported an error: ${String((error as Error)?.message ?? error)}; ${String((cleanupError as Error)?.message ?? cleanupError)}`);\n Object.assign(combined, { errors: [error, cleanupError] });\n throw combined;\n }\n throw error;\n } finally {\n transitioning = false;\n }\n },\n async stop() {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state !== 'started' && state !== 'cleanup-failed') return;\n transitioning = true;\n try { await applicationHost.stop(); }\n finally {\n if (applicationHost.state === 'stopped') state = 'stopped';\n else if (applicationHost.state === 'cleanup-failed') state = 'cleanup-failed';\n else if (applicationHost.state === 'disposed') {\n projectHost = null;\n state = 'disposed';\n }\n transitioning = false;\n }\n },\n async dispose() {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state === 'disposed') return;\n transitioning = true;\n try { await applicationHost.dispose(); }\n finally {\n if (applicationHost.state === 'disposed') {\n projectHost = null;\n state = 'disposed';\n }\n else if (applicationHost.state === 'cleanup-failed') state = 'cleanup-failed';\n transitioning = false;\n }\n },\n async createSceneScope(sceneId: string): Promise<FpsRuntimeSceneScope> {\n if (transitioning) throw new Error('Runtime lifecycle transition already in progress.');\n if (state !== 'started' || !projectHost) throw new Error(`Runtime scene scope requires started state, got: ${state}`);\n if (!sceneId.trim()) throw new Error('Runtime scene id is required.');\n const host = projectHost.createScope({\n scope: 'scene',\n manifests: scenePlugins.map(plugin => plugin.manifest),\n initialServices: [{ token: FPS_RUNTIME_SCENE_ID as FpsServiceToken<unknown>, value: sceneId }],\n loadEntry: async manifest => pluginById.get(manifest.id)?.runtime ?? null,\n });\n await host.start();\n return { id: sceneId, host, dispose: () => host.dispose() };\n },\n };\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FpsRuntimeData } from '@fps-games/playable-contracts';
|
|
2
2
|
import type { FpsDiagnostic, FpsPluginEntry, FpsPluginManifest, FpsServiceRegistry } from '@fps-games/plugin-api';
|
|
3
3
|
import type { FpsPluginHost } from '@fps-games/plugin-host';
|
|
4
|
+
import type { FpsAssetCatalogSource } from '@fps-games/plugin-assets/resources';
|
|
4
5
|
export interface FpsProjectDefinition {
|
|
5
6
|
readonly projectId: string;
|
|
6
7
|
readonly projectName: string;
|
|
@@ -37,6 +38,7 @@ export interface FpsRuntime {
|
|
|
37
38
|
export interface FpsRuntimeOptions {
|
|
38
39
|
project: FpsProjectDefinition;
|
|
39
40
|
data: FpsRuntimeData;
|
|
41
|
+
assetCatalog: FpsAssetCatalogSource['catalog'];
|
|
40
42
|
plugins?: readonly FpsRuntimePluginDefinition[];
|
|
41
43
|
report?(diagnostic: FpsDiagnostic): void;
|
|
42
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAClH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,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-1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoDA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YACW,IAAyI,EACzI,QAAgB,EACzB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAAqI;QACzI,aAAQ,GAAR,QAAQ,CAAQ;QAIzB,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF","sourcesContent":["import type { FpsRuntimeData } from '@fps-games/playable-contracts';\nimport type { FpsDiagnostic, FpsPluginEntry, FpsPluginManifest, FpsServiceRegistry } from '@fps-games/plugin-api';\nimport type { FpsPluginHost } from '@fps-games/plugin-host';\nimport type { FpsAssetCatalogSource } from '@fps-games/plugin-assets/resources';\n\nexport interface FpsProjectDefinition {\n readonly projectId: string;\n readonly projectName: string;\n readonly plugins?: readonly FpsRuntimePluginDefinition[];\n}\n\nexport interface FpsRuntimePluginDefinition {\n readonly manifest: Readonly<FpsPluginManifest>;\n readonly runtime: Readonly<FpsPluginEntry>;\n readonly scope?: 'application' | 'project' | 'scene';\n readonly data?: {\n readonly schemaVersion: number;\n readonly required?: boolean;\n readonly validate: (value: unknown) => void;\n };\n}\n\nexport type { FpsRuntimeSceneService } from '@fps-games/plugin-scene/runtime';\n\nexport type { FpsRuntimeAssetService } from '@fps-games/plugin-assets/runtime';\nexport type { FpsRuntimeMarkerService } from '@fps-games/plugin-markers/runtime';\nexport type { FpsRuntimeRenderingService } from '@fps-games/plugin-rendering/runtime';\nexport type { FpsRuntimeShadowService } from '@fps-games/plugin-shadows/runtime';\n\nexport interface FpsRuntimeSceneScope {\n readonly id: string;\n readonly host: FpsPluginHost;\n dispose(): Promise<void>;\n}\n\nexport interface FpsRuntime {\n readonly state: 'created' | 'started' | 'stopped' | 'cleanup-failed' | 'disposed';\n readonly services: FpsServiceRegistry | null;\n start(): Promise<void>;\n stop(): Promise<void>;\n dispose(): Promise<void>;\n createSceneScope(sceneId: string): Promise<FpsRuntimeSceneScope>;\n}\n\nexport interface FpsRuntimeOptions {\n project: FpsProjectDefinition;\n data: FpsRuntimeData;\n assetCatalog: FpsAssetCatalogSource['catalog'];\n plugins?: readonly FpsRuntimePluginDefinition[];\n report?(diagnostic: FpsDiagnostic): void;\n}\n\nexport {\n FpsRuntimeDataError,\n FpsRuntimeSchemaError,\n} from '@fps-games/playable-runtime-data';\n\nexport class FpsRuntimePluginDataError extends Error {\n constructor(\n readonly code: 'runtime.plugin-data.unclaimed' | 'runtime.plugin-data.missing' | 'runtime.plugin-data.unsupported' | 'runtime.plugin-data.invalid',\n readonly pluginId: string,\n message: string,\n ) {\n super(message);\n this.name = 'FpsRuntimePluginDataError';\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fps-games/playable-runtime",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Plugin-based runtime host for fps-games playable projects.",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fps-games/playable-contracts": "0.2.1-beta.
|
|
18
|
-
"@fps-games/playable-rendering": "0.2.1-beta.
|
|
19
|
-
"@fps-games/playable-runtime-data": "0.2.1-beta.
|
|
20
|
-
"@fps-games/plugin-assets": "0.2.1-beta.
|
|
21
|
-
"@fps-games/plugin-materials": "0.2.1-beta.
|
|
22
|
-
"@fps-games/plugin-markers": "0.2.1-beta.
|
|
23
|
-
"@fps-games/plugin-rendering": "0.2.1-beta.
|
|
24
|
-
"@fps-games/plugin-shadows": "0.2.1-beta.
|
|
25
|
-
"@fps-games/plugin-scene": "0.2.1-beta.
|
|
26
|
-
"@fps-games/plugin-api": "0.2.1-beta.
|
|
27
|
-
"@fps-games/plugin-host": "0.2.1-beta.
|
|
17
|
+
"@fps-games/playable-contracts": "0.2.1-beta.3",
|
|
18
|
+
"@fps-games/playable-rendering": "0.2.1-beta.3",
|
|
19
|
+
"@fps-games/playable-runtime-data": "0.2.1-beta.3",
|
|
20
|
+
"@fps-games/plugin-assets": "0.2.1-beta.3",
|
|
21
|
+
"@fps-games/plugin-materials": "0.2.1-beta.3",
|
|
22
|
+
"@fps-games/plugin-markers": "0.2.1-beta.3",
|
|
23
|
+
"@fps-games/plugin-rendering": "0.2.1-beta.3",
|
|
24
|
+
"@fps-games/plugin-shadows": "0.2.1-beta.3",
|
|
25
|
+
"@fps-games/plugin-scene": "0.2.1-beta.3",
|
|
26
|
+
"@fps-games/plugin-api": "0.2.1-beta.3",
|
|
27
|
+
"@fps-games/plugin-host": "0.2.1-beta.3"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fps-games/playable-runtime-data",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Strict validation and immutable snapshots for fps-games Runtime Data.",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fps-games/playable-contracts": "0.2.1-beta.
|
|
18
|
-
"@fps-games/playable-rendering": "0.2.1-beta.
|
|
19
|
-
"@fps-games/plugin-api": "0.2.1-beta.
|
|
17
|
+
"@fps-games/playable-contracts": "0.2.1-beta.3",
|
|
18
|
+
"@fps-games/playable-rendering": "0.2.1-beta.3",
|
|
19
|
+
"@fps-games/plugin-api": "0.2.1-beta.3"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fps-games/playable-scene",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Environment-neutral scene graph and transform domain logic.",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fps-games/playable-contracts": "0.2.1-beta.
|
|
17
|
+
"@fps-games/playable-contracts": "0.2.1-beta.3"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../src/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,oBAAoB,EAAG,mBAA4B,CAAC;AAEjE,wBAAgB,YAAY,IAAI,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../src/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,oBAAoB,EAAG,mBAA4B,CAAC;AAEjE,wBAAgB,YAAY,IAAI,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAUjE;AAED,wBAAgB,6BAA6B,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAmB3E"}
|
|
@@ -6,7 +6,10 @@ export function assetsPlugin() {
|
|
|
6
6
|
packageName: '@fps-games/plugin-assets',
|
|
7
7
|
pluginId: FPS_ASSETS_PLUGIN_ID,
|
|
8
8
|
config: null,
|
|
9
|
-
hostServices: {
|
|
9
|
+
hostServices: {
|
|
10
|
+
runtime: ['fps.runtime.data', 'fps.asset.catalog.source'],
|
|
11
|
+
renderer: ['fps.asset.catalog.source'],
|
|
12
|
+
},
|
|
10
13
|
});
|
|
11
14
|
}
|
|
12
15
|
export function createFpsAssetsPluginManifest() {
|
|
@@ -16,11 +19,15 @@ export function createFpsAssetsPluginManifest() {
|
|
|
16
19
|
apiVersion: 1,
|
|
17
20
|
requires: {},
|
|
18
21
|
provides: { features: ['fps.assets'] },
|
|
19
|
-
entries: { runtime: './runtime' },
|
|
22
|
+
entries: { runtime: './runtime', renderer: './renderer' },
|
|
20
23
|
environmentContracts: {
|
|
21
24
|
runtime: {
|
|
22
|
-
requires: { services: ['fps.runtime.data'] },
|
|
23
|
-
provides: { services: ['fps.runtime.assets'] },
|
|
25
|
+
requires: { services: ['fps.runtime.data', 'fps.asset.catalog.source'] },
|
|
26
|
+
provides: { services: ['fps.runtime.assets', 'fps.asset.resource.resolver'] },
|
|
27
|
+
},
|
|
28
|
+
renderer: {
|
|
29
|
+
requires: { services: ['fps.asset.catalog.source'] },
|
|
30
|
+
provides: { services: ['fps.asset.resource.resolver'] },
|
|
24
31
|
},
|
|
25
32
|
},
|
|
26
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../src/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GAGzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAA4B,CAAC;AAEjE,MAAM,UAAU,YAAY;IAC1B,OAAO,wBAAwB,CAAC;QAC9B,WAAW,EAAE,0BAA0B;QACvC,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"reference.js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ginManifest,\n type FpsPluginReference,\n} from '@fps-games/plugin-api';\nimport { FPS_PLUGIN_VERSION } from './version.js';\n\nexport const FPS_ASSETS_PLUGIN_ID = 'fps.plugin.assets' as const;\n\nexport function assetsPlugin(): Readonly<FpsPluginReference<null>> {\n return defineFpsPluginReference({\n packageName: '@fps-games/plugin-assets',\n pluginId: FPS_ASSETS_PLUGIN_ID,\n config: null,\n hostServices: {\n runtime: ['fps.runtime.data', 'fps.asset.catalog.source'],\n renderer: ['fps.asset.catalog.source'],\n },\n });\n}\n\nexport function createFpsAssetsPluginManifest(): Readonly<FpsPluginManifest> {\n return defineFpsPluginManifest({\n id: FPS_ASSETS_PLUGIN_ID,\n version: FPS_PLUGIN_VERSION,\n apiVersion: 1,\n requires: {},\n provides: { features: ['fps.assets'] },\n entries: { runtime: './runtime', renderer: './renderer' },\n environmentContracts: {\n runtime: {\n requires: { services: ['fps.runtime.data', 'fps.asset.catalog.source'] },\n provides: { services: ['fps.runtime.assets', 'fps.asset.resource.resolver'] },\n },\n renderer: {\n requires: { services: ['fps.asset.catalog.source'] },\n provides: { services: ['fps.asset.resource.resolver'] },\n },\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FpsPluginContext } from '@fps-games/plugin-api';
|
|
2
|
+
/** Renderer environment provider for the standard asset-resource resolver. */
|
|
3
|
+
export declare const pluginEntry: Readonly<{
|
|
4
|
+
pluginId: "fps.plugin.assets";
|
|
5
|
+
environment: "renderer";
|
|
6
|
+
register(context: FpsPluginContext): void;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQpF,8EAA8E;AAC9E,eAAO,MAAM,WAAW;;;sBAGJ,gBAAgB;EAIlC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineFpsPluginEntry } from '@fps-games/plugin-api';
|
|
2
|
+
import { FPS_ASSETS_PLUGIN_ID } from './reference.js';
|
|
3
|
+
import { createFpsAssetResourceResolver, FPS_ASSET_CATALOG_SOURCE, FPS_ASSET_RESOURCE_RESOLVER, } from './resources.js';
|
|
4
|
+
/** Renderer environment provider for the standard asset-resource resolver. */
|
|
5
|
+
export const pluginEntry = defineFpsPluginEntry({
|
|
6
|
+
pluginId: FPS_ASSETS_PLUGIN_ID,
|
|
7
|
+
environment: 'renderer',
|
|
8
|
+
register(context) {
|
|
9
|
+
const resolver = createFpsAssetResourceResolver(context.services.get(FPS_ASSET_CATALOG_SOURCE));
|
|
10
|
+
context.add(context.services.register(FPS_ASSET_RESOURCE_RESOLVER, resolver));
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAExB,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;IAC9C,QAAQ,EAAE,oBAAoB;IAC9B,WAAW,EAAE,UAAU;IACvB,QAAQ,CAAC,OAAyB;QAChC,MAAM,QAAQ,GAAG,8BAA8B,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAChG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChF,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineFpsPluginEntry, type FpsPluginContext } from '@fps-games/plugin-api';\nimport { FPS_ASSETS_PLUGIN_ID } from './reference.js';\nimport {\n createFpsAssetResourceResolver,\n FPS_ASSET_CATALOG_SOURCE,\n FPS_ASSET_RESOURCE_RESOLVER,\n} from './resources.js';\n\n/** Renderer environment provider for the standard asset-resource resolver. */\nexport const pluginEntry = defineFpsPluginEntry({\n pluginId: FPS_ASSETS_PLUGIN_ID,\n environment: 'renderer',\n register(context: FpsPluginContext) {\n const resolver = createFpsAssetResourceResolver(context.services.get(FPS_ASSET_CATALOG_SOURCE));\n context.add(context.services.register(FPS_ASSET_RESOURCE_RESOLVER, resolver));\n },\n});\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PlayableAssetResourceResolver, type PlayableGeneratedAssetCatalogEntry } from '@fps-games/playable-assets';
|
|
2
|
+
/**
|
|
3
|
+
* The generated catalog is supplied by the environment Host. The Assets Plugin
|
|
4
|
+
* owns converting it into a resolver; consumers must not build their own index.
|
|
5
|
+
*/
|
|
6
|
+
export interface FpsAssetCatalogSource {
|
|
7
|
+
readonly catalog: Readonly<Record<string, PlayableGeneratedAssetCatalogEntry>>;
|
|
8
|
+
}
|
|
9
|
+
export declare const FPS_ASSET_CATALOG_SOURCE: import("@fps-games/plugin-api").FpsServiceToken<FpsAssetCatalogSource>;
|
|
10
|
+
export declare const FPS_ASSET_RESOURCE_RESOLVER: import("@fps-games/plugin-api").FpsServiceToken<PlayableAssetResourceResolver>;
|
|
11
|
+
export declare function createFpsAssetResourceResolver(source: FpsAssetCatalogSource): PlayableAssetResourceResolver;
|
|
12
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACxC,MAAM,4BAA4B,CAAC;AAGpC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC,CAAC;CAChF;AAED,eAAO,MAAM,wBAAwB,wEAA2E,CAAC;AACjH,eAAO,MAAM,2BAA2B,gFAAsF,CAAC;AAE/H,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,qBAAqB,GAAG,6BAA6B,CAE3G"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createPlayableAssetResourceResolver, } from '@fps-games/playable-assets';
|
|
2
|
+
import { defineFpsServiceToken } from '@fps-games/plugin-api';
|
|
3
|
+
export const FPS_ASSET_CATALOG_SOURCE = defineFpsServiceToken('fps.asset.catalog.source');
|
|
4
|
+
export const FPS_ASSET_RESOURCE_RESOLVER = defineFpsServiceToken('fps.asset.resource.resolver');
|
|
5
|
+
export function createFpsAssetResourceResolver(source) {
|
|
6
|
+
return createPlayableAssetResourceResolver(source.catalog);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,GAGpC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAU9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAwB,0BAA0B,CAAC,CAAC;AACjH,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAgC,6BAA6B,CAAC,CAAC;AAE/H,MAAM,UAAU,8BAA8B,CAAC,MAA6B;IAC1E,OAAO,mCAAmC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import {\n createPlayableAssetResourceResolver,\n type PlayableAssetResourceResolver,\n type PlayableGeneratedAssetCatalogEntry,\n} from '@fps-games/playable-assets';\nimport { defineFpsServiceToken } from '@fps-games/plugin-api';\n\n/**\n * The generated catalog is supplied by the environment Host. The Assets Plugin\n * owns converting it into a resolver; consumers must not build their own index.\n */\nexport interface FpsAssetCatalogSource {\n readonly catalog: Readonly<Record<string, PlayableGeneratedAssetCatalogEntry>>;\n}\n\nexport const FPS_ASSET_CATALOG_SOURCE = defineFpsServiceToken<FpsAssetCatalogSource>('fps.asset.catalog.source');\nexport const FPS_ASSET_RESOURCE_RESOLVER = defineFpsServiceToken<PlayableAssetResourceResolver>('fps.asset.resource.resolver');\n\nexport function createFpsAssetResourceResolver(source: FpsAssetCatalogSource): PlayableAssetResourceResolver {\n return createPlayableAssetResourceResolver(source.catalog);\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FpsRuntimeAsset } from '@fps-games/playable-contracts';
|
|
2
|
+
import { type FpsPluginContext } from '@fps-games/plugin-api';
|
|
2
3
|
export interface FpsRuntimeAssetService {
|
|
3
4
|
readonly assets: readonly FpsRuntimeAsset[];
|
|
4
5
|
readonly byId: ReadonlyMap<string, FpsRuntimeAsset>;
|
|
@@ -7,6 +8,6 @@ export declare const FPS_RUNTIME_ASSETS: import("@fps-games/plugin-api").FpsServ
|
|
|
7
8
|
export declare const pluginEntry: Readonly<{
|
|
8
9
|
pluginId: "fps.plugin.assets";
|
|
9
10
|
environment: "runtime";
|
|
10
|
-
register(context:
|
|
11
|
+
register(context: FpsPluginContext): void;
|
|
11
12
|
}>;
|
|
12
13
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAA+C,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQ3G,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,kBAAkB,yEAAsE,CAAC;AAEtG,eAAO,MAAM,WAAW;;;sBAGJ,gBAAgB;EAalC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createFpsRuntimeAssetsSnapshot, FPS_RUNTIME_DATA } from '@fps-games/playable-runtime-data';
|
|
2
2
|
import { defineFpsPluginEntry, defineFpsServiceToken } from '@fps-games/plugin-api';
|
|
3
3
|
import { FPS_ASSETS_PLUGIN_ID } from './reference.js';
|
|
4
|
+
import { createFpsAssetResourceResolver, FPS_ASSET_CATALOG_SOURCE, FPS_ASSET_RESOURCE_RESOLVER, } from './resources.js';
|
|
4
5
|
export const FPS_RUNTIME_ASSETS = defineFpsServiceToken('fps.runtime.assets');
|
|
5
6
|
export const pluginEntry = defineFpsPluginEntry({
|
|
6
7
|
pluginId: FPS_ASSETS_PLUGIN_ID,
|
|
7
8
|
environment: 'runtime',
|
|
8
9
|
register(context) {
|
|
10
|
+
const resolver = createFpsAssetResourceResolver(context.services.get(FPS_ASSET_CATALOG_SOURCE));
|
|
9
11
|
const assets = createFpsRuntimeAssetsSnapshot(context.services.get(FPS_RUNTIME_DATA).assets);
|
|
10
12
|
const index = new Map();
|
|
11
13
|
for (const asset of assets) {
|
|
@@ -17,6 +19,7 @@ export const pluginEntry = defineFpsPluginEntry({
|
|
|
17
19
|
}
|
|
18
20
|
const byId = createReadonlyMapView(index);
|
|
19
21
|
context.add(context.services.register(FPS_RUNTIME_ASSETS, Object.freeze({ assets, byId })));
|
|
22
|
+
context.add(context.services.register(FPS_ASSET_RESOURCE_RESOLVER, resolver));
|
|
20
23
|
},
|
|
21
24
|
});
|
|
22
25
|
function createReadonlyMapView(source) {
|