@craft_eco/craft-mcp 0.1.25 → 0.1.26

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 (620) hide show
  1. package/README.md +31 -10
  2. package/bin/craft-mcp.mjs +10 -8
  3. package/dist-server/game-workflow/bundle-files.mjs +43 -0
  4. package/dist-server/game-workflow/engines.mjs +13 -6
  5. package/dist-server/game-workflow/project-bundles.mjs +90 -0
  6. package/dist-server/game-workflow/project-context.mjs +91 -0
  7. package/dist-server/game-workflow/projects.mjs +16 -4
  8. package/dist-server/game-workflow/publication-materials.mjs +18 -20
  9. package/dist-server/game-workflow/publications.mjs +15 -17
  10. package/dist-server/game-workflow/publish-capture.mjs +21 -57
  11. package/dist-server/integrations/config.mjs +71 -0
  12. package/dist-server/integrations/files.mjs +54 -0
  13. package/dist-server/integrations/hosts.mjs +30 -0
  14. package/dist-server/integrations/install.mjs +86 -0
  15. package/dist-server/integrations/runtime.mjs +71 -0
  16. package/dist-server/mcp/publication-page.mjs +18 -50
  17. package/dist-server/mcp/publish-panel.mjs +28 -35
  18. package/dist-server/mcp/server.mjs +17 -14
  19. package/dist-server/preview/preview-launcher.mjs +9 -2
  20. package/dist-server/preview/preview-start.mjs +2 -2
  21. package/dist-server/upstream/publication-transport.mjs +19 -19
  22. package/package.json +10 -2
  23. package/resources/craft-create/SKILL.md +14 -0
  24. package/resources/craft-game-maker/SKILL.md +77 -71
  25. package/resources/craft-game-maker/js.md +10 -10
  26. package/resources/craft-game-maker/js3d.md +13 -13
  27. package/resources/game_visual_qa.mjs +1149 -1149
  28. package/resources/js/bundle.json +93 -0
  29. package/resources/js/context/AGENTS.md +15 -102
  30. package/resources/js/context/knowledge/AigcWiring.md +5 -196
  31. package/resources/js/context/knowledge/AssetUrl.md +5 -20
  32. package/resources/js/context/knowledge/Layout.md +7 -0
  33. package/resources/js/context/knowledge/Lifecycle.md +6 -27
  34. package/resources/js/context/skills/aigc-generate/SKILL.md +6 -141
  35. package/resources/js/context/skills/asset-search/SKILL.md +5 -62
  36. package/resources/js/context/skills/asset-search/references/resource-config.md +9 -0
  37. package/resources/js/context/skills/export-config/SKILL.md +7 -19
  38. package/resources/js/context/skills/export-config/scripts/export-config.mjs +3 -45
  39. package/resources/js/context/skills/index.json +30 -0
  40. package/resources/js/context/skills/visual-qa/SKILL.md +6 -28
  41. package/resources/js/project/README.md +4 -96
  42. package/resources/js/project/package.json +1 -2
  43. package/resources/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  44. package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +1 -37
  45. package/resources/js/project/scripts/config-export.mjs +10 -34
  46. package/resources/js3d/bundle.json +104 -0
  47. package/resources/js3d/context/AGENTS.md +16 -85
  48. package/resources/js3d/context/knowledge/AigcWiring.md +9 -0
  49. package/resources/js3d/context/knowledge/AssetUrl.md +9 -0
  50. package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +9 -67
  51. package/resources/js3d/context/knowledge/Layout.md +7 -0
  52. package/resources/js3d/context/knowledge/Runtime.md +5 -30
  53. package/resources/js3d/context/skills/aigc-integration/SKILL.md +6 -164
  54. package/resources/js3d/context/skills/asset-search/SKILL.md +5 -171
  55. package/resources/js3d/context/skills/asset-search/references/resource-config.md +6 -94
  56. package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +6 -82
  57. package/resources/js3d/context/skills/export-config/SKILL.md +7 -11
  58. package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +3 -55
  59. package/resources/js3d/context/skills/index.json +42 -0
  60. package/resources/js3d/context/skills/performance-audit/SKILL.md +8 -153
  61. package/resources/js3d/context/skills/visual-qa/SKILL.md +14 -0
  62. package/resources/js3d/project/README.md +4 -103
  63. package/resources/js3d/project/package.json +1 -2
  64. package/resources/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  65. package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-scene-assets.mjs +3 -28
  66. package/resources/js3d/project/scripts/config-export.mjs +12 -34
  67. package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts +8 -0
  68. package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts.map +1 -0
  69. package/vendor/agent-cli/dist/src/artifacts/build-failure.js +39 -0
  70. package/vendor/agent-cli/dist/src/artifacts/build-failure.js.map +1 -0
  71. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts +5 -0
  72. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts.map +1 -0
  73. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js +45 -0
  74. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js.map +1 -0
  75. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +1 -1
  76. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +2 -1
  77. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +1 -1
  78. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +2 -0
  79. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -1
  80. package/vendor/agent-cli/dist/src/artifacts/prepare.js +7 -2
  81. package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -1
  82. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +2 -0
  83. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -1
  84. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +27 -16
  85. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -1
  86. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts +14 -0
  87. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts.map +1 -0
  88. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js +119 -0
  89. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js.map +1 -0
  90. package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -1
  91. package/vendor/agent-cli/dist/src/artifacts/static.js +20 -6
  92. package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -1
  93. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -1
  94. package/vendor/agent-cli/dist/src/cli/process-protocol.js +24 -2
  95. package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -1
  96. package/vendor/agent-cli/dist/src/cli/process-steering.d.ts +21 -0
  97. package/vendor/agent-cli/dist/src/cli/process-steering.d.ts.map +1 -0
  98. package/vendor/agent-cli/dist/src/cli/process-steering.js +66 -0
  99. package/vendor/agent-cli/dist/src/cli/process-steering.js.map +1 -0
  100. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +1 -1
  101. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -1
  102. package/vendor/agent-cli/dist/src/index.d.ts +4 -1
  103. package/vendor/agent-cli/dist/src/index.d.ts.map +1 -1
  104. package/vendor/agent-cli/dist/src/index.js +3 -0
  105. package/vendor/agent-cli/dist/src/index.js.map +1 -1
  106. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +29 -1
  107. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -1
  108. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +18 -1
  109. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -1
  110. package/vendor/agent-cli/dist/src/session/client.d.ts +10 -0
  111. package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -1
  112. package/vendor/agent-cli/dist/src/session/client.js +15 -5
  113. package/vendor/agent-cli/dist/src/session/client.js.map +1 -1
  114. package/vendor/agent-cli/dist/src/session/link-session.d.ts +3 -0
  115. package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -1
  116. package/vendor/agent-cli/dist/src/session/link-session.js +14 -1
  117. package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -1
  118. package/vendor/agent-cli/dist/src/session/process-observability.d.ts +3 -0
  119. package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +1 -1
  120. package/vendor/agent-cli/dist/src/session/process-observability.js +11 -0
  121. package/vendor/agent-cli/dist/src/session/process-observability.js.map +1 -1
  122. package/vendor/agent-cli/dist/src/session/process-request.d.ts +3 -2
  123. package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -1
  124. package/vendor/agent-cli/dist/src/session/process-request.js +27 -9
  125. package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -1
  126. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +1 -0
  127. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -1
  128. package/vendor/agent-cli/dist/src/session/run-start-body.js +8 -3
  129. package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -1
  130. package/vendor/agent-cli/dist/src/session/run-steer.d.ts +42 -0
  131. package/vendor/agent-cli/dist/src/session/run-steer.d.ts.map +1 -0
  132. package/vendor/agent-cli/dist/src/session/run-steer.js +205 -0
  133. package/vendor/agent-cli/dist/src/session/run-steer.js.map +1 -0
  134. package/vendor/agent-cli/dist/src/shared/types.d.ts +6 -0
  135. package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -1
  136. package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts +21 -0
  137. package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts.map +1 -0
  138. package/vendor/agent-cli/dist/src/tools/context-program-receipt.js +102 -0
  139. package/vendor/agent-cli/dist/src/tools/context-program-receipt.js.map +1 -0
  140. package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -1
  141. package/vendor/agent-cli/dist/src/tools/context-program.js +3 -0
  142. package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -1
  143. package/resources/js/context/.role/AGENTS_DESIGN.md +0 -9
  144. package/resources/js/context/agents/aigc-asset.md +0 -168
  145. package/resources/js/context/knowledge/AigcEnabled.md +0 -49
  146. package/resources/js/context/knowledge/FrontendComponents.md +0 -17
  147. package/resources/js/context/knowledge/MobileAdaptation.md +0 -73
  148. package/resources/js/context/knowledge/MobileAdapted.md +0 -36
  149. package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
  150. package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -115
  151. package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -392
  152. package/resources/js/context/knowledge/PlatformServices.md +0 -190
  153. package/resources/js/context/knowledge/ProjectDisplayConfig.md +0 -35
  154. package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
  155. package/resources/js/context/knowledge/Ui.md +0 -11
  156. package/resources/js/context/knowledge/UiEditorCompat.md +0 -21
  157. package/resources/js/context/rules/MultiplayerCapability.md +0 -23
  158. package/resources/js/context/rules/MultiplayerRoomEntryUX.md +0 -63
  159. package/resources/js/context/rules/PlatformBoundaryModules.md +0 -44
  160. package/resources/js/context/rules/preview_ready.md +0 -8
  161. package/resources/js/context/skills/aigc-generate/knowledge/audio.md +0 -39
  162. package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +0 -26
  163. package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +0 -132
  164. package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +0 -53
  165. package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +0 -52
  166. package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +0 -191
  167. package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +0 -55
  168. package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +0 -62
  169. package/resources/js/context/skills/asset-search/scripts/config.json +0 -5
  170. package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +0 -125
  171. package/resources/js/context/skills/asset-search/scripts/search.mjs +0 -760
  172. package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -657
  173. package/resources/js/context/skills/asset-search/strategies/anim2d.md +0 -42
  174. package/resources/js/context/skills/asset-search/strategies/audio.md +0 -34
  175. package/resources/js/context/skills/asset-search/strategies/effect2d.md +0 -31
  176. package/resources/js/context/skills/asset-search/strategies/texture-prop.md +0 -22
  177. package/resources/js/context/skills/asset-search/strategies/ui-common.md +0 -40
  178. package/resources/js/context/skills/asset-search/strategies/ui-style.md +0 -28
  179. package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
  180. package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +0 -93
  181. package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +0 -7
  182. package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +0 -22
  183. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +0 -5
  184. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +0 -208
  185. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +0 -37
  186. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +0 -227
  187. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +0 -31
  188. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +0 -272
  189. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.d.mts +0 -79
  190. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.mjs +0 -29
  191. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/release.json +0 -22
  192. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/cli.mjs +0 -16
  193. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.d.mts +0 -4
  194. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.mjs +0 -50
  195. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +0 -3
  196. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.mjs +0 -72
  197. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.d.mts +0 -24
  198. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.mjs +0 -2
  199. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.d.mts +0 -10
  200. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.mjs +0 -1
  201. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +0 -37
  202. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +0 -50
  203. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/cli.mjs +0 -20
  204. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.d.mts +0 -19
  205. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.mjs +0 -1
  206. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/installed.json +0 -6
  207. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.d.mts +0 -6
  208. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.mjs +0 -77
  209. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.d.mts +0 -2
  210. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.mjs +0 -34
  211. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +0 -156
  212. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +0 -249
  213. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +0 -87
  214. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +0 -2
  215. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +0 -185
  216. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +0 -294
  217. package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +0 -20
  218. package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +0 -5
  219. package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +0 -159
  220. package/resources/js/context/skills/mobile-adaptation/SKILL.md +0 -277
  221. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -50
  222. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -862
  223. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
  224. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
  225. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
  226. package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -135
  227. package/resources/js/context/skills/mobile-adaptation/references/input-config.md +0 -342
  228. package/resources/js/context/skills/mobile-adaptation/references/verification.md +0 -140
  229. package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +0 -11
  230. package/resources/js/context/skills/mobile-compat-qa/SKILL.md +0 -53
  231. package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
  232. package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
  233. package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
  234. package/resources/js/context/skills/optimization-suggestions/SKILL.md +0 -89
  235. package/resources/js/context/skills/platform-services/SKILL.md +0 -101
  236. package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
  237. package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
  238. package/resources/js/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
  239. package/resources/js/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
  240. package/resources/js/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
  241. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
  242. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
  243. package/resources/js/context/skills/platform-services/assets/modules/log.ts +0 -35
  244. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
  245. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
  246. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
  247. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
  248. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
  249. package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
  250. package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
  251. package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +0 -49
  252. package/resources/js/context/skills/platform-services/assets/modules/save.mjs +0 -1
  253. package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
  254. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
  255. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
  256. package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
  257. package/resources/js/context/skills/platform-services/references/api_reference.md +0 -18
  258. package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
  259. package/resources/js/context/skills/platform-services/scripts/install.mjs +0 -148
  260. package/resources/js/context/skills/resolution-adaptation/SKILL.md +0 -47
  261. package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
  262. package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -249
  263. package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +0 -98
  264. package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -200
  265. package/resources/js/context/skills/resolution-adaptation/references/audit.md +0 -31
  266. package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
  267. package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
  268. package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
  269. package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
  270. package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
  271. package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +0 -55
  272. package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
  273. package/resources/js/context/skills/scene-editor-compat/SKILL.md +0 -94
  274. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +0 -13
  275. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +0 -6
  276. package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +0 -25
  277. package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +0 -18
  278. package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +0 -7
  279. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +0 -42
  280. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +0 -144
  281. package/resources/js/context/skills/scene-editor-compat/docs/contract.md +0 -330
  282. package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +0 -64
  283. package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +0 -28
  284. package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +0 -47
  285. package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +0 -64
  286. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +0 -38
  287. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +0 -9
  288. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +0 -59
  289. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +0 -30
  290. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +0 -66
  291. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +0 -20
  292. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +0 -26
  293. package/resources/js/context/skills/scene-editor-compat/references/contract.md +0 -73
  294. package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +0 -162
  295. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +0 -853
  296. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +0 -173
  297. package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -427
  298. package/resources/js/context/skills/scene-editor-compat/version.json +0 -1
  299. package/resources/js/context/skills/ui-editor-compat/SKILL.md +0 -48
  300. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
  301. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -74
  302. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
  303. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
  304. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
  305. package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
  306. package/resources/js/context/skills/ui-editor-compat/references/contract.md +0 -132
  307. package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
  308. package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
  309. package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
  310. package/resources/js/context/skills/version-update/SKILL.md +0 -192
  311. package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
  312. package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
  313. package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
  314. package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  315. package/resources/js/context/version/version.json +0 -1
  316. package/resources/js/project/SPEC/assist/.gitkeep +0 -0
  317. package/resources/js/project/SPEC/guide/.gitkeep +0 -0
  318. package/resources/js/project/SPEC/plan/.gitkeep +0 -0
  319. package/resources/js/project/SPEC/readme.md +0 -6
  320. package/resources/js/project/SPEC/res/.gitkeep +0 -0
  321. package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
  322. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
  323. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
  324. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
  325. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
  326. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
  327. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
  328. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
  329. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
  330. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -29
  331. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
  332. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
  333. package/resources/js/project/runtime/lightgame/1.0.0/release.json +0 -37
  334. package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
  335. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
  336. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
  337. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
  338. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
  339. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
  340. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
  341. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
  342. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
  343. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
  344. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
  345. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
  346. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
  347. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
  348. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
  349. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
  350. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
  351. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
  352. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
  353. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
  354. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
  355. package/resources/js/project/scripts/refresh-runtime.mjs +0 -50
  356. package/resources/js/project/vendor/core-manager-js/package.json +0 -33
  357. package/resources/js/project/vendor/core-manager-js/src/.versions.json +0 -42
  358. package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +0 -41
  359. package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +0 -93
  360. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +0 -203
  361. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +0 -106
  362. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +0 -25
  363. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +0 -21
  364. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +0 -65
  365. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +0 -340
  366. package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +0 -87
  367. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +0 -92
  368. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +0 -271
  369. package/resources/js/project/vendor/core-manager-js/src/index.ts +0 -31
  370. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +0 -81
  371. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +0 -43
  372. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +0 -32
  373. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +0 -141
  374. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +0 -20
  375. package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +0 -183
  376. package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +0 -304
  377. package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +0 -351
  378. package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +0 -180
  379. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +0 -13
  380. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +0 -14
  381. package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +0 -68
  382. package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +0 -433
  383. package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +0 -118
  384. package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +0 -444
  385. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +0 -485
  386. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +0 -66
  387. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +0 -149
  388. package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +0 -9
  389. package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +0 -29
  390. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +0 -88
  391. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +0 -122
  392. package/resources/js/project/vendor/core-manager-js/src/runtime.ts +0 -24
  393. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +0 -318
  394. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +0 -151
  395. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +0 -235
  396. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +0 -98
  397. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +0 -94
  398. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +0 -209
  399. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +0 -106
  400. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +0 -341
  401. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +0 -68
  402. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +0 -236
  403. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +0 -22
  404. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +0 -29
  405. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +0 -197
  406. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +0 -9
  407. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +0 -555
  408. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +0 -112
  409. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +0 -178
  410. package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +0 -246
  411. package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +0 -139
  412. package/resources/js/project/vendor/core-manager-js/tsconfig.json +0 -15
  413. package/resources/js/project/vendor/run.sh +0 -4
  414. package/resources/js/project/version/craft_feature_version.json +0 -42
  415. package/resources/js/project/version/project_feature_version.json +0 -11
  416. package/resources/js3d/context/.role/AGENTS_DESIGN.md +0 -9
  417. package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +0 -75
  418. package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +0 -42
  419. package/resources/js3d/context/knowledge/FrontendComponents.md +0 -19
  420. package/resources/js3d/context/knowledge/MobileAdaptation.md +0 -73
  421. package/resources/js3d/context/knowledge/MobileAdapted.md +0 -36
  422. package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
  423. package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -117
  424. package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -430
  425. package/resources/js3d/context/knowledge/PlatformServices.md +0 -190
  426. package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +0 -35
  427. package/resources/js3d/context/knowledge/SceneEditorCompat.md +0 -35
  428. package/resources/js3d/context/knowledge/StepByStep.md +0 -21
  429. package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
  430. package/resources/js3d/context/knowledge/UiEditorCompat.md +0 -21
  431. package/resources/js3d/context/rules/MultiplayerCapability.md +0 -27
  432. package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +0 -63
  433. package/resources/js3d/context/rules/PlatformBoundaryModules.md +0 -44
  434. package/resources/js3d/context/rules/preview_ready.md +0 -8
  435. package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +0 -70
  436. package/resources/js3d/context/skills/aigc-integration/callback.md +0 -77
  437. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +0 -23
  438. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +0 -38
  439. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +0 -72
  440. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +0 -33
  441. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +0 -36
  442. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +0 -37
  443. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +0 -35
  444. package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +0 -58
  445. package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +0 -62
  446. package/resources/js3d/context/skills/asset-search/scripts/config.json +0 -235
  447. package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +0 -905
  448. package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +0 -79
  449. package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +0 -74
  450. package/resources/js3d/context/skills/asset-search/scripts/search.mjs +0 -637
  451. package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -667
  452. package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +0 -42
  453. package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +0 -31
  454. package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +0 -89
  455. package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +0 -143
  456. package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +0 -90
  457. package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
  458. package/resources/js3d/context/skills/game-art-style/SKILL.md +0 -60
  459. package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
  460. package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
  461. package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
  462. package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
  463. package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
  464. package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
  465. package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
  466. package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
  467. package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +0 -38
  468. package/resources/js3d/context/skills/game-art-style/references/construction.md +0 -111
  469. package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +0 -105
  470. package/resources/js3d/context/skills/game-art-style/references/sources.md +0 -25
  471. package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +0 -175
  472. package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +0 -168
  473. package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +0 -191
  474. package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +0 -165
  475. package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +0 -173
  476. package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +0 -185
  477. package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +0 -181
  478. package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +0 -189
  479. package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +0 -88
  480. package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +0 -301
  481. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -104
  482. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -933
  483. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
  484. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
  485. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
  486. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -257
  487. package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +0 -342
  488. package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +0 -140
  489. package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +0 -11
  490. package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +0 -53
  491. package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
  492. package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +0 -10
  493. package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
  494. package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
  495. package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +0 -74
  496. package/resources/js3d/context/skills/performance-audit/references/case-notes.md +0 -93
  497. package/resources/js3d/context/skills/performance-audit/references/rules.md +0 -183
  498. package/resources/js3d/context/skills/platform-services/SKILL.md +0 -101
  499. package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
  500. package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
  501. package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
  502. package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
  503. package/resources/js3d/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
  504. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
  505. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
  506. package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +0 -35
  507. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
  508. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
  509. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
  510. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
  511. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
  512. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
  513. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
  514. package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +0 -49
  515. package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +0 -1
  516. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
  517. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
  518. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
  519. package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
  520. package/resources/js3d/context/skills/platform-services/references/api_reference.md +0 -18
  521. package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
  522. package/resources/js3d/context/skills/platform-services/scripts/install.mjs +0 -148
  523. package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +0 -46
  524. package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
  525. package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -239
  526. package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +0 -129
  527. package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -188
  528. package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +0 -31
  529. package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
  530. package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
  531. package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
  532. package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
  533. package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
  534. package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
  535. package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +0 -599
  536. package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +0 -141
  537. package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +0 -92
  538. package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +0 -125
  539. package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +0 -113
  540. package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -1187
  541. package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +0 -53
  542. package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +0 -4
  543. package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +0 -94
  544. package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +0 -50
  545. package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +0 -105
  546. package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +0 -147
  547. package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +0 -79
  548. package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +0 -56
  549. package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +0 -51
  550. package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +0 -55
  551. package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +0 -78
  552. package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +0 -84
  553. package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +0 -120
  554. package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +0 -4
  555. package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +0 -238
  556. package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +0 -59
  557. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
  558. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -61
  559. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
  560. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
  561. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
  562. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
  563. package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +0 -110
  564. package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
  565. package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
  566. package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
  567. package/resources/js3d/context/skills/version-update/SKILL.md +0 -191
  568. package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
  569. package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
  570. package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
  571. package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  572. package/resources/js3d/context/version/version.json +0 -1
  573. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
  574. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
  575. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
  576. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
  577. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
  578. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
  579. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
  580. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
  581. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -30
  582. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
  583. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
  584. package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +0 -39
  585. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
  586. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
  587. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
  588. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
  589. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -7
  590. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
  591. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
  592. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
  593. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
  594. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
  595. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
  596. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
  597. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
  598. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +0 -26
  599. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +0 -351
  600. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
  601. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
  602. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
  603. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
  604. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
  605. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
  606. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
  607. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
  608. package/resources/js3d/project/scripts/refresh-runtime.mjs +0 -50
  609. package/resources/js3d/project/vendor/core-manager-three/package.json +0 -12
  610. package/resources/js3d/project/vendor/core-manager-three/src/index.ts +0 -2
  611. package/resources/js3d/project/vendor/run.sh +0 -4
  612. package/resources/js3d/project/version/craft_feature_version.json +0 -42
  613. package/resources/js3d/project/version/project_feature_version.json +0 -11
  614. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +0 -7
  615. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +0 -1
  616. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +0 -145
  617. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +0 -1
  618. /package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
  619. /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
  620. /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +0 -0
package/README.md CHANGED
@@ -6,16 +6,31 @@ Craft MCP 是面向支持本地 stdio MCP 的 AI IDE 的游戏制作服务,例
6
6
 
7
7
  ## AI IDE 安装指引
8
8
 
9
+ ### Codex / WorkBuddy 自动安装(推荐)
10
+
11
+ 显式选择当前宿主;逗号分隔可同时安装两者。安装当前包的稳定运行时、核验 MCP、备份并合并配置,安装全局 craft-create Skill。
12
+
13
+ ```sh
14
+ npx --yes --registry=https://registry.npmjs.org/ @craft_eco/craft-mcp@0.1.26 install --ide codex,workbuddy
15
+ npx --yes --registry=https://registry.npmjs.org/ @craft_eco/craft-mcp@0.1.26 doctor --ide codex,workbuddy
16
+ ```
17
+
18
+ 可用 --workspace <绝对游戏父目录> 和 --platform <HTTPS origin> 指定目录与平台;未提供时保留现有配置,新安装默认 ~/CraftGames 和本包平台。升级时运行新版本 install,旧运行时保留以便回退。安装不创建游戏、不修改信任权限。
19
+
20
+ Codex 配置 ~/.codex/config.toml(设置 CODEX_HOME 时使用其 config.toml),全局 Skill ~/.agents/skills/craft-create;WorkBuddy 配置 ~/.workbuddy/mcp.json,全局 Skill ~/.workbuddy/skills/craft-create。安装后在对应宿主开启新会话,必要时重启或重连 MCP。doctor 只核验文件与协议,不代表宿主已发现 Skill。
21
+
22
+ ### 手动接入与其他宿主
23
+
9
24
  以下命令只打印本页后退出;如果正在读取 guide 的输出,直接继续配置步骤:
10
25
 
11
26
  ```sh
12
- npx --yes --prefer-online --registry=https://registry.npmjs.org/ @craft_eco/craft-mcp@stable guide
27
+ npx --yes --prefer-online --registry=https://registry.npmjs.org/ @craft_eco/craft-mcp@0.1.26 guide
13
28
  ```
14
29
 
15
- 1. 识别当前 AI IDE 的 MCP 设置入口和配置格式,按下方示例配置 Craft。已有同包名、同 npm 源和同平台的 Craft 服务时,更新该服务的启动参数,保留其他服务。
30
+ 1. 识别当前 AI IDE 的 MCP 设置入口和配置格式,按下方示例添加 Craft 服务,保留其他服务。只有需要相同环境的 Craft 服务才复用现有配置。
16
31
  2. 若无权修改宿主配置,展示匹配该宿主的配置让用户添加。不要把 JSON 写入 TOML,也不要覆盖用户整个配置文件。
17
32
  3. 在 AI IDE 中启用并重连 MCP 服务。普通终端执行启动命令不代表宿主已加载工具;服务参数不添加 guide。
18
- 4. 调用 craft_game_info,将实际版本与 `npm view @craft_eco/craft-mcp@stable version --prefer-online --registry=https://registry.npmjs.org/` 的结果对照,确认平台为 https://pre.craft.qq.com。制作游戏前完整读取 context.engine.entrypoint 返回的 AGENTS.md 及其按需引用。
33
+ 4. 调用 craft_game_info,核对版本 0.1.26 和平台 https://test.craft.qq.com,再介绍实际可用功能。制作游戏前完整读取 context.engine.entrypoint 返回的 AGENTS.md 及其按需引用。
19
34
  5. 需要登录时调用 craft_auth_open,让用户只在返回的本机页面填写 CLI Key;凭据不进入聊天、游戏工程或共享配置。
20
35
 
21
36
  ### Codex:TOML 配置
@@ -25,14 +40,15 @@ npx --yes --prefer-online --registry=https://registry.npmjs.org/ @craft_eco/craf
25
40
  ```toml
26
41
  [mcp_servers.craft]
27
42
  command = "npx"
28
- args = ["--yes","--prefer-online","--registry=https://registry.npmjs.org/","@craft_eco/craft-mcp@stable"]
43
+ args = ["--yes","--prefer-online","--registry=https://registry.npmjs.org/","@craft_eco/craft-mcp@0.1.26"]
29
44
  startup_timeout_sec = 120
30
45
 
31
46
  [mcp_servers.craft.env]
32
- CRAFT_WEB_URL = "https://pre.craft.qq.com"
47
+ CRAFT_WEB_URL = "https://test.craft.qq.com"
48
+ CRAFT_CLIENT_IDE = "codex"
33
49
  ```
34
50
 
35
- ### Trae、WorkBuddy 与支持 mcpServers JSON 的宿主
51
+ ### WorkBuddy 与支持 mcpServers JSON 的宿主
36
52
 
37
53
  在当前 AI IDE 的 MCP 管理页面添加本地 stdio 服务。Trae 官方说明:https://docs.trae.cn/ide_add-mcp-servers 。其他宿主按自身格式填写相同 command、args、env;宿主专属扩展字段不跨 IDE 复制。
38
54
 
@@ -45,19 +61,24 @@ CRAFT_WEB_URL = "https://pre.craft.qq.com"
45
61
  "--yes",
46
62
  "--prefer-online",
47
63
  "--registry=https://registry.npmjs.org/",
48
- "@craft_eco/craft-mcp@stable"
64
+ "@craft_eco/craft-mcp@0.1.26"
49
65
  ],
50
66
  "env": {
51
- "CRAFT_WEB_URL": "https://pre.craft.qq.com"
67
+ "CRAFT_WEB_URL": "https://test.craft.qq.com",
68
+ "CRAFT_CLIENT_IDE": "workbuddy"
52
69
  }
53
70
  }
54
71
  }
55
72
  }
56
73
  ```
57
74
 
75
+ 其他宿主省略 CRAFT_CLIENT_IDE,得到通用 AGENTS.md 恢复入口。手动配置 MCP 不会安装全局 Skill;Codex/WorkBuddy 建议使用上方 install。
76
+
58
77
  ## 连接后的使用
59
78
 
60
- 默认游戏根目录为用户目录下的 CraftGames;继续已有工程时,在宿主环境变量配置中将 CLIENT_WORKSPACE_ROOT 设为原有绝对目录。
79
+ 默认游戏父目录为用户目录下的 CraftGames,游戏实际位于 <workspace>/<name>,不会自动跟随宿主当前目录。可在 MCP 环境配置中将 CLIENT_WORKSPACE_ROOT 设为游戏父目录,或在 npx 包名后追加 --workspace <绝对父目录>;重连后核对 craft_game_info.workspace。准备完成后在宿主打开返回的 project 目录。
80
+
81
+ 工程 prepare 自动维护根 AGENTS.md 的 Craft 恢复段;Codex 写 .agents/skills/craft-project/SKILL.md,WorkBuddy 写 .codebuddy/skills/craft-project/SKILL.md,未指定宿主只写 AGENTS.md。保留用户正文和同名用户 Skill。切换宿主时重新 prepare 接管既有工程,保留已有源码和另一宿主入口。引擎领域知识留在共享 MCP 资源中,通过工具返回的路径按需读取。
61
82
 
62
83
  素材按所选引擎原始契约引用:AIGC 使用平台返回的原始 URL,素材库使用候选原始 Path;不下载到 public、不改写模型依赖、不生成本地序列帧清单。以工具返回的 config_file 和 slot 定位配置,并由原始引擎解析器与 CDN 配置加载。
63
84
 
@@ -65,6 +86,6 @@ CRAFT_WEB_URL = "https://pre.craft.qq.com"
65
86
 
66
87
  私有上传使用 craft_game_upload;draft_ready 仅表示私有草稿已上传。公开发布使用 craft_game_publish_open 打开本地发布页,审阅具体文案、图片、目标版本和 revision,由用户确认后才上传公开图片并提审。
67
88
 
68
- 当前业务平台是 https://pre.craft.qq.com。npm 程序公开可下载不代表生产环境或公开发布开关已启用;上传和提审需要匹配的 Web 服务与审核配置。
89
+ 当前业务平台是 https://test.craft.qq.com。npm 程序公开可下载不代表生产环境或公开发布开关已启用;上传和提审需要匹配的 Web 服务与审核配置。
69
90
 
70
91
  发布图片上传后可公开访问,游戏审核通过后可能公开。平台审核覆盖提交的文案与图片,不会扫描或执行整个游戏压缩包。
package/bin/craft-mcp.mjs CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFile } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
3
5
 
4
6
  const [major, minor] = process.versions.node.split('.').map(Number);
5
7
  if (major < 22 || (major === 22 && minor < 12)) {
@@ -8,18 +10,18 @@ if (major < 22 || (major === 22 && minor < 12)) {
8
10
  }
9
11
 
10
12
  const args = process.argv.slice(2);
11
- if (args.length === 0) {
12
- // A supplied token or profile may belong to another environment. Use the
13
- // packaged default only for ordinary startup without either override.
14
- if (!process.env.CRAFT_WEB_URL && !process.env.CLIENT_DATA_DIR && !Object.hasOwn(process.env,'CRAFT_TOKEN')) {
15
- const { craftDefaultPlatform } = JSON.parse(await readFile(new URL('../package.json',import.meta.url),'utf8'));
16
- if (craftDefaultPlatform) process.env.CRAFT_WEB_URL = craftDefaultPlatform;
17
- }
13
+ if (args.length === 0 || (args.length === 2 && args[0] === '--workspace' && path.isAbsolute(args[1]))) {
14
+ if (args.length) process.env.CLIENT_WORKSPACE_ROOT = path.resolve(args[1]);
18
15
  await import('../dist-server/mcp/start.mjs');
19
16
  } else if (args.length === 1 && args[0] === 'guide') {
20
17
  process.stdout.write(await readFile(new URL('../README.md', import.meta.url), 'utf8'));
18
+ } else if (['install', 'doctor'].includes(args[0])) {
19
+ try {
20
+ const { runIntegrationCommand } = await import('../dist-server/integrations/install.mjs');
21
+ await runIntegrationCommand(args, fileURLToPath(new URL('..', import.meta.url)));
22
+ } catch (error) { process.stderr.write('Craft ' + args[0] + ' failed: ' + error.message + '\n'); process.exitCode = 1; }
21
23
  } else if (args.length === 1 && ['--help', '-h', 'help'].includes(args[0])) {
22
- process.stdout.write('Usage: craft-mcp [guide|--help]\n\nNo arguments: start the stdio MCP server.\nguide: print AI IDE installation instructions and exit.\n');
24
+ process.stdout.write('Usage: craft-mcp [--workspace <absolute games directory>|guide|--help]\n craft-mcp install --ide codex,workbuddy [--workspace <absolute games directory>] [--platform <HTTPS origin>]\n craft-mcp doctor --ide codex,workbuddy\n\nNo arguments: start the stdio MCP server.\n--workspace: override CLIENT_WORKSPACE_ROOT; games are created under <workspace>/<name>.\nDefault workspace: ~/CraftGames. The host current directory is not used.\nguide: print AI IDE installation instructions and exit.\ninstall: install this package into a stable runtime, verify MCP, merge the selected host configurations and install craft-create Skills. Existing workspace/platform are preserved unless specified.\ndoctor: verify configured MCP and bootstrap Skill files; host discovery still requires a new host session.\n');
23
25
  } else {
24
26
  process.stderr.write('Unknown command or extra arguments. Use craft-mcp --help.\n');
25
27
  process.exitCode = 1;
@@ -0,0 +1,43 @@
1
+ import path from 'node:path';
2
+ import { lstat, readdir, readFile } from 'node:fs/promises';
3
+ import { createHash } from 'node:crypto';
4
+
5
+ export const bundleContracts = Object.freeze({ export:1, skills:1, mcp:1, sdk_lifecycle:1 });
6
+ export const digest = value => createHash('sha256').update(value).digest('hex');
7
+ export function bundleId(manifest) {
8
+ const { id, ...body } = manifest;
9
+ return digest(JSON.stringify(body));
10
+ }
11
+
12
+ // Hash the complete engine payload, including executable skills, hooks and template.
13
+ // Common workflow and the selected engine guide travel with each version as well.
14
+ export async function bundleFiles(root, engine) {
15
+ if (!['js','js3d'].includes(engine)) throw new Error('Unsupported bundle engine');
16
+ const files = {};
17
+ async function visit(relative) {
18
+ const file = path.join(root,relative), stat = await lstat(file);
19
+ if (stat.isSymbolicLink()) throw new Error('Context bundle contains a link: ' + relative);
20
+ if (stat.isDirectory()) {
21
+ for (const name of (await readdir(file)).sort()) await visit(relative + '/' + name);
22
+ } else if (stat.isFile()) files[relative] = digest(await readFile(file));
23
+ else throw new Error('Invalid context bundle file: ' + relative);
24
+ }
25
+ if ((await lstat(root)).isSymbolicLink() || (await lstat(path.join(root,engine))).isSymbolicLink() ||
26
+ (await lstat(path.join(root,'craft-game-maker'))).isSymbolicLink()) throw new Error('Context bundle root contains a link');
27
+ for (const relative of [engine+'/context',engine+'/project','craft-game-maker/SKILL.md','craft-game-maker/'+engine+'.md']) await visit(relative);
28
+ return files;
29
+ }
30
+
31
+ export async function verifyBundle(root, engine, expectedId) {
32
+ const file = path.join(root,engine,'bundle.json');
33
+ if (!(await lstat(file)).isFile() || (await lstat(file)).isSymbolicLink()) throw new Error('Invalid bundle manifest');
34
+ const manifest = JSON.parse(await readFile(file,'utf8'));
35
+ if (manifest.schema !== 1 || manifest.engine !== engine || manifest.id !== bundleId(manifest) ||
36
+ (expectedId && manifest.id !== expectedId)) throw new Error('Context bundle identity mismatch: ' + engine);
37
+ for (const [key,version] of Object.entries(bundleContracts)) {
38
+ if (manifest.contracts?.[key] !== version) throw new Error('Incompatible context contract: ' + key + '; install a Craft version supporting this bundle');
39
+ }
40
+ const actual = await bundleFiles(root,engine);
41
+ if (JSON.stringify(actual) !== JSON.stringify(manifest.files)) throw new Error('Context bundle integrity check failed: ' + engine);
42
+ return manifest;
43
+ }
@@ -1,12 +1,13 @@
1
1
  import path from 'node:path';
2
2
  import { readFile } from 'node:fs/promises';
3
+ import { verifyBundle } from './bundle-files.mjs';
3
4
 
4
5
  // Keep project validation and resource selection on the same engine definitions.
5
6
  const definitions = {
6
7
  js: { label:'2D / Phaser', dependency:'phaser', files:['configs/assets.json','src/scenes/LoadScene.ts','src/scenes/PlayScene.ts'],
7
8
  references:{loading:'knowledge/Lifecycle.md'} },
8
9
  js3d: { label:'3D / Three.js', dependency:'three', files:[],
9
- references:{runtime:'knowledge/Runtime.md',pitfalls:'knowledge/CodingGuide/Pitfalls.md',scene_editor:'knowledge/SceneEditorCompat.md'} },
10
+ references:{runtime:'knowledge/Runtime.md',pitfalls:'knowledge/CodingGuide/Pitfalls.md'} },
10
11
  };
11
12
 
12
13
  export function engineDefinition(engine) {
@@ -18,13 +19,19 @@ export async function loadEngineResources(resources) {
18
19
  const workflow = path.join(resources,'craft-game-maker','SKILL.md');
19
20
  const instructions = await readFile(workflow,'utf8');
20
21
  const engines = {};
21
- for (const [engine,definition] of Object.entries(definitions)) {
22
+ for (const engine of Object.keys(definitions)) engines[engine] = await loadEngineResource(resources,engine);
23
+ return { instructions, engines };
24
+ }
25
+
26
+ export async function loadEngineResource(resources, engine, expectedId) {
27
+ const definition = engineDefinition(engine), bundle = await verifyBundle(resources,engine,expectedId);
28
+ const workflow = path.join(resources,'craft-game-maker','SKILL.md');
29
+ const instructions = await readFile(workflow,'utf8');
22
30
  const directory = path.join(resources,engine,'context');
23
31
  const guide = path.join(resources,'craft-game-maker',engine + '.md');
24
- engines[engine] = { engine, label:definition.label, template:path.join(resources,engine,'project'),
32
+ return { engine, label:definition.label, resources, bundle, template:path.join(resources,engine,'project'),
25
33
  instructions:instructions + '\n\n' + await readFile(guide,'utf8'),
26
- context:{ workflow, engine:{name:engine,directory,guide,entrypoint:path.join(directory,'AGENTS.md')},
34
+ context:{ workflow, bundle:{id:bundle.id,source_revision:bundle.source_revision,contracts:bundle.contracts,compatibility:bundle.compatibility},
35
+ engine:{name:engine,directory,guide,entrypoint:path.join(directory,'AGENTS.md'),skills_index:path.join(directory,'skills/index.json')},
27
36
  references:Object.fromEntries(Object.entries(definition.references).map(([key,file])=>[key,path.join(directory,file)])) } };
28
- }
29
- return { instructions, engines };
30
37
  }
@@ -0,0 +1,90 @@
1
+ import path from 'node:path';
2
+ import { cp, mkdir, mkdtemp, readFile, writeFile, lstat, rename, rm } from 'node:fs/promises';
3
+ import { safeProjectFile } from './asset-import.mjs';
4
+ import { loadEngineResource } from './engines.mjs';
5
+ import { verifyBundle } from './bundle-files.mjs';
6
+
7
+ export const contextLock = '.craft/context-lock.json';
8
+ export async function readContextLock(project, engine) {
9
+ let lock;
10
+ try { lock = JSON.parse(await readFile(await safeProjectFile(project,contextLock),'utf8')); }
11
+ catch (error) { if (error.code === 'ENOENT') return null; throw error; }
12
+ if (lock.schema !== 1 || lock.engine !== engine || !/^[a-f0-9]{64}$/.test(lock.bundle_id) ||
13
+ typeof lock.source_revision !== 'string') throw new Error('Invalid project context lock or engine mismatch; restore the project lock from version control');
14
+ return lock;
15
+ }
16
+
17
+ export async function checkProjectCompatibility(project, bundle) {
18
+ const runtime = JSON.parse(await readFile(await safeProjectFile(project,'game-runtime.json'),'utf8'));
19
+ const pkg = JSON.parse(await readFile(await safeProjectFile(project,'package.json'),'utf8'));
20
+ const c = bundle.compatibility;
21
+ // Exact versions are the tested contract. Widen only with engine-specific validation.
22
+ if (runtime.version !== c.runtime_version || pkg.dependencies?.[c.dependency] !== c.dependency_version) {
23
+ throw new Error('Incompatible project runtime/dependency for '+bundle.engine+' context '+bundle.id+
24
+ '; expected runtime '+c.runtime_version+' and '+c.dependency+' '+c.dependency_version+'. Restore matching project versions or explicitly migrate and validate the engine bundle');
25
+ }
26
+ }
27
+
28
+ async function regularDirectory(directory) {
29
+ await mkdir(directory,{recursive:true});
30
+ const stat = await lstat(directory);
31
+ if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error('Context cache must not contain directory links');
32
+ }
33
+
34
+ export class ProjectBundles {
35
+ constructor(state, engines) { this.cache = path.join(state,'context-bundles'); this.engines = engines; }
36
+ async retain(selected) {
37
+ await regularDirectory(this.cache);
38
+ const {engine,bundle,resources} = selected, target = path.join(this.cache,bundle.id);
39
+ try { await lstat(target); await verifyBundle(target,engine,bundle.id); return; }
40
+ catch (error) { if (error.code !== 'ENOENT') throw error; }
41
+ const staging = await mkdtemp(path.join(this.cache,'.staging-'));
42
+ try {
43
+ for (const name of [...Object.keys(bundle.files),engine+'/bundle.json']) {
44
+ await mkdir(path.dirname(path.join(staging,name)),{recursive:true});
45
+ await cp(path.join(resources,name),path.join(staging,name),{dereference:false});
46
+ }
47
+ await verifyBundle(staging,engine,bundle.id);
48
+ try { await rename(staging,target); }
49
+ catch (error) {
50
+ if (!['EEXIST','ENOTEMPTY','EPERM'].includes(error.code)) throw error;
51
+ await verifyBundle(target,engine,bundle.id);
52
+ }
53
+ } finally { await rm(staging,{recursive:true,force:true}); }
54
+ }
55
+ async resolve(project, engine, lock) {
56
+ if (!lock) throw new Error('Project context is unbound; run craft_game_prepare to validate and bind the existing game without resetting its source');
57
+ const current = this.engines[engine];
58
+ if (current.bundle.id !== lock.bundle_id && (await lstat(this.cache).catch(error=>{
59
+ if (error.code === 'ENOENT') return null;
60
+ throw error;
61
+ }))?.isSymbolicLink()) throw new Error('Context cache must not contain directory links');
62
+ const resources = current.bundle.id === lock.bundle_id ? current.resources : path.join(this.cache,lock.bundle_id);
63
+ let selected;
64
+ try { selected = await loadEngineResource(resources,engine,lock.bundle_id); }
65
+ catch (error) {
66
+ if (error.code === 'ENOENT') throw new Error('Missing pinned context bundle '+lock.bundle_id+' ('+engine+', source '+lock.source_revision+'). Restore the matching Craft distribution or its context-bundles cache; the project has not been upgraded');
67
+ throw error;
68
+ }
69
+ if (selected.bundle.source_revision !== lock.source_revision) throw new Error('Project context source revision mismatch');
70
+ await checkProjectCompatibility(project,selected.bundle);
71
+ return selected;
72
+ }
73
+ async bind(project, engine) {
74
+ const existing = await readContextLock(project,engine);
75
+ const selected = existing ? await this.resolve(project,engine,existing) : await loadEngineResource(this.engines[engine].resources,engine);
76
+ await checkProjectCompatibility(project,selected.bundle);
77
+ await this.retain(selected);
78
+ if (existing) return existing;
79
+ const lock = {schema:1,engine,bundle_id:selected.bundle.id,source_revision:selected.bundle.source_revision};
80
+ const file = await safeProjectFile(project,contextLock,true);
81
+ try { await writeFile(file,JSON.stringify(lock,null,2)+'\n',{flag:'wx'}); }
82
+ catch (error) {
83
+ if (error.code !== 'EEXIST') throw error;
84
+ const concurrent = await readContextLock(project,engine);
85
+ await this.resolve(project,engine,concurrent);
86
+ return concurrent;
87
+ }
88
+ return lock;
89
+ }
90
+ }
@@ -0,0 +1,91 @@
1
+ import path from 'node:path';
2
+ import { readFile, writeFile, rename, lstat } from 'node:fs/promises';
3
+ import { createHash } from 'node:crypto';
4
+ import { safeProjectFile } from './asset-import.mjs';
5
+ import { clientIde, projectSkillPath } from '../integrations/hosts.mjs';
6
+
7
+ const start = '<!-- craft-mcp:project:start -->';
8
+ const end = '<!-- craft-mcp:project:end -->';
9
+
10
+ export function projectContextPaths(project, ide = 'generic') {
11
+ const host = clientIde(ide), relative = projectSkillPath(host);
12
+ const skill = relative ? path.join(project, relative) : null;
13
+ return { entrypoint: path.join(project, 'AGENTS.md'), progress: path.join(project, 'SPEC/PROGRESS.md'), host, skill,
14
+ ...(host === 'workbuddy' ? { workbuddy_skill: skill } : {}) };
15
+ }
16
+
17
+ function recovery(name, engine) {
18
+ return `Craft 工程名:\`${name}\`;引擎:\`${engine}\`。保持已有引擎与用户源码。\n\n`
19
+ + '先读 `SPEC/PROGRESS.md` 和已有的 SPEC 设计文件,核对已完成玩法、待办及最近验收;缺少记录时检查源码与工具回执,不根据旧聊天猜测。\n\n'
20
+ + `继续本工程前调用 \`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
+ + `MCP 的 workspace 是游戏父目录,工程位于 \`workspace/${name}\`,不自动跟随宿主当前目录。若不匹配,先在宿主 MCP 设置中将 \`--workspace\` 参数(优先)或 \`CLIENT_WORKSPACE_ROOT\` 指向当前游戏的父目录并重连;不要在错误目录创建同名工程。\n\n`
22
+ + `迁移目录或首次恢复时若提示尚未 prepare,确认 workspace 后调用 \`craft_game_prepare({"name":"${name}","engine":"${engine}"})\` 并轮询任务完成;已有合法工程只会被接管,不重置模板。目录更名后使用当前目录名(须符合工具的英文 name 规则)。\n\n`
23
+ + '项目以 `.craft/context-lock.json` 绑定引擎上下文版本,随项目保存;实际路径每次通过工具查询。缺少绑定时由 prepare 核验后建立,缺包或不兼容时按诊断恢复匹配版本,不删除锁文件来绕过检查。上下文、模板和技能脚本由 Craft 版本包提供,不复制到游戏中;MCP 未连接时先连接项目使用的 Craft 服务。\n\n'
24
+ + '验收使用 `craft_game_check` → `craft_game_review` → `craft_game_deliver`;宿主按返回命令启动预览,再核对当前快照已运行。构建成功不代表预览自动开启。\n\n'
25
+ + '完成开发或停在中间状态时更新 `SPEC/PROGRESS.md`:当前玩法和操作、已完成/待办、关键文件、最近验收任务及结果、预览状态和下一步。记录可核实的事实,验收失败也保留;预览地址须重新查询,只读任务不写进度。';
26
+ }
27
+
28
+ // Only our marked section is managed. User text before/after it remains byte-for-byte intact.
29
+ function mergeEntry(original, block) {
30
+ const begins = original.split(start).length - 1, ends = original.split(end).length - 1;
31
+ if (!begins && !ends) return original + (original && !original.endsWith('\n') ? '\n' : '') + (original ? '\n' : '') + block + '\n';
32
+ if (begins !== 1 || ends !== 1 || original.indexOf(end) < original.indexOf(start)) throw new Error('Ambiguous Craft managed section in AGENTS.md; preserve and repair its markers before preparing');
33
+ return original.slice(0, original.indexOf(start)) + block + original.slice(original.indexOf(end) + end.length);
34
+ }
35
+
36
+ async function readOptional(file) {
37
+ try { return await readFile(file, 'utf8'); }
38
+ catch (error) { if (error.code !== 'ENOENT') throw error; return ''; }
39
+ }
40
+
41
+ function ownedSkill(content) {
42
+ return content.startsWith('---\nname: craft-project\n') && content.includes(start) && content.endsWith(end + '\n');
43
+ }
44
+
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 };
62
+ }
63
+
64
+ export async function prepareProjectContext(project, name, engine, ide = 'generic') {
65
+ const paths = projectContextPaths(project, ide);
66
+ const entry = await safeProjectFile(project, 'AGENTS.md');
67
+ const original = await readOptional(entry);
68
+ const body = recovery(name, engine);
69
+ const updated = mergeEntry(original, start + '\n## Craft 项目恢复\n\n' + body + '\n' + end);
70
+ const skill = paths.skill ? await safeProjectFile(project, projectSkillPath(paths.host), true) : null;
71
+ const existingSkill = skill ? await readOptional(skill) : '';
72
+ const label = engine === 'js3d' ? '3D / Three.js' : '2D / Phaser';
73
+ 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`
74
+ + start + '\n# 继续当前 Craft 游戏\n\n'
75
+ + `1. 读取项目根 \`AGENTS.md\`,确认工程 \`${name}\` 和引擎 \`${engine}\`。\n`
76
+ + '2. 按项目恢复规则读取 `SPEC/PROGRESS.md`、已有设计记录并调用 `craft_game_info`。核对工程路径、引擎与版本绑定后,读取返回的工作流、引擎入口和技能索引,按任务描述选择技能。\n'
77
+ + '3. 根据实际进度继续工作;仅恢复上下文时无需重新 prepare 或重建模板。完成修改后更新进度并按工作流验收、看图、启动预览。\n'
78
+ + end + '\n';
79
+ // A same-name user skill is not ours to replace. AGENTS.md remains the recovery entry.
80
+ const skillStatus = !skill ? 'not_requested' : existingSkill && !ownedSkill(existingSkill) ? 'preserved_user_file' : 'managed';
81
+ const progress = await safeProjectFile(project, 'SPEC/PROGRESS.md', true);
82
+ // This is project-owned state, never regenerated by prepare or a runtime upgrade.
83
+ 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' }); }
84
+ catch (error) { if (error.code !== 'EEXIST') throw error; }
85
+ if (updated !== original) await writeFile(entry, updated);
86
+ if (skillStatus === 'managed' && existingSkill !== desiredSkill) await writeFile(skill, desiredSkill);
87
+ const migration = paths.host === 'workbuddy' ? await migrateWorkBuddySkill(project, skillStatus) : null;
88
+ return { ...paths, skill_status: skillStatus,
89
+ ...(migration ? { legacy_skill: migration } : {}),
90
+ ...(paths.host === 'workbuddy' ? { workbuddy_skill_status: skillStatus } : {}) };
91
+ }
@@ -5,6 +5,9 @@ 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';
9
+ import { clientIde } from '../integrations/hosts.mjs';
10
+ import { ProjectBundles, readContextLock } from './project-bundles.mjs';
8
11
 
9
12
  async function inspectProject(project, expected) {
10
13
  const runtime = JSON.parse(await readFile(await safeProjectFile(project,'game-runtime.json'),'utf8'));
@@ -27,7 +30,7 @@ async function readRecord(file, project) {
27
30
  }
28
31
 
29
32
  export class Projects {
30
- constructor(root, state, engines) { this.root = root; this.state = path.join(state,'projects'); this.engines = engines; }
33
+ constructor(root, state, engines, ide = 'generic') { this.root = root; this.state = path.join(state,'projects'); this.engines = engines; this.ide = clientIde(ide); this.bundles = new ProjectBundles(state,engines); }
31
34
  async init() { await mkdir(this.state, { recursive: true }); }
32
35
  file(name) {
33
36
  if (typeof name !== 'string' || !/^[a-z][a-z0-9-]{0,47}$/.test(name)) throw new Error('Project name must match [a-z][a-z0-9-]{0,47}');
@@ -36,13 +39,18 @@ export class Projects {
36
39
  async owned(name) {
37
40
  return (await this.describe(name)).project;
38
41
  }
39
- async describe(name) {
42
+ async describe(name, {allowUnbound = false} = {}) {
40
43
  const project = this.file(name);
41
44
  if ((await lstat(project)).isSymbolicLink() || await realpath(project) !== project) throw new Error('Project path changed or is a symbolic link');
42
45
  const record = await readRecord(path.join(this.state,name + '.json'),project);
43
46
  if (!record) throw new Error('Prepare this project before using it');
44
47
  const engine = await inspectProject(project,record.engine);
45
- return { name, project, engine };
48
+ const lock = await readContextLock(project,engine);
49
+ if (lock || !allowUnbound) await this.bundles.resolve(project,engine,lock);
50
+ return { name, project, engine, context_binding:lock ? {status:'bound',...lock} : {status:'unbound',action:'Run craft_game_prepare to validate and bind this existing project; source files are preserved'} };
51
+ }
52
+ async resourcesFor(description) {
53
+ return this.bundles.resolve(description.project,description.engine,await readContextLock(description.project,description.engine));
46
54
  }
47
55
  async prepare(name, requestedEngine, signal) {
48
56
  signal?.throwIfAborted();
@@ -58,6 +66,7 @@ export class Projects {
58
66
  if (created) await seedProjectTemplate(this.engines[requestedEngine ?? record?.engine ?? 'js'].template,project,{ signal });
59
67
  // Existing Craft games are adopted, never overwritten or silently converted from another engine.
60
68
  const engine = await inspectProject(project,record?.engine ?? requestedEngine);
69
+ const lock = await this.bundles.bind(project,engine);
61
70
  signal?.throwIfAborted();
62
71
  if (engine === 'js3d') {
63
72
  const assets = await safeProjectFile(project,'configs/assets.json');
@@ -67,7 +76,8 @@ export class Projects {
67
76
  await assetConfig(project);
68
77
  signal?.throwIfAborted();
69
78
  if (!record?.engine) await atomicJson(recordFile,{ schema:1, name, project, engine });
70
- return { name, project, created, engine };
79
+ const project_context = await prepareProjectContext(project, name, engine, this.ide);
80
+ return { name, project, created, engine, project_context, context_binding:{status:'bound',...lock} };
71
81
  }
72
82
  }
73
83
 
@@ -82,6 +92,8 @@ export async function fingerprint(project) {
82
92
  if (entry.isSymbolicLink()) throw new Error('Source symbolic links are not supported: ' + key);
83
93
  if (entry.isDirectory()) { await walk(file,key); continue; }
84
94
  if (!entry.isFile()) throw new Error('Unsupported source file: ' + key);
95
+ // Session handoff notes are not build inputs. Recording a check receipt must not invalidate that check.
96
+ if (key === '/SPEC/PROGRESS.md' || /^\/\.workbuddy\/memory\/.*\.md$/.test(key)) continue;
85
97
  const stat = await lstat(file);
86
98
  if (++files > 10000 || (bytes += stat.size) > 128 * 1024 * 1024) throw new Error('Project exceeds source snapshot limits');
87
99
  hash.update(key).update('\0').update(await readFile(file)).update('\0');
@@ -8,30 +8,29 @@ import { imageExtension } from './asset-formats.mjs';
8
8
  import { digest } from './request-store.mjs';
9
9
 
10
10
  const text = (value, max, label) => {
11
- if (typeof value !== 'string' || !value.trim() || [...value].length > max || /[\x00-\x08\x0b\x0c\x0e-\x1f]/.test(value)) throw new Error(`请填写有效的${label},最多 ${max} 个字符。`);
11
+ if (typeof value !== 'string' || !value.trim() || [...value].length > max || /[\x00-\x08\x0b\x0c\x0e-\x1f]/.test(value)) throw new Error(`Invalid publication ${label}`);
12
12
  return value.trim();
13
13
  };
14
14
  const imageLimit = 2 * 1024 * 1024;
15
- const imageFormatMessage = '请选择 PNG 或 JPEG 格式的发布图片。';
16
15
 
17
16
  export function publicationMaterials(input) {
18
17
  const allowed = ['game_name','instructions','game_type','art_styles','play_tags','open_to_recreate','cover_path','cover_image_source'];
19
- if (!input || Array.isArray(input) || typeof input !== 'object' || Object.keys(input).some(key=>!allowed.includes(key))) throw new Error('发布资料格式无效。请检查资料后再提交。');
20
- const result = { game_name:text(input.game_name,40,'游戏名称'), instructions:text(input.instructions,8000,'玩法说明'),game_type:text(input.game_type,100,'游戏类型') };
21
- for (const [key,label] of [['art_styles','美术风格'],['play_tags','玩法标签']]) {
18
+ if (!input || Array.isArray(input) || typeof input !== 'object' || Object.keys(input).some(key=>!allowed.includes(key))) throw new Error('Invalid publication materials');
19
+ const result = { game_name:text(input.game_name,40,'game_name'), instructions:text(input.instructions,8000,'instructions'),game_type:text(input.game_type,100,'game_type') };
20
+ for (const key of ['art_styles','play_tags']) {
22
21
  const values = input[key] ?? [];
23
- if (!Array.isArray(values) || values.length > 12) throw new Error(`请选择有效的${label},最多 12 项。`);
24
- result[key] = [...new Set(values.map(value=>text(value,50,label)))];
22
+ if (!Array.isArray(values) || values.length > 12) throw new Error('Invalid publication tags');
23
+ result[key] = [...new Set(values.map(value=>text(value,50,key)))];
25
24
  }
26
- if (Buffer.byteLength(JSON.stringify({ game_type:result.game_type,art_styles:result.art_styles,play_tags:result.play_tags })) > 1900) throw new Error('分类和标签超出平台长度限制。请减少标签后再试。');
27
- if (input.open_to_recreate !== undefined && typeof input.open_to_recreate !== 'boolean') throw new Error('开放二创选项无效。请关闭开放二创后再试。');
28
- if (input.open_to_recreate === true) throw new Error('当前版本不包含可编辑源码。请关闭开放二创后再试。');
25
+ if (Buffer.byteLength(JSON.stringify({ game_type:result.game_type,art_styles:result.art_styles,play_tags:result.play_tags })) > 1900) throw new Error('Publication tags exceed the platform limit');
26
+ if (input.open_to_recreate !== undefined && typeof input.open_to_recreate !== 'boolean') throw new Error('Choose open_to_recreate explicitly as a boolean');
27
+ if (input.open_to_recreate === true) throw new Error('External dist-only versions do not include editable sources; open_to_recreate must be false');
29
28
  result.open_to_recreate = input.open_to_recreate ?? false;
30
- if (input.cover_image_source !== undefined && ![1,2].includes(input.cover_image_source)) throw new Error('封面来源无效。请重新选择封面。');
29
+ if (input.cover_image_source !== undefined && ![1,2].includes(input.cover_image_source)) throw new Error('Invalid cover image source');
31
30
  result.cover_image_source = input.cover_image_source ?? 2;
32
31
  if (input.cover_path !== undefined) {
33
- const value = text(input.cover_path,512,'封面路径');
34
- if (path.isAbsolute(value) || /[\\:\x00]/.test(value) || value.split('/').some(part=>!part || part.startsWith('.'))) throw new Error('请使用工程内的相对路径指定 PNG 或 JPEG 封面。');
32
+ const value = text(input.cover_path,512,'cover_path');
33
+ if (path.isAbsolute(value) || /[\\:\x00]/.test(value) || value.split('/').some(part=>!part || part.startsWith('.'))) throw new Error('Cover must be a project-relative PNG/JPEG');
35
34
  result.cover_path = value;
36
35
  }
37
36
  return result;
@@ -43,20 +42,19 @@ export async function readMaterial(root, relative, expected) {
43
42
  let data;
44
43
  try {
45
44
  const stat = await handle.stat();
46
- if (!stat.isFile() || stat.size < 1 || stat.size > imageLimit) throw new Error('请选择大小在 2 MiB 以内的非空发布图片。');
45
+ if (!stat.isFile() || stat.size < 1 || stat.size > imageLimit) throw new Error('Publication images must be at most 2 MiB');
47
46
  data = await handle.readFile();
48
- if (data.length !== stat.size) throw new Error('发布图片在读取时发生变化。请重新准备发布材料。');
47
+ if (data.length !== stat.size) throw new Error('Publication image changed while reading');
49
48
  } finally { await handle.close(); }
50
49
  const image = inspectImage(data);
51
50
  if (expected && (image.sha256 !== expected.sha256 || image.bytes !== expected.bytes ||
52
- (expected.extension !== undefined && image.extension !== expected.extension))) throw new Error('发布材料已变化。请重新准备并确认材料。');
51
+ (expected.extension !== undefined && image.extension !== expected.extension))) throw new Error('Publication material changed; prepare and confirm it again');
53
52
  return image;
54
53
  }
55
54
 
56
55
  function inspectImage(data) {
57
- let extension;
58
- try { extension = imageExtension(data); } catch { throw new Error(imageFormatMessage); }
59
- if (!['png','jpg'].includes(extension)) throw new Error(imageFormatMessage);
56
+ const extension = imageExtension(data);
57
+ if (!['png','jpg'].includes(extension)) throw new Error('Publication images must be PNG or JPEG');
60
58
  return { data,extension,sha256:createHash('sha256').update(data).digest('hex'),bytes:data.length };
61
59
  }
62
60
 
@@ -66,7 +64,7 @@ export async function readPublishedCover(url, signal) {
66
64
  signal:AbortSignal.any([signal,AbortSignal.timeout(15000)]) });
67
65
  if (!response.ok) {
68
66
  await response.body?.cancel();
69
- throw new Error('上次发布的封面下载失败。');
67
+ throw new Error('Publication cover download failed');
70
68
  }
71
69
  return inspectImage(await boundedBody(response,imageLimit));
72
70
  } catch {