@craft_eco/craft-mcp 0.1.18 → 0.1.22
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.
- package/README.md +45 -8
- package/bin/craft-mcp.mjs +14 -1
- package/dist-server/core/connector-auth.mjs +3 -3
- package/dist-server/game-workflow/asset-formats.mjs +25 -64
- package/dist-server/game-workflow/asset-import.mjs +83 -67
- package/dist-server/game-workflow/assets.mjs +81 -9
- package/dist-server/game-workflow/capture-worker.mjs +1 -1
- package/dist-server/game-workflow/check.mjs +1 -1
- package/dist-server/game-workflow/draft-archive.mjs +53 -53
- package/dist-server/game-workflow/draft-bindings.mjs +35 -35
- package/dist-server/game-workflow/draft-uploads.mjs +225 -207
- package/dist-server/game-workflow/engines.mjs +2 -2
- package/dist-server/game-workflow/library-assets.mjs +16 -5
- package/dist-server/game-workflow/library-candidates.mjs +2 -1
- package/dist-server/game-workflow/library-catalog.mjs +2 -2
- package/dist-server/game-workflow/publication-materials.mjs +92 -67
- package/dist-server/game-workflow/publications.mjs +164 -148
- package/dist-server/game-workflow/publish-capture-worker.mjs +57 -57
- package/dist-server/game-workflow/publish-capture.mjs +75 -75
- package/dist-server/game-workflow/resource-catalog.mjs +16 -13
- package/dist-server/mcp/control-panel.html +2 -2
- package/dist-server/mcp/control-panel.mjs +59 -59
- package/dist-server/mcp/publication-page.html +86 -86
- package/dist-server/mcp/publication-page.mjs +375 -347
- package/dist-server/mcp/publication-preview.mjs +62 -48
- package/dist-server/mcp/publication-tools.mjs +22 -22
- package/dist-server/mcp/publish-panel.mjs +205 -191
- package/dist-server/mcp/server.mjs +312 -312
- package/dist-server/upstream/craft-aigc.mjs +182 -169
- package/dist-server/upstream/library-url.mjs +3 -5
- package/dist-server/upstream/publication-transport.mjs +101 -81
- package/dist-server/upstream/resource-path.mjs +17 -0
- package/package.json +2 -2
- package/resources/craft-game-maker/SKILL.md +71 -69
- package/resources/craft-game-maker/js.md +6 -5
- package/resources/craft-game-maker/js3d.md +6 -5
- package/resources/game_visual_qa.mjs +9 -3
- package/resources/js/context/.role/AGENTS_DESIGN.md +9 -0
- package/resources/js/context/AGENTS.md +112 -0
- package/resources/js/context/agents/aigc-asset.md +168 -0
- package/resources/js/context/hooks/hooks.json +14 -20
- package/resources/js/context/knowledge/AigcEnabled.md +49 -41
- package/resources/js/context/knowledge/AigcWiring.md +200 -200
- package/resources/js/context/knowledge/AssetUrl.md +24 -24
- package/resources/js/context/knowledge/FrontendComponents.md +17 -23
- package/resources/js/context/knowledge/Lifecycle.md +32 -27
- package/resources/js/context/knowledge/MobileAdaptation.md +73 -0
- package/resources/js/context/knowledge/MobileAdapted.md +36 -0
- package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -114
- package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +115 -115
- package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +392 -392
- package/resources/js/context/knowledge/PlatformServices.md +190 -184
- package/resources/js/context/knowledge/ProjectDisplayConfig.md +35 -0
- package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -242
- package/resources/js/context/knowledge/Ui.md +11 -11
- package/resources/js/context/knowledge/UiEditorCompat.md +21 -21
- package/resources/js/context/rules/MultiplayerCapability.md +23 -23
- package/resources/js/context/rules/MultiplayerRoomEntryUX.md +63 -63
- package/resources/js/context/rules/PlatformBoundaryModules.md +44 -43
- package/resources/js/context/rules/preview_ready.md +8 -0
- package/resources/js/context/skills/aigc-generate/SKILL.md +149 -301
- package/resources/js/context/skills/aigc-generate/knowledge/audio.md +39 -39
- package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +26 -14
- package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +132 -129
- package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +53 -54
- package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +52 -50
- package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +191 -201
- package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +55 -53
- package/resources/js/context/skills/asset-search/SKILL.md +69 -73
- package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +62 -62
- package/resources/js/context/skills/asset-search/scripts/config.json +5 -5
- package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +125 -125
- package/resources/js/context/skills/asset-search/scripts/search.mjs +760 -749
- package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +657 -723
- package/resources/js/context/skills/asset-search/strategies/anim2d.md +42 -0
- package/resources/js/context/skills/asset-search/strategies/audio.md +34 -34
- package/resources/js/context/skills/asset-search/strategies/effect2d.md +31 -31
- package/resources/js/context/skills/asset-search/strategies/texture-prop.md +22 -22
- package/resources/js/context/skills/asset-search/strategies/ui-common.md +40 -40
- package/resources/js/context/skills/asset-search/strategies/ui-style.md +28 -28
- package/resources/js/context/skills/export-config/SKILL.md +28 -20
- package/resources/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/js/context/skills/{lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform → export-config/assets/tooling}/config.d.mts +19 -19
- package/resources/js/context/skills/{lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform → export-config/assets/tooling}/config.mjs +1 -1
- package/resources/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/js/context/skills/export-config/scripts/assert-asset-wiring.mjs +72 -72
- package/resources/js/context/skills/export-config/scripts/export-config.mjs +46 -43
- package/resources/js/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -106
- package/resources/js/context/skills/export-config/scripts/sync-asset-controls.mjs +352 -351
- package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +161 -163
- package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +93 -92
- package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +7 -7
- package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +22 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/platform/platform-capture-video.mjs +227 -227
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/platform/platform-service.d.mts +31 -25
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/platform/platform.d.mts +79 -79
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/platform/platform.mjs +29 -29
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/tools/assets.d.mts +24 -24
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/tools/assets.mjs +2 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/tools/astc.d.mts +10 -10
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/{1.0.0 → 1.1.0}/tools/astc.mjs +1 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +37 -32
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +50 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +156 -121
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +249 -254
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +87 -99
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +2 -14
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +185 -172
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +294 -165
- package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +20 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +5 -4
- package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +159 -109
- package/resources/js/context/skills/mobile-adaptation/SKILL.md +277 -260
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +50 -50
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +862 -881
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -92
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +254 -0
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -245
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +135 -134
- package/resources/js/context/skills/mobile-adaptation/references/input-config.md +342 -311
- package/resources/js/context/skills/mobile-adaptation/references/verification.md +140 -106
- package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +11 -0
- package/resources/js/context/skills/mobile-compat-qa/SKILL.md +53 -0
- package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +23 -0
- package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +20 -0
- package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +19 -0
- package/resources/js/context/skills/optimization-suggestions/SKILL.md +89 -89
- package/resources/js/context/skills/platform-services/SKILL.md +101 -94
- package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +465 -783
- package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +57 -57
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-session.mjs +208 -0
- package/resources/js/context/skills/platform-services/assets/modules/identity/shared.mjs +37 -0
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -39
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -1
- package/resources/js/context/skills/platform-services/assets/modules/log.ts +35 -35
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +61 -0
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +52 -0
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +30 -0
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +89 -0
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +47 -0
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +31 -25
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +272 -1
- package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +49 -49
- package/resources/js/context/skills/platform-services/assets/modules/save.mjs +1 -1
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -7
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -264
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -39
- package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +139 -139
- package/resources/js/context/skills/platform-services/references/api_reference.md +18 -18
- package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +96 -0
- package/resources/js/context/skills/platform-services/scripts/install.mjs +148 -134
- package/resources/js/context/skills/resolution-adaptation/SKILL.md +47 -202
- package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +156 -121
- package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +249 -254
- package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +98 -98
- package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +200 -200
- package/resources/js/context/skills/resolution-adaptation/references/audit.md +31 -0
- package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +40 -0
- package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +18 -0
- package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +15 -134
- package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +34 -0
- package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +38 -119
- package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +55 -0
- package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +448 -338
- package/resources/js/context/skills/scene-editor-compat/SKILL.md +94 -94
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +13 -13
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +6 -6
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +25 -25
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +18 -18
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +7 -7
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +42 -42
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +144 -144
- package/resources/js/context/skills/scene-editor-compat/docs/contract.md +330 -330
- package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +64 -64
- package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +28 -28
- package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +47 -47
- package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +64 -64
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +38 -38
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +9 -9
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +59 -59
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +30 -30
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +66 -66
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +20 -20
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +26 -26
- package/resources/js/context/skills/scene-editor-compat/references/contract.md +73 -73
- package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +162 -162
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +853 -853
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +173 -173
- package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +427 -427
- package/resources/js/context/skills/scene-editor-compat/version.json +1 -1
- package/resources/js/context/skills/ui-editor-compat/SKILL.md +48 -48
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -35
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +74 -74
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -60
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -45
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -265
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +7 -7
- package/resources/js/context/skills/ui-editor-compat/references/contract.md +132 -132
- package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -327
- package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -80
- package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -84
- package/resources/js/context/skills/version-update/SKILL.md +192 -192
- package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -129
- package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +159 -159
- package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +157 -157
- package/resources/js/context/skills/visual-qa/SKILL.md +36 -36
- package/resources/js/context/version/version.json +1 -1
- package/resources/js/project/README.md +99 -99
- package/resources/js/project/SPEC/readme.md +6 -6
- package/resources/js/project/configs/assets.json +1 -1
- package/resources/js/project/configs/game.controls.json +3 -3
- package/resources/js/project/configs/game.json +3 -3
- package/resources/js/project/game-runtime.json +2 -2
- package/resources/js/project/{projectDisplayInfo.json → game.config.json} +7 -7
- package/resources/js/project/index.html +20 -20
- package/resources/js/project/package.json +23 -23
- package/resources/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
- package/resources/js/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/js/project/scripts/config-export.mjs +37 -32
- package/resources/js/project/scripts/refresh-runtime.mjs +50 -50
- package/resources/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/js/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/js/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/js/project/src/display/ui-stage.ts +156 -121
- package/resources/js/project/src/display/viewport.ts +249 -254
- package/resources/js/project/src/main.ts +87 -99
- package/resources/js/project/src/platform.ts +2 -14
- package/resources/js/project/src/scenes/LoadScene.ts +89 -89
- package/resources/js/project/src/scenes/PlayScene.ts +17 -17
- package/resources/js/project/src/screenUi.ts +185 -172
- package/resources/js/project/src/style.css +294 -165
- package/resources/js/project/tsconfig.json +20 -20
- package/resources/js/project/unified_data_control_config.json +20 -20
- package/resources/js/project/vendor/core-manager-js/src/.versions.json +42 -42
- package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +41 -41
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +93 -90
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +203 -203
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +106 -106
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +25 -25
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +21 -21
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +65 -65
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +340 -340
- package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +87 -87
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +92 -92
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +271 -271
- package/resources/js/project/vendor/core-manager-js/src/index.ts +31 -31
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +81 -81
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +43 -43
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +32 -32
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +141 -141
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +20 -20
- package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +183 -183
- package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +304 -304
- package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +351 -351
- package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +180 -180
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +13 -13
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +14 -14
- package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +68 -68
- package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +433 -433
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +118 -118
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +444 -444
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +485 -485
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +66 -66
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +149 -149
- package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +9 -9
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +29 -29
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +88 -88
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +122 -122
- package/resources/js/project/vendor/core-manager-js/src/runtime.ts +24 -24
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +318 -318
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +151 -151
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +235 -235
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +98 -98
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +94 -94
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +209 -209
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +106 -106
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +341 -341
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +68 -68
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +236 -236
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +22 -22
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +29 -29
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +197 -197
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +9 -9
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +555 -555
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +112 -112
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +178 -178
- package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +246 -246
- package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +139 -139
- package/resources/js/project/vendor/core-manager-js/tsconfig.json +15 -15
- package/resources/js/project/vendor/run.sh +4 -107
- package/resources/js/project/version/craft_feature_version.json +42 -42
- package/resources/js/project/version/project_feature_version.json +11 -11
- package/resources/js/project/vite.config.ts +5 -4
- package/resources/js3d/context/.role/AGENTS_DESIGN.md +9 -0
- package/resources/js3d/context/AGENTS.md +95 -0
- package/resources/js3d/context/hooks/hooks.json +14 -20
- package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +75 -87
- package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +69 -69
- package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +42 -42
- package/resources/js3d/context/knowledge/FrontendComponents.md +19 -23
- package/resources/js3d/context/knowledge/MobileAdaptation.md +73 -0
- package/resources/js3d/context/knowledge/MobileAdapted.md +36 -0
- package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -114
- package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +117 -117
- package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +430 -430
- package/resources/js3d/context/knowledge/PlatformServices.md +190 -162
- package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +35 -0
- package/resources/js3d/context/knowledge/Runtime.md +34 -30
- package/resources/js3d/context/knowledge/SceneEditorCompat.md +35 -34
- package/resources/js3d/context/knowledge/StepByStep.md +21 -21
- package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -242
- package/resources/js3d/context/knowledge/UiEditorCompat.md +21 -21
- package/resources/js3d/context/rules/MultiplayerCapability.md +27 -27
- package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +63 -63
- package/resources/js3d/context/rules/PlatformBoundaryModules.md +44 -43
- package/resources/js3d/context/rules/preview_ready.md +8 -0
- package/resources/js3d/context/skills/aigc-integration/SKILL.md +172 -176
- package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +70 -0
- package/resources/js3d/context/skills/aigc-integration/callback.md +77 -56
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +23 -22
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +38 -38
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +72 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +33 -33
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +36 -36
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +37 -37
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +35 -35
- package/resources/js3d/context/skills/asset-search/SKILL.md +178 -159
- package/resources/js3d/context/skills/asset-search/references/resource-config.md +99 -56
- package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +58 -0
- package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +62 -62
- package/resources/js3d/context/skills/asset-search/scripts/config.json +235 -213
- package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +905 -885
- package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +79 -79
- package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +74 -74
- package/resources/js3d/context/skills/asset-search/scripts/search.mjs +637 -597
- package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +667 -0
- package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +42 -0
- package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +31 -0
- package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +92 -0
- package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +89 -0
- package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +143 -0
- package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +90 -0
- package/resources/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
- package/resources/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
- package/resources/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
- package/resources/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
- package/resources/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
- package/resources/js3d/context/skills/export-config/SKILL.md +20 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/js3d/context/skills/export-config/scripts/assert-asset-wiring.mjs +97 -83
- package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +56 -53
- package/resources/js3d/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -106
- package/resources/js3d/context/skills/export-config/scripts/sync-asset-controls.mjs +327 -325
- package/resources/js3d/context/skills/export-config/scripts/sync-scene-assets.mjs +216 -181
- package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +161 -163
- package/resources/js3d/context/skills/game-art-style/SKILL.md +60 -60
- package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +38 -38
- package/resources/js3d/context/skills/game-art-style/references/construction.md +111 -111
- package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +105 -105
- package/resources/js3d/context/skills/game-art-style/references/sources.md +25 -25
- package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +175 -175
- package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +168 -168
- package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +191 -191
- package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +165 -165
- package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +173 -173
- package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +185 -185
- package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +181 -181
- package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +189 -189
- package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +88 -88
- package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +301 -284
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +104 -104
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +933 -952
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -92
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +254 -0
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -245
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +257 -256
- package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +342 -311
- package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +140 -106
- package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +11 -0
- package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +53 -0
- package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +23 -0
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +10 -0
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +20 -0
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +19 -0
- package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +74 -74
- package/resources/js3d/context/skills/performance-audit/SKILL.md +166 -0
- package/resources/js3d/context/skills/performance-audit/references/case-notes.md +93 -0
- package/resources/js3d/context/skills/performance-audit/references/rules.md +183 -0
- package/resources/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
- package/resources/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
- package/resources/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
- package/resources/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
- package/resources/js3d/context/skills/platform-services/SKILL.md +101 -94
- package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +465 -783
- package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +57 -57
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-session.mjs +208 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/shared.mjs +37 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -39
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -1
- package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +35 -35
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +61 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +52 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +30 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +89 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +47 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +31 -25
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +272 -1
- package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +49 -49
- package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +1 -1
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -7
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -264
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -39
- package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +139 -139
- package/resources/js3d/context/skills/platform-services/references/api_reference.md +18 -18
- package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +96 -0
- package/resources/js3d/context/skills/platform-services/scripts/install.mjs +148 -134
- package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +46 -170
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +156 -121
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +239 -244
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +129 -127
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +188 -188
- package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +31 -0
- package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +40 -0
- package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +18 -0
- package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +15 -124
- package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +34 -0
- package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +38 -117
- package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +448 -338
- package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +599 -599
- package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +141 -141
- package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +92 -92
- package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +125 -125
- package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +113 -113
- package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +1187 -1187
- package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +53 -52
- package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +4 -4
- package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +94 -94
- package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +50 -50
- package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +105 -105
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +147 -147
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +79 -79
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +56 -56
- package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +51 -51
- package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +55 -55
- package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +78 -78
- package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +84 -84
- package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +117 -117
- package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +4 -4
- package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +238 -238
- package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +59 -59
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -35
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +61 -61
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -60
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -45
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -265
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +7 -7
- package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +110 -110
- package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -327
- package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -80
- package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -84
- package/resources/js3d/context/skills/version-update/SKILL.md +191 -191
- package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -129
- package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +159 -159
- package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +157 -157
- package/resources/js3d/context/version/version.json +1 -1
- package/resources/js3d/project/README.md +106 -100
- package/resources/js3d/project/configs/game.controls.json +3 -3
- package/resources/js3d/project/configs/game.json +3 -3
- package/resources/js3d/project/game-runtime.json +2 -2
- package/resources/js3d/project/{projectDisplayInfo.json → game.config.json} +7 -7
- package/resources/js3d/project/index.html +12 -12
- package/resources/js3d/project/package.json +24 -24
- package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +2 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +2 -12
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +21 -29
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
- package/resources/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
- package/resources/js3d/project/scripts/config-export.mjs +37 -32
- package/resources/js3d/project/scripts/refresh-runtime.mjs +50 -50
- package/resources/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/js3d/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/js3d/project/src/display/ui-stage.ts +156 -121
- package/resources/js3d/project/src/display/viewport.ts +239 -244
- package/resources/js3d/project/src/main.ts +85 -83
- package/resources/js3d/project/src/platform.ts +2 -14
- package/resources/js3d/project/src/style.css +83 -17
- package/resources/js3d/project/tsconfig.json +20 -20
- package/resources/js3d/project/unified_data_control_config.json +20 -20
- package/resources/js3d/project/vendor/core-manager-three/package.json +12 -12
- package/resources/js3d/project/vendor/core-manager-three/src/index.ts +2 -2
- package/resources/js3d/project/vendor/run.sh +4 -4
- package/resources/js3d/project/version/craft_feature_version.json +42 -42
- package/resources/js3d/project/version/project_feature_version.json +11 -11
- package/resources/js3d/project/vite.config.ts +5 -4
- package/vendor/agent-cli/dist/runtime-tools/ue/blender-cook-assets.cjs +19 -19
- package/vendor/agent-cli/dist/runtime-tools/ue/tool-manifest.json +1 -1
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts +1 -1
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.js +15 -6
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/native-source.d.ts +3 -0
- package/vendor/agent-cli/dist/src/artifacts/native-source.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/native-source.js +13 -0
- package/vendor/agent-cli/dist/src/artifacts/native-source.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts +13 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +300 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +4 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.js +20 -7
- package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +8 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +64 -37
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/restore-permissions.d.ts +27 -0
- package/vendor/agent-cli/dist/src/artifacts/restore-permissions.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/restore-permissions.js +112 -0
- package/vendor/agent-cli/dist/src/artifacts/restore-permissions.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/restore.d.ts +9 -0
- package/vendor/agent-cli/dist/src/artifacts/restore.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/restore.js +140 -59
- package/vendor/agent-cli/dist/src/artifacts/restore.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +7 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +145 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts +6 -2
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/static.js +100 -28
- package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-protocol.js +6 -3
- package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -1
- package/vendor/agent-cli/dist/src/component/browser-queue.d.ts +55 -0
- package/vendor/agent-cli/dist/src/component/browser-queue.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/browser-queue.js +63 -0
- package/vendor/agent-cli/dist/src/component/browser-queue.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/execution.d.ts +4 -0
- package/vendor/agent-cli/dist/src/component/execution.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/component/execution.js +16 -4
- package/vendor/agent-cli/dist/src/component/execution.js.map +1 -1
- package/vendor/agent-cli/dist/src/component/isolated-launcher.d.ts +2 -0
- package/vendor/agent-cli/dist/src/component/isolated-launcher.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/isolated-launcher.js +76 -0
- package/vendor/agent-cli/dist/src/component/isolated-launcher.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/isolated-preload.d.ts +2 -0
- package/vendor/agent-cli/dist/src/component/isolated-preload.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/isolated-preload.js +27 -0
- package/vendor/agent-cli/dist/src/component/isolated-preload.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts +0 -5
- package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/component/platform-access/server.js +9 -3
- package/vendor/agent-cli/dist/src/component/platform-access/server.js.map +1 -1
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js +5 -0
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js.map +1 -1
- package/vendor/agent-cli/dist/src/component/process-diagnostics.d.ts +25 -0
- package/vendor/agent-cli/dist/src/component/process-diagnostics.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/process-diagnostics.js +137 -0
- package/vendor/agent-cli/dist/src/component/process-diagnostics.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/process-isolation.d.ts +10 -0
- package/vendor/agent-cli/dist/src/component/process-isolation.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/process-isolation.js +59 -0
- package/vendor/agent-cli/dist/src/component/process-isolation.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/proxied-fetch.d.ts +2 -0
- package/vendor/agent-cli/dist/src/component/proxied-fetch.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/proxied-fetch.js +46 -0
- package/vendor/agent-cli/dist/src/component/proxied-fetch.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/public-egress.d.ts +17 -0
- package/vendor/agent-cli/dist/src/component/public-egress.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/public-egress.js +246 -0
- package/vendor/agent-cli/dist/src/component/public-egress.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-publication-lock.d.ts +3 -0
- package/vendor/agent-cli/dist/src/context/cache-publication-lock.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-publication-lock.js +68 -0
- package/vendor/agent-cli/dist/src/context/cache-publication-lock.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-publication.d.ts +1 -1
- package/vendor/agent-cli/dist/src/context/cache-publication.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/cache-publication.js +8 -4
- package/vendor/agent-cli/dist/src/context/cache-publication.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/context-cache.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/context-cache.js +5 -2
- package/vendor/agent-cli/dist/src/context/context-cache.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/context-project.d.ts +45 -4
- package/vendor/agent-cli/dist/src/context/context-project.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/context-project.js +157 -16
- package/vendor/agent-cli/dist/src/context/context-project.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/context-scoped-source.d.ts +13 -0
- package/vendor/agent-cli/dist/src/context/context-scoped-source.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-scoped-source.js +78 -0
- package/vendor/agent-cli/dist/src/context/context-scoped-source.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts +14 -0
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js +110 -44
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/local-skills.d.ts +2 -0
- package/vendor/agent-cli/dist/src/context/local-skills.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/local-skills.js +36 -19
- package/vendor/agent-cli/dist/src/context/local-skills.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/member-context.d.ts +2 -1
- package/vendor/agent-cli/dist/src/context/member-context.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/member-context.js +17 -9
- package/vendor/agent-cli/dist/src/context/member-context.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts +9 -1
- package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/script-dependencies.js +22 -6
- package/vendor/agent-cli/dist/src/context/script-dependencies.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts +1 -1
- package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/shared-cache-build.js +1 -0
- package/vendor/agent-cli/dist/src/context/shared-cache-build.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/team-knowledge.js +11 -2
- package/vendor/agent-cli/dist/src/context/team-knowledge.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/template-cache.d.ts +5 -1
- package/vendor/agent-cli/dist/src/context/template-cache.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/template-cache.js +2 -2
- package/vendor/agent-cli/dist/src/context/template-cache.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/template-refresh.d.ts +6 -0
- package/vendor/agent-cli/dist/src/context/template-refresh.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-refresh.js +45 -0
- package/vendor/agent-cli/dist/src/context/template-refresh.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-seed.d.ts +16 -3
- package/vendor/agent-cli/dist/src/context/template-seed.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/template-seed.js +71 -19
- package/vendor/agent-cli/dist/src/context/template-seed.js.map +1 -1
- package/vendor/agent-cli/dist/src/context/template-sync.d.ts +11 -0
- package/vendor/agent-cli/dist/src/context/template-sync.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-sync.js +167 -0
- package/vendor/agent-cli/dist/src/context/template-sync.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts +3 -1
- package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/context/user-skill-context.js +41 -2
- package/vendor/agent-cli/dist/src/context/user-skill-context.js.map +1 -1
- package/vendor/agent-cli/dist/src/index.d.ts +5 -1
- package/vendor/agent-cli/dist/src/index.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/index.js +5 -1
- package/vendor/agent-cli/dist/src/index.js.map +1 -1
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts +2 -2
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js +4 -2
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js.map +1 -1
- package/vendor/agent-cli/dist/src/lifecycle/hook-command.js +1 -1
- package/vendor/agent-cli/dist/src/lifecycle/hook-command.js.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts +24 -0
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js +6 -0
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +71 -4
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +13 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -1
- package/vendor/agent-cli/dist/src/security/command-translate.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/security/command-translate.js +4 -0
- package/vendor/agent-cli/dist/src/security/command-translate.js.map +1 -1
- package/vendor/agent-cli/dist/src/security/guard.d.ts +4 -0
- package/vendor/agent-cli/dist/src/security/guard.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/security/guard.js +17 -5
- package/vendor/agent-cli/dist/src/security/guard.js.map +1 -1
- package/vendor/agent-cli/dist/src/security/mount-table.d.ts +11 -2
- package/vendor/agent-cli/dist/src/security/mount-table.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/security/mount-table.js +92 -5
- package/vendor/agent-cli/dist/src/security/mount-table.js.map +1 -1
- package/vendor/agent-cli/dist/src/security/tool-scope.d.ts +4 -1
- package/vendor/agent-cli/dist/src/security/tool-scope.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/security/tool-scope.js +38 -4
- package/vendor/agent-cli/dist/src/security/tool-scope.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.d.ts +20 -0
- package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.js +28 -5
- package/vendor/agent-cli/dist/src/session/client.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/custom-context.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/custom-context.js +12 -6
- package/vendor/agent-cli/dist/src/session/custom-context.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/execution-recovery.d.ts +9 -0
- package/vendor/agent-cli/dist/src/session/execution-recovery.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/execution-recovery.js +49 -0
- package/vendor/agent-cli/dist/src/session/execution-recovery.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/expert-definition.d.ts +4 -0
- package/vendor/agent-cli/dist/src/session/expert-definition.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/expert-definition.js +20 -0
- package/vendor/agent-cli/dist/src/session/expert-definition.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-config.js +1 -1
- package/vendor/agent-cli/dist/src/session/link-config.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.d.ts +1 -0
- package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.js +19 -2
- package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-environment.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-environment.js +11 -0
- package/vendor/agent-cli/dist/src/session/process-environment.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-lifecycle.d.ts +5 -0
- package/vendor/agent-cli/dist/src/session/process-lifecycle.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-lifecycle.js +18 -0
- package/vendor/agent-cli/dist/src/session/process-lifecycle.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts +4 -0
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-observability.js +14 -0
- package/vendor/agent-cli/dist/src/session/process-observability.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-request.d.ts +7 -6
- package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.js +66 -87
- package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-restore.d.ts +4 -0
- package/vendor/agent-cli/dist/src/session/process-restore.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-restore.js +21 -0
- package/vendor/agent-cli/dist/src/session/process-restore.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-summary-output.d.ts +15 -0
- package/vendor/agent-cli/dist/src/session/process-summary-output.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-summary-output.js +46 -0
- package/vendor/agent-cli/dist/src/session/process-summary-output.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-workspace.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/process-workspace.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-workspace.js +21 -0
- package/vendor/agent-cli/dist/src/session/process-workspace.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/reference-tools.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/reference-tools.js +3 -2
- package/vendor/agent-cli/dist/src/session/reference-tools.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-setup.d.ts +2 -0
- package/vendor/agent-cli/dist/src/session/run-setup.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-setup.js +35 -14
- package/vendor/agent-cli/dist/src/session/run-setup.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +5 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.js +13 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/team-persistence.js +1 -1
- package/vendor/agent-cli/dist/src/session/team-persistence.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/tool-scheduler.js +33 -23
- package/vendor/agent-cli/dist/src/session/tool-scheduler.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/user-choice-policy.d.ts +25 -0
- package/vendor/agent-cli/dist/src/session/user-choice-policy.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-choice-policy.js +70 -0
- package/vendor/agent-cli/dist/src/session/user-choice-policy.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-choice.d.ts +3 -2
- package/vendor/agent-cli/dist/src/session/user-choice.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/user-choice.js +30 -9
- package/vendor/agent-cli/dist/src/session/user-choice.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/user-skill-compatibility.d.ts +4 -0
- package/vendor/agent-cli/dist/src/session/user-skill-compatibility.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-skill-compatibility.js +25 -0
- package/vendor/agent-cli/dist/src/session/user-skill-compatibility.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.js +2 -1
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/user-skill-prompt.d.ts +4 -0
- package/vendor/agent-cli/dist/src/session/user-skill-prompt.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-skill-prompt.js +15 -0
- package/vendor/agent-cli/dist/src/session/user-skill-prompt.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/replace-file.d.ts +3 -0
- package/vendor/agent-cli/dist/src/shared/replace-file.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/replace-file.js +34 -0
- package/vendor/agent-cli/dist/src/shared/replace-file.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts +55 -4
- package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/shared/user-choice.d.ts +21 -2
- package/vendor/agent-cli/dist/src/shared/user-choice.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/command-executor.d.ts +3 -0
- package/vendor/agent-cli/dist/src/tools/command-executor.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/command-executor.js +42 -5
- package/vendor/agent-cli/dist/src/tools/command-executor.js.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program.js +46 -20
- package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -1
- package/vendor/agent-cli/dist/src/tools/file-ops.d.ts +10 -19
- package/vendor/agent-cli/dist/src/tools/file-ops.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/file-ops.js +11 -85
- package/vendor/agent-cli/dist/src/tools/file-ops.js.map +1 -1
- package/vendor/agent-cli/dist/src/tools/file-search.d.ts +29 -0
- package/vendor/agent-cli/dist/src/tools/file-search.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/file-search.js +98 -0
- package/vendor/agent-cli/dist/src/tools/file-search.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/file-stat.d.ts +9 -0
- package/vendor/agent-cli/dist/src/tools/file-stat.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/file-stat.js +29 -0
- package/vendor/agent-cli/dist/src/tools/file-stat.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/local-hands.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/local-hands.js +10 -2
- package/vendor/agent-cli/dist/src/tools/local-hands.js.map +1 -1
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts +3 -0
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js +3 -0
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js.map +1 -1
- package/resources/js/context/CLAUDE.md +0 -54
- package/resources/js/context/agents/aigc-manager.md +0 -91
- package/resources/js/context/knowledge/GameProbe.md +0 -74
- package/resources/js/context/skills/aigc-generate/scripts/apply-results.mjs +0 -83
- package/resources/js/context/skills/aigc-generate/scripts/config.json +0 -29
- package/resources/js/context/skills/aigc-generate/scripts/generate.mjs +0 -1016
- package/resources/js/context/skills/aigc-generate/scripts/lib/client.mjs +0 -228
- package/resources/js/context/skills/aigc-generate/scripts/lib/ledger.mjs +0 -119
- package/resources/js/context/skills/aigc-generate/scripts/lib/nstep-handoff.mjs +0 -100
- package/resources/js/context/skills/aigc-generate/scripts/lib/pipelines.mjs +0 -441
- package/resources/js/context/skills/aigc-generate/scripts/lib/queue.mjs +0 -283
- package/resources/js/context/skills/aigc-generate/scripts/lib/submit.mjs +0 -122
- package/resources/js/context/skills/aigc-generate/scripts/worker.mjs +0 -171
- package/resources/js/context/skills/asset-search/scripts/recalled_sprite_paths.mjs +0 -47
- package/resources/js/context/skills/asset-search/strategies/character2d.md +0 -33
- package/resources/js/context/skills/asset-search/strategies/texture-ui.md +0 -35
- package/resources/js/context/skills/display-info-setup/SKILL.md +0 -32
- package/resources/js/context/skills/display-info-setup/scripts/init_project.mjs +0 -38
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/release.json +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/release.json +0 -44
- package/resources/js/project/.gitattributes +0 -2
- package/resources/js/project/gameplay-probe.json +0 -37
- package/resources/js/project/package-lock.json +0 -1155
- package/resources/js3d/context/CLAUDE.md +0 -50
- package/resources/js3d/context/skills/aigc-integration/scripts/config.json +0 -3
- package/resources/js3d/context/skills/aigc-integration/scripts/lib/submit.mjs +0 -344
- package/resources/js3d/context/skills/aigc-integration/scripts/query-music.mjs +0 -53
- package/resources/js3d/context/skills/aigc-integration/scripts/query-results.mjs +0 -53
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-cover.mjs +0 -44
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-image.mjs +0 -48
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-music.mjs +0 -34
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-staticmesh.mjs +0 -39
- package/resources/js3d/context/skills/platform-services/assets/release.json +0 -44
- package/resources/js3d/project/.gitattributes +0 -2
- package/resources/js3d/project/gameplay-probe.json +0 -38
- package/resources/js3d/project/package-lock.json +0 -1204
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.test.mjs +0 -25
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
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)。
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Performance Audit
|
|
11
|
+
|
|
12
|
+
先扫描代码事实,再确认实际执行频率,最后用测量证明收益。静态分析只能指出候选,不能证明帧率;没有运行数据时保留“未验证”。
|
|
13
|
+
|
|
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
|
|
43
|
+
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
|
+
node "${CRAFT_SKILL_DIR}/scripts/scan-perf.mjs" --project "${CRAFT_PROJECT_DIR}" --hotspots --top 30
|
|
60
|
+
```
|
|
61
|
+
|
|
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
|
+
## 硬约束
|
|
155
|
+
|
|
156
|
+
- 不修改 `runtime/`、`vendor/`、平台 SDK 或模板适配数学来规避业务性能问题。
|
|
157
|
+
- 场景可编辑项目(`src/scenes/<场景>/scene.ts`)不要为了合批改变 item 粒度;摆位/造型的维护约定见 `${CRAFT_CONTEXT_DIR}/knowledge/CodingGuide/SceneEditableGuide.md`。
|
|
158
|
+
- 不因静态命中就直接删除预热、资源或视觉效果;先确认加载与画面语义。
|
|
159
|
+
- `preserveDrawingBuffer` 可能被自定义截图/录像依赖;移除前必须验证截图链路。
|
|
160
|
+
- 不把 `renderer.info` 的某一次计数当成整帧;多通道渲染会覆盖或分段统计。
|
|
161
|
+
- 不把压缩产物的扫描结果当成源码结论;能拿到源码就回源码重扫。
|
|
162
|
+
|
|
163
|
+
## 参考
|
|
164
|
+
|
|
165
|
+
- [规则、误报与验证](references/rules.md)
|
|
166
|
+
- [案例:Tidewater Zoo 与 Last Light Stand](references/case-notes.md)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# 案例与判读
|
|
2
|
+
|
|
3
|
+
这两个工程用于校准扫描器的精度,不是性能结论。文件行号来自案例版本,换版本后以实际代码为准。
|
|
4
|
+
|
|
5
|
+
## 1. Tidewater Zoo(潮汐动物园)
|
|
6
|
+
|
|
7
|
+
### 工程形态
|
|
8
|
+
|
|
9
|
+
- `src/` 是零改动胶水层:平台桥、canvas 接管、启动自检,不实现游戏本体。
|
|
10
|
+
- `zoo/build/*.js` 是注入进游戏 bundle 的真实业务源码(15 个 part);`public/` 是 91 MB 的镜像产物,`dist/` 是发布产物。
|
|
11
|
+
- 游戏本体是 WebGPU + 压缩 bundle,真正的渲染循环在 `public/assets` 的压缩代码里,源码模式看不到。
|
|
12
|
+
|
|
13
|
+
因此性能扫描应主要看 `zoo/build/` 和 `src/`;`public/`、`dist/` 只用于 bundle 模式的字面量检查和资源体积分析(后者属于资源体积审计)。
|
|
14
|
+
|
|
15
|
+
### 这个工程做对的地方
|
|
16
|
+
|
|
17
|
+
- `zoo/build/00_core.js` 的 `Batch` 把大量图元合进少数顶点色 Mesh,并缓存材质(`_mat` 按参数键复用)。这是 draw call 的正确方向,扫描器不会把这类批处理当成“逐个 Mesh”。
|
|
18
|
+
- `zoo/build/30_flora.js` 明确按“材质类别 × 地图块”合并几何,而不是每个植被一个 Mesh。
|
|
19
|
+
- `src/main.ts` 的游客 GLB 预取与场景构建重叠,每批 5 个、间隔 120 ms,避免和首屏资源抢带宽。这是加载策略,不是帧循环问题。
|
|
20
|
+
|
|
21
|
+
### 扫描器在本工程上的结果
|
|
22
|
+
|
|
23
|
+
源码模式(`--project ...`,约 35 个文件、1.6 万行)得到 25 条(0 error / 19 warning / 6 info):
|
|
24
|
+
|
|
25
|
+
| 位置 | 判定 | 判读 |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `src/game/hazards.ts:83,87` | `RENDER.FRUSTUM_CULLED_OFF` | 危险物/影子池故意关闭剔除;确认是否所有实例都需要常驻,否则恢复剔除 |
|
|
28
|
+
| `src/ui/hud.ts:129-135` | `FRAME.DOM_WRITE` ×4 | HUD 在每帧更新文本/进度条;改成值变化才写或固定低频 |
|
|
29
|
+
| `src/game/hazards.ts:81,84` | `SCENE.MESH_IN_LOOP` info | 危险物池初始化,几何/材质共享;循环次数固定,优先级低 |
|
|
30
|
+
| `zoo/build/43_editable_originals.js:148`、`80_editor.js:398`、`85_pirate.js:198` | `SCENE.MESH_IN_LOOP` info | 初始化/编辑器/船只部件;确认循环次数与是否可合批 |
|
|
31
|
+
| `zoo/build/85_pirate.js` | `FRAME.DOM_WRITE` / `FRAME.COLLECTION_ALLOC` | `Z.onTick` 内每帧更新血条/UI;`P.balls.slice()`、`P.ships.filter()` 每帧分配;按变化更新、复用数组 |
|
|
32
|
+
|
|
33
|
+
关键精度案例:
|
|
34
|
+
|
|
35
|
+
- `zoo/ui/zoo-ui.js` 的 `updateHud()` 由 `setInterval(updateHud, 500)` 驱动,不是每帧。扫描器没有把它标成热函数。
|
|
36
|
+
- `zoo/ui/editor.js` 的 `updateCatalog()` 由编辑器交互触发,扫描器没有因为函数名含 `update` 就误报。
|
|
37
|
+
- `zoo/build/85_pirate.js` 的 `Z.onTick(function (t, dt) { ... })` 是自定义帧回调;扫描器识别 `onTick` 后,`updateHud`、血条 `style.left/top` 等帧内写入会被标记。热名按文件作用域传播,另一个文件的同名函数不会因为这里命中而一起变热。
|
|
38
|
+
|
|
39
|
+
这正是“调用名传播”而不是“看到 `update*` 就报”的原因。
|
|
40
|
+
|
|
41
|
+
### bundle 模式的边界
|
|
42
|
+
|
|
43
|
+
对 `dist/assets` 运行 `--mode bundle` 只得到 `SCANNER.BUNDLE_LIMITS`。压缩代码里的 `setSize`、`traverse` 等词出现在单行 bundle 中,无法可靠判断函数边界;不要用它推断 draw call 或热路径。要分析游戏本体,应拿到对应的可读源码或 `zoo/build/` 源模块。
|
|
44
|
+
|
|
45
|
+
## 2. Last Light Stand(最后的光之坚守)
|
|
46
|
+
|
|
47
|
+
### 工程形态
|
|
48
|
+
|
|
49
|
+
- `src/` 是逆向重写的 TS 参考实现(场景、系统、UI),**不是运行入口**。
|
|
50
|
+
- 实际运行的是 `engine/game_code.js`(约 225 KB 的原版压缩代码);`engine/` 不在源码扫描范围。
|
|
51
|
+
- 因此扫描 `src/` 的结论只适用于这套参考实现;原版 bundle 的性能要另做运行时测量。
|
|
52
|
+
|
|
53
|
+
### 扫描器在 `src/` 上的高价值命中
|
|
54
|
+
|
|
55
|
+
| 位置 | ID | 为什么要看 |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `src/main.ts:52` | `RENDER.PRESERVE_DRAWING_BUFFER` | 常开保留绘制缓冲。注释称“截图正确性的前提”,但平台截图默认在 render 后同步复制;先验证截图链路再决定是否移除 |
|
|
58
|
+
| `src/main.ts:68` | `FRAME.UI_SYNC_CALL` | `updateWorldLabels(camera, labelTmp)` 每帧同步世界标签;原版 HUD 元素多,DOM 同步是稳定开销 |
|
|
59
|
+
| `src/systems/gameFlow.ts:215` | `FRAME.SNAPSHOT_ALLOC` | `onSnapshot(this.getSnapshot())` 每帧构造新对象,并触发整张 HUD 更新 |
|
|
60
|
+
| `src/ui/hud/WidgetLogic_HUD.ts:19-28` | `FRAME.DOM_WRITE` ×6 | 每帧写血量、护盾、弹药、波次、得分;没有值变化判断 |
|
|
61
|
+
| `src/systems/enemies.ts:411-413` | 每个敌人一份 `BoxGeometry` + `MeshStandardMaterial` | 身体用了 InstancedMesh,但几何/材质仍按敌人创建;敌人数量增加时资源与上传增长 |
|
|
62
|
+
| `src/systems/enemies.ts:321-322` | 每次弹道生成 `clone()` + `new Vector3` | 高频攻击路径的临时对象 |
|
|
63
|
+
| `src/systems/enemies.ts:324-326` | 每次弹道新建 `BufferGeometry` + `LineBasicMaterial` | 即使特效管理器会 dispose,持续射击仍有创建/销毁抖动 |
|
|
64
|
+
| `src/systems/enemies.ts:335-336,352-353` | 每次砸地/爆裂新建 Torus/Sphere 几何与材质 | 同上;适合对象池或共享资源 |
|
|
65
|
+
| `src/systems/shooting.ts:284-285,294-295` | 每次开火新建线段/方块几何与材质 | 射速越高越明显;先共享几何/材质,再考虑对象池 |
|
|
66
|
+
| `src/scenes/battlefield/index.ts:127,130` | 初始化循环内每盏灯新建 Cylinder/Box 几何 | 6 盏灯,数量小;优先级低于帧循环与生成路径 |
|
|
67
|
+
| `src/main.ts:91-92` | `LIFECYCLE.DOUBLE_RESIZE` | 同时注册 `window.resize` 与 `ResizeObserver`,尺寸变化会走两条路径 |
|
|
68
|
+
| `src/main.ts:71` | `LIFECYCLE.RAF_NO_CANCEL` | 帧循环没有取消路径;重开/HMR 时确认不会叠加 |
|
|
69
|
+
|
|
70
|
+
### 判读顺序
|
|
71
|
+
|
|
72
|
+
按“每帧 → 高频生成 → 初始化”排序:
|
|
73
|
+
|
|
74
|
+
1. **每帧**:快照分配 + HUD 全量 DOM 写入;先做值变化判断和快照复用,通常风险最低、收益直接。
|
|
75
|
+
2. **每帧**:`updateWorldLabels`;确认它是否真的每帧遍历全部标签,能否按可见性或低频同步。
|
|
76
|
+
3. **高频生成**:弹道/爆裂/开火路径的几何、材质、临时对象;先共享资源,再评估对象池。
|
|
77
|
+
4. **每敌人资源**:几何/材质共享;InstancedMesh 已经解决“一个体素一个 draw call”,但每个敌人仍有一份资源。
|
|
78
|
+
5. **初始化**:战场灯的逐灯几何;数量小,放在最后。
|
|
79
|
+
6. **渲染设置**:`preserveDrawingBuffer` 先验证截图,不要直接删;DPR 已 clamp,不需要改。
|
|
80
|
+
|
|
81
|
+
### 这个案例不能证明什么
|
|
82
|
+
|
|
83
|
+
- `src/` 不是实际运行入口;不能把扫描结果直接等同于 `engine/game_code.js` 的性能。
|
|
84
|
+
- 没有运行测量时,不能声称“移除 preserveDrawingBuffer 提升 X%”或“HUD 降频后稳定 60 FPS”。
|
|
85
|
+
- 原版 208 个 HUD 元素的实际开销取决于 DOM 结构和浏览器;需要 Performance 面板与目标设备实测。
|
|
86
|
+
|
|
87
|
+
## 3. 两个案例的共同结论
|
|
88
|
+
|
|
89
|
+
- 最值得先修的是**每帧资源创建、每帧 DOM、每帧快照**,不是初始化循环。
|
|
90
|
+
- 看到 `InstancedMesh` 不等于资源已共享;几何/材质仍可能按实例创建。
|
|
91
|
+
- 看到 `update*` 不等于每帧;必须看调用点。`setInterval`、按钮、编辑器打开都可能驱动同名函数。
|
|
92
|
+
- 压缩产物只能做字面量检查;有源码时以源码为准。
|
|
93
|
+
- 静态扫描给出候选,`renderer.info` 和真实帧时间才给出结论。
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# 规则、误报与验证
|
|
2
|
+
|
|
3
|
+
本页是扫描器的判定口径。规则只产生“这里有性能风险”的代码事实;是否真的影响帧时间,必须回到调用频率和目标设备测量。
|
|
4
|
+
|
|
5
|
+
## 1. 扫描模型
|
|
6
|
+
|
|
7
|
+
### 两种模式
|
|
8
|
+
|
|
9
|
+
- `source`:扫描 `src/`、`zoo/`、`game/`、`app/`、`scripts/src`。能识别函数、循环、RAF 回调、生成路径和调用传播。
|
|
10
|
+
- `bundle`:扫描 `assets/`、`dist/assets`、`public/assets`、`js/`、`engine/`。压缩代码没有可靠边界,只检查渲染器字面量并输出 `SCANNER.BUNDLE_LIMITS`。
|
|
11
|
+
|
|
12
|
+
`auto` 先找源码;找不到才走 bundle。`runtime/`、`vendor/`、`node_modules/`、`engine/`、`public/`、`dist/` 不作为 source 业务代码。
|
|
13
|
+
|
|
14
|
+
### 词法掩码
|
|
15
|
+
|
|
16
|
+
扫描器用状态机同时生成两个视图:
|
|
17
|
+
|
|
18
|
+
- `masked`:注释、字符串和模板内容替换为空格,保留换行。结构、函数、循环和 `new` 规则都读它,避免把注释或文案当代码。
|
|
19
|
+
- `code`:只去掉注释,保留字符串。`addEventListener('resize')` 这类需要字面量的规则读它。
|
|
20
|
+
|
|
21
|
+
模板字符串里的 `${...}` 不会被当作代码分析;这是保守取舍,避免误判。
|
|
22
|
+
|
|
23
|
+
### 热路径
|
|
24
|
+
|
|
25
|
+
1. 种子:`tick / update / render / animate / loop / step / frame / draw / fixedUpdate / lateUpdate / onFrame / renderFrame / simulate / physicsStep / updateWorldLabels`,以及 `requestAnimationFrame` / `setAnimationLoop` / `onTick` / `onUpdate` / `onFrame` / `addTick` / `addUpdate` / `registerTick` / `everyFrame` / `onBeforeRender` / `onAfterRender` 的回调。
|
|
26
|
+
2. 帧回调:内联箭头、`function`、表达式体箭头都按整个 hook 调用标记;裸标识符(`onTick(updateHud)`、`requestAnimationFrame(stepScene)`)直接加入热集合,不要求名字匹配 `update*`。
|
|
27
|
+
3. 传播:在**单个文件内**从热函数体收集被调用名,只把匹配 `update* / render* / animate* / simulate*` 的函数加入该文件的热集合,最多 3 轮。
|
|
28
|
+
4. 排除:`spawn / emit / fire / shoot / explode / projectile / hurt / damage / kill / hit` 开头的函数不参与传播,避免把“每次射击”误判成“每帧”。
|
|
29
|
+
5. 作用域:同名函数按文件隔离。`85_pirate.js` 的 `updateHud` 在 `onTick` 内会被标记,`zoo-ui.js` 的同名 `updateHud` 由 `setInterval` 驱动则不会。
|
|
30
|
+
|
|
31
|
+
因此:
|
|
32
|
+
|
|
33
|
+
- `tick()` 调用 `updateHud()` → `updateHud` 被标记为热(medium)。
|
|
34
|
+
- `tick()` 不调用 `updateCatalog()`,但编辑器按钮调用它 → 不标记。
|
|
35
|
+
- `updateHud()` 由 `setInterval(..., 500)` 调用 → 不标记。
|
|
36
|
+
- `tick()` 调用 `spawnBullet()` → 不把 `spawnBullet` 当帧循环;它属于生成路径。
|
|
37
|
+
|
|
38
|
+
这是调用图近似,不是完整的 JavaScript 语义分析。跨文件字符串调用、回调表、事件总线可能漏报;以实际调用点为准。
|
|
39
|
+
|
|
40
|
+
### confidence
|
|
41
|
+
|
|
42
|
+
| 值 | 含义 |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `high` | 语法位置或字面量确定,例如 RAF 内联回调、`preserveDrawingBuffer: true` |
|
|
45
|
+
| `medium` | 由函数名或工厂调用传播推断,例如 `updateHud`、被 spawn 调用的 `buildEnemy` |
|
|
46
|
+
| `low` | 项目级聚合或需要人工判断的信号 |
|
|
47
|
+
|
|
48
|
+
## 2. Finding 结构
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"id": "FRAME.GPU_RESOURCE",
|
|
53
|
+
"severity": "error",
|
|
54
|
+
"confidence": "high",
|
|
55
|
+
"title": "渲染热路径新建 GPU 资源",
|
|
56
|
+
"file": "src/enemies.ts",
|
|
57
|
+
"line": 411,
|
|
58
|
+
"context": "frame-loop",
|
|
59
|
+
"evidence": "const geo = new THREE.BoxGeometry(...)",
|
|
60
|
+
"detail": "为什么是风险",
|
|
61
|
+
"fix": "首选修改方向",
|
|
62
|
+
"verify": "如何证明改对了"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`context` 取值:`frame-loop`、`loop`、`spawn-factory`、`repeated-factory`、`static`。同一文件同一规则最多保留 8 条,其余计入 `summary.suppressed`。
|
|
67
|
+
|
|
68
|
+
## 3. 规则表
|
|
69
|
+
|
|
70
|
+
### 帧循环
|
|
71
|
+
|
|
72
|
+
| ID | 检测 | 典型误报 | 修复方向 | 验证 |
|
|
73
|
+
|---|---|---|---|---|
|
|
74
|
+
| `FRAME.GPU_RESOURCE` | 热路径 `new *Geometry / *Material / *Texture / RenderTarget` | 函数名像热函数但实际只在初始化调用 | 初始化创建并复用;只改变换/颜色/uniform | `renderer.info` 稳态不增长;p95 帧时间 |
|
|
75
|
+
| `FRAME.TEMP_OBJECT` | 热路径 `new Vector/Color/Matrix/Quaternion/Box/Plane` 或 `.clone()` | 一次性事件代码被误判为热 | scratch 对象 + `copy/set/applyMatrix4` | 分配采样下降;逻辑不变 |
|
|
76
|
+
| `FRAME.COLLECTION_ALLOC` | 热路径展开、`filter/map/slice/concat`、`Object.entries` | 小数组每帧分配影响很小 | 复用数组、倒序删除、状态变化时缓存 | 分配与 Layout 次数 |
|
|
77
|
+
| `FRAME.DOM_WRITE` | 热路径 `textContent/innerHTML/style.*/classList/setAttribute` | `.value` 是普通对象字段,不是 DOM(已排除) | 值变化才写;固定低频同步 | 无持续 Recalc Style/Layout |
|
|
78
|
+
| `FRAME.UI_SYNC_CALL` | 热路径调用 `updateWorldLabels/updateHud/updateUI/syncUI` 等 | 同名函数只在高频事件中调用 | 降频、只更新变化/可见元素 | HUD 元素多时的帧时间 |
|
|
79
|
+
| `FRAME.SNAPSHOT_ALLOC` | 热路径调用返回对象字面量的 `getSnapshot` 系列 | 快照函数返回复用对象 | 复用快照并原地更新 | 分配趋势;字段正确 |
|
|
80
|
+
| `FRAME.SCENE_TRAVERSE` | 热路径 `traverse / traverseVisible` | 场景结构变化时的一次遍历 | 维护更新列表 | 对象数增加时 CPU 不线性增长 |
|
|
81
|
+
| `FRAME.RAYCAST` | 热路径 `intersect*` 或 `new Raycaster` | 只对少量对象、低频调用 | 缩小候选集、降频、缓存 | 候选数与帧时间 |
|
|
82
|
+
| `FRAME.MATERIAL_RECOMPILE` | 热路径 `needsUpdate = true` | 一次性材质变化 | 只在定义变化时设置;预建变体 | 无周期性编译尖峰 |
|
|
83
|
+
| `FRAME.LOAD` | 热路径 `fetch/loadGlbModel/new *Loader` | 只在首次进入/切场景调用 | 移到初始化/入口;共享 Promise | 代表性帧无网络/解析 |
|
|
84
|
+
| `FRAME.MESH_INSTANCE` | 热路径 `new *Mesh`(共享几何也算) | 每帧确实需要一个新对象 | 预创建/对象池/InstancedMesh | 对象数与 calls 不增长 |
|
|
85
|
+
| `FRAME.RESIZE_IN_LOOP` | 热路径 `setSize/setPixelRatio/setViewport/setScissor` | 只在 resize 回调里调用 | 移到尺寸变化回调 | 帧内不再调用 |
|
|
86
|
+
| `FRAME.LOG` | 热路径 `console.log/info/debug/warn` | 调试构建 | 状态变化才记录 | 发布构建无每帧输出 |
|
|
87
|
+
|
|
88
|
+
### 场景与绘制
|
|
89
|
+
|
|
90
|
+
| ID | 检测 | 典型误报 | 修复方向 | 验证 |
|
|
91
|
+
|---|---|---|---|---|
|
|
92
|
+
| `SCENE.GPU_RESOURCE_IN_LOOP` | 非热循环内 `new *Geometry/Material/Texture` | 循环只跑几次的初始化场景 | 提到循环外共享;批处理 | 资源数不随循环线性增长 |
|
|
93
|
+
| `SCENE.MESH_IN_LOOP` | 非热循环内 `new *Mesh`,几何/材质已共享 | 静态场景 10~20 个物件可接受 | InstancedMesh / mergeGeometries | `renderer.info.render.calls` |
|
|
94
|
+
| `SCENE.MANY_MESH_NO_INSTANCING` | 单文件 ≥60 个 Mesh 且无实例化/批处理 | 大量小物件确实需要独立交互 | 实例化、合批或分块 | calls 与对象数关系 |
|
|
95
|
+
| `RENDER.FRUSTUM_CULLED_OFF` | `frustumCulled = false` | 高速弹道/常驻特效故意关闭 | 恢复剔除或限制在少数对象 | 对象离开镜头时 calls 下降 |
|
|
96
|
+
| `RENDER.POSTPROCESS_COMPOSER` | `new EffectComposer` | 单 pass 低分辨率后处理 | 合并 pass、降低 RT 尺寸 | calls/triangles 与帧时间 |
|
|
97
|
+
| `RENDER.SHADOW_MAP_LARGE` | `mapSize` > 2048 | 高端 PC 专用工程 | 降低分辨率或收紧 shadow camera | 接触阴影与显存/帧时间 |
|
|
98
|
+
|
|
99
|
+
### 生成路径
|
|
100
|
+
|
|
101
|
+
| ID | 检测 | 典型误报 | 修复方向 | 验证 |
|
|
102
|
+
|---|---|---|---|---|
|
|
103
|
+
| `SPAWN.PER_INSTANCE_RESOURCE` | `spawn/emit/fire/shoot/...` 函数内或 spawn 调用的 `build*` 工厂内创建几何/材质/贴图 | 整个游戏只生成一次 | 共享资源;弹道/特效用对象池;只改变换与颜色 | 连续触发后 geometries/textures 不持续增长 |
|
|
104
|
+
|
|
105
|
+
`buildEnemy` 只有在被 spawn 或热路径调用时才升级为生成路径(同文件或跨文件均可);只在初始化调用的 `createBattlefield` 不会被标记。
|
|
106
|
+
|
|
107
|
+
### 渲染设置
|
|
108
|
+
|
|
109
|
+
| ID | 检测 | 典型误报 | 修复方向 | 验证 |
|
|
110
|
+
|---|---|---|---|---|
|
|
111
|
+
| `RENDER.PRESERVE_DRAWING_BUFFER` | `preserveDrawingBuffer: true` | 自定义截图/录像确实依赖 | 确认后移除;或只在诊断构建启用 | 截图完整;帧时间对比 |
|
|
112
|
+
| `RENDER.PIXEL_RATIO_UNCLAMPED` | `setPixelRatio` 参数含 `devicePixelRatio` 且无 `Math.min`,或字面量 >2 | 项目有自定义 clamp 函数未被识别 | `Math.min(devicePixelRatio, 2)` 或实测上限 | canvas 像素尺寸、清晰度、帧时间 |
|
|
113
|
+
|
|
114
|
+
### 生命周期与扫描器
|
|
115
|
+
|
|
116
|
+
| ID | 检测 | 典型误报 | 修复方向 | 验证 |
|
|
117
|
+
|---|---|---|---|---|
|
|
118
|
+
| `LIFECYCLE.NO_DISPOSE` | 项目创建 GPU 资源但全项目无 `.dispose()` | 资源由外部管理器释放 | 按所有权释放 geometry/material/texture | 多轮重开 `renderer.info` 不增长 |
|
|
119
|
+
| `LIFECYCLE.RAF_NO_CANCEL` | 有 RAF 但文件内无 `cancelAnimationFrame` | 由外部生命周期统一停止 | HMR/卸载/切场景时取消 | 重开不叠加帧循环 |
|
|
120
|
+
| `LIFECYCLE.DOUBLE_RESIZE` | 同时有 `resize` 监听与 `ResizeObserver` | 两条路径职责不同 | 保留一条权威路径 | 拖拽窗口只更新一次 |
|
|
121
|
+
| `SCANNER.NO_CODE` | 没找到源码 | 目录结构特殊 | 确认 `--project` 或 `--mode` | 能列出实际源码 |
|
|
122
|
+
| `SCANNER.SKIPPED_LARGE` | 单文件超过 8 MB 未扫描 | 生成/压缩产物 | 取得可读源码或拆分产物 | 扫描文件数与实际源码一致 |
|
|
123
|
+
| `SCANNER.BUNDLE_LIMITS` | bundle 模式 | — | 回源码重扫 | 有源码结论 |
|
|
124
|
+
|
|
125
|
+
## 4. 已知误报与漏报
|
|
126
|
+
|
|
127
|
+
- **压缩代码**:单行、短变量名、内联函数会让函数/循环边界失真。bundle 模式只保留字面量规则;不要用“未发现”证明没有热路径问题。
|
|
128
|
+
- **别名与封装**:`new ctx.Mesh(...)`、`C.batch(...)`、项目自定义工厂不会被全部识别。看到 batching/instancing 辅助时,不要按 Mesh 数量直接判断。
|
|
129
|
+
- **动态调用**:字符串回调、事件总线、`window.__game` 调试接口可能绕过调用传播。关键路径以实际调用点为准。
|
|
130
|
+
- **跨文件传播**:热名只在定义文件内传播;文件 A 的热函数调用文件 B 的 `updateFoo` 时,B 可能漏报。跨文件只依赖 `tick/update/render` 等种子名和实际调用点确认。
|
|
131
|
+
- **跨文件快照**:`snapshotNames` 按文件隔离;文件 A 定义、文件 B 调用的同名 `getSnapshot` 可能漏报,以实际调用点确认。
|
|
132
|
+
- **工厂同名**:spawn 调用的工厂按名字跨文件匹配;不同文件里的同名工厂可能被一起标记,回读 import 与定义。
|
|
133
|
+
- **TypeScript 类型签名**:对象返回类型 `): { ... } {` 已按类型括号跳过;复杂泛型或函数类型返回签名仍可能让函数体边界偏移,回读代码确认。
|
|
134
|
+
- **事件驱动同名函数**:`updateCatalog`、`updatePanel` 可能只在打开面板时调用。扫描器不标记未被热路径调用的函数;如果它被标记,回读调用点。
|
|
135
|
+
- **初始化循环**:`createBattlefield` 里的 6 盏灯逐个建几何,循环次数小,优先级低于帧循环和生成路径。扫描器把 `SCENE.MESH_IN_LOOP` 定为 info,把 `SCENE.GPU_RESOURCE_IN_LOOP` 定为 warning。
|
|
136
|
+
- **场景编辑器 item**:`src/scenes/**/scene.ts` 的静态摆位由编辑器读写,不要为了合批改变 item 粒度;需要实例化时在装配层实现,保留同一份 item 数据。
|
|
137
|
+
- **有意的渲染设置**:`frustumCulled = false` 可能是高速弹道/常驻特效;`preserveDrawingBuffer` 可能被自定义截图依赖。先确认语义。
|
|
138
|
+
- **未测量**:静态扫描看不到 GPU 时间、填充率、驱动开销、真实设备发热。`renderer.info` 也不等于帧率。
|
|
139
|
+
|
|
140
|
+
## 5. 验证矩阵
|
|
141
|
+
|
|
142
|
+
| 改动 | 证据 | 不能证明 |
|
|
143
|
+
|---|---|---|
|
|
144
|
+
| 重新扫描 | 目标 finding 消失、无新增 error | 运行时正确、帧率提升 |
|
|
145
|
+
| `npm run build` | 类型、配置导出、打包通过 | 资源实际加载、交互正确 |
|
|
146
|
+
| `runtime-audit.js` | 结构/预算项通过或明确 unknown | 真实设备帧率、GPU 显存安全 |
|
|
147
|
+
| `renderer.info` | calls / triangles / geometries / textures 前后对比 | 填充率、GPU 时间、发热 |
|
|
148
|
+
| Performance 面板 | GC、Layout、Recalc Style、长任务 | 其他设备、其他场景 |
|
|
149
|
+
| 目标设备试玩 | p50/p95、掉帧、发热、操作手感 | 全部机型、全部画质 |
|
|
150
|
+
| `game_visual_qa` | 可见画面无回归 | 性能收益 |
|
|
151
|
+
|
|
152
|
+
交付时分开写:
|
|
153
|
+
|
|
154
|
+
- 本次变化:改了哪些文件、为什么、预计影响什么指标。
|
|
155
|
+
- 已验证:scan / build / 视觉 / 运行时测量各做到哪一步。
|
|
156
|
+
- 未完成或未验证:没有测到的设备、场景、交互与性能结论。
|
|
157
|
+
|
|
158
|
+
## 6. 报告结构
|
|
159
|
+
|
|
160
|
+
`report.json` 顶层:
|
|
161
|
+
|
|
162
|
+
- `schemaVersion`、`project`、`mode`、`generatedAt`;
|
|
163
|
+
- `summary`:files、lines、findings、errors、warnings、infos、suppressed、skippedFiles、stats;
|
|
164
|
+
- `stats`:mesh/geometry/material/texture 创建数、instanced/batch 站点、dispose、raf、热行数、热函数数、帧内 DOM 写入数;
|
|
165
|
+
- `suppressed`:被折叠的规则计数;
|
|
166
|
+
- `findings`:按 severity → file → line 排序。
|
|
167
|
+
|
|
168
|
+
`stats` 是代码计数,不是运行时 draw call 或显存。用它判断“这个文件是否大量创建对象”,不要直接当性能分数。
|
|
169
|
+
|
|
170
|
+
## 7. Agent-led pass 与 hotspots
|
|
171
|
+
|
|
172
|
+
规则表是检查清单,不是性能边界。扫描器只覆盖固定 ID;算法复杂度、overdraw、数据布局、CPU/GPU 同步、自定义帧钩子和项目特有系统仍需要人工审查。
|
|
173
|
+
|
|
174
|
+
--hotspots 输出只读热点图,不应用规则:
|
|
175
|
+
|
|
176
|
+
- frame-hook:帧回调注册点;命名回调带 name。
|
|
177
|
+
- hot-function:从帧循环可达的函数;confidence 为 high 或 medium。
|
|
178
|
+
- spawn:明确的生成/发射路径;repeated-factory:被生成、循环或热路径调用的工厂。
|
|
179
|
+
- 定时器/间隔类名字(Interval、Timer、Cooldown 等)不会显示为 spawn/factory。
|
|
180
|
+
|
|
181
|
+
JSON 顶层为 summary 与 hotspots;每个 hotspot 包含 file、line、endLine、name、roles、confidence。hotspots 模式不写 .perf-audit/report.json;使用 --out 时才另存 JSON。
|
|
182
|
+
|
|
183
|
+
人工发现使用 MANUAL.<area> 标记,写明 file:line、为什么在热路径、预期影响和验证方式。不要把 MANUAL 发现写进扫描器 report.json,也不要因为扫描器没有命中就跳过最重的 2–3 个热路径。
|