@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
package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 输入平台的**唯一事实源**。
|
|
3
|
-
*
|
|
4
|
-
* 落盘位置:`${CRAFT_PROJECT_DIR}/src/input/input-platform.ts`
|
|
5
|
-
*
|
|
6
|
-
* 命名:**不要叫 `platform.ts`** —— 项目根的 `src/platform.ts` 是预览/宿主桥接
|
|
7
|
-
* (`connectPreview`),两者同名会让引用方分不清。本模块只管「输入形态」。
|
|
8
|
-
*
|
|
9
|
-
* 「输入平台」指**输入形态**(触摸 / 键鼠),不是宿主平台(浏览器 / 小游戏)。
|
|
10
|
-
* 输入层用它决定装键盘映射还是虚拟控件;UI 层用它写 `#game[data-platform]` 供业务 CSS 选择。
|
|
11
|
-
* 两者必须读同一个值 —— 若各自判定,会出现「铺了移动端 HUD 但没有摇杆」这类不一致。
|
|
12
|
-
*
|
|
13
|
-
* **业务代码禁止自行用 `navigator.maxTouchPoints` / `userAgent` / `ontouchstart` 判定平台**:
|
|
14
|
-
* 那样会绕过 `?launchPlatform` 覆盖,使移动端验收门禁失效。
|
|
15
|
-
*/
|
|
16
|
-
export type InputPlatform = 'pc' | 'mobile';
|
|
17
|
-
|
|
18
|
-
let resolved: InputPlatform | null = null;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 读取输入平台。首次调用时判定并缓存,之后恒定返回同一值
|
|
22
|
-
* (插拔鼠标、旋转设备都不会重算)。
|
|
23
|
-
*
|
|
24
|
-
* 判定优先级:
|
|
25
|
-
* 1. 显式注入(`overrideInputPlatform`:验收脚本、测试、宿主)
|
|
26
|
-
* 2. `globalThis.wx` 存在(微信小游戏)→ `'mobile'`
|
|
27
|
-
* 3. `?launchPlatform=pc|mobile` → 参数值(**移动端验收门禁走这条**)
|
|
28
|
-
* 4. 有触摸能力 **且** `(pointer: coarse)` → `'mobile'`,否则 `'pc'`
|
|
29
|
-
*
|
|
30
|
-
* 第 4 级要求两个条件同时成立:只看 `maxTouchPoints` 会把触屏 Windows 笔记本判成
|
|
31
|
-
* mobile(有触摸屏但用户在用键鼠),`(pointer: coarse)` 能区分「主要指针是手指」还是鼠标。
|
|
32
|
-
*
|
|
33
|
-
* **只在构建期调用**(建场景 / 装配 UI / 决定要不要建虚拟控件)。
|
|
34
|
-
* 禁止在每帧的 update 里调用它做输入分支 —— 逐帧读取一律走平台无关的语义接口。
|
|
35
|
-
*/
|
|
36
|
-
export function getInputPlatform(): InputPlatform {
|
|
37
|
-
if (resolved === null) resolved = detect();
|
|
38
|
-
return resolved;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** 显式覆盖。验收门禁、单测与宿主注入用;业务代码不要调用。 */
|
|
42
|
-
export function overrideInputPlatform(forced: InputPlatform): void {
|
|
43
|
-
resolved = forced;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** @internal 仅供测试重置缓存 */
|
|
47
|
-
export function resetInputPlatform(): void {
|
|
48
|
-
resolved = null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 把平台写到容器属性上,业务 CSS 用 `#game[data-platform='mobile'] .xxx` 做样式分支。
|
|
53
|
-
* **纯样式差异走 CSS、不走 JS 分支**;功能差异走语义接口,不走平台分支。
|
|
54
|
-
*/
|
|
55
|
-
export function applyPlatformAttr(container: HTMLElement): InputPlatform {
|
|
56
|
-
const platform = getInputPlatform();
|
|
57
|
-
container.dataset.platform = platform;
|
|
58
|
-
return platform;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function detect(): InputPlatform {
|
|
62
|
-
const scope = globalThis as unknown as {
|
|
63
|
-
wx?: unknown;
|
|
64
|
-
location?: { search?: string };
|
|
65
|
-
navigator?: { maxTouchPoints?: number };
|
|
66
|
-
matchMedia?: (query: string) => { matches: boolean };
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// 微信小游戏没有完整的 window / location,必须先判,
|
|
70
|
-
// 否则会落到第 4 级、因取不到触摸信号而误判成 pc。
|
|
71
|
-
if (scope.wx) return 'mobile';
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
const launch = new URLSearchParams(scope.location?.search ?? '')
|
|
75
|
-
.get('launchPlatform')
|
|
76
|
-
?.toLowerCase();
|
|
77
|
-
if (launch === 'pc' || launch === 'mobile') return launch;
|
|
78
|
-
} catch {
|
|
79
|
-
/* 无 location 的宿主忽略本级 */
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const touchPoints = scope.navigator?.maxTouchPoints ?? 0;
|
|
83
|
-
const hasTouch = 'ontouchstart' in globalThis || touchPoints > 0;
|
|
84
|
-
if (!hasTouch) return 'pc';
|
|
85
|
-
|
|
86
|
-
// matchMedia 不可用时退回「有触摸即 mobile」,与改造前行为一致。
|
|
87
|
-
const coarse =
|
|
88
|
-
typeof scope.matchMedia === 'function'
|
|
89
|
-
? scope.matchMedia('(pointer: coarse)').matches
|
|
90
|
-
: true;
|
|
91
|
-
return coarse ? 'mobile' : 'pc';
|
|
92
|
-
}
|
package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 输入采集原语:键盘状态、虚拟摇杆、语义动作合成。
|
|
3
|
-
*
|
|
4
|
-
* 落盘位置:`${CRAFT_PROJECT_DIR}/src/input/input-primitives.ts`
|
|
5
|
-
*
|
|
6
|
-
* 只负责采集与边沿计算,不做语义解释;键位映射、移动端控件构建与触点仲裁在 `input-layer.ts`。
|
|
7
|
-
* 本文件属于业务工程,不从 `runtime/lightgame/` 导入任何模块。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export interface Keyboard {
|
|
11
|
-
isDown(code: string): boolean;
|
|
12
|
-
wasPressed(code: string): boolean;
|
|
13
|
-
wasReleased(code: string): boolean;
|
|
14
|
-
axis(negative: readonly string[], positive: readonly string[]): number;
|
|
15
|
-
endFrame(): void;
|
|
16
|
-
clear(): void;
|
|
17
|
-
dispose(): void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface KeyboardOptions {
|
|
21
|
-
/** 失焦时清空按键,默认与 target 相同 */
|
|
22
|
-
blurTarget?: EventTarget;
|
|
23
|
-
/** 页面隐藏时清空按键 */
|
|
24
|
-
visibilityTarget?: Document;
|
|
25
|
-
/** 需要阻止浏览器默认行为的 `event.code`(如方向键滚动、空格翻页) */
|
|
26
|
-
preventDefault?: readonly string[];
|
|
27
|
-
/** 焦点在输入框 / 按钮上时忽略按键,默认 true */
|
|
28
|
-
ignoreEditable?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const EDITABLE_TAG = /^(INPUT|TEXTAREA|SELECT|BUTTON)$/;
|
|
32
|
-
|
|
33
|
-
export function createKeyboard(target: EventTarget, options: KeyboardOptions = {}): Keyboard {
|
|
34
|
-
const { blurTarget = target, visibilityTarget, preventDefault = [], ignoreEditable = true } = options;
|
|
35
|
-
const held = new Set<string>();
|
|
36
|
-
const pressed = new Set<string>();
|
|
37
|
-
const released = new Set<string>();
|
|
38
|
-
const blocked = new Set(preventDefault);
|
|
39
|
-
const clear = (): void => {
|
|
40
|
-
for (const code of held) released.add(code);
|
|
41
|
-
held.clear();
|
|
42
|
-
pressed.clear();
|
|
43
|
-
};
|
|
44
|
-
const onDown = (event: Event): void => {
|
|
45
|
-
const { code } = event as KeyboardEvent;
|
|
46
|
-
const node = event.target as HTMLElement | null;
|
|
47
|
-
if (ignoreEditable && (node?.isContentEditable || EDITABLE_TAG.test(node?.tagName ?? ''))) return;
|
|
48
|
-
if (blocked.has(code)) event.preventDefault();
|
|
49
|
-
if (!held.has(code)) pressed.add(code);
|
|
50
|
-
held.add(code);
|
|
51
|
-
};
|
|
52
|
-
const onUp = (event: Event): void => {
|
|
53
|
-
const { code } = event as KeyboardEvent;
|
|
54
|
-
if (held.delete(code)) released.add(code);
|
|
55
|
-
};
|
|
56
|
-
const onVisibility = (): void => {
|
|
57
|
-
if (visibilityTarget?.hidden) clear();
|
|
58
|
-
};
|
|
59
|
-
target.addEventListener('keydown', onDown);
|
|
60
|
-
target.addEventListener('keyup', onUp);
|
|
61
|
-
blurTarget.addEventListener('blur', clear);
|
|
62
|
-
visibilityTarget?.addEventListener('visibilitychange', onVisibility);
|
|
63
|
-
let disposed = false;
|
|
64
|
-
return {
|
|
65
|
-
isDown: code => held.has(code),
|
|
66
|
-
wasPressed: code => pressed.has(code),
|
|
67
|
-
wasReleased: code => released.has(code),
|
|
68
|
-
axis: (negative, positive) => Number(positive.some(code => held.has(code))) - Number(negative.some(code => held.has(code))),
|
|
69
|
-
endFrame() {
|
|
70
|
-
pressed.clear();
|
|
71
|
-
released.clear();
|
|
72
|
-
},
|
|
73
|
-
clear,
|
|
74
|
-
dispose() {
|
|
75
|
-
if (disposed) return;
|
|
76
|
-
disposed = true;
|
|
77
|
-
clear();
|
|
78
|
-
target.removeEventListener('keydown', onDown);
|
|
79
|
-
target.removeEventListener('keyup', onUp);
|
|
80
|
-
blurTarget.removeEventListener('blur', clear);
|
|
81
|
-
visibilityTarget?.removeEventListener('visibilitychange', onVisibility);
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface JoystickValue {
|
|
87
|
-
x: number;
|
|
88
|
-
y: number;
|
|
89
|
-
active: boolean;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface JoystickOptions {
|
|
93
|
-
/** 满偏半径(设计像素),默认 60 */
|
|
94
|
-
radius?: number;
|
|
95
|
-
/** 死区比例 [0, 1),死区内位移输出 0,默认 0.12 */
|
|
96
|
-
deadZone?: number;
|
|
97
|
-
/** true:按下点为原点;false:元素中心为原点。默认 true */
|
|
98
|
-
floating?: boolean;
|
|
99
|
-
/** 设计像素 → CSS 像素的缩放系数,每次 move 时读取 */
|
|
100
|
-
scale?: () => number;
|
|
101
|
-
/** 仅接受新触点后调用;坐标为 CSS client 像素,与输入原点一致 */
|
|
102
|
-
onStart?: (origin: { x: number; y: number }) => void;
|
|
103
|
-
onChange?: (value: JoystickValue) => void;
|
|
104
|
-
/** 失焦时复位 */
|
|
105
|
-
blurTarget?: EventTarget;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface Joystick {
|
|
109
|
-
value(): JoystickValue;
|
|
110
|
-
reset(): void;
|
|
111
|
-
dispose(): void;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const POINTER_END_EVENTS = ['pointerup', 'pointercancel', 'lostpointercapture'] as const;
|
|
115
|
-
|
|
116
|
-
export function createJoystick(element: HTMLElement, options: JoystickOptions = {}): Joystick {
|
|
117
|
-
const { radius = 60, deadZone = 0.12, floating = true, scale = () => 1, onStart, onChange, blurTarget } = options;
|
|
118
|
-
if (!(radius > 0) || !Number.isFinite(radius) || deadZone < 0 || deadZone >= 1) {
|
|
119
|
-
throw new RangeError('Joystick requires radius > 0 and deadZone in [0, 1)');
|
|
120
|
-
}
|
|
121
|
-
let pointerId: number | null = null;
|
|
122
|
-
let originX = 0;
|
|
123
|
-
let originY = 0;
|
|
124
|
-
let x = 0;
|
|
125
|
-
let y = 0;
|
|
126
|
-
let disposed = false;
|
|
127
|
-
const oldTouchAction = element.style.touchAction;
|
|
128
|
-
element.style.touchAction = 'none';
|
|
129
|
-
const emit = (): void => onChange?.({ x, y, active: pointerId !== null });
|
|
130
|
-
const move = (event: PointerEvent): void => {
|
|
131
|
-
if (event.pointerId !== pointerId) return;
|
|
132
|
-
event.preventDefault();
|
|
133
|
-
const scaledRadius = radius * scale();
|
|
134
|
-
if (!(scaledRadius > 0) || !Number.isFinite(scaledRadius)) throw new RangeError('Joystick scale must be finite and positive');
|
|
135
|
-
const dx = (event.clientX - originX) / scaledRadius;
|
|
136
|
-
const dy = (event.clientY - originY) / scaledRadius;
|
|
137
|
-
const length = Math.hypot(dx, dy);
|
|
138
|
-
const magnitude = Math.min(1, Math.max(0, (length - deadZone) / (1 - deadZone)));
|
|
139
|
-
x = length ? (dx / length) * magnitude : 0;
|
|
140
|
-
y = length ? (dy / length) * magnitude : 0;
|
|
141
|
-
emit();
|
|
142
|
-
};
|
|
143
|
-
// 统一接收触点与通知底盘定位,第二根手指不能重定位。
|
|
144
|
-
const down = (event: PointerEvent): void => {
|
|
145
|
-
if (pointerId !== null || (event.pointerType === 'mouse' && event.button !== 0)) return;
|
|
146
|
-
const rect = element.getBoundingClientRect();
|
|
147
|
-
originX = floating ? event.clientX : rect.left + rect.width / 2;
|
|
148
|
-
originY = floating ? event.clientY : rect.top + rect.height / 2;
|
|
149
|
-
pointerId = event.pointerId;
|
|
150
|
-
try {
|
|
151
|
-
element.setPointerCapture(pointerId);
|
|
152
|
-
} catch {
|
|
153
|
-
// 合成事件或指针已释放时捕获会失败,不影响后续 move。
|
|
154
|
-
}
|
|
155
|
-
onStart?.({ x: originX, y: originY });
|
|
156
|
-
move(event);
|
|
157
|
-
};
|
|
158
|
-
const reset = (): void => {
|
|
159
|
-
const id = pointerId;
|
|
160
|
-
pointerId = null;
|
|
161
|
-
x = 0;
|
|
162
|
-
y = 0;
|
|
163
|
-
if (id !== null) {
|
|
164
|
-
try {
|
|
165
|
-
element.releasePointerCapture(id);
|
|
166
|
-
} catch {
|
|
167
|
-
// 指针可能已被浏览器释放。
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
emit();
|
|
171
|
-
};
|
|
172
|
-
const end = (event: PointerEvent): void => {
|
|
173
|
-
if (event.pointerId === pointerId) reset();
|
|
174
|
-
};
|
|
175
|
-
element.addEventListener('pointerdown', down);
|
|
176
|
-
element.addEventListener('pointermove', move);
|
|
177
|
-
for (const name of POINTER_END_EVENTS) element.addEventListener(name, end);
|
|
178
|
-
blurTarget?.addEventListener('blur', reset);
|
|
179
|
-
return {
|
|
180
|
-
value: () => ({ x, y, active: pointerId !== null }),
|
|
181
|
-
reset,
|
|
182
|
-
dispose() {
|
|
183
|
-
if (disposed) return;
|
|
184
|
-
disposed = true;
|
|
185
|
-
try {
|
|
186
|
-
reset();
|
|
187
|
-
} finally {
|
|
188
|
-
element.style.touchAction = oldTouchAction;
|
|
189
|
-
element.removeEventListener('pointerdown', down);
|
|
190
|
-
element.removeEventListener('pointermove', move);
|
|
191
|
-
for (const name of POINTER_END_EVENTS) element.removeEventListener(name, end);
|
|
192
|
-
blurTarget?.removeEventListener('blur', reset);
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface ActionInputOptions {
|
|
199
|
-
keyboard?: Pick<Keyboard, 'isDown'>;
|
|
200
|
-
/** 动作名 → 键位 `event.code` 列表 */
|
|
201
|
-
actions?: Record<string, readonly string[]>;
|
|
202
|
-
/** 轴名 → 正负键位 */
|
|
203
|
-
axes?: Record<string, { negative?: readonly string[]; positive?: readonly string[] }>;
|
|
204
|
-
/** 动作名 → 非键盘按下源(虚拟按钮、鼠标键) */
|
|
205
|
-
buttons?: Record<string, () => boolean>;
|
|
206
|
-
/** 轴名 → 模拟量来源(摇杆),与键盘数字量相加后 clamp 到 [-1, 1] */
|
|
207
|
-
analog?: Record<string, () => number>;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export interface ActionInput {
|
|
211
|
-
sample(): void;
|
|
212
|
-
isDown(name: string): boolean;
|
|
213
|
-
wasPressed(name: string): boolean;
|
|
214
|
-
wasReleased(name: string): boolean;
|
|
215
|
-
axis(name: string): number;
|
|
216
|
-
reset(): void;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export function createActionInput(options: ActionInputOptions = {}): ActionInput {
|
|
220
|
-
const { keyboard, actions = {}, axes = {}, buttons = {}, analog = {} } = options;
|
|
221
|
-
let previous: Record<string, boolean> = {};
|
|
222
|
-
let current: Record<string, boolean> = {};
|
|
223
|
-
let pressed: Record<string, boolean> = {};
|
|
224
|
-
let released: Record<string, boolean> = {};
|
|
225
|
-
const anyKey = (keys?: readonly string[]): boolean => (keys ?? []).some(code => keyboard?.isDown(code) ?? false);
|
|
226
|
-
return {
|
|
227
|
-
sample() {
|
|
228
|
-
previous = current;
|
|
229
|
-
current = {};
|
|
230
|
-
pressed = {};
|
|
231
|
-
released = {};
|
|
232
|
-
for (const name of new Set([...Object.keys(actions), ...Object.keys(buttons)])) {
|
|
233
|
-
current[name] = anyKey(actions[name]) || Boolean(buttons[name]?.());
|
|
234
|
-
pressed[name] = current[name] && !previous[name];
|
|
235
|
-
released[name] = !current[name] && Boolean(previous[name]);
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
isDown: name => Boolean(current[name]),
|
|
239
|
-
wasPressed: name => Boolean(pressed[name]),
|
|
240
|
-
wasReleased: name => Boolean(released[name]),
|
|
241
|
-
axis(name) {
|
|
242
|
-
const keys = axes[name] ?? {};
|
|
243
|
-
const digital = Number(anyKey(keys.positive)) - Number(anyKey(keys.negative));
|
|
244
|
-
const value = Number(analog[name]?.() ?? 0);
|
|
245
|
-
return Math.max(-1, Math.min(1, digital + (Number.isFinite(value) ? value : 0)));
|
|
246
|
-
},
|
|
247
|
-
reset() {
|
|
248
|
-
previous = {};
|
|
249
|
-
current = {};
|
|
250
|
-
pressed = {};
|
|
251
|
-
released = {};
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 视角通道(look):把指针位移累积成「本帧位移」,**消费型,读一次即清零**。
|
|
3
|
-
*
|
|
4
|
-
* 落盘位置:`${CRAFT_PROJECT_DIR}/src/input/look-pad.ts`
|
|
5
|
-
*
|
|
6
|
-
* 与轴的三个根本区别,写代码前必须先接受:
|
|
7
|
-
* 1. 输出的是**位移量(像素量纲)**,不是归一化状态量 [-1,1];
|
|
8
|
-
* 2. 读一次即清零,**每帧只能读一次**(多个系统都要用时在帧开头读一次存成局部变量往下传);
|
|
9
|
-
* 3. 不需要排除按钮区域 —— 控件是独立的 DOM 元素,落在按钮上的触点命中的是按钮,
|
|
10
|
-
* 浏览器命中测试天然不会分发到这里(对应「button > joystick > look」的仲裁语义)。
|
|
11
|
-
*
|
|
12
|
-
* 移动端把它挂在右半屏的滑动区元素上;PC 端可以挂在 canvas 上并指定 requireButton。
|
|
13
|
-
*
|
|
14
|
-
* PC 侧有**三条互斥的驱动路径**,按优先级排列,不要合并:
|
|
15
|
-
* 1. **指针锁定态**(业务调过 `requestPointerLock()`):浏览器把 `clientX/Y` **冻结**在
|
|
16
|
-
* 锁定时的坐标,只有 `movementX/Y` 有效,且**不派发 pointerdown**。
|
|
17
|
-
* 只读坐标差的实现会在这条路径上恒为 0 —— 「锁了之后视角完全不能转」。
|
|
18
|
-
* 2. **悬停转向**(`requireButton: null`):不按任何键,指针在元素上移动即转向(FPS 标准操作)。
|
|
19
|
-
* **不能要求先 pointerdown**,否则配了 `null` 也要先按一下才转。
|
|
20
|
-
* 3. **拖拽转向**(`requireButton: 0 | 2`):按住指定键拖动,走 pointerdown + capture。
|
|
21
|
-
*
|
|
22
|
-
* 移动端只有第 3 条(`pointerdown` 驱动的触点跟踪),且 `requireButton` 对 touch/pen 无约束。
|
|
23
|
-
*/
|
|
24
|
-
export interface LookPadOptions {
|
|
25
|
-
/** 像素位移倍率,默认 1 */
|
|
26
|
-
sensitivity?: number;
|
|
27
|
-
/** 纵向反转 */
|
|
28
|
-
invertY?: boolean;
|
|
29
|
-
/** 起手死区(CSS 像素),位移未超过该值前不产生输出,默认 2 */
|
|
30
|
-
deadZonePx?: number;
|
|
31
|
-
/**
|
|
32
|
-
* 允许的指针类型。移动端滑动区用 `['touch', 'pen']`(避免与 PC 调试时的鼠标冲突);
|
|
33
|
-
* PC 拖拽转向用 `['mouse']`。
|
|
34
|
-
*/
|
|
35
|
-
pointerTypes?: readonly string[];
|
|
36
|
-
/**
|
|
37
|
-
* 仅当该鼠标键按下时才响应(0=左键 / 2=右键)。
|
|
38
|
-
* **`null` = 不限制,此时进入「悬停转向」:不按键、指针移动即转向**(FPS 在 PC 上的标准操作)。
|
|
39
|
-
* 只对鼠标生效;触摸与笔忽略此项。默认 `null`。
|
|
40
|
-
* 指针锁定态下这一项仍生效(用 `event.buttons` 判断持续按下),但 FPS 一般配 `null`。
|
|
41
|
-
*/
|
|
42
|
-
requireButton?: number | null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface LookPad {
|
|
46
|
-
/** 读取并清零本帧累计位移。每帧只能调一次,重复调用第二次起恒为 0 */
|
|
47
|
-
consumeDelta(): { x: number; y: number };
|
|
48
|
-
/** 外部注入位移(如「开火按钮按住拖拽也能控向」),业务侧仍只读一个 consumeDelta */
|
|
49
|
-
feedDelta(dx: number, dy: number): void;
|
|
50
|
-
/** 当前是否有指针正在滑动区内拖动 */
|
|
51
|
-
isActive(): boolean;
|
|
52
|
-
reset(): void;
|
|
53
|
-
setEnabled(enabled: boolean): void;
|
|
54
|
-
dispose(): void;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const DEFAULT_SENSITIVITY = 1;
|
|
58
|
-
const DEFAULT_DEAD_ZONE_PX = 2;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* `PointerEvent.button`(单个键,仅 down/up 有效)→ `PointerEvent.buttons`(位掩码,move 上也有效)。
|
|
62
|
-
* 注意中键与右键的编号是**交叉**的:button 1=中键对应掩码 4,button 2=右键对应掩码 2。
|
|
63
|
-
* move 事件的 `button` 恒为 -1,**判断「是否仍按住」只能用 `buttons`**。
|
|
64
|
-
*/
|
|
65
|
-
const BUTTON_TO_MASK: readonly number[] = [1, 4, 2, 8, 16];
|
|
66
|
-
|
|
67
|
-
export function createLookPad(element: HTMLElement, options: LookPadOptions = {}): LookPad {
|
|
68
|
-
const sensitivity = options.sensitivity ?? DEFAULT_SENSITIVITY;
|
|
69
|
-
const invertY = options.invertY ?? false;
|
|
70
|
-
const deadZonePx = Math.max(0, options.deadZonePx ?? DEFAULT_DEAD_ZONE_PX);
|
|
71
|
-
const pointerTypes = options.pointerTypes;
|
|
72
|
-
const requireButton = options.requireButton ?? null;
|
|
73
|
-
|
|
74
|
-
const previousTouchAction = element.style.touchAction;
|
|
75
|
-
element.style.touchAction = 'none';
|
|
76
|
-
|
|
77
|
-
let enabled = true;
|
|
78
|
-
let pointerId: number | null = null;
|
|
79
|
-
let startX = 0;
|
|
80
|
-
let startY = 0;
|
|
81
|
-
let lastX = 0;
|
|
82
|
-
let lastY = 0;
|
|
83
|
-
/** 是否已越过起手死区 */
|
|
84
|
-
let moved = false;
|
|
85
|
-
let accumulatedX = 0;
|
|
86
|
-
let accumulatedY = 0;
|
|
87
|
-
/** 悬停转向(requireButton: null,未按键)的上一帧坐标基准。null = 尚无基准 */
|
|
88
|
-
let hoverX: number | null = null;
|
|
89
|
-
let hoverY: number | null = null;
|
|
90
|
-
|
|
91
|
-
const typeAllowed = (event: PointerEvent): boolean =>
|
|
92
|
-
!pointerTypes || pointerTypes.includes(event.pointerType);
|
|
93
|
-
|
|
94
|
-
const allowed = (event: PointerEvent): boolean => {
|
|
95
|
-
if (!typeAllowed(event)) return false;
|
|
96
|
-
if (event.pointerType !== 'mouse') return true;
|
|
97
|
-
return requireButton === null || event.button === requireButton;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/** 指针锁定态:`clientX/Y` 被浏览器冻结,必须改用 `movementX/Y` */
|
|
101
|
-
const isLocked = (): boolean => document.pointerLockElement !== null;
|
|
102
|
-
|
|
103
|
-
/** 锁定态下「要求的键是否仍按住」。move 的 `button` 恒为 -1,只能查 `buttons` 位掩码 */
|
|
104
|
-
const buttonStillHeld = (event: PointerEvent): boolean => {
|
|
105
|
-
if (requireButton === null) return true;
|
|
106
|
-
const mask = BUTTON_TO_MASK[requireButton];
|
|
107
|
-
return mask !== undefined && (event.buttons & mask) !== 0;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const onDown = (event: PointerEvent): void => {
|
|
111
|
-
if (!enabled || pointerId !== null || !allowed(event)) return;
|
|
112
|
-
pointerId = event.pointerId;
|
|
113
|
-
// 切到拖拽路径,悬停基准作废(否则松手回到悬停态时会用上一段的旧基准)
|
|
114
|
-
hoverX = null;
|
|
115
|
-
hoverY = null;
|
|
116
|
-
startX = event.clientX;
|
|
117
|
-
startY = event.clientY;
|
|
118
|
-
lastX = startX;
|
|
119
|
-
lastY = startY;
|
|
120
|
-
moved = false;
|
|
121
|
-
// 与摇杆一致:把触点绑在滑动区元素上,后续 move 只发给它
|
|
122
|
-
try {
|
|
123
|
-
element.setPointerCapture(event.pointerId);
|
|
124
|
-
} catch {
|
|
125
|
-
/* 指针已失效时忽略;后续 move 由元素自身命中的事件兜底 */
|
|
126
|
-
}
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const onMove = (event: PointerEvent): void => {
|
|
131
|
-
if (!enabled) return;
|
|
132
|
-
|
|
133
|
-
// ── 路径 1:指针锁定态。无 pointerdown,clientX/Y 冻结,只有 movementX/Y 有效 ──
|
|
134
|
-
if (isLocked()) {
|
|
135
|
-
if (!typeAllowed(event) || !buttonStillHeld(event)) return;
|
|
136
|
-
hoverX = null;
|
|
137
|
-
hoverY = null;
|
|
138
|
-
// 锁定态没有「起手」概念,死区不适用(每个事件都是独立的原始位移增量)
|
|
139
|
-
push(event.movementX, event.movementY);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// ── 路径 2:悬停转向。requireButton: null 且未进入拖拽跟踪时,移动即转向 ──
|
|
144
|
-
if (requireButton === null && pointerId === null && event.pointerType === 'mouse') {
|
|
145
|
-
if (!typeAllowed(event)) return;
|
|
146
|
-
// 首次移动只建基准不产出,避免把「指针上次离开时的位置 → 现在」当成一次巨大位移
|
|
147
|
-
if (hoverX !== null && hoverY !== null) {
|
|
148
|
-
push(event.clientX - hoverX, event.clientY - hoverY);
|
|
149
|
-
}
|
|
150
|
-
hoverX = event.clientX;
|
|
151
|
-
hoverY = event.clientY;
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// ── 路径 3:拖拽转向 / 移动端触点跟踪 ──
|
|
156
|
-
if (event.pointerId !== pointerId) return;
|
|
157
|
-
event.preventDefault();
|
|
158
|
-
|
|
159
|
-
if (!moved) {
|
|
160
|
-
// 死区内不累加、也不更新 last;越界瞬间把基准挪到当前点,丢弃死区那一小段,
|
|
161
|
-
// 避免起手时镜头跳一下。deadZonePx === 0 表示不过滤,此时不能丢弃首段位移。
|
|
162
|
-
if (deadZonePx > 0) {
|
|
163
|
-
if (Math.hypot(event.clientX - startX, event.clientY - startY) < deadZonePx) return;
|
|
164
|
-
moved = true;
|
|
165
|
-
lastX = event.clientX;
|
|
166
|
-
lastY = event.clientY;
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
moved = true;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const dx = event.clientX - lastX;
|
|
173
|
-
const dy = event.clientY - lastY;
|
|
174
|
-
lastX = event.clientX;
|
|
175
|
-
lastY = event.clientY;
|
|
176
|
-
push(dx, dy);
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const onUp = (event: PointerEvent): void => {
|
|
180
|
-
if (event.pointerId === pointerId) release();
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const push = (dx: number, dy: number): void => {
|
|
184
|
-
accumulatedX += dx * sensitivity;
|
|
185
|
-
accumulatedY += dy * sensitivity * (invertY ? -1 : 1);
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const release = (): void => {
|
|
189
|
-
pointerId = null;
|
|
190
|
-
moved = false;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 指针离开元素时丢掉悬停基准。否则指针移出画布、在外面走一段再移回来,
|
|
195
|
-
* 会把「离开点 → 重新进入点」这段憋成一次巨大位移,镜头猛甩一下。
|
|
196
|
-
*/
|
|
197
|
-
const onLeave = (): void => {
|
|
198
|
-
hoverX = null;
|
|
199
|
-
hoverY = null;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
const reset = (): void => {
|
|
203
|
-
release();
|
|
204
|
-
onLeave();
|
|
205
|
-
accumulatedX = 0;
|
|
206
|
-
accumulatedY = 0;
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
element.addEventListener('pointerdown', onDown);
|
|
210
|
-
element.addEventListener('pointermove', onMove);
|
|
211
|
-
element.addEventListener('pointerup', onUp);
|
|
212
|
-
element.addEventListener('pointercancel', onUp);
|
|
213
|
-
element.addEventListener('lostpointercapture', onUp);
|
|
214
|
-
element.addEventListener('pointerleave', onLeave);
|
|
215
|
-
|
|
216
|
-
return {
|
|
217
|
-
consumeDelta() {
|
|
218
|
-
const delta = { x: accumulatedX, y: accumulatedY };
|
|
219
|
-
accumulatedX = 0;
|
|
220
|
-
accumulatedY = 0;
|
|
221
|
-
return delta;
|
|
222
|
-
},
|
|
223
|
-
feedDelta(dx, dy) {
|
|
224
|
-
if (enabled) push(dx, dy);
|
|
225
|
-
},
|
|
226
|
-
isActive() {
|
|
227
|
-
return pointerId !== null;
|
|
228
|
-
},
|
|
229
|
-
reset,
|
|
230
|
-
setEnabled(value: boolean) {
|
|
231
|
-
enabled = value;
|
|
232
|
-
if (!value) reset();
|
|
233
|
-
},
|
|
234
|
-
dispose() {
|
|
235
|
-
reset();
|
|
236
|
-
element.style.touchAction = previousTouchAction;
|
|
237
|
-
element.removeEventListener('pointerdown', onDown);
|
|
238
|
-
element.removeEventListener('pointermove', onMove);
|
|
239
|
-
element.removeEventListener('pointerup', onUp);
|
|
240
|
-
element.removeEventListener('pointercancel', onUp);
|
|
241
|
-
element.removeEventListener('lostpointercapture', onUp);
|
|
242
|
-
element.removeEventListener('pointerleave', onLeave);
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
}
|