@craft_eco/craft-mcp 0.1.28 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (999) hide show
  1. package/README.md +21 -60
  2. package/bin/craft-mcp.mjs +7 -1
  3. package/dist-server/game-workflow/asset-import.mjs +5 -1
  4. package/dist-server/game-workflow/assets.mjs +6 -2
  5. package/dist-server/game-workflow/bundle-files.mjs +9 -6
  6. package/dist-server/game-workflow/check.mjs +8 -2
  7. package/dist-server/game-workflow/context-state.mjs +67 -0
  8. package/dist-server/game-workflow/draft-archive.mjs +147 -2
  9. package/dist-server/game-workflow/draft-upload-identity.mjs +11 -0
  10. package/dist-server/game-workflow/draft-uploads.mjs +108 -60
  11. package/dist-server/game-workflow/engines.mjs +3 -3
  12. package/dist-server/game-workflow/library-assets.mjs +2 -1
  13. package/dist-server/game-workflow/local-context.mjs +62 -0
  14. package/dist-server/game-workflow/native-context.mjs +289 -0
  15. package/dist-server/game-workflow/project-bundles.mjs +121 -4
  16. package/dist-server/game-workflow/project-context.mjs +183 -45
  17. package/dist-server/game-workflow/project-leases.mjs +101 -30
  18. package/dist-server/game-workflow/projects.mjs +92 -14
  19. package/dist-server/game-workflow/tasks.mjs +7 -2
  20. package/dist-server/game-workflow/work-scope.mjs +7 -0
  21. package/dist-server/integrations/config.mjs +90 -16
  22. package/dist-server/integrations/connect.mjs +36 -0
  23. package/dist-server/integrations/connection-handoff.mjs +36 -0
  24. package/dist-server/integrations/dsh-config.mjs +182 -0
  25. package/dist-server/integrations/fixed-launcher.mjs +31 -0
  26. package/dist-server/integrations/host-reload.mjs +19 -0
  27. package/dist-server/integrations/hosts.mjs +27 -7
  28. package/dist-server/integrations/install.mjs +168 -31
  29. package/dist-server/integrations/installation-state.mjs +84 -0
  30. package/dist-server/integrations/launcher-start.mjs +52 -0
  31. package/dist-server/integrations/npm-diagnostics.mjs +32 -0
  32. package/dist-server/integrations/runtime-gc.mjs +191 -0
  33. package/dist-server/integrations/runtime-identity.mjs +22 -0
  34. package/dist-server/integrations/runtime.mjs +64 -25
  35. package/dist-server/integrations/updates.mjs +258 -0
  36. package/dist-server/integrations/version-policy.mjs +32 -0
  37. package/dist-server/launcher.mjs +1845 -0
  38. package/dist-server/mcp/control-panel.mjs +12 -24
  39. package/dist-server/mcp/server.mjs +150 -91
  40. package/dist-server/mcp/start.mjs +8 -2
  41. package/dist-server/mcp/update-session.mjs +107 -0
  42. package/dist-server/upstream/craft-aigc.mjs +43 -16
  43. package/dist-server/upstream/draft-source.mjs +29 -0
  44. package/package.json +4 -3
  45. package/resources/context-filter-report.json +177 -0
  46. package/resources/craft-create/SKILL.md +10 -2
  47. package/resources/craft-update/SKILL.md +23 -0
  48. package/resources/targets/claude/js/bootstrap/SKILL.md +20 -0
  49. package/resources/targets/claude/js/context-filter-report.json +27 -0
  50. package/resources/targets/claude/js/craft-game-maker/SKILL.md +72 -0
  51. package/resources/targets/claude/js/craft-game-maker/js.md +10 -0
  52. package/resources/targets/claude/js/js/bundle.json +97 -0
  53. package/resources/targets/claude/js/js/context/AGENTS.md +29 -0
  54. package/resources/targets/claude/js/js/context/hooks/hooks.json +14 -0
  55. package/resources/targets/claude/js/js/context/knowledge/AssetUrl.md +9 -0
  56. package/resources/targets/claude/js/js/context/knowledge/AssetWiring.md +7 -0
  57. package/resources/targets/claude/js/js/context/knowledge/Layout.md +7 -0
  58. package/resources/targets/claude/js/js/context/knowledge/Lifecycle.md +11 -0
  59. package/resources/targets/claude/js/js/context/knowledge/ResourceLoading.md +9 -0
  60. package/resources/targets/claude/js/js/context/skills/export-config/SKILL.md +16 -0
  61. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  62. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  63. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  64. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  65. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  66. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  67. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  68. package/resources/targets/claude/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  69. package/resources/targets/claude/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  70. package/resources/targets/claude/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  71. package/resources/targets/claude/js/js/context/skills/index.json +19 -0
  72. package/resources/targets/claude/js/js/context/skills/visual-qa/SKILL.md +14 -0
  73. package/resources/targets/claude/js/js/project/README.md +7 -0
  74. package/resources/targets/claude/js/js/project/configs/assets.json +1 -0
  75. package/resources/targets/claude/js/js/project/configs/game.controls.json +3 -0
  76. package/resources/targets/claude/js/js/project/configs/game.json +3 -0
  77. package/resources/targets/claude/js/js/project/game-runtime.json +7 -0
  78. package/resources/targets/claude/js/js/project/game.config.json +7 -0
  79. package/resources/targets/claude/js/js/project/index.html +20 -0
  80. package/resources/targets/claude/js/js/project/package.json +22 -0
  81. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  82. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  83. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  84. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  85. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  86. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  87. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  88. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  89. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  90. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  91. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  92. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  93. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  94. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  95. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  96. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  97. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  98. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  99. package/resources/targets/claude/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  100. package/resources/targets/claude/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  101. package/resources/targets/claude/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  102. package/resources/targets/claude/js/js/project/scripts/config-export.mjs +13 -0
  103. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  104. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  105. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  106. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  107. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  108. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  109. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  110. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  111. package/resources/targets/claude/js/js/project/scripts/write-preview-ready.mjs +22 -0
  112. package/resources/targets/claude/js/js/project/src/display/ui-stage.ts +156 -0
  113. package/resources/targets/claude/js/js/project/src/display/viewport.ts +249 -0
  114. package/resources/targets/claude/js/js/project/src/main.ts +87 -0
  115. package/resources/targets/claude/js/js/project/src/platform.ts +2 -0
  116. package/resources/targets/claude/js/js/project/src/scenes/LoadScene.ts +89 -0
  117. package/resources/targets/claude/js/js/project/src/scenes/PlayScene.ts +17 -0
  118. package/resources/targets/claude/js/js/project/src/screenUi.ts +185 -0
  119. package/resources/targets/claude/js/js/project/src/style.css +294 -0
  120. package/resources/targets/claude/js/js/project/tsconfig.json +20 -0
  121. package/resources/targets/claude/js/js/project/unified_data_control_config.json +20 -0
  122. package/resources/targets/claude/js/js/project/vite.config.ts +5 -0
  123. package/resources/targets/claude/js/recovery.md +17 -0
  124. package/resources/targets/claude/js/target.json +61 -0
  125. package/resources/targets/claude/js3d/bootstrap/SKILL.md +20 -0
  126. package/resources/targets/claude/js3d/context-filter-report.json +27 -0
  127. package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +72 -0
  128. package/resources/targets/claude/js3d/craft-game-maker/js3d.md +12 -0
  129. package/resources/targets/claude/js3d/js3d/bundle.json +108 -0
  130. package/resources/targets/claude/js3d/js3d/context/AGENTS.md +30 -0
  131. package/resources/targets/claude/js3d/js3d/context/hooks/hooks.json +14 -0
  132. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  133. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  134. package/resources/targets/claude/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  135. package/resources/targets/claude/js3d/js3d/context/knowledge/Layout.md +7 -0
  136. package/resources/targets/{workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → claude/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  137. package/resources/targets/claude/js3d/js3d/context/knowledge/Runtime.md +9 -0
  138. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  139. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  140. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  141. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  142. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  143. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  144. package/resources/targets/claude/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  145. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  146. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  147. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  148. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  149. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  150. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  151. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  152. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  153. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  154. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  155. package/resources/targets/claude/js3d/js3d/context/skills/index.json +31 -0
  156. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  157. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  158. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  159. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  160. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  161. package/resources/targets/claude/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  162. package/resources/targets/claude/js3d/js3d/project/README.md +7 -0
  163. package/resources/targets/claude/js3d/js3d/project/configs/game.controls.json +3 -0
  164. package/resources/targets/claude/js3d/js3d/project/configs/game.json +3 -0
  165. package/resources/targets/claude/js3d/js3d/project/game-runtime.json +7 -0
  166. package/resources/targets/claude/js3d/js3d/project/game.config.json +7 -0
  167. package/resources/targets/claude/js3d/js3d/project/index.html +12 -0
  168. package/resources/targets/claude/js3d/js3d/project/package.json +23 -0
  169. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  170. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  171. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  172. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  173. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  174. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  175. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  176. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  177. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  178. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  179. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  180. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  181. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  182. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  183. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  184. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  185. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  186. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  187. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  188. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  189. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  190. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  191. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  192. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  193. package/resources/targets/claude/js3d/js3d/project/scripts/config-export.mjs +15 -0
  194. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  195. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  196. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  197. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  198. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  199. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  200. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  201. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  202. package/resources/targets/claude/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  203. package/resources/targets/claude/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  204. package/resources/targets/claude/js3d/js3d/project/src/display/viewport.ts +239 -0
  205. package/resources/targets/claude/js3d/js3d/project/src/main.ts +85 -0
  206. package/resources/targets/claude/js3d/js3d/project/src/platform.ts +2 -0
  207. package/resources/targets/claude/js3d/js3d/project/src/style.css +83 -0
  208. package/resources/targets/claude/js3d/js3d/project/tsconfig.json +20 -0
  209. package/resources/targets/claude/js3d/js3d/project/unified_data_control_config.json +20 -0
  210. package/resources/targets/claude/js3d/js3d/project/vite.config.ts +5 -0
  211. package/resources/targets/claude/js3d/recovery.md +17 -0
  212. package/resources/targets/claude/js3d/target.json +60 -0
  213. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +7 -1
  214. package/resources/targets/codebuddy/js/context-filter-report.json +27 -0
  215. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +24 -29
  216. package/resources/targets/codebuddy/js/craft-game-maker/js.md +2 -2
  217. package/resources/targets/codebuddy/js/js/bundle.json +16 -18
  218. package/resources/targets/codebuddy/js/js/context/AGENTS.md +10 -6
  219. package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  220. package/resources/targets/codebuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  221. package/resources/targets/codebuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  222. package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  223. package/resources/targets/codebuddy/js/js/context/skills/index.json +2 -14
  224. package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  225. package/resources/targets/codebuddy/js/recovery.md +14 -4
  226. package/resources/targets/codebuddy/js/target.json +1 -1
  227. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +7 -1
  228. package/resources/targets/codebuddy/js3d/context-filter-report.json +27 -0
  229. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +24 -29
  230. package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +3 -4
  231. package/resources/targets/codebuddy/js3d/js3d/bundle.json +19 -21
  232. package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +10 -6
  233. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  234. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  235. package/resources/targets/{codex/js3d/js3d/context/skills/asset-search/references/resource-config.md → codebuddy/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  236. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  237. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  238. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  239. package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +4 -16
  240. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  241. package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  242. package/resources/targets/codebuddy/js3d/recovery.md +14 -4
  243. package/resources/targets/codebuddy/js3d/target.json +1 -1
  244. package/resources/targets/codex/js/bootstrap/SKILL.md +7 -1
  245. package/resources/targets/codex/js/context-filter-report.json +27 -0
  246. package/resources/targets/codex/js/craft-game-maker/SKILL.md +24 -29
  247. package/resources/targets/codex/js/craft-game-maker/js.md +2 -2
  248. package/resources/targets/codex/js/js/bundle.json +16 -18
  249. package/resources/targets/codex/js/js/context/AGENTS.md +10 -6
  250. package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +4 -4
  251. package/resources/targets/codex/js/js/context/knowledge/AssetWiring.md +7 -0
  252. package/resources/targets/codex/js/js/context/knowledge/ResourceLoading.md +9 -0
  253. package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +2 -2
  254. package/resources/targets/codex/js/js/context/skills/index.json +2 -14
  255. package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +1 -1
  256. package/resources/targets/codex/js/recovery.md +14 -4
  257. package/resources/targets/codex/js/target.json +1 -1
  258. package/resources/targets/codex/js3d/bootstrap/SKILL.md +7 -1
  259. package/resources/targets/codex/js3d/context-filter-report.json +27 -0
  260. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +24 -29
  261. package/resources/targets/codex/js3d/craft-game-maker/js3d.md +3 -4
  262. package/resources/targets/codex/js3d/js3d/bundle.json +19 -21
  263. package/resources/targets/codex/js3d/js3d/context/AGENTS.md +10 -6
  264. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  265. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  266. package/resources/targets/{codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → codex/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  267. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  268. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  269. package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  270. package/resources/targets/codex/js3d/js3d/context/skills/index.json +4 -16
  271. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  272. package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  273. package/resources/targets/codex/js3d/recovery.md +14 -4
  274. package/resources/targets/codex/js3d/target.json +1 -1
  275. package/resources/targets/cursor/js/bootstrap/SKILL.md +20 -0
  276. package/resources/targets/cursor/js/context-filter-report.json +27 -0
  277. package/resources/targets/cursor/js/craft-game-maker/SKILL.md +72 -0
  278. package/resources/targets/cursor/js/craft-game-maker/js.md +10 -0
  279. package/resources/targets/cursor/js/js/bundle.json +97 -0
  280. package/resources/targets/cursor/js/js/context/AGENTS.md +29 -0
  281. package/resources/targets/cursor/js/js/context/hooks/hooks.json +14 -0
  282. package/resources/targets/cursor/js/js/context/knowledge/AssetUrl.md +9 -0
  283. package/resources/targets/cursor/js/js/context/knowledge/AssetWiring.md +7 -0
  284. package/resources/targets/cursor/js/js/context/knowledge/Layout.md +7 -0
  285. package/resources/targets/cursor/js/js/context/knowledge/Lifecycle.md +11 -0
  286. package/resources/targets/cursor/js/js/context/knowledge/ResourceLoading.md +9 -0
  287. package/resources/targets/cursor/js/js/context/skills/export-config/SKILL.md +16 -0
  288. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  289. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  290. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  291. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  292. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  293. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  294. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  295. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  296. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  297. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  298. package/resources/targets/cursor/js/js/context/skills/index.json +19 -0
  299. package/resources/targets/cursor/js/js/context/skills/visual-qa/SKILL.md +14 -0
  300. package/resources/targets/cursor/js/js/project/README.md +7 -0
  301. package/resources/targets/cursor/js/js/project/configs/assets.json +1 -0
  302. package/resources/targets/cursor/js/js/project/configs/game.controls.json +3 -0
  303. package/resources/targets/cursor/js/js/project/configs/game.json +3 -0
  304. package/resources/targets/cursor/js/js/project/game-runtime.json +7 -0
  305. package/resources/targets/cursor/js/js/project/game.config.json +7 -0
  306. package/resources/targets/cursor/js/js/project/index.html +20 -0
  307. package/resources/targets/cursor/js/js/project/package.json +22 -0
  308. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  309. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  310. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  311. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  312. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  313. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  314. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  315. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  316. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  317. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  318. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  319. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  320. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  321. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  322. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  323. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  324. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  325. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  326. package/resources/targets/cursor/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  327. package/resources/targets/cursor/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  328. package/resources/targets/cursor/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  329. package/resources/targets/cursor/js/js/project/scripts/config-export.mjs +13 -0
  330. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  331. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  332. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  333. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  334. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  335. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  336. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  337. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  338. package/resources/targets/cursor/js/js/project/scripts/write-preview-ready.mjs +22 -0
  339. package/resources/targets/cursor/js/js/project/src/display/ui-stage.ts +156 -0
  340. package/resources/targets/cursor/js/js/project/src/display/viewport.ts +249 -0
  341. package/resources/targets/cursor/js/js/project/src/main.ts +87 -0
  342. package/resources/targets/cursor/js/js/project/src/platform.ts +2 -0
  343. package/resources/targets/cursor/js/js/project/src/scenes/LoadScene.ts +89 -0
  344. package/resources/targets/cursor/js/js/project/src/scenes/PlayScene.ts +17 -0
  345. package/resources/targets/cursor/js/js/project/src/screenUi.ts +185 -0
  346. package/resources/targets/cursor/js/js/project/src/style.css +294 -0
  347. package/resources/targets/cursor/js/js/project/tsconfig.json +20 -0
  348. package/resources/targets/cursor/js/js/project/unified_data_control_config.json +20 -0
  349. package/resources/targets/cursor/js/js/project/vite.config.ts +5 -0
  350. package/resources/targets/cursor/js/recovery.md +17 -0
  351. package/resources/targets/cursor/js/target.json +61 -0
  352. package/resources/targets/cursor/js3d/bootstrap/SKILL.md +20 -0
  353. package/resources/targets/cursor/js3d/context-filter-report.json +27 -0
  354. package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +72 -0
  355. package/resources/targets/cursor/js3d/craft-game-maker/js3d.md +12 -0
  356. package/resources/targets/cursor/js3d/js3d/bundle.json +108 -0
  357. package/resources/targets/cursor/js3d/js3d/context/AGENTS.md +30 -0
  358. package/resources/targets/cursor/js3d/js3d/context/hooks/hooks.json +14 -0
  359. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  360. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  361. package/resources/targets/cursor/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  362. package/resources/targets/cursor/js3d/js3d/context/knowledge/Layout.md +7 -0
  363. package/resources/targets/cursor/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  364. package/resources/targets/cursor/js3d/js3d/context/knowledge/Runtime.md +9 -0
  365. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  366. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  367. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  368. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  369. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  370. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  371. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  372. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  373. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  374. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  375. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  376. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  377. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  378. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  379. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  380. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  381. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  382. package/resources/targets/cursor/js3d/js3d/context/skills/index.json +31 -0
  383. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  384. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  385. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  386. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  387. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  388. package/resources/targets/cursor/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  389. package/resources/targets/cursor/js3d/js3d/project/README.md +7 -0
  390. package/resources/targets/cursor/js3d/js3d/project/configs/game.controls.json +3 -0
  391. package/resources/targets/cursor/js3d/js3d/project/configs/game.json +3 -0
  392. package/resources/targets/cursor/js3d/js3d/project/game-runtime.json +7 -0
  393. package/resources/targets/cursor/js3d/js3d/project/game.config.json +7 -0
  394. package/resources/targets/cursor/js3d/js3d/project/index.html +12 -0
  395. package/resources/targets/cursor/js3d/js3d/project/package.json +23 -0
  396. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  397. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  398. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  399. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  400. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  401. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  402. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  403. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  404. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  405. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  406. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  407. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  408. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  409. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  410. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  411. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  412. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  413. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  414. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  415. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  416. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  417. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  418. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  419. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  420. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export.mjs +15 -0
  421. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  422. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  423. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  424. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  425. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  426. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  427. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  428. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  429. package/resources/targets/cursor/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  430. package/resources/targets/cursor/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  431. package/resources/targets/cursor/js3d/js3d/project/src/display/viewport.ts +239 -0
  432. package/resources/targets/cursor/js3d/js3d/project/src/main.ts +85 -0
  433. package/resources/targets/cursor/js3d/js3d/project/src/platform.ts +2 -0
  434. package/resources/targets/cursor/js3d/js3d/project/src/style.css +83 -0
  435. package/resources/targets/cursor/js3d/js3d/project/tsconfig.json +20 -0
  436. package/resources/targets/cursor/js3d/js3d/project/unified_data_control_config.json +20 -0
  437. package/resources/targets/cursor/js3d/js3d/project/vite.config.ts +5 -0
  438. package/resources/targets/cursor/js3d/recovery.md +17 -0
  439. package/resources/targets/cursor/js3d/target.json +60 -0
  440. package/resources/targets/dsh/js/bootstrap/SKILL.md +20 -0
  441. package/resources/targets/dsh/js/context-filter-report.json +27 -0
  442. package/resources/targets/dsh/js/craft-game-maker/SKILL.md +72 -0
  443. package/resources/targets/dsh/js/craft-game-maker/js.md +10 -0
  444. package/resources/targets/dsh/js/js/bundle.json +97 -0
  445. package/resources/targets/dsh/js/js/context/AGENTS.md +29 -0
  446. package/resources/targets/dsh/js/js/context/hooks/hooks.json +14 -0
  447. package/resources/targets/dsh/js/js/context/knowledge/AssetUrl.md +9 -0
  448. package/resources/targets/dsh/js/js/context/knowledge/AssetWiring.md +7 -0
  449. package/resources/targets/dsh/js/js/context/knowledge/Layout.md +7 -0
  450. package/resources/targets/dsh/js/js/context/knowledge/Lifecycle.md +11 -0
  451. package/resources/targets/dsh/js/js/context/knowledge/ResourceLoading.md +9 -0
  452. package/resources/targets/dsh/js/js/context/skills/export-config/SKILL.md +16 -0
  453. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  454. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  455. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  456. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  457. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  458. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  459. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  460. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  461. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  462. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  463. package/resources/targets/dsh/js/js/context/skills/index.json +19 -0
  464. package/resources/targets/dsh/js/js/context/skills/visual-qa/SKILL.md +14 -0
  465. package/resources/targets/dsh/js/js/project/README.md +7 -0
  466. package/resources/targets/dsh/js/js/project/configs/assets.json +1 -0
  467. package/resources/targets/dsh/js/js/project/configs/game.controls.json +3 -0
  468. package/resources/targets/dsh/js/js/project/configs/game.json +3 -0
  469. package/resources/targets/dsh/js/js/project/game-runtime.json +7 -0
  470. package/resources/targets/dsh/js/js/project/game.config.json +7 -0
  471. package/resources/targets/dsh/js/js/project/index.html +20 -0
  472. package/resources/targets/dsh/js/js/project/package.json +22 -0
  473. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  474. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  475. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  476. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  477. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  478. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  479. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  480. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  481. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  482. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  483. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  484. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  485. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  486. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  487. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  488. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  489. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  490. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  491. package/resources/targets/dsh/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  492. package/resources/targets/dsh/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  493. package/resources/targets/dsh/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  494. package/resources/targets/dsh/js/js/project/scripts/config-export.mjs +13 -0
  495. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  496. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  497. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  498. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  499. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  500. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  501. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  502. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  503. package/resources/targets/dsh/js/js/project/scripts/write-preview-ready.mjs +22 -0
  504. package/resources/targets/dsh/js/js/project/src/display/ui-stage.ts +156 -0
  505. package/resources/targets/dsh/js/js/project/src/display/viewport.ts +249 -0
  506. package/resources/targets/dsh/js/js/project/src/main.ts +87 -0
  507. package/resources/targets/dsh/js/js/project/src/platform.ts +2 -0
  508. package/resources/targets/dsh/js/js/project/src/scenes/LoadScene.ts +89 -0
  509. package/resources/targets/dsh/js/js/project/src/scenes/PlayScene.ts +17 -0
  510. package/resources/targets/dsh/js/js/project/src/screenUi.ts +185 -0
  511. package/resources/targets/dsh/js/js/project/src/style.css +294 -0
  512. package/resources/targets/dsh/js/js/project/tsconfig.json +20 -0
  513. package/resources/targets/dsh/js/js/project/unified_data_control_config.json +20 -0
  514. package/resources/targets/dsh/js/js/project/vite.config.ts +5 -0
  515. package/resources/targets/dsh/js/recovery.md +17 -0
  516. package/resources/targets/dsh/js/target.json +61 -0
  517. package/resources/targets/dsh/js3d/bootstrap/SKILL.md +20 -0
  518. package/resources/targets/dsh/js3d/context-filter-report.json +27 -0
  519. package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +72 -0
  520. package/resources/targets/dsh/js3d/craft-game-maker/js3d.md +12 -0
  521. package/resources/targets/dsh/js3d/js3d/bundle.json +108 -0
  522. package/resources/targets/dsh/js3d/js3d/context/AGENTS.md +30 -0
  523. package/resources/targets/dsh/js3d/js3d/context/hooks/hooks.json +14 -0
  524. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  525. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  526. package/resources/targets/dsh/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  527. package/resources/targets/dsh/js3d/js3d/context/knowledge/Layout.md +7 -0
  528. package/resources/targets/dsh/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  529. package/resources/targets/dsh/js3d/js3d/context/knowledge/Runtime.md +9 -0
  530. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  531. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  532. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  533. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  534. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  535. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  536. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  537. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  538. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  539. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  540. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  541. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  542. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  543. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  544. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  545. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  546. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  547. package/resources/targets/dsh/js3d/js3d/context/skills/index.json +31 -0
  548. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  549. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  550. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  551. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  552. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  553. package/resources/targets/dsh/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  554. package/resources/targets/dsh/js3d/js3d/project/README.md +7 -0
  555. package/resources/targets/dsh/js3d/js3d/project/configs/game.controls.json +3 -0
  556. package/resources/targets/dsh/js3d/js3d/project/configs/game.json +3 -0
  557. package/resources/targets/dsh/js3d/js3d/project/game-runtime.json +7 -0
  558. package/resources/targets/dsh/js3d/js3d/project/game.config.json +7 -0
  559. package/resources/targets/dsh/js3d/js3d/project/index.html +12 -0
  560. package/resources/targets/dsh/js3d/js3d/project/package.json +23 -0
  561. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  562. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  563. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  564. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  565. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  566. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  567. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  568. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  569. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  570. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  571. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  572. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  573. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  574. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  575. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  576. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  577. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  578. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  579. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  580. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  581. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  582. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  583. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  584. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  585. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export.mjs +15 -0
  586. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  587. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  588. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  589. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  590. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  591. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  592. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  593. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  594. package/resources/targets/dsh/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  595. package/resources/targets/dsh/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  596. package/resources/targets/dsh/js3d/js3d/project/src/display/viewport.ts +239 -0
  597. package/resources/targets/dsh/js3d/js3d/project/src/main.ts +85 -0
  598. package/resources/targets/dsh/js3d/js3d/project/src/platform.ts +2 -0
  599. package/resources/targets/dsh/js3d/js3d/project/src/style.css +83 -0
  600. package/resources/targets/dsh/js3d/js3d/project/tsconfig.json +20 -0
  601. package/resources/targets/dsh/js3d/js3d/project/unified_data_control_config.json +20 -0
  602. package/resources/targets/dsh/js3d/js3d/project/vite.config.ts +5 -0
  603. package/resources/targets/dsh/js3d/recovery.md +17 -0
  604. package/resources/targets/dsh/js3d/target.json +60 -0
  605. package/resources/targets/index.json +72 -12
  606. package/resources/targets/kimi/js/bootstrap/SKILL.md +20 -0
  607. package/resources/targets/kimi/js/context-filter-report.json +27 -0
  608. package/resources/targets/kimi/js/craft-game-maker/SKILL.md +72 -0
  609. package/resources/targets/kimi/js/craft-game-maker/js.md +10 -0
  610. package/resources/targets/kimi/js/js/bundle.json +97 -0
  611. package/resources/targets/kimi/js/js/context/AGENTS.md +29 -0
  612. package/resources/targets/kimi/js/js/context/hooks/hooks.json +14 -0
  613. package/resources/targets/kimi/js/js/context/knowledge/AssetUrl.md +9 -0
  614. package/resources/targets/kimi/js/js/context/knowledge/AssetWiring.md +7 -0
  615. package/resources/targets/kimi/js/js/context/knowledge/Layout.md +7 -0
  616. package/resources/targets/kimi/js/js/context/knowledge/Lifecycle.md +11 -0
  617. package/resources/targets/kimi/js/js/context/knowledge/ResourceLoading.md +9 -0
  618. package/resources/targets/kimi/js/js/context/skills/export-config/SKILL.md +16 -0
  619. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  620. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  621. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  622. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  623. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  624. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  625. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  626. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  627. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  628. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  629. package/resources/targets/kimi/js/js/context/skills/index.json +19 -0
  630. package/resources/targets/kimi/js/js/context/skills/visual-qa/SKILL.md +14 -0
  631. package/resources/targets/kimi/js/js/project/README.md +7 -0
  632. package/resources/targets/kimi/js/js/project/configs/assets.json +1 -0
  633. package/resources/targets/kimi/js/js/project/configs/game.controls.json +3 -0
  634. package/resources/targets/kimi/js/js/project/configs/game.json +3 -0
  635. package/resources/targets/kimi/js/js/project/game-runtime.json +7 -0
  636. package/resources/targets/kimi/js/js/project/game.config.json +7 -0
  637. package/resources/targets/kimi/js/js/project/index.html +20 -0
  638. package/resources/targets/kimi/js/js/project/package.json +22 -0
  639. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  640. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  641. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  642. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  643. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  644. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  645. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  646. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  647. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  648. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  649. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  650. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  651. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  652. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  653. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  654. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  655. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  656. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  657. package/resources/targets/kimi/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  658. package/resources/targets/kimi/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  659. package/resources/targets/kimi/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  660. package/resources/targets/kimi/js/js/project/scripts/config-export.mjs +13 -0
  661. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  662. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  663. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  664. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  665. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  666. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  667. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  668. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  669. package/resources/targets/kimi/js/js/project/scripts/write-preview-ready.mjs +22 -0
  670. package/resources/targets/kimi/js/js/project/src/display/ui-stage.ts +156 -0
  671. package/resources/targets/kimi/js/js/project/src/display/viewport.ts +249 -0
  672. package/resources/targets/kimi/js/js/project/src/main.ts +87 -0
  673. package/resources/targets/kimi/js/js/project/src/platform.ts +2 -0
  674. package/resources/targets/kimi/js/js/project/src/scenes/LoadScene.ts +89 -0
  675. package/resources/targets/kimi/js/js/project/src/scenes/PlayScene.ts +17 -0
  676. package/resources/targets/kimi/js/js/project/src/screenUi.ts +185 -0
  677. package/resources/targets/kimi/js/js/project/src/style.css +294 -0
  678. package/resources/targets/kimi/js/js/project/tsconfig.json +20 -0
  679. package/resources/targets/kimi/js/js/project/unified_data_control_config.json +20 -0
  680. package/resources/targets/kimi/js/js/project/vite.config.ts +5 -0
  681. package/resources/targets/kimi/js/recovery.md +17 -0
  682. package/resources/targets/kimi/js/target.json +61 -0
  683. package/resources/targets/kimi/js3d/bootstrap/SKILL.md +20 -0
  684. package/resources/targets/kimi/js3d/context-filter-report.json +27 -0
  685. package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +72 -0
  686. package/resources/targets/kimi/js3d/craft-game-maker/js3d.md +12 -0
  687. package/resources/targets/kimi/js3d/js3d/bundle.json +108 -0
  688. package/resources/targets/kimi/js3d/js3d/context/AGENTS.md +30 -0
  689. package/resources/targets/kimi/js3d/js3d/context/hooks/hooks.json +14 -0
  690. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  691. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  692. package/resources/targets/kimi/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  693. package/resources/targets/kimi/js3d/js3d/context/knowledge/Layout.md +7 -0
  694. package/resources/targets/kimi/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  695. package/resources/targets/kimi/js3d/js3d/context/knowledge/Runtime.md +9 -0
  696. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  697. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  698. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  699. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  700. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  701. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  702. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  703. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  704. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  705. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  706. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  707. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  708. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  709. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  710. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  711. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  712. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  713. package/resources/targets/kimi/js3d/js3d/context/skills/index.json +31 -0
  714. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  715. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  716. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  717. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  718. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  719. package/resources/targets/kimi/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  720. package/resources/targets/kimi/js3d/js3d/project/README.md +7 -0
  721. package/resources/targets/kimi/js3d/js3d/project/configs/game.controls.json +3 -0
  722. package/resources/targets/kimi/js3d/js3d/project/configs/game.json +3 -0
  723. package/resources/targets/kimi/js3d/js3d/project/game-runtime.json +7 -0
  724. package/resources/targets/kimi/js3d/js3d/project/game.config.json +7 -0
  725. package/resources/targets/kimi/js3d/js3d/project/index.html +12 -0
  726. package/resources/targets/kimi/js3d/js3d/project/package.json +23 -0
  727. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  728. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  729. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  730. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  731. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  732. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  733. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  734. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  735. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  736. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  737. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  738. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  739. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  740. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  741. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  742. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  743. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  744. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  745. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  746. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  747. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  748. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  749. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  750. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  751. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export.mjs +15 -0
  752. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  753. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  754. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  755. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  756. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  757. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  758. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  759. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  760. package/resources/targets/kimi/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  761. package/resources/targets/kimi/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  762. package/resources/targets/kimi/js3d/js3d/project/src/display/viewport.ts +239 -0
  763. package/resources/targets/kimi/js3d/js3d/project/src/main.ts +85 -0
  764. package/resources/targets/kimi/js3d/js3d/project/src/platform.ts +2 -0
  765. package/resources/targets/kimi/js3d/js3d/project/src/style.css +83 -0
  766. package/resources/targets/kimi/js3d/js3d/project/tsconfig.json +20 -0
  767. package/resources/targets/kimi/js3d/js3d/project/unified_data_control_config.json +20 -0
  768. package/resources/targets/kimi/js3d/js3d/project/vite.config.ts +5 -0
  769. package/resources/targets/kimi/js3d/recovery.md +17 -0
  770. package/resources/targets/kimi/js3d/target.json +60 -0
  771. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +9 -1
  772. package/resources/targets/workbuddy/js/context-filter-report.json +27 -0
  773. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +24 -29
  774. package/resources/targets/workbuddy/js/craft-game-maker/js.md +2 -2
  775. package/resources/targets/workbuddy/js/js/bundle.json +16 -18
  776. package/resources/targets/workbuddy/js/js/context/AGENTS.md +10 -6
  777. package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  778. package/resources/targets/workbuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  779. package/resources/targets/workbuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  780. package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  781. package/resources/targets/workbuddy/js/js/context/skills/index.json +2 -14
  782. package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  783. package/resources/targets/workbuddy/js/recovery.md +16 -4
  784. package/resources/targets/workbuddy/js/target.json +1 -1
  785. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +9 -1
  786. package/resources/targets/workbuddy/js3d/context-filter-report.json +27 -0
  787. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +24 -29
  788. package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +3 -4
  789. package/resources/targets/workbuddy/js3d/js3d/bundle.json +19 -21
  790. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +10 -6
  791. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  792. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  793. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  794. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  795. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  796. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  797. package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +4 -16
  798. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  799. package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  800. package/resources/targets/workbuddy/js3d/recovery.md +16 -4
  801. package/resources/targets/workbuddy/js3d/target.json +1 -1
  802. package/resources/targets/zcode/js/bootstrap/SKILL.md +20 -0
  803. package/resources/targets/zcode/js/context-filter-report.json +27 -0
  804. package/resources/targets/zcode/js/craft-game-maker/SKILL.md +72 -0
  805. package/resources/targets/zcode/js/craft-game-maker/js.md +10 -0
  806. package/resources/targets/zcode/js/js/bundle.json +97 -0
  807. package/resources/targets/zcode/js/js/context/AGENTS.md +29 -0
  808. package/resources/targets/zcode/js/js/context/hooks/hooks.json +14 -0
  809. package/resources/targets/zcode/js/js/context/knowledge/AssetUrl.md +9 -0
  810. package/resources/targets/zcode/js/js/context/knowledge/AssetWiring.md +7 -0
  811. package/resources/targets/zcode/js/js/context/knowledge/Layout.md +7 -0
  812. package/resources/targets/zcode/js/js/context/knowledge/Lifecycle.md +11 -0
  813. package/resources/targets/zcode/js/js/context/knowledge/ResourceLoading.md +9 -0
  814. package/resources/targets/zcode/js/js/context/skills/export-config/SKILL.md +16 -0
  815. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  816. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  817. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  818. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  819. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  820. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  821. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  822. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  823. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  824. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  825. package/resources/targets/zcode/js/js/context/skills/index.json +19 -0
  826. package/resources/targets/zcode/js/js/context/skills/visual-qa/SKILL.md +14 -0
  827. package/resources/targets/zcode/js/js/project/README.md +7 -0
  828. package/resources/targets/zcode/js/js/project/configs/assets.json +1 -0
  829. package/resources/targets/zcode/js/js/project/configs/game.controls.json +3 -0
  830. package/resources/targets/zcode/js/js/project/configs/game.json +3 -0
  831. package/resources/targets/zcode/js/js/project/game-runtime.json +7 -0
  832. package/resources/targets/zcode/js/js/project/game.config.json +7 -0
  833. package/resources/targets/zcode/js/js/project/index.html +20 -0
  834. package/resources/targets/zcode/js/js/project/package.json +22 -0
  835. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  836. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  837. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  838. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  839. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  840. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  841. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  842. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  843. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  844. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  845. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  846. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  847. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  848. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  849. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  850. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  851. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  852. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  853. package/resources/targets/zcode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  854. package/resources/targets/zcode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  855. package/resources/targets/zcode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  856. package/resources/targets/zcode/js/js/project/scripts/config-export.mjs +13 -0
  857. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  858. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  859. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  860. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  861. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  862. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  863. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  864. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  865. package/resources/targets/zcode/js/js/project/scripts/write-preview-ready.mjs +22 -0
  866. package/resources/targets/zcode/js/js/project/src/display/ui-stage.ts +156 -0
  867. package/resources/targets/zcode/js/js/project/src/display/viewport.ts +249 -0
  868. package/resources/targets/zcode/js/js/project/src/main.ts +87 -0
  869. package/resources/targets/zcode/js/js/project/src/platform.ts +2 -0
  870. package/resources/targets/zcode/js/js/project/src/scenes/LoadScene.ts +89 -0
  871. package/resources/targets/zcode/js/js/project/src/scenes/PlayScene.ts +17 -0
  872. package/resources/targets/zcode/js/js/project/src/screenUi.ts +185 -0
  873. package/resources/targets/zcode/js/js/project/src/style.css +294 -0
  874. package/resources/targets/zcode/js/js/project/tsconfig.json +20 -0
  875. package/resources/targets/zcode/js/js/project/unified_data_control_config.json +20 -0
  876. package/resources/targets/zcode/js/js/project/vite.config.ts +5 -0
  877. package/resources/targets/zcode/js/recovery.md +17 -0
  878. package/resources/targets/zcode/js/target.json +61 -0
  879. package/resources/targets/zcode/js3d/bootstrap/SKILL.md +20 -0
  880. package/resources/targets/zcode/js3d/context-filter-report.json +27 -0
  881. package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +72 -0
  882. package/resources/targets/zcode/js3d/craft-game-maker/js3d.md +12 -0
  883. package/resources/targets/zcode/js3d/js3d/bundle.json +108 -0
  884. package/resources/targets/zcode/js3d/js3d/context/AGENTS.md +30 -0
  885. package/resources/targets/zcode/js3d/js3d/context/hooks/hooks.json +14 -0
  886. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  887. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  888. package/resources/targets/zcode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  889. package/resources/targets/zcode/js3d/js3d/context/knowledge/Layout.md +7 -0
  890. package/resources/targets/zcode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  891. package/resources/targets/zcode/js3d/js3d/context/knowledge/Runtime.md +9 -0
  892. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  893. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  894. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  895. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  896. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  897. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  898. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  899. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  900. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  901. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  902. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  903. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  904. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  905. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  906. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  907. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  908. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  909. package/resources/targets/zcode/js3d/js3d/context/skills/index.json +31 -0
  910. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  911. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  912. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  913. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  914. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  915. package/resources/targets/zcode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  916. package/resources/targets/zcode/js3d/js3d/project/README.md +7 -0
  917. package/resources/targets/zcode/js3d/js3d/project/configs/game.controls.json +3 -0
  918. package/resources/targets/zcode/js3d/js3d/project/configs/game.json +3 -0
  919. package/resources/targets/zcode/js3d/js3d/project/game-runtime.json +7 -0
  920. package/resources/targets/zcode/js3d/js3d/project/game.config.json +7 -0
  921. package/resources/targets/zcode/js3d/js3d/project/index.html +12 -0
  922. package/resources/targets/zcode/js3d/js3d/project/package.json +23 -0
  923. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  924. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  925. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  926. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  927. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  928. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  929. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  930. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  931. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  932. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  933. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  934. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  935. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  936. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  937. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  938. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  939. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  940. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  941. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  942. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  943. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  944. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  945. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  946. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  947. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export.mjs +15 -0
  948. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  949. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  950. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  951. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  952. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  953. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  954. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  955. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  956. package/resources/targets/zcode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  957. package/resources/targets/zcode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  958. package/resources/targets/zcode/js3d/js3d/project/src/display/viewport.ts +239 -0
  959. package/resources/targets/zcode/js3d/js3d/project/src/main.ts +85 -0
  960. package/resources/targets/zcode/js3d/js3d/project/src/platform.ts +2 -0
  961. package/resources/targets/zcode/js3d/js3d/project/src/style.css +83 -0
  962. package/resources/targets/zcode/js3d/js3d/project/tsconfig.json +20 -0
  963. package/resources/targets/zcode/js3d/js3d/project/unified_data_control_config.json +20 -0
  964. package/resources/targets/zcode/js3d/js3d/project/vite.config.ts +5 -0
  965. package/resources/targets/zcode/js3d/recovery.md +17 -0
  966. package/resources/targets/zcode/js3d/target.json +60 -0
  967. package/vendor/craft-runtime/SOURCE.json +3 -3
  968. package/vendor/craft-runtime/package.json +1 -1
  969. package/dist-server/game-workflow/publication-materials.mjs +0 -92
  970. package/dist-server/game-workflow/publications.mjs +0 -164
  971. package/dist-server/game-workflow/publish-capture-worker.mjs +0 -57
  972. package/dist-server/game-workflow/publish-capture.mjs +0 -75
  973. package/dist-server/mcp/publication-page.html +0 -86
  974. package/dist-server/mcp/publication-page.mjs +0 -375
  975. package/dist-server/mcp/publication-preview.mjs +0 -63
  976. package/dist-server/mcp/publication-tools.mjs +0 -22
  977. package/dist-server/mcp/publish-panel.mjs +0 -205
  978. package/dist-server/upstream/publication-transport.mjs +0 -101
  979. package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  980. package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  981. package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  982. package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  983. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  984. package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  985. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  986. package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +0 -9
  987. package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  988. package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +0 -12
  989. package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  990. package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  991. package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  992. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  993. package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  994. package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  995. package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  996. package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  997. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  998. package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  999. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
@@ -1,14 +1,20 @@
1
1
  import path from 'node:path';
2
- import { readFile, writeFile, rename, lstat } from 'node:fs/promises';
3
- import { createHash } from 'node:crypto';
2
+ import { readFile, writeFile, rename, open, rm } from 'node:fs/promises';
3
+ import { createHash, randomUUID } from 'node:crypto';
4
+ import { parseDocument, isMap } from 'yaml';
4
5
  import { safeProjectFile } from './asset-import.mjs';
5
- import { clientIde, projectSkillPath } from '../integrations/hosts.mjs';
6
+ import { nativeContextPath } from './native-context.mjs';
7
+ import { hosts, clientIde, projectSkillPath } from '../integrations/hosts.mjs';
6
8
 
7
9
  const start = '<!-- craft-mcp:project:start -->';
8
10
  const end = '<!-- craft-mcp:project:end -->';
11
+ // Independent of engine bundle versions: generated recovery instructions evolve too.
12
+ export const entryPolicyVersion = 9;
13
+ const hash = value => createHash('sha256').update(value).digest('hex');
14
+ const normalizeLines = value => value.replace(/\r\n/g,'\n');
9
15
 
10
- export function projectContextPaths(project, ide = 'generic') {
11
- const host = clientIde(ide), relative = projectSkillPath(host);
16
+ export function projectContextPaths(project, ide = 'generic', schema = 5) {
17
+ const host = clientIde(ide), relative = projectSkillPath(host) ? nativeContextPath(host,schema)+'/skills/craft-project/SKILL.md' : null;
12
18
  const skill = relative ? path.join(project, relative) : null;
13
19
  return { entrypoint: path.join(project, 'AGENTS.md'), progress: path.join(project, 'SPEC/PROGRESS.md'), host, skill,
14
20
  ...(host === 'workbuddy' ? { workbuddy_skill: skill } : {}) };
@@ -19,7 +25,7 @@ function recovery(name, engine) {
19
25
  + '先读 `SPEC/PROGRESS.md` 和已有的 SPEC 设计文件,核对已完成玩法、待办及最近验收;缺少记录时检查源码与工具回执,不根据旧聊天猜测。\n\n'
20
26
  + `继续本工程前调用 \`craft_game_info({"name":"${name}"})\`,核对返回的 project 是当前目录、context_binding.status 为 bound。读取返回的 \`context.workflow\`、\`context.engine.entrypoint\` 和 \`context.engine.skills_index\`;按索引 description 选择技能,相对于 context.engine.directory 读取 entrypoint,再按需读取引用。\n\n`
21
27
  + `MCP 的 workspace 是游戏父目录,工程位于 \`workspace/${name}\`,不自动跟随宿主当前目录。若不匹配,先在宿主 MCP 设置中将 \`--workspace\` 参数(优先)或 \`CLIENT_WORKSPACE_ROOT\` 指向当前游戏的父目录并重连;不要在错误目录创建同名工程。\n\n`
22
- + `迁移目录或首次恢复时若提示尚未 prepare,确认 workspace 后调用 \`craft_game_prepare({"name":"${name}","engine":"${engine}"})\` 并轮询任务完成;已有合法工程只会被接管,不重置模板。目录更名后使用当前目录名(须符合工具的英文 name 规则)。\n\n`
28
+ + `迁移目录或首次恢复时若提示尚未 prepare,确认 workspace 后调用 \`craft_game_prepare({"name":"${name}","engine":"${engine}","mode":"resume","request_key":"resume-unique-key"})\` 并轮询任务完成;已有合法工程只会被接管,不重置模板。目录更名后使用当前目录名(须符合工具的英文 name 规则)。\n\n`
23
29
  + '项目以 `.craft/context-lock.json` 绑定引擎上下文版本,随项目保存;实际路径每次通过工具查询。缺少绑定时由 prepare 核验后建立,缺包或不兼容时按诊断恢复匹配版本,不删除锁文件来绕过检查。上下文、模板和技能脚本由 Craft 版本包提供,不复制到游戏中;MCP 未连接时先连接项目使用的 Craft 服务。\n\n'
24
30
  + '验收使用 `craft_game_check` → `craft_game_review` → `craft_game_deliver`;宿主按返回命令启动预览,再核对当前快照已运行。构建成功不代表预览自动开启。\n\n'
25
31
  + '完成开发或停在中间状态时更新 `SPEC/PROGRESS.md`:当前玩法和操作、已完成/待办、关键文件、最近验收任务及结果、预览状态和下一步。记录可核实的事实,验收失败也保留;预览地址须重新查询,只读任务不写进度。';
@@ -39,59 +45,191 @@ async function readOptional(file) {
39
45
  }
40
46
 
41
47
  function ownedSkill(content) {
42
- return content.startsWith('---\nname: craft-project\n') && content.includes(start) && content.endsWith(end + '\n');
48
+ const text=normalizeLines(content);
49
+ const frontmatter=text.match(/^---\nname: craft-project\n[\s\S]*?\n---\n[ \t\n]*/);
50
+ return !!frontmatter && text.slice(frontmatter[0].length).startsWith(start)
51
+ && text.split(start).length===2 && text.split(end).length===2 && text.endsWith(end + '\n');
43
52
  }
44
53
 
45
- // Retire only Craft's old discovery file, keeping its contents and all neighbouring user files.
46
- async function migrateWorkBuddySkill(project, canonicalStatus) {
47
- const relative = '.workbuddy/skills/craft-project/SKILL.md';
48
- let legacy;
49
- try { legacy = await safeProjectFile(project, relative); }
50
- catch (error) { if (error.code === 'ENOENT') return { status: 'not_present' }; throw error; }
51
- const content = await readOptional(legacy);
52
- if (!content) return { status: 'not_present' };
53
- if (!ownedSkill(content)) return { status: 'preserved_user_file', path: legacy };
54
- if (canonicalStatus !== 'managed') return { status: 'preserved_conflict', path: legacy };
55
- const suffix = '.craft-backup-' + createHash('sha256').update(content).digest('hex').slice(0, 16);
56
- const backup = await safeProjectFile(project, relative + suffix);
57
- try { await lstat(backup); throw new Error('Legacy Craft Skill backup already exists; preserve both files and resolve before preparing'); }
58
- catch (error) { if (error.code !== 'ENOENT') throw error; }
59
- if (await readFile(legacy, 'utf8') !== content) throw new Error('Legacy Craft Skill changed while preparing');
60
- await rename(legacy, backup);
61
- return { status: 'migrated', from: legacy, backup };
54
+ function skillStatus(content) {
55
+ if (!content || ownedSkill(content)) return 'managed';
56
+ // Partial or externally extended managed files need an explicit repair, not a
57
+ // false user-owned exemption. Truly independent same-name skills are retained.
58
+ if (content.includes(start) || content.includes(end)) throw new Error('Craft recovery Skill has conflicting managed markers; preserve and repair it before preparing');
59
+ return 'preserved_user_file';
62
60
  }
63
61
 
64
- export async function prepareProjectContext(project, name, engine, ide = 'generic', isolated = false) {
65
- const paths = projectContextPaths(project, ide);
66
- const entry = await safeProjectFile(project, 'AGENTS.md');
67
- const original = await readOptional(entry);
62
+ function ruleMetadata(content) {
63
+ const match=content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
64
+ if(!match) {
65
+ if(/^---(?:\r?\n|$)/.test(content)) throw new Error('Craft rule frontmatter is incomplete; repair it before preparing');
66
+ return null;
67
+ }
68
+ const document=parseDocument(match[1],{uniqueKeys:true});
69
+ if(document.errors.length || !isMap(document.contents)) throw new Error('Craft rule frontmatter must be an unambiguous mapping');
70
+ return {document,length:match[0].length};
71
+ }
72
+
73
+ function mergeRuleMetadata(original,prefix) {
74
+ const expected=ruleMetadata(prefix),current=ruleMetadata(original);
75
+ if(!current) return prefix+original;
76
+ let changed=false;
77
+ for(const [key,value] of Object.entries(expected.document.toJS())) {
78
+ if(current.document.get(key)!==value) {current.document.set(key,value);changed=true;}
79
+ }
80
+ if(!changed) return original;
81
+ // Preserve user fields and comments in the YAML document; text outside the
82
+ // frontmatter remains byte-for-byte unchanged until the managed block merge.
83
+ const newline=original.startsWith('---\r\n') ? '\r\n' : '\n';
84
+ const yaml=normalizeLines(current.document.toString()).replace(/\n/g,newline);
85
+ return '---'+newline+yaml+'---'+newline+original.slice(current.length);
86
+ }
87
+
88
+ function recoveryEntries(name, engine, ide = 'generic', isolated = false) {
89
+ const host = clientIde(ide);
68
90
  const body = isolated ? `Craft 工程名:\`${name}\`;引擎:\`${engine}\`。\n\n`
69
- + '先读取 `SPEC/PROGRESS.md` 和本次相关源码。调用当前宿主连接的 '
70
- + `\`craft_game_info({"name":"${name}"})\`,核对 project 为当前目录、context_binding.status 为 bound。\n\n`
71
- + '读取返回的 context.recovery、context.workflow、context.engine.entrypoint 和 context.engine.skills_index。实际知识和工作流只取该绑定包;不从其他宿主目录选择正文。\n\n'
72
- + `若尚未绑定当前宿主,确认 MCP workspace 为当前游戏父目录后,调用 \`craft_game_prepare({"name":"${name}","engine":"${engine}"})\` 并等待完成。已有项目不重建模板。\n\n`
73
- + '版本记录在 `.craft/context-lock.json`;普通恢复不升级上下文、不改写进度。缺包或不兼容时恢复匹配包,不删锁绕过检查。\n'
91
+ + '本项目为各宿主分别维护上下文。' + Object.entries(hosts).map(([id,definition])=>`${definition.label ?? id} 读取 \`${nativeContextPath(id)}/AGENTS.md\``).join(',') + ';按所用宿主显式读取对应目录的 `workflow.md`、`recovery.md`、`knowledge/` 和 `skills/`。若当前宿主目录尚未提供,先完成下述 prepare 流程,不借用其他宿主的调优正文。\n\n'
92
+ + '宿主可能兼容扫描其他目录;执行任务使用自身目录中的 Skill 正文,避免同名技能取到另一宿主的调优版本。\n\n'
93
+ + `新会话首次处理本工程时调用 \`craft_game_info({"name":"${name}"})\`,核对 project 和 workspace,再调用 \`craft_update_check({"name":"${name}","request_key":"resume-unique-key"})\` 检查 npm 与当前连接版本。MCP 的 workspace 必须是当前游戏父目录。\n\n`
94
+ + '继续制作时,若检查返回 update_available=true 且 automatic_update_enabled=true,自动调用 `craft_update`(name、mode=auto、同一 request_key)安装兼容新版;尚待重连或不兼容时先处理该状态。确认可继续后调用 craft_game_prepare,传 mode=resume、name 和同一 request_key,轮询成功后保存 work_id/context_revision,重新读取本地入口和技能索引。prepare 也会执行更新检查;重试复用 request_key,当前 work 内保持原版本。\n\n'
95
+ + '新版安装后在下次 MCP 启动或用户重连时加载,当前进程继续原版;不主动重载或结束已有工作。重连后核对实际版本、build_id、active_verified 与宿主范围,再恢复当前项目。\n\n'
96
+ + '待重连时按 connection_handoff 提示用户;先完成后台任务、保存进度并 release,再重连 Craft。只有宿主实际提示信任时才由用户确认。只重试明确未开始的 prepare,不重放结果不明的操作。\n\n'
97
+ + '读取 `SPEC/PROGRESS.md`、相关设计和源码;存在 `.craft/user-rules.md` 时一并读取。用户规则放在该文件或本文件管理段之外。官方正文由清单管理,更新前保留修改备份;游戏代码和用户进度保留。\n\n'
98
+ + '纯查看无需 prepare,查询不改任何项目文件。制作期间沿用 work_id;结束或暂停后等待后台任务结束、记录进度并 craft_game_release。`.craft/context-lock.json` 只记录各宿主版本与校验状态,不作为正文目录。\n'
74
99
  : recovery(name, engine);
75
- const updated = mergeEntry(original, start + '\n## Craft 项目恢复\n\n' + body + '\n' + end);
76
- const skill = paths.skill ? await safeProjectFile(project, projectSkillPath(paths.host), true) : null;
77
- const existingSkill = skill ? await readOptional(skill) : '';
100
+ const entry = start + '\n## Craft 项目恢复\n\n' + body + '\n' + end;
78
101
  const label = engine === 'js3d' ? '3D / Three.js' : '2D / Phaser';
79
102
  const desiredSkill = `---\nname: craft-project\ndescription: 继续、修改、调试、验收或预览当前 Craft ${label} 游戏 ${name};新会话恢复项目进度、引擎上下文和预览状态时使用。Continue this existing Craft game; use craft-create only for a new game.\n---\n\n`
80
103
  + start + '\n# 继续当前 Craft 游戏\n\n'
81
104
  + `1. 读取项目根 \`AGENTS.md\`,确认工程 \`${name}\` 和引擎 \`${engine}\`。\n`
82
- + '2. 按项目恢复规则读取 `SPEC/PROGRESS.md`、已有设计记录并调用 `craft_game_info`。核对工程路径、引擎与版本绑定后,读取返回的 context.recovery(如有)、工作流、引擎入口和技能索引,按任务描述选择技能。\n'
83
- + '3. 根据实际进度继续工作;仅恢复上下文时无需重新 prepare 或重建模板。完成修改后更新进度并按工作流验收、看图、启动预览。\n'
105
+ + (isolated ? '2. 新会话先调用只读 `craft_game_info` 核对项目,再调用 `craft_update_check`(name、本次 request_key)检查版本,不写文件。继续制作且发现可用新版、自动更新已启用时,调用 `craft_update`(name、mode=auto、同一 request_key)安装;新版下次启动或用户重连生效,核对实际版本后,等待可继续后调用 `craft_game_prepare`(mode=resume,同一 request_key)。轮询完成并保留 work_id/context_revision,重新读取本 Skill 相邻的 [引擎入口](../../AGENTS.md)、[恢复说明](../../recovery.md)、[工作流](../../workflow.md) 和 [技能索引](../index.json),按任务读取当前宿主 skills/ 下的正文。\n' : '2. 按根 AGENTS.md 查询 `craft_game_info`,读取返回的引擎入口、工作流与技能索引。\n')
106
+ + (isolated ? ' 新版安装后等待下次 MCP 启动或用户重连。确认实际 version、build_id、active_verified 后,prepare(resume) 更新当前宿主、原引擎的上下文和 Skill,再重新读取正文。\n' : '')
107
+ + (isolated ? ' 不主动重载或中断工作;按 connection_handoff 提示用户,先保存进度并 release。只重试明确未开始的 prepare,不重放结果不明的操作。\n' : '')
108
+ + '3. 纯查看只读现有文件,不 prepare。制作工具带 work_id;完成修改后更新进度并按工作流验收、看图、启动预览。等待后台任务结束后调用 craft_game_release(name,work_id)。重试准备复用原 request_key,下一轮制作使用新 key;resume 不安装依赖或重建模板。\n'
84
109
  + end + '\n';
110
+ let hostEntry;
111
+ if (isolated && ['codebuddy','cursor','claude'].includes(host)) {
112
+ const native = nativeContextPath(host);
113
+ hostEntry = {path:host === 'cursor' ? native+'/rules/craft.mdc' : native+(host === 'claude' ? '/CLAUDE.md' : '/CODEBUDDY.md'),
114
+ prefix:host === 'cursor' ? '---\ndescription: Craft 游戏项目规则与本地上下文入口\nalwaysApply: true\n---\n\n' : '',
115
+ body:start+'\n# Craft 项目上下文\n\n'
116
+ +`使用本宿主的 \`${native}/AGENTS.md\`、\`${native}/workflow.md\` 和 \`${native}/skills/\`。同名兼容技能以本目录正文为准。先按项目根 AGENTS.md 查询并检查更新;制作前确认当前连接版本、prepare 后重新读取本地入口、技能索引和 SPEC/PROGRESS.md。\n`+end};
117
+ }
118
+ return {entry,skill:desiredSkill,hostEntry,label};
119
+ }
120
+
121
+ // Hash what this generator expects, not a snapshot of whatever old text is on disk.
122
+ export function projectEntryPolicy(project, lock) {
123
+ const name = path.basename(project), engine = lock?.engine;
124
+ const entries = {'AGENTS.md':recoveryEntries(name,engine,'generic',true).entry};
125
+ for (const host of [...new Set(Object.values(lock?.active_hosts ?? {}))].sort()) {
126
+ const expected = recoveryEntries(name,engine,host,true);
127
+ entries[projectSkillPath(host)] = expected.skill;
128
+ if (expected.hostEntry) entries[expected.hostEntry.path] = expected.hostEntry.prefix + expected.hostEntry.body;
129
+ }
130
+ return {entry_policy_version:entryPolicyVersion,entry_policy_hash:hash(JSON.stringify(entries))};
131
+ }
132
+
133
+ function managedBlock(content) {
134
+ const text=normalizeLines(content);
135
+ if(text.split(start).length!==2 || text.split(end).length!==2 || text.indexOf(end)<text.indexOf(start)) return null;
136
+ return text.slice(text.indexOf(start),text.indexOf(end)+end.length);
137
+ }
138
+
139
+ // Validate the generator's expected managed content before acknowledging a new
140
+ // revision. A foreign same-name Skill is a documented AGENTS fallback, never
141
+ // proof that the host has registered Craft's project Skill.
142
+ export async function validateProjectRecoveryEntries(project,lock) {
143
+ const name=path.basename(project),engine=lock?.engine,skills={};
144
+ const root=await readFile(await safeProjectFile(project,'AGENTS.md'),'utf8');
145
+ if(managedBlock(root)!==recoveryEntries(name,engine,'generic',true).entry) throw new Error('Managed recovery entry does not match the installed policy: AGENTS.md');
146
+ for(const host of [...new Set(Object.values(lock?.active_hosts??{}))].sort()) {
147
+ const expected=recoveryEntries(name,engine,host,true),relative=projectSkillPath(host);
148
+ const content=await readFile(await safeProjectFile(project,relative),'utf8');
149
+ const status=skillStatus(content);
150
+ if(!content || (status==='managed' && normalizeLines(content)!==expected.skill)) throw new Error('Managed recovery entry does not match the installed policy: '+relative);
151
+ skills[host]={path:relative,status:status==='managed'?'managed':'user_override',
152
+ ...(status==='managed'?{}:{fallback:'AGENTS.md'})};
153
+ if(expected.hostEntry) {
154
+ const entry=expected.hostEntry,actual=await readFile(await safeProjectFile(project,entry.path),'utf8');
155
+ if(managedBlock(actual)!==entry.body) throw new Error('Managed recovery entry does not match the installed policy: '+entry.path);
156
+ if(entry.prefix) {
157
+ const wanted=ruleMetadata(entry.prefix),present=ruleMetadata(actual);
158
+ if(!present || Object.entries(wanted.document.toJS()).some(([key,value])=>present.document.get(key)!==value)) throw new Error('Managed recovery metadata does not match the installed policy: '+entry.path);
159
+ }
160
+ }
161
+ }
162
+ return {native_status:'unverified',skills};
163
+ }
164
+
165
+ async function replaceEntry(project, relative, original, next, guard) {
166
+ if (next === original) return;
167
+ await guard();
168
+ const destination = await safeProjectFile(project,relative,true);
169
+ if (await readOptional(destination) !== original) throw new Error('Recovery entry changed during preparation: '+relative);
170
+ if (original) {
171
+ const backup = await safeProjectFile(project,`.craft/context-backups/entries/${hash(relative)}/${hash(original)}.md`,true);
172
+ const prior = await readOptional(backup);
173
+ if (prior && prior !== original) throw new Error('Recovery entry backup integrity failed: '+relative);
174
+ if (!prior) {
175
+ const stagedBackup = backup+'.'+randomUUID()+'.tmp';
176
+ const saved = await open(stagedBackup,'wx');
177
+ try { await saved.writeFile(original); await saved.sync(); }
178
+ catch (error) { await saved.close(); await rm(stagedBackup,{force:true}); throw error; }
179
+ await saved.close();
180
+ try { await rename(stagedBackup,backup); }
181
+ finally { await rm(stagedBackup,{force:true}); }
182
+ }
183
+ }
184
+ const temporary = await safeProjectFile(project,relative+'.craft-'+randomUUID()+'.tmp',true);
185
+ const handle = await open(temporary,'wx');
186
+ try { await handle.writeFile(next); await handle.sync(); }
187
+ catch (error) { await handle.close(); await rm(temporary,{force:true}); throw error; }
188
+ await handle.close();
189
+ try {
190
+ await guard();
191
+ if (await readOptional(await safeProjectFile(project,relative)) !== original) throw new Error('Recovery entry changed during preparation: '+relative);
192
+ await rename(temporary,destination);
193
+ } finally { await rm(temporary,{force:true}); }
194
+ }
195
+
196
+ async function prepareOneProjectContext(project, name, engine, ide = 'generic', isolated = false, guard = async()=>{}) {
197
+ const paths = projectContextPaths(project, ide), expected = recoveryEntries(name,engine,ide,isolated);
198
+ const entry = await safeProjectFile(project,'AGENTS.md'), original = await readOptional(entry);
199
+ const updated = mergeEntry(original,expected.entry);
200
+ const skill = paths.skill ? await safeProjectFile(project,projectSkillPath(paths.host),true) : null;
201
+ const existingSkill = skill ? await readOptional(skill) : '';
202
+ const label = expected.label;
85
203
  // A same-name user skill is not ours to replace. AGENTS.md remains the recovery entry.
86
- const skillStatus = !skill ? 'not_requested' : existingSkill && !ownedSkill(existingSkill) ? 'preserved_user_file' : 'managed';
204
+ const status = !skill ? 'not_requested' : skillStatus(existingSkill);
87
205
  const progress = await safeProjectFile(project, 'SPEC/PROGRESS.md', true);
88
206
  // This is project-owned state, never regenerated by prepare or a runtime upgrade.
89
207
  try { await writeFile(progress, `# Craft 项目进度\n\n- 工程:\`${name}\`\n- 引擎:\`${engine}\`(${label})\n- 上下文入口:\`AGENTS.md\`\n\n## 当前状态\n\n已建立项目恢复入口。玩法、开发进度及验收结果尚待核对,请依据现有源码与工具回执补充。\n\n## 后续工作\n\n读取已有 SPEC 设计文件和源码,按用户需求继续开发;记录已完成事项、待办、操作方式、关键文件和验收任务。\n`, { flag: 'wx' }); }
90
208
  catch (error) { if (error.code !== 'EEXIST') throw error; }
91
- if (updated !== original) await writeFile(entry, updated);
92
- if (skillStatus === 'managed' && existingSkill !== desiredSkill) await writeFile(skill, desiredSkill);
93
- const migration = paths.host === 'workbuddy' ? await migrateWorkBuddySkill(project, skillStatus) : null;
94
- return { ...paths, skill_status: skillStatus,
95
- ...(migration ? { legacy_skill: migration } : {}),
96
- ...(paths.host === 'workbuddy' ? { workbuddy_skill_status: skillStatus } : {}) };
209
+ await replaceEntry(project,'AGENTS.md',original,updated,guard);
210
+ if (status === 'managed') await replaceEntry(project,projectSkillPath(paths.host),existingSkill,expected.skill,guard);
211
+ if (expected.hostEntry) {
212
+ const {path:relative,prefix,body} = expected.hostEntry;
213
+ const file = await safeProjectFile(project,relative,true), prior = await readOptional(file);
214
+ const next = mergeEntry(prefix ? mergeRuleMetadata(prior,prefix) : prior,body);
215
+ await replaceEntry(project,relative,prior,next,guard);
216
+ paths.host_entrypoint = file;
217
+ }
218
+ return { ...paths, skill_status: status,
219
+ discovery:{native_status:'unverified',status:status==='preserved_user_file'?'user_override':status,
220
+ ...(status==='preserved_user_file'?{fallback:paths.entrypoint}:{})},
221
+ ...(paths.host === 'workbuddy' ? { workbuddy_skill_status: status } : {}) };
222
+ }
223
+
224
+ // Populate all installed surfaces, not the user's global MCP configuration.
225
+ export async function prepareProjectContext(project,name,engine,ide='generic',isolated=false,guard=async()=>{}) {
226
+ const result=await prepareOneProjectContext(project,name,engine,ide,isolated,guard);
227
+ if(isolated) {
228
+ const file=await safeProjectFile(project,'.craft/context-lock.json');
229
+ const lock=JSON.parse(await readFile(file,'utf8'));
230
+ for(const host of Object.values(lock.active_hosts??{})) {
231
+ if(host!==ide) await prepareOneProjectContext(project,name,engine,host,true,guard);
232
+ }
233
+ }
234
+ return result;
97
235
  }
@@ -1,52 +1,123 @@
1
1
  import path from 'node:path';
2
- import { mkdir, lstat, realpath } from 'node:fs/promises';
2
+ import { mkdir, lstat, realpath, readFile } from 'node:fs/promises';
3
+ import { randomUUID, createHash } from 'node:crypto';
3
4
  import lockfile from 'proper-lockfile';
5
+ import { atomicJson } from './request-store.mjs';
4
6
 
5
- // Use one policy for every process. Locks survive separate CLIENT_DATA_DIR profiles.
7
+ // A live process renews this lease even while its host edits files outside MCP.
6
8
  export const leaseOptions = Object.freeze({ realpath:false, stale:30000, update:10000, retries:0 });
9
+ const failure = (code,message) => Object.assign(new Error(message),{detail:{code}});
10
+ async function optional(file) {
11
+ try { return JSON.parse(await readFile(file,'utf8')); } catch(error) { if(error.code!=='ENOENT') throw error; return null; }
12
+ }
7
13
 
8
14
  export class ProjectLeases {
9
15
  #held = new Map();
10
16
  #pending = new Map();
17
+ #updates = new Map();
11
18
  #closed = false;
12
- constructor(workspace, onLost) {
13
- this.directory = path.join(workspace,'.craft-mcp-locks');
14
- this.onLost = onLost;
15
- }
19
+ constructor(workspace,onLost) { this.directory=path.join(workspace,'.craft-mcp-locks'); this.onLost=onLost; }
20
+ get activeCount() { return this.#held.size + this.#pending.size; }
21
+ hasRequest(name, requestKey) { return this.#held.get(name)?.record.request_key === requestKey; }
16
22
  async init() {
17
23
  await mkdir(this.directory,{recursive:true,mode:0o700});
18
- if ((await lstat(this.directory)).isSymbolicLink() || await realpath(this.directory) !== this.directory) throw new Error('Project lock directory must not be a symbolic link');
19
- }
20
- async acquire(name) {
21
- if (!/^[a-z][a-z0-9-]{0,47}$/.test(name)) throw new Error('Invalid project name');
22
- if (this.#closed) throw new Error('Project leases are closing');
23
- if (this.#held.has(name)) {
24
- if (this.#held.get(name).lost) throw new Error('工程占用锁失效,请关闭本会话的 Craft 并重新连接后准备工程。');
25
- return;
24
+ if ((await lstat(this.directory)).isSymbolicLink() || await realpath(this.directory)!==this.directory) throw new Error('Project lock directory must not be a symbolic link');
25
+ }
26
+ file(name) {
27
+ if(typeof name!=='string' || !/^[a-z][a-z0-9-]{0,47}$/.test(name)) throw new Error('Invalid project name');
28
+ return path.join(this.directory,name);
29
+ }
30
+ receipt(name,key) { return this.file(name)+'.request-'+createHash('sha256').update(key).digest('hex')+'.json'; }
31
+ async observe(name) {
32
+ const occupied=await lockfile.check(this.file(name),leaseOptions);
33
+ const owner=await optional(this.file(name)+'.owner.json');
34
+ const generation=owner ? createHash('sha256').update(owner.work_id+':'+owner.status).digest('hex').slice(0,24) : null;
35
+ return {occupied,generation,...(occupied ? {status:owner?.status??'preparing',host:owner?.host,started_at:owner?.started_at} : {})};
36
+ }
37
+ async acquire(name,{request_key,work_id,host,mode,engine}={}) {
38
+ this.file(name);
39
+ if(this.#closed) throw new Error('Project leases are closing');
40
+ if(work_id) {
41
+ const work=await this.assert(name,work_id,{ready:false});
42
+ if((engine!==undefined && work.engine!==undefined && work.engine!==engine) || mode!==work.mode || request_key!==work.request_key) throw new Error('A work_id retry must keep its original mode, engine and request_key');
43
+ return work;
44
+ }
45
+ if(typeof request_key!=='string' || !/^[a-zA-Z0-9._:-]{1,128}$/.test(request_key)) throw new Error('A stable request_key (1-128 letters, digits, . _ : -) is required');
46
+ const intent=JSON.stringify({host,mode,engine});
47
+ const prior=this.#pending.get(name);
48
+ if(prior) { await prior; return this.acquire(name,{request_key,host,mode,engine}); }
49
+ const held=this.#held.get(name);
50
+ if(held) {
51
+ if(held.record.request_key===request_key && held.intent===intent) return this.assert(name,held.record.work_id,{ready:false});
52
+ throw failure('CRAFT_PROJECT_IN_USE','This project has an active work. Finish and craft_game_release its work_id before preparing another work, including in the same MCP connection.');
26
53
  }
27
- if (this.#pending.has(name)) return this.#pending.get(name);
28
- const pending = this.#acquire(name);
29
- this.#pending.set(name,pending);
30
- try { await pending; } finally { this.#pending.delete(name); }
54
+ const promise=this.#acquire(name,{request_key,host,mode,engine},intent);
55
+ this.#pending.set(name,promise);
56
+ try {return await promise;} finally {this.#pending.delete(name);}
31
57
  }
32
- async #acquire(name) {
33
- const lease = {lost:false};
58
+ async #acquire(name,input,intent) {
59
+ const lease={lost:false,intent};
34
60
  try {
35
- lease.release = await lockfile.lock(path.join(this.directory,name),{...leaseOptions,onCompromised:error=>{
36
- lease.lost = true;
37
- void Promise.resolve(this.onLost?.(name,error)).catch(()=>{});
61
+ lease.release=await lockfile.lock(this.file(name),{...leaseOptions,onCompromised:error=>{
62
+ lease.lost=true; void Promise.resolve(this.onLost?.(name,error)).catch(()=>{});
38
63
  }});
39
- } catch (error) {
40
- if (error.code !== 'ELOCKED') throw error;
41
- throw Object.assign(new Error(`工程「${name}」正由另一个 Craft 会话使用。请在原会话继续,或关闭原会话的 Craft 后重试;并行制作请使用不同的 name。异常退出后最多等待 30 秒释放。`),{detail:{code:'CRAFT_PROJECT_IN_USE',project:name}});
64
+ } catch(error) {
65
+ if(error.code!=='ELOCKED') throw error;
66
+ throw failure('CRAFT_PROJECT_IN_USE','Another work owns this project. Read-only queries remain available. Ask the owning work to finish and release; abnormal process exit expires within 30 seconds.');
67
+ }
68
+ try {
69
+ if(this.#closed) throw new Error('Project leases are closing');
70
+ if(await optional(this.receipt(name,input.request_key))) throw failure('CRAFT_WORK_ENDED','This prepare request already ended or was interrupted. Inspect the project and start a new work with a new request_key.');
71
+ lease.record={...input,name,work_id:randomUUID(),status:'preparing',started_at:new Date().toISOString()};
72
+ await atomicJson(this.receipt(name,input.request_key),lease.record);
73
+ await atomicJson(this.file(name)+'.work-'+lease.record.work_id+'.json',lease.record);
74
+ await atomicJson(this.file(name)+'.owner.json',lease.record);
75
+ this.#held.set(name,lease);
76
+ return {...lease.record};
77
+ } catch(error) {await lease.release(); throw error;}
78
+ }
79
+ async assert(name,work_id,{ready=true,context_revision}={}) {
80
+ this.file(name);
81
+ const lease=this.#held.get(name);
82
+ if(!work_id || !lease || lease.record.work_id!==work_id) throw failure('CRAFT_WORK_REQUIRED','Prepare this project first, then pass its exact work_id. A work from another session or an ended work cannot authorize this operation.');
83
+ if(lease.lost || !await lockfile.check(this.file(name),leaseOptions)) throw failure('CRAFT_WORK_LOST','Project ownership was lost. Stop editing and prepare a new work after recovery.');
84
+ if(ready && lease.record.status!=='active') throw failure('CRAFT_WORK_NOT_READY','Wait for prepare to complete before using this work.');
85
+ if(context_revision!==undefined && context_revision!==lease.record.context_revision) throw failure('CRAFT_CONTEXT_CHANGED','Context revision differs from this work.');
86
+ return {...lease.record};
87
+ }
88
+ async update(name,work_id,fields) {
89
+ // A fast resume can finish while its task handle is still being persisted.
90
+ // Publish one coherent receipt at a time (also avoids racing Windows renames).
91
+ const previous=this.#updates.get(name)??Promise.resolve();
92
+ const pending=previous.catch(()=>{}).then(async()=>{
93
+ await this.assert(name,work_id,{ready:false});
94
+ const lease=this.#held.get(name),record={...lease.record,...fields};
95
+ await atomicJson(this.receipt(name,record.request_key),record);
96
+ await atomicJson(this.file(name)+'.work-'+work_id+'.json',record);
97
+ await atomicJson(this.file(name)+'.owner.json',record);
98
+ lease.record=record;
99
+ return {...record};
100
+ });
101
+ this.#updates.set(name,pending);
102
+ try {return await pending;} finally {if(this.#updates.get(name)===pending) this.#updates.delete(name);}
103
+ }
104
+ async release(name,work_id,status='released') {
105
+ const held=this.#held.get(name);
106
+ if(!held || held.record.work_id!==work_id) {
107
+ if(typeof work_id!=='string' || !/^[a-f0-9-]{36}$/.test(work_id)) throw failure('CRAFT_WORK_REQUIRED','Invalid work_id');
108
+ const record=await optional(this.file(name)+'.work-'+work_id+'.json');
109
+ if(record?.work_id===work_id && ['released','failed','interrupted'].includes(record.status)) return {work_id,status:record.status};
110
+ throw failure('CRAFT_WORK_REQUIRED','Only the exact owning work can be released.');
42
111
  }
43
- if (this.#closed) { await lease.release(); throw new Error('Project leases are closing'); }
44
- this.#held.set(name,lease);
112
+ await this.assert(name,work_id,{ready:false});
113
+ const record=await this.update(name,work_id,{status,finished_at:new Date().toISOString()});
114
+ await held.release(); this.#held.delete(name);
115
+ return {work_id,status:record.status};
45
116
  }
46
117
  async close() {
47
- this.#closed = true;
118
+ this.#closed=true;
48
119
  await Promise.allSettled([...this.#pending.values()]);
49
- await Promise.allSettled([...this.#held.values()].filter(lease=>!lease.lost).map(lease=>lease.release()));
120
+ await Promise.allSettled([...this.#held.entries()].filter(([,v])=>!v.lost).map(([name,v])=>this.release(name,v.record.work_id,'interrupted')));
50
121
  this.#held.clear();
51
122
  }
52
123
  }
@@ -1,13 +1,16 @@
1
1
  import path from 'node:path';
2
+ import { createReadStream } from 'node:fs';
2
3
  import { mkdir, readFile, writeFile, lstat, realpath, readdir } from 'node:fs/promises';
3
4
  import { createHash } from 'node:crypto';
4
5
  import { seedProjectTemplate } from '#craft-sdk';
5
6
  import { atomicJson } from './request-store.mjs';
6
7
  import { assetConfig, safeProjectFile } from './asset-import.mjs';
7
8
  import { engineDefinition } from './engines.mjs';
8
- import { prepareProjectContext } from './project-context.mjs';
9
+ import { prepareProjectContext, projectContextPaths } from './project-context.mjs';
9
10
  import { clientIde } from '../integrations/hosts.mjs';
10
- import { ProjectBundles, readContextLock, contextBinding } from './project-bundles.mjs';
11
+ import { ProjectBundles, readContextLock, contextBinding, checkProjectCompatibility } from './project-bundles.mjs';
12
+ import { contextLayoutSchema, inspectNativeContext, nativeContextPath, nativeSelection } from './native-context.mjs';
13
+ import { inspectContextState, beginContextPreparation, finishContextPreparation } from './context-state.mjs';
11
14
 
12
15
  async function inspectProject(project, expected) {
13
16
  const runtime = JSON.parse(await readFile(await safeProjectFile(project,'game-runtime.json'),'utf8'));
@@ -43,6 +46,42 @@ export class Projects {
43
46
  async owned(name) {
44
47
  return (await this.describe(name)).project;
45
48
  }
49
+ async inspect(name,{full=false}={}) {
50
+ const project=this.file(name);
51
+ if((await lstat(project)).isSymbolicLink() || await realpath(project)!==project) throw new Error('Project path changed or is a symbolic link');
52
+ const record=await readRecord(path.join(this.state,name+'.json'),project);
53
+ const engine=await inspectProject(project,record?.engine),installed=this.engines[engine];
54
+ let lock,invalid;
55
+ try {lock=await readContextLock(project,engine);} catch(error) {invalid=error.message;}
56
+ const binding=invalid ? {status:'invalid',reason:invalid} : contextBinding(lock,this.ide,engine);
57
+ const entry=lock?.contexts?.[this.ide];
58
+ let version_status='unknown';
59
+ if(entry) {
60
+ const difference=(entry.version??'').split('.').map((n,i)=>Number(n)-Number(installed.bundle.version?.split('.')[i])).find(n=>n!==0)??0;
61
+ version_status=entry.bundle_id===installed.bundle.id ? 'matches_installed' : difference>0 ? 'requires_newer_runtime' : difference<0 ? 'update_available' : 'unknown';
62
+ }
63
+ const layoutSchema=lock?.schema===4 ? 4 : contextLayoutSchema;
64
+ const native=installed.host ? await inspectNativeContext(project,this.ide,engine,{full,schema:layoutSchema}) : {integrity:'unchecked'};
65
+ let incompatible;
66
+ try {await checkProjectCompatibility(project,installed.bundle);} catch(error) {incompatible=error.message;}
67
+ if(full && installed.host && lock?.schema===contextLayoutSchema && version_status==='matches_installed' && native.integrity==='valid') {
68
+ try {await this.bundles.resolve(project,engine,lock);} catch(error) {native.integrity='invalid';native.reason=error.message;}
69
+ }
70
+ const state=await inspectContextState(project,lock,{full});
71
+ let preparation={...state};
72
+ if(invalid) preparation={status:'blocked',reason:invalid};
73
+ else if(incompatible) preparation={status:'blocked',reason:incompatible};
74
+ else if(version_status==='requires_newer_runtime') preparation={status:'blocked',reason:'Connect a newer Craft runtime; context cannot be downgraded'};
75
+ else if(lock?.schema===4 && !['blocked','recovery_required'].includes(state.status)) preparation={status:'migration_required',reason:'context_layout_migration_required',from_schema:4,to_schema:contextLayoutSchema};
76
+ else if(!['recovery_required','blocked'].includes(state.status) && (version_status!=='matches_installed' || native.integrity==='invalid' || native.integrity==='modified' || (installed.host && lock?.active_hosts?.[nativeContextPath(this.ide)]!==this.ide) || !record)) preparation={status:'required',reason:!record ? 'registration_required' : 'Prepare installed context and recovery entries before editing'};
77
+ // A committed version may change while a read-only query is in flight.
78
+ if(!invalid) try {if(JSON.stringify(await readContextLock(project,engine))!==JSON.stringify(lock)) preparation={status:'updating',reason:'Context commit changed during inspection; query again'};} catch {preparation={status:'updating',reason:'Context commit changed during inspection; query again'};}
79
+ return {name,project,engine,registration_required:!record,context_binding:binding,
80
+ version_status,integrity:{status:native.integrity,...(native.reason ? {reason:native.reason} : {})},preparation,
81
+ project_context:{...projectContextPaths(project,this.ide,layoutSchema),...(state.discovery?.skills?.[this.ide] ? {discovery:{native_status:state.discovery.native_status,...state.discovery.skills[this.ide]}} : {})},
82
+ ...(installed.host ? {context_layout:{schema:lock?.schema??null,target_schema:contextLayoutSchema,status:lock?.schema===4?'migration_required':lock?.schema===contextLayoutSchema?'current':'unbound',directory:nativeContextPath(this.ide,layoutSchema),target_directory:nativeContextPath(this.ide)},
83
+ context:{...nativeSelection(project,installed,{schema:layoutSchema}).context,target:{host:this.ide,engine,version:entry?.version,bundle_id:entry?.bundle_id}}} : {})};
84
+ }
46
85
  async describe(name, {allowUnbound = false} = {}) {
47
86
  const project = this.file(name);
48
87
  if ((await lstat(project)).isSymbolicLink() || await realpath(project) !== project) throw new Error('Project path changed or is a symbolic link');
@@ -51,8 +90,11 @@ export class Projects {
51
90
  const engine = await inspectProject(project,record.engine);
52
91
  const lock = await readContextLock(project,engine);
53
92
  const binding = contextBinding(lock,this.ide,engine);
54
- if (binding.status === 'bound' || !allowUnbound) await this.bundles.resolve(project,engine,lock);
55
- return { name, project, engine, context_binding:binding };
93
+ let selected;
94
+ if (binding.status === 'bound' || !allowUnbound) {
95
+ selected = await this.bundles.resolve(project,engine,lock);
96
+ }
97
+ return { name, project, engine, context_binding:contextBinding(lock,this.ide,engine),project_context:projectContextPaths(project,this.ide) };
56
98
  }
57
99
  async resourcesFor(description) {
58
100
  return this.bundles.resolve(description.project,description.engine,await readContextLock(description.project,description.engine));
@@ -62,8 +104,11 @@ export class Projects {
62
104
  if (requestedEngine !== undefined) engineDefinition(requestedEngine);
63
105
  const project = this.file(name);
64
106
  let created = false;
65
- try { await mkdir(project); created = true; }
66
- catch (error) { if (error.code !== 'EEXIST') throw error; }
107
+ if(options.mode==='resume') await lstat(project);
108
+ else {
109
+ try { await mkdir(project); created = true; }
110
+ catch (error) { if (error.code !== 'EEXIST') throw error; if(options.mode==='create') throw new Error('Project already exists; use mode=resume to continue it'); }
111
+ }
67
112
  if (await realpath(project) !== project || (await lstat(project)).isSymbolicLink()) throw new Error('Project must not be a symbolic link');
68
113
  const recordFile = path.join(this.state,name + '.json');
69
114
  const record = await readRecord(recordFile,project);
@@ -71,9 +116,33 @@ export class Projects {
71
116
  if (created) await seedProjectTemplate(this.engines[requestedEngine ?? record?.engine ?? 'js'].template,project,{ signal });
72
117
  // Existing Craft games are adopted, never overwritten or silently converted from another engine.
73
118
  const engine = await inspectProject(project,record?.engine ?? requestedEngine);
74
- const lock = await this.bundles.bind(project,engine,options);
119
+ if(this.engines[engine].host) {
120
+ if(options.upgrade_context!==undefined && typeof options.upgrade_context!=='boolean') throw new Error('upgrade_context must be boolean');
121
+ if(options.context_bundle_id!==undefined && options.context_bundle_id!==this.engines[engine].bundle.id) throw new Error('Contexts follow the installed release; select the desired MCP release instead of pinning an older context');
122
+ }
123
+ const guard=async()=>{signal?.throwIfAborted(); await options.guard?.();};
124
+ await guard();
125
+ let sync;
126
+ if(this.engines[engine].host) {
127
+ const lock=await readContextLock(project,engine);
128
+ const ready=await inspectContextState(project,lock,{full:true});
129
+ if(ready.status==='blocked') throw new Error(ready.reason);
130
+ let selected;
131
+ if(ready.status==='ready') {try {selected=await this.bundles.resolve(project,engine,lock);} catch { /* Explicit prepare repairs or reports the precise compatibility error below. */ }}
132
+ if(selected) sync={lock,selected,context_revision:ready.context_revision,project_context:{...projectContextPaths(project,this.ide),...(ready.discovery?.skills?.[this.ide] ? {discovery:{native_status:ready.discovery.native_status,...ready.discovery.skills[this.ide]}} : {})},sync:{policy:'follow-installed',location:'project',status:'current',version:selected.bundle.version,bundle_id:selected.bundle.id,directory:selected.resources}};
133
+ else {
134
+ await beginContextPreparation(project,this.ide);
135
+ sync=await this.bundles.synchronize(project,engine,{...options,allowAttach:true,guard,finalize:async (lock,verifyPublished)=>{
136
+ await guard();
137
+ const project_context=await prepareProjectContext(project,name,engine,this.ide,true,guard);
138
+ return {project_context,context_revision:await finishContextPreparation(project,lock,async()=>{await guard();await verifyPublished();})};
139
+ }});
140
+ sync.sync.status='updated';
141
+ }
142
+ }
143
+ const lock = sync ? sync.lock : await this.bundles.bind(project,engine,options);
75
144
  signal?.throwIfAborted();
76
- if (engine === 'js3d') {
145
+ if (created && engine === 'js3d') {
77
146
  const assets = await safeProjectFile(project,'configs/assets.json');
78
147
  try { await writeFile(assets,'{}\n',{flag:'wx'}); }
79
148
  catch (error) { if (error.code !== 'EEXIST') throw error; }
@@ -81,27 +150,36 @@ export class Projects {
81
150
  await assetConfig(project);
82
151
  signal?.throwIfAborted();
83
152
  if (!record?.engine) await atomicJson(recordFile,{ schema:1, name, project, engine });
84
- const project_context = await prepareProjectContext(project, name, engine, this.ide, lock.schema === 2);
85
- return { name, project, created, engine, project_context, context_binding:contextBinding(lock,this.ide,engine) };
153
+ const project_context = sync?.project_context ?? await prepareProjectContext(project, name, engine, this.ide, lock.schema >= 2, guard);
154
+ return { name, project, created, engine, project_context, context_binding:contextBinding(lock,this.ide,engine),...(sync ? {context_sync:sync.sync,context_revision:sync.context_revision} : {context_revision:createHash('sha256').update(JSON.stringify(lock)).digest('hex')}) };
155
+ }
156
+ async assertRevision(name,revision) {
157
+ const description=await this.describe(name),lock=await readContextLock(description.project,description.engine);
158
+ const state=this.engines[description.engine].host ? await inspectContextState(description.project,lock,{full:true}) : {status:'ready',context_revision:createHash('sha256').update(JSON.stringify(lock)).digest('hex')};
159
+ if(state.status!=='ready' || state.context_revision!==revision) throw new Error('Context revision changed or preparation is incomplete; stop editing and prepare again after releasing this work');
160
+ return description;
86
161
  }
87
162
  }
88
163
 
89
164
  const skip = new Set(['node_modules','dist','.git','.visualqa','.cache','.vite','.turbo']);
90
165
  export async function fingerprint(project) {
91
- const hash = createHash('sha256'); let files = 0, bytes = 0;
166
+ const hash = createHash('sha256'); let files = 0;
92
167
  async function walk(dir, relative) {
93
168
  const entries = (await readdir(dir,{ withFileTypes:true })).sort((a,b)=>a.name.localeCompare(b.name));
94
169
  for (const entry of entries) {
95
170
  if (skip.has(entry.name)) continue;
96
171
  const file = path.join(dir,entry.name), key = relative + '/' + entry.name;
172
+ // Version history is not a game input. The active sync record below is fingerprinted.
173
+ if (['/.craft/contexts','/.craft/context-backups'].includes(key)) continue;
97
174
  if (entry.isSymbolicLink()) throw new Error('Source symbolic links are not supported: ' + key);
98
175
  if (entry.isDirectory()) { await walk(file,key); continue; }
99
176
  if (!entry.isFile()) throw new Error('Unsupported source file: ' + key);
100
177
  // Session handoff notes are not build inputs. Recording a check receipt must not invalidate that check.
101
178
  if (key === '/SPEC/PROGRESS.md' || /^\/\.workbuddy\/memory\/.*\.md$/.test(key)) continue;
102
- const stat = await lstat(file);
103
- if (++files > 10000 || (bytes += stat.size) > 128 * 1024 * 1024) throw new Error('Project exceeds source snapshot limits');
104
- hash.update(key).update('\0').update(await readFile(file)).update('\0');
179
+ if (++files > 10000) throw new Error('Project exceeds source snapshot file count limit');
180
+ hash.update(key).update('\0');
181
+ for await (const chunk of createReadStream(file)) hash.update(chunk);
182
+ hash.update('\0');
105
183
  }
106
184
  }
107
185
  await walk(project,'');