@automovie/ingest 0.0.0-stage → 0.1.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 (275) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.d.ts +5 -0
  4. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js +8 -0
  5. package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js.map +1 -0
  6. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.d.ts +5 -0
  7. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js +15 -0
  8. package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js.map +1 -0
  9. package/lib/AutoMovieExternalModelIngestProfile.d.ts +11 -0
  10. package/lib/AutoMovieExternalModelIngestProfile.js +3 -0
  11. package/lib/AutoMovieExternalModelIngestProfile.js.map +1 -0
  12. package/lib/AutoMovieExternalMotionAdoptionDecision.d.ts +11 -0
  13. package/lib/AutoMovieExternalMotionAdoptionDecision.js +3 -0
  14. package/lib/AutoMovieExternalMotionAdoptionDecision.js.map +1 -0
  15. package/lib/AutoMovieGltfMotionInterpretationProfile.d.ts +9 -0
  16. package/lib/AutoMovieGltfMotionInterpretationProfile.js +3 -0
  17. package/lib/AutoMovieGltfMotionInterpretationProfile.js.map +1 -0
  18. package/lib/IAutoMovieExternalModelInspection.d.ts +48 -0
  19. package/lib/IAutoMovieExternalModelInspection.js +3 -0
  20. package/lib/IAutoMovieExternalModelInspection.js.map +1 -0
  21. package/lib/IAutoMovieExternalModelResource.d.ts +18 -0
  22. package/lib/IAutoMovieExternalModelResource.js +3 -0
  23. package/lib/IAutoMovieExternalModelResource.js.map +1 -0
  24. package/lib/IAutoMovieExternalMotionAdoption.d.ts +23 -0
  25. package/lib/IAutoMovieExternalMotionAdoption.js +3 -0
  26. package/lib/IAutoMovieExternalMotionAdoption.js.map +1 -0
  27. package/lib/IAutoMovieExternalMotionBoneMapping.d.ts +15 -0
  28. package/lib/IAutoMovieExternalMotionBoneMapping.js +3 -0
  29. package/lib/IAutoMovieExternalMotionBoneMapping.js.map +1 -0
  30. package/lib/IAutoMovieExternalMotionInspection.d.ts +25 -0
  31. package/lib/IAutoMovieExternalMotionInspection.js +3 -0
  32. package/lib/IAutoMovieExternalMotionInspection.js.map +1 -0
  33. package/lib/IAutoMovieExternalMotionNativeDecision.d.ts +20 -0
  34. package/lib/IAutoMovieExternalMotionNativeDecision.js +3 -0
  35. package/lib/IAutoMovieExternalMotionNativeDecision.js.map +1 -0
  36. package/lib/IAutoMovieExternalMotionNativeHandoff.d.ts +18 -0
  37. package/lib/IAutoMovieExternalMotionNativeHandoff.js +3 -0
  38. package/lib/IAutoMovieExternalMotionNativeHandoff.js.map +1 -0
  39. package/lib/IAutoMovieExternalMotionNodeInspection.d.ts +21 -0
  40. package/lib/IAutoMovieExternalMotionNodeInspection.js +3 -0
  41. package/lib/IAutoMovieExternalMotionNodeInspection.js.map +1 -0
  42. package/lib/IAutoMovieExternalMotionRetargetDecision.d.ts +24 -0
  43. package/lib/IAutoMovieExternalMotionRetargetDecision.js +3 -0
  44. package/lib/IAutoMovieExternalMotionRetargetDecision.js.map +1 -0
  45. package/lib/IAutoMovieExternalMotionRetargetHandoff.d.ts +22 -0
  46. package/lib/IAutoMovieExternalMotionRetargetHandoff.js +3 -0
  47. package/lib/IAutoMovieExternalMotionRetargetHandoff.js.map +1 -0
  48. package/lib/IAutoMovieExternalMotionSource.d.ts +18 -0
  49. package/lib/IAutoMovieExternalMotionSource.js +3 -0
  50. package/lib/IAutoMovieExternalMotionSource.js.map +1 -0
  51. package/lib/IAutoMovieIngestResult.d.ts +17 -0
  52. package/lib/IAutoMovieIngestResult.js +3 -0
  53. package/lib/IAutoMovieIngestResult.js.map +1 -0
  54. package/lib/adoptAutoMovieExternalMotion.d.ts +32 -0
  55. package/lib/adoptAutoMovieExternalMotion.js +215 -0
  56. package/lib/adoptAutoMovieExternalMotion.js.map +1 -0
  57. package/lib/audio/IAutoMovieDecodedProductionAudioAsset.d.ts +28 -0
  58. package/lib/audio/IAutoMovieDecodedProductionAudioAsset.js +3 -0
  59. package/lib/audio/IAutoMovieDecodedProductionAudioAsset.js.map +1 -0
  60. package/lib/audio/IAutoMovieProductionAudioProcessing.d.ts +18 -0
  61. package/lib/audio/IAutoMovieProductionAudioProcessing.js +3 -0
  62. package/lib/audio/IAutoMovieProductionAudioProcessing.js.map +1 -0
  63. package/lib/audio/IAutoMovieProductionWaveSourceFormat.d.ts +39 -0
  64. package/lib/audio/IAutoMovieProductionWaveSourceFormat.js +3 -0
  65. package/lib/audio/IAutoMovieProductionWaveSourceFormat.js.map +1 -0
  66. package/lib/audio/decodeProductionAudioAsset.d.ts +33 -0
  67. package/lib/audio/decodeProductionAudioAsset.js +257 -0
  68. package/lib/audio/decodeProductionAudioAsset.js.map +1 -0
  69. package/lib/audio/index.d.ts +4 -0
  70. package/lib/audio/index.js +21 -0
  71. package/lib/audio/index.js.map +1 -0
  72. package/lib/decodeAutoMoviePpmImage.d.ts +30 -0
  73. package/lib/decodeAutoMoviePpmImage.js +84 -0
  74. package/lib/decodeAutoMoviePpmImage.js.map +1 -0
  75. package/lib/humanoidSkeleton.d.ts +24 -0
  76. package/lib/humanoidSkeleton.js +80 -0
  77. package/lib/humanoidSkeleton.js.map +1 -0
  78. package/lib/index.d.ts +23 -0
  79. package/lib/index.js +40 -0
  80. package/lib/index.js.map +1 -0
  81. package/lib/ingestDocument.d.ts +23 -0
  82. package/lib/ingestDocument.js +173 -0
  83. package/lib/ingestDocument.js.map +1 -0
  84. package/lib/inspectAutoMovieExternalModelBytes.d.ts +32 -0
  85. package/lib/inspectAutoMovieExternalModelBytes.js +219 -0
  86. package/lib/inspectAutoMovieExternalModelBytes.js.map +1 -0
  87. package/lib/internal/COMPONENT_BYTES.d.ts +2 -0
  88. package/lib/internal/COMPONENT_BYTES.js +13 -0
  89. package/lib/internal/COMPONENT_BYTES.js.map +1 -0
  90. package/lib/internal/IAccessorSource.d.ts +16 -0
  91. package/lib/internal/IAccessorSource.js +3 -0
  92. package/lib/internal/IAccessorSource.js.map +1 -0
  93. package/lib/internal/IExternalModelAccessorReader.d.ts +9 -0
  94. package/lib/internal/IExternalModelAccessorReader.js +3 -0
  95. package/lib/internal/IExternalModelAccessorReader.js.map +1 -0
  96. package/lib/internal/IHumanoidSlot.d.ts +15 -0
  97. package/lib/internal/IHumanoidSlot.js +3 -0
  98. package/lib/internal/IHumanoidSlot.js.map +1 -0
  99. package/lib/internal/IParsedContainer.d.ts +16 -0
  100. package/lib/internal/IParsedContainer.js +3 -0
  101. package/lib/internal/IParsedContainer.js.map +1 -0
  102. package/lib/internal/SHAPE_COMPONENTS.d.ts +6 -0
  103. package/lib/internal/SHAPE_COMPONENTS.js +25 -0
  104. package/lib/internal/SHAPE_COMPONENTS.js.map +1 -0
  105. package/lib/internal/accessorElementByteLength.d.ts +12 -0
  106. package/lib/internal/accessorElementByteLength.js +28 -0
  107. package/lib/internal/accessorElementByteLength.js.map +1 -0
  108. package/lib/internal/accessorReader.d.ts +16 -0
  109. package/lib/internal/accessorReader.js +52 -0
  110. package/lib/internal/accessorReader.js.map +1 -0
  111. package/lib/internal/accessorValues.d.ts +18 -0
  112. package/lib/internal/accessorValues.js +38 -0
  113. package/lib/internal/accessorValues.js.map +1 -0
  114. package/lib/internal/collectExternalResources.d.ts +13 -0
  115. package/lib/internal/collectExternalResources.js +51 -0
  116. package/lib/internal/collectExternalResources.js.map +1 -0
  117. package/lib/internal/compareCodeUnits.d.ts +12 -0
  118. package/lib/internal/compareCodeUnits.js +17 -0
  119. package/lib/internal/compareCodeUnits.js.map +1 -0
  120. package/lib/internal/composeLocalTransform.d.ts +21 -0
  121. package/lib/internal/composeLocalTransform.js +53 -0
  122. package/lib/internal/composeLocalTransform.js.map +1 -0
  123. package/lib/internal/decodeDataUri.d.ts +14 -0
  124. package/lib/internal/decodeDataUri.js +61 -0
  125. package/lib/internal/decodeDataUri.js.map +1 -0
  126. package/lib/internal/decodeGlb.d.ts +13 -0
  127. package/lib/internal/decodeGlb.js +56 -0
  128. package/lib/internal/decodeGlb.js.map +1 -0
  129. package/lib/internal/decodeJson.d.ts +12 -0
  130. package/lib/internal/decodeJson.js +77 -0
  131. package/lib/internal/decodeJson.js.map +1 -0
  132. package/lib/internal/fileExtension.d.ts +12 -0
  133. package/lib/internal/fileExtension.js +21 -0
  134. package/lib/internal/fileExtension.js.map +1 -0
  135. package/lib/internal/finiteTuple.d.ts +14 -0
  136. package/lib/internal/finiteTuple.js +29 -0
  137. package/lib/internal/finiteTuple.js.map +1 -0
  138. package/lib/internal/gltfHumanoidBones.d.ts +15 -0
  139. package/lib/internal/gltfHumanoidBones.js +39 -0
  140. package/lib/internal/gltfHumanoidBones.js.map +1 -0
  141. package/lib/internal/humanoidBoneOfName.d.ts +18 -0
  142. package/lib/internal/humanoidBoneOfName.js +67 -0
  143. package/lib/internal/humanoidBoneOfName.js.map +1 -0
  144. package/lib/internal/inspectExternalModelHierarchy.d.ts +12 -0
  145. package/lib/internal/inspectExternalModelHierarchy.js +51 -0
  146. package/lib/internal/inspectExternalModelHierarchy.js.map +1 -0
  147. package/lib/internal/inspectExternalMotion.d.ts +23 -0
  148. package/lib/internal/inspectExternalMotion.js +152 -0
  149. package/lib/internal/inspectExternalMotion.js.map +1 -0
  150. package/lib/internal/inspectExternalMotionNodes.d.ts +15 -0
  151. package/lib/internal/inspectExternalMotionNodes.js +58 -0
  152. package/lib/internal/inspectExternalMotionNodes.js.map +1 -0
  153. package/lib/internal/integerIndex.d.ts +12 -0
  154. package/lib/internal/integerIndex.js +23 -0
  155. package/lib/internal/integerIndex.js.map +1 -0
  156. package/lib/internal/integerIndices.d.ts +12 -0
  157. package/lib/internal/integerIndices.js +23 -0
  158. package/lib/internal/integerIndices.js.map +1 -0
  159. package/lib/internal/nonNegativeInteger.d.ts +12 -0
  160. package/lib/internal/nonNegativeInteger.js +22 -0
  161. package/lib/internal/nonNegativeInteger.js.map +1 -0
  162. package/lib/internal/object.d.ts +12 -0
  163. package/lib/internal/object.js +21 -0
  164. package/lib/internal/object.js.map +1 -0
  165. package/lib/internal/optionalArray.d.ts +12 -0
  166. package/lib/internal/optionalArray.js +18 -0
  167. package/lib/internal/optionalArray.js.map +1 -0
  168. package/lib/internal/optionalObject.d.ts +12 -0
  169. package/lib/internal/optionalObject.js +18 -0
  170. package/lib/internal/optionalObject.js.map +1 -0
  171. package/lib/internal/optionalStringArray.d.ts +12 -0
  172. package/lib/internal/optionalStringArray.js +22 -0
  173. package/lib/internal/optionalStringArray.js.map +1 -0
  174. package/lib/internal/positiveInteger.d.ts +12 -0
  175. package/lib/internal/positiveInteger.js +22 -0
  176. package/lib/internal/positiveInteger.js.map +1 -0
  177. package/lib/internal/readMotionAccessor.d.ts +15 -0
  178. package/lib/internal/readMotionAccessor.js +41 -0
  179. package/lib/internal/readMotionAccessor.js.map +1 -0
  180. package/lib/internal/requiredArray.d.ts +12 -0
  181. package/lib/internal/requiredArray.js +21 -0
  182. package/lib/internal/requiredArray.js.map +1 -0
  183. package/lib/internal/uniqueStrings.d.ts +12 -0
  184. package/lib/internal/uniqueStrings.js +18 -0
  185. package/lib/internal/uniqueStrings.js.map +1 -0
  186. package/lib/internal/validNodeIndex.d.ts +12 -0
  187. package/lib/internal/validNodeIndex.js +20 -0
  188. package/lib/internal/validNodeIndex.js.map +1 -0
  189. package/lib/internal/validateAccessorRange.d.ts +14 -0
  190. package/lib/internal/validateAccessorRange.js +37 -0
  191. package/lib/internal/validateAccessorRange.js.map +1 -0
  192. package/lib/internal/validateHumanoidSkinning.d.ts +20 -0
  193. package/lib/internal/validateHumanoidSkinning.js +91 -0
  194. package/lib/internal/validateHumanoidSkinning.js.map +1 -0
  195. package/lib/internal/validatePayloadClosure.d.ts +21 -0
  196. package/lib/internal/validatePayloadClosure.js +74 -0
  197. package/lib/internal/validatePayloadClosure.js.map +1 -0
  198. package/lib/internal/validateSparseAccessor.d.ts +14 -0
  199. package/lib/internal/validateSparseAccessor.js +50 -0
  200. package/lib/internal/validateSparseAccessor.js.map +1 -0
  201. package/lib/internal/vrmHumanoidBones.d.ts +15 -0
  202. package/lib/internal/vrmHumanoidBones.js +132 -0
  203. package/lib/internal/vrmHumanoidBones.js.map +1 -0
  204. package/lib/isAutoMovieExternalModelIngestProfile.d.ts +18 -0
  205. package/lib/isAutoMovieExternalModelIngestProfile.js +24 -0
  206. package/lib/isAutoMovieExternalModelIngestProfile.js.map +1 -0
  207. package/package.json +45 -3
  208. package/src/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.ts +7 -0
  209. package/src/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.ts +21 -0
  210. package/src/AutoMovieExternalModelIngestProfile.ts +15 -0
  211. package/src/AutoMovieExternalMotionAdoptionDecision.ts +14 -0
  212. package/src/AutoMovieGltfMotionInterpretationProfile.ts +10 -0
  213. package/src/IAutoMovieExternalModelInspection.ts +62 -0
  214. package/src/IAutoMovieExternalModelResource.ts +20 -0
  215. package/src/IAutoMovieExternalMotionAdoption.ts +30 -0
  216. package/src/IAutoMovieExternalMotionBoneMapping.ts +17 -0
  217. package/src/IAutoMovieExternalMotionInspection.ts +32 -0
  218. package/src/IAutoMovieExternalMotionNativeDecision.ts +25 -0
  219. package/src/IAutoMovieExternalMotionNativeHandoff.ts +22 -0
  220. package/src/IAutoMovieExternalMotionNodeInspection.ts +26 -0
  221. package/src/IAutoMovieExternalMotionRetargetDecision.ts +31 -0
  222. package/src/IAutoMovieExternalMotionRetargetHandoff.ts +28 -0
  223. package/src/IAutoMovieExternalMotionSource.ts +20 -0
  224. package/src/IAutoMovieIngestResult.ts +19 -0
  225. package/src/adoptAutoMovieExternalMotion.ts +387 -0
  226. package/src/audio/IAutoMovieDecodedProductionAudioAsset.ts +35 -0
  227. package/src/audio/IAutoMovieProductionAudioProcessing.ts +21 -0
  228. package/src/audio/IAutoMovieProductionWaveSourceFormat.ts +50 -0
  229. package/src/audio/decodeProductionAudioAsset.ts +451 -0
  230. package/src/audio/index.ts +4 -0
  231. package/src/decodeAutoMoviePpmImage.ts +103 -0
  232. package/src/humanoidSkeleton.ts +105 -0
  233. package/src/index.ts +23 -0
  234. package/src/ingestDocument.ts +242 -0
  235. package/src/inspectAutoMovieExternalModelBytes.ts +346 -0
  236. package/src/internal/COMPONENT_BYTES.ts +12 -0
  237. package/src/internal/IAccessorSource.ts +18 -0
  238. package/src/internal/IExternalModelAccessorReader.ts +12 -0
  239. package/src/internal/IHumanoidSlot.ts +17 -0
  240. package/src/internal/IParsedContainer.ts +18 -0
  241. package/src/internal/SHAPE_COMPONENTS.ts +27 -0
  242. package/src/internal/accessorElementByteLength.ts +24 -0
  243. package/src/internal/accessorReader.ts +76 -0
  244. package/src/internal/accessorValues.ts +35 -0
  245. package/src/internal/collectExternalResources.ts +69 -0
  246. package/src/internal/compareCodeUnits.ts +15 -0
  247. package/src/internal/composeLocalTransform.ts +56 -0
  248. package/src/internal/decodeDataUri.ts +70 -0
  249. package/src/internal/decodeGlb.ts +70 -0
  250. package/src/internal/decodeJson.ts +76 -0
  251. package/src/internal/fileExtension.ts +18 -0
  252. package/src/internal/finiteTuple.ts +33 -0
  253. package/src/internal/gltfHumanoidBones.ts +48 -0
  254. package/src/internal/humanoidBoneOfName.ts +75 -0
  255. package/src/internal/inspectExternalModelHierarchy.ts +61 -0
  256. package/src/internal/inspectExternalMotion.ts +292 -0
  257. package/src/internal/inspectExternalMotionNodes.ts +81 -0
  258. package/src/internal/integerIndex.ts +28 -0
  259. package/src/internal/integerIndices.ts +24 -0
  260. package/src/internal/nonNegativeInteger.ts +22 -0
  261. package/src/internal/object.ts +22 -0
  262. package/src/internal/optionalArray.ts +17 -0
  263. package/src/internal/optionalObject.ts +20 -0
  264. package/src/internal/optionalStringArray.ts +22 -0
  265. package/src/internal/positiveInteger.ts +22 -0
  266. package/src/internal/readMotionAccessor.ts +60 -0
  267. package/src/internal/requiredArray.ts +19 -0
  268. package/src/internal/uniqueStrings.ts +16 -0
  269. package/src/internal/validNodeIndex.ts +19 -0
  270. package/src/internal/validateAccessorRange.ts +53 -0
  271. package/src/internal/validateHumanoidSkinning.ts +152 -0
  272. package/src/internal/validatePayloadClosure.ts +116 -0
  273. package/src/internal/validateSparseAccessor.ts +109 -0
  274. package/src/internal/vrmHumanoidBones.ts +176 -0
  275. package/src/isAutoMovieExternalModelIngestProfile.ts +28 -0
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeGlb = void 0;
4
+ const decodeJson_1 = require("./decodeJson");
5
+ const GLB_MAGIC = 0x46546c67;
6
+ const GLB_JSON_CHUNK = 0x4e4f534a;
7
+ const GLB_BIN_CHUNK = 0x004e4942;
8
+ /**
9
+ * Decode one GLB 2.0 container's mandatory JSON and optional BIN chunk.
10
+ *
11
+ * @evidence contracts/development/implementation.md#principled-implementation Magic, version, exact length, four-byte chunk alignment and JSON-first ordering establish the container; BIN remains a read-only input view.
12
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Container framing belongs here while strict JSON and duplicate-member checks belong to the shared JSON decoder.
13
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unexpected or repeated trailing chunks and invalid extents throw rather than truncating or guessing a payload.
14
+ * @evidence contracts/development/common.md#meaningful-documentation Comments give version/alignment rules, optional BIN aliasing and suffix-provided VRM container identity.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms Header/chunk scanning is O(chunk count); JSON decoding is O(JSON bytes), and BIN bytes are not copied.
16
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The same decoded JSON owner serves both GLB and plain glTF; one BIN view is reused by downstream payload readers.
17
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The parsed result borrows BIN bytes only during synchronous inspection; JSON objects and view references are call-local.
18
+ */
19
+ const decodeGlb = (bytes, vrmExtension) => {
20
+ if (bytes.byteLength < 20)
21
+ throw new Error("GLB/VRM container is shorter than its mandatory header.");
22
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
23
+ if (view.getUint32(0, true) !== GLB_MAGIC)
24
+ throw new Error("GLB/VRM container has an invalid magic value.");
25
+ if (view.getUint32(4, true) !== 2)
26
+ throw new Error("Only GLB container version 2 is supported.");
27
+ if (view.getUint32(8, true) !== bytes.byteLength)
28
+ throw new Error("GLB declared length does not match resident bytes.");
29
+ const jsonLength = view.getUint32(12, true);
30
+ if (jsonLength === 0 ||
31
+ jsonLength % 4 !== 0 ||
32
+ view.getUint32(16, true) !== GLB_JSON_CHUNK ||
33
+ 20 + jsonLength > bytes.byteLength)
34
+ throw new Error("GLB first chunk is not one aligned JSON chunk.");
35
+ let cursor = 20 + jsonLength;
36
+ let bin = null;
37
+ while (cursor < bytes.byteLength) {
38
+ if (cursor + 8 > bytes.byteLength)
39
+ throw new Error("GLB contains a truncated chunk header.");
40
+ const length = view.getUint32(cursor, true);
41
+ if (length % 4 !== 0 || cursor + 8 + length > bytes.byteLength)
42
+ throw new Error("GLB contains an unaligned or truncated chunk.");
43
+ const type = view.getUint32(cursor + 4, true);
44
+ if (type !== GLB_BIN_CHUNK || bin !== null)
45
+ throw new Error("GLB may contain only one optional BIN chunk after its JSON chunk.");
46
+ bin = bytes.subarray(cursor + 8, cursor + 8 + length);
47
+ cursor += 8 + length;
48
+ }
49
+ return {
50
+ json: (0, decodeJson_1.decodeJson)(bytes.subarray(20, 20 + jsonLength)),
51
+ format: vrmExtension ? "vrm" : "glb",
52
+ bin,
53
+ };
54
+ };
55
+ exports.decodeGlb = decodeGlb;
56
+ //# sourceMappingURL=decodeGlb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeGlb.js","sourceRoot":"","sources":["../../src/internal/decodeGlb.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAE1C,MAAM,SAAS,GAAW,UAAU,CAAC;AAErC,MAAM,cAAc,GAAW,UAAU,CAAC;AAE1C,MAAM,aAAa,GAAW,UAAU,CAAC;AAEzC;;;;;;;;;;GAUG;AACI,MAAM,SAAS,GAGE,CACtB,KAAiB,EACjB,YAAqB,EACH,EAAE;IACpB,IAAI,KAAK,CAAC,UAAU,GAAG,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAa,IAAI,QAAQ,CACjC,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,CACjB,CAAC;IACF,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,SAAS;QACvC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,KAAK,CAAC,UAAU;QAC9C,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,MAAM,UAAU,GAAW,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACpD,IACE,UAAU,KAAK,CAAC;QAChB,UAAU,GAAG,CAAC,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,cAAc;QAC3C,EAAE,GAAG,UAAU,GAAG,KAAK,CAAC,UAAU;QAElC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,IAAI,MAAM,GAAW,EAAE,GAAG,UAAU,CAAC;IACrC,IAAI,GAAG,GAAsB,IAAI,CAAC;IAClC,OAAO,MAAM,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QACjC,IAAI,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU;YAC/B,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAW,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpD,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,UAAU;YAC5D,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,MAAM,IAAI,GAAW,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,IAAI,KAAK,aAAa,IAAI,GAAG,KAAK,IAAI;YACxC,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;QACJ,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;QACtD,MAAM,IAAI,CAAC,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,OAAO;QACL,IAAI,EAAE,IAAA,uBAAU,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC;QACrD,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;QACpC,GAAG;KACJ,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,SAAS,GAAT,SAAS,CAiDpB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Decode strict UTF-8 JSON and refuse duplicate decoded member names.
3
+ *
4
+ * @evidence contracts/development/implementation.md#principled-implementation JSON.parse admits syntax before an iterative container/name scan rejects escaped-equivalent duplicates without recursion depth limits.
5
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure UTF-8, syntax and duplicate-member admission form one byte ingress shared by glTF and GLB.
6
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Last-wins duplicate keys cannot hide a competing loader interpretation, and invalid UTF-8 is not repaired.
7
+ * @evidence contracts/development/common.md#meaningful-documentation Prose names strict decoding, escape-equivalent duplication, iterative depth behavior and diagnostic wrapping.
8
+ * @evidence contracts/development/implementation.md#efficient-algorithms Text length drives O(N) parsing and duplicate scan; object name sets and scope stack scale with input members and depth.
9
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Syntax is parsed once and reused by the duplicate scan's valid-text premise; escaped names alone require local JSON string decoding.
10
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Text, scope stack and key sets are temporary; only the caller-owned parsed JSON tree survives return.
11
+ */
12
+ export declare const decodeJson: (bytes: Uint8Array) => unknown;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeJson = void 0;
4
+ /**
5
+ * Decode strict UTF-8 JSON and refuse duplicate decoded member names.
6
+ *
7
+ * @evidence contracts/development/implementation.md#principled-implementation JSON.parse admits syntax before an iterative container/name scan rejects escaped-equivalent duplicates without recursion depth limits.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure UTF-8, syntax and duplicate-member admission form one byte ingress shared by glTF and GLB.
9
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Last-wins duplicate keys cannot hide a competing loader interpretation, and invalid UTF-8 is not repaired.
10
+ * @evidence contracts/development/common.md#meaningful-documentation Prose names strict decoding, escape-equivalent duplication, iterative depth behavior and diagnostic wrapping.
11
+ * @evidence contracts/development/implementation.md#efficient-algorithms Text length drives O(N) parsing and duplicate scan; object name sets and scope stack scale with input members and depth.
12
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Syntax is parsed once and reused by the duplicate scan's valid-text premise; escaped names alone require local JSON string decoding.
13
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Text, scope stack and key sets are temporary; only the caller-owned parsed JSON tree survives return.
14
+ */
15
+ const decodeJson = (bytes) => {
16
+ try {
17
+ const text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
18
+ const value = JSON.parse(text);
19
+ assertUniqueJsonObjectMembers(text);
20
+ return value;
21
+ }
22
+ catch (error) {
23
+ throw new Error(`External model JSON is invalid: ${error.message}.`);
24
+ }
25
+ };
26
+ exports.decodeJson = decodeJson;
27
+ /**
28
+ * Refuse decoded-equivalent member names before last-wins JSON can hide one.
29
+ *
30
+ * The scan runs only over text `JSON.parse` has already accepted, so it needs no syntax checks: one pass keeps a stack of open containers, with a name set for each object, and treats the string after `{` or after `,` inside an object as a member name. A name containing an escape is decoded through `JSON.parse`, so an escaped spelling collides with its plain spelling. The stack replaces recursion, so nesting depth never becomes call-stack depth. It lives here rather than reusing the production package's structured JSON ingress because production sits above ingest in the dependency graph; importing its ingress would reverse that package dependency.
31
+ */
32
+ const assertUniqueJsonObjectMembers = (text) => {
33
+ const scopes = [];
34
+ let expectName = false;
35
+ let cursor = 0;
36
+ while (cursor < text.length) {
37
+ const code = text.charCodeAt(cursor);
38
+ if (code === 0x22) {
39
+ const start = cursor;
40
+ let escaped = false;
41
+ ++cursor;
42
+ while (text.charCodeAt(cursor) !== 0x22) {
43
+ if (text.charCodeAt(cursor) === 0x5c) {
44
+ escaped = true;
45
+ ++cursor;
46
+ }
47
+ ++cursor;
48
+ }
49
+ ++cursor;
50
+ if (expectName) {
51
+ const name = escaped
52
+ ? JSON.parse(text.slice(start, cursor))
53
+ : text.slice(start + 1, cursor - 1);
54
+ const names = scopes[scopes.length - 1];
55
+ if (names.has(name))
56
+ throw new Error(`duplicate member ${JSON.stringify(name)}`);
57
+ names.add(name);
58
+ expectName = false;
59
+ }
60
+ continue;
61
+ }
62
+ if (code === 0x7b) {
63
+ scopes.push(new Set());
64
+ expectName = true;
65
+ }
66
+ else if (code === 0x5b)
67
+ scopes.push(null);
68
+ else if (code === 0x7d || code === 0x5d) {
69
+ scopes.pop();
70
+ expectName = false;
71
+ }
72
+ else if (code === 0x2c)
73
+ expectName = scopes[scopes.length - 1] !== null;
74
+ ++cursor;
75
+ }
76
+ };
77
+ //# sourceMappingURL=decodeJson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeJson.js","sourceRoot":"","sources":["../../src/internal/decodeJson.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACI,MAAM,UAAU,GAAmC,CACxD,KAAiB,EACR,EAAE;IACX,IAAI,CAAC;QACH,MAAM,IAAI,GAAW,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CACnE,KAAK,CACN,CAAC;QACF,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxC,6BAA6B,CAAC,IAAI,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,mCAAoC,KAAe,CAAC,OAAO,GAAG,CAC/D,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAfW,QAAA,UAAU,GAAV,UAAU,CAerB;AAEF;;;;GAIG;AACH,MAAM,6BAA6B,GAA2B,CAC5D,IAAY,EACN,EAAE;IACR,MAAM,MAAM,GAA8B,EAAE,CAAC;IAC7C,IAAI,UAAU,GAAY,KAAK,CAAC;IAChC,IAAI,MAAM,GAAW,CAAC,CAAC;IACvB,OAAO,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAW,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,KAAK,GAAW,MAAM,CAAC;YAC7B,IAAI,OAAO,GAAY,KAAK,CAAC;YAC7B,EAAE,MAAM,CAAC;YACT,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;gBACxC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;oBACrC,OAAO,GAAG,IAAI,CAAC;oBACf,EAAE,MAAM,CAAC;gBACX,CAAC;gBACD,EAAE,MAAM,CAAC;YACX,CAAC;YACD,EAAE,MAAM,CAAC;YACT,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,IAAI,GAAW,OAAO;oBAC1B,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAY;oBACnD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;gBACtC,MAAM,KAAK,GAAgB,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;gBACtD,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;oBACjB,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC9D,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAChB,UAAU,GAAG,KAAK,CAAC;YACrB,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,EAAU,CAAC,CAAC;YAC/B,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;aAAM,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,EAAE,CAAC;YACb,UAAU,GAAG,KAAK,CAAC;QACrB,CAAC;aAAM,IAAI,IAAI,KAAK,IAAI;YAAE,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;QAC1E,EAAE,MAAM,CAAC;IACX,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Read the case-insensitive suffix of the final project-relative path component.
3
+ *
4
+ * @evidence contracts/development/implementation.md#principled-implementation The last forward slash selects the contract's project-path basename and the last dot selects its extension.
5
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Suffix interpretation stays separate from container decoding and profile selection.
6
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No suffix is inferred from byte content and a basename without a dot stays extensionless.
7
+ * @evidence contracts/development/common.md#meaningful-documentation Documentation identifies project-relative slash convention, case folding and the empty-suffix result.
8
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two last-index searches and one suffix lowercase copy cost O(path length) without filesystem access.
9
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each inspection derives its suffix once before selecting the container parser.
10
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only temporary substrings are allocated; paths, file handles and container bytes are not retained.
11
+ */
12
+ export declare const fileExtension: (value: string) => string;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fileExtension = void 0;
4
+ /**
5
+ * Read the case-insensitive suffix of the final project-relative path component.
6
+ *
7
+ * @evidence contracts/development/implementation.md#principled-implementation The last forward slash selects the contract's project-path basename and the last dot selects its extension.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Suffix interpretation stays separate from container decoding and profile selection.
9
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No suffix is inferred from byte content and a basename without a dot stays extensionless.
10
+ * @evidence contracts/development/common.md#meaningful-documentation Documentation identifies project-relative slash convention, case folding and the empty-suffix result.
11
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two last-index searches and one suffix lowercase copy cost O(path length) without filesystem access.
12
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each inspection derives its suffix once before selecting the container parser.
13
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only temporary substrings are allocated; paths, file handles and container bytes are not retained.
14
+ */
15
+ const fileExtension = (value) => {
16
+ const name = value.slice(value.lastIndexOf("/") + 1);
17
+ const index = name.lastIndexOf(".");
18
+ return index < 0 ? "" : name.slice(index).toLowerCase();
19
+ };
20
+ exports.fileExtension = fileExtension;
21
+ //# sourceMappingURL=fileExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileExtension.js","sourceRoot":"","sources":["../../src/internal/fileExtension.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACI,MAAM,aAAa,GAA8B,CACtD,KAAa,EACL,EAAE;IACV,MAAM,IAAI,GAAW,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAW,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC1D,CAAC,CAAC;AANW,QAAA,aAAa,GAAb,aAAa,CAMxB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Read a finite numeric tuple with a glTF default when omitted.
3
+ *
4
+ * Undefined copies the caller's fallback without validating it; motion-node callers supply finite three- or four-component glTF defaults. Present arrays must have the same length and finite numeric entries, or throw with the field/index path. Both branches return a fresh array.
5
+ *
6
+ * @evidence contracts/development/implementation.md#principled-implementation Undefined copies the fixed fallback; supplied arrays must match its length and contain only finite numbers.
7
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The tuple gate owns numeric/arity admission while motion-node interpretation chooses translation, scale and quaternion defaults.
8
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Wrong lengths and nonfinite values throw; supplied tuples are not normalized or padded to hide defects.
9
+ * @evidence contracts/development/common.md#meaningful-documentation Comments identify omission, caller-owned copied output and indexed finite-value errors.
10
+ * @evidence contracts/development/implementation.md#efficient-algorithms Tuple length K drives O(K) time and result space; current callers use only three or four components.
11
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The same tuple admission serves translation, rotation and scale without cross-call caching of mutable inputs.
12
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned K-number array belongs to its caller and retains no reference to the source or fallback array.
13
+ */
14
+ export declare const finiteTuple: (value: unknown, path: string, fallback: readonly number[]) => number[];
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.finiteTuple = void 0;
4
+ /**
5
+ * Read a finite numeric tuple with a glTF default when omitted.
6
+ *
7
+ * Undefined copies the caller's fallback without validating it; motion-node callers supply finite three- or four-component glTF defaults. Present arrays must have the same length and finite numeric entries, or throw with the field/index path. Both branches return a fresh array.
8
+ *
9
+ * @evidence contracts/development/implementation.md#principled-implementation Undefined copies the fixed fallback; supplied arrays must match its length and contain only finite numbers.
10
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The tuple gate owns numeric/arity admission while motion-node interpretation chooses translation, scale and quaternion defaults.
11
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Wrong lengths and nonfinite values throw; supplied tuples are not normalized or padded to hide defects.
12
+ * @evidence contracts/development/common.md#meaningful-documentation Comments identify omission, caller-owned copied output and indexed finite-value errors.
13
+ * @evidence contracts/development/implementation.md#efficient-algorithms Tuple length K drives O(K) time and result space; current callers use only three or four components.
14
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The same tuple admission serves translation, rotation and scale without cross-call caching of mutable inputs.
15
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned K-number array belongs to its caller and retains no reference to the source or fallback array.
16
+ */
17
+ const finiteTuple = (value, path, fallback) => {
18
+ if (value === undefined)
19
+ return [...fallback];
20
+ if (Array.isArray(value) === false || value.length !== fallback.length)
21
+ throw new Error(`${path} must contain exactly ${fallback.length} finite numbers.`);
22
+ return value.map((entry, index) => {
23
+ if (typeof entry !== "number" || Number.isFinite(entry) === false)
24
+ throw new Error(`${path}[${index}] must be finite.`);
25
+ return entry;
26
+ });
27
+ };
28
+ exports.finiteTuple = finiteTuple;
29
+ //# sourceMappingURL=finiteTuple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finiteTuple.js","sourceRoot":"","sources":["../../src/internal/finiteTuple.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACI,MAAM,WAAW,GAIR,CACd,KAAc,EACd,IAAY,EACZ,QAA2B,EACjB,EAAE;IACZ,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QACpE,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,yBAAyB,QAAQ,CAAC,MAAM,kBAAkB,CAClE,CAAC;IACJ,OAAQ,KAAmB,CAAC,GAAG,CAAC,CAAC,KAAc,EAAE,KAAa,EAAU,EAAE;QACxE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK;YAC/D,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,KAAK,mBAAmB,CAAC,CAAC;QACvD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,WAAW,GAAX,WAAW,CAmBtB"}
@@ -0,0 +1,15 @@
1
+ import type { IHumanoidSlot } from "./IHumanoidSlot";
2
+ /**
3
+ * Resolve first-claim glTF skin joints to recognized humanoid naming slots.
4
+ *
5
+ * The caller has admitted skin joint indices. Nodes are visited in source order, eligible only when listed in a skin, with the first recognized name per slot retained; unrecognized names and later duplicate slots are ignored. Returned slots describe naming correspondence rather than anatomy or positive skin-weight coverage.
6
+ *
7
+ * @evidence contracts/development/implementation.md#principled-implementation Skin joint indices define eligible nodes and normalized aliases assign at most one source-order node per semantic slot.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Skin membership and slot claiming stay here while the shared name helper owns this importer's supported naming vocabulary.
9
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unrecognized names and repeated slots remain unmapped instead of overwriting first ownership or inferring missing anatomy.
10
+ * @evidence contracts/development/common.md#meaningful-documentation Comments state node-order first claim, skin-only eligibility and the distinction from actual weight coverage.
11
+ * @evidence contracts/development/implementation.md#efficient-algorithms Work follows skins, their joint entries, nodes and eligible node-name text, with expected constant-time membership and slot lookups.
12
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each eligible node name is resolved once; the inspector separately shares mesh/skin weight checks.
13
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Temporary membership sets die with the call; returned slot records are bounded by the recognized humanoid vocabulary.
14
+ */
15
+ export declare const gltfHumanoidBones: (nodes: unknown[], skins: unknown[]) => IHumanoidSlot[];
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gltfHumanoidBones = void 0;
4
+ const humanoidBoneOfName_1 = require("../internal/humanoidBoneOfName");
5
+ const object_1 = require("./object");
6
+ const requiredArray_1 = require("./requiredArray");
7
+ /**
8
+ * Resolve first-claim glTF skin joints to recognized humanoid naming slots.
9
+ *
10
+ * The caller has admitted skin joint indices. Nodes are visited in source order, eligible only when listed in a skin, with the first recognized name per slot retained; unrecognized names and later duplicate slots are ignored. Returned slots describe naming correspondence rather than anatomy or positive skin-weight coverage.
11
+ *
12
+ * @evidence contracts/development/implementation.md#principled-implementation Skin joint indices define eligible nodes and normalized aliases assign at most one source-order node per semantic slot.
13
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Skin membership and slot claiming stay here while the shared name helper owns this importer's supported naming vocabulary.
14
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unrecognized names and repeated slots remain unmapped instead of overwriting first ownership or inferring missing anatomy.
15
+ * @evidence contracts/development/common.md#meaningful-documentation Comments state node-order first claim, skin-only eligibility and the distinction from actual weight coverage.
16
+ * @evidence contracts/development/implementation.md#efficient-algorithms Work follows skins, their joint entries, nodes and eligible node-name text, with expected constant-time membership and slot lookups.
17
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each eligible node name is resolved once; the inspector separately shares mesh/skin weight checks.
18
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Temporary membership sets die with the call; returned slot records are bounded by the recognized humanoid vocabulary.
19
+ */
20
+ const gltfHumanoidBones = (nodes, skins) => {
21
+ const joints = new Set(skins.flatMap((value, index) => (0, requiredArray_1.requiredArray)((0, object_1.object)(value, `skins[${index}]`).joints, `skins[${index}].joints`)));
22
+ const used = new Set();
23
+ const slots = [];
24
+ nodes.forEach((value, index) => {
25
+ if (joints.has(index) === false)
26
+ return;
27
+ const name = (0, object_1.object)(value, `nodes[${index}]`).name;
28
+ if (typeof name !== "string")
29
+ return;
30
+ const bone = (0, humanoidBoneOfName_1.humanoidBoneOfName)(name);
31
+ if (bone === undefined || used.has(bone))
32
+ return;
33
+ used.add(bone);
34
+ slots.push({ bone, node: index });
35
+ });
36
+ return slots;
37
+ };
38
+ exports.gltfHumanoidBones = gltfHumanoidBones;
39
+ //# sourceMappingURL=gltfHumanoidBones.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gltfHumanoidBones.js","sourceRoot":"","sources":["../../src/internal/gltfHumanoidBones.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE,qCAAkC;AAClC,mDAAgD;AAEhD;;;;;;;;;;;;GAYG;AACI,MAAM,iBAAiB,GAGP,CACrB,KAAgB,EAChB,KAAgB,EACC,EAAE;IACnB,MAAM,MAAM,GAAiB,IAAI,GAAG,CAClC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAc,EAAE,KAAa,EAAa,EAAE,CACzD,IAAA,6BAAa,EACX,IAAA,eAAM,EAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,CAAC,MAAM,EACvC,SAAS,KAAK,UAAU,CACzB,CACF,CACF,CAAC;IACF,MAAM,IAAI,GAA+B,IAAI,GAAG,EAAyB,CAAC;IAC1E,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAc,EAAE,KAAa,EAAQ,EAAE;QACpD,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK;YAAE,OAAO;QACxC,MAAM,IAAI,GAAY,IAAA,eAAM,EAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;QAC5D,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO;QACrC,MAAM,IAAI,GAAsC,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;QACzE,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QACjD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA3BW,QAAA,iBAAiB,GAAjB,iBAAiB,CA2B5B"}
@@ -0,0 +1,18 @@
1
+ import type { AutoMovieHumanoidBone } from "@automovie/interface";
2
+ /**
3
+ * Resolve an imported joint name to the humanoid slot its rig convention means.
4
+ *
5
+ * The name is lowercased, a leading `mixamorig` prefix (with or without its colon) is removed, and whitespace, `_`, `.`, `:`, `|` and `-` are dropped, so `mixamorig:LeftUpLeg`, `Left_UpLeg` and `leftUpLeg` all read as `leftupleg`. The table covers the supported Blender-style names (`Spine`, `LeftUpLeg`), Mixamo, VRM-style slot names (`leftUpperArm`), and Unreal mannequin spine chains (`spine_01` to `spine_03`). Fingers, eyes and jaw have no alias, so a hand rig maps only to its hand slot.
6
+ *
7
+ * @param name Joint node name exactly as the source declares it.
8
+ * @returns The slot, or `undefined` when no convention in the table names it.
9
+ *
10
+ * @evidence contracts/development/implementation.md#principled-implementation Lowercasing, removing a leading `mixamorig` prefix and dropping separator characters reduces each convention's spelling to one key, and an exact `Map` lookup resolves it, so inherited object keys can never match.
11
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The table and the normalization live in one module that the skeleton importer and the byte inspector both call, replacing two copies that had to be kept in step.
12
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The closed alias vocabulary is a naming convention supported by this mapper rather than an anatomical inference, and both callers keep their own first-claim rule instead of the helper guessing between duplicates.
13
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states the normalization steps with an example, the covered conventions, the unmapped finger, eye and jaw slots, and what `undefined` means.
14
+ * @evidence contracts/development/implementation.md#efficient-algorithms Cost is linear in the name length for two regular-expression passes and one lowercase copy, then one hash lookup.
15
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each invocation normalizes its supplied name; a joint shared by several skins may be revisited, and this helper retains no cache over mutable source revisions.
16
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The module-level table is a fixed forty-entry constant; a call retains nothing.
17
+ */
18
+ export declare const humanoidBoneOfName: (name: string) => AutoMovieHumanoidBone | undefined;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.humanoidBoneOfName = void 0;
4
+ /**
5
+ * Resolve an imported joint name to the humanoid slot its rig convention means.
6
+ *
7
+ * The name is lowercased, a leading `mixamorig` prefix (with or without its colon) is removed, and whitespace, `_`, `.`, `:`, `|` and `-` are dropped, so `mixamorig:LeftUpLeg`, `Left_UpLeg` and `leftUpLeg` all read as `leftupleg`. The table covers the supported Blender-style names (`Spine`, `LeftUpLeg`), Mixamo, VRM-style slot names (`leftUpperArm`), and Unreal mannequin spine chains (`spine_01` to `spine_03`). Fingers, eyes and jaw have no alias, so a hand rig maps only to its hand slot.
8
+ *
9
+ * @param name Joint node name exactly as the source declares it.
10
+ * @returns The slot, or `undefined` when no convention in the table names it.
11
+ *
12
+ * @evidence contracts/development/implementation.md#principled-implementation Lowercasing, removing a leading `mixamorig` prefix and dropping separator characters reduces each convention's spelling to one key, and an exact `Map` lookup resolves it, so inherited object keys can never match.
13
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The table and the normalization live in one module that the skeleton importer and the byte inspector both call, replacing two copies that had to be kept in step.
14
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The closed alias vocabulary is a naming convention supported by this mapper rather than an anatomical inference, and both callers keep their own first-claim rule instead of the helper guessing between duplicates.
15
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states the normalization steps with an example, the covered conventions, the unmapped finger, eye and jaw slots, and what `undefined` means.
16
+ * @evidence contracts/development/implementation.md#efficient-algorithms Cost is linear in the name length for two regular-expression passes and one lowercase copy, then one hash lookup.
17
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each invocation normalizes its supplied name; a joint shared by several skins may be revisited, and this helper retains no cache over mutable source revisions.
18
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The module-level table is a fixed forty-entry constant; a call retains nothing.
19
+ */
20
+ const humanoidBoneOfName = (name) => HUMANOID_ALIASES.get(name
21
+ .toLowerCase()
22
+ .replace(/^mixamorig:?/u, "")
23
+ .replace(/[\s_.:|-]/gu, ""));
24
+ exports.humanoidBoneOfName = humanoidBoneOfName;
25
+ const HUMANOID_ALIASES = new Map([
26
+ ["hips", "hips"],
27
+ ["pelvis", "hips"],
28
+ ["spine", "spine"],
29
+ ["spine01", "spine"],
30
+ ["spine1", "chest"],
31
+ ["chest", "chest"],
32
+ ["spine02", "chest"],
33
+ ["spine2", "upperChest"],
34
+ ["spine03", "upperChest"],
35
+ ["upperchest", "upperChest"],
36
+ ["neck", "neck"],
37
+ ["head", "head"],
38
+ ["leftshoulder", "leftShoulder"],
39
+ ["leftclavicle", "leftShoulder"],
40
+ ["leftarm", "leftUpperArm"],
41
+ ["leftupperarm", "leftUpperArm"],
42
+ ["leftforearm", "leftLowerArm"],
43
+ ["leftlowerarm", "leftLowerArm"],
44
+ ["lefthand", "leftHand"],
45
+ ["rightshoulder", "rightShoulder"],
46
+ ["rightclavicle", "rightShoulder"],
47
+ ["rightarm", "rightUpperArm"],
48
+ ["rightupperarm", "rightUpperArm"],
49
+ ["rightforearm", "rightLowerArm"],
50
+ ["rightlowerarm", "rightLowerArm"],
51
+ ["righthand", "rightHand"],
52
+ ["leftupleg", "leftUpperLeg"],
53
+ ["leftupperleg", "leftUpperLeg"],
54
+ ["leftleg", "leftLowerLeg"],
55
+ ["leftlowerleg", "leftLowerLeg"],
56
+ ["leftfoot", "leftFoot"],
57
+ ["lefttoebase", "leftToes"],
58
+ ["lefttoes", "leftToes"],
59
+ ["rightupleg", "rightUpperLeg"],
60
+ ["rightupperleg", "rightUpperLeg"],
61
+ ["rightleg", "rightLowerLeg"],
62
+ ["rightlowerleg", "rightLowerLeg"],
63
+ ["rightfoot", "rightFoot"],
64
+ ["righttoebase", "rightToes"],
65
+ ["righttoes", "rightToes"],
66
+ ]);
67
+ //# sourceMappingURL=humanoidBoneOfName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"humanoidBoneOfName.js","sourceRoot":"","sources":["../../src/internal/humanoidBoneOfName.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;GAeG;AACI,MAAM,kBAAkB,GAEU,CACvC,IAAY,EACuB,EAAE,CACrC,gBAAgB,CAAC,GAAG,CAClB,IAAI;KACD,WAAW,EAAE;KACb,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;KAC5B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAC9B,CAAC;AAVS,QAAA,kBAAkB,GAAlB,kBAAkB,CAU3B;AAEJ,MAAM,gBAAgB,GAA+C,IAAI,GAAG,CAG1E;IACA,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,OAAO,CAAC;IACnB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,YAAY,CAAC;IACxB,CAAC,SAAS,EAAE,YAAY,CAAC;IACzB,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,SAAS,EAAE,cAAc,CAAC;IAC3B,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,UAAU,EAAE,eAAe,CAAC;IAC7B,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,cAAc,EAAE,eAAe,CAAC;IACjC,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,WAAW,EAAE,cAAc,CAAC;IAC7B,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,SAAS,EAAE,cAAc,CAAC;IAC3B,CAAC,cAAc,EAAE,cAAc,CAAC;IAChC,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,aAAa,EAAE,UAAU,CAAC;IAC3B,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,YAAY,EAAE,eAAe,CAAC;IAC/B,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,UAAU,EAAE,eAAe,CAAC;IAC7B,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,cAAc,EAAE,WAAW,CAAC;IAC7B,CAAC,WAAW,EAAE,WAAW,CAAC;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Establish a unique-parent acyclic glTF node forest.
3
+ *
4
+ * @evidence contracts/development/implementation.md#principled-implementation Index-validated child edges fill one parent table; iterative three-state walks detect cycles and mark completed root paths.
5
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Hierarchy admission runs before profile dispatch so static, humanoid and motion consumers share one forest contract.
6
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Duplicate children, multiple parents and parent cycles throw without rewriting the graph or dropping links.
7
+ * @evidence contracts/development/common.md#meaningful-documentation Comments explain index-validation prerequisite, unique parent semantics and depth-safe iterative traversal.
8
+ * @evidence contracts/development/implementation.md#efficient-algorithms N nodes and E child links cost O(N+E), since completed parent walks are marked and each node enters one unfinished path.
9
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The returned parent table is reused by scene-root admission and motion-node interpretation in the same inspector call.
10
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Parent/state/path arrays are bounded by node count; only the returned table remains with its synchronous caller.
11
+ */
12
+ export declare const inspectExternalModelHierarchy: (values: unknown[]) => Array<number | undefined>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inspectExternalModelHierarchy = void 0;
4
+ const object_1 = require("./object");
5
+ const optionalArray_1 = require("./optionalArray");
6
+ /**
7
+ * Establish a unique-parent acyclic glTF node forest.
8
+ *
9
+ * @evidence contracts/development/implementation.md#principled-implementation Index-validated child edges fill one parent table; iterative three-state walks detect cycles and mark completed root paths.
10
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Hierarchy admission runs before profile dispatch so static, humanoid and motion consumers share one forest contract.
11
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Duplicate children, multiple parents and parent cycles throw without rewriting the graph or dropping links.
12
+ * @evidence contracts/development/common.md#meaningful-documentation Comments explain index-validation prerequisite, unique parent semantics and depth-safe iterative traversal.
13
+ * @evidence contracts/development/implementation.md#efficient-algorithms N nodes and E child links cost O(N+E), since completed parent walks are marked and each node enters one unfinished path.
14
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The returned parent table is reused by scene-root admission and motion-node interpretation in the same inspector call.
15
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Parent/state/path arrays are bounded by node count; only the returned table remains with its synchronous caller.
16
+ */
17
+ const inspectExternalModelHierarchy = (values) => {
18
+ const parentByIndex = new Array(values.length);
19
+ values.forEach((value, parentIndex) => {
20
+ const node = (0, object_1.object)(value, `nodes[${parentIndex}]`);
21
+ (0, optionalArray_1.optionalArray)(node.children, `nodes[${parentIndex}].children`).forEach((entry) => {
22
+ const childIndex = entry;
23
+ const previous = parentByIndex[childIndex];
24
+ if (previous === parentIndex)
25
+ throw new Error(`nodes[${parentIndex}].children repeats node ${childIndex}.`);
26
+ if (previous !== undefined)
27
+ throw new Error(`nodes[${childIndex}] has multiple parents ${previous} and ${parentIndex}.`);
28
+ parentByIndex[childIndex] = parentIndex;
29
+ });
30
+ });
31
+ // 0 = unvisited, 1 = on the current walk, 2 = proven to reach a root.
32
+ const state = new Uint8Array(values.length);
33
+ for (let start = 0; start < values.length; ++start) {
34
+ if (state[start] !== 0)
35
+ continue;
36
+ const path = [];
37
+ let index = start;
38
+ while (index !== undefined && state[index] === 0) {
39
+ state[index] = 1;
40
+ path.push(index);
41
+ index = parentByIndex[index];
42
+ }
43
+ if (index !== undefined && state[index] === 1)
44
+ throw new Error(`nodes[${index}] belongs to a parent cycle.`);
45
+ for (const entry of path)
46
+ state[entry] = 2;
47
+ }
48
+ return parentByIndex;
49
+ };
50
+ exports.inspectExternalModelHierarchy = inspectExternalModelHierarchy;
51
+ //# sourceMappingURL=inspectExternalModelHierarchy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspectExternalModelHierarchy.js","sourceRoot":"","sources":["../../src/internal/inspectExternalModelHierarchy.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,mDAAgD;AAEhD;;;;;;;;;;GAUG;AACI,MAAM,6BAA6B,GAET,CAC/B,MAAiB,EACU,EAAE;IAC7B,MAAM,aAAa,GAA8B,IAAI,KAAK,CAExD,MAAM,CAAC,MAAM,CAAC,CAAC;IACjB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAc,EAAE,WAAmB,EAAQ,EAAE;QAC3D,MAAM,IAAI,GAA4B,IAAA,eAAM,EAC1C,KAAK,EACL,SAAS,WAAW,GAAG,CACxB,CAAC;QACF,IAAA,6BAAa,EAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,WAAW,YAAY,CAAC,CAAC,OAAO,CACpE,CAAC,KAAc,EAAQ,EAAE;YACvB,MAAM,UAAU,GAAW,KAAe,CAAC;YAC3C,MAAM,QAAQ,GAAuB,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/D,IAAI,QAAQ,KAAK,WAAW;gBAC1B,MAAM,IAAI,KAAK,CACb,SAAS,WAAW,2BAA2B,UAAU,GAAG,CAC7D,CAAC;YACJ,IAAI,QAAQ,KAAK,SAAS;gBACxB,MAAM,IAAI,KAAK,CACb,SAAS,UAAU,0BAA0B,QAAQ,QAAQ,WAAW,GAAG,CAC5E,CAAC;YACJ,aAAa,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC;QAC1C,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,sEAAsE;IACtE,MAAM,KAAK,GAAe,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxD,KAAK,IAAI,KAAK,GAAW,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC;QAC3D,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,SAAS;QACjC,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,IAAI,KAAK,GAAuB,KAAK,CAAC;QACtC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACjD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACjB,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,SAAS,KAAK,8BAA8B,CAAC,CAAC;QAChE,KAAK,MAAM,KAAK,IAAI,IAAI;YAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AA9CW,QAAA,6BAA6B,GAA7B,6BAA6B,CA8CxC"}
@@ -0,0 +1,23 @@
1
+ import type { IAutoMovieExternalMotionInspection } from "../IAutoMovieExternalMotionInspection";
2
+ import type { IAccessorSource } from "./IAccessorSource";
3
+ /**
4
+ * Normalize glTF animation samplers into deterministic node tracks.
5
+ *
6
+ * Empty animation inventories return undefined. Otherwise source-order clips and channel-order tracks own independent FLOAT keyframe copies, even when samplers share accessors. Times must be nonnegative and strictly increasing; output arity follows path and interpolation, with only quaternion value groups checked within 1e-4 of unit magnitude. Cubic tangents remain unchanged and weight arity is not checked against the target mesh's morph count. Missing interpolation means LINEAR; unknown interpolation, duplicate node/path channels and malformed data throw with the field path.
7
+ *
8
+ * @evidence contracts/development/implementation.md#principled-implementation Validated FLOAT accessors, strictly increasing nonnegative times, supported interpolation and target-specific arity determine copied clips.
9
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Motion normalization owns sampler/channel relationships while hierarchy, node TRS and byte readers remain separate owners.
10
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Duplicate targets and non-finite values throw; quaternion value groups outside the 1e-4 magnitude tolerance are refused, while accepted keyframes are copied without normalization. Weight counts are checked only for a nonempty whole keyframe group, not against a target mesh's morph count.
11
+ * @evidence contracts/development/common.md#meaningful-documentation Prose describes clip/channel ordering, exact keyframe ownership, interpolation, arity and quaternion checks.
12
+ * @evidence contracts/development/implementation.md#efficient-algorithms Cost follows node/channel counts and decoded/copied keyframe values; shared accessors are decoded once but each track owns a copy.
13
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Accessor index plus expected shape keys per-call decoding; immutable source/payload dependencies justify reuse and track arrays remain independent.
14
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The decode cache lives only for one inspection; returned clips retain arrays proportional to keyframe counts without raw payload bytes.
15
+ */
16
+ export declare const inspectExternalMotion: (props: {
17
+ path: string;
18
+ byteLength: number;
19
+ animations: unknown[];
20
+ nodes: unknown[];
21
+ parentByIndex: readonly (number | undefined)[];
22
+ source: IAccessorSource;
23
+ }) => IAutoMovieExternalMotionInspection | undefined;