@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,20 +1,16 @@
1
1
  ---
2
2
  name: export-config
3
- description: 为 JS3D 游戏安装配置解析、参数覆盖、配置导出及独立 Vite 插件。在新增可调参数、资源配置、迁移或上传前使用;兼容旧 Runtime 导出入口。
3
+ description: 导出当前 3D / Three.js 工程的资源与可调参数配置;新增资源槽、修改配置、构建或上传前排查时使用。
4
4
  ---
5
5
 
6
- # Export Config
6
+ # 3D / Three.js 配置导出
7
7
 
8
- ## 安装与接线
8
+ 模板已自带 scripts/skill-modules/export-config,Vite 中 gameConfig() 与 lightgame() 并列。默认值写 configs/*.json,控件元数据写同名 *.controls.json;保持业务普通 JSON import。
9
9
 
10
- 新模板已预装。迁移或缺少配置能力时执行 `node "${CRAFT_SKILL_DIR}/scripts/install.mjs" --project "${CRAFT_PROJECT_DIR}"`,将 `assets/tooling/` 安装到 `scripts/skill-modules/export-config/`。安装器记录版本,重装会覆盖已装文件,不要手改;禁止直接依赖 `context` 或恢复 Runtime 中的配置模块。
10
+ 在项目目录执行 `node "${CRAFT_SKILL_DIR}/scripts/export-config.mjs"`。MCP 的工程检查也通过 SDK hook 调用本工程绑定版本的技能入口;技能与普通 `npm run config:export` 共用项目内导出流程,不查找相邻工程的上下文。
11
11
 
12
- 在 `vite.config.ts` 从项目内 `scripts/skill-modules/export-config/vite.mjs` 引入 `gameConfig()`,与 Runtime 的 `lightgame()` 并列启用。前者负责配置解析/覆盖/HMR;后者只负责预览桥、校验与 profile。
12
+ 脚本同步 @slot、assets.json 与资源控件,再导出 unified_data_control_config.json,保留已有有效覆盖值。导出后核实资源 slot 有真实消费者,参数修改能改变游戏,必要加载已成功。地址规则见 [AssetUrl](../../knowledge/AssetUrl.md)。
13
13
 
14
- 在项目 `game-runtime.json` 设置 `configs`(默认 `configs`)与 `cdnBase`。配置目录存放默认 JSON 和同名 `*.controls.json`;面板值写入 `unified_data_control_config.json`。保持 `change_value → value → default` 优先级和资源地址规则,不绕开插件直接加载原始 JSON。
14
+ 只有配置模块确实缺失或明确升级时,才执行 `node "${CRAFT_SKILL_DIR}/scripts/install.mjs" --project "${CRAFT_PROJECT_DIR}"`;它会覆盖该模块,先检查已有改动。API 以随技能 assets/tooling/*.d.mts 为准。
15
15
 
16
- ## 导出
17
-
18
- 在项目根执行 `npm run config:export`,或 `node "${CRAFT_SKILL_DIR}/scripts/export-config.mjs"`。上传入口自动分流:`1.0.0` 使用旧 Runtime CLI;`1.1.0` 使用项目内配置 CLI。项目脱离 Skill 目录时,仍可执行 `node scripts/skill-modules/export-config/cli.mjs export-config`。
19
-
20
- 权威 API 见随包 `.d.mts`。验证配置覆盖真正改变游戏、修改触发 HMR、导出保留已有面板值以及独立构建通过。不要为旧项目自动升级 Runtime。
16
+ 导出成功不等于玩法或画面通过。继续使用 craft_game_check 与 craft_game_review 验证本次最终状态。
@@ -1,56 +1,4 @@
1
- // Upload service invokes this with cwd=project. Also used by npm run config:export.
2
- import { readFile } from 'node:fs/promises';
3
- import { resolve, relative, isAbsolute } from 'node:path';
1
+ // Invoke the exporter shipped with this project's engine template.
2
+ import { resolve } from 'node:path';
4
3
  import { pathToFileURL } from 'node:url';
5
- import { assertAssetsWired } from './assert-asset-wiring.mjs';
6
- import { syncAssetControls, readControlSnapshot, applySnapshotAssetAddresses, decodeSnapshotResourcePaths } from './sync-asset-controls.mjs';
7
- import { syncSceneAssets } from './sync-scene-assets.mjs';
8
- import { applyPanelTitles, copyControlTitlesToSnapshot } from './translate-asset-titles.mjs';
9
-
10
- const project = resolve(process.cwd());
11
- const previousSnapshot = readControlSnapshot(project);
12
- const synced = syncAssetControls(project);
13
- console.error(`[export-config] assets.controls.json slots=${synced.count}`);
14
- // 清单环:把 scene.ts 里编辑器写入的 /Game/ 引用登记进 configs/scene_assets.json。
15
- // 场景编辑器退出保存时也会写同一份(同键同形),这里兜住不经编辑器写入的路径
16
- // (转换期生成、手改 scene.ts、旧工程)。清单未登记时资产会被打包静默忽略。
17
- const sceneAssets = syncSceneAssets(project);
18
- if (sceneAssets.changed) {
19
- console.error(
20
- `[export-config] 场景资产清单及控件已同步(新增 ${sceneAssets.added} 条,迁移旧键 ${sceneAssets.migrated} 条)→ ${sceneAssets.path}`,
21
- );
22
- }
23
- const titled = await applyPanelTitles(project);
24
- if (titled.updated) {
25
- console.error(`[export-config] 面板名称已写成中文:${titled.updated} 项`);
26
- }
27
-
28
- let manifest;
29
- try { manifest = JSON.parse(await readFile(resolve(project, 'game-runtime.json'), 'utf8')); }
30
- catch (error) { if (error.code !== 'ENOENT') throw error; }
31
- if (manifest?.version === '1.1.0') {
32
- const { runCli } = await import(pathToFileURL(resolve(project, 'scripts/skill-modules/export-config/cli.mjs')).href);
33
- await runCli(['export-config', '--project', project]);
34
- } else if (manifest) {
35
- if (typeof manifest.root !== 'string' || !manifest.root.startsWith('runtime/')) throw new Error('Invalid game-runtime.json root');
36
- const cli = manifest.cli ?? 'cli.mjs';
37
- if (!['cli.mjs', 'tooling/cli.mjs'].includes(cli)) throw new Error('Invalid runtime CLI entry');
38
- const entry = resolve(project, manifest.root, cli);
39
- const rel = relative(project, entry);
40
- if (rel.startsWith('..') || isAbsolute(rel)) throw new Error('Runtime exporter must remain inside the project');
41
- const { runCli } = await import(pathToFileURL(entry).href);
42
- await runCli(['export-config', '--project', project]);
43
- }
44
- const aligned = applySnapshotAssetAddresses(project, previousSnapshot);
45
- if (aligned.updated) {
46
- console.error(`[export-config] 游戏资源当前值已对齐 assets.json:${aligned.updated} 项`);
47
- }
48
- const decoded = decodeSnapshotResourcePaths(project);
49
- if (decoded.updated) {
50
- console.error(`[export-config] 资源地址已解回中文:${decoded.updated} 项`);
51
- }
52
- const snapshotTitles = copyControlTitlesToSnapshot(project);
53
- if (snapshotTitles.updated) {
54
- console.error(`[export-config] 快照条目名已对齐中文:${snapshotTitles.updated} 项`);
55
- }
56
- assertAssetsWired(project);
4
+ await import(pathToFileURL(resolve(process.cwd(), 'scripts/config-export.mjs')).href);
@@ -0,0 +1,42 @@
1
+ {
2
+ "schema": 1,
3
+ "engine": "js3d",
4
+ "skills": [
5
+ {
6
+ "id": "js3d:aigc-integration",
7
+ "name": "aigc-integration",
8
+ "description": "为 3D / Three.js 游戏生成并接入模型、贴图、音乐或动画;需要平台生成素材时使用。",
9
+ "entrypoint": "skills/aigc-integration/SKILL.md"
10
+ },
11
+ {
12
+ "id": "js3d:asset-search",
13
+ "name": "asset-search",
14
+ "description": "为当前 3D / Three.js 游戏检索并导入 Craft 素材库资源;需要现有图片、音频、模型或骨骼动作时使用。",
15
+ "entrypoint": "skills/asset-search/SKILL.md"
16
+ },
17
+ {
18
+ "id": "js3d:asset-usage-audit",
19
+ "name": "asset-usage-audit",
20
+ "description": "检查 3D / Three.js 工程资源槽、引用关系、模型与动画负担;资源接线排错或清理分析时使用。",
21
+ "entrypoint": "skills/asset-usage-audit/SKILL.md"
22
+ },
23
+ {
24
+ "id": "js3d:export-config",
25
+ "name": "export-config",
26
+ "description": "导出当前 3D / Three.js 工程的资源与可调参数配置;新增资源槽、修改配置、构建或上传前排查时使用。",
27
+ "entrypoint": "skills/export-config/SKILL.md"
28
+ },
29
+ {
30
+ "id": "js3d:performance-audit",
31
+ "name": "performance-audit",
32
+ "description": "对 3D / Three.js 工程做静态性能扫描与热点定位;分析帧循环、资源分配或性能问题时使用。",
33
+ "entrypoint": "skills/performance-audit/SKILL.md"
34
+ },
35
+ {
36
+ "id": "js3d:visual-qa",
37
+ "name": "visual-qa",
38
+ "description": "验收 3D / Three.js 游戏的真实输入、玩法闭环与截图;在交付预览或验证修复时使用。",
39
+ "entrypoint": "skills/visual-qa/SKILL.md"
40
+ }
41
+ ]
42
+ }
@@ -1,166 +1,21 @@
1
1
  ---
2
2
  name: performance-audit
3
- description: >
4
- 对 JS3D / Three.js 工程做静态性能分析:扫描渲染热路径中的资源创建、临时对象、每帧 DOM、
5
- draw call、阴影与后处理、加载和释放缺口,输出可定位到 file:line 的候选并按风险分级。
6
- 用户要求排查卡顿、掉帧、GC、draw call、帧时间,或要求先不运行游戏做性能体检时使用。
7
- 不用于资源体积/加载字节、灵感建议(optimization-suggestions)或纯画面质量(threejs-game-quality)。
3
+ description: 对 3D / Three.js 工程做静态性能扫描与热点定位;分析帧循环、资源分配或性能问题时使用。
8
4
  ---
9
5
 
10
- # Performance Audit
6
+ # 静态性能分析
11
7
 
12
- 先扫描代码事实,再确认实际执行频率,最后用测量证明收益。静态分析只能指出候选,不能证明帧率;没有运行数据时保留“未验证”。
8
+ 在本次选择的技能目录运行:
13
9
 
14
- 本技能与相邻能力的分工:
15
-
16
- - 资源文件大小、GLB 动画、贴图尺寸、预加载字节:不在本技能范围,走资源审计。
17
- - 画面、材质、镜头、构造质量:`game-art-style` / `threejs-game-quality`。
18
- - 运行时结构审计库与固定步长:`${CRAFT_CONTEXT_DIR}/skills/threejs-game-quality/references/runtime-tools.md`。
19
- - 只出玩法/迭代建议:`optimization-suggestions`。
20
-
21
- ## 调用边界
22
-
23
- - 用户点名卡顿、掉帧、帧时间、GC、draw call、发热、低端机表现,或要求“先静态看看性能问题”时使用。
24
- - 用户只要求“再优化一下”“做得更好”而不指向性能时,先确认目标;不要自动把美术或玩法请求转成性能改造。
25
- - 扫描后是否修改由本轮需求决定:只诊断就只交付报告;明确要求优化时才改代码。
26
- - 不扫描 `runtime/`、`vendor/`、`node_modules/` 作为业务性能来源;不改平台 SDK 来“优化”业务工程。
27
- - 报告写到 `${CRAFT_PROJECT_DIR}/.perf-audit/`,是诊断产物,不作为交付文件提交。
28
-
29
- ## 两种工程形态
30
-
31
- | 模式 | 判定 | 能做什么 |
32
- |---|---|---|
33
- | `source` | 有 `src/`、`zoo/`、`game/`、`app/` 等源码 | 函数边界、调用传播、循环/生成路径、逐行规则 |
34
- | `bundle` | 只有 `assets/`、`engine/` 等产物 | 只检查 `preserveDrawingBuffer`、DPR、阴影尺寸等字面量;不推断函数与频率 |
35
-
36
- `auto` 优先 source。压缩产物没有可靠的函数边界,bundle 模式会明确输出 `SCANNER.BUNDLE_LIMITS`;不要用它的“未发现”证明没有问题。有源码时以源码为准,`dist/` 只是产物。
37
-
38
- 案例工程的形态差异见 [案例与判读](references/case-notes.md)。
39
-
40
- ## 扫描
41
-
42
- ```bash
10
+ ```sh
43
11
  node "${CRAFT_SKILL_DIR}/scripts/scan-perf.mjs" --project "${CRAFT_PROJECT_DIR}" --top 20
44
- ```
45
-
46
- 常用参数:
47
-
48
- - `--mode auto|source|bundle`:强制模式;默认自动。
49
- - `--json`:输出完整 JSON;报告同时写入 `.perf-audit/report.json`。
50
- - `--top N`:终端列出前 N 条。
51
- - `--hotspots`:只输出帧回调、热函数、生成路径与重复工厂的热点图,不应用规则,也不写 findings 报告;`--json` 输出 JSON,`--out` 可另存 JSON。
52
- - `--fail-on none|warning|error`:CI 需要阻断时使用;默认不阻断。
53
-
54
- 扫描器是零依赖 ES module,不读取 `node_modules`,不执行项目代码。它用保守的词法掩码排除注释与字符串,再做括号配对和调用名传播;`updateX` 只有从真实帧循环(RAF、`setAnimationLoop` 或 `onTick`/`onUpdate` 等常见帧回调,含表达式体箭头与裸回调名)可达时才会被当作热函数,且按文件作用域传播,避免同名函数跨文件误报。
55
-
56
- ### 热点图
57
-
58
- ```bash
59
12
  node "${CRAFT_SKILL_DIR}/scripts/scan-perf.mjs" --project "${CRAFT_PROJECT_DIR}" --hotspots --top 30
60
13
  ```
61
14
 
62
- 热点图只列结构位置,不判断好坏:
63
-
64
- - `frame-hook`:帧回调注册点,可能带 `name`(命名回调)。
65
- - `hot-function`:从帧循环可达的函数,`confidence` 区分 high/medium。
66
- - `spawn`:生成/发射路径;`repeated-factory`:被生成、循环或热路径调用的工厂。
67
- - `MANUAL.*` 不在扫描器报告里;人工审查的发现写在回复中,不伪造进 `report.json`。
68
-
69
- 它不写 `.perf-audit/report.json`,适合先拿热点图选文件,再做人工审查。
70
-
71
- 扫描 findings 是检查清单,不是性能边界;扫描器干净不等于没有问题。
72
-
73
- ## 读结果
74
-
75
- 先看 `summary`,再看按严重度排序的 `findings`:
76
-
77
- | 字段 | 含义 |
78
- |---|---|
79
- | `severity` | `error` 先修;`warning` 需确认频率;`info` 是可扩展性提示 |
80
- | `confidence` | `high` 为语法/位置确定;`medium` 为调用名或工厂推断;`low` 需人工判断 |
81
- | `context` | `frame-loop`、`loop`、`spawn-factory`、`repeated-factory`、`static` |
82
- | `evidence` | 命中行;`line` 可直接跳转 |
83
- | `suppressed` | 同文件同规则超过 8 条后折叠的数量;需要回读附近代码 |
84
-
85
- 常见 ID 与首选动作:
86
-
87
- | ID | 含义 | 首选动作 |
88
- |---|---|---|
89
- | `FRAME.GPU_RESOURCE` | 帧循环里新建几何/材质/贴图/RT | 初始化时创建并复用;按实例只改变换/颜色 |
90
- | `FRAME.TEMP_OBJECT` | 帧循环里 new/clone 向量、矩阵、颜色 | 模块级或实例级 scratch 对象 + 原地方法 |
91
- | `FRAME.DOM_WRITE` / `FRAME.UI_SYNC_CALL` | 每帧写 HUD 或同步世界标签 | 只在值变化时写,或降到固定低频 |
92
- | `FRAME.SNAPSHOT_ALLOC` | 每帧构造快照对象 | 复用快照并原地更新字段 |
93
- | `FRAME.SCENE_TRAVERSE` | 每帧遍历场景树 | 维护需更新对象列表,结构变化时才遍历 |
94
- | `FRAME.RAYCAST` / `FRAME.LOAD` | 每帧射线/加载 | 缩小候选集、降频、移到初始化 |
95
- | `FRAME.MATERIAL_RECOMPILE` | 每帧设置 `needsUpdate` | 只在材质定义变化时设置 |
96
- | `SCENE.GPU_RESOURCE_IN_LOOP` | 循环内逐个建资源 | 提到循环外共享;同构对象用 InstancedMesh/合批 |
97
- | `SCENE.MESH_IN_LOOP` | 循环内逐个建 Mesh | 静态合并或实例化;确认对象数量上限 |
98
- | `SPAWN.PER_INSTANCE_RESOURCE` | 生成/发射路径逐实例建资源 | 共享几何/材质;弹道与特效用对象池 |
99
- | `RENDER.PRESERVE_DRAWING_BUFFER` | 常开保留绘制缓冲 | 确认截图路径后移除;不要盲删 |
100
- | `RENDER.PIXEL_RATIO_UNCLAMPED` | DPR 未限制 | `Math.min(devicePixelRatio, 2)` 或实测上限 |
101
- | `RENDER.SHADOW_MAP_LARGE` | 阴影贴图 > 2048 | 按主体尺寸和 shadow camera 范围降低 |
102
- | `RENDER.FRUSTUM_CULLED_OFF` | 关闭视锥剔除 | 确认是否高速/常驻对象;否则恢复 |
103
- | `LIFECYCLE.*` | 无释放、无取消 RAF、双 resize | 按所有权补释放/取消/单一尺寸路径 |
104
-
105
- 完整规则、误报边界和验证方法见 [规则与误报](references/rules.md)。
106
-
107
- ## Agent-led pass
108
-
109
- 扫描器覆盖已知模式,不覆盖算法复杂度、overdraw、数据布局、CPU/GPU 同步、自定义帧钩子和项目特有系统。完成扫描 triage 后,按热点图做一轮人工审查:
110
-
111
- 1. 读真实入口:`src/main.ts`、固定步长/物理循环、RAF 钩子、生成路径和 UI 同步路径。
112
- 2. 对每个热路径检查:重复计算或 O(n²)、候选集/数据结构、draw call 与合批、透明排序与 overdraw、材质/着色器/RT 切换、CPU↔GPU 读回与上传、DOM/Layout、监听器和定时器生命周期。
113
- 3. 记录 `MANUAL.<area>` 发现:`file:line`、为什么在热路径、预期影响、如何验证;不要只复述扫描器已经报过的内容。
114
- 4. 扫描器没有命中时,仍按热点图检查最重的 2–3 个路径;不要用“扫描通过”代替人工判断或测量。
115
-
116
- 人工发现也按同一分级修复和验证流程处理;没有测量时保留“未验证”。
117
-
118
- ## 确认频率,不要直接改
119
-
120
- 每类候选都要回到代码确认它是否真的在目标路径上:
121
-
122
- | 候选 | 必须确认 |
123
- |---|---|
124
- | `FRAME.*` | 该行是否在 RAF/`setAnimationLoop` 的调用链内;`updateX` 是否每帧调用 |
125
- | `SPAWN.PER_INSTANCE_RESOURCE` | 每次射击/生成都走这里,还是只初始化一次;高频程度 |
126
- | `SCENE.*_IN_LOOP` | 循环次数;初始化一次的场景可降级处理 |
127
- | `RENDER.*` | 截图/录像是否真的依赖该设置;目标设备与画质要求 |
128
- | `LIFECYCLE.*` | 资源所有权在谁;是否由管理器统一释放 |
129
-
130
- 调用名传播是保守近似:从帧循环可达的 `update*` / `render*` 会被标记,事件驱动的 `updateCatalog` 或 `setInterval` 驱动的 `updateHud` 不会被标记。传播按文件作用域进行,同名函数在另一个文件不会因为别处是热路径而一起变热。跨文件动态调用(字符串、回调表)可能漏报;关键路径以实际调用点为准。
131
-
132
- ## 分级修复
133
-
134
- 从低风险开始,一次只改一类,改完复测:
135
-
136
- - **L0 安全**:去掉帧内临时对象和 DOM 全量写入;把几何/材质/贴图提到初始化;限制 DPR;补 `cancelAnimationFrame` 与 `dispose`。通常不改变画面。
137
- - **L1 结构**:InstancedMesh / `mergeGeometries` / 项目已有 batching;对象池;快照复用;降低 UI 同步频率;收紧 shadow camera 或后处理 RT 分辨率。需要看画面与交互回归。
138
- - **L2 高影响**:改 renderer 创建选项(如 `preserveDrawingBuffer`)、阴影/后处理管线、场景组织或替换渲染方案。必须获得用户确认,保留原方案,并在目标设备上验收。
139
-
140
- 不要为了帧率删掉用户要求的光影、材质或特效;用户已采用的 unlit/平涂/无阴影本身不是性能缺陷。不要改 `src/display/viewport.ts` 的适配数学来“省性能”;尺寸问题交给 `resolution-adaptation`。
141
-
142
- ## 验证
143
-
144
- 静态扫描通过不代表性能通过。按改动范围选择:
145
-
146
- 1. `npm run build`:类型、配置导出与打包。旧工程按实际脚本补齐。
147
- 2. 结构审计:需要时用 `${CRAFT_CONTEXT_DIR}/skills/threejs-game-quality/scripts/runtime-audit.js`,预算来自项目,缺预算保持 unknown。
148
- 3. `renderer.info`:同一状态、同一帧范围记录 `calls / triangles / geometries / textures`;多 pass 或 `autoReset` 时先确认统计范围。
149
- 4. 真实帧:目标设备/浏览器,记录采样区间、样本数、p50/p95;用 Performance 面板确认 GC、Layout、Recalc Style 是否下降。
150
- 5. 可见改动:走项目既有 `game_visual_qa`;截图正常只证明画面,不证明帧率。
151
-
152
- 交付分开写“预计收益”和“实测收益”。没有测量就写“未验证”,不要承诺“提升 30%”或“稳定 60 FPS”。
153
-
154
- ## 硬约束
15
+ 普通扫描写入工程 .perf-audit/report.json;热点模式默认只输出结构,指定 `--out <项目内路径>` 才落盘。只读恢复不运行这些命令。
155
16
 
156
- - 不修改 `runtime/`、`vendor/`、平台 SDK 或模板适配数学来规避业务性能问题。
157
- - 场景可编辑项目(`src/scenes/<场景>/scene.ts`)不要为了合批改变 item 粒度;摆位/造型的维护约定见 `${CRAFT_CONTEXT_DIR}/knowledge/CodingGuide/SceneEditableGuide.md`。
158
- - 不因静态命中就直接删除预热、资源或视觉效果;先确认加载与画面语义。
159
- - `preserveDrawingBuffer` 可能被自定义截图/录像依赖;移除前必须验证截图链路。
160
- - 不把 `renderer.info` 的某一次计数当成整帧;多通道渲染会覆盖或分段统计。
161
- - 不把压缩产物的扫描结果当成源码结论;能拿到源码就回源码重扫。
17
+ 源码模式识别帧回调、传播到热函数的调用与生成路径,排除依赖、Runtime 和构建产物。只有产物时 bundle 模式仅检查可识别的字面量,不能据此推断真实调用频率。
162
18
 
163
- ## 参考
19
+ 先读 summary 和 findings,再核对实际源码与 confidence。优先检查每帧创建 GPU 资源、临时对象、重复 DOM、阴影和 draw calls;热点只表示结构位置,不是缺陷结论。
164
20
 
165
- - [规则、误报与验证](references/rules.md)
166
- - [案例:Tidewater Zoo 与 Last Light Stand](references/case-notes.md)
21
+ 按需求决定是否修改。修复后复查同一场景,并通过实际浏览器测量帧时间与内存;静态无命中不证明性能良好。
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: visual-qa
3
+ description: 验收 3D / Three.js 游戏的真实输入、玩法闭环与截图;在交付预览或验证修复时使用。
4
+ ---
5
+
6
+ # 3D / Three.js 游戏验收
7
+
8
+ 读取当前工作流 context.workflow 的玩法观测和检查 schema。探针从真实渲染与玩法状态提供 engine、ready、frameCount 和 game;同时提供真实 camera 与 viewport,保留 render 和资源释放。
9
+
10
+ 设计能由实际输入触发的检查:进入/推进核心循环、达到结算条件、重开恢复初始状态。只断言业务实际产生的值,不通过测试代码直接修改分数或结算。
11
+
12
+ 调用 craft_game_check 并轮询完成,使用 craft_game_review 查看实际截图。核实主要对象、UI、尺寸、遮挡、资源透明度与当前玩法,3D 场景还检查地面接触、相机与光照。修改后重新检查受影响状态。
13
+
14
+ 通过后 craft_game_deliver 返回启动命令;让宿主后台任务持续运行,查询 running 与 snapshot,打开实际链接核实后交付。记录已验证与未覆盖项,不把静态构建或扫描无错误等同于可玩。
@@ -1,106 +1,7 @@
1
- # JS3D 项目
1
+ # Craft 3D / Three.js 模板
2
2
 
3
- 使用 Three.js、TypeScript、Vite 与浏览器 API。入口 `src/main.ts` 创建场景、相机与渲染循环;
4
- 默认是深灰色空场景,画布及相机随容器尺寸更新。
5
- 屏幕适配方向无关:短边恒 1080,长边随容器比例伸缩,入口与 `src/display/ui-stage.ts` 成对同步。
6
- 根目录 `game.config.json` 保存供外部容器优先显示的分辨率与朝向偏好。
7
- 物理与其它能力按运行环境已有依赖选用,需求文档放在 `SPEC/`。
3
+ 安装依赖后可运行 `npm run dev`;`npm run build` 包含配置导出、类型检查、Runtime 校验和 Vite 构建。
8
4
 
9
- 平台沙箱使用预装依赖;启用 bwrap 时 `node_modules` 只读,不执行依赖安装或更新。
10
- 仅在独立本地开发且尚未安装依赖时运行 `npm install`。
5
+ 通过 Craft 创建时,项目根 AGENTS.md 和项目恢复 Skill 由 prepare 生成。完整引擎上下文使用 craft_game_info 返回的绑定路径,开发进度保存在 SPEC/PROGRESS.md。
11
6
 
12
- 开发预览运行 `npm run dev`;修改后的收尾检查执行:
13
-
14
- ```sh
15
- npm run build
16
- ```
17
-
18
- `build` 已包含类型检查、runtime 完整性校验与配置导出,收尾无需再逐项重复;仅需单项检查时可运行 `npm run typecheck`、`npm run runtime:verify` 或 `npm run config:export`。
19
-
20
- 新模板已预置以下文件,具体内容以当前工程为准;修改前先读取,局部修改用 `edit_file`,整篇替换用 `write_file(overwrite=true)`。
21
-
22
- | 文件 | 用途 |
23
- |---|---|
24
- | `src/main.ts` | 场景、相机、渲染循环与平台生命周期 |
25
- | `src/display/viewport.ts` | 屏幕适配纯函数解算(短边锁定 + 长边扩展),不要改数学 |
26
- | `src/display/ui-stage.ts` | `#ui-root` / `#ui-stage` 的唯一 owner,逐次 resize 同步 |
27
- | `configs/game.json` | 默认游戏配置,初始包含背景色 |
28
- | `vite.config.ts` | Vite 配置,已接入 `lightgame()`、`gameConfig()` 插件与相对部署路径 |
29
- | `ds/` | **联机权威服务端**(仅联机工程有,装 `platform-services` 的 `multiplayer` 时写入):Colyseus Room + Schema + 平台生命周期钩子。`${CRAFT_CONTEXT_DIR}/skills/platform-services/references/SERVER_GUIDE.md` 是服务端硬约束与两端契约的事实源,编写或修改服务端 Room / Schema 前必读 |
30
- | `src/skill-modules/platform-services/` | 需要联机时由 `platform-services` 只安装 `multiplayer`(`MultiplayerManager.ts`、`log.ts`、`eventBus.ts`、`multiplayer/` 和身份文件)。排行榜、云存档是另外的模块,不会一起装上(见 `${CRAFT_CONTEXT_DIR}/knowledge/PlatformServices.md`) |
31
-
32
- `dist/` 使用相对路径,可部署到子目录。`dist/index.html` 是普通游戏入口;
33
- `dist/index_profile.html` 额外加载性能工具箱,是独立诊断页面,不代表 Web 平台增加了 JS 性能按钮。
34
-
35
- ## 平台与渲染
36
-
37
- Vite 的 `lightgame()` 插件在游戏入口之前显式启动平台桥。入口仍负责生命周期:
38
-
39
- - 在 `new THREE.WebGLRenderer(...)` 前调用 `connectPreview(canvas, ...)`,捕获 WebGL 创建失败。
40
- - 每次 `renderer.render(...)` 后,同一任务内调用 `preview.afterRender()`;初始化完成后 `preview.markReady()`。
41
- - `renderForCapture` 同步重绘当前帧;使用后处理时应调用实际后处理管线,不推进游戏模拟。
42
- - 热更新时调用 `preview.dispose()`,取消业务 RAF、断开观察器,并释放渲染器和业务拥有的 GPU 资源。
43
-
44
- 真实首帧与 `markReady` 均完成后发送 `onloadend`、`ready`;首帧后的 3 秒窗口报告一次
45
- `runtime-result`(0 运行错误、1 正常、2 WebGL 创建/上下文故障),日志监听继续保留。
46
- 初始化错误也能在无首帧时报告失败。带 `preview` 查询参数时显示调试条,用户点击「修复」才发 `runtime-log`。
47
-
48
- 截图在渲染后同步复制画布及同域视频当前帧,再异步合成 DOM HUD;不默认开启 `preserveDrawingBuffer`。
49
- 默认发现 `#ui-root` 与画布同级 DOM,可用 `uiRoot` 指定范围。DOM 合成失败返回已捕获画面与原因;
50
- 跨域污染的视频/图片、外部字体、复杂 CSS、iframe 和额外 canvas 不保证完整合成。
51
- 旧截图协议和可选顶层 `requestId` 均保留。
52
-
53
- ## 参数面板
54
-
55
- 配置由 `export-config` Skill 维护,项目已预装 `scripts/skill-modules/export-config/`;`game-runtime.json` 的 `configs`、`cdnBase` 设置配置目录与 CDN。Vite 分别启用平台 `lightgame()` 和配置 `gameConfig()`,项目离开 `context` 后仍可构建和导出。
56
-
57
- ```ts
58
- import game from '../configs/game.json';
59
- scene.background = new THREE.Color(game.background);
60
- ```
61
-
62
- `configs/game.json` 放默认值,`configs/game.controls.json` 放控件元数据。数值、布尔值、
63
- 十六进制颜色可自动推断;普通文本、枚举、资源字段显式声明类型,数组不自动展成控件。
64
- 导出器生成 `unified_data_control_config.json`,Vite 根据 `origin/value` 与当前默认值校验覆盖,
65
- 业务保持普通 JSON import。`ready` 后的宿主 `preview-config` 是独立启动协议。
66
-
67
- 上传前 export-config 脚本必须先完成导出,再采集代码快照;Vite build 仅作独立构建兜底。
68
- 本地可运行 `npm run config:export`,开发模式会监听配置并刷新。
69
-
70
- ## SDK 与兼容
71
-
72
- 身份、排行榜、存档和联机通过 `platform-services` Skill 按需安装到 `src/skill-modules/platform-services/`,一次只装要用的模块。
73
- 入口在 ready 前显式初始化共享身份服务,预览桥不管理服务生命周期;先正常绘制并发出
74
- `ready`,再异步读档。云存档故障可回退本机,结果 `source` 标明 `cloud/local`;排行榜无平台时返回
75
- `PLATFORM_UNAVAILABLE`。完整用法见 [平台服务说明](../context/knowledge/PlatformServices.md)。
76
-
77
- `game-runtime.json` 固定到 `runtime/lightgame/1.1.0/`,产物与清单随快照保存。`1.0.0` 仍在同级目录,当前工程不引用其中的模块。reassign 覆盖整个 `runtime/lightgame`。
78
- `runtime:verify` 检查哈希;Vite 仍检查 Vite/Three 版本并生成 profile。只有明确维护新版本时才更新清单,普通业务不刷新。
79
-
80
- ### Runtime 定点导航
81
-
82
- 路径相对项目根;先读目标声明,再按需读实现。
83
-
84
- | 能力 | 路径/归属 |
85
- |---|---|
86
- | 预览、截图、日志、ready、uiTree、runtime-result | `runtime/lightgame/1.1.0/platform/platform.d.mts` |
87
- | 校验、Vite 平台接入、profile | `runtime/lightgame/1.1.0/tooling/`,CLI 仅校验 |
88
- | 参数配置、导出、HMR | `scripts/skill-modules/export-config/` |
89
- | 资源加载、ASTC | `runtime/lightgame/1.1.0/tools/assets.mjs` 与 `astc.mjs` |
90
- | 库模型挂载、分级档位、压缩贴图 | `runtime/lightgame/1.1.0/tools/glb.d.mts` |
91
- | 身份、排行榜、存档、联机 | `platform-services` 按模块安装到 `src/skill-modules/platform-services/`。`1.0.0/platform/` 下的同名文件只给旧工程 |
92
-
93
- 音视频、基础输入/UI、Canvas 效果及 Three 玩法由 Agent 用引擎/浏览器 API 实现,不回引旧 tools。Skill 代码从项目安装目录导入,不依赖 `context`。
94
- 按需安装的 `runtime/ui-editor/1.0.0/dom-ui.d.mts` 属于独立适配器,接入时才读取 UI Skill,不扫描其它 runtime。
95
- Three 的天空、动画和场景循环由业务自行实现,模型 GLB 的加载见下。
96
- ASTC 仅限支持相应扩展的 WebGL 路径,当前解析器支持 KTX v1 的 2D ASTC,失败可回退普通图片。
97
- 模型 GLB 一律经 `loadGlbModel` 加载:路径归一化、选档回退、压缩贴图变体探测、KTX2 接线与 PNG 回退都在入口
98
- 内部完成,玩法侧唯一需要决定的是 `lod`(按实际负担选 0/1/2,目标档缺失自动回退 0 档);不拼 URL、不自行接
99
- `GLTFLoader` / `KTX2Loader`、也不判来源与贴图形态。`withGlbLod` / `pickGlbTextureVariant` /
100
- `glbCompressedTextureUrlModifier` 仅供自定义加载管线,普通玩法不要调用。
101
- 仓库内 API 与示例入口见 [game-runtime 维护说明](../../tests/game-runtime/README.md)。
102
-
103
- `vendor/core-manager-three` 是旧平台检查所需的空包,业务不导入;`vendor/run.sh` 是空操作。
104
- vendor 模式保留其 `package.json` 与 `src/index.ts`;npm 模式可由平台清理 vendor。
105
- 未带 `game-runtime.json` 的旧项目不会由导出脚本自动接入新 SDK,也不会清空原参数清单;
106
- 仍依赖 CoreManager 的旧游戏须明确迁移,不能以空包替换。
7
+ runtime/lightgame/1.1.0 是本模板的固定运行库。普通游戏开发使用现有声明与接口;修改 Runtime 时必须单独评审、测试并维护完整性清单。
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "lightgame-js-three-template",
2
+ "name": "craft-js3d-template",
3
3
  "private": true,
4
4
  "version": "1.0.0",
5
5
  "type": "module",
@@ -10,7 +10,6 @@
10
10
  "preview": "vite preview",
11
11
  "typecheck": "tsc --noEmit",
12
12
  "runtime:verify": "node runtime/lightgame/1.1.0/tooling/cli.mjs verify",
13
- "runtime:refresh": "node scripts/refresh-runtime.mjs",
14
13
  "config:export": "node scripts/config-export.mjs"
15
14
  },
16
15
  "dependencies": {
@@ -0,0 +1,106 @@
1
+ // 资源地址归一化的唯一实现。只改 https://file.craft.qq.com 和相对路径:
2
+ // 库资源收成 Game/,其它路径把百分号编码解回中文,相对路径保留原前缀。
3
+ // UTF-8 与 GBK 都能解时,只有 GBK 得到汉字而 UTF-8 不是汉字才用 GBK。
4
+
5
+ function percentEncodedBytes(text) {
6
+ const bytes = [];
7
+ let index = 0;
8
+ while (index < text.length) {
9
+ if (text[index] === '%' && /^[0-9A-Fa-f]{2}$/.test(text.slice(index + 1, index + 3))) {
10
+ bytes.push(Number.parseInt(text.slice(index + 1, index + 3), 16));
11
+ index += 3;
12
+ continue;
13
+ }
14
+ const code = text.charCodeAt(index);
15
+ if (code > 0x7f) return null;
16
+ bytes.push(code);
17
+ index += 1;
18
+ }
19
+ return bytes;
20
+ }
21
+
22
+ function hasCjk(text) {
23
+ return /[\u3400-\u9fff]/.test(text);
24
+ }
25
+
26
+ function decodeGbk(bytes) {
27
+ try {
28
+ return new TextDecoder('gbk', { fatal: true }).decode(Uint8Array.from(bytes));
29
+ } catch {
30
+ return null;
31
+ }
32
+ }
33
+
34
+ function decodeResourcePath(text) {
35
+ const bytes = percentEncodedBytes(text);
36
+ if (!bytes) return text;
37
+ let utf8 = null;
38
+ try {
39
+ utf8 = decodeURIComponent(text);
40
+ } catch {
41
+ utf8 = null;
42
+ }
43
+ const gbk = bytes.some((byte) => byte >= 0x80) ? decodeGbk(bytes) : null;
44
+ if (utf8 && gbk && utf8 !== gbk) {
45
+ return hasCjk(gbk) && !hasCjk(utf8) ? gbk : utf8;
46
+ }
47
+ return utf8 ?? gbk ?? text;
48
+ }
49
+
50
+ function hasNonAscii(text) {
51
+ for (let index = 0; index < text.length; index += 1) {
52
+ if (text.charCodeAt(index) > 0x7f) return true;
53
+ }
54
+ return false;
55
+ }
56
+
57
+ function restoreGamePath(source) {
58
+ let path = source;
59
+ try {
60
+ const url = new URL(source);
61
+ if (url.protocol !== 'https:' || url.hostname !== 'file.craft.qq.com') return source;
62
+ path = url.pathname;
63
+ } catch { /* 相对路径 */ }
64
+ if (!/^\/?Game\//.test(path)) return source;
65
+ const decoded = decodeResourcePath(path.startsWith('/') ? path : `/${path}`).replace(/^\/+/, '');
66
+ return decoded.startsWith('Game/') ? decoded : source;
67
+ }
68
+
69
+ function decodeRelativePath(source) {
70
+ if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(source)) return source;
71
+ const parts = source.match(/^([^?#]*)([?#].*)?$/);
72
+ if (!parts || !parts[1].includes('%')) return source;
73
+ const decoded = decodeResourcePath(parts[1]);
74
+ if (decoded === parts[1] || !hasNonAscii(decoded)) return source;
75
+ const rest = parts[2] ?? '';
76
+ if (/^\/?Game\//.test(decoded)) return decoded.replace(/^\/+/, '') + rest;
77
+ return decoded + rest;
78
+ }
79
+
80
+ function decodeAbsoluteUrl(source) {
81
+ let url;
82
+ try {
83
+ url = new URL(source);
84
+ } catch {
85
+ return source;
86
+ }
87
+ if (url.protocol !== 'https:' || url.hostname !== 'file.craft.qq.com') return source;
88
+ const decodedPath = decodeResourcePath(url.pathname);
89
+ if (decodedPath === url.pathname || !hasNonAscii(decodedPath)) return source;
90
+ const href = url.href;
91
+ const origin = url.origin;
92
+ if (!href.startsWith(origin)) return source;
93
+ const rest = href.slice(origin.length);
94
+ if (!rest.startsWith(url.pathname)) return source;
95
+ return origin + decodedPath + rest.slice(url.pathname.length);
96
+ }
97
+
98
+ export function toPanelResourcePath(value) {
99
+ const source = String(value ?? '').trim();
100
+ if (!source) return source;
101
+ const restored = restoreGamePath(source);
102
+ if (restored.startsWith('Game/')) return restored;
103
+ const absolute = decodeAbsoluteUrl(source);
104
+ if (absolute !== source) return absolute;
105
+ return decodeRelativePath(source);
106
+ }
@@ -1,40 +1,15 @@
1
- // 场景资产清单环(第 8 步 ⑥ 环):把源码里场景编辑器写入的云资产引用登记进
2
- // `configs/scene_assets.json`。
3
- //
4
- // 平台口径:**configs 资产清单是打包收录资产的唯一依据**——源码里的 `/Game/` 引用若未登记,
5
- // 打包直接忽略,运行时不可见,而 `vite build` / `tsc` 全绿(静默故障)。
6
- //
7
- // 三方写同一份清单,必须同键同形 + 同判等口径,否则会分叉出重复条目或静默漏登记:
8
- // ① 场景编辑器退出保存时写(编辑器仓 `editor/src/core/SceneAssetManifest.ts`;
9
- // 宿主侧另有一份等价实现 `registerSceneAssets` 兜底);
10
- // ② 构建期 export-config 写(本文件,兜住「不经编辑器写入」的路径:转换期生成、
11
- // 手改 scene.ts、旧工程);
12
- // ③ 键派生必须与 ①② 逐字一致(`sanitizeAssetKey`);**判等一律比 `value`(资源地址)**,
13
- // 键只作标识——派生有损,比键会把两个不同资产判成同一个。
14
- //
15
- // 只登记 `/Game/...`:编辑器资产面板的 Path 全是这个形态,CDN 相对路径(`test1/...`)
16
- // 由 configs 的既有链路管,不在这里重复登记。
17
- // 清单保持编辑器的包装格式;导出前同步同名 controls,把资源声明挂到 value 叶子上。
1
+ // Register scene GLB references in the platform resource manifest.
18
2
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
19
3
  import { dirname, join } from 'node:path';
20
4
 
21
- /** 只认编辑器写进 scene.ts 的 glb item 形态:`source: { kind: 'glb', url: '/Game/...' }` */
5
+ /** 识别 scene.ts 的 GLB source 形态:`source: { kind: 'glb', url: '/Game/...' }` */
22
6
  const SCENE_GLB_URL_RE = /kind:\s*['"]glb['"]\s*,\s*url:\s*['"]([^'"]+)['"]/g;
23
7
 
24
8
  /** JSON key 白名单:runtime 的 assertKey 会因含点号直接中断 vite build */
25
9
  const UNSAFE_KEY_RE = /[^0-9A-Za-z\u4e00-\u9fa5]/g;
26
10
  const RESERVED_KEYS = new Set(['__proto__', 'prototype', 'constructor']);
27
11
 
28
- /**
29
- * 由资源 url 确定性派生清单键。
30
- *
31
- * 与场景编辑器 / 宿主逐字同源(编辑器 `SceneAssetManifest.ts`、宿主侧各有一份等价
32
- * 的 `sanitizeAssetKey`)。改这里必须三处一起改,否则同一份 scene.ts 会派生两个键、
33
- * 清单里出现重复条目。
34
- *
35
- * 两条硬约束来自 runtime `platform/config.mjs` 的 `assertKey`:
36
- * 键非空、**不含点号**;schema 由平台拼成 `<文件名>.<顶层键>`,所以绝不能自带 `scene.` 前缀。
37
- */
12
+ // Deterministic keys; compare resources by URL because key normalization is lossy.
38
13
  export function sanitizeAssetKey(url) {
39
14
  let key = String(url || '')
40
15
  .replace(/^\/Game\//, '')