@craft_eco/craft-mcp 0.1.30 → 0.1.31

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 (1060) hide show
  1. package/README.md +11 -9
  2. package/bin/craft-mcp.mjs +6 -3
  3. package/dist-server/game-workflow/context-state.mjs +9 -8
  4. package/dist-server/game-workflow/local-context.mjs +62 -62
  5. package/dist-server/game-workflow/project-context.mjs +49 -11
  6. package/dist-server/game-workflow/project-install.mjs +81 -0
  7. package/dist-server/game-workflow/projects.mjs +31 -3
  8. package/dist-server/integrations/config.mjs +20 -3
  9. package/dist-server/integrations/connect.mjs +15 -3
  10. package/dist-server/integrations/dsh-config.mjs +2 -2
  11. package/dist-server/integrations/files.mjs +54 -54
  12. package/dist-server/integrations/host-config-scope.mjs +16 -0
  13. package/dist-server/integrations/host-reload.mjs +6 -0
  14. package/dist-server/integrations/hosts.mjs +44 -6
  15. package/dist-server/integrations/install.mjs +193 -79
  16. package/dist-server/integrations/installation-state.mjs +1 -0
  17. package/dist-server/integrations/installation-transaction.mjs +27 -0
  18. package/dist-server/integrations/jsonc-config.mjs +56 -0
  19. package/dist-server/integrations/opencode-config.mjs +94 -0
  20. package/dist-server/integrations/project-setup.mjs +206 -0
  21. package/dist-server/integrations/registration-identity.mjs +15 -0
  22. package/dist-server/integrations/runtime-candidate.mjs +103 -0
  23. package/dist-server/integrations/updates.mjs +114 -41
  24. package/dist-server/launcher.mjs +8 -1
  25. package/dist-server/mcp/server.mjs +16 -2
  26. package/dist-server/mcp/update-session.mjs +88 -10
  27. package/package.json +3 -2
  28. package/resources/context-filter-report.json +121 -1
  29. package/resources/targets/claude/js/context-filter-report.json +1 -1
  30. package/resources/targets/claude/js3d/context-filter-report.json +1 -1
  31. package/resources/targets/claude/js3d/js3d/bundle.json +5 -5
  32. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  33. package/resources/targets/claude/js3d/target.json +1 -1
  34. package/resources/targets/codebuddy/js/context-filter-report.json +1 -1
  35. package/resources/targets/codebuddy/js3d/context-filter-report.json +1 -1
  36. package/resources/targets/codebuddy/js3d/js3d/bundle.json +5 -5
  37. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  38. package/resources/targets/codebuddy/js3d/target.json +1 -1
  39. package/resources/targets/codex/js/context-filter-report.json +1 -1
  40. package/resources/targets/codex/js3d/context-filter-report.json +1 -1
  41. package/resources/targets/codex/js3d/js3d/bundle.json +5 -5
  42. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  43. package/resources/targets/codex/js3d/target.json +1 -1
  44. package/resources/targets/comate/js/bootstrap/SKILL.md +20 -0
  45. package/resources/targets/comate/js/context-filter-report.json +27 -0
  46. package/resources/targets/comate/js/craft-game-maker/SKILL.md +72 -0
  47. package/resources/targets/comate/js/craft-game-maker/js.md +10 -0
  48. package/resources/targets/comate/js/js/bundle.json +97 -0
  49. package/resources/targets/comate/js/js/context/AGENTS.md +29 -0
  50. package/resources/targets/comate/js/js/context/hooks/hooks.json +14 -0
  51. package/resources/targets/comate/js/js/context/knowledge/AssetUrl.md +9 -0
  52. package/resources/targets/comate/js/js/context/knowledge/AssetWiring.md +7 -0
  53. package/resources/targets/comate/js/js/context/knowledge/Layout.md +7 -0
  54. package/resources/targets/comate/js/js/context/knowledge/Lifecycle.md +11 -0
  55. package/resources/targets/comate/js/js/context/knowledge/ResourceLoading.md +9 -0
  56. package/resources/targets/comate/js/js/context/skills/export-config/SKILL.md +16 -0
  57. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  58. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  59. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  60. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  61. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  62. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  63. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  64. package/resources/targets/comate/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  65. package/resources/targets/comate/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  66. package/resources/targets/comate/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  67. package/resources/targets/comate/js/js/context/skills/index.json +19 -0
  68. package/resources/targets/comate/js/js/context/skills/visual-qa/SKILL.md +14 -0
  69. package/resources/targets/comate/js/js/project/README.md +7 -0
  70. package/resources/targets/comate/js/js/project/configs/assets.json +1 -0
  71. package/resources/targets/comate/js/js/project/configs/game.controls.json +3 -0
  72. package/resources/targets/comate/js/js/project/configs/game.json +3 -0
  73. package/resources/targets/comate/js/js/project/game-runtime.json +7 -0
  74. package/resources/targets/comate/js/js/project/game.config.json +7 -0
  75. package/resources/targets/comate/js/js/project/index.html +20 -0
  76. package/resources/targets/comate/js/js/project/package.json +22 -0
  77. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  78. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  79. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  80. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  81. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  82. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  83. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  84. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  85. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  86. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  87. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  88. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  89. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  90. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  91. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  92. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  93. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  94. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  95. package/resources/targets/comate/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  96. package/resources/targets/comate/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  97. package/resources/targets/comate/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  98. package/resources/targets/comate/js/js/project/scripts/config-export.mjs +13 -0
  99. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  100. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  101. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  102. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  103. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  104. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  105. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  106. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  107. package/resources/targets/comate/js/js/project/scripts/write-preview-ready.mjs +22 -0
  108. package/resources/targets/comate/js/js/project/src/display/ui-stage.ts +156 -0
  109. package/resources/targets/comate/js/js/project/src/display/viewport.ts +249 -0
  110. package/resources/targets/comate/js/js/project/src/main.ts +87 -0
  111. package/resources/targets/comate/js/js/project/src/platform.ts +2 -0
  112. package/resources/targets/comate/js/js/project/src/scenes/LoadScene.ts +89 -0
  113. package/resources/targets/comate/js/js/project/src/scenes/PlayScene.ts +17 -0
  114. package/resources/targets/comate/js/js/project/src/screenUi.ts +185 -0
  115. package/resources/targets/comate/js/js/project/src/style.css +294 -0
  116. package/resources/targets/comate/js/js/project/tsconfig.json +20 -0
  117. package/resources/targets/comate/js/js/project/unified_data_control_config.json +20 -0
  118. package/resources/targets/comate/js/js/project/vite.config.ts +5 -0
  119. package/resources/targets/comate/js/recovery.md +17 -0
  120. package/resources/targets/comate/js/target.json +61 -0
  121. package/resources/targets/comate/js3d/bootstrap/SKILL.md +20 -0
  122. package/resources/targets/comate/js3d/context-filter-report.json +27 -0
  123. package/resources/targets/comate/js3d/craft-game-maker/SKILL.md +72 -0
  124. package/resources/targets/comate/js3d/craft-game-maker/js3d.md +12 -0
  125. package/resources/targets/comate/js3d/js3d/bundle.json +108 -0
  126. package/resources/targets/comate/js3d/js3d/context/AGENTS.md +30 -0
  127. package/resources/targets/comate/js3d/js3d/context/hooks/hooks.json +14 -0
  128. package/resources/targets/comate/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  129. package/resources/targets/comate/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  130. package/resources/targets/comate/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  131. package/resources/targets/comate/js3d/js3d/context/knowledge/Layout.md +7 -0
  132. package/resources/targets/comate/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  133. package/resources/targets/comate/js3d/js3d/context/knowledge/Runtime.md +9 -0
  134. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  135. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  136. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  137. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  138. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  139. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  140. package/resources/targets/comate/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  141. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  142. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  143. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  144. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  145. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  146. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  147. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  148. package/resources/targets/comate/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  149. package/resources/targets/comate/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  150. package/resources/targets/comate/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  151. package/resources/targets/comate/js3d/js3d/context/skills/index.json +31 -0
  152. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  153. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  154. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  155. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  156. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  157. package/resources/targets/comate/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  158. package/resources/targets/comate/js3d/js3d/project/README.md +7 -0
  159. package/resources/targets/comate/js3d/js3d/project/configs/game.controls.json +3 -0
  160. package/resources/targets/comate/js3d/js3d/project/configs/game.json +3 -0
  161. package/resources/targets/comate/js3d/js3d/project/game-runtime.json +7 -0
  162. package/resources/targets/comate/js3d/js3d/project/game.config.json +7 -0
  163. package/resources/targets/comate/js3d/js3d/project/index.html +12 -0
  164. package/resources/targets/comate/js3d/js3d/project/package.json +23 -0
  165. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  166. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  167. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  168. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  169. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  170. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  171. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  172. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  173. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  174. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  175. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  176. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  177. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  178. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  179. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  180. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  181. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  182. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  183. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  184. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  185. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  186. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  187. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  188. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  189. package/resources/targets/comate/js3d/js3d/project/scripts/config-export.mjs +15 -0
  190. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  191. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  192. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  193. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  194. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  195. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  196. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  197. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  198. package/resources/targets/comate/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  199. package/resources/targets/comate/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  200. package/resources/targets/comate/js3d/js3d/project/src/display/viewport.ts +239 -0
  201. package/resources/targets/comate/js3d/js3d/project/src/main.ts +85 -0
  202. package/resources/targets/comate/js3d/js3d/project/src/platform.ts +2 -0
  203. package/resources/targets/comate/js3d/js3d/project/src/style.css +83 -0
  204. package/resources/targets/comate/js3d/js3d/project/tsconfig.json +20 -0
  205. package/resources/targets/comate/js3d/js3d/project/unified_data_control_config.json +20 -0
  206. package/resources/targets/comate/js3d/js3d/project/vite.config.ts +5 -0
  207. package/resources/targets/comate/js3d/recovery.md +17 -0
  208. package/resources/targets/comate/js3d/target.json +60 -0
  209. package/resources/targets/cursor/js/context-filter-report.json +1 -1
  210. package/resources/targets/cursor/js3d/context-filter-report.json +1 -1
  211. package/resources/targets/cursor/js3d/js3d/bundle.json +5 -5
  212. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  213. package/resources/targets/cursor/js3d/target.json +1 -1
  214. package/resources/targets/dsh/js/context-filter-report.json +1 -1
  215. package/resources/targets/dsh/js3d/context-filter-report.json +1 -1
  216. package/resources/targets/dsh/js3d/js3d/bundle.json +5 -5
  217. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  218. package/resources/targets/dsh/js3d/target.json +1 -1
  219. package/resources/targets/index.json +88 -16
  220. package/resources/targets/kimi/js/context-filter-report.json +1 -1
  221. package/resources/targets/kimi/js3d/context-filter-report.json +1 -1
  222. package/resources/targets/kimi/js3d/js3d/bundle.json +5 -5
  223. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  224. package/resources/targets/kimi/js3d/target.json +1 -1
  225. package/resources/targets/opencode/js/bootstrap/SKILL.md +20 -0
  226. package/resources/targets/opencode/js/context-filter-report.json +27 -0
  227. package/resources/targets/opencode/js/craft-game-maker/SKILL.md +72 -0
  228. package/resources/targets/opencode/js/craft-game-maker/js.md +10 -0
  229. package/resources/targets/opencode/js/js/bundle.json +97 -0
  230. package/resources/targets/opencode/js/js/context/AGENTS.md +29 -0
  231. package/resources/targets/opencode/js/js/context/hooks/hooks.json +14 -0
  232. package/resources/targets/opencode/js/js/context/knowledge/AssetUrl.md +9 -0
  233. package/resources/targets/opencode/js/js/context/knowledge/AssetWiring.md +7 -0
  234. package/resources/targets/opencode/js/js/context/knowledge/Layout.md +7 -0
  235. package/resources/targets/opencode/js/js/context/knowledge/Lifecycle.md +11 -0
  236. package/resources/targets/opencode/js/js/context/knowledge/ResourceLoading.md +9 -0
  237. package/resources/targets/opencode/js/js/context/skills/export-config/SKILL.md +16 -0
  238. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  239. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  240. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  241. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  242. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  243. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  244. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  245. package/resources/targets/opencode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  246. package/resources/targets/opencode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  247. package/resources/targets/opencode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  248. package/resources/targets/opencode/js/js/context/skills/index.json +19 -0
  249. package/resources/targets/opencode/js/js/context/skills/visual-qa/SKILL.md +14 -0
  250. package/resources/targets/opencode/js/js/project/README.md +7 -0
  251. package/resources/targets/opencode/js/js/project/configs/assets.json +1 -0
  252. package/resources/targets/opencode/js/js/project/configs/game.controls.json +3 -0
  253. package/resources/targets/opencode/js/js/project/configs/game.json +3 -0
  254. package/resources/targets/opencode/js/js/project/game-runtime.json +7 -0
  255. package/resources/targets/opencode/js/js/project/game.config.json +7 -0
  256. package/resources/targets/opencode/js/js/project/index.html +20 -0
  257. package/resources/targets/opencode/js/js/project/package.json +22 -0
  258. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  259. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  260. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  261. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  262. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  263. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  264. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  265. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  266. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  267. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  268. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  269. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  270. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  271. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  272. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  273. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  274. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  275. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  276. package/resources/targets/opencode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  277. package/resources/targets/opencode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  278. package/resources/targets/opencode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  279. package/resources/targets/opencode/js/js/project/scripts/config-export.mjs +13 -0
  280. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  281. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  282. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  283. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  284. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  285. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  286. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  287. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  288. package/resources/targets/opencode/js/js/project/scripts/write-preview-ready.mjs +22 -0
  289. package/resources/targets/opencode/js/js/project/src/display/ui-stage.ts +156 -0
  290. package/resources/targets/opencode/js/js/project/src/display/viewport.ts +249 -0
  291. package/resources/targets/opencode/js/js/project/src/main.ts +87 -0
  292. package/resources/targets/opencode/js/js/project/src/platform.ts +2 -0
  293. package/resources/targets/opencode/js/js/project/src/scenes/LoadScene.ts +89 -0
  294. package/resources/targets/opencode/js/js/project/src/scenes/PlayScene.ts +17 -0
  295. package/resources/targets/opencode/js/js/project/src/screenUi.ts +185 -0
  296. package/resources/targets/opencode/js/js/project/src/style.css +294 -0
  297. package/resources/targets/opencode/js/js/project/tsconfig.json +20 -0
  298. package/resources/targets/opencode/js/js/project/unified_data_control_config.json +20 -0
  299. package/resources/targets/opencode/js/js/project/vite.config.ts +5 -0
  300. package/resources/targets/opencode/js/recovery.md +17 -0
  301. package/resources/targets/opencode/js/target.json +61 -0
  302. package/resources/targets/opencode/js3d/bootstrap/SKILL.md +20 -0
  303. package/resources/targets/opencode/js3d/context-filter-report.json +27 -0
  304. package/resources/targets/opencode/js3d/craft-game-maker/SKILL.md +72 -0
  305. package/resources/targets/opencode/js3d/craft-game-maker/js3d.md +12 -0
  306. package/resources/targets/opencode/js3d/js3d/bundle.json +108 -0
  307. package/resources/targets/opencode/js3d/js3d/context/AGENTS.md +30 -0
  308. package/resources/targets/opencode/js3d/js3d/context/hooks/hooks.json +14 -0
  309. package/resources/targets/opencode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  310. package/resources/targets/opencode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  311. package/resources/targets/opencode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  312. package/resources/targets/opencode/js3d/js3d/context/knowledge/Layout.md +7 -0
  313. package/resources/targets/opencode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  314. package/resources/targets/opencode/js3d/js3d/context/knowledge/Runtime.md +9 -0
  315. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  316. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  317. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  318. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  319. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  320. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  321. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  322. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  323. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  324. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  325. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  326. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  327. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  328. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  329. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  330. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  331. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  332. package/resources/targets/opencode/js3d/js3d/context/skills/index.json +31 -0
  333. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  334. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  335. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  336. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  337. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  338. package/resources/targets/opencode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  339. package/resources/targets/opencode/js3d/js3d/project/README.md +7 -0
  340. package/resources/targets/opencode/js3d/js3d/project/configs/game.controls.json +3 -0
  341. package/resources/targets/opencode/js3d/js3d/project/configs/game.json +3 -0
  342. package/resources/targets/opencode/js3d/js3d/project/game-runtime.json +7 -0
  343. package/resources/targets/opencode/js3d/js3d/project/game.config.json +7 -0
  344. package/resources/targets/opencode/js3d/js3d/project/index.html +12 -0
  345. package/resources/targets/opencode/js3d/js3d/project/package.json +23 -0
  346. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  347. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  348. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  349. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  350. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  351. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  352. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  353. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  354. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  355. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  356. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  357. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  358. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  359. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  360. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  361. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  362. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  363. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  364. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  365. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  366. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  367. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  368. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  369. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  370. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export.mjs +15 -0
  371. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  372. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  373. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  374. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  375. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  376. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  377. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  378. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  379. package/resources/targets/opencode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  380. package/resources/targets/opencode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  381. package/resources/targets/opencode/js3d/js3d/project/src/display/viewport.ts +239 -0
  382. package/resources/targets/opencode/js3d/js3d/project/src/main.ts +85 -0
  383. package/resources/targets/opencode/js3d/js3d/project/src/platform.ts +2 -0
  384. package/resources/targets/opencode/js3d/js3d/project/src/style.css +83 -0
  385. package/resources/targets/opencode/js3d/js3d/project/tsconfig.json +20 -0
  386. package/resources/targets/opencode/js3d/js3d/project/unified_data_control_config.json +20 -0
  387. package/resources/targets/opencode/js3d/js3d/project/vite.config.ts +5 -0
  388. package/resources/targets/opencode/js3d/recovery.md +17 -0
  389. package/resources/targets/opencode/js3d/target.json +60 -0
  390. package/resources/targets/qoder/js/bootstrap/SKILL.md +20 -0
  391. package/resources/targets/qoder/js/context-filter-report.json +27 -0
  392. package/resources/targets/qoder/js/craft-game-maker/SKILL.md +72 -0
  393. package/resources/targets/qoder/js/craft-game-maker/js.md +10 -0
  394. package/resources/targets/qoder/js/js/bundle.json +97 -0
  395. package/resources/targets/qoder/js/js/context/AGENTS.md +31 -0
  396. package/resources/targets/qoder/js/js/context/hooks/hooks.json +14 -0
  397. package/resources/targets/qoder/js/js/context/knowledge/AssetUrl.md +9 -0
  398. package/resources/targets/qoder/js/js/context/knowledge/AssetWiring.md +7 -0
  399. package/resources/targets/qoder/js/js/context/knowledge/Layout.md +7 -0
  400. package/resources/targets/qoder/js/js/context/knowledge/Lifecycle.md +11 -0
  401. package/resources/targets/qoder/js/js/context/knowledge/ResourceLoading.md +9 -0
  402. package/resources/targets/qoder/js/js/context/skills/export-config/SKILL.md +16 -0
  403. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  404. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  405. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  406. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  407. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  408. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  409. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  410. package/resources/targets/qoder/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  411. package/resources/targets/qoder/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  412. package/resources/targets/qoder/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  413. package/resources/targets/qoder/js/js/context/skills/index.json +19 -0
  414. package/resources/targets/qoder/js/js/context/skills/visual-qa/SKILL.md +14 -0
  415. package/resources/targets/qoder/js/js/project/README.md +7 -0
  416. package/resources/targets/qoder/js/js/project/configs/assets.json +1 -0
  417. package/resources/targets/qoder/js/js/project/configs/game.controls.json +3 -0
  418. package/resources/targets/qoder/js/js/project/configs/game.json +3 -0
  419. package/resources/targets/qoder/js/js/project/game-runtime.json +7 -0
  420. package/resources/targets/qoder/js/js/project/game.config.json +7 -0
  421. package/resources/targets/qoder/js/js/project/index.html +20 -0
  422. package/resources/targets/qoder/js/js/project/package.json +22 -0
  423. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  424. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  425. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  426. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  427. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  428. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  429. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  430. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  431. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  432. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  433. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  434. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  435. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  436. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  437. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  438. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  439. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  440. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  441. package/resources/targets/qoder/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  442. package/resources/targets/qoder/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  443. package/resources/targets/qoder/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  444. package/resources/targets/qoder/js/js/project/scripts/config-export.mjs +13 -0
  445. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  446. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  447. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  448. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  449. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  450. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  451. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  452. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  453. package/resources/targets/qoder/js/js/project/scripts/write-preview-ready.mjs +22 -0
  454. package/resources/targets/qoder/js/js/project/src/display/ui-stage.ts +156 -0
  455. package/resources/targets/qoder/js/js/project/src/display/viewport.ts +249 -0
  456. package/resources/targets/qoder/js/js/project/src/main.ts +87 -0
  457. package/resources/targets/qoder/js/js/project/src/platform.ts +2 -0
  458. package/resources/targets/qoder/js/js/project/src/scenes/LoadScene.ts +89 -0
  459. package/resources/targets/qoder/js/js/project/src/scenes/PlayScene.ts +17 -0
  460. package/resources/targets/qoder/js/js/project/src/screenUi.ts +185 -0
  461. package/resources/targets/qoder/js/js/project/src/style.css +294 -0
  462. package/resources/targets/qoder/js/js/project/tsconfig.json +20 -0
  463. package/resources/targets/qoder/js/js/project/unified_data_control_config.json +20 -0
  464. package/resources/targets/qoder/js/js/project/vite.config.ts +5 -0
  465. package/resources/targets/qoder/js/recovery.md +17 -0
  466. package/resources/targets/qoder/js/target.json +61 -0
  467. package/resources/targets/qoder/js3d/bootstrap/SKILL.md +20 -0
  468. package/resources/targets/qoder/js3d/context-filter-report.json +27 -0
  469. package/resources/targets/qoder/js3d/craft-game-maker/SKILL.md +72 -0
  470. package/resources/targets/qoder/js3d/craft-game-maker/js3d.md +12 -0
  471. package/resources/targets/qoder/js3d/js3d/bundle.json +108 -0
  472. package/resources/targets/qoder/js3d/js3d/context/AGENTS.md +32 -0
  473. package/resources/targets/qoder/js3d/js3d/context/hooks/hooks.json +14 -0
  474. package/resources/targets/qoder/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  475. package/resources/targets/qoder/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  476. package/resources/targets/qoder/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  477. package/resources/targets/qoder/js3d/js3d/context/knowledge/Layout.md +7 -0
  478. package/resources/targets/qoder/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  479. package/resources/targets/qoder/js3d/js3d/context/knowledge/Runtime.md +9 -0
  480. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  481. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  482. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  483. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  484. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  485. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  486. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  487. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  488. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  489. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  490. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  491. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  492. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  493. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  494. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  495. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  496. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  497. package/resources/targets/qoder/js3d/js3d/context/skills/index.json +31 -0
  498. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  499. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  500. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  501. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  502. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  503. package/resources/targets/qoder/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  504. package/resources/targets/qoder/js3d/js3d/project/README.md +7 -0
  505. package/resources/targets/qoder/js3d/js3d/project/configs/game.controls.json +3 -0
  506. package/resources/targets/qoder/js3d/js3d/project/configs/game.json +3 -0
  507. package/resources/targets/qoder/js3d/js3d/project/game-runtime.json +7 -0
  508. package/resources/targets/qoder/js3d/js3d/project/game.config.json +7 -0
  509. package/resources/targets/qoder/js3d/js3d/project/index.html +12 -0
  510. package/resources/targets/qoder/js3d/js3d/project/package.json +23 -0
  511. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  512. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  513. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  514. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  515. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  516. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  517. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  518. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  519. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  520. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  521. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  522. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  523. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  524. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  525. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  526. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  527. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  528. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  529. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  530. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  531. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  532. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  533. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  534. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  535. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export.mjs +15 -0
  536. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  537. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  538. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  539. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  540. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  541. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  542. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  543. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  544. package/resources/targets/qoder/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  545. package/resources/targets/qoder/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  546. package/resources/targets/qoder/js3d/js3d/project/src/display/viewport.ts +239 -0
  547. package/resources/targets/qoder/js3d/js3d/project/src/main.ts +85 -0
  548. package/resources/targets/qoder/js3d/js3d/project/src/platform.ts +2 -0
  549. package/resources/targets/qoder/js3d/js3d/project/src/style.css +83 -0
  550. package/resources/targets/qoder/js3d/js3d/project/tsconfig.json +20 -0
  551. package/resources/targets/qoder/js3d/js3d/project/unified_data_control_config.json +20 -0
  552. package/resources/targets/qoder/js3d/js3d/project/vite.config.ts +5 -0
  553. package/resources/targets/qoder/js3d/recovery.md +17 -0
  554. package/resources/targets/qoder/js3d/target.json +60 -0
  555. package/resources/targets/qoder-cn/js/bootstrap/SKILL.md +20 -0
  556. package/resources/targets/qoder-cn/js/context-filter-report.json +27 -0
  557. package/resources/targets/qoder-cn/js/craft-game-maker/SKILL.md +72 -0
  558. package/resources/targets/qoder-cn/js/craft-game-maker/js.md +10 -0
  559. package/resources/targets/qoder-cn/js/js/bundle.json +97 -0
  560. package/resources/targets/qoder-cn/js/js/context/AGENTS.md +31 -0
  561. package/resources/targets/qoder-cn/js/js/context/hooks/hooks.json +14 -0
  562. package/resources/targets/qoder-cn/js/js/context/knowledge/AssetUrl.md +9 -0
  563. package/resources/targets/qoder-cn/js/js/context/knowledge/AssetWiring.md +7 -0
  564. package/resources/targets/qoder-cn/js/js/context/knowledge/Layout.md +7 -0
  565. package/resources/targets/qoder-cn/js/js/context/knowledge/Lifecycle.md +11 -0
  566. package/resources/targets/qoder-cn/js/js/context/knowledge/ResourceLoading.md +9 -0
  567. package/resources/targets/qoder-cn/js/js/context/skills/export-config/SKILL.md +16 -0
  568. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  569. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  570. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  571. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  572. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  573. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  574. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  575. package/resources/targets/qoder-cn/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  576. package/resources/targets/qoder-cn/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  577. package/resources/targets/qoder-cn/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  578. package/resources/targets/qoder-cn/js/js/context/skills/index.json +19 -0
  579. package/resources/targets/qoder-cn/js/js/context/skills/visual-qa/SKILL.md +14 -0
  580. package/resources/targets/qoder-cn/js/js/project/README.md +7 -0
  581. package/resources/targets/qoder-cn/js/js/project/configs/assets.json +1 -0
  582. package/resources/targets/qoder-cn/js/js/project/configs/game.controls.json +3 -0
  583. package/resources/targets/qoder-cn/js/js/project/configs/game.json +3 -0
  584. package/resources/targets/qoder-cn/js/js/project/game-runtime.json +7 -0
  585. package/resources/targets/qoder-cn/js/js/project/game.config.json +7 -0
  586. package/resources/targets/qoder-cn/js/js/project/index.html +20 -0
  587. package/resources/targets/qoder-cn/js/js/project/package.json +22 -0
  588. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  589. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  590. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  591. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  592. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  593. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  594. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  595. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  596. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  597. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  598. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  599. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  600. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  601. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  602. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  603. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  604. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  605. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  606. package/resources/targets/qoder-cn/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  607. package/resources/targets/qoder-cn/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  608. package/resources/targets/qoder-cn/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  609. package/resources/targets/qoder-cn/js/js/project/scripts/config-export.mjs +13 -0
  610. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  611. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  612. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  613. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  614. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  615. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  616. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  617. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  618. package/resources/targets/qoder-cn/js/js/project/scripts/write-preview-ready.mjs +22 -0
  619. package/resources/targets/qoder-cn/js/js/project/src/display/ui-stage.ts +156 -0
  620. package/resources/targets/qoder-cn/js/js/project/src/display/viewport.ts +249 -0
  621. package/resources/targets/qoder-cn/js/js/project/src/main.ts +87 -0
  622. package/resources/targets/qoder-cn/js/js/project/src/platform.ts +2 -0
  623. package/resources/targets/qoder-cn/js/js/project/src/scenes/LoadScene.ts +89 -0
  624. package/resources/targets/qoder-cn/js/js/project/src/scenes/PlayScene.ts +17 -0
  625. package/resources/targets/qoder-cn/js/js/project/src/screenUi.ts +185 -0
  626. package/resources/targets/qoder-cn/js/js/project/src/style.css +294 -0
  627. package/resources/targets/qoder-cn/js/js/project/tsconfig.json +20 -0
  628. package/resources/targets/qoder-cn/js/js/project/unified_data_control_config.json +20 -0
  629. package/resources/targets/qoder-cn/js/js/project/vite.config.ts +5 -0
  630. package/resources/targets/qoder-cn/js/recovery.md +17 -0
  631. package/resources/targets/qoder-cn/js/target.json +61 -0
  632. package/resources/targets/qoder-cn/js3d/bootstrap/SKILL.md +20 -0
  633. package/resources/targets/qoder-cn/js3d/context-filter-report.json +27 -0
  634. package/resources/targets/qoder-cn/js3d/craft-game-maker/SKILL.md +72 -0
  635. package/resources/targets/qoder-cn/js3d/craft-game-maker/js3d.md +12 -0
  636. package/resources/targets/qoder-cn/js3d/js3d/bundle.json +108 -0
  637. package/resources/targets/qoder-cn/js3d/js3d/context/AGENTS.md +32 -0
  638. package/resources/targets/qoder-cn/js3d/js3d/context/hooks/hooks.json +14 -0
  639. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  640. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  641. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  642. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/Layout.md +7 -0
  643. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  644. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/Runtime.md +9 -0
  645. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  646. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  647. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  648. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  649. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  650. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  651. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  652. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  653. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  654. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  655. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  656. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  657. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  658. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  659. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  660. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  661. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  662. package/resources/targets/qoder-cn/js3d/js3d/context/skills/index.json +31 -0
  663. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  664. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  665. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  666. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  667. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  668. package/resources/targets/qoder-cn/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  669. package/resources/targets/qoder-cn/js3d/js3d/project/README.md +7 -0
  670. package/resources/targets/qoder-cn/js3d/js3d/project/configs/game.controls.json +3 -0
  671. package/resources/targets/qoder-cn/js3d/js3d/project/configs/game.json +3 -0
  672. package/resources/targets/qoder-cn/js3d/js3d/project/game-runtime.json +7 -0
  673. package/resources/targets/qoder-cn/js3d/js3d/project/game.config.json +7 -0
  674. package/resources/targets/qoder-cn/js3d/js3d/project/index.html +12 -0
  675. package/resources/targets/qoder-cn/js3d/js3d/project/package.json +23 -0
  676. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  677. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  678. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  679. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  680. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  681. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  682. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  683. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  684. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  685. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  686. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  687. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  688. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  689. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  690. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  691. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  692. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  693. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  694. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  695. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  696. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  697. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  698. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  699. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  700. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export.mjs +15 -0
  701. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  702. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  703. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  704. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  705. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  706. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  707. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  708. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  709. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  710. package/resources/targets/qoder-cn/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  711. package/resources/targets/qoder-cn/js3d/js3d/project/src/display/viewport.ts +239 -0
  712. package/resources/targets/qoder-cn/js3d/js3d/project/src/main.ts +85 -0
  713. package/resources/targets/qoder-cn/js3d/js3d/project/src/platform.ts +2 -0
  714. package/resources/targets/qoder-cn/js3d/js3d/project/src/style.css +83 -0
  715. package/resources/targets/qoder-cn/js3d/js3d/project/tsconfig.json +20 -0
  716. package/resources/targets/qoder-cn/js3d/js3d/project/unified_data_control_config.json +20 -0
  717. package/resources/targets/qoder-cn/js3d/js3d/project/vite.config.ts +5 -0
  718. package/resources/targets/qoder-cn/js3d/recovery.md +17 -0
  719. package/resources/targets/qoder-cn/js3d/target.json +60 -0
  720. package/resources/targets/qwen/js/bootstrap/SKILL.md +20 -0
  721. package/resources/targets/qwen/js/context-filter-report.json +27 -0
  722. package/resources/targets/qwen/js/craft-game-maker/SKILL.md +72 -0
  723. package/resources/targets/qwen/js/craft-game-maker/js.md +10 -0
  724. package/resources/targets/qwen/js/js/bundle.json +97 -0
  725. package/resources/targets/qwen/js/js/context/AGENTS.md +29 -0
  726. package/resources/targets/qwen/js/js/context/hooks/hooks.json +14 -0
  727. package/resources/targets/qwen/js/js/context/knowledge/AssetUrl.md +9 -0
  728. package/resources/targets/qwen/js/js/context/knowledge/AssetWiring.md +7 -0
  729. package/resources/targets/qwen/js/js/context/knowledge/Layout.md +7 -0
  730. package/resources/targets/qwen/js/js/context/knowledge/Lifecycle.md +11 -0
  731. package/resources/targets/qwen/js/js/context/knowledge/ResourceLoading.md +9 -0
  732. package/resources/targets/qwen/js/js/context/skills/export-config/SKILL.md +16 -0
  733. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  734. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  735. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  736. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  737. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  738. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  739. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  740. package/resources/targets/qwen/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  741. package/resources/targets/qwen/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  742. package/resources/targets/qwen/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  743. package/resources/targets/qwen/js/js/context/skills/index.json +19 -0
  744. package/resources/targets/qwen/js/js/context/skills/visual-qa/SKILL.md +14 -0
  745. package/resources/targets/qwen/js/js/project/README.md +7 -0
  746. package/resources/targets/qwen/js/js/project/configs/assets.json +1 -0
  747. package/resources/targets/qwen/js/js/project/configs/game.controls.json +3 -0
  748. package/resources/targets/qwen/js/js/project/configs/game.json +3 -0
  749. package/resources/targets/qwen/js/js/project/game-runtime.json +7 -0
  750. package/resources/targets/qwen/js/js/project/game.config.json +7 -0
  751. package/resources/targets/qwen/js/js/project/index.html +20 -0
  752. package/resources/targets/qwen/js/js/project/package.json +22 -0
  753. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  754. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  755. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  756. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  757. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  758. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  759. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  760. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  761. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  762. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  763. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  764. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  765. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  766. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  767. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  768. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  769. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  770. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  771. package/resources/targets/qwen/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  772. package/resources/targets/qwen/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  773. package/resources/targets/qwen/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  774. package/resources/targets/qwen/js/js/project/scripts/config-export.mjs +13 -0
  775. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  776. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  777. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  778. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  779. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  780. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  781. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  782. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  783. package/resources/targets/qwen/js/js/project/scripts/write-preview-ready.mjs +22 -0
  784. package/resources/targets/qwen/js/js/project/src/display/ui-stage.ts +156 -0
  785. package/resources/targets/qwen/js/js/project/src/display/viewport.ts +249 -0
  786. package/resources/targets/qwen/js/js/project/src/main.ts +87 -0
  787. package/resources/targets/qwen/js/js/project/src/platform.ts +2 -0
  788. package/resources/targets/qwen/js/js/project/src/scenes/LoadScene.ts +89 -0
  789. package/resources/targets/qwen/js/js/project/src/scenes/PlayScene.ts +17 -0
  790. package/resources/targets/qwen/js/js/project/src/screenUi.ts +185 -0
  791. package/resources/targets/qwen/js/js/project/src/style.css +294 -0
  792. package/resources/targets/qwen/js/js/project/tsconfig.json +20 -0
  793. package/resources/targets/qwen/js/js/project/unified_data_control_config.json +20 -0
  794. package/resources/targets/qwen/js/js/project/vite.config.ts +5 -0
  795. package/resources/targets/qwen/js/recovery.md +17 -0
  796. package/resources/targets/qwen/js/target.json +61 -0
  797. package/resources/targets/qwen/js3d/bootstrap/SKILL.md +20 -0
  798. package/resources/targets/qwen/js3d/context-filter-report.json +27 -0
  799. package/resources/targets/qwen/js3d/craft-game-maker/SKILL.md +72 -0
  800. package/resources/targets/qwen/js3d/craft-game-maker/js3d.md +12 -0
  801. package/resources/targets/qwen/js3d/js3d/bundle.json +108 -0
  802. package/resources/targets/qwen/js3d/js3d/context/AGENTS.md +30 -0
  803. package/resources/targets/qwen/js3d/js3d/context/hooks/hooks.json +14 -0
  804. package/resources/targets/qwen/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  805. package/resources/targets/qwen/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  806. package/resources/targets/qwen/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  807. package/resources/targets/qwen/js3d/js3d/context/knowledge/Layout.md +7 -0
  808. package/resources/targets/qwen/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  809. package/resources/targets/qwen/js3d/js3d/context/knowledge/Runtime.md +9 -0
  810. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  811. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  812. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  813. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  814. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  815. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  816. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  817. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  818. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  819. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  820. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  821. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  822. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  823. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  824. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  825. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  826. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  827. package/resources/targets/qwen/js3d/js3d/context/skills/index.json +31 -0
  828. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  829. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  830. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  831. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  832. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  833. package/resources/targets/qwen/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  834. package/resources/targets/qwen/js3d/js3d/project/README.md +7 -0
  835. package/resources/targets/qwen/js3d/js3d/project/configs/game.controls.json +3 -0
  836. package/resources/targets/qwen/js3d/js3d/project/configs/game.json +3 -0
  837. package/resources/targets/qwen/js3d/js3d/project/game-runtime.json +7 -0
  838. package/resources/targets/qwen/js3d/js3d/project/game.config.json +7 -0
  839. package/resources/targets/qwen/js3d/js3d/project/index.html +12 -0
  840. package/resources/targets/qwen/js3d/js3d/project/package.json +23 -0
  841. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  842. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  843. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  844. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  845. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  846. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  847. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  848. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  849. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  850. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  851. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  852. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  853. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  854. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  855. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  856. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  857. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  858. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  859. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  860. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  861. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  862. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  863. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  864. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  865. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export.mjs +15 -0
  866. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  867. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  868. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  869. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  870. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  871. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  872. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  873. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  874. package/resources/targets/qwen/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  875. package/resources/targets/qwen/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  876. package/resources/targets/qwen/js3d/js3d/project/src/display/viewport.ts +239 -0
  877. package/resources/targets/qwen/js3d/js3d/project/src/main.ts +85 -0
  878. package/resources/targets/qwen/js3d/js3d/project/src/platform.ts +2 -0
  879. package/resources/targets/qwen/js3d/js3d/project/src/style.css +83 -0
  880. package/resources/targets/qwen/js3d/js3d/project/tsconfig.json +20 -0
  881. package/resources/targets/qwen/js3d/js3d/project/unified_data_control_config.json +20 -0
  882. package/resources/targets/qwen/js3d/js3d/project/vite.config.ts +5 -0
  883. package/resources/targets/qwen/js3d/recovery.md +17 -0
  884. package/resources/targets/qwen/js3d/target.json +60 -0
  885. package/resources/targets/trae/js/bootstrap/SKILL.md +20 -0
  886. package/resources/targets/trae/js/context-filter-report.json +27 -0
  887. package/resources/targets/trae/js/craft-game-maker/SKILL.md +72 -0
  888. package/resources/targets/trae/js/craft-game-maker/js.md +10 -0
  889. package/resources/targets/trae/js/js/bundle.json +97 -0
  890. package/resources/targets/trae/js/js/context/AGENTS.md +29 -0
  891. package/resources/targets/trae/js/js/context/hooks/hooks.json +14 -0
  892. package/resources/targets/trae/js/js/context/knowledge/AssetUrl.md +9 -0
  893. package/resources/targets/trae/js/js/context/knowledge/AssetWiring.md +7 -0
  894. package/resources/targets/trae/js/js/context/knowledge/Layout.md +7 -0
  895. package/resources/targets/trae/js/js/context/knowledge/Lifecycle.md +11 -0
  896. package/resources/targets/trae/js/js/context/knowledge/ResourceLoading.md +9 -0
  897. package/resources/targets/trae/js/js/context/skills/export-config/SKILL.md +16 -0
  898. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  899. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  900. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  901. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  902. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  903. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  904. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  905. package/resources/targets/trae/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  906. package/resources/targets/trae/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  907. package/resources/targets/trae/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  908. package/resources/targets/trae/js/js/context/skills/index.json +19 -0
  909. package/resources/targets/trae/js/js/context/skills/visual-qa/SKILL.md +14 -0
  910. package/resources/targets/trae/js/js/project/README.md +7 -0
  911. package/resources/targets/trae/js/js/project/configs/assets.json +1 -0
  912. package/resources/targets/trae/js/js/project/configs/game.controls.json +3 -0
  913. package/resources/targets/trae/js/js/project/configs/game.json +3 -0
  914. package/resources/targets/trae/js/js/project/game-runtime.json +7 -0
  915. package/resources/targets/trae/js/js/project/game.config.json +7 -0
  916. package/resources/targets/trae/js/js/project/index.html +20 -0
  917. package/resources/targets/trae/js/js/project/package.json +22 -0
  918. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  919. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  920. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  921. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  922. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  923. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  924. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  925. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  926. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  927. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  928. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  929. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  930. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  931. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  932. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  933. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  934. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  935. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  936. package/resources/targets/trae/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  937. package/resources/targets/trae/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  938. package/resources/targets/trae/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  939. package/resources/targets/trae/js/js/project/scripts/config-export.mjs +13 -0
  940. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  941. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  942. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  943. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  944. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  945. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  946. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  947. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  948. package/resources/targets/trae/js/js/project/scripts/write-preview-ready.mjs +22 -0
  949. package/resources/targets/trae/js/js/project/src/display/ui-stage.ts +156 -0
  950. package/resources/targets/trae/js/js/project/src/display/viewport.ts +249 -0
  951. package/resources/targets/trae/js/js/project/src/main.ts +87 -0
  952. package/resources/targets/trae/js/js/project/src/platform.ts +2 -0
  953. package/resources/targets/trae/js/js/project/src/scenes/LoadScene.ts +89 -0
  954. package/resources/targets/trae/js/js/project/src/scenes/PlayScene.ts +17 -0
  955. package/resources/targets/trae/js/js/project/src/screenUi.ts +185 -0
  956. package/resources/targets/trae/js/js/project/src/style.css +294 -0
  957. package/resources/targets/trae/js/js/project/tsconfig.json +20 -0
  958. package/resources/targets/trae/js/js/project/unified_data_control_config.json +20 -0
  959. package/resources/targets/trae/js/js/project/vite.config.ts +5 -0
  960. package/resources/targets/trae/js/recovery.md +17 -0
  961. package/resources/targets/trae/js/target.json +61 -0
  962. package/resources/targets/trae/js3d/bootstrap/SKILL.md +20 -0
  963. package/resources/targets/trae/js3d/context-filter-report.json +27 -0
  964. package/resources/targets/trae/js3d/craft-game-maker/SKILL.md +72 -0
  965. package/resources/targets/trae/js3d/craft-game-maker/js3d.md +12 -0
  966. package/resources/targets/trae/js3d/js3d/bundle.json +108 -0
  967. package/resources/targets/trae/js3d/js3d/context/AGENTS.md +30 -0
  968. package/resources/targets/trae/js3d/js3d/context/hooks/hooks.json +14 -0
  969. package/resources/targets/trae/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  970. package/resources/targets/trae/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  971. package/resources/targets/trae/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  972. package/resources/targets/trae/js3d/js3d/context/knowledge/Layout.md +7 -0
  973. package/resources/targets/trae/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  974. package/resources/targets/trae/js3d/js3d/context/knowledge/Runtime.md +9 -0
  975. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  976. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  977. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  978. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  979. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  980. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  981. package/resources/targets/trae/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  982. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  983. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  984. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  985. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  986. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  987. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  988. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  989. package/resources/targets/trae/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  990. package/resources/targets/trae/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  991. package/resources/targets/trae/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  992. package/resources/targets/trae/js3d/js3d/context/skills/index.json +31 -0
  993. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  994. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  995. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  996. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  997. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  998. package/resources/targets/trae/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  999. package/resources/targets/trae/js3d/js3d/project/README.md +7 -0
  1000. package/resources/targets/trae/js3d/js3d/project/configs/game.controls.json +3 -0
  1001. package/resources/targets/trae/js3d/js3d/project/configs/game.json +3 -0
  1002. package/resources/targets/trae/js3d/js3d/project/game-runtime.json +7 -0
  1003. package/resources/targets/trae/js3d/js3d/project/game.config.json +7 -0
  1004. package/resources/targets/trae/js3d/js3d/project/index.html +12 -0
  1005. package/resources/targets/trae/js3d/js3d/project/package.json +23 -0
  1006. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  1007. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  1008. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  1009. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  1010. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  1011. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  1012. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  1013. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  1014. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  1015. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  1016. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  1017. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  1018. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  1019. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  1020. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  1021. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  1022. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  1023. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  1024. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  1025. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  1026. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  1027. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  1028. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  1029. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  1030. package/resources/targets/trae/js3d/js3d/project/scripts/config-export.mjs +15 -0
  1031. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  1032. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  1033. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  1034. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  1035. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  1036. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  1037. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  1038. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  1039. package/resources/targets/trae/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  1040. package/resources/targets/trae/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  1041. package/resources/targets/trae/js3d/js3d/project/src/display/viewport.ts +239 -0
  1042. package/resources/targets/trae/js3d/js3d/project/src/main.ts +85 -0
  1043. package/resources/targets/trae/js3d/js3d/project/src/platform.ts +2 -0
  1044. package/resources/targets/trae/js3d/js3d/project/src/style.css +83 -0
  1045. package/resources/targets/trae/js3d/js3d/project/tsconfig.json +20 -0
  1046. package/resources/targets/trae/js3d/js3d/project/unified_data_control_config.json +20 -0
  1047. package/resources/targets/trae/js3d/js3d/project/vite.config.ts +5 -0
  1048. package/resources/targets/trae/js3d/recovery.md +17 -0
  1049. package/resources/targets/trae/js3d/target.json +60 -0
  1050. package/resources/targets/workbuddy/js/context-filter-report.json +1 -1
  1051. package/resources/targets/workbuddy/js3d/context-filter-report.json +1 -1
  1052. package/resources/targets/workbuddy/js3d/js3d/bundle.json +5 -5
  1053. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  1054. package/resources/targets/workbuddy/js3d/target.json +1 -1
  1055. package/resources/targets/zcode/js/context-filter-report.json +1 -1
  1056. package/resources/targets/zcode/js3d/context-filter-report.json +1 -1
  1057. package/resources/targets/zcode/js3d/js3d/bundle.json +5 -5
  1058. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  1059. package/resources/targets/zcode/js3d/target.json +1 -1
  1060. package/vendor/craft-runtime/SOURCE.json +1 -1
@@ -0,0 +1,206 @@
1
+ import path from 'node:path';
2
+ import os from 'node:os';
3
+ import { readFile, lstat, realpath } from 'node:fs/promises';
4
+ import { isDeepStrictEqual } from 'node:util';
5
+ import { hosts, hostPaths, hostCommandOptions } from './hosts.mjs';
6
+ import { craftRegistrations, importZcodeFallback } from './config.mjs';
7
+ import { optionalFile, assertPlainPath } from './files.mjs';
8
+ import { installHosts } from './install.mjs';
9
+ import { compareVersions } from './version-policy.mjs';
10
+ import { readInstallation, registryOrigin } from './installation-state.mjs';
11
+ import { hostReloadProfile } from './host-reload.mjs';
12
+ import { readProjectInstall } from '../game-workflow/project-install.mjs';
13
+ import { readContextLock, checkProjectCompatibility } from '../game-workflow/project-bundles.mjs';
14
+ import { safeProjectFile } from '../game-workflow/asset-import.mjs';
15
+ import { engineDefinition } from '../game-workflow/engines.mjs';
16
+ import { verifyBundle } from '../game-workflow/bundle-files.mjs';
17
+ import { assertHostConfigScope } from './host-config-scope.mjs';
18
+
19
+ const samePath = (left, right) => typeof left === 'string' && typeof right === 'string' &&
20
+ (process.platform === 'win32' ? path.resolve(left).toLowerCase() === path.resolve(right).toLowerCase() : path.resolve(left) === path.resolve(right));
21
+
22
+ function connectionRequirements(project, ide, manifest) {
23
+ return {
24
+ status: 'unverified', trust: 'unknown', source: 'current_host_session',
25
+ tool: 'craft_game_info', arguments: { name: path.basename(project) },
26
+ expected: { host: ide, workspace: path.dirname(project), project, engine: manifest.engine,
27
+ platform: manifest.platform, minimum_version: manifest.minimum_mcp_version },
28
+ instructions: 'Discover Craft tools using the host tool catalog, including deferred tools and their actual names. Call craft_game_info in this host session and verify version/build_id, active_verified, host, workspace, platform and project. An installation receipt or standalone doctor does not confirm this connection. After verification call craft_game_prepare(mode=resume) with a new request_key, then reread the project entrypoints and Skill index.',
29
+ reconnect: hostReloadProfile(ide),
30
+ };
31
+ }
32
+
33
+ function bootstrapCommand(project, ide, manifest, paths, hostOptions) {
34
+ return { command: 'npx', args: ['-y', '--registry=' + manifest.registry,
35
+ manifest.package_name + '@' + manifest.minimum_mcp_version,
36
+ 'project-setup', '--project', project, '--ide', ide,
37
+ ...(hosts[ide].explicitConfig || hostOptions.configPath || hostOptions.hostConfigs?.[ide] ? ['--host-config',paths.config] : []),
38
+ ...(ide==='trae' ? ['--trae-region',hostOptions.traeRegion??'global'] : [])] };
39
+ }
40
+
41
+ async function validateGame(project, manifest) {
42
+ const definition = engineDefinition(manifest.engine);
43
+ const runtime = JSON.parse(await readFile(await safeProjectFile(project, 'game-runtime.json'), 'utf8'));
44
+ const pkg = JSON.parse(await readFile(await safeProjectFile(project, 'package.json'), 'utf8'));
45
+ if (typeof runtime.version !== 'string' || !pkg.scripts?.build || !pkg.dependencies?.[definition.dependency]) throw new Error('Project installation metadata does not describe a valid Craft ' + manifest.engine + ' game');
46
+ for (const relative of ['configs/game.json', 'src/main.ts', ...definition.files]) {
47
+ if (!(await lstat(await safeProjectFile(project, relative))).isFile()) throw new Error('Missing Craft game file: ' + relative);
48
+ }
49
+ return readContextLock(project, manifest.engine);
50
+ }
51
+
52
+ async function readHostRegistration(paths, ide) {
53
+ await assertHostConfigScope(paths.config,ide,paths.configPeers);
54
+ await assertPlainPath(paths.config);
55
+ let content = await optionalFile(paths.config) ?? '';
56
+ if (paths.fallbackConfig) {
57
+ await assertPlainPath(paths.fallbackConfig);
58
+ content = importZcodeFallback(content, await optionalFile(paths.fallbackConfig));
59
+ }
60
+ return craftRegistrations(content, ide);
61
+ }
62
+
63
+ async function projectRegistration(project, ide) {
64
+ const candidates = {
65
+ codex: ['.codex/config.toml'], workbuddy: ['.workbuddy/mcp.json'],
66
+ cursor: ['.cursor/mcp.json'], codebuddy: ['.codebuddy/.mcp.json', '.codebuddy/mcp.json'],
67
+ claude: ['.mcp.json'],
68
+ trae: ['.trae/mcp.json'],
69
+ comate: ['.comate/mcp.json'], opencode: ['opencode.jsonc','opencode.json','.opencode/opencode.jsonc','.opencode/opencode.json'],
70
+ qwen: ['.qwen/settings.json'],
71
+ }[ide] ?? [];
72
+ for (const relative of candidates) {
73
+ const config = path.join(project, relative);
74
+ await assertPlainPath(config);
75
+ const content = await optionalFile(config);
76
+ if (content !== null && craftRegistrations(content, ide).length) return config;
77
+ }
78
+ return null;
79
+ }
80
+
81
+ // This command inspects configuration only. It cannot observe host trust,
82
+ // deferred-tool discovery, or the connection attached to the user's chat.
83
+ export async function setupProject({ project, ide, packageRoot, install = false,
84
+ home = os.homedir(), codexHome, hostOptions = {}, runtimeRoot, stateRoot,
85
+ installer = installHosts } = {}) {
86
+ if (!Object.hasOwn(hosts, ide ?? '')) throw new Error('--ide must select exactly one supported host');
87
+ if (typeof project !== 'string' || !path.isAbsolute(project)) throw new Error('--project must be an absolute existing Craft game directory');
88
+ if (typeof packageRoot !== 'string' || !path.isAbsolute(packageRoot)) throw new Error('Craft packageRoot must be absolute');
89
+ if (typeof install !== 'boolean') throw new Error('--install is a boolean flag');
90
+ project = path.resolve(project);
91
+ const stat = await lstat(project);
92
+ const canonicalProject = await realpath(project);
93
+ if (!stat.isDirectory() || stat.isSymbolicLink() || !samePath(canonicalProject, project)) throw new Error('Craft game directory must not be a symbolic link');
94
+ // Windows accepts case variants, while game file guards require the actual
95
+ // canonical path. Keep the stored directory spelling for the engine name too.
96
+ project = canonicalProject;
97
+ if (!/^[a-z][a-z0-9-]{0,47}$/.test(path.basename(project))) throw new Error('Existing Craft game directory name must match [a-z][a-z0-9-]{0,47}');
98
+ const paths = hostPaths(home, ide, codexHome, hostOptions);
99
+ const base = { project, name: path.basename(project), host: ide, config: paths.config, changed: false, inspection_scope: 'standard_host_configuration',
100
+ host_connection: 'unverified', trust: 'unknown' };
101
+ const manifest = await readProjectInstall(project);
102
+ if (!manifest) return { ...base, status: 'missing_project_install_metadata',
103
+ next: 'Use the original verified Craft connection to prepare(mode=resume) and save project-install.json. If that connection is unavailable, recover the project platform and package source explicitly; do not guess a platform or install into the default workspace.' };
104
+ const lock = await validateGame(project, manifest);
105
+ const verification = connectionRequirements(project, ide, manifest);
106
+ const expected = { engine: manifest.engine, workspace: path.dirname(project), platform: manifest.platform,
107
+ registry: manifest.registry, channel: manifest.channel, minimum_version: manifest.minimum_mcp_version };
108
+ const response = { ...base, expected, verification };
109
+ const localConfig = await projectRegistration(project, ide);
110
+ if (localConfig) return { ...response, status: 'project_configuration_unverified', project_config: localConfig,
111
+ next: 'A project-scoped Craft registration exists. Verify its effective configuration, trust and actual connection in the host before considering a user-level installation. It was preserved and no duplicate registration was installed.' };
112
+ const registrations = await readHostRegistration(paths, ide);
113
+ if (registrations.length > 1) return { ...response, status: 'multiple_installations',
114
+ next: 'Several Craft registrations exist. Select the intended connection without replacing other environments.' };
115
+ const existing = registrations[0];
116
+ if (existing) {
117
+ const connection = existing.connection;
118
+ if (!connection || typeof connection !== 'object') return { ...response, status: 'invalid_configuration', next: 'Repair the existing Craft configuration; it was preserved.' };
119
+ if (connection.disabled === true || connection.enabled === false || connection.enable === false) return { ...response, status: 'disabled',
120
+ next: 'Craft is installed but explicitly disabled. Enable it through the current host only when the user intends to do so; do not reinstall to bypass this setting.' };
121
+ if (connection.args !== undefined && (!Array.isArray(connection.args) || connection.args.some(arg => typeof arg !== 'string'))) return { ...response, status: 'invalid_configuration', next: 'Craft startup arguments are invalid; preserve and repair the configuration.' };
122
+ const args = connection.args ?? [], indexes = args.flatMap((arg, i) => arg === '--workspace' ? [i] : []);
123
+ if (indexes.length > 1 || (indexes.length && (!args[indexes[0] + 1] || !path.isAbsolute(args[indexes[0] + 1])))) return { ...response, status: 'invalid_configuration', next: 'Craft workspace arguments are ambiguous or relative; preserve and repair the configuration.' };
124
+ const workspace = indexes.length ? args[indexes[0] + 1] : connection.env?.CLIENT_WORKSPACE_ROOT;
125
+ const platform = connection.env?.CRAFT_WEB_URL, host = connection.env?.CRAFT_CLIENT_IDE;
126
+ if ((workspace !== undefined && (typeof workspace !== 'string' || !path.isAbsolute(workspace))) ||
127
+ (platform !== undefined && typeof platform !== 'string') || (host !== undefined && typeof host !== 'string')) return { ...response, status: 'invalid_configuration',
128
+ next: 'Craft environment scope values are invalid or relative; preserve and repair the existing registration.' };
129
+ const mismatches = [];
130
+ if (workspace !== undefined && !samePath(workspace, expected.workspace)) mismatches.push('workspace');
131
+ if (platform !== undefined && (typeof platform !== 'string' || platform.replace(/\/$/, '') !== expected.platform)) mismatches.push('platform');
132
+ if (host !== undefined && host !== ide) mismatches.push('host');
133
+ if (mismatches.length) return { ...response, status: 'scope_mismatch', mismatches,
134
+ next: 'The current host Craft connection targets another project scope or platform. Preserve it and explicitly choose/reconfigure the intended connection before resuming; --install will not overwrite it.' };
135
+ if (!connection.env?.CRAFT_INSTALLATION_FILE) return { ...response, status: 'legacy_installation',
136
+ next: 'An existing Craft registration is present. Discover its actual tools and verify its current scope/version first. Migrate it with the standard installer only after resolving its identity; this command does not overwrite legacy connections.' };
137
+ let state;
138
+ try {
139
+ if (typeof connection.env.CRAFT_INSTALLATION_FILE !== 'string' || !path.isAbsolute(connection.env.CRAFT_INSTALLATION_FILE)) throw new Error('Invalid installation state path');
140
+ await assertPlainPath(connection.env.CRAFT_INSTALLATION_FILE);
141
+ state = await readInstallation(connection.env.CRAFT_INSTALLATION_FILE);
142
+ } catch { return { ...response, status: 'invalid_installation', next: 'The existing Craft installation state is missing or invalid. Preserve the configuration and repair that installation before continuing.' }; }
143
+ if (state.host !== ide || !samePath(state.config, paths.config) || !samePath(state.workspace, expected.workspace) || state.platform !== expected.platform ||
144
+ state.source.package !== manifest.package_name || registryOrigin(state.source.registry) !== registryOrigin(manifest.registry) || state.source.channel !== manifest.channel) return { ...response, status: 'scope_mismatch',
145
+ next: 'The recorded installation host, project scope, platform or package source differs from this project. Preserve it and resolve the intended connection explicitly.' };
146
+ if (!workspace || !platform || host !== ide || !connection.command) return { ...response, status: 'invalid_configuration',
147
+ next: 'The Craft registration is incomplete or differs from its installation state; repair it without guessing startup defaults.' };
148
+ const target = { version: state.target.version, build_id: state.target.build_id };
149
+ verification.expected.installed_target = target;
150
+ if (compareVersions(state.target.version, manifest.minimum_mcp_version) < 0) return { ...response, status: 'update_required', installed_target: target,
151
+ next: 'Update the existing Craft installation to a compatible release, reconnect if required, and verify the actual host connection before preparing this project.' };
152
+ return { ...response, status: 'configured_unverified', installed_target: target,
153
+ next: 'Craft is configured. Discover and call its actual tools in this host session. If tools remain unavailable, inspect connection/startup errors and host trust; do not treat this as a missing installation. Reconnect only as needed, then verify and resume.' };
154
+ }
155
+ const pkg = JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8'));
156
+ if (pkg.name !== manifest.package_name) throw new Error('Running CLI package does not match the project installation package');
157
+ if (compareVersions(pkg.version, manifest.minimum_mcp_version) < 0) return { ...response, status: 'installer_update_required',
158
+ bootstrap: bootstrapCommand(project, ide, manifest, paths, hostOptions), next: 'Use the project-compatible CLI version, then repeat project-setup. No installation was changed.' };
159
+ const bundle = await verifyBundle(path.join(packageRoot, 'resources/targets', ide, manifest.engine), manifest.engine);
160
+ if (bundle.host !== ide) throw new Error('Installer context belongs to another host');
161
+ await checkProjectCompatibility(project, bundle);
162
+ if (lock?.compatibility && !isDeepStrictEqual(lock.compatibility, bundle.compatibility)) throw new Error('Installer engine compatibility differs from the project binding');
163
+ const bound = lock?.contexts?.[ide];
164
+ if (bound && (compareVersions(bundle.version, bound.version) < 0 || (bundle.version === bound.version && bundle.id !== bound.bundle_id))) return { ...response, status: 'installer_update_required',
165
+ bootstrap: bootstrapCommand(project, ide, manifest, paths, hostOptions), next: 'This package cannot preserve the project host context binding. Select a newer compatible Craft release; context downgrade or same-version replacement is refused.' };
166
+ if (!install) return { ...response, status: 'missing_installation',
167
+ next: 'No Craft registration exists for this host. Repeat this command with --install to install only this host using the project platform, source and actual parent directory. Host trust and connection must still be verified.' };
168
+ if (!isDeepStrictEqual(await readProjectInstall(project, { required: true }), manifest)) throw new Error('Project installation metadata changed during setup; retry');
169
+ const result = await installer({ ide, workspace: expected.workspace, platform: manifest.platform,
170
+ registry: manifest.registry, channel: manifest.channel, packageRoot, home, codexHome, hostOptions,
171
+ ...(runtimeRoot ? { runtimeRoot } : {}), ...(stateRoot ? { stateRoot } : {}), onlyIfMissing: true });
172
+ const installed = result.hosts?.find(item => item.host === ide);
173
+ if (!installed) throw new Error('Installer did not return the selected host');
174
+ verification.expected.installed_target = { version: result.runtime.version,
175
+ build_id: installed.activation?.expected?.build_id ?? installed.verified?.runtime?.build_id };
176
+ return { ...response, status: 'pending_connection_verification', changed: true,
177
+ installation: installed.installation, installed_target: verification.expected.installed_target,
178
+ connection_handoff: installed.connection_handoff,
179
+ next: 'Installation completed for this host. Wait for the host to load Craft; reconnect or restart only when needed. Confirm trust only if the host requests it. Verify the actual connection with craft_game_info, then prepare(mode=resume). No game files were changed.' };
180
+ }
181
+
182
+ export function parseProjectSetupArgs(args) {
183
+ if (args[0] !== 'project-setup') throw new Error('Expected project-setup command');
184
+ const options = {};
185
+ for (let i = 1; i < args.length; i++) {
186
+ const key = args[i];
187
+ if (key === '--install') {
188
+ if (options.install !== undefined) throw new Error('Repeated --install option');
189
+ options.install = true;
190
+ } else if (['--project', '--ide', '--host-config', '--trae-region'].includes(key)) {
191
+ const name = key.slice(2), value = args[++i];
192
+ if (!value || value.startsWith('--') || Object.hasOwn(options, name)) throw new Error('Invalid or repeated ' + key);
193
+ options[name] = value;
194
+ } else throw new Error('Unknown project-setup option: ' + key);
195
+ }
196
+ if (!options.project || !options.ide) throw new Error('project-setup requires --project and --ide');
197
+ return options;
198
+ }
199
+
200
+ export async function runProjectSetupCommand(args, packageRoot) {
201
+ const options = parseProjectSetupArgs(args);
202
+ const result = await setupProject({ ...options, packageRoot,
203
+ codexHome: process.env.CODEX_HOME, hostOptions: hostCommandOptions(options) });
204
+ process.stdout.write(JSON.stringify(result, null, 2) + '\n');
205
+ return result;
206
+ }
@@ -0,0 +1,15 @@
1
+ import { hosts } from './hosts.mjs';
2
+
3
+ // Classification only: never read or execute a configuration-provided path.
4
+ // Recognize renamed and damaged managed registrations so setup cannot mistake
5
+ // them for absent installations and overwrite their configuration/state.
6
+ export function hasCraftConnectionIdentity(connection) {
7
+ const args = Array.isArray(connection?.args) ? connection.args.filter(arg => typeof arg === 'string') : [];
8
+ if (args.some(arg => /^@craft_eco\/craft-mcp(?:@[^\s]+)?$/.test(arg))) return true;
9
+ const env = connection?.env;
10
+ if (!env || typeof env !== 'object' || Array.isArray(env)) return false;
11
+ const knownHost = typeof env.CRAFT_CLIENT_IDE === 'string' && Object.hasOwn(hosts, env.CRAFT_CLIENT_IDE);
12
+ const managedLauncher = args.some(arg => /(?:^|[\\/])[^\\/]+\.launcher\.mjs$/.test(arg));
13
+ if (Object.hasOwn(env, 'CRAFT_INSTALLATION_FILE') && (knownHost || managedLauncher)) return true;
14
+ return knownHost && args.some(arg => /(?:^|[\\/])craft-mcp\.mjs$/.test(arg));
15
+ }
@@ -0,0 +1,103 @@
1
+ import path from 'node:path';
2
+ import { mkdir, mkdtemp, lstat, readFile, rename, rm } from 'node:fs/promises';
3
+ import { getRuntimeIdentity } from './runtime-identity.mjs';
4
+ import { assertPlainPath } from './files.mjs';
5
+
6
+ const within = (root, file) => {
7
+ const relative = path.relative(path.resolve(root), path.resolve(file));
8
+ return relative !== '' && relative !== '..' && !relative.startsWith('..' + path.sep) && !path.isAbsolute(relative);
9
+ };
10
+ const changed = message => Object.assign(new Error(message), { code: 'INSTALLATION_CHANGED' });
11
+ const signature = info => [info.dev, info.ino, info.birthtimeMs, info.mtimeMs].map(String).join(':');
12
+ async function directoryStamp(directory) {
13
+ try {
14
+ const info = await lstat(directory);
15
+ if (!info.isDirectory() || info.isSymbolicLink()) throw new Error('Invalid existing Craft runtime directory');
16
+ return signature(info);
17
+ } catch (error) { if (error.code === 'ENOENT') return null; throw error; }
18
+ }
19
+ function relocated(candidate) {
20
+ const { runtime, identity, destination, sourceDirectory } = candidate;
21
+ return { ...runtime, ...identity,
22
+ directory: destination,
23
+ package_root: path.join(destination, path.relative(sourceDirectory, identity.package_root)),
24
+ entry: path.join(destination, path.relative(sourceDirectory, identity.entry)) };
25
+ }
26
+
27
+ // Preparation and complete content verification happen outside installation
28
+ // locks. GC only visits the runtime root's direct version directories.
29
+ export async function prepareRuntimeCandidate(runtimeRoot, materialize) {
30
+ runtimeRoot = path.resolve(runtimeRoot);
31
+ await assertPlainPath(path.join(runtimeRoot, '.candidate-path-check'));
32
+ const parent = path.join(runtimeRoot, '.candidates');
33
+ await mkdir(parent, { recursive: true });
34
+ await assertPlainPath(path.join(parent, '.candidate-path-check'));
35
+ const staging = await mkdtemp(path.join(parent, 'prepare-'));
36
+ const candidate = { runtimeRoot, staging, managed: false };
37
+ try {
38
+ candidate.runtime = await materialize(staging);
39
+ const runtime = candidate.runtime;
40
+ candidate.identity = await getRuntimeIdentity(runtime.package_root ?? path.resolve(path.dirname(runtime.entry), '..'));
41
+ if (path.resolve(runtime.entry) !== candidate.identity.entry) throw new Error('Candidate runtime entry differs from its verified package');
42
+ if (runtime.directory && within(staging, runtime.directory)) {
43
+ candidate.sourceDirectory = path.resolve(runtime.directory);
44
+ if (path.dirname(candidate.sourceDirectory) !== staging || !within(candidate.sourceDirectory, candidate.identity.package_root) || !within(candidate.sourceDirectory, candidate.identity.entry)) throw new Error('Candidate runtime escaped its isolated directory');
45
+ candidate.destination = path.join(runtimeRoot, path.basename(candidate.sourceDirectory));
46
+ candidate.managed = true;
47
+ await refreshRuntimeCandidate(candidate);
48
+ }
49
+ // Injectable materializers may return pre-existing fixture/runtime paths.
50
+ // These are never moved or removed by candidate cleanup.
51
+ return candidate;
52
+ } catch (error) { await disposeRuntimeCandidate(candidate); throw error; }
53
+ }
54
+
55
+ // A concurrent publication may appear after preparation. Refresh its complete
56
+ // identity outside locks before retrying the short commit section.
57
+ export async function refreshRuntimeCandidate(candidate) {
58
+ if (!candidate.managed) return;
59
+ const before = await directoryStamp(candidate.destination);
60
+ candidate.existing = null;
61
+ if (before === null) return;
62
+ try {
63
+ const final = relocated(candidate);
64
+ const identity = await getRuntimeIdentity(final.package_root);
65
+ const metadataText = await readFile(path.join(candidate.destination, 'craft-runtime.json'), 'utf8');
66
+ const metadata = JSON.parse(metadataText);
67
+ if (identity.package !== final.package || identity.version !== final.version || identity.build_id !== final.build_id ||
68
+ metadata.package !== final.package || metadata.version !== final.version || metadata.build_id !== final.build_id || metadata.sha256 !== candidate.runtime.sha256) throw new Error('Existing Craft runtime differs from the verified candidate');
69
+ if (before !== await directoryStamp(candidate.destination)) throw changed('Craft runtime changed during candidate verification');
70
+ candidate.existing = { stamp: before, metadataText };
71
+ } catch (error) {
72
+ if (error.code === 'ENOENT') {
73
+ // GC can remove an unreferenced former candidate while it is inspected.
74
+ // Our private copy is still complete and can be published on retry.
75
+ if (await directoryStamp(candidate.destination) === null) return;
76
+ throw changed('Craft runtime was removed while its existing copy was being verified');
77
+ }
78
+ throw error;
79
+ }
80
+ }
81
+
82
+ // Caller holds the runtime-root lock until state/Skills/config commit finishes.
83
+ // Never remove or overwrite a shared target, including on a later commit error.
84
+ export async function publishRuntimeCandidate(candidate) {
85
+ if (!candidate.managed) return { ...candidate.runtime, ...candidate.identity };
86
+ const stamp = await directoryStamp(candidate.destination);
87
+ if (stamp !== null) {
88
+ if (!candidate.existing || stamp !== candidate.existing.stamp ||
89
+ await readFile(path.join(candidate.destination, 'craft-runtime.json'), 'utf8') !== candidate.existing.metadataText) throw changed('Another installer published this Craft runtime; verify it before retrying');
90
+ } else {
91
+ if (candidate.existing) throw changed('Previously verified Craft runtime was removed; retry candidate publication');
92
+ await rename(candidate.sourceDirectory, candidate.destination);
93
+ }
94
+ return relocated(candidate);
95
+ }
96
+
97
+ export async function disposeRuntimeCandidate(candidate) {
98
+ const parent = path.join(path.resolve(candidate.runtimeRoot), '.candidates');
99
+ const staging = path.resolve(candidate.staging);
100
+ if (path.dirname(staging) !== parent || !path.basename(staging).startsWith('prepare-')) throw new Error('Candidate cleanup escaped its private staging directory');
101
+ await assertPlainPath(path.join(staging, '.candidate-path-check'));
102
+ await rm(staging, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
103
+ }
@@ -5,12 +5,16 @@ import { readInstallation, readInstallationSnapshot, activationStatus, registryO
5
5
  import { compareVersions, requireForwardVersion, parseVersion } from './version-policy.mjs';
6
6
  import { stageRegistryRuntime, getRuntimeIdentity, probeRuntime } from './runtime.mjs';
7
7
  import { optionalFile, assertPlainPath, commitFiles } from './files.mjs';
8
- import { hostPaths, hostEnvironment, installTargets } from './hosts.mjs';
8
+ import { hostPaths, hostCommandOptions, installTargets } from './hosts.mjs';
9
9
  import { craftConfig, mergeConfig } from './config.mjs';
10
10
  import { assertDshSharedScope } from './dsh-config.mjs';
11
11
  import { connectionHandoff } from './connection-handoff.mjs';
12
12
  import { planLauncher, verifyLauncher } from './fixed-launcher.mjs';
13
13
  import os from 'node:os';
14
+ import { setTimeout as delay } from 'node:timers/promises';
15
+ import { unchangedInstallation, installationChanged, installationBusy } from './installation-transaction.mjs';
16
+ import { prepareRuntimeCandidate, publishRuntimeCandidate, disposeRuntimeCandidate, refreshRuntimeCandidate } from './runtime-candidate.mjs';
17
+ import { assertHostConfigScope } from './host-config-scope.mjs';
14
18
 
15
19
  export { readInstallation } from './installation-state.mjs';
16
20
  const pending = new Map();
@@ -66,17 +70,35 @@ async function candidateSkills(state, identity) {
66
70
  return changes;
67
71
  }
68
72
 
73
+ const shortLock = { stale: 120000, retries: 0 };
74
+
75
+ async function confirmationSnapshot(installationFile, current) {
76
+ const snapshot = await readInstallationSnapshot(installationFile), { state } = snapshot;
77
+ await assertHostConfigScope(state.config,state.host,state.config_peers);
78
+ if (state.schema !== 2 || state.activation_mode !== activationMode) throw new Error('Legacy Craft installation requires the standard installer before reconnecting');
79
+ if (activationStatus(current, state.target).status !== 'active_verified') throw installationChanged('The current connection does not match the configured update target');
80
+ await verifyLauncher(state, installationFile);
81
+ const skills = await candidateSkills(state, current);
82
+ if (skills.some(change => change.before !== change.after)) throw new Error('Installed global Skills differ from the configured runtime; run install again');
83
+ return snapshot;
84
+ }
85
+
69
86
  export async function confirmActiveInstallation({ installationFile, current }) {
70
87
  if (!current?.instance_id) throw new Error('An actual runtime instance is required to confirm the installation');
71
- const unlock = await lockfile.lock(installationFile, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
88
+ // Capture small shared files consistently. Full package hashing never blocks
89
+ // installers; a second short transaction detects concurrent scope/target changes.
90
+ let unlock = await lockfile.lock(installationFile, shortLock), snapshot;
91
+ try { snapshot = await confirmationSnapshot(installationFile, current); }
92
+ finally { await unlock(); }
93
+ let identity, integrityError;
94
+ try { identity = await getRuntimeIdentity(current.package_root); }
95
+ catch (error) { integrityError = error; }
96
+ unlock = await lockfile.lock(installationFile, shortLock);
72
97
  try {
73
- const { state, text: before } = await readInstallationSnapshot(installationFile);
74
- if (state.schema !== 2 || state.activation_mode !== activationMode) throw new Error('Legacy Craft installation requires the standard installer before reconnecting');
75
- if (activationStatus(current, state.target).status !== 'active_verified') throw new Error('The current connection does not match the configured update target');
76
- if (!sameRuntimeIdentity(await getRuntimeIdentity(current.package_root), state.target)) throw new Error('The running package files do not match the configured update target');
77
- await verifyLauncher(state, installationFile);
78
- const skills = await candidateSkills(state, current);
79
- if (skills.some(change => change.before !== change.after)) throw new Error('Installed global Skills differ from the configured runtime; run install again');
98
+ await unchangedInstallation(installationFile, snapshot.state);
99
+ if (integrityError) throw integrityError;
100
+ if (!sameRuntimeIdentity(identity, snapshot.state.target)) throw new Error('The running package files do not match the configured update target');
101
+ const { state, text: before } = await confirmationSnapshot(installationFile, current);
80
102
  const previous = state.connection_verification;
81
103
  const receipt = previous?.instance_id === current.instance_id ? previous : { version: current.version, build_id: current.build_id, instance_id: current.instance_id, confirmed_at: new Date().toISOString() };
82
104
  const written = await commitFiles([{ file: installationFile, before, after: receipt === previous ? before : JSON.stringify({ ...state, connection_verification: receipt }, null, 2) + '\n' }]);
@@ -84,7 +106,18 @@ export async function confirmActiveInstallation({ installationFile, current }) {
84
106
  } finally { await unlock(); }
85
107
  }
86
108
 
109
+ async function saveCheckReceipt(installationFile, expected, receipt) {
110
+ const unlock = await lockfile.lock(installationFile, { ...shortLock, retries: { retries: 3, minTimeout: 25, maxTimeout: 100 } });
111
+ try {
112
+ const { state, text: before } = await unchangedInstallation(installationFile, expected);
113
+ const after = { ...state, last_check: receipt };
114
+ await commitFiles([{ file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }]);
115
+ return after;
116
+ } finally { await unlock(); }
117
+ }
118
+
87
119
  async function hostUpdate(state, installationFile, launcher, identity) {
120
+ await assertHostConfigScope(state.config,state.host,state.config_peers);
88
121
  await assertPlainPath(state.config);
89
122
  if (state.host === 'dsh') assertDshSharedScope({ dshHome: path.dirname(state.config) });
90
123
  const before = await optionalFile(state.config);
@@ -103,9 +136,8 @@ async function hostUpdate(state, installationFile, launcher, identity) {
103
136
  return { file: state.config, before, after: mergeConfig(before, state.host, connection, { previousName: state.server_id, enable: false }) };
104
137
  }
105
138
 
106
- async function checkLocked({ installationFile, current, intent, requestKey, projectCompatibility, registryReceipt, lookup, materialize, probe }) {
107
- const snapshot = await readInstallationSnapshot(installationFile), before = snapshot.text;
108
- let state = snapshot.state;
139
+ async function checkSnapshot({ installationFile, current, intent, requestKey, projectCompatibility, registryReceipt, lookup, materialize, probe }) {
140
+ let state = (await readInstallationSnapshot(installationFile)).state;
109
141
  if (current.package !== state.source.package) return result(state, current, 'error', { code: 'package_mismatch', can_continue: false });
110
142
  try { requireForwardVersion(state.target, current); }
111
143
  catch (error) { return result(state, current, 'error', { code: 'target_not_forward', message: error.message, can_continue: false }); }
@@ -121,8 +153,11 @@ async function checkLocked({ installationFile, current, intent, requestKey, proj
121
153
  try { if (projectCompatibility) await projectCompatibility(current.package_root); }
122
154
  catch (error) { currentIncompatible = error.message; }
123
155
  }
124
- const keepCurrent = (status, extra = {}) => result(state, current, currentIncompatible ? 'incompatible' : status,
125
- { ...extra, can_continue: state.schema === 2 && !activationPending && !currentIncompatible && extra.can_continue !== false, ...(currentIncompatible ? { underlying_status: status, message: currentIncompatible } : {}) });
156
+ const keepCurrent = async (status, extra = {}) => {
157
+ await unchangedInstallation(installationFile, state);
158
+ return result(state, current, currentIncompatible ? 'incompatible' : status,
159
+ { ...extra, can_continue: state.schema === 2 && !activationPending && !currentIncompatible && extra.can_continue !== false, ...(currentIncompatible ? { underlying_status: status, message: currentIncompatible } : {}) });
160
+ };
126
161
  if (state.policy.mode === 'off' && !['inspect', 'update'].includes(intent)) return keepCurrent('disabled');
127
162
  let remote, checkedAt;
128
163
  const last = registryReceipt ?? state.last_check;
@@ -152,10 +187,9 @@ async function checkLocked({ installationFile, current, intent, requestKey, proj
152
187
  // Public version checks are read-only. Their receipts live in the MCP
153
188
  // connection; only an installer/preparation may persist a receipt.
154
189
  if (intent !== 'inspect') {
155
- const after = { ...state, last_check: receipt };
156
- await commitFiles([{ file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }]);
157
- state = after;
190
+ state = await saveCheckReceipt(installationFile, state, receipt);
158
191
  }
192
+ await unchangedInstallation(installationFile, state);
159
193
  if (currentIncompatible && comparison <= 0) return keepCurrent(comparison < 0 ? 'local_ahead' : 'current', { checked_at: checkedAt, remote });
160
194
  const remoteStatus = comparison < 0 ? 'local_ahead' : comparison === 0 ? 'current' : 'available';
161
195
  return result(state, current, state.schema === 1 && comparison <= 0 ? 'migration_required' : activationPending && comparison <= 0 ? 'pending_reconnect' : remoteStatus, { checked_at: checkedAt, remote,
@@ -167,12 +201,11 @@ async function checkLocked({ installationFile, current, intent, requestKey, proj
167
201
  const runtimeRoot = state.runtime_root;
168
202
  if (!path.isAbsolute(runtimeRoot ?? '')) return result(state, current, 'error', { code: 'invalid_runtime_root', can_continue: false });
169
203
  await mkdir(runtimeRoot, { recursive: true });
170
- const unlock = await lockfile.lock(runtimeRoot, { stale: 120000, retries: { retries: 20, minTimeout: 250, maxTimeout: 1000 } });
171
- let originalConfig;
204
+ let candidate, originalConfig;
172
205
  try {
173
206
  originalConfig = await optionalFile(state.config);
174
- const runtime = await materialize(state.source, remote, runtimeRoot);
175
- const identity = await getRuntimeIdentity(runtime.package_root ?? path.resolve(path.dirname(runtime.entry), '..'));
207
+ candidate = await prepareRuntimeCandidate(runtimeRoot, stagingRoot => materialize(state.source, remote, stagingRoot));
208
+ let identity = candidate.identity;
176
209
  if (!within(runtimeRoot, identity.package_root) || identity.package !== state.source.package || identity.version !== remote.version) throw new Error('Candidate runtime identity/path mismatch');
177
210
  requireForwardVersion(identity, state.target);
178
211
  if (projectCompatibility) {
@@ -182,50 +215,84 @@ async function checkLocked({ installationFile, current, intent, requestKey, proj
182
215
  const verified = await probe({ command: process.execPath, args: [identity.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace } },
183
216
  { version: identity.version, build_id: identity.build_id, host: state.host, workspace: state.workspace, platform: state.platform });
184
217
  if (verified.runtime?.activation_mode !== activationMode) throw new Error('Candidate runtime does not support activation at the next MCP start');
185
- const launcherPlan = await planLauncher(installationFile, state.launcher, identity.package_root);
186
- const skillChanges = await candidateSkills(state, identity), configChange = await hostUpdate(state, installationFile, launcherPlan.launcher, identity);
187
- const target = { ...identity, origin: { kind: 'npm', registry: state.source.registry, integrity: remote.integrity } };
188
- const after = { ...state, schema: 2, activation_mode: activationMode, launcher: launcherPlan.launcher, anchor: identity, target, skills_runtime: skillRuntimeIdentity(identity), last_check: receipt, updated_at: new Date().toISOString() };
189
- delete after.connection_verification;
190
- await commitFiles([...skillChanges, launcherPlan.change, { file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }, configChange]);
191
- state = after;
192
- return result(state, current, 'pending_reconnect', { checked_at: checkedAt, remote, reconnect_required: true, can_continue: false, verified: { ...verified, scope: 'standalone_probe' } });
218
+ if (!sameRuntimeIdentity(await getRuntimeIdentity(identity.package_root), identity)) throw new Error('Candidate runtime changed during startup verification');
219
+ // Neither registry traffic nor materialization/probing owns a shared lock.
220
+ // Re-read the authoritative state before publishing; receipt-only writes merge.
221
+ const commitCandidate = async () => {
222
+ const unlockState = await lockfile.lock(installationFile, shortLock);
223
+ let unlockRuntime;
224
+ try {
225
+ const latest = await unchangedInstallation(installationFile, state);
226
+ state = latest.state;
227
+ unlockRuntime = await lockfile.lock(runtimeRoot, shortLock);
228
+ identity = await publishRuntimeCandidate(candidate);
229
+ requireForwardVersion(identity, state.target);
230
+ const launcherPlan = await planLauncher(installationFile, state.launcher, identity.package_root);
231
+ const skillChanges = await candidateSkills(state, identity), configChange = await hostUpdate(state, installationFile, launcherPlan.launcher, identity);
232
+ const target = { ...identity, origin: { kind: 'npm', registry: state.source.registry, integrity: remote.integrity } };
233
+ const after = { ...state, schema: 2, activation_mode: activationMode, launcher: launcherPlan.launcher, anchor: identity, target, skills_runtime: skillRuntimeIdentity(identity), last_check: receipt, updated_at: new Date().toISOString() };
234
+ delete after.connection_verification;
235
+ await commitFiles([...skillChanges, launcherPlan.change, { file: installationFile, before: latest.text, after: JSON.stringify(after, null, 2) + '\n' }, configChange]);
236
+ state = after;
237
+ return result(state, current, 'pending_reconnect', { checked_at: checkedAt, remote, reconnect_required: true, can_continue: false, verified: { ...verified, scope: 'standalone_probe' } });
238
+ } finally { try { await unlockRuntime?.(); } finally { await unlockState(); } }
239
+ };
240
+ for (let attempt = 0; ; attempt++) {
241
+ try { return await commitCandidate(); }
242
+ catch (error) {
243
+ if (!['INSTALLATION_CHANGED','ELOCKED'].includes(error.code) || attempt >= 3) throw error;
244
+ // A second host can publish identical bytes while our own installation
245
+ // remains unchanged. Reuse the complete download and revalidate the
246
+ // existing target outside locks, rather than downloading a second time.
247
+ await unchangedInstallation(installationFile, state);
248
+ if (error.code === 'INSTALLATION_CHANGED') await refreshRuntimeCandidate(candidate);
249
+ await delay(100 * (attempt + 1));
250
+ }
251
+ }
252
+
253
+
193
254
  } catch (error) {
255
+ if (['ELOCKED', 'INSTALLATION_CHANGED'].includes(error.code)) throw error;
194
256
  const failure = { checked_at: checkedAt, remote, code: 'candidate_rejected', message: error.message, ...(error.npm_code?{npm_code:error.npm_code}:{}) };
195
257
  try {
196
258
  // A failed candidate must not disable a verified existing installation.
197
259
  // Recheck the rollback, scope and complete old package before allowing work.
198
260
  if (state.schema !== 2 || activationPending || currentIncompatible) throw new Error(currentIncompatible ?? 'No compatible active installation to retain');
199
- if (await optionalFile(installationFile) !== before) throw new Error('Installation state changed; rollback could not be verified');
261
+ await unchangedInstallation(installationFile, state);
200
262
  if (originalConfig === undefined || originalConfig === null || await optionalFile(state.config) !== originalConfig) throw new Error('Host configuration changed; rollback could not be verified');
201
263
  if (!sameRuntimeIdentity(await getRuntimeIdentity(current.package_root), state.target)) throw new Error('Existing runtime integrity check failed');
202
264
  await hostUpdate(state, installationFile, state.launcher ?? { entry: current.entry }, current);
203
265
  if (!state.launcher && path.resolve(craftConfig(originalConfig, state.host, state.server_id).args[0]) !== path.resolve(current.entry)) throw new Error('Existing runtime entry differs from the configured connection');
204
266
  const skills = await candidateSkills(state, current);
205
267
  if (skills.some(change => change.before !== change.after)) throw new Error('Existing managed Skills differ from the current runtime');
268
+ await unchangedInstallation(installationFile, state);
206
269
  return result(state, current, 'update_failed', { ...failure, can_continue: true, retained_version: current.version,
207
270
  next: 'Report the update failure and continue with the verified existing version. A later new work can retry the update; do not claim the newest version is running.' });
208
271
  } catch (fallbackError) {
272
+ if (fallbackError.code === 'INSTALLATION_CHANGED') throw fallbackError;
209
273
  return result(state, current, 'error', { ...failure, can_continue: false, fallback_error: fallbackError.message });
210
274
  }
211
275
  }
212
- finally { await unlock(); }
276
+ finally { if (candidate) await disposeRuntimeCandidate(candidate); }
213
277
  }
214
278
 
215
279
  export async function checkForUpdate({ installationFile, current, intent = 'inspect', requestKey, projectCompatibility, registryReceipt, lookup = queryRegistry, materialize = stageRegistryRuntime, probe = probeRuntime }) {
216
280
  if (!installationFile) return { status: 'unmanaged', current, can_continue: true, activation_required: false, note: 'Install Craft once to enable automatic updates.' };
217
281
  if (!['inspect', 'auto', 'create', 'resume', 'update'].includes(intent)) throw new Error('Invalid update intent');
218
- // Serialize per installation across processes. A shared promise only merges
219
- // the same logical request in this process; a later work still checks npm.
282
+ // Deduplicate only the same logical request. Other readers and downloads
283
+ // proceed independently; the short commit compares their installation snapshot.
220
284
  const key = requestKey ? JSON.stringify([installationFile, current.build_id, current.instance_id, intent, requestKey]) : Symbol('unkeyed update');
221
285
  if (pending.has(key)) return pending.get(key);
222
286
  const operation = (async () => {
223
- let unlock;
224
- try {
225
- unlock = await lockfile.lock(installationFile, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
226
- return await checkLocked({ installationFile, current, intent, requestKey, projectCompatibility, registryReceipt, lookup, materialize, probe });
227
- } catch (error) { return { status: 'error', code: 'update_failed', message: error.message, current, can_continue: false, activation_required: false }; }
228
- finally { await unlock?.(); }
287
+ for (let attempt = 0; attempt < 3; attempt++) {
288
+ try {
289
+ return await checkSnapshot({ installationFile, current, intent, requestKey, projectCompatibility, registryReceipt, lookup, materialize, probe });
290
+ } catch (error) {
291
+ if (error.code === 'INSTALLATION_CHANGED' && attempt < 2) continue;
292
+ if (['ELOCKED', 'INSTALLATION_CHANGED'].includes(error.code)) return installationBusy(error, current);
293
+ return { status: 'error', code: 'update_failed', message: error.message, current, can_continue: false, activation_required: false };
294
+ }
295
+ }
229
296
  })();
230
297
  pending.set(key, operation);
231
298
  try { return await operation; } finally { if (pending.get(key) === operation) pending.delete(key); }
@@ -235,12 +302,13 @@ export async function runUpdateCommand(args) {
235
302
  const [command, ...rest] = args, options = {};
236
303
  for (let i = 0; i < rest.length; i += 2) {
237
304
  const key = rest[i]?.replace(/^--/, '');
238
- if (rest[i] !== '--ide' || !rest[i + 1] || Object.hasOwn(options, key)) throw new Error('Use craft-mcp ' + command + ' --ide <host>');
305
+ if (!['--ide','--host-config','--trae-region'].includes(rest[i]) || !rest[i + 1] || Object.hasOwn(options, key)) throw new Error('Use craft-mcp ' + command + ' --ide <host> [--host-config ABS] [--trae-region global|cn]');
239
306
  options[key] = rest[i + 1];
240
307
  }
241
308
  const results = [];
309
+ const hostOptions = hostCommandOptions(options);
242
310
  for (const host of installTargets(options.ide)) {
243
- const paths = hostPaths(os.homedir(), host, process.env.CODEX_HOME, hostEnvironment());
311
+ const paths = hostPaths(os.homedir(), host, process.env.CODEX_HOME, hostOptions);
244
312
  await assertPlainPath(paths.config);
245
313
  assertDshSharedScope(paths);
246
314
  const connection = craftConfig(await optionalFile(paths.config) ?? '', host);
@@ -249,6 +317,11 @@ export async function runUpdateCommand(args) {
249
317
  const state = await readInstallation(installationFile);
250
318
  const current = await getRuntimeIdentity(state.target.package_root);
251
319
  const update = await checkForUpdate({ installationFile, current, intent: command === 'update' ? 'update' : 'inspect', requestKey: 'cli-' + Date.now() });
320
+ if (update.status === 'installation_busy') {
321
+ results.push({ host, ...update, scope: 'configured_runtime' });
322
+ process.exitCode = 1;
323
+ continue;
324
+ }
252
325
  // A CLI can inspect configured files, but cannot prove a host connection.
253
326
  results.push({ host, ...update, activation: { status: 'pending_connection_verification', expected: update.target }, can_continue: false, scope: 'configured_runtime', note: 'Call craft_game_info in the actual host connection to confirm activation.',
254
327
  ...(!['error','update_failed','incompatible','migration_required'].includes(update.status) ? {connection_handoff:connectionHandoff({host,target:update.target,workspace:state.workspace,platform:state.platform,intent:command==='update'?'update':'inspect'})} : {}) });