@carbonenginejs/runtime-resource 0.9.2 → 0.11.0

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 (544) hide show
  1. package/NOTICE +3 -2
  2. package/README.md +47 -6
  3. package/dist/CjsMotherLode.js +88 -88
  4. package/dist/CjsMotherLode.js.map +1 -1
  5. package/dist/CjsResMan.js +717 -228
  6. package/dist/CjsResMan.js.map +1 -1
  7. package/dist/CjsResManFetchProvider.js +94 -0
  8. package/dist/CjsResManFetchProvider.js.map +1 -0
  9. package/dist/{CjsResManQueue.js → CjsResManWorkQueue.js} +112 -25
  10. package/dist/CjsResManWorkQueue.js.map +1 -0
  11. package/dist/format/CjsBlueReader.js +89 -0
  12. package/dist/format/CjsBlueReader.js.map +1 -1
  13. package/dist/format/CjsFormat.js +42 -16
  14. package/dist/format/CjsFormat.js.map +1 -1
  15. package/dist/format/CjsReader.js +4 -0
  16. package/dist/format/CjsReader.js.map +1 -1
  17. package/dist/format/CjsResourceProbe.js +2 -0
  18. package/dist/format/CjsResourceProbe.js.map +1 -1
  19. package/dist/format/effect/effectPermutationGraph.js +257 -0
  20. package/dist/format/effect/effectPermutationGraph.js.map +1 -0
  21. package/dist/format/effect/effectReflectionPackage.js +636 -0
  22. package/dist/format/effect/effectReflectionPackage.js.map +1 -0
  23. package/dist/format/effect/sha256.js +114 -0
  24. package/dist/format/effect/sha256.js.map +1 -0
  25. package/dist/format/payloadContract.js +20 -0
  26. package/dist/format/payloadContract.js.map +1 -1
  27. package/dist/formats/black/CjsBlackFormat.js +15 -1
  28. package/dist/formats/black/CjsBlackFormat.js.map +1 -1
  29. package/dist/formats/black/core/CjsBlackBinaryReader.js +103 -0
  30. package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
  31. package/dist/formats/black/core/CjsBlackPropertyReaders.js +61 -0
  32. package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
  33. package/dist/formats/black/core/CjsBlackReader.js +125 -0
  34. package/dist/formats/black/core/CjsBlackReader.js.map +1 -1
  35. package/dist/formats/black/core/CjsBlackSchemaRegistry.js +103 -0
  36. package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
  37. package/dist/formats/black/core/helpers.js +17 -0
  38. package/dist/formats/black/core/helpers.js.map +1 -1
  39. package/dist/formats/bnk/CjsBnkFormat.js +8 -0
  40. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  41. package/dist/formats/bnk/core/helpers.js +20 -0
  42. package/dist/formats/bnk/core/helpers.js.map +1 -1
  43. package/dist/formats/bnk/core/musicNodes.js +40 -3
  44. package/dist/formats/bnk/core/musicNodes.js.map +1 -1
  45. package/dist/formats/bnk/core/soundbanksInfo.js +2 -0
  46. package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
  47. package/dist/formats/cmf/core/binary.js +71 -0
  48. package/dist/formats/cmf/core/binary.js.map +1 -1
  49. package/dist/formats/cmf/core/buffers.js +4 -0
  50. package/dist/formats/cmf/core/buffers.js.map +1 -1
  51. package/dist/formats/cmf/core/helpers.js +31 -0
  52. package/dist/formats/cmf/core/helpers.js.map +1 -1
  53. package/dist/formats/cmf/core/schema.js +10 -0
  54. package/dist/formats/cmf/core/schema.js.map +1 -1
  55. package/dist/formats/cmf/core/shared.js +9 -0
  56. package/dist/formats/cmf/core/shared.js.map +1 -1
  57. package/dist/formats/cmf/core/writer.js +54 -0
  58. package/dist/formats/cmf/core/writer.js.map +1 -1
  59. package/dist/formats/dds/core/bc6h.js +10 -0
  60. package/dist/formats/dds/core/bc6h.js.map +1 -1
  61. package/dist/formats/dds/core/bc7.js +16 -0
  62. package/dist/formats/dds/core/bc7.js.map +1 -1
  63. package/dist/formats/dds/core/helpers.js +47 -0
  64. package/dist/formats/dds/core/helpers.js.map +1 -1
  65. package/dist/formats/dxbc/CjsDxbcFormat.js +142 -0
  66. package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -0
  67. package/dist/formats/dxbc/core/DxbcReader.js +266 -0
  68. package/dist/formats/dxbc/core/DxbcReader.js.map +1 -0
  69. package/dist/formats/dxbc/core/container.js +169 -0
  70. package/dist/formats/dxbc/core/container.js.map +1 -0
  71. package/dist/formats/dxbc/core/decoder.js +789 -0
  72. package/dist/formats/dxbc/core/decoder.js.map +1 -0
  73. package/dist/formats/dxbc/core/errors.js +19 -0
  74. package/dist/formats/dxbc/core/errors.js.map +1 -0
  75. package/dist/formats/dxbc/core/helpers.js +220 -0
  76. package/dist/formats/dxbc/core/helpers.js.map +1 -0
  77. package/dist/formats/dxbc/core/opcodes.js +45 -0
  78. package/dist/formats/dxbc/core/opcodes.js.map +1 -0
  79. package/dist/formats/dxbc/core/program.js +91 -0
  80. package/dist/formats/dxbc/core/program.js.map +1 -0
  81. package/dist/formats/dxbc/core/signature.js +172 -0
  82. package/dist/formats/dxbc/core/signature.js.map +1 -0
  83. package/dist/formats/dxbc/index.js +2 -0
  84. package/dist/formats/dxbc/index.js.map +1 -0
  85. package/dist/formats/fbx/core/helpers.js +21 -0
  86. package/dist/formats/fbx/core/helpers.js.map +1 -1
  87. package/dist/formats/flac/CjsFlacFormat.js +49 -0
  88. package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
  89. package/dist/formats/flac/core/helpers.js +20 -0
  90. package/dist/formats/flac/core/helpers.js.map +1 -1
  91. package/dist/formats/gif/CjsGifFormat.js +49 -0
  92. package/dist/formats/gif/CjsGifFormat.js.map +1 -1
  93. package/dist/formats/gif/core/helpers.js +20 -0
  94. package/dist/formats/gif/core/helpers.js.map +1 -1
  95. package/dist/formats/gltf/core/helpers.js +15 -0
  96. package/dist/formats/gltf/core/helpers.js.map +1 -1
  97. package/dist/formats/gltf/core/parser.js +13 -0
  98. package/dist/formats/gltf/core/parser.js.map +1 -1
  99. package/dist/formats/gltf/core/targets.js +10 -0
  100. package/dist/formats/gltf/core/targets.js.map +1 -1
  101. package/dist/formats/gr2/core/bitknit2.js +2 -0
  102. package/dist/formats/gr2/core/bitknit2.js.map +1 -1
  103. package/dist/formats/gr2/core/helpers.js +20 -0
  104. package/dist/formats/gr2/core/helpers.js.map +1 -1
  105. package/dist/formats/gr2/core/targets.js +10 -0
  106. package/dist/formats/gr2/core/targets.js.map +1 -1
  107. package/dist/formats/hlsl/CjsHlslFormat.js +254 -0
  108. package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -0
  109. package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -0
  110. package/dist/formats/hlsl/core/HlslBinaryUtils.js.map +1 -0
  111. package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -0
  112. package/dist/formats/hlsl/core/HlslEffectReadError.js.map +1 -0
  113. package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -0
  114. package/dist/formats/hlsl/core/HlslEffectStateManager.js.map +1 -0
  115. package/dist/formats/hlsl/core/HlslReader.js +266 -0
  116. package/dist/formats/hlsl/core/HlslReader.js.map +1 -0
  117. package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -0
  118. package/dist/formats/hlsl/core/HlslRenderStateSetup.js.map +1 -0
  119. package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -0
  120. package/dist/formats/hlsl/core/HlslResourceSetDescription.js.map +1 -0
  121. package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -0
  122. package/dist/formats/hlsl/core/HlslShaderBytecode.js.map +1 -0
  123. package/dist/formats/hlsl/core/analysis.js +51 -0
  124. package/dist/formats/hlsl/core/analysis.js.map +1 -0
  125. package/dist/formats/hlsl/core/helpers.js +270 -0
  126. package/dist/formats/hlsl/core/helpers.js.map +1 -0
  127. package/dist/formats/hlsl/core/json.js +284 -0
  128. package/dist/formats/hlsl/core/json.js.map +1 -0
  129. package/dist/formats/hlsl/core/metadata.js +327 -0
  130. package/dist/formats/hlsl/core/metadata.js.map +1 -0
  131. package/dist/formats/hlsl/core/portableReflection.js +848 -0
  132. package/dist/formats/hlsl/core/portableReflection.js.map +1 -0
  133. package/dist/formats/hlsl/core/render-states.js +280 -0
  134. package/dist/formats/hlsl/core/render-states.js.map +1 -0
  135. package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -0
  136. package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js.map +1 -0
  137. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +294 -0
  138. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -0
  139. package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -0
  140. package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js.map +1 -0
  141. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -0
  142. package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -0
  143. package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -0
  144. package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js.map +1 -0
  145. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +742 -0
  146. package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -0
  147. package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -0
  148. package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js.map +1 -0
  149. package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -0
  150. package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js.map +1 -0
  151. package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -0
  152. package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js.map +1 -0
  153. package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -0
  154. package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -0
  155. package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -0
  156. package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js.map +1 -0
  157. package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -0
  158. package/dist/formats/hlsl/core/tr2/shader/HlslPass.js.map +1 -0
  159. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -0
  160. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js.map +1 -0
  161. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -0
  162. package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js.map +1 -0
  163. package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -0
  164. package/dist/formats/hlsl/core/tr2/shader/HlslShader.js.map +1 -0
  165. package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -0
  166. package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js.map +1 -0
  167. package/dist/formats/hlsl/index.js +2 -0
  168. package/dist/formats/hlsl/index.js.map +1 -0
  169. package/dist/formats/hlsl/portable.js +2 -0
  170. package/dist/formats/hlsl/portable.js.map +1 -0
  171. package/dist/formats/index.js +4 -0
  172. package/dist/formats/index.js.map +1 -1
  173. package/dist/formats/jpeg/core/helpers.js +52 -0
  174. package/dist/formats/jpeg/core/helpers.js.map +1 -1
  175. package/dist/formats/jpeg/core/jpeg.js +93 -0
  176. package/dist/formats/jpeg/core/jpeg.js.map +1 -1
  177. package/dist/formats/mp3/core/helpers.js +37 -0
  178. package/dist/formats/mp3/core/helpers.js.map +1 -1
  179. package/dist/formats/mp4/core/helpers.js +35 -0
  180. package/dist/formats/mp4/core/helpers.js.map +1 -1
  181. package/dist/formats/ogg/CjsOggFormat.js +49 -0
  182. package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
  183. package/dist/formats/ogg/core/helpers.js +23 -0
  184. package/dist/formats/ogg/core/helpers.js.map +1 -1
  185. package/dist/formats/ogg/core/vorbis.js +13 -0
  186. package/dist/formats/ogg/core/vorbis.js.map +1 -1
  187. package/dist/formats/png/core/helpers.js +52 -0
  188. package/dist/formats/png/core/helpers.js.map +1 -1
  189. package/dist/formats/red/CjsRedFormat.js +2 -0
  190. package/dist/formats/red/CjsRedFormat.js.map +1 -1
  191. package/dist/formats/red/core/CjsRedReader.js +52 -0
  192. package/dist/formats/red/core/CjsRedReader.js.map +1 -1
  193. package/dist/formats/red/core/helpers.js +19 -0
  194. package/dist/formats/red/core/helpers.js.map +1 -1
  195. package/dist/formats/stl/core/stl.js +8 -0
  196. package/dist/formats/stl/core/stl.js.map +1 -1
  197. package/dist/formats/stl/core/targets.js +10 -0
  198. package/dist/formats/stl/core/targets.js.map +1 -1
  199. package/dist/formats/tga/core/helpers.js +47 -0
  200. package/dist/formats/tga/core/helpers.js.map +1 -1
  201. package/dist/formats/wav/core/helpers.js +37 -0
  202. package/dist/formats/wav/core/helpers.js.map +1 -1
  203. package/dist/formats/webgl/CjsWebglFormat.js +221 -0
  204. package/dist/formats/webgl/CjsWebglFormat.js.map +1 -0
  205. package/dist/formats/webgl/core/cewg/CewgPackage.js +339 -0
  206. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -0
  207. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +104 -0
  208. package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +1 -0
  209. package/dist/formats/webgl/core/cewg/binary.js +101 -0
  210. package/dist/formats/webgl/core/cewg/binary.js.map +1 -0
  211. package/dist/formats/webgl/core/cewgCompleteness.js +81 -0
  212. package/dist/formats/webgl/core/cewgCompleteness.js.map +1 -0
  213. package/dist/formats/webgl/core/effectPackage.js +789 -0
  214. package/dist/formats/webgl/core/effectPackage.js.map +1 -0
  215. package/dist/formats/webgl/core/effectPackageValidation.js +331 -0
  216. package/dist/formats/webgl/core/effectPackageValidation.js.map +1 -0
  217. package/dist/formats/webgl/core/errors.js +27 -0
  218. package/dist/formats/webgl/core/errors.js.map +1 -0
  219. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2678 -0
  220. package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -0
  221. package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -0
  222. package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +1 -0
  223. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +428 -0
  224. package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -0
  225. package/dist/formats/webgl/core/helpers.js +306 -0
  226. package/dist/formats/webgl/core/helpers.js.map +1 -0
  227. package/dist/formats/webgl/index.js +2 -0
  228. package/dist/formats/webgl/index.js.map +1 -0
  229. package/dist/formats/webgpu/CjsWebgpuFormat.js +376 -0
  230. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -0
  231. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +415 -0
  232. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +1 -0
  233. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +100 -0
  234. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +1 -0
  235. package/dist/formats/webgpu/core/cewgpu/binary.js +93 -0
  236. package/dist/formats/webgpu/core/cewgpu/binary.js.map +1 -0
  237. package/dist/formats/webgpu/core/cewgpu/tags.js +17 -0
  238. package/dist/formats/webgpu/core/cewgpu/tags.js.map +1 -0
  239. package/dist/formats/webgpu/core/effectAnalysis.js +82 -0
  240. package/dist/formats/webgpu/core/effectAnalysis.js.map +1 -0
  241. package/dist/formats/webgpu/core/effectBackendBodySet.js +305 -0
  242. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -0
  243. package/dist/formats/webgpu/core/effectPackageValidation.js +1078 -0
  244. package/dist/formats/webgpu/core/effectPackageValidation.js.map +1 -0
  245. package/dist/formats/webgpu/core/errors.js +20 -0
  246. package/dist/formats/webgpu/core/errors.js.map +1 -0
  247. package/dist/formats/webgpu/core/helpers.js +448 -0
  248. package/dist/formats/webgpu/core/helpers.js.map +1 -0
  249. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +223 -0
  250. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -0
  251. package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -0
  252. package/dist/formats/webgpu/core/ir/buildControlFlow.js.map +1 -0
  253. package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -0
  254. package/dist/formats/webgpu/core/ir/indexableTemps.js.map +1 -0
  255. package/dist/formats/webgpu/core/ir/inferValueTypes.js +454 -0
  256. package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -0
  257. package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -0
  258. package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -0
  259. package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -0
  260. package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js.map +1 -0
  261. package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -0
  262. package/dist/formats/webgpu/core/ir/sourceLanes.js.map +1 -0
  263. package/dist/formats/webgpu/core/packageEffect.js +300 -0
  264. package/dist/formats/webgpu/core/packageEffect.js.map +1 -0
  265. package/dist/formats/webgpu/core/packageEffectSelection.js +164 -0
  266. package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -0
  267. package/dist/formats/webgpu/core/packageMetadata.js +8 -0
  268. package/dist/formats/webgpu/core/packageMetadata.js.map +1 -0
  269. package/dist/formats/webgpu/core/schema.js +4 -0
  270. package/dist/formats/webgpu/core/schema.js.map +1 -0
  271. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +275 -0
  272. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -0
  273. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +182 -0
  274. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -0
  275. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +324 -0
  276. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -0
  277. package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -0
  278. package/dist/formats/webgpu/core/wgsl/emitWgsl.js.map +1 -0
  279. package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -0
  280. package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js.map +1 -0
  281. package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -0
  282. package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -0
  283. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +754 -0
  284. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -0
  285. package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -0
  286. package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -0
  287. package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -0
  288. package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js.map +1 -0
  289. package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -0
  290. package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js.map +1 -0
  291. package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -0
  292. package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js.map +1 -0
  293. package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -0
  294. package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js.map +1 -0
  295. package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -0
  296. package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js.map +1 -0
  297. package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -0
  298. package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js.map +1 -0
  299. package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -0
  300. package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js.map +1 -0
  301. package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -0
  302. package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js.map +1 -0
  303. package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -0
  304. package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js.map +1 -0
  305. package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -0
  306. package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js.map +1 -0
  307. package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -0
  308. package/dist/formats/webgpu/core/wgsl/precisionControls.js.map +1 -0
  309. package/dist/formats/webgpu/core/wgsl/selectionPlans.js +758 -0
  310. package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -0
  311. package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -0
  312. package/dist/formats/webgpu/core/wgsl/uniformity.js.map +1 -0
  313. package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -0
  314. package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js.map +1 -0
  315. package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -0
  316. package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js.map +1 -0
  317. package/dist/formats/webgpu/index.js +2 -0
  318. package/dist/formats/webgpu/index.js.map +1 -0
  319. package/dist/formats/webm/core/helpers.js +35 -0
  320. package/dist/formats/webm/core/helpers.js.map +1 -1
  321. package/dist/formats/webp/CjsWebpFormat.js +49 -0
  322. package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
  323. package/dist/formats/webp/core/helpers.js +23 -0
  324. package/dist/formats/webp/core/helpers.js.map +1 -1
  325. package/dist/formats/wem/CjsWemFormat.js +8 -0
  326. package/dist/formats/wem/CjsWemFormat.js.map +1 -1
  327. package/dist/formats/wem/core/bitStream.js +2 -0
  328. package/dist/formats/wem/core/bitStream.js.map +1 -1
  329. package/dist/formats/wem/core/helpers.js +20 -0
  330. package/dist/formats/wem/core/helpers.js.map +1 -1
  331. package/dist/formats/yaml/CjsYamlFormat.js +45 -0
  332. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  333. package/dist/formats/yaml/core/CjsYamlReader.js +91 -0
  334. package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
  335. package/dist/formats/yaml/core/helpers.js +10 -0
  336. package/dist/formats/yaml/core/helpers.js.map +1 -1
  337. package/dist/index.js +56 -43
  338. package/dist/index.js.map +1 -1
  339. package/dist/{CjsResource.js → resource/CjsResource.js} +232 -17
  340. package/dist/resource/CjsResource.js.map +1 -0
  341. package/dist/{resources → resource}/Tr2LightProfileRes.js +4 -3
  342. package/dist/resource/Tr2LightProfileRes.js.map +1 -0
  343. package/dist/{resources → resource/audio}/AudioGeometryResData.js +1 -1
  344. package/dist/resource/audio/AudioGeometryResData.js.map +1 -0
  345. package/dist/resource/audio/CjsAudioBufferRes.js +86 -0
  346. package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -0
  347. package/dist/resource/audio/CjsAudioRes.js +213 -0
  348. package/dist/resource/audio/CjsAudioRes.js.map +1 -0
  349. package/dist/resource/audio/index.js +4 -0
  350. package/dist/resource/audio/index.js.map +1 -0
  351. package/dist/{resources → resource/geometry}/MeshDecalData.js +1 -1
  352. package/dist/resource/geometry/MeshDecalData.js.map +1 -0
  353. package/dist/{resources → resource/geometry}/MeshDecalLodData.js +1 -1
  354. package/dist/resource/geometry/MeshDecalLodData.js.map +1 -0
  355. package/dist/resource/geometry/TriGeometryRes.js +656 -0
  356. package/dist/resource/geometry/TriGeometryRes.js.map +1 -0
  357. package/dist/{resources → resource/geometry}/TriGeometryResAreaData.js +1 -1
  358. package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -0
  359. package/dist/{resources → resource/geometry}/TriGeometryResJointData.js +1 -1
  360. package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -0
  361. package/dist/{resources → resource/geometry}/TriGeometryResLodData.js +1 -1
  362. package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -0
  363. package/dist/{resources → resource/geometry}/TriGeometryResMeshData.js +1 -1
  364. package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -0
  365. package/dist/{resources → resource/geometry}/TriGeometryResSkeletonData.js +1 -1
  366. package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -0
  367. package/dist/{resources → resource/geometry}/TriJointBinding.js +1 -1
  368. package/dist/resource/geometry/TriJointBinding.js.map +1 -0
  369. package/dist/{resources → resource/geometry}/TriMorphTargetGeometryConstants.js +1 -1
  370. package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -0
  371. package/dist/{resources → resource/geometry}/TriRtGeometryConstants.js +1 -1
  372. package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -0
  373. package/dist/{resources → resource/geometry/granny}/GStateBindingCallbackData.js +1 -1
  374. package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -0
  375. package/dist/{resources → resource/geometry/granny}/Tr2GrannyIntersectionResult.js +1 -1
  376. package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -0
  377. package/dist/{resources → resource/geometry/granny}/Tr2GrannyStateRes.js +6 -5
  378. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -0
  379. package/dist/{resources → resource/geometry/granny}/TriGrannyRes.js +6 -5
  380. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -0
  381. package/dist/{resources → resource/geometry/granny}/enums.js +1 -9
  382. package/dist/resource/geometry/granny/enums.js.map +1 -0
  383. package/dist/resource/geometry/granny/index.js +6 -0
  384. package/dist/resource/geometry/granny/index.js.map +1 -0
  385. package/dist/resource/geometry/index.js +17 -0
  386. package/dist/resource/geometry/index.js.map +1 -0
  387. package/dist/resource/index.js +52 -0
  388. package/dist/resource/index.js.map +1 -0
  389. package/dist/resource/resourceBoundary.js +64 -0
  390. package/dist/resource/resourceBoundary.js.map +1 -0
  391. package/dist/resource/shader/Tr2EffectRes.js +429 -0
  392. package/dist/resource/shader/Tr2EffectRes.js.map +1 -0
  393. package/dist/resource/shader/Tr2MaterialArea.js +34 -0
  394. package/dist/resource/shader/Tr2MaterialArea.js.map +1 -0
  395. package/dist/resource/shader/Tr2MaterialMesh.js +30 -0
  396. package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -0
  397. package/dist/resource/shader/Tr2MaterialRes.js +35 -0
  398. package/dist/resource/shader/Tr2MaterialRes.js.map +1 -0
  399. package/dist/resource/shader/Tr2Shader.js +256 -0
  400. package/dist/resource/shader/Tr2Shader.js.map +1 -0
  401. package/dist/resource/shader/Tr2ShaderPermutation.js +47 -0
  402. package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -0
  403. package/dist/resource/shader/index.js +17 -0
  404. package/dist/resource/shader/index.js.map +1 -0
  405. package/dist/resource/shader/portable.js +33 -0
  406. package/dist/resource/shader/portable.js.map +1 -0
  407. package/dist/resource/shader/reflection/Tr2EffectConstant.js +135 -0
  408. package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -0
  409. package/dist/resource/shader/reflection/Tr2EffectDefine.js +28 -0
  410. package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -0
  411. package/dist/resource/shader/reflection/Tr2EffectDescription.js +107 -0
  412. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -0
  413. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +145 -0
  414. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -0
  415. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +103 -0
  416. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -0
  417. package/dist/resource/shader/reflection/Tr2EffectResource.js +84 -0
  418. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -0
  419. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +239 -0
  420. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -0
  421. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +66 -0
  422. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -0
  423. package/dist/resource/shader/reflection/Tr2Pass.js +109 -0
  424. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -0
  425. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +75 -0
  426. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -0
  427. package/dist/{texture → resource/texture}/CjsTextureArrayRes.js +83 -6
  428. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -0
  429. package/dist/{texture/CjsTextureParameterProxy.js → resource/texture/CjsTextureArrayResParameterProxy.js} +56 -10
  430. package/dist/resource/texture/CjsTextureArrayResParameterProxy.js.map +1 -0
  431. package/dist/{resources → resource/texture}/Tr2ImageRes.js +6 -4
  432. package/dist/resource/texture/Tr2ImageRes.js.map +1 -0
  433. package/dist/{resources → resource/texture}/Tr2TextureLodManager.js +3 -1
  434. package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -0
  435. package/dist/{resources → resource/texture}/Tr2TextureLodUpdateRequest.js +1 -1
  436. package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -0
  437. package/dist/{resources → resource/texture}/Tr2TexturePackChannel.js +1 -1
  438. package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -0
  439. package/dist/{resources → resource/texture}/Tr2TexturePipeline.js +6 -4
  440. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -0
  441. package/dist/{resources → resource/texture}/Tr2TexturePipelineParams.js +1 -1
  442. package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -0
  443. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepCompress.js +1 -1
  444. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -0
  445. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepGenerateMips.js +1 -1
  446. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
  447. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLimitSize.js +1 -1
  448. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -0
  449. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLoad.js +1 -1
  450. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -0
  451. package/dist/{resources → resource/texture}/Tr2TexturePipelineStepPack.js +1 -1
  452. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -0
  453. package/dist/{resources → resource/texture}/TriTextureRes.js +42 -26
  454. package/dist/resource/texture/TriTextureRes.js.map +1 -0
  455. package/dist/resource/texture/index.js +15 -0
  456. package/dist/resource/texture/index.js.map +1 -0
  457. package/dist/{resources → resource/texture}/texturePipelineBehavior.js +59 -59
  458. package/dist/resource/texture/texturePipelineBehavior.js.map +1 -0
  459. package/dist/worker/CjsResManMainThreadLoader.js +87 -0
  460. package/dist/worker/CjsResManMainThreadLoader.js.map +1 -0
  461. package/dist/worker/CjsResManWorker.js +217 -0
  462. package/dist/worker/CjsResManWorker.js.map +1 -0
  463. package/dist/worker/CjsResManWorkerLoader.js +434 -0
  464. package/dist/worker/CjsResManWorkerLoader.js.map +1 -0
  465. package/dist/worker/protocol.js +12 -0
  466. package/dist/worker/protocol.js.map +1 -0
  467. package/docs/README.md +16 -3
  468. package/docs/architecture.md +39 -16
  469. package/docs/concepts/resource-lifecycle.md +2 -1
  470. package/docs/formats/README.md +8 -0
  471. package/docs/formats/provenance.md +11 -3
  472. package/docs/reference/classes/README.md +6 -4
  473. package/docs/reference/classes/audio.md +30 -0
  474. package/docs/reference/classes/core.md +31 -11
  475. package/docs/reference/classes/formats.md +440 -0
  476. package/docs/reference/classes/resources.md +151 -41
  477. package/docs/reference/classes/texture.md +7 -7
  478. package/docs/reference/motherlode-cache.md +17 -0
  479. package/docs/reference/queues.md +9 -1
  480. package/docs/reference/workers.md +135 -0
  481. package/docs/roadmap.md +27 -1
  482. package/format-notices/dxbc/LICENSE +21 -0
  483. package/format-notices/dxbc/NOTICE +20 -0
  484. package/format-notices/hlsl/LICENSE +21 -0
  485. package/format-notices/hlsl/NOTICE +25 -0
  486. package/format-notices/webgl/LICENSE +21 -0
  487. package/format-notices/webgl/NOTICE +35 -0
  488. package/format-notices/webgpu/LICENSE +21 -0
  489. package/format-notices/webgpu/NOTICE +31 -0
  490. package/package.json +13 -1
  491. package/dist/CjsResManQueue.js.map +0 -1
  492. package/dist/CjsResource.js.map +0 -1
  493. package/dist/CjsResourceSource.js +0 -68
  494. package/dist/CjsResourceSource.js.map +0 -1
  495. package/dist/resourcePath.js +0 -18
  496. package/dist/resourcePath.js.map +0 -1
  497. package/dist/resourceStates.js +0 -9
  498. package/dist/resourceStates.js.map +0 -1
  499. package/dist/resources/AudioGeometryResData.js.map +0 -1
  500. package/dist/resources/GStateBindingCallbackData.js.map +0 -1
  501. package/dist/resources/MeshDecalData.js.map +0 -1
  502. package/dist/resources/MeshDecalLodData.js.map +0 -1
  503. package/dist/resources/Tr2EffectRes.js +0 -71
  504. package/dist/resources/Tr2EffectRes.js.map +0 -1
  505. package/dist/resources/Tr2GrannyIntersectionResult.js.map +0 -1
  506. package/dist/resources/Tr2GrannyStateRes.js.map +0 -1
  507. package/dist/resources/Tr2ImageRes.js.map +0 -1
  508. package/dist/resources/Tr2LightProfileRes.js.map +0 -1
  509. package/dist/resources/Tr2MaterialArea.js +0 -34
  510. package/dist/resources/Tr2MaterialArea.js.map +0 -1
  511. package/dist/resources/Tr2MaterialMesh.js +0 -31
  512. package/dist/resources/Tr2MaterialMesh.js.map +0 -1
  513. package/dist/resources/Tr2MaterialRes.js +0 -34
  514. package/dist/resources/Tr2MaterialRes.js.map +0 -1
  515. package/dist/resources/Tr2ShaderPermutation.js +0 -43
  516. package/dist/resources/Tr2ShaderPermutation.js.map +0 -1
  517. package/dist/resources/Tr2TextureLodManager.js.map +0 -1
  518. package/dist/resources/Tr2TextureLodUpdateRequest.js.map +0 -1
  519. package/dist/resources/Tr2TexturePackChannel.js.map +0 -1
  520. package/dist/resources/Tr2TexturePipeline.js.map +0 -1
  521. package/dist/resources/Tr2TexturePipelineParams.js.map +0 -1
  522. package/dist/resources/Tr2TexturePipelineStepCompress.js.map +0 -1
  523. package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +0 -1
  524. package/dist/resources/Tr2TexturePipelineStepLimitSize.js.map +0 -1
  525. package/dist/resources/Tr2TexturePipelineStepLoad.js.map +0 -1
  526. package/dist/resources/Tr2TexturePipelineStepPack.js.map +0 -1
  527. package/dist/resources/TriGeometryRes.js +0 -239
  528. package/dist/resources/TriGeometryRes.js.map +0 -1
  529. package/dist/resources/TriGeometryResAreaData.js.map +0 -1
  530. package/dist/resources/TriGeometryResJointData.js.map +0 -1
  531. package/dist/resources/TriGeometryResLodData.js.map +0 -1
  532. package/dist/resources/TriGeometryResMeshData.js.map +0 -1
  533. package/dist/resources/TriGeometryResSkeletonData.js.map +0 -1
  534. package/dist/resources/TriGrannyRes.js.map +0 -1
  535. package/dist/resources/TriJointBinding.js.map +0 -1
  536. package/dist/resources/TriMorphTargetGeometryConstants.js.map +0 -1
  537. package/dist/resources/TriRtGeometryConstants.js.map +0 -1
  538. package/dist/resources/TriTextureRes.js.map +0 -1
  539. package/dist/resources/enums.js.map +0 -1
  540. package/dist/resources/resourceBoundary.js +0 -47
  541. package/dist/resources/resourceBoundary.js.map +0 -1
  542. package/dist/resources/texturePipelineBehavior.js.map +0 -1
  543. package/dist/texture/CjsTextureArrayRes.js.map +0 -1
  544. package/dist/texture/CjsTextureParameterProxy.js.map +0 -1
package/NOTICE CHANGED
@@ -3,8 +3,9 @@ carbonenginejs/runtime-resource
3
3
 
4
4
  Copyright (c) 2026 CarbonEngineJS contributors.
5
5
 
6
- This package owns CarbonEngineJS resource lifecycle, format selection, and the
7
- non-shader format implementations listed under `format-notices/`.
6
+ This package owns CarbonEngineJS resource lifecycle, format selection,
7
+ canonical GPU-free shader/reflection models, and the non-shader format
8
+ implementations listed under `format-notices/`.
8
9
 
9
10
  CarbonEngine source material, format names, class names, and schema semantics
10
11
  remain copyright their original CarbonEngine authors. Fenris Creations
package/README.md CHANGED
@@ -4,10 +4,11 @@ CarbonEngineJS resource lifecycle, cache, format selection, source, and object
4
4
  loading contracts — the GPU-free resource layer.
5
5
 
6
6
  Use this package when you need Carbon-shaped resource loading (`res:/` paths,
7
- requirement/emit selection, `Ready()`/`GetObject()`) or one of the non-shader
8
- format readers, without choosing a GPU backend. It sits between source
9
- adapters and the engine packages that realize prepared resources. It does not
10
- own WebGL/WebGPU realization, device budgets, or shader formats.
7
+ requirement/emit selection, `Ready()`/`GetObject()`), canonical GPU-free shader
8
+ reflection, or one of the bundled format readers without choosing a GPU
9
+ backend. It sits between format/resource providers and the engines that
10
+ realize prepared resources. It owns neither WebGL/WebGPU realization nor the
11
+ standalone shader parser/compiler packages.
11
12
 
12
13
  ## Install
13
14
 
@@ -21,11 +22,17 @@ Concrete formats are explicit tree-shakeable subpaths, never imported by the
21
22
  package root:
22
23
 
23
24
  ```js
24
- import { CjsResMan } from "@carbonenginejs/runtime-resource";
25
+ import {
26
+ CjsResMan,
27
+ CjsResManFetchProvider
28
+ } from "@carbonenginejs/runtime-resource";
25
29
  import { CjsMp4Format } from "@carbonenginejs/runtime-resource/formats/mp4";
26
30
 
27
31
  const resMan = new CjsResMan().Register({
28
- source,
32
+ paths: {
33
+ res: "https://cdn.example.invalid/resources/"
34
+ },
35
+ source: new CjsResManFetchProvider(),
29
36
  formats: [ CjsMp4Format ]
30
37
  });
31
38
 
@@ -33,11 +40,45 @@ const resource = resMan.GetResource("res:/video/intro.mp4");
33
40
  const video = await resource.Ready();
34
41
  ```
35
42
 
43
+ Browser consumers use worker-backed fetch and declared worker-safe format
44
+ readers by default, with deterministic main-thread fallback; see
45
+ [browser worker execution](docs/reference/workers.md).
46
+
47
+ Raw audio resource ownership is available from an explicit subpath:
48
+
49
+ ```js
50
+ import {
51
+ CjsAudioBufferRes,
52
+ CjsAudioRes
53
+ } from "@carbonenginejs/runtime-resource/resource/audio";
54
+ ```
55
+
56
+ `CjsAudioRes` always represents one addressable audio file. Its backing may be
57
+ a complete loose file, an individually served response, or a window within a
58
+ shared `CjsAudioBufferRes` bank payload.
59
+
60
+ Canonical effect-resource and shader reflection classes are available from:
61
+
62
+ ```js
63
+ import {
64
+ Tr2EffectRes,
65
+ Tr2Shader
66
+ } from "@carbonenginejs/runtime-resource/resource/shader";
67
+ ```
68
+
69
+ `Tr2EffectRes` fail-closed validates complete permutation topology and portable
70
+ reflection, selects a package permutation, and hydrates it into a cached,
71
+ device-free `Tr2Shader`. Engines add programs, layouts, bindings, and other GPU
72
+ state.
73
+
36
74
  ## Documentation
37
75
 
38
76
  - [Package documentation](docs/README.md)
39
77
  - [Architecture and boundaries](docs/architecture.md)
40
78
  - [Resource lifecycle concepts](docs/concepts/resource-lifecycle.md)
79
+ - [Browser worker execution](docs/reference/workers.md)
80
+ - [Audio resource classes](docs/reference/classes/audio.md)
81
+ - [Resource and shader-reflection classes](docs/reference/classes/resources.md)
41
82
  - [Format subpaths](docs/formats/README.md)
42
83
  - [Format ownership and fork provenance](docs/formats/provenance.md)
43
84
 
@@ -1,4 +1,4 @@
1
- import { normalizeResourcePath } from './resourcePath.js';
1
+ import { normalizeResourcePath } from '@carbonenginejs/runtime-utils/path';
2
2
 
3
3
  // Source: blue/include/IMotherLode.h
4
4
  // Source: blue/src/MotherLode.h
@@ -150,7 +150,7 @@ class CjsMotherLode {
150
150
  #cacheSize = DEFAULT_CACHE_SIZE;
151
151
  #entries = new Map();
152
152
  #nextCacheSequence = 1;
153
- #now = DefaultNow;
153
+ #now = defaultNow;
154
154
 
155
155
  /**
156
156
  * Create an active deterministic resource registry.
@@ -230,14 +230,14 @@ class CjsMotherLode {
230
230
  */
231
231
  Insert(keyOrResource, resourceOrPath, optionsOrVariant = {}) {
232
232
  if (!this.#active) {
233
- throw MotherLodeInactiveError();
233
+ throw motherLodeInactiveError();
234
234
  }
235
235
  const {
236
236
  key,
237
237
  resource,
238
238
  options
239
- } = NormalizeInsertArguments(keyOrResource, resourceOrPath, optionsOrVariant);
240
- AssertResource(resource);
239
+ } = normalizeInsertArguments(keyOrResource, resourceOrPath, optionsOrVariant);
240
+ assertResource(resource);
241
241
  const existing = this.#entries.get(key) || null;
242
242
  if (existing && existing.resource === resource) {
243
243
  const updated = {
@@ -247,17 +247,17 @@ class CjsMotherLode {
247
247
  this.#AssertRecordedBytesTotal(updated, existing);
248
248
  this.#TouchRecord(updated, options);
249
249
  Object.assign(existing, updated);
250
- return FreezeInsertResult(key, resource, false, false, null);
250
+ return freezeInsertResult(key, resource, false, false, null);
251
251
  }
252
252
  if (existing && options.replace === false) {
253
- return FreezeInsertResult(key, existing.resource, false, false, null);
253
+ return freezeInsertResult(key, existing.resource, false, false, null);
254
254
  }
255
255
  const record = this.#CreateRecord(key, resource, options, existing);
256
256
  if (existing) {
257
257
  this.#CleanupRecord(existing, options, "replace", true);
258
258
  }
259
259
  this.#entries.set(key, record);
260
- return FreezeInsertResult(key, resource, true, Boolean(existing), existing?.resource || null);
260
+ return freezeInsertResult(key, resource, true, Boolean(existing), existing?.resource || null);
261
261
  }
262
262
 
263
263
  /**
@@ -286,15 +286,15 @@ class CjsMotherLode {
286
286
  */
287
287
  ReplaceExpected(key, expected, resource, options = {}) {
288
288
  if (!this.#active) {
289
- throw MotherLodeInactiveError();
289
+ throw motherLodeInactiveError();
290
290
  }
291
- const resolvedKey = NormalizeResolvedKey(key);
292
- const policy = NormalizeOptions(options, "conditional replace");
291
+ const resolvedKey = normalizeResolvedKey(key);
292
+ const policy = normalizeOptions(options, "conditional replace");
293
293
  if (policy.commitGuard !== undefined && typeof policy.commitGuard !== "function") {
294
294
  throw new TypeError("CjsMotherLode conditional replace commitGuard must be a function.");
295
295
  }
296
- AssertResource(expected);
297
- AssertResource(resource);
296
+ assertResource(expected);
297
+ assertResource(resource);
298
298
  if (resource === expected) {
299
299
  const error = new Error("CjsMotherLode conditional replacement requires a distinct resource.");
300
300
  error.code = "CJS_MOTHERLODE_REPLACE_ALIAS";
@@ -302,7 +302,7 @@ class CjsMotherLode {
302
302
  }
303
303
  const existing = this.#entries.get(resolvedKey) || null;
304
304
  if (!existing || existing.resource !== expected) {
305
- return FreezeConditionalReplaceResult(resolvedKey, false, existing?.resource || null, null);
305
+ return freezeConditionalReplaceResult(resolvedKey, false, existing?.resource || null, null);
306
306
  }
307
307
  const recordOptions = {
308
308
  ...policy,
@@ -315,10 +315,10 @@ class CjsMotherLode {
315
315
  // Re-check after clock/metadata validation, then publish with no user code
316
316
  // between the exact-record comparison and Map mutation.
317
317
  if (policy.commitGuard && !policy.commitGuard() || this.#entries.get(resolvedKey) !== existing) {
318
- return FreezeConditionalReplaceResult(resolvedKey, false, this.#entries.get(resolvedKey)?.resource || null, null);
318
+ return freezeConditionalReplaceResult(resolvedKey, false, this.#entries.get(resolvedKey)?.resource || null, null);
319
319
  }
320
320
  this.#entries.set(resolvedKey, record);
321
- const result = FreezeConditionalReplaceResult(resolvedKey, true, resource, expected);
321
+ const result = freezeConditionalReplaceResult(resolvedKey, true, resource, expected);
322
322
  try {
323
323
  this.#CleanupRecord(existing, policy, "conditional replace");
324
324
  } catch (cause) {
@@ -340,7 +340,7 @@ class CjsMotherLode {
340
340
  * @throws {TypeError} If the identity cannot be normalized.
341
341
  */
342
342
  HasKey(key, variant = undefined) {
343
- return this.#entries.has(NormalizeLookupKey(key, variant));
343
+ return this.#entries.has(normalizeLookupKey(key, variant));
344
344
  }
345
345
 
346
346
  /**
@@ -353,7 +353,7 @@ class CjsMotherLode {
353
353
  * @throws {TypeError} If the identity cannot be normalized.
354
354
  */
355
355
  Lookup(key, variant = undefined) {
356
- return this.#entries.get(NormalizeLookupKey(key, variant))?.resource || null;
356
+ return this.#entries.get(normalizeLookupKey(key, variant))?.resource || null;
357
357
  }
358
358
 
359
359
  /**
@@ -372,7 +372,7 @@ class CjsMotherLode {
372
372
  const {
373
373
  resolvedKey,
374
374
  options
375
- } = NormalizeDeleteArguments(key, variantOrOptions, maybeOptions);
375
+ } = normalizeDeleteArguments(key, variantOrOptions, maybeOptions);
376
376
  const record = this.#entries.get(resolvedKey);
377
377
  if (!record) return false;
378
378
  this.#entries.delete(resolvedKey);
@@ -391,7 +391,7 @@ class CjsMotherLode {
391
391
  * @throws {AggregateError} If cleanup fails for one or more removed resources.
392
392
  */
393
393
  DeleteAllVariants(path, options = {}) {
394
- const normalizedPath = NormalizePath(path);
394
+ const normalizedPath = normalizePath(path);
395
395
  const prefix = `${normalizedPath}\u0000`;
396
396
  const records = [];
397
397
  for (const [key, record] of this.#entries) {
@@ -456,7 +456,7 @@ class CjsMotherLode {
456
456
  const {
457
457
  resolvedKey,
458
458
  options
459
- } = NormalizeActivityArguments(key, variantOrOptions, maybeOptions);
459
+ } = normalizeActivityArguments(key, variantOrOptions, maybeOptions);
460
460
  const record = this.#entries.get(resolvedKey);
461
461
  if (!record) return null;
462
462
  record.cached = false;
@@ -480,7 +480,7 @@ class CjsMotherLode {
480
480
  const {
481
481
  resolvedKey,
482
482
  options
483
- } = NormalizeActivityArguments(key, variantOrOptions, maybeOptions);
483
+ } = normalizeActivityArguments(key, variantOrOptions, maybeOptions);
484
484
  const record = this.#entries.get(resolvedKey);
485
485
  if (!record) return null;
486
486
  record.cached = false;
@@ -501,7 +501,7 @@ class CjsMotherLode {
501
501
  * @throws {TypeError} If the identity cannot be normalized.
502
502
  */
503
503
  Lock(key, variant = undefined) {
504
- const record = this.#entries.get(NormalizeLookupKey(key, variant));
504
+ const record = this.#entries.get(normalizeLookupKey(key, variant));
505
505
  if (!record) return 0;
506
506
  record.lockCount += 1;
507
507
  record.cached = false;
@@ -520,7 +520,7 @@ class CjsMotherLode {
520
520
  * @throws {TypeError} If the identity cannot be normalized.
521
521
  */
522
522
  Unlock(key, variant = undefined) {
523
- const record = this.#entries.get(NormalizeLookupKey(key, variant));
523
+ const record = this.#entries.get(normalizeLookupKey(key, variant));
524
524
  if (!record) return 0;
525
525
  if (record.lockCount > 0) record.lockCount -= 1;
526
526
  return record.lockCount;
@@ -545,7 +545,7 @@ class CjsMotherLode {
545
545
  * @throws {AggregateError} If one or more cleanup, payload-release, or purge-state operations fail.
546
546
  */
547
547
  PurgeInactive(options = {}) {
548
- const policy = NormalizePurgeOptions(options, this.#activityFrame, this.#now);
548
+ const policy = normalizePurgeOptions(options, this.#activityFrame, this.#now);
549
549
  this.#activityFrame = Math.max(this.#activityFrame, policy.frame);
550
550
  const purgedKeys = [];
551
551
  const payloadKeys = [];
@@ -556,7 +556,7 @@ class CjsMotherLode {
556
556
  locked += 1;
557
557
  continue;
558
558
  }
559
- if (IsInactive(record.lastUsedFrame, record.lastUsedTime, policy.frame, policy.time, policy.maxIdleFrames, policy.maxIdleMilliseconds)) {
559
+ if (isInactive(record.lastUsedFrame, record.lastUsedTime, policy.frame, policy.time, policy.maxIdleFrames, policy.maxIdleMilliseconds)) {
560
560
  try {
561
561
  this.#CleanupRecord(record, policy, "purge inactive", true);
562
562
  } catch (error) {
@@ -568,20 +568,20 @@ class CjsMotherLode {
568
568
  try {
569
569
  record.resource?.MarkPurged?.();
570
570
  } catch (cause) {
571
- errors.push(MotherLodeCleanupError("mark purged", key, record.resource, cause));
571
+ errors.push(motherLodeCleanupError("mark purged", key, record.resource, cause));
572
572
  }
573
573
  continue;
574
574
  }
575
- if (policy.releasePayload !== false && HasOwnedPayload(record.resource) && IsInactive(record.payloadLastUsedFrame, record.payloadLastUsedTime, policy.frame, policy.time, policy.payloadMaxIdleFrames, policy.payloadMaxIdleMilliseconds)) {
575
+ if (policy.releasePayload !== false && hasOwnedPayload(record.resource) && isInactive(record.payloadLastUsedFrame, record.payloadLastUsedTime, policy.frame, policy.time, policy.payloadMaxIdleFrames, policy.payloadMaxIdleMilliseconds)) {
576
576
  try {
577
577
  record.resource.ReleasePayload();
578
578
  payloadKeys.push(key);
579
579
  } catch (cause) {
580
- errors.push(MotherLodeCleanupError("release inactive payload", key, record.resource, cause));
580
+ errors.push(motherLodeCleanupError("release inactive payload", key, record.resource, cause));
581
581
  }
582
582
  }
583
583
  }
584
- const result = FreezePurgeResult(policy.frame, policy.time, purgedKeys, payloadKeys, locked);
584
+ const result = freezePurgeResult(policy.frame, policy.time, purgedKeys, payloadKeys, locked);
585
585
  if (errors.length) {
586
586
  const error = new AggregateError(errors, "CjsMotherLode inactivity purge failed.");
587
587
  error.code = "CJS_MOTHERLODE_PURGE_FAILED";
@@ -613,7 +613,7 @@ class CjsMotherLode {
613
613
  * @throws {AggregateError} If cleanup or purge-state publication fails for one or more candidates.
614
614
  */
615
615
  TrimCache(options = {}) {
616
- const policy = NormalizeOptions(options, "cache trim");
616
+ const policy = normalizeOptions(options, "cache trim");
617
617
  const beforeBytes = this.#GetCacheBytes();
618
618
  const evictedKeys = [];
619
619
  const failedKeys = [];
@@ -641,13 +641,13 @@ class CjsMotherLode {
641
641
  try {
642
642
  record.resource?.MarkPurged?.();
643
643
  } catch (cause) {
644
- errors.push(MotherLodeCleanupError("mark cache eviction purged", record.key, record.resource, cause));
644
+ errors.push(motherLodeCleanupError("mark cache eviction purged", record.key, record.resource, cause));
645
645
  failedKeys.push(record.key);
646
646
  }
647
647
  }
648
648
  }
649
649
  const afterBytes = this.#GetCacheBytes();
650
- const result = FreezeCacheTrimResult(this.#cacheSize, beforeBytes, afterBytes, evictedBytes, evictedKeys, failedKeys);
650
+ const result = freezeCacheTrimResult(this.#cacheSize, beforeBytes, afterBytes, evictedBytes, evictedKeys, failedKeys);
651
651
  if (errors.length) {
652
652
  const error = new AggregateError(errors, "CjsMotherLode cache trim failed.");
653
653
  error.code = "CJS_MOTHERLODE_CACHE_TRIM_FAILED";
@@ -669,8 +669,8 @@ class CjsMotherLode {
669
669
  * @throws {AggregateError} If enforcing the new budget cannot clean one or more cached entries.
670
670
  */
671
671
  SetCacheSize(bytes, options = {}) {
672
- AssertNonNegativeSafeInteger(bytes, "CjsMotherLode cache size");
673
- const policy = NormalizeOptions(options, "set cache size");
672
+ assertNonNegativeSafeInteger(bytes, "CjsMotherLode cache size");
673
+ const policy = normalizeOptions(options, "set cache size");
674
674
  this.#cacheSize = bytes;
675
675
  this.TrimCache(policy);
676
676
  return this;
@@ -734,8 +734,8 @@ class CjsMotherLode {
734
734
  cacheBytes += record.bytes;
735
735
  }
736
736
  if (record.lockCount > 0) locked += 1;
737
- if (HasOwnedPayload(record.resource)) payloads += 1;
738
- const path = record.resource?.GetPath?.() || record.resource?.path || GetKeyPath(record.key);
737
+ if (hasOwnedPayload(record.resource)) payloads += 1;
738
+ const path = record.resource?.GetPath?.() || record.resource?.path || getKeyPath(record.key);
739
739
  if (path) paths.add(path);
740
740
  const state = typeof record.resource?.state === "string" ? record.resource.state : "unknown";
741
741
  states[state] = (states[state] || 0) + 1;
@@ -840,7 +840,7 @@ class CjsMotherLode {
840
840
  */
841
841
  #UpdateRecord(record, options) {
842
842
  if (options.bytes !== undefined) {
843
- AssertNonNegativeSafeInteger(options.bytes, "CjsMotherLode entry bytes");
843
+ assertNonNegativeSafeInteger(options.bytes, "CjsMotherLode entry bytes");
844
844
  record.bytes = options.bytes;
845
845
  }
846
846
  if (options.cacheable !== undefined) record.cacheable = Boolean(options.cacheable);
@@ -900,7 +900,7 @@ class CjsMotherLode {
900
900
  */
901
901
  #TouchRecord(record, options) {
902
902
  const frame = options.frame === undefined ? this.#activityFrame + 1 : options.frame;
903
- AssertNonNegativeSafeInteger(frame, "CjsMotherLode activity frame");
903
+ assertNonNegativeSafeInteger(frame, "CjsMotherLode activity frame");
904
904
  this.#activityFrame = Math.max(this.#activityFrame, frame);
905
905
  record.lastUsedFrame = frame;
906
906
  const time = options.time === undefined ? this.#now() : options.time;
@@ -924,18 +924,18 @@ class CjsMotherLode {
924
924
  #CleanupRecord(record, options, operation, preserveOnFailure = false) {
925
925
  let cleanupComplete = false;
926
926
  try {
927
- CleanupOwnedResource(record.resource, options);
927
+ cleanupOwnedResource(record.resource, options);
928
928
  cleanupComplete = true;
929
- DetachResourceLifecycle(record.resource);
929
+ detachResourceLifecycle(record.resource);
930
930
  } catch (cause) {
931
931
  if (!preserveOnFailure && !cleanupComplete) {
932
932
  try {
933
- DetachResourceLifecycle(record.resource);
933
+ detachResourceLifecycle(record.resource);
934
934
  } catch (detachCause) {
935
935
  cause = new AggregateError([cause, detachCause], "Resource cleanup and detach failed.");
936
936
  }
937
937
  }
938
- throw MotherLodeCleanupError(operation, record.key, record.resource, cause);
938
+ throw motherLodeCleanupError(operation, record.key, record.resource, cause);
939
939
  }
940
940
  }
941
941
 
@@ -952,14 +952,14 @@ class CjsMotherLode {
952
952
  const errors = [];
953
953
  for (const record of records) {
954
954
  try {
955
- CleanupOwnedResource(record.resource, options);
955
+ cleanupOwnedResource(record.resource, options);
956
956
  } catch (cause) {
957
- errors.push(MotherLodeCleanupError(operation, record.key, record.resource, cause));
957
+ errors.push(motherLodeCleanupError(operation, record.key, record.resource, cause));
958
958
  }
959
959
  try {
960
- DetachResourceLifecycle(record.resource);
960
+ detachResourceLifecycle(record.resource);
961
961
  } catch (cause) {
962
- errors.push(MotherLodeCleanupError(`${operation} detach`, record.key, record.resource, cause));
962
+ errors.push(motherLodeCleanupError(`${operation} detach`, record.key, record.resource, cause));
963
963
  }
964
964
  }
965
965
  if (errors.length) {
@@ -979,7 +979,7 @@ class CjsMotherLode {
979
979
  * @throws {TypeError} If the path is empty/invalid or the variant contains a null byte.
980
980
  */
981
981
  function getMotherLodeKey(path, variant = "") {
982
- const normalizedPath = NormalizePath(path);
982
+ const normalizedPath = normalizePath(path);
983
983
  if (variant === null || variant === undefined || variant === "") return normalizedPath;
984
984
  const normalizedVariant = String(variant);
985
985
  if (normalizedVariant.includes("\u0000")) {
@@ -987,18 +987,18 @@ function getMotherLodeKey(path, variant = "") {
987
987
  }
988
988
  return `${normalizedPath}\u0000${normalizedVariant}`;
989
989
  }
990
- function NormalizeInsertArguments(keyOrResource, resourceOrPath, optionsOrVariant) {
990
+ function normalizeInsertArguments(keyOrResource, resourceOrPath, optionsOrVariant) {
991
991
  if (typeof keyOrResource === "string") {
992
992
  return {
993
- key: NormalizeResolvedKey(keyOrResource),
993
+ key: normalizeResolvedKey(keyOrResource),
994
994
  resource: resourceOrPath,
995
- options: NormalizeOptions(optionsOrVariant, "insert")
995
+ options: normalizeOptions(optionsOrVariant, "insert")
996
996
  };
997
997
  }
998
998
  const resource = keyOrResource;
999
999
  const path = resourceOrPath ?? resource?.GetPath?.() ?? resource?.path;
1000
1000
  const isOptions = optionsOrVariant && typeof optionsOrVariant === "object" && !Array.isArray(optionsOrVariant);
1001
- const options = isOptions ? NormalizeOptions(optionsOrVariant, "insert") : {};
1001
+ const options = isOptions ? normalizeOptions(optionsOrVariant, "insert") : {};
1002
1002
  const variant = isOptions ? options.variant || "" : optionsOrVariant;
1003
1003
  return {
1004
1004
  key: getMotherLodeKey(path, variant),
@@ -1006,46 +1006,46 @@ function NormalizeInsertArguments(keyOrResource, resourceOrPath, optionsOrVarian
1006
1006
  options
1007
1007
  };
1008
1008
  }
1009
- function NormalizeDeleteArguments(key, variantOrOptions, maybeOptions) {
1009
+ function normalizeDeleteArguments(key, variantOrOptions, maybeOptions) {
1010
1010
  if (variantOrOptions && typeof variantOrOptions === "object" && !Array.isArray(variantOrOptions)) {
1011
1011
  return {
1012
- resolvedKey: NormalizeResolvedKey(key),
1013
- options: NormalizeOptions(variantOrOptions, "delete")
1012
+ resolvedKey: normalizeResolvedKey(key),
1013
+ options: normalizeOptions(variantOrOptions, "delete")
1014
1014
  };
1015
1015
  }
1016
1016
  return {
1017
- resolvedKey: NormalizeLookupKey(key, variantOrOptions),
1018
- options: NormalizeOptions(maybeOptions || {}, "delete")
1017
+ resolvedKey: normalizeLookupKey(key, variantOrOptions),
1018
+ options: normalizeOptions(maybeOptions || {}, "delete")
1019
1019
  };
1020
1020
  }
1021
- function NormalizeActivityArguments(key, variantOrOptions, maybeOptions) {
1021
+ function normalizeActivityArguments(key, variantOrOptions, maybeOptions) {
1022
1022
  if (variantOrOptions && typeof variantOrOptions === "object" && !Array.isArray(variantOrOptions)) {
1023
1023
  return {
1024
- resolvedKey: NormalizeResolvedKey(key),
1025
- options: NormalizeOptions(variantOrOptions, "activity")
1024
+ resolvedKey: normalizeResolvedKey(key),
1025
+ options: normalizeOptions(variantOrOptions, "activity")
1026
1026
  };
1027
1027
  }
1028
1028
  return {
1029
- resolvedKey: NormalizeLookupKey(key, variantOrOptions),
1030
- options: NormalizeOptions(maybeOptions || {}, "activity")
1029
+ resolvedKey: normalizeLookupKey(key, variantOrOptions),
1030
+ options: normalizeOptions(maybeOptions || {}, "activity")
1031
1031
  };
1032
1032
  }
1033
- function NormalizeLookupKey(key, variant) {
1034
- return variant === undefined ? NormalizeResolvedKey(key) : getMotherLodeKey(key, variant);
1033
+ function normalizeLookupKey(key, variant) {
1034
+ return variant === undefined ? normalizeResolvedKey(key) : getMotherLodeKey(key, variant);
1035
1035
  }
1036
- function NormalizeResolvedKey(key) {
1036
+ function normalizeResolvedKey(key) {
1037
1037
  if (typeof key !== "string" || !key) {
1038
1038
  throw new TypeError("CjsMotherLode requires a canonical string key.");
1039
1039
  }
1040
1040
  const separator = key.indexOf("\u0000");
1041
1041
  return separator === -1 ? getMotherLodeKey(key) : getMotherLodeKey(key.slice(0, separator), key.slice(separator + 1));
1042
1042
  }
1043
- function NormalizePath(path) {
1043
+ function normalizePath(path) {
1044
1044
  const normalizedPath = normalizeResourcePath(path);
1045
1045
  if (!normalizedPath) throw new TypeError("CjsMotherLode requires a resource path.");
1046
1046
  return normalizedPath;
1047
1047
  }
1048
- function NormalizeOptions(options, operation) {
1048
+ function normalizeOptions(options, operation) {
1049
1049
  if (options === null || options === undefined) return {};
1050
1050
  if (!options || typeof options !== "object" || Array.isArray(options)) {
1051
1051
  throw new TypeError(`CjsMotherLode ${operation} options must be an object.`);
@@ -1061,20 +1061,20 @@ function NormalizeOptions(options, operation) {
1061
1061
  * @param {() => number} now Registry clock.
1062
1062
  * @returns {CjsMotherLodePurgeOptions & {frame: number, time: number}} Validated sweep policy.
1063
1063
  */
1064
- function NormalizePurgeOptions(options, activityFrame, now) {
1065
- const policy = NormalizeOptions(options, "purge");
1064
+ function normalizePurgeOptions(options, activityFrame, now) {
1065
+ const policy = normalizeOptions(options, "purge");
1066
1066
  const frame = policy.frame === undefined ? activityFrame + 1 : policy.frame;
1067
- AssertNonNegativeSafeInteger(frame, "CjsMotherLode purge frame");
1067
+ assertNonNegativeSafeInteger(frame, "CjsMotherLode purge frame");
1068
1068
  const time = policy.time === undefined ? now() : policy.time;
1069
- AssertNonNegativeFiniteNumber(time, "CjsMotherLode purge time");
1069
+ assertNonNegativeFiniteNumber(time, "CjsMotherLode purge time");
1070
1070
  for (const name of ["maxIdleFrames", "payloadMaxIdleFrames"]) {
1071
1071
  if (policy[name] !== undefined) {
1072
- AssertNonNegativeSafeInteger(policy[name], `CjsMotherLode ${name}`);
1072
+ assertNonNegativeSafeInteger(policy[name], `CjsMotherLode ${name}`);
1073
1073
  }
1074
1074
  }
1075
1075
  for (const name of ["maxIdleMilliseconds", "payloadMaxIdleMilliseconds"]) {
1076
1076
  if (policy[name] !== undefined) {
1077
- AssertNonNegativeFiniteNumber(policy[name], `CjsMotherLode ${name}`);
1077
+ assertNonNegativeFiniteNumber(policy[name], `CjsMotherLode ${name}`);
1078
1078
  }
1079
1079
  }
1080
1080
  return {
@@ -1095,7 +1095,7 @@ function NormalizePurgeOptions(options, activityFrame, now) {
1095
1095
  * @param {number|undefined} maxMilliseconds Optional millisecond limit.
1096
1096
  * @returns {boolean} Whether at least one configured limit has elapsed.
1097
1097
  */
1098
- function IsInactive(lastFrame, lastTime, frame, time, maxFrames, maxMilliseconds) {
1098
+ function isInactive(lastFrame, lastTime, frame, time, maxFrames, maxMilliseconds) {
1099
1099
  const frameExpired = maxFrames !== undefined && frame >= lastFrame && frame - lastFrame >= maxFrames;
1100
1100
  const timeExpired = maxMilliseconds !== undefined && time >= lastTime && time - lastTime >= maxMilliseconds;
1101
1101
  return frameExpired || timeExpired;
@@ -1107,7 +1107,7 @@ function IsInactive(lastFrame, lastTime, frame, time, maxFrames, maxMilliseconds
1107
1107
  * @param {object|Function} resource Candidate resource.
1108
1108
  * @returns {boolean} Whether `ReleasePayload()` can remove an attached payload.
1109
1109
  */
1110
- function HasOwnedPayload(resource) {
1110
+ function hasOwnedPayload(resource) {
1111
1111
  return typeof resource?.HasPayload === "function" && typeof resource?.ReleasePayload === "function" && Boolean(resource.HasPayload());
1112
1112
  }
1113
1113
 
@@ -1117,10 +1117,10 @@ function HasOwnedPayload(resource) {
1117
1117
  * @param {object|Function} resource Removed resource.
1118
1118
  * @returns {void}
1119
1119
  */
1120
- function DetachResourceLifecycle(resource) {
1120
+ function detachResourceLifecycle(resource) {
1121
1121
  resource?.SetLifecycleController?.(null);
1122
1122
  }
1123
- function CleanupOwnedResource(resource, options) {
1123
+ function cleanupOwnedResource(resource, options) {
1124
1124
  if (options.cleanup === false) return;
1125
1125
  if (typeof options.cleanup === "function") {
1126
1126
  options.cleanup(resource);
@@ -1147,12 +1147,12 @@ function CleanupOwnedResource(resource, options) {
1147
1147
  throw errors.length === 1 ? errors[0] : new AggregateError(errors, "Resource cleanup failed.");
1148
1148
  }
1149
1149
  }
1150
- function AssertResource(resource) {
1150
+ function assertResource(resource) {
1151
1151
  if (typeof resource !== "object" && typeof resource !== "function" || resource === null) {
1152
1152
  throw new TypeError("CjsMotherLode requires a resource object.");
1153
1153
  }
1154
1154
  }
1155
- function AssertNonNegativeSafeInteger(value, label) {
1155
+ function assertNonNegativeSafeInteger(value, label) {
1156
1156
  if (!Number.isSafeInteger(value) || value < 0) {
1157
1157
  throw new TypeError(`${label} must be a non-negative safe integer.`);
1158
1158
  }
@@ -1165,12 +1165,12 @@ function AssertNonNegativeSafeInteger(value, label) {
1165
1165
  * @param {string} label Error-message field name.
1166
1166
  * @returns {void}
1167
1167
  */
1168
- function AssertNonNegativeFiniteNumber(value, label) {
1168
+ function assertNonNegativeFiniteNumber(value, label) {
1169
1169
  if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
1170
1170
  throw new TypeError(`${label} must be a non-negative finite number.`);
1171
1171
  }
1172
1172
  }
1173
- function FreezeInsertResult(key, resource, inserted, replaced, displaced) {
1173
+ function freezeInsertResult(key, resource, inserted, replaced, displaced) {
1174
1174
  return Object.freeze({
1175
1175
  key,
1176
1176
  resource,
@@ -1189,7 +1189,7 @@ function FreezeInsertResult(key, resource, inserted, replaced, displaced) {
1189
1189
  * @param {object|Function|null} displaced Former owner when committed.
1190
1190
  * @returns {CjsMotherLodeConditionalReplaceResult} Immutable replacement result.
1191
1191
  */
1192
- function FreezeConditionalReplaceResult(key, committed, resource, displaced) {
1192
+ function freezeConditionalReplaceResult(key, committed, resource, displaced) {
1193
1193
  return Object.freeze({
1194
1194
  key,
1195
1195
  committed,
@@ -1208,7 +1208,7 @@ function FreezeConditionalReplaceResult(key, committed, resource, displaced) {
1208
1208
  * @param {number} locked Number of locked entries skipped.
1209
1209
  * @returns {CjsMotherLodePurgeResult} Immutable sweep result.
1210
1210
  */
1211
- function FreezePurgeResult(frame, time, purgedKeys, payloadKeys, locked) {
1211
+ function freezePurgeResult(frame, time, purgedKeys, payloadKeys, locked) {
1212
1212
  return Object.freeze({
1213
1213
  frame,
1214
1214
  time,
@@ -1231,7 +1231,7 @@ function FreezePurgeResult(frame, time, purgedKeys, payloadKeys, locked) {
1231
1231
  * @param {string[]} failedKeys Candidate identities that reported failure.
1232
1232
  * @returns {CjsMotherLodeCacheTrimResult} Immutable cache-housekeeping result.
1233
1233
  */
1234
- function FreezeCacheTrimResult(cacheSize, beforeBytes, afterBytes, evictedBytes, evictedKeys, failedKeys) {
1234
+ function freezeCacheTrimResult(cacheSize, beforeBytes, afterBytes, evictedBytes, evictedKeys, failedKeys) {
1235
1235
  return Object.freeze({
1236
1236
  cacheSize,
1237
1237
  beforeBytes,
@@ -1244,12 +1244,12 @@ function FreezeCacheTrimResult(cacheSize, beforeBytes, afterBytes, evictedBytes,
1244
1244
  failedKeys: Object.freeze(failedKeys)
1245
1245
  });
1246
1246
  }
1247
- function MotherLodeInactiveError() {
1247
+ function motherLodeInactiveError() {
1248
1248
  const error = new Error("CjsMotherLode is shut down. Call Startup() before inserting resources.");
1249
1249
  error.code = "CJS_MOTHERLODE_INACTIVE";
1250
1250
  return error;
1251
1251
  }
1252
- function MotherLodeCleanupError(operation, key, resource, cause) {
1252
+ function motherLodeCleanupError(operation, key, resource, cause) {
1253
1253
  const error = new Error(`CjsMotherLode ${operation} cleanup failed for ${key}.`, {
1254
1254
  cause
1255
1255
  });
@@ -1259,11 +1259,11 @@ function MotherLodeCleanupError(operation, key, resource, cause) {
1259
1259
  error.resource = resource;
1260
1260
  return error;
1261
1261
  }
1262
- function GetKeyPath(key) {
1262
+ function getKeyPath(key) {
1263
1263
  const separator = key.indexOf("\u0000");
1264
1264
  return separator === -1 ? key : key.slice(0, separator);
1265
1265
  }
1266
- function DefaultNow() {
1266
+ function defaultNow() {
1267
1267
  return Date.now();
1268
1268
  }
1269
1269