@forgeax/engine-assets-runtime 0.1.4 → 0.1.6
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/README.md +442 -175
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/aabb.unit.test.d.ts +2 -0
- package/dist/__tests__/aabb.unit.test.d.ts.map +1 -0
- package/dist/__tests__/artifact-integrity.unit.test.d.ts +2 -0
- package/dist/__tests__/artifact-integrity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/artifact-io.unit.test.d.ts +2 -0
- package/dist/__tests__/artifact-io.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-evidence-sdk.integration.test.d.ts +2 -0
- package/dist/__tests__/asset-evidence-sdk.integration.test.d.ts.map +1 -0
- package/dist/__tests__/asset-evidence.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-evidence.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-kind.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-kind.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-catalog-reconcile.integration.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-catalog-reconcile.integration.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-catalog-reconcile.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-catalog-reconcile.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry-catalog.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry-catalog.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.pack-cache.test.d.ts.map +1 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/asset-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/asset-runtime-error-code-owner.test-d.d.ts +2 -0
- package/dist/__tests__/asset-runtime-error-code-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/catalog-replica.unit.test.d.ts +2 -0
- package/dist/__tests__/catalog-replica.unit.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-source-v2.unit.test.d.ts +2 -0
- package/dist/__tests__/catalog-source-v2.unit.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-source.unit.test.d.ts +2 -0
- package/dist/__tests__/catalog-source.unit.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-subscription-order.unit.test.d.ts +2 -0
- package/dist/__tests__/catalog-subscription-order.unit.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-subscription.unit.test.d.ts +2 -0
- package/dist/__tests__/catalog-subscription.unit.test.d.ts.map +1 -0
- package/dist/__tests__/decode-image-bytes-pass-through.test.d.ts +2 -0
- package/dist/__tests__/decode-image-bytes-pass-through.test.d.ts.map +1 -0
- package/dist/__tests__/decode-image-bytes.browser.test.d.ts +2 -0
- package/dist/__tests__/decode-image-bytes.browser.test.d.ts.map +1 -0
- package/dist/__tests__/decode-image-bytes.test-d.d.ts +2 -0
- package/dist/__tests__/decode-image-bytes.test-d.d.ts.map +1 -0
- package/dist/__tests__/decode-image-bytes.test.d.ts +2 -0
- package/dist/__tests__/decode-image-bytes.test.d.ts.map +1 -0
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts +2 -0
- package/dist/__tests__/dynamic-texture-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors-asset.unit.test.d.ts +2 -0
- package/dist/__tests__/errors-asset.unit.test.d.ts.map +1 -0
- package/dist/__tests__/inline-pack-loaders.unit.test.d.ts +2 -0
- package/dist/__tests__/inline-pack-loaders.unit.test.d.ts.map +1 -0
- package/dist/__tests__/instantiate-context.unit.test.d.ts +2 -0
- package/dist/__tests__/instantiate-context.unit.test.d.ts.map +1 -0
- package/dist/__tests__/instantiate-publication-fence.unit.test.d.ts +2 -0
- package/dist/__tests__/instantiate-publication-fence.unit.test.d.ts.map +1 -0
- package/dist/__tests__/instantiate.unit.test.d.ts +2 -0
- package/dist/__tests__/instantiate.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loader-input-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/loader-input-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/loader-registry.unit.test.d.ts +2 -0
- package/dist/__tests__/loader-registry.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-dependency-invalidation.unit.test.d.ts +2 -0
- package/dist/__tests__/material-dependency-invalidation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-generation-cache.unit.test.d.ts +2 -0
- package/dist/__tests__/material-generation-cache.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-load-consumer.test-d.d.ts +2 -0
- package/dist/__tests__/material-load-consumer.test-d.d.ts.map +1 -0
- package/dist/__tests__/material-ready.integration.test.d.ts +2 -0
- package/dist/__tests__/material-ready.integration.test.d.ts.map +1 -0
- package/dist/__tests__/material-stale-generation.unit.test.d.ts +2 -0
- package/dist/__tests__/material-stale-generation.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin-morph-v3.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin-morph-v3.test.d.ts.map +1 -0
- package/dist/__tests__/mesh-bin.unit.test.d.ts +2 -0
- package/dist/__tests__/mesh-bin.unit.test.d.ts.map +1 -0
- package/dist/__tests__/mipmap-generator.unit.test.d.ts +2 -0
- package/dist/__tests__/mipmap-generator.unit.test.d.ts.map +1 -0
- package/dist/__tests__/pack-artifact-transcode-model-owner.test.d.ts +2 -0
- package/dist/__tests__/pack-artifact-transcode-model-owner.test.d.ts.map +1 -0
- package/dist/__tests__/pack-basis-load.integration.test.d.ts +2 -0
- package/dist/__tests__/pack-basis-load.integration.test.d.ts.map +1 -0
- package/dist/__tests__/payload-validate.unit.test.d.ts +2 -0
- package/dist/__tests__/payload-validate.unit.test.d.ts.map +1 -0
- package/dist/__tests__/plugin.test.d.ts +2 -0
- package/dist/__tests__/plugin.test.d.ts.map +1 -0
- package/dist/__tests__/registry-concurrency.bench.test.d.ts +2 -0
- package/dist/__tests__/registry-concurrency.bench.test.d.ts.map +1 -0
- package/dist/__tests__/registry-failure-retry.integration.test.d.ts +2 -0
- package/dist/__tests__/registry-failure-retry.integration.test.d.ts.map +1 -0
- package/dist/__tests__/registry-load-graph.integration.test.d.ts +2 -0
- package/dist/__tests__/registry-load-graph.integration.test.d.ts.map +1 -0
- package/dist/__tests__/registry-load-state.unit.test.d.ts +2 -0
- package/dist/__tests__/registry-load-state.unit.test.d.ts.map +1 -0
- package/dist/__tests__/registry-package-cache.unit.test.d.ts +2 -0
- package/dist/__tests__/registry-package-cache.unit.test.d.ts.map +1 -0
- package/dist/__tests__/registry-public-ready.unit.test.d.ts +2 -0
- package/dist/__tests__/registry-public-ready.unit.test.d.ts.map +1 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts +2 -0
- package/dist/__tests__/resolve-asset-handle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scene-handle-fields.unit.test.d.ts +2 -0
- package/dist/__tests__/scene-handle-fields.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scene-payload.unit.test.d.ts +2 -0
- package/dist/__tests__/scene-payload.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scene-publication-fence.test.d.ts +2 -0
- package/dist/__tests__/scene-publication-fence.test.d.ts.map +1 -0
- package/dist/__tests__/scriptable-pack-public-surface.test-d.d.ts +2 -0
- package/dist/__tests__/scriptable-pack-public-surface.test-d.d.ts.map +1 -0
- package/dist/__tests__/static-rig.integration.test.d.ts +2 -0
- package/dist/__tests__/static-rig.integration.test.d.ts.map +1 -0
- package/dist/__tests__/validate-material.unit.test.d.ts +2 -0
- package/dist/__tests__/validate-material.unit.test.d.ts.map +1 -0
- package/dist/__tests__/video-pack-loader.integration.test.d.ts +2 -0
- package/dist/__tests__/video-pack-loader.integration.test.d.ts.map +1 -0
- package/dist/aabb.d.ts +3 -0
- package/dist/aabb.d.ts.map +1 -0
- package/dist/asset-registry.d.ts +552 -0
- package/dist/asset-registry.d.ts.map +1 -0
- package/dist/builtin-asset-registry.d.ts +22 -0
- package/dist/builtin-asset-registry.d.ts.map +1 -0
- package/dist/catalog-source.d.ts +2 -1
- package/dist/catalog-source.d.ts.map +1 -1
- package/dist/decode-image-bytes.d.ts +57 -0
- package/dist/decode-image-bytes.d.ts.map +1 -0
- package/dist/dynamic-texture-store.d.ts +89 -0
- package/dist/dynamic-texture-store.d.ts.map +1 -0
- package/dist/errors/asset.d.ts +201 -0
- package/dist/errors/asset.d.ts.map +1 -0
- package/dist/handles.d.ts +141 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/image-error.d.ts +6 -0
- package/dist/image-error.d.ts.map +1 -0
- package/dist/index.d.ts +32 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +7218 -114
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/loader-registry.d.ts +63 -0
- package/dist/loader-registry.d.ts.map +1 -0
- package/dist/loaders/inline-pack.d.ts +72 -0
- package/dist/loaders/inline-pack.d.ts.map +1 -0
- package/dist/loaders/mesh-bin.d.ts +21 -0
- package/dist/loaders/mesh-bin.d.ts.map +1 -0
- package/dist/loaders/pack-artifact.d.ts +20 -0
- package/dist/loaders/pack-artifact.d.ts.map +1 -0
- package/dist/material/dependency-graph.d.ts +9 -0
- package/dist/material/dependency-graph.d.ts.map +1 -0
- package/dist/material/generation-cache.d.ts +24 -0
- package/dist/material/generation-cache.d.ts.map +1 -0
- package/dist/material/inspection.d.ts +24 -0
- package/dist/material/inspection.d.ts.map +1 -0
- package/dist/material/loader.d.ts +59 -0
- package/dist/material/loader.d.ts.map +1 -0
- package/dist/material/runtime-shader.d.ts +14 -0
- package/dist/material/runtime-shader.d.ts.map +1 -0
- package/dist/mesh-bin.d.ts +3 -0
- package/dist/mesh-bin.d.ts.map +1 -0
- package/dist/mipmap-generator.d.ts +132 -0
- package/dist/mipmap-generator.d.ts.map +1 -0
- package/dist/payload-validate.d.ts +60 -0
- package/dist/payload-validate.d.ts.map +1 -0
- package/dist/plugin.d.ts +16 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/registry/artifact-io.d.ts +16 -0
- package/dist/registry/artifact-io.d.ts.map +1 -0
- package/dist/registry/asset-evidence.d.ts +13 -0
- package/dist/registry/asset-evidence.d.ts.map +1 -0
- package/dist/registry/catalog-state.d.ts +47 -0
- package/dist/registry/catalog-state.d.ts.map +1 -0
- package/dist/registry/catalog.d.ts +48 -0
- package/dist/registry/catalog.d.ts.map +1 -0
- package/dist/registry/instantiate.d.ts +153 -0
- package/dist/registry/instantiate.d.ts.map +1 -0
- package/dist/registry/load-by-guid.d.ts +247 -0
- package/dist/registry/load-by-guid.d.ts.map +1 -0
- package/dist/registry/load-state.d.ts +26 -0
- package/dist/registry/load-state.d.ts.map +1 -0
- package/dist/registry/runtime-projection.d.ts +16 -0
- package/dist/registry/runtime-projection.d.ts.map +1 -0
- package/dist/registry/scene-publication-fence.d.ts +38 -0
- package/dist/registry/scene-publication-fence.d.ts.map +1 -0
- package/dist/registry/validate-material.d.ts +77 -0
- package/dist/registry/validate-material.d.ts.map +1 -0
- package/dist/resolve-asset-handle.d.ts +43 -0
- package/dist/resolve-asset-handle.d.ts.map +1 -0
- package/dist/resolve-tileset-runtime.d.ts +23 -0
- package/dist/resolve-tileset-runtime.d.ts.map +1 -0
- package/dist/scene-handle-fields.d.ts +88 -0
- package/dist/scene-handle-fields.d.ts.map +1 -0
- package/dist/scene-payload.d.ts +15 -0
- package/dist/scene-payload.d.ts.map +1 -0
- package/dist/wire-default-loaders.d.ts +29 -0
- package/dist/wire-default-loaders.d.ts.map +1 -0
- package/package.json +22 -9
- package/src/__tests__/aabb.unit.test.ts +97 -0
- package/src/__tests__/artifact-integrity.unit.test.ts +99 -0
- package/src/__tests__/artifact-io.unit.test.ts +127 -0
- package/src/__tests__/asset-evidence-sdk.integration.test.ts +32 -0
- package/src/__tests__/asset-evidence.unit.test.ts +32 -0
- package/src/__tests__/{asset-kind.test.ts → asset-kind.unit.test.ts} +1 -1
- package/src/__tests__/asset-registry-catalog-reconcile.integration.test.ts +74 -0
- package/src/__tests__/asset-registry-catalog-reconcile.unit.test.ts +89 -0
- package/src/__tests__/asset-registry-catalog.unit.test.ts +170 -0
- package/src/__tests__/asset-registry.pack-cache.test.ts +96 -0
- package/src/__tests__/asset-registry.unit.test.ts +511 -0
- package/src/__tests__/asset-runtime-error-code-owner.test-d.ts +63 -0
- package/src/__tests__/catalog-replica.unit.test.ts +196 -0
- package/src/__tests__/catalog-source-v2.unit.test.ts +158 -0
- package/src/__tests__/catalog-source.unit.test.ts +126 -0
- package/src/__tests__/catalog-subscription-order.unit.test.ts +65 -0
- package/src/__tests__/catalog-subscription.unit.test.ts +28 -0
- package/src/__tests__/decode-image-bytes-pass-through.test.ts +34 -0
- package/src/__tests__/decode-image-bytes.browser.test.ts +102 -0
- package/src/__tests__/decode-image-bytes.test-d.ts +108 -0
- package/src/__tests__/decode-image-bytes.test.ts +90 -0
- package/src/__tests__/decode-image-mime-owner.test.ts +2 -5
- package/src/__tests__/dynamic-texture-store.unit.test.ts +115 -0
- package/src/__tests__/errors-asset.unit.test.ts +92 -0
- package/src/__tests__/inline-pack-loaders.unit.test.ts +548 -0
- package/src/__tests__/instantiate-context.unit.test.ts +65 -0
- package/src/__tests__/instantiate-publication-fence.unit.test.ts +158 -0
- package/src/__tests__/instantiate.unit.test.ts +684 -0
- package/src/__tests__/loader-input-contract.unit.test.ts +89 -0
- package/src/__tests__/loader-registry.unit.test.ts +101 -0
- package/src/__tests__/material-dependency-invalidation.unit.test.ts +14 -0
- package/src/__tests__/material-generation-cache.unit.test.ts +46 -0
- package/src/__tests__/material-load-consumer.test-d.ts +42 -0
- package/src/__tests__/material-ready.integration.test.ts +492 -0
- package/src/__tests__/material-stale-generation.unit.test.ts +152 -0
- package/src/__tests__/mesh-bin-morph-v3.test.ts +22 -0
- package/src/__tests__/mesh-bin.unit.test.ts +152 -0
- package/src/__tests__/mipmap-generator.unit.test.ts +202 -0
- package/src/__tests__/pack-artifact-transcode-model-owner.test.ts +32 -0
- package/src/__tests__/pack-basis-load.integration.test.ts +168 -0
- package/src/__tests__/payload-validate.unit.test.ts +285 -0
- package/src/__tests__/plugin.test.ts +55 -0
- package/src/__tests__/registry-concurrency.bench.test.ts +40 -0
- package/src/__tests__/registry-failure-retry.integration.test.ts +69 -0
- package/src/__tests__/registry-load-graph.integration.test.ts +246 -0
- package/src/__tests__/registry-load-state.unit.test.ts +35 -0
- package/src/__tests__/registry-package-cache.unit.test.ts +53 -0
- package/src/__tests__/registry-public-ready.unit.test.ts +38 -0
- package/src/__tests__/resolve-asset-handle.unit.test.ts +238 -0
- package/src/__tests__/scene-handle-fields.unit.test.ts +129 -0
- package/src/__tests__/scene-payload.unit.test.ts +151 -0
- package/src/__tests__/scene-publication-fence.test.ts +129 -0
- package/src/__tests__/scriptable-pack-public-surface.test-d.ts +16 -0
- package/src/__tests__/static-rig.integration.test.ts +8 -0
- package/src/__tests__/validate-material.unit.test.ts +359 -0
- package/src/__tests__/video-pack-loader.integration.test.ts +83 -0
- package/src/aabb.ts +107 -0
- package/src/asset-registry.ts +2040 -0
- package/src/builtin-asset-registry.ts +164 -0
- package/src/catalog-source.ts +14 -70
- package/src/decode-image-bytes.ts +126 -0
- package/src/dynamic-texture-store.ts +234 -0
- package/src/errors/asset.ts +347 -0
- package/src/handles.ts +180 -0
- package/src/image-error.ts +45 -0
- package/src/index.ts +177 -19
- package/src/internal.ts +1 -0
- package/src/loader-registry.ts +157 -0
- package/src/loaders/inline-pack.ts +837 -0
- package/src/loaders/mesh-bin.ts +304 -0
- package/src/loaders/pack-artifact.ts +665 -0
- package/src/material/dependency-graph.ts +46 -0
- package/src/material/generation-cache.ts +177 -0
- package/src/material/inspection.ts +46 -0
- package/src/material/loader.ts +326 -0
- package/src/material/runtime-shader.ts +133 -0
- package/src/mesh-bin.ts +5 -0
- package/src/mipmap-generator.ts +450 -0
- package/src/payload-validate.ts +573 -0
- package/src/plugin.ts +48 -0
- package/src/registry/artifact-io.ts +259 -0
- package/src/registry/asset-evidence.ts +51 -0
- package/src/registry/catalog-state.ts +409 -0
- package/src/registry/catalog.ts +369 -0
- package/src/registry/instantiate.ts +1056 -0
- package/src/registry/load-by-guid.ts +1657 -0
- package/src/registry/load-state.ts +115 -0
- package/src/registry/runtime-projection.ts +63 -0
- package/src/registry/scene-publication-fence.ts +256 -0
- package/src/registry/validate-material.ts +386 -0
- package/src/resolve-asset-handle.ts +147 -0
- package/src/resolve-tileset-runtime.ts +72 -0
- package/src/scene-handle-fields.ts +221 -0
- package/src/scene-payload.ts +207 -0
- package/src/wire-default-loaders.ts +79 -0
- package/dist/__tests__/asset-graph-red.integration.test.d.ts +0 -2
- package/dist/__tests__/asset-graph-red.integration.test.d.ts.map +0 -1
- package/dist/__tests__/asset-kind.test.d.ts +0 -2
- package/dist/__tests__/asset-kind.test.d.ts.map +0 -1
- package/dist/__tests__/asset-registry-core.integration.test.d.ts +0 -2
- package/dist/__tests__/asset-registry-core.integration.test.d.ts.map +0 -1
- package/dist/__tests__/asset-registry-public-api.test-d.d.ts +0 -2
- package/dist/__tests__/asset-registry-public-api.test-d.d.ts.map +0 -1
- package/dist/__tests__/asset-runtime-core-lifecycle.integration.test.d.ts +0 -2
- package/dist/__tests__/asset-runtime-core-lifecycle.integration.test.d.ts.map +0 -1
- package/dist/__tests__/asset-runtime-snapshot.unit.test.d.ts +0 -2
- package/dist/__tests__/asset-runtime-snapshot.unit.test.d.ts.map +0 -1
- package/dist/__tests__/catalog-session-red.unit.test.d.ts +0 -2
- package/dist/__tests__/catalog-session-red.unit.test.d.ts.map +0 -1
- package/dist/__tests__/registry-lifecycle-red.integration.test.d.ts +0 -2
- package/dist/__tests__/registry-lifecycle-red.integration.test.d.ts.map +0 -1
- package/src/__tests__/asset-graph-red.integration.test.ts +0 -113
- package/src/__tests__/asset-registry-core.integration.test.ts +0 -161
- package/src/__tests__/asset-registry-public-api.test-d.ts +0 -31
- package/src/__tests__/asset-runtime-core-lifecycle.integration.test.ts +0 -79
- package/src/__tests__/asset-runtime-snapshot.unit.test.ts +0 -23
- package/src/__tests__/catalog-session-red.unit.test.ts +0 -276
- package/src/__tests__/registry-lifecycle-red.integration.test.ts +0 -80
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
import type { Component, EcsError, EntityHandle, World } from '@forgeax/engine-ecs';
|
|
2
|
+
import type { PackError } from '@forgeax/engine-pack/errors';
|
|
3
|
+
import { AssetGuid } from '@forgeax/engine-pack/guid';
|
|
4
|
+
import { type Result, type RhiError } from '@forgeax/engine-rhi';
|
|
5
|
+
import type { ShaderRegistry } from '@forgeax/engine-shader';
|
|
6
|
+
import { type Asset, type AssetEnvelope, AssetError, type AssetEvidence, type AssetEvidenceError, type AssetRef, type CatalogEntry, type EngineMetrics, type Handle, type ImageError, type ImportTransport, type InspectSnapshot, type Loader, type Package, type ParseErrorDetail, type RuntimeAssetBinding, type SceneAsset, type TagOf, type TranscodeCaps, type MeshAsset as TypesMeshAsset } from '@forgeax/engine-types';
|
|
7
|
+
import type { LoaderRegistry } from './loader-registry';
|
|
8
|
+
import type { CatalogListener, CatalogSource } from './catalog-source';
|
|
9
|
+
import type { MaterialLoadError, MaterialReady } from './material/loader';
|
|
10
|
+
import { ArtifactReadCache } from './registry/artifact-io';
|
|
11
|
+
import { type RuntimeEvidenceSource } from './registry/asset-evidence';
|
|
12
|
+
import { type CatalogRecord } from './registry/catalog';
|
|
13
|
+
import { type CatalogReplicaSnapshot } from './registry/catalog-state';
|
|
14
|
+
import { type PostSpawnHook } from './registry/instantiate';
|
|
15
|
+
import { LoadStateStore } from './registry/load-state';
|
|
16
|
+
import type { ScenePublicationFence, ScenePublicationFenceError } from './registry/scene-publication-fence';
|
|
17
|
+
export { HANDLE_CUBE, HANDLE_CYLINDER, HANDLE_NINESLICE_QUAD, HANDLE_QUAD, HANDLE_SPHERE, HANDLE_TRIANGLE, } from './handles';
|
|
18
|
+
export { animationClipLoader, animationGraphLoader, INLINE_PACK_LOADERS, materialLoader, meshLoader, sceneLoader, skeletonLoader, skinLoader, } from './loaders/inline-pack';
|
|
19
|
+
export { equirectLoader, fontLoader, PACK_ARTIFACT_LOADERS, textureLoader, } from './loaders/pack-artifact';
|
|
20
|
+
export { type TilesetValidateOptions, validateTilesetPayload } from './payload-validate';
|
|
21
|
+
export type { Asset, TypesMeshAsset as MeshAsset };
|
|
22
|
+
/**
|
|
23
|
+
* Asset registry (instance-per-engine; `engine.assets: AssetRegistry | null`).
|
|
24
|
+
*
|
|
25
|
+
* The builtin meshes (`HANDLE_CUBE` / `HANDLE_TRIANGLE` / ...) are served by
|
|
26
|
+
* the process-static `BuiltinAssetRegistry`, so AI users see usable handles in
|
|
27
|
+
* the very first frame without registration ceremony (charter proposition 1).
|
|
28
|
+
*
|
|
29
|
+
* @example Catalogue a texture by GUID, load its payload, and bind a material:
|
|
30
|
+
* ```ts
|
|
31
|
+
* const guid = engine.assets.parseGuid('00000000-0000-7000-8000-000000000001');
|
|
32
|
+
* engine.assets.catalog(guid, myTexture); // GUID -> payload
|
|
33
|
+
* const res = await engine.assets.loadByGuid(guid); // payload (D-17)
|
|
34
|
+
* if (!res.ok) {
|
|
35
|
+
* switch (res.error.code) {
|
|
36
|
+
* case 'asset-not-found': // guid not catalogued
|
|
37
|
+
* }
|
|
38
|
+
* return;
|
|
39
|
+
* }
|
|
40
|
+
* const material = world.allocSharedRef('MaterialAsset', { // mint column handle
|
|
41
|
+
* kind: 'material',
|
|
42
|
+
* passes: [{ name: 'Forward', program: { module: 'forgeax::default-standard-pbr' }, tags: { LightMode: 'Forward' }, queue: 2000 }],
|
|
43
|
+
* values: { baseColorTexture: res.value },
|
|
44
|
+
* });
|
|
45
|
+
* world.spawn({ component: MeshRenderer, data: { materials: [material] } });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export interface ParsedPackFile {
|
|
49
|
+
schemaVersion?: string;
|
|
50
|
+
kind?: string;
|
|
51
|
+
assets: Array<{
|
|
52
|
+
guid: string;
|
|
53
|
+
kind: string;
|
|
54
|
+
payload: Record<string, unknown>;
|
|
55
|
+
refs?: string[];
|
|
56
|
+
artifacts?: Record<string, import('@forgeax/engine-types').ArtifactDescriptor>;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
59
|
+
export type CatalogReconcileError = AssetError;
|
|
60
|
+
export type CatalogReconcileResult = Result<CatalogReplicaSnapshot, CatalogReconcileError>;
|
|
61
|
+
export declare class AssetRegistry {
|
|
62
|
+
readonly shaderRegistry: ShaderRegistry;
|
|
63
|
+
private catalogSource;
|
|
64
|
+
private catalogEnumerating;
|
|
65
|
+
private readonly catalogListeners;
|
|
66
|
+
private catalogSourceDispose;
|
|
67
|
+
private catalogReplica;
|
|
68
|
+
readonly assetCatalog: Map<string, AssetEnvelope<Asset>>;
|
|
69
|
+
/** Owner-injected component catalog used for scene breadcrumb projection. */
|
|
70
|
+
readonly componentCatalog: ReadonlyMap<string, Component>;
|
|
71
|
+
private readonly packages;
|
|
72
|
+
private readonly packageByPath;
|
|
73
|
+
private readonly pendingNames;
|
|
74
|
+
packIndexUrl: string | undefined;
|
|
75
|
+
packIndexCache: Map<string, CatalogRecord> | undefined;
|
|
76
|
+
/** Current browser-facing asset realm; absent for inline/shipped legacy use. */
|
|
77
|
+
runtimeBinding: RuntimeAssetBinding | undefined;
|
|
78
|
+
readonly inFlight: Map<string, Promise<Result<unknown, AssetError | ImageError | RhiError>>>;
|
|
79
|
+
readonly packFileCache: Map<string, ParsedPackFile>;
|
|
80
|
+
readonly packFileInFlight: Map<string, Promise<ParsedPackFile>>;
|
|
81
|
+
readonly artifactCache: ArtifactReadCache;
|
|
82
|
+
readonly loadState: LoadStateStore;
|
|
83
|
+
/**
|
|
84
|
+
* Render-facing material readiness owned by the production GUID loader.
|
|
85
|
+
* The map stores the complete tuple result, including structured failures,
|
|
86
|
+
* so record code cannot silently fall back to a generic MaterialAsset.
|
|
87
|
+
*/
|
|
88
|
+
readonly materialReadiness: Map<string, MaterialReady | MaterialLoadError>;
|
|
89
|
+
private assetEvidenceAdapter;
|
|
90
|
+
readonly generations: Map<string, number>;
|
|
91
|
+
globalGeneration: number;
|
|
92
|
+
/**
|
|
93
|
+
* Monotonic payload-cache epoch. Render-side derived snapshots use this
|
|
94
|
+
* single stamp to skip re-walking an unchanged material parent chain on
|
|
95
|
+
* every frame; catalog/invalidation mutations advance it conservatively.
|
|
96
|
+
*/
|
|
97
|
+
catalogEpoch: number;
|
|
98
|
+
packIndexCachePatchQueue: Promise<void>;
|
|
99
|
+
metrics: EngineMetrics | null;
|
|
100
|
+
transcodeCaps: TranscodeCaps;
|
|
101
|
+
/** @internal */
|
|
102
|
+
_originIndex: WeakMap<object, string>;
|
|
103
|
+
/**
|
|
104
|
+
* Construct a fresh registry pre-populated with the builtin cube + triangle
|
|
105
|
+
* mesh handles (`HANDLE_CUBE` / `HANDLE_TRIANGLE`).
|
|
106
|
+
*
|
|
107
|
+
* feat-20260514 M3 / w15: the previous optional `RhiDevice` constructor
|
|
108
|
+
* argument (consumed by the now-deleted `createInstancedBuffer` triplet)
|
|
109
|
+
* is removed; the registry surface is engine-agnostic again. Per-entity
|
|
110
|
+
* instance transforms now live inside the ECS `Instances { transforms:
|
|
111
|
+
* 'array<f32>' }` component; the RenderSystem record stage owns GPU
|
|
112
|
+
* storage buffer allocation + cap-gate.
|
|
113
|
+
*/
|
|
114
|
+
readonly loaders: LoaderRegistry;
|
|
115
|
+
readonly importTransport: ImportTransport | undefined;
|
|
116
|
+
readonly postSpawnHook: PostSpawnHook | undefined;
|
|
117
|
+
/** @internal Stored for M2 validation; TS suppressor reference */
|
|
118
|
+
constructor(shaderRegistry: ShaderRegistry, importTransport?: ImportTransport | undefined, extraLoaders?: readonly Loader[] | undefined, postSpawnHook?: PostSpawnHook | undefined, runtimeBinding?: RuntimeAssetBinding | undefined, componentCatalog?: ReadonlyMap<string, Component>);
|
|
119
|
+
/**
|
|
120
|
+
* Restore the engine-owned GUID catalogue after a runtime-realm transition.
|
|
121
|
+
*
|
|
122
|
+
* Builtin meshes are process-static engine assets, not game-owned catalog
|
|
123
|
+
* rows. A realm transition clears the user catalog and load caches, but must
|
|
124
|
+
* leave these assets addressable so a scene in the newly bound game can keep
|
|
125
|
+
* resolving its builtin mesh references.
|
|
126
|
+
*/
|
|
127
|
+
private registerBuiltins;
|
|
128
|
+
/**
|
|
129
|
+
* feat-20260527-sprite-nineslice M4 / w16 prep + w18 (D-5 + D-9): inject the
|
|
130
|
+
* per-Renderer `EngineMetrics` so register-time soft-warns can bump the same
|
|
131
|
+
* counter map the runtime reads through `renderer.metrics.snapshot()`. Called
|
|
132
|
+
* by `createRenderer` after constructing both the registry and the metrics
|
|
133
|
+
* instance; safe to skip in standalone tests (the soft-warn arms simply do
|
|
134
|
+
* not record).
|
|
135
|
+
*/
|
|
136
|
+
setMetrics(metrics: EngineMetrics): void;
|
|
137
|
+
/**
|
|
138
|
+
* feat-20260707 M5 / w33 (D-11): wire the device compression caps used by the
|
|
139
|
+
* Basis texture / equirect transcode arms. `createRenderer` calls this right
|
|
140
|
+
* after construction with `RhiCaps` projected to `TranscodeCaps` (D-8). Left
|
|
141
|
+
* at the all-false default, the loaders transcode to the uncompressed
|
|
142
|
+
* `rgba8unorm` / `rgba16float` fallback (AC-04, section 8 P3).
|
|
143
|
+
*/
|
|
144
|
+
setTranscodeCaps(caps: TranscodeCaps): void;
|
|
145
|
+
/**
|
|
146
|
+
* Inject authoritative runtime evidence without importing CLI or Node policy.
|
|
147
|
+
* `inspect(guid)` and `verifyByGuid(guid)` return the shared state model; an
|
|
148
|
+
* omitted capability remains an explicit structured error, never a pass.
|
|
149
|
+
*/
|
|
150
|
+
configureAssetEvidence(source: RuntimeEvidenceSource): void;
|
|
151
|
+
/**
|
|
152
|
+
* @internal — read the metrics handle for register-time soft-warn paths.
|
|
153
|
+
* Returns `null` when no `createRenderer` wired the registry to a renderer
|
|
154
|
+
* (the standalone-test path; the structured fail-fast branches still fire).
|
|
155
|
+
*/
|
|
156
|
+
_getMetrics(): EngineMetrics | null;
|
|
157
|
+
/**
|
|
158
|
+
* @internal — reverse-lookup: find the GUID key for a catalogued asset
|
|
159
|
+
* payload by identity comparison (===). Returns the GUID string if found,
|
|
160
|
+
* `undefined` otherwise. This is the SSOT for the inline identity scan
|
|
161
|
+
* idiom that previously existed in two places (instantiate sceneGuidKey
|
|
162
|
+
* lookup and resolveSkinAsset skeleton match).
|
|
163
|
+
*
|
|
164
|
+
* Linear scan of the assetCatalog (Map<string, AssetEnvelope>). The O(n)
|
|
165
|
+
* cost is acceptable for save-path frequencies (OOS-2).
|
|
166
|
+
*/
|
|
167
|
+
_guidForAsset(asset: Asset): string | undefined;
|
|
168
|
+
/** Return the production MaterialReady/Error result for one material GUID. */
|
|
169
|
+
getMaterialReadiness(guid: string): MaterialReady | MaterialLoadError | undefined;
|
|
170
|
+
/** Record the canonical result produced by the production material loader. */
|
|
171
|
+
recordMaterialReadiness(guid: string, readiness: MaterialReady | MaterialLoadError): void;
|
|
172
|
+
/**
|
|
173
|
+
* Configure a catalog URL for `loadByGuid`.
|
|
174
|
+
*
|
|
175
|
+
* Call this once during engine initialization with the URL where
|
|
176
|
+
* `pack-index.json` is served (emitted by `@forgeax/engine-vite-plugin-pack`
|
|
177
|
+
* during `vite build`). In a Vite dev host, use `configureRuntimeBinding`
|
|
178
|
+
* instead so the catalog remains bound to its scope and generation. The
|
|
179
|
+
* index is also the canonical base URL for every
|
|
180
|
+
* catalog entry: relative, root-relative, and absolute entry URLs are resolved
|
|
181
|
+
* against it before the registry fetches a pack body. After configuration,
|
|
182
|
+
* `loadByGuid` will fetch the catalog on its first invocation and cache it for
|
|
183
|
+
* subsequent calls.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* engine.assets.configurePackIndex('/pack-index.json');
|
|
188
|
+
* const payloadRes = await engine.assets.loadByGuid(guid); // payload, not a handle (D-17)
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
configurePackIndex(url: string): void;
|
|
192
|
+
/**
|
|
193
|
+
* Atomically replace the browser-side asset realm. The binding owns the
|
|
194
|
+
* catalog URL and generation; no cache from the previous game survives the
|
|
195
|
+
* transition.
|
|
196
|
+
*/
|
|
197
|
+
configureRuntimeBinding(binding: RuntimeAssetBinding): void;
|
|
198
|
+
/**
|
|
199
|
+
* feat-20260621 F17c: invalidate a single cached asset by GUID so the next
|
|
200
|
+
* `loadByGuid` performs a genuinely fresh fetch. Clears, for this GUID only:
|
|
201
|
+
* the catalogue entry, the in-flight dedup entry, the cached pack-file body
|
|
202
|
+
* (keyed by the index entry's packageUrl), and the pack-index entry. Then
|
|
203
|
+
* increments the per-GUID generation counter so any still in-flight Promise
|
|
204
|
+
* for this GUID discards its result (returns `asset-invalidated`). The body +
|
|
205
|
+
* index clears are targeted (other GUIDs' cached bodies and index entries
|
|
206
|
+
* survive); deleting the index entry forces `resolveCatalogEntry` to re-fetch
|
|
207
|
+
* the pack-index on the next load, re-resolving the packageUrl whose body
|
|
208
|
+
* cache was just dropped. No-op when the GUID is not catalogued.
|
|
209
|
+
*
|
|
210
|
+
* Does NOT touch `packages` (a re-load's registerPackage overwrites them; D-8)
|
|
211
|
+
* and does NOT trigger GPU resource release (OOS-1,
|
|
212
|
+
* q1 boundary: the asset is CPU-only; GPU resources follow the ECS).
|
|
213
|
+
*
|
|
214
|
+
* @param guid - Case-insensitive GUID string or AssetGuid.
|
|
215
|
+
*/
|
|
216
|
+
invalidate(guid: string): void;
|
|
217
|
+
/**
|
|
218
|
+
* Adopt freshly loaded Mesh material slots into an object that is already
|
|
219
|
+
* pinned by live World shared refs. Geometry and GPU-backed fields deliberately
|
|
220
|
+
* remain untouched: this primitive is only for a default-material source
|
|
221
|
+
* override, never a general Mesh reimport. This is the atomic cutover: Catalog,
|
|
222
|
+
* Ready load state, and payload-to-GUID provenance must all name the same
|
|
223
|
+
* object after the call. Call only after invalidate(guid) + loadByGuid(guid)
|
|
224
|
+
* has completed successfully.
|
|
225
|
+
*/
|
|
226
|
+
adoptReloadedMeshMaterialSlots(guid: string, livePayload: Asset): Result<Asset, AssetError>;
|
|
227
|
+
/**
|
|
228
|
+
* feat-20260621 F17c: invalidate ALL cached assets so the next `loadByGuid`
|
|
229
|
+
* re-fetches both the pack-index and the asset body. Clears assetCatalog,
|
|
230
|
+
* inFlight, and packFileCache (wholesale), and resets packIndexCache to
|
|
231
|
+
* `undefined` (NOT `.clear()` -- an empty Map would short-circuit
|
|
232
|
+
* `resolveCatalogEntry`'s `=== undefined` re-fetch guard and serve
|
|
233
|
+
* asset-not-imported for every later load; undefined forces a fresh
|
|
234
|
+
* fetchPackIndex). Then increments a single globalGeneration counter so every
|
|
235
|
+
* in-flight Promise (regardless of GUID) discards its result. Returns the
|
|
236
|
+
* number of assets that were catalogued before the call.
|
|
237
|
+
*
|
|
238
|
+
* Idempotent: second call on an already-empty catalogue returns clearedCount 0
|
|
239
|
+
* (AC-06). Does NOT trigger GPU resource release (OOS-1).
|
|
240
|
+
*/
|
|
241
|
+
invalidateAll(): {
|
|
242
|
+
clearedCount: number;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Force a re-fetch of the configured pack-index NOW and repopulate the cache,
|
|
246
|
+
* so a synchronous `listCatalog()` immediately reflects assets added on disk
|
|
247
|
+
* since boot (a freshly imported GLB's sub-assets). `loadByGuid`'s lazy
|
|
248
|
+
* re-fetch only fires on a per-GUID miss and `invalidateAll()` merely clears
|
|
249
|
+
* the cache (leaving `listCatalog()` empty until the next load), so neither
|
|
250
|
+
* makes a Content Browser or `loadByGuid`-driven "Add to Scene" see a new
|
|
251
|
+
* asset without a page reload. This does.
|
|
252
|
+
*
|
|
253
|
+
* No-op (returns false) when no pack-index URL is configured (dev inline
|
|
254
|
+
* catalogue path) or the fetch fails — callers keep the stale cache rather
|
|
255
|
+
* than blanking it. Returns true when the cache was repopulated.
|
|
256
|
+
*/
|
|
257
|
+
refreshCatalog(): Promise<boolean>;
|
|
258
|
+
setCatalogSource(source: CatalogSource): void;
|
|
259
|
+
/** Stop the catalog transport and remove its replica without clearing payload caches. */
|
|
260
|
+
clearCatalogSource(): void;
|
|
261
|
+
enumerateCatalog(): Promise<Result<readonly CatalogEntry[], AssetError>>;
|
|
262
|
+
/** Read the immutable catalog projection folded by this registry. */
|
|
263
|
+
catalogSnapshot(): CatalogReplicaSnapshot | undefined;
|
|
264
|
+
/** Explicitly recover the registry's single catalog replica from its configured source. */
|
|
265
|
+
reconcileCatalog(): Promise<CatalogReconcileResult>;
|
|
266
|
+
subscribeCatalog(listener: CatalogListener): () => void;
|
|
267
|
+
/**
|
|
268
|
+
* Materialise a `SceneAsset` into an existing `World` and return the
|
|
269
|
+
* synthetic root `Entity` (feat-20260514 w31 sugar wrapper; AC-03 +
|
|
270
|
+
* requirements §IN-3; M3: returns Entity not SceneInstanceId).
|
|
271
|
+
*
|
|
272
|
+
* Before spawning, handle-type component fields (e.g. `assetHandle`,
|
|
273
|
+
* `material`, `skeleton`) containing GUID strings are resolved to fresh
|
|
274
|
+
* user-tier `Handle` numbers via `world.allocSharedRef` (feat-20260614 M8
|
|
275
|
+
* D-19 instantiate-time GUID->handle mint; supersedes the pre-D-17
|
|
276
|
+
* `resolveGuid` map). GUIDs that fail to parse or are not catalogued return
|
|
277
|
+
* `AssetError(code='asset-not-found')` with a hint containing the GUID,
|
|
278
|
+
* node localId, and field name.
|
|
279
|
+
*
|
|
280
|
+
* Errors propagate verbatim through the closed
|
|
281
|
+
* `AssetError | PackError | EcsError` union so AI users that already
|
|
282
|
+
* narrow `loadByGuid<SceneAsset>` results reuse the same `switch
|
|
283
|
+
* (err.code)` exhaustively (charter proposition 3 machine-readable
|
|
284
|
+
* union; plan-strategy §3.3 closed-union transparency).
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```ts
|
|
288
|
+
* const sceneRes = await engine.assets.loadByGuid<SceneAsset>(roomGuid); // payload (D-17)
|
|
289
|
+
* if (!sceneRes.ok) return;
|
|
290
|
+
* const handle = world.allocSharedRef('SceneAsset', sceneRes.value); // mint column handle
|
|
291
|
+
* const r = engine.assets.instantiate(handle, world);
|
|
292
|
+
* if (!r.ok) {
|
|
293
|
+
* switch (r.error.code) {
|
|
294
|
+
* case 'asset-not-found':
|
|
295
|
+
* case 'pack-cyclic-reference':
|
|
296
|
+
* // ... AssetErrorCode | PackErrorCode | EcsErrorCode exhaustive
|
|
297
|
+
* }
|
|
298
|
+
* }
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
instantiate<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World, parent?: EntityHandle): Result<EntityHandle, AssetError | PackError | EcsError>;
|
|
302
|
+
instantiateWithPublicationFence<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World, parent: EntityHandle | undefined, expectedPublication: ScenePublicationFence): Result<EntityHandle, AssetError | PackError | EcsError | ScenePublicationFenceError>;
|
|
303
|
+
/**
|
|
304
|
+
* Materialise a `SceneAsset` FLAT into an existing `World` — the "open a scene
|
|
305
|
+
* for authoring" registry entry (#655): NO synthetic SceneInstance root, NO
|
|
306
|
+
* forced `ChildOf` on top-level members. Returns the top-level entity handles.
|
|
307
|
+
* Nested prefabs (`mounts[]`) still materialise as their own SceneInstance
|
|
308
|
+
* anchors. Use {@link instantiate} (anchor) at runtime / Play and for nested
|
|
309
|
+
* prefabs.
|
|
310
|
+
*/
|
|
311
|
+
instantiateFlat<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World): Result<EntityHandle[], AssetError | PackError | EcsError>;
|
|
312
|
+
instantiateFlatWithPublicationFence<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World, expectedPublication: ScenePublicationFence): Result<EntityHandle[], AssetError | PackError | EcsError | ScenePublicationFenceError>;
|
|
313
|
+
private sceneMeshGuidBySlot;
|
|
314
|
+
private migrateLegacySceneMaterialOverrides;
|
|
315
|
+
private preflightSceneMaterialGraph;
|
|
316
|
+
/**
|
|
317
|
+
* @internal
|
|
318
|
+
* Transform a SceneAsset whose handle-type component fields hold GUID
|
|
319
|
+
* strings (post-parseScenePayload intermediate state) into a copy whose
|
|
320
|
+
* handle fields hold resolved Handle numbers.
|
|
321
|
+
*
|
|
322
|
+
* Schema-driven field detection (plan-strategy D-4): for each component
|
|
323
|
+
* field whose Component.schema fieldType starts with `shared\<`, the
|
|
324
|
+
* value is treated as a GUID string and resolved via `AssetGuid.parse` +
|
|
325
|
+
* catalogue lookup + `world.internSharedRef` (feat-20260614 M8 D-15/D-17;
|
|
326
|
+
* the registry mints nothing). Unknown component names are silently passed
|
|
327
|
+
* through (the ecs layer's additionalProperties check will catch unknowns at
|
|
328
|
+
* spawn if appropriate).
|
|
329
|
+
*
|
|
330
|
+
* Stop-on-first-error (AC-08): the first unresolvable GUID aborts
|
|
331
|
+
* iteration and returns `AssetError(code='asset-not-found')` with a hint
|
|
332
|
+
* containing the GUID string, node localId, and field name for AI-user
|
|
333
|
+
* debuggability (P3).
|
|
334
|
+
*/
|
|
335
|
+
_resolveSceneGuids(scene: SceneAsset, world: World, sceneGuidKey?: string, _visitedMountGuids?: Set<string>, _guidToHandle?: Map<string, number>, _resolvedSceneHandles?: Map<string, number>, _materialGraphPreflighted?: boolean): Result<SceneAsset, AssetError>;
|
|
336
|
+
/**
|
|
337
|
+
* Register an asset and return a fresh
|
|
338
|
+
* `Result<Handle<TagOf<T>, 'shared'>, AssetError>`. The brand `target`
|
|
339
|
+
* tag is derived from the Asset's `kind` discriminator via `AssetTagMap`
|
|
340
|
+
* (charter F1 single-entry indexability). The runtime representation is
|
|
341
|
+
* an auto-incrementing u32 starting at 1024 (builtins reserve 1-2).
|
|
342
|
+
*
|
|
343
|
+
* feat-20260526 M4: `shadingModel` field is retired in favour of
|
|
344
|
+
* pass-based MaterialAsset. This generic surface covers the full
|
|
345
|
+
* `Asset` closed union (mesh / texture / sampler / scene / equirect
|
|
346
|
+
* / material).
|
|
347
|
+
*/
|
|
348
|
+
/**
|
|
349
|
+
* feat-20260614 M8 (D-15 / D-17): catalogue a payload under its GUID.
|
|
350
|
+
* Replaces the old `register` / `registerWithGuid` mint pair -- the registry
|
|
351
|
+
* stores the PAYLOAD and never produces a handle (it owns no World).
|
|
352
|
+
* Column minting is the caller's job via `world.allocSharedRef`.
|
|
353
|
+
*
|
|
354
|
+
* Validates mesh stride + material passes / sprite slices at catalogue entry
|
|
355
|
+
* (same fail-fast surface as the old register path). Returns
|
|
356
|
+
* `Result.err(AssetError)` on validation failure; `Result.ok(payload)` with
|
|
357
|
+
* the stored payload (mesh payloads gain an `aabb`) on success.
|
|
358
|
+
*/
|
|
359
|
+
catalog<T = Asset>(guid: AssetGuid | string, asset: T, refs?: readonly AssetRef[]): Result<T, AssetError>;
|
|
360
|
+
/**
|
|
361
|
+
* @internal feat-20260618-asset-and-pack-name-fields M3 (D-1): the single
|
|
362
|
+
* package-mapping write primitive. All three registration entry points funnel
|
|
363
|
+
* here so the XOR name invariant is implemented once (#1 SSOT):
|
|
364
|
+
* - catalog() inline path -> registerPackage(null, [guid]) (no package)
|
|
365
|
+
* - loadByGuid disk path -> registerPackage(packageUrl, [g1,g2,...], names)
|
|
366
|
+
* - constructor builtin -> registerPackage(null, [...guids]) (D-5 null)
|
|
367
|
+
*
|
|
368
|
+
* `path === null` registers the GUIDs with no package (resolveName reads their
|
|
369
|
+
* storedName or returns ''). A non-null `path` finds-or-creates the shared
|
|
370
|
+
* MutablePackage for that path and adds the GUIDs to it; per-GUID entry names
|
|
371
|
+
* (D-2: name flows entry -> Package, never the payload) are taken from
|
|
372
|
+
* `names`. The 1->N promotion branch (D-3) is added by w11. Never throws --
|
|
373
|
+
* it only writes maps; resolution + validation happen in resolveName / rename.
|
|
374
|
+
*/
|
|
375
|
+
_registerPackage(path: string | null, guids: readonly string[], names?: Map<string, string>): void;
|
|
376
|
+
/**
|
|
377
|
+
* Read the per-GUID stored display name (D-6 home: the envelope's `name`
|
|
378
|
+
* field, with `pendingNames` covering the prod-disk ordering where the name is
|
|
379
|
+
* known before the body is catalogued). Single read point for resolveName /
|
|
380
|
+
* the 1->N promotion XOR check.
|
|
381
|
+
*/
|
|
382
|
+
private storedNameFor;
|
|
383
|
+
private hasStoredName;
|
|
384
|
+
/**
|
|
385
|
+
* Write the per-GUID stored display name. When the envelope exists, replace it
|
|
386
|
+
* with one carrying the new `name` (the envelope is immutable; D-6 keeps the
|
|
387
|
+
* payload free of the name). Before the envelope is catalogued (prod disk
|
|
388
|
+
* path), stash on `pendingNames` so catalog() can drain it into the new
|
|
389
|
+
* envelope. `name === undefined` clears the name in both homes.
|
|
390
|
+
*/
|
|
391
|
+
private setStoredName;
|
|
392
|
+
/**
|
|
393
|
+
* Return the `Package` this GUID belongs to, or `null` when the asset has no
|
|
394
|
+
* package (catalog() inline + builtin, D-5), or `undefined` when the GUID was
|
|
395
|
+
* never registered. The returned `Package` is a readonly snapshot whose
|
|
396
|
+
* `assetCount` is derived from the live member set (#2 Derive).
|
|
397
|
+
*/
|
|
398
|
+
packageOf(guid: AssetGuid | string): Package | null | undefined;
|
|
399
|
+
/**
|
|
400
|
+
* Resolve an asset's human-readable display name -- the single source of truth
|
|
401
|
+
* for the two-segment identity's `name` segment (D-6). Every name consumer
|
|
402
|
+
* (inspect / catalog builder / CLI) reads this or the same `deriveAssetName`
|
|
403
|
+
* pure function it delegates to (AC-04); no consumer re-implements the XOR
|
|
404
|
+
* rule. Returns a deterministic fallback rather than throwing on a missing
|
|
405
|
+
* name (AC-15): `basename(path)` for a multi-asset entry that lacks a stored
|
|
406
|
+
* name, or `''` for a no-package asset with no self name (the detectable
|
|
407
|
+
* "genuinely no name" signal, charter P3). An unregistered GUID is treated as
|
|
408
|
+
* the no-package branch.
|
|
409
|
+
*/
|
|
410
|
+
resolveName(guid: AssetGuid | string): string;
|
|
411
|
+
/**
|
|
412
|
+
* Rename an asset's display name in memory (D-4). Three classes by package
|
|
413
|
+
* shape:
|
|
414
|
+
* - no-package asset -> set the stored self name
|
|
415
|
+
* - multi-asset package -> set the entry stored name
|
|
416
|
+
* - single-asset package -> rewrite the package path's leaf segment so the
|
|
417
|
+
* derived basename becomes `newName` (the package
|
|
418
|
+
* stays single-asset; the leaf IS the name)
|
|
419
|
+
*
|
|
420
|
+
* In-memory only (OOS-1: no disk write-back). Returns structured failures via
|
|
421
|
+
* the closed `AssetErrorCode` union with no new members (D-4): a name that
|
|
422
|
+
* collides with another member of the same package -> `asset-invalid-value`;
|
|
423
|
+
* an unregistered GUID -> `asset-not-found`. AI users consume `.code` through
|
|
424
|
+
* a `switch`, not by parsing `.message` (charter P3).
|
|
425
|
+
*/
|
|
426
|
+
rename(guid: AssetGuid | string, newName: string): Result<void, AssetError>;
|
|
427
|
+
/**
|
|
428
|
+
* Return an `asset-invalid-value` AssetError if another member of `pkg`
|
|
429
|
+
* already resolves to `newName`, else null. Extracted from `rename` to keep
|
|
430
|
+
* the collision-detection control flow flat (D-4 reuses the closed error code;
|
|
431
|
+
* the detail narrows via the `{ field, value, reason }` union variant).
|
|
432
|
+
*/
|
|
433
|
+
private nameCollisionIn;
|
|
434
|
+
/**
|
|
435
|
+
* Parse a dash-form GUID string into an `AssetGuid`. Thin convenience over
|
|
436
|
+
* `AssetGuid.parse` for the `loadByGuid` / `catalog` call sites; throws
|
|
437
|
+
* `AssetError` on a malformed GUID (caller-error, mirrors `parseInt`-style
|
|
438
|
+
* eager validation -- the GUID literal is author-supplied, not user data).
|
|
439
|
+
*/
|
|
440
|
+
parseGuid(guidStr: string): AssetGuid;
|
|
441
|
+
/**
|
|
442
|
+
* Look up a catalogued payload by GUID, or `undefined` on miss. Used by the
|
|
443
|
+
* ECS/render side (e.g. `walkMaterialParents` in `resolve-asset-handle.ts`)
|
|
444
|
+
* to resolve a payload's embedded sub-asset GUIDs (D-19) without minting.
|
|
445
|
+
*/
|
|
446
|
+
lookup<T = Asset>(guid: AssetGuid | string): T | undefined;
|
|
447
|
+
/**
|
|
448
|
+
* feat-20260613-material-paramschema-driven-binding M4 / w23 (D-5 graceful):
|
|
449
|
+
* Return the texture-field name set for the given material-shader id,
|
|
450
|
+
* derived from the registered shader's paramSchema via `derive(paramSchema)
|
|
451
|
+
* .textureFieldNames`. Returns `undefined` when the shader is not yet
|
|
452
|
+
* registered (cross-worktree shader-late-register, plan R-4).
|
|
453
|
+
*
|
|
454
|
+
* Used by `extractFrame` to know which values fields the shader
|
|
455
|
+
* declares as texture handles; the extract layer validates handle-vs-
|
|
456
|
+
* scalar typing and drops misclassified slots so the record stage's
|
|
457
|
+
* MISSING_TEXTURE_HANDLE fallback can take over (white default texture)
|
|
458
|
+
* rather than letting a stray handle reach `device.createBindGroup`.
|
|
459
|
+
*
|
|
460
|
+
* feat-20260705-runtime-tier2-decomposition M1 / w5 (D-4): delegates to the
|
|
461
|
+
* extracted `./registry/validate-material` free function (signature stable).
|
|
462
|
+
*/
|
|
463
|
+
materialShaderTextureFieldNames(shaderId: string): ReadonlySet<string> | undefined;
|
|
464
|
+
/**
|
|
465
|
+
* Load an asset and all its transitively referenced sub-assets by GUID.
|
|
466
|
+
* The result is a durable Asset payload. Consumer owners may narrow the
|
|
467
|
+
* success type, then call their own World/Host projection; this registry does
|
|
468
|
+
* not create a generic GUID-to-handle materializer.
|
|
469
|
+
* Delegates to the load-by-guid collaboration module (w7 / D-4); see
|
|
470
|
+
* registry/load-by-guid.ts for the full DDC / pack-fetch pipeline.
|
|
471
|
+
*/
|
|
472
|
+
loadByGuid<T = Asset>(guid: AssetGuid, parentContext?: {
|
|
473
|
+
sceneEntityId?: number;
|
|
474
|
+
componentField?: string;
|
|
475
|
+
}): Promise<Result<T, AssetError | ImageError | RhiError>>;
|
|
476
|
+
/**
|
|
477
|
+
* Dispatch a pack payload through the injected LoaderRegistry. Delegates to
|
|
478
|
+
* the load-by-guid collaboration module (w7 / D-4). Kept as a class method so
|
|
479
|
+
* existing structural-cast test access keeps resolving.
|
|
480
|
+
*/
|
|
481
|
+
parseAssetPayload(kind: string, payload: Record<string, unknown>, refs?: string[]): Asset | Record<string, unknown> | undefined | {
|
|
482
|
+
readonly ok: false;
|
|
483
|
+
readonly error: ParseErrorDetail;
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* Parse a pack asset entry and return the payload + refs. Delegates to the
|
|
487
|
+
* load-by-guid collaboration module (w7 / D-4). Kept as a class method so
|
|
488
|
+
* existing structural-cast test access keeps resolving.
|
|
489
|
+
*/
|
|
490
|
+
parseAndReturnAsset(assetEntry: {
|
|
491
|
+
kind: string;
|
|
492
|
+
payload: Record<string, unknown>;
|
|
493
|
+
refs?: string[];
|
|
494
|
+
}): Result<{
|
|
495
|
+
asset: Asset;
|
|
496
|
+
refs: readonly string[];
|
|
497
|
+
}, AssetError>;
|
|
498
|
+
/** Return the legacy catalog snapshot when no GUID is supplied. */
|
|
499
|
+
inspect(): InspectSnapshot;
|
|
500
|
+
/** Return joined source/cook/package/runtime evidence for one GUID. */
|
|
501
|
+
inspect(guid: string): Promise<Result<AssetEvidence, AssetEvidenceError>>;
|
|
502
|
+
/** Verify the same GUID evidence chain through the injected SDK capability. */
|
|
503
|
+
verifyByGuid(guid: string): Promise<Result<AssetEvidence, AssetEvidenceError>>;
|
|
504
|
+
/**
|
|
505
|
+
* Return a readonly snapshot of all catalogued assets (inlined + pack-index)
|
|
506
|
+
* for enumeration by asset panels (AC-03 single source of truth).
|
|
507
|
+
*
|
|
508
|
+
* Merges entries from the private `packIndexCache` (prod path, carries
|
|
509
|
+
* `packageUrl`) and `assetCatalog` (inlined / dev path, no URL). Each
|
|
510
|
+
* GUID appears exactly once. Returns a fresh array on every call — the
|
|
511
|
+
* internal Maps are never exposed (charter P4 consistent abstraction).
|
|
512
|
+
*
|
|
513
|
+
* plan-strategy section 2 D1; requirements AC-03; research Finding 5.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```ts
|
|
517
|
+
* for (const e of registry.listCatalog()) {
|
|
518
|
+
* console.log(e.guid, e.kind, e.name, e.packageUrl);
|
|
519
|
+
* }
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
listCatalog(): readonly {
|
|
523
|
+
guid: string;
|
|
524
|
+
kind: string;
|
|
525
|
+
name?: string;
|
|
526
|
+
packageUrl: string;
|
|
527
|
+
packageId?: CatalogEntry['packageId'];
|
|
528
|
+
provenance?: CatalogEntry['provenance'];
|
|
529
|
+
revision?: CatalogEntry['revision'];
|
|
530
|
+
sourceKey?: CatalogEntry['sourceKey'];
|
|
531
|
+
sourceIndex?: CatalogEntry['sourceIndex'];
|
|
532
|
+
sourceOverrides?: CatalogEntry['sourceOverrides'];
|
|
533
|
+
sourceOverrideDescriptors?: CatalogEntry['sourceOverrideDescriptors'];
|
|
534
|
+
authoring?: CatalogEntry['authoring'];
|
|
535
|
+
relations?: CatalogEntry['relations'];
|
|
536
|
+
diagnostics?: CatalogEntry['diagnostics'];
|
|
537
|
+
refs?: readonly string[];
|
|
538
|
+
subject?: import('@forgeax/engine-types').CatalogSubject;
|
|
539
|
+
execution?: import('@forgeax/engine-types').CookExecution;
|
|
540
|
+
lifecycle?: import('@forgeax/engine-types').CatalogLifecycle;
|
|
541
|
+
projection?: import('@forgeax/engine-types').CatalogProjection;
|
|
542
|
+
/**
|
|
543
|
+
* On-disk source-file path for external imported assets (FBX / GLB / HDR /
|
|
544
|
+
* audio / font), relative to the game root. Editors locate the
|
|
545
|
+
* `.meta.json` sidecar via `sourcePath + '.meta.json'` for CRUD; unlike
|
|
546
|
+
* `packageUrl` (the runtime load artefact) it is stable across DDC cook
|
|
547
|
+
* state. `undefined` for inline / dev-path assets (no sidecar, no CRUD).
|
|
548
|
+
*/
|
|
549
|
+
sourcePath?: string;
|
|
550
|
+
}[];
|
|
551
|
+
}
|
|
552
|
+
//# sourceMappingURL=asset-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-registry.d.ts","sourceRoot":"","sources":["../src/asset-registry.ts"],"names":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AAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtC,UAAU,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;QACxC,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtC,WAAW,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;QAC1C,eAAe,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;QAClD,yBAAyB,CAAC,EAAE,YAAY,CAAC,2BAA2B,CAAC,CAAC;QACtE,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtC,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtC,WAAW,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,EAAE,OAAO,uBAAuB,EAAE,cAAc,CAAC;QACzD,SAAS,CAAC,EAAE,OAAO,uBAAuB,EAAE,aAAa,CAAC;QAC1D,SAAS,CAAC,EAAE,OAAO,uBAAuB,EAAE,gBAAgB,CAAC;QAC7D,UAAU,CAAC,EAAE,OAAO,uBAAuB,EAAE,iBAAiB,CAAC;QAC/D;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,EAAE;CA4FJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Handle, MeshAsset as TypesMeshAsset } from '@forgeax/engine-types';
|
|
2
|
+
import { BUILTIN_BASE } from '@forgeax/engine-types';
|
|
3
|
+
export { BUILTIN_BASE };
|
|
4
|
+
export declare const BUILTIN_CUBE: TypesMeshAsset;
|
|
5
|
+
export declare const BUILTIN_TRIANGLE: TypesMeshAsset;
|
|
6
|
+
export declare const BUILTIN_QUAD: TypesMeshAsset;
|
|
7
|
+
export declare const BUILTIN_SPHERE: TypesMeshAsset;
|
|
8
|
+
export declare const BUILTIN_CYLINDER: TypesMeshAsset;
|
|
9
|
+
export declare const BUILTIN_NINESLICE_QUAD: TypesMeshAsset;
|
|
10
|
+
/**
|
|
11
|
+
* Process-static builtin asset resolver (D-15). `resolve(handle)` returns the
|
|
12
|
+
* frozen builtin payload when `slot < BUILTIN_BASE`, else `null` (the slot
|
|
13
|
+
* belongs to the user tier — resolve it through `world.sharedRefs.resolve`).
|
|
14
|
+
*
|
|
15
|
+
* Read-only: there is no register / mint surface. The five builtin payloads
|
|
16
|
+
* are fixed at module load. AI users `import { BuiltinAssetRegistry } from
|
|
17
|
+
* '@forgeax/engine-runtime'` and resolve a builtin handle without a World.
|
|
18
|
+
*/
|
|
19
|
+
export declare const BuiltinAssetRegistry: Readonly<{
|
|
20
|
+
resolve<T extends TypesMeshAsset>(handle: Handle<string, "shared">): T | null;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=builtin-asset-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-asset-registry.d.ts","sourceRoot":"","sources":["../src/builtin-asset-registry.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAc,MAAM,uBAAuB,CAAC;AAMjE,OAAO,EAAE,YAAY,EAAE,CAAC;AAmBxB,eAAO,MAAM,YAAY,EAAE,cAAoD,CAAC;AAmBhF,eAAO,MAAM,gBAAgB,EAAE,cAAwD,CAAC;AAiBxF,eAAO,MAAM,YAAY,EAAE,cAAoD,CAAC;AAchF,eAAO,MAAM,cAAc,EAAE,cAAsD,CAAC;AAgBpF,eAAO,MAAM,gBAAgB,EAAE,cAAwD,CAAC;AAexF,eAAO,MAAM,sBAAsB,EAAE,cAA6D,CAAC;AAanG;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;YACvB,CAAC,SAAS,cAAc,UAAU,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI;EAM7E,CAAC"}
|
package/dist/catalog-source.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Result } from '@forgeax/engine-rhi';
|
|
2
|
+
import { AssetError, type CatalogDelta, type CatalogEntry, type ResourceRevision, type RuntimeAssetBinding } from '@forgeax/engine-types';
|
|
2
3
|
export type CatalogListener = (delta: CatalogDelta) => void;
|
|
3
4
|
/** Read-only catalog source backed by static entries or a canonical URL. */
|
|
4
5
|
export interface CatalogSource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-source.d.ts","sourceRoot":"","sources":["../src/catalog-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"catalog-source.d.ts","sourceRoot":"","sources":["../src/catalog-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAEL,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,YAAY,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IAClE,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,IAAI,CAAC;IACjD,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;CAC9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