@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
@@ -1,853 +0,0 @@
1
- #!/usr/bin/env python3
2
- """JS2D 场景编辑器契约的静态检查(项目级)。
3
-
4
- 按 JS2DSceneEditor 0.2.0 的接入契约检查一个工程:
5
- 1. localcraft.scene-editor.json 声明(schemaVersion、scene / 可选 scenes、路径规则、runtimeConsumers)
6
- 2. 每个已声明场景文件(.Scene.ts 的 Build 函数或 .json;必需字段;id 与声明一致)
7
- 3. localcraft.assets.json 资产注册表(id/name/kind、capability、source 按 kind、ID 稳定)
8
- 4. runtimeConsumers 对每一个声明 path 的非 type-only 静态 import;必须 import 资产表并提供 file url 读取接口(无 kind=file 也要先写);必须提供 listSceneBlockers(无 blocksMovement: true 也要先写)
9
- 5. SPEC/plan/dev-config.json 的 scene_editor_compat 字段
10
-
11
- 退出码:0=契约达标且 scene_editor_compat 已为 true;3=达标但标记未写;
12
- 1=有 findings;2=环境错误。
13
-
14
- 本检查是静态契约门禁,通过不等于编辑器端到端可用;最终复检仍以
15
- 「编辑器同版本的契约解析器 / 宿主检测」为准(见 ../SKILL.md)。
16
- """
17
-
18
- from __future__ import annotations
19
-
20
- import argparse
21
- import json
22
- import re
23
- import sys
24
- from dataclasses import dataclass, field
25
- from pathlib import Path
26
-
27
- DEV_CONFIG_REL = Path("SPEC") / "plan" / "dev-config.json"
28
- SCENE_EDITOR_COMPAT_FIELD = "scene_editor_compat"
29
- SCENE_EDITOR_VER_FIELD = "scene_editor_ver"
30
- SKILL_DIR = Path(__file__).resolve().parent.parent
31
- SKILL_VERSION_FILE = SKILL_DIR / "version.json"
32
-
33
- MANIFEST_NAME = "localcraft.scene-editor.json"
34
- SCENES_MAX = 64
35
- PATH_RULE_HINT = "禁 ./、../、绝对路径、反斜杠、协议、查询参数"
36
- def field_pattern(name: str) -> str:
37
- """TS 静态对象和 JSON 风格对象均允许使用带引号的属性名。"""
38
- key = re.escape(name)
39
- return r"(?:\b" + key + r"\b|'" + key + r"'|\"" + key + r"\")\s*:"
40
-
41
-
42
- SCENE_DOC_ID_RE = re.compile(field_pattern("id") + r"\s*['\"]([^'\"]+)['\"]")
43
- SCENE_CAPABILITIES = ("scene-placeable", "terrain-paintable")
44
- ASSET_KINDS = ("file", "procedural", "prefab", "terrain", "component")
45
- ASSET_KIND_HINT = "file | procedural | prefab | terrain | component"
46
-
47
- SCENE_REQUIRED_FIELDS = (
48
- "schemaVersion", "id", "name", "width", "height",
49
- "cellSize", "baseTerrain", "layers", "regions", "objects", "updatedAt",
50
- )
51
- GRID_MIN, GRID_MAX = 4, 256
52
- ITEM_INT_FIELDS = ("x", "y", "width", "height")
53
- ITEM_FLOAT_RE = re.compile(r"['\"]?\b(x|y|width|height)\b['\"]?\s*:\s*(-?\d+\.\d+)")
54
-
55
- BUILD_SIG_RE = re.compile(
56
- r"export\s+function\s+Build\s*\(\s*\)\s*:\s*SceneDocument\b"
57
- )
58
- RETURN_OBJ_RE = re.compile(r"return\s*\{")
59
- ASSET_ID_RE = re.compile(field_pattern("assetId") + r"\s*['\"]([^'\"]+)['\"]")
60
- IMPORT_FROM_RE = re.compile(
61
- r"import\s+(?:type\s+)?[^;]*?\s+from\s+['\"]([^'\"]+)['\"]"
62
- )
63
- SIDE_EFFECT_IMPORT_RE = re.compile(r"^import\s+['\"]([^'\"]+)['\"]")
64
-
65
- FORBIDDEN_PATTERNS = (
66
- ("模板字符串", re.compile(r"`")),
67
- ("箭头函数", re.compile(r"=>")),
68
- ("展开运算符", re.compile(r"\.\.\.")),
69
- ("undefined", re.compile(r"\bundefined\b")),
70
- ("await", re.compile(r"\bawait\b")),
71
- ("yield", re.compile(r"\byield\b")),
72
- ("new 表达式", re.compile(r"\bnew\s+")),
73
- )
74
-
75
-
76
- @dataclass
77
- class Finding:
78
- category: str
79
- message: str
80
-
81
-
82
- @dataclass
83
- class Report:
84
- findings: list = field(default_factory=list)
85
- compat_field: bool | None = None
86
- compat_ver: str | None = None
87
- manifest_exists: bool = False
88
- scene_path: str | None = None
89
- scene_paths: list = field(default_factory=list)
90
- scene_entries: list = field(default_factory=list)
91
-
92
- @property
93
- def compatible(self) -> bool:
94
- return not self.findings
95
-
96
- @property
97
- def marked(self) -> bool:
98
- return self.compat_field is True
99
-
100
- def add(self, category: str, message: str) -> None:
101
- self.findings.append(Finding(category, message))
102
-
103
- def to_dict(self) -> dict:
104
- status = "partial"
105
- if not self.findings:
106
- status = "ok" if self.marked else "unmarked"
107
- return {
108
- "compatible": self.compatible,
109
- "compat_field": self.compat_field is True,
110
- "compat_ver": self.compat_ver,
111
- "manifest_exists": self.manifest_exists,
112
- "scene_path": self.scene_path,
113
- "scene_paths": list(self.scene_paths),
114
- "findings": [
115
- {"category": f.category, "message": f.message}
116
- for f in self.findings
117
- ],
118
- "status": status,
119
- }
120
-
121
-
122
- def is_relative_clean_path(p: str) -> bool:
123
- """manifest 的路径要求:项目根相对路径,禁 ./、../、绝对路径、反斜杠、协议、查询参数。"""
124
- if not isinstance(p, str) or not p or p != p.strip():
125
- return False
126
- if p.startswith(("./", "../", "/", "\\")):
127
- return False
128
- if re.match(r"^[a-zA-Z]:[\\/]", p): # Windows 盘符
129
- return False
130
- if re.match(r"^[a-zA-Z][a-zA-Z0-9+.-]*:", p): # 协议
131
- return False
132
- if "\\" in p or "?" in p or "#" in p:
133
- return False
134
- if ".." in Path(p).parts:
135
- return False
136
- return True
137
-
138
-
139
- def strip_comments(text: str) -> str:
140
- """去掉 // 与 /* */ 注释(保留换行与行长),用于 import 扫描。"""
141
- out: list[str] = []
142
- i, n = 0, len(text)
143
- in_block = False
144
- while i < n:
145
- if in_block:
146
- if text[i:i + 2] == "*/":
147
- in_block = False
148
- out.append(" ")
149
- i += 2
150
- else:
151
- out.append(" " if text[i] != "\n" else "\n")
152
- i += 1
153
- elif text[i:i + 2] == "//":
154
- while i < n and text[i] != "\n":
155
- out.append(" ")
156
- i += 1
157
- elif text[i:i + 2] == "/*":
158
- in_block = True
159
- out.append(" ")
160
- i += 2
161
- else:
162
- out.append(text[i])
163
- i += 1
164
- return "".join(out)
165
-
166
-
167
- def has_field(text: str, name: str) -> bool:
168
- return re.search(field_pattern(name), text) is not None
169
-
170
-
171
- def first_number(text: str, name: str) -> float | None:
172
- m = re.search(field_pattern(name) + r"\s*(-?\d+(?:\.\d+)?)", text)
173
- return float(m.group(1)) if m else None
174
-
175
-
176
- def collect_asset_ids_json(data) -> list:
177
- ids: list[str] = []
178
- seen: set[int] = set()
179
-
180
- def walk(node) -> None:
181
- if isinstance(node, dict):
182
- for key, value in node.items():
183
- if key == "assetId" and isinstance(value, str):
184
- ids.append(value)
185
- else:
186
- walk(value)
187
- elif isinstance(node, list):
188
- for item in node:
189
- walk(item)
190
-
191
- walk(data)
192
- return ids
193
-
194
-
195
- def parse_scene_ref(entry, where: str, report: Report) -> dict | None:
196
- """校验一条 {id, path};不合法返回 None。"""
197
- if not isinstance(entry, dict):
198
- report.add("manifest", f"{where} 不是对象")
199
- return None
200
- sid = entry.get("id")
201
- path = entry.get("path")
202
- ok = True
203
- if not isinstance(sid, str) or not sid.strip():
204
- report.add("manifest", f"{where} 的 id 缺失或为空")
205
- ok = False
206
- if not isinstance(path, str) or not path:
207
- report.add("manifest", f"{where} 的 path 缺失或不是字符串")
208
- ok = False
209
- elif not is_relative_clean_path(path):
210
- report.add(
211
- "path",
212
- f"{where} 路径不合法:{path!r}({PATH_RULE_HINT})",
213
- )
214
- ok = False
215
- constraints = entry.get("constraints")
216
- if constraints is not None:
217
- if not isinstance(constraints, dict):
218
- report.add("manifest", f"{where}.constraints 必须是对象")
219
- else:
220
- for key in (
221
- "requiredObjects",
222
- "uniqueObjectKinds",
223
- "allowedObjectKinds",
224
- ):
225
- if key in constraints and not isinstance(constraints[key], list):
226
- report.add(
227
- "manifest",
228
- f"{where}.constraints.{key} 必须是数组",
229
- )
230
- if not ok or not isinstance(sid, str) or not isinstance(path, str):
231
- return None
232
- return {"id": sid, "path": path}
233
-
234
-
235
- def check_manifest_scenes(data: dict, report: Report) -> None:
236
- """解析 scene / 可选 scenes,写入 report.scene_path 与 scene_paths。"""
237
- scene = parse_scene_ref(data.get("scene"), "scene", report)
238
- if scene:
239
- report.scene_path = scene["path"]
240
- raw_scenes = data.get("scenes")
241
- if raw_scenes is None:
242
- if scene:
243
- report.scene_entries = [scene]
244
- report.scene_paths = [scene["path"]]
245
- return
246
- if not isinstance(raw_scenes, list):
247
- report.add("manifest", "scenes 必须是数组")
248
- return
249
- if not (1 <= len(raw_scenes) <= SCENES_MAX):
250
- report.add(
251
- "manifest",
252
- f"scenes 应为 1~{SCENES_MAX} 条,实际 {len(raw_scenes)}",
253
- )
254
- entries: list[dict] = []
255
- seen_ids: set[str] = set()
256
- seen_paths: set[str] = set()
257
- for index, item in enumerate(raw_scenes):
258
- parsed = parse_scene_ref(item, f"scenes[{index}]", report)
259
- if not parsed:
260
- continue
261
- if parsed["id"] in seen_ids:
262
- report.add("manifest", f"scenes 的 id 重复:{parsed['id']}")
263
- seen_ids.add(parsed["id"])
264
- path_key = parsed["path"].lower()
265
- if path_key in seen_paths:
266
- report.add("manifest", f"scenes 的 path 重复:{parsed['path']}")
267
- seen_paths.add(path_key)
268
- entries.append(parsed)
269
- if scene and entries:
270
- matched = any(
271
- item["id"] == scene["id"] and item["path"] == scene["path"]
272
- for item in entries
273
- )
274
- if not matched:
275
- report.add(
276
- "manifest",
277
- "scene 必须和 scenes 里某条的 id + path 完全一致(默认打开的那一个)",
278
- )
279
- if entries:
280
- report.scene_entries = entries
281
- report.scene_paths = [item["path"] for item in entries]
282
- elif scene:
283
- report.scene_entries = [scene]
284
- report.scene_paths = [scene["path"]]
285
-
286
-
287
- def check_manifest(root: Path, report: Report) -> dict:
288
- """检查 localcraft.scene-editor.json;返回解析出的声明或 None。"""
289
- manifest_path = root / MANIFEST_NAME
290
- if not manifest_path.is_file():
291
- report.add("manifest", f"{MANIFEST_NAME} 不存在(项目未声明场景编辑器接入)")
292
- return None
293
- report.manifest_exists = True
294
- try:
295
- data = json.loads(manifest_path.read_text(encoding="utf-8"))
296
- except json.JSONDecodeError as exc:
297
- report.add("manifest", f"{MANIFEST_NAME} 不是合法 JSON:{exc}")
298
- return None
299
- if not isinstance(data, dict):
300
- report.add("manifest", f"{MANIFEST_NAME} 根不是对象")
301
- return None
302
- if data.get("schemaVersion") != 1:
303
- report.add(
304
- "manifest",
305
- f"schemaVersion 应为 1,实际 {data.get('schemaVersion')!r}",
306
- )
307
- check_manifest_scenes(data, report)
308
- registry = data.get("assetRegistry")
309
- if not isinstance(registry, str):
310
- report.add("manifest", "assetRegistry 缺失或不是字符串")
311
- elif not is_relative_clean_path(registry):
312
- report.add(
313
- "path",
314
- f"assetRegistry 路径不合法:{registry!r}(禁 ./、../、绝对路径、反斜杠、协议、查询参数)",
315
- )
316
- consumers = data.get("runtimeConsumers")
317
- if not isinstance(consumers, list) or not consumers:
318
- report.add("manifest", "runtimeConsumers 缺失或为空(运行时静态接入无证据)")
319
- elif isinstance(consumers, list):
320
- for item in consumers:
321
- if not isinstance(item, str) or not is_relative_clean_path(item):
322
- report.add(
323
- "path",
324
- f"runtimeConsumers 路径不合法:{item!r}(禁 ./、../、绝对路径、反斜杠、协议、查询参数)",
325
- )
326
- return data
327
-
328
-
329
- def is_json_int(value) -> bool:
330
- """JSON 整数:Python int,排除 bool 与 1.0 这类 float。"""
331
- return isinstance(value, int) and not isinstance(value, bool)
332
-
333
-
334
- def check_item_int_fields(items, kind_label: str, report: Report) -> None:
335
- """物件/区域的 x、y、width、height 必须是整数格。"""
336
- if not isinstance(items, list):
337
- return
338
- for index, item in enumerate(items):
339
- if not isinstance(item, dict):
340
- continue
341
- item_id = item.get("id") if isinstance(item.get("id"), str) else f"#{index}"
342
- for field in ITEM_INT_FIELDS:
343
- if field not in item:
344
- continue
345
- value = item[field]
346
- if not is_json_int(value):
347
- report.add(
348
- "scene",
349
- f"{kind_label} {item_id} 的 {field} 必须是整数,实际 {value!r}",
350
- )
351
-
352
-
353
- def check_scene_file(
354
- root: Path,
355
- scene_path: str,
356
- report: Report,
357
- expected_id: str | None = None,
358
- ) -> list:
359
- """检查场景文件;返回从场景中收集到的 assetId 列表。"""
360
- path = root / scene_path
361
- asset_ids: list[str] = []
362
- if not path.is_file():
363
- report.add("scene", f"场景文件不存在:{scene_path}")
364
- return asset_ids
365
- suffix = path.suffix.lower()
366
- if suffix not in (".ts", ".json"):
367
- report.add("scene", f"不支持的场景文件格式:{path.suffix}(支持 .ts / .json)")
368
- return asset_ids
369
- text = path.read_text(encoding="utf-8")
370
- if suffix == ".json":
371
- try:
372
- data = json.loads(text)
373
- except json.JSONDecodeError as exc:
374
- report.add("scene", f"{scene_path} JSON 解析失败:{exc}")
375
- return asset_ids
376
- if not isinstance(data, dict):
377
- report.add("scene", f"{scene_path} 根不是对象")
378
- return asset_ids
379
- if expected_id is not None and data.get("id") != expected_id:
380
- report.add(
381
- "scene",
382
- f"{scene_path} 的 id 应为 {expected_id!r},实际 {data.get('id')!r}",
383
- )
384
- if data.get("schemaVersion") != 2:
385
- report.add("scene", f"场景 schemaVersion 应为 2,实际 {data.get('schemaVersion')!r}")
386
- for name in SCENE_REQUIRED_FIELDS:
387
- if name not in data:
388
- report.add("scene", f"场景缺少必需字段:{name}")
389
- for name in ("width", "height"):
390
- value = data.get(name)
391
- if isinstance(value, (int, float)) and not (
392
- GRID_MIN <= value <= GRID_MAX
393
- ):
394
- report.add(
395
- "scene",
396
- f"{name} 应为 {GRID_MIN}~{GRID_MAX} 格,实际 {value}",
397
- )
398
- check_item_int_fields(data.get("objects"), f"{scene_path} 物件", report)
399
- check_item_int_fields(data.get("regions"), f"{scene_path} 区域", report)
400
- asset_ids = collect_asset_ids_json(data)
401
- return asset_ids
402
- # TS 场景
403
- build = BUILD_SIG_RE.search(text)
404
- if build is None:
405
- report.add("scene", f"{scene_path} 缺少入口:export function Build(): SceneDocument")
406
- return asset_ids
407
- body = text[build.start():]
408
- if RETURN_OBJ_RE.search(body) is None:
409
- report.add("scene", "Build 函数体必须是直接 return 对象字面量")
410
- doc_id = SCENE_DOC_ID_RE.search(body)
411
- if expected_id is not None:
412
- actual = doc_id.group(1) if doc_id else None
413
- if actual != expected_id:
414
- report.add(
415
- "scene",
416
- f"{scene_path} 的 id 应为 {expected_id!r},实际 {actual!r}",
417
- )
418
- for name, pattern in FORBIDDEN_PATTERNS:
419
- if pattern.search(body):
420
- report.add(
421
- "scene",
422
- f"Build 返回对象包含不支持的内容:{name}(只允许静态字面量)",
423
- )
424
- for line in text.splitlines():
425
- stripped = line.strip()
426
- if not stripped.startswith("import "):
427
- continue
428
- if re.match(r"^import\s+type\b", stripped):
429
- continue
430
- report.add("scene", f"场景文件不允许值导入,仅允许 import type:{stripped[:60]}")
431
- for line in text.splitlines():
432
- stripped = line.strip()
433
- if stripped.startswith("export ") and not stripped.startswith(
434
- "export function Build"
435
- ):
436
- report.add("scene", f"Build 必须是唯一导出:{stripped[:60]}")
437
- for name in SCENE_REQUIRED_FIELDS:
438
- if not has_field(body, name):
439
- report.add("scene", f"Build 返回对象缺少必需字段:{name}")
440
- if has_field(body, "schemaVersion") and not re.search(
441
- field_pattern("schemaVersion") + r"\s*2\b", body
442
- ):
443
- report.add("scene", "schemaVersion 应为 2")
444
- for name in ("width", "height"):
445
- value = first_number(body, name)
446
- if value is not None and not (GRID_MIN <= value <= GRID_MAX):
447
- report.add(
448
- "scene",
449
- f"{name} 应为 {GRID_MIN}~{GRID_MAX} 格,实际 {value}",
450
- )
451
- for match in ITEM_FLOAT_RE.finditer(body):
452
- report.add(
453
- "scene",
454
- f"物件/区域的 {match.group(1)} 必须是整数,实际 {match.group(2)}",
455
- )
456
- return ASSET_ID_RE.findall(body)
457
-
458
-
459
- def check_asset_library_fields(asset: dict, asset_id: str, report: Report) -> None:
460
- """进资源库的条目必须有 name 和合法 kind;缺了会被编辑器静默丢掉。"""
461
- name = asset.get("name")
462
- if not isinstance(name, str) or not name.strip():
463
- extra = ""
464
- if isinstance(asset.get("label"), str) and asset.get("label"):
465
- extra = "(编辑器读 name 不读 label,把 label 改成 name)"
466
- report.add("registry", f"资产 {asset_id} 缺 name{extra}")
467
- kind = asset.get("kind")
468
- if kind not in ASSET_KINDS:
469
- report.add(
470
- "registry",
471
- f"资产 {asset_id} 缺合法 kind(必须是 {ASSET_KIND_HINT}),"
472
- f"实际 {kind!r};缺 kind 会被编辑器静默丢掉,资源库看不到 #{asset_id}",
473
- )
474
-
475
-
476
- def check_terrain_placement(asset: dict, asset_id: str, report: Report) -> None:
477
- """A paintable brush needs a concrete runtime type, not its resource classification.
478
-
479
- This validates declarations only; runtime dispatch/rendering still needs behavioral tests.
480
- """
481
- if "terrain-paintable" not in asset.get("capabilities", []):
482
- return
483
- placement = asset.get("placement")
484
- placement = placement if isinstance(placement, dict) else {}
485
- kind = placement.get("runtimeKind")
486
- if not isinstance(kind, str) or not kind or kind != kind.strip() or kind in ("terrain", "resource"):
487
- report.add("terrain", f"地形资产 {asset_id} 的 placement.runtimeKind 必须是游戏支持的具体地形类型,不能是 terrain/resource 或空值;实际 {kind!r}")
488
- if "blocksMovement" in placement and not isinstance(placement["blocksMovement"], bool):
489
- report.add("terrain", f"地形资产 {asset_id} 的 placement.blocksMovement 必须为布尔值")
490
- if "properties" in placement and not isinstance(placement["properties"], dict):
491
- report.add("terrain", f"地形资产 {asset_id} 的 placement.properties 必须为对象")
492
-
493
-
494
- def check_asset_source(
495
- root: Path, asset: dict, asset_id: str, report: Report
496
- ) -> None:
497
- """file 验 source.url;其余 kind 验 source.module 可达。"""
498
- source = asset.get("source")
499
- if not isinstance(source, dict):
500
- report.add("registry", f"资产 {asset_id} 缺 source")
501
- return
502
- if asset.get("kind") == "file":
503
- url = source.get("url")
504
- if not isinstance(url, str) or not url.strip():
505
- report.add(
506
- "registry",
507
- f"资产 {asset_id} 的 kind 是 file,source.url 必须是非空图片地址",
508
- )
509
- return
510
- module = source.get("module")
511
- if not isinstance(module, str):
512
- report.add(
513
- "registry",
514
- f"资产 {asset_id} 声明了场景 capability 但缺 source.module",
515
- )
516
- return
517
- if not is_relative_clean_path(module):
518
- report.add(
519
- "path",
520
- f"资产 {asset_id} 的 source.module 路径不合法:{module!r}",
521
- )
522
- elif not (root / module).is_file():
523
- report.add(
524
- "registry",
525
- f"资产 {asset_id} 的 source.module 文件不存在:{module}",
526
- )
527
-
528
-
529
- def check_registry(
530
- root: Path, registry_rel: str | None, scene_asset_ids: list, report: Report
531
- ) -> None:
532
- """检查 localcraft.assets.json 注册表。"""
533
- if not isinstance(registry_rel, str):
534
- return
535
- path = root / registry_rel
536
- if not path.is_file():
537
- report.add("registry", f"资产注册表不存在:{registry_rel}")
538
- return
539
- try:
540
- data = json.loads(path.read_text(encoding="utf-8"))
541
- except json.JSONDecodeError as exc:
542
- report.add("registry", f"资产注册表解析失败:{exc}")
543
- return
544
- if not isinstance(data, dict) or data.get("schemaVersion") != 1:
545
- report.add("registry", "注册表 schemaVersion 应为 1")
546
- assets = data.get("assets") if isinstance(data, dict) else None
547
- if not isinstance(assets, list):
548
- report.add("registry", "注册表缺少 assets 数组")
549
- return
550
- seen_ids: set[str] = set()
551
- registry_ids: set[str] = set()
552
- for asset in assets:
553
- if not isinstance(asset, dict):
554
- report.add("registry", "assets 数组存在非对象条目")
555
- continue
556
- asset_id = asset.get("id")
557
- if not isinstance(asset_id, str) or not asset_id:
558
- report.add("registry", "存在缺 id 的资产条目")
559
- continue
560
- if asset_id in seen_ids:
561
- report.add("registry", f"资产 ID 重复:{asset_id}")
562
- seen_ids.add(asset_id)
563
- registry_ids.add(asset_id)
564
- capabilities = asset.get("capabilities")
565
- has_scene_cap = (
566
- isinstance(capabilities, list)
567
- and any(c in SCENE_CAPABILITIES for c in capabilities)
568
- )
569
- if not has_scene_cap:
570
- continue
571
- check_asset_library_fields(asset, asset_id, report)
572
- check_terrain_placement(asset, asset_id, report)
573
- check_asset_source(root, asset, asset_id, report)
574
- for asset_id in scene_asset_ids:
575
- if asset_id not in registry_ids:
576
- report.add(
577
- "registry",
578
- f"场景引用的 assetId 不在注册表:{asset_id}",
579
- )
580
- else:
581
- entry = next(
582
- (a for a in assets if isinstance(a, dict) and a.get("id") == asset_id),
583
- None,
584
- )
585
- caps = entry.get("capabilities") if isinstance(entry, dict) else None
586
- if not (
587
- isinstance(caps, list)
588
- and any(c in SCENE_CAPABILITIES for c in caps)
589
- ):
590
- report.add(
591
- "registry",
592
- f"场景引用的资产 {asset_id} 未声明 scene-placeable / terrain-paintable capability",
593
- )
594
-
595
-
596
- def resolve_import(root: Path, consumer: Path, spec: str) -> list:
597
- """解析 import 说明符为候选绝对路径(支持相对路径、@/ 别名、TS 无扩展名)。"""
598
- if spec.startswith("@"):
599
- base = root / "src"
600
- spec = spec[len("@"):].lstrip("/")
601
- else:
602
- base = consumer.parent
603
- p = (base / spec).resolve()
604
- return [c for c in (p, p.with_name(p.name + ".ts")) if c.is_file()]
605
-
606
-
607
- def iter_value_import_specs(text: str):
608
- """非 type-only 的静态 import 说明符。"""
609
- for line in text.splitlines():
610
- stripped = line.strip()
611
- if not stripped.startswith("import "):
612
- continue
613
- if re.match(r"^import\s+type\b", stripped):
614
- continue
615
- m = IMPORT_FROM_RE.search(stripped)
616
- if m:
617
- yield m.group(1)
618
- continue
619
- m2 = SIDE_EFFECT_IMPORT_RE.match(stripped)
620
- if m2:
621
- yield m2.group(1)
622
-
623
-
624
- def consumer_imports_file(root: Path, consumer: Path, target: Path) -> bool:
625
- """consumer 是否静态 import 到 target(解析后比绝对路径)。"""
626
- text = strip_comments(consumer.read_text(encoding="utf-8"))
627
- target_abs = target.resolve()
628
- for spec in iter_value_import_specs(text):
629
- if target_abs in resolve_import(root, consumer, spec):
630
- return True
631
- return False
632
-
633
-
634
- def check_consumers(
635
- root: Path, consumers: list, scene_paths: list, report: Report
636
- ) -> None:
637
- """每个 consumer 必须 import 至少一个已声明场景;每个 path 必须被至少一个 consumer import。"""
638
- if not scene_paths:
639
- return
640
- existing: list[tuple[str, Path]] = []
641
- for consumer_rel in consumers:
642
- consumer = root / consumer_rel
643
- if not consumer.is_file():
644
- report.add("consumer", f"runtimeConsumers 文件不存在:{consumer_rel}")
645
- continue
646
- existing.append((consumer_rel, consumer))
647
- imported_any = False
648
- for scene_path in scene_paths:
649
- if consumer_imports_file(root, consumer, (root / scene_path).resolve()):
650
- imported_any = True
651
- break
652
- if not imported_any:
653
- report.add(
654
- "consumer",
655
- f"{consumer_rel} 未以非 type-only 的静态 import 引用任何已声明场景文件",
656
- )
657
- for scene_path in scene_paths:
658
- scene_abs = (root / scene_path).resolve()
659
- covered = any(
660
- consumer_imports_file(root, consumer, scene_abs)
661
- for _, consumer in existing
662
- )
663
- if not covered:
664
- report.add(
665
- "consumer",
666
- f"已声明场景 {scene_path} 未被任何 runtimeConsumers 静态 import",
667
- )
668
-
669
-
670
- FILE_URL_API_MARKERS = ("listSceneFileObjects", "enqueueSceneFileImages")
671
-
672
-
673
- def check_file_registry_import(
674
- root: Path, consumers: list, registry_rel: str | None, report: Report
675
- ) -> None:
676
- """无论有没有 kind=file,都必须 import 资产表并提供 url 读取接口。"""
677
- if not isinstance(registry_rel, str):
678
- return
679
- registry_abs = (root / registry_rel).resolve()
680
- if not registry_abs.is_file():
681
- return
682
- imported = False
683
- has_api = False
684
- for consumer_rel in consumers:
685
- consumer = root / consumer_rel
686
- if not consumer.is_file():
687
- continue
688
- if consumer_imports_file(root, consumer, registry_abs):
689
- imported = True
690
- text = consumer.read_text(encoding="utf-8")
691
- if all(marker in text for marker in FILE_URL_API_MARKERS):
692
- has_api = True
693
- if not imported:
694
- report.add(
695
- "consumer",
696
- f"runtimeConsumers 必须静态 import {registry_rel} 并实现 file url 读取接口"
697
- "(资产表还没有 kind=file 也要先写好;禁止把 url 抄进 boot.config / FILE_ASSETS)",
698
- )
699
- elif not has_api:
700
- report.add(
701
- "consumer",
702
- "runtimeConsumers 必须提供 listSceneFileObjects / enqueueSceneFileImages"
703
- "(资产表还没有 kind=file 也要先写好)",
704
- )
705
-
706
-
707
- def check_blocks_movement_api(root: Path, consumers: list, report: Report) -> None:
708
- """无论有没有 blocksMovement: true,都必须提供 listSceneBlockers 并读该字段。"""
709
- ok = False
710
- for consumer_rel in consumers:
711
- consumer = root / consumer_rel
712
- if not consumer.is_file():
713
- continue
714
- text = consumer.read_text(encoding="utf-8")
715
- if "listSceneBlockers" in text and "blocksMovement" in text:
716
- ok = True
717
- break
718
- if not ok:
719
- report.add(
720
- "consumer",
721
- "runtimeConsumers 必须提供 listSceneBlockers,且只按顶层 blocksMovement === true 建阻挡"
722
- "(场景还没有阻挡开关也要先写好;禁止 kind / 硬编码墙表)",
723
- )
724
-
725
-
726
- def read_skill_version() -> str:
727
- """读本 skill version.json 的 version。缺失或非法则抛错。"""
728
- data = json.loads(SKILL_VERSION_FILE.read_text(encoding="utf-8"))
729
- if not isinstance(data, dict):
730
- raise ValueError("version.json 根不是对象")
731
- version = data.get("version")
732
- if not isinstance(version, str) or not version.strip():
733
- raise ValueError("version.json 缺少非空 version")
734
- return version.strip()
735
-
736
-
737
- def _read_dev_config(root: Path) -> dict | None:
738
- path = root / DEV_CONFIG_REL
739
- if not path.is_file():
740
- return None
741
- try:
742
- data = json.loads(path.read_text(encoding="utf-8"))
743
- except (json.JSONDecodeError, OSError):
744
- return None
745
- return data if isinstance(data, dict) else None
746
-
747
-
748
- def read_compat_field(root: Path) -> bool | None:
749
- """读 SPEC/plan/dev-config.json 的 scene_editor_compat;缺失/不可读一律 None。"""
750
- data = _read_dev_config(root)
751
- if data is None:
752
- return None
753
- return True if data.get(SCENE_EDITOR_COMPAT_FIELD) is True else None
754
-
755
-
756
- def read_compat_ver(root: Path) -> str | None:
757
- """读 scene_editor_ver 字符串;缺失或非法返回 None。"""
758
- data = _read_dev_config(root)
759
- if data is None:
760
- return None
761
- value = data.get(SCENE_EDITOR_VER_FIELD)
762
- if not isinstance(value, str) or not value.strip():
763
- return None
764
- return value.strip()
765
-
766
-
767
- def skill_version_matches(value: str | None) -> bool:
768
- if not value:
769
- return False
770
- try:
771
- return value == read_skill_version()
772
- except (OSError, json.JSONDecodeError, ValueError):
773
- return False
774
-
775
-
776
- def run_check(root: Path) -> Report:
777
- report = Report()
778
- manifest = check_manifest(root, report)
779
- asset_ids: list[str] = []
780
- for entry in report.scene_entries:
781
- asset_ids.extend(
782
- check_scene_file(
783
- root, entry["path"], report, expected_id=entry["id"]
784
- )
785
- )
786
- registry_rel = (
787
- manifest.get("assetRegistry")
788
- if isinstance(manifest, dict)
789
- else None
790
- )
791
- consumers = (
792
- manifest.get("runtimeConsumers")
793
- if isinstance(manifest, dict) and isinstance(manifest.get("runtimeConsumers"), list)
794
- else []
795
- )
796
- check_registry(root, registry_rel, asset_ids, report)
797
- check_consumers(root, consumers, report.scene_paths, report)
798
- check_file_registry_import(root, consumers, registry_rel, report)
799
- check_blocks_movement_api(root, consumers, report)
800
- report.compat_field = read_compat_field(root)
801
- report.compat_ver = read_compat_ver(root)
802
- return report
803
-
804
-
805
- def print_report(report: Report) -> None:
806
- if report.manifest_exists:
807
- print(f"[CHECK] manifest {MANIFEST_NAME}")
808
- for scene_path in report.scene_paths:
809
- print(f"[CHECK] scene {scene_path}")
810
- for f in report.findings:
811
- print(f"[FIND] {f.category}: {f.message}")
812
- print(
813
- f"[SUMMARY] findings={len(report.findings)} "
814
- f"compat={report.compat_field is True} "
815
- f"ver={report.compat_ver or '-'}"
816
- )
817
-
818
-
819
- def main() -> int:
820
- parser = argparse.ArgumentParser(
821
- description="JS2D 场景编辑器契约静态检查(项目级)。"
822
- )
823
- parser.add_argument("--project-root", required=True)
824
- parser.add_argument("--json", action="store_true", help="输出结构化 JSON 报告")
825
- args = parser.parse_args()
826
-
827
- root = Path(args.project_root).resolve()
828
- if not root.is_dir():
829
- print("SCENE_CONTRACT_ENV_ERROR", file=sys.stderr)
830
- print(f"--project-root 不是目录:{root}", file=sys.stderr)
831
- return 2
832
-
833
- report = run_check(root)
834
- if args.json:
835
- print(json.dumps(report.to_dict(), ensure_ascii=False, indent=2))
836
- else:
837
- print_report(report)
838
- if report.findings:
839
- print("SCENE_CONTRACT_PARTIAL")
840
- elif report.marked:
841
- print("SCENE_CONTRACT_OK")
842
- else:
843
- print("SCENE_CONTRACT_UNMARKED")
844
-
845
- if report.findings:
846
- return 1
847
- if report.marked:
848
- return 0
849
- return 3
850
-
851
-
852
- if __name__ == "__main__":
853
- raise SystemExit(main())