@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,225 +1,331 @@
1
- import path from 'node:path';
2
- import { mkdir } from 'node:fs/promises';
3
- import lockfile from 'proper-lockfile';
4
- import { readInstallation, readInstallationSnapshot, activationStatus, registryOrigin, installedSkillEntries, skillRuntimeIdentity, sameRuntimeIdentity, activationMode } from './installation-state.mjs';
5
- import { compareVersions, requireForwardVersion, parseVersion } from './version-policy.mjs';
6
- import { stageRegistryRuntime, getRuntimeIdentity, probeRuntime } from './runtime.mjs';
7
- import { optionalFile, assertPlainPath, commitFiles } from './files.mjs';
8
- import { hostPaths, hostEnvironment, installTargets } from './hosts.mjs';
9
- import { craftConfig, mergeConfig } from './config.mjs';
10
- import { assertDshSharedScope } from './dsh-config.mjs';
11
- import { connectionHandoff } from './connection-handoff.mjs';
12
- import os from 'node:os';
13
-
14
- export { readInstallation } from './installation-state.mjs';
15
- const pending = new Map();
16
- const receiptLifetime = 5 * 60 * 1000;
17
-
18
- function result(state, current, status, extra = {}) {
19
- return { status, installation_id: state.id, source: state.source, policy: state.policy,
20
- current, target: state.target, activation: activationStatus(current, state.target),
21
- activation_mode: state.activation_mode ?? 'legacy_front', migration_required: state.schema === 1,
22
- activation_required: false, reconnect_required: !sameRuntimeIdentity(current, state.target), explicitly_not_started: true, ...extra };
23
- }
24
-
25
- export async function readUpdateStatus({ installationFile, current }) {
26
- if (!installationFile) return { status: 'unmanaged', current, activation_required: false, note: 'Run the standard Craft installer once to enable automatic updates.' };
27
- try {
28
- const state = await readInstallation(installationFile);
29
- const activation = activationStatus(current, state.target);
30
- return result(state, current, state.schema === 1 ? 'migration_required' : activation.status === 'active_verified' ? 'current' : activation.status, { last_check: state.last_check, can_continue: state.schema === 2 && activation.status === 'active_verified' });
31
- } catch (error) { return { status: 'error', code: 'invalid_installation', message: error.message, current, can_continue: false, activation_required: false }; }
32
- }
33
-
34
- export async function queryRegistry(source, { fetchImpl = fetch, timeoutMs = 15000 } = {}) {
35
- const registry = registryOrigin(source.registry);
36
- const url = new URL(encodeURIComponent(source.package) + '/' + encodeURIComponent(source.channel), registry);
37
- const response = await fetchImpl(url, { headers: { accept: 'application/json' }, signal: AbortSignal.timeout(timeoutMs) });
38
- if (!response.ok) throw Object.assign(new Error('npm version check failed (HTTP ' + response.status + ')'), { code: response.status >= 400 && response.status < 500 && ![408, 429].includes(response.status) ? 'INVALID_REGISTRY_METADATA' : 'REGISTRY_UNAVAILABLE' });
39
- let data;
40
- try { data = await response.json(); if (data.name !== source.package) throw new Error('npm returned a different package identity'); parseVersion(data.version); }
41
- catch { throw Object.assign(new Error('npm returned invalid package identity metadata'), { code: 'INVALID_REGISTRY_METADATA' }); }
42
- const integrity = data.dist?.integrity ?? (data.dist?.shasum && /^[a-f0-9]{40}$/.test(data.dist.shasum) ? 'sha1-' + Buffer.from(data.dist.shasum, 'hex').toString('base64') : undefined);
43
- if (!integrity || !String(integrity).split(/\s+/).some(value => /^(sha512|sha384|sha256|sha1)-[A-Za-z0-9+/]+={0,2}$/.test(value))) throw Object.assign(new Error('npm package integrity metadata is missing or invalid'), { code: 'INVALID_REGISTRY_METADATA' });
44
- return { package: data.name, version: data.version, integrity, node: data.engines?.node ?? null };
45
- }
46
-
47
- function within(root, file) {
48
- const relative = path.relative(path.resolve(root), path.resolve(file));
49
- return relative === '' || (!relative.startsWith('..' + path.sep) && relative !== '..' && !path.isAbsolute(relative));
50
- }
51
-
52
- async function candidateSkills(state, identity) {
53
- // Skill locations are explicit installer-owned destinations. Do not infer a
54
- // user's home from a custom CODEX_HOME or rewrite unrelated host directories.
55
- const changes = [];
56
- for (const { name, file, marker } of installedSkillEntries(state)) {
57
- await assertPlainPath(file);
58
- const desired = await optionalFile(path.join(identity.package_root, 'resources', name, 'SKILL.md'));
59
- if (desired === null) throw new Error('Updated runtime is missing the managed ' + name + ' Skill');
60
- if (!desired.includes(marker)) throw new Error('Updated runtime has an invalid managed Skill marker');
61
- const before = await optionalFile(file);
62
- if (before && !before.includes(marker)) throw new Error('User-owned Skill preserved: ' + file);
63
- changes.push({ file, before, after: desired });
64
- }
65
- return changes;
66
- }
67
-
68
- export async function confirmActiveInstallation({ installationFile, current }) {
69
- if (!current?.instance_id) throw new Error('An actual runtime instance is required to confirm the installation');
70
- const unlock = await lockfile.lock(installationFile, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
71
- try {
72
- const { state, text: before } = await readInstallationSnapshot(installationFile);
73
- if (state.schema !== 2 || state.activation_mode !== activationMode) throw new Error('Legacy Craft installation requires the standard installer before reconnecting');
74
- if (activationStatus(current, state.target).status !== 'active_verified') throw new Error('The current connection does not match the configured update target');
75
- if (!sameRuntimeIdentity(await getRuntimeIdentity(current.package_root), state.target)) throw new Error('The running package files do not match the configured update target');
76
- const skills = await candidateSkills(state, current);
77
- if (skills.some(change => change.before !== change.after)) throw new Error('Installed global Skills differ from the configured runtime; run install again');
78
- const previous = state.connection_verification;
79
- const receipt = previous?.instance_id === current.instance_id ? previous : { version: current.version, build_id: current.build_id, instance_id: current.instance_id, confirmed_at: new Date().toISOString() };
80
- const written = await commitFiles([{ file: installationFile, before, after: receipt === previous ? before : JSON.stringify({ ...state, connection_verification: receipt }, null, 2) + '\n' }]);
81
- return { status: 'active_verified', ...receipt, ...written, scope: 'current_connection' };
82
- } finally { await unlock(); }
83
- }
84
-
85
- async function hostUpdate(state, installationFile, identity) {
86
- await assertPlainPath(state.config);
87
- if (state.host === 'dsh') assertDshSharedScope({ dshHome: path.dirname(state.config) });
88
- const before = await optionalFile(state.config);
89
- if (before === null) throw new Error('Craft host configuration is missing; run install again');
90
- const existing = craftConfig(before, state.host, state.server_id);
91
- const samePath = (a, b) => typeof a === 'string' && typeof b === 'string' && (process.platform === 'win32' ? path.resolve(a).toLowerCase() === path.resolve(b).toLowerCase() : path.resolve(a) === path.resolve(b));
92
- const workspaceIndex = existing?.args?.indexOf('--workspace') ?? -1;
93
- if (!existing || !samePath(existing.env?.CRAFT_INSTALLATION_FILE, installationFile) || existing.env?.CRAFT_CLIENT_IDE !== state.host ||
94
- !samePath(workspaceIndex >= 0 ? existing.args[workspaceIndex + 1] : existing.env?.CLIENT_WORKSPACE_ROOT, state.workspace) ||
95
- new URL(existing.env?.CRAFT_WEB_URL).origin !== new URL(state.platform).origin) throw new Error('Craft host configuration scope changed; run install with the intended scope');
96
- const connection = { command: process.execPath, args: [identity.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace, CRAFT_INSTALLATION_FILE: installationFile } };
97
- return { file: state.config, before, after: mergeConfig(before, state.host, connection, { previousName: state.server_id, enable: false }) };
98
- }
99
-
100
- async function checkLocked({ installationFile, current, intent, requestKey, projectCompatibility, lookup, materialize, probe }) {
101
- const snapshot = await readInstallationSnapshot(installationFile), before = snapshot.text;
102
- let state = snapshot.state;
103
- if (current.package !== state.source.package) return result(state, current, 'error', { code: 'package_mismatch', can_continue: false });
104
- try { requireForwardVersion(state.target, current); }
105
- catch (error) { return result(state, current, 'error', { code: 'target_not_forward', message: error.message, can_continue: false }); }
106
- let pendingIncompatible;
107
- const activationPending = !sameRuntimeIdentity(current, state.target);
108
- if (activationPending) {
109
- try { if (projectCompatibility) await projectCompatibility(state.target.package_root); }
110
- catch (error) { pendingIncompatible = error.message; }
111
- if (!pendingIncompatible && intent !== 'inspect') return result(state, current, 'pending_reconnect', { reconnect_required: true, can_continue: false });
112
- }
113
- let currentIncompatible = pendingIncompatible;
114
- if (!currentIncompatible) {
115
- try { if (projectCompatibility) await projectCompatibility(current.package_root); }
116
- catch (error) { currentIncompatible = error.message; }
117
- }
118
- const keepCurrent = (status, extra = {}) => result(state, current, currentIncompatible ? 'incompatible' : status,
119
- { ...extra, can_continue: state.schema === 2 && !activationPending && !currentIncompatible && extra.can_continue !== false, ...(currentIncompatible ? { underlying_status: status, message: currentIncompatible } : {}) });
120
- if (state.policy.mode === 'off' && !['inspect', 'update'].includes(intent)) return keepCurrent('disabled');
121
- let remote, checkedAt;
122
- const last = state.last_check;
123
- if (requestKey && last?.request_key === requestKey && last.remote && Date.now() - Date.parse(last.checked_at) < receiptLifetime && last.source_key === JSON.stringify(state.source)) {
124
- remote = last.remote; checkedAt = last.checked_at;
125
- } else {
126
- try { remote = await lookup(state.source); checkedAt = new Date().toISOString(); }
127
- catch (error) {
128
- if (error.code === 'INVALID_REGISTRY_METADATA') return result(state, current, 'error', { code: 'invalid_registry_metadata', message: error.message, can_continue: false });
129
- // Network failure is an unknown remote state, never proof of latest.
130
- return keepCurrent('offline', { checked_at: new Date().toISOString(), remote_status: 'unknown', message: error.message, can_continue: state.schema === 2 && !currentIncompatible && !activationPending && state.policy.offline === 'allow-existing' });
131
- }
132
- }
133
- try {
134
- if (remote.package !== state.source.package) throw new Error('npm package identity mismatch');
135
- parseVersion(remote.version);
136
- } catch (error) { return result(state, current, 'error', { code: 'invalid_registry_identity', message: error.message, can_continue: false }); }
137
- const receipt = { checked_at: checkedAt, ...(requestKey ? { request_key: requestKey } : {}), source_key: JSON.stringify(state.source), remote };
138
- // A staged target can be unsuitable for this particular project. Keep it as
139
- // the minimum version while looking for a newer compatible replacement.
140
- const comparison = compareVersions(remote.version, state.target.version);
141
- if (comparison === 0 && state.target.origin?.kind === 'npm' && state.target.origin.registry === state.source.registry && state.target.origin.integrity !== remote.integrity) {
142
- return result(state, current, 'error', { code: 'same_version_integrity_changed', checked_at: checkedAt, remote, message: 'The registry reports different bytes for an installed package version; automatic replacement refused', can_continue: false });
143
- }
144
- if (comparison <= 0 || intent === 'inspect') {
145
- const after = { ...state, last_check: receipt };
146
- await commitFiles([{ file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }]);
147
- state = after;
148
- if (currentIncompatible && comparison <= 0) return keepCurrent(comparison < 0 ? 'local_ahead' : 'current', { checked_at: checkedAt, remote });
149
- const remoteStatus = comparison < 0 ? 'local_ahead' : comparison === 0 ? 'current' : 'available';
150
- return result(after, current, state.schema === 1 && comparison <= 0 ? 'migration_required' : activationPending && comparison <= 0 ? 'pending_reconnect' : remoteStatus, { checked_at: checkedAt, remote,
151
- ...(activationPending ? { remote_status: remoteStatus } : {}),
152
- ...(comparison === 0 ? { remote_build_status: state.target.origin?.integrity === remote.integrity ? 'integrity_matches' : 'not_compared_local_install' } : {}),
153
- ...(currentIncompatible ? { current_compatibility: { status: 'incompatible', message: currentIncompatible } } : {}), can_continue: state.schema === 2 && !currentIncompatible && !activationPending });
154
- }
155
- const runtimeRoot = state.runtime_root;
156
- if (!path.isAbsolute(runtimeRoot ?? '')) return result(state, current, 'error', { code: 'invalid_runtime_root', can_continue: false });
157
- await mkdir(runtimeRoot, { recursive: true });
158
- const unlock = await lockfile.lock(runtimeRoot, { stale: 120000, retries: { retries: 20, minTimeout: 250, maxTimeout: 1000 } });
159
- try {
160
- const runtime = await materialize(state.source, remote, runtimeRoot);
161
- const identity = await getRuntimeIdentity(runtime.package_root ?? path.resolve(path.dirname(runtime.entry), '..'));
162
- if (!within(runtimeRoot, identity.package_root) || identity.package !== state.source.package || identity.version !== remote.version) throw new Error('Candidate runtime identity/path mismatch');
163
- requireForwardVersion(identity, state.target);
164
- if (projectCompatibility) {
165
- try { await projectCompatibility(identity.package_root); }
166
- catch (error) { return result(state, current, 'incompatible', { checked_at: checkedAt, remote, message: error.message, can_continue: false }); }
167
- }
168
- const verified = await probe({ command: process.execPath, args: [identity.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace } },
169
- { version: identity.version, build_id: identity.build_id, host: state.host, workspace: state.workspace, platform: state.platform });
170
- if (verified.runtime?.activation_mode !== activationMode) throw new Error('Candidate runtime does not support activation at the next MCP start');
171
- const skillChanges = await candidateSkills(state, identity), configChange = await hostUpdate(state, installationFile, identity);
172
- const target = { ...identity, origin: { kind: 'npm', registry: state.source.registry, integrity: remote.integrity } };
173
- const after = { ...state, schema: 2, activation_mode: activationMode, anchor: identity, target, skills_runtime: skillRuntimeIdentity(identity), last_check: receipt, updated_at: new Date().toISOString() };
174
- delete after.connection_verification;
175
- await commitFiles([...skillChanges, { file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }, configChange]);
176
- state = after;
177
- return result(state, current, 'pending_reconnect', { checked_at: checkedAt, remote, reconnect_required: true, can_continue: false, verified: { ...verified, scope: 'standalone_probe' } });
178
- } catch (error) { return result(state, current, 'error', { checked_at: checkedAt, remote, code: 'candidate_rejected', message: error.message, can_continue: false }); }
179
- finally { await unlock(); }
180
- }
181
-
182
- export async function checkForUpdate({ installationFile, current, intent = 'inspect', requestKey, projectCompatibility, lookup = queryRegistry, materialize = stageRegistryRuntime, probe = probeRuntime }) {
183
- if (!installationFile) return { status: 'unmanaged', current, can_continue: true, activation_required: false, note: 'Install Craft once to enable automatic updates.' };
184
- if (!['inspect', 'create', 'resume', 'update'].includes(intent)) throw new Error('Invalid update intent');
185
- // Serialize per installation across processes. A shared promise only merges
186
- // the same logical request in this process; a later work still checks npm.
187
- const key = requestKey ? JSON.stringify([installationFile, current.build_id, current.instance_id, intent, requestKey]) : Symbol('unkeyed update');
188
- if (pending.has(key)) return pending.get(key);
189
- const operation = (async () => {
190
- let unlock;
191
- try {
192
- unlock = await lockfile.lock(installationFile, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
193
- return await checkLocked({ installationFile, current, intent, requestKey, projectCompatibility, lookup, materialize, probe });
194
- } catch (error) { return { status: 'error', code: 'update_failed', message: error.message, current, can_continue: false, activation_required: false }; }
195
- finally { await unlock?.(); }
196
- })();
197
- pending.set(key, operation);
198
- try { return await operation; } finally { if (pending.get(key) === operation) pending.delete(key); }
199
- }
200
-
201
- export async function runUpdateCommand(args) {
202
- const [command, ...rest] = args, options = {};
203
- for (let i = 0; i < rest.length; i += 2) {
204
- const key = rest[i]?.replace(/^--/, '');
205
- if (rest[i] !== '--ide' || !rest[i + 1] || Object.hasOwn(options, key)) throw new Error('Use craft-mcp ' + command + ' --ide <host>');
206
- options[key] = rest[i + 1];
207
- }
208
- const results = [];
209
- for (const host of installTargets(options.ide)) {
210
- const paths = hostPaths(os.homedir(), host, process.env.CODEX_HOME, hostEnvironment());
211
- await assertPlainPath(paths.config);
212
- assertDshSharedScope(paths);
213
- const connection = craftConfig(await optionalFile(paths.config) ?? '', host);
214
- const installationFile = connection?.env?.CRAFT_INSTALLATION_FILE;
215
- if (!installationFile) throw new Error(host + ': Install Craft once before using automatic updates');
216
- const state = await readInstallation(installationFile);
217
- const current = await getRuntimeIdentity(state.target.package_root);
218
- const update = await checkForUpdate({ installationFile, current, intent: command === 'update' ? 'update' : 'inspect', requestKey: 'cli-' + Date.now() });
219
- // A CLI can inspect configured files, but cannot prove a host connection.
220
- results.push({ host, ...update, activation: { status: 'pending_connection_verification', expected: update.target }, can_continue: false, scope: 'configured_runtime', note: 'Call craft_game_info in the actual host connection to confirm activation.',
221
- ...(!['error','incompatible','migration_required'].includes(update.status) ? {connection_handoff:connectionHandoff({host,target:update.target,workspace:state.workspace,platform:state.platform,intent:command==='update'?'update':'inspect'})} : {}) });
222
- if (['error', 'incompatible'].includes(update.status)) process.exitCode = 1;
223
- }
224
- process.stdout.write(JSON.stringify({ hosts: results }, null, 2) + '\n');
225
- }
1
+ import path from 'node:path';
2
+ import { mkdir } from 'node:fs/promises';
3
+ import lockfile from 'proper-lockfile';
4
+ import { readInstallation, readInstallationSnapshot, activationStatus, registryOrigin, installedSkillEntries, skillRuntimeIdentity, sameRuntimeIdentity, activationMode } from './installation-state.mjs';
5
+ import { compareVersions, requireForwardVersion, parseVersion } from './version-policy.mjs';
6
+ import { stageRegistryRuntime, getRuntimeIdentity, probeRuntime } from './runtime.mjs';
7
+ import { optionalFile, assertPlainPath, commitFiles } from './files.mjs';
8
+ import { hostPaths, hostCommandOptions, installTargets } from './hosts.mjs';
9
+ import { craftConfig, mergeConfig } from './config.mjs';
10
+ import { assertDshSharedScope } from './dsh-config.mjs';
11
+ import { connectionHandoff } from './connection-handoff.mjs';
12
+ import { planLauncher, verifyLauncher } from './fixed-launcher.mjs';
13
+ import os from 'node:os';
14
+ import { setTimeout as delay } from 'node:timers/promises';
15
+ import { unchangedInstallation, installationChanged, installationBusy } from './installation-transaction.mjs';
16
+ import { prepareRuntimeCandidate, publishRuntimeCandidate, disposeRuntimeCandidate, refreshRuntimeCandidate } from './runtime-candidate.mjs';
17
+ import { assertHostConfigScope } from './host-config-scope.mjs';
18
+
19
+ export { readInstallation } from './installation-state.mjs';
20
+ const pending = new Map();
21
+ const receiptLifetime = 5 * 60 * 1000;
22
+
23
+ function result(state, current, status, extra = {}) {
24
+ return { status, installation_id: state.id, source: state.source, policy: state.policy,
25
+ current, target: state.target, activation: activationStatus(current, state.target),
26
+ activation_mode: state.activation_mode ?? 'legacy_front', migration_required: state.schema === 1,
27
+ activation_required: false, reconnect_required: !sameRuntimeIdentity(current, state.target), explicitly_not_started: true, ...extra };
28
+ }
29
+
30
+ export async function readUpdateStatus({ installationFile, current }) {
31
+ if (!installationFile) return { status: 'unmanaged', current, activation_required: false, note: 'Run the standard Craft installer once to enable automatic updates.' };
32
+ try {
33
+ const state = await readInstallation(installationFile);
34
+ const activation = activationStatus(current, state.target);
35
+ return result(state, current, state.schema === 1 ? 'migration_required' : activation.status === 'active_verified' ? 'current' : activation.status, { last_check: state.last_check, can_continue: state.schema === 2 && activation.status === 'active_verified' });
36
+ } catch (error) { return { status: 'error', code: 'invalid_installation', message: error.message, current, can_continue: false, activation_required: false }; }
37
+ }
38
+
39
+ export async function queryRegistry(source, { fetchImpl = fetch, timeoutMs = 15000 } = {}) {
40
+ const registry = registryOrigin(source.registry);
41
+ const url = new URL(encodeURIComponent(source.package) + '/' + encodeURIComponent(source.channel), registry);
42
+ const response = await fetchImpl(url, { headers: { accept: 'application/json' }, signal: AbortSignal.timeout(timeoutMs) });
43
+ if (!response.ok) throw Object.assign(new Error('npm version check failed (HTTP ' + response.status + ')'), { code: response.status >= 400 && response.status < 500 && ![408, 429].includes(response.status) ? 'INVALID_REGISTRY_METADATA' : 'REGISTRY_UNAVAILABLE' });
44
+ let data;
45
+ try { data = await response.json(); if (data.name !== source.package) throw new Error('npm returned a different package identity'); parseVersion(data.version); }
46
+ catch { throw Object.assign(new Error('npm returned invalid package identity metadata'), { code: 'INVALID_REGISTRY_METADATA' }); }
47
+ const integrity = data.dist?.integrity ?? (data.dist?.shasum && /^[a-f0-9]{40}$/.test(data.dist.shasum) ? 'sha1-' + Buffer.from(data.dist.shasum, 'hex').toString('base64') : undefined);
48
+ if (!integrity || !String(integrity).split(/\s+/).some(value => /^(sha512|sha384|sha256|sha1)-[A-Za-z0-9+/]+={0,2}$/.test(value))) throw Object.assign(new Error('npm package integrity metadata is missing or invalid'), { code: 'INVALID_REGISTRY_METADATA' });
49
+ return { package: data.name, version: data.version, integrity, node: data.engines?.node ?? null };
50
+ }
51
+
52
+ function within(root, file) {
53
+ const relative = path.relative(path.resolve(root), path.resolve(file));
54
+ return relative === '' || (!relative.startsWith('..' + path.sep) && relative !== '..' && !path.isAbsolute(relative));
55
+ }
56
+
57
+ async function candidateSkills(state, identity) {
58
+ // Skill locations are explicit installer-owned destinations. Do not infer a
59
+ // user's home from a custom CODEX_HOME or rewrite unrelated host directories.
60
+ const changes = [];
61
+ for (const { name, file, marker } of installedSkillEntries(state)) {
62
+ await assertPlainPath(file);
63
+ const desired = await optionalFile(path.join(identity.package_root, 'resources', name, 'SKILL.md'));
64
+ if (desired === null) throw new Error('Updated runtime is missing the managed ' + name + ' Skill');
65
+ if (!desired.includes(marker)) throw new Error('Updated runtime has an invalid managed Skill marker');
66
+ const before = await optionalFile(file);
67
+ if (before && !before.includes(marker)) throw new Error('User-owned Skill preserved: ' + file);
68
+ changes.push({ file, before, after: desired });
69
+ }
70
+ return changes;
71
+ }
72
+
73
+ const shortLock = { stale: 120000, retries: 0 };
74
+
75
+ async function confirmationSnapshot(installationFile, current) {
76
+ const snapshot = await readInstallationSnapshot(installationFile), { state } = snapshot;
77
+ await assertHostConfigScope(state.config,state.host,state.config_peers);
78
+ if (state.schema !== 2 || state.activation_mode !== activationMode) throw new Error('Legacy Craft installation requires the standard installer before reconnecting');
79
+ if (activationStatus(current, state.target).status !== 'active_verified') throw installationChanged('The current connection does not match the configured update target');
80
+ await verifyLauncher(state, installationFile);
81
+ const skills = await candidateSkills(state, current);
82
+ if (skills.some(change => change.before !== change.after)) throw new Error('Installed global Skills differ from the configured runtime; run install again');
83
+ return snapshot;
84
+ }
85
+
86
+ export async function confirmActiveInstallation({ installationFile, current }) {
87
+ if (!current?.instance_id) throw new Error('An actual runtime instance is required to confirm the installation');
88
+ // Capture small shared files consistently. Full package hashing never blocks
89
+ // installers; a second short transaction detects concurrent scope/target changes.
90
+ let unlock = await lockfile.lock(installationFile, shortLock), snapshot;
91
+ try { snapshot = await confirmationSnapshot(installationFile, current); }
92
+ finally { await unlock(); }
93
+ let identity, integrityError;
94
+ try { identity = await getRuntimeIdentity(current.package_root); }
95
+ catch (error) { integrityError = error; }
96
+ unlock = await lockfile.lock(installationFile, shortLock);
97
+ try {
98
+ await unchangedInstallation(installationFile, snapshot.state);
99
+ if (integrityError) throw integrityError;
100
+ if (!sameRuntimeIdentity(identity, snapshot.state.target)) throw new Error('The running package files do not match the configured update target');
101
+ const { state, text: before } = await confirmationSnapshot(installationFile, current);
102
+ const previous = state.connection_verification;
103
+ const receipt = previous?.instance_id === current.instance_id ? previous : { version: current.version, build_id: current.build_id, instance_id: current.instance_id, confirmed_at: new Date().toISOString() };
104
+ const written = await commitFiles([{ file: installationFile, before, after: receipt === previous ? before : JSON.stringify({ ...state, connection_verification: receipt }, null, 2) + '\n' }]);
105
+ return { status: 'active_verified', ...receipt, ...written, scope: 'current_connection' };
106
+ } finally { await unlock(); }
107
+ }
108
+
109
+ async function saveCheckReceipt(installationFile, expected, receipt) {
110
+ const unlock = await lockfile.lock(installationFile, { ...shortLock, retries: { retries: 3, minTimeout: 25, maxTimeout: 100 } });
111
+ try {
112
+ const { state, text: before } = await unchangedInstallation(installationFile, expected);
113
+ const after = { ...state, last_check: receipt };
114
+ await commitFiles([{ file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }]);
115
+ return after;
116
+ } finally { await unlock(); }
117
+ }
118
+
119
+ async function hostUpdate(state, installationFile, launcher, identity) {
120
+ await assertHostConfigScope(state.config,state.host,state.config_peers);
121
+ await assertPlainPath(state.config);
122
+ if (state.host === 'dsh') assertDshSharedScope({ dshHome: path.dirname(state.config) });
123
+ const before = await optionalFile(state.config);
124
+ if (before === null) throw new Error('Craft host configuration is missing; run install again');
125
+ const existing = craftConfig(before, state.host, state.server_id);
126
+ await verifyLauncher(state, installationFile, existing);
127
+ const samePath = (a, b) => typeof a === 'string' && typeof b === 'string' && (process.platform === 'win32' ? path.resolve(a).toLowerCase() === path.resolve(b).toLowerCase() : path.resolve(a) === path.resolve(b));
128
+ const workspaceIndex = existing?.args?.indexOf('--workspace') ?? -1;
129
+ if (!existing || !samePath(existing.env?.CRAFT_INSTALLATION_FILE, installationFile) || existing.env?.CRAFT_CLIENT_IDE !== state.host ||
130
+ !samePath(workspaceIndex >= 0 ? existing.args[workspaceIndex + 1] : existing.env?.CLIENT_WORKSPACE_ROOT, state.workspace) ||
131
+ new URL(existing.env?.CRAFT_WEB_URL).origin !== new URL(state.platform).origin) throw new Error('Craft host configuration scope changed; run install with the intended scope');
132
+ // Fixed-entry updates must not rewrite watched host configuration: a host
133
+ // could otherwise restart an in-flight MCP task on an env-only change.
134
+ if (state.launcher?.entry === launcher.entry) return { file: state.config, before, after: before };
135
+ const connection = { command: existing.command, args: [launcher.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace, CRAFT_INSTALLATION_FILE: installationFile, CRAFT_RUNTIME_REVISION: identity.build_id } };
136
+ return { file: state.config, before, after: mergeConfig(before, state.host, connection, { previousName: state.server_id, enable: false }) };
137
+ }
138
+
139
+ async function checkSnapshot({ installationFile, current, intent, requestKey, projectCompatibility, registryReceipt, lookup, materialize, probe }) {
140
+ let state = (await readInstallationSnapshot(installationFile)).state;
141
+ if (current.package !== state.source.package) return result(state, current, 'error', { code: 'package_mismatch', can_continue: false });
142
+ try { requireForwardVersion(state.target, current); }
143
+ catch (error) { return result(state, current, 'error', { code: 'target_not_forward', message: error.message, can_continue: false }); }
144
+ let pendingIncompatible;
145
+ const activationPending = !sameRuntimeIdentity(current, state.target);
146
+ if (activationPending) {
147
+ try { if (projectCompatibility) await projectCompatibility(state.target.package_root); }
148
+ catch (error) { pendingIncompatible = error.message; }
149
+ if (!pendingIncompatible && intent !== 'inspect') return result(state, current, 'pending_reconnect', { reconnect_required: true, can_continue: false });
150
+ }
151
+ let currentIncompatible = pendingIncompatible;
152
+ if (!currentIncompatible) {
153
+ try { if (projectCompatibility) await projectCompatibility(current.package_root); }
154
+ catch (error) { currentIncompatible = error.message; }
155
+ }
156
+ const keepCurrent = async (status, extra = {}) => {
157
+ await unchangedInstallation(installationFile, state);
158
+ return result(state, current, currentIncompatible ? 'incompatible' : status,
159
+ { ...extra, can_continue: state.schema === 2 && !activationPending && !currentIncompatible && extra.can_continue !== false, ...(currentIncompatible ? { underlying_status: status, message: currentIncompatible } : {}) });
160
+ };
161
+ if (state.policy.mode === 'off' && !['inspect', 'update'].includes(intent)) return keepCurrent('disabled');
162
+ let remote, checkedAt;
163
+ const last = registryReceipt ?? state.last_check;
164
+ const age = Date.now() - Date.parse(last?.checked_at);
165
+ if ((registryReceipt || (requestKey && last?.request_key === requestKey)) && last?.remote && age >= 0 && age < receiptLifetime && last.source_key === JSON.stringify(state.source)) {
166
+ remote = last.remote; checkedAt = last.checked_at;
167
+ } else {
168
+ try { remote = await lookup(state.source); checkedAt = new Date().toISOString(); }
169
+ catch (error) {
170
+ if (error.code === 'INVALID_REGISTRY_METADATA') return result(state, current, 'error', { code: 'invalid_registry_metadata', message: error.message, can_continue: false });
171
+ // Network failure is an unknown remote state, never proof of latest.
172
+ return keepCurrent('offline', { checked_at: new Date().toISOString(), remote_status: 'unknown', message: error.message, can_continue: state.schema === 2 && !currentIncompatible && !activationPending && state.policy.offline === 'allow-existing' });
173
+ }
174
+ }
175
+ try {
176
+ if (remote.package !== state.source.package) throw new Error('npm package identity mismatch');
177
+ parseVersion(remote.version);
178
+ } catch (error) { return result(state, current, 'error', { code: 'invalid_registry_identity', message: error.message, can_continue: false }); }
179
+ const receipt = { checked_at: checkedAt, ...(requestKey ? { request_key: requestKey } : {}), source_key: JSON.stringify(state.source), remote };
180
+ // A staged target can be unsuitable for this particular project. Keep it as
181
+ // the minimum version while looking for a newer compatible replacement.
182
+ const comparison = compareVersions(remote.version, state.target.version);
183
+ if (comparison === 0 && state.target.origin?.kind === 'npm' && state.target.origin.registry === state.source.registry && state.target.origin.integrity !== remote.integrity) {
184
+ return result(state, current, 'error', { code: 'same_version_integrity_changed', checked_at: checkedAt, remote, message: 'The registry reports different bytes for an installed package version; automatic replacement refused', can_continue: false });
185
+ }
186
+ if (comparison <= 0 || intent === 'inspect') {
187
+ // Public version checks are read-only. Their receipts live in the MCP
188
+ // connection; only an installer/preparation may persist a receipt.
189
+ if (intent !== 'inspect') {
190
+ state = await saveCheckReceipt(installationFile, state, receipt);
191
+ }
192
+ await unchangedInstallation(installationFile, state);
193
+ if (currentIncompatible && comparison <= 0) return keepCurrent(comparison < 0 ? 'local_ahead' : 'current', { checked_at: checkedAt, remote });
194
+ const remoteStatus = comparison < 0 ? 'local_ahead' : comparison === 0 ? 'current' : 'available';
195
+ return result(state, current, state.schema === 1 && comparison <= 0 ? 'migration_required' : activationPending && comparison <= 0 ? 'pending_reconnect' : remoteStatus, { checked_at: checkedAt, remote,
196
+ update_available: comparison > 0, automatic_update_enabled: state.policy.mode !== 'off',
197
+ ...(activationPending ? { remote_status: remoteStatus } : {}),
198
+ ...(comparison === 0 ? { remote_build_status: state.target.origin?.integrity === remote.integrity ? 'integrity_matches' : 'not_compared_local_install' } : {}),
199
+ ...(currentIncompatible ? { current_compatibility: { status: 'incompatible', message: currentIncompatible } } : {}), can_continue: state.schema === 2 && !currentIncompatible && !activationPending });
200
+ }
201
+ const runtimeRoot = state.runtime_root;
202
+ if (!path.isAbsolute(runtimeRoot ?? '')) return result(state, current, 'error', { code: 'invalid_runtime_root', can_continue: false });
203
+ await mkdir(runtimeRoot, { recursive: true });
204
+ let candidate, originalConfig;
205
+ try {
206
+ originalConfig = await optionalFile(state.config);
207
+ candidate = await prepareRuntimeCandidate(runtimeRoot, stagingRoot => materialize(state.source, remote, stagingRoot));
208
+ let identity = candidate.identity;
209
+ if (!within(runtimeRoot, identity.package_root) || identity.package !== state.source.package || identity.version !== remote.version) throw new Error('Candidate runtime identity/path mismatch');
210
+ requireForwardVersion(identity, state.target);
211
+ if (projectCompatibility) {
212
+ try { await projectCompatibility(identity.package_root); }
213
+ catch (error) { return result(state, current, 'incompatible', { checked_at: checkedAt, remote, message: error.message, can_continue: false }); }
214
+ }
215
+ const verified = await probe({ command: process.execPath, args: [identity.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace } },
216
+ { version: identity.version, build_id: identity.build_id, host: state.host, workspace: state.workspace, platform: state.platform });
217
+ if (verified.runtime?.activation_mode !== activationMode) throw new Error('Candidate runtime does not support activation at the next MCP start');
218
+ if (!sameRuntimeIdentity(await getRuntimeIdentity(identity.package_root), identity)) throw new Error('Candidate runtime changed during startup verification');
219
+ // Neither registry traffic nor materialization/probing owns a shared lock.
220
+ // Re-read the authoritative state before publishing; receipt-only writes merge.
221
+ const commitCandidate = async () => {
222
+ const unlockState = await lockfile.lock(installationFile, shortLock);
223
+ let unlockRuntime;
224
+ try {
225
+ const latest = await unchangedInstallation(installationFile, state);
226
+ state = latest.state;
227
+ unlockRuntime = await lockfile.lock(runtimeRoot, shortLock);
228
+ identity = await publishRuntimeCandidate(candidate);
229
+ requireForwardVersion(identity, state.target);
230
+ const launcherPlan = await planLauncher(installationFile, state.launcher, identity.package_root);
231
+ const skillChanges = await candidateSkills(state, identity), configChange = await hostUpdate(state, installationFile, launcherPlan.launcher, identity);
232
+ const target = { ...identity, origin: { kind: 'npm', registry: state.source.registry, integrity: remote.integrity } };
233
+ const after = { ...state, schema: 2, activation_mode: activationMode, launcher: launcherPlan.launcher, anchor: identity, target, skills_runtime: skillRuntimeIdentity(identity), last_check: receipt, updated_at: new Date().toISOString() };
234
+ delete after.connection_verification;
235
+ await commitFiles([...skillChanges, launcherPlan.change, { file: installationFile, before: latest.text, after: JSON.stringify(after, null, 2) + '\n' }, configChange]);
236
+ state = after;
237
+ return result(state, current, 'pending_reconnect', { checked_at: checkedAt, remote, reconnect_required: true, can_continue: false, verified: { ...verified, scope: 'standalone_probe' } });
238
+ } finally { try { await unlockRuntime?.(); } finally { await unlockState(); } }
239
+ };
240
+ for (let attempt = 0; ; attempt++) {
241
+ try { return await commitCandidate(); }
242
+ catch (error) {
243
+ if (!['INSTALLATION_CHANGED','ELOCKED'].includes(error.code) || attempt >= 3) throw error;
244
+ // A second host can publish identical bytes while our own installation
245
+ // remains unchanged. Reuse the complete download and revalidate the
246
+ // existing target outside locks, rather than downloading a second time.
247
+ await unchangedInstallation(installationFile, state);
248
+ if (error.code === 'INSTALLATION_CHANGED') await refreshRuntimeCandidate(candidate);
249
+ await delay(100 * (attempt + 1));
250
+ }
251
+ }
252
+
253
+
254
+ } catch (error) {
255
+ if (['ELOCKED', 'INSTALLATION_CHANGED'].includes(error.code)) throw error;
256
+ const failure = { checked_at: checkedAt, remote, code: 'candidate_rejected', message: error.message, ...(error.npm_code?{npm_code:error.npm_code}:{}) };
257
+ try {
258
+ // A failed candidate must not disable a verified existing installation.
259
+ // Recheck the rollback, scope and complete old package before allowing work.
260
+ if (state.schema !== 2 || activationPending || currentIncompatible) throw new Error(currentIncompatible ?? 'No compatible active installation to retain');
261
+ await unchangedInstallation(installationFile, state);
262
+ if (originalConfig === undefined || originalConfig === null || await optionalFile(state.config) !== originalConfig) throw new Error('Host configuration changed; rollback could not be verified');
263
+ if (!sameRuntimeIdentity(await getRuntimeIdentity(current.package_root), state.target)) throw new Error('Existing runtime integrity check failed');
264
+ await hostUpdate(state, installationFile, state.launcher ?? { entry: current.entry }, current);
265
+ if (!state.launcher && path.resolve(craftConfig(originalConfig, state.host, state.server_id).args[0]) !== path.resolve(current.entry)) throw new Error('Existing runtime entry differs from the configured connection');
266
+ const skills = await candidateSkills(state, current);
267
+ if (skills.some(change => change.before !== change.after)) throw new Error('Existing managed Skills differ from the current runtime');
268
+ await unchangedInstallation(installationFile, state);
269
+ return result(state, current, 'update_failed', { ...failure, can_continue: true, retained_version: current.version,
270
+ next: 'Report the update failure and continue with the verified existing version. A later new work can retry the update; do not claim the newest version is running.' });
271
+ } catch (fallbackError) {
272
+ if (fallbackError.code === 'INSTALLATION_CHANGED') throw fallbackError;
273
+ return result(state, current, 'error', { ...failure, can_continue: false, fallback_error: fallbackError.message });
274
+ }
275
+ }
276
+ finally { if (candidate) await disposeRuntimeCandidate(candidate); }
277
+ }
278
+
279
+ export async function checkForUpdate({ installationFile, current, intent = 'inspect', requestKey, projectCompatibility, registryReceipt, lookup = queryRegistry, materialize = stageRegistryRuntime, probe = probeRuntime }) {
280
+ if (!installationFile) return { status: 'unmanaged', current, can_continue: true, activation_required: false, note: 'Install Craft once to enable automatic updates.' };
281
+ if (!['inspect', 'auto', 'create', 'resume', 'update'].includes(intent)) throw new Error('Invalid update intent');
282
+ // Deduplicate only the same logical request. Other readers and downloads
283
+ // proceed independently; the short commit compares their installation snapshot.
284
+ const key = requestKey ? JSON.stringify([installationFile, current.build_id, current.instance_id, intent, requestKey]) : Symbol('unkeyed update');
285
+ if (pending.has(key)) return pending.get(key);
286
+ const operation = (async () => {
287
+ for (let attempt = 0; attempt < 3; attempt++) {
288
+ try {
289
+ return await checkSnapshot({ installationFile, current, intent, requestKey, projectCompatibility, registryReceipt, lookup, materialize, probe });
290
+ } catch (error) {
291
+ if (error.code === 'INSTALLATION_CHANGED' && attempt < 2) continue;
292
+ if (['ELOCKED', 'INSTALLATION_CHANGED'].includes(error.code)) return installationBusy(error, current);
293
+ return { status: 'error', code: 'update_failed', message: error.message, current, can_continue: false, activation_required: false };
294
+ }
295
+ }
296
+ })();
297
+ pending.set(key, operation);
298
+ try { return await operation; } finally { if (pending.get(key) === operation) pending.delete(key); }
299
+ }
300
+
301
+ export async function runUpdateCommand(args) {
302
+ const [command, ...rest] = args, options = {};
303
+ for (let i = 0; i < rest.length; i += 2) {
304
+ const key = rest[i]?.replace(/^--/, '');
305
+ if (!['--ide','--host-config','--trae-region'].includes(rest[i]) || !rest[i + 1] || Object.hasOwn(options, key)) throw new Error('Use craft-mcp ' + command + ' --ide <host> [--host-config ABS] [--trae-region global|cn]');
306
+ options[key] = rest[i + 1];
307
+ }
308
+ const results = [];
309
+ const hostOptions = hostCommandOptions(options);
310
+ for (const host of installTargets(options.ide)) {
311
+ const paths = hostPaths(os.homedir(), host, process.env.CODEX_HOME, hostOptions);
312
+ await assertPlainPath(paths.config);
313
+ assertDshSharedScope(paths);
314
+ const connection = craftConfig(await optionalFile(paths.config) ?? '', host);
315
+ const installationFile = connection?.env?.CRAFT_INSTALLATION_FILE;
316
+ if (!installationFile) throw new Error(host + ': Install Craft once before using automatic updates');
317
+ const state = await readInstallation(installationFile);
318
+ const current = await getRuntimeIdentity(state.target.package_root);
319
+ const update = await checkForUpdate({ installationFile, current, intent: command === 'update' ? 'update' : 'inspect', requestKey: 'cli-' + Date.now() });
320
+ if (update.status === 'installation_busy') {
321
+ results.push({ host, ...update, scope: 'configured_runtime' });
322
+ process.exitCode = 1;
323
+ continue;
324
+ }
325
+ // A CLI can inspect configured files, but cannot prove a host connection.
326
+ results.push({ host, ...update, activation: { status: 'pending_connection_verification', expected: update.target }, can_continue: false, scope: 'configured_runtime', note: 'Call craft_game_info in the actual host connection to confirm activation.',
327
+ ...(!['error','update_failed','incompatible','migration_required'].includes(update.status) ? {connection_handoff:connectionHandoff({host,target:update.target,workspace:state.workspace,platform:state.platform,intent:command==='update'?'update':'inspect'})} : {}) });
328
+ if (['error', 'update_failed', 'incompatible'].includes(update.status)) process.exitCode = 1;
329
+ }
330
+ process.stdout.write(JSON.stringify({ hosts: results }, null, 2) + '\n');
331
+ }