@craft_eco/craft-mcp 0.1.22 → 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 (614) hide show
  1. package/README.md +28 -7
  2. package/bin/craft-mcp.mjs +10 -2
  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/integrations/config.mjs +71 -0
  9. package/dist-server/integrations/files.mjs +54 -0
  10. package/dist-server/integrations/hosts.mjs +30 -0
  11. package/dist-server/integrations/install.mjs +86 -0
  12. package/dist-server/integrations/runtime.mjs +71 -0
  13. package/dist-server/mcp/server.mjs +13 -9
  14. package/dist-server/preview/preview-launcher.mjs +9 -2
  15. package/dist-server/preview/preview-start.mjs +2 -2
  16. package/package.json +10 -1
  17. package/resources/craft-create/SKILL.md +14 -0
  18. package/resources/craft-game-maker/SKILL.md +77 -71
  19. package/resources/craft-game-maker/js.md +10 -10
  20. package/resources/craft-game-maker/js3d.md +13 -13
  21. package/resources/game_visual_qa.mjs +1149 -1149
  22. package/resources/js/bundle.json +93 -0
  23. package/resources/js/context/AGENTS.md +15 -102
  24. package/resources/js/context/knowledge/AigcWiring.md +5 -196
  25. package/resources/js/context/knowledge/AssetUrl.md +5 -20
  26. package/resources/js/context/knowledge/Layout.md +7 -0
  27. package/resources/js/context/knowledge/Lifecycle.md +6 -27
  28. package/resources/js/context/skills/aigc-generate/SKILL.md +6 -141
  29. package/resources/js/context/skills/asset-search/SKILL.md +5 -62
  30. package/resources/js/context/skills/asset-search/references/resource-config.md +9 -0
  31. package/resources/js/context/skills/export-config/SKILL.md +7 -19
  32. package/resources/js/context/skills/export-config/scripts/export-config.mjs +3 -45
  33. package/resources/js/context/skills/index.json +30 -0
  34. package/resources/js/context/skills/visual-qa/SKILL.md +6 -28
  35. package/resources/js/project/README.md +4 -96
  36. package/resources/js/project/package.json +1 -2
  37. package/resources/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  38. package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +1 -37
  39. package/resources/js/project/scripts/config-export.mjs +10 -34
  40. package/resources/js3d/bundle.json +104 -0
  41. package/resources/js3d/context/AGENTS.md +16 -85
  42. package/resources/js3d/context/knowledge/AigcWiring.md +9 -0
  43. package/resources/js3d/context/knowledge/AssetUrl.md +9 -0
  44. package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +9 -67
  45. package/resources/js3d/context/knowledge/Layout.md +7 -0
  46. package/resources/js3d/context/knowledge/Runtime.md +5 -30
  47. package/resources/js3d/context/skills/aigc-integration/SKILL.md +6 -164
  48. package/resources/js3d/context/skills/asset-search/SKILL.md +5 -171
  49. package/resources/js3d/context/skills/asset-search/references/resource-config.md +6 -94
  50. package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +6 -82
  51. package/resources/js3d/context/skills/export-config/SKILL.md +7 -11
  52. package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +3 -55
  53. package/resources/js3d/context/skills/index.json +42 -0
  54. package/resources/js3d/context/skills/performance-audit/SKILL.md +8 -153
  55. package/resources/js3d/context/skills/visual-qa/SKILL.md +14 -0
  56. package/resources/js3d/project/README.md +4 -103
  57. package/resources/js3d/project/package.json +1 -2
  58. package/resources/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  59. package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-scene-assets.mjs +3 -28
  60. package/resources/js3d/project/scripts/config-export.mjs +12 -34
  61. package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts +8 -0
  62. package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts.map +1 -0
  63. package/vendor/agent-cli/dist/src/artifacts/build-failure.js +39 -0
  64. package/vendor/agent-cli/dist/src/artifacts/build-failure.js.map +1 -0
  65. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts +5 -0
  66. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts.map +1 -0
  67. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js +45 -0
  68. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js.map +1 -0
  69. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +1 -1
  70. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +71 -6
  71. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +1 -1
  72. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +2 -0
  73. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -1
  74. package/vendor/agent-cli/dist/src/artifacts/prepare.js +7 -2
  75. package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -1
  76. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +2 -0
  77. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -1
  78. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +27 -16
  79. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -1
  80. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts +14 -0
  81. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts.map +1 -0
  82. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js +119 -0
  83. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js.map +1 -0
  84. package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -1
  85. package/vendor/agent-cli/dist/src/artifacts/static.js +20 -6
  86. package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -1
  87. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -1
  88. package/vendor/agent-cli/dist/src/cli/process-protocol.js +24 -2
  89. package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -1
  90. package/vendor/agent-cli/dist/src/cli/process-steering.d.ts +21 -0
  91. package/vendor/agent-cli/dist/src/cli/process-steering.d.ts.map +1 -0
  92. package/vendor/agent-cli/dist/src/cli/process-steering.js +66 -0
  93. package/vendor/agent-cli/dist/src/cli/process-steering.js.map +1 -0
  94. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +1 -1
  95. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -1
  96. package/vendor/agent-cli/dist/src/index.d.ts +4 -1
  97. package/vendor/agent-cli/dist/src/index.d.ts.map +1 -1
  98. package/vendor/agent-cli/dist/src/index.js +3 -0
  99. package/vendor/agent-cli/dist/src/index.js.map +1 -1
  100. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +31 -1
  101. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -1
  102. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +19 -1
  103. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -1
  104. package/vendor/agent-cli/dist/src/session/client.d.ts +10 -0
  105. package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -1
  106. package/vendor/agent-cli/dist/src/session/client.js +16 -5
  107. package/vendor/agent-cli/dist/src/session/client.js.map +1 -1
  108. package/vendor/agent-cli/dist/src/session/link-session.d.ts +3 -0
  109. package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -1
  110. package/vendor/agent-cli/dist/src/session/link-session.js +17 -1
  111. package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -1
  112. package/vendor/agent-cli/dist/src/session/process-observability.d.ts +3 -0
  113. package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +1 -1
  114. package/vendor/agent-cli/dist/src/session/process-observability.js +11 -0
  115. package/vendor/agent-cli/dist/src/session/process-observability.js.map +1 -1
  116. package/vendor/agent-cli/dist/src/session/process-request.d.ts +3 -2
  117. package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -1
  118. package/vendor/agent-cli/dist/src/session/process-request.js +27 -9
  119. package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -1
  120. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +2 -0
  121. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -1
  122. package/vendor/agent-cli/dist/src/session/run-start-body.js +9 -3
  123. package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -1
  124. package/vendor/agent-cli/dist/src/session/run-steer.d.ts +42 -0
  125. package/vendor/agent-cli/dist/src/session/run-steer.d.ts.map +1 -0
  126. package/vendor/agent-cli/dist/src/session/run-steer.js +205 -0
  127. package/vendor/agent-cli/dist/src/session/run-steer.js.map +1 -0
  128. package/vendor/agent-cli/dist/src/shared/types.d.ts +10 -0
  129. package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -1
  130. package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts +21 -0
  131. package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts.map +1 -0
  132. package/vendor/agent-cli/dist/src/tools/context-program-receipt.js +102 -0
  133. package/vendor/agent-cli/dist/src/tools/context-program-receipt.js.map +1 -0
  134. package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -1
  135. package/vendor/agent-cli/dist/src/tools/context-program.js +3 -0
  136. package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -1
  137. package/resources/js/context/.role/AGENTS_DESIGN.md +0 -9
  138. package/resources/js/context/agents/aigc-asset.md +0 -168
  139. package/resources/js/context/knowledge/AigcEnabled.md +0 -49
  140. package/resources/js/context/knowledge/FrontendComponents.md +0 -17
  141. package/resources/js/context/knowledge/MobileAdaptation.md +0 -73
  142. package/resources/js/context/knowledge/MobileAdapted.md +0 -36
  143. package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
  144. package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -115
  145. package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -392
  146. package/resources/js/context/knowledge/PlatformServices.md +0 -190
  147. package/resources/js/context/knowledge/ProjectDisplayConfig.md +0 -35
  148. package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
  149. package/resources/js/context/knowledge/Ui.md +0 -11
  150. package/resources/js/context/knowledge/UiEditorCompat.md +0 -21
  151. package/resources/js/context/rules/MultiplayerCapability.md +0 -23
  152. package/resources/js/context/rules/MultiplayerRoomEntryUX.md +0 -63
  153. package/resources/js/context/rules/PlatformBoundaryModules.md +0 -44
  154. package/resources/js/context/rules/preview_ready.md +0 -8
  155. package/resources/js/context/skills/aigc-generate/knowledge/audio.md +0 -39
  156. package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +0 -26
  157. package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +0 -132
  158. package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +0 -53
  159. package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +0 -52
  160. package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +0 -191
  161. package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +0 -55
  162. package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +0 -62
  163. package/resources/js/context/skills/asset-search/scripts/config.json +0 -5
  164. package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +0 -125
  165. package/resources/js/context/skills/asset-search/scripts/search.mjs +0 -760
  166. package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -657
  167. package/resources/js/context/skills/asset-search/strategies/anim2d.md +0 -42
  168. package/resources/js/context/skills/asset-search/strategies/audio.md +0 -34
  169. package/resources/js/context/skills/asset-search/strategies/effect2d.md +0 -31
  170. package/resources/js/context/skills/asset-search/strategies/texture-prop.md +0 -22
  171. package/resources/js/context/skills/asset-search/strategies/ui-common.md +0 -40
  172. package/resources/js/context/skills/asset-search/strategies/ui-style.md +0 -28
  173. package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
  174. package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +0 -93
  175. package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +0 -7
  176. package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +0 -22
  177. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +0 -5
  178. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +0 -208
  179. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +0 -37
  180. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +0 -227
  181. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +0 -31
  182. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +0 -272
  183. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.d.mts +0 -79
  184. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.mjs +0 -29
  185. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/release.json +0 -22
  186. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/cli.mjs +0 -16
  187. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.d.mts +0 -4
  188. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.mjs +0 -50
  189. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +0 -3
  190. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.mjs +0 -72
  191. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.d.mts +0 -24
  192. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.mjs +0 -2
  193. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.d.mts +0 -10
  194. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.mjs +0 -1
  195. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +0 -37
  196. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +0 -50
  197. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/cli.mjs +0 -20
  198. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.d.mts +0 -19
  199. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.mjs +0 -1
  200. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/installed.json +0 -6
  201. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.d.mts +0 -6
  202. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.mjs +0 -77
  203. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.d.mts +0 -2
  204. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.mjs +0 -34
  205. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +0 -156
  206. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +0 -249
  207. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +0 -87
  208. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +0 -2
  209. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +0 -185
  210. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +0 -294
  211. package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +0 -20
  212. package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +0 -5
  213. package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +0 -159
  214. package/resources/js/context/skills/mobile-adaptation/SKILL.md +0 -277
  215. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -50
  216. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -862
  217. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
  218. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
  219. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
  220. package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -135
  221. package/resources/js/context/skills/mobile-adaptation/references/input-config.md +0 -342
  222. package/resources/js/context/skills/mobile-adaptation/references/verification.md +0 -140
  223. package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +0 -11
  224. package/resources/js/context/skills/mobile-compat-qa/SKILL.md +0 -53
  225. package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
  226. package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
  227. package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
  228. package/resources/js/context/skills/optimization-suggestions/SKILL.md +0 -89
  229. package/resources/js/context/skills/platform-services/SKILL.md +0 -101
  230. package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
  231. package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
  232. package/resources/js/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
  233. package/resources/js/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
  234. package/resources/js/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
  235. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
  236. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
  237. package/resources/js/context/skills/platform-services/assets/modules/log.ts +0 -35
  238. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
  239. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
  240. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
  241. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
  242. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
  243. package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
  244. package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
  245. package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +0 -49
  246. package/resources/js/context/skills/platform-services/assets/modules/save.mjs +0 -1
  247. package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
  248. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
  249. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
  250. package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
  251. package/resources/js/context/skills/platform-services/references/api_reference.md +0 -18
  252. package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
  253. package/resources/js/context/skills/platform-services/scripts/install.mjs +0 -148
  254. package/resources/js/context/skills/resolution-adaptation/SKILL.md +0 -47
  255. package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
  256. package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -249
  257. package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +0 -98
  258. package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -200
  259. package/resources/js/context/skills/resolution-adaptation/references/audit.md +0 -31
  260. package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
  261. package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
  262. package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
  263. package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
  264. package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
  265. package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +0 -55
  266. package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
  267. package/resources/js/context/skills/scene-editor-compat/SKILL.md +0 -94
  268. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +0 -13
  269. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +0 -6
  270. package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +0 -25
  271. package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +0 -18
  272. package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +0 -7
  273. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +0 -42
  274. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +0 -144
  275. package/resources/js/context/skills/scene-editor-compat/docs/contract.md +0 -330
  276. package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +0 -64
  277. package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +0 -28
  278. package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +0 -47
  279. package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +0 -64
  280. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +0 -38
  281. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +0 -9
  282. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +0 -59
  283. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +0 -30
  284. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +0 -66
  285. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +0 -20
  286. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +0 -26
  287. package/resources/js/context/skills/scene-editor-compat/references/contract.md +0 -73
  288. package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +0 -162
  289. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +0 -853
  290. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +0 -173
  291. package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -427
  292. package/resources/js/context/skills/scene-editor-compat/version.json +0 -1
  293. package/resources/js/context/skills/ui-editor-compat/SKILL.md +0 -48
  294. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
  295. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -74
  296. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
  297. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
  298. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
  299. package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
  300. package/resources/js/context/skills/ui-editor-compat/references/contract.md +0 -132
  301. package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
  302. package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
  303. package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
  304. package/resources/js/context/skills/version-update/SKILL.md +0 -192
  305. package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
  306. package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
  307. package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
  308. package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  309. package/resources/js/context/version/version.json +0 -1
  310. package/resources/js/project/SPEC/assist/.gitkeep +0 -0
  311. package/resources/js/project/SPEC/guide/.gitkeep +0 -0
  312. package/resources/js/project/SPEC/plan/.gitkeep +0 -0
  313. package/resources/js/project/SPEC/readme.md +0 -6
  314. package/resources/js/project/SPEC/res/.gitkeep +0 -0
  315. package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
  316. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
  317. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
  318. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
  319. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
  320. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
  321. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
  322. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
  323. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
  324. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -29
  325. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
  326. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
  327. package/resources/js/project/runtime/lightgame/1.0.0/release.json +0 -37
  328. package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
  329. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
  330. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
  331. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
  332. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
  333. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
  334. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
  335. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
  336. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
  337. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
  338. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
  339. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
  340. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
  341. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
  342. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
  343. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
  344. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
  345. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
  346. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
  347. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
  348. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
  349. package/resources/js/project/scripts/refresh-runtime.mjs +0 -50
  350. package/resources/js/project/vendor/core-manager-js/package.json +0 -33
  351. package/resources/js/project/vendor/core-manager-js/src/.versions.json +0 -42
  352. package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +0 -41
  353. package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +0 -93
  354. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +0 -203
  355. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +0 -106
  356. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +0 -25
  357. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +0 -21
  358. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +0 -65
  359. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +0 -340
  360. package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +0 -87
  361. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +0 -92
  362. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +0 -271
  363. package/resources/js/project/vendor/core-manager-js/src/index.ts +0 -31
  364. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +0 -81
  365. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +0 -43
  366. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +0 -32
  367. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +0 -141
  368. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +0 -20
  369. package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +0 -183
  370. package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +0 -304
  371. package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +0 -351
  372. package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +0 -180
  373. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +0 -13
  374. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +0 -14
  375. package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +0 -68
  376. package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +0 -433
  377. package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +0 -118
  378. package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +0 -444
  379. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +0 -485
  380. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +0 -66
  381. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +0 -149
  382. package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +0 -9
  383. package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +0 -29
  384. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +0 -88
  385. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +0 -122
  386. package/resources/js/project/vendor/core-manager-js/src/runtime.ts +0 -24
  387. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +0 -318
  388. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +0 -151
  389. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +0 -235
  390. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +0 -98
  391. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +0 -94
  392. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +0 -209
  393. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +0 -106
  394. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +0 -341
  395. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +0 -68
  396. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +0 -236
  397. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +0 -22
  398. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +0 -29
  399. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +0 -197
  400. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +0 -9
  401. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +0 -555
  402. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +0 -112
  403. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +0 -178
  404. package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +0 -246
  405. package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +0 -139
  406. package/resources/js/project/vendor/core-manager-js/tsconfig.json +0 -15
  407. package/resources/js/project/vendor/run.sh +0 -4
  408. package/resources/js/project/version/craft_feature_version.json +0 -42
  409. package/resources/js/project/version/project_feature_version.json +0 -11
  410. package/resources/js3d/context/.role/AGENTS_DESIGN.md +0 -9
  411. package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +0 -75
  412. package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +0 -42
  413. package/resources/js3d/context/knowledge/FrontendComponents.md +0 -19
  414. package/resources/js3d/context/knowledge/MobileAdaptation.md +0 -73
  415. package/resources/js3d/context/knowledge/MobileAdapted.md +0 -36
  416. package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
  417. package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -117
  418. package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -430
  419. package/resources/js3d/context/knowledge/PlatformServices.md +0 -190
  420. package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +0 -35
  421. package/resources/js3d/context/knowledge/SceneEditorCompat.md +0 -35
  422. package/resources/js3d/context/knowledge/StepByStep.md +0 -21
  423. package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
  424. package/resources/js3d/context/knowledge/UiEditorCompat.md +0 -21
  425. package/resources/js3d/context/rules/MultiplayerCapability.md +0 -27
  426. package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +0 -63
  427. package/resources/js3d/context/rules/PlatformBoundaryModules.md +0 -44
  428. package/resources/js3d/context/rules/preview_ready.md +0 -8
  429. package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +0 -70
  430. package/resources/js3d/context/skills/aigc-integration/callback.md +0 -77
  431. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +0 -23
  432. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +0 -38
  433. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +0 -72
  434. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +0 -33
  435. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +0 -36
  436. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +0 -37
  437. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +0 -35
  438. package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +0 -58
  439. package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +0 -62
  440. package/resources/js3d/context/skills/asset-search/scripts/config.json +0 -235
  441. package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +0 -905
  442. package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +0 -79
  443. package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +0 -74
  444. package/resources/js3d/context/skills/asset-search/scripts/search.mjs +0 -637
  445. package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -667
  446. package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +0 -42
  447. package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +0 -31
  448. package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +0 -89
  449. package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +0 -143
  450. package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +0 -90
  451. package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
  452. package/resources/js3d/context/skills/game-art-style/SKILL.md +0 -60
  453. package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
  454. package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
  455. package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
  456. package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
  457. package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
  458. package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
  459. package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
  460. package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
  461. package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +0 -38
  462. package/resources/js3d/context/skills/game-art-style/references/construction.md +0 -111
  463. package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +0 -105
  464. package/resources/js3d/context/skills/game-art-style/references/sources.md +0 -25
  465. package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +0 -175
  466. package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +0 -168
  467. package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +0 -191
  468. package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +0 -165
  469. package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +0 -173
  470. package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +0 -185
  471. package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +0 -181
  472. package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +0 -189
  473. package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +0 -88
  474. package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +0 -301
  475. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -104
  476. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -933
  477. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
  478. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
  479. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
  480. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -257
  481. package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +0 -342
  482. package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +0 -140
  483. package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +0 -11
  484. package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +0 -53
  485. package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
  486. package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +0 -10
  487. package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
  488. package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
  489. package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +0 -74
  490. package/resources/js3d/context/skills/performance-audit/references/case-notes.md +0 -93
  491. package/resources/js3d/context/skills/performance-audit/references/rules.md +0 -183
  492. package/resources/js3d/context/skills/platform-services/SKILL.md +0 -101
  493. package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
  494. package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
  495. package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
  496. package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
  497. package/resources/js3d/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
  498. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
  499. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
  500. package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +0 -35
  501. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
  502. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
  503. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
  504. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
  505. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
  506. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
  507. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
  508. package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +0 -49
  509. package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +0 -1
  510. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
  511. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
  512. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
  513. package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
  514. package/resources/js3d/context/skills/platform-services/references/api_reference.md +0 -18
  515. package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
  516. package/resources/js3d/context/skills/platform-services/scripts/install.mjs +0 -148
  517. package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +0 -46
  518. package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
  519. package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -239
  520. package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +0 -129
  521. package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -188
  522. package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +0 -31
  523. package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
  524. package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
  525. package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
  526. package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
  527. package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
  528. package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
  529. package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +0 -599
  530. package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +0 -141
  531. package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +0 -92
  532. package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +0 -125
  533. package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +0 -113
  534. package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -1187
  535. package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +0 -53
  536. package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +0 -4
  537. package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +0 -94
  538. package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +0 -50
  539. package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +0 -105
  540. package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +0 -147
  541. package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +0 -79
  542. package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +0 -56
  543. package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +0 -51
  544. package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +0 -55
  545. package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +0 -78
  546. package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +0 -84
  547. package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +0 -120
  548. package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +0 -4
  549. package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +0 -238
  550. package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +0 -59
  551. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
  552. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -61
  553. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
  554. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
  555. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
  556. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
  557. package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +0 -110
  558. package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
  559. package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
  560. package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
  561. package/resources/js3d/context/skills/version-update/SKILL.md +0 -191
  562. package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
  563. package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
  564. package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
  565. package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  566. package/resources/js3d/context/version/version.json +0 -1
  567. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
  568. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
  569. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
  570. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
  571. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
  572. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
  573. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
  574. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
  575. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -30
  576. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
  577. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
  578. package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +0 -39
  579. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
  580. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
  581. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
  582. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
  583. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -7
  584. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
  585. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
  586. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
  587. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
  588. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
  589. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
  590. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
  591. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
  592. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +0 -26
  593. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +0 -351
  594. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
  595. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
  596. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
  597. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
  598. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
  599. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
  600. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
  601. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
  602. package/resources/js3d/project/scripts/refresh-runtime.mjs +0 -50
  603. package/resources/js3d/project/vendor/core-manager-three/package.json +0 -12
  604. package/resources/js3d/project/vendor/core-manager-three/src/index.ts +0 -2
  605. package/resources/js3d/project/vendor/run.sh +0 -4
  606. package/resources/js3d/project/version/craft_feature_version.json +0 -42
  607. package/resources/js3d/project/version/project_feature_version.json +0 -11
  608. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +0 -7
  609. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +0 -1
  610. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +0 -145
  611. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +0 -1
  612. /package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
  613. /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
  614. /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +0 -0
@@ -1,448 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * 异比例适配审计:在多档 viewport 下加载构建产物,度量留边、stage 缩放与 UI 溢出。
4
- *
5
- * 传入 --config 时先采集首选显示尺寸,再采集通用比例;断言以运行时实测尺寸为准。
6
- *
7
- * 用法:
8
- * node aspect_audit.mjs --game <dist目录> --out <输出目录>
9
- * [--config <game.config.json路径>]
10
- * [--package-root <含 playwright 的目录>] [--browser-channel chrome|msedge]
11
- * [--settle-ms 1200] [--steps <JSON步骤文件>] [--click-center]
12
- *
13
- * 退出码:
14
- * 0 冷启动与同会话切换的几何断言通过(仍需人工判读玩法与取景)
15
- * 1 有档位渲染失败(canvas 缺失或尺寸为 0)或断言不过
16
- * 2 环境异常(playwright 不可用 / 产物入口缺失)
17
- */
18
- import fs from 'node:fs';
19
- import http from 'node:http';
20
- import path from 'node:path';
21
- import { pathToFileURL } from 'node:url';
22
-
23
- const MIME = {
24
- '.html': 'text/html; charset=utf-8',
25
- '.js': 'text/javascript; charset=utf-8',
26
- '.mjs': 'text/javascript; charset=utf-8',
27
- '.css': 'text/css; charset=utf-8',
28
- '.json': 'application/json; charset=utf-8',
29
- '.png': 'image/png',
30
- '.jpg': 'image/jpeg',
31
- '.jpeg': 'image/jpeg',
32
- '.webp': 'image/webp',
33
- '.svg': 'image/svg+xml',
34
- '.ico': 'image/x-icon',
35
- '.woff': 'font/woff',
36
- '.woff2': 'font/woff2',
37
- '.ttf': 'font/ttf',
38
- '.mp3': 'audio/mpeg',
39
- '.ogg': 'audio/ogg',
40
- '.wav': 'audio/wav',
41
- '.mp4': 'video/mp4',
42
- '.glb': 'model/gltf-binary',
43
- '.gltf': 'model/gltf+json',
44
- '.hdr': 'application/octet-stream',
45
- '.wasm': 'application/wasm',
46
- };
47
-
48
- /** 短边基准。项目若显式覆盖 ViewportOptions.shortEdge,这里同步改 */
49
- const SHORT_EDGE = 1080;
50
-
51
- /**
52
- * 档位表。长边固定 1024,短边按比例推算 —— 与验收截图的尺寸量级一致,
53
- * 既能暴露比例问题又不浪费带宽。
54
- *
55
- * 适配是**方向无关**的(短边锁定 + 长边扩展),所以横竖两侧都要测:
56
- * 横竖方向都需要测试;支持范围内铺满,超范围允许模型留边。
57
- * `expectClamp` 标记的档位超出 4:3 ~ 20:9 支持区间,留边是设计行为而非缺陷。
58
- */
59
- const VIEWPORTS = [
60
- { name: '1-1', width: 768, height: 768, note: '极方屏,比 4:3 更方', expectClamp: true },
61
- { name: '4-3', width: 1024, height: 768, note: 'iPad 横屏,支持区间最方端' },
62
- { name: '16-9', width: 1024, height: 576, note: '常见横屏基准' },
63
- { name: '19.5-9', width: 1024, height: 473, note: 'iPhone 横屏' },
64
- { name: '21-9', width: 1024, height: 439, note: '超宽,超出 20:9', expectClamp: true },
65
- { name: '3-4', width: 768, height: 1024, note: 'iPad 竖屏' },
66
- { name: '9-16', width: 576, height: 1024, note: '常见竖屏基准' },
67
- { name: '9-19.5', width: 473, height: 1024, note: 'iPhone 竖屏' },
68
- { name: '9-21', width: 439, height: 1024, note: '超长,超出 20:9', expectClamp: true },
69
- { name: 'small-landscape', width: 800, height: 360, note: '小横屏,检查实际 CSS 尺度' },
70
- { name: 'small-portrait', width: 360, height: 800, note: '小竖屏,检查实际 CSS 尺度' },
71
- ];
72
-
73
- /** 首选显示尺寸与通用档位。配置只决定采集视口,不改变运行时适配断言。 */
74
- export function computeCases(config) {
75
- if (config === undefined) return VIEWPORTS;
76
- const { width, height } = config?.designResolution ?? {};
77
- if (![width, height].every((value) => Number.isInteger(value) && value > 0)) {
78
- throw new Error('designResolution.width/height 必须是正整数');
79
- }
80
- const orientation = width >= height ? 'landscape' : 'portrait';
81
- if (config.orientation !== orientation) {
82
- throw new Error('orientation 必须与首选展示宽高一致');
83
- }
84
- const ratio = Math.max(width, height) / Math.min(width, height);
85
- return [
86
- {
87
- name: 'preferred', width, height, note: '首选显示偏好',
88
- expectClamp: ratio < 4 / 3 || ratio > 20 / 9,
89
- },
90
- ...VIEWPORTS,
91
- ];
92
- }
93
-
94
- function parseArgs(argv) {
95
- const out = { settleMs: 1200, clickCenter: false };
96
- for (let i = 2; i < argv.length; i += 1) {
97
- const key = argv[i];
98
- const next = () => argv[(i += 1)];
99
- if (key === '--game') out.game = next();
100
- else if (key === '--out') out.out = next();
101
- else if (key === '--config') {
102
- out.config = next();
103
- if (!out.config) throw new Error('--config 需要 game.config.json 路径');
104
- } else if (key === '--steps') {
105
- out.steps = next();
106
- if (!out.steps) throw new Error('--steps 需要 JSON 步骤文件');
107
- } else if (key === '--browser-channel') {
108
- out.browserChannel = next();
109
- if (!['chrome', 'msedge'].includes(out.browserChannel)) throw new Error('--browser-channel 仅支持 chrome / msedge');
110
- } else if (key === '--package-root') out.packageRoot = next();
111
- else if (key === '--settle-ms') out.settleMs = Number(next()) || 1200;
112
- else if (key === '--click-center') out.clickCenter = true;
113
- }
114
- return out;
115
- }
116
-
117
- function startServer(root) {
118
- return new Promise((resolve, reject) => {
119
- const server = http.createServer((req, res) => {
120
- const raw = decodeURIComponent((req.url || '/').split('?')[0]);
121
- const rel = raw === '/' ? 'index.html' : raw.replace(/^\/+/, '');
122
- // 阻断路径穿越:normalize 后必须仍在 root 内
123
- const abs = path.resolve(root, rel);
124
- if (!abs.startsWith(path.resolve(root))) {
125
- res.writeHead(403).end('forbidden');
126
- return;
127
- }
128
- fs.readFile(abs, (err, buf) => {
129
- if (err) {
130
- res.writeHead(404).end('not found');
131
- return;
132
- }
133
- res.writeHead(200, {
134
- 'content-type': MIME[path.extname(abs).toLowerCase()] || 'application/octet-stream',
135
- });
136
- res.end(buf);
137
- });
138
- });
139
- server.on('error', reject);
140
- server.listen(0, '127.0.0.1', () => resolve({ server, port: server.address().port }));
141
- });
142
- }
143
-
144
- async function loadPlaywright(packageRoot) {
145
- const candidates = [];
146
- if (packageRoot) candidates.push(path.join(packageRoot, 'playwright', 'index.js'));
147
- candidates.push('playwright');
148
- for (const candidate of candidates) {
149
- try {
150
- const spec = candidate.endsWith('.js') ? pathToFileURL(candidate).href : candidate;
151
- const mod = await import(spec);
152
- if (mod?.chromium) return mod;
153
- if (mod?.default?.chromium) return mod.default;
154
- } catch {
155
- /* 试下一个候选 */
156
- }
157
- }
158
- return null;
159
- }
160
-
161
- /**
162
- * 页面内度量。全部基于 getBoundingClientRect,拿到的是**变换后的实际显示矩形**,
163
- * 不需要知道内部用了 transform 还是改尺寸。
164
- */
165
- export const MEASURE = (shortEdge) => {
166
- const round = (n) => Math.round(n * 100) / 100;
167
- const vw = window.innerWidth;
168
- const vh = window.innerHeight;
169
- const canvas = document.querySelector('#game canvas') || document.querySelector('canvas');
170
- const stage = document.getElementById('ui-stage');
171
- const rectOf = (el) => {
172
- if (!el) return null;
173
- const r = el.getBoundingClientRect();
174
- return { x: round(r.x), y: round(r.y), width: round(r.width), height: round(r.height) };
175
- };
176
-
177
- const canvasRect = rectOf(canvas);
178
- const stageRect = rectOf(stage);
179
-
180
- // canvas 留边:容器铺满时四边都为 0
181
- const canvasLetterbox = canvasRect
182
- ? {
183
- x: round(Math.abs(canvasRect.x)),
184
- y: round(Math.abs(canvasRect.y)),
185
- right: round(Math.abs(vw - (canvasRect.x + canvasRect.width))),
186
- bottom: round(Math.abs(vh - (canvasRect.y + canvasRect.height))),
187
- }
188
- : null;
189
-
190
- // stage 内缩 + 从内联样式反推的缩放系数与逻辑尺寸
191
- let stageInset = null;
192
- let stageScale = null;
193
- let stageLogical = null;
194
- if (stageRect && stage) {
195
- stageInset = { x: round(vw - stageRect.width), y: round(vh - stageRect.height) };
196
- const transform = stage.style.transform || '';
197
- const matched = /scale\(([-\d.]+)\)/.exec(transform);
198
- if (matched) stageScale = Number(matched[1]);
199
- const w = parseFloat(stage.style.width || '0');
200
- const h = parseFloat(stage.style.height || '0');
201
- if (w > 0 && h > 0) stageLogical = { width: round(w), height: round(h) };
202
- }
203
-
204
- // UI 溢出:stage 内元素超出 stage 可见矩形(判定基准取实际显示矩形,含 scale)
205
- let uiOverflow = 0;
206
- const overflowSamples = [];
207
- if (stageRect && stage) {
208
- const tolerance = 1.5;
209
- const nodes = stage.querySelectorAll('*');
210
- for (let i = 0; i < nodes.length; i += 1) {
211
- const el = nodes[i];
212
- const box = el.getBoundingClientRect();
213
- let r = { left: box.left, top: box.top, right: box.right, bottom: box.bottom };
214
- // 隐藏层不参与;滚动/裁剪容器外的内容不是可见 UI 越界。
215
- let visible = true;
216
- for (let parent = el; parent; parent = parent.parentElement) {
217
- const css = getComputedStyle(parent);
218
- if (css.display === 'none' || css.visibility !== 'visible' || Number(css.opacity) === 0) {
219
- visible = false;
220
- break;
221
- }
222
- if (parent !== el && parent !== stage && stage.contains(parent)) {
223
- const clip = parent.getBoundingClientRect();
224
- if (['auto', 'scroll', 'hidden', 'clip'].includes(css.overflowX)) {
225
- r.left = Math.max(r.left, clip.left);
226
- r.right = Math.min(r.right, clip.right);
227
- }
228
- if (['auto', 'scroll', 'hidden', 'clip'].includes(css.overflowY)) {
229
- r.top = Math.max(r.top, clip.top);
230
- r.bottom = Math.min(r.bottom, clip.bottom);
231
- }
232
- }
233
- }
234
- if (!visible) continue;
235
- r.width = r.right - r.left;
236
- r.height = r.bottom - r.top;
237
- if (r.width <= 0 || r.height <= 0) continue;
238
- const over =
239
- r.left < stageRect.x - tolerance ||
240
- r.top < stageRect.y - tolerance ||
241
- r.right > stageRect.x + stageRect.width + tolerance ||
242
- r.bottom > stageRect.y + stageRect.height + tolerance;
243
- if (over) {
244
- uiOverflow += 1;
245
- if (overflowSamples.length < 5) {
246
- const cls = typeof el.className === 'string' ? el.className : '';
247
- overflowSamples.push(`${el.tagName.toLowerCase()}${cls ? '.' + cls.split(/\s+/)[0] : ''}`);
248
- }
249
- }
250
- }
251
- }
252
-
253
- return {
254
- viewport: { width: vw, height: vh },
255
- canvas: canvasRect,
256
- canvasLetterbox,
257
- stage: stageRect,
258
- stageInset,
259
- stageScale,
260
- stageLogical,
261
- orientation: stage?.dataset?.orientation ?? null,
262
- uiOverflow,
263
- overflowSamples,
264
- // 断言保留精度;四舍五入到两位会把合法的 1/3、2/3 缩放误判为失败。
265
- expectedScale: Math.min(vw, vh) / shortEdge,
266
- expectedOrientation: vw >= vh ? 'landscape' : 'portrait',
267
- uiRootPresent: !!document.getElementById('ui-root'),
268
- };
269
- };
270
-
271
- /** 步骤只通过正常点击/按键/可见条件进入玩法,不读取游戏私有状态。 */
272
- export function validateSteps(value = {}) {
273
- if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('步骤须为 JSON 对象');
274
- if (Object.keys(value).some(key => !['enter', 'panels'].includes(key))) throw new Error('步骤文件仅允许 enter / panels');
275
- const check = (steps) => {
276
- if (!Array.isArray(steps)) throw new Error('步骤须为数组');
277
- for (const step of steps) {
278
- const keys = step && typeof step === 'object' ? Object.keys(step) : [];
279
- if (keys.length !== 1 || !['click', 'press', 'waitFor'].includes(keys[0]) ||
280
- typeof step[keys[0]] !== 'string' || !step[keys[0]].trim()) {
281
- throw new Error('每步仅允许一个非空 click / press / waitFor 字符串');
282
- }
283
- }
284
- return steps;
285
- };
286
- const enter = check(value.enter ?? []);
287
- if (!Array.isArray(value.panels ?? [])) throw new Error('panels 须为数组');
288
- const names = new Set();
289
- const panels = (value.panels ?? []).map((panel) => {
290
- if (!panel || Object.keys(panel).some(key => !['name', 'open', 'close'].includes(key)) ||
291
- typeof panel.name !== 'string' || !/^[a-zA-Z0-9_-]+$/.test(panel.name) ||
292
- panel.name === 'gameplay' || names.has(panel.name)) {
293
- throw new Error('面板 name 须为唯一的字母、数字、下划线或短横线');
294
- }
295
- names.add(panel.name);
296
- const open = check(panel.open), close = check(panel.close);
297
- if (!open.length || !close.length) throw new Error('面板须同时提供非空 open / close 步骤');
298
- return { name: panel.name, open, close };
299
- });
300
- return { enter, panels };
301
- }
302
-
303
- async function runSteps(page, steps) {
304
- for (const step of steps) {
305
- if (step.click) await page.locator(step.click).click({ timeout: 10000 });
306
- else if (step.press) await page.keyboard.press(step.press);
307
- else await page.locator(step.waitFor).waitFor({ state: 'visible', timeout: 10000 });
308
- }
309
- }
310
-
311
- export function geometryOk(vp, measured) {
312
- const canvas = measured?.canvas;
313
- // 经营管理界面可以是纯 DOM;仍须存在有效 stage 并遵守相同缩放模型。
314
- const surface = canvas ?? measured?.stage;
315
- if (!surface || surface.width <= 0 || surface.height <= 0) return false;
316
- const orientationOk = measured.orientation === measured.expectedOrientation;
317
- const overflowOk = measured.uiOverflow === 0;
318
- if (vp.expectClamp) return orientationOk && overflowOk && !!measured.stageLogical;
319
- const lb = measured.canvasLetterbox;
320
- const filled = canvas ? !!lb && lb.x + lb.y + lb.right + lb.bottom < 2
321
- : Math.abs(measured.stageInset?.x ?? Infinity) + Math.abs(measured.stageInset?.y ?? Infinity) < 2;
322
- return filled && measured.stageScale != null &&
323
- Math.abs(measured.stageScale - measured.expectedScale) < 0.002 && orientationOk && overflowOk;
324
- }
325
-
326
- /** 冷启动覆盖 + 同一个页面切换并返回基线;面板关闭失败后不继续污染后续状态。 */
327
- export async function collectAudit(browser, { url, cases, outDir, settleMs = 1200,
328
- steps = {}, clickCenter = false }) {
329
- const workflow = validateSteps(steps);
330
- const results = [];
331
- const baseline = cases.find(v => v.name === 'preferred') ?? cases.find(v => v.name === '16-9') ?? cases[0];
332
- if (!baseline) throw new Error('至少需要一个视口');
333
- async function session(phase, initial, sequence) {
334
- const context = await browser.newContext({ viewport: { width: initial.width, height: initial.height } });
335
- const page = await context.newPage();
336
- const errors = [];
337
- page.on('pageerror', e => errors.push(String(e.message).slice(0, 200)));
338
- let current = initial;
339
- let state = 'enter';
340
- async function capture(vp, name = 'gameplay') {
341
- const measured = await page.evaluate(MEASURE, SHORT_EDGE);
342
- const shot = path.join(outDir, `aspect-${phase}-${vp.name}-${name}.png`);
343
- await page.screenshot({ path: shot });
344
- results.push({ ...vp, phase, state: name, ok: geometryOk(vp, measured) && errors.length === 0,
345
- errors: [...errors], ...measured, shot });
346
- }
347
- try {
348
- await page.goto(url, { waitUntil: 'load', timeout: 30000 });
349
- await page.waitForTimeout(settleMs);
350
- await runSteps(page, workflow.enter);
351
- if (clickCenter) await page.mouse.click(Math.floor(initial.width / 2), Math.floor(initial.height / 2));
352
- await page.waitForTimeout(settleMs);
353
- for (const vp of sequence) {
354
- current = vp;
355
- state = 'resize';
356
- if (phase === 'live') await page.setViewportSize({ width: vp.width, height: vp.height });
357
- await page.waitForTimeout(settleMs);
358
- // setViewportSize 返回不代表 resize / ResizeObserver 已提交,至少跨过两帧再量度。
359
- await page.evaluate(() => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))));
360
- state = 'gameplay';
361
- await capture(vp);
362
- for (const panel of workflow.panels) {
363
- state = panel.name;
364
- await runSteps(page, panel.open);
365
- await page.waitForTimeout(settleMs);
366
- await capture(vp, panel.name);
367
- await runSteps(page, panel.close);
368
- }
369
- }
370
- } catch (err) {
371
- results.push({ ...current, phase, state, ok: false, errors: [...errors, String(err.message).slice(0, 200)] });
372
- } finally {
373
- await context.close();
374
- }
375
- }
376
- for (const vp of cases) await session('cold', vp, [vp]);
377
- await session('live', baseline, [baseline, ...cases.filter(v => v !== baseline),
378
- { ...baseline, name: `${baseline.name}-return` }]);
379
- return { results, entryConfigured: workflow.enter.length > 0, panels: workflow.panels.map(p => p.name) };
380
- }
381
-
382
- async function main() {
383
- const args = parseArgs(process.argv);
384
- if (!args.game || !args.out) {
385
- console.error('[aspect-audit] 需要 --game <dist目录> 与 --out <输出目录>');
386
- return 2;
387
- }
388
- const dist = path.resolve(args.game);
389
- if (!fs.existsSync(path.join(dist, 'index.html'))) {
390
- console.error(`[aspect-audit] 产物入口缺失:${path.join(dist, 'index.html')}`);
391
- return 2;
392
- }
393
- const cases = computeCases(
394
- args.config ? JSON.parse(fs.readFileSync(path.resolve(args.config), 'utf8')) : undefined,
395
- );
396
-
397
- const playwright = await loadPlaywright(args.packageRoot);
398
- if (!playwright) {
399
- console.error('[aspect-audit] playwright 不可用;用 --package-root 指向安装了它的目录');
400
- return 2;
401
- }
402
-
403
- const outDir = path.resolve(args.out);
404
- fs.mkdirSync(outDir, { recursive: true });
405
-
406
- // 参数有误时在启动浏览器和服务前失败。
407
- const steps = validateSteps(args.steps ? JSON.parse(fs.readFileSync(path.resolve(args.steps), 'utf8')) : {});
408
- const { server, port } = await startServer(dist);
409
- const url = `http://127.0.0.1:${port}/index.html`;
410
- let browser;
411
- let audit;
412
- try {
413
- browser = await playwright.chromium.launch({ channel: args.browserChannel });
414
- audit = await collectAudit(browser, { url, cases, outDir, settleMs: args.settleMs,
415
- steps, clickCenter: args.clickCenter });
416
- } finally {
417
- await browser?.close();
418
- await new Promise(resolve => server.close(resolve));
419
- }
420
- const failed = audit.results.filter(r => !r.ok).length;
421
- const report = { model: 'short-edge-lock', shortEdge: SHORT_EDGE, url,
422
- entryConfigured: audit.entryConfigured, panels: audit.panels,
423
- visualReviewRequired: true, geometryPassed: failed === 0, cases: audit.results };
424
- const reportPath = path.join(outDir, 'aspect-report.json');
425
- fs.writeFileSync(reportPath, JSON.stringify(report, null, 2), 'utf-8');
426
- for (const r of audit.results) {
427
- console.log(`[${r.ok ? 'GEOMETRY' : 'FAIL'}] ${r.phase}/${r.name}/${r.state} ` +
428
- `${r.width}x${r.height} | UI overflow ${r.uiOverflow ?? 'n/a'}` +
429
- (r.errors.length ? ` | ${r.errors.join('; ')}` : ''));
430
- if (r.shot) console.log(`[SHOT] ${r.shot}`);
431
- }
432
- console.log(`[REPORT] ${reportPath}`);
433
- console.log('[aspect-audit] 冷启动与运行时切换采集完成;几何通过不代表取景、阅读、命中或真机通过。');
434
- if (!audit.entryConfigured) console.log('[aspect-audit] 未配置 --steps enter,可能只采集到标题;须进入实际玩法补验。');
435
-
436
- return failed > 0 ? 1 : 0;
437
- }
438
-
439
- // 被当作模块 import 时不执行主流程(argv[1] 可能不存在,先做守卫再比较)
440
- const invokedPath = process.argv[1] ? pathToFileURL(process.argv[1]).href : '';
441
- if (import.meta.url === invokedPath) {
442
- main()
443
- .then((code) => process.exit(code))
444
- .catch((err) => {
445
- console.error(`[aspect-audit] 未预期异常:${err?.stack || err}`);
446
- process.exit(2);
447
- });
448
- }
@@ -1,94 +0,0 @@
1
- ---
2
- name: scene-editor-compat
3
- description: 为 JS2D 游戏接入或修复 JS2DSceneEditor 场景契约,并在已适配项目后续资源修改、场景状态或碰撞行为修改时维护游戏、资源面板与场景资产的关联。支持单 / 多场景及真实运行时消费检查;不用于 JS3D、UI 编辑器或未适配项目的普通开发。
4
- ---
5
-
6
- # JS2D 场景接入与修复
7
-
8
- 目标是让现有游戏场景可被编辑且修改能在游戏中生效,不是创建一个能打开的占位地图。本 Skill 由宿主 Agent 执行;独立编辑器保存声明的场景文件,并可随新增资源提交资产表,不负责业务代码迁移或资源面板导出。
9
-
10
- 玩法用 Phaser 3.90 消费场景数据:加载界面 `enqueueSceneFileImages(this.load, …)`,开战 `this.add.image(x, y, key)`,Arcade 按 `listSceneBlockers` 建静态碰撞。检查与标记用本包 Python 脚本;编辑器读声明和场景文件。
11
-
12
- ## 输入与边界
13
-
14
- - 从宿主取得项目类型、目标项目/工作区、当前版本、检测问题和用户授权状态。不要凭标题或图片猜引擎。
15
- - 检查可以只读执行。只有用户已确认适配,或明确要求生成/修改符合契约的游戏时,才改项目文件;仅点击入口不是修改授权。已有确认无需反复询问。
16
- - JS3D、其他或未知类型停止 JS2D 适配。读取/权限失败不当作文件不存在;项目正在修改、打包或基准版本已变化时交回宿主处理,不覆盖并发成果。
17
- - 不修改 Web、平台配置、鉴权或发布状态;不自动提交 Git、部署或发布到大厅。
18
- - `SPEC/plan/dev-config.json` 的 `scene_editor_compat` 只由本 skill 的标记脚本写入(见「标记」)。功能版本写入 `version/project_feature_version.json`,数值来自 `version/craft_feature_version.json` 的 `sceneeditor`,由开发者手动维护。Agent 禁止手改这两处。
19
-
20
- ## 必须读取的参考
21
-
22
- 适配前读取 [contract.md](docs/contract.md)。新建 TS 数据或类型时参考 [platformer-ts](examples/platformer-ts/) 完整示例,但禁止把示例关卡覆盖当前游戏。契约检查与标记脚本在 [scripts/](scripts/)(`check_scene_contract.py` / `apply_scene_marker.py`),按「执行」使用,不必读其源码。
23
-
24
- ## 已适配项目的资源维护
25
-
26
- 首次适配及后续资源/尺寸修改还须读取 `${CRAFT_SKILL_DIR}/docs/visual-contract.md`:沿现有 source.schema / preview 关联背景与主角静态预览,按游戏真实尺寸、锚点及拉伸/平铺生成 visual,并同步运行时。该扩展须配套 JS2DSceneEditor 0.3.0,不将出生点预览转成额外角色。
27
-
28
- 首次适配有文件图片的项目,以及 `scene_editor_compat: true` 后的新增 / 替换 / 删除资源、历史图片不显示或换图不更新修复,均读取 `${CRAFT_SKILL_DIR}/docs/resource-sync.md`,特别是「地址归一化与历史资源修复」。用户已授权的换图或新增请求包含维护对应引用,不要求重新确认整项目适配,也不重建布局。只读咨询仍只检查。
29
-
30
- 此分支处理游戏资源面板交给 Agent 的换图、自然对话 / AIGC / 素材库替换,以及编辑器保存后交给 Agent 的新增资源。保留稳定 ID 和业务行为,同步注册表、槽位、实际消费者及面板导出;不能只因原契约检查通过就跳过本轮资源同步。没有经过本轮 Agent 的编辑器保存,不声称本 Skill 已被自动执行。
31
-
32
- ## 地形维护
33
-
34
- 含可绘制地形的首次适配、后续新增/修改地形或地形不生效修复,须先读 [terrain-contract.md](docs/terrain-contract.md)。区分地形类别与具体类型,完整消费新增 regions,并验证显示、阻挡和项目地表状态;不能只验证原有物件移动。
35
-
36
- ## 运行时状态维护
37
-
38
- 首次适配或修改场景实例的运行时状态、碰撞、交互生命周期时,读取 [runtime-state.md](docs/runtime-state.md)。场景声明是初始状态,不是永久冻结的本局状态;保留原玩法的状态转换,不把静态阻挡示例当作动态物件的完整实现。
39
-
40
- ## 多场景
41
-
42
- 靠根目录 `localcraft.scene-editor.json` 声明,**禁止按文件名猜**(不要扫 `*.Scene.ts`)。每个可编辑场景一条 `{id,label,path}`,共用一份 `localcraft.assets.json`。字段规则见 [contract.md](docs/contract.md) §1。
43
-
44
- - 不写 `scenes` 时按单场景,只看 `scene`。写了 `scenes`(1–64 条)时,`scene` 仍是默认打开的那一个,必须和列表里某条的 **id + path 完全一致**。
45
- - `id` 与 `path` 各自唯一(path 大小写不敏感)。每个场景文件自己一份 `Build`/JSON(`id` 等于该条声明),物件 `assetId` 指向共享注册表。
46
- - 编辑器**不会**在界面新建/删除场景。要进左侧列表必须:场景文件已存在 + 写进声明 + `runtimeConsumers` 用非 type-only 静态 import **每一个** path。只写注释或 `import()` 不算。
47
- - 保存只回写**当前**场景路径,不要一次改其它场景文件。
48
- - 可选 `constraints`(`requiredObjects` / `uniqueObjectKinds` / `allowedObjectKinds`)写在声明条目上,不要发明第二种约束文件。
49
- - 交回宿主的快照要带上:声明、注册表、全部场景文件、全部 `runtimeConsumers`。少一个声明的场景文件会打不开。
50
-
51
- ## 执行流程
52
-
53
- 1. **只读检查。** 读取根目录 `localcraft.scene-editor.json`:有 `scenes` 则逐条读每个 `path`,否则只读 `scene.path`。再读 `assetRegistry` 和 `runtimeConsumers`。检查格式、路径、资产 ID、每个声明场景是否被静态 import。文件名由声明决定,不写死 Main.Scene.ts。已符合契约且没有其他修改请求时不改文件,返回可打开结果;静态检查不能证明实际运行已通过。
54
- 2. **确认迁移范围。** 对未接入项目,在已授权范围内检查现有世界创建代码与场景资源,识别真实布局、坐标单位、碰撞、出生点和业务属性。无法可靠映射动态场景时,解释限制并请求明确方案,不把动态逻辑强行压成静态假地图。多个可玩关卡/开始背景要进编辑器时,拆成多个场景文件并写进 `scenes`,不要塞进同一个 `Build`。
55
- 3. **最小修改。** 新建推荐 `.Scene.ts`,保留已有合法 JSON/TS 的路径和格式。声明 schemaVersion 为 1;新场景数据为 v2;资产注册表为 v1。Build 只直接返回静态字面量,使用项目自有类型和 import type,不执行项目 TS 来提取场景。保留稳定 ID、扩展字段、布局、玩法和实际资源。资产表每条必须有 `id`、`name`、`kind`(`file` \| `procedural` \| `prefab` \| `terrain` \| `component`),不要写 `label`;缺 `kind` 会被编辑器静默丢掉。只有确实能摆放/绘制的资源才声明对应 capability;出生点等逻辑对象的 assetId 也必须能解析。
56
- 4. **连接运行时。** 适配器真实静态 import **每一个**已声明场景,并在游戏启动链路按当前玩法调用对应 `Build`(JSON 则消费对应数据)。将格坐标/尺寸按项目单位正确映射,使用场景数据创建世界。去掉重复覆盖的旧布局来源,但保留其他业务行为。迁移格式时同时更新声明和所有相关消费者,确认无依赖后才清理旧数据。
57
- 5. **预接 file url。** 无论资产表此刻有没有 `kind=file` 条目,都必须提前写好读 `source.url` 的接口:静态 import 资产表,提供 `listSceneFileObjects` / `enqueueSceneFileImages`。编辑器稍后加 file 资产不会再跑本 skill,禁止等出现 file 再补。加载界面用 `resolveAssetUrl` 入队 Phaser Loader,开战按物件格数 `this.add.image` 摆图。禁止把 url 抄进 `boot.config` / `FILE_ASSETS`,禁止改成程序绘制。多场景时按**当前**那份场景文档入队/摆图,不要只接默认 `scene` 而漏掉其它 path 的 import。形态见 `examples/platformer-ts/src/game/sceneFileAssets.ts`。
58
- 6. **绑定阻挡。** 无论场景此刻有没有 `blocksMovement: true`,都必须提前写好 `listSceneBlockers`:初始只收物件/区域顶层 `blocksMovement === true`,按格映射成像素矩形;缺失或 false 不挡,不按 kind、颜色或资产默认值改写已存在实例。静态物件可以建静态体,动态物件按 [runtime-state.md](docs/runtime-state.md) 接入项目已有生命周期,使显示与碰撞同步变化,不另写平行墙表。资产表 `placement.blocksMovement` 仅为新实例默认值。多场景时使用当前场景的状态;示例 `examples/platformer-ts/src/game/sceneBlockers.ts` 只提供初始阻挡列表。
59
- 7. **验证与交回。** 跑本 skill 的契约检查;有文件图片或声明图片预览时,按 resource-sync 文档在配置导出后运行 `check_scene_resource_urls.py`,检查未解析槽位及旧图后备。再按常驻 `AGENTS.md` 调用 `game_visual_qa`。在隔离草稿中验证移动物件后游戏位置变化;修改动态行为时按 runtime-state 文档验证受影响的状态转换和后续动作,不只检查初始显示。不把测试位移混入用户最终布局。无法运行的检查明确标为未验证。由宿主保存新版本、构建并读取最新快照;不要自行调用猜测的接口。
60
- 8. **写入标记和功能版本。** 本 skill 的契约检查(`check_scene_contract.py`)全量通过后,执行 `apply_scene_marker.py --mode mark` 写入 `scene_editor_compat: true`,并按平台清单把 `sceneeditor` 写入 `version/project_feature_version.json`(见「标记」)。
61
-
62
- ## 执行
63
-
64
- ```bash
65
- # 1. 契约检查(--json 输出结构化报告;退出码 0=达标且已标记 / 3=达标但缺标记 / 1=有 findings / 2=环境错误)
66
- python3 "${CRAFT_SKILL_DIR}/scripts/check_scene_contract.py" --project-root "${CRAFT_PROJECT_DIR}"
67
-
68
- # 2. 按报告 [FIND] 逐条修复(manifest / 场景文件 / 注册表 / 运行时消费者),回到第 1 步复检
69
-
70
- # 3. 复检通过后写入标记,并回写 sceneeditor 功能版本(仍有 findings 会 REFUSE)
71
- python3 "${CRAFT_SKILL_DIR}/scripts/apply_scene_marker.py" --project-root "${CRAFT_PROJECT_DIR}" --mode mark
72
-
73
- # 查看标记状态
74
- python3 "${CRAFT_SKILL_DIR}/scripts/apply_scene_marker.py" --project-root "${CRAFT_PROJECT_DIR}" --mode status
75
- ```
76
-
77
- ## 标记
78
-
79
- `scene_editor_compat` 是 `SPEC/plan/dev-config.json` 的布尔字段:`true` 表示项目场景已按契约接入,之后新增场景数据也按同一形态写。功能版本不写在这份文件里。`mark` 成功后把 `sceneeditor` 写成 `version/craft_feature_version.json` 中的 `currentVersion`,落到 `version/project_feature_version.json`。平台清单里的版本号由开发者手动维护。
80
-
81
- - 只有本 skill 的 `apply_scene_marker.py --mode mark` 能在全量检查通过后写
82
- `scene_editor_compat: true` 并回写功能版本;Agent 禁止手改。
83
- 检查仍有 findings 时脚本 REFUSE(退出码 1),字段保持原值。
84
- - 写标记前先校验平台清单:清单不合法或缺少 `sceneeditor` 时输出 `SCENE_MARK_WRITE_FAILED`,标记也不写,按 `[ERROR]` 行修正后重跑;工程没有平台清单时照常写标记,跳过回写并输出 `FEATURE_VERSION_SKIPPED`。
85
- - `SPEC/plan/dev-config.json` 不存在时(二创升级往往没有这份文件),脚本创建文件并只写
86
- `scene_editor_compat`,不臆造其它键;文件已存在则读出整份合并写回,不丢其它键。
87
- - Code 读:新增或改写场景静态数据、修改资源之前读 `scene_editor_compat`。缺失或不是 `true` 时,不因普通开发自主适配;用户明确要求接入 / 修复时走已授权的适配流程。`true` 时布局写进 manifest 声明的场景文件(`Build` 返回对象 / JSON),资源按「已适配项目的资源维护」处理,不另建硬编码布局或图片地址表。
88
- - 静态检查通过不等于编辑器端到端可用;第 7 步的运行验证仍必须执行,二者缺一不算打通。
89
-
90
- ## 返回结果
91
-
92
- 向宿主报告:检查结论、修改文件、场景路径、逐项验证证据、未验证项、`scene_editor_compat` 与 `sceneeditor` 功能版本是否已由标记脚本写入,以及下一步。建议结论使用 `ready` / `needs-adaptation` / `unsupported` / `blocked` / `failed`;具体机器字段由平台调用协议定义,本文件不新增 Web 消息协议。
93
-
94
- 只有契约复检通过才能建议打开。`ready` 仅表示可以加载编辑,不等同真实运行验收通过,运行时验证单独报告。失败时保留可追溯修改并交回宿主,不无限重试或通过删对象、删引用掩盖错误。
@@ -1,13 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "assets": [
4
- {
5
- "id": "platform.stone", "name": "石平台", "kind": "procedural",
6
- "capabilities": ["scene-placeable"], "category": "prop",
7
- "source": { "module": "src/game/sceneAdapter.ts" },
8
- "preview": { "color": "#8170c6", "icon": "▬" },
9
- "placement": { "runtimeKind": "platform", "width": 2, "height": 1, "blocksMovement": true, "properties": { "color": "#8170c6" } },
10
- "editorSchema": { "color": { "type": "string", "label": "颜色" } }
11
- }
12
- ]
13
- }
@@ -1,6 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "scene": { "id": "main", "label": "示例地图", "path": "src/scenes/main.scene.json" },
4
- "assetRegistry": "localcraft.assets.json",
5
- "runtimeConsumers": ["src/game/sceneAdapter.ts"]
6
- }
@@ -1,25 +0,0 @@
1
- import scene from '../scenes/main.scene.json';
2
- import registry from '../../localcraft.assets.json';
3
- import { compileScene, overlaps } from '../../runtime/scene-editor/1.0.0/scene.mjs';
4
- import type { Rect, RuntimeScene } from '../../runtime/scene-editor/1.0.0/scene.mjs';
5
-
6
- export function createExampleWorld(): RuntimeScene {
7
- return compileScene(scene, registry);
8
- }
9
-
10
- // Example rendering only: use the game's existing visual factories for real assets.
11
- export function drawExampleWorld(context: CanvasRenderingContext2D, world: RuntimeScene): void {
12
- context.fillStyle = world.baseTerrain === 'stone' ? '#252b38' : '#527d46';
13
- context.fillRect(0, 0, world.width, world.height);
14
- for (const item of world.items) {
15
- if (item.collection !== 'objects' || item.runtimeKind !== 'platform') continue;
16
- context.fillStyle = String(item.properties.color ?? '#8170c6');
17
- context.fillRect(item.x, item.y, item.width, item.height);
18
- }
19
- }
20
-
21
- // Small grid-step example. Existing physics engines can consume world.blockers directly.
22
- export function canOccupy(world: RuntimeScene, rect: Rect): boolean {
23
- return rect.x >= 0 && rect.y >= 0 && rect.x + rect.width <= world.width && rect.y + rect.height <= world.height
24
- && !world.blockers.some(blocker => overlaps(rect, blocker));
25
- }
@@ -1,18 +0,0 @@
1
- {
2
- "schemaVersion": 2, "id": "main", "name": "示例地图", "width": 12, "height": 8,
3
- "cellSize": 32, "baseTerrain": "stone",
4
- "layers": [
5
- { "id": "world", "name": "物件", "group": "objects", "kind": "object", "order": 10, "visible": true, "locked": false },
6
- { "id": "markers", "name": "出生点", "group": "logic", "kind": "marker", "order": 20, "visible": true, "locked": false },
7
- { "id": "collision", "name": "阻挡", "group": "logic", "kind": "collision", "order": 30, "visible": true, "locked": false },
8
- { "id": "triggers", "name": "触发区", "group": "logic", "kind": "trigger", "order": 40, "visible": true, "locked": false }
9
- ],
10
- "objects": [
11
- { "id": "platform-1", "label": "石平台", "kind": "platform", "assetId": "platform.stone", "layerId": "world", "x": 4, "y": 2, "width": 2, "height": 1, "blocksMovement": true, "properties": { "color": "#8170c6" } },
12
- { "id": "spawn-1", "label": "出生点", "kind": "spawn", "layerId": "markers", "x": 1, "y": 2, "width": 1, "height": 1 }
13
- ],
14
- "regions": [
15
- { "id": "wall-1", "label": "边界阻挡", "kind": "collision", "layerId": "collision", "x": 0, "y": 7, "width": 12, "height": 1, "blocksMovement": true },
16
- { "id": "goal-1", "label": "目标区", "kind": "trigger", "layerId": "triggers", "x": 9, "y": 2, "width": 2, "height": 2 }
17
- ]
18
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": "1.0.0",
3
- "files": {
4
- "scene.d.mts": "4ed2a4279a073b846f7e79115ae0c4c907503861ca4b877c1a59bf66b856d1f0",
5
- "scene.mjs": "21e6f378a2d08432eec7654819093f29b14d6d58f0c5451b680116b0d114a989"
6
- }
7
- }