@craft_eco/craft-mcp 0.1.28 → 0.1.30
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 +21 -60
- package/bin/craft-mcp.mjs +7 -1
- package/dist-server/game-workflow/asset-import.mjs +5 -1
- package/dist-server/game-workflow/assets.mjs +6 -2
- package/dist-server/game-workflow/bundle-files.mjs +9 -6
- package/dist-server/game-workflow/check.mjs +8 -2
- package/dist-server/game-workflow/context-state.mjs +67 -0
- package/dist-server/game-workflow/draft-archive.mjs +147 -2
- package/dist-server/game-workflow/draft-upload-identity.mjs +11 -0
- package/dist-server/game-workflow/draft-uploads.mjs +108 -60
- package/dist-server/game-workflow/engines.mjs +3 -3
- package/dist-server/game-workflow/library-assets.mjs +2 -1
- package/dist-server/game-workflow/local-context.mjs +62 -0
- package/dist-server/game-workflow/native-context.mjs +289 -0
- package/dist-server/game-workflow/project-bundles.mjs +121 -4
- package/dist-server/game-workflow/project-context.mjs +183 -45
- package/dist-server/game-workflow/project-leases.mjs +101 -30
- package/dist-server/game-workflow/projects.mjs +92 -14
- package/dist-server/game-workflow/tasks.mjs +7 -2
- package/dist-server/game-workflow/work-scope.mjs +7 -0
- package/dist-server/integrations/config.mjs +90 -16
- package/dist-server/integrations/connect.mjs +36 -0
- package/dist-server/integrations/connection-handoff.mjs +36 -0
- package/dist-server/integrations/dsh-config.mjs +182 -0
- package/dist-server/integrations/fixed-launcher.mjs +31 -0
- package/dist-server/integrations/host-reload.mjs +19 -0
- package/dist-server/integrations/hosts.mjs +27 -7
- package/dist-server/integrations/install.mjs +168 -31
- package/dist-server/integrations/installation-state.mjs +84 -0
- package/dist-server/integrations/launcher-start.mjs +52 -0
- package/dist-server/integrations/npm-diagnostics.mjs +32 -0
- package/dist-server/integrations/runtime-gc.mjs +191 -0
- package/dist-server/integrations/runtime-identity.mjs +22 -0
- package/dist-server/integrations/runtime.mjs +64 -25
- package/dist-server/integrations/updates.mjs +258 -0
- package/dist-server/integrations/version-policy.mjs +32 -0
- package/dist-server/launcher.mjs +1845 -0
- package/dist-server/mcp/control-panel.mjs +12 -24
- package/dist-server/mcp/server.mjs +150 -91
- package/dist-server/mcp/start.mjs +8 -2
- package/dist-server/mcp/update-session.mjs +107 -0
- package/dist-server/upstream/craft-aigc.mjs +43 -16
- package/dist-server/upstream/draft-source.mjs +29 -0
- package/package.json +4 -3
- package/resources/context-filter-report.json +177 -0
- package/resources/craft-create/SKILL.md +10 -2
- package/resources/craft-update/SKILL.md +23 -0
- package/resources/targets/claude/js/bootstrap/SKILL.md +20 -0
- package/resources/targets/claude/js/context-filter-report.json +27 -0
- package/resources/targets/claude/js/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/claude/js/craft-game-maker/js.md +10 -0
- package/resources/targets/claude/js/js/bundle.json +97 -0
- package/resources/targets/claude/js/js/context/AGENTS.md +29 -0
- package/resources/targets/claude/js/js/context/hooks/hooks.json +14 -0
- package/resources/targets/claude/js/js/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/claude/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/claude/js/js/context/knowledge/Layout.md +7 -0
- package/resources/targets/claude/js/js/context/knowledge/Lifecycle.md +11 -0
- package/resources/targets/claude/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/claude/js/js/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/claude/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/claude/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/claude/js/js/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/claude/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/claude/js/js/context/skills/index.json +19 -0
- package/resources/targets/claude/js/js/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/claude/js/js/project/README.md +7 -0
- package/resources/targets/claude/js/js/project/configs/assets.json +1 -0
- package/resources/targets/claude/js/js/project/configs/game.controls.json +3 -0
- package/resources/targets/claude/js/js/project/configs/game.json +3 -0
- package/resources/targets/claude/js/js/project/game-runtime.json +7 -0
- package/resources/targets/claude/js/js/project/game.config.json +7 -0
- package/resources/targets/claude/js/js/project/index.html +20 -0
- package/resources/targets/claude/js/js/project/package.json +22 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/claude/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/claude/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
- package/resources/targets/claude/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/claude/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
- package/resources/targets/claude/js/js/project/scripts/config-export.mjs +13 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/claude/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/claude/js/js/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/claude/js/js/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/claude/js/js/project/src/display/viewport.ts +249 -0
- package/resources/targets/claude/js/js/project/src/main.ts +87 -0
- package/resources/targets/claude/js/js/project/src/platform.ts +2 -0
- package/resources/targets/claude/js/js/project/src/scenes/LoadScene.ts +89 -0
- package/resources/targets/claude/js/js/project/src/scenes/PlayScene.ts +17 -0
- package/resources/targets/claude/js/js/project/src/screenUi.ts +185 -0
- package/resources/targets/claude/js/js/project/src/style.css +294 -0
- package/resources/targets/claude/js/js/project/tsconfig.json +20 -0
- package/resources/targets/claude/js/js/project/unified_data_control_config.json +20 -0
- package/resources/targets/claude/js/js/project/vite.config.ts +5 -0
- package/resources/targets/claude/js/recovery.md +17 -0
- package/resources/targets/claude/js/target.json +61 -0
- package/resources/targets/claude/js3d/bootstrap/SKILL.md +20 -0
- package/resources/targets/claude/js3d/context-filter-report.json +27 -0
- package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/claude/js3d/craft-game-maker/js3d.md +12 -0
- package/resources/targets/claude/js3d/js3d/bundle.json +108 -0
- package/resources/targets/claude/js3d/js3d/context/AGENTS.md +30 -0
- package/resources/targets/claude/js3d/js3d/context/hooks/hooks.json +14 -0
- package/resources/targets/claude/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/claude/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/claude/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
- package/resources/targets/claude/js3d/js3d/context/knowledge/Layout.md +7 -0
- package/resources/targets/{workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → claude/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
- package/resources/targets/claude/js3d/js3d/context/knowledge/Runtime.md +9 -0
- package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
- package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
- package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
- package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
- package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
- package/resources/targets/claude/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/claude/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/claude/js3d/js3d/context/skills/index.json +31 -0
- package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
- package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
- package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
- package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
- package/resources/targets/claude/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
- package/resources/targets/claude/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/claude/js3d/js3d/project/README.md +7 -0
- package/resources/targets/claude/js3d/js3d/project/configs/game.controls.json +3 -0
- package/resources/targets/claude/js3d/js3d/project/configs/game.json +3 -0
- package/resources/targets/claude/js3d/js3d/project/game-runtime.json +7 -0
- package/resources/targets/claude/js3d/js3d/project/game.config.json +7 -0
- package/resources/targets/claude/js3d/js3d/project/index.html +12 -0
- package/resources/targets/claude/js3d/js3d/project/package.json +23 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
- package/resources/targets/claude/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/config-export.mjs +15 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/claude/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/claude/js3d/js3d/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/claude/js3d/js3d/project/src/display/viewport.ts +239 -0
- package/resources/targets/claude/js3d/js3d/project/src/main.ts +85 -0
- package/resources/targets/claude/js3d/js3d/project/src/platform.ts +2 -0
- package/resources/targets/claude/js3d/js3d/project/src/style.css +83 -0
- package/resources/targets/claude/js3d/js3d/project/tsconfig.json +20 -0
- package/resources/targets/claude/js3d/js3d/project/unified_data_control_config.json +20 -0
- package/resources/targets/claude/js3d/js3d/project/vite.config.ts +5 -0
- package/resources/targets/claude/js3d/recovery.md +17 -0
- package/resources/targets/claude/js3d/target.json +60 -0
- package/resources/targets/codebuddy/js/bootstrap/SKILL.md +7 -1
- package/resources/targets/codebuddy/js/context-filter-report.json +27 -0
- package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +24 -29
- package/resources/targets/codebuddy/js/craft-game-maker/js.md +2 -2
- package/resources/targets/codebuddy/js/js/bundle.json +16 -18
- package/resources/targets/codebuddy/js/js/context/AGENTS.md +10 -6
- package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +4 -4
- package/resources/targets/codebuddy/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/codebuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +2 -2
- package/resources/targets/codebuddy/js/js/context/skills/index.json +2 -14
- package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
- package/resources/targets/codebuddy/js/recovery.md +14 -4
- package/resources/targets/codebuddy/js/target.json +1 -1
- package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +7 -1
- package/resources/targets/codebuddy/js3d/context-filter-report.json +27 -0
- package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +24 -29
- package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +3 -4
- package/resources/targets/codebuddy/js3d/js3d/bundle.json +19 -21
- package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +10 -6
- package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
- package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/{codex/js3d/js3d/context/skills/asset-search/references/resource-config.md → codebuddy/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
- package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
- package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
- package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
- package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +4 -16
- package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
- package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
- package/resources/targets/codebuddy/js3d/recovery.md +14 -4
- package/resources/targets/codebuddy/js3d/target.json +1 -1
- package/resources/targets/codex/js/bootstrap/SKILL.md +7 -1
- package/resources/targets/codex/js/context-filter-report.json +27 -0
- package/resources/targets/codex/js/craft-game-maker/SKILL.md +24 -29
- package/resources/targets/codex/js/craft-game-maker/js.md +2 -2
- package/resources/targets/codex/js/js/bundle.json +16 -18
- package/resources/targets/codex/js/js/context/AGENTS.md +10 -6
- package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +4 -4
- package/resources/targets/codex/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/codex/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +2 -2
- package/resources/targets/codex/js/js/context/skills/index.json +2 -14
- package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +1 -1
- package/resources/targets/codex/js/recovery.md +14 -4
- package/resources/targets/codex/js/target.json +1 -1
- package/resources/targets/codex/js3d/bootstrap/SKILL.md +7 -1
- package/resources/targets/codex/js3d/context-filter-report.json +27 -0
- package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +24 -29
- package/resources/targets/codex/js3d/craft-game-maker/js3d.md +3 -4
- package/resources/targets/codex/js3d/js3d/bundle.json +19 -21
- package/resources/targets/codex/js3d/js3d/context/AGENTS.md +10 -6
- package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
- package/resources/targets/codex/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/{codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md → codex/js3d/js3d/context/knowledge/ResourceLoading.md} +2 -2
- package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
- package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
- package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
- package/resources/targets/codex/js3d/js3d/context/skills/index.json +4 -16
- package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
- package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
- package/resources/targets/codex/js3d/recovery.md +14 -4
- package/resources/targets/codex/js3d/target.json +1 -1
- package/resources/targets/cursor/js/bootstrap/SKILL.md +20 -0
- package/resources/targets/cursor/js/context-filter-report.json +27 -0
- package/resources/targets/cursor/js/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/cursor/js/craft-game-maker/js.md +10 -0
- package/resources/targets/cursor/js/js/bundle.json +97 -0
- package/resources/targets/cursor/js/js/context/AGENTS.md +29 -0
- package/resources/targets/cursor/js/js/context/hooks/hooks.json +14 -0
- package/resources/targets/cursor/js/js/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/cursor/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/cursor/js/js/context/knowledge/Layout.md +7 -0
- package/resources/targets/cursor/js/js/context/knowledge/Lifecycle.md +11 -0
- package/resources/targets/cursor/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/cursor/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/cursor/js/js/context/skills/index.json +19 -0
- package/resources/targets/cursor/js/js/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/cursor/js/js/project/README.md +7 -0
- package/resources/targets/cursor/js/js/project/configs/assets.json +1 -0
- package/resources/targets/cursor/js/js/project/configs/game.controls.json +3 -0
- package/resources/targets/cursor/js/js/project/configs/game.json +3 -0
- package/resources/targets/cursor/js/js/project/game-runtime.json +7 -0
- package/resources/targets/cursor/js/js/project/game.config.json +7 -0
- package/resources/targets/cursor/js/js/project/index.html +20 -0
- package/resources/targets/cursor/js/js/project/package.json +22 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/cursor/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/cursor/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
- package/resources/targets/cursor/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/cursor/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
- package/resources/targets/cursor/js/js/project/scripts/config-export.mjs +13 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/cursor/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/cursor/js/js/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/cursor/js/js/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/cursor/js/js/project/src/display/viewport.ts +249 -0
- package/resources/targets/cursor/js/js/project/src/main.ts +87 -0
- package/resources/targets/cursor/js/js/project/src/platform.ts +2 -0
- package/resources/targets/cursor/js/js/project/src/scenes/LoadScene.ts +89 -0
- package/resources/targets/cursor/js/js/project/src/scenes/PlayScene.ts +17 -0
- package/resources/targets/cursor/js/js/project/src/screenUi.ts +185 -0
- package/resources/targets/cursor/js/js/project/src/style.css +294 -0
- package/resources/targets/cursor/js/js/project/tsconfig.json +20 -0
- package/resources/targets/cursor/js/js/project/unified_data_control_config.json +20 -0
- package/resources/targets/cursor/js/js/project/vite.config.ts +5 -0
- package/resources/targets/cursor/js/recovery.md +17 -0
- package/resources/targets/cursor/js/target.json +61 -0
- package/resources/targets/cursor/js3d/bootstrap/SKILL.md +20 -0
- package/resources/targets/cursor/js3d/context-filter-report.json +27 -0
- package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/cursor/js3d/craft-game-maker/js3d.md +12 -0
- package/resources/targets/cursor/js3d/js3d/bundle.json +108 -0
- package/resources/targets/cursor/js3d/js3d/context/AGENTS.md +30 -0
- package/resources/targets/cursor/js3d/js3d/context/hooks/hooks.json +14 -0
- package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/cursor/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/cursor/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
- package/resources/targets/cursor/js3d/js3d/context/knowledge/Layout.md +7 -0
- package/resources/targets/cursor/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
- package/resources/targets/cursor/js3d/js3d/context/knowledge/Runtime.md +9 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/index.json +31 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
- package/resources/targets/cursor/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/cursor/js3d/js3d/project/README.md +7 -0
- package/resources/targets/cursor/js3d/js3d/project/configs/game.controls.json +3 -0
- package/resources/targets/cursor/js3d/js3d/project/configs/game.json +3 -0
- package/resources/targets/cursor/js3d/js3d/project/game-runtime.json +7 -0
- package/resources/targets/cursor/js3d/js3d/project/game.config.json +7 -0
- package/resources/targets/cursor/js3d/js3d/project/index.html +12 -0
- package/resources/targets/cursor/js3d/js3d/project/package.json +23 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
- package/resources/targets/cursor/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/config-export.mjs +15 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/cursor/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/cursor/js3d/js3d/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/cursor/js3d/js3d/project/src/display/viewport.ts +239 -0
- package/resources/targets/cursor/js3d/js3d/project/src/main.ts +85 -0
- package/resources/targets/cursor/js3d/js3d/project/src/platform.ts +2 -0
- package/resources/targets/cursor/js3d/js3d/project/src/style.css +83 -0
- package/resources/targets/cursor/js3d/js3d/project/tsconfig.json +20 -0
- package/resources/targets/cursor/js3d/js3d/project/unified_data_control_config.json +20 -0
- package/resources/targets/cursor/js3d/js3d/project/vite.config.ts +5 -0
- package/resources/targets/cursor/js3d/recovery.md +17 -0
- package/resources/targets/cursor/js3d/target.json +60 -0
- package/resources/targets/dsh/js/bootstrap/SKILL.md +20 -0
- package/resources/targets/dsh/js/context-filter-report.json +27 -0
- package/resources/targets/dsh/js/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/dsh/js/craft-game-maker/js.md +10 -0
- package/resources/targets/dsh/js/js/bundle.json +97 -0
- package/resources/targets/dsh/js/js/context/AGENTS.md +29 -0
- package/resources/targets/dsh/js/js/context/hooks/hooks.json +14 -0
- package/resources/targets/dsh/js/js/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/dsh/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/dsh/js/js/context/knowledge/Layout.md +7 -0
- package/resources/targets/dsh/js/js/context/knowledge/Lifecycle.md +11 -0
- package/resources/targets/dsh/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/dsh/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/dsh/js/js/context/skills/index.json +19 -0
- package/resources/targets/dsh/js/js/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/dsh/js/js/project/README.md +7 -0
- package/resources/targets/dsh/js/js/project/configs/assets.json +1 -0
- package/resources/targets/dsh/js/js/project/configs/game.controls.json +3 -0
- package/resources/targets/dsh/js/js/project/configs/game.json +3 -0
- package/resources/targets/dsh/js/js/project/game-runtime.json +7 -0
- package/resources/targets/dsh/js/js/project/game.config.json +7 -0
- package/resources/targets/dsh/js/js/project/index.html +20 -0
- package/resources/targets/dsh/js/js/project/package.json +22 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/dsh/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/dsh/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
- package/resources/targets/dsh/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/dsh/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
- package/resources/targets/dsh/js/js/project/scripts/config-export.mjs +13 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/dsh/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/dsh/js/js/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/dsh/js/js/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/dsh/js/js/project/src/display/viewport.ts +249 -0
- package/resources/targets/dsh/js/js/project/src/main.ts +87 -0
- package/resources/targets/dsh/js/js/project/src/platform.ts +2 -0
- package/resources/targets/dsh/js/js/project/src/scenes/LoadScene.ts +89 -0
- package/resources/targets/dsh/js/js/project/src/scenes/PlayScene.ts +17 -0
- package/resources/targets/dsh/js/js/project/src/screenUi.ts +185 -0
- package/resources/targets/dsh/js/js/project/src/style.css +294 -0
- package/resources/targets/dsh/js/js/project/tsconfig.json +20 -0
- package/resources/targets/dsh/js/js/project/unified_data_control_config.json +20 -0
- package/resources/targets/dsh/js/js/project/vite.config.ts +5 -0
- package/resources/targets/dsh/js/recovery.md +17 -0
- package/resources/targets/dsh/js/target.json +61 -0
- package/resources/targets/dsh/js3d/bootstrap/SKILL.md +20 -0
- package/resources/targets/dsh/js3d/context-filter-report.json +27 -0
- package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/dsh/js3d/craft-game-maker/js3d.md +12 -0
- package/resources/targets/dsh/js3d/js3d/bundle.json +108 -0
- package/resources/targets/dsh/js3d/js3d/context/AGENTS.md +30 -0
- package/resources/targets/dsh/js3d/js3d/context/hooks/hooks.json +14 -0
- package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/dsh/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/dsh/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
- package/resources/targets/dsh/js3d/js3d/context/knowledge/Layout.md +7 -0
- package/resources/targets/dsh/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
- package/resources/targets/dsh/js3d/js3d/context/knowledge/Runtime.md +9 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/index.json +31 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
- package/resources/targets/dsh/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/dsh/js3d/js3d/project/README.md +7 -0
- package/resources/targets/dsh/js3d/js3d/project/configs/game.controls.json +3 -0
- package/resources/targets/dsh/js3d/js3d/project/configs/game.json +3 -0
- package/resources/targets/dsh/js3d/js3d/project/game-runtime.json +7 -0
- package/resources/targets/dsh/js3d/js3d/project/game.config.json +7 -0
- package/resources/targets/dsh/js3d/js3d/project/index.html +12 -0
- package/resources/targets/dsh/js3d/js3d/project/package.json +23 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
- package/resources/targets/dsh/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/config-export.mjs +15 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/dsh/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/dsh/js3d/js3d/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/dsh/js3d/js3d/project/src/display/viewport.ts +239 -0
- package/resources/targets/dsh/js3d/js3d/project/src/main.ts +85 -0
- package/resources/targets/dsh/js3d/js3d/project/src/platform.ts +2 -0
- package/resources/targets/dsh/js3d/js3d/project/src/style.css +83 -0
- package/resources/targets/dsh/js3d/js3d/project/tsconfig.json +20 -0
- package/resources/targets/dsh/js3d/js3d/project/unified_data_control_config.json +20 -0
- package/resources/targets/dsh/js3d/js3d/project/vite.config.ts +5 -0
- package/resources/targets/dsh/js3d/recovery.md +17 -0
- package/resources/targets/dsh/js3d/target.json +60 -0
- package/resources/targets/index.json +72 -12
- package/resources/targets/kimi/js/bootstrap/SKILL.md +20 -0
- package/resources/targets/kimi/js/context-filter-report.json +27 -0
- package/resources/targets/kimi/js/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/kimi/js/craft-game-maker/js.md +10 -0
- package/resources/targets/kimi/js/js/bundle.json +97 -0
- package/resources/targets/kimi/js/js/context/AGENTS.md +29 -0
- package/resources/targets/kimi/js/js/context/hooks/hooks.json +14 -0
- package/resources/targets/kimi/js/js/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/kimi/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/kimi/js/js/context/knowledge/Layout.md +7 -0
- package/resources/targets/kimi/js/js/context/knowledge/Lifecycle.md +11 -0
- package/resources/targets/kimi/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/kimi/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/kimi/js/js/context/skills/index.json +19 -0
- package/resources/targets/kimi/js/js/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/kimi/js/js/project/README.md +7 -0
- package/resources/targets/kimi/js/js/project/configs/assets.json +1 -0
- package/resources/targets/kimi/js/js/project/configs/game.controls.json +3 -0
- package/resources/targets/kimi/js/js/project/configs/game.json +3 -0
- package/resources/targets/kimi/js/js/project/game-runtime.json +7 -0
- package/resources/targets/kimi/js/js/project/game.config.json +7 -0
- package/resources/targets/kimi/js/js/project/index.html +20 -0
- package/resources/targets/kimi/js/js/project/package.json +22 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/kimi/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/kimi/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
- package/resources/targets/kimi/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/kimi/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
- package/resources/targets/kimi/js/js/project/scripts/config-export.mjs +13 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/kimi/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/kimi/js/js/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/kimi/js/js/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/kimi/js/js/project/src/display/viewport.ts +249 -0
- package/resources/targets/kimi/js/js/project/src/main.ts +87 -0
- package/resources/targets/kimi/js/js/project/src/platform.ts +2 -0
- package/resources/targets/kimi/js/js/project/src/scenes/LoadScene.ts +89 -0
- package/resources/targets/kimi/js/js/project/src/scenes/PlayScene.ts +17 -0
- package/resources/targets/kimi/js/js/project/src/screenUi.ts +185 -0
- package/resources/targets/kimi/js/js/project/src/style.css +294 -0
- package/resources/targets/kimi/js/js/project/tsconfig.json +20 -0
- package/resources/targets/kimi/js/js/project/unified_data_control_config.json +20 -0
- package/resources/targets/kimi/js/js/project/vite.config.ts +5 -0
- package/resources/targets/kimi/js/recovery.md +17 -0
- package/resources/targets/kimi/js/target.json +61 -0
- package/resources/targets/kimi/js3d/bootstrap/SKILL.md +20 -0
- package/resources/targets/kimi/js3d/context-filter-report.json +27 -0
- package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/kimi/js3d/craft-game-maker/js3d.md +12 -0
- package/resources/targets/kimi/js3d/js3d/bundle.json +108 -0
- package/resources/targets/kimi/js3d/js3d/context/AGENTS.md +30 -0
- package/resources/targets/kimi/js3d/js3d/context/hooks/hooks.json +14 -0
- package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/kimi/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/kimi/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
- package/resources/targets/kimi/js3d/js3d/context/knowledge/Layout.md +7 -0
- package/resources/targets/kimi/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
- package/resources/targets/kimi/js3d/js3d/context/knowledge/Runtime.md +9 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/index.json +31 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
- package/resources/targets/kimi/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/kimi/js3d/js3d/project/README.md +7 -0
- package/resources/targets/kimi/js3d/js3d/project/configs/game.controls.json +3 -0
- package/resources/targets/kimi/js3d/js3d/project/configs/game.json +3 -0
- package/resources/targets/kimi/js3d/js3d/project/game-runtime.json +7 -0
- package/resources/targets/kimi/js3d/js3d/project/game.config.json +7 -0
- package/resources/targets/kimi/js3d/js3d/project/index.html +12 -0
- package/resources/targets/kimi/js3d/js3d/project/package.json +23 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
- package/resources/targets/kimi/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/config-export.mjs +15 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/kimi/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/kimi/js3d/js3d/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/kimi/js3d/js3d/project/src/display/viewport.ts +239 -0
- package/resources/targets/kimi/js3d/js3d/project/src/main.ts +85 -0
- package/resources/targets/kimi/js3d/js3d/project/src/platform.ts +2 -0
- package/resources/targets/kimi/js3d/js3d/project/src/style.css +83 -0
- package/resources/targets/kimi/js3d/js3d/project/tsconfig.json +20 -0
- package/resources/targets/kimi/js3d/js3d/project/unified_data_control_config.json +20 -0
- package/resources/targets/kimi/js3d/js3d/project/vite.config.ts +5 -0
- package/resources/targets/kimi/js3d/recovery.md +17 -0
- package/resources/targets/kimi/js3d/target.json +60 -0
- package/resources/targets/workbuddy/js/bootstrap/SKILL.md +9 -1
- package/resources/targets/workbuddy/js/context-filter-report.json +27 -0
- package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +24 -29
- package/resources/targets/workbuddy/js/craft-game-maker/js.md +2 -2
- package/resources/targets/workbuddy/js/js/bundle.json +16 -18
- package/resources/targets/workbuddy/js/js/context/AGENTS.md +10 -6
- package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +4 -4
- package/resources/targets/workbuddy/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/workbuddy/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +2 -2
- package/resources/targets/workbuddy/js/js/context/skills/index.json +2 -14
- package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +1 -1
- package/resources/targets/workbuddy/js/recovery.md +16 -4
- package/resources/targets/workbuddy/js/target.json +1 -1
- package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +9 -1
- package/resources/targets/workbuddy/js3d/context-filter-report.json +27 -0
- package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +24 -29
- package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +3 -4
- package/resources/targets/workbuddy/js3d/js3d/bundle.json +19 -21
- package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +10 -6
- package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +4 -4
- package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/workbuddy/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
- package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +1 -1
- package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +2 -2
- package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +2 -2
- package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +4 -16
- package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +1 -1
- package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +1 -1
- package/resources/targets/workbuddy/js3d/recovery.md +16 -4
- package/resources/targets/workbuddy/js3d/target.json +1 -1
- package/resources/targets/zcode/js/bootstrap/SKILL.md +20 -0
- package/resources/targets/zcode/js/context-filter-report.json +27 -0
- package/resources/targets/zcode/js/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/zcode/js/craft-game-maker/js.md +10 -0
- package/resources/targets/zcode/js/js/bundle.json +97 -0
- package/resources/targets/zcode/js/js/context/AGENTS.md +29 -0
- package/resources/targets/zcode/js/js/context/hooks/hooks.json +14 -0
- package/resources/targets/zcode/js/js/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/zcode/js/js/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/zcode/js/js/context/knowledge/Layout.md +7 -0
- package/resources/targets/zcode/js/js/context/knowledge/Lifecycle.md +11 -0
- package/resources/targets/zcode/js/js/context/knowledge/ResourceLoading.md +9 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/zcode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/zcode/js/js/context/skills/index.json +19 -0
- package/resources/targets/zcode/js/js/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/zcode/js/js/project/README.md +7 -0
- package/resources/targets/zcode/js/js/project/configs/assets.json +1 -0
- package/resources/targets/zcode/js/js/project/configs/game.controls.json +3 -0
- package/resources/targets/zcode/js/js/project/configs/game.json +3 -0
- package/resources/targets/zcode/js/js/project/game-runtime.json +7 -0
- package/resources/targets/zcode/js/js/project/game.config.json +7 -0
- package/resources/targets/zcode/js/js/project/index.html +20 -0
- package/resources/targets/zcode/js/js/project/package.json +22 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/zcode/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
- package/resources/targets/zcode/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/zcode/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
- package/resources/targets/zcode/js/js/project/scripts/config-export.mjs +13 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/zcode/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/zcode/js/js/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/zcode/js/js/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/zcode/js/js/project/src/display/viewport.ts +249 -0
- package/resources/targets/zcode/js/js/project/src/main.ts +87 -0
- package/resources/targets/zcode/js/js/project/src/platform.ts +2 -0
- package/resources/targets/zcode/js/js/project/src/scenes/LoadScene.ts +89 -0
- package/resources/targets/zcode/js/js/project/src/scenes/PlayScene.ts +17 -0
- package/resources/targets/zcode/js/js/project/src/screenUi.ts +185 -0
- package/resources/targets/zcode/js/js/project/src/style.css +294 -0
- package/resources/targets/zcode/js/js/project/tsconfig.json +20 -0
- package/resources/targets/zcode/js/js/project/unified_data_control_config.json +20 -0
- package/resources/targets/zcode/js/js/project/vite.config.ts +5 -0
- package/resources/targets/zcode/js/recovery.md +17 -0
- package/resources/targets/zcode/js/target.json +61 -0
- package/resources/targets/zcode/js3d/bootstrap/SKILL.md +20 -0
- package/resources/targets/zcode/js3d/context-filter-report.json +27 -0
- package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +72 -0
- package/resources/targets/zcode/js3d/craft-game-maker/js3d.md +12 -0
- package/resources/targets/zcode/js3d/js3d/bundle.json +108 -0
- package/resources/targets/zcode/js3d/js3d/context/AGENTS.md +30 -0
- package/resources/targets/zcode/js3d/js3d/context/hooks/hooks.json +14 -0
- package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/targets/zcode/js3d/js3d/context/knowledge/AssetWiring.md +7 -0
- package/resources/targets/zcode/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
- package/resources/targets/zcode/js3d/js3d/context/knowledge/Layout.md +7 -0
- package/resources/targets/zcode/js3d/js3d/context/knowledge/ResourceLoading.md +11 -0
- package/resources/targets/zcode/js3d/js3d/context/knowledge/Runtime.md +9 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/index.json +31 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
- package/resources/targets/zcode/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/targets/zcode/js3d/js3d/project/README.md +7 -0
- package/resources/targets/zcode/js3d/js3d/project/configs/game.controls.json +3 -0
- package/resources/targets/zcode/js3d/js3d/project/configs/game.json +3 -0
- package/resources/targets/zcode/js3d/js3d/project/game-runtime.json +7 -0
- package/resources/targets/zcode/js3d/js3d/project/game.config.json +7 -0
- package/resources/targets/zcode/js3d/js3d/project/index.html +12 -0
- package/resources/targets/zcode/js3d/js3d/project/package.json +23 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
- package/resources/targets/zcode/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/config-export.mjs +15 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
- package/resources/targets/zcode/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
- package/resources/targets/zcode/js3d/js3d/project/src/display/ui-stage.ts +156 -0
- package/resources/targets/zcode/js3d/js3d/project/src/display/viewport.ts +239 -0
- package/resources/targets/zcode/js3d/js3d/project/src/main.ts +85 -0
- package/resources/targets/zcode/js3d/js3d/project/src/platform.ts +2 -0
- package/resources/targets/zcode/js3d/js3d/project/src/style.css +83 -0
- package/resources/targets/zcode/js3d/js3d/project/tsconfig.json +20 -0
- package/resources/targets/zcode/js3d/js3d/project/unified_data_control_config.json +20 -0
- package/resources/targets/zcode/js3d/js3d/project/vite.config.ts +5 -0
- package/resources/targets/zcode/js3d/recovery.md +17 -0
- package/resources/targets/zcode/js3d/target.json +60 -0
- package/vendor/craft-runtime/SOURCE.json +3 -3
- package/vendor/craft-runtime/package.json +1 -1
- package/dist-server/game-workflow/publication-materials.mjs +0 -92
- package/dist-server/game-workflow/publications.mjs +0 -164
- package/dist-server/game-workflow/publish-capture-worker.mjs +0 -57
- package/dist-server/game-workflow/publish-capture.mjs +0 -75
- package/dist-server/mcp/publication-page.html +0 -86
- package/dist-server/mcp/publication-page.mjs +0 -375
- package/dist-server/mcp/publication-preview.mjs +0 -63
- package/dist-server/mcp/publication-tools.mjs +0 -22
- package/dist-server/mcp/publish-panel.mjs +0 -205
- package/dist-server/upstream/publication-transport.mjs +0 -101
- package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
- package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
- package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
- package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +0 -14
- package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +0 -9
- package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
- package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
- package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
- package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
- package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { readFile, lstat, mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { resolve, join, relative, isAbsolute, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const pair = name => [`${name}.mjs`, `${name}.d.mts`];
|
|
6
|
+
const release = {
|
|
7
|
+
version: '1.1.0',
|
|
8
|
+
target: 'scripts/skill-modules/export-config',
|
|
9
|
+
defaults: ['config'],
|
|
10
|
+
groups: {
|
|
11
|
+
config: [...pair('config'), ...pair('project'), ...pair('vite'), 'cli.mjs'],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const assets = resolve(dirname(fileURLToPath(import.meta.url)), '../assets/tooling');
|
|
15
|
+
const safeParts = value => typeof value === 'string' && value.split('/').every(part => /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(part));
|
|
16
|
+
|
|
17
|
+
async function checkedPath(root, name) {
|
|
18
|
+
if (!safeParts(name)) throw new Error(`Invalid package path: ${name}`);
|
|
19
|
+
const target = resolve(root, name);
|
|
20
|
+
const rel = relative(root, target);
|
|
21
|
+
if (isAbsolute(rel) || rel === '..' || rel.startsWith('../')) throw new Error(`Path escapes project: ${name}`);
|
|
22
|
+
let current = root;
|
|
23
|
+
for (const part of name.split('/')) {
|
|
24
|
+
current = join(current, part);
|
|
25
|
+
try {
|
|
26
|
+
const info = await lstat(current);
|
|
27
|
+
if (info.isSymbolicLink()) throw new Error(`Symbolic links are not allowed: ${current}`);
|
|
28
|
+
} catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function readRecord(path) {
|
|
34
|
+
try {
|
|
35
|
+
const record = JSON.parse(await readFile(path, 'utf8'));
|
|
36
|
+
return record && typeof record === 'object' ? record : {};
|
|
37
|
+
} catch (error) {
|
|
38
|
+
if (error.code === 'ENOENT') return {};
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function installPackage(project, modules, source = assets) {
|
|
44
|
+
const root = resolve(project);
|
|
45
|
+
const info = await lstat(root);
|
|
46
|
+
if (!info.isDirectory() || info.isSymbolicLink()) throw new Error('Project root must be a real directory');
|
|
47
|
+
await readFile(await checkedPath(root, 'package.json'));
|
|
48
|
+
const selected = modules ?? release.defaults;
|
|
49
|
+
if (!Array.isArray(selected) || !selected.length) throw new Error('Select at least one module');
|
|
50
|
+
for (const module of selected) {
|
|
51
|
+
if (!Object.hasOwn(release.groups, module)) throw new Error(`Unknown module: ${module}`);
|
|
52
|
+
}
|
|
53
|
+
const recordPath = await checkedPath(root, `${release.target}/installed.json`);
|
|
54
|
+
const previous = await readRecord(recordPath);
|
|
55
|
+
const kept = Array.isArray(previous.modules) ? previous.modules.filter(module => Object.hasOwn(release.groups, module)) : [];
|
|
56
|
+
const installed = [...new Set([...kept, ...selected])].sort();
|
|
57
|
+
const files = new Map();
|
|
58
|
+
for (const name of new Set(installed.flatMap(module => release.groups[module]))) {
|
|
59
|
+
files.set(await checkedPath(root, `${release.target}/${name}`), await readFile(await checkedPath(source, name)));
|
|
60
|
+
}
|
|
61
|
+
for (const [target, bytes] of files) {
|
|
62
|
+
await mkdir(dirname(target), { recursive: true });
|
|
63
|
+
await writeFile(target, bytes);
|
|
64
|
+
}
|
|
65
|
+
await writeFile(recordPath, `${JSON.stringify({ version: release.version, modules: installed }, null, 2)}\n`);
|
|
66
|
+
const previousVersion = typeof previous.version === 'string' ? previous.version : '';
|
|
67
|
+
return { root: release.target, version: release.version, previousVersion, modules: installed };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function runCli(args = process.argv.slice(2)) {
|
|
71
|
+
let project, modules;
|
|
72
|
+
for (let index = 0; index < args.length; index++) {
|
|
73
|
+
const flag = args[index];
|
|
74
|
+
const value = args[++index];
|
|
75
|
+
if (!value || value.startsWith('--')) throw new Error(`Missing value for ${flag}`);
|
|
76
|
+
if (flag === '--project') project = value;
|
|
77
|
+
else if (flag === '--modules') modules = value.split(',');
|
|
78
|
+
else throw new Error(`Unknown option: ${flag}`);
|
|
79
|
+
}
|
|
80
|
+
if (!project) throw new Error('Usage: install.mjs --project <directory> [--modules <comma-separated names>]');
|
|
81
|
+
const result = await installPackage(project, modules);
|
|
82
|
+
const version = result.previousVersion && result.previousVersion !== result.version ? `${result.previousVersion} -> ${result.version}` : result.version;
|
|
83
|
+
console.log(`[skill] ${result.root}: ${result.modules.join(', ')} (${version})`);
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
88
|
+
runCli().catch(error => { console.error(error.message); process.exitCode = 1; });
|
|
89
|
+
}
|
package/resources/targets/zcode/js/js/context/skills/export-config/scripts/panel-resource-path.mjs
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// 资源地址归一化的唯一实现。只改 https://file.craft.qq.com 和相对路径:
|
|
2
|
+
// 库资源收成 Game/,其它路径把百分号编码解回中文,相对路径保留原前缀。
|
|
3
|
+
// UTF-8 与 GBK 都能解时,只有 GBK 得到汉字而 UTF-8 不是汉字才用 GBK。
|
|
4
|
+
|
|
5
|
+
function percentEncodedBytes(text) {
|
|
6
|
+
const bytes = [];
|
|
7
|
+
let index = 0;
|
|
8
|
+
while (index < text.length) {
|
|
9
|
+
if (text[index] === '%' && /^[0-9A-Fa-f]{2}$/.test(text.slice(index + 1, index + 3))) {
|
|
10
|
+
bytes.push(Number.parseInt(text.slice(index + 1, index + 3), 16));
|
|
11
|
+
index += 3;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const code = text.charCodeAt(index);
|
|
15
|
+
if (code > 0x7f) return null;
|
|
16
|
+
bytes.push(code);
|
|
17
|
+
index += 1;
|
|
18
|
+
}
|
|
19
|
+
return bytes;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function hasCjk(text) {
|
|
23
|
+
return /[\u3400-\u9fff]/.test(text);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function decodeGbk(bytes) {
|
|
27
|
+
try {
|
|
28
|
+
return new TextDecoder('gbk', { fatal: true }).decode(Uint8Array.from(bytes));
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function decodeResourcePath(text) {
|
|
35
|
+
const bytes = percentEncodedBytes(text);
|
|
36
|
+
if (!bytes) return text;
|
|
37
|
+
let utf8 = null;
|
|
38
|
+
try {
|
|
39
|
+
utf8 = decodeURIComponent(text);
|
|
40
|
+
} catch {
|
|
41
|
+
utf8 = null;
|
|
42
|
+
}
|
|
43
|
+
const gbk = bytes.some((byte) => byte >= 0x80) ? decodeGbk(bytes) : null;
|
|
44
|
+
if (utf8 && gbk && utf8 !== gbk) {
|
|
45
|
+
return hasCjk(gbk) && !hasCjk(utf8) ? gbk : utf8;
|
|
46
|
+
}
|
|
47
|
+
return utf8 ?? gbk ?? text;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function hasNonAscii(text) {
|
|
51
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
52
|
+
if (text.charCodeAt(index) > 0x7f) return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function restoreGamePath(source) {
|
|
58
|
+
let path = source;
|
|
59
|
+
try {
|
|
60
|
+
const url = new URL(source);
|
|
61
|
+
if (url.protocol !== 'https:' || url.hostname !== 'file.craft.qq.com') return source;
|
|
62
|
+
path = url.pathname;
|
|
63
|
+
} catch { /* 相对路径 */ }
|
|
64
|
+
if (!/^\/?Game\//.test(path)) return source;
|
|
65
|
+
const decoded = decodeResourcePath(path.startsWith('/') ? path : `/${path}`).replace(/^\/+/, '');
|
|
66
|
+
return decoded.startsWith('Game/') ? decoded : source;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function decodeRelativePath(source) {
|
|
70
|
+
if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(source)) return source;
|
|
71
|
+
const parts = source.match(/^([^?#]*)([?#].*)?$/);
|
|
72
|
+
if (!parts || !parts[1].includes('%')) return source;
|
|
73
|
+
const decoded = decodeResourcePath(parts[1]);
|
|
74
|
+
if (decoded === parts[1] || !hasNonAscii(decoded)) return source;
|
|
75
|
+
const rest = parts[2] ?? '';
|
|
76
|
+
if (/^\/?Game\//.test(decoded)) return decoded.replace(/^\/+/, '') + rest;
|
|
77
|
+
return decoded + rest;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function decodeAbsoluteUrl(source) {
|
|
81
|
+
let url;
|
|
82
|
+
try {
|
|
83
|
+
url = new URL(source);
|
|
84
|
+
} catch {
|
|
85
|
+
return source;
|
|
86
|
+
}
|
|
87
|
+
if (url.protocol !== 'https:' || url.hostname !== 'file.craft.qq.com') return source;
|
|
88
|
+
const decodedPath = decodeResourcePath(url.pathname);
|
|
89
|
+
if (decodedPath === url.pathname || !hasNonAscii(decodedPath)) return source;
|
|
90
|
+
const href = url.href;
|
|
91
|
+
const origin = url.origin;
|
|
92
|
+
if (!href.startsWith(origin)) return source;
|
|
93
|
+
const rest = href.slice(origin.length);
|
|
94
|
+
if (!rest.startsWith(url.pathname)) return source;
|
|
95
|
+
return origin + decodedPath + rest.slice(url.pathname.length);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function toPanelResourcePath(value) {
|
|
99
|
+
const source = String(value ?? '').trim();
|
|
100
|
+
if (!source) return source;
|
|
101
|
+
const restored = restoreGamePath(source);
|
|
102
|
+
if (restored.startsWith('Game/')) return restored;
|
|
103
|
+
const absolute = decodeAbsoluteUrl(source);
|
|
104
|
+
if (absolute !== source) return absolute;
|
|
105
|
+
return decodeRelativePath(source);
|
|
106
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"engine": "js",
|
|
4
|
+
"host": "zcode",
|
|
5
|
+
"skills": [
|
|
6
|
+
{
|
|
7
|
+
"id": "zcode:js:export-config",
|
|
8
|
+
"name": "export-config",
|
|
9
|
+
"description": "Craft ZCode 项目专用;导出当前 2D / Phaser 工程的资源与可调参数配置;新增资源槽、修改配置、构建或上传前排查时使用。",
|
|
10
|
+
"entrypoint": "skills/export-config/SKILL.md"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "zcode:js:visual-qa",
|
|
14
|
+
"name": "visual-qa",
|
|
15
|
+
"description": "Craft ZCode 项目专用;验收 2D / Phaser 游戏的真实输入、玩法闭环与截图;在交付预览或验证修复时使用。",
|
|
16
|
+
"entrypoint": "skills/visual-qa/SKILL.md"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-qa
|
|
3
|
+
description: Craft ZCode 项目专用;验收 2D / Phaser 游戏的真实输入、玩法闭环与截图;在交付预览或验证修复时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 2D / Phaser 游戏验收
|
|
7
|
+
|
|
8
|
+
读取当前工作流 context.workflow 的玩法观测和检查 schema。探针从真实渲染与玩法状态提供 engine、ready、frameCount 和 game;保留 Phaser POST_RENDER 与 PlayScene 状态。
|
|
9
|
+
|
|
10
|
+
设计能由实际输入触发的检查:进入/推进核心循环、达到结算条件、重开恢复初始状态。只断言业务实际产生的值,不通过测试代码直接修改分数或结算。
|
|
11
|
+
|
|
12
|
+
调用 craft_game_check 并轮询完成,使用 craft_game_review 查看实际截图。核实主要对象、UI、尺寸、遮挡、资源透明度与当前玩法,3D 场景还检查地面接触、相机与光照。修改后重新检查受影响状态。
|
|
13
|
+
|
|
14
|
+
通过后 craft_game_deliver 返回启动命令;让宿主后台任务持续运行,查询 running 与 snapshot,打开实际链接核实后交付。记录已验证与未覆盖项,不把静态构建或扫描无错误等同于可玩。
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Craft 2D / Phaser 模板
|
|
2
|
+
|
|
3
|
+
安装依赖后可运行 `npm run dev`;`npm run build` 包含配置导出、类型检查、Runtime 校验和 Vite 构建。
|
|
4
|
+
|
|
5
|
+
通过 Craft 创建时,项目根 AGENTS.md 和项目恢复 Skill 由 prepare 生成。完整引擎上下文使用 craft_game_info 返回的绑定路径,开发进度保存在 SPEC/PROGRESS.md。
|
|
6
|
+
|
|
7
|
+
runtime/lightgame/1.1.0 是本模板的固定运行库。普通游戏开发使用现有声明与接口;修改 Runtime 时必须单独评审、测试并维护完整性清单。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
|
6
|
+
<title>Light Game</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="game"></div>
|
|
10
|
+
<div id="loading">
|
|
11
|
+
<div class="loading-panel">
|
|
12
|
+
<div class="loading-label">加载中</div>
|
|
13
|
+
<div id="loading-percent" class="loading-percent">0%</div>
|
|
14
|
+
<div class="loading-bar"><div id="loading-bar-fill" class="loading-bar-fill"></div></div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<script>globalThis.__loadState = { state: "loading", progress: 0 };</script>
|
|
18
|
+
<script type="module" src="./src/main.ts"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "craft-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
|
+
"postbuild": "node scripts/write-preview-ready.mjs",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"runtime:verify": "node runtime/lightgame/1.1.0/tooling/cli.mjs verify",
|
|
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
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
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);})();
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { apiBase } from './shared.mjs';
|
|
2
|
+
|
|
3
|
+
const EXCHANGE_PATH = '/api/auth/qq-game-session';
|
|
4
|
+
const EXCHANGE_TIMEOUT_MS = 10_000;
|
|
5
|
+
const BRIDGE_WAIT_MS = 10_000;
|
|
6
|
+
const BRIDGE_POLL_MS = 50;
|
|
7
|
+
const DEFAULT_EXPIRES_IN_S = 1800;
|
|
8
|
+
/** session_token cannot be renewed; a fresh login() + exchange runs this long before expiry. */
|
|
9
|
+
const REFRESH_LEAD_MS = 120_000;
|
|
10
|
+
const MIN_REFRESH_DELAY_MS = 30_000;
|
|
11
|
+
/** Stops a burst of 401s from turning into a burst of login() + exchange round trips. */
|
|
12
|
+
const RETRY_COOLDOWN_MS = 5_000;
|
|
13
|
+
|
|
14
|
+
/** `api` comes from the URL, so it is the only thing deciding where game_token is sent. */
|
|
15
|
+
const QQ_API_HOST = /(^|\.)craft\.qq\.com$/;
|
|
16
|
+
const LOOPBACK = new Set(['localhost', '127.0.0.1', '[::1]']);
|
|
17
|
+
|
|
18
|
+
const text = value => (typeof value === 'string' ? value.trim() : '');
|
|
19
|
+
|
|
20
|
+
/** Hosts disagree on naming (`game_token` vs `gameToken`); snake_case wins when both are present. */
|
|
21
|
+
const pick = (source, snake, camel) => {
|
|
22
|
+
const value = source?.[snake];
|
|
23
|
+
return value == null || value === '' ? source?.[camel] : value;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const trustedApi = value => {
|
|
27
|
+
const api = apiBase(value);
|
|
28
|
+
if (!api) return null;
|
|
29
|
+
const { hostname } = new URL(api);
|
|
30
|
+
return QQ_API_HOST.test(hostname) || LOOPBACK.has(hostname) ? api : null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
class QqSessionError extends Error {
|
|
34
|
+
constructor(reason, { status = 0, permanent = false } = {}) {
|
|
35
|
+
super(reason);
|
|
36
|
+
this.status = status;
|
|
37
|
+
this.permanent = permanent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Craft appends `api`, `app_id`, `qq_test` to the game URL when syncing to QQ; `qq_test` alone marks the QQ host. */
|
|
42
|
+
export function readQqRuntime(win) {
|
|
43
|
+
const search = win?.location?.search;
|
|
44
|
+
const params = new URLSearchParams(typeof search === 'string' ? search : '');
|
|
45
|
+
if (!params.has('qq_test')) return null;
|
|
46
|
+
const api = trustedApi(text(params.get('api')));
|
|
47
|
+
const appId = text(params.get('app_id'));
|
|
48
|
+
const flag = text(params.get('qq_test'));
|
|
49
|
+
const qqTest = flag === '0' || flag === '1' ? Number(flag) : null;
|
|
50
|
+
if (api && appId && qqTest !== null) return { api, appId, qqTest };
|
|
51
|
+
const problems = [!api && 'api (need https *.craft.qq.com, no query/hash)', !appId && 'app_id', qqTest === null && 'qq_test (need 0 or 1)'].filter(Boolean);
|
|
52
|
+
return { invalid: true, reason: `missing or invalid: ${problems.join(', ')}` };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The SDK picks bridge or mock once, at evaluation time, so it must load after the host bridge exists. */
|
|
56
|
+
export async function loadQqSdk(win) {
|
|
57
|
+
const deadline = Date.now() + BRIDGE_WAIT_MS;
|
|
58
|
+
while (!win?.qqAiGameSdk && typeof win?.__qqAiGameBridge?.invoke !== 'function') {
|
|
59
|
+
if (Date.now() >= deadline) return null;
|
|
60
|
+
await new Promise(resolve => setTimeout(resolve, BRIDGE_POLL_MS));
|
|
61
|
+
}
|
|
62
|
+
if (!win?.qqAiGameSdk) await import('./qq-ai-game-sdk.min.js');
|
|
63
|
+
return win?.qqAiGameSdk ?? null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const sessionData = payload => {
|
|
67
|
+
if (typeof payload?.session_token === 'string') return payload;
|
|
68
|
+
if (payload?.code === 0 && payload.data && typeof payload.data === 'object') return payload.data;
|
|
69
|
+
return null;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export function createQqSession({ win, runtime, loadSdk = loadQqSdk, log, apply, fail, now = Date.now }) {
|
|
73
|
+
const fetchImpl = win?.fetch ? win.fetch.bind(win) : globalThis.fetch;
|
|
74
|
+
let sdk = null, stopped = false, inflight = null, timer, controller = null, expiresAt = 0, attemptedAt = 0;
|
|
75
|
+
|
|
76
|
+
const resolveSdk = async () => {
|
|
77
|
+
if (!sdk) {
|
|
78
|
+
try {
|
|
79
|
+
sdk = await loadSdk(win);
|
|
80
|
+
} catch {
|
|
81
|
+
throw new QqSessionError('sdk load failed');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!sdk || typeof sdk.login !== 'function') throw new QqSessionError('sdk unavailable', { permanent: true });
|
|
85
|
+
if (sdk.isMock) throw new QqSessionError('sdk in mock mode', { permanent: true });
|
|
86
|
+
return sdk;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const login = async () => {
|
|
90
|
+
let result;
|
|
91
|
+
const ready = await resolveSdk();
|
|
92
|
+
if (stopped) throw new QqSessionError('disposed');
|
|
93
|
+
try {
|
|
94
|
+
result = await ready.login();
|
|
95
|
+
} catch (error) {
|
|
96
|
+
throw new QqSessionError(`login ${text(error?.code) || 'failed'}`);
|
|
97
|
+
}
|
|
98
|
+
const gopenid = text(result?.gopenid);
|
|
99
|
+
const gameToken = text(pick(result, 'game_token', 'gameToken'));
|
|
100
|
+
if (!gopenid || !gameToken) throw new QqSessionError('login returned no credentials');
|
|
101
|
+
return { gopenid, gameToken };
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const exchange = async () => {
|
|
105
|
+
const { gopenid, gameToken } = await login();
|
|
106
|
+
if (stopped) throw new QqSessionError('disposed');
|
|
107
|
+
const request = new AbortController();
|
|
108
|
+
controller = request;
|
|
109
|
+
const timeout = setTimeout(() => request.abort(), EXCHANGE_TIMEOUT_MS);
|
|
110
|
+
try {
|
|
111
|
+
const response = await fetchImpl(`${runtime.api}${EXCHANGE_PATH}`, {
|
|
112
|
+
method: 'POST',
|
|
113
|
+
headers: { 'Content-Type': 'application/json' },
|
|
114
|
+
body: JSON.stringify({ app_id: runtime.appId, qq_test: runtime.qqTest, game_token: gameToken, gopenid }),
|
|
115
|
+
signal: request.signal,
|
|
116
|
+
redirect: 'error',
|
|
117
|
+
credentials: 'omit',
|
|
118
|
+
});
|
|
119
|
+
if (response.status !== 200) {
|
|
120
|
+
const permanent = response.status === 400 || response.status === 403 || response.status === 503;
|
|
121
|
+
throw new QqSessionError(`exchange http ${response.status}`, { status: response.status, permanent });
|
|
122
|
+
}
|
|
123
|
+
const data = sessionData(await response.json());
|
|
124
|
+
const token = text(data?.session_token);
|
|
125
|
+
const playerId = text(data?.player_id);
|
|
126
|
+
if (!token || !playerId) throw new QqSessionError('exchange response malformed');
|
|
127
|
+
const ttl = Number(pick(data, 'expires_in', 'expiresIn'));
|
|
128
|
+
const expiresIn = ttl > 0 ? ttl : DEFAULT_EXPIRES_IN_S;
|
|
129
|
+
const playerName = text(data.player_name) || `用户${playerId.slice(-6)}`;
|
|
130
|
+
return { identity: { api: runtime.api, token, appId: runtime.appId, playerId, playerName }, expiresIn };
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (error instanceof QqSessionError) throw error;
|
|
133
|
+
throw new QqSessionError('exchange network error');
|
|
134
|
+
} finally {
|
|
135
|
+
clearTimeout(timeout);
|
|
136
|
+
if (controller === request) controller = null;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const attempt = async () => {
|
|
141
|
+
try {
|
|
142
|
+
return await exchange();
|
|
143
|
+
} catch (error) {
|
|
144
|
+
if (error.status !== 401 || stopped) throw error;
|
|
145
|
+
return exchange();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const schedule = expiresIn => {
|
|
150
|
+
expiresAt = now() + expiresIn * 1000;
|
|
151
|
+
clearTimeout(timer);
|
|
152
|
+
const delay = Math.max(expiresIn * 1000 - REFRESH_LEAD_MS, MIN_REFRESH_DELAY_MS);
|
|
153
|
+
timer = setTimeout(() => void refresh(), delay);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const refresh = () => {
|
|
157
|
+
if (stopped) return Promise.resolve(false);
|
|
158
|
+
if (inflight) return inflight;
|
|
159
|
+
inflight = (async () => {
|
|
160
|
+
try {
|
|
161
|
+
const result = await attempt();
|
|
162
|
+
if (stopped) return false;
|
|
163
|
+
schedule(result.expiresIn);
|
|
164
|
+
apply(result.identity);
|
|
165
|
+
return true;
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (stopped) return false;
|
|
168
|
+
if (error.permanent) stop();
|
|
169
|
+
fail(error.message);
|
|
170
|
+
return false;
|
|
171
|
+
} finally {
|
|
172
|
+
attemptedAt = now();
|
|
173
|
+
inflight = null;
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
176
|
+
return inflight;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const coolingDown = () => attemptedAt > 0 && now() - attemptedAt < RETRY_COOLDOWN_MS;
|
|
180
|
+
|
|
181
|
+
const onVisibility = () => {
|
|
182
|
+
if (stopped || inflight || win?.document?.visibilityState !== 'visible' || coolingDown()) return;
|
|
183
|
+
if (expiresAt && now() < expiresAt - REFRESH_LEAD_MS) return;
|
|
184
|
+
void refresh();
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
function stop() {
|
|
188
|
+
stopped = true;
|
|
189
|
+
clearTimeout(timer);
|
|
190
|
+
controller?.abort();
|
|
191
|
+
win?.document?.removeEventListener?.('visibilitychange', onVisibility);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
start() {
|
|
196
|
+
win?.document?.addEventListener?.('visibilitychange', onVisibility);
|
|
197
|
+
log('qq session exchanging');
|
|
198
|
+
return refresh();
|
|
199
|
+
},
|
|
200
|
+
/** Resolves true once a new session_token is in place; shares an exchange already in flight. */
|
|
201
|
+
reauthenticate() {
|
|
202
|
+
if (inflight) return refresh();
|
|
203
|
+
if (stopped || coolingDown()) return Promise.resolve(false);
|
|
204
|
+
return refresh();
|
|
205
|
+
},
|
|
206
|
+
dispose: stop,
|
|
207
|
+
};
|
|
208
|
+
}
|
package/resources/targets/zcode/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const unavailable = () => ({ ok: false, code: 'PLATFORM_UNAVAILABLE', message: '当前环境不支持平台服务' });
|
|
2
|
+
|
|
3
|
+
export const failure = (code = 'INTERNAL_ERROR', message = '服务暂不可用,请稍后重试') => ({ ok: false, code, message });
|
|
4
|
+
|
|
5
|
+
export const duration = (value, fallback) => (Number.isFinite(value) && value >= 0 ? Math.min(value, 60_000) : fallback);
|
|
6
|
+
|
|
7
|
+
const httpOrigin = value => {
|
|
8
|
+
try {
|
|
9
|
+
const url = new URL(value);
|
|
10
|
+
return /^https?:$/.test(url.protocol) ? url.origin : null;
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function parentOrigin(win, explicit) {
|
|
17
|
+
if (explicit && explicit !== '*') return httpOrigin(explicit);
|
|
18
|
+
const referrer = httpOrigin(win?.document?.referrer);
|
|
19
|
+
if (referrer) return referrer;
|
|
20
|
+
try {
|
|
21
|
+
return httpOrigin(win?.parent?.location?.origin);
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** HTTPS gateway base without trailing slashes; plain HTTP only for loopback hosts. */
|
|
28
|
+
export function apiBase(value) {
|
|
29
|
+
try {
|
|
30
|
+
const url = new URL(value);
|
|
31
|
+
const local = url.protocol === 'http:' && ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname);
|
|
32
|
+
if ((url.protocol !== 'https:' && !local) || url.username || url.password || url.search || url.hash) return null;
|
|
33
|
+
return url.href.replace(/\/+$/, '');
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|