@automovie/ingest 0.0.0-stage → 0.0.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,132 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vrmHumanoidBones = void 0;
4
+ const compareCodeUnits_1 = require("./compareCodeUnits");
5
+ const object_1 = require("./object");
6
+ const optionalObject_1 = require("./optionalObject");
7
+ const requiredArray_1 = require("./requiredArray");
8
+ const validNodeIndex_1 = require("./validNodeIndex");
9
+ /**
10
+ * Read declared VRM humanoid mappings using version-specific thumb migration.
11
+ *
12
+ * VRMC_vrm takes precedence when both metadata families exist and emits recognized bone keys in code-unit order; VRM 0.x retains array order, migrates thumb names and rejects duplicate slots. Unknown names and invalid node indices throw, and absent metadata returns an empty list. VRMC_vrm is interpreted with 1.0 thumb names even for 1.0-beta declarations; this pass does not validate a complete VRM schema, unique target nodes or skin weights.
13
+ *
14
+ * @evidence contracts/development/implementation.md#principled-implementation VRMC_vrm uses named 1.0 slots and valid node indices; VRM 0.x maps renamed thumb slots and rejects duplicates.
15
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Version branching, thumb migration and the closed humanoid vocabulary stay with this metadata owner.
16
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unknown or dangling mappings throw; VRMC_vrm beta thumb conventions remain an explicit unresolved interpretation limit.
17
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states metadata version branching, node references, ordering and unsupported beta interpretation.
18
+ * @evidence contracts/development/implementation.md#efficient-algorithms Work follows mapping entries and name text; 1.0 metadata enumerates B keys before O(B log B) prefix-scanning comparisons, while 0.x uses expected constant-time slot lookups after name admission.
19
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Each metadata mapping is resolved once during its inspector call; mutable documents prevent persistent equivalence caching.
20
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Result slot records scale with declared mappings; temporary entries and uniqueness sets die on return or throw.
21
+ */
22
+ const vrmHumanoidBones = (document, nodes) => {
23
+ const extensions = (0, optionalObject_1.optionalObject)(document.extensions, "extensions");
24
+ if (extensions.VRMC_vrm !== undefined) {
25
+ const vrm = (0, object_1.object)(extensions.VRMC_vrm, "extensions.VRMC_vrm");
26
+ const humanoid = (0, object_1.object)(vrm.humanoid, "extensions.VRMC_vrm.humanoid");
27
+ const bones = (0, object_1.object)(humanoid.humanBones, "extensions.VRMC_vrm.humanoid.humanBones");
28
+ return Object.entries(bones)
29
+ .sort(([left], [right]) => (0, compareCodeUnits_1.compareCodeUnits)(left, right))
30
+ .map(([bone, value]) => {
31
+ if (Object.hasOwn(HUMANOID_BONES, bone) === false)
32
+ throw new Error(`VRMC_vrm declares unknown humanoid bone "${bone}".`);
33
+ const node = (0, object_1.object)(value, `extensions.VRMC_vrm.humanoid.humanBones.${bone}`).node;
34
+ if ((0, validNodeIndex_1.validNodeIndex)(node, nodes.length) === false)
35
+ throw new Error(`VRMC_vrm humanoid bone "${bone}" does not resolve to a node.`);
36
+ return { bone: bone, node: node };
37
+ });
38
+ }
39
+ if (extensions.VRM !== undefined) {
40
+ const vrm = (0, object_1.object)(extensions.VRM, "extensions.VRM");
41
+ const humanoid = (0, object_1.object)(vrm.humanoid, "extensions.VRM.humanoid");
42
+ const used = new Set();
43
+ return (0, requiredArray_1.requiredArray)(humanoid.humanBones, "extensions.VRM.humanoid.humanBones").map((value, index) => {
44
+ const entry = (0, object_1.object)(value, `extensions.VRM.humanoid.humanBones[${index}]`);
45
+ const bone = vrm0Bone(entry.bone);
46
+ if (bone === undefined ||
47
+ (0, validNodeIndex_1.validNodeIndex)(entry.node, nodes.length) === false ||
48
+ used.has(bone))
49
+ throw new Error(`VRM humanoid entry ${index} has an unknown, duplicate or dangling bone mapping.`);
50
+ used.add(bone);
51
+ return { bone, node: entry.node };
52
+ });
53
+ }
54
+ return [];
55
+ };
56
+ exports.vrmHumanoidBones = vrmHumanoidBones;
57
+ /** Read a VRM 0.x bone name as its VRM 1.0 slot. VRM 1.0 renamed the thumb chain, so 0.x `ThumbProximal` is the 1.0 `ThumbMetacarpal` and 0.x `ThumbIntermediate` the 1.0 `ThumbProximal`; every other name is shared. */
58
+ const vrm0Bone = (value) => {
59
+ if (typeof value !== "string")
60
+ return undefined;
61
+ const migrated = Object.hasOwn(VRM0_THUMB_NAMES, value)
62
+ ? VRM0_THUMB_NAMES[value]
63
+ : value;
64
+ return Object.hasOwn(HUMANOID_BONES, migrated)
65
+ ? migrated
66
+ : undefined;
67
+ };
68
+ const VRM0_THUMB_NAMES = {
69
+ leftThumbProximal: "leftThumbMetacarpal",
70
+ leftThumbIntermediate: "leftThumbProximal",
71
+ rightThumbProximal: "rightThumbMetacarpal",
72
+ rightThumbIntermediate: "rightThumbProximal",
73
+ };
74
+ /** Every humanoid slot; the `Record` type requires exactly the union's keys. */
75
+ const HUMANOID_BONES = {
76
+ hips: true,
77
+ spine: true,
78
+ chest: true,
79
+ upperChest: true,
80
+ neck: true,
81
+ head: true,
82
+ leftEye: true,
83
+ rightEye: true,
84
+ jaw: true,
85
+ leftShoulder: true,
86
+ leftUpperArm: true,
87
+ leftLowerArm: true,
88
+ leftHand: true,
89
+ rightShoulder: true,
90
+ rightUpperArm: true,
91
+ rightLowerArm: true,
92
+ rightHand: true,
93
+ leftUpperLeg: true,
94
+ leftLowerLeg: true,
95
+ leftFoot: true,
96
+ leftToes: true,
97
+ rightUpperLeg: true,
98
+ rightLowerLeg: true,
99
+ rightFoot: true,
100
+ rightToes: true,
101
+ leftThumbMetacarpal: true,
102
+ leftThumbProximal: true,
103
+ leftThumbDistal: true,
104
+ leftIndexProximal: true,
105
+ leftIndexIntermediate: true,
106
+ leftIndexDistal: true,
107
+ leftMiddleProximal: true,
108
+ leftMiddleIntermediate: true,
109
+ leftMiddleDistal: true,
110
+ leftRingProximal: true,
111
+ leftRingIntermediate: true,
112
+ leftRingDistal: true,
113
+ leftLittleProximal: true,
114
+ leftLittleIntermediate: true,
115
+ leftLittleDistal: true,
116
+ rightThumbMetacarpal: true,
117
+ rightThumbProximal: true,
118
+ rightThumbDistal: true,
119
+ rightIndexProximal: true,
120
+ rightIndexIntermediate: true,
121
+ rightIndexDistal: true,
122
+ rightMiddleProximal: true,
123
+ rightMiddleIntermediate: true,
124
+ rightMiddleDistal: true,
125
+ rightRingProximal: true,
126
+ rightRingIntermediate: true,
127
+ rightRingDistal: true,
128
+ rightLittleProximal: true,
129
+ rightLittleIntermediate: true,
130
+ rightLittleDistal: true,
131
+ };
132
+ //# sourceMappingURL=vrmHumanoidBones.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vrmHumanoidBones.js","sourceRoot":"","sources":["../../src/internal/vrmHumanoidBones.ts"],"names":[],"mappings":";;;AAGA,yDAAsD;AACtD,qCAAkC;AAClC,qDAAkD;AAClD,mDAAgD;AAChD,qDAAkD;AAElD;;;;;;;;;;;;GAYG;AACI,MAAM,gBAAgB,GAGN,CACrB,QAAiC,EACjC,KAAgB,EACC,EAAE;IACnB,MAAM,UAAU,GAA4B,IAAA,+BAAc,EACxD,QAAQ,CAAC,UAAU,EACnB,YAAY,CACb,CAAC;IACF,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,GAAG,GAA4B,IAAA,eAAM,EACzC,UAAU,CAAC,QAAQ,EACnB,qBAAqB,CACtB,CAAC;QACF,MAAM,QAAQ,GAA4B,IAAA,eAAM,EAC9C,GAAG,CAAC,QAAQ,EACZ,8BAA8B,CAC/B,CAAC;QACF,MAAM,KAAK,GAA4B,IA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IAAI;IACvB,qBAAqB,EAAE,IAAI;IAC3B,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,uBAAuB,EAAE,IAAI;IAC7B,iBAAiB,EAAE,IAAI;CACxB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AutoMovieExternalModelIngestProfile } from "./AutoMovieExternalModelIngestProfile";
2
+ /**
3
+ * Whether an untyped selection, such as a command-line or manifest value, names one supported ingest profile exactly.
4
+ *
5
+ * Only an exact element of the frozen profile list passes, so `toString` and other inherited names are refused.
6
+ *
7
+ * @param value Candidate selection of any type.
8
+ * @returns `true` when `value` is one of the profile literals.
9
+ *
10
+ * @evidence contracts/development/implementation.md#principled-implementation Exact membership in the four-element frozen registry-derived list admits only supported profile literals, including no inherited object names.
11
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The byte inspector delegates profile admission to this guard, which consumes the single frozen list derived from the closed typed registry.
12
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The guard does no trimming or case folding, so a near-miss spelling is refused rather than accepted.
13
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states the intended untyped inputs, the exact-match rule, and the inherited-name refusal.
14
+ * @evidence contracts/development/implementation.md#efficient-algorithms One type check and at most four literal comparisons per call require constant time without allocating another profile inventory.
15
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A constant-time check has nothing worth reusing.
16
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The guard retains nothing and reads a module constant.
17
+ */
18
+ export declare const isAutoMovieExternalModelIngestProfile: (value: unknown) => value is AutoMovieExternalModelIngestProfile;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAutoMovieExternalModelIngestProfile = void 0;
4
+ const AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES_1 = require("./AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES");
5
+ /**
6
+ * Whether an untyped selection, such as a command-line or manifest value, names one supported ingest profile exactly.
7
+ *
8
+ * Only an exact element of the frozen profile list passes, so `toString` and other inherited names are refused.
9
+ *
10
+ * @param value Candidate selection of any type.
11
+ * @returns `true` when `value` is one of the profile literals.
12
+ *
13
+ * @evidence contracts/development/implementation.md#principled-implementation Exact membership in the four-element frozen registry-derived list admits only supported profile literals, including no inherited object names.
14
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The byte inspector delegates profile admission to this guard, which consumes the single frozen list derived from the closed typed registry.
15
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The guard does no trimming or case folding, so a near-miss spelling is refused rather than accepted.
16
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states the intended untyped inputs, the exact-match rule, and the inherited-name refusal.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms One type check and at most four literal comparisons per call require constant time without allocating another profile inventory.
18
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A constant-time check has nothing worth reusing.
19
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The guard retains nothing and reads a module constant.
20
+ */
21
+ const isAutoMovieExternalModelIngestProfile = (value) => typeof value === "string" &&
22
+ AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES_1.AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.includes(value);
23
+ exports.isAutoMovieExternalModelIngestProfile = isAutoMovieExternalModelIngestProfile;
24
+ //# sourceMappingURL=isAutoMovieExternalModelIngestProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isAutoMovieExternalModelIngestProfile.js","sourceRoot":"","sources":["../src/isAutoMovieExternalModelIngestProfile.ts"],"names":[],"mappings":";;;AAAA,2GAAwG;AAGxG;;;;;;;;;;;;;;;GAeG;AACI,MAAM,qCAAqC,GAEE,CAClD,KAAc,EACgC,EAAE,CAChD,OAAO,KAAK,KAAK,QAAQ;IACzB,qFAAyC,CAAC,QAAQ,CAChD,KAA4C,CAC7C,CAAC;AARS,QAAA,qCAAqC,GAArC,qCAAqC,CAQ9C"}
package/package.json CHANGED
@@ -1,6 +1,48 @@
1
1
  {
2
2
  "name": "@automovie/ingest",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "automovie ingest: admit external media inputs — glTF/GLB documents into the core node graph and clips, RIFF/WAVE audio into decoded samples (headless, no three.js)",
5
+ "main": "lib/index.js",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./lib/index.d.ts",
9
+ "default": "./lib/index.js"
10
+ },
11
+ "./package.json": "./package.json"
12
+ },
13
+ "keywords": [],
14
+ "author": "Samchon",
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/samchon/automovie"
19
+ },
20
+ "files": [
21
+ "lib",
22
+ "src",
23
+ "package.json",
24
+ "LICENSE",
25
+ "README.md"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "dependencies": {
31
+ "@gltf-transform/core": "^4.5.0",
32
+ "@automovie/engine": "^0.0.0",
33
+ "@automovie/interface": "^0.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "rimraf": "^6.0.1",
37
+ "ttsc": "^0.36.3",
38
+ "typescript": "^7.0.2",
39
+ "@ttsc/lint": "^0.36.3",
40
+ "@wrtnlabs/evidence": "^0.8.2",
41
+ "@ttsc/evidence": "^0.36.3"
42
+ },
43
+ "scripts": {
44
+ "build": "rimraf lib && ttsc",
45
+ "evidence": "evidence"
46
+ },
47
+ "types": "lib/index.d.ts"
6
48
  }
@@ -0,0 +1,7 @@
1
+ import type { AutoMovieGltfMotionInterpretationProfile } from "./AutoMovieGltfMotionInterpretationProfile";
2
+
3
+ /**
4
+ * Runtime identity of the fixed glTF motion spatial interpretation. This typed literal defines metres, right-handed coordinates and Y-up without implicit conversion; inspection and adoption share it, and no geometry-validity claim follows from the label.
5
+ */
6
+ export const AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE: AutoMovieGltfMotionInterpretationProfile =
7
+ "gltf-2.0-meter-right-handed-y-up" as const;
@@ -0,0 +1,21 @@
1
+ import type { AutoMovieExternalModelIngestProfile } from "./AutoMovieExternalModelIngestProfile";
2
+
3
+ /** Runtime registry whose `Record` type requires exactly the union's keys. */
4
+ const INGEST_PROFILE_REGISTRY: Readonly<
5
+ Record<AutoMovieExternalModelIngestProfile, true>
6
+ > = {
7
+ "gltf-static-v1": true,
8
+ "gltf-humanoid-v1": true,
9
+ "gltf-motion-v1": true,
10
+ "vrm-humanoid-v1": true,
11
+ };
12
+
13
+ /**
14
+ * Every supported ingest profile literal, frozen in declaration order. The complete Record over the closed union supplies exactly four own keys; the profile guard reuses this bounded module-lifetime inventory without deriving another list.
15
+ */
16
+ export const AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES: readonly AutoMovieExternalModelIngestProfile[] =
17
+ Object.freeze(
18
+ Object.keys(
19
+ INGEST_PROFILE_REGISTRY,
20
+ ) as AutoMovieExternalModelIngestProfile[],
21
+ );
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Fixed normalization profiles the builder may select for an external model.
3
+ *
4
+ * `gltf-static-v1` checks structure and resources of a model with at least one mesh. `gltf-humanoid-v1` also requires a skin, a joint whose name maps to `hips`, and count-matched JOINTS_0/WEIGHTS_0 with nonnegative components and a finite positive total per vertex. `gltf-motion-v1` inspects animations instead of meshes and requires at least one. `vrm-humanoid-v1` requires a GLB or VRM container with VRM metadata declaring `hips` and the same structural skin coverage. Weight normalization, duplicate influences and additional joint-set completeness are not proved; these profiles do not certify anatomy or complete glTF validity.
5
+ *
6
+ * @evidence contracts/development/design.md#principled-representation A closed union of four versioned profile literals makes the caller choose an interpretation explicitly instead of the inspector sniffing one.
7
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The union is mirrored at run time by a registry typed as a `Record` over it, so the type and the accepted strings cannot drift.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No default profile exists; an unknown string is refused by the inspector and by the runtime guard.
9
+ * @evidence contracts/development/common.md#meaningful-documentation The documentation states what each of the four profiles adds to the structural checks.
10
+ */
11
+ export type AutoMovieExternalModelIngestProfile =
12
+ | "gltf-static-v1"
13
+ | "gltf-humanoid-v1"
14
+ | "gltf-motion-v1"
15
+ | "vrm-humanoid-v1";
@@ -0,0 +1,14 @@
1
+ import type { IAutoMovieExternalMotionNativeDecision } from "./IAutoMovieExternalMotionNativeDecision";
2
+ import type { IAutoMovieExternalMotionRetargetDecision } from "./IAutoMovieExternalMotionRetargetDecision";
3
+
4
+ /**
5
+ * How the author uses one inspected take: replayed on its own rig, or retargeted onto a target rig by the engine later.
6
+ *
7
+ * @evidence contracts/development/design.md#principled-representation A discriminated union on `mode` lets TypeScript narrow the retarget-only fields, and adoption checks the discriminant at run time for untyped callers.
8
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The alias names the two supported uses in one place so adoption's parameter and the receipt's `mode` field derive from it.
9
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Only the two declared modes exist; adoption throws on any other discriminant instead of defaulting to native playback.
10
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states what each arm means for the take: replay on its own rig or a later engine retarget.
11
+ */
12
+ export type AutoMovieExternalMotionAdoptionDecision =
13
+ | IAutoMovieExternalMotionNativeDecision
14
+ | IAutoMovieExternalMotionRetargetDecision;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Fixed metre, right-handed and Y-up meaning of normalized glTF motion.
3
+ *
4
+ * @evidence contracts/development/design.md#principled-representation One literal names the spatial interpretation glTF motion inspection applies without coordinate conversion.
5
+ * @evidence contracts/development/design.md#minimal-and-owned-surface A dedicated type keeps the public runtime constant precisely typed without duplicating its interpretation choices.
6
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The union admits no unannounced axis/unit convention or inferred scale from rig names.
7
+ * @evidence contracts/development/common.md#meaningful-documentation The declaration identifies units, handedness and vertical axis for every imported track and node.
8
+ */
9
+ export type AutoMovieGltfMotionInterpretationProfile =
10
+ "gltf-2.0-meter-right-handed-y-up";
@@ -0,0 +1,62 @@
1
+ import type { AutoMovieHumanoidBone } from "@automovie/interface";
2
+
3
+ import type { AutoMovieExternalModelIngestProfile } from "./AutoMovieExternalModelIngestProfile";
4
+ import type { IAutoMovieExternalModelResource } from "./IAutoMovieExternalModelResource";
5
+ import type { IAutoMovieExternalMotionInspection } from "./IAutoMovieExternalMotionInspection";
6
+
7
+ /**
8
+ * Byte-level facts the external-model builder accepts before materializing a source.
9
+ *
10
+ * Inspection is synchronous because the production builder already holds the exact resident bytes and must reject violations of its selected structural/profile contract before anything is built from them. It does not certify complete glTF validity or image media decoding. Hosts still construct the render mesh with their own loader from the same content-addressed asset; these facts only gate it.
11
+ *
12
+ * @evidence contracts/development/design.md#principled-representation The record reports only facts read from the declared JSON and checked against resident bytes: counts of the top-level arrays, the extension union, sidecar URIs, profile-proved humanoid slots with weight usage, and motion takes when the motion profile ran.
13
+ * @evidence contracts/development/design.md#minimal-and-owned-surface One inspection result serves every profile, with `humanoidBones` empty and `motion` absent where a profile does not compute them, so the production inventory reads one shape.
14
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts `format` is a family label: a `.vrm` suffix or declared VRM extension produces `vrm`, while `vrm-humanoid-v1` separately checks VRM metadata; the label alone certifies no rig.
15
+ * @evidence contracts/development/common.md#meaningful-documentation The comments state why inspection is synchronous, that hosts still load the render mesh themselves, how `format` is decided, the order of `extensions` and `resources`, how each profile fills `humanoidBones`, and when `motion` is present.
16
+ */
17
+ export interface IAutoMovieExternalModelInspection {
18
+ /** Profile the caller selected and the inspection enforced. */
19
+ profile: AutoMovieExternalModelIngestProfile;
20
+
21
+ /** Container family: `vrm` for a `.vrm` suffix or an extension union containing `VRM` or `VRMC_vrm`, otherwise `gltf` or `glb` by suffix; this label alone does not prove VRM metadata. */
22
+ format: "gltf" | "glb" | "vrm";
23
+
24
+ /** GlTF asset version; only 2.0 is accepted. */
25
+ version: "2.0";
26
+
27
+ /** Lengths of the declared top-level arrays; an absent array counts zero. */
28
+ counts: {
29
+ /** Number of `nodes` entries. */
30
+ nodes: number;
31
+
32
+ /** Number of `meshes` entries. */
33
+ meshes: number;
34
+
35
+ /** Number of `skins` entries. */
36
+ skins: number;
37
+
38
+ /** Number of `animations` entries, read even when no motion is inspected. */
39
+ animations: number;
40
+ };
41
+
42
+ /** Union of `extensionsUsed` and the root `extensions` keys, deduplicated and sorted in code-unit order. */
43
+ extensions: string[];
44
+
45
+ /** Sidecar buffers and images, one entry per distinct URI, sorted by URI in code-unit order. */
46
+ resources: IAutoMovieExternalModelResource[];
47
+
48
+ /** Humanoid slots the profile proved, empty for the static and motion profiles. `gltf-humanoid-v1` lists skin joints in node order whose names map to a slot, first node per slot; `vrm-humanoid-v1` lists the VRM declaration, with VRM 0.x thumb names migrated to their VRM 1.0 slots. */
49
+ humanoidBones: Array<{
50
+ /** Normalized humanoid slot. */
51
+ bone: AutoMovieHumanoidBone;
52
+
53
+ /** Zero-based index of the node carrying the slot. */
54
+ node: number;
55
+
56
+ /** Whether some skinned vertex gives this joint a positive weight. */
57
+ weighted: boolean;
58
+ }>;
59
+
60
+ /** Normalized takes; present only under `gltf-motion-v1`. */
61
+ motion?: IAutoMovieExternalMotionInspection;
62
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * One external URI whose resident bytes the builder must bind before ingest.
3
+ *
4
+ * Data URIs are decoded in place and never listed; only a URI that names a sidecar file appears here.
5
+ *
6
+ * @evidence contracts/development/design.md#principled-representation A resource is keyed by its exact declared URI and role, the two facts the builder needs to bind manifest-owned bytes, and a buffer keeps its glTF `byteLength` because the resolved bytes must match it.
7
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Buffers and images share one record discriminated by `kind`, since both resolve through the same `resolveResource` seam.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Data URIs are excluded rather than listed as resolvable, and an image carries `null` instead of an invented length.
9
+ * @evidence contracts/development/common.md#meaningful-documentation The comments state that only sidecar URIs appear, that the URI is undecoded, which array declares each kind, and why an image has no length.
10
+ */
11
+ export interface IAutoMovieExternalModelResource {
12
+ /** URI exactly as the glTF declares it, unresolved and undecoded. */
13
+ uri: string;
14
+
15
+ /** Whether a `buffers` or an `images` entry declares the URI. */
16
+ kind: "buffer" | "image";
17
+
18
+ /** Declared `byteLength` of a buffer, which the resolved bytes must equal; `null` for an image, which glTF gives no length. */
19
+ byteLength: number | null;
20
+ }
@@ -0,0 +1,30 @@
1
+ import type { IAutoMovieClip } from "@automovie/interface";
2
+
3
+ import type { AutoMovieExternalMotionAdoptionDecision } from "./AutoMovieExternalMotionAdoptionDecision";
4
+ import type { IAutoMovieExternalMotionNativeHandoff } from "./IAutoMovieExternalMotionNativeHandoff";
5
+ import type { IAutoMovieExternalMotionRetargetHandoff } from "./IAutoMovieExternalMotionRetargetHandoff";
6
+ import type { IAutoMovieExternalMotionSource } from "./IAutoMovieExternalMotionSource";
7
+
8
+ /**
9
+ * Receipt connecting one byte-pinned take to native playback or a later engine retarget pass. It copies everything it holds, so mutating it never changes the inspection or the decision it came from.
10
+ *
11
+ * @evidence contracts/development/design.md#principled-representation The receipt pairs the byte identity with a deep copy of the chosen take and its handoff, so later stages work from a snapshot that mutation of the inspection or decision cannot alter.
12
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The producer repeats `handoff.mode` as top-level `mode` for inventory branching; the independent union fields do not statically correlate, so manually supplied receipts need admission.
13
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The producer copies the selected take and declared decision fields after its mapped-basis checks; the type does not certify every unmapped rig field or authenticate externally constructed receipts.
14
+ * @evidence contracts/development/common.md#meaningful-documentation The comments state that every member is a copy, that the take keeps source track order, and which consumer each handoff arm feeds.
15
+ */
16
+ export interface IAutoMovieExternalMotionAdoption {
17
+ /** Copy of the source identity that was checked against the inspection. */
18
+ source: IAutoMovieExternalMotionSource;
19
+
20
+ /** The decision's mode, repeated by `handoff.mode`. */
21
+ mode: AutoMovieExternalMotionAdoptionDecision["mode"];
22
+
23
+ /** Deep copy of the selected take with its tracks in source order. */
24
+ take: IAutoMovieClip;
25
+
26
+ /** Mode-specific inputs for the builder or the retarget pass. */
27
+ handoff:
28
+ | IAutoMovieExternalMotionNativeHandoff
29
+ | IAutoMovieExternalMotionRetargetHandoff;
30
+ }
@@ -0,0 +1,17 @@
1
+ import type { AutoMovieHumanoidBone } from "@automovie/interface";
2
+
3
+ /**
4
+ * One author-declared correspondence between an inspected node and a humanoid bone of the source rig.
5
+ *
6
+ * @evidence contracts/development/design.md#principled-representation A mapping row pairs an inspector-issued node id with a humanoid slot, so the correspondence is declared by the author against stable ids rather than inferred from node names.
7
+ * @evidence contracts/development/design.md#minimal-and-owned-surface One flat pair per mapped node is the minimum that lets both decisions and both handoffs share the same element type.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The row carries no alias or fuzzy-match field; adoption refuses an unknown node, a bone the rig lacks, and any repeated node or bone.
9
+ * @evidence contracts/development/common.md#meaningful-documentation The property comments give the node id form, that it must exist in the inspection, and that each bone and node maps at most once.
10
+ */
11
+ export interface IAutoMovieExternalMotionBoneMapping {
12
+ /** Inspected node id such as `node_3`; it must exist in the inspection. */
13
+ node: string;
14
+
15
+ /** Source-rig bone the node plays; each bone and node maps at most once. */
16
+ bone: AutoMovieHumanoidBone;
17
+ }
@@ -0,0 +1,32 @@
1
+ import type { IAutoMovieClip } from "@automovie/interface";
2
+
3
+ import { AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE } from "./AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE";
4
+ import type { IAutoMovieExternalMotionNodeInspection } from "./IAutoMovieExternalMotionNodeInspection";
5
+
6
+ /**
7
+ * Animation facts normalized from one exact glTF, GLB or VRM byte revision.
8
+ *
9
+ * @evidence contracts/development/design.md#principled-representation Takes are rewritten from FLOAT accessors to node tracks with exact copied keyframes under one declared spatial interpretation, so motion data is reproducible from the bytes alone.
10
+ * @evidence contracts/development/design.md#minimal-and-owned-surface `nodeIds` duplicates the node ids as a plain list because mapping authors and the inventory consume the list without the transforms.
11
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The literal constrains typed producers to one declared convention; the inspector emits it and adoption checks it at runtime, while this erased interface alone cannot authenticate externally supplied transforms or their units.
12
+ * @evidence contracts/development/common.md#meaningful-documentation The comments state that the path and length repeat for adoption checks, the length excludes sidecars, and how takes are ordered, named, timed and flagged as non-looping.
13
+ */
14
+ export interface IAutoMovieExternalMotionInspection {
15
+ /** Path whose suffix selected the decoder, repeated for adoption checks. */
16
+ path: string;
17
+
18
+ /** Length of the inspected container bytes, excluding sidecars. */
19
+ byteLength: number;
20
+
21
+ /** The fixed interpretation every node and track is read under. */
22
+ interpretation: typeof AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE;
23
+
24
+ /** Every node in source order with its hierarchy and rest basis. */
25
+ nodes: IAutoMovieExternalMotionNodeInspection[];
26
+
27
+ /** The node ids in source order, for an explicit source-rig mapping. */
28
+ nodeIds: string[];
29
+
30
+ /** One clip `clip_{index}` per animation in source order, its tracks in channel order with FLOAT keyframes copied exactly, duration the latest keyframe time, and `loop` false. */
31
+ takes: IAutoMovieClip[];
32
+ }
@@ -0,0 +1,25 @@
1
+ import type { IAutoMovieSkeleton } from "@automovie/interface";
2
+
3
+ import type { IAutoMovieExternalMotionBoneMapping } from "./IAutoMovieExternalMotionBoneMapping";
4
+
5
+ /**
6
+ * Native use replays the inspected node tracks on the source rig the author declares; ingest infers no rig and matches no names.
7
+ *
8
+ * @evidence contracts/development/design.md#principled-representation Native use needs only the take, the author's source rig and the mapping, because the tracks replay on the rig the bytes describe and nothing is converted between skeletons.
9
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The native arm repeats the three shared fields rather than extending a base type, keeping each arm readable on its own at the cost of three duplicated property declarations.
10
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The rig is not trusted blindly: adoption recomputes each mapped bone's parent and rest from the inspected nodes and requires exact equality.
11
+ * @evidence contracts/development/common.md#meaningful-documentation The property comments state the take id form, the rig's id, uniqueness, hips and exact-basis requirements, and that the mapping must cover every animated node.
12
+ */
13
+ export interface IAutoMovieExternalMotionNativeDecision {
14
+ /** Mode discriminator. */
15
+ mode: "native";
16
+
17
+ /** Inspected take id such as `clip_0`. */
18
+ take: string;
19
+
20
+ /** Source skeleton with a non-blank id, unique bones including `hips`, and, for every mapped bone, the parent and rest the inspected hierarchy implies with exact number equality. */
21
+ sourceRig: IAutoMovieSkeleton;
22
+
23
+ /** Non-empty node-to-bone mapping that covers every node the take animates; ingest never derives it from names. */
24
+ mapping: IAutoMovieExternalMotionBoneMapping[];
25
+ }
@@ -0,0 +1,22 @@
1
+ import type { IAutoMovieSkeleton } from "@automovie/interface";
2
+
3
+ import type { IAutoMovieExternalMotionBoneMapping } from "./IAutoMovieExternalMotionBoneMapping";
4
+
5
+ /**
6
+ * Validated inputs a native adoption hands to the motion builder, which still decides whether the take's interpolation and channel coverage can become clinical motion.
7
+ *
8
+ * @evidence contracts/development/design.md#principled-representation The handoff carries a rig whose mapped bones matched the inspected basis and a node-sorted mapping, a canonical order that makes two receipts for the same decision compare equal regardless of the author's row order.
9
+ * @evidence contracts/development/design.md#minimal-and-owned-surface A separate handoff type keeps the builder's input apart from the author's decision, so the builder never sees the unvalidated take id field.
10
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The handoff states that interpolation and channel coverage remain the builder's decision instead of claiming ingest proved the take convertible.
11
+ * @evidence contracts/development/common.md#meaningful-documentation The comments state that the rig is a deep copy and that the mapping is sorted by node id in code-unit order.
12
+ */
13
+ export interface IAutoMovieExternalMotionNativeHandoff {
14
+ /** Mode discriminator. */
15
+ mode: "native";
16
+
17
+ /** Deep copy of the decision's source rig, sharing nothing with it. */
18
+ sourceRig: IAutoMovieSkeleton;
19
+
20
+ /** Copy of the decision's mapping sorted by node id in code-unit order. */
21
+ mapping: IAutoMovieExternalMotionBoneMapping[];
22
+ }
@@ -0,0 +1,26 @@
1
+ import type { IAutoMovieTransform } from "@automovie/interface";
2
+
3
+ /**
4
+ * One node of a motion source with the local rest basis read from its bytes.
5
+ *
6
+ * @evidence contracts/development/design.md#principled-representation Each node carries its index-derived id, parent id and a canonical local TRS with glTF defaults, rotation renormalized after a tolerance check, which is the basis motion adoption recomputes rest poses from.
7
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The record keeps both the stable id and the raw index so tracks and mappings cite ids while diagnostics can still name the source index.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts A node matrix is refused rather than decomposed; omitted TRS fields receive glTF defaults and admitted rotation components are renormalized, so these records preserve the declared interpretation rather than the exact original rotation numbers.
9
+ * @evidence contracts/development/common.md#meaningful-documentation The comments give the id form, the index base, the name and parent null cases, and every normalization the transform received.
10
+ */
11
+ export interface IAutoMovieExternalMotionNodeInspection {
12
+ /** `node_{index}`, the id tracks and source-rig mappings cite. */
13
+ id: string;
14
+
15
+ /** Zero-based node index in the inspected glTF revision. */
16
+ index: number;
17
+
18
+ /** Declared name when non-empty, otherwise `null`. */
19
+ name: string | null;
20
+
21
+ /** Id of the node listing this one as a child, or `null` for a root. */
22
+ parent: string | null;
23
+
24
+ /** Parent-local rest TRS with glTF defaults for absent fields, finite components, positive scale, and the rotation renormalized to unit length after a 1e-4 magnitude tolerance check. */
25
+ transform: IAutoMovieTransform;
26
+ }
@@ -0,0 +1,31 @@
1
+ import type { IAutoMovieSkeleton } from "@automovie/interface";
2
+
3
+ import type { IAutoMovieExternalMotionBoneMapping } from "./IAutoMovieExternalMotionBoneMapping";
4
+
5
+ /**
6
+ * Retarget use declares the source rig, the mapping and the target identity, so the engine pass that later retargets the take guesses none of them.
7
+ *
8
+ * @evidence contracts/development/design.md#principled-representation Retargeting additionally needs a root translation multiplier and a target identity, the two inputs a skeleton-to-skeleton transfer cannot derive from the source bytes.
9
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The retarget arm is the native arm plus exactly those two fields, so the union's narrowing exposes them only where they apply.
10
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Ingest validates the multiplier and target spelling but never resolves the target or picks a default scale, leaving both explicit for the engine pass.
11
+ * @evidence contracts/development/common.md#meaningful-documentation The added properties state the finite-positive range of the multiplier and that the target is resolved after ingest.
12
+ */
13
+ export interface IAutoMovieExternalMotionRetargetDecision {
14
+ /** Mode discriminator. */
15
+ mode: "retarget";
16
+
17
+ /** Inspected take id such as `clip_0`. */
18
+ take: string;
19
+
20
+ /** Source skeleton with a non-blank id, unique bones including `hips`, and, for every mapped bone, the parent and rest the inspected hierarchy implies with exact number equality. */
21
+ sourceRig: IAutoMovieSkeleton;
22
+
23
+ /** Non-empty node-to-bone mapping that covers every node the take animates; ingest never derives it from names. */
24
+ mapping: IAutoMovieExternalMotionBoneMapping[];
25
+
26
+ /** Multiplier for source root translation; finite and positive. */
27
+ translationScale: number;
28
+
29
+ /** Non-blank target rig or actor identity, resolved after ingest. */
30
+ target: string;
31
+ }
@@ -0,0 +1,28 @@
1
+ import type { IAutoMovieSkeleton } from "@automovie/interface";
2
+
3
+ import type { IAutoMovieExternalMotionBoneMapping } from "./IAutoMovieExternalMotionBoneMapping";
4
+
5
+ /**
6
+ * Inputs copied after adoption's mapped-basis and retarget-field checks; the engine-owned retarget pass still admits source conversion and source-target compatibility.
7
+ *
8
+ * @evidence contracts/development/design.md#principled-representation Besides the copied rig and sorted mapping, the retarget handoff forwards the validated multiplier and target unchanged, which is all the engine retarget pass needs from ingest.
9
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Its fields mirror the retarget decision minus the take id, so the receipt's take field is the single place the selected clip lives.
10
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The documentation keeps source conversion and source-target compatibility as downstream checks rather than implying ingest performed them.
11
+ * @evidence contracts/development/common.md#meaningful-documentation The property comments say which values were checked, finite-positive scale and non-blank target, and that the target is not resolved here.
12
+ */
13
+ export interface IAutoMovieExternalMotionRetargetHandoff {
14
+ /** Mode discriminator. */
15
+ mode: "retarget";
16
+
17
+ /** Deep copy of the decision's source rig, sharing nothing with it. */
18
+ sourceRig: IAutoMovieSkeleton;
19
+
20
+ /** Copy of the decision's mapping sorted by node id in code-unit order. */
21
+ mapping: IAutoMovieExternalMotionBoneMapping[];
22
+
23
+ /** The decision's multiplier, checked finite and positive. */
24
+ translationScale: number;
25
+
26
+ /** The decision's target identity, checked non-blank but not resolved. */
27
+ target: string;
28
+ }