@craft_eco/craft-mcp 0.1.28 → 0.1.29

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 (980) hide show
  1. package/README.md +23 -17
  2. package/bin/craft-mcp.mjs +4 -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 +5 -0
  7. package/dist-server/game-workflow/context-state.mjs +67 -0
  8. package/dist-server/game-workflow/draft-uploads.mjs +3 -0
  9. package/dist-server/game-workflow/engines.mjs +3 -3
  10. package/dist-server/game-workflow/library-assets.mjs +2 -1
  11. package/dist-server/game-workflow/local-context.mjs +62 -0
  12. package/dist-server/game-workflow/native-context.mjs +289 -0
  13. package/dist-server/game-workflow/project-bundles.mjs +246 -129
  14. package/dist-server/game-workflow/project-context.mjs +183 -45
  15. package/dist-server/game-workflow/project-leases.mjs +101 -30
  16. package/dist-server/game-workflow/projects.mjs +86 -10
  17. package/dist-server/game-workflow/publications.mjs +5 -1
  18. package/dist-server/game-workflow/tasks.mjs +6 -1
  19. package/dist-server/game-workflow/work-scope.mjs +7 -0
  20. package/dist-server/integrations/config.mjs +145 -71
  21. package/dist-server/integrations/connection-handoff.mjs +42 -0
  22. package/dist-server/integrations/dsh-config.mjs +182 -0
  23. package/dist-server/integrations/files.mjs +54 -54
  24. package/dist-server/integrations/hosts.mjs +55 -35
  25. package/dist-server/integrations/install.mjs +205 -86
  26. package/dist-server/integrations/installation-state.mjs +84 -0
  27. package/dist-server/integrations/runtime-gc.mjs +188 -0
  28. package/dist-server/integrations/runtime.mjs +126 -72
  29. package/dist-server/integrations/updates.mjs +225 -0
  30. package/dist-server/integrations/version-policy.mjs +32 -0
  31. package/dist-server/mcp/control-panel.mjs +5 -2
  32. package/dist-server/mcp/publish-panel.mjs +7 -2
  33. package/dist-server/mcp/server.mjs +134 -26
  34. package/dist-server/mcp/start.mjs +8 -2
  35. package/dist-server/mcp/update-session.mjs +92 -0
  36. package/package.json +2 -2
  37. package/resources/context-filter-report.json +177 -0
  38. package/resources/craft-create/SKILL.md +19 -11
  39. package/resources/craft-update/SKILL.md +25 -0
  40. package/resources/targets/claude/js/bootstrap/SKILL.md +18 -0
  41. package/resources/targets/claude/js/context-filter-report.json +27 -0
  42. package/resources/targets/claude/js/craft-game-maker/SKILL.md +76 -0
  43. package/resources/targets/claude/js/craft-game-maker/js.md +10 -0
  44. package/resources/targets/claude/js/js/bundle.json +97 -0
  45. package/resources/targets/claude/js/js/context/AGENTS.md +29 -0
  46. package/resources/targets/claude/js/js/context/hooks/hooks.json +14 -0
  47. package/resources/targets/claude/js/js/context/knowledge/AssetUrl.md +9 -0
  48. package/resources/targets/claude/js/js/context/knowledge/AssetWiring.md +7 -0
  49. package/resources/targets/claude/js/js/context/knowledge/Layout.md +7 -0
  50. package/resources/targets/claude/js/js/context/knowledge/Lifecycle.md +11 -0
  51. package/resources/targets/claude/js/js/context/knowledge/ResourceLoading.md +9 -0
  52. package/resources/targets/claude/js/js/context/skills/export-config/SKILL.md +16 -0
  53. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  54. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  55. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  56. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  57. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  58. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  59. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  60. package/resources/targets/claude/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  61. package/resources/targets/claude/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  62. package/resources/targets/claude/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  63. package/resources/targets/claude/js/js/context/skills/index.json +19 -0
  64. package/resources/targets/claude/js/js/context/skills/visual-qa/SKILL.md +14 -0
  65. package/resources/targets/claude/js/js/project/README.md +7 -0
  66. package/resources/targets/claude/js/js/project/configs/assets.json +1 -0
  67. package/resources/targets/claude/js/js/project/configs/game.controls.json +3 -0
  68. package/resources/targets/claude/js/js/project/configs/game.json +3 -0
  69. package/resources/targets/claude/js/js/project/game-runtime.json +7 -0
  70. package/resources/targets/claude/js/js/project/game.config.json +7 -0
  71. package/resources/targets/claude/js/js/project/index.html +20 -0
  72. package/resources/targets/claude/js/js/project/package.json +22 -0
  73. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  74. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  75. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  76. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  77. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  78. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  79. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  80. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  81. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  82. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  83. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  84. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  85. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  86. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  87. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  88. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  89. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  90. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  91. package/resources/targets/claude/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  92. package/resources/targets/claude/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  93. package/resources/targets/claude/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  94. package/resources/targets/claude/js/js/project/scripts/config-export.mjs +13 -0
  95. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  96. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  97. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  98. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  99. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  100. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  101. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  102. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  103. package/resources/targets/claude/js/js/project/scripts/write-preview-ready.mjs +22 -0
  104. package/resources/targets/claude/js/js/project/src/display/ui-stage.ts +156 -0
  105. package/resources/targets/claude/js/js/project/src/display/viewport.ts +249 -0
  106. package/resources/targets/claude/js/js/project/src/main.ts +87 -0
  107. package/resources/targets/claude/js/js/project/src/platform.ts +2 -0
  108. package/resources/targets/claude/js/js/project/src/scenes/LoadScene.ts +89 -0
  109. package/resources/targets/claude/js/js/project/src/scenes/PlayScene.ts +17 -0
  110. package/resources/targets/claude/js/js/project/src/screenUi.ts +185 -0
  111. package/resources/targets/claude/js/js/project/src/style.css +294 -0
  112. package/resources/targets/claude/js/js/project/tsconfig.json +20 -0
  113. package/resources/targets/claude/js/js/project/unified_data_control_config.json +20 -0
  114. package/resources/targets/claude/js/js/project/vite.config.ts +5 -0
  115. package/resources/targets/claude/js/recovery.md +13 -0
  116. package/resources/targets/claude/js/target.json +61 -0
  117. package/resources/targets/claude/js3d/bootstrap/SKILL.md +18 -0
  118. package/resources/targets/claude/js3d/context-filter-report.json +27 -0
  119. package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +76 -0
  120. package/resources/targets/claude/js3d/craft-game-maker/js3d.md +12 -0
  121. package/resources/targets/claude/js3d/js3d/bundle.json +108 -0
  122. package/resources/targets/claude/js3d/js3d/context/AGENTS.md +30 -0
  123. package/resources/targets/claude/js3d/js3d/context/hooks/hooks.json +14 -0
  124. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  125. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  126. package/resources/targets/claude/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  127. package/resources/targets/claude/js3d/js3d/context/knowledge/Layout.md +7 -0
  128. package/resources/targets/{workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → claude/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  129. package/resources/targets/claude/js3d/js3d/context/knowledge/Runtime.md +9 -0
  130. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  131. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  132. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  133. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  134. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  135. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  136. package/resources/targets/claude/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  137. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  138. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  139. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  140. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  141. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  142. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  143. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  144. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  145. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  146. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  147. package/resources/targets/claude/js3d/js3d/context/skills/index.json +31 -0
  148. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  149. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  150. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  151. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  152. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  153. package/resources/targets/claude/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  154. package/resources/targets/claude/js3d/js3d/project/README.md +7 -0
  155. package/resources/targets/claude/js3d/js3d/project/configs/game.controls.json +3 -0
  156. package/resources/targets/claude/js3d/js3d/project/configs/game.json +3 -0
  157. package/resources/targets/claude/js3d/js3d/project/game-runtime.json +7 -0
  158. package/resources/targets/claude/js3d/js3d/project/game.config.json +7 -0
  159. package/resources/targets/claude/js3d/js3d/project/index.html +12 -0
  160. package/resources/targets/claude/js3d/js3d/project/package.json +23 -0
  161. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  162. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  163. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  164. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  165. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  166. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  167. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  168. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  169. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  170. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  171. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  172. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  173. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  174. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  175. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  176. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  177. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  178. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  179. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  180. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  181. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  182. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  183. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  184. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  185. package/resources/targets/claude/js3d/js3d/project/scripts/config-export.mjs +15 -0
  186. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  187. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  188. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  189. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  190. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  191. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  192. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  193. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  194. package/resources/targets/claude/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  195. package/resources/targets/claude/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  196. package/resources/targets/claude/js3d/js3d/project/src/display/viewport.ts +239 -0
  197. package/resources/targets/claude/js3d/js3d/project/src/main.ts +85 -0
  198. package/resources/targets/claude/js3d/js3d/project/src/platform.ts +2 -0
  199. package/resources/targets/claude/js3d/js3d/project/src/style.css +83 -0
  200. package/resources/targets/claude/js3d/js3d/project/tsconfig.json +20 -0
  201. package/resources/targets/claude/js3d/js3d/project/unified_data_control_config.json +20 -0
  202. package/resources/targets/claude/js3d/js3d/project/vite.config.ts +5 -0
  203. package/resources/targets/claude/js3d/recovery.md +13 -0
  204. package/resources/targets/claude/js3d/target.json +60 -0
  205. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +5 -1
  206. package/resources/targets/codebuddy/js/context-filter-report.json +27 -0
  207. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +18 -19
  208. package/resources/targets/codebuddy/js/craft-game-maker/js.md +2 -2
  209. package/resources/targets/codebuddy/js/js/bundle.json +16 -18
  210. package/resources/targets/codebuddy/js/js/context/AGENTS.md +10 -6
  211. package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  212. package/resources/targets/codebuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  213. package/resources/targets/codebuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  214. package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  215. package/resources/targets/codebuddy/js/js/context/skills/index.json +2 -14
  216. package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  217. package/resources/targets/codebuddy/js/recovery.md +10 -4
  218. package/resources/targets/codebuddy/js/target.json +1 -1
  219. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +5 -1
  220. package/resources/targets/codebuddy/js3d/context-filter-report.json +27 -0
  221. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +18 -19
  222. package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +3 -4
  223. package/resources/targets/codebuddy/js3d/js3d/bundle.json +19 -21
  224. package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +10 -6
  225. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  226. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  227. package/resources/targets/{codex/js3d/js3d/context/skills/asset-search/references/resource-config.md → codebuddy/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  228. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  229. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  230. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  231. package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +4 -16
  232. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  233. package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  234. package/resources/targets/codebuddy/js3d/recovery.md +10 -4
  235. package/resources/targets/codebuddy/js3d/target.json +1 -1
  236. package/resources/targets/codex/js/bootstrap/SKILL.md +9 -1
  237. package/resources/targets/codex/js/context-filter-report.json +27 -0
  238. package/resources/targets/codex/js/craft-game-maker/SKILL.md +18 -19
  239. package/resources/targets/codex/js/craft-game-maker/js.md +2 -2
  240. package/resources/targets/codex/js/js/bundle.json +16 -18
  241. package/resources/targets/codex/js/js/context/AGENTS.md +10 -6
  242. package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +4 -4
  243. package/resources/targets/codex/js/js/context/knowledge/AssetWiring.md +7 -0
  244. package/resources/targets/codex/js/js/context/knowledge/ResourceLoading.md +9 -0
  245. package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +2 -2
  246. package/resources/targets/codex/js/js/context/skills/index.json +2 -14
  247. package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +1 -1
  248. package/resources/targets/codex/js/recovery.md +14 -4
  249. package/resources/targets/codex/js/target.json +1 -1
  250. package/resources/targets/codex/js3d/bootstrap/SKILL.md +9 -1
  251. package/resources/targets/codex/js3d/context-filter-report.json +27 -0
  252. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +18 -19
  253. package/resources/targets/codex/js3d/craft-game-maker/js3d.md +3 -4
  254. package/resources/targets/codex/js3d/js3d/bundle.json +19 -21
  255. package/resources/targets/codex/js3d/js3d/context/AGENTS.md +10 -6
  256. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  257. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  258. package/resources/targets/{codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → codex/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  259. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  260. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  261. package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  262. package/resources/targets/codex/js3d/js3d/context/skills/index.json +4 -16
  263. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  264. package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  265. package/resources/targets/codex/js3d/recovery.md +14 -4
  266. package/resources/targets/codex/js3d/target.json +1 -1
  267. package/resources/targets/cursor/js/bootstrap/SKILL.md +18 -0
  268. package/resources/targets/cursor/js/context-filter-report.json +27 -0
  269. package/resources/targets/cursor/js/craft-game-maker/SKILL.md +76 -0
  270. package/resources/targets/cursor/js/craft-game-maker/js.md +10 -0
  271. package/resources/targets/cursor/js/js/bundle.json +97 -0
  272. package/resources/targets/cursor/js/js/context/AGENTS.md +29 -0
  273. package/resources/targets/cursor/js/js/context/hooks/hooks.json +14 -0
  274. package/resources/targets/cursor/js/js/context/knowledge/AssetUrl.md +9 -0
  275. package/resources/targets/cursor/js/js/context/knowledge/AssetWiring.md +7 -0
  276. package/resources/targets/cursor/js/js/context/knowledge/Layout.md +7 -0
  277. package/resources/targets/cursor/js/js/context/knowledge/Lifecycle.md +11 -0
  278. package/resources/targets/cursor/js/js/context/knowledge/ResourceLoading.md +9 -0
  279. package/resources/targets/cursor/js/js/context/skills/export-config/SKILL.md +16 -0
  280. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  281. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  282. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  283. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  284. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  285. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  286. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  287. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  288. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  289. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  290. package/resources/targets/cursor/js/js/context/skills/index.json +19 -0
  291. package/resources/targets/cursor/js/js/context/skills/visual-qa/SKILL.md +14 -0
  292. package/resources/targets/cursor/js/js/project/README.md +7 -0
  293. package/resources/targets/cursor/js/js/project/configs/assets.json +1 -0
  294. package/resources/targets/cursor/js/js/project/configs/game.controls.json +3 -0
  295. package/resources/targets/cursor/js/js/project/configs/game.json +3 -0
  296. package/resources/targets/cursor/js/js/project/game-runtime.json +7 -0
  297. package/resources/targets/cursor/js/js/project/game.config.json +7 -0
  298. package/resources/targets/cursor/js/js/project/index.html +20 -0
  299. package/resources/targets/cursor/js/js/project/package.json +22 -0
  300. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  301. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  302. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  303. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  304. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  305. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  306. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  307. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  308. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  309. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  310. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  311. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  312. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  313. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  314. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  315. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  316. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  317. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  318. package/resources/targets/cursor/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  319. package/resources/targets/cursor/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  320. package/resources/targets/cursor/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  321. package/resources/targets/cursor/js/js/project/scripts/config-export.mjs +13 -0
  322. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  323. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  324. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  325. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  326. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  327. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  328. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  329. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  330. package/resources/targets/cursor/js/js/project/scripts/write-preview-ready.mjs +22 -0
  331. package/resources/targets/cursor/js/js/project/src/display/ui-stage.ts +156 -0
  332. package/resources/targets/cursor/js/js/project/src/display/viewport.ts +249 -0
  333. package/resources/targets/cursor/js/js/project/src/main.ts +87 -0
  334. package/resources/targets/cursor/js/js/project/src/platform.ts +2 -0
  335. package/resources/targets/cursor/js/js/project/src/scenes/LoadScene.ts +89 -0
  336. package/resources/targets/cursor/js/js/project/src/scenes/PlayScene.ts +17 -0
  337. package/resources/targets/cursor/js/js/project/src/screenUi.ts +185 -0
  338. package/resources/targets/cursor/js/js/project/src/style.css +294 -0
  339. package/resources/targets/cursor/js/js/project/tsconfig.json +20 -0
  340. package/resources/targets/cursor/js/js/project/unified_data_control_config.json +20 -0
  341. package/resources/targets/cursor/js/js/project/vite.config.ts +5 -0
  342. package/resources/targets/cursor/js/recovery.md +13 -0
  343. package/resources/targets/cursor/js/target.json +61 -0
  344. package/resources/targets/cursor/js3d/bootstrap/SKILL.md +18 -0
  345. package/resources/targets/cursor/js3d/context-filter-report.json +27 -0
  346. package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +76 -0
  347. package/resources/targets/cursor/js3d/craft-game-maker/js3d.md +12 -0
  348. package/resources/targets/cursor/js3d/js3d/bundle.json +108 -0
  349. package/resources/targets/cursor/js3d/js3d/context/AGENTS.md +30 -0
  350. package/resources/targets/cursor/js3d/js3d/context/hooks/hooks.json +14 -0
  351. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  352. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  353. package/resources/targets/cursor/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  354. package/resources/targets/cursor/js3d/js3d/context/knowledge/Layout.md +7 -0
  355. package/resources/targets/cursor/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  356. package/resources/targets/cursor/js3d/js3d/context/knowledge/Runtime.md +9 -0
  357. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  358. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  359. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  360. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  361. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  362. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  363. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  364. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  365. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  366. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  367. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  368. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  369. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  370. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  371. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  372. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  373. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  374. package/resources/targets/cursor/js3d/js3d/context/skills/index.json +31 -0
  375. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  376. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  377. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  378. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  379. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  380. package/resources/targets/cursor/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  381. package/resources/targets/cursor/js3d/js3d/project/README.md +7 -0
  382. package/resources/targets/cursor/js3d/js3d/project/configs/game.controls.json +3 -0
  383. package/resources/targets/cursor/js3d/js3d/project/configs/game.json +3 -0
  384. package/resources/targets/cursor/js3d/js3d/project/game-runtime.json +7 -0
  385. package/resources/targets/cursor/js3d/js3d/project/game.config.json +7 -0
  386. package/resources/targets/cursor/js3d/js3d/project/index.html +12 -0
  387. package/resources/targets/cursor/js3d/js3d/project/package.json +23 -0
  388. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  389. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  390. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  391. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  392. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  393. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  394. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  395. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  396. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  397. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  398. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  399. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  400. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  401. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  402. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  403. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  404. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  405. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  406. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  407. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  408. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  409. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  410. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  411. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  412. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export.mjs +15 -0
  413. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  414. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  415. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  416. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  417. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  418. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  419. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  420. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  421. package/resources/targets/cursor/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  422. package/resources/targets/cursor/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  423. package/resources/targets/cursor/js3d/js3d/project/src/display/viewport.ts +239 -0
  424. package/resources/targets/cursor/js3d/js3d/project/src/main.ts +85 -0
  425. package/resources/targets/cursor/js3d/js3d/project/src/platform.ts +2 -0
  426. package/resources/targets/cursor/js3d/js3d/project/src/style.css +83 -0
  427. package/resources/targets/cursor/js3d/js3d/project/tsconfig.json +20 -0
  428. package/resources/targets/cursor/js3d/js3d/project/unified_data_control_config.json +20 -0
  429. package/resources/targets/cursor/js3d/js3d/project/vite.config.ts +5 -0
  430. package/resources/targets/cursor/js3d/recovery.md +13 -0
  431. package/resources/targets/cursor/js3d/target.json +60 -0
  432. package/resources/targets/dsh/js/bootstrap/SKILL.md +18 -0
  433. package/resources/targets/dsh/js/context-filter-report.json +27 -0
  434. package/resources/targets/dsh/js/craft-game-maker/SKILL.md +76 -0
  435. package/resources/targets/dsh/js/craft-game-maker/js.md +10 -0
  436. package/resources/targets/dsh/js/js/bundle.json +97 -0
  437. package/resources/targets/dsh/js/js/context/AGENTS.md +29 -0
  438. package/resources/targets/dsh/js/js/context/hooks/hooks.json +14 -0
  439. package/resources/targets/dsh/js/js/context/knowledge/AssetUrl.md +9 -0
  440. package/resources/targets/dsh/js/js/context/knowledge/AssetWiring.md +7 -0
  441. package/resources/targets/dsh/js/js/context/knowledge/Layout.md +7 -0
  442. package/resources/targets/dsh/js/js/context/knowledge/Lifecycle.md +11 -0
  443. package/resources/targets/dsh/js/js/context/knowledge/ResourceLoading.md +9 -0
  444. package/resources/targets/dsh/js/js/context/skills/export-config/SKILL.md +16 -0
  445. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  446. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  447. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  448. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  449. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  450. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  451. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  452. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  453. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  454. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  455. package/resources/targets/dsh/js/js/context/skills/index.json +19 -0
  456. package/resources/targets/dsh/js/js/context/skills/visual-qa/SKILL.md +14 -0
  457. package/resources/targets/dsh/js/js/project/README.md +7 -0
  458. package/resources/targets/dsh/js/js/project/configs/assets.json +1 -0
  459. package/resources/targets/dsh/js/js/project/configs/game.controls.json +3 -0
  460. package/resources/targets/dsh/js/js/project/configs/game.json +3 -0
  461. package/resources/targets/dsh/js/js/project/game-runtime.json +7 -0
  462. package/resources/targets/dsh/js/js/project/game.config.json +7 -0
  463. package/resources/targets/dsh/js/js/project/index.html +20 -0
  464. package/resources/targets/dsh/js/js/project/package.json +22 -0
  465. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  466. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  467. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  468. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  469. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  470. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  471. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  472. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  473. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  474. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  475. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  476. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  477. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  478. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  479. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  480. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  481. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  482. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  483. package/resources/targets/dsh/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  484. package/resources/targets/dsh/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  485. package/resources/targets/dsh/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  486. package/resources/targets/dsh/js/js/project/scripts/config-export.mjs +13 -0
  487. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  488. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  489. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  490. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  491. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  492. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  493. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  494. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  495. package/resources/targets/dsh/js/js/project/scripts/write-preview-ready.mjs +22 -0
  496. package/resources/targets/dsh/js/js/project/src/display/ui-stage.ts +156 -0
  497. package/resources/targets/dsh/js/js/project/src/display/viewport.ts +249 -0
  498. package/resources/targets/dsh/js/js/project/src/main.ts +87 -0
  499. package/resources/targets/dsh/js/js/project/src/platform.ts +2 -0
  500. package/resources/targets/dsh/js/js/project/src/scenes/LoadScene.ts +89 -0
  501. package/resources/targets/dsh/js/js/project/src/scenes/PlayScene.ts +17 -0
  502. package/resources/targets/dsh/js/js/project/src/screenUi.ts +185 -0
  503. package/resources/targets/dsh/js/js/project/src/style.css +294 -0
  504. package/resources/targets/dsh/js/js/project/tsconfig.json +20 -0
  505. package/resources/targets/dsh/js/js/project/unified_data_control_config.json +20 -0
  506. package/resources/targets/dsh/js/js/project/vite.config.ts +5 -0
  507. package/resources/targets/dsh/js/recovery.md +13 -0
  508. package/resources/targets/dsh/js/target.json +61 -0
  509. package/resources/targets/dsh/js3d/bootstrap/SKILL.md +18 -0
  510. package/resources/targets/dsh/js3d/context-filter-report.json +27 -0
  511. package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +76 -0
  512. package/resources/targets/dsh/js3d/craft-game-maker/js3d.md +12 -0
  513. package/resources/targets/dsh/js3d/js3d/bundle.json +108 -0
  514. package/resources/targets/dsh/js3d/js3d/context/AGENTS.md +30 -0
  515. package/resources/targets/dsh/js3d/js3d/context/hooks/hooks.json +14 -0
  516. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  517. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  518. package/resources/targets/dsh/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  519. package/resources/targets/dsh/js3d/js3d/context/knowledge/Layout.md +7 -0
  520. package/resources/targets/dsh/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  521. package/resources/targets/dsh/js3d/js3d/context/knowledge/Runtime.md +9 -0
  522. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  523. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  524. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  525. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  526. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  527. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  528. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  529. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  530. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  531. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  532. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  533. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  534. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  535. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  536. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  537. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  538. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  539. package/resources/targets/dsh/js3d/js3d/context/skills/index.json +31 -0
  540. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  541. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  542. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  543. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  544. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  545. package/resources/targets/dsh/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  546. package/resources/targets/dsh/js3d/js3d/project/README.md +7 -0
  547. package/resources/targets/dsh/js3d/js3d/project/configs/game.controls.json +3 -0
  548. package/resources/targets/dsh/js3d/js3d/project/configs/game.json +3 -0
  549. package/resources/targets/dsh/js3d/js3d/project/game-runtime.json +7 -0
  550. package/resources/targets/dsh/js3d/js3d/project/game.config.json +7 -0
  551. package/resources/targets/dsh/js3d/js3d/project/index.html +12 -0
  552. package/resources/targets/dsh/js3d/js3d/project/package.json +23 -0
  553. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  554. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  555. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  556. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  557. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  558. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  559. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  560. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  561. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  562. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  563. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  564. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  565. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  566. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  567. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  568. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  569. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  570. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  571. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  572. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  573. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  574. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  575. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  576. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  577. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export.mjs +15 -0
  578. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  579. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  580. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  581. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  582. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  583. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  584. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  585. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  586. package/resources/targets/dsh/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  587. package/resources/targets/dsh/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  588. package/resources/targets/dsh/js3d/js3d/project/src/display/viewport.ts +239 -0
  589. package/resources/targets/dsh/js3d/js3d/project/src/main.ts +85 -0
  590. package/resources/targets/dsh/js3d/js3d/project/src/platform.ts +2 -0
  591. package/resources/targets/dsh/js3d/js3d/project/src/style.css +83 -0
  592. package/resources/targets/dsh/js3d/js3d/project/tsconfig.json +20 -0
  593. package/resources/targets/dsh/js3d/js3d/project/unified_data_control_config.json +20 -0
  594. package/resources/targets/dsh/js3d/js3d/project/vite.config.ts +5 -0
  595. package/resources/targets/dsh/js3d/recovery.md +13 -0
  596. package/resources/targets/dsh/js3d/target.json +60 -0
  597. package/resources/targets/index.json +72 -12
  598. package/resources/targets/kimi/js/bootstrap/SKILL.md +18 -0
  599. package/resources/targets/kimi/js/context-filter-report.json +27 -0
  600. package/resources/targets/kimi/js/craft-game-maker/SKILL.md +76 -0
  601. package/resources/targets/kimi/js/craft-game-maker/js.md +10 -0
  602. package/resources/targets/kimi/js/js/bundle.json +97 -0
  603. package/resources/targets/kimi/js/js/context/AGENTS.md +29 -0
  604. package/resources/targets/kimi/js/js/context/hooks/hooks.json +14 -0
  605. package/resources/targets/kimi/js/js/context/knowledge/AssetUrl.md +9 -0
  606. package/resources/targets/kimi/js/js/context/knowledge/AssetWiring.md +7 -0
  607. package/resources/targets/kimi/js/js/context/knowledge/Layout.md +7 -0
  608. package/resources/targets/kimi/js/js/context/knowledge/Lifecycle.md +11 -0
  609. package/resources/targets/kimi/js/js/context/knowledge/ResourceLoading.md +9 -0
  610. package/resources/targets/kimi/js/js/context/skills/export-config/SKILL.md +16 -0
  611. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  612. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  613. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  614. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  615. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  616. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  617. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  618. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  619. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  620. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  621. package/resources/targets/kimi/js/js/context/skills/index.json +19 -0
  622. package/resources/targets/kimi/js/js/context/skills/visual-qa/SKILL.md +14 -0
  623. package/resources/targets/kimi/js/js/project/README.md +7 -0
  624. package/resources/targets/kimi/js/js/project/configs/assets.json +1 -0
  625. package/resources/targets/kimi/js/js/project/configs/game.controls.json +3 -0
  626. package/resources/targets/kimi/js/js/project/configs/game.json +3 -0
  627. package/resources/targets/kimi/js/js/project/game-runtime.json +7 -0
  628. package/resources/targets/kimi/js/js/project/game.config.json +7 -0
  629. package/resources/targets/kimi/js/js/project/index.html +20 -0
  630. package/resources/targets/kimi/js/js/project/package.json +22 -0
  631. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  632. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  633. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  634. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  635. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  636. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  637. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  638. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  639. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  640. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  641. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  642. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  643. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  644. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  645. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  646. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  647. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  648. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  649. package/resources/targets/kimi/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  650. package/resources/targets/kimi/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  651. package/resources/targets/kimi/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  652. package/resources/targets/kimi/js/js/project/scripts/config-export.mjs +13 -0
  653. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  654. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  655. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  656. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  657. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  658. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  659. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  660. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  661. package/resources/targets/kimi/js/js/project/scripts/write-preview-ready.mjs +22 -0
  662. package/resources/targets/kimi/js/js/project/src/display/ui-stage.ts +156 -0
  663. package/resources/targets/kimi/js/js/project/src/display/viewport.ts +249 -0
  664. package/resources/targets/kimi/js/js/project/src/main.ts +87 -0
  665. package/resources/targets/kimi/js/js/project/src/platform.ts +2 -0
  666. package/resources/targets/kimi/js/js/project/src/scenes/LoadScene.ts +89 -0
  667. package/resources/targets/kimi/js/js/project/src/scenes/PlayScene.ts +17 -0
  668. package/resources/targets/kimi/js/js/project/src/screenUi.ts +185 -0
  669. package/resources/targets/kimi/js/js/project/src/style.css +294 -0
  670. package/resources/targets/kimi/js/js/project/tsconfig.json +20 -0
  671. package/resources/targets/kimi/js/js/project/unified_data_control_config.json +20 -0
  672. package/resources/targets/kimi/js/js/project/vite.config.ts +5 -0
  673. package/resources/targets/kimi/js/recovery.md +13 -0
  674. package/resources/targets/kimi/js/target.json +61 -0
  675. package/resources/targets/kimi/js3d/bootstrap/SKILL.md +18 -0
  676. package/resources/targets/kimi/js3d/context-filter-report.json +27 -0
  677. package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +76 -0
  678. package/resources/targets/kimi/js3d/craft-game-maker/js3d.md +12 -0
  679. package/resources/targets/kimi/js3d/js3d/bundle.json +108 -0
  680. package/resources/targets/kimi/js3d/js3d/context/AGENTS.md +30 -0
  681. package/resources/targets/kimi/js3d/js3d/context/hooks/hooks.json +14 -0
  682. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  683. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  684. package/resources/targets/kimi/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  685. package/resources/targets/kimi/js3d/js3d/context/knowledge/Layout.md +7 -0
  686. package/resources/targets/kimi/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  687. package/resources/targets/kimi/js3d/js3d/context/knowledge/Runtime.md +9 -0
  688. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  689. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  690. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  691. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  692. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  693. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  694. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  695. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  696. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  697. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  698. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  699. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  700. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  701. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  702. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  703. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  704. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  705. package/resources/targets/kimi/js3d/js3d/context/skills/index.json +31 -0
  706. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  707. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  708. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  709. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  710. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  711. package/resources/targets/kimi/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  712. package/resources/targets/kimi/js3d/js3d/project/README.md +7 -0
  713. package/resources/targets/kimi/js3d/js3d/project/configs/game.controls.json +3 -0
  714. package/resources/targets/kimi/js3d/js3d/project/configs/game.json +3 -0
  715. package/resources/targets/kimi/js3d/js3d/project/game-runtime.json +7 -0
  716. package/resources/targets/kimi/js3d/js3d/project/game.config.json +7 -0
  717. package/resources/targets/kimi/js3d/js3d/project/index.html +12 -0
  718. package/resources/targets/kimi/js3d/js3d/project/package.json +23 -0
  719. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  720. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  721. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  722. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  723. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  724. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  725. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  726. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  727. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  728. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  729. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  730. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  731. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  732. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  733. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  734. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  735. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  736. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  737. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  738. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  739. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  740. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  741. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  742. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  743. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export.mjs +15 -0
  744. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  745. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  746. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  747. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  748. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  749. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  750. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  751. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  752. package/resources/targets/kimi/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  753. package/resources/targets/kimi/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  754. package/resources/targets/kimi/js3d/js3d/project/src/display/viewport.ts +239 -0
  755. package/resources/targets/kimi/js3d/js3d/project/src/main.ts +85 -0
  756. package/resources/targets/kimi/js3d/js3d/project/src/platform.ts +2 -0
  757. package/resources/targets/kimi/js3d/js3d/project/src/style.css +83 -0
  758. package/resources/targets/kimi/js3d/js3d/project/tsconfig.json +20 -0
  759. package/resources/targets/kimi/js3d/js3d/project/unified_data_control_config.json +20 -0
  760. package/resources/targets/kimi/js3d/js3d/project/vite.config.ts +5 -0
  761. package/resources/targets/kimi/js3d/recovery.md +13 -0
  762. package/resources/targets/kimi/js3d/target.json +60 -0
  763. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +24 -14
  764. package/resources/targets/workbuddy/js/context-filter-report.json +27 -0
  765. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +18 -19
  766. package/resources/targets/workbuddy/js/craft-game-maker/js.md +2 -2
  767. package/resources/targets/workbuddy/js/js/bundle.json +16 -18
  768. package/resources/targets/workbuddy/js/js/context/AGENTS.md +29 -25
  769. package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  770. package/resources/targets/workbuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  771. package/resources/targets/workbuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  772. package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  773. package/resources/targets/workbuddy/js/js/context/skills/index.json +2 -14
  774. package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  775. package/resources/targets/workbuddy/js/recovery.md +19 -7
  776. package/resources/targets/workbuddy/js/target.json +1 -1
  777. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +24 -14
  778. package/resources/targets/workbuddy/js3d/context-filter-report.json +27 -0
  779. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +18 -19
  780. package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +3 -4
  781. package/resources/targets/workbuddy/js3d/js3d/bundle.json +19 -21
  782. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +30 -26
  783. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  784. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  785. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  786. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  787. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  788. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  789. package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +4 -16
  790. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  791. package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  792. package/resources/targets/workbuddy/js3d/recovery.md +19 -7
  793. package/resources/targets/workbuddy/js3d/target.json +1 -1
  794. package/resources/targets/zcode/js/bootstrap/SKILL.md +18 -0
  795. package/resources/targets/zcode/js/context-filter-report.json +27 -0
  796. package/resources/targets/zcode/js/craft-game-maker/SKILL.md +76 -0
  797. package/resources/targets/zcode/js/craft-game-maker/js.md +10 -0
  798. package/resources/targets/zcode/js/js/bundle.json +97 -0
  799. package/resources/targets/zcode/js/js/context/AGENTS.md +29 -0
  800. package/resources/targets/zcode/js/js/context/hooks/hooks.json +14 -0
  801. package/resources/targets/zcode/js/js/context/knowledge/AssetUrl.md +9 -0
  802. package/resources/targets/zcode/js/js/context/knowledge/AssetWiring.md +7 -0
  803. package/resources/targets/zcode/js/js/context/knowledge/Layout.md +7 -0
  804. package/resources/targets/zcode/js/js/context/knowledge/Lifecycle.md +11 -0
  805. package/resources/targets/zcode/js/js/context/knowledge/ResourceLoading.md +9 -0
  806. package/resources/targets/zcode/js/js/context/skills/export-config/SKILL.md +16 -0
  807. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  808. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  809. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  810. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  811. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  812. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  813. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  814. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  815. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  816. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  817. package/resources/targets/zcode/js/js/context/skills/index.json +19 -0
  818. package/resources/targets/zcode/js/js/context/skills/visual-qa/SKILL.md +14 -0
  819. package/resources/targets/zcode/js/js/project/README.md +7 -0
  820. package/resources/targets/zcode/js/js/project/configs/assets.json +1 -0
  821. package/resources/targets/zcode/js/js/project/configs/game.controls.json +3 -0
  822. package/resources/targets/zcode/js/js/project/configs/game.json +3 -0
  823. package/resources/targets/zcode/js/js/project/game-runtime.json +7 -0
  824. package/resources/targets/zcode/js/js/project/game.config.json +7 -0
  825. package/resources/targets/zcode/js/js/project/index.html +20 -0
  826. package/resources/targets/zcode/js/js/project/package.json +22 -0
  827. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  828. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  829. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  830. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  831. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  832. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  833. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  834. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  835. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  836. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  837. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  838. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  839. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  840. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  841. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  842. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  843. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  844. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  845. package/resources/targets/zcode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  846. package/resources/targets/zcode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  847. package/resources/targets/zcode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  848. package/resources/targets/zcode/js/js/project/scripts/config-export.mjs +13 -0
  849. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  850. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  851. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  852. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  853. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  854. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  855. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  856. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  857. package/resources/targets/zcode/js/js/project/scripts/write-preview-ready.mjs +22 -0
  858. package/resources/targets/zcode/js/js/project/src/display/ui-stage.ts +156 -0
  859. package/resources/targets/zcode/js/js/project/src/display/viewport.ts +249 -0
  860. package/resources/targets/zcode/js/js/project/src/main.ts +87 -0
  861. package/resources/targets/zcode/js/js/project/src/platform.ts +2 -0
  862. package/resources/targets/zcode/js/js/project/src/scenes/LoadScene.ts +89 -0
  863. package/resources/targets/zcode/js/js/project/src/scenes/PlayScene.ts +17 -0
  864. package/resources/targets/zcode/js/js/project/src/screenUi.ts +185 -0
  865. package/resources/targets/zcode/js/js/project/src/style.css +294 -0
  866. package/resources/targets/zcode/js/js/project/tsconfig.json +20 -0
  867. package/resources/targets/zcode/js/js/project/unified_data_control_config.json +20 -0
  868. package/resources/targets/zcode/js/js/project/vite.config.ts +5 -0
  869. package/resources/targets/zcode/js/recovery.md +13 -0
  870. package/resources/targets/zcode/js/target.json +61 -0
  871. package/resources/targets/zcode/js3d/bootstrap/SKILL.md +18 -0
  872. package/resources/targets/zcode/js3d/context-filter-report.json +27 -0
  873. package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +76 -0
  874. package/resources/targets/zcode/js3d/craft-game-maker/js3d.md +12 -0
  875. package/resources/targets/zcode/js3d/js3d/bundle.json +108 -0
  876. package/resources/targets/zcode/js3d/js3d/context/AGENTS.md +30 -0
  877. package/resources/targets/zcode/js3d/js3d/context/hooks/hooks.json +14 -0
  878. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  879. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  880. package/resources/targets/zcode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  881. package/resources/targets/zcode/js3d/js3d/context/knowledge/Layout.md +7 -0
  882. package/resources/targets/zcode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  883. package/resources/targets/zcode/js3d/js3d/context/knowledge/Runtime.md +9 -0
  884. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  885. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  886. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  887. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  888. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  889. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  890. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  891. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  892. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  893. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  894. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  895. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  896. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  897. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  898. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  899. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  900. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  901. package/resources/targets/zcode/js3d/js3d/context/skills/index.json +31 -0
  902. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  903. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  904. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  905. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  906. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  907. package/resources/targets/zcode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  908. package/resources/targets/zcode/js3d/js3d/project/README.md +7 -0
  909. package/resources/targets/zcode/js3d/js3d/project/configs/game.controls.json +3 -0
  910. package/resources/targets/zcode/js3d/js3d/project/configs/game.json +3 -0
  911. package/resources/targets/zcode/js3d/js3d/project/game-runtime.json +7 -0
  912. package/resources/targets/zcode/js3d/js3d/project/game.config.json +7 -0
  913. package/resources/targets/zcode/js3d/js3d/project/index.html +12 -0
  914. package/resources/targets/zcode/js3d/js3d/project/package.json +23 -0
  915. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  916. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  917. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  918. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  919. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  920. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  921. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  922. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  923. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  924. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  925. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  926. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  927. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  928. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  929. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  930. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  931. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  932. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  933. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  934. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  935. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  936. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  937. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  938. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  939. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export.mjs +15 -0
  940. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  941. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  942. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  943. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  944. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  945. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  946. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  947. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  948. package/resources/targets/zcode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  949. package/resources/targets/zcode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  950. package/resources/targets/zcode/js3d/js3d/project/src/display/viewport.ts +239 -0
  951. package/resources/targets/zcode/js3d/js3d/project/src/main.ts +85 -0
  952. package/resources/targets/zcode/js3d/js3d/project/src/platform.ts +2 -0
  953. package/resources/targets/zcode/js3d/js3d/project/src/style.css +83 -0
  954. package/resources/targets/zcode/js3d/js3d/project/tsconfig.json +20 -0
  955. package/resources/targets/zcode/js3d/js3d/project/unified_data_control_config.json +20 -0
  956. package/resources/targets/zcode/js3d/js3d/project/vite.config.ts +5 -0
  957. package/resources/targets/zcode/js3d/recovery.md +13 -0
  958. package/resources/targets/zcode/js3d/target.json +60 -0
  959. package/vendor/craft-runtime/SOURCE.json +2 -2
  960. package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  961. package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  962. package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  963. package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  964. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  965. package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  966. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  967. package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +0 -9
  968. package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  969. package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +0 -12
  970. package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  971. package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  972. package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  973. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  974. package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  975. package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  976. package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  977. package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  978. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  979. package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  980. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
@@ -0,0 +1,455 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
3
+ import { dirname, extname, join, relative, resolve, sep } from 'node:path';
4
+ import { imageSize, inspectGlb } from './glb.mjs';
5
+
6
+ const CODE_EXTS = new Set(['.js', '.mjs', '.cjs', '.ts', '.tsx', '.html', '.css']);
7
+ const ASSET_EXTS = new Set(['.glb', '.gltf', '.png', '.jpg', '.jpeg', '.webp', '.ktx', '.ktx2', '.ogg', '.mp3', '.wav', '.m4a', '.bin', '.woff', '.woff2', '.ttf', '.otf']);
8
+ const MODEL_EXTS = new Set(['.glb', '.gltf']);
9
+ const IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.webp', '.ktx', '.ktx2']);
10
+ const AUDIO_EXTS = new Set(['.ogg', '.mp3', '.wav', '.m4a']);
11
+ const SKIP_DIRS = new Set(['.git', 'node_modules', '.asset-audit', '.asset-search', 'dist', 'coverage', '.claude', '.cursor', '.agents', '.workbuddy', '.codebuddy', '.dsh', '.zcode', '.kimi-code', '.craft']);
12
+ const HARDCODED_URL = /(['"`])((?:https?:\/\/file\.craft\.qq\.com\/|\/Game\/|Game\/)[^'"`\\]*)\1/g;
13
+ const LOAD_CALLS = /\b(loadGlbModel|GLBLoader|SkinnedCreate|SkinnedFromGltf|GLTFLoader|createAssetLoader)\s*\(/g;
14
+
15
+ function toPosix(value) { return value.split(sep).join('/'); }
16
+ function escapeRegExp(value) {
17
+ return value.replace(/[.*+?^$|[\]\\]/g, '\\$&').replace(/[{}()]/g, '\\$&');
18
+ }
19
+ function countExact(text, needle) {
20
+ if (!needle) return 0;
21
+ let total = 0;
22
+ let at = text.indexOf(needle);
23
+ while (at >= 0) { total += 1; at = text.indexOf(needle, at + needle.length); }
24
+ return total;
25
+ }
26
+ function countToken(text, token) {
27
+ if (!token) return 0;
28
+ try { return (text.match(new RegExp('(?<![A-Za-z0-9_])' + escapeRegExp(token) + '(?![A-Za-z0-9_])', 'g')) || []).length; }
29
+ catch { return countExact(text, token); }
30
+ }
31
+ function stripComments(text, ext) {
32
+ let result = '';
33
+ let quote = null;
34
+ for (let index = 0; index < text.length; index += 1) {
35
+ const char = text[index];
36
+ const next = text[index + 1];
37
+ if (quote) {
38
+ result += char;
39
+ if (char === '\\') { index += 1; if (index < text.length) result += text[index]; continue; }
40
+ if (char === quote) quote = null;
41
+ continue;
42
+ }
43
+ if (char === '"' || char === "'" || char === '`') { quote = char; result += char; continue; }
44
+ if (char === '/' && next === '/') {
45
+ while (index < text.length && text[index] !== '\n') index += 1;
46
+ result += '\n';
47
+ continue;
48
+ }
49
+ if (char === '/' && next === '*') {
50
+ index += 2;
51
+ while (index < text.length && !(text[index] === '*' && text[index + 1] === '/')) {
52
+ if (text[index] === '\n') result += '\n';
53
+ index += 1;
54
+ }
55
+ index += 1;
56
+ continue;
57
+ }
58
+ result += char;
59
+ }
60
+ if (ext === '.html' || ext === '.htm') result = result.replace(/<!--[\s\S]*?-->/g, '');
61
+ return result;
62
+ }
63
+ function readText(path) { try { return readFileSync(path, 'utf8'); } catch { return ''; } }
64
+ function readJson(path, fallback) { try { return JSON.parse(readFileSync(path, 'utf8')); } catch { return fallback; } }
65
+ function walkFiles(root) {
66
+ const files = [];
67
+ const visit = (dir) => {
68
+ let entries;
69
+ try { entries = readdirSync(dir, { withFileTypes: true }); } catch { return; }
70
+ for (const entry of entries) {
71
+ if (entry.isSymbolicLink()) continue;
72
+ if (entry.isDirectory()) { if (!SKIP_DIRS.has(entry.name)) visit(join(dir, entry.name)); continue; }
73
+ if (entry.isFile()) files.push(join(dir, entry.name));
74
+ }
75
+ };
76
+ visit(root);
77
+ return files;
78
+ }
79
+ function collectFiles(root, roots) {
80
+ const result = [];
81
+ for (const item of roots) {
82
+ const absolute = join(root, item);
83
+ if (!existsSync(absolute)) continue;
84
+ try { if (!statSync(absolute).isDirectory()) { result.push(absolute); continue; } } catch { continue; }
85
+ result.push(...walkFiles(absolute));
86
+ }
87
+ return result;
88
+ }
89
+ const SOURCE_CODE_SKIP = /(?:^|\/)(?:node_modules|dist|build|public|runtime|vendor|_original|tests?|scripts|coverage|\.claude|\.cursor|\.agents|\.workbuddy|\.codebuddy|\.dsh|\.zcode|\.kimi-code|\.craft|\.asset-audit|\.asset-search)(?:\/|$)/i;
90
+ function collectSourceCode(root) {
91
+ return walkFiles(root).filter((file) => {
92
+ if (!/\.(?:ts|tsx|js|mjs|cjs)$/i.test(file)) return false;
93
+ if (/\.min\.(?:js|mjs|cjs)$/i.test(file)) return false;
94
+ const rel = toPosix(relative(root, file));
95
+ return !SOURCE_CODE_SKIP.test(rel);
96
+ });
97
+ }
98
+ function kindFor(value, assetType) {
99
+ const ext = extname(String(value).split('?')[0]).toLowerCase();
100
+ if (assetType === 'Texture2D') return 'texture';
101
+ if (assetType === 'StaticMesh' || assetType === 'SkeletalMesh') return 'model';
102
+ if (assetType === 'AnimSequence') return 'animation';
103
+ if (assetType === 'PaperFlipbook') return 'sprite';
104
+ if (assetType === 'SoundWave') return 'audio';
105
+ if (MODEL_EXTS.has(ext)) return 'model';
106
+ if (IMAGE_EXTS.has(ext)) return 'texture';
107
+ if (AUDIO_EXTS.has(ext)) return 'audio';
108
+ if (ext === '.bin') return 'binary';
109
+ if (ext === '.woff' || ext === '.woff2' || ext === '.ttf' || ext === '.otf') return 'font';
110
+ return 'other';
111
+ }
112
+ function looksLikeAssetUrl(value) {
113
+ if (typeof value !== 'string') return false;
114
+ const text = value.trim();
115
+ if (!text) return false;
116
+ if (text.startsWith('/Game/') || text.startsWith('Game/') || text.startsWith('test1/')) return true;
117
+ if (text.startsWith('https://file.craft.qq.com/')) return true;
118
+ return ASSET_EXTS.has(extname(text.split('?')[0]).toLowerCase());
119
+ }
120
+ function flattenLeaves(value, prefix, out) {
121
+ if (out === undefined) out = [];
122
+ if (value === null || value === undefined) return out;
123
+ if (Array.isArray(value)) { value.forEach((item, index) => flattenLeaves(item, prefix ? prefix + '.' + index : String(index), out)); return out; }
124
+ if (typeof value === 'object') { for (const [key, item] of Object.entries(value)) flattenLeaves(item, prefix ? prefix + '.' + key : key, out); return out; }
125
+ if (typeof value === 'string') out.push({ path: prefix, value });
126
+ return out;
127
+ }
128
+ function normalizeUrl(value) {
129
+ return String(value || '').trim().replace(/^https?:\/\/file\.craft\.qq\.com\//i, '').replace(/^\/Glb\//, '/').replace(/^Glb\//, '').replace(/^\/+/, '');
130
+ }
131
+ function hashFile(path) { try { return createHash('sha256').update(readFileSync(path)).digest('hex'); } catch { return null; } }
132
+ function makeCorpus(files) {
133
+ const texts = [];
134
+ for (const file of files) {
135
+ const ext = extname(file).toLowerCase();
136
+ if (!CODE_EXTS.has(ext) && ext !== '.json') continue;
137
+ const text = readText(file);
138
+ if (text) texts.push(stripComments(text, ext));
139
+ }
140
+ return texts.join('\n');
141
+ }
142
+ function familyDirectories(code, dirs) {
143
+ const found = new Set();
144
+ const topLevel = new Set(['models', 'audio', 'textures', 'ui', 'clouds', 'assets']);
145
+ for (const dir of dirs) {
146
+ if (topLevel.has(dir)) continue;
147
+ const token = dir + '/';
148
+ let at = code.indexOf(token);
149
+ while (at >= 0) {
150
+ const after = code.slice(at + token.length, at + token.length + 500);
151
+ const before = code.slice(Math.max(0, at - 140), at);
152
+ if (/(\+|\.concat\(|\.join\()/.test(after)) { found.add(dir); break; }
153
+ const assigned = before.match(/([A-Za-z_$][\w$]*)\s*=\s*['"`](?:\.\/)?$/);
154
+ if (assigned) {
155
+ const name = escapeRegExp(assigned[1]);
156
+ const use = new RegExp('\\b' + name + '\\b\\s*(?:\\+|\\$\\{)' + '|\\.\\.\\.\\s*' + name + '\\b' + '|\\$\\{\\s*' + name + '\\b' + '|\\.concat\\(\\s*' + name + '\\b');
157
+ if (use.test(code)) { found.add(dir); break; }
158
+ }
159
+ at = code.indexOf(token, at + token.length);
160
+ }
161
+ }
162
+ return found;
163
+ }
164
+ function buildBundleAssets(root) {
165
+ const files = collectFiles(root, ['models', 'audio', 'textures', 'ui', 'clouds', 'assets']).filter((file) => ASSET_EXTS.has(extname(file).toLowerCase()) && !CODE_EXTS.has(extname(file).toLowerCase()));
166
+ const assets = [];
167
+ for (const file of new Set(files)) {
168
+ const rel = toPosix(relative(root, file));
169
+ const kind = kindFor(rel);
170
+ let glb = null; let image = null; let error = null;
171
+ try {
172
+ if (kind === 'model' && extname(rel).toLowerCase() === '.glb') glb = inspectGlb(readFileSync(file));
173
+ else if (kind === 'texture') image = imageSize(readFileSync(file));
174
+ } catch (caught) { error = caught.message; }
175
+ assets.push({ path: rel, absolute: file, bytes: statSync(file).size, kind, glb, image, error });
176
+ }
177
+ return assets;
178
+ }
179
+ function buildBundleCorpus(root) {
180
+ const files = collectFiles(root, ['assets', 'ui', 'models', 'clouds']).filter((file) => ['.js', '.mjs', '.cjs', '.css', '.html', '.json'].includes(extname(file).toLowerCase()));
181
+ const index = join(root, 'index.html');
182
+ if (existsSync(index)) files.push(index);
183
+ return makeCorpus(files);
184
+ }
185
+ function hasUsageCode(root) {
186
+ const files = collectFiles(root, ['assets', 'ui', 'clouds']).filter((file) => /\.(js|mjs|cjs)$/i.test(file));
187
+ for (const file of files) {
188
+ try { if (statSync(file).size > 0) return true; } catch { /* ignore unreadable files */ }
189
+ }
190
+ return false;
191
+ }
192
+ function prefixPath(path) {
193
+ return path.split(', ').map((item) => item.startsWith('public/') ? item : 'public/' + item).join(', ');
194
+ }
195
+ function preloadFinding(code, assets) {
196
+ const pattern = /\[(?:\s*['"][^'"]{2,}['"]\s*,){7,}\s*['"][^'"]+['"]\s*\]/g;
197
+ for (const match of code.matchAll(pattern)) {
198
+ const at = match.index || 0;
199
+ const context = code.slice(Math.max(0, at - 800), at + 3000);
200
+ if (!/fetch\s*\(/.test(context) || !/\.glb['"`]/.test(context)) continue;
201
+ const names = [...match[0].matchAll(/['"`]([^'"`]+)['"`]/g)].map((item) => item[1]);
202
+ const matched = assets.filter((asset) => names.some((name) => {
203
+ const base = name.replace(/\.glb$/i, '').split('/').pop();
204
+ return Boolean(base) && asset.path.endsWith('/' + base + '.glb');
205
+ }));
206
+ if (!matched.length) continue;
207
+ return {
208
+ id: 'EAGER_PRELOAD', severity: 'warning', confidence: 'medium',
209
+ title: 'Many model files are fetched by an eager preload list', path: 'bundle script',
210
+ evidence: { names: names.length, matchedFiles: matched.length, bytes: matched.reduce((total, asset) => total + asset.bytes, 0) },
211
+ estimatedSavings: 0,
212
+ fix: 'Stage the preload (small warm set, idle priority) or reduce payload with animation resampling/texture resizing; keep enough warm models to avoid pop-in.',
213
+ verify: 'Measure first-canvas time and model-ready time separately; do not remove the preload based only on network totals.',
214
+ };
215
+ }
216
+ return null;
217
+ }
218
+ function summarizeBundle(root, assets, corpus, options) {
219
+ const settings = options || {};
220
+ const hasUsageEvidence = settings.hasUsageEvidence !== false;
221
+ const dirs = [...new Set(assets.map((asset) => toPosix(dirname(asset.path))))].filter((dir) => dir !== '.');
222
+ const family = familyDirectories(corpus, dirs);
223
+ const findings = [];
224
+ const duplicates = new Map();
225
+ const enriched = assets.map((asset) => {
226
+ const name = asset.path.split('/').pop();
227
+ const stem = name.replace(/\.[^.]+$/, '');
228
+ const dir = toPosix(dirname(asset.path));
229
+ const pathCount = countExact(corpus, asset.path) + countExact(corpus, './' + asset.path);
230
+ const nameCount = countToken(corpus, name);
231
+ const stemCount = pathCount === 0 && nameCount === 0 ? countToken(corpus, stem) : 0;
232
+ const familyHit = family.has(dir);
233
+ const used = pathCount > 0 || nameCount > 0 || stemCount > 0 || familyHit;
234
+ const confidence = pathCount > 0 || nameCount > 0 ? 'direct' : familyHit ? 'family' : 'none';
235
+ const hash = hashFile(asset.absolute);
236
+ if (hash) { if (!duplicates.has(hash)) duplicates.set(hash, []); duplicates.get(hash).push(asset.path); }
237
+ if (!used && hasUsageEvidence) findings.push({ id: 'UNREFERENCED_FILE', severity: 'warning', confidence: dir !== '.' && corpus.includes(dir + '/') ? 'medium' : 'high', title: 'Asset file is not referenced by scanned code', path: asset.path, evidence: { bytes: asset.bytes, refs: { path: pathCount, name: nameCount, stem: stemCount, family: familyHit } }, estimatedSavings: asset.bytes, fix: 'Confirm intent, then remove the file or exclude it from the package. Never remove a dynamic family without checking its constructor.', verify: 'Rebuild and run the game; check for 404s and missing visuals/audio.' });
238
+ if (asset.error) findings.push({ id: 'GLB_PARSE_ERROR', severity: 'error', confidence: 'high', title: 'GLB could not be inspected', path: asset.path, evidence: { error: asset.error, bytes: asset.bytes }, estimatedSavings: 0, fix: 'Inspect with the runtime loader; reject corrupted or unsupported GLBs.', verify: 'Load through the project runtime and confirm it renders.' });
239
+ if (asset.glb) {
240
+ const glb = asset.glb;
241
+ if (glb.extensionsRequired.length) findings.push({ id: 'UNSUPPORTED_GLB_EXTENSION', severity: 'error', confidence: 'high', title: 'GLB requires a glTF extension; verify the project loader supports it', path: asset.path, evidence: { extensionsRequired: glb.extensionsRequired, bytes: asset.bytes }, estimatedSavings: 0, fix: 'Confirm whether the project uses loadGlbModel (Three GLTFLoader) or a custom GLBLoader; add the needed decoder or re-export without extensionsRequired. Do not strip extensionsRequired without proof.', verify: 'Load the GLB with the project runtime and check geometry, skinning and textures.' });
242
+ if (glb.animationBytes > 500000 && glb.animationBytes / Math.max(1, asset.bytes) > 0.35) findings.push({ id: 'ANIMATION_DOMINANT', severity: 'warning', confidence: 'high', title: 'Animation keyframes dominate this skinned model', path: asset.path, evidence: { bytes: asset.bytes, animationBytes: glb.animationBytes, clips: glb.clips, keyframes: glb.keyframes, duration: glb.duration, keyframesPerSecond: Number(glb.keyframesPerSecond.toFixed(1)) }, estimatedSavings: Math.round(glb.animationBytes * 0.5), fix: 'Resample with gltf-transform (tolerance ~0.001), then validate clip names/durations and sampled transforms with a slerp-aware comparison.', verify: 'Run the game, compare representative poses, and confirm clips/durations are unchanged.' });
243
+ if (glb.textureBytes > 500000 || glb.images.some((image) => (image.width || 0) > 1024 || (image.height || 0) > 1024)) findings.push({ id: 'LARGE_TEXTURE', severity: 'warning', confidence: 'high', title: 'Model embeds large textures', path: asset.path, evidence: { bytes: asset.bytes, textureBytes: glb.textureBytes, images: glb.images.map((image) => ({ width: image.width, height: image.height, bytes: image.bytes, format: image.format })) }, estimatedSavings: Math.round(glb.textureBytes * 0.5), fix: 'Resize embedded textures to the smallest size that survives the actual viewing distance, then re-embed; keep alpha and color-space semantics.', verify: 'Compare the model at the closest gameplay distance; check seams, alpha edges and UI readability.' });
244
+ if (!glb.clips && glb.nodes > glb.meshes + 5 && glb.nodes > glb.meshes * 1.5 && asset.bytes > 500000) findings.push({ id: 'PRUNE_CANDIDATE', severity: 'info', confidence: 'medium', title: 'Static model carries many empty/auxiliary nodes', path: asset.path, evidence: { bytes: asset.bytes, nodes: glb.nodes, meshes: glb.meshes }, estimatedSavings: Math.round(asset.bytes * 0.1), fix: 'Run gltf-transform prune (and dedup); keep nodes the game looks up by name.', verify: 'Load through the project runtime and confirm named anchors and materials still resolve.' });
245
+ } else if (asset.kind === 'texture' && asset.image) {
246
+ if (asset.bytes > 1000000 || asset.image.width > 1024 || asset.image.height > 1024) findings.push({ id: 'LARGE_TEXTURE', severity: 'warning', confidence: 'high', title: 'Texture is larger than the common 1024 px budget', path: asset.path, evidence: { bytes: asset.bytes, width: asset.image.width, height: asset.image.height, format: asset.image.format }, estimatedSavings: Math.round(asset.bytes * 0.5), fix: 'Resize to the smallest size that survives the viewing distance; preserve aspect ratio, alpha and format.', verify: 'Compare in the real camera distance and target screen size.' });
247
+ }
248
+ return { path: asset.path, bytes: asset.bytes, kind: asset.kind, used: hasUsageEvidence ? used : null, confidence: hasUsageEvidence ? confidence : 'unknown', refs: { path: pathCount, name: nameCount, stem: stemCount, family: familyHit }, glb: asset.glb, image: asset.image, error: asset.error };
249
+ });
250
+ for (const [hash, paths] of duplicates) {
251
+ if (paths.length < 2) continue;
252
+ const first = assets.find((asset) => asset.path === paths[0]);
253
+ const bytes = first ? first.bytes : 0;
254
+ findings.push({ id: 'DUPLICATE_FILE', severity: 'warning', confidence: 'high', title: 'Identical asset files are packaged more than once', path: paths.join(', '), evidence: { hash: hash.slice(0, 12), files: paths.length, bytesEach: bytes }, estimatedSavings: bytes * (paths.length - 1), fix: 'Keep one copy and reference it from all consumers; verify the export does not require a distinct filename per slot.', verify: 'Rebuild and confirm every consumer still loads the shared asset.' });
255
+ }
256
+ const preload = preloadFinding(corpus, assets);
257
+ if (preload) findings.push(preload);
258
+ if (!hasUsageEvidence) findings.push({ id: 'NO_USAGE_CORPUS', severity: 'warning', confidence: 'high', title: 'No built code was scanned; asset usage cannot be determined', path: 'bundle script', evidence: { assets: assets.length }, estimatedSavings: 0, fix: 'Build the project and scan the built output, or use source mode with configs. Do not delete assets from this report.', verify: 'Re-run after a successful build and confirm asset references appear.' });
259
+ const glbAssets = enriched.filter((asset) => asset.glb);
260
+ const usedBytes = hasUsageEvidence ? enriched.filter((asset) => asset.used).reduce((total, asset) => total + asset.bytes, 0) : 0;
261
+ const unusedBytes = hasUsageEvidence ? enriched.filter((asset) => !asset.used).reduce((total, asset) => total + asset.bytes, 0) : 0;
262
+ const textureBytes = glbAssets.reduce((total, asset) => total + asset.glb.textureBytes, 0) + enriched.filter((asset) => asset.kind === 'texture').reduce((total, asset) => total + asset.bytes, 0);
263
+ return { assets: enriched, findings, summary: { files: enriched.length, bytes: enriched.reduce((total, asset) => total + asset.bytes, 0), usedBytes, unusedBytes, familyBytes: enriched.filter((asset) => asset.confidence === 'family').reduce((total, asset) => total + asset.bytes, 0), glbFiles: glbAssets.length, animationBytes: glbAssets.reduce((total, asset) => total + asset.glb.animationBytes, 0), textureBytes, duplicateGroups: [...duplicates.values()].filter((paths) => paths.length > 1).length, usageEvidence: hasUsageEvidence } };
264
+ }
265
+ function collectControls(configDir) {
266
+ const controls = new Map();
267
+ if (!existsSync(configDir)) return controls;
268
+ for (const name of readdirSync(configDir)) {
269
+ if (!name.endsWith('.json') || name.endsWith('.controls.json') || name === 'scene_assets.json') continue;
270
+ const stem = name.replace(/\.json$/, '');
271
+ const json = readJson(join(configDir, name), null);
272
+ if (!json || typeof json !== 'object' || Array.isArray(json)) continue;
273
+ const inline = (value, prefix) => {
274
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return;
275
+ const key = prefix === stem || prefix.startsWith(stem + '.') ? prefix : stem + '.' + prefix;
276
+ if (value.type === 'resource') controls.set(key, value);
277
+ for (const [childKey, child] of Object.entries(value)) inline(child, prefix ? prefix + '.' + childKey : childKey);
278
+ };
279
+ inline(json, '');
280
+ }
281
+ for (const name of readdirSync(configDir)) {
282
+ if (!name.endsWith('.controls.json')) continue;
283
+ const json = readJson(join(configDir, name), {});
284
+ const stem = name.replace(/\.controls\.json$/, '');
285
+ const walk = (value, prefix) => {
286
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return;
287
+ if (value.type) controls.set(stem + '.' + prefix, value);
288
+ for (const [key, child] of Object.entries(value)) walk(child, prefix ? prefix + '.' + key : key);
289
+ };
290
+ walk(json, '');
291
+ }
292
+ return controls;
293
+ }
294
+ function collectSourceSlots(root) {
295
+ const runtime = readJson(join(root, 'game-runtime.json'), {});
296
+ const configDir = join(root, runtime.configs || 'configs');
297
+ const controls = collectControls(configDir);
298
+ const slots = [];
299
+ const seen = new Set();
300
+ const knownUrls = new Set();
301
+ const add = (slot) => {
302
+ const key = normalizeUrl(slot.url);
303
+ if (slot.manifest && key && knownUrls.has(key)) return;
304
+ if (!slot.manifest && key) knownUrls.add(key);
305
+ if (!seen.has(slot.id)) { seen.add(slot.id); slots.push(slot); }
306
+ };
307
+ if (existsSync(configDir)) {
308
+ for (const name of readdirSync(configDir)) {
309
+ if (!name.endsWith('.json') || name.endsWith('.controls.json') || name === 'scene_assets.json') continue;
310
+ const stem = name.replace(/\.json$/, '');
311
+ const json = readJson(join(configDir, name), null);
312
+ if (!json || typeof json !== 'object' || Array.isArray(json)) continue;
313
+ for (const leaf of flattenLeaves(json)) {
314
+ const id = leaf.path === stem || leaf.path.startsWith(stem + '.') ? leaf.path : stem + '.' + leaf.path;
315
+ const control = controls.get(id) || (id.endsWith('.value') ? controls.get(id.slice(0, -6)) : null);
316
+ const declared = control && control.type === 'resource';
317
+ if (!declared && !looksLikeAssetUrl(leaf.value)) continue;
318
+ add({ id, url: leaf.value, kind: kindFor(leaf.value, control && control.asset_type), source: 'configs/' + name, configFile: stem, path: leaf.path, controls: control ? { type: control.type, asset_type: control.asset_type } : null });
319
+ }
320
+ }
321
+ }
322
+ const sceneAssets = readJson(join(configDir, 'scene_assets.json'), {});
323
+ if (sceneAssets && typeof sceneAssets === 'object') {
324
+ for (const [key, entry] of Object.entries(sceneAssets)) {
325
+ const url = typeof entry === 'string' ? entry : entry && entry.value;
326
+ if (typeof url === 'string' && url) add({ id: 'scene_assets.' + key, url, kind: kindFor(url), source: 'configs/scene_assets.json', sceneAsset: true });
327
+ }
328
+ }
329
+ const manifest = readJson(join(root, 'SPEC', 'res', 'asset-manifest.json'), null);
330
+ if (manifest && typeof manifest === 'object' && !Array.isArray(manifest)) {
331
+ for (const [slot, entry] of Object.entries(manifest)) {
332
+ if (!entry || typeof entry !== 'object') continue;
333
+ const url = entry.path || entry.Path || entry.file_path || entry.FilePath || entry.asset_path;
334
+ if (typeof url === 'string' && url) add({ id: 'manifest.' + slot, url, kind: kindFor(url, entry.asset_type), source: 'SPEC/res/asset-manifest.json', manifest: { slot, status: entry.status || null, category: entry.category || null } });
335
+ }
336
+ }
337
+ return slots;
338
+ }
339
+ function collectSourceFindings(root, slots) {
340
+ const srcRoot = join(root, 'src');
341
+ const srcFiles = existsSync(srcRoot) ? walkFiles(srcRoot) : [];
342
+ const codeFiles = collectSourceCode(root);
343
+ const cleanSource = codeFiles.map((file) => stripComments(readText(file), extname(file))).join('\n');
344
+ const findings = [];
345
+ const imports = new Map();
346
+ const defaultImport = /import\s+([A-Za-z_$][\w$]*)\s+from\s+['"]([^'"]*configs\/([^'"]+)\.json)['"]/g;
347
+ const namespaceImport = /import\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"]([^'"]*configs\/([^'"]+)\.json)['"]/g;
348
+ const aliasImport = /import\s*\{\s*default\s+as\s+([A-Za-z_$][\w$]*)\s*\}\s*from\s+['"]([^'"]*configs\/([^'"]+)\.json)['"]/g;
349
+ for (const match of cleanSource.matchAll(defaultImport)) imports.set(match[3], match[1]);
350
+ for (const match of cleanSource.matchAll(namespaceImport)) imports.set(match[3], match[1]);
351
+ for (const match of cleanSource.matchAll(aliasImport)) imports.set(match[3], match[1]);
352
+ for (const slot of slots) {
353
+ if (!slot.configFile || !slot.path) { slot.usage = countExact(cleanSource, slot.url) > 0 ? 'direct' : slot.sceneAsset ? 'direct' : slot.manifest ? 'unknown' : 'unreferenced'; continue; }
354
+ const local = imports.get(slot.configFile);
355
+ if (!local) {
356
+ if (countExact(cleanSource, slot.url) > 0) slot.usage = 'direct';
357
+ else if (cleanSource.includes('configs/' + slot.configFile + '.json')) slot.usage = 'dynamic';
358
+ else slot.usage = 'unreferenced';
359
+ continue;
360
+ }
361
+ if (new RegExp('(?:Object\\s*\\.\\s*(?:entries|values|keys)|\\.\\.\\.)\\s*\\(?\\s*' + escapeRegExp(local) + '\\b').test(cleanSource)) { slot.usage = 'dynamic'; continue; }
362
+ const dotted = new RegExp(escapeRegExp(local) + '\\.' + slot.path.split('.').map(escapeRegExp).join('\\.') + '(?![A-Za-z0-9_])');
363
+ const indexed = new RegExp(escapeRegExp(local) + '\\s*\\[\\s*[\'"]' + escapeRegExp(slot.path) + '[\'"]\\s*\\]');
364
+ slot.usage = dotted.test(cleanSource) || indexed.test(cleanSource) ? 'direct' : 'unreferenced';
365
+ }
366
+ const sceneRefs = [];
367
+ if (existsSync(srcRoot)) for (const file of walkFiles(join(srcRoot, 'scenes'))) {
368
+ if (!file.endsWith('scene.ts')) continue;
369
+ for (const match of readText(file).matchAll(/['"]([^'"]*\/Game\/[^'"]+)['"]/g)) sceneRefs.push({ file: toPosix(relative(root, file)), url: match[1] });
370
+ }
371
+ const sceneValues = new Set(slots.filter((slot) => slot.sceneAsset).map((slot) => normalizeUrl(slot.url)));
372
+ for (const ref of sceneRefs) if (!sceneValues.has(normalizeUrl(ref.url))) findings.push({ id: 'SCENE_ASSET_UNREGISTERED', severity: 'error', confidence: 'high', title: 'Scene data references a /Game asset that is not registered', path: ref.file, evidence: { url: ref.url }, estimatedSavings: 0, fix: 'Regenerate configs/scene_assets.json through the export/build flow; the packager silently drops unregistered scene assets.', verify: 'Run npm run build and confirm the asset is present in the package.' });
373
+ for (const file of srcFiles) {
374
+ const rel = toPosix(relative(root, file));
375
+ if ((rel.includes('/scenes/') && rel.endsWith('/scene.ts')) || rel.endsWith('assets.json')) continue;
376
+ for (const match of readText(file).matchAll(HARDCODED_URL)) findings.push({ id: 'HARDCODED_URL', severity: 'error', confidence: 'high', title: 'Asset URL is written directly in source instead of configs/assets.json', path: rel, evidence: { url: match[2] }, estimatedSavings: 0, fix: 'Move the URL into configs/assets.json, import the JSON and consume resolveAssetUrl/loadGlbModel.', verify: 'Run npm run build; the asset wiring assertion must pass.' });
377
+ }
378
+ if (/\bGLTFLoader\b|\bDRACOLoader\b/.test(cleanSource)) findings.push({ id: 'BYPASS_GLB_LOADER', severity: 'warning', confidence: 'medium', title: 'Source uses a raw glTF loader for assets', path: 'source', evidence: { matches: ['GLTFLoader', 'DRACOLoader'].filter((name) => cleanSource.includes(name)) }, estimatedSavings: 0, fix: 'Use loadGlbModel from runtime/lightgame/1.1.0/tools/glb.mjs; a custom pipeline must keep URL rewriting and manager.addHandler on a per-load manager.', verify: 'Confirm LOD fallback, compressed-texture selection and PNG fallback.' });
379
+ const HOT_FUNCTION = /\b(?:function\s+(?:render|update|tick|animate|loop)\b|(?:render|update|tick|animate|loop)\s*[:=]\s*(?:async\s*)?(?:function|\())/;
380
+ const COLD_FUNCTION = /\b(?:function\s+(?:init|setup|boot|load|preload|start|create|enter)\b|(?:init|setup|boot|load|preload|start|create|enter)\s*[:=]\s*(?:async\s*)?(?:function|\())/;
381
+ const loadSites = [];
382
+ for (const match of cleanSource.matchAll(LOAD_CALLS)) {
383
+ const at = match.index || 0;
384
+ const context = cleanSource.slice(Math.max(0, at - 300), at + 200);
385
+ loadSites.push({ api: match[1], hot: HOT_FUNCTION.test(context) && !COLD_FUNCTION.test(context) });
386
+ }
387
+ for (const site of loadSites.filter((item) => item.hot)) findings.push({ id: 'LOAD_IN_HOT_PATH', severity: 'warning', confidence: 'low', title: 'Model/asset load appears inside a render or loop path', path: 'source', evidence: { api: site.api }, estimatedSavings: 0, fix: 'Load during init or scene entry, keep the handle, and reuse/copy the loaded result.', verify: 'Profile the representative frame and confirm no network/parse work during rendering.' });
388
+ if (loadSites.length && !/\bdispose\s*\(/.test(cleanSource)) findings.push({ id: 'NO_DISPOSE', severity: 'info', confidence: 'medium', title: 'No model/resource disposal path was found', path: 'source', evidence: { loadSites: loadSites.length }, estimatedSavings: 0, fix: 'Release owned geometries/materials/textures on scene switch or teardown, and clear the AssetLoader cache if used.', verify: 'Switch/reload the scene and confirm GPU resource counts do not grow monotonically.' });
389
+ for (const slot of slots) {
390
+ if (slot.usage === 'unreferenced') findings.push({ id: 'UNREFERENCED_SLOT', severity: 'warning', confidence: 'medium', title: 'Declared asset slot has no provable consumer', path: slot.source, evidence: { slot: slot.id, url: slot.url, kind: slot.kind }, estimatedSavings: 0, fix: 'Confirm intent, then remove the slot and its controls or wire it to a real consumer. If the JSON is consumed dynamically, do not delete.', verify: 'Run npm run build and exercise the owning feature.' });
391
+ else if (slot.usage === 'dynamic') findings.push({ id: 'UNKNOWN_USAGE', severity: 'info', confidence: 'low', title: 'Config is consumed dynamically; usage cannot be proven statically', path: slot.source, evidence: { slot: slot.id, url: slot.url }, estimatedSavings: 0, fix: 'Inspect the dynamic access manually; do not treat this slot as unused.', verify: 'Exercise the code path that enumerates the config.' });
392
+ if (!slot.controls && !slot.sceneAsset && !slot.manifest) findings.push({ id: 'CONTROLS_MISSING', severity: 'info', confidence: 'medium', title: 'Asset slot has no resource control metadata', path: slot.source, evidence: { slot: slot.id, url: slot.url }, estimatedSavings: 0, fix: 'Add type:resource and asset_type to the matching *.controls.json.', verify: 'Open the config panel and confirm the control appears.' });
393
+ }
394
+ const byUrl = new Map();
395
+ for (const slot of slots) { const key = normalizeUrl(slot.url); if (!byUrl.has(key)) byUrl.set(key, []); byUrl.get(key).push(slot); }
396
+ for (const [url, group] of byUrl) if (group.length > 1) findings.push({ id: 'DUPLICATE_URL', severity: 'info', confidence: 'high', title: 'The same asset URL is registered under multiple slots', path: group.map((slot) => slot.source).join(', '), evidence: { url, slots: group.map((slot) => slot.id) }, estimatedSavings: 0, fix: 'Keep one canonical slot or load once and share the result; retain aliases only if the panel needs them.', verify: 'Confirm every consumer still resolves the URL after consolidation.' });
397
+ return { findings, sourceFiles: codeFiles.length, usage: slots.map((slot) => ({ id: slot.id, url: slot.url, kind: slot.kind, source: slot.source, usage: slot.usage || 'unknown' })) };
398
+ }
399
+ export function scanProject(projectRoot, options) {
400
+ const settings = options || {};
401
+ const mode = settings.mode || 'auto';
402
+ const root = resolve(projectRoot);
403
+ const hasSource = existsSync(join(root, 'src')) && existsSync(join(root, 'configs'));
404
+ const hasBundle = existsSync(join(root, 'index.html')) && existsSync(join(root, 'assets'));
405
+ const resolvedMode = mode === 'auto' ? (hasSource ? 'source' : hasBundle ? 'bundle' : 'source') : mode;
406
+ const findings = [];
407
+ let assets = [];
408
+ let summary = {};
409
+ let usage = [];
410
+
411
+ if (resolvedMode === 'bundle') {
412
+ const result = summarizeBundle(root, buildBundleAssets(root), buildBundleCorpus(root), { hasUsageEvidence: hasUsageCode(root) });
413
+ assets = result.assets;
414
+ summary = result.summary;
415
+ findings.push(...result.findings);
416
+ } else {
417
+ const publicRoot = join(root, 'public');
418
+ const hasPublicAssets = existsSync(join(publicRoot, 'models')) || existsSync(join(publicRoot, 'audio')) || existsSync(join(publicRoot, 'textures'));
419
+ const slots = collectSourceSlots(root);
420
+ const sourceResult = collectSourceFindings(root, slots);
421
+ findings.push(...sourceResult.findings);
422
+ usage = sourceResult.usage;
423
+ summary = {
424
+ slots: slots.length,
425
+ used: usage.filter((item) => item.usage === 'direct').length,
426
+ dynamic: usage.filter((item) => item.usage === 'dynamic').length,
427
+ unreferenced: usage.filter((item) => item.usage === 'unreferenced').length,
428
+ sourceFiles: sourceResult.sourceFiles,
429
+ };
430
+ if (!slots.length) {
431
+ summary.note = hasPublicAssets
432
+ ? 'No config asset slots; assets are mirrored under public/.'
433
+ : 'No config asset slots; source-level checks still ran.';
434
+ }
435
+ if (hasPublicAssets) {
436
+ const extraCorpus = [join(root, 'index.html'), join(root, 'dist', 'index.html'), join(root, 'zoo', 'apply_ui.mjs'), join(root, 'zoo', 'ui', 'index.dist.template.html'), ...collectFiles(root, ['zoo/ui'])].filter((file) => existsSync(file));
437
+ const publicCorpus = buildBundleCorpus(publicRoot) + ' ' + makeCorpus(extraCorpus);
438
+ const publicResult = summarizeBundle(publicRoot, buildBundleAssets(publicRoot), publicCorpus, { hasUsageEvidence: hasUsageCode(publicRoot) });
439
+ assets = publicResult.assets.map((asset) => Object.assign({}, asset, { path: 'public/' + asset.path }));
440
+ findings.push(...publicResult.findings.map((finding) => Object.assign({}, finding, { path: finding.path && finding.path !== 'bundle script' ? prefixPath(finding.path) : finding.path })));
441
+ summary = Object.assign({}, summary, {
442
+ publicFiles: publicResult.summary.files,
443
+ publicBytes: publicResult.summary.bytes,
444
+ publicUnusedBytes: publicResult.summary.unusedBytes,
445
+ publicGlbFiles: publicResult.summary.glbFiles,
446
+ publicAnimationBytes: publicResult.summary.animationBytes,
447
+ publicTextureBytes: publicResult.summary.textureBytes,
448
+ publicDuplicateGroups: publicResult.summary.duplicateGroups,
449
+ publicUsageEvidence: publicResult.summary.usageEvidence,
450
+ });
451
+ }
452
+ }
453
+ findings.sort((a, b) => (b.estimatedSavings - a.estimatedSavings) || (['error', 'warning', 'info'].indexOf(a.severity) - ['error', 'warning', 'info'].indexOf(b.severity)));
454
+ return { schemaVersion: 1, project: root, mode: resolvedMode, generatedAt: new Date().toISOString(), summary: Object.assign({}, summary, { findings: findings.length, errorFindings: findings.filter((finding) => finding.severity === 'error').length, warningFindings: findings.filter((finding) => finding.severity === 'warning').length }), assets, usage, findings };
455
+ }
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ import { mkdirSync, writeFileSync } from 'node:fs';
3
+ import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
4
+ import { formatBytes } from './lib/glb.mjs';
5
+ import { scanProject } from './lib/scan.mjs';
6
+
7
+ function parseArgs(argv) {
8
+ const args = { project: process.env.CRAFT_PROJECT_DIR || process.cwd(), mode: 'auto', top: 15, out: null, json: false };
9
+ for (let index = 0; index < argv.length; index += 1) {
10
+ const item = argv[index];
11
+ if (item === '--project') args.project = argv[++index];
12
+ else if (item === '--mode') args.mode = argv[++index];
13
+ else if (item === '--top') args.top = Number(argv[++index]);
14
+ else if (item === '--out') args.out = argv[++index];
15
+ else if (item === '--json') args.json = true;
16
+ else if (item === '--help' || item === '-h') args.help = true;
17
+ else throw new Error('Unknown argument: ' + item);
18
+ }
19
+ if (!['auto', 'source', 'bundle'].includes(args.mode)) throw new Error('--mode must be auto, source or bundle');
20
+ if (!Number.isFinite(args.top) || args.top < 1) throw new Error('--top must be a positive number');
21
+ return args;
22
+ }
23
+
24
+ function reportPath(project, requested) {
25
+ const target = requested ? (isAbsolute(requested) ? requested : resolve(project, requested)) : join(project, '.asset-audit', 'report.json');
26
+ const rel = relative(project, target);
27
+ if (rel.startsWith('..') || isAbsolute(rel)) throw new Error('--out must stay inside the project');
28
+ return target;
29
+ }
30
+
31
+ function printSummary(report, outPath, top) {
32
+ const lines = [];
33
+ const summary = report.summary;
34
+ lines.push('Asset usage audit (' + report.mode + ')');
35
+ if (report.mode === 'bundle') {
36
+ lines.push('Files: ' + summary.files + ' · ' + formatBytes(summary.bytes));
37
+ lines.push('Used: ' + formatBytes(summary.usedBytes) + ' · dynamic-family: ' + formatBytes(summary.familyBytes) + ' · unused: ' + formatBytes(summary.unusedBytes));
38
+ lines.push('GLB: ' + summary.glbFiles + ' models · animation ' + formatBytes(summary.animationBytes) + ' · textures ' + formatBytes(summary.textureBytes));
39
+ } else {
40
+ lines.push('Slots: ' + summary.slots + ' · used ' + (summary.used || 0) + ' · dynamic ' + (summary.dynamic || 0) + ' · unreferenced ' + (summary.unreferenced || 0));
41
+ if (summary.publicFiles) {
42
+ lines.push('Public assets: ' + summary.publicFiles + ' files · ' + formatBytes(summary.publicBytes) + ' · unused ' + formatBytes(summary.publicUnusedBytes));
43
+ lines.push('Public GLB: ' + summary.publicGlbFiles + ' models · animation ' + formatBytes(summary.publicAnimationBytes) + ' · textures ' + formatBytes(summary.publicTextureBytes));
44
+ }
45
+ if (summary.note) lines.push(summary.note);
46
+ }
47
+ lines.push('Findings: ' + summary.findings + ' (' + summary.errorFindings + ' errors, ' + summary.warningFindings + ' warnings)');
48
+ const visible = report.findings.slice(0, top);
49
+ if (visible.length) {
50
+ lines.push('Top findings:');
51
+ visible.forEach((finding, index) => {
52
+ const saving = finding.estimatedSavings > 0 ? ' · ~' + formatBytes(finding.estimatedSavings) + ' potential' : '';
53
+ lines.push(' ' + (index + 1) + '. ' + finding.id + ' · ' + finding.severity + ' · ' + finding.path + saving);
54
+ if (finding.evidence) lines.push(' ' + JSON.stringify(finding.evidence).slice(0, 240));
55
+ });
56
+ }
57
+ lines.push('Report: ' + outPath);
58
+ console.log(lines.join('\n'));
59
+ }
60
+
61
+ try {
62
+ const args = parseArgs(process.argv.slice(2));
63
+ if (args.help) {
64
+ console.log('Usage: node scan-assets.mjs [--project DIR] [--mode auto|source|bundle] [--out FILE] [--top N] [--json]');
65
+ process.exit(0);
66
+ }
67
+ const project = resolve(args.project);
68
+ const outPath = reportPath(project, args.out);
69
+ const report = scanProject(project, { mode: args.mode });
70
+ mkdirSync(dirname(outPath), { recursive: true });
71
+ writeFileSync(outPath, JSON.stringify(report, null, 2) + '\n');
72
+ if (args.json) console.log(JSON.stringify(report, null, 2));
73
+ else printSummary(report, outPath, args.top);
74
+ } catch (error) {
75
+ console.error('FAIL — ' + (error && error.message ? error.message : String(error)));
76
+ process.exit(1);
77
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: export-config
3
+ description: Craft ZCode 项目专用;导出当前 3D / Three.js 工程的资源与可调参数配置;新增资源槽、修改配置、构建或上传前排查时使用。
4
+ ---
5
+
6
+ # 3D / Three.js 配置导出
7
+
8
+ 模板已自带 scripts/skill-modules/export-config,Vite 中 gameConfig() 与 lightgame() 并列。默认值写 configs/*.json,控件元数据写同名 *.controls.json;保持业务普通 JSON import。
9
+
10
+ 在项目目录执行 `node "${CRAFT_SKILL_DIR}/scripts/export-config.mjs"`。MCP 的工程检查也通过 SDK hook 调用本工程已同步版本的本地技能入口;技能与普通 `npm run config:export` 共用项目内导出流程,不查找相邻工程的上下文。
11
+
12
+ 脚本同步 @slot、assets.json 与资源控件,再导出 unified_data_control_config.json,保留已有有效覆盖值。导出后核实资源 slot 有真实消费者,参数修改能改变游戏,必要加载已成功。地址规则见 [AssetUrl](../../knowledge/AssetUrl.md)。
13
+
14
+ 只有配置模块确实缺失或明确升级时,才执行 `node "${CRAFT_SKILL_DIR}/scripts/install.mjs" --project "${CRAFT_PROJECT_DIR}"`;它会覆盖该模块,先检查已有改动。API 以随技能 assets/tooling/*.d.mts 为准。
15
+
16
+ 导出成功不等于玩法或画面通过。继续使用 craft_game_check 与 craft_game_review 验证本次最终状态。
@@ -0,0 +1,20 @@
1
+ import { resolve } from 'node:path';
2
+ import { pathToFileURL } from 'node:url';
3
+ import { exportProjectConfig } from './project.mjs';
4
+
5
+ export async function runCli(args = process.argv.slice(2)) {
6
+ if ((args[0] ?? 'export-config') !== 'export-config') throw new Error('Usage: cli.mjs export-config [--project <directory>] [--check]');
7
+ let project = process.cwd(), check = false;
8
+ for (let index = 1; index < args.length; index++) {
9
+ if (args[index] === '--check') check = true;
10
+ else if (args[index] === '--project' && args[index + 1] && !args[index + 1].startsWith('--')) project = args[++index];
11
+ else throw new Error(`Invalid export-config option: ${args[index]}`);
12
+ }
13
+ const result = await exportProjectConfig(resolve(project), { check, onWarn: message => console.warn(`[LightGame config] ${message}`) });
14
+ console.log(`[LightGame] ${result.entries.length} controls ${result.changed ? 'exported' : 'unchanged'}`);
15
+ return result;
16
+ }
17
+
18
+ if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
19
+ runCli().catch(error => { console.error(`[LightGame config] ${error.message}`); process.exitCode = 1; });
20
+ }
@@ -0,0 +1,19 @@
1
+ export interface ControlMetadata {
2
+ type?: 'int' | 'float' | 'number' | 'num_slider' | 'bool' | 'boolean' | 'switch' | 'enum' | 'dropdown' | 'string' | 'text' | 'color' | 'resource';
3
+ enabled?: boolean; expose?: boolean; title?: string; description?: string;
4
+ min?: number; max?: number; step?: number; unit?: string; alpha?: boolean;
5
+ options?: Array<string | number | {value: string | number; label?: string}>;
6
+ tab?: string; group?: string; priority?: number;
7
+ category?: string; subcategory?: string; asset_type?: string;
8
+ }
9
+ export interface ConfigEntry {
10
+ schema: string; enabled: boolean; title: string; description: string;
11
+ locator: { tab: string; group: string; priority: number };
12
+ control: Record<string, unknown> & { type: string; default: unknown; value?: unknown; origin?: unknown };
13
+ }
14
+ export interface ConfigOptions { onWarn?: (message: string) => void; cdnBase?: string }
15
+ export function normalizeAssetUrl(value: unknown, cdnBase?: string): string;
16
+ export function inferControl(value: unknown, metadata?: ControlMetadata): ConfigEntry['control'] | null;
17
+ export function validateControlValue(control: ConfigEntry['control'], value: unknown): boolean;
18
+ export function createConfigEntries(owner: string, data: object, metadata?: Record<string, ControlMetadata>, previous?: ConfigEntry[], options?: ConfigOptions): ConfigEntry[];
19
+ export function resolveConfig<T extends object>(owner: string, data: T, metadata?: Record<string, ControlMetadata>, entries?: ConfigEntry[], options?: ConfigOptions): T;
@@ -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");var has=__name((value,key)=>Object.prototype.hasOwnProperty.call(value,key),"has");var record=__name(value=>value!==null&&typeof value==="object"&&!Array.isArray(value),"record");var equal=__name((a,b)=>typeof a===typeof b&&(typeof a==="number"?Math.abs(a-b)<1e-9:a===b),"equal");var colorPattern=/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i;var reserved=new Set(["__proto__","prototype","constructor"]);function assertKey(key,label){if(!key||key.includes(".")||reserved.has(key))throw new TypeError(`${label}: config keys must be nonempty, safe and contain no dots (${key})`)}__name(assertKey,"assertKey");function normalizeAssetUrl(value,cdnBase="https://file.craft.qq.com"){const path=String(value??"").trim().replaceAll("\\","/");return path?resolveAssetUrl(path,{cdnBaseUrl:cdnBase}):""}__name(normalizeAssetUrl,"normalizeAssetUrl");function inferControl(value,metadata={}){if(metadata.enabled===false||metadata.expose===false)return null;const kind=metadata.type??(typeof value==="number"?"number":typeof value==="boolean"?"boolean":typeof value==="string"&&colorPattern.test(value)?"color":void 0);if(!kind)return null;let control;switch(kind){case"int":case"float":case"number":case"num_slider":{if(typeof value!=="number"||!Number.isFinite(value))throw new TypeError("numeric controls require a finite numeric default");const span=Math.max(1,Math.abs(value)*2);const min=metadata.min??Math.min(0,value-span);const max=metadata.max??Math.max(1,value+span);const step=metadata.step??(kind==="int"||kind!=="float"&&Number.isInteger(value)?1:.01);if(![min,max,step].every(Number.isFinite)||min>max||step<=0||value<min||value>max)throw new TypeError("numeric min/max/step must be finite, contain the default, and step must be positive");control={type:"num_slider",default:value,min,max,step,unit:metadata.unit??""};if(kind==="int")control.integer=true;break}case"bool":case"boolean":case"switch":if(typeof value!=="boolean")throw new TypeError("switch controls require a boolean default");control={type:"switch",default:value};break;case"enum":case"dropdown":{const options=metadata.options?.map(option=>record(option)?{value:option.value,label:String(option.label??option.value)}:{value:option,label:String(option)});if(!options?.length||options.some(option=>!["string","number"].includes(typeof option.value))||new Set(options.map(option=>`${typeof option.value}:${option.value}`)).size!==options.length||!options.some(option=>equal(option.value,value)))throw new TypeError("dropdown options must be unique scalar values and contain the default");control={type:"dropdown",default:value,options};break}case"string":case"text":if(typeof value!=="string")throw new TypeError("text controls require a string default");control={type:"text",default:value};break;case"color":if(typeof value!=="string"||!colorPattern.test(value))throw new TypeError("color controls require a hexadecimal color default");control={type:"color",default:value,alpha:metadata.alpha??(value.length===5||value.length===9)};break;case"resource":if(typeof value!=="string")throw new TypeError("resource controls require a string default");control={type:"resource",default:value};for(const key of["category","subcategory","asset_type"])if(metadata[key]!==void 0)control[key]=metadata[key];break;default:throw new TypeError(`unsupported control type: ${kind}`)}return control}__name(inferControl,"inferControl");function validateControlValue(control,value){switch(control.type){case"num_slider":return typeof value==="number"&&Number.isFinite(value)&&value>=control.min&&value<=control.max&&(!control.integer||Number.isInteger(value));case"switch":return typeof value==="boolean";case"color":return typeof value==="string"&&colorPattern.test(value);case"dropdown":return control.options.some(option=>equal(option.value,value));case"text":case"resource":return typeof value==="string";default:return false}}__name(validateControlValue,"validateControlValue");function leaves(data,metadata,owner){if(!record(data)||!record(metadata))throw new TypeError(`${owner}: config and controls must be JSON objects`);const output=[];const seen=new Set;function walk(value,parts){if(Array.isArray(value))return;if(record(value)){for(const[key,child]of Object.entries(value)){assertKey(key,owner);walk(child,[...parts,key])}return}const path=parts.join(".");const meta=metadata[path]??{};if(!record(meta))throw new TypeError(`${owner}.${path}: controls metadata must be an object`);seen.add(path);try{const control=inferControl(value,meta);if(control)output.push({path,parts,control,meta,value})}catch(error){throw new TypeError(`${owner}.${path}: ${error.message}`)}}__name(walk,"walk");walk(data,[]);for(const key of Object.keys(metadata))if(!seen.has(key))throw new TypeError(`${owner}.${key}: control refers to a missing scalar field (arrays are not exposed)`);return output}__name(leaves,"leaves");function createConfigEntries(owner,data,metadata={},previous=[],options={}){assertKey(owner,"config filename");const oldBySchema=new Map((Array.isArray(previous)?previous:[]).map(item=>[item.schema,item]));return leaves(data,metadata,owner).map(({path,control,meta,value})=>{const schema=`${owner}.${path}`;const old=oldBySchema.get(schema);const oldControl=old?.control;let selected=value;let stale=oldControl?.previous_value;if(oldControl){const candidate=has(oldControl,"change_value")?oldControl.change_value:has(oldControl,"value")?oldControl.value:oldControl.default;const origin=has(oldControl,"origin")?oldControl.origin:oldControl.default;if(!equal(origin,value)&&equal(candidate,origin)){selected=value;stale=void 0}else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate)){selected=candidate;if(!equal(candidate,value))stale=void 0}else if(!equal(candidate,value)){stale=candidate;options.onWarn?.(`${schema}: saved override is incompatible with the current default or constraints; using code default`)}}return{schema,enabled:old?.enabled!==false,title:meta.title??old?.title??path,description:meta.description??old?.description??"",locator:{tab:meta.tab??owner,group:meta.group??path.split(".")[0],priority:meta.priority??0},control:{...control,...control.type==="resource"?Object.fromEntries(["category","subcategory","asset_type"].filter(key=>control[key]===void 0&&oldControl?.[key]!==void 0).map(key=>[key,oldControl[key]])):{},origin:value,value:selected,...stale!==void 0?{previous_value:stale}:{}}}})}__name(createConfigEntries,"createConfigEntries");function resolveConfig(owner,data,metadata={},entries=[],options={}){const result=JSON.parse(JSON.stringify(data));const index=new Map((Array.isArray(entries)?entries:[]).map(item=>[item.schema,item]));for(const{path,parts,control,value}of leaves(data,metadata,owner)){const item=index.get(`${owner}.${path}`);let selected=value;if(item?.enabled!==false&&item?.control){const stored=item.control;const candidate=has(stored,"change_value")?stored.change_value:has(stored,"value")?stored.value:stored.default;const origin=has(stored,"origin")?stored.origin:stored.default;if(!equal(origin,value)&&equal(candidate,origin))selected=value;else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate))selected=candidate;else options.onWarn?.(`${owner}.${path}: ignored incompatible saved override`)}if(control.type==="resource")selected=normalizeAssetUrl(selected,options.cdnBase);let parent=result;for(const key of parts.slice(0,-1))parent=parent[key];parent[parts.at(-1)]=selected}return result}__name(resolveConfig,"resolveConfig");export{createConfigEntries,inferControl,normalizeAssetUrl,resolveConfig,validateControlValue};