@craft_eco/craft-mcp 0.1.22 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -7
- package/bin/craft-mcp.mjs +10 -2
- 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/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/server.mjs +13 -9
- package/dist-server/preview/preview-launcher.mjs +9 -2
- package/dist-server/preview/preview-start.mjs +2 -2
- package/package.json +10 -1
- 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 +71 -6
- 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 +31 -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 +19 -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 +16 -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 +17 -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 +2 -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 +9 -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 +10 -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,65 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import type Phaser from 'phaser';
|
|
3
|
-
import { AudioManager } from './AudioManager';
|
|
4
|
-
|
|
5
|
-
vi.mock('../logManager/LogManager', () => ({
|
|
6
|
-
LogManager: {
|
|
7
|
-
info: vi.fn(),
|
|
8
|
-
warn: vi.fn(),
|
|
9
|
-
error: vi.fn(),
|
|
10
|
-
},
|
|
11
|
-
}));
|
|
12
|
-
|
|
13
|
-
function createScene(audioExists = true) {
|
|
14
|
-
const soundObj = {
|
|
15
|
-
play: vi.fn(),
|
|
16
|
-
setVolume: vi.fn(),
|
|
17
|
-
once: vi.fn(),
|
|
18
|
-
isPlaying: false,
|
|
19
|
-
};
|
|
20
|
-
const add = vi.fn(() => soundObj);
|
|
21
|
-
const scene = {
|
|
22
|
-
load: {},
|
|
23
|
-
cache: {
|
|
24
|
-
audio: { exists: vi.fn(() => audioExists) },
|
|
25
|
-
},
|
|
26
|
-
sound: {
|
|
27
|
-
add,
|
|
28
|
-
unlock: vi.fn(),
|
|
29
|
-
volume: 1,
|
|
30
|
-
mute: false,
|
|
31
|
-
},
|
|
32
|
-
tweens: { add: vi.fn() },
|
|
33
|
-
} as unknown as Phaser.Scene;
|
|
34
|
-
return { scene, add, soundObj };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
describe('AudioManager', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
vi.clearAllMocks();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
afterEach(async () => {
|
|
43
|
-
AudioManager.stopAllSfx();
|
|
44
|
-
await AudioManager.stopBgm({ fadeSeconds: 0 });
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('未 preload 时 playBgm/playSfx 失败', async () => {
|
|
48
|
-
const { scene, add } = createScene(false);
|
|
49
|
-
AudioManager.bindScene(scene);
|
|
50
|
-
|
|
51
|
-
await expect(AudioManager.playBgm('bgm', { fadeSeconds: 0 })).resolves.toBe(false);
|
|
52
|
-
await expect(AudioManager.playSfx('hit')).resolves.toBe(false);
|
|
53
|
-
expect(add).not.toHaveBeenCalled();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('已 preload 时 playBgm 走 sound.add', async () => {
|
|
57
|
-
const { scene, add, soundObj } = createScene(true);
|
|
58
|
-
AudioManager.bindScene(scene);
|
|
59
|
-
|
|
60
|
-
await expect(AudioManager.playBgm('bgm', { fadeSeconds: 0 })).resolves.toBe(true);
|
|
61
|
-
expect(add).toHaveBeenCalledWith('bgm', expect.objectContaining({ loop: true }));
|
|
62
|
-
expect(soundObj.play).toHaveBeenCalled();
|
|
63
|
-
expect(AudioManager.getBgmAsset()).toBe('bgm');
|
|
64
|
-
});
|
|
65
|
-
});
|
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import Phaser from 'phaser';
|
|
2
|
-
import { LogManager } from '../logManager/LogManager';
|
|
3
|
-
|
|
4
|
-
const LOG_TAG = 'AudioManager';
|
|
5
|
-
const DEFAULT_SFX_POOL_SIZE = 16;
|
|
6
|
-
const DEFAULT_BGM_FADE_SECONDS = 0.5;
|
|
7
|
-
|
|
8
|
-
type AudioSlot = string;
|
|
9
|
-
export type AudioAssetInput = string;
|
|
10
|
-
type PlayableSound = Phaser.Sound.BaseSound & { setVolume(value: number): unknown };
|
|
11
|
-
|
|
12
|
-
export interface AudioSceneLease {
|
|
13
|
-
readonly id: number;
|
|
14
|
-
readonly scene: Phaser.Scene;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface BgmOptions {
|
|
18
|
-
fadeSeconds?: number;
|
|
19
|
-
loop?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface SfxOptions {
|
|
23
|
-
volumeDb?: number;
|
|
24
|
-
throttleMs?: number;
|
|
25
|
-
maxConcurrent?: number;
|
|
26
|
-
pitch?: number;
|
|
27
|
-
/** 循环环境音等持续音效;离开 owner 时必须调用 stopSfx(id)。 */
|
|
28
|
-
loop?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface AudioSettings {
|
|
32
|
-
master: number;
|
|
33
|
-
bgm: number;
|
|
34
|
-
sfx: number;
|
|
35
|
-
muted: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface SfxRecord {
|
|
39
|
-
id: AudioSlot;
|
|
40
|
-
sound: PlayableSound;
|
|
41
|
-
gain: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function clamp01(value: unknown): number {
|
|
45
|
-
return Math.min(Math.max(Number(value) || 0, 0), 1);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function dbToGain(db: unknown): number {
|
|
49
|
-
return Math.pow(10, Number(db || 0) / 20);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function audioSlot(input: AudioAssetInput): AudioSlot {
|
|
53
|
-
const id = String(input ?? '').trim();
|
|
54
|
-
if (!id) throw new Error('[AudioManager] audio key 不能为空');
|
|
55
|
-
return id;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
class AudioManagerClass extends EventTarget {
|
|
59
|
-
private activeScene: Phaser.Scene | null = null;
|
|
60
|
-
private activeLease: AudioSceneLease | null = null;
|
|
61
|
-
private nextLeaseId = 1;
|
|
62
|
-
private bgmSound: PlayableSound | null = null;
|
|
63
|
-
private bgmAsset: AudioSlot | null = null;
|
|
64
|
-
private bgmFadeTween: Phaser.Tweens.Tween | null = null;
|
|
65
|
-
private sfxInstances: SfxRecord[] = [];
|
|
66
|
-
private sfxActive = new Map<string, Set<SfxRecord>>();
|
|
67
|
-
private sfxLastPlayMs = new Map<string, number>();
|
|
68
|
-
|
|
69
|
-
sfxPoolSize = DEFAULT_SFX_POOL_SIZE;
|
|
70
|
-
bgmDefaultFadeSeconds = DEFAULT_BGM_FADE_SECONDS;
|
|
71
|
-
masterVolume = 1;
|
|
72
|
-
bgmVolume = 1;
|
|
73
|
-
sfxVolume = 1;
|
|
74
|
-
muted = false;
|
|
75
|
-
|
|
76
|
-
/** @internal 由常驻 RuntimeHostScene 获取音频 lease。 */
|
|
77
|
-
bindScene(scene: Phaser.Scene | null): AudioSceneLease | null {
|
|
78
|
-
if (!scene?.sound || !scene?.load) return null;
|
|
79
|
-
this.stopBgmFade();
|
|
80
|
-
this.bgmSound?.setVolume(this.bgmVolume);
|
|
81
|
-
this.activeLease = Object.freeze({ id: this.nextLeaseId++, scene });
|
|
82
|
-
this.activeScene = scene;
|
|
83
|
-
try { scene.sound.unlock?.(); } catch { /* 浏览器尚未允许音频时等待用户手势 */ }
|
|
84
|
-
this.applyVolumes(scene.sound);
|
|
85
|
-
return this.activeLease;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** @internal 旧 RuntimeHostScene 的迟到 shutdown 不得释放新 owner。 */
|
|
89
|
-
unbindScene(lease: AudioSceneLease): boolean {
|
|
90
|
-
if (this.activeLease !== lease) return false;
|
|
91
|
-
this.stopBgmFade();
|
|
92
|
-
this.activeLease = null;
|
|
93
|
-
this.activeScene = null;
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** @internal */
|
|
98
|
-
isCurrentScene(lease: AudioSceneLease | null): boolean {
|
|
99
|
-
return lease !== null && this.activeLease === lease;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async playBgm(input: AudioAssetInput, options: BgmOptions = {}): Promise<boolean> {
|
|
103
|
-
const scene = this.requireScene('playBgm');
|
|
104
|
-
if (!scene) return false;
|
|
105
|
-
const id = audioSlot(input);
|
|
106
|
-
const silent = this.requireAudioSlot(id);
|
|
107
|
-
if (this.bgmAsset === id && (silent || this.bgmSound?.isPlaying)) return true;
|
|
108
|
-
if (!(await this.ensureLoaded(scene, id))) return false;
|
|
109
|
-
|
|
110
|
-
const fadeSeconds = Math.max(0, options.fadeSeconds ?? this.bgmDefaultFadeSeconds);
|
|
111
|
-
if (this.bgmSound) await this.stopBgm({ fadeSeconds });
|
|
112
|
-
if (silent) {
|
|
113
|
-
this.bgmSound = null;
|
|
114
|
-
this.bgmAsset = id;
|
|
115
|
-
this.emit('bgmChanged', { assetId: id });
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
const sound = scene.sound.add(String(id), {
|
|
119
|
-
loop: options.loop ?? true,
|
|
120
|
-
volume: fadeSeconds > 0 ? 0 : this.bgmVolume,
|
|
121
|
-
}) as PlayableSound;
|
|
122
|
-
sound.play();
|
|
123
|
-
this.bgmSound = sound;
|
|
124
|
-
this.bgmAsset = id;
|
|
125
|
-
if (fadeSeconds > 0) {
|
|
126
|
-
const tween = scene.tweens.add({
|
|
127
|
-
targets: sound,
|
|
128
|
-
volume: this.bgmVolume,
|
|
129
|
-
duration: fadeSeconds * 1000,
|
|
130
|
-
} as Phaser.Types.Tweens.TweenBuilderConfig);
|
|
131
|
-
this.bgmFadeTween = tween;
|
|
132
|
-
tween.once('complete', () => {
|
|
133
|
-
if (this.bgmFadeTween === tween) this.bgmFadeTween = null;
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
this.emit('bgmChanged', { assetId: id });
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async stopBgm(options: { fadeSeconds?: number } = {}): Promise<void> {
|
|
141
|
-
const sound = this.bgmSound;
|
|
142
|
-
if (!sound) {
|
|
143
|
-
this.bgmAsset = null;
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const scene = this.activeScene;
|
|
147
|
-
const fadeSeconds = Math.max(0, options.fadeSeconds ?? this.bgmDefaultFadeSeconds);
|
|
148
|
-
this.stopBgmFade();
|
|
149
|
-
if (scene?.tweens && fadeSeconds > 0) {
|
|
150
|
-
await new Promise<void>((resolve) => {
|
|
151
|
-
const tween = scene.tweens.add({
|
|
152
|
-
targets: sound,
|
|
153
|
-
volume: 0,
|
|
154
|
-
duration: fadeSeconds * 1000,
|
|
155
|
-
} as Phaser.Types.Tweens.TweenBuilderConfig);
|
|
156
|
-
this.bgmFadeTween = tween;
|
|
157
|
-
tween.once('complete', resolve);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
this.destroySound(sound);
|
|
161
|
-
if (this.bgmSound === sound) {
|
|
162
|
-
this.bgmSound = null;
|
|
163
|
-
this.bgmAsset = null;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
pauseBgm(): boolean {
|
|
168
|
-
if (!this.bgmSound?.isPlaying) return false;
|
|
169
|
-
this.bgmSound.pause();
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
resumeBgm(): boolean {
|
|
174
|
-
if (!this.bgmSound?.isPaused) return false;
|
|
175
|
-
this.bgmSound.resume();
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
getBgmAsset(): AudioSlot | null {
|
|
180
|
-
return this.bgmAsset;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
async playSfx(input: AudioAssetInput, options: SfxOptions = {}): Promise<boolean> {
|
|
184
|
-
const scene = this.requireScene('playSfx');
|
|
185
|
-
if (!scene) return false;
|
|
186
|
-
const id = audioSlot(input);
|
|
187
|
-
const silent = this.requireAudioSlot(id);
|
|
188
|
-
if (silent) return this.ensureLoaded(scene, id);
|
|
189
|
-
const key = String(id);
|
|
190
|
-
const throttleMs = Math.max(0, Number(options.throttleMs ?? 0));
|
|
191
|
-
const now = performance.now();
|
|
192
|
-
if (throttleMs > 0 && now - (this.sfxLastPlayMs.get(key) ?? -Infinity) < throttleMs) return false;
|
|
193
|
-
const maxConcurrent = Math.max(0, Number(options.maxConcurrent ?? 0));
|
|
194
|
-
if (maxConcurrent > 0 && this.countActiveSfxBySlot(id) >= maxConcurrent) return false;
|
|
195
|
-
if (!(await this.ensureLoaded(scene, id))) return false;
|
|
196
|
-
|
|
197
|
-
this.sfxLastPlayMs.set(key, now);
|
|
198
|
-
while (this.sfxInstances.length >= this.sfxPoolSize) {
|
|
199
|
-
const oldest = this.sfxInstances.shift();
|
|
200
|
-
if (oldest) this.destroySfx(oldest);
|
|
201
|
-
}
|
|
202
|
-
const gain = dbToGain(options.volumeDb ?? 0);
|
|
203
|
-
const sound = scene.sound.add(key, {
|
|
204
|
-
volume: this.sfxVolume * gain,
|
|
205
|
-
rate: Math.max(0.01, Number(options.pitch ?? 1)),
|
|
206
|
-
loop: options.loop ?? false,
|
|
207
|
-
}) as PlayableSound;
|
|
208
|
-
const record: SfxRecord = { id, sound, gain };
|
|
209
|
-
this.trackSfx(record);
|
|
210
|
-
sound.once('complete', () => this.destroySfx(record));
|
|
211
|
-
sound.once('stop', () => this.destroySfx(record));
|
|
212
|
-
sound.play();
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
stopSfx(input: AudioAssetInput): void {
|
|
217
|
-
const id = audioSlot(input);
|
|
218
|
-
this.requireAudioSlot(id);
|
|
219
|
-
for (const record of [...(this.sfxActive.get(String(id)) ?? [])]) this.destroySfx(record);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
stopAllSfx(): void {
|
|
223
|
-
for (const record of [...this.sfxInstances]) this.destroySfx(record);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
isSfxPlaying(input: AudioAssetInput): boolean {
|
|
227
|
-
return this.countActiveSfx(input) > 0;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
countActiveSfx(input: AudioAssetInput): number {
|
|
231
|
-
const id = audioSlot(input);
|
|
232
|
-
this.requireAudioSlot(id);
|
|
233
|
-
return this.countActiveSfxBySlot(id);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
setMasterVolume(value: number): void {
|
|
237
|
-
this.masterVolume = clamp01(value);
|
|
238
|
-
this.applyVolumes(this.activeScene?.sound);
|
|
239
|
-
this.emit('volumeChanged', { category: 'master', volume: this.masterVolume });
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
setBgmVolume(value: number): void {
|
|
243
|
-
this.bgmVolume = clamp01(value);
|
|
244
|
-
this.applyVolumes();
|
|
245
|
-
this.emit('volumeChanged', { category: 'bgm', volume: this.bgmVolume });
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
setSfxVolume(value: number): void {
|
|
249
|
-
this.sfxVolume = clamp01(value);
|
|
250
|
-
this.applyVolumes();
|
|
251
|
-
this.emit('volumeChanged', { category: 'sfx', volume: this.sfxVolume });
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
setMuted(muted: boolean): void {
|
|
255
|
-
this.muted = Boolean(muted);
|
|
256
|
-
this.applyVolumes(this.activeScene?.sound);
|
|
257
|
-
this.emit('mutedChanged', { muted: this.muted });
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
saveSettings(): AudioSettings {
|
|
261
|
-
return {
|
|
262
|
-
master: this.masterVolume,
|
|
263
|
-
bgm: this.bgmVolume,
|
|
264
|
-
sfx: this.sfxVolume,
|
|
265
|
-
muted: this.muted,
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
loadSettings(settings: Partial<AudioSettings>): void {
|
|
270
|
-
if (settings.master !== undefined) this.masterVolume = clamp01(settings.master);
|
|
271
|
-
if (settings.bgm !== undefined) this.bgmVolume = clamp01(settings.bgm);
|
|
272
|
-
if (settings.sfx !== undefined) this.sfxVolume = clamp01(settings.sfx);
|
|
273
|
-
if (settings.muted !== undefined) this.muted = Boolean(settings.muted);
|
|
274
|
-
this.applyVolumes(this.activeScene?.sound);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
private requireAudioSlot(id: AudioSlot): boolean {
|
|
278
|
-
audioSlot(id);
|
|
279
|
-
return false;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
private countActiveSfxBySlot(id: AudioSlot): number {
|
|
283
|
-
return this.sfxActive.get(id)?.size ?? 0;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
private async ensureLoaded(scene: Phaser.Scene, id: AudioSlot): Promise<boolean> {
|
|
287
|
-
if (scene.cache?.audio?.exists(id)) return true;
|
|
288
|
-
LogManager.error(`音频尚未 preload: ${String(id)}`, LOG_TAG);
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
private requireScene(apiName: string): Phaser.Scene | null {
|
|
293
|
-
if (this.activeScene?.sound && this.activeScene.load) return this.activeScene;
|
|
294
|
-
LogManager.warn(`${apiName} 需要框架音频宿主已就绪`, LOG_TAG);
|
|
295
|
-
return null;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
private applyVolumes(soundManager?: Phaser.Sound.BaseSoundManager): void {
|
|
299
|
-
if (soundManager) {
|
|
300
|
-
soundManager.volume = this.masterVolume;
|
|
301
|
-
soundManager.mute = this.muted;
|
|
302
|
-
}
|
|
303
|
-
if (this.bgmSound && !this.bgmFadeTween) this.bgmSound.setVolume(this.bgmVolume);
|
|
304
|
-
for (const record of this.sfxInstances) record.sound.setVolume(this.sfxVolume * record.gain);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
private stopBgmFade(): void {
|
|
308
|
-
try { this.bgmFadeTween?.remove(); } catch { /* tween 已结束 */ }
|
|
309
|
-
this.bgmFadeTween = null;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
private destroySound(sound: PlayableSound): void {
|
|
313
|
-
try { sound.stop(); } catch { /* 已停止 */ }
|
|
314
|
-
try { sound.destroy(); } catch { /* 已销毁 */ }
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
private trackSfx(record: SfxRecord): void {
|
|
318
|
-
this.sfxInstances.push(record);
|
|
319
|
-
const key = String(record.id);
|
|
320
|
-
const active = this.sfxActive.get(key) ?? new Set<SfxRecord>();
|
|
321
|
-
active.add(record);
|
|
322
|
-
this.sfxActive.set(key, active);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
private destroySfx(record: SfxRecord): void {
|
|
326
|
-
const index = this.sfxInstances.indexOf(record);
|
|
327
|
-
if (index >= 0) this.sfxInstances.splice(index, 1);
|
|
328
|
-
const key = String(record.id);
|
|
329
|
-
const active = this.sfxActive.get(key);
|
|
330
|
-
active?.delete(record);
|
|
331
|
-
if (active?.size === 0) this.sfxActive.delete(key);
|
|
332
|
-
this.destroySound(record.sound);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
private emit(type: string, detail: unknown): void {
|
|
336
|
-
this.dispatchEvent(new CustomEvent(type, { detail }));
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
export const AudioManager = new AudioManagerClass();
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { buildOverrideIndex, resolveFeatureData } from './tuneRuntime.mjs';
|
|
2
|
-
import type { Resolved, TuneControl } from './tuneRuntime.mjs';
|
|
3
|
-
|
|
4
|
-
declare const __LIGHTGAME_DATA_CONTROL_CONFIG__: unknown;
|
|
5
|
-
|
|
6
|
-
// feature config 只需从本模块 import:defineFeatureConfig 声明配置。
|
|
7
|
-
// tune.* 仅在需要覆盖自动推断结果时使用(连续调节整数、生成枚举下拉)。
|
|
8
|
-
export { tune } from './tuneRuntime.mjs';
|
|
9
|
-
export type { TuneControl, TuneType, Tuned } from './tuneRuntime.mjs';
|
|
10
|
-
|
|
11
|
-
const OWNER_RE = /^[a-z][A-Za-z0-9]*$/;
|
|
12
|
-
|
|
13
|
-
type DeepReadonly<Value> =
|
|
14
|
-
Value extends (...args: any[]) => unknown
|
|
15
|
-
? Value
|
|
16
|
-
: Value extends readonly (infer Item)[]
|
|
17
|
-
? readonly DeepReadonly<Item>[]
|
|
18
|
-
: Value extends object
|
|
19
|
-
? { readonly [Key in keyof Value]: DeepReadonly<Value[Key]> }
|
|
20
|
-
: Value;
|
|
21
|
-
|
|
22
|
-
export type FeatureConfig<
|
|
23
|
-
Data extends object = Record<string, unknown>,
|
|
24
|
-
Owner extends string = string,
|
|
25
|
-
> = DeepReadonly<Data> & {
|
|
26
|
-
readonly $owner: Owner;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Web 参数面板保存的覆盖值必须在模块作用域读取:业务消费者 import config.ts 时,
|
|
30
|
-
// defineFeatureConfig 会立即求值并冻结结果,之后再注入覆盖已经来不及。
|
|
31
|
-
// 该编译期常量由项目 vite.config.ts 注入,使 CoreManager 不反向依赖项目文件。
|
|
32
|
-
const unifiedDataControlConfig = typeof __LIGHTGAME_DATA_CONTROL_CONFIG__ === 'undefined'
|
|
33
|
-
? []
|
|
34
|
-
: __LIGHTGAME_DATA_CONTROL_CONFIG__;
|
|
35
|
-
const overrideIndex = buildOverrideIndex(unifiedDataControlConfig);
|
|
36
|
-
|
|
37
|
-
function deepFreeze<Value>(value: Value, visited = new Set<object>()): DeepReadonly<Value> {
|
|
38
|
-
if (typeof value !== 'object' || value === null || visited.has(value)) {
|
|
39
|
-
return value as DeepReadonly<Value>;
|
|
40
|
-
}
|
|
41
|
-
visited.add(value);
|
|
42
|
-
for (const child of Object.values(value)) deepFreeze(child, visited);
|
|
43
|
-
return Object.freeze(value) as DeepReadonly<Value>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 读取 feature config 上登记的控件定义(不可枚举,不影响业务遍历与序列化)。
|
|
48
|
-
* 仅用于调试与自检;导出器走 tuneRuntime.resolveFeatureData 直接取,不依赖此处。
|
|
49
|
-
*/
|
|
50
|
-
export function getFeatureControls(config: unknown): Readonly<Record<string, TuneControl>> {
|
|
51
|
-
if (typeof config !== 'object' || config === null) return {};
|
|
52
|
-
const controls = (config as { $controls?: unknown }).$controls;
|
|
53
|
-
if (typeof controls !== 'object' || controls === null || Array.isArray(controls)) return {};
|
|
54
|
-
return controls as Readonly<Record<string, TuneControl>>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function defineFeatureConfig<
|
|
58
|
-
const Owner extends string,
|
|
59
|
-
const Data extends Record<string, unknown>,
|
|
60
|
-
>(owner: Owner, data: Data): FeatureConfig<Resolved<Data>, Owner> {
|
|
61
|
-
if (!OWNER_RE.test(owner)) {
|
|
62
|
-
throw new TypeError(`[FeatureConfig] owner '${String(owner)}' 必须是 lowerCamel ASCII 标识符`);
|
|
63
|
-
}
|
|
64
|
-
if (typeof data !== 'object' || data === null || Array.isArray(data)) {
|
|
65
|
-
throw new TypeError('[FeatureConfig] data 必须是 Object');
|
|
66
|
-
}
|
|
67
|
-
if (Object.hasOwn(data, '$owner')) {
|
|
68
|
-
throw new TypeError("[FeatureConfig] data 不得声明保留字段 '$owner'");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const resolved = resolveFeatureData({
|
|
72
|
-
owner,
|
|
73
|
-
data,
|
|
74
|
-
overrides: overrideIndex,
|
|
75
|
-
onWarn: (message) => console.warn(`[FeatureConfig] ${message}`),
|
|
76
|
-
});
|
|
77
|
-
if (resolved.errors.length > 0) {
|
|
78
|
-
throw new TypeError(`[FeatureConfig] '${owner}' 配置非法:\n- ${resolved.errors.join('\n- ')}`);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const merged = { ...(resolved.data as object), $owner: owner };
|
|
82
|
-
Object.defineProperty(merged, '$controls', {
|
|
83
|
-
value: deepFreeze(resolved.controls),
|
|
84
|
-
enumerable: false,
|
|
85
|
-
});
|
|
86
|
-
return deepFreeze(merged) as FeatureConfig<Resolved<Data>, Owner>;
|
|
87
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// tuneRuntime.mjs 的类型声明。运行时实现是纯 JS(供导出器共享),类型契约在此维护。
|
|
2
|
-
|
|
3
|
-
export type TuneType = 'int' | 'float' | 'string' | 'bool' | 'enum' | 'color';
|
|
4
|
-
|
|
5
|
-
export interface TuneRange {
|
|
6
|
-
readonly min?: number;
|
|
7
|
-
readonly max?: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/** tune.* 的标记对象;defineFeatureConfig 会在返回前解包成裸值。 */
|
|
11
|
-
export interface Tuned<Value = unknown> {
|
|
12
|
-
readonly $tune: true;
|
|
13
|
-
readonly type: TuneType;
|
|
14
|
-
readonly value: Value;
|
|
15
|
-
readonly min?: number;
|
|
16
|
-
readonly max?: number;
|
|
17
|
-
readonly options?: readonly string[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** 导出器/运行时共用的控件定义,形状与旧 config.json 条目一致。 */
|
|
21
|
-
export interface TuneControl {
|
|
22
|
-
readonly type: TuneType | 'resource';
|
|
23
|
-
readonly value: unknown;
|
|
24
|
-
readonly min?: number;
|
|
25
|
-
readonly max?: number;
|
|
26
|
-
readonly options?: readonly string[];
|
|
27
|
-
/** 仅 type='resource':AssetRef 的 slot,供导出器生成标题。 */
|
|
28
|
-
readonly slot?: string;
|
|
29
|
-
/** 仅 type='resource':AssetRef 的 category,供导出器映射 asset_type。 */
|
|
30
|
-
readonly assetCategory?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface TuneOverride {
|
|
34
|
-
readonly origin: unknown;
|
|
35
|
-
readonly value: unknown;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 把 Tuned<Inner> 解包成 Inner,使业务代码的属性访问类型完全不受标注影响:
|
|
40
|
-
* `tune.int(10)` 在 config 上读出来仍是 number。
|
|
41
|
-
*
|
|
42
|
-
* AssetRef 解析后附加可选 `path`:Web 端替换过该槽位时为资源路径,否则字段不存在。
|
|
43
|
-
* 业务按 `if (cfg.slot.path)` 分流「用文件资产」与「程序直绘」。
|
|
44
|
-
*/
|
|
45
|
-
export type Resolved<Value> =
|
|
46
|
-
Value extends Tuned<infer Inner>
|
|
47
|
-
? Inner
|
|
48
|
-
: Value extends { readonly $assetRef: true }
|
|
49
|
-
? Value & { readonly path?: string }
|
|
50
|
-
: Value extends (...args: any[]) => unknown
|
|
51
|
-
? Value
|
|
52
|
-
: Value extends readonly (infer Item)[]
|
|
53
|
-
? readonly Resolved<Item>[]
|
|
54
|
-
: Value extends object
|
|
55
|
-
? { [Key in keyof Value]: Resolved<Value[Key]> }
|
|
56
|
-
: Value;
|
|
57
|
-
|
|
58
|
-
export declare const TUNE_TYPES: readonly TuneType[];
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 精修一个可被 Web 参数面板调节的值:自定义范围、枚举下拉、或强制类型。
|
|
62
|
-
* 未标注的标量叶子仍会按 inferControlMeta 自动导出,标注只用于覆盖推断结果。
|
|
63
|
-
* 越界 / 类型不符 / options 非法都会在声明期直接抛错。
|
|
64
|
-
*/
|
|
65
|
-
export declare const tune: {
|
|
66
|
-
int(value: number, range?: TuneRange): Tuned<number>;
|
|
67
|
-
float(value: number, range?: TuneRange): Tuned<number>;
|
|
68
|
-
string(value: string): Tuned<string>;
|
|
69
|
-
bool(value: boolean): Tuned<boolean>;
|
|
70
|
-
enum<Option extends string>(value: Option, options: readonly Option[]): Tuned<Option>;
|
|
71
|
-
color(value: string): Tuned<string>;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export declare function isTuned(value: unknown): value is Tuned;
|
|
75
|
-
export declare function isAssetRefLike(value: unknown): value is { readonly $assetRef: true };
|
|
76
|
-
export declare function checkTunedValue(meta: Tuned | TuneControl, value: unknown): string | null;
|
|
77
|
-
export declare function valuesEqual(left: unknown, right: unknown): boolean;
|
|
78
|
-
export declare function buildOverrideIndex(source: unknown): Map<string, TuneOverride>;
|
|
79
|
-
|
|
80
|
-
/** 未标注标量叶子的自动控件推断;返回 null 表示该叶子保持私有、不导出。 */
|
|
81
|
-
export declare function inferControlMeta(value: unknown): { type: TuneType; value: unknown } | null;
|
|
82
|
-
|
|
83
|
-
export declare function resolveFeatureData<Data>(args: {
|
|
84
|
-
owner: string;
|
|
85
|
-
data: Data;
|
|
86
|
-
overrides?: Map<string, TuneOverride>;
|
|
87
|
-
onWarn?: (message: string) => void;
|
|
88
|
-
}): {
|
|
89
|
-
data: Resolved<Data>;
|
|
90
|
-
controls: Record<string, TuneControl>;
|
|
91
|
-
errors: string[];
|
|
92
|
-
};
|