@forgeax/engine-assets-runtime 0.0.0-dev.8d955ade1c79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +491 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/__tests__/aabb.unit.test.d.ts +2 -0
  5. package/dist/__tests__/aabb.unit.test.d.ts.map +1 -0
  6. package/dist/__tests__/artifact-integrity.unit.test.d.ts +2 -0
  7. package/dist/__tests__/artifact-integrity.unit.test.d.ts.map +1 -0
  8. package/dist/__tests__/artifact-io.unit.test.d.ts +2 -0
  9. package/dist/__tests__/artifact-io.unit.test.d.ts.map +1 -0
  10. package/dist/__tests__/asset-evidence-sdk.integration.test.d.ts +2 -0
  11. package/dist/__tests__/asset-evidence-sdk.integration.test.d.ts.map +1 -0
  12. package/dist/__tests__/asset-evidence.unit.test.d.ts +2 -0
  13. package/dist/__tests__/asset-evidence.unit.test.d.ts.map +1 -0
  14. package/dist/__tests__/asset-kind.unit.test.d.ts +2 -0
  15. package/dist/__tests__/asset-kind.unit.test.d.ts.map +1 -0
  16. package/dist/__tests__/asset-registry-catalog-reconcile.integration.test.d.ts +2 -0
  17. package/dist/__tests__/asset-registry-catalog-reconcile.integration.test.d.ts.map +1 -0
  18. package/dist/__tests__/asset-registry-catalog-reconcile.unit.test.d.ts +2 -0
  19. package/dist/__tests__/asset-registry-catalog-reconcile.unit.test.d.ts.map +1 -0
  20. package/dist/__tests__/asset-registry-catalog.unit.test.d.ts +2 -0
  21. package/dist/__tests__/asset-registry-catalog.unit.test.d.ts.map +1 -0
  22. package/dist/__tests__/asset-registry.pack-cache.test.d.ts +2 -0
  23. package/dist/__tests__/asset-registry.pack-cache.test.d.ts.map +1 -0
  24. package/dist/__tests__/asset-registry.unit.test.d.ts +2 -0
  25. package/dist/__tests__/asset-registry.unit.test.d.ts.map +1 -0
  26. package/dist/__tests__/asset-runtime-error-code-owner.test-d.d.ts +2 -0
  27. package/dist/__tests__/asset-runtime-error-code-owner.test-d.d.ts.map +1 -0
  28. package/dist/__tests__/catalog-replica.unit.test.d.ts +2 -0
  29. package/dist/__tests__/catalog-replica.unit.test.d.ts.map +1 -0
  30. package/dist/__tests__/catalog-source-v2.unit.test.d.ts +2 -0
  31. package/dist/__tests__/catalog-source-v2.unit.test.d.ts.map +1 -0
  32. package/dist/__tests__/catalog-source.unit.test.d.ts +2 -0
  33. package/dist/__tests__/catalog-source.unit.test.d.ts.map +1 -0
  34. package/dist/__tests__/catalog-subscription-order.unit.test.d.ts +2 -0
  35. package/dist/__tests__/catalog-subscription-order.unit.test.d.ts.map +1 -0
  36. package/dist/__tests__/catalog-subscription.unit.test.d.ts +2 -0
  37. package/dist/__tests__/catalog-subscription.unit.test.d.ts.map +1 -0
  38. package/dist/__tests__/decode-image-bytes-pass-through.test.d.ts +2 -0
  39. package/dist/__tests__/decode-image-bytes-pass-through.test.d.ts.map +1 -0
  40. package/dist/__tests__/decode-image-bytes.browser.test.d.ts +2 -0
  41. package/dist/__tests__/decode-image-bytes.browser.test.d.ts.map +1 -0
  42. package/dist/__tests__/decode-image-bytes.test-d.d.ts +2 -0
  43. package/dist/__tests__/decode-image-bytes.test-d.d.ts.map +1 -0
  44. package/dist/__tests__/decode-image-bytes.test.d.ts +2 -0
  45. package/dist/__tests__/decode-image-bytes.test.d.ts.map +1 -0
  46. package/dist/__tests__/decode-image-mime-owner.test.d.ts +2 -0
  47. package/dist/__tests__/decode-image-mime-owner.test.d.ts.map +1 -0
  48. package/dist/__tests__/dynamic-texture-store.unit.test.d.ts +2 -0
  49. package/dist/__tests__/dynamic-texture-store.unit.test.d.ts.map +1 -0
  50. package/dist/__tests__/errors-asset.unit.test.d.ts +2 -0
  51. package/dist/__tests__/errors-asset.unit.test.d.ts.map +1 -0
  52. package/dist/__tests__/inline-pack-loaders.unit.test.d.ts +2 -0
  53. package/dist/__tests__/inline-pack-loaders.unit.test.d.ts.map +1 -0
  54. package/dist/__tests__/instantiate-context.unit.test.d.ts +2 -0
  55. package/dist/__tests__/instantiate-context.unit.test.d.ts.map +1 -0
  56. package/dist/__tests__/instantiate-publication-fence.unit.test.d.ts +2 -0
  57. package/dist/__tests__/instantiate-publication-fence.unit.test.d.ts.map +1 -0
  58. package/dist/__tests__/instantiate.unit.test.d.ts +2 -0
  59. package/dist/__tests__/instantiate.unit.test.d.ts.map +1 -0
  60. package/dist/__tests__/loader-input-contract.unit.test.d.ts +2 -0
  61. package/dist/__tests__/loader-input-contract.unit.test.d.ts.map +1 -0
  62. package/dist/__tests__/loader-registry.unit.test.d.ts +2 -0
  63. package/dist/__tests__/loader-registry.unit.test.d.ts.map +1 -0
  64. package/dist/__tests__/material-dependency-invalidation.unit.test.d.ts +2 -0
  65. package/dist/__tests__/material-dependency-invalidation.unit.test.d.ts.map +1 -0
  66. package/dist/__tests__/material-generation-cache.unit.test.d.ts +2 -0
  67. package/dist/__tests__/material-generation-cache.unit.test.d.ts.map +1 -0
  68. package/dist/__tests__/material-load-consumer.test-d.d.ts +2 -0
  69. package/dist/__tests__/material-load-consumer.test-d.d.ts.map +1 -0
  70. package/dist/__tests__/material-ready.integration.test.d.ts +2 -0
  71. package/dist/__tests__/material-ready.integration.test.d.ts.map +1 -0
  72. package/dist/__tests__/material-stale-generation.unit.test.d.ts +2 -0
  73. package/dist/__tests__/material-stale-generation.unit.test.d.ts.map +1 -0
  74. package/dist/__tests__/mesh-bin-morph-v3.test.d.ts +2 -0
  75. package/dist/__tests__/mesh-bin-morph-v3.test.d.ts.map +1 -0
  76. package/dist/__tests__/mesh-bin.unit.test.d.ts +2 -0
  77. package/dist/__tests__/mesh-bin.unit.test.d.ts.map +1 -0
  78. package/dist/__tests__/mipmap-generator.unit.test.d.ts +2 -0
  79. package/dist/__tests__/mipmap-generator.unit.test.d.ts.map +1 -0
  80. package/dist/__tests__/pack-artifact-transcode-model-owner.test.d.ts +2 -0
  81. package/dist/__tests__/pack-artifact-transcode-model-owner.test.d.ts.map +1 -0
  82. package/dist/__tests__/pack-basis-load.integration.test.d.ts +2 -0
  83. package/dist/__tests__/pack-basis-load.integration.test.d.ts.map +1 -0
  84. package/dist/__tests__/payload-validate.unit.test.d.ts +2 -0
  85. package/dist/__tests__/payload-validate.unit.test.d.ts.map +1 -0
  86. package/dist/__tests__/plugin.test.d.ts +2 -0
  87. package/dist/__tests__/plugin.test.d.ts.map +1 -0
  88. package/dist/__tests__/registry-concurrency.bench.test.d.ts +2 -0
  89. package/dist/__tests__/registry-concurrency.bench.test.d.ts.map +1 -0
  90. package/dist/__tests__/registry-failure-retry.integration.test.d.ts +2 -0
  91. package/dist/__tests__/registry-failure-retry.integration.test.d.ts.map +1 -0
  92. package/dist/__tests__/registry-load-graph.integration.test.d.ts +2 -0
  93. package/dist/__tests__/registry-load-graph.integration.test.d.ts.map +1 -0
  94. package/dist/__tests__/registry-load-state.unit.test.d.ts +2 -0
  95. package/dist/__tests__/registry-load-state.unit.test.d.ts.map +1 -0
  96. package/dist/__tests__/registry-package-cache.unit.test.d.ts +2 -0
  97. package/dist/__tests__/registry-package-cache.unit.test.d.ts.map +1 -0
  98. package/dist/__tests__/registry-public-ready.unit.test.d.ts +2 -0
  99. package/dist/__tests__/registry-public-ready.unit.test.d.ts.map +1 -0
  100. package/dist/__tests__/resolve-asset-handle.unit.test.d.ts +2 -0
  101. package/dist/__tests__/resolve-asset-handle.unit.test.d.ts.map +1 -0
  102. package/dist/__tests__/scene-handle-fields.unit.test.d.ts +2 -0
  103. package/dist/__tests__/scene-handle-fields.unit.test.d.ts.map +1 -0
  104. package/dist/__tests__/scene-payload.unit.test.d.ts +2 -0
  105. package/dist/__tests__/scene-payload.unit.test.d.ts.map +1 -0
  106. package/dist/__tests__/scene-publication-fence.test.d.ts +2 -0
  107. package/dist/__tests__/scene-publication-fence.test.d.ts.map +1 -0
  108. package/dist/__tests__/scriptable-pack-public-surface.test-d.d.ts +2 -0
  109. package/dist/__tests__/scriptable-pack-public-surface.test-d.d.ts.map +1 -0
  110. package/dist/__tests__/static-rig.integration.test.d.ts +2 -0
  111. package/dist/__tests__/static-rig.integration.test.d.ts.map +1 -0
  112. package/dist/__tests__/validate-material.unit.test.d.ts +2 -0
  113. package/dist/__tests__/validate-material.unit.test.d.ts.map +1 -0
  114. package/dist/__tests__/video-pack-loader.integration.test.d.ts +2 -0
  115. package/dist/__tests__/video-pack-loader.integration.test.d.ts.map +1 -0
  116. package/dist/aabb.d.ts +3 -0
  117. package/dist/aabb.d.ts.map +1 -0
  118. package/dist/asset-kind.d.ts +4 -0
  119. package/dist/asset-kind.d.ts.map +1 -0
  120. package/dist/asset-registry.d.ts +554 -0
  121. package/dist/asset-registry.d.ts.map +1 -0
  122. package/dist/builtin-asset-registry.d.ts +22 -0
  123. package/dist/builtin-asset-registry.d.ts.map +1 -0
  124. package/dist/catalog-source.d.ts +24 -0
  125. package/dist/catalog-source.d.ts.map +1 -0
  126. package/dist/decode-image-bytes.d.ts +57 -0
  127. package/dist/decode-image-bytes.d.ts.map +1 -0
  128. package/dist/dynamic-texture-store.d.ts +89 -0
  129. package/dist/dynamic-texture-store.d.ts.map +1 -0
  130. package/dist/errors/asset.d.ts +201 -0
  131. package/dist/errors/asset.d.ts.map +1 -0
  132. package/dist/handles.d.ts +143 -0
  133. package/dist/handles.d.ts.map +1 -0
  134. package/dist/image-error.d.ts +6 -0
  135. package/dist/image-error.d.ts.map +1 -0
  136. package/dist/index.d.ts +34 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.mjs +8359 -0
  139. package/dist/index.mjs.map +1 -0
  140. package/dist/internal/artifact-cache.d.ts +17 -0
  141. package/dist/internal/artifact-cache.d.ts.map +1 -0
  142. package/dist/internal/asset-graph.d.ts +70 -0
  143. package/dist/internal/asset-graph.d.ts.map +1 -0
  144. package/dist/internal/catalog-session.d.ts +60 -0
  145. package/dist/internal/catalog-session.d.ts.map +1 -0
  146. package/dist/internal/decoder-registry.d.ts +19 -0
  147. package/dist/internal/decoder-registry.d.ts.map +1 -0
  148. package/dist/internal/immutable-payload.d.ts +9 -0
  149. package/dist/internal/immutable-payload.d.ts.map +1 -0
  150. package/dist/internal/load-asset.d.ts +31 -0
  151. package/dist/internal/load-asset.d.ts.map +1 -0
  152. package/dist/internal/pack-reader.d.ts +18 -0
  153. package/dist/internal/pack-reader.d.ts.map +1 -0
  154. package/dist/internal/validate-runtime-row.d.ts +7 -0
  155. package/dist/internal/validate-runtime-row.d.ts.map +1 -0
  156. package/dist/internal.d.ts +3 -0
  157. package/dist/internal.d.ts.map +1 -0
  158. package/dist/internal.mjs +329 -0
  159. package/dist/internal.mjs.map +1 -0
  160. package/dist/loader-registry.d.ts +63 -0
  161. package/dist/loader-registry.d.ts.map +1 -0
  162. package/dist/loaders/inline-pack.d.ts +72 -0
  163. package/dist/loaders/inline-pack.d.ts.map +1 -0
  164. package/dist/loaders/mesh-bin.d.ts +21 -0
  165. package/dist/loaders/mesh-bin.d.ts.map +1 -0
  166. package/dist/loaders/pack-artifact.d.ts +20 -0
  167. package/dist/loaders/pack-artifact.d.ts.map +1 -0
  168. package/dist/material/dependency-graph.d.ts +9 -0
  169. package/dist/material/dependency-graph.d.ts.map +1 -0
  170. package/dist/material/generation-cache.d.ts +24 -0
  171. package/dist/material/generation-cache.d.ts.map +1 -0
  172. package/dist/material/inspection.d.ts +24 -0
  173. package/dist/material/inspection.d.ts.map +1 -0
  174. package/dist/material/loader.d.ts +59 -0
  175. package/dist/material/loader.d.ts.map +1 -0
  176. package/dist/material/runtime-shader.d.ts +14 -0
  177. package/dist/material/runtime-shader.d.ts.map +1 -0
  178. package/dist/mesh-bin.d.ts +3 -0
  179. package/dist/mesh-bin.d.ts.map +1 -0
  180. package/dist/mipmap-generator.d.ts +132 -0
  181. package/dist/mipmap-generator.d.ts.map +1 -0
  182. package/dist/payload-validate.d.ts +60 -0
  183. package/dist/payload-validate.d.ts.map +1 -0
  184. package/dist/plugin.d.ts +16 -0
  185. package/dist/plugin.d.ts.map +1 -0
  186. package/dist/registry/artifact-io.d.ts +16 -0
  187. package/dist/registry/artifact-io.d.ts.map +1 -0
  188. package/dist/registry/asset-evidence.d.ts +13 -0
  189. package/dist/registry/asset-evidence.d.ts.map +1 -0
  190. package/dist/registry/catalog-state.d.ts +47 -0
  191. package/dist/registry/catalog-state.d.ts.map +1 -0
  192. package/dist/registry/catalog.d.ts +48 -0
  193. package/dist/registry/catalog.d.ts.map +1 -0
  194. package/dist/registry/instantiate.d.ts +153 -0
  195. package/dist/registry/instantiate.d.ts.map +1 -0
  196. package/dist/registry/load-by-guid.d.ts +247 -0
  197. package/dist/registry/load-by-guid.d.ts.map +1 -0
  198. package/dist/registry/load-state.d.ts +26 -0
  199. package/dist/registry/load-state.d.ts.map +1 -0
  200. package/dist/registry/runtime-projection.d.ts +16 -0
  201. package/dist/registry/runtime-projection.d.ts.map +1 -0
  202. package/dist/registry/scene-publication-fence.d.ts +38 -0
  203. package/dist/registry/scene-publication-fence.d.ts.map +1 -0
  204. package/dist/registry/validate-material.d.ts +77 -0
  205. package/dist/registry/validate-material.d.ts.map +1 -0
  206. package/dist/resolve-asset-handle.d.ts +43 -0
  207. package/dist/resolve-asset-handle.d.ts.map +1 -0
  208. package/dist/resolve-tileset-runtime.d.ts +23 -0
  209. package/dist/resolve-tileset-runtime.d.ts.map +1 -0
  210. package/dist/scene-handle-fields.d.ts +88 -0
  211. package/dist/scene-handle-fields.d.ts.map +1 -0
  212. package/dist/scene-payload.d.ts +15 -0
  213. package/dist/scene-payload.d.ts.map +1 -0
  214. package/dist/wire-default-loaders.d.ts +29 -0
  215. package/dist/wire-default-loaders.d.ts.map +1 -0
  216. package/package.json +76 -0
  217. package/src/__tests__/aabb.unit.test.ts +97 -0
  218. package/src/__tests__/artifact-integrity.unit.test.ts +99 -0
  219. package/src/__tests__/artifact-io.unit.test.ts +127 -0
  220. package/src/__tests__/asset-evidence-sdk.integration.test.ts +32 -0
  221. package/src/__tests__/asset-evidence.unit.test.ts +32 -0
  222. package/src/__tests__/asset-kind.unit.test.ts +14 -0
  223. package/src/__tests__/asset-registry-catalog-reconcile.integration.test.ts +74 -0
  224. package/src/__tests__/asset-registry-catalog-reconcile.unit.test.ts +89 -0
  225. package/src/__tests__/asset-registry-catalog.unit.test.ts +170 -0
  226. package/src/__tests__/asset-registry.pack-cache.test.ts +96 -0
  227. package/src/__tests__/asset-registry.unit.test.ts +511 -0
  228. package/src/__tests__/asset-runtime-error-code-owner.test-d.ts +63 -0
  229. package/src/__tests__/catalog-replica.unit.test.ts +196 -0
  230. package/src/__tests__/catalog-source-v2.unit.test.ts +158 -0
  231. package/src/__tests__/catalog-source.unit.test.ts +126 -0
  232. package/src/__tests__/catalog-subscription-order.unit.test.ts +65 -0
  233. package/src/__tests__/catalog-subscription.unit.test.ts +28 -0
  234. package/src/__tests__/decode-image-bytes-pass-through.test.ts +34 -0
  235. package/src/__tests__/decode-image-bytes.browser.test.ts +102 -0
  236. package/src/__tests__/decode-image-bytes.test-d.ts +108 -0
  237. package/src/__tests__/decode-image-bytes.test.ts +90 -0
  238. package/src/__tests__/decode-image-mime-owner.test.ts +38 -0
  239. package/src/__tests__/dynamic-texture-store.unit.test.ts +115 -0
  240. package/src/__tests__/errors-asset.unit.test.ts +92 -0
  241. package/src/__tests__/inline-pack-loaders.unit.test.ts +548 -0
  242. package/src/__tests__/instantiate-context.unit.test.ts +65 -0
  243. package/src/__tests__/instantiate-publication-fence.unit.test.ts +158 -0
  244. package/src/__tests__/instantiate.unit.test.ts +684 -0
  245. package/src/__tests__/loader-input-contract.unit.test.ts +89 -0
  246. package/src/__tests__/loader-registry.unit.test.ts +101 -0
  247. package/src/__tests__/material-dependency-invalidation.unit.test.ts +14 -0
  248. package/src/__tests__/material-generation-cache.unit.test.ts +46 -0
  249. package/src/__tests__/material-load-consumer.test-d.ts +42 -0
  250. package/src/__tests__/material-ready.integration.test.ts +508 -0
  251. package/src/__tests__/material-stale-generation.unit.test.ts +147 -0
  252. package/src/__tests__/mesh-bin-morph-v3.test.ts +22 -0
  253. package/src/__tests__/mesh-bin.unit.test.ts +152 -0
  254. package/src/__tests__/mipmap-generator.unit.test.ts +202 -0
  255. package/src/__tests__/pack-artifact-transcode-model-owner.test.ts +32 -0
  256. package/src/__tests__/pack-basis-load.integration.test.ts +168 -0
  257. package/src/__tests__/payload-validate.unit.test.ts +285 -0
  258. package/src/__tests__/plugin.test.ts +55 -0
  259. package/src/__tests__/registry-concurrency.bench.test.ts +40 -0
  260. package/src/__tests__/registry-failure-retry.integration.test.ts +69 -0
  261. package/src/__tests__/registry-load-graph.integration.test.ts +246 -0
  262. package/src/__tests__/registry-load-state.unit.test.ts +35 -0
  263. package/src/__tests__/registry-package-cache.unit.test.ts +53 -0
  264. package/src/__tests__/registry-public-ready.unit.test.ts +38 -0
  265. package/src/__tests__/resolve-asset-handle.unit.test.ts +238 -0
  266. package/src/__tests__/scene-handle-fields.unit.test.ts +129 -0
  267. package/src/__tests__/scene-payload.unit.test.ts +151 -0
  268. package/src/__tests__/scene-publication-fence.test.ts +129 -0
  269. package/src/__tests__/scriptable-pack-public-surface.test-d.ts +27 -0
  270. package/src/__tests__/static-rig.integration.test.ts +8 -0
  271. package/src/__tests__/validate-material.unit.test.ts +359 -0
  272. package/src/__tests__/video-pack-loader.integration.test.ts +83 -0
  273. package/src/aabb.ts +107 -0
  274. package/src/asset-kind.ts +6 -0
  275. package/src/asset-registry.ts +2045 -0
  276. package/src/builtin-asset-registry.ts +164 -0
  277. package/src/catalog-source.ts +89 -0
  278. package/src/decode-image-bytes.ts +126 -0
  279. package/src/dynamic-texture-store.ts +234 -0
  280. package/src/errors/asset.ts +347 -0
  281. package/src/handles.ts +186 -0
  282. package/src/image-error.ts +45 -0
  283. package/src/index.ts +189 -0
  284. package/src/internal/artifact-cache.ts +65 -0
  285. package/src/internal/asset-graph.ts +420 -0
  286. package/src/internal/catalog-session.ts +345 -0
  287. package/src/internal/decoder-registry.ts +175 -0
  288. package/src/internal/immutable-payload.ts +20 -0
  289. package/src/internal/load-asset.ts +254 -0
  290. package/src/internal/pack-reader.ts +183 -0
  291. package/src/internal/validate-runtime-row.ts +51 -0
  292. package/src/internal.ts +6 -0
  293. package/src/loader-registry.ts +157 -0
  294. package/src/loaders/inline-pack.ts +837 -0
  295. package/src/loaders/mesh-bin.ts +304 -0
  296. package/src/loaders/pack-artifact.ts +665 -0
  297. package/src/material/dependency-graph.ts +46 -0
  298. package/src/material/generation-cache.ts +177 -0
  299. package/src/material/inspection.ts +46 -0
  300. package/src/material/loader.ts +326 -0
  301. package/src/material/runtime-shader.ts +133 -0
  302. package/src/mesh-bin.ts +5 -0
  303. package/src/mipmap-generator.ts +450 -0
  304. package/src/payload-validate.ts +573 -0
  305. package/src/plugin.ts +48 -0
  306. package/src/registry/artifact-io.ts +259 -0
  307. package/src/registry/asset-evidence.ts +51 -0
  308. package/src/registry/catalog-state.ts +409 -0
  309. package/src/registry/catalog.ts +369 -0
  310. package/src/registry/instantiate.ts +1056 -0
  311. package/src/registry/load-by-guid.ts +1657 -0
  312. package/src/registry/load-state.ts +115 -0
  313. package/src/registry/runtime-projection.ts +63 -0
  314. package/src/registry/scene-publication-fence.ts +256 -0
  315. package/src/registry/validate-material.ts +385 -0
  316. package/src/resolve-asset-handle.ts +147 -0
  317. package/src/resolve-tileset-runtime.ts +72 -0
  318. package/src/scene-handle-fields.ts +221 -0
  319. package/src/scene-payload.ts +207 -0
  320. package/src/wire-default-loaders.ts +79 -0
@@ -0,0 +1,554 @@
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
+ /** Public identity projection consumed by scene collection boundaries. */
169
+ guidOf(asset: Asset): string | undefined;
170
+ /** Return the production MaterialReady/Error result for one material GUID. */
171
+ getMaterialReadiness(guid: string): MaterialReady | MaterialLoadError | undefined;
172
+ /** Record the canonical result produced by the production material loader. */
173
+ recordMaterialReadiness(guid: string, readiness: MaterialReady | MaterialLoadError): void;
174
+ /**
175
+ * Configure a catalog URL for `loadByGuid`.
176
+ *
177
+ * Call this once during engine initialization with the URL where
178
+ * `pack-index.json` is served (emitted by `@forgeax/engine-vite-plugin-pack`
179
+ * during `vite build`). In a Vite dev host, use `configureRuntimeBinding`
180
+ * instead so the catalog remains bound to its scope and generation. The
181
+ * index is also the canonical base URL for every
182
+ * catalog entry: relative, root-relative, and absolute entry URLs are resolved
183
+ * against it before the registry fetches a pack body. After configuration,
184
+ * `loadByGuid` will fetch the catalog on its first invocation and cache it for
185
+ * subsequent calls.
186
+ *
187
+ * @example
188
+ * ```ts
189
+ * engine.assets.configurePackIndex('/pack-index.json');
190
+ * const payloadRes = await engine.assets.loadByGuid(guid); // payload, not a handle (D-17)
191
+ * ```
192
+ */
193
+ configurePackIndex(url: string): void;
194
+ /**
195
+ * Atomically replace the browser-side asset realm. The binding owns the
196
+ * catalog URL and generation; no cache from the previous game survives the
197
+ * transition.
198
+ */
199
+ configureRuntimeBinding(binding: RuntimeAssetBinding): void;
200
+ /**
201
+ * feat-20260621 F17c: invalidate a single cached asset by GUID so the next
202
+ * `loadByGuid` performs a genuinely fresh fetch. Clears, for this GUID only:
203
+ * the catalogue entry, the in-flight dedup entry, the cached pack-file body
204
+ * (keyed by the index entry's packageUrl), and the pack-index entry. Then
205
+ * increments the per-GUID generation counter so any still in-flight Promise
206
+ * for this GUID discards its result (returns `asset-invalidated`). The body +
207
+ * index clears are targeted (other GUIDs' cached bodies and index entries
208
+ * survive); deleting the index entry forces `resolveCatalogEntry` to re-fetch
209
+ * the pack-index on the next load, re-resolving the packageUrl whose body
210
+ * cache was just dropped. No-op when the GUID is not catalogued.
211
+ *
212
+ * Does NOT touch `packages` (a re-load's registerPackage overwrites them; D-8)
213
+ * and does NOT trigger GPU resource release (OOS-1,
214
+ * q1 boundary: the asset is CPU-only; GPU resources follow the ECS).
215
+ *
216
+ * @param guid - Case-insensitive GUID string or AssetGuid.
217
+ */
218
+ invalidate(guid: string): void;
219
+ /**
220
+ * Adopt freshly loaded Mesh material slots into an object that is already
221
+ * pinned by live World shared refs. Geometry and GPU-backed fields deliberately
222
+ * remain untouched: this primitive is only for a default-material source
223
+ * override, never a general Mesh reimport. This is the atomic cutover: Catalog,
224
+ * Ready load state, and payload-to-GUID provenance must all name the same
225
+ * object after the call. Call only after invalidate(guid) + loadByGuid(guid)
226
+ * has completed successfully.
227
+ */
228
+ adoptReloadedMeshMaterialSlots(guid: string, livePayload: Asset): Result<Asset, AssetError>;
229
+ /**
230
+ * feat-20260621 F17c: invalidate ALL cached assets so the next `loadByGuid`
231
+ * re-fetches both the pack-index and the asset body. Clears assetCatalog,
232
+ * inFlight, and packFileCache (wholesale), and resets packIndexCache to
233
+ * `undefined` (NOT `.clear()` -- an empty Map would short-circuit
234
+ * `resolveCatalogEntry`'s `=== undefined` re-fetch guard and serve
235
+ * asset-not-imported for every later load; undefined forces a fresh
236
+ * fetchPackIndex). Then increments a single globalGeneration counter so every
237
+ * in-flight Promise (regardless of GUID) discards its result. Returns the
238
+ * number of assets that were catalogued before the call.
239
+ *
240
+ * Idempotent: second call on an already-empty catalogue returns clearedCount 0
241
+ * (AC-06). Does NOT trigger GPU resource release (OOS-1).
242
+ */
243
+ invalidateAll(): {
244
+ clearedCount: number;
245
+ };
246
+ /**
247
+ * Force a re-fetch of the configured pack-index NOW and repopulate the cache,
248
+ * so a synchronous `listCatalog()` immediately reflects assets added on disk
249
+ * since boot (a freshly imported GLB's sub-assets). `loadByGuid`'s lazy
250
+ * re-fetch only fires on a per-GUID miss and `invalidateAll()` merely clears
251
+ * the cache (leaving `listCatalog()` empty until the next load), so neither
252
+ * makes a Content Browser or `loadByGuid`-driven "Add to Scene" see a new
253
+ * asset without a page reload. This does.
254
+ *
255
+ * No-op (returns false) when no pack-index URL is configured (dev inline
256
+ * catalogue path) or the fetch fails — callers keep the stale cache rather
257
+ * than blanking it. Returns true when the cache was repopulated.
258
+ */
259
+ refreshCatalog(): Promise<boolean>;
260
+ setCatalogSource(source: CatalogSource): void;
261
+ /** Stop the catalog transport and remove its replica without clearing payload caches. */
262
+ clearCatalogSource(): void;
263
+ enumerateCatalog(): Promise<Result<readonly CatalogEntry[], AssetError>>;
264
+ /** Read the immutable catalog projection folded by this registry. */
265
+ catalogSnapshot(): CatalogReplicaSnapshot | undefined;
266
+ /** Explicitly recover the registry's single catalog replica from its configured source. */
267
+ reconcileCatalog(): Promise<CatalogReconcileResult>;
268
+ subscribeCatalog(listener: CatalogListener): () => void;
269
+ /**
270
+ * Materialise a `SceneAsset` into an existing `World` and return the
271
+ * synthetic root `Entity` (feat-20260514 w31 sugar wrapper; AC-03 +
272
+ * requirements §IN-3; M3: returns Entity not SceneInstanceId).
273
+ *
274
+ * Before spawning, handle-type component fields (e.g. `assetHandle`,
275
+ * `material`, `skeleton`) containing GUID strings are resolved to fresh
276
+ * user-tier `Handle` numbers via `world.allocSharedRef` (feat-20260614 M8
277
+ * D-19 instantiate-time GUID->handle mint; supersedes the pre-D-17
278
+ * `resolveGuid` map). GUIDs that fail to parse or are not catalogued return
279
+ * `AssetError(code='asset-not-found')` with a hint containing the GUID,
280
+ * node localId, and field name.
281
+ *
282
+ * Errors propagate verbatim through the closed
283
+ * `AssetError | PackError | EcsError` union so AI users that already
284
+ * narrow `loadByGuid<SceneAsset>` results reuse the same `switch
285
+ * (err.code)` exhaustively (charter proposition 3 machine-readable
286
+ * union; plan-strategy §3.3 closed-union transparency).
287
+ *
288
+ * @example
289
+ * ```ts
290
+ * const sceneRes = await engine.assets.loadByGuid<SceneAsset>(roomGuid); // payload (D-17)
291
+ * if (!sceneRes.ok) return;
292
+ * const handle = world.allocSharedRef('SceneAsset', sceneRes.value); // mint column handle
293
+ * const r = engine.assets.instantiate(handle, world);
294
+ * if (!r.ok) {
295
+ * switch (r.error.code) {
296
+ * case 'asset-not-found':
297
+ * case 'pack-cyclic-reference':
298
+ * // ... AssetErrorCode | PackErrorCode | EcsErrorCode exhaustive
299
+ * }
300
+ * }
301
+ * ```
302
+ */
303
+ instantiate<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World, parent?: EntityHandle): Result<EntityHandle, AssetError | PackError | EcsError>;
304
+ instantiateWithPublicationFence<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World, parent: EntityHandle | undefined, expectedPublication: ScenePublicationFence): Result<EntityHandle, AssetError | PackError | EcsError | ScenePublicationFenceError>;
305
+ /**
306
+ * Materialise a `SceneAsset` FLAT into an existing `World` — the "open a scene
307
+ * for authoring" registry entry (#655): NO synthetic SceneInstance root, NO
308
+ * forced `ChildOf` on top-level members. Returns the top-level entity handles.
309
+ * Nested prefabs (`mounts[]`) still materialise as their own SceneInstance
310
+ * anchors. Use {@link instantiate} (anchor) at runtime / Play and for nested
311
+ * prefabs.
312
+ */
313
+ instantiateFlat<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World): Result<EntityHandle[], AssetError | PackError | EcsError>;
314
+ instantiateFlatWithPublicationFence<T extends SceneAsset>(handle: Handle<TagOf<T>, 'shared'>, world: World, expectedPublication: ScenePublicationFence): Result<EntityHandle[], AssetError | PackError | EcsError | ScenePublicationFenceError>;
315
+ private sceneMeshGuidBySlot;
316
+ private migrateLegacySceneMaterialOverrides;
317
+ private preflightSceneMaterialGraph;
318
+ /**
319
+ * @internal
320
+ * Transform a SceneAsset whose handle-type component fields hold GUID
321
+ * strings (post-parseScenePayload intermediate state) into a copy whose
322
+ * handle fields hold resolved Handle numbers.
323
+ *
324
+ * Schema-driven field detection (plan-strategy D-4): for each component
325
+ * field whose Component.schema fieldType starts with `shared\<`, the
326
+ * value is treated as a GUID string and resolved via `AssetGuid.parse` +
327
+ * catalogue lookup + `world.internSharedRef` (feat-20260614 M8 D-15/D-17;
328
+ * the registry mints nothing). Unknown component names are silently passed
329
+ * through (the ecs layer's additionalProperties check will catch unknowns at
330
+ * spawn if appropriate).
331
+ *
332
+ * Stop-on-first-error (AC-08): the first unresolvable GUID aborts
333
+ * iteration and returns `AssetError(code='asset-not-found')` with a hint
334
+ * containing the GUID string, node localId, and field name for AI-user
335
+ * debuggability (P3).
336
+ */
337
+ _resolveSceneGuids(scene: SceneAsset, world: World, sceneGuidKey?: string, _visitedMountGuids?: Set<string>, _guidToHandle?: Map<string, number>, _resolvedSceneHandles?: Map<string, number>, _materialGraphPreflighted?: boolean): Result<SceneAsset, AssetError>;
338
+ /**
339
+ * Register an asset and return a fresh
340
+ * `Result<Handle<TagOf<T>, 'shared'>, AssetError>`. The brand `target`
341
+ * tag is derived from the Asset's `kind` discriminator via `AssetTagMap`
342
+ * (charter F1 single-entry indexability). The runtime representation is
343
+ * an auto-incrementing u32 starting at 1024 (builtins reserve 1-2).
344
+ *
345
+ * feat-20260526 M4: `shadingModel` field is retired in favour of
346
+ * pass-based MaterialAsset. This generic surface covers the full
347
+ * `Asset` closed union (mesh / texture / sampler / scene / equirect
348
+ * / material).
349
+ */
350
+ /**
351
+ * feat-20260614 M8 (D-15 / D-17): catalogue a payload under its GUID.
352
+ * Replaces the old `register` / `registerWithGuid` mint pair -- the registry
353
+ * stores the PAYLOAD and never produces a handle (it owns no World).
354
+ * Column minting is the caller's job via `world.allocSharedRef`.
355
+ *
356
+ * Validates mesh stride + material passes / sprite slices at catalogue entry
357
+ * (same fail-fast surface as the old register path). Returns
358
+ * `Result.err(AssetError)` on validation failure; `Result.ok(payload)` with
359
+ * the stored payload (mesh payloads gain an `aabb`) on success.
360
+ */
361
+ catalog<T = Asset>(guid: AssetGuid | string, asset: T, refs?: readonly AssetRef[]): Result<T, AssetError>;
362
+ /**
363
+ * @internal feat-20260618-asset-and-pack-name-fields M3 (D-1): the single
364
+ * package-mapping write primitive. All three registration entry points funnel
365
+ * here so the XOR name invariant is implemented once (#1 SSOT):
366
+ * - catalog() inline path -> registerPackage(null, [guid]) (no package)
367
+ * - loadByGuid disk path -> registerPackage(packageUrl, [g1,g2,...], names)
368
+ * - constructor builtin -> registerPackage(null, [...guids]) (D-5 null)
369
+ *
370
+ * `path === null` registers the GUIDs with no package (resolveName reads their
371
+ * storedName or returns ''). A non-null `path` finds-or-creates the shared
372
+ * MutablePackage for that path and adds the GUIDs to it; per-GUID entry names
373
+ * (D-2: name flows entry -> Package, never the payload) are taken from
374
+ * `names`. The 1->N promotion branch (D-3) is added by w11. Never throws --
375
+ * it only writes maps; resolution + validation happen in resolveName / rename.
376
+ */
377
+ _registerPackage(path: string | null, guids: readonly string[], names?: Map<string, string>): void;
378
+ /**
379
+ * Read the per-GUID stored display name (D-6 home: the envelope's `name`
380
+ * field, with `pendingNames` covering the prod-disk ordering where the name is
381
+ * known before the body is catalogued). Single read point for resolveName /
382
+ * the 1->N promotion XOR check.
383
+ */
384
+ private storedNameFor;
385
+ private hasStoredName;
386
+ /**
387
+ * Write the per-GUID stored display name. When the envelope exists, replace it
388
+ * with one carrying the new `name` (the envelope is immutable; D-6 keeps the
389
+ * payload free of the name). Before the envelope is catalogued (prod disk
390
+ * path), stash on `pendingNames` so catalog() can drain it into the new
391
+ * envelope. `name === undefined` clears the name in both homes.
392
+ */
393
+ private setStoredName;
394
+ /**
395
+ * Return the `Package` this GUID belongs to, or `null` when the asset has no
396
+ * package (catalog() inline + builtin, D-5), or `undefined` when the GUID was
397
+ * never registered. The returned `Package` is a readonly snapshot whose
398
+ * `assetCount` is derived from the live member set (#2 Derive).
399
+ */
400
+ packageOf(guid: AssetGuid | string): Package | null | undefined;
401
+ /**
402
+ * Resolve an asset's human-readable display name -- the single source of truth
403
+ * for the two-segment identity's `name` segment (D-6). Every name consumer
404
+ * (inspect / catalog builder / CLI) reads this or the same `deriveAssetName`
405
+ * pure function it delegates to (AC-04); no consumer re-implements the XOR
406
+ * rule. Returns a deterministic fallback rather than throwing on a missing
407
+ * name (AC-15): `basename(path)` for a multi-asset entry that lacks a stored
408
+ * name, or `''` for a no-package asset with no self name (the detectable
409
+ * "genuinely no name" signal, charter P3). An unregistered GUID is treated as
410
+ * the no-package branch.
411
+ */
412
+ resolveName(guid: AssetGuid | string): string;
413
+ /**
414
+ * Rename an asset's display name in memory (D-4). Three classes by package
415
+ * shape:
416
+ * - no-package asset -> set the stored self name
417
+ * - multi-asset package -> set the entry stored name
418
+ * - single-asset package -> rewrite the package path's leaf segment so the
419
+ * derived basename becomes `newName` (the package
420
+ * stays single-asset; the leaf IS the name)
421
+ *
422
+ * In-memory only (OOS-1: no disk write-back). Returns structured failures via
423
+ * the closed `AssetErrorCode` union with no new members (D-4): a name that
424
+ * collides with another member of the same package -> `asset-invalid-value`;
425
+ * an unregistered GUID -> `asset-not-found`. AI users consume `.code` through
426
+ * a `switch`, not by parsing `.message` (charter P3).
427
+ */
428
+ rename(guid: AssetGuid | string, newName: string): Result<void, AssetError>;
429
+ /**
430
+ * Return an `asset-invalid-value` AssetError if another member of `pkg`
431
+ * already resolves to `newName`, else null. Extracted from `rename` to keep
432
+ * the collision-detection control flow flat (D-4 reuses the closed error code;
433
+ * the detail narrows via the `{ field, value, reason }` union variant).
434
+ */
435
+ private nameCollisionIn;
436
+ /**
437
+ * Parse a dash-form GUID string into an `AssetGuid`. Thin convenience over
438
+ * `AssetGuid.parse` for the `loadByGuid` / `catalog` call sites; throws
439
+ * `AssetError` on a malformed GUID (caller-error, mirrors `parseInt`-style
440
+ * eager validation -- the GUID literal is author-supplied, not user data).
441
+ */
442
+ parseGuid(guidStr: string): AssetGuid;
443
+ /**
444
+ * Look up a catalogued payload by GUID, or `undefined` on miss. Used by the
445
+ * ECS/render side (e.g. `walkMaterialParents` in `resolve-asset-handle.ts`)
446
+ * to resolve a payload's embedded sub-asset GUIDs (D-19) without minting.
447
+ */
448
+ lookup<T = Asset>(guid: AssetGuid | string): T | undefined;
449
+ /**
450
+ * feat-20260613-material-paramschema-driven-binding M4 / w23 (D-5 graceful):
451
+ * Return the texture-field name set for the given material-shader id,
452
+ * derived from the registered shader's paramSchema via `derive(paramSchema)
453
+ * .textureFieldNames`. Returns `undefined` when the shader is not yet
454
+ * registered (cross-worktree shader-late-register, plan R-4).
455
+ *
456
+ * Used by `extractFrame` to know which values fields the shader
457
+ * declares as texture handles; the extract layer validates handle-vs-
458
+ * scalar typing and drops misclassified slots so the record stage's
459
+ * MISSING_TEXTURE_HANDLE fallback can take over (white default texture)
460
+ * rather than letting a stray handle reach `device.createBindGroup`.
461
+ *
462
+ * feat-20260705-runtime-tier2-decomposition M1 / w5 (D-4): delegates to the
463
+ * extracted `./registry/validate-material` free function (signature stable).
464
+ */
465
+ materialShaderTextureFieldNames(shaderId: string): ReadonlySet<string> | undefined;
466
+ /**
467
+ * Load an asset and all its transitively referenced sub-assets by GUID.
468
+ * The result is a durable Asset payload. Consumer owners may narrow the
469
+ * success type, then call their own World/Host projection; this registry does
470
+ * not create a generic GUID-to-handle materializer.
471
+ * Delegates to the load-by-guid collaboration module (w7 / D-4); see
472
+ * registry/load-by-guid.ts for the full DDC / pack-fetch pipeline.
473
+ */
474
+ loadByGuid<T = Asset>(guid: AssetGuid, parentContext?: {
475
+ sceneEntityId?: number;
476
+ componentField?: string;
477
+ }): Promise<Result<T, AssetError | ImageError | RhiError>>;
478
+ /**
479
+ * Dispatch a pack payload through the injected LoaderRegistry. Delegates to
480
+ * the load-by-guid collaboration module (w7 / D-4). Kept as a class method so
481
+ * existing structural-cast test access keeps resolving.
482
+ */
483
+ parseAssetPayload(kind: string, payload: Record<string, unknown>, refs?: string[]): Asset | Record<string, unknown> | undefined | {
484
+ readonly ok: false;
485
+ readonly error: ParseErrorDetail;
486
+ };
487
+ /**
488
+ * Parse a pack asset entry and return the payload + refs. Delegates to the
489
+ * load-by-guid collaboration module (w7 / D-4). Kept as a class method so
490
+ * existing structural-cast test access keeps resolving.
491
+ */
492
+ parseAndReturnAsset(assetEntry: {
493
+ kind: string;
494
+ payload: Record<string, unknown>;
495
+ refs?: string[];
496
+ }): Result<{
497
+ asset: Asset;
498
+ refs: readonly string[];
499
+ }, AssetError>;
500
+ /** Return the legacy catalog snapshot when no GUID is supplied. */
501
+ inspect(): InspectSnapshot;
502
+ /** Return joined source/cook/package/runtime evidence for one GUID. */
503
+ inspect(guid: string): Promise<Result<AssetEvidence, AssetEvidenceError>>;
504
+ /** Verify the same GUID evidence chain through the injected SDK capability. */
505
+ verifyByGuid(guid: string): Promise<Result<AssetEvidence, AssetEvidenceError>>;
506
+ /**
507
+ * Return a readonly snapshot of all catalogued assets (inlined + pack-index)
508
+ * for enumeration by asset panels (AC-03 single source of truth).
509
+ *
510
+ * Merges entries from the private `packIndexCache` (prod path, carries
511
+ * `packageUrl`) and `assetCatalog` (inlined / dev path, no URL). Each
512
+ * GUID appears exactly once. Returns a fresh array on every call — the
513
+ * internal Maps are never exposed (charter P4 consistent abstraction).
514
+ *
515
+ * plan-strategy section 2 D1; requirements AC-03; research Finding 5.
516
+ *
517
+ * @example
518
+ * ```ts
519
+ * for (const e of registry.listCatalog()) {
520
+ * console.log(e.guid, e.kind, e.name, e.packageUrl);
521
+ * }
522
+ * ```
523
+ */
524
+ listCatalog(): readonly {
525
+ guid: string;
526
+ kind: string;
527
+ name?: string;
528
+ packageUrl: string;
529
+ packageId?: CatalogEntry['packageId'];
530
+ provenance?: CatalogEntry['provenance'];
531
+ revision?: CatalogEntry['revision'];
532
+ sourceKey?: CatalogEntry['sourceKey'];
533
+ sourceIndex?: CatalogEntry['sourceIndex'];
534
+ sourceOverrides?: CatalogEntry['sourceOverrides'];
535
+ sourceOverrideDescriptors?: CatalogEntry['sourceOverrideDescriptors'];
536
+ authoring?: CatalogEntry['authoring'];
537
+ relations?: CatalogEntry['relations'];
538
+ diagnostics?: CatalogEntry['diagnostics'];
539
+ refs?: readonly string[];
540
+ subject?: import('@forgeax/engine-types').CatalogSubject;
541
+ execution?: import('@forgeax/engine-types').CookExecution;
542
+ lifecycle?: import('@forgeax/engine-types').CatalogLifecycle;
543
+ projection?: import('@forgeax/engine-types').CatalogProjection;
544
+ /**
545
+ * On-disk source-file path for external imported assets (FBX / GLB / HDR /
546
+ * audio / font), relative to the game root. Editors locate the
547
+ * `.meta.json` sidecar via `sourcePath + '.meta.json'` for CRUD; unlike
548
+ * `packageUrl` (the runtime load artefact) it is stable across DDC cook
549
+ * state. `undefined` for inline / dev-path assets (no sidecar, no CRUD).
550
+ */
551
+ sourcePath?: string;
552
+ }[];
553
+ }
554
+ //# sourceMappingURL=asset-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-registry.d.ts","sourceRoot":"","sources":["../src/asset-registry.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAW,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EAEb,KAAK,YAAY,EAEjB,KAAK,aAAa,EAClB,KAAK,MAAM,EAEX,KAAK,UAAU,EACf,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,MAAM,EAIX,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAGf,KAAK,KAAK,EAEV,KAAK,aAAa,EAClB,KAAK,SAAS,IAAI,cAAc,EAEjC,MAAM,uBAAuB,CAAC;AAS/B,OA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,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"}
@@ -0,0 +1,24 @@
1
+ import { type Result } from '@forgeax/engine-rhi';
2
+ import { AssetError, type CatalogDelta, type CatalogEntry, type ResourceRevision, type RuntimeAssetBinding } from '@forgeax/engine-types';
3
+ export type CatalogListener = (delta: CatalogDelta) => void;
4
+ /** Read-only catalog source backed by static entries or a canonical URL. */
5
+ export interface CatalogSource {
6
+ enumerate(): Promise<Result<readonly CatalogEntry[], AssetError>>;
7
+ subscribe(listener: CatalogListener): () => void;
8
+ readonly expectedScope?: Pick<RuntimeAssetBinding, 'scopeId' | 'generation'>;
9
+ }
10
+ /**
11
+ * Create a read-only catalog source while preserving the schema SSOT.
12
+ *
13
+ * Static and fetched sources use the same `CatalogEntry` and revision fields;
14
+ * an expected revision rejects unverified data before it reaches consumers.
15
+ */
16
+ export declare function createCatalogSource(options: {
17
+ readonly url?: string;
18
+ readonly entries?: readonly CatalogEntry[];
19
+ readonly fetch?: typeof globalThis.fetch;
20
+ readonly expectedRevision?: ResourceRevision;
21
+ readonly expectedScope?: Pick<RuntimeAssetBinding, 'scopeId' | 'generation'>;
22
+ readonly subscribe?: (listener: CatalogListener) => () => void;
23
+ }): CatalogSource;
24
+ //# sourceMappingURL=catalog-source.d.ts.map
@@ -0,0 +1 @@
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;CAC9E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACzC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,IAAI,CAAC;CAChE,GAAG,aAAa,CAuDhB"}