@craft_eco/craft-mcp 0.1.29 → 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 (1140) hide show
  1. package/README.md +17 -60
  2. package/bin/craft-mcp.mjs +7 -1
  3. package/dist-server/game-workflow/check.mjs +3 -2
  4. package/dist-server/game-workflow/context-state.mjs +68 -67
  5. package/dist-server/game-workflow/draft-archive.mjs +147 -2
  6. package/dist-server/game-workflow/draft-upload-identity.mjs +11 -0
  7. package/dist-server/game-workflow/draft-uploads.mjs +105 -60
  8. package/dist-server/game-workflow/native-context.mjs +289 -289
  9. package/dist-server/game-workflow/project-bundles.mjs +246 -246
  10. package/dist-server/game-workflow/project-context.mjs +56 -18
  11. package/dist-server/game-workflow/project-install.mjs +81 -0
  12. package/dist-server/game-workflow/projects.mjs +37 -7
  13. package/dist-server/game-workflow/tasks.mjs +1 -1
  14. package/dist-server/game-workflow/work-scope.mjs +7 -7
  15. package/dist-server/integrations/config.mjs +162 -145
  16. package/dist-server/integrations/connect.mjs +48 -0
  17. package/dist-server/integrations/connection-handoff.mjs +36 -42
  18. package/dist-server/integrations/dsh-config.mjs +182 -182
  19. package/dist-server/integrations/fixed-launcher.mjs +31 -0
  20. package/dist-server/integrations/host-config-scope.mjs +16 -0
  21. package/dist-server/integrations/host-reload.mjs +25 -0
  22. package/dist-server/integrations/hosts.mjs +93 -55
  23. package/dist-server/integrations/install.mjs +337 -205
  24. package/dist-server/integrations/installation-state.mjs +85 -84
  25. package/dist-server/integrations/installation-transaction.mjs +27 -0
  26. package/dist-server/integrations/jsonc-config.mjs +56 -0
  27. package/dist-server/integrations/launcher-start.mjs +52 -0
  28. package/dist-server/integrations/npm-diagnostics.mjs +32 -0
  29. package/dist-server/integrations/opencode-config.mjs +94 -0
  30. package/dist-server/integrations/project-setup.mjs +206 -0
  31. package/dist-server/integrations/registration-identity.mjs +15 -0
  32. package/dist-server/integrations/runtime-candidate.mjs +103 -0
  33. package/dist-server/integrations/runtime-gc.mjs +191 -188
  34. package/dist-server/integrations/runtime-identity.mjs +22 -0
  35. package/dist-server/integrations/runtime.mjs +111 -126
  36. package/dist-server/integrations/updates.mjs +331 -225
  37. package/dist-server/integrations/version-policy.mjs +32 -32
  38. package/dist-server/launcher.mjs +1852 -0
  39. package/dist-server/mcp/control-panel.mjs +8 -23
  40. package/dist-server/mcp/server.mjs +47 -82
  41. package/dist-server/mcp/update-session.mjs +185 -92
  42. package/dist-server/upstream/craft-aigc.mjs +43 -16
  43. package/dist-server/upstream/draft-source.mjs +29 -0
  44. package/package.json +5 -3
  45. package/resources/context-filter-report.json +120 -0
  46. package/resources/craft-create/SKILL.md +19 -19
  47. package/resources/craft-update/SKILL.md +9 -11
  48. package/resources/targets/claude/js/bootstrap/SKILL.md +3 -1
  49. package/resources/targets/claude/js/craft-game-maker/SKILL.md +11 -15
  50. package/resources/targets/claude/js/js/bundle.json +7 -7
  51. package/resources/targets/claude/js/recovery.md +5 -1
  52. package/resources/targets/claude/js/target.json +1 -1
  53. package/resources/targets/claude/js3d/bootstrap/SKILL.md +3 -1
  54. package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +11 -15
  55. package/resources/targets/claude/js3d/js3d/bundle.json +8 -8
  56. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  57. package/resources/targets/claude/js3d/recovery.md +5 -1
  58. package/resources/targets/claude/js3d/target.json +1 -1
  59. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +3 -1
  60. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +11 -15
  61. package/resources/targets/codebuddy/js/js/bundle.json +7 -7
  62. package/resources/targets/codebuddy/js/recovery.md +5 -1
  63. package/resources/targets/codebuddy/js/target.json +1 -1
  64. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +3 -1
  65. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +11 -15
  66. package/resources/targets/codebuddy/js3d/js3d/bundle.json +8 -8
  67. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  68. package/resources/targets/codebuddy/js3d/recovery.md +5 -1
  69. package/resources/targets/codebuddy/js3d/target.json +1 -1
  70. package/resources/targets/codex/js/bootstrap/SKILL.md +2 -4
  71. package/resources/targets/codex/js/craft-game-maker/SKILL.md +11 -15
  72. package/resources/targets/codex/js/js/bundle.json +7 -7
  73. package/resources/targets/codex/js/recovery.md +3 -3
  74. package/resources/targets/codex/js/target.json +1 -1
  75. package/resources/targets/codex/js3d/bootstrap/SKILL.md +2 -4
  76. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +11 -15
  77. package/resources/targets/codex/js3d/js3d/bundle.json +8 -8
  78. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  79. package/resources/targets/codex/js3d/recovery.md +3 -3
  80. package/resources/targets/codex/js3d/target.json +1 -1
  81. package/resources/targets/comate/js/bootstrap/SKILL.md +20 -0
  82. package/resources/targets/comate/js/context-filter-report.json +27 -0
  83. package/resources/targets/comate/js/craft-game-maker/SKILL.md +72 -0
  84. package/resources/targets/comate/js/craft-game-maker/js.md +10 -0
  85. package/resources/targets/comate/js/js/bundle.json +97 -0
  86. package/resources/targets/comate/js/js/context/AGENTS.md +29 -0
  87. package/resources/targets/comate/js/js/context/hooks/hooks.json +14 -0
  88. package/resources/targets/comate/js/js/context/knowledge/AssetUrl.md +9 -0
  89. package/resources/targets/comate/js/js/context/knowledge/AssetWiring.md +7 -0
  90. package/resources/targets/comate/js/js/context/knowledge/Layout.md +7 -0
  91. package/resources/targets/comate/js/js/context/knowledge/Lifecycle.md +11 -0
  92. package/resources/targets/comate/js/js/context/knowledge/ResourceLoading.md +9 -0
  93. package/resources/targets/comate/js/js/context/skills/export-config/SKILL.md +16 -0
  94. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  95. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  96. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  97. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  98. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  99. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  100. package/resources/targets/comate/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  101. package/resources/targets/comate/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  102. package/resources/targets/comate/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  103. package/resources/targets/comate/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  104. package/resources/targets/comate/js/js/context/skills/index.json +19 -0
  105. package/resources/targets/comate/js/js/context/skills/visual-qa/SKILL.md +14 -0
  106. package/resources/targets/comate/js/js/project/README.md +7 -0
  107. package/resources/targets/comate/js/js/project/configs/assets.json +1 -0
  108. package/resources/targets/comate/js/js/project/configs/game.controls.json +3 -0
  109. package/resources/targets/comate/js/js/project/configs/game.json +3 -0
  110. package/resources/targets/comate/js/js/project/game-runtime.json +7 -0
  111. package/resources/targets/comate/js/js/project/game.config.json +7 -0
  112. package/resources/targets/comate/js/js/project/index.html +20 -0
  113. package/resources/targets/comate/js/js/project/package.json +22 -0
  114. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  115. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  116. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  117. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  118. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  119. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  120. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  121. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  122. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  123. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  124. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  125. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  126. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  127. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  128. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  129. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  130. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  131. package/resources/targets/comate/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  132. package/resources/targets/comate/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  133. package/resources/targets/comate/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  134. package/resources/targets/comate/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  135. package/resources/targets/comate/js/js/project/scripts/config-export.mjs +13 -0
  136. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  137. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  138. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  139. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  140. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  141. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  142. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  143. package/resources/targets/comate/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  144. package/resources/targets/comate/js/js/project/scripts/write-preview-ready.mjs +22 -0
  145. package/resources/targets/comate/js/js/project/src/display/ui-stage.ts +156 -0
  146. package/resources/targets/comate/js/js/project/src/display/viewport.ts +249 -0
  147. package/resources/targets/comate/js/js/project/src/main.ts +87 -0
  148. package/resources/targets/comate/js/js/project/src/platform.ts +2 -0
  149. package/resources/targets/comate/js/js/project/src/scenes/LoadScene.ts +89 -0
  150. package/resources/targets/comate/js/js/project/src/scenes/PlayScene.ts +17 -0
  151. package/resources/targets/comate/js/js/project/src/screenUi.ts +185 -0
  152. package/resources/targets/comate/js/js/project/src/style.css +294 -0
  153. package/resources/targets/comate/js/js/project/tsconfig.json +20 -0
  154. package/resources/targets/comate/js/js/project/unified_data_control_config.json +20 -0
  155. package/resources/targets/comate/js/js/project/vite.config.ts +5 -0
  156. package/resources/targets/comate/js/recovery.md +17 -0
  157. package/resources/targets/comate/js/target.json +61 -0
  158. package/resources/targets/comate/js3d/bootstrap/SKILL.md +20 -0
  159. package/resources/targets/comate/js3d/context-filter-report.json +27 -0
  160. package/resources/targets/comate/js3d/craft-game-maker/SKILL.md +72 -0
  161. package/resources/targets/comate/js3d/craft-game-maker/js3d.md +12 -0
  162. package/resources/targets/comate/js3d/js3d/bundle.json +108 -0
  163. package/resources/targets/comate/js3d/js3d/context/AGENTS.md +30 -0
  164. package/resources/targets/comate/js3d/js3d/context/hooks/hooks.json +14 -0
  165. package/resources/targets/comate/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  166. package/resources/targets/comate/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  167. package/resources/targets/comate/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  168. package/resources/targets/comate/js3d/js3d/context/knowledge/Layout.md +7 -0
  169. package/resources/targets/comate/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  170. package/resources/targets/comate/js3d/js3d/context/knowledge/Runtime.md +9 -0
  171. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  172. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  173. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  174. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  175. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  176. package/resources/targets/comate/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  177. package/resources/targets/comate/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  178. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  179. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  180. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  181. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  182. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  183. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  184. package/resources/targets/comate/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  185. package/resources/targets/comate/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  186. package/resources/targets/comate/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  187. package/resources/targets/comate/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  188. package/resources/targets/comate/js3d/js3d/context/skills/index.json +31 -0
  189. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  190. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  191. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  192. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  193. package/resources/targets/comate/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  194. package/resources/targets/comate/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  195. package/resources/targets/comate/js3d/js3d/project/README.md +7 -0
  196. package/resources/targets/comate/js3d/js3d/project/configs/game.controls.json +3 -0
  197. package/resources/targets/comate/js3d/js3d/project/configs/game.json +3 -0
  198. package/resources/targets/comate/js3d/js3d/project/game-runtime.json +7 -0
  199. package/resources/targets/comate/js3d/js3d/project/game.config.json +7 -0
  200. package/resources/targets/comate/js3d/js3d/project/index.html +12 -0
  201. package/resources/targets/comate/js3d/js3d/project/package.json +23 -0
  202. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  203. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  204. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  205. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  206. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  207. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  208. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  209. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  210. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  211. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  212. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  213. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  214. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  215. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  216. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  217. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  218. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  219. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  220. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  221. package/resources/targets/comate/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  222. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  223. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  224. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  225. package/resources/targets/comate/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  226. package/resources/targets/comate/js3d/js3d/project/scripts/config-export.mjs +15 -0
  227. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  228. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  229. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  230. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  231. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  232. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  233. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  234. package/resources/targets/comate/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  235. package/resources/targets/comate/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  236. package/resources/targets/comate/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  237. package/resources/targets/comate/js3d/js3d/project/src/display/viewport.ts +239 -0
  238. package/resources/targets/comate/js3d/js3d/project/src/main.ts +85 -0
  239. package/resources/targets/comate/js3d/js3d/project/src/platform.ts +2 -0
  240. package/resources/targets/comate/js3d/js3d/project/src/style.css +83 -0
  241. package/resources/targets/comate/js3d/js3d/project/tsconfig.json +20 -0
  242. package/resources/targets/comate/js3d/js3d/project/unified_data_control_config.json +20 -0
  243. package/resources/targets/comate/js3d/js3d/project/vite.config.ts +5 -0
  244. package/resources/targets/comate/js3d/recovery.md +17 -0
  245. package/resources/targets/comate/js3d/target.json +60 -0
  246. package/resources/targets/cursor/js/bootstrap/SKILL.md +3 -1
  247. package/resources/targets/cursor/js/craft-game-maker/SKILL.md +11 -15
  248. package/resources/targets/cursor/js/js/bundle.json +7 -7
  249. package/resources/targets/cursor/js/recovery.md +5 -1
  250. package/resources/targets/cursor/js/target.json +1 -1
  251. package/resources/targets/cursor/js3d/bootstrap/SKILL.md +3 -1
  252. package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +11 -15
  253. package/resources/targets/cursor/js3d/js3d/bundle.json +8 -8
  254. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  255. package/resources/targets/cursor/js3d/recovery.md +5 -1
  256. package/resources/targets/cursor/js3d/target.json +1 -1
  257. package/resources/targets/dsh/js/bootstrap/SKILL.md +3 -1
  258. package/resources/targets/dsh/js/craft-game-maker/SKILL.md +11 -15
  259. package/resources/targets/dsh/js/js/bundle.json +7 -7
  260. package/resources/targets/dsh/js/recovery.md +5 -1
  261. package/resources/targets/dsh/js/target.json +1 -1
  262. package/resources/targets/dsh/js3d/bootstrap/SKILL.md +3 -1
  263. package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +11 -15
  264. package/resources/targets/dsh/js3d/js3d/bundle.json +8 -8
  265. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  266. package/resources/targets/dsh/js3d/recovery.md +5 -1
  267. package/resources/targets/dsh/js3d/target.json +1 -1
  268. package/resources/targets/index.json +104 -32
  269. package/resources/targets/kimi/js/bootstrap/SKILL.md +3 -1
  270. package/resources/targets/kimi/js/craft-game-maker/SKILL.md +11 -15
  271. package/resources/targets/kimi/js/js/bundle.json +7 -7
  272. package/resources/targets/kimi/js/recovery.md +5 -1
  273. package/resources/targets/kimi/js/target.json +1 -1
  274. package/resources/targets/kimi/js3d/bootstrap/SKILL.md +3 -1
  275. package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +11 -15
  276. package/resources/targets/kimi/js3d/js3d/bundle.json +8 -8
  277. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  278. package/resources/targets/kimi/js3d/recovery.md +5 -1
  279. package/resources/targets/kimi/js3d/target.json +1 -1
  280. package/resources/targets/opencode/js/bootstrap/SKILL.md +20 -0
  281. package/resources/targets/opencode/js/context-filter-report.json +27 -0
  282. package/resources/targets/opencode/js/craft-game-maker/SKILL.md +72 -0
  283. package/resources/targets/opencode/js/craft-game-maker/js.md +10 -0
  284. package/resources/targets/opencode/js/js/bundle.json +97 -0
  285. package/resources/targets/opencode/js/js/context/AGENTS.md +29 -0
  286. package/resources/targets/opencode/js/js/context/hooks/hooks.json +14 -0
  287. package/resources/targets/opencode/js/js/context/knowledge/AssetUrl.md +9 -0
  288. package/resources/targets/opencode/js/js/context/knowledge/AssetWiring.md +7 -0
  289. package/resources/targets/opencode/js/js/context/knowledge/Layout.md +7 -0
  290. package/resources/targets/opencode/js/js/context/knowledge/Lifecycle.md +11 -0
  291. package/resources/targets/opencode/js/js/context/knowledge/ResourceLoading.md +9 -0
  292. package/resources/targets/opencode/js/js/context/skills/export-config/SKILL.md +16 -0
  293. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  294. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  295. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  296. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  297. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  298. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  299. package/resources/targets/opencode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  300. package/resources/targets/opencode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  301. package/resources/targets/opencode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  302. package/resources/targets/opencode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  303. package/resources/targets/opencode/js/js/context/skills/index.json +19 -0
  304. package/resources/targets/opencode/js/js/context/skills/visual-qa/SKILL.md +14 -0
  305. package/resources/targets/opencode/js/js/project/README.md +7 -0
  306. package/resources/targets/opencode/js/js/project/configs/assets.json +1 -0
  307. package/resources/targets/opencode/js/js/project/configs/game.controls.json +3 -0
  308. package/resources/targets/opencode/js/js/project/configs/game.json +3 -0
  309. package/resources/targets/opencode/js/js/project/game-runtime.json +7 -0
  310. package/resources/targets/opencode/js/js/project/game.config.json +7 -0
  311. package/resources/targets/opencode/js/js/project/index.html +20 -0
  312. package/resources/targets/opencode/js/js/project/package.json +22 -0
  313. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  314. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  315. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  316. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  317. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  318. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  319. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  320. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  321. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  322. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  323. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  324. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  325. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  326. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  327. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  328. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  329. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  330. package/resources/targets/opencode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  331. package/resources/targets/opencode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  332. package/resources/targets/opencode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  333. package/resources/targets/opencode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  334. package/resources/targets/opencode/js/js/project/scripts/config-export.mjs +13 -0
  335. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  336. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  337. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  338. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  339. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  340. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  341. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  342. package/resources/targets/opencode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  343. package/resources/targets/opencode/js/js/project/scripts/write-preview-ready.mjs +22 -0
  344. package/resources/targets/opencode/js/js/project/src/display/ui-stage.ts +156 -0
  345. package/resources/targets/opencode/js/js/project/src/display/viewport.ts +249 -0
  346. package/resources/targets/opencode/js/js/project/src/main.ts +87 -0
  347. package/resources/targets/opencode/js/js/project/src/platform.ts +2 -0
  348. package/resources/targets/opencode/js/js/project/src/scenes/LoadScene.ts +89 -0
  349. package/resources/targets/opencode/js/js/project/src/scenes/PlayScene.ts +17 -0
  350. package/resources/targets/opencode/js/js/project/src/screenUi.ts +185 -0
  351. package/resources/targets/opencode/js/js/project/src/style.css +294 -0
  352. package/resources/targets/opencode/js/js/project/tsconfig.json +20 -0
  353. package/resources/targets/opencode/js/js/project/unified_data_control_config.json +20 -0
  354. package/resources/targets/opencode/js/js/project/vite.config.ts +5 -0
  355. package/resources/targets/opencode/js/recovery.md +17 -0
  356. package/resources/targets/opencode/js/target.json +61 -0
  357. package/resources/targets/opencode/js3d/bootstrap/SKILL.md +20 -0
  358. package/resources/targets/opencode/js3d/context-filter-report.json +27 -0
  359. package/resources/targets/opencode/js3d/craft-game-maker/SKILL.md +72 -0
  360. package/resources/targets/opencode/js3d/craft-game-maker/js3d.md +12 -0
  361. package/resources/targets/opencode/js3d/js3d/bundle.json +108 -0
  362. package/resources/targets/opencode/js3d/js3d/context/AGENTS.md +30 -0
  363. package/resources/targets/opencode/js3d/js3d/context/hooks/hooks.json +14 -0
  364. package/resources/targets/opencode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  365. package/resources/targets/opencode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  366. package/resources/targets/opencode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  367. package/resources/targets/opencode/js3d/js3d/context/knowledge/Layout.md +7 -0
  368. package/resources/targets/opencode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  369. package/resources/targets/opencode/js3d/js3d/context/knowledge/Runtime.md +9 -0
  370. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  371. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  372. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  373. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  374. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  375. package/resources/targets/opencode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  376. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  377. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  378. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  379. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  380. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  381. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  382. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  383. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  384. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  385. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  386. package/resources/targets/opencode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  387. package/resources/targets/opencode/js3d/js3d/context/skills/index.json +31 -0
  388. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  389. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  390. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  391. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  392. package/resources/targets/opencode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  393. package/resources/targets/opencode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  394. package/resources/targets/opencode/js3d/js3d/project/README.md +7 -0
  395. package/resources/targets/opencode/js3d/js3d/project/configs/game.controls.json +3 -0
  396. package/resources/targets/opencode/js3d/js3d/project/configs/game.json +3 -0
  397. package/resources/targets/opencode/js3d/js3d/project/game-runtime.json +7 -0
  398. package/resources/targets/opencode/js3d/js3d/project/game.config.json +7 -0
  399. package/resources/targets/opencode/js3d/js3d/project/index.html +12 -0
  400. package/resources/targets/opencode/js3d/js3d/project/package.json +23 -0
  401. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  402. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  403. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  404. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  405. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  406. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  407. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  408. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  409. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  410. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  411. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  412. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  413. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  414. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  415. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  416. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  417. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  418. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  419. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  420. package/resources/targets/opencode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  421. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  422. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  423. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  424. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  425. package/resources/targets/opencode/js3d/js3d/project/scripts/config-export.mjs +15 -0
  426. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  427. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  428. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  429. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  430. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  431. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  432. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  433. package/resources/targets/opencode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  434. package/resources/targets/opencode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  435. package/resources/targets/opencode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  436. package/resources/targets/opencode/js3d/js3d/project/src/display/viewport.ts +239 -0
  437. package/resources/targets/opencode/js3d/js3d/project/src/main.ts +85 -0
  438. package/resources/targets/opencode/js3d/js3d/project/src/platform.ts +2 -0
  439. package/resources/targets/opencode/js3d/js3d/project/src/style.css +83 -0
  440. package/resources/targets/opencode/js3d/js3d/project/tsconfig.json +20 -0
  441. package/resources/targets/opencode/js3d/js3d/project/unified_data_control_config.json +20 -0
  442. package/resources/targets/opencode/js3d/js3d/project/vite.config.ts +5 -0
  443. package/resources/targets/opencode/js3d/recovery.md +17 -0
  444. package/resources/targets/opencode/js3d/target.json +60 -0
  445. package/resources/targets/qoder/js/bootstrap/SKILL.md +20 -0
  446. package/resources/targets/qoder/js/context-filter-report.json +27 -0
  447. package/resources/targets/qoder/js/craft-game-maker/SKILL.md +72 -0
  448. package/resources/targets/qoder/js/craft-game-maker/js.md +10 -0
  449. package/resources/targets/qoder/js/js/bundle.json +97 -0
  450. package/resources/targets/qoder/js/js/context/AGENTS.md +31 -0
  451. package/resources/targets/qoder/js/js/context/hooks/hooks.json +14 -0
  452. package/resources/targets/qoder/js/js/context/knowledge/AssetUrl.md +9 -0
  453. package/resources/targets/qoder/js/js/context/knowledge/AssetWiring.md +7 -0
  454. package/resources/targets/qoder/js/js/context/knowledge/Layout.md +7 -0
  455. package/resources/targets/qoder/js/js/context/knowledge/Lifecycle.md +11 -0
  456. package/resources/targets/qoder/js/js/context/knowledge/ResourceLoading.md +9 -0
  457. package/resources/targets/qoder/js/js/context/skills/export-config/SKILL.md +16 -0
  458. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  459. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  460. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  461. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  462. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  463. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  464. package/resources/targets/qoder/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  465. package/resources/targets/qoder/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  466. package/resources/targets/qoder/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  467. package/resources/targets/qoder/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  468. package/resources/targets/qoder/js/js/context/skills/index.json +19 -0
  469. package/resources/targets/qoder/js/js/context/skills/visual-qa/SKILL.md +14 -0
  470. package/resources/targets/qoder/js/js/project/README.md +7 -0
  471. package/resources/targets/qoder/js/js/project/configs/assets.json +1 -0
  472. package/resources/targets/qoder/js/js/project/configs/game.controls.json +3 -0
  473. package/resources/targets/qoder/js/js/project/configs/game.json +3 -0
  474. package/resources/targets/qoder/js/js/project/game-runtime.json +7 -0
  475. package/resources/targets/qoder/js/js/project/game.config.json +7 -0
  476. package/resources/targets/qoder/js/js/project/index.html +20 -0
  477. package/resources/targets/qoder/js/js/project/package.json +22 -0
  478. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  479. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  480. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  481. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  482. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  483. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  484. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  485. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  486. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  487. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  488. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  489. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  490. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  491. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  492. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  493. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  494. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  495. package/resources/targets/qoder/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  496. package/resources/targets/qoder/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  497. package/resources/targets/qoder/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  498. package/resources/targets/qoder/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  499. package/resources/targets/qoder/js/js/project/scripts/config-export.mjs +13 -0
  500. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  501. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  502. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  503. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  504. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  505. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  506. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  507. package/resources/targets/qoder/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  508. package/resources/targets/qoder/js/js/project/scripts/write-preview-ready.mjs +22 -0
  509. package/resources/targets/qoder/js/js/project/src/display/ui-stage.ts +156 -0
  510. package/resources/targets/qoder/js/js/project/src/display/viewport.ts +249 -0
  511. package/resources/targets/qoder/js/js/project/src/main.ts +87 -0
  512. package/resources/targets/qoder/js/js/project/src/platform.ts +2 -0
  513. package/resources/targets/qoder/js/js/project/src/scenes/LoadScene.ts +89 -0
  514. package/resources/targets/qoder/js/js/project/src/scenes/PlayScene.ts +17 -0
  515. package/resources/targets/qoder/js/js/project/src/screenUi.ts +185 -0
  516. package/resources/targets/qoder/js/js/project/src/style.css +294 -0
  517. package/resources/targets/qoder/js/js/project/tsconfig.json +20 -0
  518. package/resources/targets/qoder/js/js/project/unified_data_control_config.json +20 -0
  519. package/resources/targets/qoder/js/js/project/vite.config.ts +5 -0
  520. package/resources/targets/qoder/js/recovery.md +17 -0
  521. package/resources/targets/qoder/js/target.json +61 -0
  522. package/resources/targets/qoder/js3d/bootstrap/SKILL.md +20 -0
  523. package/resources/targets/qoder/js3d/context-filter-report.json +27 -0
  524. package/resources/targets/qoder/js3d/craft-game-maker/SKILL.md +72 -0
  525. package/resources/targets/qoder/js3d/craft-game-maker/js3d.md +12 -0
  526. package/resources/targets/qoder/js3d/js3d/bundle.json +108 -0
  527. package/resources/targets/qoder/js3d/js3d/context/AGENTS.md +32 -0
  528. package/resources/targets/qoder/js3d/js3d/context/hooks/hooks.json +14 -0
  529. package/resources/targets/qoder/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  530. package/resources/targets/qoder/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  531. package/resources/targets/qoder/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  532. package/resources/targets/qoder/js3d/js3d/context/knowledge/Layout.md +7 -0
  533. package/resources/targets/qoder/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  534. package/resources/targets/qoder/js3d/js3d/context/knowledge/Runtime.md +9 -0
  535. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  536. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  537. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  538. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  539. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  540. package/resources/targets/qoder/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  541. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  542. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  543. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  544. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  545. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  546. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  547. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  548. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  549. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  550. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  551. package/resources/targets/qoder/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  552. package/resources/targets/qoder/js3d/js3d/context/skills/index.json +31 -0
  553. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  554. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  555. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  556. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  557. package/resources/targets/qoder/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  558. package/resources/targets/qoder/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  559. package/resources/targets/qoder/js3d/js3d/project/README.md +7 -0
  560. package/resources/targets/qoder/js3d/js3d/project/configs/game.controls.json +3 -0
  561. package/resources/targets/qoder/js3d/js3d/project/configs/game.json +3 -0
  562. package/resources/targets/qoder/js3d/js3d/project/game-runtime.json +7 -0
  563. package/resources/targets/qoder/js3d/js3d/project/game.config.json +7 -0
  564. package/resources/targets/qoder/js3d/js3d/project/index.html +12 -0
  565. package/resources/targets/qoder/js3d/js3d/project/package.json +23 -0
  566. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  567. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  568. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  569. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  570. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  571. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  572. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  573. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  574. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  575. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  576. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  577. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  578. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  579. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  580. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  581. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  582. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  583. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  584. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  585. package/resources/targets/qoder/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  586. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  587. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  588. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  589. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  590. package/resources/targets/qoder/js3d/js3d/project/scripts/config-export.mjs +15 -0
  591. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  592. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  593. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  594. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  595. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  596. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  597. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  598. package/resources/targets/qoder/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  599. package/resources/targets/qoder/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  600. package/resources/targets/qoder/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  601. package/resources/targets/qoder/js3d/js3d/project/src/display/viewport.ts +239 -0
  602. package/resources/targets/qoder/js3d/js3d/project/src/main.ts +85 -0
  603. package/resources/targets/qoder/js3d/js3d/project/src/platform.ts +2 -0
  604. package/resources/targets/qoder/js3d/js3d/project/src/style.css +83 -0
  605. package/resources/targets/qoder/js3d/js3d/project/tsconfig.json +20 -0
  606. package/resources/targets/qoder/js3d/js3d/project/unified_data_control_config.json +20 -0
  607. package/resources/targets/qoder/js3d/js3d/project/vite.config.ts +5 -0
  608. package/resources/targets/qoder/js3d/recovery.md +17 -0
  609. package/resources/targets/qoder/js3d/target.json +60 -0
  610. package/resources/targets/qoder-cn/js/bootstrap/SKILL.md +20 -0
  611. package/resources/targets/qoder-cn/js/context-filter-report.json +27 -0
  612. package/resources/targets/qoder-cn/js/craft-game-maker/SKILL.md +72 -0
  613. package/resources/targets/qoder-cn/js/craft-game-maker/js.md +10 -0
  614. package/resources/targets/qoder-cn/js/js/bundle.json +97 -0
  615. package/resources/targets/qoder-cn/js/js/context/AGENTS.md +31 -0
  616. package/resources/targets/qoder-cn/js/js/context/hooks/hooks.json +14 -0
  617. package/resources/targets/qoder-cn/js/js/context/knowledge/AssetUrl.md +9 -0
  618. package/resources/targets/qoder-cn/js/js/context/knowledge/AssetWiring.md +7 -0
  619. package/resources/targets/qoder-cn/js/js/context/knowledge/Layout.md +7 -0
  620. package/resources/targets/qoder-cn/js/js/context/knowledge/Lifecycle.md +11 -0
  621. package/resources/targets/qoder-cn/js/js/context/knowledge/ResourceLoading.md +9 -0
  622. package/resources/targets/qoder-cn/js/js/context/skills/export-config/SKILL.md +16 -0
  623. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  624. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  625. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  626. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  627. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  628. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  629. package/resources/targets/qoder-cn/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  630. package/resources/targets/qoder-cn/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  631. package/resources/targets/qoder-cn/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  632. package/resources/targets/qoder-cn/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  633. package/resources/targets/qoder-cn/js/js/context/skills/index.json +19 -0
  634. package/resources/targets/qoder-cn/js/js/context/skills/visual-qa/SKILL.md +14 -0
  635. package/resources/targets/qoder-cn/js/js/project/README.md +7 -0
  636. package/resources/targets/qoder-cn/js/js/project/configs/assets.json +1 -0
  637. package/resources/targets/qoder-cn/js/js/project/configs/game.controls.json +3 -0
  638. package/resources/targets/qoder-cn/js/js/project/configs/game.json +3 -0
  639. package/resources/targets/qoder-cn/js/js/project/game-runtime.json +7 -0
  640. package/resources/targets/qoder-cn/js/js/project/game.config.json +7 -0
  641. package/resources/targets/qoder-cn/js/js/project/index.html +20 -0
  642. package/resources/targets/qoder-cn/js/js/project/package.json +22 -0
  643. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  644. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  645. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  646. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  647. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  648. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  649. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  650. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  651. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  652. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  653. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  654. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  655. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  656. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  657. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  658. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  659. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  660. package/resources/targets/qoder-cn/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  661. package/resources/targets/qoder-cn/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  662. package/resources/targets/qoder-cn/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  663. package/resources/targets/qoder-cn/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  664. package/resources/targets/qoder-cn/js/js/project/scripts/config-export.mjs +13 -0
  665. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  666. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  667. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  668. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  669. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  670. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  671. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  672. package/resources/targets/qoder-cn/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  673. package/resources/targets/qoder-cn/js/js/project/scripts/write-preview-ready.mjs +22 -0
  674. package/resources/targets/qoder-cn/js/js/project/src/display/ui-stage.ts +156 -0
  675. package/resources/targets/qoder-cn/js/js/project/src/display/viewport.ts +249 -0
  676. package/resources/targets/qoder-cn/js/js/project/src/main.ts +87 -0
  677. package/resources/targets/qoder-cn/js/js/project/src/platform.ts +2 -0
  678. package/resources/targets/qoder-cn/js/js/project/src/scenes/LoadScene.ts +89 -0
  679. package/resources/targets/qoder-cn/js/js/project/src/scenes/PlayScene.ts +17 -0
  680. package/resources/targets/qoder-cn/js/js/project/src/screenUi.ts +185 -0
  681. package/resources/targets/qoder-cn/js/js/project/src/style.css +294 -0
  682. package/resources/targets/qoder-cn/js/js/project/tsconfig.json +20 -0
  683. package/resources/targets/qoder-cn/js/js/project/unified_data_control_config.json +20 -0
  684. package/resources/targets/qoder-cn/js/js/project/vite.config.ts +5 -0
  685. package/resources/targets/qoder-cn/js/recovery.md +17 -0
  686. package/resources/targets/qoder-cn/js/target.json +61 -0
  687. package/resources/targets/qoder-cn/js3d/bootstrap/SKILL.md +20 -0
  688. package/resources/targets/qoder-cn/js3d/context-filter-report.json +27 -0
  689. package/resources/targets/qoder-cn/js3d/craft-game-maker/SKILL.md +72 -0
  690. package/resources/targets/qoder-cn/js3d/craft-game-maker/js3d.md +12 -0
  691. package/resources/targets/qoder-cn/js3d/js3d/bundle.json +108 -0
  692. package/resources/targets/qoder-cn/js3d/js3d/context/AGENTS.md +32 -0
  693. package/resources/targets/qoder-cn/js3d/js3d/context/hooks/hooks.json +14 -0
  694. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  695. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  696. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  697. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/Layout.md +7 -0
  698. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  699. package/resources/targets/qoder-cn/js3d/js3d/context/knowledge/Runtime.md +9 -0
  700. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  701. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  702. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  703. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  704. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  705. package/resources/targets/qoder-cn/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  706. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  707. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  708. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  709. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  710. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  711. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  712. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  713. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  714. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  715. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  716. package/resources/targets/qoder-cn/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  717. package/resources/targets/qoder-cn/js3d/js3d/context/skills/index.json +31 -0
  718. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  719. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  720. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  721. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  722. package/resources/targets/qoder-cn/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  723. package/resources/targets/qoder-cn/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  724. package/resources/targets/qoder-cn/js3d/js3d/project/README.md +7 -0
  725. package/resources/targets/qoder-cn/js3d/js3d/project/configs/game.controls.json +3 -0
  726. package/resources/targets/qoder-cn/js3d/js3d/project/configs/game.json +3 -0
  727. package/resources/targets/qoder-cn/js3d/js3d/project/game-runtime.json +7 -0
  728. package/resources/targets/qoder-cn/js3d/js3d/project/game.config.json +7 -0
  729. package/resources/targets/qoder-cn/js3d/js3d/project/index.html +12 -0
  730. package/resources/targets/qoder-cn/js3d/js3d/project/package.json +23 -0
  731. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  732. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  733. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  734. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  735. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  736. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  737. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  738. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  739. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  740. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  741. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  742. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  743. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  744. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  745. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  746. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  747. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  748. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  749. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  750. package/resources/targets/qoder-cn/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  751. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  752. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  753. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  754. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  755. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/config-export.mjs +15 -0
  756. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  757. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  758. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  759. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  760. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  761. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  762. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  763. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  764. package/resources/targets/qoder-cn/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  765. package/resources/targets/qoder-cn/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  766. package/resources/targets/qoder-cn/js3d/js3d/project/src/display/viewport.ts +239 -0
  767. package/resources/targets/qoder-cn/js3d/js3d/project/src/main.ts +85 -0
  768. package/resources/targets/qoder-cn/js3d/js3d/project/src/platform.ts +2 -0
  769. package/resources/targets/qoder-cn/js3d/js3d/project/src/style.css +83 -0
  770. package/resources/targets/qoder-cn/js3d/js3d/project/tsconfig.json +20 -0
  771. package/resources/targets/qoder-cn/js3d/js3d/project/unified_data_control_config.json +20 -0
  772. package/resources/targets/qoder-cn/js3d/js3d/project/vite.config.ts +5 -0
  773. package/resources/targets/qoder-cn/js3d/recovery.md +17 -0
  774. package/resources/targets/qoder-cn/js3d/target.json +60 -0
  775. package/resources/targets/qwen/js/bootstrap/SKILL.md +20 -0
  776. package/resources/targets/qwen/js/context-filter-report.json +27 -0
  777. package/resources/targets/qwen/js/craft-game-maker/SKILL.md +72 -0
  778. package/resources/targets/qwen/js/craft-game-maker/js.md +10 -0
  779. package/resources/targets/qwen/js/js/bundle.json +97 -0
  780. package/resources/targets/qwen/js/js/context/AGENTS.md +29 -0
  781. package/resources/targets/qwen/js/js/context/hooks/hooks.json +14 -0
  782. package/resources/targets/qwen/js/js/context/knowledge/AssetUrl.md +9 -0
  783. package/resources/targets/qwen/js/js/context/knowledge/AssetWiring.md +7 -0
  784. package/resources/targets/qwen/js/js/context/knowledge/Layout.md +7 -0
  785. package/resources/targets/qwen/js/js/context/knowledge/Lifecycle.md +11 -0
  786. package/resources/targets/qwen/js/js/context/knowledge/ResourceLoading.md +9 -0
  787. package/resources/targets/qwen/js/js/context/skills/export-config/SKILL.md +16 -0
  788. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  789. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  790. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  791. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  792. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  793. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  794. package/resources/targets/qwen/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  795. package/resources/targets/qwen/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  796. package/resources/targets/qwen/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  797. package/resources/targets/qwen/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  798. package/resources/targets/qwen/js/js/context/skills/index.json +19 -0
  799. package/resources/targets/qwen/js/js/context/skills/visual-qa/SKILL.md +14 -0
  800. package/resources/targets/qwen/js/js/project/README.md +7 -0
  801. package/resources/targets/qwen/js/js/project/configs/assets.json +1 -0
  802. package/resources/targets/qwen/js/js/project/configs/game.controls.json +3 -0
  803. package/resources/targets/qwen/js/js/project/configs/game.json +3 -0
  804. package/resources/targets/qwen/js/js/project/game-runtime.json +7 -0
  805. package/resources/targets/qwen/js/js/project/game.config.json +7 -0
  806. package/resources/targets/qwen/js/js/project/index.html +20 -0
  807. package/resources/targets/qwen/js/js/project/package.json +22 -0
  808. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  809. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  810. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  811. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  812. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  813. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  814. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  815. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  816. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  817. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  818. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  819. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  820. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  821. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  822. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  823. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  824. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  825. package/resources/targets/qwen/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  826. package/resources/targets/qwen/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  827. package/resources/targets/qwen/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  828. package/resources/targets/qwen/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  829. package/resources/targets/qwen/js/js/project/scripts/config-export.mjs +13 -0
  830. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  831. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  832. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  833. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  834. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  835. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  836. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  837. package/resources/targets/qwen/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  838. package/resources/targets/qwen/js/js/project/scripts/write-preview-ready.mjs +22 -0
  839. package/resources/targets/qwen/js/js/project/src/display/ui-stage.ts +156 -0
  840. package/resources/targets/qwen/js/js/project/src/display/viewport.ts +249 -0
  841. package/resources/targets/qwen/js/js/project/src/main.ts +87 -0
  842. package/resources/targets/qwen/js/js/project/src/platform.ts +2 -0
  843. package/resources/targets/qwen/js/js/project/src/scenes/LoadScene.ts +89 -0
  844. package/resources/targets/qwen/js/js/project/src/scenes/PlayScene.ts +17 -0
  845. package/resources/targets/qwen/js/js/project/src/screenUi.ts +185 -0
  846. package/resources/targets/qwen/js/js/project/src/style.css +294 -0
  847. package/resources/targets/qwen/js/js/project/tsconfig.json +20 -0
  848. package/resources/targets/qwen/js/js/project/unified_data_control_config.json +20 -0
  849. package/resources/targets/qwen/js/js/project/vite.config.ts +5 -0
  850. package/resources/targets/qwen/js/recovery.md +17 -0
  851. package/resources/targets/qwen/js/target.json +61 -0
  852. package/resources/targets/qwen/js3d/bootstrap/SKILL.md +20 -0
  853. package/resources/targets/qwen/js3d/context-filter-report.json +27 -0
  854. package/resources/targets/qwen/js3d/craft-game-maker/SKILL.md +72 -0
  855. package/resources/targets/qwen/js3d/craft-game-maker/js3d.md +12 -0
  856. package/resources/targets/qwen/js3d/js3d/bundle.json +108 -0
  857. package/resources/targets/qwen/js3d/js3d/context/AGENTS.md +30 -0
  858. package/resources/targets/qwen/js3d/js3d/context/hooks/hooks.json +14 -0
  859. package/resources/targets/qwen/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  860. package/resources/targets/qwen/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  861. package/resources/targets/qwen/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  862. package/resources/targets/qwen/js3d/js3d/context/knowledge/Layout.md +7 -0
  863. package/resources/targets/qwen/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  864. package/resources/targets/qwen/js3d/js3d/context/knowledge/Runtime.md +9 -0
  865. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  866. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  867. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  868. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  869. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  870. package/resources/targets/qwen/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  871. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  872. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  873. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  874. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  875. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  876. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  877. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  878. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  879. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  880. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  881. package/resources/targets/qwen/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  882. package/resources/targets/qwen/js3d/js3d/context/skills/index.json +31 -0
  883. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  884. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  885. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  886. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  887. package/resources/targets/qwen/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  888. package/resources/targets/qwen/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  889. package/resources/targets/qwen/js3d/js3d/project/README.md +7 -0
  890. package/resources/targets/qwen/js3d/js3d/project/configs/game.controls.json +3 -0
  891. package/resources/targets/qwen/js3d/js3d/project/configs/game.json +3 -0
  892. package/resources/targets/qwen/js3d/js3d/project/game-runtime.json +7 -0
  893. package/resources/targets/qwen/js3d/js3d/project/game.config.json +7 -0
  894. package/resources/targets/qwen/js3d/js3d/project/index.html +12 -0
  895. package/resources/targets/qwen/js3d/js3d/project/package.json +23 -0
  896. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  897. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  898. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  899. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  900. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  901. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  902. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  903. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  904. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  905. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  906. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  907. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  908. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  909. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  910. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  911. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  912. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  913. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  914. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  915. package/resources/targets/qwen/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  916. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  917. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  918. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  919. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  920. package/resources/targets/qwen/js3d/js3d/project/scripts/config-export.mjs +15 -0
  921. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  922. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  923. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  924. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  925. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  926. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  927. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  928. package/resources/targets/qwen/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  929. package/resources/targets/qwen/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  930. package/resources/targets/qwen/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  931. package/resources/targets/qwen/js3d/js3d/project/src/display/viewport.ts +239 -0
  932. package/resources/targets/qwen/js3d/js3d/project/src/main.ts +85 -0
  933. package/resources/targets/qwen/js3d/js3d/project/src/platform.ts +2 -0
  934. package/resources/targets/qwen/js3d/js3d/project/src/style.css +83 -0
  935. package/resources/targets/qwen/js3d/js3d/project/tsconfig.json +20 -0
  936. package/resources/targets/qwen/js3d/js3d/project/unified_data_control_config.json +20 -0
  937. package/resources/targets/qwen/js3d/js3d/project/vite.config.ts +5 -0
  938. package/resources/targets/qwen/js3d/recovery.md +17 -0
  939. package/resources/targets/qwen/js3d/target.json +60 -0
  940. package/resources/targets/trae/js/bootstrap/SKILL.md +20 -0
  941. package/resources/targets/trae/js/context-filter-report.json +27 -0
  942. package/resources/targets/trae/js/craft-game-maker/SKILL.md +72 -0
  943. package/resources/targets/trae/js/craft-game-maker/js.md +10 -0
  944. package/resources/targets/trae/js/js/bundle.json +97 -0
  945. package/resources/targets/trae/js/js/context/AGENTS.md +29 -0
  946. package/resources/targets/trae/js/js/context/hooks/hooks.json +14 -0
  947. package/resources/targets/trae/js/js/context/knowledge/AssetUrl.md +9 -0
  948. package/resources/targets/trae/js/js/context/knowledge/AssetWiring.md +7 -0
  949. package/resources/targets/trae/js/js/context/knowledge/Layout.md +7 -0
  950. package/resources/targets/trae/js/js/context/knowledge/Lifecycle.md +11 -0
  951. package/resources/targets/trae/js/js/context/knowledge/ResourceLoading.md +9 -0
  952. package/resources/targets/trae/js/js/context/skills/export-config/SKILL.md +16 -0
  953. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  954. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  955. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  956. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  957. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  958. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  959. package/resources/targets/trae/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  960. package/resources/targets/trae/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  961. package/resources/targets/trae/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  962. package/resources/targets/trae/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  963. package/resources/targets/trae/js/js/context/skills/index.json +19 -0
  964. package/resources/targets/trae/js/js/context/skills/visual-qa/SKILL.md +14 -0
  965. package/resources/targets/trae/js/js/project/README.md +7 -0
  966. package/resources/targets/trae/js/js/project/configs/assets.json +1 -0
  967. package/resources/targets/trae/js/js/project/configs/game.controls.json +3 -0
  968. package/resources/targets/trae/js/js/project/configs/game.json +3 -0
  969. package/resources/targets/trae/js/js/project/game-runtime.json +7 -0
  970. package/resources/targets/trae/js/js/project/game.config.json +7 -0
  971. package/resources/targets/trae/js/js/project/index.html +20 -0
  972. package/resources/targets/trae/js/js/project/package.json +22 -0
  973. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  974. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  975. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  976. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  977. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  978. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  979. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  980. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  981. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  982. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  983. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  984. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  985. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  986. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  987. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  988. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  989. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  990. package/resources/targets/trae/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  991. package/resources/targets/trae/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  992. package/resources/targets/trae/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  993. package/resources/targets/trae/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  994. package/resources/targets/trae/js/js/project/scripts/config-export.mjs +13 -0
  995. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  996. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  997. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  998. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  999. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  1000. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  1001. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  1002. package/resources/targets/trae/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  1003. package/resources/targets/trae/js/js/project/scripts/write-preview-ready.mjs +22 -0
  1004. package/resources/targets/trae/js/js/project/src/display/ui-stage.ts +156 -0
  1005. package/resources/targets/trae/js/js/project/src/display/viewport.ts +249 -0
  1006. package/resources/targets/trae/js/js/project/src/main.ts +87 -0
  1007. package/resources/targets/trae/js/js/project/src/platform.ts +2 -0
  1008. package/resources/targets/trae/js/js/project/src/scenes/LoadScene.ts +89 -0
  1009. package/resources/targets/trae/js/js/project/src/scenes/PlayScene.ts +17 -0
  1010. package/resources/targets/trae/js/js/project/src/screenUi.ts +185 -0
  1011. package/resources/targets/trae/js/js/project/src/style.css +294 -0
  1012. package/resources/targets/trae/js/js/project/tsconfig.json +20 -0
  1013. package/resources/targets/trae/js/js/project/unified_data_control_config.json +20 -0
  1014. package/resources/targets/trae/js/js/project/vite.config.ts +5 -0
  1015. package/resources/targets/trae/js/recovery.md +17 -0
  1016. package/resources/targets/trae/js/target.json +61 -0
  1017. package/resources/targets/trae/js3d/bootstrap/SKILL.md +20 -0
  1018. package/resources/targets/trae/js3d/context-filter-report.json +27 -0
  1019. package/resources/targets/trae/js3d/craft-game-maker/SKILL.md +72 -0
  1020. package/resources/targets/trae/js3d/craft-game-maker/js3d.md +12 -0
  1021. package/resources/targets/trae/js3d/js3d/bundle.json +108 -0
  1022. package/resources/targets/trae/js3d/js3d/context/AGENTS.md +30 -0
  1023. package/resources/targets/trae/js3d/js3d/context/hooks/hooks.json +14 -0
  1024. package/resources/targets/trae/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  1025. package/resources/targets/trae/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  1026. package/resources/targets/trae/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  1027. package/resources/targets/trae/js3d/js3d/context/knowledge/Layout.md +7 -0
  1028. package/resources/targets/trae/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  1029. package/resources/targets/trae/js3d/js3d/context/knowledge/Runtime.md +9 -0
  1030. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  1031. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  1032. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  1033. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  1034. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  1035. package/resources/targets/trae/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  1036. package/resources/targets/trae/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  1037. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  1038. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  1039. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  1040. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  1041. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  1042. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  1043. package/resources/targets/trae/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  1044. package/resources/targets/trae/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  1045. package/resources/targets/trae/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  1046. package/resources/targets/trae/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  1047. package/resources/targets/trae/js3d/js3d/context/skills/index.json +31 -0
  1048. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  1049. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  1050. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  1051. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  1052. package/resources/targets/trae/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  1053. package/resources/targets/trae/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  1054. package/resources/targets/trae/js3d/js3d/project/README.md +7 -0
  1055. package/resources/targets/trae/js3d/js3d/project/configs/game.controls.json +3 -0
  1056. package/resources/targets/trae/js3d/js3d/project/configs/game.json +3 -0
  1057. package/resources/targets/trae/js3d/js3d/project/game-runtime.json +7 -0
  1058. package/resources/targets/trae/js3d/js3d/project/game.config.json +7 -0
  1059. package/resources/targets/trae/js3d/js3d/project/index.html +12 -0
  1060. package/resources/targets/trae/js3d/js3d/project/package.json +23 -0
  1061. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  1062. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  1063. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  1064. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  1065. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  1066. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  1067. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  1068. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  1069. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  1070. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  1071. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  1072. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  1073. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  1074. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  1075. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  1076. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  1077. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  1078. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  1079. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  1080. package/resources/targets/trae/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  1081. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  1082. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  1083. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  1084. package/resources/targets/trae/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  1085. package/resources/targets/trae/js3d/js3d/project/scripts/config-export.mjs +15 -0
  1086. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  1087. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  1088. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  1089. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  1090. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  1091. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  1092. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  1093. package/resources/targets/trae/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  1094. package/resources/targets/trae/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  1095. package/resources/targets/trae/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  1096. package/resources/targets/trae/js3d/js3d/project/src/display/viewport.ts +239 -0
  1097. package/resources/targets/trae/js3d/js3d/project/src/main.ts +85 -0
  1098. package/resources/targets/trae/js3d/js3d/project/src/platform.ts +2 -0
  1099. package/resources/targets/trae/js3d/js3d/project/src/style.css +83 -0
  1100. package/resources/targets/trae/js3d/js3d/project/tsconfig.json +20 -0
  1101. package/resources/targets/trae/js3d/js3d/project/unified_data_control_config.json +20 -0
  1102. package/resources/targets/trae/js3d/js3d/project/vite.config.ts +5 -0
  1103. package/resources/targets/trae/js3d/recovery.md +17 -0
  1104. package/resources/targets/trae/js3d/target.json +60 -0
  1105. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +22 -24
  1106. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +11 -15
  1107. package/resources/targets/workbuddy/js/js/bundle.json +8 -8
  1108. package/resources/targets/workbuddy/js/js/context/AGENTS.md +29 -29
  1109. package/resources/targets/workbuddy/js/recovery.md +19 -19
  1110. package/resources/targets/workbuddy/js/target.json +1 -1
  1111. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +22 -24
  1112. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +11 -15
  1113. package/resources/targets/workbuddy/js3d/js3d/bundle.json +9 -9
  1114. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +30 -30
  1115. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  1116. package/resources/targets/workbuddy/js3d/recovery.md +19 -19
  1117. package/resources/targets/workbuddy/js3d/target.json +1 -1
  1118. package/resources/targets/zcode/js/bootstrap/SKILL.md +3 -1
  1119. package/resources/targets/zcode/js/craft-game-maker/SKILL.md +11 -15
  1120. package/resources/targets/zcode/js/js/bundle.json +7 -7
  1121. package/resources/targets/zcode/js/recovery.md +5 -1
  1122. package/resources/targets/zcode/js/target.json +1 -1
  1123. package/resources/targets/zcode/js3d/bootstrap/SKILL.md +3 -1
  1124. package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +11 -15
  1125. package/resources/targets/zcode/js3d/js3d/bundle.json +8 -8
  1126. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  1127. package/resources/targets/zcode/js3d/recovery.md +5 -1
  1128. package/resources/targets/zcode/js3d/target.json +1 -1
  1129. package/vendor/craft-runtime/SOURCE.json +3 -3
  1130. package/vendor/craft-runtime/package.json +1 -1
  1131. package/dist-server/game-workflow/publication-materials.mjs +0 -92
  1132. package/dist-server/game-workflow/publications.mjs +0 -168
  1133. package/dist-server/game-workflow/publish-capture-worker.mjs +0 -57
  1134. package/dist-server/game-workflow/publish-capture.mjs +0 -75
  1135. package/dist-server/mcp/publication-page.html +0 -86
  1136. package/dist-server/mcp/publication-page.mjs +0 -375
  1137. package/dist-server/mcp/publication-preview.mjs +0 -63
  1138. package/dist-server/mcp/publication-tools.mjs +0 -22
  1139. package/dist-server/mcp/publish-panel.mjs +0 -210
  1140. package/dist-server/upstream/publication-transport.mjs +0 -101
@@ -1,205 +1,337 @@
1
- import path from 'node:path';
2
- import os from 'node:os';
3
- import { readFile, mkdir } from 'node:fs/promises';
4
- import lockfile from 'proper-lockfile';
5
- import { getAppDataRoot } from '../core/app-paths.mjs';
6
- import { hostPaths, hostEnvironment, installTargets } from './hosts.mjs';
7
- import { craftConfig, craftRegistrations, mergeConfig, importZcodeFallback } from './config.mjs';
8
- import { assertDshSharedScope } from './dsh-config.mjs';
9
- import { optionalFile, assertPlainPath, commitFiles } from './files.mjs';
10
- import { stageRuntime, probeRuntime, getRuntimeIdentity } from './runtime.mjs';
11
- import { installationPath, readInstallation, readInstallationSnapshot, updateSource, installedSkillEntries, skillRuntimeIdentity, sameRuntimeIdentity, activationMode } from './installation-state.mjs';
12
- import { requireForwardVersion } from './version-policy.mjs';
13
- import { connectionHandoff } from './connection-handoff.mjs';
14
-
15
- const bootstrapMarker = '<!-- craft-mcp:bootstrap:v1 -->';
16
- function legacyNpmSource(connection, packageName) {
17
- const args = connection?.args ?? [];
18
- const spec = args.find(value => typeof value === 'string' && (value === packageName || value.startsWith(packageName + '@')));
19
- if (!spec) return null;
20
- const selector = spec.slice(packageName.length + 1);
21
- const channel = /^[a-zA-Z][a-zA-Z0-9._-]*$/.test(selector) ? selector : undefined;
22
- const registryValues = args.flatMap((value, index) => typeof value !== 'string' ? [] : value.startsWith('--registry=') ? [value.slice('--registry='.length)] : value === '--registry' ? [args[index + 1]] : []);
23
- if (registryValues.some(value => typeof value !== 'string') || new Set(registryValues).size > 1) throw new Error('Legacy Craft npm registry arguments are ambiguous; preserve the configuration and choose a registry explicitly');
24
- return { package_spec: spec, ...(channel ? { channel } : {}), ...(registryValues.length ? { registry: registryValues[0] } : {}), selector_kind: channel ? 'dist_tag' : selector ? 'pinned_version' : 'unspecified' };
25
- }
26
- function platformOrigin(value) {
27
- const url = new URL(value);
28
- if (url.protocol !== 'https:' || url.username || url.password || url.pathname !== '/' || url.search || url.hash) throw new Error('--platform must be a credential-free HTTPS origin');
29
- return url.origin;
30
- }
31
-
32
- function hostConnectionOptions(host) {
33
- if (host === 'codex') return { startup_timeout_sec: 120 };
34
- if (host === 'claude') return { type: 'stdio' };
35
- if (host === 'zcode') return { type: 'stdio', timeoutMs: 120000 };
36
- if (host === 'kimi') return { enabled: true, startupTimeoutMs: 120000 };
37
- if (host === 'dsh') return {};
38
- return { type: 'stdio', timeout: 120000 };
39
- }
40
-
41
- export async function installHosts({ ide, workspace, platform, packageRoot, home = os.homedir(), codexHome, hostOptions = {},
42
- runtimeRoot = path.join(getAppDataRoot(), 'runtimes'), stateRoot = path.join(path.dirname(runtimeRoot), 'installations'),
43
- registry, channel, updates, materialize = stageRuntime, probe = probeRuntime }) {
44
- const targets = installTargets(ide);
45
- if (workspace !== undefined && !path.isAbsolute(workspace)) throw new Error('--workspace must be absolute');
46
- if (platform !== undefined) platform = platformOrigin(platform);
47
- if (updates !== undefined && !['auto', 'off'].includes(updates)) throw new Error('--updates must be auto or off');
48
- const pkg = JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8'));
49
- const desiredSkill = await readFile(path.join(packageRoot, 'resources/craft-create/SKILL.md'), 'utf8');
50
- const desiredUpdateSkill = await optionalFile(path.join(packageRoot, 'resources/craft-update/SKILL.md'));
51
- if (!desiredSkill.includes(bootstrapMarker)) throw new Error('Craft bootstrap Skill missing from distribution');
52
- if (desiredUpdateSkill !== null && !desiredUpdateSkill.includes('<!-- craft-mcp:update:v1 -->')) throw new Error('Craft update Skill has an invalid distribution marker');
53
- await mkdir(runtimeRoot, { recursive: true });
54
- const release = await lockfile.lock(runtimeRoot, { stale: 120000, retries: 0 });
55
- try {
56
- const plans = [];
57
- for (const host of targets) {
58
- const paths = hostPaths(home, host, codexHome, hostOptions);
59
- await assertPlainPath(paths.config); await assertPlainPath(paths.skill); await assertPlainPath(paths.updateSkill);
60
- assertDshSharedScope(paths);
61
- const original = await optionalFile(paths.config), existingSkill = await optionalFile(paths.skill);
62
- let configInput = original ?? '', fallbackSnapshot;
63
- if (paths.fallbackConfig) {
64
- await assertPlainPath(paths.fallbackConfig);
65
- const fallback = await optionalFile(paths.fallbackConfig);
66
- configInput = importZcodeFallback(configInput, fallback);
67
- if (configInput !== (original ?? '')) fallbackSnapshot = { file: paths.fallbackConfig, text: fallback };
68
- }
69
- const existingUpdateSkill = await optionalFile(paths.updateSkill);
70
- if (existingSkill && !existingSkill.includes(bootstrapMarker)) throw new Error('User-owned craft-create Skill preserved; rename it before installing: ' + paths.skill);
71
- if (desiredUpdateSkill && existingUpdateSkill && !existingUpdateSkill.includes('<!-- craft-mcp:update:v1 -->')) throw new Error('User-owned craft-update Skill preserved; rename it before installing: ' + paths.updateSkill);
72
- const registrations = craftRegistrations(configInput, host);
73
- if (registrations.length > 1) throw new Error(host + ': Multiple Craft registrations found; preserve separate environments and select one installation before updating');
74
- const previousName = registrations[0]?.name ?? 'craft', old = registrations[0]?.connection;
75
- const legacySource = legacyNpmSource(old, pkg.name);
76
- const statePath = installationPath(stateRoot, host, paths.config);
77
- const previousSnapshot = old?.env?.CRAFT_INSTALLATION_FILE ? await readInstallationSnapshot(old.env.CRAFT_INSTALLATION_FILE) : null;
78
- const previousState = previousSnapshot?.state;
79
- if (previousState && (previousState.host !== host || path.resolve(previousState.config) !== path.resolve(paths.config))) throw new Error('Craft installation state belongs to another host configuration');
80
- const stateBefore = previousSnapshot && path.resolve(old.env.CRAFT_INSTALLATION_FILE) === path.resolve(statePath.file) ? previousSnapshot.text : await optionalFile(statePath.file);
81
- let previousRuntime = previousState?.target;
82
- if (!previousRuntime && old?.args?.[0] && path.isAbsolute(old.args[0])) {
83
- const oldRoot = path.resolve(path.dirname(old.args[0]), '..');
84
- try { previousRuntime = await getRuntimeIdentity(oldRoot); }
85
- catch (error) { if (error.code !== 'ENOENT') throw error; }
86
- }
87
- if (!previousRuntime) {
88
- const pinned = old?.args?.find(value => typeof value === 'string' && /^@craft_eco\/craft-mcp@\d/.test(value));
89
- if (pinned) previousRuntime = { version: pinned.slice('@craft_eco/craft-mcp@'.length) };
90
- }
91
- const workspaceIndex = old?.args?.indexOf('--workspace') ?? -1;
92
- const games = workspace ?? (workspaceIndex >= 0 ? old.args[workspaceIndex + 1] : old?.env?.CLIENT_WORKSPACE_ROOT) ?? path.join(home, 'CraftGames');
93
- if (!path.isAbsolute(games)) throw new Error('Configured Craft workspace must be absolute');
94
- const origin = platformOrigin(platform ?? old?.env?.CRAFT_WEB_URL ?? pkg.craft?.platform);
95
- plans.push({ host, paths, original, configInput, fallbackSnapshot, existingSkill, existingUpdateSkill, previousName, previousRuntime, previousState, legacySource, statePath, stateBefore, workspace: path.resolve(games), platform: origin });
96
- }
97
- const runtime = await materialize(packageRoot, runtimeRoot), changes = [], results = [];
98
- const identity = { ...await getRuntimeIdentity(runtime.package_root ?? path.resolve(path.dirname(runtime.entry), '..')), entry: runtime.entry };
99
- for (const plan of plans) {
100
- requireForwardVersion(identity, plan.previousRuntime);
101
- const source = updateSource(pkg, { registry: registry ?? (!plan.previousState ? plan.legacySource?.registry : undefined), channel: channel ?? (!plan.previousState ? plan.legacySource?.channel : undefined) }, plan.previousState?.source);
102
- const migration = plan.previousState?.migration ?? (plan.legacySource ? { from_server: plan.previousName, ...plan.legacySource } : undefined);
103
- const state = { schema: 2, activation_mode: activationMode, id: plan.statePath.id, host: plan.host, server_id: 'craft', config: plan.paths.config,
104
- workspace: plan.workspace, platform: plan.platform, runtime_root: runtimeRoot, source,
105
- ...(migration ? { migration } : {}),
106
- skills: { 'craft-create': plan.paths.skill, ...(desiredUpdateSkill ? { 'craft-update': plan.paths.updateSkill } : {}) },
107
- policy: { mode: updates ?? plan.previousState?.policy.mode ?? 'auto', offline: 'allow-existing' }, anchor: identity, target: identity, skills_runtime: skillRuntimeIdentity(identity) };
108
- if (plan.previousState?.connection_verification && sameRuntimeIdentity(identity, plan.previousState.target) && plan.workspace === plan.previousState.workspace && plan.platform === plan.previousState.platform) state.connection_verification = plan.previousState.connection_verification;
109
- // Reinstalling the same build must not reset check receipts or touch files.
110
- const priorComparable = plan.previousState && { ...plan.previousState };
111
- if (priorComparable) { delete priorComparable.updated_at; delete priorComparable.last_check; }
112
- const same = priorComparable && JSON.stringify(priorComparable) === JSON.stringify(state);
113
- const desiredState = same ? plan.previousState : { ...state, updated_at: new Date().toISOString() };
114
- const connection = { command: process.execPath, args: [runtime.entry, '--workspace', plan.workspace],
115
- env: { CRAFT_CLIENT_IDE: plan.host, CRAFT_WEB_URL: plan.platform, CLIENT_WORKSPACE_ROOT: plan.workspace, CRAFT_INSTALLATION_FILE: plan.statePath.file },
116
- ...hostConnectionOptions(plan.host) };
117
- const updated = mergeConfig(plan.configInput, plan.host, connection, { previousName: plan.previousName });
118
- const verified = await probe(craftConfig(updated, plan.host), { version: runtime.version, build_id: identity.build_id, host: plan.host, workspace: plan.workspace, platform: plan.platform });
119
- if (verified.runtime?.activation_mode !== activationMode) throw new Error('Craft runtime requires a legacy frontend; install a next_mcp_start distribution');
120
- changes.push({ file: plan.paths.skill, before: plan.existingSkill, after: desiredSkill });
121
- if (desiredUpdateSkill) changes.push({ file: plan.paths.updateSkill, before: plan.existingUpdateSkill, after: desiredUpdateSkill });
122
- // A host may react as soon as its config changes. Make the state and
123
- // managed entrypoints available before exposing the new launch command.
124
- changes.push({ file: plan.statePath.file, before: plan.stateBefore, after: same ? plan.stateBefore : JSON.stringify(desiredState, null, 2) + '\n' },
125
- { file: plan.paths.config, before: plan.original, after: updated });
126
- results.push({ host: plan.host, ...plan.paths, installation: plan.statePath.file, source, policy: state.policy, ...(migration ? { migration } : {}), ...(plan.previousName !== 'craft' ? { migrated_from: plan.previousName } : {}), ...(plan.fallbackSnapshot ? { imported_from: plan.fallbackSnapshot.file } : {}), verified,
127
- activation_mode: activationMode, reconnect_required: true, activation: { status: 'pending_connection_verification', expected: identity },
128
- connection_handoff: connectionHandoff({host:plan.host,target:identity,workspace:plan.workspace,platform:plan.platform,intent:'install'}) });
129
- }
130
- for (const plan of plans) {
131
- await assertPlainPath(plan.paths.config);
132
- assertDshSharedScope(plan.paths);
133
- if (plan.fallbackSnapshot && await optionalFile(plan.fallbackSnapshot.file) !== plan.fallbackSnapshot.text) throw new Error('ZCode fallback MCP configuration changed during installation; retry without changing the fallback');
134
- }
135
- const written = await commitFiles(changes);
136
- return { runtime, hosts: results, ...written,
137
- next: 'Reload Craft in the selected host, then call craft_game_info on that actual connection and match runtime version/build_id. Installed updates apply at the next MCP start; existing connections keep their complete current runtime. Standalone probes do not confirm host activation.' };
138
- } finally { await release(); }
139
- }
140
-
141
- async function verifyInstalledSkills(installation, paths, connection) {
142
- const entries = installation?.skills ? installedSkillEntries(installation) : [{ name: 'craft-create', file: paths.skill, marker: bootstrapMarker }];
143
- const contents = new Map();
144
- for (const { name, file, marker } of entries) {
145
- await assertPlainPath(file);
146
- const content = await optionalFile(file);
147
- if (!content?.includes(marker)) throw new Error('Craft ' + name + ' Skill missing or not managed by installer: ' + file);
148
- contents.set(name, content);
149
- }
150
- const candidates = installation ? installation.skills_runtime ? [installation.skills_runtime] : [installation.target, installation.anchor] : [await getRuntimeIdentity(path.resolve(path.dirname(connection.args[0]), '..'))];
151
- for (const candidate of candidates) {
152
- const actual = await getRuntimeIdentity(candidate.package_root);
153
- if (actual.package !== candidate.package || actual.version !== candidate.version || actual.build_id !== candidate.build_id) throw new Error('Installed Skill runtime files differ from their recorded identity');
154
- let matches = true;
155
- for (const { name, marker } of entries) {
156
- const expected = await optionalFile(path.join(candidate.package_root, 'resources', name, 'SKILL.md'));
157
- if (!expected?.includes(marker) || contents.get(name) !== expected) { matches = false; break; }
158
- }
159
- if (matches) return { status: 'verified', runtime: skillRuntimeIdentity(candidate), managed: entries.map(entry => entry.name) };
160
- }
161
- // Pre-receipt installations can have activated B while anchor A and pending C
162
- // remain on disk. Never call B corrupt or claim its identity is verified.
163
- if (installation && !installation.skills_runtime) return { status: 'legacy_unverified', managed: entries.map(entry => entry.name), note: 'Managed Skill markers are present, but their runtime identity was not recorded by this older installation. Complete activation on the actual connection to synchronize and verify them.' };
164
- throw new Error('Craft managed Skills differ from the recorded installed Skill runtime; run install again');
165
- }
166
-
167
- export async function doctorHosts({ ide, home = os.homedir(), codexHome, hostOptions = {}, probe = probeRuntime }) {
168
- const results = [];
169
- for (const host of installTargets(ide)) {
170
- const paths = hostPaths(home, host, codexHome, hostOptions);
171
- await assertPlainPath(paths.config);
172
- assertDshSharedScope(paths);
173
- const connection = craftConfig(await optionalFile(paths.config) ?? '', host);
174
- if (!connection?.command || connection.env?.CRAFT_CLIENT_IDE !== host) throw new Error(host + ': Craft installation missing or host marker incorrect; run install --ide ' + host);
175
- if (connection.disabled === true || connection.enabled === false || connection.enable === false) throw new Error(host + ': Craft MCP is disabled');
176
- let installation = null, skillsVerification;
177
- if (connection.env.CRAFT_INSTALLATION_FILE) {
178
- const unlock = await lockfile.lock(connection.env.CRAFT_INSTALLATION_FILE, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
179
- try {
180
- installation = await readInstallation(connection.env.CRAFT_INSTALLATION_FILE);
181
- skillsVerification = await verifyInstalledSkills(installation, paths, connection);
182
- } finally { await unlock(); }
183
- } else skillsVerification = await verifyInstalledSkills(null, paths, connection);
184
- const skillsPending = Boolean(installation && skillsVerification.runtime?.build_id !== installation.target.build_id);
185
- const checkConnection = installation ? { ...connection, args: [installation.target.entry, '--workspace', installation.workspace] } : connection;
186
- const verified = await probe(checkConnection, { host, ...(installation ? { version: installation.target.version, build_id: installation.target.build_id } : {}) });
187
- results.push({ host, ...paths, entry: connection.args[0], target: installation?.target, skills_pending_activation: skillsPending, skills_verification: skillsVerification, verified });
188
- }
189
- return { hosts: results, note: results.some(item => item.skills_verification.status !== 'verified')
190
- ? 'Candidate MCP protocol verified; legacy global Skill identity remains unverified. Complete activation on the actual connection, then run doctor again. Host trust and Skill discovery require host verification.'
191
- : 'MCP protocol and installed files verified. Host trust, Skill discovery and session recovery require a new session in the host.' };
192
- }
193
-
194
- export async function runIntegrationCommand(args, packageRoot) {
195
- const [command, ...rest] = args, options = {};
196
- for (let i = 0; i < rest.length; i += 2) {
197
- const name = rest[i].replace(/^--/, '');
198
- if (!rest[i].startsWith('--') || !['ide', ...(command === 'install' ? ['workspace', 'platform', 'registry', 'channel', 'updates'] : [])].includes(name) || !rest[i + 1] || Object.hasOwn(options, name)) throw new Error('Invalid or repeated option. Use craft-mcp --help.');
199
- options[name] = rest[i + 1];
200
- }
201
- options.codexHome = process.env.CODEX_HOME;
202
- options.hostOptions = hostEnvironment();
203
- const result = command === 'install' ? await installHosts({ ...options, packageRoot }) : await doctorHosts(options);
204
- process.stdout.write(JSON.stringify(result, null, 2) + '\n');
205
- }
1
+ import path from 'node:path';
2
+ import os from 'node:os';
3
+ import { readFile, mkdir } from 'node:fs/promises';
4
+ import lockfile from 'proper-lockfile';
5
+ import { getAppDataRoot } from '../core/app-paths.mjs';
6
+ import { hostPaths, hostCommandOptions, installTargets } from './hosts.mjs';
7
+ import { craftConfig, craftRegistrations, mergeConfig, importZcodeFallback } from './config.mjs';
8
+ import { assertDshSharedScope } from './dsh-config.mjs';
9
+ import { optionalFile, assertPlainPath, commitFiles } from './files.mjs';
10
+ import { stageRuntime, probeRuntime, getRuntimeIdentity } from './runtime.mjs';
11
+ import { installationPath, readInstallation, readInstallationSnapshot, updateSource, installedSkillEntries, skillRuntimeIdentity, sameRuntimeIdentity, activationMode } from './installation-state.mjs';
12
+ import { requireForwardVersion } from './version-policy.mjs';
13
+ import { connectionHandoff } from './connection-handoff.mjs';
14
+ import { planLauncher, verifyLauncher } from './fixed-launcher.mjs';
15
+ import { prepareRuntimeCandidate, refreshRuntimeCandidate, publishRuntimeCandidate, disposeRuntimeCandidate } from './runtime-candidate.mjs';
16
+ import { sameInstallation, installationChanged } from './installation-transaction.mjs';
17
+ import { assertHostConfigScope } from './host-config-scope.mjs';
18
+
19
+ const bootstrapMarker = '<!-- craft-mcp:bootstrap:v1 -->';
20
+ function legacyNpmSource(connection, packageName) {
21
+ const args = connection?.args ?? [];
22
+ const spec = args.find(value => typeof value === 'string' && (value === packageName || value.startsWith(packageName + '@')));
23
+ if (!spec) return null;
24
+ const selector = spec.slice(packageName.length + 1);
25
+ const channel = /^[a-zA-Z][a-zA-Z0-9._-]*$/.test(selector) ? selector : undefined;
26
+ const registryValues = args.flatMap((value, index) => typeof value !== 'string' ? [] : value.startsWith('--registry=') ? [value.slice('--registry='.length)] : value === '--registry' ? [args[index + 1]] : []);
27
+ if (registryValues.some(value => typeof value !== 'string') || new Set(registryValues).size > 1) throw new Error('Legacy Craft npm registry arguments are ambiguous; preserve the configuration and choose a registry explicitly');
28
+ return { package_spec: spec, ...(channel ? { channel } : {}), ...(registryValues.length ? { registry: registryValues[0] } : {}), selector_kind: channel ? 'dist_tag' : selector ? 'pinned_version' : 'unspecified' };
29
+ }
30
+ function platformOrigin(value) {
31
+ const url = new URL(value);
32
+ if (url.protocol !== 'https:' || url.username || url.password || url.pathname !== '/' || url.search || url.hash) throw new Error('--platform must be a credential-free HTTPS origin');
33
+ return url.origin;
34
+ }
35
+
36
+ function hostConnectionOptions(host) {
37
+ if (host === 'codex') return { startup_timeout_sec: 120 };
38
+ if (host === 'claude') return { type: 'stdio' };
39
+ if (host === 'zcode') return { type: 'stdio', timeoutMs: 120000 };
40
+ if (host === 'kimi') return { enabled: true, startupTimeoutMs: 120000 };
41
+ if (host === 'dsh') return {};
42
+ if (host === 'trae') return {command:'node'};
43
+ if (['qoder-cn','qoder','comate','opencode'].includes(host)) return {};
44
+ if (host === 'qwen') return { timeout: 120000 };
45
+ return { type: 'stdio', timeout: 120000 };
46
+ }
47
+
48
+ function hostRuntimeEnvironment(host, existing = {}) {
49
+ // TRAE documents a single executable name without spaces. Pin its lookup to
50
+ // the Node used for installation; the launcher path remains an args element.
51
+ if(host !== 'trae') return {};
52
+ const directory=path.dirname(process.execPath), same=(value)=>process.platform==='win32'?value.toLowerCase()===directory.toLowerCase():value===directory;
53
+ const rest=(existing.PATH ?? existing.Path ?? process.env.PATH ?? process.env.Path ?? '').split(path.delimiter).filter(value=>value&&!same(value));
54
+ return {PATH:[directory,...rest].join(path.delimiter)};
55
+ }
56
+
57
+ export async function installHosts({ ide, workspace, platform, packageRoot, home = os.homedir(), codexHome, hostOptions = {},
58
+ runtimeRoot = path.join(getAppDataRoot(), 'runtimes'), stateRoot = path.join(path.dirname(runtimeRoot), 'installations'),
59
+ registry, channel, updates, onlyIfMissing = false, materialize = stageRuntime, probe = probeRuntime }) {
60
+ const targets = installTargets(ide);
61
+ if (hostOptions.configPath && targets.length !== 1) throw new Error('--host-config requires exactly one --ide');
62
+ if (workspace !== undefined && !path.isAbsolute(workspace)) throw new Error('--workspace must be absolute');
63
+ if (platform !== undefined) platform = platformOrigin(platform);
64
+ if (updates !== undefined && !['auto', 'off'].includes(updates)) throw new Error('--updates must be auto or off');
65
+ const pkg = JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8'));
66
+ const desiredSkill = await readFile(path.join(packageRoot, 'resources/craft-create/SKILL.md'), 'utf8');
67
+ const desiredUpdateSkill = await optionalFile(path.join(packageRoot, 'resources/craft-update/SKILL.md'));
68
+ if (!desiredSkill.includes(bootstrapMarker)) throw new Error('Craft bootstrap Skill missing from distribution');
69
+ if (desiredUpdateSkill !== null && !desiredUpdateSkill.includes('<!-- craft-mcp:update:v1 -->')) throw new Error('Craft update Skill has an invalid distribution marker');
70
+ await mkdir(runtimeRoot, { recursive: true });
71
+ const targetPaths = new Map(targets.map(host => [host, hostPaths(home, host, codexHome, hostOptions)]));
72
+ async function readPlans() {
73
+ const plans = [];
74
+ for (const host of targets) {
75
+ const paths = targetPaths.get(host);
76
+ await assertPlainPath(paths.config); await assertPlainPath(paths.skill); await assertPlainPath(paths.updateSkill);
77
+ assertDshSharedScope(paths);
78
+ await assertHostConfigScope(paths.config,host,paths.configPeers);
79
+ const original = await optionalFile(paths.config), existingSkill = await optionalFile(paths.skill);
80
+ let configInput = original ?? '', fallbackSnapshot;
81
+ if (paths.fallbackConfig) {
82
+ await assertPlainPath(paths.fallbackConfig);
83
+ const fallback = await optionalFile(paths.fallbackConfig);
84
+ configInput = importZcodeFallback(configInput, fallback);
85
+ if (configInput !== (original ?? '')) fallbackSnapshot = { file: paths.fallbackConfig, text: fallback };
86
+ }
87
+ const existingUpdateSkill = await optionalFile(paths.updateSkill);
88
+ if (existingSkill && !existingSkill.includes(bootstrapMarker)) throw new Error('User-owned craft-create Skill preserved; rename it before installing: ' + paths.skill);
89
+ if (desiredUpdateSkill && existingUpdateSkill && !existingUpdateSkill.includes('<!-- craft-mcp:update:v1 -->')) throw new Error('User-owned craft-update Skill preserved; rename it before installing: ' + paths.updateSkill);
90
+ const registrations = craftRegistrations(configInput, host);
91
+ if (onlyIfMissing && registrations.length) throw new Error(host + ': Craft was configured while project setup was running; preserve the registration and inspect it again');
92
+ if (registrations.length > 1) throw new Error(host + ': Multiple Craft registrations found; preserve separate environments and select one installation before updating');
93
+ const previousName = registrations[0]?.name ?? 'craft', old = registrations[0]?.connection;
94
+ const legacySource = legacyNpmSource(old, pkg.name);
95
+ const statePath = installationPath(stateRoot, host, paths.config);
96
+ const previousSnapshot = old?.env?.CRAFT_INSTALLATION_FILE ? await readInstallationSnapshot(old.env.CRAFT_INSTALLATION_FILE) : null;
97
+ const previousState = previousSnapshot?.state;
98
+ if (previousState && (previousState.host !== host || path.resolve(previousState.config) !== path.resolve(paths.config))) throw new Error('Craft installation state belongs to another host configuration');
99
+ const stateBefore = previousSnapshot && path.resolve(old.env.CRAFT_INSTALLATION_FILE) === path.resolve(statePath.file) ? previousSnapshot.text : await optionalFile(statePath.file);
100
+ let previousRuntime = previousState?.target;
101
+ if (!previousRuntime && old?.args?.[0] && path.isAbsolute(old.args[0])) {
102
+ const oldRoot = path.resolve(path.dirname(old.args[0]), '..');
103
+ try { previousRuntime = await getRuntimeIdentity(oldRoot); }
104
+ catch (error) { if (error.code !== 'ENOENT') throw error; }
105
+ }
106
+ if (!previousRuntime) {
107
+ const pinned = old?.args?.find(value => typeof value === 'string' && /^@craft_eco\/craft-mcp@\d/.test(value));
108
+ if (pinned) previousRuntime = { version: pinned.slice('@craft_eco/craft-mcp@'.length) };
109
+ }
110
+ const workspaceIndex = old?.args?.indexOf('--workspace') ?? -1;
111
+ const games = workspace ?? (workspaceIndex >= 0 ? old.args[workspaceIndex + 1] : old?.env?.CLIENT_WORKSPACE_ROOT) ?? path.join(home, 'CraftGames');
112
+ if (!path.isAbsolute(games)) throw new Error('Configured Craft workspace must be absolute');
113
+ const origin = platformOrigin(platform ?? old?.env?.CRAFT_WEB_URL ?? pkg.craft?.platform);
114
+ plans.push({ host, paths, original, configInput, fallbackSnapshot, existingSkill, existingUpdateSkill, previousName, previousRuntime, previousState, legacySource, statePath, stateBefore, workspace: path.resolve(games), platform: origin });
115
+ }
116
+ return plans;
117
+ }
118
+ // Re-read everything that can affect a host before a short commit. Receipt
119
+ // changes are independent and are retained instead of invalidating a plan.
120
+ async function verifyPlans(plans) {
121
+ for (const plan of plans) {
122
+ for (const [file, expected] of [[plan.paths.config, plan.original], [plan.paths.skill, plan.existingSkill], [plan.paths.updateSkill, plan.existingUpdateSkill]]) {
123
+ await assertPlainPath(file);
124
+ if (await optionalFile(file) !== expected) throw installationChanged('Craft host files changed while the candidate was prepared');
125
+ }
126
+ assertDshSharedScope(plan.paths);
127
+ await assertHostConfigScope(plan.paths.config,plan.host,plan.paths.configPeers);
128
+ if (plan.fallbackSnapshot && await optionalFile(plan.fallbackSnapshot.file) !== plan.fallbackSnapshot.text) throw new Error('ZCode fallback MCP configuration changed during installation; retry without changing the fallback');
129
+ const text = await optionalFile(plan.statePath.file);
130
+ if (text !== plan.stateBefore) {
131
+ const latest = text === null ? null : await readInstallation(plan.statePath.file);
132
+ if (!latest || !plan.previousState || !sameInstallation(latest, plan.previousState)) throw installationChanged();
133
+ plan.previousState = latest;
134
+ plan.stateBefore = text;
135
+ }
136
+ // A migrated installation can still point at a distinct historical file.
137
+ const oldFile = craftConfig(plan.configInput, plan.host, plan.previousName)?.env?.CRAFT_INSTALLATION_FILE;
138
+ if (oldFile && path.resolve(oldFile) !== path.resolve(plan.statePath.file)) {
139
+ const latest = await readInstallation(oldFile);
140
+ if (!sameInstallation(latest, plan.previousState)) throw installationChanged();
141
+ plan.previousState = latest;
142
+ }
143
+ }
144
+ }
145
+ const initialPlans = await readPlans();
146
+ const candidate = await prepareRuntimeCandidate(runtimeRoot, staging => materialize(packageRoot, staging));
147
+ const verifiedCache = new Map();
148
+ try {
149
+ for (let attempt = 0; attempt < 4; attempt++) {
150
+ let plans, stateLocks = [], release;
151
+ try {
152
+ plans = attempt === 0 ? initialPlans : await readPlans();
153
+ const verifiedByHost = new Map();
154
+ for (const plan of plans) {
155
+ requireForwardVersion(candidate.identity, plan.previousRuntime);
156
+ const old = craftConfig(plan.configInput, plan.host, plan.previousName);
157
+ const connection = { ...old, command: process.execPath, args: [candidate.identity.entry, '--workspace', plan.workspace],
158
+ env: { ...old?.env, ...hostRuntimeEnvironment(plan.host,old?.env), CRAFT_CLIENT_IDE: plan.host, CRAFT_WEB_URL: plan.platform, CLIENT_WORKSPACE_ROOT: plan.workspace,
159
+ CRAFT_INSTALLATION_FILE: plan.statePath.file, CRAFT_RUNTIME_REVISION: candidate.identity.build_id }, ...hostConnectionOptions(plan.host) };
160
+ const expected = { version: candidate.identity.version, build_id: candidate.identity.build_id, host: plan.host, workspace: plan.workspace, platform: plan.platform };
161
+ const key = JSON.stringify({ connection, expected });
162
+ const verified = verifiedCache.get(key) ?? await probe(connection, expected);
163
+ if (verified.runtime?.activation_mode !== activationMode) throw new Error('Craft runtime requires a legacy frontend; install a next_mcp_start distribution');
164
+ verifiedCache.set(key, verified);
165
+ verifiedByHost.set(plan.host, verified);
166
+ }
167
+ if (!sameRuntimeIdentity(await getRuntimeIdentity(candidate.identity.package_root), candidate.identity)) throw new Error('Craft candidate changed during verification; installation refused');
168
+ await refreshRuntimeCandidate(candidate);
169
+ const lockPaths = [...new Set(plans.flatMap(plan => [plan.statePath.file, craftConfig(plan.configInput, plan.host, plan.previousName)?.env?.CRAFT_INSTALLATION_FILE].filter(Boolean)).map(file => path.resolve(file)))].sort();
170
+ for (const file of lockPaths) {
171
+ await assertPlainPath(file); await mkdir(path.dirname(file), { recursive: true });
172
+ stateLocks.push(await lockfile.lock(file, { realpath: false, stale: 120000, retries: 0 }));
173
+ }
174
+ // Never hold installation-state locks while waiting on launcher or GC.
175
+ release = await lockfile.lock(runtimeRoot, { stale: 120000, retries: 0 });
176
+ await verifyPlans(plans);
177
+ const runtime = await publishRuntimeCandidate(candidate);
178
+ const identity = { package: runtime.package, version: runtime.version, build_id: runtime.build_id, package_root: runtime.package_root, entry: runtime.entry };
179
+ const changes = [], results = [];
180
+ for (const plan of plans) {
181
+ requireForwardVersion(identity, plan.previousRuntime);
182
+ const source = updateSource(pkg, { registry: registry ?? (!plan.previousState ? plan.legacySource?.registry : undefined), channel: channel ?? (!plan.previousState ? plan.legacySource?.channel : undefined) }, plan.previousState?.source);
183
+ const migration = plan.previousState?.migration ?? (plan.legacySource ? { from_server: plan.previousName, ...plan.legacySource } : undefined);
184
+ const launcherPlan = await planLauncher(plan.statePath.file, plan.previousState?.launcher, identity.package_root);
185
+ const state = { schema: 2, activation_mode: activationMode, id: plan.statePath.id, host: plan.host, server_id: 'craft', config: plan.paths.config,
186
+ launcher: launcherPlan.launcher,
187
+ workspace: plan.workspace, platform: plan.platform, runtime_root: runtimeRoot, source,
188
+ ...(plan.paths.configPeers?{config_peers:plan.paths.configPeers}:{}),
189
+ ...(migration ? { migration } : {}),
190
+ skills: { 'craft-create': plan.paths.skill, ...(desiredUpdateSkill ? { 'craft-update': plan.paths.updateSkill } : {}) },
191
+ policy: { mode: updates ?? plan.previousState?.policy.mode ?? 'auto', offline: 'allow-existing' }, anchor: identity, target: identity, skills_runtime: skillRuntimeIdentity(identity) };
192
+ if (plan.previousState?.connection_verification && sameRuntimeIdentity(identity, plan.previousState.target) && plan.workspace === plan.previousState.workspace && plan.platform === plan.previousState.platform) state.connection_verification = plan.previousState.connection_verification;
193
+ // Reinstalling the same build must not reset check receipts or touch files.
194
+ const priorComparable = plan.previousState && { ...plan.previousState };
195
+ if (priorComparable) { delete priorComparable.updated_at; delete priorComparable.last_check; }
196
+ const same = priorComparable && JSON.stringify(priorComparable) === JSON.stringify(state);
197
+ const desiredState = same ? plan.previousState : { ...state, updated_at: new Date().toISOString() };
198
+ const connection = { command: process.execPath, args: [launcherPlan.launcher.entry, '--workspace', plan.workspace],
199
+ env: { ...hostRuntimeEnvironment(plan.host,craftConfig(plan.configInput,plan.host,plan.previousName)?.env), CRAFT_CLIENT_IDE: plan.host, CRAFT_WEB_URL: plan.platform, CLIENT_WORKSPACE_ROOT: plan.workspace, CRAFT_INSTALLATION_FILE: plan.statePath.file, CRAFT_RUNTIME_REVISION: identity.build_id },
200
+ ...hostConnectionOptions(plan.host) };
201
+ const configured = craftConfig(plan.configInput, plan.host, plan.previousName);
202
+ // Some hosts omit an enabled flag when saving their configuration. Do not
203
+ // reinsert defaults into an already enabled registration.
204
+ const alreadyEnabled = configured && configured.disabled !== true && configured.enabled !== false && configured.enable !== false;
205
+ const updated = mergeConfig(plan.configInput, plan.host, connection, { previousName: plan.previousName, enable: !alreadyEnabled });
206
+ const verified = verifiedByHost.get(plan.host);
207
+ changes.push({ file: plan.paths.skill, before: plan.existingSkill, after: desiredSkill });
208
+ if (desiredUpdateSkill) changes.push({ file: plan.paths.updateSkill, before: plan.existingUpdateSkill, after: desiredUpdateSkill });
209
+ // A host may react as soon as its config changes. Make the state and
210
+ // managed entrypoints available before exposing the new launch command.
211
+ changes.push(launcherPlan.change, { file: plan.statePath.file, before: plan.stateBefore, after: same ? plan.stateBefore : JSON.stringify(desiredState, null, 2) + '\n' },
212
+ { file: plan.paths.config, before: plan.original, after: updated });
213
+ results.push({ host: plan.host, ...plan.paths, installation: plan.statePath.file, launcher: state.launcher, source, policy: state.policy, ...(migration ? { migration } : {}), ...(plan.previousName !== 'craft' ? { migrated_from: plan.previousName } : {}), ...(plan.fallbackSnapshot ? { imported_from: plan.fallbackSnapshot.file } : {}), verified,
214
+ activation_mode: activationMode, reconnect_required: true, activation: { status: 'pending_connection_verification', expected: identity },
215
+ connection_handoff: connectionHandoff({host:plan.host,target:identity,workspace:plan.workspace,platform:plan.platform,intent:'install'}) });
216
+ }
217
+ const written = await commitFiles(changes);
218
+ return { runtime, hosts: results, ...written,
219
+ next: 'The installed package loads at the next MCP start or user-requested reconnect. Verify the actual runtime version/build_id, then prepare the current project to update its context and Skills. Standalone probes do not confirm host activation.' };
220
+ } catch (error) {
221
+ if (!['ELOCKED', 'INSTALLATION_CHANGED'].includes(error.code) || attempt === 3) throw error;
222
+ } finally {
223
+ try { await release?.(); } finally { for (const unlock of stateLocks.reverse()) await unlock(); }
224
+ }
225
+ await new Promise(resolve => setTimeout(resolve, 100 * (attempt + 1)));
226
+ }
227
+ } finally { await disposeRuntimeCandidate(candidate); }
228
+ }
229
+
230
+ async function verifyInstalledSkills(installation, paths, connection, snapshot) {
231
+ const entries = installation?.skills ? installedSkillEntries(installation) : [{ name: 'craft-create', file: paths.skill, marker: bootstrapMarker }];
232
+ const contents = new Map();
233
+ for (const { name, file, marker } of entries) {
234
+ await assertPlainPath(file);
235
+ const content = snapshot ? snapshot.get(file) : await optionalFile(file);
236
+ if (!content?.includes(marker)) throw new Error('Craft ' + name + ' Skill missing or not managed by installer: ' + file);
237
+ contents.set(name, content);
238
+ }
239
+ const candidates = installation ? installation.skills_runtime ? [installation.skills_runtime] : [installation.target, installation.anchor] : [await getRuntimeIdentity(path.resolve(path.dirname(connection.args[0]), '..'))];
240
+ for (const candidate of candidates) {
241
+ const actual = await getRuntimeIdentity(candidate.package_root);
242
+ if (actual.package !== candidate.package || actual.version !== candidate.version || actual.build_id !== candidate.build_id) throw new Error('Installed Skill runtime files differ from their recorded identity');
243
+ let matches = true;
244
+ for (const { name, marker } of entries) {
245
+ const expected = await optionalFile(path.join(candidate.package_root, 'resources', name, 'SKILL.md'));
246
+ if (!expected?.includes(marker) || contents.get(name) !== expected) { matches = false; break; }
247
+ }
248
+ if (matches) return { status: 'verified', runtime: skillRuntimeIdentity(candidate), managed: entries.map(entry => entry.name) };
249
+ }
250
+ // Pre-receipt installations can have activated B while anchor A and pending C
251
+ // remain on disk. Never call B corrupt or claim its identity is verified.
252
+ if (installation && !installation.skills_runtime) return { status: 'legacy_unverified', managed: entries.map(entry => entry.name), note: 'Managed Skill markers are present, but their runtime identity was not recorded by this older installation. Complete activation on the actual connection to synchronize and verify them.' };
253
+ throw new Error('Craft managed Skills differ from the recorded installed Skill runtime; run install again');
254
+ }
255
+
256
+ export async function doctorHosts({ ide, home = os.homedir(), codexHome, hostOptions = {}, probe = probeRuntime }) {
257
+ const results = [];
258
+ for (const host of installTargets(ide)) {
259
+ for (let attempt = 0; attempt < 4; attempt++) {
260
+ try {
261
+ const paths = hostPaths(home, host, codexHome, hostOptions);
262
+ await assertHostConfigScope(paths.config,host,paths.configPeers);
263
+ await assertPlainPath(paths.config);
264
+ assertDshSharedScope(paths);
265
+ const configText = await optionalFile(paths.config) ?? '';
266
+ const connection = craftConfig(configText, host);
267
+ if (!connection?.command || connection.env?.CRAFT_CLIENT_IDE !== host) throw new Error(host + ': Craft installation missing or host marker incorrect; run install --ide ' + host);
268
+ if (connection.disabled === true || connection.enabled === false || connection.enable === false) throw new Error(host + ': Craft MCP is disabled');
269
+ let installation = null, skillsVerification, verificationError;
270
+ const file = connection.env.CRAFT_INSTALLATION_FILE, skillSnapshots = new Map();
271
+ if (file) {
272
+ const unlock = await lockfile.lock(file, { stale: 120000, retries: 0 });
273
+ try {
274
+ if (await optionalFile(paths.config) !== configText) throw installationChanged();
275
+ installation = await readInstallation(file);
276
+ const entries = installation.skills ? installedSkillEntries(installation) : [{ file: paths.skill }];
277
+ for (const entry of entries) {
278
+ await assertPlainPath(entry.file);
279
+ skillSnapshots.set(entry.file, await optionalFile(entry.file));
280
+ }
281
+ await verifyLauncher(installation, file, connection);
282
+ } finally { await unlock(); }
283
+ }
284
+ // Hash immutable package content outside the state lock. Use captured
285
+ // Skill bytes, then distinguish a changed snapshot from real corruption.
286
+ try { skillsVerification = await verifyInstalledSkills(installation, paths, connection, file ? skillSnapshots : undefined); }
287
+ catch (error) { verificationError = error; }
288
+ async function stableSnapshot() {
289
+ if (!file) {
290
+ if (await optionalFile(paths.config) !== configText) throw installationChanged();
291
+ return;
292
+ }
293
+ const unlock = await lockfile.lock(file, { stale: 120000, retries: 0 });
294
+ try {
295
+ const latest = await readInstallation(file);
296
+ if (!sameInstallation(latest, installation) || await optionalFile(paths.config) !== configText) throw installationChanged();
297
+ for (const [skill, text] of skillSnapshots) if (await optionalFile(skill) !== text) throw installationChanged('Craft Skills changed during diagnosis');
298
+ await verifyLauncher(latest, file, connection);
299
+ installation = latest;
300
+ } finally { await unlock(); }
301
+ }
302
+ await stableSnapshot();
303
+ if (verificationError) throw verificationError;
304
+ const skillsPending = Boolean(installation && skillsVerification.runtime?.build_id !== installation.target.build_id);
305
+ const checkConnection = installation && !installation.launcher ? { ...connection, args: [installation.target.entry, '--workspace', installation.workspace] } : connection;
306
+ let verified, probeError;
307
+ try { verified = await probe(checkConnection, { host, ...(installation ? { version: installation.target.version, build_id: installation.target.build_id, workspace: installation.workspace, platform: installation.platform } : {}) }); }
308
+ catch (error) { probeError = error; }
309
+ // The launcher may observe a newer target while a diagnostic probe is
310
+ // starting. Re-read all scope/config fields on the next bounded attempt.
311
+ await stableSnapshot();
312
+ if (probeError) throw probeError;
313
+ results.push({ host, ...paths, entry: connection.args[0], target: installation?.target, skills_pending_activation: skillsPending, skills_verification: skillsVerification, verified });
314
+ break;
315
+ } catch (error) {
316
+ if (!['ELOCKED', 'INSTALLATION_CHANGED'].includes(error.code) || attempt === 3) throw error;
317
+ }
318
+ await new Promise(resolve => setTimeout(resolve, 100 * (attempt + 1)));
319
+ }
320
+ }
321
+ return { hosts: results, note: results.some(item => item.skills_verification.status !== 'verified')
322
+ ? 'Candidate MCP protocol verified; legacy global Skill identity remains unverified. Complete activation on the actual connection, then run doctor again. Host trust and Skill discovery require host verification.'
323
+ : 'MCP protocol and installed files verified. Host trust, Skill discovery and session recovery require a new session in the host.' };
324
+ }
325
+
326
+ export async function runIntegrationCommand(args, packageRoot) {
327
+ const [command, ...rest] = args, options = {};
328
+ for (let i = 0; i < rest.length; i += 2) {
329
+ const name = rest[i].replace(/^--/, '');
330
+ if (!rest[i].startsWith('--') || !['ide', 'host-config', 'trae-region', ...(command === 'install' ? ['workspace', 'platform', 'registry', 'channel', 'updates'] : [])].includes(name) || !rest[i + 1] || Object.hasOwn(options, name)) throw new Error('Invalid or repeated option. Use craft-mcp --help.');
331
+ options[name] = rest[i + 1];
332
+ }
333
+ options.codexHome = process.env.CODEX_HOME;
334
+ options.hostOptions = hostCommandOptions(options);
335
+ const result = command === 'install' ? await installHosts({ ...options, packageRoot }) : await doctorHosts(options);
336
+ process.stdout.write(JSON.stringify(result, null, 2) + '\n');
337
+ }