@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,34 +0,0 @@
|
|
|
1
|
-
# audio — 音频(`audio_js`)
|
|
2
|
-
|
|
3
|
-
本文件只负责 query/filters;audio 的用途分流(bgm/sfx/ambience)由本轮请求里的 `audio_role` 决定。
|
|
4
|
-
|
|
5
|
-
## query 拼装
|
|
6
|
-
|
|
7
|
-
拼一条紧凑语义文本。格式:`字段:值`,半角空格分隔、多值全角 `,`;已知才写,未知跳过。
|
|
8
|
-
不要补写分辨率、文件格式、音量数值或“高品质”等空泛词。
|
|
9
|
-
|
|
10
|
-
- `bgm`:`使用场景:{玩法/场景} 情绪:{mood} 强度:{intensity} 节奏:{tempo} 配器:{instrumentation} 循环:是`
|
|
11
|
-
- `sfx`:`触发事件:{event} 音源:{source/material} 力度:{impact} 时长:{短/中} 尾音:{dry/ringing/...}`
|
|
12
|
-
- `ambience`:`环境:{place/weather} 质感:{texture} 密度:{sparse/dense} 远近:{distance} 循环:是`
|
|
13
|
-
|
|
14
|
-
例:
|
|
15
|
-
|
|
16
|
-
- `使用场景:火山战斗 情绪:压迫 强度:高 节奏:快速 配器:低沉打击乐 循环:是`
|
|
17
|
-
- `触发事件:剑气命中 音源:金属,破空 力度:强 时长:短 尾音:干脆`
|
|
18
|
-
- `环境:熔岩洞窟 质感:低频轰鸣,火焰爆裂 密度:稀疏 远近:远景 循环:是`
|
|
19
|
-
|
|
20
|
-
## 判别
|
|
21
|
-
|
|
22
|
-
- 循环 BGM/配乐 → `音乐`;攻击/技能/受击 → `战斗`;脚步/跳跃/载具 → `移动`
|
|
23
|
-
- 点击/弹窗/提示 → `界面`;场景氛围/自然音 → `环境`;拾取/升级/胜负 → `游戏`
|
|
24
|
-
|
|
25
|
-
## 消歧
|
|
26
|
-
|
|
27
|
-
- 战斗 vs 游戏:攻防交互=战斗,结果反馈(升级/得分)=游戏。
|
|
28
|
-
- 环境 vs 音乐:无旋律底噪=环境,有旋律=音乐。
|
|
29
|
-
- `audio_role=bgm` 固定优先 `音乐`;`ambience` 固定优先 `环境`;`sfx` 再按真实触发事件选择
|
|
30
|
-
`战斗/移动/界面/游戏`,不因 owner 是 Scene 就统一写战斗。
|
|
31
|
-
|
|
32
|
-
## 同义组(多值 OR)
|
|
33
|
-
|
|
34
|
-
- 交互反馈:`["界面","游戏"]`
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# effect2d — 2D 特效序列帧(`effect_2d_js`)
|
|
2
|
-
|
|
3
|
-
## query 拼装
|
|
4
|
-
|
|
5
|
-
拼一条语义文本。格式:`字段:值`,全角 `:` 前缀、半角空格分隔、多值全角 `,`;已知才写,未知跳过。
|
|
6
|
-
模板:`标签:{tags} 主色调:{color} 朝向:{direction}`
|
|
7
|
-
|
|
8
|
-
- `主色调`:基础色名(青蓝/橙红/金黄/白色…),≤2 个。
|
|
9
|
-
- `朝向`:运动/扩散方向(向上/向右/向外扩散/向内收缩/旋转/环绕/随机闪烁);无则留空。
|
|
10
|
-
- `标签`:仅画风/循环性明确时写(像素/循环);勿写数字,勿臆造。
|
|
11
|
-
|
|
12
|
-
例:`主色调:青蓝,白色 朝向:向上`
|
|
13
|
-
|
|
14
|
-
## 判别
|
|
15
|
-
|
|
16
|
-
- 爆炸/冲击波 → `爆炸`;命中/受击 → `受击`;近身挥砍轨迹 → `近战`
|
|
17
|
-
- 施法起手/吟唱 → `施法`;AOE 范围 → `范围`;目标/地面指示器 → `指示器`;锁定连线 → `连线`
|
|
18
|
-
- 增益减益循环(冰冻/中毒/燃烧) → `Buff`;护盾护罩 → `护盾`
|
|
19
|
-
- 投射物/弹道 → `飞行`;头顶情绪符号 → `表情`
|
|
20
|
-
- 场景环境动效 → `环境`;UI 界面动效 → `界面`
|
|
21
|
-
|
|
22
|
-
## 消歧
|
|
23
|
-
|
|
24
|
-
- 受击 vs 爆炸:单体火花=受击,范围炸裂=爆炸。
|
|
25
|
-
- 近战 vs 飞行:贴身=近战,脱手投射=飞行。
|
|
26
|
-
- `Buff` 大写B,原样传。
|
|
27
|
-
|
|
28
|
-
## 同义组(多值 OR)
|
|
29
|
-
|
|
30
|
-
- 攻击命中:`["近战","受击","爆炸"]`
|
|
31
|
-
- 技能释放:`["施法","范围","飞行"]`
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# texture-prop — 2D 物件(`prop_2d_js`)
|
|
2
|
-
|
|
3
|
-
## query 拼装
|
|
4
|
-
|
|
5
|
-
拼一条语义文本。格式:`字段:值`,全角 `:` 前缀、半角空格分隔、多值全角 `,`;已知才写,未知跳过。
|
|
6
|
-
模板:`标签:{tags} 内容描述:{desc}`
|
|
7
|
-
|
|
8
|
-
- `内容描述`:**主信号**,一句客观外观(材质+颜色+形状+特征),勿堆砌风格词。
|
|
9
|
-
- `标签`:区分力低,一般省略;画风为关键筛选时才写。
|
|
10
|
-
|
|
11
|
-
例:`内容描述:棕色的圆形木头桌子,上面摆着绿色的药水`
|
|
12
|
-
|
|
13
|
-
## 判别
|
|
14
|
-
|
|
15
|
-
- 桌椅/柜子/床等家具陈设 → `家具`
|
|
16
|
-
- 可拾取/使用的功能道具 → `道具`
|
|
17
|
-
- 其余通用物件 → `物品`
|
|
18
|
-
|
|
19
|
-
## 消歧 / 同义组
|
|
20
|
-
|
|
21
|
-
- 居家陈设=`家具`,其余=`物品`。
|
|
22
|
-
- 物品/道具边界不清晰,拿不准:`["物品","道具"]`。
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# ui-common — 普通 UI 图标/界面
|
|
2
|
-
|
|
3
|
-
## 适用范围
|
|
4
|
-
|
|
5
|
-
仅有 UI、界面、按钮等功能描述,或没有明确风格表诉求时使用本策略。
|
|
6
|
-
|
|
7
|
-
- 前端资源类型:`ui-common`
|
|
8
|
-
- 检索资源表:`texture_2d_js`
|
|
9
|
-
- 工程资源槽位仍使用 `texture-ui` / `Texture2D`
|
|
10
|
-
|
|
11
|
-
不要因为出现“卡通”“科幻”等一般题材词就自动切换资源表;只有明确要求风格化 UI 时才使用 `ui-style`。
|
|
12
|
-
|
|
13
|
-
## Query 拼装
|
|
14
|
-
|
|
15
|
-
拼一条语义文本。格式:`字段:值`,全角 `:` 前缀、半角空格分隔、多值用全角 `,`;已知才写,未知跳过。
|
|
16
|
-
|
|
17
|
-
模板:`标签:{tags} 描述:{desc}`
|
|
18
|
-
|
|
19
|
-
- `描述`:主信号,一句客观外观(用途/主体+颜色+形状+材质),越具体越准。
|
|
20
|
-
- `标签`:画风/题材词;有明确题材时保留,但不因此改变本策略的资源表。
|
|
21
|
-
|
|
22
|
-
例:`标签:卡通 描述:金色圆形的金币图标,中央有花纹`
|
|
23
|
-
|
|
24
|
-
## 判别与消歧
|
|
25
|
-
|
|
26
|
-
- 半身/全身人物大图 → `立绘`;仅头部小图/头像框 → `头像`
|
|
27
|
-
- 可点击控件 → `按钮`;纯展示状态图标 → `功能`
|
|
28
|
-
- 道具/材料图标 → `物品`;武器图标 → `武器`;穿戴装备 → `装备`
|
|
29
|
-
- 技能/法术 → `技能`;排名/等级/勋章 → `段位`;货币 → `货币`
|
|
30
|
-
- 弹窗/面板底图 → `底板`;大幅背景 → `背景图`
|
|
31
|
-
- 结算/胜负面板 → `结算`;进度/血条 → `进度条`;摇杆 → `摇杆`
|
|
32
|
-
- 纯色块/几何形状 → `形状`;艺术字/标题 → `艺术字`
|
|
33
|
-
- 装饰小图 → `装饰`;扁平图标 → `扁平`;表情 → `表情`;载具 → `载具`;场景缩略 → `场景`
|
|
34
|
-
|
|
35
|
-
- 立绘 vs 头像:半身/全身=立绘,仅头部=头像。
|
|
36
|
-
- 物品 vs 装备 vs 武器:能穿戴=装备,攻击道具=武器,消耗/材料=物品。
|
|
37
|
-
- 按钮 vs 功能:可点击=按钮,纯展示=功能。
|
|
38
|
-
- `物品`/`底板` 是巨型桶,命中后必须靠 Query 收敛。
|
|
39
|
-
|
|
40
|
-
同义组:人物图 `["立绘", "头像"]`;装备类 `["装备", "武器"]`;交互控件 `["按钮", "功能"]`。
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# ui-style — 风格化 UI 图标/界面
|
|
2
|
-
|
|
3
|
-
## 适用范围
|
|
4
|
-
|
|
5
|
-
用户明确要求像素、微恐等风格化 UI 时使用本策略。
|
|
6
|
-
|
|
7
|
-
- 前端资源类型:`ui-style`
|
|
8
|
-
- 检索资源表:`ui_2d_js`
|
|
9
|
-
- 工程资源槽位仍使用 `texture-ui` / `Texture2D`
|
|
10
|
-
|
|
11
|
-
风格词必须保留在 Query 中,不能只依赖资源类型。未明确要求风格时使用 `ui-common`,不得为了使用风格表臆造风格。
|
|
12
|
-
|
|
13
|
-
## Query 拼装
|
|
14
|
-
|
|
15
|
-
沿用结构:`标签:{tags} 描述:{desc}`。
|
|
16
|
-
|
|
17
|
-
- `标签` 必须包含用户明确提出的风格词,如 `像素`、`微恐`。
|
|
18
|
-
- `描述` 仍需客观描述用途、主体、颜色、形状和材质。
|
|
19
|
-
- UI 类型判别沿用普通 UI 规则,例如可点击控件写 `按钮`,技能/法术写 `技能`。
|
|
20
|
-
|
|
21
|
-
例:`标签:像素、微恐 描述:带裂纹和暗红血迹的恐怖风格技能按钮`
|
|
22
|
-
|
|
23
|
-
## 路由边界
|
|
24
|
-
|
|
25
|
-
- 明确的像素或微恐 UI → 使用 `ui-style`,从 `ui_2d_js` 召回。
|
|
26
|
-
- 其他风格词只有在后端已确认属于 `ui_2d_js` 的索引范围时才使用 `ui-style`,否则使用 `ui-common` 并保留风格词。
|
|
27
|
-
- 不新增工程 category,不改变 `texture-ui` 槽位、`Texture2D` 控件或运行时图片加载方式。
|
|
28
|
-
- 召回命中后和普通 UI 一样写入 `configs/assets.json`,最终按单图 `load.image` 消费。
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
|
|
4
|
-
export const TRANSLATE_API_URL = 'http://wxup-agent.agent-toolbox.gw2clsv.woa.com/v1/translate';
|
|
5
|
-
|
|
6
|
-
const QUEUE_SUBDIRS = ['pending', 'working', 'done', 'failed'];
|
|
7
|
-
|
|
8
|
-
export function hasCjk(text) {
|
|
9
|
-
return /[\u3400-\u9fff]/.test(String(text ?? ''));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function needsTranslation(text) {
|
|
13
|
-
const value = String(text ?? '').trim();
|
|
14
|
-
return value.length > 0 && /^[\x00-\x7F]+$/.test(value) && /[A-Za-z]/.test(value);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function readableEnglish(text) {
|
|
18
|
-
return String(text ?? '')
|
|
19
|
-
.replaceAll('_', ' ')
|
|
20
|
-
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
21
|
-
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
|
|
22
|
-
.trim();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function readJson(path, fallback) {
|
|
26
|
-
if (!existsSync(path)) return fallback;
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(readFileSync(path, 'utf8'));
|
|
29
|
-
} catch {
|
|
30
|
-
return fallback;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function takeTitle(map, name, value) {
|
|
35
|
-
const title = String(value ?? '').trim();
|
|
36
|
-
if (!name || !hasCjk(title)) return;
|
|
37
|
-
if (hasCjk(map.get(name))) return;
|
|
38
|
-
map.set(name, title);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function collectDisplayTitles(projectRoot) {
|
|
42
|
-
const titles = new Map();
|
|
43
|
-
const ledger = readJson(join(projectRoot, '.aigc-queue', 'results.json'), { items: [] });
|
|
44
|
-
for (const item of Array.isArray(ledger.items) ? ledger.items : []) {
|
|
45
|
-
takeTitle(titles, String(item?.name ?? '').trim(), item?.displayPath);
|
|
46
|
-
}
|
|
47
|
-
const queueRoot = join(projectRoot, '.aigc-queue');
|
|
48
|
-
for (const sub of QUEUE_SUBDIRS) {
|
|
49
|
-
const dir = join(queueRoot, sub);
|
|
50
|
-
if (!existsSync(dir)) continue;
|
|
51
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
52
|
-
if (!entry.isFile() || !entry.name.endsWith('.json')) continue;
|
|
53
|
-
const record = readJson(join(dir, entry.name), null);
|
|
54
|
-
const name = String(record?.task?.name ?? '').trim();
|
|
55
|
-
takeTitle(titles, name, record?.cardFields?.displayPath ?? record?.task?.displayPath);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return titles;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async function fetchTranslations(texts, fetchImpl = globalThis.fetch) {
|
|
62
|
-
if (typeof fetchImpl !== 'function') return texts.map(() => null);
|
|
63
|
-
const platformUrl = process.env.PLATFORM_ACCESS_URL?.replace(/\/+$/, '');
|
|
64
|
-
const platformKey = process.env.PLATFORM_ACCESS_KEY;
|
|
65
|
-
if (platformUrl && !platformKey) return texts.map(() => null);
|
|
66
|
-
const endpoint = platformUrl ? platformUrl + '/api/ms/agent/toolbox/translate' : TRANSLATE_API_URL;
|
|
67
|
-
const values = [];
|
|
68
|
-
for (let start = 0; start < texts.length; start += 50) {
|
|
69
|
-
const batch = texts.slice(start, start + 50);
|
|
70
|
-
let result = null;
|
|
71
|
-
for (let attempt = 0; attempt <= 3; attempt += 1) {
|
|
72
|
-
try {
|
|
73
|
-
const response = await fetchImpl(endpoint, {
|
|
74
|
-
method: 'POST',
|
|
75
|
-
headers: { 'Content-Type': 'application/json', ...(platformUrl ? { 'x-platform-run-key': platformKey } : {}) },
|
|
76
|
-
body: JSON.stringify({ texts: batch, source_lang: 'en', target_lang: 'zh', mode: 'fast' }),
|
|
77
|
-
signal: AbortSignal.timeout(30_000),
|
|
78
|
-
});
|
|
79
|
-
if (response.status === 429) {
|
|
80
|
-
await new Promise((resolve) => setTimeout(resolve, 2 ** attempt * 1000));
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
84
|
-
const payload = await response.json();
|
|
85
|
-
if (!Array.isArray(payload.translations) || payload.translations.length !== batch.length) {
|
|
86
|
-
throw new Error('translations 数量不对');
|
|
87
|
-
}
|
|
88
|
-
result = payload.translations.map((item) => String(item ?? '').trim() || null);
|
|
89
|
-
break;
|
|
90
|
-
} catch {
|
|
91
|
-
if (attempt < 3 && fetchImpl === globalThis.fetch) {
|
|
92
|
-
await new Promise((resolve) => setTimeout(resolve, 2 ** attempt * 1000));
|
|
93
|
-
} else break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
values.push(...(result ?? batch.map(() => null)));
|
|
97
|
-
}
|
|
98
|
-
return values;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export async function applyPanelTitles(projectRoot, { fetchImpl } = {}) {
|
|
102
|
-
const controlsPath = join(projectRoot, 'configs', 'assets.controls.json');
|
|
103
|
-
const controls = readJson(controlsPath, {});
|
|
104
|
-
if (!controls || typeof controls !== 'object' || Array.isArray(controls)) {
|
|
105
|
-
return { updated: 0 };
|
|
106
|
-
}
|
|
107
|
-
const display = collectDisplayTitles(projectRoot);
|
|
108
|
-
const jobs = [];
|
|
109
|
-
let updated = 0;
|
|
110
|
-
|
|
111
|
-
for (const [name, entry] of Object.entries(controls)) {
|
|
112
|
-
if (!entry || typeof entry !== 'object') continue;
|
|
113
|
-
const fromDisplay = display.get(name);
|
|
114
|
-
if (hasCjk(fromDisplay) && entry.title !== fromDisplay) {
|
|
115
|
-
entry.title = fromDisplay;
|
|
116
|
-
updated += 1;
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
if (hasCjk(entry.title)) continue;
|
|
120
|
-
const seed = String(entry.title || name).trim() || name;
|
|
121
|
-
if (!needsTranslation(seed)) continue;
|
|
122
|
-
jobs.push({ name, text: readableEnglish(seed) });
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (jobs.length > 0) {
|
|
126
|
-
const translated = await fetchTranslations(jobs.map((job) => job.text), fetchImpl);
|
|
127
|
-
jobs.forEach((job, index) => {
|
|
128
|
-
const zh = translated[index];
|
|
129
|
-
if (!hasCjk(zh)) return;
|
|
130
|
-
if (controls[job.name].title === zh) return;
|
|
131
|
-
controls[job.name].title = zh;
|
|
132
|
-
updated += 1;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (updated) {
|
|
137
|
-
mkdirSync(join(projectRoot, 'configs'), { recursive: true });
|
|
138
|
-
writeFileSync(controlsPath, `${JSON.stringify(controls, null, 2)}\n`, 'utf8');
|
|
139
|
-
}
|
|
140
|
-
return { updated };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export function copyControlTitlesToSnapshot(projectRoot) {
|
|
144
|
-
const snapshotPath = join(projectRoot, 'unified_data_control_config.json');
|
|
145
|
-
const controls = readJson(join(projectRoot, 'configs', 'assets.controls.json'), {});
|
|
146
|
-
const snapshot = readJson(snapshotPath, []);
|
|
147
|
-
if (!Array.isArray(snapshot) || !controls || typeof controls !== 'object') return { updated: 0 };
|
|
148
|
-
let updated = 0;
|
|
149
|
-
for (const entry of snapshot) {
|
|
150
|
-
if (!entry || typeof entry.schema !== 'string' || !entry.schema.startsWith('assets.')) continue;
|
|
151
|
-
const name = entry.schema.slice('assets.'.length);
|
|
152
|
-
const title = controls[name]?.title;
|
|
153
|
-
if (!hasCjk(title) || entry.title === title) continue;
|
|
154
|
-
entry.title = title;
|
|
155
|
-
updated += 1;
|
|
156
|
-
}
|
|
157
|
-
if (updated) {
|
|
158
|
-
writeFileSync(snapshotPath, `${JSON.stringify(snapshot, null, 2)}\n`, 'utf8');
|
|
159
|
-
}
|
|
160
|
-
return { updated };
|
|
161
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lightgame-runtime-adapt
|
|
3
|
-
description: >
|
|
4
|
-
仅当用户本轮明确要求把现有 JS2D 工程从 vendor / CoreManager 升级、适配或迁移到 runtime/lightgame/1.1.0 时使用。
|
|
5
|
-
普通生成、iterate、出包、见到 CoreManager、缺少 game-runtime.json 都不够,不要加载。
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# 从 vendor 升级到 lightgame 1.1.0(JS2D)
|
|
9
|
-
|
|
10
|
-
这是一次性迁移,不是默认开发路径。Vendor / CoreManager 能继续出包时不要加载本 skill,也不要改老局架构。
|
|
11
|
-
|
|
12
|
-
对照结构只读 `${CRAFT_SKILL_DIR}/project/`(本 skill 内的 1.1.0 模板快照:runtime、配置模块与脚手架,不含 vendor,也不含 `1.0.0`)。不要按游戏工作区里的旧 vendor 继续扩写。沙箱里 `${CRAFT_PROJECT_DIR}` 是玩家那局游戏,不能当模板源。
|
|
13
|
-
|
|
14
|
-
## 何时加载
|
|
15
|
-
|
|
16
|
-
**只有**用户本轮明确说:从 vendor / CoreManager 升级、适配或迁移到 `runtime/lightgame/1.1.0`,或点名本 skill。
|
|
17
|
-
|
|
18
|
-
以下都**不够**,保持双轨(老 CM / 新 runtime),不要执行本 skill:
|
|
19
|
-
|
|
20
|
-
- 工程 `import` `@tencent/core-manager-js`、`vendor/core-manager-js`、内联 `src/coreManager`
|
|
21
|
-
- 没有 `game-runtime.json`
|
|
22
|
-
- 出包失败、缺依赖、构建红字
|
|
23
|
-
- 加玩法、改美术、加排行榜
|
|
24
|
-
- 已经在用 `runtime/lightgame/1.0.0` 或 `1.1.0` 的普通迭代
|
|
25
|
-
|
|
26
|
-
## 禁止
|
|
27
|
-
|
|
28
|
-
- 禁止在未点名时新建 `game-runtime.json` 或覆盖 `runtime/`。
|
|
29
|
-
- 禁止 `import` `@tencent/core-manager-js`、其 `vendor/.../src/` 内部路径、或内联 `src/coreManager`。
|
|
30
|
-
- 禁止为补能力去改、抄、恢复 CoreManager 实现,也禁止把 `1.0.0/tools` 装回来补输入、音视频、UI 或 Canvas。游戏工程里已有的 `vendor/core-manager-js` 先留着,业务改接后再删引用;不要用空包覆盖它。
|
|
31
|
-
- 禁止安装或改写 `runtime/lightgame/1.0.0`。旧目录若已存在则保留,不覆盖、不删除。
|
|
32
|
-
- 禁止为了目录整齐丢掉玩法:不覆盖 `src/scenes/`、现有 `PlayScene` / `LoadScene`、资源、`SPEC/`。
|
|
33
|
-
- 不要通读打包 `.mjs`。先读同名 `.d.mts`,实现有问题时再读 `.mjs`。
|
|
34
|
-
- 本 skill 只处理 JS2D(Phaser)。不要改 JS3D,也不要去引 `core-manager-three`。
|
|
35
|
-
|
|
36
|
-
## 目标结构
|
|
37
|
-
|
|
38
|
-
路径相对游戏工程根(`${CRAFT_PROJECT_DIR}`),以 skill 内快照为准:
|
|
39
|
-
|
|
40
|
-
| 路径 | 用途 |
|
|
41
|
-
|---|---|
|
|
42
|
-
| `game-runtime.json` | 固定 SDK 到 `runtime/lightgame/1.1.0`,CLI 只校验;`configs` 目录与 `cdnBase` 也写在这里 |
|
|
43
|
-
| `runtime/lightgame/1.1.0/platform/` | 预览、截图视频合成、日志、ready、uiTree、runtime-result |
|
|
44
|
-
| `runtime/lightgame/1.1.0/tools/` | `assets.mjs` 的 `resolveAssetUrl`,以及 ASTC |
|
|
45
|
-
| `runtime/lightgame/1.1.0/tooling/` | Vite 插件 `lightgame()`、校验、profile |
|
|
46
|
-
| `scripts/skill-modules/export-config/` | 配置解析、导出、`gameConfig()` |
|
|
47
|
-
| `src/platform.ts` | 只转出 `connectPreview`,不在桥里初始化身份 |
|
|
48
|
-
| `src/screenUi.ts` | 屏幕 HUD;没有才补,有则保留。用 DOM,不引旧 tools/ui |
|
|
49
|
-
| `src/main.ts` | 已有 Phaser 入口上接平台桥,不要换成模板空壳 |
|
|
50
|
-
| `vite.config.ts` | `lightgame()` 与 `gameConfig()` 并列 |
|
|
51
|
-
| `configs/*.json` | 默认值;同名 `*.controls.json` 是控件元数据 |
|
|
52
|
-
|
|
53
|
-
## 旧 API → 1.1.0
|
|
54
|
-
|
|
55
|
-
| 旧(CoreManager-js / 内联 src/coreManager) | 新 |
|
|
56
|
-
|---|---|
|
|
57
|
-
| `LogManager` / 截图 / 调试条 | `platform/platform.d.mts`:`connectPreview`。挂在现有 `Phaser.Game` 的 `postBoot`:每帧 `POST_RENDER` 里 `afterRender()`,加载层第一帧 `markReady()`,销毁 `dispose()` |
|
|
58
|
-
| `ConfigManager` | `configs/*.json` + `scripts/skill-modules/export-config` 的 `gameConfig()`。目录和 CDN 写 `game-runtime.json` 的 `configs`、`cdnBase` |
|
|
59
|
-
| `ResourceManager` / `AssetUrlResolver` | 玩法图用 Phaser Loader;URL 解析用 `tools/assets.d.mts` 的 `resolveAssetUrl` |
|
|
60
|
-
| `InputManager` / 键盘 / 摇杆 | Phaser 输入。不要装 `1.0.0/tools/input` |
|
|
61
|
-
| `DomUiKit` / `createButton` | 已有 HUD 保持;没有才用快照里的 `src/screenUi.ts`。不要引 `1.0.0/tools/ui` |
|
|
62
|
-
| 音视频 | Phaser / 浏览器 API。不要引 `1.0.0/tools/audio` 或 `video` |
|
|
63
|
-
| 排行榜 / 云存档 / 身份 | 玩法确实用到时再加载 `platform-services`,装到 `src/skill-modules/platform-services/`。`markReady()` 前显式 `init()` 同一身份服务,不等身份或读档成功才 ready。预览桥不负责初始化或销毁 |
|
|
64
|
-
| `SpriteAnimManager` 等无对应模块 | 留在 Phaser / 业务里实现,不要回去引 CoreManager |
|
|
65
|
-
|
|
66
|
-
入口约定与新模板一致:`parent: 'game'`,`render.preserveDrawingBuffer: true`,`PlayScene` 显式 `super({ key: 'PlayScene' })`,`main.ts` 用 `scene.add` 登记。
|
|
67
|
-
|
|
68
|
-
## 执行步骤
|
|
69
|
-
|
|
70
|
-
1. 确认用户本轮原文是从 vendor / CoreManager 升级到 `1.1.0`,或点名本 skill。不是则停。
|
|
71
|
-
2. 在 `${CRAFT_PROJECT_DIR}` 搜索 `@tencent/core-manager-js`、`vendor/core-manager-js`、`src/coreManager`、`LogManager`、`ResourceManager`、`InputManager`、`ConfigManager`、`DomUiKit`,列出业务引用。
|
|
72
|
-
3. 把 skill 内快照的 1.1.0 runtime 与配置脚手架装进游戏工程(不覆盖玩法入口):
|
|
73
|
-
|
|
74
|
-
```sh
|
|
75
|
-
node "${CRAFT_SKILL_DIR}/scripts/install-template.mjs" --project "${CRAFT_PROJECT_DIR}"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
4. 改 `vite.config.ts`:从 `runtime/lightgame/1.1.0/tooling/vite.mjs` 引入 `lightgame()`,从 `scripts/skill-modules/export-config/vite.mjs` 引入 `gameConfig()`,两者并列。对照模板 `vite.config.ts`。去掉 CoreManager 的 alias。
|
|
79
|
-
5. 现有 `src/main.ts` 对齐平台桥(不要整文件换成模板空游戏):
|
|
80
|
-
- `connectPreview(canvas)` 在 Phaser `postBoot`
|
|
81
|
-
- 每帧 `POST_RENDER` 里 `preview.afterRender()`
|
|
82
|
-
- 加载层第一帧 `markReady`;销毁时 `preview.dispose()`
|
|
83
|
-
- 不要等云端身份或读档成功才 `ready`
|
|
84
|
-
- 仍引用 CoreManager 的 `src/platform.ts` 由安装器换成 1.1.0 转出;已经引用 lightgame 的文件保留,由本步改 import
|
|
85
|
-
6. 按上表改 import 和调用,删掉对 CoreManager 的依赖与别名。需要榜单或存档时再加载 `platform-services`,在可能触发 `markReady()` 之前 `void service.init()`。有 `screenUi.ts` 则在现有 Play 流程里挂上,不要新建一套 Scene 覆盖玩法。
|
|
86
|
-
7. `package.json` 脚本以 install 结果为准(`build` 含 typecheck)。保留 Phaser 依赖。
|
|
87
|
-
8. 在 `${CRAFT_PROJECT_DIR}` 执行 `npm run build`,加载 `visual-qa` 后再对可见内容调用 `game_visual_qa`。
|
|
88
|
-
|
|
89
|
-
`install-template.mjs` 交付 `runtime/lightgame/1.1.0/`、`scripts/skill-modules/export-config/`、`game-runtime.json`(保留旧 manifest 的 `configs` / `cdnBase`)。仍引用 CoreManager 的 `src/platform.ts` 会覆盖为 1.1.0 桥;没有 `src/screenUi.ts` 才补。不改 `src/main.ts`、`src/scenes/`、资源、`SPEC/`、`vendor/`,也不写入 `runtime/lightgame/1.0.0`。看到 preserved 提示后检查脚本是否仍指向旧导出 CLI。维护本 skill 时从 `js/project` 同步 `1.1.0` 与 export-config,不要带 `vendor/` 或 `1.0.0`。
|
|
90
|
-
|
|
91
|
-
## 收尾
|
|
92
|
-
|
|
93
|
-
交付说明写清:已去掉哪些 CoreManager 引用、改接到哪些 1.1.0 模块、构建与视觉结果。未对上的旧 API 列出来,不要假装还在用 vendor。区分构建验证与真实宿主服务联调。
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "lightgame-js-template",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "npm run config:export && npm run typecheck && vite build",
|
|
9
|
-
"preview": "vite preview",
|
|
10
|
-
"typecheck": "tsc --noEmit",
|
|
11
|
-
"runtime:verify": "node runtime/lightgame/1.1.0/tooling/cli.mjs verify",
|
|
12
|
-
"runtime:refresh": "node scripts/refresh-runtime.mjs",
|
|
13
|
-
"config:export": "node scripts/config-export.mjs"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"phaser": "3.90.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"typescript": "5.8.3",
|
|
20
|
-
"vite": "7.3.5"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* qq-ai-game-sdk v0.5.8 — 手 Q AI 游戏 JS SDK
|
|
3
|
-
* (c) Tencent. All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
"use strict";var QQAiGameSdk=(()=>{var G=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var Te=(e,t)=>{for(var r in t)G(e,r,{get:t[r],enumerable:!0})},be=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ae(t))!Ge.call(e,n)&&n!==r&&G(e,n,{get:()=>t[n],enumerable:!(o=Oe(t,n))||o.enumerable});return e};var ve=e=>be(G({},"__esModule",{value:!0}),e);var $e={};Te($e,{MallOrderStatus:()=>g,PayType:()=>y,QToastMode:()=>R,default:()=>je,normalizeErrorCode:()=>T});var Ce=new Set(["E_NO_GAME_ID","E_NO_UIN","E_LOGIN_FAILED","E_NOT_LOGIN","E_NO_SESSION","E_MISSING_RANK_KEY","E_INVALID_PARAM","E_TOAST_INVALID_PARAM","E_NAV_BUTTONS_INVALID_PARAM","E_STORAGE_INVALID_PARAM","E_STORAGE_FAILED","E_CHAPTER_DIRECTORY_BUSY","E_CHAPTER_DIRECTORY_EMPTY","E_CHAPTER_DIRECTORY_FAILED","E_PAY_PANEL_INVALID_PARAM","E_SHARE_INVALID_PARAM","E_SHARE_SIGN_FAILED","E_URL_INVALID_PARAM","E_LIST_PRODUCTS_INVALID_PAY_TYPE","E_CREATE_ORDER_MISSING_PRODUCT_ID","E_CREATE_ORDER_INVALID_QUANTITY","E_LIST_PURCHASES_MISSING_PRODUCT_ID","E_LIST_PURCHASES_INVALID_STATUSES","E_PAY_LIST_PURCHASES_INVALID_PARAM","E_PAY_LIST_PURCHASES_NOT_LOGIN","E_PAY_LIST_PURCHASES_FAILED","E_LIST_UNDELIVERED_INVALID_PAY_TYPE","E_LIST_UNDELIVERED_INVALID_LIMIT","E_CONFIRM_DELIVERY_MISSING_ORDER_ID","E_NETWORK","E_BACKEND","E_NO_BRIDGE","E_UNSUPPORTED_VERSION","E_UNKNOWN_METHOD","E_TIMEOUT","E_CANCELLED"]);function T(e){if(typeof e!="string"||e.length===0)return"E_BACKEND";let t=e.indexOf(":"),r=t>=0?e.slice(0,t):e,o=r==="E_METHOD_NOT_FOUND"?"E_UNKNOWN_METHOD":r;return Ce.has(o)?o:"E_BACKEND"}var R=Object.freeze({Info:0,Success:1,Warning:2}),y=Object.freeze({UNKNOWN:0,COIN:1,CASH:2}),g=Object.freeze({UNKNOWN:0,PENDING:1,PAID:2,DELIVERED:3,CANCELLED:4,FAILED:5});function p(e,t){let r=null,o=e;if(e&&typeof e=="object"){let n=e;if(typeof n.onSuccess=="function"||typeof n.onFail=="function"){r={onSuccess:n.onSuccess,onFail:n.onFail};let a={};for(let s of Object.keys(n))s!=="onSuccess"&&s!=="onFail"&&(a[s]=n[s]);o=a}}return new Promise((n,a)=>{t(o,{onSuccess(s){if(r!=null&&r.onSuccess)try{r.onSuccess(s)}catch(i){console.error("[qqAiGameSdk] onSuccess threw:",i)}n(s)},onFail(s){if(r!=null&&r.onFail)try{r.onFail(s)}catch(i){console.error("[qqAiGameSdk] onFail threw:",i)}a(s)}})})}function l(e,t,r=!1,o){let n=new Error(t||e);return n.code=e,n.retryable=r,n.cause=o,n}function b(e,t="E_BACKEND"){if(e&&typeof e=="object"&&"code"in e&&"retryable"in e)return e;let r=e instanceof Error?e.message:String(e);return l(t,r,!1,e)}function U(){if(typeof window=="undefined"||window.__qqAiGameSdkForceMock)return!1;let e=window.__qqAiGameBridge;return!!(e&&typeof e.invoke=="function")}function _(e,t){return new Promise((r,o)=>{let n=typeof window!="undefined"?window.__qqAiGameBridge:void 0;if(!n||typeof n.invoke!="function"){o(l("E_NO_BRIDGE","native bridge (window.__qqAiGameBridge.invoke) not available",!1));return}let a;try{a=JSON.stringify(t!=null?t:{})}catch(s){o(l("E_INVALID_PARAM","payload not serializable",!1,s));return}try{n.invoke(e,a,s=>{try{let i=typeof s=="string"?JSON.parse(s):s;if(!i||typeof i!="object"){o(l("E_BACKEND","bridge.".concat(e," invalid response"),!1));return}if("ret"in i&&i.ret===0){r(i.data);return}let c=i,f=T(c.code);o(l(f,(typeof c.msg=="string"?c.msg:"")||"bridge.".concat(e," ret=").concat(c.ret),f==="E_CHAPTER_DIRECTORY_BUSY"||f==="E_CHAPTER_DIRECTORY_FAILED"))}catch(i){o(b(i,"E_BACKEND"))}})}catch(s){o(b(s,"E_NETWORK"))}})}function q(){return _("login",{})}function M(){return _("reportGameStart",{})}function V(e){return _("reportGameEnd",e)}function B(e){return _("reportScore",e)}function m(e,t){return _(e,t!=null?t:{})}function F(e,t){let r=typeof window!="undefined"?window.__qqAiGameBridge:void 0;if(!r||typeof r.invoke!="function")return;let o;try{o=JSON.stringify(t!=null?t:{})}catch(n){return}try{r.invoke(e,o)}catch(n){}}function h(){}function k(e,t){if(!e||typeof t!="function")return h;let r=typeof window!="undefined"?window.__qqAiGameBridge:void 0;if(!r||typeof r.on!="function"){try{console.warn("[qqAiGameSdk] bridge.on unavailable (old Native or no bridge), listener will not be invoked, topic="+e)}catch(o){}return h}try{let o=r.on(e,t);return typeof o=="function"?o:h}catch(o){return h}}function v(e){if(!e)return!1;let t=typeof window!="undefined"?window.__qqAiGameBridge:void 0;if(!t||typeof t.canI!="function")return!1;try{return!!t.canI(e)}catch(r){return!1}}function Ne(){return"ps_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,8)}function Q(e){let t=Ne();return new Promise((r,o)=>{let n=!1,a=()=>{},s=()=>{if(!n){n=!0;try{a()}catch(i){}}};a=k("host.pay.onResult",i=>{let c=i;!c||typeof c!="object"||c.sessionId===t&&(s(),c.status==="completed"||c.status==="cancelled"?r({status:c.status}):(console.warn("[qqAiGameSdk] pay.onResult unknown status:",c.status),r({status:"cancelled"})))}),m("pay.showPanel",{payToken:e,sessionId:t}).then(i=>{if(!i||i.status!=="shown"){s();let c=i;c&&(c.status==="completed"||c.status==="cancelled")?r(c):o(l("E_BACKEND","pay.showPanel invalid ack",!1))}}).catch(i=>{s(),o(i)})})}function K(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.chapterId!="string"||t.chapterId.length===0||typeof t.sequence!="number"||!Number.isFinite(t.sequence)||typeof t.title!="string"?null:{chapterId:t.chapterId,sequence:t.sequence,title:t.title}}var Y=128,H=65536;function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $(e){if(!e||typeof e!="object")return{ok:!1,error:l("E_NAV_BUTTONS_INVALID_PARAM","closeButtonVisible or moreButtonVisible is required",!1)};let t=j(e,"closeButtonVisible"),r=j(e,"moreButtonVisible");if(!t&&!r)return{ok:!1,error:l("E_NAV_BUTTONS_INVALID_PARAM","closeButtonVisible or moreButtonVisible is required",!1)};let o={};if(t){if(typeof e.closeButtonVisible!="boolean")return{ok:!1,error:l("E_NAV_BUTTONS_INVALID_PARAM","closeButtonVisible must be boolean",!1)};o.closeButtonVisible=e.closeButtonVisible}if(r){if(typeof e.moreButtonVisible!="boolean")return{ok:!1,error:l("E_NAV_BUTTONS_INVALID_PARAM","moreButtonVisible must be boolean",!1)};o.moreButtonVisible=e.moreButtonVisible}return{ok:!0,payload:o}}function C(e){return typeof e!="string"||e.length<1||e.length>Y?l("E_STORAGE_INVALID_PARAM","key length must be in [1, ".concat(Y,"]"),!1):null}function N(e){return e===void 0?{ok:!0,payload:"game"}:e==="game"||e==="user"?{ok:!0,payload:e}:{ok:!1,error:l("E_STORAGE_INVALID_PARAM","scope must be 'game' or 'user'",!1)}}function z(e){let t=C(e&&e.key);if(t)return{ok:!1,error:t};if(!e||typeof e.value!="string"||e.value.length>H)return{ok:!1,error:l("E_STORAGE_INVALID_PARAM","value must be a string with length <= ".concat(H),!1)};let r=N(e.scope);return r.ok?{ok:!0,payload:{key:e.key,value:e.value,scope:r.payload}}:r}function W(e){let t=C(e&&e.key);if(t)return{ok:!1,error:t};let r=N(e.scope);return r.ok?{ok:!0,payload:{key:e.key,scope:r.payload}}:r}function J(e){let t=C(e&&e.key);if(t)return{ok:!1,error:t};let r=N(e.scope);return r.ok?{ok:!0,payload:{key:e.key,scope:r.payload}}:r}var d={gopenid:null,gameToken:null,expiresAt:0,sessionId:null,startedAt:0,bestByKey:{},lastReport:null};function S(e){setTimeout(e,0)}function De(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ee(e){let t=[],r=Object.keys(e||{});for(let o=0;o<r.length;o++){let n=r[o],a=e[n],s=typeof a=="number"?a:Number(a)||0,i=d.bestByKey[n]!=null?d.bestByKey[n]:0,c=s>i,f=c?s:i;d.bestByKey[n]=f,t.push({rankKey:n,rankValue:s,bestRankValue:f,rank:Math.floor(Math.random()*100)+1,isNewBest:c})}return t}function te(){return new Promise(e=>{if(d.gopenid&&Date.now()<d.expiresAt){e({gopenid:d.gopenid,gameToken:d.gameToken||"mock-token",expiresIn:Math.max(0,Math.floor((d.expiresAt-Date.now())/1e3))});return}S(()=>{d.gopenid="local-dev-"+Math.random().toString(36).slice(2,8),d.gameToken="mock-token-"+Math.random().toString(36).slice(2,10),d.expiresAt=Date.now()+864e5;let t={gopenid:d.gopenid,gameToken:d.gameToken,expiresIn:86400};console.log("[qqAiGameSdk.mock] login \u2192",t),e(t)})})}function re(){return new Promise(e=>{S(()=>{d.sessionId&&console.warn("[qqAiGameSdk.mock] \u4E0A\u4E00\u5C40\u672A reportGameEnd \u5C31\u518D\u6B21 reportGameStart\uFF0C\u81EA\u52A8\u4F5C\u5E9F\u4E0A\u4E00\u5C40:",d.sessionId),d.sessionId=De(),d.startedAt=Date.now(),d.lastReport=null;let t={sessionId:d.sessionId,startedAt:d.startedAt,serverTime:Math.floor(Date.now()/1e3)};console.log("[qqAiGameSdk.mock] reportGameStart \u2192",t),e(t)})})}function oe(e){return new Promise((t,r)=>{S(()=>{if(!e||!e.sessionId){r(l("E_INVALID_PARAM","sessionId is required",!1));return}if(!e.data||typeof e.data!="object"||!Object.keys(e.data).length){r(l("E_INVALID_PARAM","data is required",!1));return}if(d.sessionId&&e.sessionId!==d.sessionId){r(l("E_NO_SESSION","sessionId not match current session",!1));return}d.lastReport={data:{...e.data},ts:Date.now()};let o=ee(e.data),n={gopenid:d.gopenid||"local-dev",rankResults:o};console.log("[qqAiGameSdk.mock] reportScore \u2192",n),t(n)})})}function ne(e){return new Promise((t,r)=>{S(()=>{let o=e&&e.sessionId;if(!o){r(l("E_INVALID_PARAM","sessionId is required",!1));return}d.sessionId&&o!==d.sessionId&&console.warn("[qqAiGameSdk.mock] sessionId \u4E0D\u4E00\u81F4\uFF0C\u4EE5 opts \u4E3A\u51C6:",o,"\u7F13\u5B58:",d.sessionId);let n=e.data,a=n?ee(n):[],s={sessionId:o,rankResults:a};try{localStorage.setItem("qqAiGameSdk_lastGameEnd",JSON.stringify({sessionId:o,data:n||null,rankResults:a,ts:Date.now()}))}catch(i){}console.log("[qqAiGameSdk.mock] reportGameEnd \u2192",s),d.sessionId=null,d.startedAt=0,d.lastReport=null,t(s)})})}var I=[{productId:"diamond_100",name:"\u94BB\u77F3 100",payType:y.CASH,price:600,iconUrl:"",desc:"\u73B0\u91D1\u8D2D\u4E70 100 \u94BB"},{productId:"diamond_1000",name:"\u94BB\u77F3 1000",payType:y.CASH,price:5e3,iconUrl:"",desc:"\u73B0\u91D1\u8D2D\u4E70 1000 \u94BB"},{productId:"skin_default",name:"\u9ED8\u8BA4\u76AE\u80A4",payType:y.COIN,price:500,iconUrl:"",desc:"\u6E38\u620F\u5E01\u8D2D\u4E70"}],P=Object.create(null),we=1;function Le(e){for(let t=0;t<I.length;t++)if(I[t].productId===e)return I[t]}function se(e){return new Promise(t=>{S(()=>{let r=e&&e.payType,o=r?I.filter(n=>n.payType===r):I.slice();console.log("[qqAiGameSdk.mock] listProducts \u2192",o.length,"items"),t({products:o})})})}function ae(e){return new Promise((t,r)=>{S(()=>{let o=Le(e.productId);if(!o){r(l("E_BACKEND","mock: product '".concat(e.productId,"' not found"),!1));return}let n=e.quantity==null?1:e.quantity,a=String(1e9+we++),s=Math.floor(Date.now()/1e3),i="mock_pay_token_"+a,c=o.payType===y.COIN?g.PAID:g.PENDING;P[a]={orderId:a,productId:o.productId,productName:o.name,payType:o.payType,status:c,amount:o.price*n,createdAt:s,paidAt:c===g.PAID?s:0,metadata:e.metadata||"",payToken:i};let f={orderId:a,payToken:i};console.log("[qqAiGameSdk.mock] createOrder \u2192",f),t(f)})})}function ie(e){return new Promise(t=>{S(()=>{let r=e&&e.statuses||[g.PAID,g.DELIVERED],o=e.productId,n=Object.keys(P).map(s=>P[s]);n=n.filter(s=>s.productId===o&&r.indexOf(s.status)>=0),n.sort((s,i)=>i.createdAt-s.createdAt);let a=n.map(s=>({orderId:s.orderId,productId:s.productId,productName:s.productName,payType:s.payType,status:s.status,amount:s.amount,createdAt:s.createdAt,paidAt:s.paidAt,metadata:s.metadata}));console.log("[qqAiGameSdk.mock] listPurchases \u2192",a.length,"productId=",o),t({purchases:a})})})}function le(e){return new Promise(t=>{S(()=>{let r=e&&e.payType,o=Math.max(1,Math.min(e&&e.limit||50,200)),n=Object.keys(P).map(s=>P[s]);n=n.filter(s=>s.status===g.PENDING||s.status===g.PAID),r&&(n=n.filter(s=>s.payType===r)),n.sort((s,i)=>i.createdAt-s.createdAt);let a=n.slice(0,o).map(s=>({orderId:s.orderId,productId:s.productId,productName:s.productName,payType:s.payType,status:s.status,amount:s.amount,createdAt:s.createdAt,payToken:s.status===g.PENDING?s.payToken:void 0,metadata:s.metadata}));console.log("[qqAiGameSdk.mock] listUndeliveredOrders \u2192",a.length),t({orders:a})})})}function ce(e){return new Promise((t,r)=>{S(()=>{let o=P[e.orderId];if(!o){console.warn("[qqAiGameSdk.mock] confirmDelivery: orderId \u4E0D\u5B58\u5728\uFF0C\u6A21\u62DF\u5DF2\u53D1\u8D27\u8FD4\u56DE:",e.orderId),t({status:g.DELIVERED});return}if(o.status===g.PENDING){r(l("E_BACKEND","mock: order not paid yet",!1));return}o.status===g.PAID&&(o.status=g.DELIVERED),t({status:g.DELIVERED})})})}function ue(e){return new Promise(t=>{S(()=>{console.log("[qqAiGameSdk.mock] showSharePanel \u2192 channel=qqfriend"),t({channel:"qqfriend"})})})}function de(e){return new Promise(t=>{S(()=>{let r=e&&e.page||"detail",o=e&&e.params||{},n=[],a=Object.keys(o);for(let E=0;E<a.length;E++)n.push("".concat(encodeURIComponent(a[E]),"=").concat(encodeURIComponent(String(o[a[E]]))));let s=n.length?"&"+n.join("&"):"",i=typeof location!="undefined"&&location.origin?location.origin:"https://local.dev",c="".concat(i,"/mock-game-url?page=").concat(r).concat(s),f="mqqapi://mock/game?page=".concat(r).concat(s);console.log("[qqAiGameSdk.mock] getGameUrl \u2192 page=".concat(r)),t({url:c,scheme:f})})})}function pe(){return new Promise(e=>{S(()=>{e({gameId:"mock-game",coverUrl:"",gameName:"Mock Game"})})})}function me(e){return new Promise(t=>{S(()=>{console.log("[qqAiGameSdk.mock] setNavigationBarButtons \u2192",e),t({errCode:0})})})}function Se(){return new Promise(e=>{S(()=>{console.log("[qqAiGameSdk.mock] showMorePanel"),e({errCode:0})})})}function ge(){return new Promise(e=>{S(()=>{console.log("[qqAiGameSdk.mock] showChapterDirectory"),e({errCode:0,total:3})})})}var X="qqAiGameSdk.storage",Z="mock-game",xe="mock-user",O=Object.create(null);function w(e,t){let r=e==="user"?"".concat(X,".user.").concat(Z,".").concat(xe):"".concat(X,".game.").concat(Z);return"".concat(r,".").concat(t)}function fe(e){return new Promise(t=>{S(()=>{let r=w(e.scope,e.key);O[r]=e.value;try{typeof localStorage!="undefined"&&localStorage.setItem(r,e.value)}catch(o){}t({errCode:0})})})}function Re(e){return new Promise(t=>{S(()=>{let r=w(e.scope,e.key),o=null;try{typeof localStorage!="undefined"&&(o=localStorage.getItem(r))}catch(n){}o===null&&Object.prototype.hasOwnProperty.call(O,r)&&(o=O[r]),t({value:o})})})}function ye(e){return new Promise(t=>{S(()=>{let r=w(e.scope,e.key);delete O[r];try{typeof localStorage!="undefined"&&localStorage.removeItem(r)}catch(o){}t({errCode:0})})})}var D=Object.create(null);function Pe(e,t){return!e||typeof t!="function"?function(){}:((D[e]||(D[e]=[])).push(t),function(){let n=D[e];if(!n)return;let a=n.indexOf(t);a>=0&&n.splice(a,1)})}function _e(e){return!1}var x="0.5.8",Ue=[R.Info,R.Success,R.Warning];function qe(){return typeof window=="undefined"||window.__qqAiGameSdkForceMock?"mock":U()?"bridge":"mock"}var u=qe(),Ee={version:x,get isMock(){return u==="mock"},get transport(){return u},login(e){return p(e,(t,r)=>{(u==="bridge"?q():te()).then(o=>r.onSuccess(o)).catch(o=>r.onFail(o))})},reportGameStart(e){return p(e,(t,r)=>{(u==="bridge"?M():re()).then(o=>r.onSuccess(o)).catch(o=>r.onFail(o))})},reportScore(e){return p(e,(t,r)=>{(u==="bridge"?B(t):oe(t)).then(o=>r.onSuccess(o)).catch(o=>r.onFail(o))})},reportGameEnd(e){return p(e,(t,r)=>{(u==="bridge"?V(t):ne(t)).then(o=>r.onSuccess(o)).catch(o=>r.onFail(o))})},showToast(e){return p(e,(t,r)=>{if(!t||typeof t.text!="string"||t.text.length===0){r.onFail(l("E_TOAST_INVALID_PARAM","text is required",!1));return}let o=t.mode===void 0?R.Success:t.mode;if(typeof o!="number"||Ue.indexOf(o)<0){r.onFail(l("E_TOAST_INVALID_PARAM","mode must be QToastMode.Info/Success/Warning",!1));return}(u==="bridge"?m("ui.showToast",{text:t.text,mode:o}):(console.log("[qqAiGameSdk] showToast (mock, mode=".concat(o,"): ").concat(t.text)),Promise.resolve({errCode:0}))).then(a=>r.onSuccess(a)).catch(a=>r.onFail(a))})},openUrl(e,t){if(typeof e!="string"||e.length===0){console.warn("[qqAiGameSdk] openUrl: url \u975E\u6CD5\uFF08\u9700\u975E\u7A7A\u5B57\u7B26\u4E32\uFF09\uFF0C\u5DF2\u5FFD\u7565");return}let r=t===!0;u==="bridge"?F("nav.openUrl",{url:e,closeCurPage:r}):console.log("[qqAiGameSdk] openUrl (mock): ".concat(e," closeCurPage=").concat(r))},closeGame(e){return p(e,(t,r)=>{let o=t&&typeof t.reason=="string"?t.reason:void 0;(u==="bridge"?m("game.close",o?{reason:o}:{}):(console.log("[qqAiGameSdk] closeGame (mock)",o||""),Promise.resolve({errCode:0}))).then(a=>r.onSuccess(a)).catch(a=>r.onFail(a))})},getGameInfo(e){return p(e,(t,r)=>{(u==="bridge"?m("game.getGameInfo",{}):pe()).then(o=>r.onSuccess(o)).catch(o=>r.onFail(o))})},setNavigationBarButtons(e){return p(e,(t,r)=>{let o=$(t);if(!o.ok){r.onFail(o.error);return}(u==="bridge"?m("nav.setButtonsVisibility",o.payload):me(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},showMorePanel(e){return p(e,(t,r)=>{(u==="bridge"?m("nav.showMorePanel",{}):Se()).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},showChapterDirectory(e){return p(e,(t,r)=>{(u==="bridge"?m("game.showChapterDirectory",{}):ge()).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},setStorage(e){return p(e,(t,r)=>{let o=z(t);if(!o.ok){r.onFail(o.error);return}(u==="bridge"?m("storage.set",o.payload):fe(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},getStorage(e){return p(e,(t,r)=>{let o=W(t);if(!o.ok){r.onFail(o.error);return}(u==="bridge"?m("storage.get",o.payload):Re(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},removeStorage(e){return p(e,(t,r)=>{let o=J(t);if(!o.ok){r.onFail(o.error);return}(u==="bridge"?m("storage.remove",o.payload):ye(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},showPayPanel(e){return p(e,(t,r)=>{if(!t||typeof t.payToken!="string"||t.payToken.length===0){r.onFail(l("E_PAY_PANEL_INVALID_PARAM","payToken is required",!1));return}let o;u==="bridge"?v("host.pay.onResult")?o=Q(t.payToken):(console.warn("[qqAiGameSdk] pay.showPanel running in v1 mode (host does not support pay.onResult), subject to 30s router timeout. Please upgrade host SDK."),o=m("pay.showPanel",{payToken:t.payToken})):(console.log("[qqAiGameSdk] showPayPanel (mock): ".concat(t.payToken)),o=Promise.resolve({status:"completed"})),o.then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},showSharePanel(e){return p(e,(t,r)=>{let o=Ye(t);if(o.err){r.onFail(o.err);return}(u==="bridge"?m("share.showPanel",o.payload):ue(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},getGameUrl(e){return p(e,(t,r)=>{let o=He(t);if(o.err){r.onFail(o.err);return}(u==="bridge"?m("share.getGameUrl",o.payload):de(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},enterScene(e){return p(e,(t,r)=>{var a,s;if(!t||typeof t.chapterId!="string"||!t.chapterId||typeof t.sceneId!="string"||!t.sceneId){r.onFail(l("E_INVALID_PARAM","chapterId and sceneId are required",!1));return}let o=JSON.stringify({chapter_id:t.chapterId,scene_id:t.sceneId,is_new_to_player:!!t.isNewToPlayer,scene_title:(a=t.sceneTitle)!=null?a:"",scene_content:(s=t.sceneContent)!=null?s:""});(u==="bridge"?m("net.trpcRequest",{cmd:"/v1/2171",data:o}).then(()=>({})):(console.log("[qqAiGameSdk] enterScene (mock): chapterId=".concat(t.chapterId)),Promise.resolve({}))).then(i=>r.onSuccess(i)).catch(i=>r.onFail(i))})},submitChoice(e){return p(e,(t,r)=>{var a,s;if(!t||typeof t.chapterId!="string"||!t.chapterId||typeof t.sceneId!="string"||!t.sceneId||typeof t.choiceId!="string"||!t.choiceId){r.onFail(l("E_INVALID_PARAM","chapterId, sceneId, and choiceId are required",!1));return}let o=JSON.stringify({chapter_id:t.chapterId,scene_id:t.sceneId,choice_id:t.choiceId,choice_text:(a=t.choiceText)!=null?a:"",time_to_decide_ms:(s=t.timeToDecideMs)!=null?s:0,was_replay:!!t.wasReplay});(u==="bridge"?m("net.trpcRequest",{cmd:"/v1/2172",data:o}).then(i=>L(i,{newVariables:{}})):(console.log("[qqAiGameSdk] submitChoice (mock): choiceId=".concat(t.choiceId)),Promise.resolve({newVariables:{}}))).then(i=>r.onSuccess(i)).catch(i=>r.onFail(i))})},addFriend(e){return p(e,(t,r)=>{var a,s,i;if(!t||typeof t.characterId!="string"||!t.characterId){r.onFail(l("E_INVALID_PARAM","characterId is required",!1));return}let o=JSON.stringify({character_id:t.characterId,chapter_id:(a=t.chapterId)!=null?a:"",scene_id:(s=t.sceneId)!=null?s:"",display_name:(i=t.displayName)!=null?i:""});(u==="bridge"?m("net.trpcRequest",{cmd:"/v1/2216",data:o}).then(c=>L(c,{isFirstAdd:!1,handshakeOk:!1,firstAddedAt:0})):(console.log("[qqAiGameSdk] addFriend (mock): characterId=".concat(t.characterId)),Promise.resolve({isFirstAdd:!0,handshakeOk:!0,firstAddedAt:Date.now()}))).then(c=>r.onSuccess(c)).catch(c=>r.onFail(c))})},listFriends(e){return p(e,(t,r)=>{(u==="bridge"?m("net.trpcRequest",{cmd:"/v1/2217",data:"{}"}).then(n=>L(n,{friends:[]})):(console.log("[qqAiGameSdk] listFriends (mock)"),Promise.resolve({friends:[]}))).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},listProducts(e){return p(e,(t,r)=>{let o=Ve(t);if(o.err){r.onFail(o.err);return}(u==="bridge"?m("pay.listProducts",o.payload):se(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},createOrder(e){return p(e,(t,r)=>{let o=Be(t);if(o.err){r.onFail(o.err);return}(u==="bridge"?m("pay.createOrder",o.payload):ae(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},listPurchases(e){return p(e,(t,r)=>{let o=Fe(t);if(o.err){r.onFail(o.err);return}(u==="bridge"?m("pay.listPurchases",o.payload):ie(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},listUndeliveredOrders(e){return p(e,(t,r)=>{let o=Qe(t);if(o.err){r.onFail(o.err);return}(u==="bridge"?m("pay.listUndeliveredOrders",o.payload):le(o.payload)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},confirmDelivery(e){return p(e,(t,r)=>{if(!t||typeof t.orderId!="string"||t.orderId.length===0){r.onFail(l("E_CONFIRM_DELIVERY_MISSING_ORDER_ID","orderId is required",!1));return}let o={orderId:t.orderId};typeof t.ack=="string"&&t.ack.length>0&&(o.ack=t.ack),(u==="bridge"?m("pay.confirmDelivery",o):ce(o)).then(n=>r.onSuccess(n)).catch(n=>r.onFail(n))})},canI(e){return u==="bridge"?v(e):_e(e)},getEnv(){let e=typeof window!="undefined"&&window.__QQAIGAME_LOAD_CONTEXT__||{},t=[],r="unknown";if(typeof window!="undefined"){let n=window.__qqAiGameBridge,a=n&&n.supportedMethods;a&&typeof a=="object"?t=Object.keys(a):Array.isArray(e.supportedMethods)&&(t=e.supportedMethods.slice()),n&&typeof n.injectVersion=="string"&&n.injectVersion.length>0&&(r=n.injectVersion)}let o={sdkJs:{version:x,protocol:1,injectVersion:r},sdkNative:{version:e.sdkNativeVersion||"unknown",platform:"unknown",platformVersion:"unknown"},host:{name:e.hostName||"unknown",version:e.hostVersion||"unknown"},app:{name:"mobileqq",version:e.appVersion||"unknown",build:e.appBuild||"unknown"},supportedMethods:t};return Promise.resolve(o)},onGameStartRequested(e){return A("game.pleaseStart",e)},onGamePauseRequested(e){return A("game.pleasePause",t=>e(Ie(t)))},onGameResumeRequested(e){return A("game.pleaseResume",t=>e(Ie(t)))},onChapterSelected(e){return A("game.chapterSelected",t=>{let r=K(t);r&&e(r)})}},he=[0,1,2],Me=[0,1,2,3,4,5];function ke(e){return typeof e=="number"&&Number.isFinite(e)&&Math.floor(e)===e&&e>0}function Ve(e){let t={};if(e&&e.payType!==void 0){if(typeof e.payType!="number"||he.indexOf(e.payType)<0)return{payload:t,err:l("E_LIST_PRODUCTS_INVALID_PAY_TYPE","invalid payType",!1)};t.payType=e.payType}return{payload:t,err:null}}function Be(e){if(!e||typeof e.productId!="string"||e.productId.length===0)return{payload:{productId:""},err:l("E_CREATE_ORDER_MISSING_PRODUCT_ID","productId is required",!1)};let t={productId:e.productId};if(e.quantity!==void 0){if(!ke(e.quantity))return{payload:t,err:l("E_CREATE_ORDER_INVALID_QUANTITY","quantity must be positive integer",!1)};t.quantity=e.quantity}return typeof e.metadata=="string"&&e.metadata.length>0&&(t.metadata=e.metadata),{payload:t,err:null}}function Fe(e){let t={productId:""};if(!e||typeof e.productId!="string"||e.productId.length===0)return{payload:t,err:l("E_LIST_PURCHASES_MISSING_PRODUCT_ID","productId required",!1)};if(t.productId=e.productId,e.statuses!==void 0){if(!Array.isArray(e.statuses)||e.statuses.length===0)return{payload:t,err:l("E_LIST_PURCHASES_INVALID_STATUSES","statuses must be non-empty array",!1)};for(let r=0;r<e.statuses.length;r++){let o=e.statuses[r];if(typeof o!="number"||Me.indexOf(o)<0)return{payload:t,err:l("E_LIST_PURCHASES_INVALID_STATUSES","invalid status at [".concat(r,"]"),!1)}}t.statuses=e.statuses.slice()}return{payload:t,err:null}}function Qe(e){let t={};if(e){if(e.payType!==void 0){if(typeof e.payType!="number"||he.indexOf(e.payType)<0)return{payload:t,err:l("E_LIST_UNDELIVERED_INVALID_PAY_TYPE","invalid payType",!1)};t.payType=e.payType}if(e.limit!==void 0){if(!ke(e.limit)||e.limit>200)return{payload:t,err:l("E_LIST_UNDELIVERED_INVALID_LIMIT","limit must be in [1, 200]",!1)};t.limit=e.limit}}return{payload:t,err:null}}var Ke=["detail","game"];function Ye(e){let t=e&&e.arkData;if(!t||typeof t.title!="string"||t.title.length===0)return{payload:{arkData:{title:""}},err:l("E_SHARE_INVALID_PARAM","arkData.title is required",!1)};let r={title:t.title};typeof t.desc=="string"&&(r.desc=t.desc),typeof t.previewUrl=="string"&&(r.previewUrl=t.previewUrl),typeof t.jumpUrl=="string"&&(r.jumpUrl=t.jumpUrl);let o={arkData:r};if(e&&e.linkData!==void 0){let n=e.linkData;if(!n||typeof n.title!="string"||n.title.length===0)return{payload:o,err:l("E_SHARE_INVALID_PARAM","linkData.title is required",!1)};let a={title:n.title};typeof n.desc=="string"&&(a.desc=n.desc),typeof n.iconUrl=="string"&&(a.iconUrl=n.iconUrl),typeof n.targetUrl=="string"&&(a.targetUrl=n.targetUrl),o.linkData=a}if(e&&Array.isArray(e.disabledChannels)){let n=e.disabledChannels.filter(a=>typeof a=="string"&&a.length>0);n.length&&(o.disabledChannels=n)}return{payload:o,err:null}}function He(e){if(!e||typeof e.page!="string"||Ke.indexOf(e.page)<0)return{payload:{page:"detail"},err:l("E_URL_INVALID_PARAM","page must be 'detail' or 'game'",!1)};let t={page:e.page};if(e.params!==void 0&&e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)){let r=e.params,o={},n=Object.keys(r);for(let a=0;a<n.length;a++){let s=r[n[a]];s!=null&&(o[n[a]]=String(s))}n.length&&(t.params=o)}return{payload:t,err:null}}function Ie(e){return e&&typeof e=="object"&&"reason"in e?e.reason:e}function L(e,t){if(!e||typeof e.rawData!="string"||!e.rawData)return t;try{return JSON.parse(e.rawData)}catch(r){return t}}function A(e,t){return u==="bridge"?k(e,t):Pe(e,t)}typeof window!="undefined"&&(window.qqAiGameSdk?console.log("[qqAiGameSdk] \u68C0\u6D4B\u5230\u5DF2\u6CE8\u5165\u7684\u5B9E\u4F8B\uFF0C\u8DF3\u8FC7\u8986\u76D6"):(window.qqAiGameSdk=Ee,console.log("[qqAiGameSdk] v".concat(x," injected (transport=").concat(u,")"))));var je=Ee;return ve($e);})();
|