@craft_eco/craft-mcp 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -10
- package/bin/craft-mcp.mjs +10 -8
- package/dist-server/game-workflow/bundle-files.mjs +43 -0
- package/dist-server/game-workflow/engines.mjs +13 -6
- package/dist-server/game-workflow/project-bundles.mjs +90 -0
- package/dist-server/game-workflow/project-context.mjs +91 -0
- package/dist-server/game-workflow/projects.mjs +16 -4
- package/dist-server/game-workflow/publication-materials.mjs +18 -20
- package/dist-server/game-workflow/publications.mjs +15 -17
- package/dist-server/game-workflow/publish-capture.mjs +21 -57
- package/dist-server/integrations/config.mjs +71 -0
- package/dist-server/integrations/files.mjs +54 -0
- package/dist-server/integrations/hosts.mjs +30 -0
- package/dist-server/integrations/install.mjs +86 -0
- package/dist-server/integrations/runtime.mjs +71 -0
- package/dist-server/mcp/publication-page.mjs +18 -50
- package/dist-server/mcp/publish-panel.mjs +28 -35
- package/dist-server/mcp/server.mjs +17 -14
- package/dist-server/preview/preview-launcher.mjs +9 -2
- package/dist-server/preview/preview-start.mjs +2 -2
- package/dist-server/upstream/publication-transport.mjs +19 -19
- package/package.json +10 -2
- package/resources/craft-create/SKILL.md +14 -0
- package/resources/craft-game-maker/SKILL.md +77 -71
- package/resources/craft-game-maker/js.md +10 -10
- package/resources/craft-game-maker/js3d.md +13 -13
- package/resources/game_visual_qa.mjs +1149 -1149
- package/resources/js/bundle.json +93 -0
- package/resources/js/context/AGENTS.md +15 -102
- package/resources/js/context/knowledge/AigcWiring.md +5 -196
- package/resources/js/context/knowledge/AssetUrl.md +5 -20
- package/resources/js/context/knowledge/Layout.md +7 -0
- package/resources/js/context/knowledge/Lifecycle.md +6 -27
- package/resources/js/context/skills/aigc-generate/SKILL.md +6 -141
- package/resources/js/context/skills/asset-search/SKILL.md +5 -62
- package/resources/js/context/skills/asset-search/references/resource-config.md +9 -0
- package/resources/js/context/skills/export-config/SKILL.md +7 -19
- package/resources/js/context/skills/export-config/scripts/export-config.mjs +3 -45
- package/resources/js/context/skills/index.json +30 -0
- package/resources/js/context/skills/visual-qa/SKILL.md +6 -28
- package/resources/js/project/README.md +4 -96
- package/resources/js/project/package.json +1 -2
- package/resources/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +1 -37
- package/resources/js/project/scripts/config-export.mjs +10 -34
- package/resources/js3d/bundle.json +104 -0
- package/resources/js3d/context/AGENTS.md +16 -85
- package/resources/js3d/context/knowledge/AigcWiring.md +9 -0
- package/resources/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +9 -67
- package/resources/js3d/context/knowledge/Layout.md +7 -0
- package/resources/js3d/context/knowledge/Runtime.md +5 -30
- package/resources/js3d/context/skills/aigc-integration/SKILL.md +6 -164
- package/resources/js3d/context/skills/asset-search/SKILL.md +5 -171
- package/resources/js3d/context/skills/asset-search/references/resource-config.md +6 -94
- package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +6 -82
- package/resources/js3d/context/skills/export-config/SKILL.md +7 -11
- package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +3 -55
- package/resources/js3d/context/skills/index.json +42 -0
- package/resources/js3d/context/skills/performance-audit/SKILL.md +8 -153
- package/resources/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/js3d/project/README.md +4 -103
- package/resources/js3d/project/package.json +1 -2
- package/resources/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-scene-assets.mjs +3 -28
- package/resources/js3d/project/scripts/config-export.mjs +12 -34
- package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts +8 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.js +39 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts +5 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js +45 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +2 -1
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +2 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.js +7 -2
- package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +2 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +27 -16
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts +14 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js +119 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/static.js +20 -6
- 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 +24 -2
- package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-steering.d.ts +21 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.js +66 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +1 -1
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -1
- package/vendor/agent-cli/dist/src/index.d.ts +4 -1
- package/vendor/agent-cli/dist/src/index.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/index.js +3 -0
- package/vendor/agent-cli/dist/src/index.js.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +29 -1
- 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 +18 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.d.ts +10 -0
- package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.js +15 -5
- package/vendor/agent-cli/dist/src/session/client.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.d.ts +3 -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 +14 -1
- package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-observability.js +11 -0
- package/vendor/agent-cli/dist/src/session/process-observability.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.d.ts +3 -2
- package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.js +27 -9
- package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +1 -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 +8 -3
- package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-steer.d.ts +42 -0
- package/vendor/agent-cli/dist/src/session/run-steer.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-steer.js +205 -0
- package/vendor/agent-cli/dist/src/session/run-steer.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts +6 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts +21 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.js +102 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program.js +3 -0
- package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -1
- package/resources/js/context/.role/AGENTS_DESIGN.md +0 -9
- package/resources/js/context/agents/aigc-asset.md +0 -168
- package/resources/js/context/knowledge/AigcEnabled.md +0 -49
- package/resources/js/context/knowledge/FrontendComponents.md +0 -17
- package/resources/js/context/knowledge/MobileAdaptation.md +0 -73
- package/resources/js/context/knowledge/MobileAdapted.md +0 -36
- package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
- package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -115
- package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -392
- package/resources/js/context/knowledge/PlatformServices.md +0 -190
- package/resources/js/context/knowledge/ProjectDisplayConfig.md +0 -35
- package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
- package/resources/js/context/knowledge/Ui.md +0 -11
- package/resources/js/context/knowledge/UiEditorCompat.md +0 -21
- package/resources/js/context/rules/MultiplayerCapability.md +0 -23
- package/resources/js/context/rules/MultiplayerRoomEntryUX.md +0 -63
- package/resources/js/context/rules/PlatformBoundaryModules.md +0 -44
- package/resources/js/context/rules/preview_ready.md +0 -8
- package/resources/js/context/skills/aigc-generate/knowledge/audio.md +0 -39
- package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +0 -26
- package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +0 -132
- package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +0 -53
- package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +0 -52
- package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +0 -191
- package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +0 -55
- package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +0 -62
- package/resources/js/context/skills/asset-search/scripts/config.json +0 -5
- package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +0 -125
- package/resources/js/context/skills/asset-search/scripts/search.mjs +0 -760
- package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -657
- package/resources/js/context/skills/asset-search/strategies/anim2d.md +0 -42
- package/resources/js/context/skills/asset-search/strategies/audio.md +0 -34
- package/resources/js/context/skills/asset-search/strategies/effect2d.md +0 -31
- package/resources/js/context/skills/asset-search/strategies/texture-prop.md +0 -22
- package/resources/js/context/skills/asset-search/strategies/ui-common.md +0 -40
- package/resources/js/context/skills/asset-search/strategies/ui-style.md +0 -28
- package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
- package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +0 -93
- package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +0 -7
- package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +0 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +0 -208
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +0 -31
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +0 -272
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.d.mts +0 -79
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.mjs +0 -29
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/release.json +0 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/cli.mjs +0 -16
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.d.mts +0 -4
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.mjs +0 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +0 -3
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.mjs +0 -72
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.d.mts +0 -24
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.mjs +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.d.mts +0 -10
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/cli.mjs +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.d.mts +0 -19
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/installed.json +0 -6
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.d.mts +0 -6
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.mjs +0 -77
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.d.mts +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.mjs +0 -34
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +0 -156
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +0 -249
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +0 -87
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +0 -185
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +0 -294
- package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +0 -5
- package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +0 -159
- package/resources/js/context/skills/mobile-adaptation/SKILL.md +0 -277
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -50
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -862
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -135
- package/resources/js/context/skills/mobile-adaptation/references/input-config.md +0 -342
- package/resources/js/context/skills/mobile-adaptation/references/verification.md +0 -140
- package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +0 -11
- package/resources/js/context/skills/mobile-compat-qa/SKILL.md +0 -53
- package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
- package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
- package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
- package/resources/js/context/skills/optimization-suggestions/SKILL.md +0 -89
- package/resources/js/context/skills/platform-services/SKILL.md +0 -101
- package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
- package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
- package/resources/js/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/modules/log.ts +0 -35
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
- package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +0 -49
- package/resources/js/context/skills/platform-services/assets/modules/save.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
- package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
- package/resources/js/context/skills/platform-services/references/api_reference.md +0 -18
- package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
- package/resources/js/context/skills/platform-services/scripts/install.mjs +0 -148
- package/resources/js/context/skills/resolution-adaptation/SKILL.md +0 -47
- package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
- package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -249
- package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +0 -98
- package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -200
- package/resources/js/context/skills/resolution-adaptation/references/audit.md +0 -31
- package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
- package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
- package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
- package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
- package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
- package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +0 -55
- package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
- package/resources/js/context/skills/scene-editor-compat/SKILL.md +0 -94
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +0 -13
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +0 -6
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +0 -25
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +0 -18
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +0 -42
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +0 -144
- package/resources/js/context/skills/scene-editor-compat/docs/contract.md +0 -330
- package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +0 -64
- package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +0 -28
- package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +0 -47
- package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +0 -64
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +0 -38
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +0 -9
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +0 -59
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +0 -30
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +0 -66
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +0 -20
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +0 -26
- package/resources/js/context/skills/scene-editor-compat/references/contract.md +0 -73
- package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +0 -162
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +0 -853
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +0 -173
- package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -427
- package/resources/js/context/skills/scene-editor-compat/version.json +0 -1
- package/resources/js/context/skills/ui-editor-compat/SKILL.md +0 -48
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -74
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js/context/skills/ui-editor-compat/references/contract.md +0 -132
- package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
- package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
- package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
- package/resources/js/context/skills/version-update/SKILL.md +0 -192
- package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
- package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
- package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
- package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js/context/version/version.json +0 -1
- package/resources/js/project/SPEC/assist/.gitkeep +0 -0
- package/resources/js/project/SPEC/guide/.gitkeep +0 -0
- package/resources/js/project/SPEC/plan/.gitkeep +0 -0
- package/resources/js/project/SPEC/readme.md +0 -6
- package/resources/js/project/SPEC/res/.gitkeep +0 -0
- package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -29
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/release.json +0 -37
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js/project/vendor/core-manager-js/package.json +0 -33
- package/resources/js/project/vendor/core-manager-js/src/.versions.json +0 -42
- package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +0 -41
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +0 -93
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +0 -203
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +0 -106
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +0 -25
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +0 -21
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +0 -65
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +0 -340
- package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +0 -87
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +0 -92
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +0 -271
- package/resources/js/project/vendor/core-manager-js/src/index.ts +0 -31
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +0 -81
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +0 -43
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +0 -32
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +0 -141
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +0 -20
- package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +0 -183
- package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +0 -304
- package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +0 -351
- package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +0 -180
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +0 -13
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +0 -14
- package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +0 -68
- package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +0 -433
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +0 -118
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +0 -444
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +0 -485
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +0 -66
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +0 -149
- package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +0 -9
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +0 -29
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +0 -88
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +0 -122
- package/resources/js/project/vendor/core-manager-js/src/runtime.ts +0 -24
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +0 -318
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +0 -151
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +0 -235
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +0 -98
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +0 -94
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +0 -209
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +0 -106
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +0 -341
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +0 -68
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +0 -236
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +0 -22
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +0 -29
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +0 -197
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +0 -9
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +0 -555
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +0 -112
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +0 -178
- package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +0 -246
- package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +0 -139
- package/resources/js/project/vendor/core-manager-js/tsconfig.json +0 -15
- package/resources/js/project/vendor/run.sh +0 -4
- package/resources/js/project/version/craft_feature_version.json +0 -42
- package/resources/js/project/version/project_feature_version.json +0 -11
- package/resources/js3d/context/.role/AGENTS_DESIGN.md +0 -9
- package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +0 -75
- package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +0 -42
- package/resources/js3d/context/knowledge/FrontendComponents.md +0 -19
- package/resources/js3d/context/knowledge/MobileAdaptation.md +0 -73
- package/resources/js3d/context/knowledge/MobileAdapted.md +0 -36
- package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
- package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -117
- package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -430
- package/resources/js3d/context/knowledge/PlatformServices.md +0 -190
- package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +0 -35
- package/resources/js3d/context/knowledge/SceneEditorCompat.md +0 -35
- package/resources/js3d/context/knowledge/StepByStep.md +0 -21
- package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
- package/resources/js3d/context/knowledge/UiEditorCompat.md +0 -21
- package/resources/js3d/context/rules/MultiplayerCapability.md +0 -27
- package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +0 -63
- package/resources/js3d/context/rules/PlatformBoundaryModules.md +0 -44
- package/resources/js3d/context/rules/preview_ready.md +0 -8
- package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +0 -70
- package/resources/js3d/context/skills/aigc-integration/callback.md +0 -77
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +0 -23
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +0 -38
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +0 -72
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +0 -33
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +0 -36
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +0 -37
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +0 -35
- package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +0 -58
- package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +0 -62
- package/resources/js3d/context/skills/asset-search/scripts/config.json +0 -235
- package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +0 -905
- package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +0 -79
- package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +0 -74
- package/resources/js3d/context/skills/asset-search/scripts/search.mjs +0 -637
- package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -667
- package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +0 -42
- package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +0 -31
- package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +0 -89
- package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +0 -143
- package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +0 -90
- package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
- package/resources/js3d/context/skills/game-art-style/SKILL.md +0 -60
- package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
- package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +0 -38
- package/resources/js3d/context/skills/game-art-style/references/construction.md +0 -111
- package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +0 -105
- package/resources/js3d/context/skills/game-art-style/references/sources.md +0 -25
- package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +0 -175
- package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +0 -168
- package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +0 -191
- package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +0 -165
- package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +0 -173
- package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +0 -185
- package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +0 -181
- package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +0 -189
- package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +0 -88
- package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +0 -301
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -104
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -933
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -257
- package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +0 -342
- package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +0 -140
- package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +0 -11
- package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +0 -53
- package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +0 -10
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
- package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +0 -74
- package/resources/js3d/context/skills/performance-audit/references/case-notes.md +0 -93
- package/resources/js3d/context/skills/performance-audit/references/rules.md +0 -183
- package/resources/js3d/context/skills/platform-services/SKILL.md +0 -101
- package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
- package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
- package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +0 -35
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
- package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +0 -49
- package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +0 -1
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
- package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
- package/resources/js3d/context/skills/platform-services/references/api_reference.md +0 -18
- package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
- package/resources/js3d/context/skills/platform-services/scripts/install.mjs +0 -148
- package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +0 -46
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -239
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +0 -129
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -188
- package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +0 -31
- package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
- package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
- package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
- package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
- package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
- package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
- package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +0 -599
- package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +0 -141
- package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +0 -92
- package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +0 -125
- package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +0 -113
- package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -1187
- package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +0 -53
- package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +0 -4
- package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +0 -94
- package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +0 -50
- package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +0 -105
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +0 -147
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +0 -79
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +0 -56
- package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +0 -51
- package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +0 -55
- package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +0 -78
- package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +0 -84
- package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +0 -120
- package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +0 -4
- package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +0 -238
- package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +0 -59
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -61
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +0 -110
- package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
- package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
- package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
- package/resources/js3d/context/skills/version-update/SKILL.md +0 -191
- package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
- package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
- package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
- package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js3d/context/version/version.json +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -30
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +0 -39
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -7
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +0 -26
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +0 -351
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js3d/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js3d/project/vendor/core-manager-three/package.json +0 -12
- package/resources/js3d/project/vendor/core-manager-three/src/index.ts +0 -2
- package/resources/js3d/project/vendor/run.sh +0 -4
- package/resources/js3d/project/version/craft_feature_version.json +0 -42
- package/resources/js3d/project/version/project_feature_version.json +0 -11
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +0 -7
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +0 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +0 -145
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +0 -1
- /package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
- /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
- /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +0 -0
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import Phaser from 'phaser';
|
|
2
|
-
|
|
3
|
-
export interface EffectEntityCreateOptions {
|
|
4
|
-
x?: number;
|
|
5
|
-
y?: number;
|
|
6
|
-
autoplay?: boolean;
|
|
7
|
-
autoDestroy?: boolean;
|
|
8
|
-
scale?: number;
|
|
9
|
-
playbackRate?: number;
|
|
10
|
-
rotation?: number;
|
|
11
|
-
alpha?: number;
|
|
12
|
-
originX?: number;
|
|
13
|
-
originY?: number;
|
|
14
|
-
depth?: number;
|
|
15
|
-
onComplete?: (entity: EffectEntity) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type EffectEntityPlayOnceOptions = Omit<
|
|
19
|
-
EffectEntityCreateOptions,
|
|
20
|
-
'autoplay' | 'autoDestroy'
|
|
21
|
-
>;
|
|
22
|
-
|
|
23
|
-
export type EffectEntityLoopOptions = Omit<
|
|
24
|
-
EffectEntityCreateOptions,
|
|
25
|
-
'autoplay' | 'autoDestroy' | 'onComplete'
|
|
26
|
-
>;
|
|
27
|
-
export type EffectAssetInput = string;
|
|
28
|
-
|
|
29
|
-
function effectKey(input: EffectAssetInput): string {
|
|
30
|
-
const key = String(input ?? '').trim();
|
|
31
|
-
if (!key) throw new Error('[EffectEntity] texture key 不能为空');
|
|
32
|
-
return key;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class EffectEntity {
|
|
36
|
-
private destroyed = false;
|
|
37
|
-
private paused = false;
|
|
38
|
-
private completionEvent: string | null = null;
|
|
39
|
-
private completionHandler: (() => void) | null = null;
|
|
40
|
-
|
|
41
|
-
static list(): string[] {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static has(input: EffectAssetInput): boolean {
|
|
46
|
-
return Boolean(String(input ?? '').trim());
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @deprecated 业务请按生命周期使用 playOnce() 或 startLoop()。 */
|
|
50
|
-
static create(
|
|
51
|
-
scene: Phaser.Scene,
|
|
52
|
-
input: EffectAssetInput,
|
|
53
|
-
options: EffectEntityCreateOptions = {},
|
|
54
|
-
): EffectEntity {
|
|
55
|
-
return this.createWithPlayback(scene, input, options);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
static playOnce(
|
|
59
|
-
scene: Phaser.Scene,
|
|
60
|
-
input: EffectAssetInput,
|
|
61
|
-
options: EffectEntityPlayOnceOptions = {},
|
|
62
|
-
): EffectEntity {
|
|
63
|
-
return this.createWithPlayback(
|
|
64
|
-
scene,
|
|
65
|
-
input,
|
|
66
|
-
{ ...options, autoplay: true, autoDestroy: true },
|
|
67
|
-
false,
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static startLoop(
|
|
72
|
-
scene: Phaser.Scene,
|
|
73
|
-
input: EffectAssetInput,
|
|
74
|
-
options: EffectEntityLoopOptions = {},
|
|
75
|
-
): EffectEntity {
|
|
76
|
-
return this.createWithPlayback(
|
|
77
|
-
scene,
|
|
78
|
-
input,
|
|
79
|
-
{ ...options, autoplay: true, autoDestroy: false },
|
|
80
|
-
true,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
private static createWithPlayback(
|
|
85
|
-
scene: Phaser.Scene,
|
|
86
|
-
input: EffectAssetInput,
|
|
87
|
-
options: EffectEntityCreateOptions,
|
|
88
|
-
playbackLoop?: boolean,
|
|
89
|
-
): EffectEntity {
|
|
90
|
-
const entityId = effectKey(input);
|
|
91
|
-
if (!scene?.add || !scene?.anims || !scene?.textures) {
|
|
92
|
-
throw new Error(`[EffectEntity] create('${entityId}') 需要有效 Phaser.Scene`);
|
|
93
|
-
}
|
|
94
|
-
if (!scene.textures.exists(entityId)) {
|
|
95
|
-
throw new Error(`[EffectEntity] 纹理 '${entityId}' 尚未 preload`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const animationKey = entityId;
|
|
99
|
-
const sprite = scene.add.sprite(options.x ?? 0, options.y ?? 0, entityId, 0);
|
|
100
|
-
const loop = playbackLoop ?? options.autoDestroy !== true;
|
|
101
|
-
const entity = new EffectEntity(
|
|
102
|
-
scene,
|
|
103
|
-
entityId,
|
|
104
|
-
animationKey,
|
|
105
|
-
loop,
|
|
106
|
-
options.autoDestroy ?? !loop,
|
|
107
|
-
options.onComplete,
|
|
108
|
-
sprite,
|
|
109
|
-
);
|
|
110
|
-
entity
|
|
111
|
-
.setScale(options.scale ?? 1)
|
|
112
|
-
.setPlaybackRate(options.playbackRate ?? 1)
|
|
113
|
-
.setRotation(options.rotation ?? 0)
|
|
114
|
-
.setAlpha(options.alpha ?? 1)
|
|
115
|
-
.setOrigin(options.originX ?? 0.5, options.originY ?? options.originX ?? 0.5)
|
|
116
|
-
.setDepth(options.depth ?? 0);
|
|
117
|
-
if (options.autoplay !== false) entity.play();
|
|
118
|
-
return entity;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
private constructor(
|
|
122
|
-
private readonly scene: Phaser.Scene,
|
|
123
|
-
readonly id: string,
|
|
124
|
-
private readonly animationKey: string,
|
|
125
|
-
readonly loop: boolean,
|
|
126
|
-
private readonly autoDestroy: boolean,
|
|
127
|
-
private readonly onComplete: ((entity: EffectEntity) => void) | undefined,
|
|
128
|
-
readonly sprite: Phaser.GameObjects.Sprite,
|
|
129
|
-
) {
|
|
130
|
-
this.scene.sys.events.once(Phaser.Scenes.Events.SHUTDOWN, this.destroy, this);
|
|
131
|
-
this.scene.sys.events.once(Phaser.Scenes.Events.DESTROY, this.destroy, this);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
play(restart = true): boolean {
|
|
135
|
-
if (this.destroyed) return false;
|
|
136
|
-
this.clearCompletionListener();
|
|
137
|
-
if (!this.loop) {
|
|
138
|
-
this.completionEvent = `animationcomplete-${this.animationKey}`;
|
|
139
|
-
this.completionHandler = () => {
|
|
140
|
-
this.clearCompletionListener();
|
|
141
|
-
if (this.destroyed) return;
|
|
142
|
-
this.onComplete?.(this);
|
|
143
|
-
if (this.autoDestroy) this.destroy();
|
|
144
|
-
};
|
|
145
|
-
this.sprite.once(this.completionEvent, this.completionHandler);
|
|
146
|
-
}
|
|
147
|
-
this.paused = false;
|
|
148
|
-
this.sprite.play({
|
|
149
|
-
key: this.animationKey,
|
|
150
|
-
repeat: this.loop ? -1 : 0,
|
|
151
|
-
}, !restart);
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
pause(): void {
|
|
156
|
-
if (this.destroyed || this.paused) return;
|
|
157
|
-
this.sprite.anims.pause();
|
|
158
|
-
this.paused = true;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
resume(): void {
|
|
162
|
-
if (this.destroyed || !this.paused) return;
|
|
163
|
-
this.sprite.anims.resume();
|
|
164
|
-
this.paused = false;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
stop(): void {
|
|
168
|
-
if (this.destroyed) return;
|
|
169
|
-
this.clearCompletionListener();
|
|
170
|
-
this.sprite.anims.stop();
|
|
171
|
-
this.paused = false;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
isPaused(): boolean { return this.paused; }
|
|
175
|
-
setPosition(x: number, y: number): this { this.sprite.setPosition(x, y); return this; }
|
|
176
|
-
setVisible(visible: boolean): this { this.sprite.setVisible(visible); return this; }
|
|
177
|
-
setScale(scale: number): this { const value = Number(scale); this.sprite.setScale(Number.isFinite(value) && value > 0 ? value : 1); return this; }
|
|
178
|
-
setPlaybackRate(rate: number): this {
|
|
179
|
-
const value = Number(rate);
|
|
180
|
-
this.sprite.anims.timeScale = Number.isFinite(value) && value > 0 ? value : 1;
|
|
181
|
-
return this;
|
|
182
|
-
}
|
|
183
|
-
setRotation(rotation: number): this { this.sprite.setRotation(rotation); return this; }
|
|
184
|
-
setAlpha(alpha: number): this { this.sprite.setAlpha(alpha); return this; }
|
|
185
|
-
setTint(color: number): this { this.sprite.setTint(color); return this; }
|
|
186
|
-
clearTint(): this { this.sprite.clearTint(); return this; }
|
|
187
|
-
setFlip(x: boolean, y = false): this { this.sprite.setFlip(x, y); return this; }
|
|
188
|
-
setOrigin(x: number, y = x): this { this.sprite.setOrigin(x, y); return this; }
|
|
189
|
-
setDepth(depth: number): this { this.sprite.setDepth(depth); return this; }
|
|
190
|
-
|
|
191
|
-
private clearCompletionListener(): void {
|
|
192
|
-
if (this.completionEvent && this.completionHandler) {
|
|
193
|
-
this.sprite.off(this.completionEvent, this.completionHandler);
|
|
194
|
-
}
|
|
195
|
-
this.completionEvent = null;
|
|
196
|
-
this.completionHandler = null;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
destroy(): void {
|
|
200
|
-
if (this.destroyed) return;
|
|
201
|
-
this.destroyed = true;
|
|
202
|
-
this.clearCompletionListener();
|
|
203
|
-
this.scene.sys.events.off(Phaser.Scenes.Events.SHUTDOWN, this.destroy, this);
|
|
204
|
-
this.scene.sys.events.off(Phaser.Scenes.Events.DESTROY, this.destroy, this);
|
|
205
|
-
if (this.sprite.active) this.sprite.destroy();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
isDestroyed(): boolean { return this.destroyed; }
|
|
209
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { FxManager } from './FxManager';
|
|
3
|
-
import {
|
|
4
|
-
defineMotion,
|
|
5
|
-
defineParticleEffect,
|
|
6
|
-
} from './FxRecipe';
|
|
7
|
-
|
|
8
|
-
vi.mock('phaser', () => ({
|
|
9
|
-
default: {
|
|
10
|
-
BlendModes: { NORMAL: 0, ADD: 1, MULTIPLY: 2, SCREEN: 3 },
|
|
11
|
-
Scenes: { Events: { SHUTDOWN: 'shutdown', DESTROY: 'destroy' } },
|
|
12
|
-
},
|
|
13
|
-
}));
|
|
14
|
-
|
|
15
|
-
function fixture() {
|
|
16
|
-
const emitter = {
|
|
17
|
-
setDepth: vi.fn().mockReturnThis(),
|
|
18
|
-
explode: vi.fn(),
|
|
19
|
-
destroy: vi.fn(),
|
|
20
|
-
};
|
|
21
|
-
const timer = { remove: vi.fn() };
|
|
22
|
-
const tween = {
|
|
23
|
-
once: vi.fn(),
|
|
24
|
-
destroy: vi.fn(),
|
|
25
|
-
};
|
|
26
|
-
const scene = {
|
|
27
|
-
textures: { exists: vi.fn(() => true) },
|
|
28
|
-
add: { particles: vi.fn(() => emitter) },
|
|
29
|
-
time: { delayedCall: vi.fn(() => timer) },
|
|
30
|
-
tweens: { chain: vi.fn(() => tween) },
|
|
31
|
-
sys: { events: { once: vi.fn() } },
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
scene,
|
|
35
|
-
emitter,
|
|
36
|
-
timer,
|
|
37
|
-
tween,
|
|
38
|
-
addParticles: scene.add.particles,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
describe('FxManager', () => {
|
|
43
|
-
it('用实际文件纹理建立有预算 burst,并自动安排清理', () => {
|
|
44
|
-
const recipe = defineParticleEffect({
|
|
45
|
-
kind: 'particle',
|
|
46
|
-
id: 'hit-sparks',
|
|
47
|
-
texture: 'spark_particle',
|
|
48
|
-
emission: { mode: 'burst', count: { min: 8, max: 12 } },
|
|
49
|
-
speed: { min: 40, max: 90 },
|
|
50
|
-
angle: { min: 0, max: 360 },
|
|
51
|
-
lifespan: { min: 180, max: 320 },
|
|
52
|
-
blendMode: 'add',
|
|
53
|
-
maxParticles: 16,
|
|
54
|
-
});
|
|
55
|
-
const value = fixture();
|
|
56
|
-
const handle = FxManager.playParticles(value.scene as never, recipe, {
|
|
57
|
-
x: 12,
|
|
58
|
-
y: 24,
|
|
59
|
-
depth: 7,
|
|
60
|
-
seed: 9,
|
|
61
|
-
});
|
|
62
|
-
expect(value.addParticles).toHaveBeenCalledWith(
|
|
63
|
-
12,
|
|
64
|
-
24,
|
|
65
|
-
'spark_particle',
|
|
66
|
-
expect.objectContaining({
|
|
67
|
-
emitting: false,
|
|
68
|
-
maxParticles: 12,
|
|
69
|
-
blendMode: 1,
|
|
70
|
-
}),
|
|
71
|
-
);
|
|
72
|
-
expect(value.emitter.explode).toHaveBeenCalledTimes(1);
|
|
73
|
-
expect(value.emitter.setDepth).toHaveBeenCalledWith(7);
|
|
74
|
-
expect(value.scene.time.delayedCall).toHaveBeenCalledWith(
|
|
75
|
-
440,
|
|
76
|
-
expect.any(Function),
|
|
77
|
-
[],
|
|
78
|
-
expect.anything(),
|
|
79
|
-
);
|
|
80
|
-
handle.destroy();
|
|
81
|
-
expect(value.emitter.destroy).toHaveBeenCalled();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('集中播放并清理 MotionRecipe', () => {
|
|
85
|
-
const recipe = defineMotion({
|
|
86
|
-
kind: 'motion',
|
|
87
|
-
id: 'pickup-pop',
|
|
88
|
-
steps: [
|
|
89
|
-
{ duration: 100, to: { scaleX: 1.2, scaleY: 1.2 } },
|
|
90
|
-
{ duration: 160, ease: 'Quad.out', to: { alpha: 0 }, by: { y: -20 } },
|
|
91
|
-
],
|
|
92
|
-
});
|
|
93
|
-
const value = fixture();
|
|
94
|
-
const target = { y: 0, alpha: 1, scaleX: 1, scaleY: 1 };
|
|
95
|
-
const handle = FxManager.playMotion(value.scene as never, target, recipe);
|
|
96
|
-
expect(value.scene.tweens.chain).toHaveBeenCalledWith(expect.objectContaining({
|
|
97
|
-
targets: target,
|
|
98
|
-
tweens: [
|
|
99
|
-
expect.objectContaining({ duration: 100, scaleX: 1.2 }),
|
|
100
|
-
expect.objectContaining({ duration: 160, y: '-=20', alpha: 0 }),
|
|
101
|
-
],
|
|
102
|
-
}));
|
|
103
|
-
handle.destroy();
|
|
104
|
-
expect(value.tween.destroy).toHaveBeenCalled();
|
|
105
|
-
});
|
|
106
|
-
});
|
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
import Phaser from 'phaser';
|
|
2
|
-
import type {
|
|
3
|
-
MotionRecipe,
|
|
4
|
-
ParticleEffectRecipe,
|
|
5
|
-
} from './FxRecipe';
|
|
6
|
-
|
|
7
|
-
export interface FxBudget {
|
|
8
|
-
readonly maxActiveEmitters: number;
|
|
9
|
-
readonly maxActiveParticles: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ParticlePlayOptions {
|
|
13
|
-
readonly x: number;
|
|
14
|
-
readonly y: number;
|
|
15
|
-
readonly depth?: number;
|
|
16
|
-
readonly countScale?: number;
|
|
17
|
-
readonly seed?: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface FxHandle {
|
|
21
|
-
readonly recipeId: string;
|
|
22
|
-
destroy(): void;
|
|
23
|
-
isDestroyed(): boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface ParticleFxHandle extends FxHandle {
|
|
27
|
-
readonly emitter: Phaser.GameObjects.Particles.ParticleEmitter;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface MotionFxHandle extends FxHandle {
|
|
31
|
-
readonly tween: Phaser.Tweens.TweenChain;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface FxSceneState {
|
|
35
|
-
budget: FxBudget;
|
|
36
|
-
handles: Set<FxHandleImpl>;
|
|
37
|
-
activeParticles: number;
|
|
38
|
-
sequence: number;
|
|
39
|
-
cleanupBound: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const DEFAULT_BUDGET: FxBudget = Object.freeze({
|
|
43
|
-
maxActiveEmitters: 32,
|
|
44
|
-
maxActiveParticles: 1024,
|
|
45
|
-
});
|
|
46
|
-
const sceneStates = new WeakMap<Phaser.Scene, FxSceneState>();
|
|
47
|
-
|
|
48
|
-
function positiveInteger(value: number, label: string): number {
|
|
49
|
-
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
50
|
-
throw new RangeError(`[FxManager] ${label} 必须是正整数`);
|
|
51
|
-
}
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function finite(value: number | undefined, fallback: number): number {
|
|
56
|
-
return value === undefined || !Number.isFinite(value) ? fallback : value;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function hashSeed(value: string): number {
|
|
60
|
-
let hash = 0x811c9dc5;
|
|
61
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
62
|
-
hash ^= value.charCodeAt(index);
|
|
63
|
-
hash = Math.imul(hash, 0x01000193);
|
|
64
|
-
}
|
|
65
|
-
return hash >>> 0 || 0x9e3779b9;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function randomInteger(min: number, max: number, seed: number): number {
|
|
69
|
-
let value = seed >>> 0 || 0x9e3779b9;
|
|
70
|
-
value ^= value << 13;
|
|
71
|
-
value ^= value >>> 17;
|
|
72
|
-
value ^= value << 5;
|
|
73
|
-
const unit = (value >>> 0) / 0x1_0000_0000;
|
|
74
|
-
return Math.min(max, Math.floor(min + unit * (max - min + 1)));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function blendMode(value: ParticleEffectRecipe['blendMode']): number {
|
|
78
|
-
switch (value) {
|
|
79
|
-
case 'add':
|
|
80
|
-
return Phaser.BlendModes.ADD;
|
|
81
|
-
case 'multiply':
|
|
82
|
-
return Phaser.BlendModes.MULTIPLY;
|
|
83
|
-
case 'screen':
|
|
84
|
-
return Phaser.BlendModes.SCREEN;
|
|
85
|
-
default:
|
|
86
|
-
return Phaser.BlendModes.NORMAL;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function stateFor(scene: Phaser.Scene): FxSceneState {
|
|
91
|
-
if (!scene?.sys?.events || !scene.add?.particles || !scene.time || !scene.tweens) {
|
|
92
|
-
throw new Error('[FxManager] 需要有效 Phaser Scene');
|
|
93
|
-
}
|
|
94
|
-
let state = sceneStates.get(scene);
|
|
95
|
-
if (!state) {
|
|
96
|
-
state = {
|
|
97
|
-
budget: DEFAULT_BUDGET,
|
|
98
|
-
handles: new Set(),
|
|
99
|
-
activeParticles: 0,
|
|
100
|
-
sequence: 0,
|
|
101
|
-
cleanupBound: false,
|
|
102
|
-
};
|
|
103
|
-
sceneStates.set(scene, state);
|
|
104
|
-
}
|
|
105
|
-
if (!state.cleanupBound) {
|
|
106
|
-
state.cleanupBound = true;
|
|
107
|
-
scene.sys.events.once(Phaser.Scenes.Events.SHUTDOWN, () => FxManager.clear(scene));
|
|
108
|
-
scene.sys.events.once(Phaser.Scenes.Events.DESTROY, () => FxManager.clear(scene));
|
|
109
|
-
}
|
|
110
|
-
return state;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function particleTexture(
|
|
114
|
-
scene: Phaser.Scene,
|
|
115
|
-
recipe: ParticleEffectRecipe,
|
|
116
|
-
): Readonly<{ key: string; frame?: number }> {
|
|
117
|
-
const key = recipe.texture.trim();
|
|
118
|
-
if (!scene.textures.exists(key)) {
|
|
119
|
-
throw new Error(`[FxManager] 粒子纹理 '${key}' 尚未 preload/load`);
|
|
120
|
-
}
|
|
121
|
-
return Object.freeze({
|
|
122
|
-
key,
|
|
123
|
-
...(recipe.frame === undefined ? {} : { frame: recipe.frame }),
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function estimateParticles(recipe: ParticleEffectRecipe, countScale: number): number {
|
|
128
|
-
const maximum = recipe.emission.mode === 'burst'
|
|
129
|
-
? Math.ceil(recipe.emission.count.max * countScale)
|
|
130
|
-
: recipe.emission.duration === undefined
|
|
131
|
-
? recipe.maxParticles ?? 128
|
|
132
|
-
: Math.ceil(
|
|
133
|
-
recipe.emission.duration
|
|
134
|
-
/ recipe.emission.frequency
|
|
135
|
-
* recipe.emission.quantity,
|
|
136
|
-
);
|
|
137
|
-
return Math.max(1, Math.min(recipe.maxParticles ?? 128, maximum));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
abstract class FxHandleImpl implements FxHandle {
|
|
141
|
-
private destroyed = false;
|
|
142
|
-
|
|
143
|
-
protected constructor(
|
|
144
|
-
protected readonly scene: Phaser.Scene,
|
|
145
|
-
protected readonly state: FxSceneState,
|
|
146
|
-
readonly recipeId: string,
|
|
147
|
-
private readonly particleReservation: number,
|
|
148
|
-
) {
|
|
149
|
-
state.handles.add(this);
|
|
150
|
-
state.activeParticles += particleReservation;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
destroy(): void {
|
|
154
|
-
if (this.destroyed) return;
|
|
155
|
-
this.destroyed = true;
|
|
156
|
-
this.destroyRuntime();
|
|
157
|
-
this.state.handles.delete(this);
|
|
158
|
-
this.state.activeParticles = Math.max(
|
|
159
|
-
0,
|
|
160
|
-
this.state.activeParticles - this.particleReservation,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
isDestroyed(): boolean {
|
|
165
|
-
return this.destroyed;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
protected abstract destroyRuntime(): void;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
class ParticleHandleImpl extends FxHandleImpl implements ParticleFxHandle {
|
|
172
|
-
private timers: Phaser.Time.TimerEvent[] = [];
|
|
173
|
-
|
|
174
|
-
constructor(
|
|
175
|
-
scene: Phaser.Scene,
|
|
176
|
-
state: FxSceneState,
|
|
177
|
-
recipeId: string,
|
|
178
|
-
reservation: number,
|
|
179
|
-
readonly emitter: Phaser.GameObjects.Particles.ParticleEmitter,
|
|
180
|
-
) {
|
|
181
|
-
super(scene, state, recipeId, reservation);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
schedule(delay: number): void {
|
|
185
|
-
this.timers.push(this.scene.time.delayedCall(delay, this.destroy, [], this));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
scheduleFlowStop(duration: number, tail: number): void {
|
|
189
|
-
this.timers.push(this.scene.time.delayedCall(duration, () => {
|
|
190
|
-
if (this.isDestroyed()) return;
|
|
191
|
-
this.emitter.stop();
|
|
192
|
-
this.schedule(tail);
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
protected destroyRuntime(): void {
|
|
197
|
-
for (const timer of this.timers) timer.remove(false);
|
|
198
|
-
this.timers = [];
|
|
199
|
-
this.emitter.destroy();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
class MotionHandleImpl extends FxHandleImpl implements MotionFxHandle {
|
|
204
|
-
constructor(
|
|
205
|
-
scene: Phaser.Scene,
|
|
206
|
-
state: FxSceneState,
|
|
207
|
-
recipeId: string,
|
|
208
|
-
readonly tween: Phaser.Tweens.TweenChain,
|
|
209
|
-
) {
|
|
210
|
-
super(scene, state, recipeId, 0);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
protected destroyRuntime(): void {
|
|
214
|
-
this.tween.destroy();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function playParticles(
|
|
219
|
-
scene: Phaser.Scene,
|
|
220
|
-
recipe: ParticleEffectRecipe,
|
|
221
|
-
options: ParticlePlayOptions,
|
|
222
|
-
): ParticleFxHandle {
|
|
223
|
-
const state = stateFor(scene);
|
|
224
|
-
const activeEmitters = [...state.handles]
|
|
225
|
-
.filter((handle) => handle instanceof ParticleHandleImpl)
|
|
226
|
-
.length;
|
|
227
|
-
if (activeEmitters >= state.budget.maxActiveEmitters) {
|
|
228
|
-
throw new Error('[FxManager] active emitter 预算已满');
|
|
229
|
-
}
|
|
230
|
-
const countScale = Math.min(2, Math.max(0.25, finite(options.countScale, 1)));
|
|
231
|
-
const requested = estimateParticles(recipe, countScale);
|
|
232
|
-
const remaining = state.budget.maxActiveParticles - state.activeParticles;
|
|
233
|
-
const reservation = Math.min(requested, remaining);
|
|
234
|
-
if (reservation <= 0) throw new Error('[FxManager] active particle 预算已满');
|
|
235
|
-
|
|
236
|
-
const texture = particleTexture(scene, recipe);
|
|
237
|
-
const flow = recipe.emission.mode === 'flow';
|
|
238
|
-
const emitter = scene.add.particles(
|
|
239
|
-
finite(options.x, 0),
|
|
240
|
-
finite(options.y, 0),
|
|
241
|
-
texture.key,
|
|
242
|
-
{
|
|
243
|
-
emitting: flow,
|
|
244
|
-
maxParticles: reservation,
|
|
245
|
-
speed: recipe.speed,
|
|
246
|
-
angle: recipe.angle,
|
|
247
|
-
lifespan: recipe.lifespan,
|
|
248
|
-
...(texture.frame === undefined ? {} : { frame: texture.frame }),
|
|
249
|
-
...(recipe.scale ? { scale: recipe.scale } : {}),
|
|
250
|
-
...(recipe.alpha ? { alpha: recipe.alpha } : {}),
|
|
251
|
-
...(recipe.rotate ? { rotate: recipe.rotate } : {}),
|
|
252
|
-
...(recipe.gravityY === undefined ? {} : { gravityY: recipe.gravityY }),
|
|
253
|
-
...(flow
|
|
254
|
-
? {
|
|
255
|
-
frequency: recipe.emission.frequency,
|
|
256
|
-
quantity: Math.min(recipe.emission.quantity, reservation),
|
|
257
|
-
}
|
|
258
|
-
: {}),
|
|
259
|
-
blendMode: blendMode(recipe.blendMode),
|
|
260
|
-
},
|
|
261
|
-
);
|
|
262
|
-
emitter.setDepth(finite(options.depth, 0));
|
|
263
|
-
const handle = new ParticleHandleImpl(
|
|
264
|
-
scene,
|
|
265
|
-
state,
|
|
266
|
-
recipe.id,
|
|
267
|
-
reservation,
|
|
268
|
-
emitter,
|
|
269
|
-
);
|
|
270
|
-
if (!flow) {
|
|
271
|
-
const minimum = Math.min(reservation, Math.round(recipe.emission.count.min * countScale));
|
|
272
|
-
const maximum = Math.min(reservation, Math.round(recipe.emission.count.max * countScale));
|
|
273
|
-
const seed = options.seed ?? hashSeed(
|
|
274
|
-
`${recipe.id}:${options.x}:${options.y}:${state.sequence++}`,
|
|
275
|
-
);
|
|
276
|
-
emitter.explode(randomInteger(minimum, Math.max(minimum, maximum), seed), 0, 0);
|
|
277
|
-
handle.schedule(recipe.lifespan.max + 120);
|
|
278
|
-
} else if (recipe.emission.duration !== undefined) {
|
|
279
|
-
handle.scheduleFlowStop(recipe.emission.duration, recipe.lifespan.max + 120);
|
|
280
|
-
}
|
|
281
|
-
return handle;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function playMotion(
|
|
285
|
-
scene: Phaser.Scene,
|
|
286
|
-
target: object,
|
|
287
|
-
recipe: MotionRecipe,
|
|
288
|
-
): MotionFxHandle {
|
|
289
|
-
const state = stateFor(scene);
|
|
290
|
-
if (!target || typeof target !== 'object') {
|
|
291
|
-
throw new TypeError('[FxManager] motion target 必须是 Object');
|
|
292
|
-
}
|
|
293
|
-
const tween = scene.tweens.chain({
|
|
294
|
-
targets: target,
|
|
295
|
-
repeat: recipe.repeat ?? 0,
|
|
296
|
-
yoyo: recipe.yoyo ?? false,
|
|
297
|
-
tweens: recipe.steps.map((step) => ({
|
|
298
|
-
...(step.to ?? {}),
|
|
299
|
-
...Object.fromEntries(
|
|
300
|
-
Object.entries(step.by ?? {}).map(([property, value]) => [
|
|
301
|
-
property,
|
|
302
|
-
`${value < 0 ? '-=' : '+='}${Math.abs(value)}`,
|
|
303
|
-
]),
|
|
304
|
-
),
|
|
305
|
-
duration: step.duration,
|
|
306
|
-
ease: step.ease ?? 'Linear',
|
|
307
|
-
hold: step.hold ?? 0,
|
|
308
|
-
})),
|
|
309
|
-
});
|
|
310
|
-
const handle = new MotionHandleImpl(scene, state, recipe.id, tween);
|
|
311
|
-
tween.once('complete', handle.destroy, handle);
|
|
312
|
-
return handle;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
function configure(scene: Phaser.Scene, budget: Partial<FxBudget>): void {
|
|
316
|
-
const state = stateFor(scene);
|
|
317
|
-
state.budget = Object.freeze({
|
|
318
|
-
maxActiveEmitters: positiveInteger(
|
|
319
|
-
budget.maxActiveEmitters ?? state.budget.maxActiveEmitters,
|
|
320
|
-
'maxActiveEmitters',
|
|
321
|
-
),
|
|
322
|
-
maxActiveParticles: positiveInteger(
|
|
323
|
-
budget.maxActiveParticles ?? state.budget.maxActiveParticles,
|
|
324
|
-
'maxActiveParticles',
|
|
325
|
-
),
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function clear(scene: Phaser.Scene): void {
|
|
330
|
-
const state = sceneStates.get(scene);
|
|
331
|
-
if (!state) return;
|
|
332
|
-
for (const handle of [...state.handles]) handle.destroy();
|
|
333
|
-
sceneStates.delete(scene);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export const FxManager = Object.freeze({
|
|
337
|
-
configure,
|
|
338
|
-
playParticles,
|
|
339
|
-
playMotion,
|
|
340
|
-
clear,
|
|
341
|
-
});
|