@craft_eco/craft-mcp 0.0.0-stage → 0.1.14

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 (1039) hide show
  1. package/README.md +32 -2
  2. package/bin/craft-mcp.mjs +7 -0
  3. package/dist-server/core/app-paths.mjs +15 -0
  4. package/dist-server/core/auth-store.mjs +70 -0
  5. package/dist-server/core/connector-auth.mjs +30 -0
  6. package/dist-server/core/http-utils.mjs +14 -0
  7. package/dist-server/game-workflow/asset-formats.mjs +76 -0
  8. package/dist-server/game-workflow/asset-import.mjs +113 -0
  9. package/dist-server/game-workflow/asset-inputs.mjs +10 -0
  10. package/dist-server/game-workflow/assets.mjs +161 -0
  11. package/dist-server/game-workflow/capture-worker.mjs +14 -0
  12. package/dist-server/game-workflow/check.mjs +74 -0
  13. package/dist-server/game-workflow/draft-archive.mjs +91 -0
  14. package/dist-server/game-workflow/draft-bindings.mjs +35 -0
  15. package/dist-server/game-workflow/draft-uploads.mjs +207 -0
  16. package/dist-server/game-workflow/engines.mjs +30 -0
  17. package/dist-server/game-workflow/library-assets.mjs +77 -0
  18. package/dist-server/game-workflow/library-candidates.mjs +37 -0
  19. package/dist-server/game-workflow/library-catalog.mjs +45 -0
  20. package/dist-server/game-workflow/project-leases.mjs +52 -0
  21. package/dist-server/game-workflow/projects.mjs +92 -0
  22. package/dist-server/game-workflow/publication-materials.mjs +67 -0
  23. package/dist-server/game-workflow/publications.mjs +146 -0
  24. package/dist-server/game-workflow/publish-capture-worker.mjs +57 -0
  25. package/dist-server/game-workflow/publish-capture.mjs +75 -0
  26. package/dist-server/game-workflow/request-store.mjs +52 -0
  27. package/dist-server/game-workflow/resource-catalog.mjs +97 -0
  28. package/dist-server/game-workflow/tasks.mjs +93 -0
  29. package/dist-server/mcp/asset-tools.mjs +42 -0
  30. package/dist-server/mcp/control-panel.html +17 -0
  31. package/dist-server/mcp/control-panel.mjs +40 -0
  32. package/dist-server/mcp/publication-tools.mjs +19 -0
  33. package/dist-server/mcp/server.mjs +297 -0
  34. package/dist-server/mcp/start.mjs +20 -0
  35. package/dist-server/preview/local-static-preview.mjs +71 -0
  36. package/dist-server/preview/preview-control.mjs +35 -0
  37. package/dist-server/preview/preview-launcher.mjs +26 -0
  38. package/dist-server/preview/preview-snapshot.mjs +35 -0
  39. package/dist-server/preview/preview-start.mjs +12 -0
  40. package/dist-server/preview/preview-worker.mjs +68 -0
  41. package/dist-server/upstream/craft-aigc.mjs +197 -0
  42. package/dist-server/upstream/library-url.mjs +14 -0
  43. package/dist-server/upstream/publication-transport.mjs +80 -0
  44. package/package.json +33 -4
  45. package/resources/craft-game-maker/SKILL.md +67 -0
  46. package/resources/craft-game-maker/js.md +9 -0
  47. package/resources/craft-game-maker/js3d.md +12 -0
  48. package/resources/game_visual_qa.mjs +1143 -0
  49. package/resources/js/context/CLAUDE.md +54 -0
  50. package/resources/js/context/agents/aigc-manager.md +91 -0
  51. package/resources/js/context/hooks/hooks.json +20 -0
  52. package/resources/js/context/knowledge/AigcEnabled.md +41 -0
  53. package/resources/js/context/knowledge/AigcWiring.md +200 -0
  54. package/resources/js/context/knowledge/AssetUrl.md +24 -0
  55. package/resources/js/context/knowledge/FrontendComponents.md +23 -0
  56. package/resources/js/context/knowledge/GameProbe.md +74 -0
  57. package/resources/js/context/knowledge/Lifecycle.md +27 -0
  58. package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -0
  59. package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +115 -0
  60. package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +392 -0
  61. package/resources/js/context/knowledge/PlatformServices.md +184 -0
  62. package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -0
  63. package/resources/js/context/knowledge/Ui.md +11 -0
  64. package/resources/js/context/knowledge/UiEditorCompat.md +21 -0
  65. package/resources/js/context/rules/MultiplayerCapability.md +23 -0
  66. package/resources/js/context/rules/MultiplayerRoomEntryUX.md +63 -0
  67. package/resources/js/context/rules/PlatformBoundaryModules.md +43 -0
  68. package/resources/js/context/skills/aigc-generate/SKILL.md +301 -0
  69. package/resources/js/context/skills/aigc-generate/knowledge/audio.md +39 -0
  70. package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +14 -0
  71. package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +129 -0
  72. package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +54 -0
  73. package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +50 -0
  74. package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +201 -0
  75. package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +53 -0
  76. package/resources/js/context/skills/aigc-generate/scripts/apply-results.mjs +83 -0
  77. package/resources/js/context/skills/aigc-generate/scripts/config.json +29 -0
  78. package/resources/js/context/skills/aigc-generate/scripts/generate.mjs +1016 -0
  79. package/resources/js/context/skills/aigc-generate/scripts/lib/client.mjs +228 -0
  80. package/resources/js/context/skills/aigc-generate/scripts/lib/ledger.mjs +119 -0
  81. package/resources/js/context/skills/aigc-generate/scripts/lib/nstep-handoff.mjs +100 -0
  82. package/resources/js/context/skills/aigc-generate/scripts/lib/pipelines.mjs +441 -0
  83. package/resources/js/context/skills/aigc-generate/scripts/lib/queue.mjs +283 -0
  84. package/resources/js/context/skills/aigc-generate/scripts/lib/submit.mjs +122 -0
  85. package/resources/js/context/skills/aigc-generate/scripts/worker.mjs +171 -0
  86. package/resources/js/context/skills/asset-search/SKILL.md +73 -0
  87. package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +62 -0
  88. package/resources/js/context/skills/asset-search/scripts/config.json +5 -0
  89. package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +125 -0
  90. package/resources/js/context/skills/asset-search/scripts/recalled_sprite_paths.mjs +47 -0
  91. package/resources/js/context/skills/asset-search/scripts/search.mjs +749 -0
  92. package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +723 -0
  93. package/resources/js/context/skills/asset-search/strategies/audio.md +34 -0
  94. package/resources/js/context/skills/asset-search/strategies/character2d.md +33 -0
  95. package/resources/js/context/skills/asset-search/strategies/effect2d.md +31 -0
  96. package/resources/js/context/skills/asset-search/strategies/texture-prop.md +22 -0
  97. package/resources/js/context/skills/asset-search/strategies/texture-ui.md +35 -0
  98. package/resources/js/context/skills/asset-search/strategies/ui-common.md +40 -0
  99. package/resources/js/context/skills/asset-search/strategies/ui-style.md +28 -0
  100. package/resources/js/context/skills/display-info-setup/SKILL.md +32 -0
  101. package/resources/js/context/skills/display-info-setup/scripts/init_project.mjs +38 -0
  102. package/resources/js/context/skills/export-config/SKILL.md +20 -0
  103. package/resources/js/context/skills/export-config/scripts/assert-asset-wiring.mjs +72 -0
  104. package/resources/js/context/skills/export-config/scripts/export-config.mjs +43 -0
  105. package/resources/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  106. package/resources/js/context/skills/export-config/scripts/sync-asset-controls.mjs +351 -0
  107. package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +163 -0
  108. package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +92 -0
  109. package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +7 -0
  110. package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +22 -0
  111. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
  112. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
  113. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
  114. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
  115. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
  116. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
  117. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
  118. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
  119. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform.mjs +29 -0
  120. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
  121. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
  122. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/release.json +37 -0
  123. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
  124. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
  125. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
  126. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
  127. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.mjs +8 -0
  128. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
  129. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
  130. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
  131. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
  132. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
  133. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
  134. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
  135. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
  136. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
  137. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
  138. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
  139. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
  140. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
  141. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
  142. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
  143. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
  144. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +32 -0
  145. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +50 -0
  146. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +121 -0
  147. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +254 -0
  148. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +99 -0
  149. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +14 -0
  150. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +172 -0
  151. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +165 -0
  152. package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +20 -0
  153. package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +4 -0
  154. package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +109 -0
  155. package/resources/js/context/skills/mobile-adaptation/SKILL.md +260 -0
  156. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +50 -0
  157. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +881 -0
  158. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -0
  159. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -0
  160. package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +134 -0
  161. package/resources/js/context/skills/mobile-adaptation/references/input-config.md +311 -0
  162. package/resources/js/context/skills/mobile-adaptation/references/verification.md +106 -0
  163. package/resources/js/context/skills/optimization-suggestions/SKILL.md +89 -0
  164. package/resources/js/context/skills/platform-services/SKILL.md +94 -0
  165. package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +783 -0
  166. package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +57 -0
  167. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -0
  168. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -0
  169. package/resources/js/context/skills/platform-services/assets/modules/log.ts +35 -0
  170. package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +25 -0
  171. package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +1 -0
  172. package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +49 -0
  173. package/resources/js/context/skills/platform-services/assets/modules/save.mjs +1 -0
  174. package/resources/js/context/skills/platform-services/assets/release.json +44 -0
  175. package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -0
  176. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -0
  177. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -0
  178. package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +139 -0
  179. package/resources/js/context/skills/platform-services/references/api_reference.md +18 -0
  180. package/resources/js/context/skills/platform-services/scripts/install.mjs +134 -0
  181. package/resources/js/context/skills/resolution-adaptation/SKILL.md +202 -0
  182. package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +121 -0
  183. package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +254 -0
  184. package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +98 -0
  185. package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +200 -0
  186. package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +134 -0
  187. package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +119 -0
  188. package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +338 -0
  189. package/resources/js/context/skills/scene-editor-compat/SKILL.md +94 -0
  190. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +13 -0
  191. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +6 -0
  192. package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +25 -0
  193. package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +18 -0
  194. package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +7 -0
  195. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +42 -0
  196. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +144 -0
  197. package/resources/js/context/skills/scene-editor-compat/docs/contract.md +330 -0
  198. package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +64 -0
  199. package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +28 -0
  200. package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +47 -0
  201. package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +64 -0
  202. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +38 -0
  203. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +9 -0
  204. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +59 -0
  205. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +30 -0
  206. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +66 -0
  207. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +20 -0
  208. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +26 -0
  209. package/resources/js/context/skills/scene-editor-compat/references/contract.md +73 -0
  210. package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +162 -0
  211. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +853 -0
  212. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +173 -0
  213. package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +427 -0
  214. package/resources/js/context/skills/scene-editor-compat/version.json +1 -0
  215. package/resources/js/context/skills/ui-editor-compat/SKILL.md +48 -0
  216. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -0
  217. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +74 -0
  218. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -0
  219. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -0
  220. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -0
  221. package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +7 -0
  222. package/resources/js/context/skills/ui-editor-compat/references/contract.md +132 -0
  223. package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -0
  224. package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -0
  225. package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -0
  226. package/resources/js/context/skills/version-update/SKILL.md +192 -0
  227. package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -0
  228. package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +159 -0
  229. package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +157 -0
  230. package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  231. package/resources/js/context/skills/visual-qa/SKILL.md +36 -0
  232. package/resources/js/context/version/version.json +1 -0
  233. package/resources/js/project/.gitattributes +2 -0
  234. package/resources/js/project/README.md +99 -0
  235. package/resources/js/project/SPEC/assist/.gitkeep +0 -0
  236. package/resources/js/project/SPEC/guide/.gitkeep +0 -0
  237. package/resources/js/project/SPEC/plan/.gitkeep +0 -0
  238. package/resources/js/project/SPEC/readme.md +6 -0
  239. package/resources/js/project/SPEC/res/.gitkeep +0 -0
  240. package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
  241. package/resources/js/project/configs/assets.json +1 -0
  242. package/resources/js/project/configs/game.controls.json +3 -0
  243. package/resources/js/project/configs/game.json +3 -0
  244. package/resources/js/project/game-runtime.json +7 -0
  245. package/resources/js/project/gameplay-probe.json +37 -0
  246. package/resources/js/project/index.html +20 -0
  247. package/resources/js/project/package-lock.json +1155 -0
  248. package/resources/js/project/package.json +23 -0
  249. package/resources/js/project/projectDisplayInfo.json +7 -0
  250. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
  251. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
  252. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
  253. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
  254. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
  255. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
  256. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
  257. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
  258. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +29 -0
  259. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
  260. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
  261. package/resources/js/project/runtime/lightgame/1.0.0/release.json +37 -0
  262. package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
  263. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
  264. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
  265. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
  266. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +8 -0
  267. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
  268. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
  269. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
  270. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
  271. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
  272. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
  273. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
  274. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
  275. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
  276. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
  277. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
  278. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
  279. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
  280. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
  281. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
  282. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
  283. package/resources/js/project/scripts/config-export.mjs +32 -0
  284. package/resources/js/project/scripts/refresh-runtime.mjs +50 -0
  285. package/resources/js/project/src/display/ui-stage.ts +121 -0
  286. package/resources/js/project/src/display/viewport.ts +254 -0
  287. package/resources/js/project/src/main.ts +99 -0
  288. package/resources/js/project/src/platform.ts +14 -0
  289. package/resources/js/project/src/scenes/LoadScene.ts +89 -0
  290. package/resources/js/project/src/scenes/PlayScene.ts +17 -0
  291. package/resources/js/project/src/screenUi.ts +172 -0
  292. package/resources/js/project/src/style.css +165 -0
  293. package/resources/js/project/tsconfig.json +20 -0
  294. package/resources/js/project/unified_data_control_config.json +20 -0
  295. package/resources/js/project/vendor/core-manager-js/package.json +33 -0
  296. package/resources/js/project/vendor/core-manager-js/src/.versions.json +42 -0
  297. package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +41 -0
  298. package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +90 -0
  299. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +203 -0
  300. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +106 -0
  301. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +25 -0
  302. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +21 -0
  303. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +65 -0
  304. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +340 -0
  305. package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +87 -0
  306. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +92 -0
  307. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +271 -0
  308. package/resources/js/project/vendor/core-manager-js/src/index.ts +31 -0
  309. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +81 -0
  310. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +43 -0
  311. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +32 -0
  312. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +141 -0
  313. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +20 -0
  314. package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +183 -0
  315. package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +304 -0
  316. package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +351 -0
  317. package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +180 -0
  318. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +13 -0
  319. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +14 -0
  320. package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +68 -0
  321. package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +433 -0
  322. package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +118 -0
  323. package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +444 -0
  324. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +485 -0
  325. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +66 -0
  326. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +149 -0
  327. package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +9 -0
  328. package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +29 -0
  329. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +88 -0
  330. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +122 -0
  331. package/resources/js/project/vendor/core-manager-js/src/runtime.ts +24 -0
  332. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +318 -0
  333. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +151 -0
  334. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +235 -0
  335. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +98 -0
  336. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +94 -0
  337. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +209 -0
  338. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +106 -0
  339. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +341 -0
  340. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +68 -0
  341. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +236 -0
  342. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +22 -0
  343. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +29 -0
  344. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +197 -0
  345. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +9 -0
  346. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +555 -0
  347. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +112 -0
  348. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +178 -0
  349. package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +246 -0
  350. package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +139 -0
  351. package/resources/js/project/vendor/core-manager-js/tsconfig.json +15 -0
  352. package/resources/js/project/vendor/run.sh +107 -0
  353. package/resources/js/project/version/craft_feature_version.json +42 -0
  354. package/resources/js/project/version/project_feature_version.json +11 -0
  355. package/resources/js/project/vite.config.ts +4 -0
  356. package/resources/js3d/context/CLAUDE.md +50 -0
  357. package/resources/js3d/context/hooks/hooks.json +20 -0
  358. package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +87 -0
  359. package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +69 -0
  360. package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +42 -0
  361. package/resources/js3d/context/knowledge/FrontendComponents.md +23 -0
  362. package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -0
  363. package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +117 -0
  364. package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +430 -0
  365. package/resources/js3d/context/knowledge/PlatformServices.md +162 -0
  366. package/resources/js3d/context/knowledge/Runtime.md +30 -0
  367. package/resources/js3d/context/knowledge/SceneEditorCompat.md +34 -0
  368. package/resources/js3d/context/knowledge/StepByStep.md +21 -0
  369. package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -0
  370. package/resources/js3d/context/knowledge/UiEditorCompat.md +21 -0
  371. package/resources/js3d/context/rules/MultiplayerCapability.md +27 -0
  372. package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +63 -0
  373. package/resources/js3d/context/rules/PlatformBoundaryModules.md +43 -0
  374. package/resources/js3d/context/skills/aigc-integration/SKILL.md +176 -0
  375. package/resources/js3d/context/skills/aigc-integration/callback.md +56 -0
  376. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +22 -0
  377. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +38 -0
  378. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +33 -0
  379. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +36 -0
  380. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +37 -0
  381. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +35 -0
  382. package/resources/js3d/context/skills/aigc-integration/scripts/config.json +3 -0
  383. package/resources/js3d/context/skills/aigc-integration/scripts/lib/submit.mjs +344 -0
  384. package/resources/js3d/context/skills/aigc-integration/scripts/query-music.mjs +53 -0
  385. package/resources/js3d/context/skills/aigc-integration/scripts/query-results.mjs +53 -0
  386. package/resources/js3d/context/skills/aigc-integration/scripts/submit-cover.mjs +44 -0
  387. package/resources/js3d/context/skills/aigc-integration/scripts/submit-image.mjs +48 -0
  388. package/resources/js3d/context/skills/aigc-integration/scripts/submit-music.mjs +34 -0
  389. package/resources/js3d/context/skills/aigc-integration/scripts/submit-staticmesh.mjs +39 -0
  390. package/resources/js3d/context/skills/asset-search/SKILL.md +159 -0
  391. package/resources/js3d/context/skills/asset-search/references/resource-config.md +56 -0
  392. package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +62 -0
  393. package/resources/js3d/context/skills/asset-search/scripts/config.json +213 -0
  394. package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +885 -0
  395. package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +79 -0
  396. package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +74 -0
  397. package/resources/js3d/context/skills/asset-search/scripts/search.mjs +597 -0
  398. package/resources/js3d/context/skills/export-config/scripts/assert-asset-wiring.mjs +83 -0
  399. package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +53 -0
  400. package/resources/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  401. package/resources/js3d/context/skills/export-config/scripts/sync-asset-controls.mjs +325 -0
  402. package/resources/js3d/context/skills/export-config/scripts/sync-scene-assets.mjs +181 -0
  403. package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +163 -0
  404. package/resources/js3d/context/skills/game-art-style/SKILL.md +60 -0
  405. package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
  406. package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
  407. package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
  408. package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
  409. package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
  410. package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
  411. package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
  412. package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
  413. package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +38 -0
  414. package/resources/js3d/context/skills/game-art-style/references/construction.md +111 -0
  415. package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +105 -0
  416. package/resources/js3d/context/skills/game-art-style/references/sources.md +25 -0
  417. package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +175 -0
  418. package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +168 -0
  419. package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +191 -0
  420. package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +165 -0
  421. package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +173 -0
  422. package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +185 -0
  423. package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +181 -0
  424. package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +189 -0
  425. package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +88 -0
  426. package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +284 -0
  427. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +104 -0
  428. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +952 -0
  429. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -0
  430. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -0
  431. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +256 -0
  432. package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +311 -0
  433. package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +106 -0
  434. package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +74 -0
  435. package/resources/js3d/context/skills/platform-services/SKILL.md +94 -0
  436. package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +783 -0
  437. package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +57 -0
  438. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -0
  439. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -0
  440. package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +35 -0
  441. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +25 -0
  442. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +1 -0
  443. package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +49 -0
  444. package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +1 -0
  445. package/resources/js3d/context/skills/platform-services/assets/release.json +44 -0
  446. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -0
  447. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -0
  448. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -0
  449. package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +139 -0
  450. package/resources/js3d/context/skills/platform-services/references/api_reference.md +18 -0
  451. package/resources/js3d/context/skills/platform-services/scripts/install.mjs +134 -0
  452. package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +170 -0
  453. package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +121 -0
  454. package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +244 -0
  455. package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +127 -0
  456. package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +188 -0
  457. package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +124 -0
  458. package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +117 -0
  459. package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +338 -0
  460. package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +599 -0
  461. package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +141 -0
  462. package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +92 -0
  463. package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +125 -0
  464. package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +113 -0
  465. package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +1187 -0
  466. package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +52 -0
  467. package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +4 -0
  468. package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +94 -0
  469. package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +50 -0
  470. package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +105 -0
  471. package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +147 -0
  472. package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +79 -0
  473. package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +56 -0
  474. package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +51 -0
  475. package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +55 -0
  476. package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +78 -0
  477. package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +84 -0
  478. package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +120 -0
  479. package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +4 -0
  480. package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +238 -0
  481. package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +59 -0
  482. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -0
  483. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +61 -0
  484. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -0
  485. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -0
  486. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -0
  487. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +7 -0
  488. package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +110 -0
  489. package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -0
  490. package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -0
  491. package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -0
  492. package/resources/js3d/context/skills/version-update/SKILL.md +191 -0
  493. package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -0
  494. package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +159 -0
  495. package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +157 -0
  496. package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  497. package/resources/js3d/context/version/version.json +1 -0
  498. package/resources/js3d/project/.gitattributes +2 -0
  499. package/resources/js3d/project/README.md +100 -0
  500. package/resources/js3d/project/configs/game.controls.json +3 -0
  501. package/resources/js3d/project/configs/game.json +3 -0
  502. package/resources/js3d/project/game-runtime.json +7 -0
  503. package/resources/js3d/project/gameplay-probe.json +38 -0
  504. package/resources/js3d/project/index.html +12 -0
  505. package/resources/js3d/project/package-lock.json +1204 -0
  506. package/resources/js3d/project/package.json +24 -0
  507. package/resources/js3d/project/projectDisplayInfo.json +7 -0
  508. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
  509. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
  510. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
  511. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
  512. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
  513. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
  514. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
  515. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
  516. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +30 -0
  517. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
  518. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
  519. package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +39 -0
  520. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
  521. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
  522. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
  523. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
  524. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +7 -0
  525. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
  526. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
  527. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
  528. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
  529. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
  530. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
  531. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
  532. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
  533. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +36 -0
  534. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +359 -0
  535. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.test.mjs +25 -0
  536. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
  537. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
  538. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
  539. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
  540. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
  541. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
  542. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
  543. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
  544. package/resources/js3d/project/scripts/config-export.mjs +32 -0
  545. package/resources/js3d/project/scripts/refresh-runtime.mjs +50 -0
  546. package/resources/js3d/project/src/display/ui-stage.ts +121 -0
  547. package/resources/js3d/project/src/display/viewport.ts +244 -0
  548. package/resources/js3d/project/src/main.ts +83 -0
  549. package/resources/js3d/project/src/platform.ts +14 -0
  550. package/resources/js3d/project/src/style.css +17 -0
  551. package/resources/js3d/project/tsconfig.json +20 -0
  552. package/resources/js3d/project/unified_data_control_config.json +20 -0
  553. package/resources/js3d/project/vendor/core-manager-three/package.json +12 -0
  554. package/resources/js3d/project/vendor/core-manager-three/src/index.ts +2 -0
  555. package/resources/js3d/project/vendor/run.sh +4 -0
  556. package/resources/js3d/project/version/craft_feature_version.json +42 -0
  557. package/resources/js3d/project/version/project_feature_version.json +11 -0
  558. package/resources/js3d/project/vite.config.ts +4 -0
  559. package/vendor/agent-cli/dist/runtime-tools/registry.json +6 -0
  560. package/vendor/agent-cli/dist/runtime-tools/tool-bundle-types.d.cts +15 -0
  561. package/vendor/agent-cli/dist/runtime-tools/tool-bundle.cjs +129 -0
  562. package/vendor/agent-cli/dist/runtime-tools/ue/blender-cook-assets.cjs +296 -0
  563. package/vendor/agent-cli/dist/runtime-tools/ue/context-adapter.cjs +48 -0
  564. package/vendor/agent-cli/dist/runtime-tools/ue/scene-process-lock.cjs +110 -0
  565. package/vendor/agent-cli/dist/runtime-tools/ue/tool-manifest.json +22 -0
  566. package/vendor/agent-cli/dist/runtime-tools/ue/ue-asset-references.cjs +305 -0
  567. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts +3 -0
  568. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts.map +1 -0
  569. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js +45 -0
  570. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js.map +1 -0
  571. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +57 -0
  572. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -0
  573. package/vendor/agent-cli/dist/src/artifacts/prepare.js +198 -0
  574. package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -0
  575. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +32 -0
  576. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -0
  577. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +146 -0
  578. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -0
  579. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts +28 -0
  580. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts.map +1 -0
  581. package/vendor/agent-cli/dist/src/artifacts/restore.js +384 -0
  582. package/vendor/agent-cli/dist/src/artifacts/restore.js.map +1 -0
  583. package/vendor/agent-cli/dist/src/artifacts/static.d.ts +15 -0
  584. package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -0
  585. package/vendor/agent-cli/dist/src/artifacts/static.js +152 -0
  586. package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -0
  587. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts +4 -0
  588. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts.map +1 -0
  589. package/vendor/agent-cli/dist/src/cli/commands/process.js +24 -0
  590. package/vendor/agent-cli/dist/src/cli/commands/process.js.map +1 -0
  591. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts +23 -0
  592. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts.map +1 -0
  593. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js +62 -0
  594. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js.map +1 -0
  595. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts +9 -0
  596. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts.map +1 -0
  597. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js +15 -0
  598. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js.map +1 -0
  599. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts +3 -0
  600. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts.map +1 -0
  601. package/vendor/agent-cli/dist/src/cli/commands/run.js +284 -0
  602. package/vendor/agent-cli/dist/src/cli/commands/run.js.map +1 -0
  603. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts +11 -0
  604. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts.map +1 -0
  605. package/vendor/agent-cli/dist/src/cli/commands/setup.js +161 -0
  606. package/vendor/agent-cli/dist/src/cli/commands/setup.js.map +1 -0
  607. package/vendor/agent-cli/dist/src/cli/options.d.ts +83 -0
  608. package/vendor/agent-cli/dist/src/cli/options.d.ts.map +1 -0
  609. package/vendor/agent-cli/dist/src/cli/options.js +213 -0
  610. package/vendor/agent-cli/dist/src/cli/options.js.map +1 -0
  611. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts +5 -0
  612. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -0
  613. package/vendor/agent-cli/dist/src/cli/process-protocol.js +276 -0
  614. package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -0
  615. package/vendor/agent-cli/dist/src/cli/registry.d.ts +55 -0
  616. package/vendor/agent-cli/dist/src/cli/registry.d.ts.map +1 -0
  617. package/vendor/agent-cli/dist/src/cli/registry.js +99 -0
  618. package/vendor/agent-cli/dist/src/cli/registry.js.map +1 -0
  619. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts +44 -0
  620. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts.map +1 -0
  621. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js +83 -0
  622. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js.map +1 -0
  623. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts +28 -0
  624. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts.map +1 -0
  625. package/vendor/agent-cli/dist/src/cli/render/text-sink.js +52 -0
  626. package/vendor/agent-cli/dist/src/cli/render/text-sink.js.map +1 -0
  627. package/vendor/agent-cli/dist/src/cli.d.ts +9 -0
  628. package/vendor/agent-cli/dist/src/cli.d.ts.map +1 -0
  629. package/vendor/agent-cli/dist/src/cli.js +54 -0
  630. package/vendor/agent-cli/dist/src/cli.js.map +1 -0
  631. package/vendor/agent-cli/dist/src/component/execution.d.ts +24 -0
  632. package/vendor/agent-cli/dist/src/component/execution.d.ts.map +1 -0
  633. package/vendor/agent-cli/dist/src/component/execution.js +131 -0
  634. package/vendor/agent-cli/dist/src/component/execution.js.map +1 -0
  635. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts +24 -0
  636. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts.map +1 -0
  637. package/vendor/agent-cli/dist/src/component/platform-access/server.js +200 -0
  638. package/vendor/agent-cli/dist/src/component/platform-access/server.js.map +1 -0
  639. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts +31 -0
  640. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts.map +1 -0
  641. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js +57 -0
  642. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js.map +1 -0
  643. package/vendor/agent-cli/dist/src/component/preparation.d.ts +10 -0
  644. package/vendor/agent-cli/dist/src/component/preparation.d.ts.map +1 -0
  645. package/vendor/agent-cli/dist/src/component/preparation.js +35 -0
  646. package/vendor/agent-cli/dist/src/component/preparation.js.map +1 -0
  647. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts +15 -0
  648. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts.map +1 -0
  649. package/vendor/agent-cli/dist/src/component/runtime-tools.js +37 -0
  650. package/vendor/agent-cli/dist/src/component/runtime-tools.js.map +1 -0
  651. package/vendor/agent-cli/dist/src/component/runtime.d.ts +8 -0
  652. package/vendor/agent-cli/dist/src/component/runtime.d.ts.map +1 -0
  653. package/vendor/agent-cli/dist/src/component/runtime.js +95 -0
  654. package/vendor/agent-cli/dist/src/component/runtime.js.map +1 -0
  655. package/vendor/agent-cli/dist/src/config/config-store.d.ts +50 -0
  656. package/vendor/agent-cli/dist/src/config/config-store.d.ts.map +1 -0
  657. package/vendor/agent-cli/dist/src/config/config-store.js +117 -0
  658. package/vendor/agent-cli/dist/src/config/config-store.js.map +1 -0
  659. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts +17 -0
  660. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts.map +1 -0
  661. package/vendor/agent-cli/dist/src/context/cache-lease.js +133 -0
  662. package/vendor/agent-cli/dist/src/context/cache-lease.js.map +1 -0
  663. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts +9 -0
  664. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts.map +1 -0
  665. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js +51 -0
  666. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js.map +1 -0
  667. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts +4 -0
  668. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts.map +1 -0
  669. package/vendor/agent-cli/dist/src/context/cache-publication.js +54 -0
  670. package/vendor/agent-cli/dist/src/context/cache-publication.js.map +1 -0
  671. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts +12 -0
  672. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts.map +1 -0
  673. package/vendor/agent-cli/dist/src/context/client-context-view.js +100 -0
  674. package/vendor/agent-cli/dist/src/context/client-context-view.js.map +1 -0
  675. package/vendor/agent-cli/dist/src/context/context-budget.d.ts +3 -0
  676. package/vendor/agent-cli/dist/src/context/context-budget.d.ts.map +1 -0
  677. package/vendor/agent-cli/dist/src/context/context-budget.js +10 -0
  678. package/vendor/agent-cli/dist/src/context/context-budget.js.map +1 -0
  679. package/vendor/agent-cli/dist/src/context/context-cache.d.ts +108 -0
  680. package/vendor/agent-cli/dist/src/context/context-cache.d.ts.map +1 -0
  681. package/vendor/agent-cli/dist/src/context/context-cache.js +357 -0
  682. package/vendor/agent-cli/dist/src/context/context-cache.js.map +1 -0
  683. package/vendor/agent-cli/dist/src/context/context-project.d.ts +26 -0
  684. package/vendor/agent-cli/dist/src/context/context-project.d.ts.map +1 -0
  685. package/vendor/agent-cli/dist/src/context/context-project.js +113 -0
  686. package/vendor/agent-cli/dist/src/context/context-project.js.map +1 -0
  687. package/vendor/agent-cli/dist/src/context/context-resource.d.ts +4 -0
  688. package/vendor/agent-cli/dist/src/context/context-resource.d.ts.map +1 -0
  689. package/vendor/agent-cli/dist/src/context/context-resource.js +11 -0
  690. package/vendor/agent-cli/dist/src/context/context-resource.js.map +1 -0
  691. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts +9 -0
  692. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts.map +1 -0
  693. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js +134 -0
  694. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js.map +1 -0
  695. package/vendor/agent-cli/dist/src/context/local-skills.d.ts +4 -0
  696. package/vendor/agent-cli/dist/src/context/local-skills.d.ts.map +1 -0
  697. package/vendor/agent-cli/dist/src/context/local-skills.js +157 -0
  698. package/vendor/agent-cli/dist/src/context/local-skills.js.map +1 -0
  699. package/vendor/agent-cli/dist/src/context/member-context.d.ts +19 -0
  700. package/vendor/agent-cli/dist/src/context/member-context.d.ts.map +1 -0
  701. package/vendor/agent-cli/dist/src/context/member-context.js +105 -0
  702. package/vendor/agent-cli/dist/src/context/member-context.js.map +1 -0
  703. package/vendor/agent-cli/dist/src/context/member-documents.d.ts +3 -0
  704. package/vendor/agent-cli/dist/src/context/member-documents.d.ts.map +1 -0
  705. package/vendor/agent-cli/dist/src/context/member-documents.js +38 -0
  706. package/vendor/agent-cli/dist/src/context/member-documents.js.map +1 -0
  707. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts +3 -0
  708. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts.map +1 -0
  709. package/vendor/agent-cli/dist/src/context/member-profile-header.js +62 -0
  710. package/vendor/agent-cli/dist/src/context/member-profile-header.js.map +1 -0
  711. package/vendor/agent-cli/dist/src/context/member-profile.d.ts +43 -0
  712. package/vendor/agent-cli/dist/src/context/member-profile.d.ts.map +1 -0
  713. package/vendor/agent-cli/dist/src/context/member-profile.js +91 -0
  714. package/vendor/agent-cli/dist/src/context/member-profile.js.map +1 -0
  715. package/vendor/agent-cli/dist/src/context/member-selection.d.ts +7 -0
  716. package/vendor/agent-cli/dist/src/context/member-selection.d.ts.map +1 -0
  717. package/vendor/agent-cli/dist/src/context/member-selection.js +58 -0
  718. package/vendor/agent-cli/dist/src/context/member-selection.js.map +1 -0
  719. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts +6 -0
  720. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts.map +1 -0
  721. package/vendor/agent-cli/dist/src/context/script-dependencies.js +24 -0
  722. package/vendor/agent-cli/dist/src/context/script-dependencies.js.map +1 -0
  723. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts +3 -0
  724. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts.map +1 -0
  725. package/vendor/agent-cli/dist/src/context/shared-cache-build.js +55 -0
  726. package/vendor/agent-cli/dist/src/context/shared-cache-build.js.map +1 -0
  727. package/vendor/agent-cli/dist/src/context/team-definition.d.ts +39 -0
  728. package/vendor/agent-cli/dist/src/context/team-definition.d.ts.map +1 -0
  729. package/vendor/agent-cli/dist/src/context/team-definition.js +78 -0
  730. package/vendor/agent-cli/dist/src/context/team-definition.js.map +1 -0
  731. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts +7 -0
  732. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts.map +1 -0
  733. package/vendor/agent-cli/dist/src/context/team-knowledge.js +37 -0
  734. package/vendor/agent-cli/dist/src/context/team-knowledge.js.map +1 -0
  735. package/vendor/agent-cli/dist/src/context/template-cache.d.ts +27 -0
  736. package/vendor/agent-cli/dist/src/context/template-cache.d.ts.map +1 -0
  737. package/vendor/agent-cli/dist/src/context/template-cache.js +100 -0
  738. package/vendor/agent-cli/dist/src/context/template-cache.js.map +1 -0
  739. package/vendor/agent-cli/dist/src/context/template-seed.d.ts +32 -0
  740. package/vendor/agent-cli/dist/src/context/template-seed.d.ts.map +1 -0
  741. package/vendor/agent-cli/dist/src/context/template-seed.js +117 -0
  742. package/vendor/agent-cli/dist/src/context/template-seed.js.map +1 -0
  743. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts +19 -0
  744. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts.map +1 -0
  745. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +292 -0
  746. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -0
  747. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts +13 -0
  748. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts.map +1 -0
  749. package/vendor/agent-cli/dist/src/context/user-skill-context.js +178 -0
  750. package/vendor/agent-cli/dist/src/context/user-skill-context.js.map +1 -0
  751. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts +54 -0
  752. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts.map +1 -0
  753. package/vendor/agent-cli/dist/src/context/user-skill-install.js +184 -0
  754. package/vendor/agent-cli/dist/src/context/user-skill-install.js.map +1 -0
  755. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts +14 -0
  756. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts.map +1 -0
  757. package/vendor/agent-cli/dist/src/context/zip-extract.js +130 -0
  758. package/vendor/agent-cli/dist/src/context/zip-extract.js.map +1 -0
  759. package/vendor/agent-cli/dist/src/index.d.ts +56 -0
  760. package/vendor/agent-cli/dist/src/index.d.ts.map +1 -0
  761. package/vendor/agent-cli/dist/src/index.js +82 -0
  762. package/vendor/agent-cli/dist/src/index.js.map +1 -0
  763. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts +68 -0
  764. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts.map +1 -0
  765. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js +242 -0
  766. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js.map +1 -0
  767. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts +40 -0
  768. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts.map +1 -0
  769. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js +87 -0
  770. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js.map +1 -0
  771. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts +134 -0
  772. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts.map +1 -0
  773. package/vendor/agent-cli/dist/src/lifecycle/registry.js +152 -0
  774. package/vendor/agent-cli/dist/src/lifecycle/registry.js.map +1 -0
  775. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts +40 -0
  776. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts.map +1 -0
  777. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js +149 -0
  778. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js.map +1 -0
  779. package/vendor/agent-cli/dist/src/mcp/client.d.ts +12 -0
  780. package/vendor/agent-cli/dist/src/mcp/client.d.ts.map +1 -0
  781. package/vendor/agent-cli/dist/src/mcp/client.js +95 -0
  782. package/vendor/agent-cli/dist/src/mcp/client.js.map +1 -0
  783. package/vendor/agent-cli/dist/src/mcp/connection.d.ts +14 -0
  784. package/vendor/agent-cli/dist/src/mcp/connection.d.ts.map +1 -0
  785. package/vendor/agent-cli/dist/src/mcp/connection.js +115 -0
  786. package/vendor/agent-cli/dist/src/mcp/connection.js.map +1 -0
  787. package/vendor/agent-cli/dist/src/mcp/execute.d.ts +5 -0
  788. package/vendor/agent-cli/dist/src/mcp/execute.d.ts.map +1 -0
  789. package/vendor/agent-cli/dist/src/mcp/execute.js +26 -0
  790. package/vendor/agent-cli/dist/src/mcp/execute.js.map +1 -0
  791. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts +11 -0
  792. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts.map +1 -0
  793. package/vendor/agent-cli/dist/src/mcp/instance-lock.js +51 -0
  794. package/vendor/agent-cli/dist/src/mcp/instance-lock.js.map +1 -0
  795. package/vendor/agent-cli/dist/src/mcp/types.d.ts +27 -0
  796. package/vendor/agent-cli/dist/src/mcp/types.d.ts.map +1 -0
  797. package/vendor/agent-cli/dist/src/mcp/types.js +2 -0
  798. package/vendor/agent-cli/dist/src/mcp/types.js.map +1 -0
  799. package/vendor/agent-cli/dist/src/protocol/input.d.ts +21 -0
  800. package/vendor/agent-cli/dist/src/protocol/input.d.ts.map +1 -0
  801. package/vendor/agent-cli/dist/src/protocol/input.js +95 -0
  802. package/vendor/agent-cli/dist/src/protocol/input.js.map +1 -0
  803. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts +58 -0
  804. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts.map +1 -0
  805. package/vendor/agent-cli/dist/src/protocol/link/channel.js +337 -0
  806. package/vendor/agent-cli/dist/src/protocol/link/channel.js.map +1 -0
  807. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts +13 -0
  808. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts.map +1 -0
  809. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js +27 -0
  810. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js.map +1 -0
  811. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts +57 -0
  812. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts.map +1 -0
  813. package/vendor/agent-cli/dist/src/protocol/link/envelope.js +93 -0
  814. package/vendor/agent-cli/dist/src/protocol/link/envelope.js.map +1 -0
  815. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts +28 -0
  816. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts.map +1 -0
  817. package/vendor/agent-cli/dist/src/protocol/link/liveness.js +86 -0
  818. package/vendor/agent-cli/dist/src/protocol/link/liveness.js.map +1 -0
  819. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts +14 -0
  820. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts.map +1 -0
  821. package/vendor/agent-cli/dist/src/protocol/link/middleware.js +40 -0
  822. package/vendor/agent-cli/dist/src/protocol/link/middleware.js.map +1 -0
  823. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts +31 -0
  824. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts.map +1 -0
  825. package/vendor/agent-cli/dist/src/protocol/link/rpc.js +90 -0
  826. package/vendor/agent-cli/dist/src/protocol/link/rpc.js.map +1 -0
  827. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts +32 -0
  828. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts.map +1 -0
  829. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js +106 -0
  830. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js.map +1 -0
  831. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts +509 -0
  832. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts.map +1 -0
  833. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js +131 -0
  834. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js.map +1 -0
  835. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +351 -0
  836. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -0
  837. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +103 -0
  838. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -0
  839. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts +9 -0
  840. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts.map +1 -0
  841. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js +58 -0
  842. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js.map +1 -0
  843. package/vendor/agent-cli/dist/src/security/command-parse.d.ts +21 -0
  844. package/vendor/agent-cli/dist/src/security/command-parse.d.ts.map +1 -0
  845. package/vendor/agent-cli/dist/src/security/command-parse.js +395 -0
  846. package/vendor/agent-cli/dist/src/security/command-parse.js.map +1 -0
  847. package/vendor/agent-cli/dist/src/security/command-translate.d.ts +30 -0
  848. package/vendor/agent-cli/dist/src/security/command-translate.d.ts.map +1 -0
  849. package/vendor/agent-cli/dist/src/security/command-translate.js +161 -0
  850. package/vendor/agent-cli/dist/src/security/command-translate.js.map +1 -0
  851. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts +18 -0
  852. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts.map +1 -0
  853. package/vendor/agent-cli/dist/src/security/context-write-policy.js +121 -0
  854. package/vendor/agent-cli/dist/src/security/context-write-policy.js.map +1 -0
  855. package/vendor/agent-cli/dist/src/security/guard.d.ts +41 -0
  856. package/vendor/agent-cli/dist/src/security/guard.d.ts.map +1 -0
  857. package/vendor/agent-cli/dist/src/security/guard.js +154 -0
  858. package/vendor/agent-cli/dist/src/security/guard.js.map +1 -0
  859. package/vendor/agent-cli/dist/src/security/mount-table.d.ts +47 -0
  860. package/vendor/agent-cli/dist/src/security/mount-table.d.ts.map +1 -0
  861. package/vendor/agent-cli/dist/src/security/mount-table.js +164 -0
  862. package/vendor/agent-cli/dist/src/security/mount-table.js.map +1 -0
  863. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts +23 -0
  864. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts.map +1 -0
  865. package/vendor/agent-cli/dist/src/security/sandbox-path.js +110 -0
  866. package/vendor/agent-cli/dist/src/security/sandbox-path.js.map +1 -0
  867. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts +5 -0
  868. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts.map +1 -0
  869. package/vendor/agent-cli/dist/src/security/tool-run-owner.js +16 -0
  870. package/vendor/agent-cli/dist/src/security/tool-run-owner.js.map +1 -0
  871. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts +16 -0
  872. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts.map +1 -0
  873. package/vendor/agent-cli/dist/src/security/tool-scope.js +88 -0
  874. package/vendor/agent-cli/dist/src/security/tool-scope.js.map +1 -0
  875. package/vendor/agent-cli/dist/src/session/client.d.ts +116 -0
  876. package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -0
  877. package/vendor/agent-cli/dist/src/session/client.js +376 -0
  878. package/vendor/agent-cli/dist/src/session/client.js.map +1 -0
  879. package/vendor/agent-cli/dist/src/session/custom-context.d.ts +6 -0
  880. package/vendor/agent-cli/dist/src/session/custom-context.d.ts.map +1 -0
  881. package/vendor/agent-cli/dist/src/session/custom-context.js +100 -0
  882. package/vendor/agent-cli/dist/src/session/custom-context.js.map +1 -0
  883. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts +38 -0
  884. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts.map +1 -0
  885. package/vendor/agent-cli/dist/src/session/engine-decide.js +87 -0
  886. package/vendor/agent-cli/dist/src/session/engine-decide.js.map +1 -0
  887. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts +4 -0
  888. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts.map +1 -0
  889. package/vendor/agent-cli/dist/src/session/execution-settlement.js +15 -0
  890. package/vendor/agent-cli/dist/src/session/execution-settlement.js.map +1 -0
  891. package/vendor/agent-cli/dist/src/session/link-config.d.ts +13 -0
  892. package/vendor/agent-cli/dist/src/session/link-config.d.ts.map +1 -0
  893. package/vendor/agent-cli/dist/src/session/link-config.js +29 -0
  894. package/vendor/agent-cli/dist/src/session/link-config.js.map +1 -0
  895. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts +30 -0
  896. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts.map +1 -0
  897. package/vendor/agent-cli/dist/src/session/link-outcome.js +67 -0
  898. package/vendor/agent-cli/dist/src/session/link-outcome.js.map +1 -0
  899. package/vendor/agent-cli/dist/src/session/link-session.d.ts +76 -0
  900. package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -0
  901. package/vendor/agent-cli/dist/src/session/link-session.js +412 -0
  902. package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -0
  903. package/vendor/agent-cli/dist/src/session/local-execution.d.ts +28 -0
  904. package/vendor/agent-cli/dist/src/session/local-execution.d.ts.map +1 -0
  905. package/vendor/agent-cli/dist/src/session/local-execution.js +119 -0
  906. package/vendor/agent-cli/dist/src/session/local-execution.js.map +1 -0
  907. package/vendor/agent-cli/dist/src/session/member-tools.d.ts +22 -0
  908. package/vendor/agent-cli/dist/src/session/member-tools.d.ts.map +1 -0
  909. package/vendor/agent-cli/dist/src/session/member-tools.js +72 -0
  910. package/vendor/agent-cli/dist/src/session/member-tools.js.map +1 -0
  911. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts +7 -0
  912. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts.map +1 -0
  913. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js +30 -0
  914. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js.map +1 -0
  915. package/vendor/agent-cli/dist/src/session/process-environment.d.ts +3 -0
  916. package/vendor/agent-cli/dist/src/session/process-environment.d.ts.map +1 -0
  917. package/vendor/agent-cli/dist/src/session/process-environment.js +22 -0
  918. package/vendor/agent-cli/dist/src/session/process-environment.js.map +1 -0
  919. package/vendor/agent-cli/dist/src/session/process-request.d.ts +36 -0
  920. package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -0
  921. package/vendor/agent-cli/dist/src/session/process-request.js +494 -0
  922. package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -0
  923. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts +8 -0
  924. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts.map +1 -0
  925. package/vendor/agent-cli/dist/src/session/reference-tools.js +34 -0
  926. package/vendor/agent-cli/dist/src/session/reference-tools.js.map +1 -0
  927. package/vendor/agent-cli/dist/src/session/run-events.d.ts +81 -0
  928. package/vendor/agent-cli/dist/src/session/run-events.d.ts.map +1 -0
  929. package/vendor/agent-cli/dist/src/session/run-events.js +160 -0
  930. package/vendor/agent-cli/dist/src/session/run-events.js.map +1 -0
  931. package/vendor/agent-cli/dist/src/session/run-setup.d.ts +76 -0
  932. package/vendor/agent-cli/dist/src/session/run-setup.d.ts.map +1 -0
  933. package/vendor/agent-cli/dist/src/session/run-setup.js +273 -0
  934. package/vendor/agent-cli/dist/src/session/run-setup.js.map +1 -0
  935. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +41 -0
  936. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -0
  937. package/vendor/agent-cli/dist/src/session/run-start-body.js +64 -0
  938. package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -0
  939. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts +17 -0
  940. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts.map +1 -0
  941. package/vendor/agent-cli/dist/src/session/team-persistence.js +75 -0
  942. package/vendor/agent-cli/dist/src/session/team-persistence.js.map +1 -0
  943. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts +37 -0
  944. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts.map +1 -0
  945. package/vendor/agent-cli/dist/src/session/tool-scheduler.js +232 -0
  946. package/vendor/agent-cli/dist/src/session/tool-scheduler.js.map +1 -0
  947. package/vendor/agent-cli/dist/src/session/user-choice.d.ts +5 -0
  948. package/vendor/agent-cli/dist/src/session/user-choice.d.ts.map +1 -0
  949. package/vendor/agent-cli/dist/src/session/user-choice.js +80 -0
  950. package/vendor/agent-cli/dist/src/session/user-choice.js.map +1 -0
  951. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts +31 -0
  952. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts.map +1 -0
  953. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js +104 -0
  954. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js.map +1 -0
  955. package/vendor/agent-cli/dist/src/shared/app-id.d.ts +13 -0
  956. package/vendor/agent-cli/dist/src/shared/app-id.d.ts.map +1 -0
  957. package/vendor/agent-cli/dist/src/shared/app-id.js +25 -0
  958. package/vendor/agent-cli/dist/src/shared/app-id.js.map +1 -0
  959. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts +13 -0
  960. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts.map +1 -0
  961. package/vendor/agent-cli/dist/src/shared/auth-headers.js +16 -0
  962. package/vendor/agent-cli/dist/src/shared/auth-headers.js.map +1 -0
  963. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts +3 -0
  964. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts.map +1 -0
  965. package/vendor/agent-cli/dist/src/shared/cli-version.js +22 -0
  966. package/vendor/agent-cli/dist/src/shared/cli-version.js.map +1 -0
  967. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts +14 -0
  968. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts.map +1 -0
  969. package/vendor/agent-cli/dist/src/shared/error-detail.js +29 -0
  970. package/vendor/agent-cli/dist/src/shared/error-detail.js.map +1 -0
  971. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts +36 -0
  972. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts.map +1 -0
  973. package/vendor/agent-cli/dist/src/shared/output-guard.js +94 -0
  974. package/vendor/agent-cli/dist/src/shared/output-guard.js.map +1 -0
  975. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts +3 -0
  976. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts.map +1 -0
  977. package/vendor/agent-cli/dist/src/shared/process-cwd.js +11 -0
  978. package/vendor/agent-cli/dist/src/shared/process-cwd.js.map +1 -0
  979. package/vendor/agent-cli/dist/src/shared/process-types.d.ts +60 -0
  980. package/vendor/agent-cli/dist/src/shared/process-types.d.ts.map +1 -0
  981. package/vendor/agent-cli/dist/src/shared/process-types.js +10 -0
  982. package/vendor/agent-cli/dist/src/shared/process-types.js.map +1 -0
  983. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts +7 -0
  984. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts.map +1 -0
  985. package/vendor/agent-cli/dist/src/shared/server-headers.js +113 -0
  986. package/vendor/agent-cli/dist/src/shared/server-headers.js.map +1 -0
  987. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts +47 -0
  988. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts.map +1 -0
  989. package/vendor/agent-cli/dist/src/shared/shell-runtime.js +210 -0
  990. package/vendor/agent-cli/dist/src/shared/shell-runtime.js.map +1 -0
  991. package/vendor/agent-cli/dist/src/shared/types.d.ts +458 -0
  992. package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -0
  993. package/vendor/agent-cli/dist/src/shared/types.js +2 -0
  994. package/vendor/agent-cli/dist/src/shared/types.js.map +1 -0
  995. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts +22 -0
  996. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts.map +1 -0
  997. package/vendor/agent-cli/dist/src/shared/user-choice.js +2 -0
  998. package/vendor/agent-cli/dist/src/shared/user-choice.js.map +1 -0
  999. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts +9 -0
  1000. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts.map +1 -0
  1001. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js +85 -0
  1002. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js.map +1 -0
  1003. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts +30 -0
  1004. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts.map +1 -0
  1005. package/vendor/agent-cli/dist/src/tools/command-executor.js +96 -0
  1006. package/vendor/agent-cli/dist/src/tools/command-executor.js.map +1 -0
  1007. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts +16 -0
  1008. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts.map +1 -0
  1009. package/vendor/agent-cli/dist/src/tools/context-program-publish.js +104 -0
  1010. package/vendor/agent-cli/dist/src/tools/context-program-publish.js.map +1 -0
  1011. package/vendor/agent-cli/dist/src/tools/context-program.d.ts +21 -0
  1012. package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -0
  1013. package/vendor/agent-cli/dist/src/tools/context-program.js +207 -0
  1014. package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -0
  1015. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts +61 -0
  1016. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts.map +1 -0
  1017. package/vendor/agent-cli/dist/src/tools/file-ops.js +477 -0
  1018. package/vendor/agent-cli/dist/src/tools/file-ops.js.map +1 -0
  1019. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts +58 -0
  1020. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts.map +1 -0
  1021. package/vendor/agent-cli/dist/src/tools/local-hands.js +322 -0
  1022. package/vendor/agent-cli/dist/src/tools/local-hands.js.map +1 -0
  1023. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts +24 -0
  1024. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts.map +1 -0
  1025. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js +160 -0
  1026. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js.map +1 -0
  1027. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts +66 -0
  1028. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts.map +1 -0
  1029. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js +65 -0
  1030. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js.map +1 -0
  1031. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts +29 -0
  1032. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts.map +1 -0
  1033. package/vendor/agent-cli/dist/src/tools/tool-timeout.js +88 -0
  1034. package/vendor/agent-cli/dist/src/tools/tool-timeout.js.map +1 -0
  1035. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts +42 -0
  1036. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts.map +1 -0
  1037. package/vendor/agent-cli/dist/src/tools/write-guard.js +34 -0
  1038. package/vendor/agent-cli/dist/src/tools/write-guard.js.map +1 -0
  1039. package/vendor/agent-cli/package.json +29 -0
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var finite=__name((value,label)=>{if(!Number.isFinite(value))throw new TypeError(`${label} must be finite`);return value},"finite");var delta=__name(value=>{if(finite(value,"delta")<0)throw new RangeError("delta must be nonnegative");return value},"delta");function gridFrames(image,{frameWidth,frameHeight,count,margin=0,spacing=0}={}){const width=image.naturalWidth||image.width,height=image.naturalHeight||image.height;if(![frameWidth,frameHeight].every(value=>Number.isInteger(value)&&value>0)||![margin,spacing].every(value=>Number.isInteger(value)&&value>=0))throw new RangeError("Frame dimensions must be positive integers; margin/spacing nonnegative integers");const columns=Math.floor((width-margin*2+spacing)/(frameWidth+spacing));const rows=Math.floor((height-margin*2+spacing)/(frameHeight+spacing));const available=Math.max(0,columns)*Math.max(0,rows);count??=available;if(!Number.isInteger(count)||count<1||count>available)throw new RangeError("Frame count exceeds the image grid");return Array.from({length:count},(_,index)=>({x:margin+index%columns*(frameWidth+spacing),y:margin+Math.floor(index/columns)*(frameHeight+spacing),width:frameWidth,height:frameHeight}))}__name(gridFrames,"gridFrames");function createSpriteAnimation(image,{frames,fps=12,loop=true,playbackRate=1,autoplay=true,onComplete}={}){if(!frames?.length||!(fps>0)||!Number.isFinite(fps)||!(playbackRate>0)||!Number.isFinite(playbackRate))throw new RangeError("Animation needs frames, positive fps and playbackRate");for(const frame of frames)if(![frame.x,frame.y,frame.width,frame.height].every(Number.isFinite)||frame.width<=0||frame.height<=0)throw new RangeError("Invalid frame rectangle");const duration=frames.length/fps;let elapsed=0,playing=autoplay,completed=false,disposed=false;const frameIndex=__name(()=>Math.min(frames.length-1,Math.floor(elapsed*fps)),"frameIndex");return{get frameIndex(){return frameIndex()},get finished(){return completed},get playing(){return playing},update(dt){delta(dt);if(!playing||disposed||completed)return;elapsed+=dt*playbackRate;if(loop)elapsed%=duration;else if(elapsed>=duration){elapsed=duration;playing=false;completed=true;onComplete?.()}},play({restart=false}={}){if(disposed)throw new Error("Animation is disposed");if(restart||completed){elapsed=0;completed=false}playing=true},pause(){playing=false},setPlaybackRate(value){if(!(value>0)||!Number.isFinite(value))throw new RangeError("playbackRate must be positive");playbackRate=value},draw(context,x,y,options={}){if(disposed)return;const frame=frames[frameIndex()],width=options.width??frame.width,height=options.height??frame.height;context.save();try{context.translate(x,y);context.rotate(options.rotation??0);context.scale(options.flipX?-1:1,options.flipY?-1:1);context.globalAlpha*=options.alpha??1;context.drawImage(image,frame.x,frame.y,frame.width,frame.height,-(options.originX??.5)*width,-(options.originY??.5)*height,width,height)}finally{context.restore()}},dispose(){disposed=true;playing=false}}}__name(createSpriteAnimation,"createSpriteAnimation");var easing=Object.freeze({linear:__name(t=>t,"linear"),inOutQuad:__name(t=>t<.5?2*t*t:1-(-2*t+2)**2/2,"inOutQuad"),outCubic:__name(t=>1-(1-t)**3,"outCubic")});function createTween(target,to,{duration=.3,repeat=0,yoyo=false,ease=easing.linear,onComplete}={}){if(!(duration>0)||!Number.isFinite(duration)||!Number.isInteger(repeat)||repeat<-1)throw new RangeError("Tween duration must be positive; repeat must be -1 or a nonnegative integer");const keys=Object.keys(to),from={};if(!keys.length)throw new TypeError("Tween requires at least one property");for(const key of keys){from[key]=finite(target[key],key);finite(to[key],key)}let elapsed=0,done=false,paused=false,disposed=false;return{get finished(){return done},update(dt){delta(dt);if(done||paused||disposed)return;elapsed+=dt;const cycles=repeat===-1?Infinity:repeat+1;const atEnd=elapsed>=duration*cycles;const cycle=atEnd?cycles-1:Math.floor(elapsed/duration);let fraction=atEnd?1:elapsed/duration-cycle;if(yoyo&&cycle%2===1)fraction=1-fraction;const value=finite(ease(fraction),"eased progress");for(const key of keys)target[key]=from[key]+(to[key]-from[key])*value;if(atEnd){done=true;onComplete?.()}},pause(){paused=true},resume(){paused=false},dispose(){disposed=true}}}__name(createTween,"createTween");function createParticleSystem({maxParticles=256,random=Math.random}={}){if(!Number.isInteger(maxParticles)||maxParticles<1)throw new RangeError("maxParticles must be a positive integer");const particles=[],emitters=new Set;let disposed=false;const range=__name((value,fallback,label,minimum=-Infinity)=>{const pair=Array.isArray(value)?value:[value??fallback,value??fallback];if(pair.length!==2||!pair.every(Number.isFinite)||pair[0]<minimum||pair[1]<pair[0])throw new RangeError(`Invalid particle ${label} range`);return pair},"range");function recipe(options){return{...options,x:finite(options.x??0,"x"),y:finite(options.y??0,"y"),lifetime:range(options.lifetime,.5,"lifetime",Number.EPSILON),speed:range(options.speed,50,"speed",0),angle:range(options.angle,0,"angle"),radius:range(options.radius,3,"radius",0),gravity:finite(options.gravity??0,"gravity")}}__name(recipe,"recipe");const pick=__name(pair=>pair[0]+(pair[1]-pair[0])*random(),"pick");function spawn(r,age=0){if(particles.length>=maxParticles)return false;const lifetime=pick(r.lifetime);if(age>=lifetime)return false;const speed=pick(r.speed),angle=pick(r.angle),vx=Math.cos(angle)*speed,initialVy=Math.sin(angle)*speed;particles.push({x:r.x+vx*age,y:r.y+initialVy*age+.5*r.gravity*age**2,vx,vy:initialVy+r.gravity*age,age,lifetime,radius:pick(r.radius),gravity:r.gravity,color:r.color??"#ffffff",image:r.image,fade:r.fade!==false});return true}__name(spawn,"spawn");function emit(options={}){if(disposed)throw new Error("Particle system is disposed");const r=recipe(options),count=options.count??1;if(!Number.isInteger(count)||count<0)throw new RangeError("Particle count must be a nonnegative integer");let created=0;for(let i=0,n=Math.min(count,maxParticles-particles.length);i<n;i++)if(spawn(r))created++;return created}__name(emit,"emit");return{emit,get count(){return particles.length},startEmitter(options,{rate=20,duration=Infinity}={}){if(disposed)throw new Error("Particle system is disposed");if(!(rate>0)||!Number.isFinite(rate)||!(duration>0))throw new RangeError("Emitter rate and duration must be positive");const emitter={recipe:recipe(options),rate,duration,elapsed:0,sequence:0};emitters.add(emitter);return{dispose(){emitters.delete(emitter)}}},update(dt){delta(dt);if(disposed)return;for(let i=particles.length-1;i>=0;i--){const p=particles[i];p.age+=dt;if(p.age>=p.lifetime){particles.splice(i,1);continue}p.x+=p.vx*dt;p.y+=p.vy*dt+.5*p.gravity*dt**2;p.vy+=p.gravity*dt}for(const e of emitters){const elapsed=e.elapsed+dt,end=Math.min(elapsed,e.duration),last=Math.floor(end*e.rate+1e-9);const first=Math.max(e.sequence+1,Math.floor((elapsed-e.recipe.lifetime[1])*e.rate)+1);for(let seq=first;seq<=last&&particles.length<maxParticles;seq++)spawn(e.recipe,elapsed-seq/e.rate);e.sequence=last;e.elapsed=elapsed;if(elapsed>=e.duration)emitters.delete(e)}},draw(context){context.save();try{const alpha=context.globalAlpha;for(const p of particles){context.globalAlpha=alpha*(p.fade?Math.max(0,1-p.age/p.lifetime):1);if(p.image)context.drawImage(p.image,p.x-p.radius,p.y-p.radius,p.radius*2,p.radius*2);else{context.fillStyle=p.color;context.beginPath();context.arc(p.x,p.y,p.radius,0,Math.PI*2);context.fill()}}}finally{context.restore()}},clear(){particles.length=0;emitters.clear()},dispose(){disposed=true;particles.length=0;emitters.clear()}}}__name(createParticleSystem,"createParticleSystem");function createCameraShake({duration=.15,amplitude=6,frequency=30,seed=0}={}){if(!(duration>0)||!Number.isFinite(duration)||!Number.isFinite(amplitude)||amplitude<0||!(frequency>0)||!Number.isFinite(frequency))throw new RangeError("Invalid camera shake options");let elapsed=0,disposed=false;const noise=__name(index=>{const x=Math.sin(index*127.1+seed*311.7)*43758.5453;return(x-Math.floor(x))*2-1},"noise");return{update(dt){delta(dt);elapsed=Math.min(duration,elapsed+dt)},offset(){if(disposed||elapsed>=duration)return{x:0,y:0};const index=Math.floor(elapsed*frequency),gain=amplitude*(1-elapsed/duration);return{x:noise(index*2)*gain,y:noise(index*2+1)*gain}},get finished(){return disposed||elapsed>=duration},dispose(){disposed=true}}}__name(createCameraShake,"createCameraShake");export{createCameraShake,createParticleSystem,createSpriteAnimation,createTween,easing,gridFrames};
@@ -0,0 +1,36 @@
1
+ import type * as Three from 'three';
2
+ import type { GLTF } from 'three/addons/loaders/GLTFLoader.js';
3
+ export type GlbLodLevel = 0 | 1 | 2;
4
+ export type GlbTextureVariant = 'astc';
5
+ export interface GlbLoadOptions {
6
+ /** 分级档位,默认 0;目标档加载失败自动回退 0 档。 */
7
+ lod?: GlbLodLevel;
8
+ /** 中断加载:reject,底层请求结果被丢弃。 */
9
+ signal?: AbortSignal;
10
+ }
11
+ /**
12
+ * 加载模型 GLB 的标准入口(资产库与 AIGC 模型通用)。
13
+ * 内部完成选档回退、压缩贴图变体探测、KTX2 接线与 PNG 回退,调用方无需拼 URL 或接线。
14
+ */
15
+ export function loadGlbModel<T = GLTF>(
16
+ THREE: typeof Three,
17
+ renderer: Three.WebGLRenderer,
18
+ url: string,
19
+ options?: GlbLoadOptions,
20
+ ): Promise<T>;
21
+ /** 进阶:0 档原样返回,1/2 档在扩展名前插入 `_L1`/`_L2`;data:/blob: 与非模型路径原样返回。传入的 path 必须是 0 档基线路径。 */
22
+ export function withGlbLod(path: string, level: GlbLodLevel): string;
23
+ /** 进阶:按 WebGL 扩展选压缩贴图变体;都没有时返回 null(留在 PNG)。 */
24
+ export function pickGlbTextureVariant(gl: WebGLRenderingContext | WebGL2RenderingContext): GlbTextureVariant | null;
25
+ /** 进阶:生成把库模型外部 PNG 改写为 KTX2 sidecar 的 LoadingManager URL 改写函数。 */
26
+ export function glbCompressedTextureUrlModifier(variant: GlbTextureVariant): (url: string) => string;
27
+
28
+ import type { AssetUrlOptions } from './assets.mjs';
29
+ export interface SceneGlbLoadOptions extends GlbLoadOptions, AssetUrlOptions {}
30
+ export type SceneGlbLoader = <T = GLTF>(THREE: typeof Three, renderer: Three.WebGLRenderer, path: string, options?: SceneGlbLoadOptions) => Promise<T>;
31
+ /** Map `/Game/...` scene paths to the configured CDN while preserving HTTP(S) URLs. */
32
+ export function resolveGlbUrl(path: string, options?: AssetUrlOptions): string;
33
+ /** Create a scene loader; the injected function receives the resolved URL and GLB options. */
34
+ export function createSceneGlbLoader(loadModel?: typeof loadGlbModel): SceneGlbLoader;
35
+ /** Resolve a raw scene-editor `/Game/...` path and load it through the standard GLB pipeline. */
36
+ export const loadSceneGlb: SceneGlbLoader;
@@ -0,0 +1,359 @@
1
+ /**
2
+ * GLB 模型的分级档位与压缩贴图工具。资产库模型形如
3
+ * `/Glb/Game/<...>/<Name>[_L1|_L2].glb`;拆分式的贴图拆在以 GLB basename 命名的目录中,
4
+ * 压缩变体在其兄弟目录 `<同名>_<variant>/`(不是同级文件,详见 `derivePathnameSidecar`)。
5
+ *
6
+ * 加载入口是 `loadGlbModel`(选档 + 压缩贴图 + 回退一体编排);`withGlbLod` /
7
+ * `pickGlbTextureVariant` / `glbCompressedTextureUrlModifier` 是进阶导出,供需要自定义
8
+ * 加载管线的调用方使用,普通玩法不需要接触。
9
+ *
10
+ * **不假设某个 GLB 是一体式(贴图内嵌)还是拆分式(外部 PNG + KTX2 sidecar),不假设
11
+ * 它带不带降档,也不按来源(资产库 / AIGC)分支**:两类模型都可能是一体式或拆分式、
12
+ * 带或不带降档,本模块一视同仁。贴图形态在加载时由 glTF 自身决定——内嵌贴图经 loader
13
+ * 变成 blob: URL、天然跳过改写;外部 PNG 才按 sidecar 约定尝试 KTX2。档位按命名推导后
14
+ * 逐档尝试,目标档缺失自动回退 0 档基线,调用方无需关心某个档位或形态是否存在。
15
+ *
16
+ * 本模块只做字符串推导、WebGL 扩展探测与 GLB 加载编排,导入时无副作用(不碰 document / WebGL / 网络,
17
+ * 也不静态导入 three —— three 的构建产物在模块作用域会触碰 window,违反 runtime 导入约定;
18
+ * three addons 在 `loadGlbModel` 首次调用时才动态加载)。
19
+ * 路径的 CDN 拼接与 `/Glb` 挂载点归一化由 `tools/assets.mjs` 的 `resolveAssetUrl` 负责;
20
+ * 配置资源字段在 Vite 导入阶段已归一化,业务把字段值直接传给 `loadGlbModel` 即可。
21
+ */
22
+
23
+ import { resolveAssetUrl } from './assets.mjs';
24
+
25
+ const MODEL_EXT = /\.(?:glb|gltf)$/i;
26
+ const IMAGE_EXT = /\.(?:png|jpe?g)$/i;
27
+
28
+ /** 拆出 pathname 与 `?`/`#` 尾巴,避免带查询参数时误判后缀。 */
29
+ function splitPath(value) {
30
+ const parts = String(value ?? '').match(/^([^?#]*)([?#].*)?$/);
31
+ return parts ? { pathname: parts[1], rest: parts[2] ?? '' } : { pathname: '', rest: '' };
32
+ }
33
+
34
+ /**
35
+ * 已知的资源托管挂载根。只用于 sidecar 推导的边界保护:目录若是挂载根本身
36
+ * (如 `/Glb/Game`),说明贴图不在任何以模型名命名的 sidecar 目录里,不能改写。
37
+ */
38
+ const LIBRARY_MOUNTS = ['/Glb/Game/', 'Glb/Game/', '/Game/', 'Game/'];
39
+
40
+ /**
41
+ * 切换模型 GLB 的分级档位:0 档原样返回,1/2 档在扩展名前插入 `_L1`/`_L2`。
42
+ * 对任何模型路径(资产库或 AIGC)统一套用——两类模型都可能带降档;
43
+ * data:/blob: 与非模型路径原样返回。
44
+ *
45
+ * **调用方必须传入 0 档(基线)路径**——配置字段、检索结果、AIGC 回调路径都是基线路径,
46
+ * 这是唯一契约,本函数不检测也不剥离已有后缀。对一个已带 `_L1`/`_L2` 的路径再调用本函数
47
+ * 会在结果里叠出两段后缀(如 `x_L1_L2.glb`),这是误用,不是需要兼容的输入形态:模型的
48
+ * 真实文件名可能本来就以 `_L1`/`_L2` 结尾(与分级无关的巧合命名),若本函数尝试剥离,
49
+ * 反而会把这类正常基线路径错误改写成不存在的文件。
50
+ *
51
+ * 只做命名推导,**不保证目标档位存在**:0 档是每个模型都有的基线,降级档个别模型可能缺
52
+ * (例如未命中导出母材质白名单的模型)。调用方选了非 0 档就要处理加载失败并回退 0 档;
53
+ * 走 `loadGlbModel` 时该回退是自动的。
54
+ */
55
+ export function withGlbLod(path, level) {
56
+ if (level !== 0 && level !== 1 && level !== 2) {
57
+ throw new TypeError(`withGlbLod: level must be 0, 1 or 2 (received ${JSON.stringify(level)})`);
58
+ }
59
+ const raw = String(path ?? '');
60
+ if (level === 0) return raw;
61
+ if (!raw || /^(?:data:|blob:)/i.test(raw)) return raw;
62
+ const { pathname, rest } = splitPath(raw);
63
+ if (!pathname || !MODEL_EXT.test(pathname)) return raw;
64
+ const dot = pathname.lastIndexOf('.');
65
+ return `${pathname.slice(0, dot)}_L${level}${pathname.slice(dot)}${rest}`;
66
+ }
67
+
68
+ /**
69
+ * 内部推导:由外部 PNG 的 pathname 得到同级压缩贴图 KTX2 的 pathname。
70
+ *
71
+ * sidecar 约定(UE 导出):PNG 位于以 GLB basename(含分级后缀)命名的目录里,
72
+ * 压缩变体是它的兄弟目录:
73
+ * `<Name>_L1/<Image>_L1.png` → `<Name>_L1_astc/<Image>_L1.ktx2`
74
+ *
75
+ * 这些 KTX2 **不被 GLB JSON 引用**(也没有 KHR_texture_basisu),所以只能靠 URL 改写取到。
76
+ * 非图片、无目录段,或目录就是已知的资源托管根(把托管根本身当模型名会拼出
77
+ * `/Glb/Game_astc/` 这类垃圾路径)时返回 null。不导出:调用方用
78
+ * `glbCompressedTextureUrlModifier` 即可,不需要自己拼 sidecar 路径。
79
+ */
80
+ function derivePathnameSidecar(pathname, variant) {
81
+ if (!IMAGE_EXT.test(pathname)) return null;
82
+ const slash = pathname.lastIndexOf('/');
83
+ if (slash <= 0) return null;
84
+ const dir = pathname.slice(0, slash);
85
+ // 目录若是托管根本身(如 `/Glb/Game`),说明贴图不在任何以模型名命名的 sidecar 目录里。
86
+ if (LIBRARY_MOUNTS.some(mount => `${dir}/` === mount)) return null;
87
+ const file = pathname.slice(slash + 1).replace(IMAGE_EXT, '');
88
+ return `${dir}_${variant}/${file}.ktx2`;
89
+ }
90
+
91
+ function toGlbCompressedTextureUrl(pngUrl, variant) {
92
+ if (variant !== 'astc') {
93
+ throw new TypeError(`toGlbCompressedTextureUrl: variant must be 'astc' (received ${JSON.stringify(variant)})`);
94
+ }
95
+ const raw = String(pngUrl ?? '').trim();
96
+ if (!raw || /^(?:data:|blob:)/i.test(raw)) return null;
97
+
98
+ // 绝对/协议相对 URL:挂载点判断必须基于 URL.pathname,不能是 splitPath 拆出的、仍带
99
+ // scheme+host 的整段字符串(那样 dir 永远不等于任何挂载点前缀,边界检查形同虚设)。
100
+ // 改写后用 url.href 拼回,search/hash 由 URL 对象自动保留。协议相对 `//host/...` 没有
101
+ // scheme,`new URL` 无 base 会抛错,按既有 rewriteLibraryGlbMount 的约定安全地原样放过
102
+ // (回退 PNG),不落回下面的相对路径分支——那样会把 `//host` 错当成路径的一部分。
103
+ if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(raw)) {
104
+ let url;
105
+ try {
106
+ url = new URL(raw);
107
+ } catch {
108
+ return null;
109
+ }
110
+ const newPathname = derivePathnameSidecar(url.pathname, variant);
111
+ if (newPathname === null) return null;
112
+ url.pathname = newPathname;
113
+ return url.href;
114
+ }
115
+
116
+ const { pathname, rest } = splitPath(raw);
117
+ const newPathname = derivePathnameSidecar(pathname, variant);
118
+ return newPathname === null ? null : `${newPathname}${rest}`;
119
+ }
120
+
121
+ /** 是否支持 ASTC 压缩贴图。 */
122
+ function hasAstc(gl) {
123
+ return Boolean(
124
+ gl &&
125
+ !gl.isContextLost?.() &&
126
+ (gl.getExtension('WEBGL_compressed_texture_astc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc')),
127
+ );
128
+ }
129
+
130
+ /**
131
+ * 选压缩贴图变体:有 ASTC 扩展用 `astc`,否则返回 null(留在 PNG,含仅支持 S3TC/DXT 的 PC 浏览器)。
132
+ *
133
+ * 判据是 WebGL 扩展探测,而不是 userAgent。无 ASTC 时不尝试 `_dxt` sidecar——PC 等平台直接用 GLB
134
+ * 引用的 PNG。调用方不指定格式,只决定是否启用这条可选优化。
135
+ *
136
+ * 返回 null 时不要挂 URL 改写:GLB 自带的 PNG 就是兼容路径。
137
+ */
138
+ export function pickGlbTextureVariant(gl) {
139
+ if (hasAstc(gl)) return 'astc';
140
+ return null;
141
+ }
142
+
143
+ /**
144
+ * 生成 Three LoadingManager 的 URL 改写函数:把外部 PNG/JPEG 贴图按 sidecar 约定改写成 KTX2。
145
+ *
146
+ * **不区分来源,也不假设贴图形态**:
147
+ * - 一体式 GLB(贴图内嵌,无论资产库还是 AIGC):GLTFLoader 把 bufferView 转成 blob:
148
+ * URL,本函数原样放过——一体式永远不会被改写,也无需任何分支;
149
+ * - 拆分式 GLB:`images[].uri` 指向外部 PNG,按 `<模型目录>/<图>.png →
150
+ * <模型目录>_<variant>/<图>.ktx2` 改写;
151
+ * - 改写后的 KTX2 不存在(404)或解码失败时,**必须回退原 PNG 重新加载**——某棵 GLB
152
+ * 树有没有 sidecar 无法从 URL 判断,只能靠加载结果,这是调用方的硬性义务。
153
+ *
154
+ * **必须挂在本次 GLB 加载专用的 LoadingManager 上**(`new GLTFLoader(new THREE.LoadingManager())`)。
155
+ * 本函数不再按挂载点过滤来源:挂到共享或全局 manager 会把流经它的无关外部图片一并改写,
156
+ * 导致那些图片 404。专用 manager 把改写的作用域限制在这一次模型加载内。
157
+ *
158
+ * 改写后的 KTX2 需要 Three 的 KTX2Loader 才能解析;没接 KTX2Loader 时不要挂本改写函数。
159
+ */
160
+ export function glbCompressedTextureUrlModifier(variant) {
161
+ return (url) => toGlbCompressedTextureUrl(String(url ?? ''), variant) ?? String(url ?? '');
162
+ }
163
+
164
+ /**
165
+ * 让 loadAsync 支持 AbortSignal:signal 中断时整体 reject,底层请求结果被丢弃;
166
+ * 已中断的 signal 不会发起加载。
167
+ */
168
+ function abortableLoad(start, signal) {
169
+ if (!signal) return start();
170
+ const abortError = () => signal.reason ?? new DOMException('The operation was aborted.', 'AbortError');
171
+ if (signal.aborted) return Promise.reject(abortError());
172
+ return new Promise((resolve, reject) => {
173
+ const onAbort = () => reject(abortError());
174
+ signal.addEventListener('abort', onAbort, { once: true });
175
+ let promise;
176
+ try {
177
+ promise = start();
178
+ } catch (error) {
179
+ signal.removeEventListener('abort', onAbort);
180
+ reject(error);
181
+ return;
182
+ }
183
+ promise.then(
184
+ (value) => { signal.removeEventListener('abort', onAbort); resolve(value); },
185
+ (error) => { signal.removeEventListener('abort', onAbort); reject(error); },
186
+ );
187
+ });
188
+ }
189
+
190
+ /**
191
+ * 抑制 GLTFLoader 内部对「贴图加载失败」的无条件 console.error。
192
+ *
193
+ * 起因:`GLTFLoader.loadImageSource` 失败时会在库自身代码里无条件
194
+ * `console.error('THREE.GLTFLoader: Couldn\'t load texture', uri)` 再重新抛出,没有任何
195
+ * 选项能关闭;而本 runtime 的 `platform.mjs` 会把 `console.error` 计入 `runtime-result`
196
+ * 评分(触发即判定失败)。KTX2 sidecar 是否存在无法预先判断,只能真的尝一次——所以这个
197
+ * 失败是本函数已知、预期、随后会自动回退原 PNG 的可恢复失败,不该被当作运行错误上报。
198
+ *
199
+ * 用宽松的前缀+关键词匹配(而不是逐字匹配 Three 的固定文案):三方库版本升级时措辞可能
200
+ * 改,逐字匹配会静默失效、且不会有任何提示;`THREE.` 前缀是库自身贯穿所有模块的日志
201
+ * 惯例,不太可能被去掉,比措辞本身更稳。
202
+ *
203
+ * 并发安全分两层,缺一不可:
204
+ * - 引用计数:多个 `loadGlbModel` 可能并发加载,先结束的那次不能提前卸掉仍在使用的包装,
205
+ * 只有计数归零才收尾。包装本身按 depth 判定是否过滤,归零后即使仍留在链上也自动放行。
206
+ * - 还原前先比较再赋值:抑制窗口内若有别的模块(典型是 `platform.mjs` 的日志采集)在本
207
+ * 包装之上又装了一层,无条件 `console.error = <进入时的值>` 会把那一层摘掉,使
208
+ * `console.error` 采集静默失效且没有任何提示。只在 `console.error` 仍停在本包装这一层
209
+ * 时才还原,否则保留整条链路不动。
210
+ */
211
+ let gltfTextureErrorSuppressionDepth = 0;
212
+ let gltfTextureErrorWrapper = null;
213
+ let consoleErrorBeforeSuppression = null;
214
+
215
+ function acquireGltfTextureErrorSuppression() {
216
+ if (gltfTextureErrorWrapper === null) {
217
+ const previous = console.error;
218
+ consoleErrorBeforeSuppression = previous;
219
+ gltfTextureErrorWrapper = (...args) => {
220
+ if (gltfTextureErrorSuppressionDepth > 0 && args[0]?.startsWith?.('THREE.') && /texture/i.test(args[0])) return;
221
+ previous.apply(console, args);
222
+ };
223
+ console.error = gltfTextureErrorWrapper;
224
+ }
225
+ gltfTextureErrorSuppressionDepth++;
226
+ }
227
+
228
+ function releaseGltfTextureErrorSuppression() {
229
+ gltfTextureErrorSuppressionDepth = Math.max(0, gltfTextureErrorSuppressionDepth - 1);
230
+ if (gltfTextureErrorSuppressionDepth > 0) return;
231
+ // 只在 console.error 仍停在本包装这一层时才还原,否则会摘掉窗口内其它模块装的包装。
232
+ // 无论是否还原都清掉标记:本包装此时已随 depth 归零放行,下次调用会重新装一层并在结束时
233
+ // 正常还原,不会逐次累加——只有在窗口内被别人重新包装过时才会在链上多留一层放行包装,
234
+ // 这比丢掉别人的采集层安全得多。
235
+ if (console.error === gltfTextureErrorWrapper) console.error = consoleErrorBeforeSuppression;
236
+ gltfTextureErrorWrapper = null;
237
+ consoleErrorBeforeSuppression = null;
238
+ }
239
+
240
+ async function loadWithCompressedTextures(THREE, path, variant, renderer, signal) {
241
+ // 专用 manager:改写作用域只限于本次加载,不污染其它并发加载。
242
+ const manager = new THREE.LoadingManager();
243
+ manager.setURLModifier(glbCompressedTextureUrlModifier(variant));
244
+ // 关键接线:GLTFLoader 用 manager.getHandler(<glTF 原始 uri>) 选择贴图 loader,
245
+ // 此时 uri 仍是 `.png`(改写发生在更内层的 manager.resolveURL)。所以 handler 按
246
+ // 原始图片扩展名接管,由 KTX2Loader 自己的 FileLoader 触发改写、取到 .ktx2 并解析。
247
+ // 只挂 modifier 不挂 handler 是错的:改写出的 .ktx2 会落回图片解码器直接失败。
248
+ const [{ GLTFLoader }, { KTX2Loader }] = await Promise.all([
249
+ import('three/addons/loaders/GLTFLoader.js'),
250
+ import('three/addons/loaders/KTX2Loader.js'),
251
+ ]);
252
+ const ktx2 = new KTX2Loader(manager).detectSupport(renderer);
253
+ manager.addHandler(/\.(?:png|jpe?g)$/i, ktx2);
254
+ // UE sidecar 是原生 BC/ASTC KTX2(vkFormat 已定义),KTX2Loader 走免转码器直传路径,
255
+ // 不会初始化 worker;无需 dispose。
256
+ acquireGltfTextureErrorSuppression();
257
+ return abortableLoad(() => new GLTFLoader(manager).loadAsync(path), signal)
258
+ .finally(releaseGltfTextureErrorSuppression);
259
+ }
260
+
261
+ async function loadPlain(path, signal) {
262
+ const { GLTFLoader } = await import('three/addons/loaders/GLTFLoader.js');
263
+ return abortableLoad(() => new GLTFLoader().loadAsync(path), signal);
264
+ }
265
+
266
+ /**
267
+ * 加载模型 GLB 的标准入口,资产库与 AIGC 模型通用。
268
+ *
269
+ * 内部完成全部编排,调用方不拼接 URL:
270
+ * - 选档:`lod`(默认 0)按命名推导逐档尝试,目标档缺失自动回退 0 档——0 档是每个
271
+ * 模型都有的基线,资产库与 AIGC 模型通用,调用方无需关心某个档位是否存在。降档回退
272
+ * 发生时 `console.warn` 一条具体消息(带 lod 数值与两个 URL),供排查该模型是否真的
273
+ * 缺档还是配置传错了 lod;不影响 `runtime-result` 评分(评分只看 `console.error`)。
274
+ * - 贴图:有 ASTC 扩展时挂专用 manager 改写外部 PNG 为 `_astc` KTX2 并接 `KTX2Loader` 解析;
275
+ * 无 ASTC 时直接加载 PNG;内嵌贴图(blob:)天然跳过;KTX2 取不到或解码失败时自动回退
276
+ * 原 PNG 重载,材质不会空着,同样 `console.warn` 一条带 URL 与具体错误的消息。sidecar 是否存在无法预判,尝试期间临时抑制 GLTFLoader 对此失败
277
+ * 无条件触发的 `console.error`(该失败已知且会自动回退,不是运行错误;抑制仅对
278
+ * Three 自身「THREE.…texture…」日志生效,不影响其它错误,见
279
+ * `acquireGltfTextureErrorSuppression`)。
280
+ * - `signal` 中断时 reject(底层请求结果被丢弃,不自动 dispose 已加载内容——本调用
281
+ * 在 reject 时不返回任何 gltf)。
282
+ *
283
+ * @param THREE Three 命名空间(取 `LoadingManager`),与其它 tools 的显式注入风格一致。
284
+ * @param renderer 已创建的 `THREE.WebGLRenderer`,用于压缩贴图格式探测。
285
+ * @param url 已归一化的模型 URL(通常直接传 `configs/*.json` 的资源字段值)。
286
+ * @returns GLTFLoader 的解析结果(`.scene` / `.animations` 等由调用方使用与 dispose)。
287
+ */
288
+ export async function loadGlbModel(THREE, renderer, url, options = {}) {
289
+ if (!THREE || typeof THREE.LoadingManager !== 'function') {
290
+ throw new TypeError('loadGlbModel: THREE(含 LoadingManager 的命名空间)为必填参数');
291
+ }
292
+ if (!renderer || typeof renderer.getContext !== 'function') {
293
+ throw new TypeError('loadGlbModel: renderer(THREE.WebGLRenderer)为必填参数');
294
+ }
295
+ const { lod = 0, signal } = options;
296
+ if (lod !== 0 && lod !== 1 && lod !== 2) {
297
+ throw new TypeError(`loadGlbModel: lod 必须是 0、1 或 2(收到 ${JSON.stringify(lod)})`);
298
+ }
299
+ const raw = String(url ?? '');
300
+ const variant = pickGlbTextureVariant(renderer.getContext());
301
+ // 按 (level, path) 配对保留,供下面的警告消息引用;path 去重逻辑与之前一致(data:/blob:/
302
+ // 非模型路径在任何 level 下都返回同一个 raw,此时只会有一次尝试,不会重复请求)。
303
+ const attempts = [];
304
+ const seenPaths = new Set();
305
+ for (const level of [lod, 0]) {
306
+ const path = withGlbLod(raw, level);
307
+ if (seenPaths.has(path)) continue;
308
+ seenPaths.add(path);
309
+ attempts.push({ level, path });
310
+ }
311
+ let lastError = null;
312
+ for (let i = 0; i < attempts.length; i++) {
313
+ const { level, path } = attempts[i];
314
+ try {
315
+ if (variant) {
316
+ try {
317
+ return await loadWithCompressedTextures(THREE, path, variant, renderer, signal);
318
+ } catch (error) {
319
+ if (signal?.aborted) throw error;
320
+ // 压缩贴图环节失败(404 / 解码 / GPU 格式不支持):回退原 PNG 重载。这个失败面既可能
321
+ // 是「贴图缺 sidecar」,也可能是这个 path 本身就加载不了(下面 loadPlain 若也失败,
322
+ // 会被外层 catch 的 LOD 回退警告覆盖,两条警告连起来读就能判断具体是哪种)。
323
+ console.warn(
324
+ `[loadGlbModel] 压缩贴图(${variant})加载失败,回退到未压缩贴图:${path} — ${error?.message ?? error}`,
325
+ );
326
+ }
327
+ }
328
+ return await loadPlain(path, signal);
329
+ } catch (error) {
330
+ if (signal?.aborted) throw error;
331
+ lastError = error;
332
+ const next = attempts[i + 1];
333
+ if (next) {
334
+ console.warn(
335
+ `[loadGlbModel] lod=${level} 加载失败,回退到 lod=${next.level}:${path} → ${next.path} — ${error?.message ?? error}`,
336
+ );
337
+ }
338
+ }
339
+ }
340
+ throw lastError;
341
+ }
342
+
343
+ /** Resolve a scene editor asset path through the same CDN mapping as config resources. */
344
+ export function resolveGlbUrl(path, options = {}) {
345
+ return resolveAssetUrl(path, options);
346
+ }
347
+
348
+ /** Create a scene-path loader; injection keeps URL mapping independently testable. */
349
+ export function createSceneGlbLoader(loadModel = loadGlbModel) {
350
+ if (typeof loadModel !== 'function') throw new TypeError('createSceneGlbLoader: loadModel must be a function');
351
+ return function loadSceneGlb(THREE, renderer, path, options = {}) {
352
+ const { cdnBaseUrl, baseUrl, ...loadOptions } = options;
353
+ const url = resolveGlbUrl(path, { cdnBaseUrl, baseUrl });
354
+ return loadModel(THREE, renderer, url, loadOptions);
355
+ };
356
+ }
357
+
358
+ /** Resolve a raw scene-editor path, then load it with the standard GLB pipeline. */
359
+ export const loadSceneGlb = createSceneGlbLoader();
@@ -0,0 +1,25 @@
1
+ import assert from 'node:assert/strict';
2
+ import { createSceneGlbLoader, resolveGlbUrl } from './glb.mjs';
3
+
4
+ const cdnBaseUrl = 'https://cdn.example.test';
5
+ assert.equal(resolveGlbUrl('/Game/场景资产/树 木.glb', { cdnBaseUrl }),
6
+ 'https://cdn.example.test/Glb/Game/%E5%9C%BA%E6%99%AF%E8%B5%84%E4%BA%A7/%E6%A0%91%20%E6%9C%A8.glb');
7
+ assert.equal(resolveGlbUrl('/Game/%E6%A0%91.glb', { cdnBaseUrl }),
8
+ 'https://cdn.example.test/Glb/Game/%E6%A0%91.glb');
9
+ assert.equal(resolveGlbUrl('https://assets.example.test/Glb/Game/tree.glb?rev=2#mesh', { cdnBaseUrl }),
10
+ 'https://assets.example.test/Glb/Game/tree.glb?rev=2#mesh');
11
+ assert.equal(resolveGlbUrl('https://assets.example.test/tree.glb', { cdnBaseUrl }),
12
+ 'https://assets.example.test/tree.glb');
13
+
14
+ const calls = [];
15
+ const loadSceneGlb = createSceneGlbLoader(async (...args) => {
16
+ calls.push(args);
17
+ return { scene: 'loaded' };
18
+ });
19
+ const result = await loadSceneGlb({}, {}, '/Game/场景资产/树 木.glb', {
20
+ cdnBaseUrl,
21
+ lod: 2,
22
+ });
23
+ assert.deepEqual(result, { scene: 'loaded' });
24
+ assert.equal(calls[0][2], 'https://cdn.example.test/Glb/Game/%E5%9C%BA%E6%99%AF%E8%B5%84%E4%BA%A7/%E6%A0%91%20%E6%9C%A8.glb');
25
+ assert.deepEqual(calls[0][3], { lod: 2 });
@@ -0,0 +1,17 @@
1
+ export function canvasPoint(canvas: HTMLCanvasElement, event: Pick<PointerEvent, 'clientX' | 'clientY'>): { x: number; y: number };
2
+ export interface Keyboard {
3
+ isDown(code: string): boolean; wasPressed(code: string): boolean; wasReleased(code: string): boolean;
4
+ axis(negative: readonly string[], positive: readonly string[]): number;
5
+ endFrame(): void; clear(): void; dispose(): void;
6
+ }
7
+ export function createKeyboard(target: EventTarget, options?: { blurTarget?: EventTarget; visibilityTarget?: Document; preventDefault?: readonly string[]; ignoreEditable?: boolean }): Keyboard;
8
+ export interface JoystickValue { x: number; y: number; active: boolean }
9
+ export function createJoystick(element: HTMLElement, options?: { radius?: number; deadZone?: number; floating?: boolean; scale?: () => number; onChange?: (value: JoystickValue) => void; blurTarget?: EventTarget }): { value(): JoystickValue; reset(): void; dispose(): void };
10
+ export interface ActionInputOptions {
11
+ keyboard?: Pick<Keyboard, 'isDown'>;
12
+ actions?: Record<string, readonly string[]>;
13
+ axes?: Record<string, { negative?: readonly string[]; positive?: readonly string[] }>;
14
+ buttons?: Record<string, () => boolean>;
15
+ analog?: Record<string, () => number>;
16
+ }
17
+ export function createActionInput(options?: ActionInputOptions): { sample(): void; isDown(name: string): boolean; wasPressed(name: string): boolean; wasReleased(name: string): boolean; axis(name: string): number; reset(): void };
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function canvasPoint(canvas,event){const rect=canvas.getBoundingClientRect();if(!(rect.width>0&&rect.height>0))throw new Error("Canvas must have a visible, nonzero CSS size");return{x:(event.clientX-rect.left)*canvas.width/rect.width,y:(event.clientY-rect.top)*canvas.height/rect.height}}__name(canvasPoint,"canvasPoint");function createKeyboard(target,{blurTarget=target,visibilityTarget,preventDefault=[],ignoreEditable=true}={}){const held=new Set,pressed=new Set,released=new Set;const blocked=new Set(preventDefault);const clear=__name(()=>{for(const code of held)released.add(code);held.clear();pressed.clear()},"clear");const onDown=__name(event=>{const node=event.target;if(ignoreEditable&&(node?.isContentEditable||/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(node?.tagName??"")))return;if(blocked.has(event.code))event.preventDefault();if(!held.has(event.code))pressed.add(event.code);held.add(event.code)},"onDown");const onUp=__name(event=>{if(held.delete(event.code))released.add(event.code)},"onUp");const onVisibility=__name(()=>{if(visibilityTarget?.hidden)clear()},"onVisibility");target.addEventListener("keydown",onDown);target.addEventListener("keyup",onUp);blurTarget.addEventListener("blur",clear);visibilityTarget?.addEventListener("visibilitychange",onVisibility);let disposed=false;return{isDown:__name(code=>held.has(code),"isDown"),wasPressed:__name(code=>pressed.has(code),"wasPressed"),wasReleased:__name(code=>released.has(code),"wasReleased"),axis:__name((negative,positive)=>Number(positive.some(code=>held.has(code)))-Number(negative.some(code=>held.has(code))),"axis"),endFrame(){pressed.clear();released.clear()},clear,dispose(){if(disposed)return;disposed=true;clear();target.removeEventListener("keydown",onDown);target.removeEventListener("keyup",onUp);blurTarget.removeEventListener("blur",clear);visibilityTarget?.removeEventListener("visibilitychange",onVisibility)}}}__name(createKeyboard,"createKeyboard");function createJoystick(element,{radius=60,deadZone=.12,floating=true,scale=__name(()=>1,"scale"),onChange,blurTarget}={}){if(!(radius>0)||!Number.isFinite(radius)||deadZone<0||deadZone>=1)throw new RangeError("Joystick requires radius > 0 and deadZone in [0, 1)");let pointerId=null,originX=0,originY=0,x=0,y=0,disposed=false;const oldTouchAction=element.style.touchAction;element.style.touchAction="none";const emit=__name(()=>onChange?.({x,y,active:pointerId!==null}),"emit");const move=__name(event=>{if(event.pointerId!==pointerId)return;event.preventDefault();const scaledRadius=radius*scale();if(!(scaledRadius>0)||!Number.isFinite(scaledRadius))throw new RangeError("Joystick scale must be finite and positive");const dx=(event.clientX-originX)/scaledRadius,dy=(event.clientY-originY)/scaledRadius;const length=Math.hypot(dx,dy);const magnitude=Math.min(1,Math.max(0,(length-deadZone)/(1-deadZone)));x=length?dx/length*magnitude:0;y=length?dy/length*magnitude:0;emit()},"move");const down=__name(event=>{if(pointerId!==null||event.pointerType==="mouse"&&event.button!==0)return;const rect=element.getBoundingClientRect();originX=floating?event.clientX:rect.left+rect.width/2;originY=floating?event.clientY:rect.top+rect.height/2;pointerId=event.pointerId;try{element.setPointerCapture(pointerId)}catch{}move(event)},"down");const reset=__name(()=>{const id=pointerId;pointerId=null;x=y=0;if(id!==null){try{element.releasePointerCapture(id)}catch{}}emit()},"reset");const end=__name(event=>{if(event.pointerId===pointerId)reset()},"end");element.addEventListener("pointerdown",down);element.addEventListener("pointermove",move);for(const name of["pointerup","pointercancel","lostpointercapture"])element.addEventListener(name,end);blurTarget?.addEventListener("blur",reset);return{value:__name(()=>({x,y,active:pointerId!==null}),"value"),reset,dispose(){if(disposed)return;disposed=true;try{reset()}finally{element.style.touchAction=oldTouchAction;element.removeEventListener("pointerdown",down);element.removeEventListener("pointermove",move);for(const name of["pointerup","pointercancel","lostpointercapture"])element.removeEventListener(name,end);blurTarget?.removeEventListener("blur",reset)}}}}__name(createJoystick,"createJoystick");function createActionInput({keyboard,actions={},axes={},buttons={},analog={}}={}){let previous={},current={},pressed={},released={};const anyKey=__name(keys=>(keys??[]).some(code=>keyboard?.isDown(code)),"anyKey");return{sample(){previous=current;current={};pressed={};released={};for(const name of new Set([...Object.keys(actions),...Object.keys(buttons)])){current[name]=anyKey(actions[name])||Boolean(buttons[name]?.());pressed[name]=current[name]&&!previous[name];released[name]=!current[name]&&Boolean(previous[name])}},isDown:__name(name=>Boolean(current[name]),"isDown"),wasPressed:__name(name=>Boolean(pressed[name]),"wasPressed"),wasReleased:__name(name=>Boolean(released[name]),"wasReleased"),axis(name){const keys=axes[name]??{};const digital=Number(anyKey(keys.positive))-Number(anyKey(keys.negative));const value=Number(analog[name]?.()??0);return Math.max(-1,Math.min(1,digital+(Number.isFinite(value)?value:0)))},reset(){previous={};current={};pressed={};released={}}}}__name(createActionInput,"createActionInput");export{canvasPoint,createActionInput,createJoystick,createKeyboard};
@@ -0,0 +1,40 @@
1
+ import type * as Three from 'three';
2
+ export interface AssetBox { size: Three.Vector3; min: Three.Vector3; max: Three.Vector3; center: Three.Vector3 }
3
+ export interface BoxCollider { cx: number; cy: number; cz: number; hw: number; hh: number; hd: number }
4
+ export function measureObject(THREE: typeof Three, object: Three.Object3D): AssetBox;
5
+ export function measureFromManifest(THREE: typeof Three, boxSize: string, boxOrigin?: string): AssetBox;
6
+ export function scaleForHeight(box: AssetBox, target: number): number;
7
+ export function scaleForWidth(box: AssetBox, target: number): number;
8
+ export function scaleForDepth(box: AssetBox, target: number): number;
9
+ export function scaleToFit(box: AssetBox, extent: number): number;
10
+ export function colliderTop(collider: BoxCollider): number;
11
+ export function colliderBottom(collider: BoxCollider): number;
12
+ export interface Placement { scale: Three.Vector3; size: Three.Vector3; bounds: Three.Box3; collider: BoxCollider; bottomY: number; topY: number }
13
+ export function placeOnSurface(THREE: typeof Three, object: Three.Object3D, options: { surfaceY: number; x: number; z: number; hover?: number; shrink?: number; rotationY?: number; scale?: number; targetHeight?: number; targetWidth?: number; targetDepth?: number }): Placement;
14
+ export function resolveGround(colliders: readonly BoxCollider[], x: number, z: number, radius: number, previousY: number, nextY: number, tolerance?: number): { grounded: boolean; groundY: number; index: number };
15
+ export function resolveSolid(colliders: readonly BoxCollider[], actor: { radius: number; height: number }, fromY: number, toX: number, toY: number, toZ: number): { x: number; y: number; z: number; grounded: boolean; ceiling: boolean; pushed: boolean };
16
+ export function hitByReach(origin: Three.Vector3Like, direction: Three.Vector3Like, reach: number, arcDot: number, target: BoxCollider, verticalTolerance: number): boolean;
17
+ export function hitByRadius(center: Three.Vector3Like, radius: number, target: BoxCollider, verticalTolerance: number): boolean;
18
+ export function makeTerrainMaterial(THREE: typeof Three, texture: Three.Texture, options: { planeSize: number | [number, number]; textureWorldSize?: number; tint?: Three.ColorRepresentation; roughness?: number; metalness?: number }): Three.MeshStandardMaterial;
19
+ export function makeFallbackTerrainTexture(THREE: typeof Three, canvas: HTMLCanvasElement, options?: { size?: number; color?: string; noise?: number; random?: () => number }): Three.CanvasTexture;
20
+ export function auditPlacement(entries: readonly { slot: string; placed: Placement; expectSurfaceY?: number; logicHalfWidth?: number }[], options?: { playerHeight?: number; maxHeightRatio?: number; minHeightRatio?: number; surfaceTolerance?: number; colliderTolerance?: number }): { slot: string; kind: 'oversize' | 'undersize' | 'not_on_surface' | 'collider_mismatch'; actual: number; expected: number }[];
21
+ export interface DisposeObjectOptions { disposeTextures?: boolean; exclude?: ReadonlySet<unknown>; remove?: boolean }
22
+ export function disposeObject(object: Three.Object3D, options?: DisposeObjectOptions): void;
23
+ export function loadModel<T>(loader: { loadAsync(url: string): Promise<T> }, url: string, options?: { signal?: AbortSignal; dispose?: (value: T) => void; onDisposeError?: (error: unknown) => void }): Promise<T>;
24
+ export function cloneModel<T extends Three.Object3D>(object: T, options?: { cloneSkeleton?: (object: T) => T; cloneMaterials?: boolean }): T;
25
+ export function createAnimationController(THREE: typeof Three, object: Three.Object3D, clips: readonly Three.AnimationClip[], options?: { onFinished?: (action: Three.AnimationAction) => void }): {
26
+ mixer: Three.AnimationMixer;
27
+ play(name: string, options?: { loop?: boolean; repetitions?: number; fadeSeconds?: number; timeScale?: number }): Three.AnimationAction;
28
+ update(dt: number): void; stop(): void; dispose(): void;
29
+ };
30
+ export function projectWorldLabel(THREE: typeof Three, position: Three.Vector3Like, camera: Three.Camera, width: number, height: number): { x: number; y: number; visible: boolean };
31
+ export function sunDirectionFrom(THREE: typeof Three, elevationDeg: number, azimuthDeg: number): Three.Vector3;
32
+ export function skyScaleFor(cameraFar: number): number;
33
+ export function createSky<T extends Three.Mesh<Three.BufferGeometry, Three.ShaderMaterial>>(THREE: typeof Three, options: {
34
+ Sky: new () => T; scene: Three.Scene; renderer?: Three.WebGLRenderer; cameraFar?: number; elevationDeg?: number; azimuthDeg?: number;
35
+ atmosphere?: Record<string, number>; bakeEnvironment?: boolean; nightBakeElevationDeg?: number;
36
+ }): { sky: T; sunDirection: Three.Vector3; environmentTarget: Three.WebGLRenderTarget | null; update(dt: number): void; dispose(): void };
37
+ export function makeSunLight(THREE: typeof Three, options: { scene: Three.Scene; renderer?: Three.WebGLRenderer; direction: Three.Vector3; color?: Three.ColorRepresentation; intensity?: number; distance?: number; castShadow?: boolean; shadowExtent?: number; shadowMapSize?: number }): { sun: Three.DirectionalLight; dispose(): void };
38
+ export function relativeLuminance(THREE: typeof Three, color: Three.ColorRepresentation): number;
39
+ export function effectiveAmbientLuminance(THREE: typeof Three, color: Three.ColorRepresentation, intensity: number): number;
40
+ export function skyVisibilityMargin(cameraHeight: number, cameraDistance: number, fovDeg: number): number;
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var positive=__name((value,label)=>{if(!(value>0)||!Number.isFinite(value))throw new RangeError(`${label} must be finite and positive`);return value},"positive");var number=__name((value,label)=>{if(!Number.isFinite(value))throw new TypeError(`${label} must be finite`);return value},"number");function measureObject(THREE,object){object.updateWorldMatrix(true,true);if(Math.abs(object.matrixWorld.determinant())<1e-12)throw new Error("Cannot measure an object with a singular world transform");const inverse=object.matrixWorld.clone().invert(),bounds=new THREE.Box3,point=new THREE.Vector3;object.traverse(node=>{const position=node.geometry?.attributes?.position;if(!position)return;const matrix=new THREE.Matrix4().multiplyMatrices(inverse,node.matrixWorld);for(let i=0;i<position.count;i++){if(node.isMesh&&typeof node.getVertexPosition==="function")node.getVertexPosition(i,point);else point.fromBufferAttribute(position,i);bounds.expandByPoint(point.applyMatrix4(matrix))}});if(bounds.isEmpty())throw new Error("Object has no measurable geometry");return{size:bounds.getSize(new THREE.Vector3),min:bounds.min.clone(),max:bounds.max.clone(),center:bounds.getCenter(new THREE.Vector3)}}__name(measureObject,"measureObject");function measureFromManifest(THREE,boxSize,boxOrigin){const triple=__name(text=>{const values2=String(text).split(",").map(Number);if(values2.length!==3||!values2.every(Number.isFinite))throw new TypeError("Expected three comma-separated finite numbers");return values2},"triple");const values=triple(boxSize);values.forEach(v=>positive(v,"box dimension"));const size=new THREE.Vector3(...values),center=boxOrigin===void 0?new THREE.Vector3(0,size.y/2,0):new THREE.Vector3(...triple(boxOrigin));const half=size.clone().multiplyScalar(.5);return{size,center,min:center.clone().sub(half),max:center.clone().add(half)}}__name(measureFromManifest,"measureFromManifest");var scaleForHeight=__name((box,target)=>positive(target,"targetHeight")/positive(box.size.y,"height"),"scaleForHeight");var scaleForWidth=__name((box,target)=>positive(target,"targetWidth")/positive(box.size.x,"width"),"scaleForWidth");var scaleForDepth=__name((box,target)=>positive(target,"targetDepth")/positive(box.size.z,"depth"),"scaleForDepth");var scaleToFit=__name((box,extent)=>Math.min(1,positive(extent,"extent")/positive(Math.max(box.size.x,box.size.y,box.size.z),"size")),"scaleToFit");var colliderTop=__name(collider=>collider.cy+collider.hh,"colliderTop");var colliderBottom=__name(collider=>collider.cy-collider.hh,"colliderBottom");function fromBounds(bounds,shrink=0){if(!Number.isFinite(shrink)||shrink<0||shrink>.4)throw new RangeError("shrink must be in [0, 0.4]");return{cx:(bounds.min.x+bounds.max.x)/2,cy:(bounds.min.y+bounds.max.y)/2,cz:(bounds.min.z+bounds.max.z)/2,hw:(bounds.max.x-bounds.min.x)*(1-shrink)/2,hh:(bounds.max.y-bounds.min.y)/2,hd:(bounds.max.z-bounds.min.z)*(1-shrink)/2}}__name(fromBounds,"fromBounds");function placeOnSurface(THREE,object,options){const{surfaceY,x,z,hover=0,shrink=0}=options;[surfaceY,x,z,hover].forEach(value=>number(value,"placement coordinate"));const dimensions=["targetHeight","targetWidth","targetDepth"].filter(key=>options[key]!==void 0);if(dimensions.length>1||dimensions.length&&options.scale!==void 0)throw new TypeError("Specify one target dimension or scale");if(options.rotationY!==void 0)object.rotation.y=number(options.rotationY,"rotationY");if(options.scale!==void 0)object.scale.setScalar(positive(options.scale,"scale"));object.updateWorldMatrix(true,true);const bounds=new THREE.Box3().setFromObject(object,true);if(bounds.isEmpty())throw new Error("Cannot place an object without geometry");if(dimensions.length){const axis={targetHeight:"y",targetWidth:"x",targetDepth:"z"}[dimensions[0]];const size=bounds.getSize(new THREE.Vector3);const ratio=positive(options[dimensions[0]],dimensions[0])/positive(size[axis],"object dimension");object.scale.multiplyScalar(ratio)}const world=object.getWorldPosition(new THREE.Vector3);world.x=x;world.z=z;object.position.copy(object.parent?object.parent.worldToLocal(world):world);object.updateWorldMatrix(true,true);bounds.setFromObject(object,true);const pivot=object.getWorldPosition(new THREE.Vector3);pivot.y+=surfaceY+hover-bounds.min.y;object.position.copy(object.parent?object.parent.worldToLocal(pivot):pivot);object.updateWorldMatrix(true,true);bounds.setFromObject(object,true);const collider=fromBounds(bounds,shrink);return{scale:object.scale.clone(),size:bounds.getSize(new THREE.Vector3),bounds,collider,bottomY:colliderBottom(collider),topY:colliderTop(collider)}}__name(placeOnSurface,"placeOnSurface");var horizontalOverlap=__name((c,x,z,radius)=>Math.abs(x-c.cx)<c.hw+radius&&Math.abs(z-c.cz)<c.hd+radius,"horizontalOverlap");function resolveGround(colliders,x,z,radius,previousY,nextY,tolerance=.05){let groundY=-Infinity,index=-1;if(nextY>previousY+tolerance)return{grounded:false,groundY:0,index:-1};colliders.forEach((c,i)=>{const top=colliderTop(c);if(horizontalOverlap(c,x,z,radius)&&previousY>=top-tolerance&&nextY<=top+tolerance&&top>groundY){groundY=top;index=i}});return{grounded:index!==-1,groundY:index===-1?0:groundY,index}}__name(resolveGround,"resolveGround");function resolveSolid(colliders,actor,fromY,toX,toY,toZ){let x=toX,y=toY,z=toZ,grounded=false,ceiling=false,pushed=false;const falling=toY<=fromY;for(const c of colliders){if(!horizontalOverlap(c,x,z,actor.radius))continue;const top=colliderTop(c),bottom=colliderBottom(c);if(falling&&fromY>=top-.05&&toY<=top&&(!grounded||top>y)){y=top;grounded=true}else if(!falling&&fromY+actor.height<=bottom+.05&&toY+actor.height>=bottom&&(!ceiling||bottom-actor.height<y)){y=bottom-actor.height;ceiling=true}}for(const c of colliders){if(!(y+actor.height>colliderBottom(c)+.02&&y<colliderTop(c)-.02)||!horizontalOverlap(c,x,z,actor.radius))continue;const dx=x-c.cx,dz=z-c.cz,overlapX=c.hw+actor.radius-Math.abs(dx),overlapZ=c.hd+actor.radius-Math.abs(dz);if(overlapX<overlapZ)x+=dx>=0?overlapX:-overlapX;else z+=dz>=0?overlapZ:-overlapZ;pushed=true}return{x,y,z,grounded,ceiling,pushed}}__name(resolveSolid,"resolveSolid");function hitByReach(origin,direction,reach,arcDot,target,verticalTolerance){if(Math.abs(target.cy-origin.y)>verticalTolerance+target.hh)return false;const dx=target.cx-origin.x,dz=target.cz-origin.z,distance=Math.hypot(dx,dz),norm=Math.hypot(direction.x,direction.z);if(distance>reach+Math.max(target.hw,target.hd))return false;return distance<1e-4||norm>0&&(dx*direction.x+dz*direction.z)/distance/norm>=arcDot}__name(hitByReach,"hitByReach");function hitByRadius(center,radius,target,verticalTolerance){return Math.abs(target.cy-center.y)<=verticalTolerance+target.hh&&Math.hypot(target.cx-center.x,target.cz-center.z)<=radius+Math.max(target.hw,target.hd)}__name(hitByRadius,"hitByRadius");function makeTerrainMaterial(THREE,texture,{planeSize,textureWorldSize=4,tint=16777215,roughness=.9,metalness=0}={}){const[width,depth]=Array.isArray(planeSize)?planeSize:[planeSize,planeSize];positive(width,"plane width");positive(depth,"plane depth");positive(textureWorldSize,"textureWorldSize");const map=texture.clone();map.wrapS=map.wrapT=THREE.RepeatWrapping;map.repeat.set(width/textureWorldSize,depth/textureWorldSize);map.colorSpace=THREE.SRGBColorSpace;map.needsUpdate=true;return new THREE.MeshStandardMaterial({map,color:tint,roughness,metalness})}__name(makeTerrainMaterial,"makeTerrainMaterial");function makeFallbackTerrainTexture(THREE,canvas,{size=64,color="#718061",noise=12,random=Math.random}={}){if(!Number.isInteger(size)||size<1)throw new RangeError("Texture size must be a positive integer");const context=canvas.getContext("2d");if(!context)throw new Error("Canvas 2D context required");canvas.width=canvas.height=size;context.fillStyle=color;context.fillRect(0,0,size,size);const data=context.getImageData(0,0,size,size);for(let i=0;i<data.data.length;i+=4){const offset=(random()*2-1)*noise;for(let j=0;j<3;j++)data.data[i+j]+=offset}context.putImageData(data,0,0);const texture=new THREE.CanvasTexture(canvas);texture.colorSpace=THREE.SRGBColorSpace;return texture}__name(makeFallbackTerrainTexture,"makeFallbackTerrainTexture");function auditPlacement(entries,{playerHeight,maxHeightRatio=8,minHeightRatio=.02,surfaceTolerance=.05,colliderTolerance=.2}={}){const issues=[];for(const entry of entries){const height=entry.placed.size.y;if(playerHeight>0&&height>playerHeight*maxHeightRatio)issues.push({slot:entry.slot,kind:"oversize",actual:height,expected:playerHeight*maxHeightRatio});if(playerHeight>0&&height<playerHeight*minHeightRatio)issues.push({slot:entry.slot,kind:"undersize",actual:height,expected:playerHeight*minHeightRatio});if(entry.expectSurfaceY!==void 0&&Math.abs(entry.placed.bottomY-entry.expectSurfaceY)>surfaceTolerance)issues.push({slot:entry.slot,kind:"not_on_surface",actual:entry.placed.bottomY,expected:entry.expectSurfaceY});if(entry.logicHalfWidth!==void 0&&(!(entry.logicHalfWidth>0)||Math.abs(entry.placed.collider.hw/entry.logicHalfWidth-1)>colliderTolerance))issues.push({slot:entry.slot,kind:"collider_mismatch",actual:entry.logicHalfWidth,expected:entry.placed.collider.hw})}return issues}__name(auditPlacement,"auditPlacement");function disposeObject(object,{disposeTextures=false,exclude=new Set,remove=true}={}){const resources=new Set;const include=__name(resource=>{if(resource&&!exclude.has(resource)&&typeof resource.dispose==="function")resources.add(resource)},"include");object.traverse(node=>{include(node.geometry);for(const material of Array.isArray(node.material)?node.material:[node.material]){if(!material||exclude.has(material))continue;include(material);if(disposeTextures){for(const value of Object.values(material))if(value?.isTexture)include(value);for(const uniform of Object.values(material.uniforms??{}))for(const value of Array.isArray(uniform.value)?uniform.value:[uniform.value])if(value?.isTexture)include(value)}}if(node.skeleton)include(node.skeleton)});if(remove)object.removeFromParent();for(const resource of resources)resource.dispose()}__name(disposeObject,"disposeObject");function loadModel(loader,url,{signal,dispose=__name(result=>disposeObject(result.scene??result,{disposeTextures:true}),"dispose"),onDisposeError}={}){if(signal?.aborted)return Promise.reject(signal.reason??new DOMException("Model load cancelled","AbortError"));return new Promise((resolve,reject)=>{let cancelled=false;const cancel=__name(()=>{cancelled=true;signal.removeEventListener("abort",cancel);reject(signal.reason??new DOMException("Model load cancelled","AbortError"))},"cancel");signal?.addEventListener("abort",cancel,{once:true});Promise.resolve().then(()=>loader.loadAsync(url)).then(result=>{signal?.removeEventListener("abort",cancel);if(cancelled){try{dispose(result)}catch(error){try{onDisposeError?.(error)}catch{}}return}resolve(result)},error=>{signal?.removeEventListener("abort",cancel);if(!cancelled)reject(error)})})}__name(loadModel,"loadModel");function cloneModel(object,{cloneSkeleton,cloneMaterials=false}={}){let skinned=false;object.traverse(node=>{if(node.isSkinnedMesh)skinned=true});if(skinned&&!cloneSkeleton)throw new Error("Skinned models require the caller to pass SkeletonUtils.clone");const cloned=skinned?cloneSkeleton(object):object.clone(true);if(cloneMaterials){const materials=new Map;const clone=__name(material=>{if(!materials.has(material))materials.set(material,material.clone());return materials.get(material)},"clone");cloned.traverse(node=>{if(node.material)node.material=Array.isArray(node.material)?node.material.map(clone):clone(node.material)})}return cloned}__name(cloneModel,"cloneModel");function createAnimationController(THREE,object,clips,{onFinished}={}){const names=new Map;for(const clip of clips){if(names.has(clip.name))throw new Error(`Duplicate animation '${clip.name}'`);names.set(clip.name,clip)}const mixer=new THREE.AnimationMixer(object);let current=null,disposed=false;const finished=__name(event=>onFinished?.(event.action),"finished");mixer.addEventListener("finished",finished);return{mixer,play(name,{loop=true,repetitions=Infinity,fadeSeconds=.2,timeScale=1}={}){if(disposed)throw new Error("Animation controller is disposed");const clip=names.get(name);if(!clip)throw new Error(`Unknown animation '${name}'`);if(!(fadeSeconds>=0)||!Number.isFinite(fadeSeconds)||!Number.isFinite(timeScale))throw new RangeError("Invalid animation fade or timeScale");const action=mixer.clipAction(clip);if(current&&current!==action){if(fadeSeconds)current.fadeOut(fadeSeconds);else current.stop()}action.reset().setLoop(loop?THREE.LoopRepeat:THREE.LoopOnce,repetitions);action.clampWhenFinished=!loop;action.timeScale=timeScale;if(fadeSeconds)action.fadeIn(fadeSeconds);action.play();current=action;return action},update(dt){if(disposed)return;if(!Number.isFinite(dt)||dt<0)throw new RangeError("Animation delta must be nonnegative");mixer.update(dt)},stop(){mixer.stopAllAction();current=null},dispose(){if(disposed)return;disposed=true;mixer.stopAllAction();mixer.removeEventListener("finished",finished);mixer.uncacheRoot(object)}}}__name(createAnimationController,"createAnimationController");function projectWorldLabel(THREE,position,camera,width,height){camera.updateWorldMatrix(true,false);const point=new THREE.Vector3(position.x,position.y,position.z).project(camera);return{x:(point.x+1)*width/2,y:(1-point.y)*height/2,visible:point.z>=-1&&point.z<=1&&Math.abs(point.x)<=1&&Math.abs(point.y)<=1}}__name(projectWorldLabel,"projectWorldLabel");function sunDirectionFrom(THREE,elevationDeg,azimuthDeg){return new THREE.Vector3().setFromSphericalCoords(1,(90-number(elevationDeg,"elevation"))*Math.PI/180,number(azimuthDeg,"azimuth")*Math.PI/180)}__name(sunDirectionFrom,"sunDirectionFrom");var skyScaleFor=__name(cameraFar=>positive(cameraFar,"cameraFar")*1.6,"skyScaleFor");function createSky(THREE,{Sky,scene,renderer,cameraFar=1e3,elevationDeg=32,azimuthDeg=200,atmosphere={},bakeEnvironment=false,nightBakeElevationDeg}={}){if(typeof Sky!=="function")throw new TypeError("Pass Sky from your Three.js addon installation");if(bakeEnvironment&&!renderer)throw new TypeError("Environment baking requires a WebGLRenderer");if(!scene?.add)throw new TypeError("Pass the application scene");const scale=skyScaleFor(cameraFar),direction=sunDirectionFrom(THREE,elevationDeg,azimuthDeg);for(const[name,value]of Object.entries(atmosphere))number(value,`Sky ${name}`);if(nightBakeElevationDeg!==void 0)number(nightBakeElevationDeg,"nightBakeElevationDeg");const sky=new Sky,uniforms=sky.material.uniforms;const previousEnvironment=scene.environment;let environmentTarget=null,disposed=false;if(!uniforms.sunPosition?.value?.copy){sky.geometry.dispose();sky.material.dispose();throw new Error("Sky addon must expose sunPosition")}sky.scale.setScalar(scale);const defaults={turbidity:2,rayleigh:1,mieCoefficient:.005,mieDirectionalG:.8};for(const[name,value]of Object.entries({...defaults,...atmosphere})){if(!uniforms[name]){sky.geometry.dispose();sky.material.dispose();throw new Error(`This Sky addon does not support '${name}'`)}uniforms[name].value=number(value,`Sky ${name}`)}uniforms.sunPosition.value.copy(direction);try{if(bakeEnvironment){const generator=new THREE.PMREMGenerator(renderer),bakeScene=new THREE.Scene;const disc=uniforms.showSunDisc?.value;try{if(elevationDeg<0&&nightBakeElevationDeg!==void 0)uniforms.sunPosition.value.copy(sunDirectionFrom(THREE,nightBakeElevationDeg,azimuthDeg));if(uniforms.showSunDisc)uniforms.showSunDisc.value=0;bakeScene.add(sky);environmentTarget=generator.fromScene(bakeScene)}finally{generator.dispose();uniforms.sunPosition.value.copy(direction);if(uniforms.showSunDisc)uniforms.showSunDisc.value=disc}scene.environment=environmentTarget.texture}scene.add(sky)}catch(error){sky.removeFromParent();sky.geometry.dispose();sky.material.dispose();environmentTarget?.dispose();throw error}return{sky,sunDirection:direction,environmentTarget,update(dt){if(disposed)return;if(!Number.isFinite(dt)||dt<0)throw new RangeError("Sky delta must be nonnegative");if(uniforms.time)uniforms.time.value+=dt},dispose(){if(disposed)return;disposed=true;sky.removeFromParent();sky.geometry.dispose();sky.material.dispose();if(environmentTarget){if(scene.environment===environmentTarget.texture)scene.environment=previousEnvironment;environmentTarget.dispose()}}}}__name(createSky,"createSky");function makeSunLight(THREE,{scene,renderer,direction,color=16773848,intensity=2,distance=100,castShadow=true,shadowExtent=60,shadowMapSize=2048}={}){positive(distance,"light distance");positive(shadowExtent,"shadowExtent");if(castShadow&&!renderer)throw new TypeError("Pass renderer to explicitly enable its shadows");const sun=new THREE.DirectionalLight(color,intensity);sun.position.copy(direction).normalize().multiplyScalar(distance);sun.castShadow=castShadow;if(castShadow){renderer.shadowMap.enabled=true;Object.assign(sun.shadow.camera,{left:-shadowExtent,right:shadowExtent,top:shadowExtent,bottom:-shadowExtent,near:.5,far:Math.max(200,distance*3)});sun.shadow.camera.updateProjectionMatrix();sun.shadow.mapSize.set(shadowMapSize,shadowMapSize);sun.shadow.normalBias=.02;sun.shadow.bias=-5e-4}scene.add(sun);scene.add(sun.target);let disposed=false;return{sun,dispose(){if(disposed)return;disposed=true;sun.removeFromParent();sun.target.removeFromParent();sun.dispose()}}}__name(makeSunLight,"makeSunLight");function relativeLuminance(THREE,color){const c=new THREE.Color(color);return .2126*c.r+.7152*c.g+.0722*c.b}__name(relativeLuminance,"relativeLuminance");var effectiveAmbientLuminance=__name((THREE,color,intensity)=>relativeLuminance(THREE,color)*Math.max(0,intensity),"effectiveAmbientLuminance");var skyVisibilityMargin=__name((cameraHeight,cameraDistance,fovDeg)=>fovDeg/2-Math.atan2(Math.max(0,cameraHeight),Math.max(1e-6,cameraDistance))*180/Math.PI,"skyVisibilityMargin");export{auditPlacement,cloneModel,colliderBottom,colliderTop,createAnimationController,createSky,disposeObject,effectiveAmbientLuminance,hitByRadius,hitByReach,loadModel,makeFallbackTerrainTexture,makeSunLight,makeTerrainMaterial,measureFromManifest,measureObject,placeOnSurface,projectWorldLabel,relativeLuminance,resolveGround,resolveSolid,scaleForDepth,scaleForHeight,scaleForWidth,scaleToFit,skyScaleFor,skyVisibilityMargin,sunDirectionFrom};
@@ -0,0 +1,10 @@
1
+ export interface UiRect { x: number; y: number; width: number; height: number }
2
+ export interface UiStage {
3
+ root: HTMLDivElement; stage: HTMLDivElement; readonly scale: number;
4
+ resize(cssWidth?: number, cssHeight?: number): void; layer(name: string): HTMLDivElement; dispose(): void;
5
+ }
6
+ export function createUiStage(container: HTMLElement, options: { width: number; height: number; layers?: Record<string, number>; zIndex?: number }): UiStage;
7
+ export function setRect(element: HTMLElement, rect: UiRect): void;
8
+ export function applyNineSlice<T extends HTMLElement>(element: T, url: string, borders: { top: number; right?: number; bottom?: number; left?: number }): T;
9
+ export function createButton(document: Document, options?: { label?: string; onClick?: (event: MouseEvent) => void; dragThreshold?: number; scale?: () => number; disabled?: boolean; className?: string }): { element: HTMLButtonElement; dispose(): void };
10
+ export function createWorldLabel(element: HTMLElement, project: () => { x: number; y: number; visible?: boolean } | null, options?: { offsetX?: number; offsetY?: number }): { update(): void; dispose(): void };
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function createUiStage(container,{width,height,layers={background:0,hud:100,panel:300,scrim:600,modal:650,toast:900},zIndex=10}={}){if(!(width>0&&height>0)||!Number.isFinite(width+height))throw new RangeError("UI design size must be positive");const document=container.ownerDocument;const root=document.createElement("div"),stage=document.createElement("div");Object.assign(root.style,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden",zIndex:String(zIndex)});Object.assign(stage.style,{position:"absolute",left:"50%",top:"50%",width:`${width}px`,height:`${height}px`,transformOrigin:"center center",pointerEvents:"none"});root.appendChild(stage);const layerElements=new Map;for(const[name,order]of Object.entries(layers)){const element=document.createElement("div");element.dataset.layer=name;Object.assign(element.style,{position:"absolute",inset:"0",pointerEvents:"none",zIndex:String(order)});stage.appendChild(element);layerElements.set(name,element)}container.appendChild(root);let scale=1;const resize=__name((cssWidth=container.clientWidth,cssHeight=container.clientHeight)=>{if(!(cssWidth>=0&&cssHeight>=0)||!Number.isFinite(cssWidth+cssHeight))throw new RangeError("UI container size must be finite and nonnegative");scale=Math.min(cssWidth/width,cssHeight/height);stage.style.transform=`translate(-50%, -50%) scale(${scale})`},"resize");resize();return{root,stage,resize,get scale(){return scale},layer(name){const element=layerElements.get(name);if(!element)throw new Error(`Unknown UI layer '${name}'`);return element},dispose(){root.remove();layerElements.clear()}}}__name(createUiStage,"createUiStage");function setRect(element,{x,y,width,height}){if(![x,y,width,height].every(Number.isFinite))throw new TypeError("UI rect values must be finite");Object.assign(element.style,{position:"absolute",left:`${x}px`,top:`${y}px`,width:`${width}px`,height:`${height}px`})}__name(setRect,"setRect");function applyNineSlice(element,url,{top,right=top,bottom=top,left=right}){if(![top,right,bottom,left].every(value=>Number.isFinite(value)&&value>=0))throw new RangeError("Nine-slice borders must be nonnegative");Object.assign(element.style,{borderImageSource:`url(${JSON.stringify(url)})`,borderImageSlice:`${top} ${right} ${bottom} ${left} fill`,borderImageRepeat:"stretch",borderStyle:"solid",borderColor:"transparent",borderWidth:`${top}px ${right}px ${bottom}px ${left}px`,boxSizing:"border-box"});return element}__name(applyNineSlice,"applyNineSlice");function createButton(document,{label="",onClick,dragThreshold=20,scale=__name(()=>1,"scale"),disabled=false,className=""}={}){const element=document.createElement("button");element.type="button";element.textContent=label;element.disabled=disabled;element.className=className;element.style.pointerEvents="auto";const pointers=new Map;let suppressClick=false;const down=__name(event=>{suppressClick=false;pointers.set(event.pointerId,{x:event.clientX,y:event.clientY,moved:false})},"down");const move=__name(event=>{const p=pointers.get(event.pointerId);if(p&&Math.hypot(event.clientX-p.x,event.clientY-p.y)>dragThreshold*scale())p.moved=true},"move");const up=__name(event=>{move(event);const p=pointers.get(event.pointerId);suppressClick=Boolean(p?.moved);pointers.delete(event.pointerId)},"up");const cancel=__name(event=>{pointers.delete(event.pointerId);suppressClick=true},"cancel");const click=__name(event=>{if(element.disabled||event.detail!==0&&suppressClick){suppressClick=false;event.preventDefault();return}onClick?.(event)},"click");const handlers={pointerdown:down,pointermove:move,pointerup:up,pointercancel:cancel,click};for(const[name,handler]of Object.entries(handlers))element.addEventListener(name,handler);return{element,dispose(){for(const[name,handler]of Object.entries(handlers))element.removeEventListener(name,handler);pointers.clear();element.remove()}}}__name(createButton,"createButton");function createWorldLabel(element,project,{offsetX=0,offsetY=0}={}){Object.assign(element.style,{position:"absolute",pointerEvents:"none",transform:"translate(-50%, -100%)"});let disposed=false;return{update(){if(disposed)return;const point=project();const visible=point&&point.visible!==false&&Number.isFinite(point.x)&&Number.isFinite(point.y);element.hidden=!visible;if(visible){element.style.left=`${point.x+offsetX}px`;element.style.top=`${point.y+offsetY}px`}},dispose(){if(!disposed){disposed=true;element.remove()}}}}__name(createWorldLabel,"createWorldLabel");export{applyNineSlice,createButton,createUiStage,createWorldLabel,setRect};
@@ -0,0 +1,8 @@
1
+ import type { AssetUrlOptions } from './assets.mjs';
2
+ export interface VideoRect { x: number; y: number; width: number; height: number }
3
+ export interface VideoOverlayOptions extends AssetUrlOptions {
4
+ crossOrigin?: string; muted?: boolean; mutedRetry?: boolean; loop?: boolean; controls?: boolean; interactive?: boolean;
5
+ fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; autoClose?: boolean; rect?: VideoRect;
6
+ onEnded?: () => void; onError?: (error: Error) => void;
7
+ }
8
+ export function createVideoOverlay(container: HTMLElement, url: string, options?: VideoOverlayOptions): { element: HTMLVideoElement; play(): Promise<void>; setRect(rect?: VideoRect): void; dispose(): void };
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function rewriteLibraryGlbMount(path){const value=String(path??"").trim();if(!value||/^(?:data:|blob:)/i.test(value))return value;const parts=value.match(/^([^?#]*)([?#].*)?$/);if(!parts)return value;const pathname=parts[1],rest=parts[2]??"";if(!/\.(?:glb|gltf)$/i.test(pathname))return value;if(pathname.startsWith("/Glb/Game/")||pathname.startsWith("Glb/Game/"))return value;if(pathname.startsWith("/Game/"))return`/Glb${pathname}${rest}`;if(pathname.startsWith("Game/"))return`Glb/${pathname}${rest}`;if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))try{const url=new URL(value);if(url.pathname.startsWith("/Game/")&&/\.(?:glb|gltf)$/i.test(url.pathname)){url.pathname=`/Glb${url.pathname}`;return url.href}}catch{}return value}__name(rewriteLibraryGlbMount,"rewriteLibraryGlbMount");function resolveAssetUrl(path,{cdnBaseUrl="",baseUrl}={}){const value=rewriteLibraryGlbMount(path);if(!value)throw new TypeError("Asset path must not be empty");if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))return value;const encoded=encodeURI(value).replace(/%25([\da-f]{2})/gi,"%$1");const localPrefix=/^(?:assets|game|res|cfg|fonts)\//.test(value);if(cdnBaseUrl&&!localPrefix&&(value.startsWith("/Game/")||value.startsWith("/Glb/")||!/^(?:\/|\.\.?\/)/.test(value))){return`${cdnBaseUrl.replace(/\/+$/,"")}/${encoded.replace(/^\/+/,"")}`}return baseUrl?new URL(encoded,baseUrl).href:encoded}__name(resolveAssetUrl,"resolveAssetUrl");function createVideoOverlay(container,url,options={}){const element=container.ownerDocument.createElement("video");element.crossOrigin=options.crossOrigin??"anonymous";element.playsInline=true;element.preload="auto";element.muted=options.muted??false;element.loop=options.loop??false;element.controls=options.controls??false;Object.assign(element.style,{position:"absolute",pointerEvents:options.interactive?"auto":"none",objectFit:options.fit??"contain"});let disposed=false;function setRect(rect){if(!rect)Object.assign(element.style,{left:"0",top:"0",width:"100%",height:"100%"});else{if(![rect.x,rect.y,rect.width,rect.height].every(Number.isFinite)||rect.width<=0||rect.height<=0)throw new RangeError("Video rect requires finite coordinates and positive dimensions");Object.assign(element.style,{left:`${rect.x}px`,top:`${rect.y}px`,width:`${rect.width}px`,height:`${rect.height}px`})}}__name(setRect,"setRect");function dispose(){if(disposed)return;disposed=true;element.removeEventListener("ended",onEnded);element.removeEventListener("error",onError);element.pause();element.removeAttribute("src");element.load();element.remove()}__name(dispose,"dispose");const onEnded=__name(()=>{try{options.onEnded?.()}finally{if(options.autoClose!==false)dispose()}},"onEnded");const onError=__name(()=>{try{options.onError?.(new Error(`Video load failed: ${element.src}`))}finally{dispose()}},"onError");setRect(options.rect);element.addEventListener("ended",onEnded);element.addEventListener("error",onError);element.src=resolveAssetUrl(url,options);container.appendChild(element);return{element,setRect,dispose,async play(){if(disposed)throw new Error("Video overlay is disposed");try{await element.play()}catch(error){if(disposed)throw error;if(options.mutedRetry&&!element.muted){element.muted=true;await element.play()}else throw error}}}}__name(createVideoOverlay,"createVideoOverlay");export{createVideoOverlay};