@forgeax/engine-assets-runtime 0.1.4 → 0.1.7
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 +453 -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 +554 -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 +143 -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 +7233 -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 +508 -0
- package/src/__tests__/material-stale-generation.unit.test.ts +147 -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 +27 -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 +2045 -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 +186 -0
- package/src/image-error.ts +45 -0
- package/src/index.ts +183 -16
- 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 +385 -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,57 @@
|
|
|
1
|
+
import type { ImageError, Result, TextureAsset } from '@forgeax/engine-types';
|
|
2
|
+
/**
|
|
3
|
+
* Decode a PNG / JPEG byte stream into a `TextureAsset` POD.
|
|
4
|
+
*
|
|
5
|
+
* Runtime SDK entry for AI users who hold image bytes (fetched over the
|
|
6
|
+
* network, embedded as base64, produced by an out-of-tree decoder, etc.) and
|
|
7
|
+
* want to feed them into `world.allocSharedRef('TextureAsset', pod)` +
|
|
8
|
+
* `GpuResourceStore.ensureResident` without the disk-side importer / build
|
|
9
|
+
* pipeline in the loop (charter P1 progressive disclosure: one-step "bytes
|
|
10
|
+
* in, POD out").
|
|
11
|
+
*
|
|
12
|
+
* v1 supports the two universally-decodable mime types: `image/png` and
|
|
13
|
+
* `image/jpeg`. Failure surfaces are all structured via the closed
|
|
14
|
+
* `ImageError` union (`.code` / `.expected` / `.hint` / `.detail`); the
|
|
15
|
+
* function never throws for expected failures (AGENTS.md Error model +
|
|
16
|
+
* charter P3 explicit failure).
|
|
17
|
+
*
|
|
18
|
+
* Error codes possible (subset of the closed `ImageErrorCode` union):
|
|
19
|
+
* - `image-format-unsupported` -- mime not in the v1 whitelist (`detail.actualMime`)
|
|
20
|
+
* - `image-decode-failed` -- decoder rejected the bytes, or the environment
|
|
21
|
+
* lacks `createImageBitmap` (`detail.reason`)
|
|
22
|
+
*
|
|
23
|
+
* @param bytes - Encoded image byte stream (`Uint8Array` or `ArrayBuffer`).
|
|
24
|
+
* @param mime - Byte-stream mime type. v1 whitelist: `'image/png' | 'image/jpeg'`.
|
|
25
|
+
* @param opts - Optional decode overrides:
|
|
26
|
+
* - `colorSpace`: `'srgb'` (default) or `'linear'`. Derives POD `format`:
|
|
27
|
+
* `srgb -> 'rgba8unorm-srgb'`, `linear -> 'rgba8unorm'`.
|
|
28
|
+
* - `mipmap`: `true` (default) or `false`. When true, `mipLevelCount` is
|
|
29
|
+
* computed via `numMipLevels({ width, height })`; when false, forced 1.
|
|
30
|
+
* @returns `ok(TextureAsset)` on success; `err(ImageError)` on failure.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { decodeImageBytes } from '@forgeax/engine-assets-runtime';
|
|
35
|
+
*
|
|
36
|
+
* const bytes = new Uint8Array(await (await fetch(url)).arrayBuffer());
|
|
37
|
+
* const result = await decodeImageBytes(bytes, 'image/png');
|
|
38
|
+
* if (!result.ok) {
|
|
39
|
+
* // The ImageError code and detail are one correlated discriminated union.
|
|
40
|
+
* switch (result.error.code) {
|
|
41
|
+
* case 'image-format-unsupported':
|
|
42
|
+
* console.error('bad mime:', result.error.detail.actualMime);
|
|
43
|
+
* break;
|
|
44
|
+
* case 'image-decode-failed':
|
|
45
|
+
* console.error('decode reason:', result.error.detail.reason);
|
|
46
|
+
* break;
|
|
47
|
+
* }
|
|
48
|
+
* return;
|
|
49
|
+
* }
|
|
50
|
+
* const handle = world.allocSharedRef('TextureAsset', result.value);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function decodeImageBytes(bytes: Uint8Array | ArrayBuffer, mime: string, opts?: {
|
|
54
|
+
colorSpace?: 'srgb' | 'linear';
|
|
55
|
+
mipmap?: boolean;
|
|
56
|
+
}): Promise<Result<TextureAsset, ImageError>>;
|
|
57
|
+
//# sourceMappingURL=decode-image-bytes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-image-bytes.d.ts","sourceRoot":"","sources":["../src/decode-image-bytes.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAa9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9D,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAkC3C"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Result, RhiDevice, RhiError, Texture, TextureView } from '@forgeax/engine-rhi';
|
|
2
|
+
import type { Handle } from '@forgeax/engine-types';
|
|
3
|
+
/**
|
|
4
|
+
* The host-owned external image the engine copies a video frame from
|
|
5
|
+
* (HTMLVideoElement / VideoFrame / ImageBitmap / canvas). Mirrors the `source`
|
|
6
|
+
* member of the WebGPU `GPUCopyExternalImageSourceInfo` the RHI
|
|
7
|
+
* `copyExternalImageToTexture` consumes; aliased here so the store does not pull
|
|
8
|
+
* the whole webgpu descriptor type into its surface.
|
|
9
|
+
*/
|
|
10
|
+
export type CopyExternalImageSource = GPUCopyExternalImageSourceInfo['source'];
|
|
11
|
+
/** rgba8unorm-srgb: a video frame decodes to sRGB; sampling returns linear. */
|
|
12
|
+
declare const VIDEO_TEXTURE_FORMAT: "rgba8unorm-srgb";
|
|
13
|
+
/**
|
|
14
|
+
* The minimal RHI device surface DynamicTextureStore needs. Declared structurally
|
|
15
|
+
* (not the full RhiDevice) so unit tests drive it with a small mock and the store
|
|
16
|
+
* stays decoupled from the rest of the device surface (Pipeline Isolation).
|
|
17
|
+
*/
|
|
18
|
+
export interface DynamicTextureDevice {
|
|
19
|
+
createTexture(desc: {
|
|
20
|
+
readonly size: {
|
|
21
|
+
readonly width: number;
|
|
22
|
+
readonly height: number;
|
|
23
|
+
readonly depthOrArrayLayers: number;
|
|
24
|
+
};
|
|
25
|
+
readonly format: typeof VIDEO_TEXTURE_FORMAT;
|
|
26
|
+
readonly usage: number;
|
|
27
|
+
readonly label?: string;
|
|
28
|
+
}): Result<Texture, RhiError>;
|
|
29
|
+
createTextureView(texture: Texture, desc: Record<string, never>): Result<TextureView, RhiError>;
|
|
30
|
+
destroyTexture(texture: Texture): Result<void, RhiError>;
|
|
31
|
+
readonly queue: {
|
|
32
|
+
copyExternalImageToTexture(source: {
|
|
33
|
+
readonly source: CopyExternalImageSource;
|
|
34
|
+
readonly flipY?: boolean;
|
|
35
|
+
}, destination: {
|
|
36
|
+
readonly texture: Texture;
|
|
37
|
+
}, copySize: {
|
|
38
|
+
readonly width: number;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
readonly depthOrArrayLayers: number;
|
|
41
|
+
}): Result<void, RhiError>;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Adapt the opaque RHI device to the store's intentionally small upload seam. */
|
|
45
|
+
export declare function adaptDynamicTextureDevice(device: RhiDevice): DynamicTextureDevice;
|
|
46
|
+
/**
|
|
47
|
+
* Transient per-frame texture store for video sources. Independent of
|
|
48
|
+
* GpuResourceStore: it neither imports nor reaches into the static residency
|
|
49
|
+
* cache (AC-08 / D-3).
|
|
50
|
+
*/
|
|
51
|
+
export declare class DynamicTextureStore {
|
|
52
|
+
private device;
|
|
53
|
+
private readonly entries;
|
|
54
|
+
/**
|
|
55
|
+
* Wire the GPU device the store uploads through. Called once after the
|
|
56
|
+
* renderer captures its device (mirrors GpuResourceStore.configureGpuDevice).
|
|
57
|
+
* A replacement device invalidates every cached texture: the handles in the
|
|
58
|
+
* map belong to the old device and cannot be reused after renderer recovery.
|
|
59
|
+
*/
|
|
60
|
+
configureGpuDevice(device: DynamicTextureDevice): void;
|
|
61
|
+
/**
|
|
62
|
+
* Upload one video frame for `clip` from the host-owned source image
|
|
63
|
+
* (HTMLVideoElement / VideoFrame / ImageBitmap), (re)allocating the transient
|
|
64
|
+
* texture when its size changes, and return the current-frame view to bind.
|
|
65
|
+
*
|
|
66
|
+
* Returns `undefined` (not an error) when the device is not yet wired or the
|
|
67
|
+
* source has no decodable dimensions yet (metadata pending) — the caller binds
|
|
68
|
+
* the default view that frame. A structured RhiError surfaces only when a wired
|
|
69
|
+
* device rejects the allocation or the copy (charter P3).
|
|
70
|
+
*/
|
|
71
|
+
uploadFrame(clip: Handle<'VideoAsset', 'shared'>, source: CopyExternalImageSource, width: number, height: number): Result<TextureView, RhiError> | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* The current-frame view for a clip, if one has been uploaded this session,
|
|
74
|
+
* else undefined. The record stage reads this when assembling the bind group
|
|
75
|
+
* (a frame that has not uploaded yet falls back to the default view).
|
|
76
|
+
*/
|
|
77
|
+
getView(clip: Handle<'VideoAsset', 'shared'>): TextureView | undefined;
|
|
78
|
+
/** Destroy every transient texture + drop the map (renderer teardown). */
|
|
79
|
+
destroyAll(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Get the entry for `id`, (re)allocating its texture + view when absent or
|
|
82
|
+
* when the source dimensions changed. A same-size re-upload reuses the
|
|
83
|
+
* existing texture (allocate-once for a steady clip; the per-frame cost is the
|
|
84
|
+
* copyExternalImageToTexture write, not a texture create).
|
|
85
|
+
*/
|
|
86
|
+
private ensureEntry;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=dynamic-texture-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-texture-store.d.ts","sourceRoot":"","sources":["../src/dynamic-texture-store.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;AAY/E,+EAA+E;AAC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S,GAAG,oBAAoB,CAiCjF;AASD;;;;GAIG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAA+C;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAE7D;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAOtD;;;;;;;;;OASG;IACH,WAAW,CACT,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,EACpC,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,SAAS;IAmB5C;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,WAAW,GAAG,SAAS;IAItE,0EAA0E;IAC1E,UAAU,IAAI,IAAI;IAQlB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;CA4BpB"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { MeshBinHeaderV4 } from '@forgeax/engine-pack';
|
|
2
|
+
import { AssetError, type AssetMeshBinContractFacts, type AssetMeshBinContractViolationReason } from '@forgeax/engine-types';
|
|
3
|
+
export declare class MeshBinAssetError extends AssetError {
|
|
4
|
+
readonly subject: "mesh-bin";
|
|
5
|
+
readonly sourceKey: string;
|
|
6
|
+
readonly actual: string;
|
|
7
|
+
readonly recovery = "re-cook the source with its Meta sidecar through the build-time importer";
|
|
8
|
+
constructor(args: {
|
|
9
|
+
readonly sourceKey: string;
|
|
10
|
+
readonly expected: string;
|
|
11
|
+
readonly actual: string;
|
|
12
|
+
readonly header?: Partial<MeshBinHeaderV4> & {
|
|
13
|
+
readonly byteLength?: number;
|
|
14
|
+
};
|
|
15
|
+
readonly reason?: AssetMeshBinContractViolationReason;
|
|
16
|
+
readonly expectedFacts?: AssetMeshBinContractFacts;
|
|
17
|
+
readonly actualFacts?: AssetMeshBinContractFacts;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Detail for `RuntimeErrorCode 'material-resolved-empty-passes'`.
|
|
22
|
+
*
|
|
23
|
+
* Emitted at material parent chain walk time when the resolved passes list
|
|
24
|
+
* is empty. Two reasons: `'missing-parent'` (a parent handle is not
|
|
25
|
+
* registered) and `'no-pass-in-chain'` (the entire parent chain has no
|
|
26
|
+
* pass declarations). AI users switch on `.detail.reason` to surface the
|
|
27
|
+
* right recovery guidance.
|
|
28
|
+
*
|
|
29
|
+
* plan-strategy D-2/D-3: empty-passes is a runtime-layer error
|
|
30
|
+
* (RuntimeErrorCode, not AssetErrorCode).
|
|
31
|
+
*/
|
|
32
|
+
export interface MaterialResolvedEmptyPassesDetail {
|
|
33
|
+
/** GUID of the material whose resolve produced empty passes. */
|
|
34
|
+
readonly materialGuid: string;
|
|
35
|
+
/** Root cause of the empty passes: missing parent vs entire chain has no passes. */
|
|
36
|
+
readonly reason: 'missing-parent' | 'no-pass-in-chain';
|
|
37
|
+
/** The raw numeric handle id of the unregistered parent. Only populated when reason='missing-parent'. */
|
|
38
|
+
readonly missingParentHandle?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Structured error for material parent chain resolve yielding zero passes.
|
|
42
|
+
*
|
|
43
|
+
* Emitted by `AssetRegistry.passesOf` when the parent chain walk produces
|
|
44
|
+
* an empty passes list (AC-09, D-3 two-reason). Four-field surface:
|
|
45
|
+
* - `.code = 'material-resolved-empty-passes'` (closed RuntimeErrorCode)
|
|
46
|
+
* - `.expected` — expected-state description
|
|
47
|
+
* - `.hint` — actionable recovery guidance (differs per reason)
|
|
48
|
+
* - `.detail = { materialGuid, reason, missingParentHandle? }`
|
|
49
|
+
*/
|
|
50
|
+
export declare class MaterialResolvedEmptyPassesError extends Error {
|
|
51
|
+
readonly code: "material-resolved-empty-passes";
|
|
52
|
+
readonly expected: string;
|
|
53
|
+
readonly hint: string;
|
|
54
|
+
readonly detail: MaterialResolvedEmptyPassesDetail;
|
|
55
|
+
constructor(materialGuid: string, reason: 'missing-parent' | 'no-pass-in-chain', missingParentHandle?: number);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Detail for `RuntimeErrorCode 'mesh-ssbo-capacity-exceeded'`.
|
|
59
|
+
*
|
|
60
|
+
* Fired by `growMeshSsbo` (createRenderer.ts grow factory) when, after
|
|
61
|
+
* attempting pow2 doubling, the resulting `slotCount` still cannot
|
|
62
|
+
* accommodate the requested `requested` slot count under the device's
|
|
63
|
+
* `maxStorageBufferBindingSize` ceiling. This is a defensive fallback —
|
|
64
|
+
* the primary path for "request past device limit" is
|
|
65
|
+
* `mesh-ssbo-ceiling-reached`. The two codes share the same detail shape so
|
|
66
|
+
* AI users handle both arms identically; the discriminant identifies which
|
|
67
|
+
* branch fired so diagnostics can distinguish the primary vs defensive
|
|
68
|
+
* surface (research §F6.c).
|
|
69
|
+
*
|
|
70
|
+
* - `requested` — slot count requested by the caller (entity count for the frame)
|
|
71
|
+
* - `capacity` — current `slotCount` in the grow controller's state
|
|
72
|
+
* - `ceiling` — `device.limits.maxStorageBufferBindingSize` in BYTES (not slots)
|
|
73
|
+
*/
|
|
74
|
+
export interface MeshSsboCapacityExceededDetail {
|
|
75
|
+
readonly requested: number;
|
|
76
|
+
readonly capacity: number;
|
|
77
|
+
readonly ceiling: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Structured error for the post-grow defensive fallback when mesh-SSBO
|
|
81
|
+
* capacity cannot accommodate the requested slot count.
|
|
82
|
+
*
|
|
83
|
+
* Emitted by `growMeshSsbo` in `createRenderer.ts` (D-5: fire, never
|
|
84
|
+
* throw). Four-field surface aligned with `SkinPaletteOverflowError`:
|
|
85
|
+
* - `.code = 'mesh-ssbo-capacity-exceeded'`
|
|
86
|
+
* - `.expected` — capacity >= requested
|
|
87
|
+
* - `.hint` — reduce per-frame entity count or split work across frames
|
|
88
|
+
* - `.detail = { requested, capacity, ceiling }`
|
|
89
|
+
*/
|
|
90
|
+
export declare class MeshSsboCapacityExceededError extends Error {
|
|
91
|
+
readonly code: "mesh-ssbo-capacity-exceeded";
|
|
92
|
+
readonly expected: string;
|
|
93
|
+
readonly hint: string;
|
|
94
|
+
readonly detail: MeshSsboCapacityExceededDetail;
|
|
95
|
+
constructor(requested: number, capacity: number, ceiling: number);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Detail for `RuntimeErrorCode 'mesh-ssbo-ceiling-reached'`.
|
|
99
|
+
*
|
|
100
|
+
* Fired by `growMeshSsbo` when the requested slot count would exceed the
|
|
101
|
+
* device's `maxStorageBufferBindingSize` (the only ceiling per D-1; engine
|
|
102
|
+
* carries no private capacity constant). Same detail shape as
|
|
103
|
+
* `MeshSsboCapacityExceededDetail`.
|
|
104
|
+
*
|
|
105
|
+
* - `requested` — slot count requested by the caller
|
|
106
|
+
* - `capacity` — current `slotCount` in the grow controller's state
|
|
107
|
+
* - `ceiling` — `device.limits.maxStorageBufferBindingSize` in BYTES
|
|
108
|
+
*/
|
|
109
|
+
export interface MeshSsboCeilingReachedDetail {
|
|
110
|
+
readonly requested: number;
|
|
111
|
+
readonly capacity: number;
|
|
112
|
+
readonly ceiling: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Structured error for mesh-SSBO grow refused because the request exceeds
|
|
116
|
+
* `device.limits.maxStorageBufferBindingSize`.
|
|
117
|
+
*
|
|
118
|
+
* Emitted by `growMeshSsbo` (D-5: fire, never throw). The frame renders a
|
|
119
|
+
* degraded subset (truncated to pre-grow capacity) per plan-strategy D-2 —
|
|
120
|
+
* no black frame. Four-field surface aligned with `SkinPaletteOverflowError`:
|
|
121
|
+
* - `.code = 'mesh-ssbo-ceiling-reached'`
|
|
122
|
+
* - `.expected` — requested * stride <= device.limits.maxStorageBufferBindingSize
|
|
123
|
+
* - `.hint` — reduce per-frame entity count or pick a higher-tier adapter
|
|
124
|
+
* - `.detail = { requested, capacity, ceiling }`
|
|
125
|
+
*/
|
|
126
|
+
export declare class MeshSsboCeilingReachedError extends Error {
|
|
127
|
+
readonly code: "mesh-ssbo-ceiling-reached";
|
|
128
|
+
readonly expected: string;
|
|
129
|
+
readonly hint: string;
|
|
130
|
+
readonly detail: MeshSsboCeilingReachedDetail;
|
|
131
|
+
constructor(requested: number, capacity: number, ceiling: number);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Detail for `RuntimeErrorCode 'scene-collect-entity-ref-out-of-closure'`.
|
|
135
|
+
*
|
|
136
|
+
* Emitted during rootsToSceneAsset when an entity field references a target
|
|
137
|
+
* outside the collected forest closure.
|
|
138
|
+
*/
|
|
139
|
+
export interface SceneCollectEntityRefOutOfClosureDetail {
|
|
140
|
+
readonly entity: number;
|
|
141
|
+
readonly field: string;
|
|
142
|
+
readonly target: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Structured error for entity ref pointing outside the forest closure.
|
|
146
|
+
*
|
|
147
|
+
* Emitted during rootsToSceneAsset collect; fail-fast per charter P3.
|
|
148
|
+
* - `.code = 'scene-collect-entity-ref-out-of-closure'`
|
|
149
|
+
* - `.expected` — all entity refs resolve within the closure
|
|
150
|
+
* - `.hint` — Expand roots to include the target entity, or remove the reference.
|
|
151
|
+
* - `.detail = { entity, field, target }`
|
|
152
|
+
*/
|
|
153
|
+
export declare class SceneCollectEntityRefOutOfClosureError extends Error {
|
|
154
|
+
readonly code: "scene-collect-entity-ref-out-of-closure";
|
|
155
|
+
readonly expected: string;
|
|
156
|
+
readonly hint: string;
|
|
157
|
+
readonly detail: SceneCollectEntityRefOutOfClosureDetail;
|
|
158
|
+
constructor(entity: number, field: string, target: number);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Detail for `RuntimeErrorCode 'scene-collect-asset-guid-unresolved'`.
|
|
162
|
+
*
|
|
163
|
+
* Emitted at two points with different context on hand:
|
|
164
|
+
* - collect (handle→GUID): the shared handle is known → `.handle` is set.
|
|
165
|
+
* - serialize (GUID→refs): the GUID string is known but absent from the
|
|
166
|
+
* refs index → `.guid` is set. (`.handle` is meaningless there.)
|
|
167
|
+
* Exactly one of `handle` / `guid` is present per instance.
|
|
168
|
+
*/
|
|
169
|
+
export interface SceneCollectAssetGuidUnresolvedDetail {
|
|
170
|
+
readonly field: string;
|
|
171
|
+
readonly handle?: number;
|
|
172
|
+
readonly guid?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Structured error for a shared asset reference whose GUID cannot be resolved.
|
|
176
|
+
*
|
|
177
|
+
* Emitted during rootsToSceneAsset collect (handle) or
|
|
178
|
+
* serializeSceneAssetToPack (guid); fail-fast per charter P3.
|
|
179
|
+
* - `.code = 'scene-collect-asset-guid-unresolved'`
|
|
180
|
+
* - `.expected` — every shared asset reference has a catalogued GUID
|
|
181
|
+
* - `.hint` — Register the asset in AssetRegistry before collecting.
|
|
182
|
+
* - `.detail = { field, handle }` (collect) or `{ field, guid }` (serialize)
|
|
183
|
+
*/
|
|
184
|
+
export declare class SceneCollectAssetGuidUnresolvedError extends Error {
|
|
185
|
+
readonly code: "scene-collect-asset-guid-unresolved";
|
|
186
|
+
readonly expected: string;
|
|
187
|
+
readonly hint: string;
|
|
188
|
+
readonly detail: SceneCollectAssetGuidUnresolvedDetail;
|
|
189
|
+
constructor(field: string, ref: number | string);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Closed union of asset-cluster error codes. AI users perform exhaustive
|
|
193
|
+
* `switch (err.code)` without default; TS guards completeness.
|
|
194
|
+
*/
|
|
195
|
+
export type AssetRuntimeErrorCode = AssetRuntimeError['code'];
|
|
196
|
+
/**
|
|
197
|
+
* Closed union of the asset-cluster structured error classes, each carrying
|
|
198
|
+
* an `AssetRuntimeErrorCode` discriminant on `.code`.
|
|
199
|
+
*/
|
|
200
|
+
export type AssetRuntimeError = MaterialResolvedEmptyPassesError | MeshSsboCapacityExceededError | MeshSsboCeilingReachedError | SceneCollectEntityRefOutOfClosureError | SceneCollectAssetGuidUnresolvedError;
|
|
201
|
+
//# sourceMappingURL=asset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/errors/asset.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,UAAU,EAEV,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACzC,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C,QAAQ,CAAC,OAAO,EAAG,UAAU,CAAU;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,8EAA8E;gBAEnF,IAAI,EAAE;QAChB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG;YAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,mCAAmC,CAAC;QACtD,QAAQ,CAAC,aAAa,CAAC,EAAE,yBAAyB,CAAC;QACnD,QAAQ,CAAC,WAAW,CAAC,EAAE,yBAAyB,CAAC;KAClD;CAyBF;AAID;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iCAAiC;IAChD,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,CAAC;IACvD,yGAAyG;IACzG,QAAQ,CAAC,mBAAmB,CAAC,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D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,gCAAgC,GAChC,6BAA6B,GAC7B,2BAA2B,GAC3B,sCAAsC,GACtC,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { Handle } from '@forgeax/engine-types';
|
|
2
|
+
/**
|
|
3
|
+
* Builtin unit-cube mesh handle (8 vertices + 36 indices, pos+normal
|
|
4
|
+
* interleaved). Pair with `MeshFilter` to spawn a cube entity.
|
|
5
|
+
*
|
|
6
|
+
* @remarks Typed as `Handle<'MeshAsset', 'shared'>` — feat-20260517
|
|
7
|
+
* unifies the engine-types and engine-ecs Handle brand SSOT into a single
|
|
8
|
+
* `Handle<T extends string, M extends 'unique'|'shared'>` declaration
|
|
9
|
+
* (research Finding 4 import-path-decoupled identity), and constructs the
|
|
10
|
+
* value via the brand-creation factory `toShared<'MeshAsset'>(N)` so
|
|
11
|
+
* the caller-side `as unknown as` cast is eliminated (AC-05). The
|
|
12
|
+
* `'shared'` mode signals the AssetRegistry owns the lifecycle — the
|
|
13
|
+
* ECS does not release the slot on despawn / removeComponent / set.
|
|
14
|
+
* Runtime value is a small u32 (1).
|
|
15
|
+
*/
|
|
16
|
+
export declare const HANDLE_CUBE: Handle<'MeshAsset', 'shared'>;
|
|
17
|
+
/**
|
|
18
|
+
* Builtin triangle mesh handle (3 vertices). Pair with `MeshFilter`.
|
|
19
|
+
*
|
|
20
|
+
* @remarks Typed as `Handle<'MeshAsset', 'shared'>` (same narrow brand
|
|
21
|
+
* as HANDLE_CUBE; constructed via the `toShared<'MeshAsset'>(N)`
|
|
22
|
+
* factory per AC-05).
|
|
23
|
+
*/
|
|
24
|
+
export declare const HANDLE_TRIANGLE: Handle<'MeshAsset', 'shared'>;
|
|
25
|
+
/**
|
|
26
|
+
* Builtin unit-quad mesh handle — 4 vertices, 6 indices, 2 triangles on
|
|
27
|
+
* the XY plane facing +Z. Pair with `MeshFilter` to spawn a sprite quad
|
|
28
|
+
* (feat-20260520-2d-sprite-layer-mvp / M-1 / w06).
|
|
29
|
+
*
|
|
30
|
+
* @derives Same-shape sibling of {@link HANDLE_CUBE} / {@link HANDLE_TRIANGLE}
|
|
31
|
+
* per requirements §2.1.C: built via the `toShared<'MeshAsset'>(N)`
|
|
32
|
+
* brand-creation factory; reserved-id 3 fills the namespace hole between
|
|
33
|
+
* HANDLE_TRIANGLE=2 and FIRST_USER_HANDLE=1024 (no `BUILTIN_HANDLE_`
|
|
34
|
+
* prefix per Q2 naming decision — discoverable next to existing
|
|
35
|
+
* builtins in IDE autocomplete; charter F1 single-entry indexability).
|
|
36
|
+
*
|
|
37
|
+
* @reuses {@link createPlaneGeometry}(1, 1) — the procedural plane factory
|
|
38
|
+
* already produces 8-floats-per-vertex interleaved (position + normal +
|
|
39
|
+
* uv) and is then expanded to the runtime 12-floats layout (adds
|
|
40
|
+
* tangent vec4) by {@link meshFromInterleaved}. This funnels HANDLE_QUAD
|
|
41
|
+
* onto the exact same vertex pipeline branch as BUILTIN_CUBE /
|
|
42
|
+
* BUILTIN_TRIANGLE and the procedural geometry factories — zero new
|
|
43
|
+
* layout discriminator (plan-strategy §3 RT4 + D-9 + charter P4
|
|
44
|
+
* consistent abstraction).
|
|
45
|
+
*
|
|
46
|
+
* @reuses `PROCEDURAL_FLOATS_PER_VERTEX` = 12 from
|
|
47
|
+
* `@forgeax/engine-geometry` (the single layout SSOT; the procedural
|
|
48
|
+
* `createPlaneGeometry` factory already returns 12F via
|
|
49
|
+
* `meshFromInterleaved`).
|
|
50
|
+
*/
|
|
51
|
+
export declare const HANDLE_QUAD: Handle<'MeshAsset', 'shared'>;
|
|
52
|
+
/**
|
|
53
|
+
* Id=4 reserved builtin; occupies the next available slot under
|
|
54
|
+
* FIRST_USER_HANDLE=1024. BUILTIN_SPHERE is synthesised from
|
|
55
|
+
* `createSphereGeometry(1, 16, 12)` through the same
|
|
56
|
+
* `meshFromInterleaved` path as BUILTIN_QUAD, so the runtime
|
|
57
|
+
* 12-float stride is byte-identical to procedural output — zero
|
|
58
|
+
* new layout discriminator (charter P4 consistent abstraction).
|
|
59
|
+
*/
|
|
60
|
+
export declare const HANDLE_SPHERE: Handle<'MeshAsset', 'shared'>;
|
|
61
|
+
/**
|
|
62
|
+
* Builtin cylinder mesh handle — procedural open cylinder (unit-height,
|
|
63
|
+
* radius=0.5, 16 radial segments, no caps). Pair with `MeshFilter`.
|
|
64
|
+
*
|
|
65
|
+
* @derives Same-shape sibling of {@link HANDLE_SPHERE}: synthesised from
|
|
66
|
+
* `createCylinderGeometry(0.5, 0.5, 1, 16, 1)` through the same
|
|
67
|
+
* `meshFromInterleaved` path as BUILTIN_SPHERE, so the runtime
|
|
68
|
+
* 12-float stride is byte-identical to all other built-in meshes —
|
|
69
|
+
* zero new layout discriminator (charter P4 consistent abstraction).
|
|
70
|
+
*
|
|
71
|
+
* @remarks Id=6 follows {@link HANDLE_NINESLICE_QUAD}=5 in the builtin slot
|
|
72
|
+
* sequence (FIRST_USER_HANDLE=1024 untouched).
|
|
73
|
+
* feat-20260701-editor-world-container-doc-ecs-collapse M0 / AC-16:
|
|
74
|
+
* GUID = deriveBuiltin('HANDLE_CYLINDER') UUIDv5
|
|
75
|
+
* (plan-strategy §2 D-6 + §5.6 builtin-guid-ssot gate)
|
|
76
|
+
*/
|
|
77
|
+
export declare const HANDLE_CYLINDER: Handle<'MeshAsset', 'shared'>;
|
|
78
|
+
/**
|
|
79
|
+
* Builtin 9-slice quad mesh handle — 4×4 grid (16 vertices, 9 sub-quads,
|
|
80
|
+
* 54 indices) on the XY plane facing +Z. Pair with `MeshFilter` and a
|
|
81
|
+
* `MaterialAsset` whose first pass shader is `'forgeax::sprite'` and whose
|
|
82
|
+
* `values.slices` is non-zero to render a 9-sliced UI panel
|
|
83
|
+
* (feat-20260527-sprite-nineslice / M2 / w9).
|
|
84
|
+
*
|
|
85
|
+
* @derives Same-shape sibling of {@link HANDLE_QUAD}: synthesised from
|
|
86
|
+
* `createPlaneGeometry(1, 1, 3, 3)` which subdivides the unit quad into
|
|
87
|
+
* 3×3 sub-quads (9 cells). The 16 grid points and 54 indices feed
|
|
88
|
+
* {@link meshFromInterleaved} so the runtime 12-float vertex stride is
|
|
89
|
+
* byte-identical to all other built-in / procedural meshes — zero new
|
|
90
|
+
* layout discriminator (charter P4 consistent abstraction).
|
|
91
|
+
*
|
|
92
|
+
* @remarks Id=5 follows {@link HANDLE_SPHERE}=4 in the builtin slot
|
|
93
|
+
* sequence (FIRST_USER_HANDLE=1024 untouched). The vertex shader uses
|
|
94
|
+
* `vertex_index % 4` / `vertex_index / 4` to recover (i, j) grid
|
|
95
|
+
* coordinates and four anchor vec4s to map each grid cell to the right
|
|
96
|
+
* region of the source texture; only required when the sprite material
|
|
97
|
+
* declares non-zero `slices`. For the legacy zero-slice sprite path use
|
|
98
|
+
* {@link HANDLE_QUAD}.
|
|
99
|
+
*
|
|
100
|
+
* @reuses `PROCEDURAL_FLOATS_PER_VERTEX` = 12 from
|
|
101
|
+
* `@forgeax/engine-geometry` (sprite-pipeline binding table / vertex layout
|
|
102
|
+
* untouched). plan-strategy §D-2 NOTE clarifies
|
|
103
|
+
* the id=5 vs original-plan id=4 drift: HANDLE_SPHERE took id=4 in
|
|
104
|
+
* feat-20260529-fxaa-sphere-builtin before this feat landed.
|
|
105
|
+
*/
|
|
106
|
+
export declare const HANDLE_NINESLICE_QUAD: Handle<'MeshAsset', 'shared'>;
|
|
107
|
+
/**
|
|
108
|
+
* Stable GUIDs for the builtin meshes — the dash-form of
|
|
109
|
+
* `deriveBuiltin('HANDLE_<NAME>')` (UUIDv5, ForgeaX namespace) in
|
|
110
|
+
* `@forgeax/engine-pack`. They are inlined here (not imported) because the
|
|
111
|
+
* pack derivation runs under top-level `await` (async SubtleCrypto) and
|
|
112
|
+
* dragging that into the AssetRegistry constructor — a synchronous hot path
|
|
113
|
+
* consumed engine-wide — would make the whole runtime module graph async.
|
|
114
|
+
*
|
|
115
|
+
* The single source of truth remains `deriveBuiltin`: a cross-package
|
|
116
|
+
* guard test (`builtin-guid-ssot.test.ts`) asserts each literal equals the
|
|
117
|
+
* derived value, so any drift in the derivation reds the suite. This pairs
|
|
118
|
+
* the previously-disconnected dual truths (the u32 `HANDLE_*` constants and
|
|
119
|
+
* the pack GUID strings) into one bidirectionally-resolvable table, so
|
|
120
|
+
* `guidOf(HANDLE_CUBE)` no longer returns `undefined`
|
|
121
|
+
* (docs/feedbacks/2026-06-03 §6.2 Tier 0).
|
|
122
|
+
*/
|
|
123
|
+
export declare const BUILTIN_MESH_GUIDS: ReadonlyArray<readonly [Handle<'MeshAsset', 'shared'>, string]>;
|
|
124
|
+
/** Resolve the stable producer GUID for one process-static builtin mesh handle. */
|
|
125
|
+
export declare function builtinMeshGuid(handle: Handle<string, 'shared'>): string | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Field names known to carry handle<> schema-vocab references (plan-strategy
|
|
128
|
+
* D-4). parseScenePayload uses this allowlist to replace integer values
|
|
129
|
+
* with GUID strings from refs[] only for handle fields — a Transform.pos lane of 0,
|
|
130
|
+
* ChildOf.parent=0 and similar non-handle integers are left untouched.
|
|
131
|
+
*
|
|
132
|
+
* When a new handle<> field is added to a runtime component, its field name
|
|
133
|
+
* MUST be added here so parseScenePayload correctly resolves it.
|
|
134
|
+
*/
|
|
135
|
+
export declare const HANDLE_FIELD_NAMES: ReadonlySet<string>;
|
|
136
|
+
/**
|
|
137
|
+
* Field names known to carry `array<handle<X>>` schema-vocab references
|
|
138
|
+
* (feat-20260608 M2 / w7: MeshRenderer.materials). Each element is a refs
|
|
139
|
+
* index that resolves to a GUID string. Coexists with HANDLE_FIELD_NAMES;
|
|
140
|
+
* a field name lives in exactly one set.
|
|
141
|
+
*/
|
|
142
|
+
export declare const HANDLE_ARRAY_FIELD_NAMES: ReadonlySet<string>;
|
|
143
|
+
//# sourceMappingURL=handles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["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
|
|
2
|
+
type UnsupportedMimeImageError = ImageErrorFor<'image-format-unsupported'>;
|
|
3
|
+
type UnsupportedMimeImageErrorDetail = ImageErrorDetailFor<'image-format-unsupported'>;
|
|
4
|
+
export declare function makeImageError(detail: UnsupportedMimeImageErrorDetail): UnsupportedMimeImageError;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=image-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-error.d.ts","sourceRoot":"","sources":["../src/image-error.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUhF,KAAK,yBAAyB,GAAG,aAAa,CAAC,0BAA0B,CAAC,CAAC;AAC3E,KAAK,+BAA+B,GAAG,mBAAmB,CAAC,0BAA0B,CAAC,CAAC;AA2BvF,wBAAgB,cAAc,CAAC,MAAM,EAAE,+BAA+B,GAAG,yBAAyB,CAEjG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { AnimationClip, AnimationGraph, AudioClipAsset, EquirectAsset, FontAsset, MaterialAsset, ParticleEffectAsset, RenderPipelineAsset, SamplerAsset, SceneAsset, SkeletonAsset, SkinAsset, TextureAsset, TilesetAsset, VideoAsset, } from '@forgeax/engine-types';
|
|
2
2
|
export { defineAssetKind } from './asset-kind.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export type { Asset, CatalogReconcileError, CatalogReconcileResult, MeshAsset, } from './asset-registry';
|
|
4
|
+
export { AssetRegistry } from './asset-registry';
|
|
5
|
+
export { BUILTIN_BASE, BUILTIN_CUBE, BUILTIN_CYLINDER, BUILTIN_NINESLICE_QUAD, BUILTIN_QUAD, BUILTIN_SPHERE, BUILTIN_TRIANGLE, BuiltinAssetRegistry, } from './builtin-asset-registry';
|
|
6
|
+
export { type CatalogListener, type CatalogSource, createCatalogSource } from './catalog-source';
|
|
7
|
+
export { decodeImageBytes } from './decode-image-bytes';
|
|
8
|
+
export { adaptDynamicTextureDevice, type DynamicTextureDevice, DynamicTextureStore, } from './dynamic-texture-store';
|
|
9
|
+
export type { AssetRuntimeError, AssetRuntimeErrorCode, MaterialResolvedEmptyPassesDetail, SceneCollectAssetGuidUnresolvedDetail, SceneCollectEntityRefOutOfClosureDetail, } from './errors/asset';
|
|
10
|
+
export { MaterialResolvedEmptyPassesError, MeshBinAssetError, MeshSsboCapacityExceededError, MeshSsboCeilingReachedError, SceneCollectAssetGuidUnresolvedError, SceneCollectEntityRefOutOfClosureError, } from './errors/asset';
|
|
11
|
+
export { builtinMeshGuid, HANDLE_CUBE, HANDLE_CYLINDER, HANDLE_NINESLICE_QUAD, HANDLE_QUAD, HANDLE_SPHERE, HANDLE_TRIANGLE, } from './handles';
|
|
12
|
+
export { type AssetRegistry as RuntimeAssetRegistry, type AssetRegistryResolver, createAssetRegistry, getAssetRegistryResolver, } from './internal/load-asset.js';
|
|
13
|
+
export { LoaderRegistry } from './loader-registry';
|
|
14
|
+
export { animationClipLoader, animationGraphLoader, audioLoader, INLINE_PACK_LOADERS, materialLoader, meshLoader, particleEffectLoader, renderPipelineLoader, sceneLoader, skeletonLoader, skinLoader, tilesetLoader, } from './loaders/inline-pack';
|
|
15
|
+
export { type UnpackedMeshBin, unpackMeshBinV4, } from './loaders/mesh-bin';
|
|
16
|
+
export { equirectLoader, fontLoader, PACK_ARTIFACT_LOADERS, renderPipelineLoader as renderPipelineArtifactLoader, textureLoader, tilesetLoader as tilesetArtifactLoader, } from './loaders/pack-artifact';
|
|
17
|
+
export { MaterialGenerationCache } from './material/generation-cache';
|
|
18
|
+
export { inspectMaterialRuntime, type MaterialRuntimeInfo } from './material/inspection';
|
|
19
|
+
export { createMaterialLoader, type MaterialLoadError, type MaterialLoadErrorCode, type MaterialLoadErrorDetail, type MaterialLoaderOptions, type MaterialLoadRequest, type MaterialPublication, type MaterialReady, } from './material/loader';
|
|
20
|
+
export { installMaterialReadyShaders, materialParametersToParamSchema, runtimeMaterialShaderId, } from './material/runtime-shader';
|
|
21
|
+
export { blitMipmapsSync, getOrCreateMipmapPipeline, type MipmapBlitDevice, type MipmapShaderModuleFactory, mipmapCacheSize, numMipLevels, } from './mipmap-generator';
|
|
22
|
+
export { type TilesetValidateOptions, validateTilesetPayload } from './payload-validate';
|
|
23
|
+
export { assetLoaderPlugin, assetsPlugin, packLoaderPlugin } from './plugin';
|
|
24
|
+
export { createRuntimeAssetEvidenceAdapter, type RuntimeEvidenceSource, } from './registry/asset-evidence';
|
|
25
|
+
export { CatalogReplica, type CatalogReplicaSnapshot } from './registry/catalog-state';
|
|
26
|
+
export type { PostSpawnHook, SkinJointResolver } from './registry/instantiate';
|
|
27
|
+
export { buildSceneChildContext } from './registry/instantiate';
|
|
28
|
+
export { loadMaterialReadyByGuid } from './registry/load-by-guid';
|
|
29
|
+
export { compareScenePublicationFences, createScenePublicationFence, observeScenePublication, parseScenePublicationFence, SCENE_PUBLICATION_FENCE_SCHEMA, SCENE_PUBLICATION_RECOVERY_ACTIONS, type ScenePublicationFence, type ScenePublicationFenceError, type ScenePublicationFencePhase, type ScenePublicationObservation, scenePublicationFenceFromCatalog, } from './registry/scene-publication-fence';
|
|
30
|
+
export { resolveAssetHandle, walkMaterialPassesOverSharedRefs } from './resolve-asset-handle';
|
|
31
|
+
export { type ResolvedTilesetRuntime, resolveTilesetRuntime, type TilesetAtlasLookup, type TilesetRuntimeError, type TilesetRuntimeErrorCode, } from './resolve-tileset-runtime';
|
|
32
|
+
export { parseScenePayload } from './scene-payload';
|
|
33
|
+
export { createDefaultLoaderRegistry, wireDefaultLoaders } from './wire-default-loaders';
|
|
5
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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