@fps-games/editor 0.1.5-beta.5 → 0.1.7-beta.1

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 (469) hide show
  1. package/dist/agent-bridge/capabilities/assets.d.ts +8 -0
  2. package/dist/agent-bridge/capabilities/assets.d.ts.map +1 -0
  3. package/dist/agent-bridge/capabilities/assets.js +226 -0
  4. package/dist/agent-bridge/capabilities/assets.js.map +1 -0
  5. package/dist/agent-bridge/capabilities/editor-state.d.ts +5 -0
  6. package/dist/agent-bridge/capabilities/editor-state.d.ts.map +1 -0
  7. package/dist/agent-bridge/capabilities/editor-state.js +72 -0
  8. package/dist/agent-bridge/capabilities/editor-state.js.map +1 -0
  9. package/dist/agent-bridge/capabilities/host-lifecycle.d.ts +4 -0
  10. package/dist/agent-bridge/capabilities/host-lifecycle.d.ts.map +1 -0
  11. package/dist/agent-bridge/capabilities/host-lifecycle.js +87 -0
  12. package/dist/agent-bridge/capabilities/host-lifecycle.js.map +1 -0
  13. package/dist/agent-bridge/capabilities/prefabs.d.ts +5 -0
  14. package/dist/agent-bridge/capabilities/prefabs.d.ts.map +1 -0
  15. package/dist/agent-bridge/capabilities/prefabs.js +735 -0
  16. package/dist/agent-bridge/capabilities/prefabs.js.map +1 -0
  17. package/dist/agent-bridge/capabilities/scene-objects.d.ts +9 -0
  18. package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +1 -0
  19. package/dist/agent-bridge/capabilities/scene-objects.js +394 -0
  20. package/dist/agent-bridge/capabilities/scene-objects.js.map +1 -0
  21. package/dist/agent-bridge/capabilities/selection.d.ts +5 -0
  22. package/dist/agent-bridge/capabilities/selection.d.ts.map +1 -0
  23. package/dist/agent-bridge/capabilities/selection.js +57 -0
  24. package/dist/agent-bridge/capabilities/selection.js.map +1 -0
  25. package/dist/agent-bridge/capabilities/shadows.d.ts +5 -0
  26. package/dist/agent-bridge/capabilities/shadows.d.ts.map +1 -0
  27. package/dist/agent-bridge/capabilities/shadows.js +1876 -0
  28. package/dist/agent-bridge/capabilities/shadows.js.map +1 -0
  29. package/dist/agent-bridge/capabilities/transform.d.ts +5 -0
  30. package/dist/agent-bridge/capabilities/transform.d.ts.map +1 -0
  31. package/dist/agent-bridge/capabilities/transform.js +162 -0
  32. package/dist/agent-bridge/capabilities/transform.js.map +1 -0
  33. package/dist/agent-bridge/capabilities/ui-regions.d.ts +4 -0
  34. package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +1 -0
  35. package/dist/agent-bridge/capabilities/ui-regions.js +168 -0
  36. package/dist/agent-bridge/capabilities/ui-regions.js.map +1 -0
  37. package/dist/agent-bridge/capabilities/viewport.d.ts +5 -0
  38. package/dist/agent-bridge/capabilities/viewport.d.ts.map +1 -0
  39. package/dist/agent-bridge/capabilities/viewport.js +407 -0
  40. package/dist/agent-bridge/capabilities/viewport.js.map +1 -0
  41. package/dist/agent-bridge/capability-sources.d.ts +6 -0
  42. package/dist/agent-bridge/capability-sources.d.ts.map +1 -0
  43. package/dist/agent-bridge/capability-sources.js +26 -0
  44. package/dist/agent-bridge/capability-sources.js.map +1 -0
  45. package/dist/agent-bridge/diagnostics.d.ts +12 -0
  46. package/dist/agent-bridge/diagnostics.d.ts.map +1 -0
  47. package/dist/agent-bridge/diagnostics.js +45 -0
  48. package/dist/agent-bridge/diagnostics.js.map +1 -0
  49. package/dist/agent-bridge/index.d.ts +5 -0
  50. package/dist/agent-bridge/index.d.ts.map +1 -0
  51. package/dist/agent-bridge/index.js +5 -0
  52. package/dist/agent-bridge/index.js.map +1 -0
  53. package/dist/agent-bridge/register.d.ts +4 -0
  54. package/dist/agent-bridge/register.d.ts.map +1 -0
  55. package/dist/agent-bridge/register.js +908 -0
  56. package/dist/agent-bridge/register.js.map +1 -0
  57. package/dist/agent-bridge/shared.d.ts +189 -0
  58. package/dist/agent-bridge/shared.d.ts.map +1 -0
  59. package/dist/agent-bridge/shared.js +39 -0
  60. package/dist/agent-bridge/shared.js.map +1 -0
  61. package/dist/agent-bridge/source-types.d.ts +90 -0
  62. package/dist/agent-bridge/source-types.d.ts.map +1 -0
  63. package/dist/agent-bridge/source-types.js +2 -0
  64. package/dist/agent-bridge/source-types.js.map +1 -0
  65. package/dist/build-info.json +17 -17
  66. package/dist/local-editor-agent-actions.d.ts +8 -1
  67. package/dist/local-editor-agent-actions.d.ts.map +1 -1
  68. package/dist/local-editor-agent-actions.js +171 -12
  69. package/dist/local-editor-agent-actions.js.map +1 -1
  70. package/dist/local-editor-agent-bridge-transport.d.ts +95 -0
  71. package/dist/local-editor-agent-bridge-transport.d.ts.map +1 -0
  72. package/dist/local-editor-agent-bridge-transport.js +340 -0
  73. package/dist/local-editor-agent-bridge-transport.js.map +1 -0
  74. package/dist/local-editor-agent-bridge.d.ts +2 -0
  75. package/dist/local-editor-agent-bridge.d.ts.map +1 -0
  76. package/dist/local-editor-agent-bridge.js +2 -0
  77. package/dist/local-editor-agent-bridge.js.map +1 -0
  78. package/dist/local-editor-agent-context.d.ts +29 -1
  79. package/dist/local-editor-agent-context.d.ts.map +1 -1
  80. package/dist/local-editor-agent-context.js +403 -0
  81. package/dist/local-editor-agent-context.js.map +1 -1
  82. package/dist/local-editor-harness.d.ts +128 -6
  83. package/dist/local-editor-harness.d.ts.map +1 -1
  84. package/dist/local-editor-harness.js +2730 -151
  85. package/dist/local-editor-harness.js.map +1 -1
  86. package/dist/local-editor-marker-graph.d.ts +92 -0
  87. package/dist/local-editor-marker-graph.d.ts.map +1 -0
  88. package/dist/local-editor-marker-graph.js +1432 -0
  89. package/dist/local-editor-marker-graph.js.map +1 -0
  90. package/dist/local-editor-performance-stats.js +1 -1
  91. package/dist/local-editor-performance-stats.js.map +1 -1
  92. package/dist/playable-babylon-facade.d.ts +2 -2
  93. package/dist/playable-babylon-facade.d.ts.map +1 -1
  94. package/dist/playable-babylon-facade.js +1 -1
  95. package/dist/playable-babylon-facade.js.map +1 -1
  96. package/dist/playable-babylon-rendering.js +20 -0
  97. package/dist/playable-babylon-rendering.js.map +1 -1
  98. package/dist/playable-local-editor-host.d.ts +57 -7
  99. package/dist/playable-local-editor-host.d.ts.map +1 -1
  100. package/dist/playable-local-editor-host.js +25 -1
  101. package/dist/playable-local-editor-host.js.map +1 -1
  102. package/dist/playable-sdk.d.ts +4 -2
  103. package/dist/playable-sdk.d.ts.map +1 -1
  104. package/dist/playable-sdk.js +2 -1
  105. package/dist/playable-sdk.js.map +1 -1
  106. package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.d.ts.map +1 -1
  107. package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js +6 -4
  108. package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js.map +1 -1
  109. package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.d.ts.map +1 -1
  110. package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.js +103 -1
  111. package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.js.map +1 -1
  112. package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.d.ts.map +1 -1
  113. package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.js +330 -27
  114. package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.js.map +1 -1
  115. package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts.map +1 -1
  116. package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js +159 -0
  117. package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js.map +1 -1
  118. package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js +8 -1
  119. package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js.map +1 -1
  120. package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts +53 -2
  121. package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts.map +1 -1
  122. package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js +1 -0
  123. package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js.map +1 -1
  124. package/node_modules/@fps-games/babylon-renderer/package.json +1 -1
  125. package/node_modules/@fps-games/editor-babylon/dist/camera-controller.d.ts.map +1 -1
  126. package/node_modules/@fps-games/editor-babylon/dist/camera-controller.js +11 -0
  127. package/node_modules/@fps-games/editor-babylon/dist/camera-controller.js.map +1 -1
  128. package/node_modules/@fps-games/editor-babylon/dist/editor-sky.d.ts +3 -1
  129. package/node_modules/@fps-games/editor-babylon/dist/editor-sky.d.ts.map +1 -1
  130. package/node_modules/@fps-games/editor-babylon/dist/editor-sky.js +114 -18
  131. package/node_modules/@fps-games/editor-babylon/dist/editor-sky.js.map +1 -1
  132. package/node_modules/@fps-games/editor-babylon/dist/editor-world.d.ts +1 -0
  133. package/node_modules/@fps-games/editor-babylon/dist/editor-world.d.ts.map +1 -1
  134. package/node_modules/@fps-games/editor-babylon/dist/editor-world.js +3 -0
  135. package/node_modules/@fps-games/editor-babylon/dist/editor-world.js.map +1 -1
  136. package/node_modules/@fps-games/editor-babylon/dist/index.d.ts +3 -0
  137. package/node_modules/@fps-games/editor-babylon/dist/index.d.ts.map +1 -1
  138. package/node_modules/@fps-games/editor-babylon/dist/index.js +3 -0
  139. package/node_modules/@fps-games/editor-babylon/dist/index.js.map +1 -1
  140. package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.d.ts +52 -0
  141. package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.d.ts.map +1 -0
  142. package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js +1395 -0
  143. package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js.map +1 -0
  144. package/node_modules/@fps-games/editor-babylon/dist/material-property-adapter.d.ts.map +1 -1
  145. package/node_modules/@fps-games/editor-babylon/dist/material-property-adapter.js +4 -65
  146. package/node_modules/@fps-games/editor-babylon/dist/material-property-adapter.js.map +1 -1
  147. package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.d.ts +28 -0
  148. package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.d.ts.map +1 -0
  149. package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.js +235 -0
  150. package/node_modules/@fps-games/editor-babylon/dist/material-slot-source-resolver.js.map +1 -0
  151. package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.d.ts +37 -0
  152. package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.d.ts.map +1 -0
  153. package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.js +451 -0
  154. package/node_modules/@fps-games/editor-babylon/dist/prefab-comparison-preview-controller.js.map +1 -0
  155. package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.d.ts.map +1 -1
  156. package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.js +14 -3
  157. package/node_modules/@fps-games/editor-babylon/dist/projection-asset-container-importer.js.map +1 -1
  158. package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.d.ts +1 -0
  159. package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.d.ts.map +1 -1
  160. package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.js +20 -4
  161. package/node_modules/@fps-games/editor-babylon/dist/projection-pick-resolver.js.map +1 -1
  162. package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.d.ts +3 -6
  163. package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.d.ts.map +1 -1
  164. package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.js +4 -37
  165. package/node_modules/@fps-games/editor-babylon/dist/projection-source-owner-path.js.map +1 -1
  166. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +74 -1
  167. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
  168. package/node_modules/@fps-games/editor-babylon/dist/projection.js +641 -52
  169. package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
  170. package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.d.ts +11 -0
  171. package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.d.ts.map +1 -1
  172. package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.js +113 -29
  173. package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.js.map +1 -1
  174. package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts +13 -1
  175. package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts.map +1 -1
  176. package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js +543 -3
  177. package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js.map +1 -1
  178. package/node_modules/@fps-games/editor-babylon/package.json +5 -5
  179. package/node_modules/@fps-games/editor-browser/dist/index.d.ts +8 -2
  180. package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
  181. package/node_modules/@fps-games/editor-browser/dist/index.js +4 -0
  182. package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
  183. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts +5 -0
  184. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts.map +1 -0
  185. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js +23 -0
  186. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js.map +1 -0
  187. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js +1 -1
  188. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js.map +1 -1
  189. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.d.ts.map +1 -1
  190. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js +76 -9
  191. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js.map +1 -1
  192. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.d.ts.map +1 -1
  193. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js +3 -2
  194. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js.map +1 -1
  195. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.d.ts +21 -0
  196. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.d.ts.map +1 -0
  197. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.js +75 -0
  198. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.js.map +1 -0
  199. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +2 -0
  200. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
  201. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +326 -72
  202. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
  203. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts +5 -0
  204. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts.map +1 -0
  205. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js +92 -0
  206. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js.map +1 -0
  207. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts +4 -1
  208. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts.map +1 -1
  209. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js +22 -7
  210. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js.map +1 -1
  211. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +4 -0
  212. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
  213. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +24 -11
  214. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
  215. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
  216. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
  217. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +7 -0
  218. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
  219. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panel-registry.js +1 -1
  220. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panel-registry.js.map +1 -1
  221. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +4 -0
  222. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
  223. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +1471 -29
  224. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
  225. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts +70 -0
  226. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -0
  227. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +171 -0
  228. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.map +1 -0
  229. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.d.ts +1 -1
  230. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.d.ts.map +1 -1
  231. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js +2 -2
  232. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js.map +1 -1
  233. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.d.ts.map +1 -1
  234. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.js +9 -2
  235. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.js.map +1 -1
  236. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +301 -3
  237. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
  238. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts +12 -1
  239. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts.map +1 -1
  240. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js +13 -1
  241. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
  242. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +6 -4
  243. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
  244. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +1501 -122
  245. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
  246. package/node_modules/@fps-games/editor-browser/package.json +3 -3
  247. package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts +18 -0
  248. package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts.map +1 -0
  249. package/node_modules/@fps-games/editor-core/dist/agent-bridge.js +102 -0
  250. package/node_modules/@fps-games/editor-core/dist/agent-bridge.js.map +1 -0
  251. package/node_modules/@fps-games/editor-core/dist/index.d.ts +1 -0
  252. package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
  253. package/node_modules/@fps-games/editor-core/dist/index.js +1 -0
  254. package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
  255. package/node_modules/@fps-games/editor-core/dist/scene-graph.d.ts +1 -1
  256. package/node_modules/@fps-games/editor-core/dist/scene-graph.d.ts.map +1 -1
  257. package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts +3 -1
  258. package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts.map +1 -1
  259. package/node_modules/@fps-games/editor-core/dist/viewport-tools.js +1 -0
  260. package/node_modules/@fps-games/editor-core/dist/viewport-tools.js.map +1 -1
  261. package/node_modules/@fps-games/editor-core/package.json +2 -2
  262. package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
  263. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.d.ts +3 -0
  264. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.d.ts.map +1 -0
  265. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.js +9 -0
  266. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.js.map +1 -0
  267. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts +6 -0
  268. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts.map +1 -0
  269. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js +89 -0
  270. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js.map +1 -0
  271. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.d.ts +18 -0
  272. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.d.ts.map +1 -0
  273. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.js +121 -0
  274. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.js.map +1 -0
  275. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts +4 -0
  276. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts.map +1 -0
  277. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js +3 -0
  278. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js.map +1 -0
  279. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.d.ts +27 -0
  280. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.d.ts.map +1 -0
  281. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.js +782 -0
  282. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.js.map +1 -0
  283. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.d.ts +5 -0
  284. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.d.ts.map +1 -0
  285. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.js +5 -0
  286. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.js.map +1 -0
  287. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.d.ts +80 -0
  288. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.d.ts.map +1 -0
  289. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.js +600 -0
  290. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.js.map +1 -0
  291. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.d.ts +51 -0
  292. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.d.ts.map +1 -0
  293. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.js +2 -0
  294. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.js.map +1 -0
  295. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts.map +1 -1
  296. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js +17 -3
  297. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js.map +1 -1
  298. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/document.d.ts.map +1 -1
  299. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/document.js +2 -1
  300. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/document.js.map +1 -1
  301. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/types.d.ts +3 -2
  302. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/types.d.ts.map +1 -1
  303. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts +1 -1
  304. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts.map +1 -1
  305. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js +48 -20
  306. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js.map +1 -1
  307. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.d.ts +1 -1
  308. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.d.ts.map +1 -1
  309. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.js +1 -1
  310. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.js.map +1 -1
  311. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.d.ts.map +1 -1
  312. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js +2 -1
  313. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js.map +1 -1
  314. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/types.d.ts +3 -0
  315. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/types.d.ts.map +1 -1
  316. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts +97 -2
  317. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
  318. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +1143 -8
  319. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
  320. package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts +145 -2
  321. package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts.map +1 -1
  322. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.d.ts +1 -1
  323. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.d.ts.map +1 -1
  324. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.js +1 -1
  325. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.js.map +1 -1
  326. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.d.ts.map +1 -1
  327. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js +24 -9
  328. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js.map +1 -1
  329. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.d.ts +6 -0
  330. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.d.ts.map +1 -1
  331. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.js +31 -0
  332. package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.js.map +1 -1
  333. package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +3 -0
  334. package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
  335. package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +3 -0
  336. package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
  337. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts +82 -2
  338. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts.map +1 -1
  339. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js +396 -22
  340. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js.map +1 -1
  341. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts +1 -1
  342. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts.map +1 -1
  343. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js +1 -1
  344. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js.map +1 -1
  345. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.d.ts.map +1 -1
  346. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.js +0 -3
  347. package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.js.map +1 -1
  348. package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.d.ts +29 -1
  349. package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.d.ts.map +1 -1
  350. package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.js +143 -0
  351. package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.js.map +1 -1
  352. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.d.ts.map +1 -1
  353. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js +3 -7
  354. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js.map +1 -1
  355. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts.map +1 -1
  356. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js +6 -0
  357. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js.map +1 -1
  358. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/types.d.ts +2 -10
  359. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/types.d.ts.map +1 -1
  360. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.d.ts.map +1 -1
  361. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js +107 -11
  362. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js.map +1 -1
  363. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.d.ts.map +1 -1
  364. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js +4 -1
  365. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js.map +1 -1
  366. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.d.ts.map +1 -1
  367. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.js +19 -1
  368. package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.js.map +1 -1
  369. package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.d.ts.map +1 -1
  370. package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js +19 -3
  371. package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js.map +1 -1
  372. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.d.ts +1 -2
  373. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.d.ts.map +1 -1
  374. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js +0 -14
  375. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js.map +1 -1
  376. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.d.ts +1 -7
  377. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.d.ts.map +1 -1
  378. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.js +3 -32
  379. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.js.map +1 -1
  380. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.d.ts.map +1 -1
  381. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js +82 -63
  382. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js.map +1 -1
  383. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts +7 -23
  384. package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts.map +1 -1
  385. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.d.ts +5 -0
  386. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.d.ts.map +1 -0
  387. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.js +996 -0
  388. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.js.map +1 -0
  389. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.d.ts +3 -0
  390. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.d.ts.map +1 -0
  391. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.js +3 -0
  392. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.js.map +1 -0
  393. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.d.ts +152 -0
  394. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.d.ts.map +1 -0
  395. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.js +2 -0
  396. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.js.map +1 -0
  397. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.d.ts.map +1 -1
  398. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.js +44 -2
  399. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.js.map +1 -1
  400. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts +1 -0
  401. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts.map +1 -1
  402. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js +244 -12
  403. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js.map +1 -1
  404. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts.map +1 -1
  405. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js +216 -67
  406. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js.map +1 -1
  407. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.d.ts.map +1 -1
  408. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.js +7 -4
  409. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/object.js.map +1 -1
  410. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.d.ts.map +1 -1
  411. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.js +45 -1
  412. package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.js.map +1 -1
  413. package/node_modules/@fps-games/editor-playable-sdk/dist/session/hierarchy.d.ts.map +1 -1
  414. package/node_modules/@fps-games/editor-playable-sdk/dist/session/hierarchy.js +2 -1
  415. package/node_modules/@fps-games/editor-playable-sdk/dist/session/hierarchy.js.map +1 -1
  416. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.d.ts +5 -0
  417. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.d.ts.map +1 -0
  418. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.js +5 -0
  419. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.js.map +1 -0
  420. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.d.ts +21 -0
  421. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.d.ts.map +1 -0
  422. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.js +158 -0
  423. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.js.map +1 -0
  424. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.d.ts +5 -0
  425. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.d.ts.map +1 -0
  426. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.js +83 -0
  427. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.js.map +1 -0
  428. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.d.ts +35 -0
  429. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.d.ts.map +1 -0
  430. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.js +363 -0
  431. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.js.map +1 -0
  432. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.d.ts +105 -0
  433. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.d.ts.map +1 -0
  434. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.js +6 -0
  435. package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.js.map +1 -0
  436. package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts +3 -0
  437. package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts.map +1 -1
  438. package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js +44 -0
  439. package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js.map +1 -1
  440. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.d.ts +26 -0
  441. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.d.ts.map +1 -0
  442. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.js +105 -0
  443. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.js.map +1 -0
  444. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +3 -0
  445. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
  446. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +3 -0
  447. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
  448. package/node_modules/@fps-games/editor-playable-sdk/package.json +3 -3
  449. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts +1127 -0
  450. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts.map +1 -0
  451. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js +2180 -0
  452. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js.map +1 -0
  453. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts +68 -0
  454. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts.map +1 -0
  455. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js +23 -0
  456. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js.map +1 -0
  457. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +57 -3
  458. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +1 -1
  459. package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +1 -1
  460. package/node_modules/@fps-games/editor-protocol/dist/index.d.ts +21 -0
  461. package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
  462. package/node_modules/@fps-games/editor-protocol/dist/index.js +3 -0
  463. package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
  464. package/node_modules/@fps-games/editor-protocol/dist/marker-graph.d.ts +128 -0
  465. package/node_modules/@fps-games/editor-protocol/dist/marker-graph.d.ts.map +1 -0
  466. package/node_modules/@fps-games/editor-protocol/dist/marker-graph.js +2 -0
  467. package/node_modules/@fps-games/editor-protocol/dist/marker-graph.js.map +1 -0
  468. package/node_modules/@fps-games/editor-protocol/package.json +1 -1
  469. package/package.json +8 -8
@@ -0,0 +1,782 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ export async function resolvePlayableEditorAssetMetadata(input) {
4
+ const metadata = {
5
+ ...(input.existingMetadata ?? {}),
6
+ ...(input.payloadMetadata ?? {}),
7
+ };
8
+ const assetAnalysis = await resolvePlayableEditorAssetAnalysis(input);
9
+ if (assetAnalysis)
10
+ metadata.assetAnalysis = assetAnalysis;
11
+ else
12
+ delete metadata.assetAnalysis;
13
+ if (input.kind === 'texture' || input.kind === 'image') {
14
+ const textureCapabilities = createPlayableEditorTextureAssetCapabilities(input.sourcePath, metadata);
15
+ if (textureCapabilities) {
16
+ metadata.textureUsage = textureCapabilities.usage;
17
+ metadata.capabilities = {
18
+ ...(isRecord(metadata.capabilities) ? metadata.capabilities : {}),
19
+ materialTexture: textureCapabilities.materialTexture,
20
+ environmentTexture: textureCapabilities.environmentTexture,
21
+ };
22
+ }
23
+ return Object.keys(metadata).length > 0 ? metadata : null;
24
+ }
25
+ if (input.kind !== 'model')
26
+ return Object.keys(metadata).length > 0 ? metadata : null;
27
+ const materialSlots = await extractPlayableEditorGltfMaterialSlots(input.sourcePath, {
28
+ assetGuid: input.guid,
29
+ assetId: input.assetId,
30
+ cwd: input.cwd,
31
+ assetsDir: input.assetsDir,
32
+ existingMaterialSlots: metadata.materialSlots,
33
+ });
34
+ if (materialSlots.length === 0) {
35
+ delete metadata.materialSlots;
36
+ }
37
+ else {
38
+ metadata.materialSlots = materialSlots;
39
+ }
40
+ return Object.keys(metadata).length > 0 ? metadata : null;
41
+ }
42
+ export async function resolvePlayableEditorAssetAnalysis(input) {
43
+ if (input.kind === 'model') {
44
+ return resolvePlayableEditorGltfAssetAnalysis(input.sourcePath);
45
+ }
46
+ if (input.kind === 'texture' || input.kind === 'image') {
47
+ return resolvePlayableEditorImageAssetAnalysis(input.sourcePath);
48
+ }
49
+ return null;
50
+ }
51
+ export async function extractPlayableEditorGltfMaterialSlots(sourcePath, context = {}) {
52
+ try {
53
+ const gltf = await readGltfJson(sourcePath);
54
+ return collectGltfMaterialSlots(gltf, {
55
+ ...context,
56
+ sourcePath,
57
+ });
58
+ }
59
+ catch {
60
+ return [];
61
+ }
62
+ }
63
+ async function readGltfJson(sourcePath) {
64
+ const extension = path.extname(sourcePath).toLowerCase();
65
+ if (extension === '.gltf') {
66
+ return JSON.parse(await fs.readFile(sourcePath, 'utf8'));
67
+ }
68
+ if (extension !== '.glb')
69
+ return null;
70
+ const bytes = await fs.readFile(sourcePath);
71
+ if (bytes.length < 20 || bytes.toString('utf8', 0, 4) !== 'glTF')
72
+ return null;
73
+ const version = bytes.readUInt32LE(4);
74
+ if (version !== 2)
75
+ return null;
76
+ const declaredLength = bytes.readUInt32LE(8);
77
+ if (declaredLength > bytes.length)
78
+ return null;
79
+ let offset = 12;
80
+ while (offset + 8 <= bytes.length) {
81
+ const chunkLength = bytes.readUInt32LE(offset);
82
+ const chunkType = bytes.readUInt32LE(offset + 4);
83
+ offset += 8;
84
+ if (offset + chunkLength > bytes.length)
85
+ return null;
86
+ if (chunkType === 0x4e4f534a) {
87
+ const jsonText = bytes.toString('utf8', offset, offset + chunkLength).replace(/\0+$/g, '');
88
+ return JSON.parse(jsonText);
89
+ }
90
+ offset += chunkLength;
91
+ }
92
+ return null;
93
+ }
94
+ async function resolvePlayableEditorGltfAssetAnalysis(sourcePath) {
95
+ try {
96
+ const gltf = await readGltfJson(sourcePath);
97
+ if (!gltf || typeof gltf !== 'object')
98
+ return null;
99
+ const scenes = Array.isArray(gltf.scenes) ? gltf.scenes : [];
100
+ const nodes = Array.isArray(gltf.nodes) ? gltf.nodes : [];
101
+ const meshes = Array.isArray(gltf.meshes) ? gltf.meshes : [];
102
+ const materials = Array.isArray(gltf.materials) ? gltf.materials : [];
103
+ const textures = Array.isArray(gltf.textures) ? gltf.textures : [];
104
+ const images = Array.isArray(gltf.images) ? gltf.images : [];
105
+ const animations = Array.isArray(gltf.animations) ? gltf.animations : [];
106
+ const skins = Array.isArray(gltf.skins) ? gltf.skins : [];
107
+ const primitiveCount = meshes.reduce((count, mesh) => (count + (Array.isArray(mesh?.primitives) ? mesh.primitives.length : 0)), 0);
108
+ const complexity = resolveAssetComplexity({
109
+ nodeCount: nodes.length,
110
+ meshCount: meshes.length,
111
+ primitiveCount,
112
+ materialCount: materials.length,
113
+ textureCount: textures.length,
114
+ imageCount: images.length,
115
+ });
116
+ const diagnostics = createGltfAssetAnalysisDiagnostics({
117
+ nodeCount: nodes.length,
118
+ meshCount: meshes.length,
119
+ primitiveCount,
120
+ materialCount: materials.length,
121
+ textureCount: textures.length,
122
+ imageCount: images.length,
123
+ animationCount: animations.length,
124
+ skinCount: skins.length,
125
+ complexity,
126
+ });
127
+ const analysis = {
128
+ kind: 'gltf',
129
+ format: path.extname(sourcePath).toLowerCase() === '.gltf' ? 'gltf' : 'glb',
130
+ summary: `${nodes.length} nodes, ${meshes.length} meshes, ${primitiveCount} primitives, ${materials.length} materials`,
131
+ complexity,
132
+ sceneCount: scenes.length,
133
+ nodeCount: nodes.length,
134
+ meshCount: meshes.length,
135
+ primitiveCount,
136
+ materialCount: materials.length,
137
+ textureCount: textures.length,
138
+ imageCount: images.length,
139
+ animationCount: animations.length,
140
+ skinCount: skins.length,
141
+ meshes: createGltfMeshAnalysisSummaries(meshes, materials),
142
+ materials: createGltfMaterialAnalysisSummaries(gltf),
143
+ diagnostics,
144
+ };
145
+ return analysis;
146
+ }
147
+ catch {
148
+ return null;
149
+ }
150
+ }
151
+ async function resolvePlayableEditorImageAssetAnalysis(sourcePath) {
152
+ try {
153
+ const bytes = await fs.readFile(sourcePath);
154
+ const extension = path.extname(sourcePath).toLowerCase();
155
+ const image = extension === '.png'
156
+ ? readPngImageAnalysis(bytes)
157
+ : extension === '.jpg' || extension === '.jpeg'
158
+ ? readJpegImageAnalysis(bytes)
159
+ : extension === '.webp'
160
+ ? readWebpImageAnalysis(bytes)
161
+ : null;
162
+ if (!image)
163
+ return null;
164
+ const diagnostics = createImageAssetAnalysisDiagnostics(image);
165
+ return {
166
+ kind: 'image',
167
+ format: image.format,
168
+ summary: `${image.width}x${image.height} ${image.mime}`,
169
+ complexity: image.estimatedPixels >= 4096 * 4096 ? 'high' : image.estimatedPixels >= 2048 * 2048 ? 'medium' : 'low',
170
+ width: image.width,
171
+ height: image.height,
172
+ mime: image.mime,
173
+ bitDepth: image.bitDepth,
174
+ hasAlpha: image.hasAlpha,
175
+ estimatedPixels: image.estimatedPixels,
176
+ diagnostics,
177
+ };
178
+ }
179
+ catch {
180
+ return null;
181
+ }
182
+ }
183
+ function createGltfMeshAnalysisSummaries(meshes, materials) {
184
+ return meshes.slice(0, 50).map((mesh, meshIndex) => {
185
+ const primitives = Array.isArray(mesh?.primitives) ? mesh.primitives : [];
186
+ const materialIndices = [...new Set(primitives
187
+ .map((primitive) => Number.isInteger(primitive?.material) ? primitive.material : -1)
188
+ .filter((materialIndex) => materialIndex >= 0))];
189
+ return {
190
+ meshIndex,
191
+ ...(typeof mesh?.name === 'string' && mesh.name.trim() ? { name: mesh.name.trim() } : {}),
192
+ primitiveCount: primitives.length,
193
+ ...(materialIndices.length > 0 ? { materialIndices } : {}),
194
+ ...(materialIndices.length > 0
195
+ ? {
196
+ materialNames: materialIndices
197
+ .map((materialIndex) => {
198
+ const material = materials[materialIndex];
199
+ return typeof material?.name === 'string' ? material.name.trim() : '';
200
+ })
201
+ .filter(Boolean),
202
+ }
203
+ : {}),
204
+ };
205
+ });
206
+ }
207
+ function createGltfMaterialAnalysisSummaries(gltf) {
208
+ const materials = Array.isArray(gltf?.materials) ? gltf.materials : [];
209
+ return materials.slice(0, 50).map((material, sourceMaterialIndex) => {
210
+ const pbr = material?.pbrMetallicRoughness && typeof material.pbrMetallicRoughness === 'object'
211
+ ? material.pbrMetallicRoughness
212
+ : {};
213
+ const textureSlots = readGltfMaterialTextureSlots(material, pbr);
214
+ return {
215
+ sourceMaterialIndex,
216
+ ...(typeof material?.name === 'string' && material.name.trim() ? { materialName: material.name.trim() } : {}),
217
+ ...(Array.isArray(pbr.baseColorFactor) ? { baseColorFactor: pbr.baseColorFactor.slice(0, 4) } : {}),
218
+ metallicFactor: Number.isFinite(pbr.metallicFactor) ? pbr.metallicFactor : 1,
219
+ roughnessFactor: Number.isFinite(pbr.roughnessFactor) ? pbr.roughnessFactor : 1,
220
+ alphaMode: normalizeGltfAlphaMode(material?.alphaMode) ?? 'opaque',
221
+ ...(Number.isFinite(material?.alphaCutoff) ? { alphaCutoff: material.alphaCutoff } : {}),
222
+ ...(textureSlots.length > 0 ? { textureSlots } : {}),
223
+ };
224
+ });
225
+ }
226
+ function readGltfMaterialTextureSlots(material, pbr) {
227
+ const slots = [];
228
+ pushGltfTextureSlot(slots, 'baseColor', pbr?.baseColorTexture);
229
+ pushGltfTextureSlot(slots, 'metallicRoughness', pbr?.metallicRoughnessTexture);
230
+ pushGltfTextureSlot(slots, 'normal', material?.normalTexture);
231
+ pushGltfTextureSlot(slots, 'occlusion', material?.occlusionTexture);
232
+ pushGltfTextureSlot(slots, 'emissive', material?.emissiveTexture);
233
+ return slots;
234
+ }
235
+ function pushGltfTextureSlot(slots, slot, textureInfo) {
236
+ if (!isRecord(textureInfo) || !Number.isInteger(textureInfo.index))
237
+ return;
238
+ slots.push({
239
+ slot,
240
+ textureIndex: textureInfo.index,
241
+ ...(Number.isFinite(textureInfo.texCoord) ? { texCoord: textureInfo.texCoord } : {}),
242
+ });
243
+ }
244
+ function resolveAssetComplexity(input) {
245
+ if (input.nodeCount >= 300
246
+ || input.meshCount >= 250
247
+ || input.primitiveCount >= 300
248
+ || input.materialCount >= 200
249
+ || input.textureCount >= 80
250
+ || input.imageCount >= 80)
251
+ return 'high';
252
+ if (input.nodeCount >= 100
253
+ || input.meshCount >= 80
254
+ || input.primitiveCount >= 100
255
+ || input.materialCount >= 50
256
+ || input.textureCount >= 24
257
+ || input.imageCount >= 24)
258
+ return 'medium';
259
+ return 'low';
260
+ }
261
+ function createGltfAssetAnalysisDiagnostics(input) {
262
+ const diagnostics = [];
263
+ if (input.complexity === 'high') {
264
+ diagnostics.push({
265
+ severity: 'warning',
266
+ source: 'asset',
267
+ code: 'asset.analysis.highComplexity',
268
+ message: 'GLTF asset is structurally complex; agent should place and inspect it before duplicating or using dense shadows.',
269
+ details: {
270
+ nodeCount: input.nodeCount,
271
+ meshCount: input.meshCount,
272
+ primitiveCount: input.primitiveCount,
273
+ materialCount: input.materialCount,
274
+ textureCount: input.textureCount,
275
+ imageCount: input.imageCount,
276
+ },
277
+ });
278
+ }
279
+ if (input.animationCount > 0 || input.skinCount > 0) {
280
+ diagnostics.push({
281
+ severity: 'info',
282
+ source: 'asset',
283
+ code: 'asset.analysis.riggedOrAnimated',
284
+ message: 'GLTF asset contains animation or skin data.',
285
+ details: {
286
+ animationCount: input.animationCount,
287
+ skinCount: input.skinCount,
288
+ },
289
+ });
290
+ }
291
+ return diagnostics;
292
+ }
293
+ function readPngImageAnalysis(bytes) {
294
+ if (bytes.length < 33)
295
+ return null;
296
+ if (bytes[0] !== 0x89
297
+ || bytes.toString('ascii', 1, 4) !== 'PNG'
298
+ || bytes[4] !== 0x0d
299
+ || bytes[5] !== 0x0a
300
+ || bytes[6] !== 0x1a
301
+ || bytes[7] !== 0x0a)
302
+ return null;
303
+ const chunkType = bytes.toString('ascii', 12, 16);
304
+ if (chunkType !== 'IHDR')
305
+ return null;
306
+ const width = bytes.readUInt32BE(16);
307
+ const height = bytes.readUInt32BE(20);
308
+ const bitDepth = bytes[24];
309
+ const colorType = bytes[25];
310
+ return {
311
+ format: 'png',
312
+ mime: 'image/png',
313
+ width,
314
+ height,
315
+ bitDepth,
316
+ hasAlpha: colorType === 4 || colorType === 6,
317
+ estimatedPixels: width * height,
318
+ };
319
+ }
320
+ function readJpegImageAnalysis(bytes) {
321
+ if (bytes.length < 4 || bytes[0] !== 0xff || bytes[1] !== 0xd8)
322
+ return null;
323
+ let offset = 2;
324
+ while (offset + 9 < bytes.length) {
325
+ if (bytes[offset] !== 0xff) {
326
+ offset += 1;
327
+ continue;
328
+ }
329
+ const marker = bytes[offset + 1];
330
+ const length = bytes.readUInt16BE(offset + 2);
331
+ if (length < 2)
332
+ return null;
333
+ const isStartOfFrame = (marker >= 0xc0
334
+ && marker <= 0xcf
335
+ && ![0xc4, 0xc8, 0xcc].includes(marker));
336
+ if (isStartOfFrame && offset + 8 < bytes.length) {
337
+ const bitDepth = bytes[offset + 4];
338
+ const height = bytes.readUInt16BE(offset + 5);
339
+ const width = bytes.readUInt16BE(offset + 7);
340
+ return {
341
+ format: 'jpeg',
342
+ mime: 'image/jpeg',
343
+ width,
344
+ height,
345
+ bitDepth,
346
+ hasAlpha: false,
347
+ estimatedPixels: width * height,
348
+ };
349
+ }
350
+ offset += 2 + length;
351
+ }
352
+ return null;
353
+ }
354
+ function readWebpImageAnalysis(bytes) {
355
+ if (bytes.length < 30 || bytes.toString('ascii', 0, 4) !== 'RIFF' || bytes.toString('ascii', 8, 12) !== 'WEBP')
356
+ return null;
357
+ const chunkType = bytes.toString('ascii', 12, 16);
358
+ if (chunkType === 'VP8X' && bytes.length >= 30) {
359
+ const flags = bytes[20];
360
+ const width = readUInt24LE(bytes, 24) + 1;
361
+ const height = readUInt24LE(bytes, 27) + 1;
362
+ return {
363
+ format: 'webp',
364
+ mime: 'image/webp',
365
+ width,
366
+ height,
367
+ hasAlpha: (flags & 0x10) !== 0,
368
+ estimatedPixels: width * height,
369
+ };
370
+ }
371
+ if (chunkType === 'VP8 ' && bytes.length >= 30) {
372
+ const width = bytes.readUInt16LE(26) & 0x3fff;
373
+ const height = bytes.readUInt16LE(28) & 0x3fff;
374
+ return {
375
+ format: 'webp',
376
+ mime: 'image/webp',
377
+ width,
378
+ height,
379
+ hasAlpha: false,
380
+ estimatedPixels: width * height,
381
+ };
382
+ }
383
+ if (chunkType === 'VP8L' && bytes.length >= 25 && bytes[20] === 0x2f) {
384
+ const bits = bytes.readUInt32LE(21);
385
+ const width = (bits & 0x3fff) + 1;
386
+ const height = ((bits >> 14) & 0x3fff) + 1;
387
+ return {
388
+ format: 'webp',
389
+ mime: 'image/webp',
390
+ width,
391
+ height,
392
+ hasAlpha: true,
393
+ estimatedPixels: width * height,
394
+ };
395
+ }
396
+ return null;
397
+ }
398
+ function readUInt24LE(bytes, offset) {
399
+ return bytes[offset] | (bytes[offset + 1] << 8) | (bytes[offset + 2] << 16);
400
+ }
401
+ function createImageAssetAnalysisDiagnostics(input) {
402
+ const diagnostics = [];
403
+ if (input.estimatedPixels >= 4096 * 4096) {
404
+ diagnostics.push({
405
+ severity: 'warning',
406
+ source: 'asset',
407
+ code: 'asset.analysis.largeImage',
408
+ message: 'Image asset is large; agent should inspect texture usage before assigning it broadly.',
409
+ details: {
410
+ width: input.width,
411
+ height: input.height,
412
+ estimatedPixels: input.estimatedPixels,
413
+ },
414
+ });
415
+ }
416
+ return diagnostics;
417
+ }
418
+ function collectGltfMaterialSlots(gltf, context = {}) {
419
+ if (!gltf || typeof gltf !== 'object')
420
+ return [];
421
+ const nodes = Array.isArray(gltf.nodes) ? gltf.nodes : [];
422
+ const meshes = Array.isArray(gltf.meshes) ? gltf.meshes : [];
423
+ const materials = Array.isArray(gltf.materials) ? gltf.materials : [];
424
+ const sourceMaterialProfiles = collectGltfSourceMaterialProfiles(gltf, context);
425
+ const sceneIndexes = collectGltfSceneRootNodeIndexes(gltf);
426
+ const parentByNode = buildGltfParentIndex(nodes);
427
+ const rootSet = new Set(sceneIndexes);
428
+ const previousSlotIdByOwnerPath = createPreviousMaterialSlotIdMap(context.existingMaterialSlots);
429
+ const currentOwnerPathCounts = countGltfMaterialSlotOwnerPaths(nodes, meshes, parentByNode, rootSet);
430
+ const slots = [];
431
+ for (let nodeIndex = 0; nodeIndex < nodes.length; nodeIndex += 1) {
432
+ const node = nodes[nodeIndex];
433
+ const meshIndex = Number.isInteger(node?.mesh) ? node.mesh : -1;
434
+ if (meshIndex < 0 || meshIndex >= meshes.length)
435
+ continue;
436
+ const ownerNodePath = buildGltfOwnerNodePath(nodes, parentByNode, rootSet, nodeIndex);
437
+ if (!ownerNodePath)
438
+ continue;
439
+ const mesh = meshes[meshIndex];
440
+ const materialRefs = readGltfNodeMeshMaterialRefs(mesh, materials);
441
+ const sourceMaterialIndex = materialRefs.indices[0] ?? -1;
442
+ const materialName = materialRefs.names[0] ?? null;
443
+ const reusablePreviousSlotId = currentOwnerPathCounts.get(ownerNodePath) === 1
444
+ ? previousSlotIdByOwnerPath.get(ownerNodePath)
445
+ : null;
446
+ const slotId = reusablePreviousSlotId
447
+ ?? createGltfMaterialSlotId({
448
+ assetGuid: context.assetGuid,
449
+ assetId: context.assetId,
450
+ nodeIndex,
451
+ meshIndex,
452
+ });
453
+ slots.push({
454
+ slotId,
455
+ ownerNodePath,
456
+ label: readGltfNodeMeshLabel(node, mesh, ownerNodePath),
457
+ nodeIndex,
458
+ meshIndex,
459
+ ...(sourceMaterialIndex >= 0 ? { sourceMaterialIndex } : {}),
460
+ ...(materialRefs.indices.length > 0 ? { sourceMaterialIndices: materialRefs.indices } : {}),
461
+ ...(materialName ? { materialName } : {}),
462
+ ...(materialRefs.names.length > 0 ? { materialNames: materialRefs.names } : {}),
463
+ ...pickGltfSlotSourceMaterialProfiles(sourceMaterialProfiles, materialRefs.indices),
464
+ });
465
+ }
466
+ return slots.sort((left, right) => String(left.ownerNodePath).localeCompare(String(right.ownerNodePath)));
467
+ }
468
+ function collectGltfSourceMaterialProfiles(gltf, context = {}) {
469
+ const materials = Array.isArray(gltf?.materials) ? gltf.materials : [];
470
+ const profiles = [];
471
+ for (let sourceMaterialIndex = 0; sourceMaterialIndex < materials.length; sourceMaterialIndex += 1) {
472
+ const sourceProfile = readGltfSourceMaterialProfile(gltf, sourceMaterialIndex, context);
473
+ if (sourceProfile)
474
+ profiles.push(sourceProfile);
475
+ }
476
+ return profiles;
477
+ }
478
+ function pickGltfSlotSourceMaterialProfiles(sourceProfiles, sourceMaterialIndices) {
479
+ if (!sourceMaterialIndices.length || !sourceProfiles.length)
480
+ return {};
481
+ const profileByIndex = new Map(sourceProfiles.map(profile => [profile.sourceMaterialIndex, profile]));
482
+ const sourceMaterialProfiles = sourceMaterialIndices
483
+ .map(sourceMaterialIndex => profileByIndex.get(sourceMaterialIndex))
484
+ .filter(Boolean);
485
+ return sourceMaterialProfiles.length > 0 ? { sourceMaterialProfiles } : {};
486
+ }
487
+ function readGltfSourceMaterialProfile(gltf, sourceMaterialIndex, context = {}) {
488
+ const material = Array.isArray(gltf?.materials) ? gltf.materials[sourceMaterialIndex] : null;
489
+ if (!material || typeof material !== 'object')
490
+ return null;
491
+ const profile = {};
492
+ const textureHints = [];
493
+ const pbr = material.pbrMetallicRoughness && typeof material.pbrMetallicRoughness === 'object'
494
+ ? material.pbrMetallicRoughness
495
+ : {};
496
+ const baseColor = {};
497
+ const baseColorFactor = Array.isArray(pbr.baseColorFactor) ? pbr.baseColorFactor : null;
498
+ const baseColorRgb = readGltfRgbFactor(baseColorFactor);
499
+ if (baseColorRgb)
500
+ baseColor.color = baseColorRgb;
501
+ const baseColorTextureRef = applyGltfTextureRef(gltf, pbr.baseColorTexture, context, 'baseColor.texture', baseColor, 'texture', textureHints);
502
+ if (Object.keys(baseColor).length > 0)
503
+ profile.baseColor = {
504
+ ...baseColor,
505
+ brightness: 1,
506
+ saturation: 1,
507
+ contrast: 1,
508
+ hue: 0,
509
+ };
510
+ const normal = {};
511
+ applyGltfTextureRef(gltf, material.normalTexture, context, 'normal.texture', normal, 'texture', textureHints);
512
+ if (Number.isFinite(material.normalTexture?.scale))
513
+ normal.strength = material.normalTexture.scale;
514
+ else if (normal.texture)
515
+ normal.strength = 1;
516
+ if (Object.keys(normal).length > 0)
517
+ profile.normal = normal;
518
+ profile.metallic = Number.isFinite(pbr.metallicFactor) ? pbr.metallicFactor : 1;
519
+ profile.roughness = Number.isFinite(pbr.roughnessFactor) ? pbr.roughnessFactor : 1;
520
+ const metallicRoughness = {};
521
+ applyGltfTextureRef(gltf, pbr.metallicRoughnessTexture, context, 'metallicRoughness.texture', metallicRoughness, 'texture', textureHints);
522
+ if (Object.keys(metallicRoughness).length > 0)
523
+ profile.metallicRoughness = metallicRoughness;
524
+ const occlusion = {};
525
+ applyGltfTextureRef(gltf, material.occlusionTexture, context, 'occlusion.texture', occlusion, 'texture', textureHints);
526
+ if (Number.isFinite(material.occlusionTexture?.strength))
527
+ occlusion.strength = material.occlusionTexture.strength;
528
+ else if (occlusion.texture)
529
+ occlusion.strength = 1;
530
+ if (Object.keys(occlusion).length > 0)
531
+ profile.occlusion = occlusion;
532
+ const emission = {};
533
+ const emissiveColor = readGltfRgbFactor(Array.isArray(material.emissiveFactor) ? material.emissiveFactor : null);
534
+ const hasEmissionColor = emissiveColor && (emissiveColor.r !== 0 || emissiveColor.g !== 0 || emissiveColor.b !== 0);
535
+ if (hasEmissionColor)
536
+ emission.color = emissiveColor;
537
+ applyGltfTextureRef(gltf, material.emissiveTexture, context, 'emission.texture', emission, 'texture', textureHints);
538
+ if (hasEmissionColor)
539
+ emission.intensity = 1;
540
+ if (Object.keys(emission).length > 0)
541
+ profile.emission = emission;
542
+ const alpha = {};
543
+ const alphaMode = normalizeGltfAlphaMode(material.alphaMode);
544
+ if (alphaMode)
545
+ alpha.mode = alphaMode;
546
+ if (alphaMode === 'mask' || alphaMode === 'blend') {
547
+ if (baseColorFactor && Number.isFinite(baseColorFactor[3]) && baseColorFactor[3] !== 1)
548
+ alpha.opacity = baseColorFactor[3];
549
+ if (Number.isFinite(material.alphaCutoff))
550
+ alpha.cutoff = material.alphaCutoff;
551
+ else if (alphaMode === 'mask')
552
+ alpha.cutoff = 0.5;
553
+ if (baseColorTextureRef.texture) {
554
+ alpha.texture = structuredClone(baseColorTextureRef.texture);
555
+ }
556
+ else if (baseColorTextureRef.hint) {
557
+ textureHints.push({
558
+ ...baseColorTextureRef.hint,
559
+ profilePath: 'alpha.texture',
560
+ });
561
+ }
562
+ }
563
+ if (Object.keys(alpha).length > 0)
564
+ profile.alpha = alpha;
565
+ if (Object.keys(profile).length === 0 && textureHints.length === 0)
566
+ return null;
567
+ const materialName = typeof material.name === 'string' && material.name.trim() ? material.name.trim() : '';
568
+ return {
569
+ sourceMaterialIndex,
570
+ ...(materialName ? { materialName } : {}),
571
+ ...(Object.keys(profile).length > 0 ? { profile } : {}),
572
+ ...(textureHints.length > 0 ? { textureHints } : {}),
573
+ };
574
+ }
575
+ function readGltfRgbFactor(value) {
576
+ if (!Array.isArray(value) || value.length < 3)
577
+ return null;
578
+ const [r, g, b] = value;
579
+ return Number.isFinite(r) && Number.isFinite(g) && Number.isFinite(b) ? { r, g, b } : null;
580
+ }
581
+ function normalizeGltfAlphaMode(value) {
582
+ if (value === 'MASK')
583
+ return 'mask';
584
+ if (value === 'BLEND')
585
+ return 'blend';
586
+ if (value === 'OPAQUE')
587
+ return 'opaque';
588
+ return null;
589
+ }
590
+ function applyGltfTextureRef(gltf, textureInfo, context, profilePath, target, targetProperty, textureHints) {
591
+ const result = resolveGltfTextureRef(gltf, textureInfo, context, profilePath);
592
+ if (result.texture)
593
+ target[targetProperty] = result.texture;
594
+ if (result.hint)
595
+ textureHints.push(result.hint);
596
+ return result;
597
+ }
598
+ function resolveGltfTextureRef(gltf, textureInfo, context, profilePath) {
599
+ const textureRecord = isRecord(textureInfo) ? textureInfo : {};
600
+ const textureIndex = Number.isInteger(textureRecord.index) ? textureRecord.index : -1;
601
+ if (textureIndex < 0)
602
+ return {};
603
+ const textures = Array.isArray(gltf?.textures) ? gltf.textures : [];
604
+ const images = Array.isArray(gltf?.images) ? gltf.images : [];
605
+ const texture = textures[textureIndex];
606
+ const imageIndex = Number.isInteger(texture?.source) ? texture.source : -1;
607
+ const image = imageIndex >= 0 ? images[imageIndex] : null;
608
+ const uri = typeof image?.uri === 'string' ? image.uri.trim() : '';
609
+ const baseHint = {
610
+ profilePath,
611
+ textureIndex,
612
+ ...(imageIndex >= 0 ? { imageIndex } : {}),
613
+ ...(uri ? { uri } : {}),
614
+ ...(Number.isInteger(image?.bufferView) ? { bufferView: image.bufferView } : {}),
615
+ ...(typeof image?.mimeType === 'string' && image.mimeType.trim() ? { mimeType: image.mimeType.trim() } : {}),
616
+ };
617
+ if (image?.bufferView != null)
618
+ return { hint: { ...baseHint, reason: 'embedded-texture' } };
619
+ if (!uri)
620
+ return { hint: { ...baseHint, reason: 'missing-image-uri' } };
621
+ if (/^data:/i.test(uri))
622
+ return { hint: { ...baseHint, reason: 'embedded-texture' } };
623
+ if (/^https?:\/\//i.test(uri) || uri.startsWith('/'))
624
+ return { texture: { url: uri } };
625
+ let decodedUri = uri;
626
+ try {
627
+ decodedUri = decodeURIComponent(uri);
628
+ }
629
+ catch {
630
+ return { hint: { ...baseHint, reason: 'unresolved-external-texture' } };
631
+ }
632
+ const sourceDir = path.dirname(String(context.sourcePath ?? ''));
633
+ const absolutePath = path.resolve(sourceDir, decodedUri);
634
+ const assetsDir = context.assetsDir ? path.resolve(context.assetsDir) : '';
635
+ const cwd = context.cwd ? path.resolve(context.cwd) : '';
636
+ const relativeToAssets = assetsDir ? path.relative(assetsDir, absolutePath) : '../';
637
+ if (assetsDir && cwd && relativeToAssets && !relativeToAssets.startsWith('..') && !path.isAbsolute(relativeToAssets)) {
638
+ const relativeToCwd = path.relative(cwd, absolutePath).split(path.sep).join('/');
639
+ return { texture: { url: `/${relativeToCwd}` } };
640
+ }
641
+ return { hint: { ...baseHint, reason: 'unresolved-external-texture' } };
642
+ }
643
+ function countGltfMaterialSlotOwnerPaths(nodes, meshes, parentByNode, rootSet) {
644
+ const counts = new Map();
645
+ for (let nodeIndex = 0; nodeIndex < nodes.length; nodeIndex += 1) {
646
+ const meshIndex = Number.isInteger(nodes[nodeIndex]?.mesh) ? nodes[nodeIndex].mesh : -1;
647
+ if (meshIndex < 0 || meshIndex >= meshes.length)
648
+ continue;
649
+ const ownerNodePath = buildGltfOwnerNodePath(nodes, parentByNode, rootSet, nodeIndex);
650
+ if (!ownerNodePath)
651
+ continue;
652
+ counts.set(ownerNodePath, (counts.get(ownerNodePath) ?? 0) + 1);
653
+ }
654
+ return counts;
655
+ }
656
+ function createPreviousMaterialSlotIdMap(rawSlots) {
657
+ const result = new Map();
658
+ if (!Array.isArray(rawSlots))
659
+ return result;
660
+ const ownerPathCounts = new Map();
661
+ for (const rawSlot of rawSlots) {
662
+ if (!isRecord(rawSlot))
663
+ continue;
664
+ const ownerNodePath = typeof rawSlot.ownerNodePath === 'string'
665
+ ? rawSlot.ownerNodePath.trim().replace(/^\/+|\/+$/g, '')
666
+ : '';
667
+ if (ownerNodePath)
668
+ ownerPathCounts.set(ownerNodePath, (ownerPathCounts.get(ownerNodePath) ?? 0) + 1);
669
+ }
670
+ for (const rawSlot of rawSlots) {
671
+ if (!isRecord(rawSlot))
672
+ continue;
673
+ const ownerNodePath = typeof rawSlot.ownerNodePath === 'string'
674
+ ? rawSlot.ownerNodePath.trim().replace(/^\/+|\/+$/g, '')
675
+ : '';
676
+ const slotId = typeof rawSlot.slotId === 'string' ? rawSlot.slotId.trim() : '';
677
+ if (ownerNodePath && slotId && ownerPathCounts.get(ownerNodePath) === 1)
678
+ result.set(ownerNodePath, slotId);
679
+ }
680
+ return result;
681
+ }
682
+ function createGltfMaterialSlotId(input) {
683
+ const seed = `${input.assetGuid || input.assetId || 'asset'}:${input.nodeIndex}:${input.meshIndex}`;
684
+ return `slot_${stableHashToken(seed)}`;
685
+ }
686
+ function createPlayableEditorTextureAssetCapabilities(sourcePath, metadata) {
687
+ if (metadata.textureUsage === 'environment' || metadata.usage === 'environment') {
688
+ return { usage: 'environment', materialTexture: false, environmentTexture: true };
689
+ }
690
+ if (isRecord(metadata.capabilities) && metadata.capabilities.environmentTexture === true) {
691
+ return { usage: 'environment', materialTexture: false, environmentTexture: true };
692
+ }
693
+ const extension = path.extname(sourcePath).toLowerCase();
694
+ if (['.env', '.hdr', '.dds', '.ktx', '.ktx2'].includes(extension)) {
695
+ return { usage: 'environment', materialTexture: false, environmentTexture: true };
696
+ }
697
+ if (['.png', '.jpg', '.jpeg', '.webp'].includes(extension)) {
698
+ return { usage: 'material', materialTexture: true, environmentTexture: false };
699
+ }
700
+ return null;
701
+ }
702
+ function collectGltfSceneRootNodeIndexes(gltf) {
703
+ const scenes = Array.isArray(gltf.scenes) ? gltf.scenes : [];
704
+ const sceneIndex = Number.isInteger(gltf.scene) ? gltf.scene : 0;
705
+ const scene = scenes[sceneIndex] ?? scenes[0];
706
+ return Array.isArray(scene?.nodes) ? scene.nodes.filter(Number.isInteger) : [];
707
+ }
708
+ function buildGltfParentIndex(nodes) {
709
+ const parentByNode = new Map();
710
+ for (let parentIndex = 0; parentIndex < nodes.length; parentIndex += 1) {
711
+ const children = Array.isArray(nodes[parentIndex]?.children) ? nodes[parentIndex].children : [];
712
+ for (const childIndex of children) {
713
+ if (Number.isInteger(childIndex) && !parentByNode.has(childIndex)) {
714
+ parentByNode.set(childIndex, parentIndex);
715
+ }
716
+ }
717
+ }
718
+ return parentByNode;
719
+ }
720
+ function buildGltfOwnerNodePath(nodes, parentByNode, rootSet, nodeIndex) {
721
+ const segments = [];
722
+ let currentIndex = nodeIndex;
723
+ const visited = new Set();
724
+ while (Number.isInteger(currentIndex) && currentIndex >= 0 && currentIndex < nodes.length) {
725
+ if (visited.has(currentIndex))
726
+ return '';
727
+ visited.add(currentIndex);
728
+ segments.push(stableGltfNodeSegment(nodes[currentIndex], currentIndex));
729
+ const parentIndex = parentByNode.get(currentIndex);
730
+ if (typeof parentIndex !== 'number' || !Number.isInteger(parentIndex))
731
+ break;
732
+ currentIndex = parentIndex;
733
+ }
734
+ segments.reverse();
735
+ if (segments.length > 1 && rootSet.has(currentIndex))
736
+ segments.shift();
737
+ return segments.filter(Boolean).join('/');
738
+ }
739
+ function stableGltfNodeSegment(node, index) {
740
+ const name = isRecord(node) && typeof node.name === 'string' ? node.name.trim() : '';
741
+ return name || `node_${index}`;
742
+ }
743
+ function readGltfNodeMeshLabel(node, mesh, ownerNodePath) {
744
+ const nodeName = isRecord(node) && typeof node.name === 'string' ? node.name.trim() : '';
745
+ const meshName = isRecord(mesh) && typeof mesh.name === 'string' ? mesh.name.trim() : '';
746
+ return nodeName || meshName || ownerNodePath.split('/').filter(Boolean).pop() || ownerNodePath;
747
+ }
748
+ function readGltfNodeMeshMaterialRefs(mesh, materials) {
749
+ const meshRecord = isRecord(mesh) ? mesh : {};
750
+ const primitives = Array.isArray(meshRecord.primitives) ? meshRecord.primitives : [];
751
+ const indices = [];
752
+ const seen = new Set();
753
+ for (const primitive of primitives) {
754
+ const materialIndex = Number.isInteger(primitive?.material) ? primitive.material : -1;
755
+ if (materialIndex >= 0 && !seen.has(materialIndex)) {
756
+ seen.add(materialIndex);
757
+ indices.push(materialIndex);
758
+ }
759
+ }
760
+ return {
761
+ indices,
762
+ names: indices
763
+ .map((materialIndex) => {
764
+ const material = materials[materialIndex];
765
+ return typeof material?.name === 'string' ? material.name.trim() : '';
766
+ })
767
+ .filter(Boolean),
768
+ };
769
+ }
770
+ function isRecord(value) {
771
+ return value != null && typeof value === 'object' && !Array.isArray(value);
772
+ }
773
+ function stableHashToken(value) {
774
+ const text = String(value ?? '');
775
+ let hash = 0x811c9dc5;
776
+ for (let index = 0; index < text.length; index += 1) {
777
+ hash ^= text.charCodeAt(index);
778
+ hash = Math.imul(hash, 0x01000193);
779
+ }
780
+ return (hash >>> 0).toString(16).padStart(8, '0');
781
+ }
782
+ //# sourceMappingURL=metadata.js.map