@craft_eco/craft-mcp 0.1.28 → 0.1.30

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 (999) hide show
  1. package/README.md +21 -60
  2. package/bin/craft-mcp.mjs +7 -1
  3. package/dist-server/game-workflow/asset-import.mjs +5 -1
  4. package/dist-server/game-workflow/assets.mjs +6 -2
  5. package/dist-server/game-workflow/bundle-files.mjs +9 -6
  6. package/dist-server/game-workflow/check.mjs +8 -2
  7. package/dist-server/game-workflow/context-state.mjs +67 -0
  8. package/dist-server/game-workflow/draft-archive.mjs +147 -2
  9. package/dist-server/game-workflow/draft-upload-identity.mjs +11 -0
  10. package/dist-server/game-workflow/draft-uploads.mjs +108 -60
  11. package/dist-server/game-workflow/engines.mjs +3 -3
  12. package/dist-server/game-workflow/library-assets.mjs +2 -1
  13. package/dist-server/game-workflow/local-context.mjs +62 -0
  14. package/dist-server/game-workflow/native-context.mjs +289 -0
  15. package/dist-server/game-workflow/project-bundles.mjs +121 -4
  16. package/dist-server/game-workflow/project-context.mjs +183 -45
  17. package/dist-server/game-workflow/project-leases.mjs +101 -30
  18. package/dist-server/game-workflow/projects.mjs +92 -14
  19. package/dist-server/game-workflow/tasks.mjs +7 -2
  20. package/dist-server/game-workflow/work-scope.mjs +7 -0
  21. package/dist-server/integrations/config.mjs +90 -16
  22. package/dist-server/integrations/connect.mjs +36 -0
  23. package/dist-server/integrations/connection-handoff.mjs +36 -0
  24. package/dist-server/integrations/dsh-config.mjs +182 -0
  25. package/dist-server/integrations/fixed-launcher.mjs +31 -0
  26. package/dist-server/integrations/host-reload.mjs +19 -0
  27. package/dist-server/integrations/hosts.mjs +27 -7
  28. package/dist-server/integrations/install.mjs +168 -31
  29. package/dist-server/integrations/installation-state.mjs +84 -0
  30. package/dist-server/integrations/launcher-start.mjs +52 -0
  31. package/dist-server/integrations/npm-diagnostics.mjs +32 -0
  32. package/dist-server/integrations/runtime-gc.mjs +191 -0
  33. package/dist-server/integrations/runtime-identity.mjs +22 -0
  34. package/dist-server/integrations/runtime.mjs +64 -25
  35. package/dist-server/integrations/updates.mjs +258 -0
  36. package/dist-server/integrations/version-policy.mjs +32 -0
  37. package/dist-server/launcher.mjs +1845 -0
  38. package/dist-server/mcp/control-panel.mjs +12 -24
  39. package/dist-server/mcp/server.mjs +150 -91
  40. package/dist-server/mcp/start.mjs +8 -2
  41. package/dist-server/mcp/update-session.mjs +107 -0
  42. package/dist-server/upstream/craft-aigc.mjs +43 -16
  43. package/dist-server/upstream/draft-source.mjs +29 -0
  44. package/package.json +4 -3
  45. package/resources/context-filter-report.json +177 -0
  46. package/resources/craft-create/SKILL.md +10 -2
  47. package/resources/craft-update/SKILL.md +23 -0
  48. package/resources/targets/claude/js/bootstrap/SKILL.md +20 -0
  49. package/resources/targets/claude/js/context-filter-report.json +27 -0
  50. package/resources/targets/claude/js/craft-game-maker/SKILL.md +72 -0
  51. package/resources/targets/claude/js/craft-game-maker/js.md +10 -0
  52. package/resources/targets/claude/js/js/bundle.json +97 -0
  53. package/resources/targets/claude/js/js/context/AGENTS.md +29 -0
  54. package/resources/targets/claude/js/js/context/hooks/hooks.json +14 -0
  55. package/resources/targets/claude/js/js/context/knowledge/AssetUrl.md +9 -0
  56. package/resources/targets/claude/js/js/context/knowledge/AssetWiring.md +7 -0
  57. package/resources/targets/claude/js/js/context/knowledge/Layout.md +7 -0
  58. package/resources/targets/claude/js/js/context/knowledge/Lifecycle.md +11 -0
  59. package/resources/targets/claude/js/js/context/knowledge/ResourceLoading.md +9 -0
  60. package/resources/targets/claude/js/js/context/skills/export-config/SKILL.md +16 -0
  61. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  62. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  63. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  64. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  65. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  66. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  67. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  68. package/resources/targets/claude/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  69. package/resources/targets/claude/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  70. package/resources/targets/claude/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  71. package/resources/targets/claude/js/js/context/skills/index.json +19 -0
  72. package/resources/targets/claude/js/js/context/skills/visual-qa/SKILL.md +14 -0
  73. package/resources/targets/claude/js/js/project/README.md +7 -0
  74. package/resources/targets/claude/js/js/project/configs/assets.json +1 -0
  75. package/resources/targets/claude/js/js/project/configs/game.controls.json +3 -0
  76. package/resources/targets/claude/js/js/project/configs/game.json +3 -0
  77. package/resources/targets/claude/js/js/project/game-runtime.json +7 -0
  78. package/resources/targets/claude/js/js/project/game.config.json +7 -0
  79. package/resources/targets/claude/js/js/project/index.html +20 -0
  80. package/resources/targets/claude/js/js/project/package.json +22 -0
  81. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  82. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  83. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  84. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  85. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  86. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  87. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  88. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  89. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  90. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  91. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  92. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  93. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  94. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  95. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  96. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  97. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  98. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  99. package/resources/targets/claude/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  100. package/resources/targets/claude/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  101. package/resources/targets/claude/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  102. package/resources/targets/claude/js/js/project/scripts/config-export.mjs +13 -0
  103. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  104. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  105. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  106. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  107. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  108. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  109. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  110. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  111. package/resources/targets/claude/js/js/project/scripts/write-preview-ready.mjs +22 -0
  112. package/resources/targets/claude/js/js/project/src/display/ui-stage.ts +156 -0
  113. package/resources/targets/claude/js/js/project/src/display/viewport.ts +249 -0
  114. package/resources/targets/claude/js/js/project/src/main.ts +87 -0
  115. package/resources/targets/claude/js/js/project/src/platform.ts +2 -0
  116. package/resources/targets/claude/js/js/project/src/scenes/LoadScene.ts +89 -0
  117. package/resources/targets/claude/js/js/project/src/scenes/PlayScene.ts +17 -0
  118. package/resources/targets/claude/js/js/project/src/screenUi.ts +185 -0
  119. package/resources/targets/claude/js/js/project/src/style.css +294 -0
  120. package/resources/targets/claude/js/js/project/tsconfig.json +20 -0
  121. package/resources/targets/claude/js/js/project/unified_data_control_config.json +20 -0
  122. package/resources/targets/claude/js/js/project/vite.config.ts +5 -0
  123. package/resources/targets/claude/js/recovery.md +17 -0
  124. package/resources/targets/claude/js/target.json +61 -0
  125. package/resources/targets/claude/js3d/bootstrap/SKILL.md +20 -0
  126. package/resources/targets/claude/js3d/context-filter-report.json +27 -0
  127. package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +72 -0
  128. package/resources/targets/claude/js3d/craft-game-maker/js3d.md +12 -0
  129. package/resources/targets/claude/js3d/js3d/bundle.json +108 -0
  130. package/resources/targets/claude/js3d/js3d/context/AGENTS.md +30 -0
  131. package/resources/targets/claude/js3d/js3d/context/hooks/hooks.json +14 -0
  132. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  133. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  134. package/resources/targets/claude/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  135. package/resources/targets/claude/js3d/js3d/context/knowledge/Layout.md +7 -0
  136. package/resources/targets/{workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → claude/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  137. package/resources/targets/claude/js3d/js3d/context/knowledge/Runtime.md +9 -0
  138. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  139. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  140. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  141. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  142. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  143. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  144. package/resources/targets/claude/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  145. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  146. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  147. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  148. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  149. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  150. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  151. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  152. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  153. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  154. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  155. package/resources/targets/claude/js3d/js3d/context/skills/index.json +31 -0
  156. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  157. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  158. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  159. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  160. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  161. package/resources/targets/claude/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  162. package/resources/targets/claude/js3d/js3d/project/README.md +7 -0
  163. package/resources/targets/claude/js3d/js3d/project/configs/game.controls.json +3 -0
  164. package/resources/targets/claude/js3d/js3d/project/configs/game.json +3 -0
  165. package/resources/targets/claude/js3d/js3d/project/game-runtime.json +7 -0
  166. package/resources/targets/claude/js3d/js3d/project/game.config.json +7 -0
  167. package/resources/targets/claude/js3d/js3d/project/index.html +12 -0
  168. package/resources/targets/claude/js3d/js3d/project/package.json +23 -0
  169. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  170. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  171. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  172. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  173. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  174. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  175. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  176. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  177. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  178. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  179. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  180. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  181. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  182. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  183. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  184. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  185. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  186. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  187. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  188. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  189. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  190. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  191. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  192. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  193. package/resources/targets/claude/js3d/js3d/project/scripts/config-export.mjs +15 -0
  194. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  195. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  196. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  197. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  198. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  199. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  200. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  201. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  202. package/resources/targets/claude/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  203. package/resources/targets/claude/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  204. package/resources/targets/claude/js3d/js3d/project/src/display/viewport.ts +239 -0
  205. package/resources/targets/claude/js3d/js3d/project/src/main.ts +85 -0
  206. package/resources/targets/claude/js3d/js3d/project/src/platform.ts +2 -0
  207. package/resources/targets/claude/js3d/js3d/project/src/style.css +83 -0
  208. package/resources/targets/claude/js3d/js3d/project/tsconfig.json +20 -0
  209. package/resources/targets/claude/js3d/js3d/project/unified_data_control_config.json +20 -0
  210. package/resources/targets/claude/js3d/js3d/project/vite.config.ts +5 -0
  211. package/resources/targets/claude/js3d/recovery.md +17 -0
  212. package/resources/targets/claude/js3d/target.json +60 -0
  213. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +7 -1
  214. package/resources/targets/codebuddy/js/context-filter-report.json +27 -0
  215. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +24 -29
  216. package/resources/targets/codebuddy/js/craft-game-maker/js.md +2 -2
  217. package/resources/targets/codebuddy/js/js/bundle.json +16 -18
  218. package/resources/targets/codebuddy/js/js/context/AGENTS.md +10 -6
  219. package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  220. package/resources/targets/codebuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  221. package/resources/targets/codebuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  222. package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  223. package/resources/targets/codebuddy/js/js/context/skills/index.json +2 -14
  224. package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  225. package/resources/targets/codebuddy/js/recovery.md +14 -4
  226. package/resources/targets/codebuddy/js/target.json +1 -1
  227. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +7 -1
  228. package/resources/targets/codebuddy/js3d/context-filter-report.json +27 -0
  229. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +24 -29
  230. package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +3 -4
  231. package/resources/targets/codebuddy/js3d/js3d/bundle.json +19 -21
  232. package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +10 -6
  233. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  234. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  235. package/resources/targets/{codex/js3d/js3d/context/skills/asset-search/references/resource-config.md → codebuddy/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  236. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  237. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  238. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  239. package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +4 -16
  240. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  241. package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  242. package/resources/targets/codebuddy/js3d/recovery.md +14 -4
  243. package/resources/targets/codebuddy/js3d/target.json +1 -1
  244. package/resources/targets/codex/js/bootstrap/SKILL.md +7 -1
  245. package/resources/targets/codex/js/context-filter-report.json +27 -0
  246. package/resources/targets/codex/js/craft-game-maker/SKILL.md +24 -29
  247. package/resources/targets/codex/js/craft-game-maker/js.md +2 -2
  248. package/resources/targets/codex/js/js/bundle.json +16 -18
  249. package/resources/targets/codex/js/js/context/AGENTS.md +10 -6
  250. package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +4 -4
  251. package/resources/targets/codex/js/js/context/knowledge/AssetWiring.md +7 -0
  252. package/resources/targets/codex/js/js/context/knowledge/ResourceLoading.md +9 -0
  253. package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +2 -2
  254. package/resources/targets/codex/js/js/context/skills/index.json +2 -14
  255. package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +1 -1
  256. package/resources/targets/codex/js/recovery.md +14 -4
  257. package/resources/targets/codex/js/target.json +1 -1
  258. package/resources/targets/codex/js3d/bootstrap/SKILL.md +7 -1
  259. package/resources/targets/codex/js3d/context-filter-report.json +27 -0
  260. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +24 -29
  261. package/resources/targets/codex/js3d/craft-game-maker/js3d.md +3 -4
  262. package/resources/targets/codex/js3d/js3d/bundle.json +19 -21
  263. package/resources/targets/codex/js3d/js3d/context/AGENTS.md +10 -6
  264. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  265. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  266. package/resources/targets/{codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → codex/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  267. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  268. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  269. package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  270. package/resources/targets/codex/js3d/js3d/context/skills/index.json +4 -16
  271. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  272. package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  273. package/resources/targets/codex/js3d/recovery.md +14 -4
  274. package/resources/targets/codex/js3d/target.json +1 -1
  275. package/resources/targets/cursor/js/bootstrap/SKILL.md +20 -0
  276. package/resources/targets/cursor/js/context-filter-report.json +27 -0
  277. package/resources/targets/cursor/js/craft-game-maker/SKILL.md +72 -0
  278. package/resources/targets/cursor/js/craft-game-maker/js.md +10 -0
  279. package/resources/targets/cursor/js/js/bundle.json +97 -0
  280. package/resources/targets/cursor/js/js/context/AGENTS.md +29 -0
  281. package/resources/targets/cursor/js/js/context/hooks/hooks.json +14 -0
  282. package/resources/targets/cursor/js/js/context/knowledge/AssetUrl.md +9 -0
  283. package/resources/targets/cursor/js/js/context/knowledge/AssetWiring.md +7 -0
  284. package/resources/targets/cursor/js/js/context/knowledge/Layout.md +7 -0
  285. package/resources/targets/cursor/js/js/context/knowledge/Lifecycle.md +11 -0
  286. package/resources/targets/cursor/js/js/context/knowledge/ResourceLoading.md +9 -0
  287. package/resources/targets/cursor/js/js/context/skills/export-config/SKILL.md +16 -0
  288. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  289. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  290. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  291. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  292. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  293. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  294. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  295. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  296. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  297. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  298. package/resources/targets/cursor/js/js/context/skills/index.json +19 -0
  299. package/resources/targets/cursor/js/js/context/skills/visual-qa/SKILL.md +14 -0
  300. package/resources/targets/cursor/js/js/project/README.md +7 -0
  301. package/resources/targets/cursor/js/js/project/configs/assets.json +1 -0
  302. package/resources/targets/cursor/js/js/project/configs/game.controls.json +3 -0
  303. package/resources/targets/cursor/js/js/project/configs/game.json +3 -0
  304. package/resources/targets/cursor/js/js/project/game-runtime.json +7 -0
  305. package/resources/targets/cursor/js/js/project/game.config.json +7 -0
  306. package/resources/targets/cursor/js/js/project/index.html +20 -0
  307. package/resources/targets/cursor/js/js/project/package.json +22 -0
  308. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  309. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  310. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  311. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  312. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  313. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  314. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  315. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  316. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  317. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  318. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  319. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  320. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  321. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  322. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  323. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  324. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  325. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  326. package/resources/targets/cursor/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  327. package/resources/targets/cursor/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  328. package/resources/targets/cursor/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  329. package/resources/targets/cursor/js/js/project/scripts/config-export.mjs +13 -0
  330. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  331. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  332. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  333. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  334. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  335. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  336. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  337. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  338. package/resources/targets/cursor/js/js/project/scripts/write-preview-ready.mjs +22 -0
  339. package/resources/targets/cursor/js/js/project/src/display/ui-stage.ts +156 -0
  340. package/resources/targets/cursor/js/js/project/src/display/viewport.ts +249 -0
  341. package/resources/targets/cursor/js/js/project/src/main.ts +87 -0
  342. package/resources/targets/cursor/js/js/project/src/platform.ts +2 -0
  343. package/resources/targets/cursor/js/js/project/src/scenes/LoadScene.ts +89 -0
  344. package/resources/targets/cursor/js/js/project/src/scenes/PlayScene.ts +17 -0
  345. package/resources/targets/cursor/js/js/project/src/screenUi.ts +185 -0
  346. package/resources/targets/cursor/js/js/project/src/style.css +294 -0
  347. package/resources/targets/cursor/js/js/project/tsconfig.json +20 -0
  348. package/resources/targets/cursor/js/js/project/unified_data_control_config.json +20 -0
  349. package/resources/targets/cursor/js/js/project/vite.config.ts +5 -0
  350. package/resources/targets/cursor/js/recovery.md +17 -0
  351. package/resources/targets/cursor/js/target.json +61 -0
  352. package/resources/targets/cursor/js3d/bootstrap/SKILL.md +20 -0
  353. package/resources/targets/cursor/js3d/context-filter-report.json +27 -0
  354. package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +72 -0
  355. package/resources/targets/cursor/js3d/craft-game-maker/js3d.md +12 -0
  356. package/resources/targets/cursor/js3d/js3d/bundle.json +108 -0
  357. package/resources/targets/cursor/js3d/js3d/context/AGENTS.md +30 -0
  358. package/resources/targets/cursor/js3d/js3d/context/hooks/hooks.json +14 -0
  359. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  360. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  361. package/resources/targets/cursor/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  362. package/resources/targets/cursor/js3d/js3d/context/knowledge/Layout.md +7 -0
  363. package/resources/targets/cursor/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  364. package/resources/targets/cursor/js3d/js3d/context/knowledge/Runtime.md +9 -0
  365. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  366. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  367. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  368. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  369. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  370. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  371. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  372. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  373. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  374. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  375. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  376. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  377. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  378. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  379. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  380. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  381. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  382. package/resources/targets/cursor/js3d/js3d/context/skills/index.json +31 -0
  383. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  384. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  385. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  386. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  387. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  388. package/resources/targets/cursor/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  389. package/resources/targets/cursor/js3d/js3d/project/README.md +7 -0
  390. package/resources/targets/cursor/js3d/js3d/project/configs/game.controls.json +3 -0
  391. package/resources/targets/cursor/js3d/js3d/project/configs/game.json +3 -0
  392. package/resources/targets/cursor/js3d/js3d/project/game-runtime.json +7 -0
  393. package/resources/targets/cursor/js3d/js3d/project/game.config.json +7 -0
  394. package/resources/targets/cursor/js3d/js3d/project/index.html +12 -0
  395. package/resources/targets/cursor/js3d/js3d/project/package.json +23 -0
  396. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  397. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  398. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  399. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  400. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  401. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  402. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  403. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  404. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  405. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  406. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  407. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  408. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  409. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  410. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  411. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  412. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  413. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  414. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  415. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  416. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  417. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  418. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  419. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  420. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export.mjs +15 -0
  421. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  422. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  423. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  424. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  425. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  426. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  427. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  428. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  429. package/resources/targets/cursor/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  430. package/resources/targets/cursor/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  431. package/resources/targets/cursor/js3d/js3d/project/src/display/viewport.ts +239 -0
  432. package/resources/targets/cursor/js3d/js3d/project/src/main.ts +85 -0
  433. package/resources/targets/cursor/js3d/js3d/project/src/platform.ts +2 -0
  434. package/resources/targets/cursor/js3d/js3d/project/src/style.css +83 -0
  435. package/resources/targets/cursor/js3d/js3d/project/tsconfig.json +20 -0
  436. package/resources/targets/cursor/js3d/js3d/project/unified_data_control_config.json +20 -0
  437. package/resources/targets/cursor/js3d/js3d/project/vite.config.ts +5 -0
  438. package/resources/targets/cursor/js3d/recovery.md +17 -0
  439. package/resources/targets/cursor/js3d/target.json +60 -0
  440. package/resources/targets/dsh/js/bootstrap/SKILL.md +20 -0
  441. package/resources/targets/dsh/js/context-filter-report.json +27 -0
  442. package/resources/targets/dsh/js/craft-game-maker/SKILL.md +72 -0
  443. package/resources/targets/dsh/js/craft-game-maker/js.md +10 -0
  444. package/resources/targets/dsh/js/js/bundle.json +97 -0
  445. package/resources/targets/dsh/js/js/context/AGENTS.md +29 -0
  446. package/resources/targets/dsh/js/js/context/hooks/hooks.json +14 -0
  447. package/resources/targets/dsh/js/js/context/knowledge/AssetUrl.md +9 -0
  448. package/resources/targets/dsh/js/js/context/knowledge/AssetWiring.md +7 -0
  449. package/resources/targets/dsh/js/js/context/knowledge/Layout.md +7 -0
  450. package/resources/targets/dsh/js/js/context/knowledge/Lifecycle.md +11 -0
  451. package/resources/targets/dsh/js/js/context/knowledge/ResourceLoading.md +9 -0
  452. package/resources/targets/dsh/js/js/context/skills/export-config/SKILL.md +16 -0
  453. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  454. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  455. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  456. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  457. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  458. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  459. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  460. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  461. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  462. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  463. package/resources/targets/dsh/js/js/context/skills/index.json +19 -0
  464. package/resources/targets/dsh/js/js/context/skills/visual-qa/SKILL.md +14 -0
  465. package/resources/targets/dsh/js/js/project/README.md +7 -0
  466. package/resources/targets/dsh/js/js/project/configs/assets.json +1 -0
  467. package/resources/targets/dsh/js/js/project/configs/game.controls.json +3 -0
  468. package/resources/targets/dsh/js/js/project/configs/game.json +3 -0
  469. package/resources/targets/dsh/js/js/project/game-runtime.json +7 -0
  470. package/resources/targets/dsh/js/js/project/game.config.json +7 -0
  471. package/resources/targets/dsh/js/js/project/index.html +20 -0
  472. package/resources/targets/dsh/js/js/project/package.json +22 -0
  473. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  474. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  475. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  476. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  477. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  478. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  479. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  480. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  481. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  482. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  483. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  484. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  485. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  486. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  487. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  488. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  489. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  490. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  491. package/resources/targets/dsh/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  492. package/resources/targets/dsh/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  493. package/resources/targets/dsh/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  494. package/resources/targets/dsh/js/js/project/scripts/config-export.mjs +13 -0
  495. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  496. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  497. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  498. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  499. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  500. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  501. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  502. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  503. package/resources/targets/dsh/js/js/project/scripts/write-preview-ready.mjs +22 -0
  504. package/resources/targets/dsh/js/js/project/src/display/ui-stage.ts +156 -0
  505. package/resources/targets/dsh/js/js/project/src/display/viewport.ts +249 -0
  506. package/resources/targets/dsh/js/js/project/src/main.ts +87 -0
  507. package/resources/targets/dsh/js/js/project/src/platform.ts +2 -0
  508. package/resources/targets/dsh/js/js/project/src/scenes/LoadScene.ts +89 -0
  509. package/resources/targets/dsh/js/js/project/src/scenes/PlayScene.ts +17 -0
  510. package/resources/targets/dsh/js/js/project/src/screenUi.ts +185 -0
  511. package/resources/targets/dsh/js/js/project/src/style.css +294 -0
  512. package/resources/targets/dsh/js/js/project/tsconfig.json +20 -0
  513. package/resources/targets/dsh/js/js/project/unified_data_control_config.json +20 -0
  514. package/resources/targets/dsh/js/js/project/vite.config.ts +5 -0
  515. package/resources/targets/dsh/js/recovery.md +17 -0
  516. package/resources/targets/dsh/js/target.json +61 -0
  517. package/resources/targets/dsh/js3d/bootstrap/SKILL.md +20 -0
  518. package/resources/targets/dsh/js3d/context-filter-report.json +27 -0
  519. package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +72 -0
  520. package/resources/targets/dsh/js3d/craft-game-maker/js3d.md +12 -0
  521. package/resources/targets/dsh/js3d/js3d/bundle.json +108 -0
  522. package/resources/targets/dsh/js3d/js3d/context/AGENTS.md +30 -0
  523. package/resources/targets/dsh/js3d/js3d/context/hooks/hooks.json +14 -0
  524. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  525. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  526. package/resources/targets/dsh/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  527. package/resources/targets/dsh/js3d/js3d/context/knowledge/Layout.md +7 -0
  528. package/resources/targets/dsh/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  529. package/resources/targets/dsh/js3d/js3d/context/knowledge/Runtime.md +9 -0
  530. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  531. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  532. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  533. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  534. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  535. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  536. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  537. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  538. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  539. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  540. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  541. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  542. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  543. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  544. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  545. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  546. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  547. package/resources/targets/dsh/js3d/js3d/context/skills/index.json +31 -0
  548. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  549. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  550. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  551. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  552. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  553. package/resources/targets/dsh/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  554. package/resources/targets/dsh/js3d/js3d/project/README.md +7 -0
  555. package/resources/targets/dsh/js3d/js3d/project/configs/game.controls.json +3 -0
  556. package/resources/targets/dsh/js3d/js3d/project/configs/game.json +3 -0
  557. package/resources/targets/dsh/js3d/js3d/project/game-runtime.json +7 -0
  558. package/resources/targets/dsh/js3d/js3d/project/game.config.json +7 -0
  559. package/resources/targets/dsh/js3d/js3d/project/index.html +12 -0
  560. package/resources/targets/dsh/js3d/js3d/project/package.json +23 -0
  561. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  562. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  563. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  564. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  565. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  566. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  567. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  568. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  569. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  570. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  571. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  572. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  573. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  574. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  575. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  576. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  577. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  578. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  579. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  580. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  581. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  582. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  583. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  584. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  585. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export.mjs +15 -0
  586. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  587. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  588. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  589. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  590. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  591. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  592. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  593. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  594. package/resources/targets/dsh/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  595. package/resources/targets/dsh/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  596. package/resources/targets/dsh/js3d/js3d/project/src/display/viewport.ts +239 -0
  597. package/resources/targets/dsh/js3d/js3d/project/src/main.ts +85 -0
  598. package/resources/targets/dsh/js3d/js3d/project/src/platform.ts +2 -0
  599. package/resources/targets/dsh/js3d/js3d/project/src/style.css +83 -0
  600. package/resources/targets/dsh/js3d/js3d/project/tsconfig.json +20 -0
  601. package/resources/targets/dsh/js3d/js3d/project/unified_data_control_config.json +20 -0
  602. package/resources/targets/dsh/js3d/js3d/project/vite.config.ts +5 -0
  603. package/resources/targets/dsh/js3d/recovery.md +17 -0
  604. package/resources/targets/dsh/js3d/target.json +60 -0
  605. package/resources/targets/index.json +72 -12
  606. package/resources/targets/kimi/js/bootstrap/SKILL.md +20 -0
  607. package/resources/targets/kimi/js/context-filter-report.json +27 -0
  608. package/resources/targets/kimi/js/craft-game-maker/SKILL.md +72 -0
  609. package/resources/targets/kimi/js/craft-game-maker/js.md +10 -0
  610. package/resources/targets/kimi/js/js/bundle.json +97 -0
  611. package/resources/targets/kimi/js/js/context/AGENTS.md +29 -0
  612. package/resources/targets/kimi/js/js/context/hooks/hooks.json +14 -0
  613. package/resources/targets/kimi/js/js/context/knowledge/AssetUrl.md +9 -0
  614. package/resources/targets/kimi/js/js/context/knowledge/AssetWiring.md +7 -0
  615. package/resources/targets/kimi/js/js/context/knowledge/Layout.md +7 -0
  616. package/resources/targets/kimi/js/js/context/knowledge/Lifecycle.md +11 -0
  617. package/resources/targets/kimi/js/js/context/knowledge/ResourceLoading.md +9 -0
  618. package/resources/targets/kimi/js/js/context/skills/export-config/SKILL.md +16 -0
  619. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  620. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  621. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  622. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  623. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  624. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  625. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  626. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  627. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  628. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  629. package/resources/targets/kimi/js/js/context/skills/index.json +19 -0
  630. package/resources/targets/kimi/js/js/context/skills/visual-qa/SKILL.md +14 -0
  631. package/resources/targets/kimi/js/js/project/README.md +7 -0
  632. package/resources/targets/kimi/js/js/project/configs/assets.json +1 -0
  633. package/resources/targets/kimi/js/js/project/configs/game.controls.json +3 -0
  634. package/resources/targets/kimi/js/js/project/configs/game.json +3 -0
  635. package/resources/targets/kimi/js/js/project/game-runtime.json +7 -0
  636. package/resources/targets/kimi/js/js/project/game.config.json +7 -0
  637. package/resources/targets/kimi/js/js/project/index.html +20 -0
  638. package/resources/targets/kimi/js/js/project/package.json +22 -0
  639. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  640. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  641. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  642. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  643. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  644. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  645. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  646. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  647. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  648. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  649. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  650. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  651. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  652. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  653. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  654. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  655. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  656. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  657. package/resources/targets/kimi/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  658. package/resources/targets/kimi/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  659. package/resources/targets/kimi/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  660. package/resources/targets/kimi/js/js/project/scripts/config-export.mjs +13 -0
  661. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  662. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  663. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  664. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  665. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  666. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  667. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  668. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  669. package/resources/targets/kimi/js/js/project/scripts/write-preview-ready.mjs +22 -0
  670. package/resources/targets/kimi/js/js/project/src/display/ui-stage.ts +156 -0
  671. package/resources/targets/kimi/js/js/project/src/display/viewport.ts +249 -0
  672. package/resources/targets/kimi/js/js/project/src/main.ts +87 -0
  673. package/resources/targets/kimi/js/js/project/src/platform.ts +2 -0
  674. package/resources/targets/kimi/js/js/project/src/scenes/LoadScene.ts +89 -0
  675. package/resources/targets/kimi/js/js/project/src/scenes/PlayScene.ts +17 -0
  676. package/resources/targets/kimi/js/js/project/src/screenUi.ts +185 -0
  677. package/resources/targets/kimi/js/js/project/src/style.css +294 -0
  678. package/resources/targets/kimi/js/js/project/tsconfig.json +20 -0
  679. package/resources/targets/kimi/js/js/project/unified_data_control_config.json +20 -0
  680. package/resources/targets/kimi/js/js/project/vite.config.ts +5 -0
  681. package/resources/targets/kimi/js/recovery.md +17 -0
  682. package/resources/targets/kimi/js/target.json +61 -0
  683. package/resources/targets/kimi/js3d/bootstrap/SKILL.md +20 -0
  684. package/resources/targets/kimi/js3d/context-filter-report.json +27 -0
  685. package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +72 -0
  686. package/resources/targets/kimi/js3d/craft-game-maker/js3d.md +12 -0
  687. package/resources/targets/kimi/js3d/js3d/bundle.json +108 -0
  688. package/resources/targets/kimi/js3d/js3d/context/AGENTS.md +30 -0
  689. package/resources/targets/kimi/js3d/js3d/context/hooks/hooks.json +14 -0
  690. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  691. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  692. package/resources/targets/kimi/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  693. package/resources/targets/kimi/js3d/js3d/context/knowledge/Layout.md +7 -0
  694. package/resources/targets/kimi/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  695. package/resources/targets/kimi/js3d/js3d/context/knowledge/Runtime.md +9 -0
  696. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  697. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  698. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  699. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  700. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  701. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  702. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  703. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  704. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  705. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  706. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  707. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  708. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  709. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  710. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  711. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  712. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  713. package/resources/targets/kimi/js3d/js3d/context/skills/index.json +31 -0
  714. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  715. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  716. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  717. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  718. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  719. package/resources/targets/kimi/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  720. package/resources/targets/kimi/js3d/js3d/project/README.md +7 -0
  721. package/resources/targets/kimi/js3d/js3d/project/configs/game.controls.json +3 -0
  722. package/resources/targets/kimi/js3d/js3d/project/configs/game.json +3 -0
  723. package/resources/targets/kimi/js3d/js3d/project/game-runtime.json +7 -0
  724. package/resources/targets/kimi/js3d/js3d/project/game.config.json +7 -0
  725. package/resources/targets/kimi/js3d/js3d/project/index.html +12 -0
  726. package/resources/targets/kimi/js3d/js3d/project/package.json +23 -0
  727. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  728. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  729. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  730. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  731. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  732. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  733. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  734. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  735. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  736. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  737. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  738. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  739. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  740. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  741. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  742. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  743. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  744. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  745. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  746. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  747. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  748. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  749. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  750. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  751. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export.mjs +15 -0
  752. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  753. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  754. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  755. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  756. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  757. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  758. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  759. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  760. package/resources/targets/kimi/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  761. package/resources/targets/kimi/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  762. package/resources/targets/kimi/js3d/js3d/project/src/display/viewport.ts +239 -0
  763. package/resources/targets/kimi/js3d/js3d/project/src/main.ts +85 -0
  764. package/resources/targets/kimi/js3d/js3d/project/src/platform.ts +2 -0
  765. package/resources/targets/kimi/js3d/js3d/project/src/style.css +83 -0
  766. package/resources/targets/kimi/js3d/js3d/project/tsconfig.json +20 -0
  767. package/resources/targets/kimi/js3d/js3d/project/unified_data_control_config.json +20 -0
  768. package/resources/targets/kimi/js3d/js3d/project/vite.config.ts +5 -0
  769. package/resources/targets/kimi/js3d/recovery.md +17 -0
  770. package/resources/targets/kimi/js3d/target.json +60 -0
  771. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +9 -1
  772. package/resources/targets/workbuddy/js/context-filter-report.json +27 -0
  773. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +24 -29
  774. package/resources/targets/workbuddy/js/craft-game-maker/js.md +2 -2
  775. package/resources/targets/workbuddy/js/js/bundle.json +16 -18
  776. package/resources/targets/workbuddy/js/js/context/AGENTS.md +10 -6
  777. package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  778. package/resources/targets/workbuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  779. package/resources/targets/workbuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  780. package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  781. package/resources/targets/workbuddy/js/js/context/skills/index.json +2 -14
  782. package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  783. package/resources/targets/workbuddy/js/recovery.md +16 -4
  784. package/resources/targets/workbuddy/js/target.json +1 -1
  785. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +9 -1
  786. package/resources/targets/workbuddy/js3d/context-filter-report.json +27 -0
  787. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +24 -29
  788. package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +3 -4
  789. package/resources/targets/workbuddy/js3d/js3d/bundle.json +19 -21
  790. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +10 -6
  791. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  792. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  793. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  794. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  795. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  796. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  797. package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +4 -16
  798. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  799. package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  800. package/resources/targets/workbuddy/js3d/recovery.md +16 -4
  801. package/resources/targets/workbuddy/js3d/target.json +1 -1
  802. package/resources/targets/zcode/js/bootstrap/SKILL.md +20 -0
  803. package/resources/targets/zcode/js/context-filter-report.json +27 -0
  804. package/resources/targets/zcode/js/craft-game-maker/SKILL.md +72 -0
  805. package/resources/targets/zcode/js/craft-game-maker/js.md +10 -0
  806. package/resources/targets/zcode/js/js/bundle.json +97 -0
  807. package/resources/targets/zcode/js/js/context/AGENTS.md +29 -0
  808. package/resources/targets/zcode/js/js/context/hooks/hooks.json +14 -0
  809. package/resources/targets/zcode/js/js/context/knowledge/AssetUrl.md +9 -0
  810. package/resources/targets/zcode/js/js/context/knowledge/AssetWiring.md +7 -0
  811. package/resources/targets/zcode/js/js/context/knowledge/Layout.md +7 -0
  812. package/resources/targets/zcode/js/js/context/knowledge/Lifecycle.md +11 -0
  813. package/resources/targets/zcode/js/js/context/knowledge/ResourceLoading.md +9 -0
  814. package/resources/targets/zcode/js/js/context/skills/export-config/SKILL.md +16 -0
  815. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  816. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  817. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  818. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  819. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  820. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  821. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  822. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  823. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  824. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  825. package/resources/targets/zcode/js/js/context/skills/index.json +19 -0
  826. package/resources/targets/zcode/js/js/context/skills/visual-qa/SKILL.md +14 -0
  827. package/resources/targets/zcode/js/js/project/README.md +7 -0
  828. package/resources/targets/zcode/js/js/project/configs/assets.json +1 -0
  829. package/resources/targets/zcode/js/js/project/configs/game.controls.json +3 -0
  830. package/resources/targets/zcode/js/js/project/configs/game.json +3 -0
  831. package/resources/targets/zcode/js/js/project/game-runtime.json +7 -0
  832. package/resources/targets/zcode/js/js/project/game.config.json +7 -0
  833. package/resources/targets/zcode/js/js/project/index.html +20 -0
  834. package/resources/targets/zcode/js/js/project/package.json +22 -0
  835. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  836. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  837. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  838. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  839. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  840. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  841. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  842. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  843. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  844. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  845. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  846. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  847. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  848. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  849. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  850. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  851. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  852. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  853. package/resources/targets/zcode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  854. package/resources/targets/zcode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  855. package/resources/targets/zcode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  856. package/resources/targets/zcode/js/js/project/scripts/config-export.mjs +13 -0
  857. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  858. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  859. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  860. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  861. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  862. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  863. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  864. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  865. package/resources/targets/zcode/js/js/project/scripts/write-preview-ready.mjs +22 -0
  866. package/resources/targets/zcode/js/js/project/src/display/ui-stage.ts +156 -0
  867. package/resources/targets/zcode/js/js/project/src/display/viewport.ts +249 -0
  868. package/resources/targets/zcode/js/js/project/src/main.ts +87 -0
  869. package/resources/targets/zcode/js/js/project/src/platform.ts +2 -0
  870. package/resources/targets/zcode/js/js/project/src/scenes/LoadScene.ts +89 -0
  871. package/resources/targets/zcode/js/js/project/src/scenes/PlayScene.ts +17 -0
  872. package/resources/targets/zcode/js/js/project/src/screenUi.ts +185 -0
  873. package/resources/targets/zcode/js/js/project/src/style.css +294 -0
  874. package/resources/targets/zcode/js/js/project/tsconfig.json +20 -0
  875. package/resources/targets/zcode/js/js/project/unified_data_control_config.json +20 -0
  876. package/resources/targets/zcode/js/js/project/vite.config.ts +5 -0
  877. package/resources/targets/zcode/js/recovery.md +17 -0
  878. package/resources/targets/zcode/js/target.json +61 -0
  879. package/resources/targets/zcode/js3d/bootstrap/SKILL.md +20 -0
  880. package/resources/targets/zcode/js3d/context-filter-report.json +27 -0
  881. package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +72 -0
  882. package/resources/targets/zcode/js3d/craft-game-maker/js3d.md +12 -0
  883. package/resources/targets/zcode/js3d/js3d/bundle.json +108 -0
  884. package/resources/targets/zcode/js3d/js3d/context/AGENTS.md +30 -0
  885. package/resources/targets/zcode/js3d/js3d/context/hooks/hooks.json +14 -0
  886. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  887. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  888. package/resources/targets/zcode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  889. package/resources/targets/zcode/js3d/js3d/context/knowledge/Layout.md +7 -0
  890. package/resources/targets/zcode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  891. package/resources/targets/zcode/js3d/js3d/context/knowledge/Runtime.md +9 -0
  892. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  893. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  894. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  895. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  896. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  897. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  898. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  899. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  900. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  901. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  902. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  903. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  904. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  905. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  906. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  907. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  908. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  909. package/resources/targets/zcode/js3d/js3d/context/skills/index.json +31 -0
  910. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  911. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  912. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  913. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  914. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  915. package/resources/targets/zcode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  916. package/resources/targets/zcode/js3d/js3d/project/README.md +7 -0
  917. package/resources/targets/zcode/js3d/js3d/project/configs/game.controls.json +3 -0
  918. package/resources/targets/zcode/js3d/js3d/project/configs/game.json +3 -0
  919. package/resources/targets/zcode/js3d/js3d/project/game-runtime.json +7 -0
  920. package/resources/targets/zcode/js3d/js3d/project/game.config.json +7 -0
  921. package/resources/targets/zcode/js3d/js3d/project/index.html +12 -0
  922. package/resources/targets/zcode/js3d/js3d/project/package.json +23 -0
  923. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  924. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  925. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  926. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  927. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  928. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  929. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  930. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  931. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  932. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  933. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  934. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  935. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  936. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  937. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  938. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  939. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  940. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  941. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  942. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  943. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  944. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  945. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  946. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  947. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export.mjs +15 -0
  948. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  949. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  950. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  951. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  952. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  953. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  954. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  955. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  956. package/resources/targets/zcode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  957. package/resources/targets/zcode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  958. package/resources/targets/zcode/js3d/js3d/project/src/display/viewport.ts +239 -0
  959. package/resources/targets/zcode/js3d/js3d/project/src/main.ts +85 -0
  960. package/resources/targets/zcode/js3d/js3d/project/src/platform.ts +2 -0
  961. package/resources/targets/zcode/js3d/js3d/project/src/style.css +83 -0
  962. package/resources/targets/zcode/js3d/js3d/project/tsconfig.json +20 -0
  963. package/resources/targets/zcode/js3d/js3d/project/unified_data_control_config.json +20 -0
  964. package/resources/targets/zcode/js3d/js3d/project/vite.config.ts +5 -0
  965. package/resources/targets/zcode/js3d/recovery.md +17 -0
  966. package/resources/targets/zcode/js3d/target.json +60 -0
  967. package/vendor/craft-runtime/SOURCE.json +3 -3
  968. package/vendor/craft-runtime/package.json +1 -1
  969. package/dist-server/game-workflow/publication-materials.mjs +0 -92
  970. package/dist-server/game-workflow/publications.mjs +0 -164
  971. package/dist-server/game-workflow/publish-capture-worker.mjs +0 -57
  972. package/dist-server/game-workflow/publish-capture.mjs +0 -75
  973. package/dist-server/mcp/publication-page.html +0 -86
  974. package/dist-server/mcp/publication-page.mjs +0 -375
  975. package/dist-server/mcp/publication-preview.mjs +0 -63
  976. package/dist-server/mcp/publication-tools.mjs +0 -22
  977. package/dist-server/mcp/publish-panel.mjs +0 -205
  978. package/dist-server/upstream/publication-transport.mjs +0 -101
  979. package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  980. package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  981. package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  982. package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  983. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  984. package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  985. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  986. package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +0 -9
  987. package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  988. package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +0 -12
  989. package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  990. package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  991. package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  992. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  993. package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  994. package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  995. package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  996. package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  997. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  998. package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  999. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
@@ -0,0 +1,72 @@
1
+ import { resolve, relative, join } from 'node:path';
2
+ import { createRequire } from 'node:module';
3
+ import { readFile, writeFile } from 'node:fs/promises';
4
+ import { verifyRuntime } from './project.mjs';
5
+
6
+ export function lightgame(options = {}) {
7
+ const virtualId = 'virtual:lightgame/bootstrap';
8
+ const resolvedId = `\0${virtualId}`;
9
+ const entry = options.entry ?? '/src/main.ts';
10
+ let root, outDir, manifest;
11
+ return {
12
+ name: 'lightgame-platform',
13
+ enforce: 'pre',
14
+ async configResolved(config) {
15
+ root = config.root;
16
+ outDir = resolve(root, config.build.outDir);
17
+ ({ manifest } = await verifyRuntime(root));
18
+ const packageJson = JSON.parse(await readFile(join(root, 'package.json'), 'utf8'));
19
+ const require = createRequire(join(root, 'package.json'));
20
+ for (const dependency of ['vite', 'three', 'phaser']) {
21
+ const expected = packageJson.dependencies?.[dependency] ?? packageJson.devDependencies?.[dependency];
22
+ if (!expected) continue;
23
+ const packagePath = dependency === 'three'
24
+ ? resolve(require.resolve('three'), '..', '..', 'package.json')
25
+ : require.resolve(`${dependency}/package.json`);
26
+ const actual = JSON.parse(await readFile(packagePath, 'utf8')).version;
27
+ if (actual !== expected) throw new Error(`[LightGame] ${dependency} version mismatch: project requires ${expected}, toolchain provides ${actual}. Align the toolchain; do not silently fall back.`);
28
+ }
29
+ },
30
+ resolveId(id) {
31
+ if (id === virtualId || id === `/${virtualId}`) return resolvedId;
32
+ },
33
+ load(id) {
34
+ if (id !== resolvedId) return;
35
+ const runtimeUrl = `/${relative(root, resolve(root, manifest.root, 'platform/platform.mjs')).replaceAll('\\', '/')}`;
36
+ const identityUrl = `/${relative(root, resolve(root, manifest.root, 'platform/platform-service.mjs')).replaceAll('\\', '/')}`;
37
+ return `let bridge;
38
+ try { const sdk = await import(${JSON.stringify(runtimeUrl)}); bridge = sdk.startPlatform(); } catch (error) { console.error('[LightGame] platform startup failed', error); }
39
+ if (new URLSearchParams(window.location.search).has('qq_test')) {
40
+ try {
41
+ const { getPlatformService } = await import(${JSON.stringify(identityUrl)});
42
+ void getPlatformService({ initTimeoutMs: 20000 }).init();
43
+ } catch (error) { console.error('[LightGame] QQ identity startup failed', error); }
44
+ }
45
+ try { await import(${JSON.stringify(entry)}); } catch (error) { console.error('[LightGame] game startup failed', error); throw error; }
46
+ if (import.meta.hot) import.meta.hot.dispose(() => bridge?.dispose());
47
+ `;
48
+ },
49
+ transformIndexHtml: {
50
+ order: 'pre',
51
+ handler(html) {
52
+ let matched = 0;
53
+ const target = entry.replace(/^\.?\//, '');
54
+ const transformed = html.replace(/<script\b([^>]*?)\bsrc\s*=\s*(["'])([^"']+)\2([^>]*)>\s*<\/script>/gi, (tag, before, quote, source) => {
55
+ if (source.replace(/^\.?\//, '') !== target) return tag;
56
+ matched++;
57
+ return `<script type="module" src="/${virtualId}"></script>`;
58
+ });
59
+ if (matched !== 1) throw new Error(`[LightGame] expected exactly one ${entry} module script in index.html, found ${matched}`);
60
+ return transformed;
61
+ },
62
+ },
63
+ async closeBundle() {
64
+ if (options.profile === false || !outDir) return;
65
+ let html;
66
+ try { html = await readFile(join(outDir, 'index.html'), 'utf8'); }
67
+ catch (error) { if (error.code === 'ENOENT') return; throw error; }
68
+ const tag = '<script src="https://file.craft.qq.com/QA/profile_toolbox.js"></script>';
69
+ await writeFile(join(outDir, 'index_profile.html'), html.replace('</head>', ` ${tag}\n</head>`), 'utf8');
70
+ },
71
+ };
72
+ }
@@ -0,0 +1,24 @@
1
+ export interface AssetUrlOptions { cdnBaseUrl?: string; baseUrl?: string }
2
+ export function resolveAssetUrl(path: string, options?: AssetUrlOptions): string;
3
+ export function decodeImage(blob: Blob, options?: { signal?: AbortSignal }): Promise<ImageBitmap | HTMLImageElement>;
4
+ export interface AssetProgress { active: number; queued: number; completed: number; total: number; ratio: number }
5
+ export interface AssetLoadOptions { type?: string; signal?: AbortSignal }
6
+ export interface AssetLoaderOptions extends AssetUrlOptions {
7
+ concurrency?: number;
8
+ fetch?: typeof fetch;
9
+ decodeImage?: (blob: Blob, options: { signal: AbortSignal }) => Promise<unknown>;
10
+ loaders?: Record<string, (url: string, options: { signal: AbortSignal }) => Promise<unknown>>;
11
+ disposeResource?: (value: unknown, type: string) => void;
12
+ onProgress?: (progress: AssetProgress) => void;
13
+ }
14
+ export interface AssetLoader {
15
+ load<T = ImageBitmap | HTMLImageElement>(path: string, options?: AssetLoadOptions): Promise<T>;
16
+ loadAll<T = unknown>(items: readonly (string | ({ path: string } & AssetLoadOptions))[], options?: { signal?: AbortSignal }): Promise<T[]>;
17
+ get<T = unknown>(path: string, type?: string): T | undefined;
18
+ has(path: string, type?: string): boolean;
19
+ progress(): AssetProgress;
20
+ release(path: string, type?: string): boolean;
21
+ clear(): void;
22
+ dispose(): void;
23
+ }
24
+ export function createAssetLoader(options?: AssetLoaderOptions): AssetLoader;
@@ -0,0 +1,2 @@
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 abortError(){return new DOMException("Asset load cancelled","AbortError")}__name(abortError,"abortError");function disposeValue(value){value?.close?.()}__name(disposeValue,"disposeValue");async function decodeImage(blob,{signal}={}){if(signal?.aborted)throw signal.reason??abortError();if(typeof globalThis.createImageBitmap==="function"){const bitmap=await globalThis.createImageBitmap(blob);if(signal?.aborted){bitmap.close();throw signal.reason??abortError()}return bitmap}if(typeof globalThis.Image!=="function")throw new Error("Image decoding requires createImageBitmap or a browser Image");return new Promise((resolve,reject)=>{const image=new globalThis.Image;const url=URL.createObjectURL(blob);const cleanup=__name(()=>{image.onload=image.onerror=null;signal?.removeEventListener("abort",cancel);URL.revokeObjectURL(url)},"cleanup");const cancel=__name(()=>{cleanup();image.removeAttribute("src");reject(signal.reason??abortError())},"cancel");image.onload=()=>{cleanup();resolve(image)};image.onerror=()=>{cleanup();reject(new Error("Image decode failed"))};signal?.addEventListener("abort",cancel,{once:true});image.src=url})}__name(decodeImage,"decodeImage");function createAssetLoader(options={}){const concurrency=options.concurrency??4;if(!Number.isInteger(concurrency)||concurrency<1)throw new RangeError("concurrency must be a positive integer");const fetcher=options.fetch??globalThis.fetch;const imageDecoder=options.decodeImage??decodeImage;const cache=new Map;const pending=new Map;const queue=[];let active=0,total=0,completed=0,disposed=false;const keyFor=__name((path,type)=>`${type}
2
+ ${resolveAssetUrl(path,options)}`,"keyFor");const progress=__name(()=>({active,queued:queue.filter(j=>!j.controller.signal.aborted).length,completed,total,ratio:total?completed/total:1}),"progress");const report=__name(()=>{try{options.onProgress?.(progress())}catch{}},"report");const free=__name(entry=>{(options.disposeResource??disposeValue)(entry.value,entry.type)},"free");async function fetchValue(job){const{signal}=job.controller;if(options.loaders?.[job.type])return options.loaders[job.type](job.url,{signal});if(typeof fetcher!=="function")throw new Error("Provide fetch to load assets in this environment");const response=await fetcher(job.url,{signal});if(!response.ok)throw new Error(`HTTP ${response.status} loading ${job.url}`);switch(job.type){case"json":return response.json();case"text":return response.text();case"binary":return response.arrayBuffer();case"blob":return response.blob();case"image":return imageDecoder(await response.blob(),{signal});default:throw new TypeError(`Unknown asset type '${job.type}'; provide a loader for it`)}}__name(fetchValue,"fetchValue");function pump(){while(active<concurrency&&queue.length){const job=queue.shift();if(job.controller.signal.aborted){finish(job,void 0,job.controller.signal.reason??abortError());continue}active++;job.started=true;report();Promise.resolve().then(()=>fetchValue(job)).then(value=>{if(job.controller.signal.aborted||disposed){let cleanupError;try{free({value,type:job.type})}catch(error){cleanupError=error}finish(job,void 0,cleanupError??job.controller.signal.reason??abortError())}else finish(job,value)},error=>finish(job,void 0,error))}}__name(pump,"pump");function finish(job,value,error){if(job.started)active--;if(pending.get(job.key)===job)pending.delete(job.key);completed++;if(!error)cache.set(job.key,{value,type:job.type});else if(!job.controller.signal.aborted&&error?.name!=="AbortError")error=new Error(`Failed to load ${job.type} asset '${job.url}': ${error?.message??String(error)}`,{cause:error});for(const subscriber of job.subscribers){subscriber.cleanup();if(error)subscriber.reject(error);else subscriber.resolve(value)}job.subscribers.clear();report();queueMicrotask(pump)}__name(finish,"finish");function load(path,{type="image",signal}={}){if(disposed)return Promise.reject(new Error("Asset loader is disposed"));if(signal?.aborted)return Promise.reject(signal.reason??abortError());const url=resolveAssetUrl(path,options);const key=keyFor(path,type);if(cache.has(key))return Promise.resolve(cache.get(key).value);let job=pending.get(key);if(!job||job.controller.signal.aborted){job={key,url,type,controller:new AbortController,subscribers:new Set,started:false};pending.set(key,job);queue.push(job);total++}return new Promise((resolve,reject)=>{const cancel=__name(()=>{subscriber.cleanup();job.subscribers.delete(subscriber);reject(signal.reason??abortError());if(!job.subscribers.size)job.controller.abort(abortError())},"cancel");const subscriber={resolve,reject,cleanup:__name(()=>signal?.removeEventListener("abort",cancel),"cleanup")};job.subscribers.add(subscriber);signal?.addEventListener("abort",cancel,{once:true});pump()})}__name(load,"load");function release(path,type="image"){const key=keyFor(path,type);const job=pending.get(key);if(job){job.controller.abort(abortError());for(const sub of job.subscribers){sub.cleanup();sub.reject(job.controller.signal.reason)}job.subscribers.clear()}const entry=cache.get(key);if(entry){cache.delete(key);free(entry)}return Boolean(job||entry)}__name(release,"release");function clear(){for(const job of pending.values()){job.controller.abort(abortError());for(const sub of job.subscribers){sub.cleanup();sub.reject(job.controller.signal.reason)}job.subscribers.clear()}const entries=[...cache.values()];cache.clear();const errors=[];for(const entry of entries){try{free(entry)}catch(error){errors.push(error)}}if(errors.length)throw new AggregateError(errors,"Asset resource cleanup failed")}__name(clear,"clear");return{load,loadAll:__name((items,{signal}={})=>Promise.all(items.map(item=>typeof item==="string"?load(item,{signal}):load(item.path,{...item,signal:item.signal??signal}))),"loadAll"),get:__name((path,type="image")=>cache.get(keyFor(path,type))?.value,"get"),has:__name((path,type="image")=>cache.has(keyFor(path,type)),"has"),progress,release,clear,dispose(){if(!disposed){disposed=true;clear()}}}}__name(createAssetLoader,"createAssetLoader");export{createAssetLoader,decodeImage,resolveAssetUrl};
@@ -0,0 +1,10 @@
1
+ import type { AssetUrlOptions } from './assets.mjs';
2
+ export function supportsAstc(gl: WebGLRenderingContext | WebGL2RenderingContext): boolean;
3
+ export function toAstcKtxUrl(url: string): string | null;
4
+ export interface AstcTextureData { width: number; height: number; internalFormat: number; mipmaps: { width: number; height: number; data: Uint8Array }[] }
5
+ export function parseAstcKtx(buffer: ArrayBuffer): AstcTextureData;
6
+ export function loadAstcTexture(gl: WebGLRenderingContext | WebGL2RenderingContext, url: string, options?: AssetUrlOptions & {
7
+ fallbackUrl?: string; fetch?: typeof fetch; signal?: AbortSignal;
8
+ decodeImage?: (blob: Blob, options: { signal?: AbortSignal }) => Promise<ImageBitmap | HTMLImageElement>;
9
+ onFallback?: (error: unknown) => void;
10
+ }): Promise<{ texture: WebGLTexture; width: number; height: number; format: 'astc' | 'image'; 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 abortError(){return new DOMException("Asset load cancelled","AbortError")}__name(abortError,"abortError");async function decodeImage(blob,{signal}={}){if(signal?.aborted)throw signal.reason??abortError();if(typeof globalThis.createImageBitmap==="function"){const bitmap=await globalThis.createImageBitmap(blob);if(signal?.aborted){bitmap.close();throw signal.reason??abortError()}return bitmap}if(typeof globalThis.Image!=="function")throw new Error("Image decoding requires createImageBitmap or a browser Image");return new Promise((resolve,reject)=>{const image=new globalThis.Image;const url=URL.createObjectURL(blob);const cleanup=__name(()=>{image.onload=image.onerror=null;signal?.removeEventListener("abort",cancel);URL.revokeObjectURL(url)},"cleanup");const cancel=__name(()=>{cleanup();image.removeAttribute("src");reject(signal.reason??abortError())},"cancel");image.onload=()=>{cleanup();resolve(image)};image.onerror=()=>{cleanup();reject(new Error("Image decode failed"))};signal?.addEventListener("abort",cancel,{once:true});image.src=url})}__name(decodeImage,"decodeImage");function supportsAstc(gl){return Boolean(gl&&!gl.isContextLost?.()&&(gl.getExtension("WEBGL_compressed_texture_astc")||gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc")))}__name(supportsAstc,"supportsAstc");function toAstcKtxUrl(url){if(/^(?:data:|blob:)/i.test(url))return null;const match=String(url).match(/^([^?#]*)([?#].*)?$/);return match&&/\.(?:png|jpe?g)$/i.test(match[1])?`${match[1].replace(/\.(?:png|jpe?g)$/i,".ktx")}${match[2]??""}`:null}__name(toAstcKtxUrl,"toAstcKtxUrl");function parseAstcKtx(buffer){if(!(buffer instanceof ArrayBuffer)||buffer.byteLength<64)throw new TypeError("KTX v1 requires at least 64 bytes");const bytes=new Uint8Array(buffer),magic=[171,75,84,88,32,49,49,187,13,10,26,10];if(!magic.every((value,i)=>bytes[i]===value))throw new Error("Invalid KTX v1 identifier");const view=new DataView(buffer),marker=view.getUint32(12,true);if(marker!==67305985&&marker!==16909060)throw new Error("Invalid KTX byte order");const littleEndian=marker===67305985,read=__name(offset2=>view.getUint32(offset2,littleEndian),"read");const internalFormat=read(28),width=read(36),height=read(40),levels=read(56)||1;const formatIndex=internalFormat>=37808&&internalFormat<=37821?internalFormat-37808:internalFormat>=37840&&internalFormat<=37853?internalFormat-37840:-1;if(formatIndex<0||read(16)!==0||read(20)!==1||read(24)!==0||read(32)!==6408)throw new Error("KTX is not an ASTC RGBA compressed texture");if(!width||!height||read(44)!==0||read(48)!==0||read(52)!==1)throw new Error("Only nonempty 2D, nonarray KTX textures are supported");if(levels>Math.floor(Math.log2(Math.max(width,height)))+1)throw new Error("Invalid KTX mip count");const blockSizes=[[4,4],[5,4],[5,5],[6,5],[6,6],[8,5],[8,6],[8,8],[10,5],[10,6],[10,8],[10,10],[12,10],[12,12]];const[blockWidth,blockHeight]=blockSizes[formatIndex],mipmaps=[];let offset=64+read(60);if(offset%4!==0||offset>buffer.byteLength)throw new Error("Invalid KTX metadata size");for(let level=0;level<levels;level++){if(offset+4>buffer.byteLength)throw new Error("Truncated KTX mip header");const size=read(offset);offset+=4;const mipWidth=Math.max(1,Math.floor(width/2**level)),mipHeight=Math.max(1,Math.floor(height/2**level));const expected=Math.ceil(mipWidth/blockWidth)*Math.ceil(mipHeight/blockHeight)*16;if(size!==expected||offset+size>buffer.byteLength)throw new Error("Invalid or truncated ASTC mip data");mipmaps.push({width:mipWidth,height:mipHeight,data:new Uint8Array(buffer,offset,size)});offset+=size+(4-size%4)%4}return{width,height,internalFormat,mipmaps}}__name(parseAstcKtx,"parseAstcKtx");function checkSignal(signal){if(signal?.aborted)throw signal.reason??new DOMException("Texture load cancelled","AbortError")}__name(checkSignal,"checkSignal");async function loadAstcTexture(gl,url,options={}){if(!gl||typeof gl.createTexture!=="function")throw new TypeError("A WebGL rendering context is required; Canvas 2D is unsupported");if(gl.isContextLost?.())throw new Error("WebGL context is lost");const fetcher=options.fetch??globalThis.fetch,decodeImage2=options.decodeImage??decodeImage;const fetchChecked=__name(async path=>{checkSignal(options.signal);const response=await fetcher(resolveAssetUrl(path,options),{signal:options.signal});if(!response.ok)throw new Error(`HTTP ${response.status} loading ${path}`);return response},"fetchChecked");function upload(data,compressed){checkSignal(options.signal);if(gl.isContextLost?.())throw new Error("WebGL context is lost");const previousBinding=gl.getParameter(gl.TEXTURE_BINDING_2D),texture=gl.createTexture();if(!texture)throw new Error("WebGL could not allocate a texture");try{gl.bindTexture(gl.TEXTURE_2D,texture);if(compressed)data.mipmaps.forEach((mip,level)=>gl.compressedTexImage2D(gl.TEXTURE_2D,level,data.internalFormat,mip.width,mip.height,0,mip.data));else gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,data);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);const error=gl.getError();if(error!==gl.NO_ERROR)throw new Error(`WebGL texture upload error 0x${error.toString(16)}`)}catch(error){gl.deleteTexture(texture);throw error}finally{gl.bindTexture(gl.TEXTURE_2D,previousBinding)}let disposed=false;return{texture,width:data.width||data.naturalWidth,height:data.height||data.naturalHeight,format:compressed?"astc":"image",dispose(){if(!disposed){disposed=true;gl.deleteTexture(texture)}}}}__name(upload,"upload");try{checkSignal(options.signal);if(!supportsAstc(gl))throw new Error("ASTC is not supported by this WebGL context");const data=parseAstcKtx(await(await fetchChecked(url)).arrayBuffer());const supportedFormats=gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS);if(!Array.from(supportedFormats??[]).includes(data.internalFormat))throw new Error("This ASTC internal format is unsupported");return upload(data,true)}catch(error){checkSignal(options.signal);if(!options.fallbackUrl||error?.name==="AbortError"||gl.isContextLost?.())throw error;options.onFallback?.(error);const image=await decodeImage2(await(await fetchChecked(options.fallbackUrl)).blob(),{signal:options.signal});try{return upload(image,false)}finally{image.close?.()}}}__name(loadAstcTexture,"loadAstcTexture");export{loadAstcTexture,parseAstcKtx,supportsAstc,toAstcKtxUrl};
@@ -0,0 +1,26 @@
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' | 'dxt';
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 扩展选压缩贴图变体;有 ASTC 用 astc,否则有 S3TC/DXT 用 dxt,都没有时返回 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;
@@ -0,0 +1,351 @@
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
+ const MODEL_EXT = /\.(?:glb|gltf)$/i;
24
+ const IMAGE_EXT = /\.(?:png|jpe?g)$/i;
25
+
26
+ /** 拆出 pathname 与 `?`/`#` 尾巴,避免带查询参数时误判后缀。 */
27
+ function splitPath(value) {
28
+ const parts = String(value ?? '').match(/^([^?#]*)([?#].*)?$/);
29
+ return parts ? { pathname: parts[1], rest: parts[2] ?? '' } : { pathname: '', rest: '' };
30
+ }
31
+
32
+ /**
33
+ * 已知的资源托管挂载根。只用于 sidecar 推导的边界保护:目录若是挂载根本身
34
+ * (如 `/Glb/Game`),说明贴图不在任何以模型名命名的 sidecar 目录里,不能改写。
35
+ */
36
+ const LIBRARY_MOUNTS = ['/Glb/Game/', 'Glb/Game/', '/Game/', 'Game/'];
37
+
38
+ /**
39
+ * 切换模型 GLB 的分级档位:0 档原样返回,1/2 档在扩展名前插入 `_L1`/`_L2`。
40
+ * 对任何模型路径(资产库或 AIGC)统一套用——两类模型都可能带降档;
41
+ * data:/blob: 与非模型路径原样返回。
42
+ *
43
+ * **调用方必须传入 0 档(基线)路径**——配置字段、检索结果、AIGC 回调路径都是基线路径,
44
+ * 这是唯一契约,本函数不检测也不剥离已有后缀。对一个已带 `_L1`/`_L2` 的路径再调用本函数
45
+ * 会在结果里叠出两段后缀(如 `x_L1_L2.glb`),这是误用,不是需要兼容的输入形态:模型的
46
+ * 真实文件名可能本来就以 `_L1`/`_L2` 结尾(与分级无关的巧合命名),若本函数尝试剥离,
47
+ * 反而会把这类正常基线路径错误改写成不存在的文件。
48
+ *
49
+ * 只做命名推导,**不保证目标档位存在**:0 档是每个模型都有的基线,降级档个别模型可能缺
50
+ * (例如未命中导出母材质白名单的模型)。调用方选了非 0 档就要处理加载失败并回退 0 档;
51
+ * 走 `loadGlbModel` 时该回退是自动的。
52
+ */
53
+ export function withGlbLod(path, level) {
54
+ if (level !== 0 && level !== 1 && level !== 2) {
55
+ throw new TypeError(`withGlbLod: level must be 0, 1 or 2 (received ${JSON.stringify(level)})`);
56
+ }
57
+ const raw = String(path ?? '');
58
+ if (level === 0) return raw;
59
+ if (!raw || /^(?:data:|blob:)/i.test(raw)) return raw;
60
+ const { pathname, rest } = splitPath(raw);
61
+ if (!pathname || !MODEL_EXT.test(pathname)) return raw;
62
+ const dot = pathname.lastIndexOf('.');
63
+ return `${pathname.slice(0, dot)}_L${level}${pathname.slice(dot)}${rest}`;
64
+ }
65
+
66
+ /**
67
+ * 内部推导:由外部 PNG 的 pathname 得到同级压缩贴图 KTX2 的 pathname。
68
+ *
69
+ * sidecar 约定(UE 导出):PNG 位于以 GLB basename(含分级后缀)命名的目录里,
70
+ * 压缩变体是它的兄弟目录:
71
+ * `<Name>_L1/<Image>_L1.png` → `<Name>_L1_astc/<Image>_L1.ktx2`
72
+ * `<Name>_L1/<Image>_L1.png` → `<Name>_L1_dxt/<Image>_L1.ktx2`
73
+ *
74
+ * 这些 KTX2 **不被 GLB JSON 引用**(也没有 KHR_texture_basisu),所以只能靠 URL 改写取到。
75
+ * 非图片、无目录段,或目录就是已知的资源托管根(把托管根本身当模型名会拼出
76
+ * `/Glb/Game_astc/` 这类垃圾路径)时返回 null。不导出:调用方用
77
+ * `glbCompressedTextureUrlModifier` 即可,不需要自己拼 sidecar 路径。
78
+ */
79
+ function derivePathnameSidecar(pathname, variant) {
80
+ if (!IMAGE_EXT.test(pathname)) return null;
81
+ const slash = pathname.lastIndexOf('/');
82
+ if (slash <= 0) return null;
83
+ const dir = pathname.slice(0, slash);
84
+ // 目录若是托管根本身(如 `/Glb/Game`),说明贴图不在任何以模型名命名的 sidecar 目录里。
85
+ if (LIBRARY_MOUNTS.some(mount => `${dir}/` === mount)) return null;
86
+ const file = pathname.slice(slash + 1).replace(IMAGE_EXT, '');
87
+ return `${dir}_${variant}/${file}.ktx2`;
88
+ }
89
+
90
+ function toGlbCompressedTextureUrl(pngUrl, variant) {
91
+ if (variant !== 'astc' && variant !== 'dxt') {
92
+ throw new TypeError(`toGlbCompressedTextureUrl: variant must be 'astc' or 'dxt' (received ${JSON.stringify(variant)})`);
93
+ }
94
+ const raw = String(pngUrl ?? '').trim();
95
+ if (!raw || /^(?:data:|blob:)/i.test(raw)) return null;
96
+
97
+ // 绝对/协议相对 URL:挂载点判断必须基于 URL.pathname,不能是 splitPath 拆出的、仍带
98
+ // scheme+host 的整段字符串(那样 dir 永远不等于任何挂载点前缀,边界检查形同虚设)。
99
+ // 改写后用 url.href 拼回,search/hash 由 URL 对象自动保留。协议相对 `//host/...` 没有
100
+ // scheme,`new URL` 无 base 会抛错,按既有 rewriteLibraryGlbMount 的约定安全地原样放过
101
+ // (回退 PNG),不落回下面的相对路径分支——那样会把 `//host` 错当成路径的一部分。
102
+ if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(raw)) {
103
+ let url;
104
+ try {
105
+ url = new URL(raw);
106
+ } catch {
107
+ return null;
108
+ }
109
+ const newPathname = derivePathnameSidecar(url.pathname, variant);
110
+ if (newPathname === null) return null;
111
+ url.pathname = newPathname;
112
+ return url.href;
113
+ }
114
+
115
+ const { pathname, rest } = splitPath(raw);
116
+ const newPathname = derivePathnameSidecar(pathname, variant);
117
+ return newPathname === null ? null : `${newPathname}${rest}`;
118
+ }
119
+
120
+ /** 是否支持 ASTC 压缩贴图。 */
121
+ function hasAstc(gl) {
122
+ return Boolean(
123
+ gl &&
124
+ !gl.isContextLost?.() &&
125
+ (gl.getExtension('WEBGL_compressed_texture_astc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc')),
126
+ );
127
+ }
128
+
129
+ /** 是否支持 S3TC/DXT 压缩贴图(DXT1/DXT5,常见 PC)。 */
130
+ function hasS3tc(gl) {
131
+ return Boolean(
132
+ gl &&
133
+ !gl.isContextLost?.() &&
134
+ (gl.getExtension('WEBGL_compressed_texture_s3tc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')),
135
+ );
136
+ }
137
+
138
+ /**
139
+ * 选压缩贴图变体:有 ASTC 扩展用 `astc`,否则有 S3TC/DXT 用 `dxt`,都没有则返回 null(留在 PNG)。
140
+ *
141
+ * 判据是 WebGL 扩展探测,而不是 userAgent。ASTC 优先:同时暴露两种扩展时仍走 `_astc`。
142
+ * 仅有 S3TC/DXT(常见 PC)时改写到 `_dxt` sidecar。调用方不指定格式,只决定是否启用这条可选优化。
143
+ *
144
+ * 返回 null 时不要挂 URL 改写:GLB 自带的 PNG 就是兼容路径。
145
+ */
146
+ export function pickGlbTextureVariant(gl) {
147
+ if (hasAstc(gl)) return 'astc';
148
+ if (hasS3tc(gl)) return 'dxt';
149
+ return null;
150
+ }
151
+
152
+ /**
153
+ * 生成 Three LoadingManager 的 URL 改写函数:把外部 PNG/JPEG 贴图按 sidecar 约定改写成 KTX2。
154
+ *
155
+ * **不区分来源,也不假设贴图形态**:
156
+ * - 一体式 GLB(贴图内嵌,无论资产库还是 AIGC):GLTFLoader 把 bufferView 转成 blob:
157
+ * URL,本函数原样放过——一体式永远不会被改写,也无需任何分支;
158
+ * - 拆分式 GLB:`images[].uri` 指向外部 PNG,按 `<模型目录>/<图>.png →
159
+ * <模型目录>_<variant>/<图>.ktx2` 改写;
160
+ * - 改写后的 KTX2 不存在(404)或解码失败时,**必须回退原 PNG 重新加载**——某棵 GLB
161
+ * 树有没有 sidecar 无法从 URL 判断,只能靠加载结果,这是调用方的硬性义务。
162
+ *
163
+ * **必须挂在本次 GLB 加载专用的 LoadingManager 上**(`new GLTFLoader(new THREE.LoadingManager())`)。
164
+ * 本函数不再按挂载点过滤来源:挂到共享或全局 manager 会把流经它的无关外部图片一并改写,
165
+ * 导致那些图片 404。专用 manager 把改写的作用域限制在这一次模型加载内。
166
+ *
167
+ * 改写后的 KTX2 需要 Three 的 KTX2Loader 才能解析;没接 KTX2Loader 时不要挂本改写函数。
168
+ */
169
+ export function glbCompressedTextureUrlModifier(variant) {
170
+ return (url) => toGlbCompressedTextureUrl(String(url ?? ''), variant) ?? String(url ?? '');
171
+ }
172
+
173
+ /**
174
+ * 让 loadAsync 支持 AbortSignal:signal 中断时整体 reject,底层请求结果被丢弃;
175
+ * 已中断的 signal 不会发起加载。
176
+ */
177
+ function abortableLoad(start, signal) {
178
+ if (!signal) return start();
179
+ const abortError = () => signal.reason ?? new DOMException('The operation was aborted.', 'AbortError');
180
+ if (signal.aborted) return Promise.reject(abortError());
181
+ return new Promise((resolve, reject) => {
182
+ const onAbort = () => reject(abortError());
183
+ signal.addEventListener('abort', onAbort, { once: true });
184
+ let promise;
185
+ try {
186
+ promise = start();
187
+ } catch (error) {
188
+ signal.removeEventListener('abort', onAbort);
189
+ reject(error);
190
+ return;
191
+ }
192
+ promise.then(
193
+ (value) => { signal.removeEventListener('abort', onAbort); resolve(value); },
194
+ (error) => { signal.removeEventListener('abort', onAbort); reject(error); },
195
+ );
196
+ });
197
+ }
198
+
199
+ /**
200
+ * 抑制 GLTFLoader 内部对「贴图加载失败」的无条件 console.error。
201
+ *
202
+ * 起因:`GLTFLoader.loadImageSource` 失败时会在库自身代码里无条件
203
+ * `console.error('THREE.GLTFLoader: Couldn\'t load texture', uri)` 再重新抛出,没有任何
204
+ * 选项能关闭;而本 runtime 的 `platform.mjs` 会把 `console.error` 计入 `runtime-result`
205
+ * 评分(触发即判定失败)。KTX2 sidecar 是否存在无法预先判断,只能真的尝一次——所以这个
206
+ * 失败是本函数已知、预期、随后会自动回退原 PNG 的可恢复失败,不该被当作运行错误上报。
207
+ *
208
+ * 用宽松的前缀+关键词匹配(而不是逐字匹配 Three 的固定文案):三方库版本升级时措辞可能
209
+ * 改,逐字匹配会静默失效、且不会有任何提示;`THREE.` 前缀是库自身贯穿所有模块的日志
210
+ * 惯例,不太可能被去掉,比措辞本身更稳。
211
+ *
212
+ * 并发安全分两层,缺一不可:
213
+ * - 引用计数:多个 `loadGlbModel` 可能并发加载,先结束的那次不能提前卸掉仍在使用的包装,
214
+ * 只有计数归零才收尾。包装本身按 depth 判定是否过滤,归零后即使仍留在链上也自动放行。
215
+ * - 还原前先比较再赋值:抑制窗口内若有别的模块(典型是 `platform.mjs` 的日志采集)在本
216
+ * 包装之上又装了一层,无条件 `console.error = <进入时的值>` 会把那一层摘掉,使
217
+ * `console.error` 采集静默失效且没有任何提示。只在 `console.error` 仍停在本包装这一层
218
+ * 时才还原,否则保留整条链路不动。
219
+ */
220
+ let gltfTextureErrorSuppressionDepth = 0;
221
+ let gltfTextureErrorWrapper = null;
222
+ let consoleErrorBeforeSuppression = null;
223
+
224
+ function acquireGltfTextureErrorSuppression() {
225
+ if (gltfTextureErrorWrapper === null) {
226
+ const previous = console.error;
227
+ consoleErrorBeforeSuppression = previous;
228
+ gltfTextureErrorWrapper = (...args) => {
229
+ if (gltfTextureErrorSuppressionDepth > 0 && args[0]?.startsWith?.('THREE.') && /texture/i.test(args[0])) return;
230
+ previous.apply(console, args);
231
+ };
232
+ console.error = gltfTextureErrorWrapper;
233
+ }
234
+ gltfTextureErrorSuppressionDepth++;
235
+ }
236
+
237
+ function releaseGltfTextureErrorSuppression() {
238
+ gltfTextureErrorSuppressionDepth = Math.max(0, gltfTextureErrorSuppressionDepth - 1);
239
+ if (gltfTextureErrorSuppressionDepth > 0) return;
240
+ // 只在 console.error 仍停在本包装这一层时才还原,否则会摘掉窗口内其它模块装的包装。
241
+ // 无论是否还原都清掉标记:本包装此时已随 depth 归零放行,下次调用会重新装一层并在结束时
242
+ // 正常还原,不会逐次累加——只有在窗口内被别人重新包装过时才会在链上多留一层放行包装,
243
+ // 这比丢掉别人的采集层安全得多。
244
+ if (console.error === gltfTextureErrorWrapper) console.error = consoleErrorBeforeSuppression;
245
+ gltfTextureErrorWrapper = null;
246
+ consoleErrorBeforeSuppression = null;
247
+ }
248
+
249
+ async function loadWithCompressedTextures(THREE, path, variant, renderer, signal) {
250
+ // 专用 manager:改写作用域只限于本次加载,不污染其它并发加载。
251
+ const manager = new THREE.LoadingManager();
252
+ manager.setURLModifier(glbCompressedTextureUrlModifier(variant));
253
+ // 关键接线:GLTFLoader 用 manager.getHandler(<glTF 原始 uri>) 选择贴图 loader,
254
+ // 此时 uri 仍是 `.png`(改写发生在更内层的 manager.resolveURL)。所以 handler 按
255
+ // 原始图片扩展名接管,由 KTX2Loader 自己的 FileLoader 触发改写、取到 .ktx2 并解析。
256
+ // 只挂 modifier 不挂 handler 是错的:改写出的 .ktx2 会落回图片解码器直接失败。
257
+ const [{ GLTFLoader }, { KTX2Loader }] = await Promise.all([
258
+ import('three/addons/loaders/GLTFLoader.js'),
259
+ import('three/addons/loaders/KTX2Loader.js'),
260
+ ]);
261
+ const ktx2 = new KTX2Loader(manager).detectSupport(renderer);
262
+ manager.addHandler(/\.(?:png|jpe?g)$/i, ktx2);
263
+ // UE sidecar 是原生 BC/ASTC KTX2(vkFormat 已定义),KTX2Loader 走免转码器直传路径,
264
+ // 不会初始化 worker;无需 dispose。
265
+ acquireGltfTextureErrorSuppression();
266
+ return abortableLoad(() => new GLTFLoader(manager).loadAsync(path), signal)
267
+ .finally(releaseGltfTextureErrorSuppression);
268
+ }
269
+
270
+ async function loadPlain(path, signal) {
271
+ const { GLTFLoader } = await import('three/addons/loaders/GLTFLoader.js');
272
+ return abortableLoad(() => new GLTFLoader().loadAsync(path), signal);
273
+ }
274
+
275
+ /**
276
+ * 加载模型 GLB 的标准入口,资产库与 AIGC 模型通用。
277
+ *
278
+ * 内部完成全部编排,调用方不拼接 URL:
279
+ * - 选档:`lod`(默认 0)按命名推导逐档尝试,目标档缺失自动回退 0 档——0 档是每个
280
+ * 模型都有的基线,资产库与 AIGC 模型通用,调用方无需关心某个档位是否存在。降档回退
281
+ * 发生时 `console.warn` 一条具体消息(带 lod 数值与两个 URL),供排查该模型是否真的
282
+ * 缺档还是配置传错了 lod;不影响 `runtime-result` 评分(评分只看 `console.error`)。
283
+ * - 贴图:有 ASTC 扩展时挂专用 manager 改写外部 PNG 为 `_astc` KTX2;没有 ASTC 但有
284
+ * S3TC/DXT 时改写为 `_dxt` KTX2,并接 `KTX2Loader` 解析。两者都没有时直接加载 PNG。
285
+ * 内嵌贴图(blob:)天然跳过;KTX2 取不到或解码失败时自动回退原 PNG 重载,材质不会空着,
286
+ * 同样 `console.warn` 一条带 URL 与具体错误的消息。sidecar 是否存在无法预判,尝试期间临时抑制
287
+ * GLTFLoader 对此失败无条件触发的 `console.error`(该失败已知且会自动回退,不是运行错误;抑制仅对
288
+ * Three 自身「THREE.…texture…」日志生效,不影响其它错误,见
289
+ * `acquireGltfTextureErrorSuppression`)。
290
+ * - `signal` 中断时 reject(底层请求结果被丢弃,不自动 dispose 已加载内容——本调用
291
+ * 在 reject 时不返回任何 gltf)。
292
+ *
293
+ * @param THREE Three 命名空间(取 `LoadingManager`),与其它 tools 的显式注入风格一致。
294
+ * @param renderer 已创建的 `THREE.WebGLRenderer`,用于压缩贴图格式探测。
295
+ * @param url 已归一化的模型 URL(通常直接传 `configs/*.json` 的资源字段值)。
296
+ * @returns GLTFLoader 的解析结果(`.scene` / `.animations` 等由调用方使用与 dispose)。
297
+ */
298
+ export async function loadGlbModel(THREE, renderer, url, options = {}) {
299
+ if (!THREE || typeof THREE.LoadingManager !== 'function') {
300
+ throw new TypeError('loadGlbModel: THREE(含 LoadingManager 的命名空间)为必填参数');
301
+ }
302
+ if (!renderer || typeof renderer.getContext !== 'function') {
303
+ throw new TypeError('loadGlbModel: renderer(THREE.WebGLRenderer)为必填参数');
304
+ }
305
+ const { lod = 0, signal } = options;
306
+ if (lod !== 0 && lod !== 1 && lod !== 2) {
307
+ throw new TypeError(`loadGlbModel: lod 必须是 0、1 或 2(收到 ${JSON.stringify(lod)})`);
308
+ }
309
+ const raw = String(url ?? '');
310
+ const variant = pickGlbTextureVariant(renderer.getContext());
311
+ // 按 (level, path) 配对保留,供下面的警告消息引用;path 去重逻辑与之前一致(data:/blob:/
312
+ // 非模型路径在任何 level 下都返回同一个 raw,此时只会有一次尝试,不会重复请求)。
313
+ const attempts = [];
314
+ const seenPaths = new Set();
315
+ for (const level of [lod, 0]) {
316
+ const path = withGlbLod(raw, level);
317
+ if (seenPaths.has(path)) continue;
318
+ seenPaths.add(path);
319
+ attempts.push({ level, path });
320
+ }
321
+ let lastError = null;
322
+ for (let i = 0; i < attempts.length; i++) {
323
+ const { level, path } = attempts[i];
324
+ try {
325
+ if (variant) {
326
+ try {
327
+ return await loadWithCompressedTextures(THREE, path, variant, renderer, signal);
328
+ } catch (error) {
329
+ if (signal?.aborted) throw error;
330
+ // 压缩贴图环节失败(404 / 解码 / GPU 格式不支持):回退原 PNG 重载。这个失败面既可能
331
+ // 是「贴图缺 sidecar」,也可能是这个 path 本身就加载不了(下面 loadPlain 若也失败,
332
+ // 会被外层 catch 的 LOD 回退警告覆盖,两条警告连起来读就能判断具体是哪种)。
333
+ console.warn(
334
+ `[loadGlbModel] 压缩贴图(${variant})加载失败,回退到未压缩贴图:${path} — ${error?.message ?? error}`,
335
+ );
336
+ }
337
+ }
338
+ return await loadPlain(path, signal);
339
+ } catch (error) {
340
+ if (signal?.aborted) throw error;
341
+ lastError = error;
342
+ const next = attempts[i + 1];
343
+ if (next) {
344
+ console.warn(
345
+ `[loadGlbModel] lod=${level} 加载失败,回退到 lod=${next.level}:${path} → ${next.path} — ${error?.message ?? error}`,
346
+ );
347
+ }
348
+ }
349
+ }
350
+ throw lastError;
351
+ }
@@ -0,0 +1,97 @@
1
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
2
+ import { join, relative } from 'node:path';
3
+ import { isExportableUrl } from './sync-asset-controls.mjs';
4
+ import { manifestEntryUrl, sceneAssetControlPath } from './sync-scene-assets.mjs';
5
+
6
+ const QUOTED_URL = /(['"`])((?:https?:\/\/file\.craft\.qq\.com\/|\/Game\/|Game\/)[^'"`\\]*)\1/g;
7
+
8
+ function walkTsFiles(dir, acc = []) {
9
+ if (!existsSync(dir)) return acc;
10
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
11
+ if (entry.name.startsWith('.')) continue;
12
+ const path = join(dir, entry.name);
13
+ if (entry.isDirectory()) {
14
+ walkTsFiles(path, acc);
15
+ continue;
16
+ }
17
+ if (entry.isFile() && entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) acc.push(path);
18
+ }
19
+ return acc;
20
+ }
21
+
22
+ function readJson(path, fallback) {
23
+ if (!existsSync(path)) return fallback;
24
+ try {
25
+ return JSON.parse(readFileSync(path, 'utf8'));
26
+ } catch {
27
+ return fallback;
28
+ }
29
+ }
30
+
31
+ // 场景编辑器持有的场景数据 `src/scenes/**/scene.ts` 以云资产虚拟路径 `/Game/...` 引用 glb:
32
+ // 该路径是编辑器的数据契约(`editor/src/core/sceneSource.ts` 只接受纯字面量),
33
+ // 不能改成 `configs/assets.json` 的导入引用。它走的是另一条链——清单环:
34
+ // `/Game/` 引用登记进 `configs/scene_assets.json`(编辑器退出保存与 export-config 两处同键生成)。
35
+ // 契约见 knowledge/SceneEditorCompat.md 与 skills/scene-editor-compat/SKILL.md 第 8 步。
36
+ function isSceneEditorSceneData(projectRoot, file) {
37
+ const rel = relative(projectRoot, file).replaceAll('\\', '/');
38
+ return rel.startsWith('src/scenes/') && rel.endsWith('/scene.ts');
39
+ }
40
+
41
+ export function findHardcodedAssetUrls(projectRoot) {
42
+ const srcRoot = join(projectRoot, 'src');
43
+ const found = [];
44
+ for (const file of walkTsFiles(srcRoot)) {
45
+ if (isSceneEditorSceneData(projectRoot, file)) continue;
46
+ const text = readFileSync(file, 'utf8');
47
+ if (text.includes('configs/assets.json')) continue;
48
+ for (const match of text.matchAll(QUOTED_URL)) {
49
+ const url = match[2].trim();
50
+ if (!isExportableUrl(url)) continue;
51
+ found.push({ file: relative(projectRoot, file), url });
52
+ }
53
+ }
54
+ return found;
55
+ }
56
+
57
+ export function findMissingAssetSchemas(projectRoot) {
58
+ const assets = readJson(join(projectRoot, 'configs', 'assets.json'), {});
59
+ const snapshot = readJson(join(projectRoot, 'unified_data_control_config.json'), []);
60
+ if (!assets || typeof assets !== 'object' || Array.isArray(assets)) return [];
61
+ const schemas = new Set(
62
+ (Array.isArray(snapshot) ? snapshot : [])
63
+ .map((entry) => entry?.schema)
64
+ .filter((schema) => typeof schema === 'string'),
65
+ );
66
+ const missing = [];
67
+ for (const [name, value] of Object.entries(assets)) {
68
+ if (!isExportableUrl(value)) continue;
69
+ if (!schemas.has(`assets.${name}`)) missing.push(name);
70
+ }
71
+ return missing;
72
+ }
73
+
74
+ export function assertAssetsWired(projectRoot) {
75
+ const literals = findHardcodedAssetUrls(projectRoot);
76
+ if (literals.length) {
77
+ const lines = literals.map((item) => `${item.file}: ${item.url}`).join('\n');
78
+ throw new Error(`资源地址写在源码里,未从 configs/assets.json 导入:\n${lines}`);
79
+ }
80
+ const missing = findMissingAssetSchemas(projectRoot);
81
+ if (missing.length) {
82
+ throw new Error(`configs/assets.json 的这些键没有进入 unified_data_control_config.json:${missing.join(', ')}`);
83
+ }
84
+ const manifest = readJson(join(projectRoot, 'configs', 'scene_assets.json'), {});
85
+ const snapshot = readJson(join(projectRoot, 'unified_data_control_config.json'), []);
86
+ const resources = new Set(
87
+ (Array.isArray(snapshot) ? snapshot : [])
88
+ .filter((entry) => entry?.control?.type === 'resource')
89
+ .map((entry) => entry.schema),
90
+ );
91
+ const missingSceneAssets = Object.entries(manifest).filter(([key, entry]) =>
92
+ manifestEntryUrl(entry) && !resources.has(`scene_assets.${sceneAssetControlPath(key, entry)}`),
93
+ ).map(([key]) => key);
94
+ if (missingSceneAssets.length) {
95
+ throw new Error(`configs/scene_assets.json 的这些资源没有进入 unified_data_control_config.json:${missingSceneAssets.join(', ')}`);
96
+ }
97
+ }