@craft_eco/craft-mcp 0.1.28 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (980) hide show
  1. package/README.md +23 -17
  2. package/bin/craft-mcp.mjs +4 -1
  3. package/dist-server/game-workflow/asset-import.mjs +5 -1
  4. package/dist-server/game-workflow/assets.mjs +6 -2
  5. package/dist-server/game-workflow/bundle-files.mjs +9 -6
  6. package/dist-server/game-workflow/check.mjs +5 -0
  7. package/dist-server/game-workflow/context-state.mjs +67 -0
  8. package/dist-server/game-workflow/draft-uploads.mjs +3 -0
  9. package/dist-server/game-workflow/engines.mjs +3 -3
  10. package/dist-server/game-workflow/library-assets.mjs +2 -1
  11. package/dist-server/game-workflow/local-context.mjs +62 -0
  12. package/dist-server/game-workflow/native-context.mjs +289 -0
  13. package/dist-server/game-workflow/project-bundles.mjs +246 -129
  14. package/dist-server/game-workflow/project-context.mjs +183 -45
  15. package/dist-server/game-workflow/project-leases.mjs +101 -30
  16. package/dist-server/game-workflow/projects.mjs +86 -10
  17. package/dist-server/game-workflow/publications.mjs +5 -1
  18. package/dist-server/game-workflow/tasks.mjs +6 -1
  19. package/dist-server/game-workflow/work-scope.mjs +7 -0
  20. package/dist-server/integrations/config.mjs +145 -71
  21. package/dist-server/integrations/connection-handoff.mjs +42 -0
  22. package/dist-server/integrations/dsh-config.mjs +182 -0
  23. package/dist-server/integrations/files.mjs +54 -54
  24. package/dist-server/integrations/hosts.mjs +55 -35
  25. package/dist-server/integrations/install.mjs +205 -86
  26. package/dist-server/integrations/installation-state.mjs +84 -0
  27. package/dist-server/integrations/runtime-gc.mjs +188 -0
  28. package/dist-server/integrations/runtime.mjs +126 -72
  29. package/dist-server/integrations/updates.mjs +225 -0
  30. package/dist-server/integrations/version-policy.mjs +32 -0
  31. package/dist-server/mcp/control-panel.mjs +5 -2
  32. package/dist-server/mcp/publish-panel.mjs +7 -2
  33. package/dist-server/mcp/server.mjs +134 -26
  34. package/dist-server/mcp/start.mjs +8 -2
  35. package/dist-server/mcp/update-session.mjs +92 -0
  36. package/package.json +2 -2
  37. package/resources/context-filter-report.json +177 -0
  38. package/resources/craft-create/SKILL.md +19 -11
  39. package/resources/craft-update/SKILL.md +25 -0
  40. package/resources/targets/claude/js/bootstrap/SKILL.md +18 -0
  41. package/resources/targets/claude/js/context-filter-report.json +27 -0
  42. package/resources/targets/claude/js/craft-game-maker/SKILL.md +76 -0
  43. package/resources/targets/claude/js/craft-game-maker/js.md +10 -0
  44. package/resources/targets/claude/js/js/bundle.json +97 -0
  45. package/resources/targets/claude/js/js/context/AGENTS.md +29 -0
  46. package/resources/targets/claude/js/js/context/hooks/hooks.json +14 -0
  47. package/resources/targets/claude/js/js/context/knowledge/AssetUrl.md +9 -0
  48. package/resources/targets/claude/js/js/context/knowledge/AssetWiring.md +7 -0
  49. package/resources/targets/claude/js/js/context/knowledge/Layout.md +7 -0
  50. package/resources/targets/claude/js/js/context/knowledge/Lifecycle.md +11 -0
  51. package/resources/targets/claude/js/js/context/knowledge/ResourceLoading.md +9 -0
  52. package/resources/targets/claude/js/js/context/skills/export-config/SKILL.md +16 -0
  53. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  54. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  55. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  56. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  57. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  58. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  59. package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  60. package/resources/targets/claude/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  61. package/resources/targets/claude/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  62. package/resources/targets/claude/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  63. package/resources/targets/claude/js/js/context/skills/index.json +19 -0
  64. package/resources/targets/claude/js/js/context/skills/visual-qa/SKILL.md +14 -0
  65. package/resources/targets/claude/js/js/project/README.md +7 -0
  66. package/resources/targets/claude/js/js/project/configs/assets.json +1 -0
  67. package/resources/targets/claude/js/js/project/configs/game.controls.json +3 -0
  68. package/resources/targets/claude/js/js/project/configs/game.json +3 -0
  69. package/resources/targets/claude/js/js/project/game-runtime.json +7 -0
  70. package/resources/targets/claude/js/js/project/game.config.json +7 -0
  71. package/resources/targets/claude/js/js/project/index.html +20 -0
  72. package/resources/targets/claude/js/js/project/package.json +22 -0
  73. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  74. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  75. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  76. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  77. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  78. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  79. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  80. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  81. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  82. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  83. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  84. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  85. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  86. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  87. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  88. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  89. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  90. package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  91. package/resources/targets/claude/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  92. package/resources/targets/claude/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  93. package/resources/targets/claude/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  94. package/resources/targets/claude/js/js/project/scripts/config-export.mjs +13 -0
  95. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  96. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  97. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  98. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  99. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  100. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  101. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  102. package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  103. package/resources/targets/claude/js/js/project/scripts/write-preview-ready.mjs +22 -0
  104. package/resources/targets/claude/js/js/project/src/display/ui-stage.ts +156 -0
  105. package/resources/targets/claude/js/js/project/src/display/viewport.ts +249 -0
  106. package/resources/targets/claude/js/js/project/src/main.ts +87 -0
  107. package/resources/targets/claude/js/js/project/src/platform.ts +2 -0
  108. package/resources/targets/claude/js/js/project/src/scenes/LoadScene.ts +89 -0
  109. package/resources/targets/claude/js/js/project/src/scenes/PlayScene.ts +17 -0
  110. package/resources/targets/claude/js/js/project/src/screenUi.ts +185 -0
  111. package/resources/targets/claude/js/js/project/src/style.css +294 -0
  112. package/resources/targets/claude/js/js/project/tsconfig.json +20 -0
  113. package/resources/targets/claude/js/js/project/unified_data_control_config.json +20 -0
  114. package/resources/targets/claude/js/js/project/vite.config.ts +5 -0
  115. package/resources/targets/claude/js/recovery.md +13 -0
  116. package/resources/targets/claude/js/target.json +61 -0
  117. package/resources/targets/claude/js3d/bootstrap/SKILL.md +18 -0
  118. package/resources/targets/claude/js3d/context-filter-report.json +27 -0
  119. package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +76 -0
  120. package/resources/targets/claude/js3d/craft-game-maker/js3d.md +12 -0
  121. package/resources/targets/claude/js3d/js3d/bundle.json +108 -0
  122. package/resources/targets/claude/js3d/js3d/context/AGENTS.md +30 -0
  123. package/resources/targets/claude/js3d/js3d/context/hooks/hooks.json +14 -0
  124. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  125. package/resources/targets/claude/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  126. package/resources/targets/claude/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  127. package/resources/targets/claude/js3d/js3d/context/knowledge/Layout.md +7 -0
  128. package/resources/targets/{workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → claude/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  129. package/resources/targets/claude/js3d/js3d/context/knowledge/Runtime.md +9 -0
  130. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  131. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  132. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  133. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  134. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  135. package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  136. package/resources/targets/claude/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  137. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  138. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  139. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  140. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  141. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  142. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  143. package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  144. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  145. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  146. package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  147. package/resources/targets/claude/js3d/js3d/context/skills/index.json +31 -0
  148. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  149. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  150. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  151. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  152. package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  153. package/resources/targets/claude/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  154. package/resources/targets/claude/js3d/js3d/project/README.md +7 -0
  155. package/resources/targets/claude/js3d/js3d/project/configs/game.controls.json +3 -0
  156. package/resources/targets/claude/js3d/js3d/project/configs/game.json +3 -0
  157. package/resources/targets/claude/js3d/js3d/project/game-runtime.json +7 -0
  158. package/resources/targets/claude/js3d/js3d/project/game.config.json +7 -0
  159. package/resources/targets/claude/js3d/js3d/project/index.html +12 -0
  160. package/resources/targets/claude/js3d/js3d/project/package.json +23 -0
  161. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  162. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  163. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  164. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  165. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  166. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  167. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  168. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  169. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  170. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  171. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  172. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  173. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  174. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  175. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  176. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  177. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  178. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  179. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  180. package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  181. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  182. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  183. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  184. package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  185. package/resources/targets/claude/js3d/js3d/project/scripts/config-export.mjs +15 -0
  186. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  187. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  188. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  189. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  190. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  191. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  192. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  193. package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  194. package/resources/targets/claude/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  195. package/resources/targets/claude/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  196. package/resources/targets/claude/js3d/js3d/project/src/display/viewport.ts +239 -0
  197. package/resources/targets/claude/js3d/js3d/project/src/main.ts +85 -0
  198. package/resources/targets/claude/js3d/js3d/project/src/platform.ts +2 -0
  199. package/resources/targets/claude/js3d/js3d/project/src/style.css +83 -0
  200. package/resources/targets/claude/js3d/js3d/project/tsconfig.json +20 -0
  201. package/resources/targets/claude/js3d/js3d/project/unified_data_control_config.json +20 -0
  202. package/resources/targets/claude/js3d/js3d/project/vite.config.ts +5 -0
  203. package/resources/targets/claude/js3d/recovery.md +13 -0
  204. package/resources/targets/claude/js3d/target.json +60 -0
  205. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +5 -1
  206. package/resources/targets/codebuddy/js/context-filter-report.json +27 -0
  207. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +18 -19
  208. package/resources/targets/codebuddy/js/craft-game-maker/js.md +2 -2
  209. package/resources/targets/codebuddy/js/js/bundle.json +16 -18
  210. package/resources/targets/codebuddy/js/js/context/AGENTS.md +10 -6
  211. package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  212. package/resources/targets/codebuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  213. package/resources/targets/codebuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  214. package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  215. package/resources/targets/codebuddy/js/js/context/skills/index.json +2 -14
  216. package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  217. package/resources/targets/codebuddy/js/recovery.md +10 -4
  218. package/resources/targets/codebuddy/js/target.json +1 -1
  219. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +5 -1
  220. package/resources/targets/codebuddy/js3d/context-filter-report.json +27 -0
  221. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +18 -19
  222. package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +3 -4
  223. package/resources/targets/codebuddy/js3d/js3d/bundle.json +19 -21
  224. package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +10 -6
  225. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  226. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  227. package/resources/targets/{codex/js3d/js3d/context/skills/asset-search/references/resource-config.md → codebuddy/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  228. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  229. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  230. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  231. package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +4 -16
  232. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  233. package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  234. package/resources/targets/codebuddy/js3d/recovery.md +10 -4
  235. package/resources/targets/codebuddy/js3d/target.json +1 -1
  236. package/resources/targets/codex/js/bootstrap/SKILL.md +9 -1
  237. package/resources/targets/codex/js/context-filter-report.json +27 -0
  238. package/resources/targets/codex/js/craft-game-maker/SKILL.md +18 -19
  239. package/resources/targets/codex/js/craft-game-maker/js.md +2 -2
  240. package/resources/targets/codex/js/js/bundle.json +16 -18
  241. package/resources/targets/codex/js/js/context/AGENTS.md +10 -6
  242. package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +4 -4
  243. package/resources/targets/codex/js/js/context/knowledge/AssetWiring.md +7 -0
  244. package/resources/targets/codex/js/js/context/knowledge/ResourceLoading.md +9 -0
  245. package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +2 -2
  246. package/resources/targets/codex/js/js/context/skills/index.json +2 -14
  247. package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +1 -1
  248. package/resources/targets/codex/js/recovery.md +14 -4
  249. package/resources/targets/codex/js/target.json +1 -1
  250. package/resources/targets/codex/js3d/bootstrap/SKILL.md +9 -1
  251. package/resources/targets/codex/js3d/context-filter-report.json +27 -0
  252. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +18 -19
  253. package/resources/targets/codex/js3d/craft-game-maker/js3d.md +3 -4
  254. package/resources/targets/codex/js3d/js3d/bundle.json +19 -21
  255. package/resources/targets/codex/js3d/js3d/context/AGENTS.md +10 -6
  256. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  257. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  258. package/resources/targets/{codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → codex/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
  259. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  260. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  261. package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  262. package/resources/targets/codex/js3d/js3d/context/skills/index.json +4 -16
  263. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  264. package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  265. package/resources/targets/codex/js3d/recovery.md +14 -4
  266. package/resources/targets/codex/js3d/target.json +1 -1
  267. package/resources/targets/cursor/js/bootstrap/SKILL.md +18 -0
  268. package/resources/targets/cursor/js/context-filter-report.json +27 -0
  269. package/resources/targets/cursor/js/craft-game-maker/SKILL.md +76 -0
  270. package/resources/targets/cursor/js/craft-game-maker/js.md +10 -0
  271. package/resources/targets/cursor/js/js/bundle.json +97 -0
  272. package/resources/targets/cursor/js/js/context/AGENTS.md +29 -0
  273. package/resources/targets/cursor/js/js/context/hooks/hooks.json +14 -0
  274. package/resources/targets/cursor/js/js/context/knowledge/AssetUrl.md +9 -0
  275. package/resources/targets/cursor/js/js/context/knowledge/AssetWiring.md +7 -0
  276. package/resources/targets/cursor/js/js/context/knowledge/Layout.md +7 -0
  277. package/resources/targets/cursor/js/js/context/knowledge/Lifecycle.md +11 -0
  278. package/resources/targets/cursor/js/js/context/knowledge/ResourceLoading.md +9 -0
  279. package/resources/targets/cursor/js/js/context/skills/export-config/SKILL.md +16 -0
  280. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  281. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  282. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  283. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  284. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  285. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  286. package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  287. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  288. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  289. package/resources/targets/cursor/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  290. package/resources/targets/cursor/js/js/context/skills/index.json +19 -0
  291. package/resources/targets/cursor/js/js/context/skills/visual-qa/SKILL.md +14 -0
  292. package/resources/targets/cursor/js/js/project/README.md +7 -0
  293. package/resources/targets/cursor/js/js/project/configs/assets.json +1 -0
  294. package/resources/targets/cursor/js/js/project/configs/game.controls.json +3 -0
  295. package/resources/targets/cursor/js/js/project/configs/game.json +3 -0
  296. package/resources/targets/cursor/js/js/project/game-runtime.json +7 -0
  297. package/resources/targets/cursor/js/js/project/game.config.json +7 -0
  298. package/resources/targets/cursor/js/js/project/index.html +20 -0
  299. package/resources/targets/cursor/js/js/project/package.json +22 -0
  300. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  301. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  302. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  303. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  304. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  305. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  306. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  307. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  308. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  309. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  310. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  311. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  312. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  313. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  314. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  315. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  316. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  317. package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  318. package/resources/targets/cursor/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  319. package/resources/targets/cursor/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  320. package/resources/targets/cursor/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  321. package/resources/targets/cursor/js/js/project/scripts/config-export.mjs +13 -0
  322. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  323. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  324. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  325. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  326. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  327. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  328. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  329. package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  330. package/resources/targets/cursor/js/js/project/scripts/write-preview-ready.mjs +22 -0
  331. package/resources/targets/cursor/js/js/project/src/display/ui-stage.ts +156 -0
  332. package/resources/targets/cursor/js/js/project/src/display/viewport.ts +249 -0
  333. package/resources/targets/cursor/js/js/project/src/main.ts +87 -0
  334. package/resources/targets/cursor/js/js/project/src/platform.ts +2 -0
  335. package/resources/targets/cursor/js/js/project/src/scenes/LoadScene.ts +89 -0
  336. package/resources/targets/cursor/js/js/project/src/scenes/PlayScene.ts +17 -0
  337. package/resources/targets/cursor/js/js/project/src/screenUi.ts +185 -0
  338. package/resources/targets/cursor/js/js/project/src/style.css +294 -0
  339. package/resources/targets/cursor/js/js/project/tsconfig.json +20 -0
  340. package/resources/targets/cursor/js/js/project/unified_data_control_config.json +20 -0
  341. package/resources/targets/cursor/js/js/project/vite.config.ts +5 -0
  342. package/resources/targets/cursor/js/recovery.md +13 -0
  343. package/resources/targets/cursor/js/target.json +61 -0
  344. package/resources/targets/cursor/js3d/bootstrap/SKILL.md +18 -0
  345. package/resources/targets/cursor/js3d/context-filter-report.json +27 -0
  346. package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +76 -0
  347. package/resources/targets/cursor/js3d/craft-game-maker/js3d.md +12 -0
  348. package/resources/targets/cursor/js3d/js3d/bundle.json +108 -0
  349. package/resources/targets/cursor/js3d/js3d/context/AGENTS.md +30 -0
  350. package/resources/targets/cursor/js3d/js3d/context/hooks/hooks.json +14 -0
  351. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  352. package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  353. package/resources/targets/cursor/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  354. package/resources/targets/cursor/js3d/js3d/context/knowledge/Layout.md +7 -0
  355. package/resources/targets/cursor/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  356. package/resources/targets/cursor/js3d/js3d/context/knowledge/Runtime.md +9 -0
  357. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  358. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  359. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  360. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  361. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  362. package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  363. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  364. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  365. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  366. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  367. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  368. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  369. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  370. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  371. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  372. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  373. package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  374. package/resources/targets/cursor/js3d/js3d/context/skills/index.json +31 -0
  375. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  376. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  377. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  378. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  379. package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  380. package/resources/targets/cursor/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  381. package/resources/targets/cursor/js3d/js3d/project/README.md +7 -0
  382. package/resources/targets/cursor/js3d/js3d/project/configs/game.controls.json +3 -0
  383. package/resources/targets/cursor/js3d/js3d/project/configs/game.json +3 -0
  384. package/resources/targets/cursor/js3d/js3d/project/game-runtime.json +7 -0
  385. package/resources/targets/cursor/js3d/js3d/project/game.config.json +7 -0
  386. package/resources/targets/cursor/js3d/js3d/project/index.html +12 -0
  387. package/resources/targets/cursor/js3d/js3d/project/package.json +23 -0
  388. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  389. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  390. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  391. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  392. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  393. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  394. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  395. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  396. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  397. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  398. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  399. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  400. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  401. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  402. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  403. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  404. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  405. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  406. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  407. package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  408. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  409. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  410. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  411. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  412. package/resources/targets/cursor/js3d/js3d/project/scripts/config-export.mjs +15 -0
  413. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  414. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  415. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  416. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  417. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  418. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  419. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  420. package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  421. package/resources/targets/cursor/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  422. package/resources/targets/cursor/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  423. package/resources/targets/cursor/js3d/js3d/project/src/display/viewport.ts +239 -0
  424. package/resources/targets/cursor/js3d/js3d/project/src/main.ts +85 -0
  425. package/resources/targets/cursor/js3d/js3d/project/src/platform.ts +2 -0
  426. package/resources/targets/cursor/js3d/js3d/project/src/style.css +83 -0
  427. package/resources/targets/cursor/js3d/js3d/project/tsconfig.json +20 -0
  428. package/resources/targets/cursor/js3d/js3d/project/unified_data_control_config.json +20 -0
  429. package/resources/targets/cursor/js3d/js3d/project/vite.config.ts +5 -0
  430. package/resources/targets/cursor/js3d/recovery.md +13 -0
  431. package/resources/targets/cursor/js3d/target.json +60 -0
  432. package/resources/targets/dsh/js/bootstrap/SKILL.md +18 -0
  433. package/resources/targets/dsh/js/context-filter-report.json +27 -0
  434. package/resources/targets/dsh/js/craft-game-maker/SKILL.md +76 -0
  435. package/resources/targets/dsh/js/craft-game-maker/js.md +10 -0
  436. package/resources/targets/dsh/js/js/bundle.json +97 -0
  437. package/resources/targets/dsh/js/js/context/AGENTS.md +29 -0
  438. package/resources/targets/dsh/js/js/context/hooks/hooks.json +14 -0
  439. package/resources/targets/dsh/js/js/context/knowledge/AssetUrl.md +9 -0
  440. package/resources/targets/dsh/js/js/context/knowledge/AssetWiring.md +7 -0
  441. package/resources/targets/dsh/js/js/context/knowledge/Layout.md +7 -0
  442. package/resources/targets/dsh/js/js/context/knowledge/Lifecycle.md +11 -0
  443. package/resources/targets/dsh/js/js/context/knowledge/ResourceLoading.md +9 -0
  444. package/resources/targets/dsh/js/js/context/skills/export-config/SKILL.md +16 -0
  445. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  446. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  447. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  448. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  449. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  450. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  451. package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  452. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  453. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  454. package/resources/targets/dsh/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  455. package/resources/targets/dsh/js/js/context/skills/index.json +19 -0
  456. package/resources/targets/dsh/js/js/context/skills/visual-qa/SKILL.md +14 -0
  457. package/resources/targets/dsh/js/js/project/README.md +7 -0
  458. package/resources/targets/dsh/js/js/project/configs/assets.json +1 -0
  459. package/resources/targets/dsh/js/js/project/configs/game.controls.json +3 -0
  460. package/resources/targets/dsh/js/js/project/configs/game.json +3 -0
  461. package/resources/targets/dsh/js/js/project/game-runtime.json +7 -0
  462. package/resources/targets/dsh/js/js/project/game.config.json +7 -0
  463. package/resources/targets/dsh/js/js/project/index.html +20 -0
  464. package/resources/targets/dsh/js/js/project/package.json +22 -0
  465. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  466. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  467. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  468. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  469. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  470. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  471. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  472. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  473. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  474. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  475. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  476. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  477. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  478. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  479. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  480. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  481. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  482. package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  483. package/resources/targets/dsh/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  484. package/resources/targets/dsh/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  485. package/resources/targets/dsh/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  486. package/resources/targets/dsh/js/js/project/scripts/config-export.mjs +13 -0
  487. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  488. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  489. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  490. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  491. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  492. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  493. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  494. package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  495. package/resources/targets/dsh/js/js/project/scripts/write-preview-ready.mjs +22 -0
  496. package/resources/targets/dsh/js/js/project/src/display/ui-stage.ts +156 -0
  497. package/resources/targets/dsh/js/js/project/src/display/viewport.ts +249 -0
  498. package/resources/targets/dsh/js/js/project/src/main.ts +87 -0
  499. package/resources/targets/dsh/js/js/project/src/platform.ts +2 -0
  500. package/resources/targets/dsh/js/js/project/src/scenes/LoadScene.ts +89 -0
  501. package/resources/targets/dsh/js/js/project/src/scenes/PlayScene.ts +17 -0
  502. package/resources/targets/dsh/js/js/project/src/screenUi.ts +185 -0
  503. package/resources/targets/dsh/js/js/project/src/style.css +294 -0
  504. package/resources/targets/dsh/js/js/project/tsconfig.json +20 -0
  505. package/resources/targets/dsh/js/js/project/unified_data_control_config.json +20 -0
  506. package/resources/targets/dsh/js/js/project/vite.config.ts +5 -0
  507. package/resources/targets/dsh/js/recovery.md +13 -0
  508. package/resources/targets/dsh/js/target.json +61 -0
  509. package/resources/targets/dsh/js3d/bootstrap/SKILL.md +18 -0
  510. package/resources/targets/dsh/js3d/context-filter-report.json +27 -0
  511. package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +76 -0
  512. package/resources/targets/dsh/js3d/craft-game-maker/js3d.md +12 -0
  513. package/resources/targets/dsh/js3d/js3d/bundle.json +108 -0
  514. package/resources/targets/dsh/js3d/js3d/context/AGENTS.md +30 -0
  515. package/resources/targets/dsh/js3d/js3d/context/hooks/hooks.json +14 -0
  516. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  517. package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  518. package/resources/targets/dsh/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  519. package/resources/targets/dsh/js3d/js3d/context/knowledge/Layout.md +7 -0
  520. package/resources/targets/dsh/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  521. package/resources/targets/dsh/js3d/js3d/context/knowledge/Runtime.md +9 -0
  522. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  523. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  524. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  525. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  526. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  527. package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  528. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  529. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  530. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  531. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  532. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  533. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  534. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  535. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  536. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  537. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  538. package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  539. package/resources/targets/dsh/js3d/js3d/context/skills/index.json +31 -0
  540. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  541. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  542. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  543. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  544. package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  545. package/resources/targets/dsh/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  546. package/resources/targets/dsh/js3d/js3d/project/README.md +7 -0
  547. package/resources/targets/dsh/js3d/js3d/project/configs/game.controls.json +3 -0
  548. package/resources/targets/dsh/js3d/js3d/project/configs/game.json +3 -0
  549. package/resources/targets/dsh/js3d/js3d/project/game-runtime.json +7 -0
  550. package/resources/targets/dsh/js3d/js3d/project/game.config.json +7 -0
  551. package/resources/targets/dsh/js3d/js3d/project/index.html +12 -0
  552. package/resources/targets/dsh/js3d/js3d/project/package.json +23 -0
  553. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  554. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  555. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  556. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  557. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  558. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  559. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  560. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  561. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  562. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  563. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  564. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  565. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  566. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  567. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  568. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  569. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  570. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  571. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  572. package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  573. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  574. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  575. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  576. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  577. package/resources/targets/dsh/js3d/js3d/project/scripts/config-export.mjs +15 -0
  578. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  579. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  580. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  581. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  582. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  583. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  584. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  585. package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  586. package/resources/targets/dsh/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  587. package/resources/targets/dsh/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  588. package/resources/targets/dsh/js3d/js3d/project/src/display/viewport.ts +239 -0
  589. package/resources/targets/dsh/js3d/js3d/project/src/main.ts +85 -0
  590. package/resources/targets/dsh/js3d/js3d/project/src/platform.ts +2 -0
  591. package/resources/targets/dsh/js3d/js3d/project/src/style.css +83 -0
  592. package/resources/targets/dsh/js3d/js3d/project/tsconfig.json +20 -0
  593. package/resources/targets/dsh/js3d/js3d/project/unified_data_control_config.json +20 -0
  594. package/resources/targets/dsh/js3d/js3d/project/vite.config.ts +5 -0
  595. package/resources/targets/dsh/js3d/recovery.md +13 -0
  596. package/resources/targets/dsh/js3d/target.json +60 -0
  597. package/resources/targets/index.json +72 -12
  598. package/resources/targets/kimi/js/bootstrap/SKILL.md +18 -0
  599. package/resources/targets/kimi/js/context-filter-report.json +27 -0
  600. package/resources/targets/kimi/js/craft-game-maker/SKILL.md +76 -0
  601. package/resources/targets/kimi/js/craft-game-maker/js.md +10 -0
  602. package/resources/targets/kimi/js/js/bundle.json +97 -0
  603. package/resources/targets/kimi/js/js/context/AGENTS.md +29 -0
  604. package/resources/targets/kimi/js/js/context/hooks/hooks.json +14 -0
  605. package/resources/targets/kimi/js/js/context/knowledge/AssetUrl.md +9 -0
  606. package/resources/targets/kimi/js/js/context/knowledge/AssetWiring.md +7 -0
  607. package/resources/targets/kimi/js/js/context/knowledge/Layout.md +7 -0
  608. package/resources/targets/kimi/js/js/context/knowledge/Lifecycle.md +11 -0
  609. package/resources/targets/kimi/js/js/context/knowledge/ResourceLoading.md +9 -0
  610. package/resources/targets/kimi/js/js/context/skills/export-config/SKILL.md +16 -0
  611. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  612. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  613. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  614. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  615. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  616. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  617. package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  618. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  619. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  620. package/resources/targets/kimi/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  621. package/resources/targets/kimi/js/js/context/skills/index.json +19 -0
  622. package/resources/targets/kimi/js/js/context/skills/visual-qa/SKILL.md +14 -0
  623. package/resources/targets/kimi/js/js/project/README.md +7 -0
  624. package/resources/targets/kimi/js/js/project/configs/assets.json +1 -0
  625. package/resources/targets/kimi/js/js/project/configs/game.controls.json +3 -0
  626. package/resources/targets/kimi/js/js/project/configs/game.json +3 -0
  627. package/resources/targets/kimi/js/js/project/game-runtime.json +7 -0
  628. package/resources/targets/kimi/js/js/project/game.config.json +7 -0
  629. package/resources/targets/kimi/js/js/project/index.html +20 -0
  630. package/resources/targets/kimi/js/js/project/package.json +22 -0
  631. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  632. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  633. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  634. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  635. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  636. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  637. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  638. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  639. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  640. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  641. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  642. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  643. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  644. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  645. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  646. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  647. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  648. package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  649. package/resources/targets/kimi/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  650. package/resources/targets/kimi/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  651. package/resources/targets/kimi/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  652. package/resources/targets/kimi/js/js/project/scripts/config-export.mjs +13 -0
  653. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  654. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  655. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  656. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  657. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  658. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  659. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  660. package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  661. package/resources/targets/kimi/js/js/project/scripts/write-preview-ready.mjs +22 -0
  662. package/resources/targets/kimi/js/js/project/src/display/ui-stage.ts +156 -0
  663. package/resources/targets/kimi/js/js/project/src/display/viewport.ts +249 -0
  664. package/resources/targets/kimi/js/js/project/src/main.ts +87 -0
  665. package/resources/targets/kimi/js/js/project/src/platform.ts +2 -0
  666. package/resources/targets/kimi/js/js/project/src/scenes/LoadScene.ts +89 -0
  667. package/resources/targets/kimi/js/js/project/src/scenes/PlayScene.ts +17 -0
  668. package/resources/targets/kimi/js/js/project/src/screenUi.ts +185 -0
  669. package/resources/targets/kimi/js/js/project/src/style.css +294 -0
  670. package/resources/targets/kimi/js/js/project/tsconfig.json +20 -0
  671. package/resources/targets/kimi/js/js/project/unified_data_control_config.json +20 -0
  672. package/resources/targets/kimi/js/js/project/vite.config.ts +5 -0
  673. package/resources/targets/kimi/js/recovery.md +13 -0
  674. package/resources/targets/kimi/js/target.json +61 -0
  675. package/resources/targets/kimi/js3d/bootstrap/SKILL.md +18 -0
  676. package/resources/targets/kimi/js3d/context-filter-report.json +27 -0
  677. package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +76 -0
  678. package/resources/targets/kimi/js3d/craft-game-maker/js3d.md +12 -0
  679. package/resources/targets/kimi/js3d/js3d/bundle.json +108 -0
  680. package/resources/targets/kimi/js3d/js3d/context/AGENTS.md +30 -0
  681. package/resources/targets/kimi/js3d/js3d/context/hooks/hooks.json +14 -0
  682. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  683. package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  684. package/resources/targets/kimi/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  685. package/resources/targets/kimi/js3d/js3d/context/knowledge/Layout.md +7 -0
  686. package/resources/targets/kimi/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  687. package/resources/targets/kimi/js3d/js3d/context/knowledge/Runtime.md +9 -0
  688. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  689. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  690. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  691. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  692. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  693. package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  694. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  695. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  696. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  697. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  698. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  699. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  700. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  701. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  702. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  703. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  704. package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  705. package/resources/targets/kimi/js3d/js3d/context/skills/index.json +31 -0
  706. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  707. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  708. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  709. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  710. package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  711. package/resources/targets/kimi/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  712. package/resources/targets/kimi/js3d/js3d/project/README.md +7 -0
  713. package/resources/targets/kimi/js3d/js3d/project/configs/game.controls.json +3 -0
  714. package/resources/targets/kimi/js3d/js3d/project/configs/game.json +3 -0
  715. package/resources/targets/kimi/js3d/js3d/project/game-runtime.json +7 -0
  716. package/resources/targets/kimi/js3d/js3d/project/game.config.json +7 -0
  717. package/resources/targets/kimi/js3d/js3d/project/index.html +12 -0
  718. package/resources/targets/kimi/js3d/js3d/project/package.json +23 -0
  719. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  720. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  721. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  722. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  723. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  724. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  725. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  726. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  727. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  728. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  729. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  730. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  731. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  732. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  733. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  734. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  735. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  736. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  737. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  738. package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  739. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  740. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  741. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  742. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  743. package/resources/targets/kimi/js3d/js3d/project/scripts/config-export.mjs +15 -0
  744. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  745. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  746. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  747. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  748. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  749. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  750. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  751. package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  752. package/resources/targets/kimi/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  753. package/resources/targets/kimi/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  754. package/resources/targets/kimi/js3d/js3d/project/src/display/viewport.ts +239 -0
  755. package/resources/targets/kimi/js3d/js3d/project/src/main.ts +85 -0
  756. package/resources/targets/kimi/js3d/js3d/project/src/platform.ts +2 -0
  757. package/resources/targets/kimi/js3d/js3d/project/src/style.css +83 -0
  758. package/resources/targets/kimi/js3d/js3d/project/tsconfig.json +20 -0
  759. package/resources/targets/kimi/js3d/js3d/project/unified_data_control_config.json +20 -0
  760. package/resources/targets/kimi/js3d/js3d/project/vite.config.ts +5 -0
  761. package/resources/targets/kimi/js3d/recovery.md +13 -0
  762. package/resources/targets/kimi/js3d/target.json +60 -0
  763. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +24 -14
  764. package/resources/targets/workbuddy/js/context-filter-report.json +27 -0
  765. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +18 -19
  766. package/resources/targets/workbuddy/js/craft-game-maker/js.md +2 -2
  767. package/resources/targets/workbuddy/js/js/bundle.json +16 -18
  768. package/resources/targets/workbuddy/js/js/context/AGENTS.md +29 -25
  769. package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +4 -4
  770. package/resources/targets/workbuddy/js/js/context/knowledge/AssetWiring.md +7 -0
  771. package/resources/targets/workbuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
  772. package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +2 -2
  773. package/resources/targets/workbuddy/js/js/context/skills/index.json +2 -14
  774. package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
  775. package/resources/targets/workbuddy/js/recovery.md +19 -7
  776. package/resources/targets/workbuddy/js/target.json +1 -1
  777. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +24 -14
  778. package/resources/targets/workbuddy/js3d/context-filter-report.json +27 -0
  779. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +18 -19
  780. package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +3 -4
  781. package/resources/targets/workbuddy/js3d/js3d/bundle.json +19 -21
  782. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +30 -26
  783. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
  784. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  785. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  786. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
  787. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
  788. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
  789. package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +4 -16
  790. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
  791. package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
  792. package/resources/targets/workbuddy/js3d/recovery.md +19 -7
  793. package/resources/targets/workbuddy/js3d/target.json +1 -1
  794. package/resources/targets/zcode/js/bootstrap/SKILL.md +18 -0
  795. package/resources/targets/zcode/js/context-filter-report.json +27 -0
  796. package/resources/targets/zcode/js/craft-game-maker/SKILL.md +76 -0
  797. package/resources/targets/zcode/js/craft-game-maker/js.md +10 -0
  798. package/resources/targets/zcode/js/js/bundle.json +97 -0
  799. package/resources/targets/zcode/js/js/context/AGENTS.md +29 -0
  800. package/resources/targets/zcode/js/js/context/hooks/hooks.json +14 -0
  801. package/resources/targets/zcode/js/js/context/knowledge/AssetUrl.md +9 -0
  802. package/resources/targets/zcode/js/js/context/knowledge/AssetWiring.md +7 -0
  803. package/resources/targets/zcode/js/js/context/knowledge/Layout.md +7 -0
  804. package/resources/targets/zcode/js/js/context/knowledge/Lifecycle.md +11 -0
  805. package/resources/targets/zcode/js/js/context/knowledge/ResourceLoading.md +9 -0
  806. package/resources/targets/zcode/js/js/context/skills/export-config/SKILL.md +16 -0
  807. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  808. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  809. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  810. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  811. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  812. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  813. package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  814. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  815. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  816. package/resources/targets/zcode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  817. package/resources/targets/zcode/js/js/context/skills/index.json +19 -0
  818. package/resources/targets/zcode/js/js/context/skills/visual-qa/SKILL.md +14 -0
  819. package/resources/targets/zcode/js/js/project/README.md +7 -0
  820. package/resources/targets/zcode/js/js/project/configs/assets.json +1 -0
  821. package/resources/targets/zcode/js/js/project/configs/game.controls.json +3 -0
  822. package/resources/targets/zcode/js/js/project/configs/game.json +3 -0
  823. package/resources/targets/zcode/js/js/project/game-runtime.json +7 -0
  824. package/resources/targets/zcode/js/js/project/game.config.json +7 -0
  825. package/resources/targets/zcode/js/js/project/index.html +20 -0
  826. package/resources/targets/zcode/js/js/project/package.json +22 -0
  827. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  828. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  829. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  830. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  831. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  832. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  833. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  834. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  835. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  836. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  837. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  838. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  839. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  840. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  841. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  842. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  843. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  844. package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  845. package/resources/targets/zcode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  846. package/resources/targets/zcode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  847. package/resources/targets/zcode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  848. package/resources/targets/zcode/js/js/project/scripts/config-export.mjs +13 -0
  849. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  850. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  851. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  852. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  853. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  854. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  855. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  856. package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  857. package/resources/targets/zcode/js/js/project/scripts/write-preview-ready.mjs +22 -0
  858. package/resources/targets/zcode/js/js/project/src/display/ui-stage.ts +156 -0
  859. package/resources/targets/zcode/js/js/project/src/display/viewport.ts +249 -0
  860. package/resources/targets/zcode/js/js/project/src/main.ts +87 -0
  861. package/resources/targets/zcode/js/js/project/src/platform.ts +2 -0
  862. package/resources/targets/zcode/js/js/project/src/scenes/LoadScene.ts +89 -0
  863. package/resources/targets/zcode/js/js/project/src/scenes/PlayScene.ts +17 -0
  864. package/resources/targets/zcode/js/js/project/src/screenUi.ts +185 -0
  865. package/resources/targets/zcode/js/js/project/src/style.css +294 -0
  866. package/resources/targets/zcode/js/js/project/tsconfig.json +20 -0
  867. package/resources/targets/zcode/js/js/project/unified_data_control_config.json +20 -0
  868. package/resources/targets/zcode/js/js/project/vite.config.ts +5 -0
  869. package/resources/targets/zcode/js/recovery.md +13 -0
  870. package/resources/targets/zcode/js/target.json +61 -0
  871. package/resources/targets/zcode/js3d/bootstrap/SKILL.md +18 -0
  872. package/resources/targets/zcode/js3d/context-filter-report.json +27 -0
  873. package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +76 -0
  874. package/resources/targets/zcode/js3d/craft-game-maker/js3d.md +12 -0
  875. package/resources/targets/zcode/js3d/js3d/bundle.json +108 -0
  876. package/resources/targets/zcode/js3d/js3d/context/AGENTS.md +30 -0
  877. package/resources/targets/zcode/js3d/js3d/context/hooks/hooks.json +14 -0
  878. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  879. package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
  880. package/resources/targets/zcode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  881. package/resources/targets/zcode/js3d/js3d/context/knowledge/Layout.md +7 -0
  882. package/resources/targets/zcode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
  883. package/resources/targets/zcode/js3d/js3d/context/knowledge/Runtime.md +9 -0
  884. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  885. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  886. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  887. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  888. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  889. package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  890. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  891. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  892. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  893. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  894. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  895. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  896. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  897. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  898. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  899. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  900. package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  901. package/resources/targets/zcode/js3d/js3d/context/skills/index.json +31 -0
  902. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  903. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  904. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  905. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  906. package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  907. package/resources/targets/zcode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  908. package/resources/targets/zcode/js3d/js3d/project/README.md +7 -0
  909. package/resources/targets/zcode/js3d/js3d/project/configs/game.controls.json +3 -0
  910. package/resources/targets/zcode/js3d/js3d/project/configs/game.json +3 -0
  911. package/resources/targets/zcode/js3d/js3d/project/game-runtime.json +7 -0
  912. package/resources/targets/zcode/js3d/js3d/project/game.config.json +7 -0
  913. package/resources/targets/zcode/js3d/js3d/project/index.html +12 -0
  914. package/resources/targets/zcode/js3d/js3d/project/package.json +23 -0
  915. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  916. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  917. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  918. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  919. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  920. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  921. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  922. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  923. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  924. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  925. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  926. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  927. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  928. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  929. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  930. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  931. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  932. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  933. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  934. package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  935. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  936. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  937. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  938. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  939. package/resources/targets/zcode/js3d/js3d/project/scripts/config-export.mjs +15 -0
  940. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  941. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  942. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  943. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  944. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  945. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  946. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  947. package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  948. package/resources/targets/zcode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  949. package/resources/targets/zcode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  950. package/resources/targets/zcode/js3d/js3d/project/src/display/viewport.ts +239 -0
  951. package/resources/targets/zcode/js3d/js3d/project/src/main.ts +85 -0
  952. package/resources/targets/zcode/js3d/js3d/project/src/platform.ts +2 -0
  953. package/resources/targets/zcode/js3d/js3d/project/src/style.css +83 -0
  954. package/resources/targets/zcode/js3d/js3d/project/tsconfig.json +20 -0
  955. package/resources/targets/zcode/js3d/js3d/project/unified_data_control_config.json +20 -0
  956. package/resources/targets/zcode/js3d/js3d/project/vite.config.ts +5 -0
  957. package/resources/targets/zcode/js3d/recovery.md +13 -0
  958. package/resources/targets/zcode/js3d/target.json +60 -0
  959. package/vendor/craft-runtime/SOURCE.json +2 -2
  960. package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  961. package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  962. package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  963. package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  964. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  965. package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  966. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  967. package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +0 -9
  968. package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  969. package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +0 -12
  970. package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  971. package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  972. package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  973. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
  974. package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +0 -9
  975. package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
  976. package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
  977. package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
  978. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
  979. package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
  980. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
@@ -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 = 4;
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}","intent":"inspect"})\` 检查 npm 与当前连接版本。MCP 的 workspace 必须是当前游戏父目录。\n\n`
94
+ + '继续制作前调用 `craft_update_check`(name、intent=resume、本次唯一 request_key),按回执完成自动安装和当前连接切版确认;尚待重连或不兼容时先处理该状态。确认可继续后调用 craft_game_prepare,传 mode=resume、name 和同一 request_key,轮询成功后保存 work_id/context_revision,重新读取本地入口和技能索引。prepare 也会执行更新检查;重试复用 request_key,当前 work 内保持原版本。\n\n'
95
+ + '待重连时按工具返回的 connection_handoff 处理;纯 inspect 不自动重载。更新调用返回且当前工作结束后,使用宿主实际可用的控制能力并遵守其规则;不可用、失败或仍旧时提示用户重连或完整重启。核验必须来自当前聊天的实际 craft_game_info:版本、build_id 与目标一致,记录实际 instance_id,确认 active_verified 且 host/workspace/platform 符合预期;安装或重载成功提示不代表切版成功。仅重试明确未开始的 prepare 并复用 request_key,不重放付费操作。\n\n'
96
+ + '读取 `SPEC/PROGRESS.md`、相关设计和源码;存在 `.craft/user-rules.md` 时一并读取。用户规则放在该文件或本文件管理段之外。官方正文由清单管理,更新前保留修改备份;游戏代码和用户进度保留。\n\n'
97
+ + '纯查看无需 prepare,查询不改任何项目文件。制作期间沿用 work_id;结束或暂停后等待后台任务结束、记录进度并 craft_game_release。`.craft/context-lock.json` 只记录各宿主版本与校验状态,不作为正文目录。\n'
74
98
  : 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) : '';
99
+ const entry = start + '\n## Craft 项目恢复\n\n' + body + '\n' + end;
78
100
  const label = engine === 'js3d' ? '3D / Three.js' : '2D / Phaser';
79
101
  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
102
  + start + '\n# 继续当前 Craft 游戏\n\n'
81
103
  + `1. 读取项目根 \`AGENTS.md\`,确认工程 \`${name}\` 和引擎 \`${engine}\`。\n`
82
- + '2. 按项目恢复规则读取 `SPEC/PROGRESS.md`、已有设计记录并调用 `craft_game_info`。核对工程路径、引擎与版本绑定后,读取返回的 context.recovery(如有)、工作流、引擎入口和技能索引,按任务描述选择技能。\n'
83
- + '3. 根据实际进度继续工作;仅恢复上下文时无需重新 prepare 或重建模板。完成修改后更新进度并按工作流验收、看图、启动预览。\n'
104
+ + (isolated ? '2. 新会话先调用只读 `craft_game_info` 核对项目,再调用 `craft_update_check`(name、intent=inspect)检查版本。继续制作时用 intent=resume 和新的 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')
105
+ + (isolated && host==='codex' ? ' 待重连时遵循 connection_handoff;inspect 不自动重载。更新调用返回后重新查询当前连接的忙闲状态,等待本会话工作结束并 release,遵守宿主重载能力的作用范围与规则。当前连接空闲不代表其他聊天空闲;先确认重载影响范围内没有活动工作,无法确认则提示用户操作。若有实际可用且控制当前聊天的原生重载能力则自动尝试一次;否则或失败、实际仍旧时,提示用户重连 Craft,必要时完整退出并重开 Codex。不得用独立探测进程代替当前聊天核验。\n' : '')
106
+ + (isolated && host==='workbuddy' ? ' 待重连时遵循 connection_handoff;inspect 不自动重载。等待工作结束并 release 后重连 Craft;实际版本仍旧时,保存进度,从托盘完整退出 WorkBuddy 后重新打开,等待 Craft 就绪。仅页面实际提示未信任时由用户点击信任。\n' : '')
107
+ + (isolated && ['codex','workbuddy'].includes(host) ? ' 重连后通过当前聊天的 craft_game_info 核对实际版本和 build_id 与目标一致,记录实际 instance_id,确认 active_verified 且 host/workspace/platform 符合预期,不能仅凭绿灯或重载成功继续;只重试明确未开始的 prepare 并复用 request_key,不重放付费操作。\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
  }
@@ -5,9 +5,11 @@ import { seedProjectTemplate } from '#craft-sdk';
5
5
  import { atomicJson } from './request-store.mjs';
6
6
  import { assetConfig, safeProjectFile } from './asset-import.mjs';
7
7
  import { engineDefinition } from './engines.mjs';
8
- import { prepareProjectContext } from './project-context.mjs';
8
+ import { prepareProjectContext, projectContextPaths } from './project-context.mjs';
9
9
  import { clientIde } from '../integrations/hosts.mjs';
10
- import { ProjectBundles, readContextLock, contextBinding } from './project-bundles.mjs';
10
+ import { ProjectBundles, readContextLock, contextBinding, checkProjectCompatibility } from './project-bundles.mjs';
11
+ import { contextLayoutSchema, inspectNativeContext, nativeContextPath, nativeSelection } from './native-context.mjs';
12
+ import { inspectContextState, beginContextPreparation, finishContextPreparation } from './context-state.mjs';
11
13
 
12
14
  async function inspectProject(project, expected) {
13
15
  const runtime = JSON.parse(await readFile(await safeProjectFile(project,'game-runtime.json'),'utf8'));
@@ -43,6 +45,42 @@ export class Projects {
43
45
  async owned(name) {
44
46
  return (await this.describe(name)).project;
45
47
  }
48
+ async inspect(name,{full=false}={}) {
49
+ const project=this.file(name);
50
+ if((await lstat(project)).isSymbolicLink() || await realpath(project)!==project) throw new Error('Project path changed or is a symbolic link');
51
+ const record=await readRecord(path.join(this.state,name+'.json'),project);
52
+ const engine=await inspectProject(project,record?.engine),installed=this.engines[engine];
53
+ let lock,invalid;
54
+ try {lock=await readContextLock(project,engine);} catch(error) {invalid=error.message;}
55
+ const binding=invalid ? {status:'invalid',reason:invalid} : contextBinding(lock,this.ide,engine);
56
+ const entry=lock?.contexts?.[this.ide];
57
+ let version_status='unknown';
58
+ if(entry) {
59
+ const difference=(entry.version??'').split('.').map((n,i)=>Number(n)-Number(installed.bundle.version?.split('.')[i])).find(n=>n!==0)??0;
60
+ version_status=entry.bundle_id===installed.bundle.id ? 'matches_installed' : difference>0 ? 'requires_newer_runtime' : difference<0 ? 'update_available' : 'unknown';
61
+ }
62
+ const layoutSchema=lock?.schema===4 ? 4 : contextLayoutSchema;
63
+ const native=installed.host ? await inspectNativeContext(project,this.ide,engine,{full,schema:layoutSchema}) : {integrity:'unchecked'};
64
+ let incompatible;
65
+ try {await checkProjectCompatibility(project,installed.bundle);} catch(error) {incompatible=error.message;}
66
+ if(full && installed.host && lock?.schema===contextLayoutSchema && version_status==='matches_installed' && native.integrity==='valid') {
67
+ try {await this.bundles.resolve(project,engine,lock);} catch(error) {native.integrity='invalid';native.reason=error.message;}
68
+ }
69
+ const state=await inspectContextState(project,lock,{full});
70
+ let preparation={...state};
71
+ if(invalid) preparation={status:'blocked',reason:invalid};
72
+ else if(incompatible) preparation={status:'blocked',reason:incompatible};
73
+ else if(version_status==='requires_newer_runtime') preparation={status:'blocked',reason:'Connect a newer Craft runtime; context cannot be downgraded'};
74
+ 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};
75
+ 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'};
76
+ // A committed version may change while a read-only query is in flight.
77
+ 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'};}
78
+ return {name,project,engine,registration_required:!record,context_binding:binding,
79
+ version_status,integrity:{status:native.integrity,...(native.reason ? {reason:native.reason} : {})},preparation,
80
+ project_context:{...projectContextPaths(project,this.ide,layoutSchema),...(state.discovery?.skills?.[this.ide] ? {discovery:{native_status:state.discovery.native_status,...state.discovery.skills[this.ide]}} : {})},
81
+ ...(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)},
82
+ context:{...nativeSelection(project,installed,{schema:layoutSchema}).context,target:{host:this.ide,engine,version:entry?.version,bundle_id:entry?.bundle_id}}} : {})};
83
+ }
46
84
  async describe(name, {allowUnbound = false} = {}) {
47
85
  const project = this.file(name);
48
86
  if ((await lstat(project)).isSymbolicLink() || await realpath(project) !== project) throw new Error('Project path changed or is a symbolic link');
@@ -51,8 +89,11 @@ export class Projects {
51
89
  const engine = await inspectProject(project,record.engine);
52
90
  const lock = await readContextLock(project,engine);
53
91
  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 };
92
+ let selected;
93
+ if (binding.status === 'bound' || !allowUnbound) {
94
+ selected = await this.bundles.resolve(project,engine,lock);
95
+ }
96
+ return { name, project, engine, context_binding:contextBinding(lock,this.ide,engine),project_context:projectContextPaths(project,this.ide) };
56
97
  }
57
98
  async resourcesFor(description) {
58
99
  return this.bundles.resolve(description.project,description.engine,await readContextLock(description.project,description.engine));
@@ -62,8 +103,11 @@ export class Projects {
62
103
  if (requestedEngine !== undefined) engineDefinition(requestedEngine);
63
104
  const project = this.file(name);
64
105
  let created = false;
65
- try { await mkdir(project); created = true; }
66
- catch (error) { if (error.code !== 'EEXIST') throw error; }
106
+ if(options.mode==='resume') await lstat(project);
107
+ else {
108
+ try { await mkdir(project); created = true; }
109
+ catch (error) { if (error.code !== 'EEXIST') throw error; if(options.mode==='create') throw new Error('Project already exists; use mode=resume to continue it'); }
110
+ }
67
111
  if (await realpath(project) !== project || (await lstat(project)).isSymbolicLink()) throw new Error('Project must not be a symbolic link');
68
112
  const recordFile = path.join(this.state,name + '.json');
69
113
  const record = await readRecord(recordFile,project);
@@ -71,9 +115,33 @@ export class Projects {
71
115
  if (created) await seedProjectTemplate(this.engines[requestedEngine ?? record?.engine ?? 'js'].template,project,{ signal });
72
116
  // Existing Craft games are adopted, never overwritten or silently converted from another engine.
73
117
  const engine = await inspectProject(project,record?.engine ?? requestedEngine);
74
- const lock = await this.bundles.bind(project,engine,options);
118
+ if(this.engines[engine].host) {
119
+ if(options.upgrade_context!==undefined && typeof options.upgrade_context!=='boolean') throw new Error('upgrade_context must be boolean');
120
+ 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');
121
+ }
122
+ const guard=async()=>{signal?.throwIfAborted(); await options.guard?.();};
123
+ await guard();
124
+ let sync;
125
+ if(this.engines[engine].host) {
126
+ const lock=await readContextLock(project,engine);
127
+ const ready=await inspectContextState(project,lock,{full:true});
128
+ if(ready.status==='blocked') throw new Error(ready.reason);
129
+ let selected;
130
+ if(ready.status==='ready') {try {selected=await this.bundles.resolve(project,engine,lock);} catch { /* Explicit prepare repairs or reports the precise compatibility error below. */ }}
131
+ 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}};
132
+ else {
133
+ await beginContextPreparation(project,this.ide);
134
+ sync=await this.bundles.synchronize(project,engine,{...options,allowAttach:true,guard,finalize:async (lock,verifyPublished)=>{
135
+ await guard();
136
+ const project_context=await prepareProjectContext(project,name,engine,this.ide,true,guard);
137
+ return {project_context,context_revision:await finishContextPreparation(project,lock,async()=>{await guard();await verifyPublished();})};
138
+ }});
139
+ sync.sync.status='updated';
140
+ }
141
+ }
142
+ const lock = sync ? sync.lock : await this.bundles.bind(project,engine,options);
75
143
  signal?.throwIfAborted();
76
- if (engine === 'js3d') {
144
+ if (created && engine === 'js3d') {
77
145
  const assets = await safeProjectFile(project,'configs/assets.json');
78
146
  try { await writeFile(assets,'{}\n',{flag:'wx'}); }
79
147
  catch (error) { if (error.code !== 'EEXIST') throw error; }
@@ -81,8 +149,14 @@ export class Projects {
81
149
  await assetConfig(project);
82
150
  signal?.throwIfAborted();
83
151
  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) };
152
+ const project_context = sync?.project_context ?? await prepareProjectContext(project, name, engine, this.ide, lock.schema >= 2, guard);
153
+ 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')}) };
154
+ }
155
+ async assertRevision(name,revision) {
156
+ const description=await this.describe(name),lock=await readContextLock(description.project,description.engine);
157
+ 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')};
158
+ 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');
159
+ return description;
86
160
  }
87
161
  }
88
162
 
@@ -94,6 +168,8 @@ export async function fingerprint(project) {
94
168
  for (const entry of entries) {
95
169
  if (skip.has(entry.name)) continue;
96
170
  const file = path.join(dir,entry.name), key = relative + '/' + entry.name;
171
+ // Version history is not a game input. The active sync record below is fingerprinted.
172
+ if (['/.craft/contexts','/.craft/context-backups'].includes(key)) continue;
97
173
  if (entry.isSymbolicLink()) throw new Error('Source symbolic links are not supported: ' + key);
98
174
  if (entry.isDirectory()) { await walk(file,key); continue; }
99
175
  if (!entry.isFile()) throw new Error('Unsupported source file: ' + key);
@@ -1,3 +1,4 @@
1
+ import { guardWork } from './work-scope.mjs';
1
2
  import path from 'node:path';
2
3
  import { randomUUID } from 'node:crypto';
3
4
  import { mkdir } from 'node:fs/promises';
@@ -127,6 +128,7 @@ export class Publications {
127
128
  if (previous.client_request_id === record.request_id && previous.state !== 'external_draft') {
128
129
  if (!previous.finalization_retry_required) return view(record,previous);
129
130
  if (!record.share_input) throw new Error('The original immutable submission payload is required to retry finalization');
131
+ await guardWork();
130
132
  await request('submit',{ input:record.share_input },signal);
131
133
  record.state = 'submitted';
132
134
  await this.store.save(record);
@@ -136,6 +138,7 @@ export class Publications {
136
138
  for (const image of record.images) {
137
139
  signal.throwIfAborted();
138
140
  const data = await readMaterial(this.#directory(record),image.file,image);
141
+ await guardWork();
139
142
  const receipt = await request('image',{ image:data,purpose:image.purpose,conversation_id:record.conversation_id,
140
143
  version_id:record.version_id,external_manifest_sha256:record.external_manifest_sha256 },signal);
141
144
  if (receipt.sha256 !== image.sha256 || receipt.bytes !== image.bytes ||
@@ -150,7 +153,8 @@ export class Publications {
150
153
  if (record.share_input && JSON.stringify(record.share_input) !== JSON.stringify(input)) throw new Error('Publication submission changed after confirmation');
151
154
  record.share_input = input; record.state = 'submitting';
152
155
  await this.store.save(record);
153
- await request('submit',{ input },signal);
156
+ await guardWork();
157
+ await request('submit',{ input },signal);
154
158
  record.state = 'submitted';
155
159
  await this.store.save(record);
156
160
  return view(record,await this.#status(record,request,signal));