@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
package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
+
import { dirname, extname, join, relative, resolve, sep } from 'node:path';
|
|
4
|
+
import { imageSize, inspectGlb } from './glb.mjs';
|
|
5
|
+
|
|
6
|
+
const CODE_EXTS = new Set(['.js', '.mjs', '.cjs', '.ts', '.tsx', '.html', '.css']);
|
|
7
|
+
const ASSET_EXTS = new Set(['.glb', '.gltf', '.png', '.jpg', '.jpeg', '.webp', '.ktx', '.ktx2', '.ogg', '.mp3', '.wav', '.m4a', '.bin', '.woff', '.woff2', '.ttf', '.otf']);
|
|
8
|
+
const MODEL_EXTS = new Set(['.glb', '.gltf']);
|
|
9
|
+
const IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.webp', '.ktx', '.ktx2']);
|
|
10
|
+
const AUDIO_EXTS = new Set(['.ogg', '.mp3', '.wav', '.m4a']);
|
|
11
|
+
const SKIP_DIRS = new Set(['.git', 'node_modules', '.asset-audit', '.asset-search', 'dist', 'coverage', '.claude', '.cursor', '.agents', '.workbuddy', '.codebuddy', '.dsh', '.zcode', '.kimi-code', '.craft']);
|
|
12
|
+
const HARDCODED_URL = /(['"`])((?:https?:\/\/file\.craft\.qq\.com\/|\/Game\/|Game\/)[^'"`\\]*)\1/g;
|
|
13
|
+
const LOAD_CALLS = /\b(loadGlbModel|GLBLoader|SkinnedCreate|SkinnedFromGltf|GLTFLoader|createAssetLoader)\s*\(/g;
|
|
14
|
+
|
|
15
|
+
function toPosix(value) { return value.split(sep).join('/'); }
|
|
16
|
+
function escapeRegExp(value) {
|
|
17
|
+
return value.replace(/[.*+?^$|[\]\\]/g, '\\$&').replace(/[{}()]/g, '\\$&');
|
|
18
|
+
}
|
|
19
|
+
function countExact(text, needle) {
|
|
20
|
+
if (!needle) return 0;
|
|
21
|
+
let total = 0;
|
|
22
|
+
let at = text.indexOf(needle);
|
|
23
|
+
while (at >= 0) { total += 1; at = text.indexOf(needle, at + needle.length); }
|
|
24
|
+
return total;
|
|
25
|
+
}
|
|
26
|
+
function countToken(text, token) {
|
|
27
|
+
if (!token) return 0;
|
|
28
|
+
try { return (text.match(new RegExp('(?<![A-Za-z0-9_])' + escapeRegExp(token) + '(?![A-Za-z0-9_])', 'g')) || []).length; }
|
|
29
|
+
catch { return countExact(text, token); }
|
|
30
|
+
}
|
|
31
|
+
function stripComments(text, ext) {
|
|
32
|
+
let result = '';
|
|
33
|
+
let quote = null;
|
|
34
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
35
|
+
const char = text[index];
|
|
36
|
+
const next = text[index + 1];
|
|
37
|
+
if (quote) {
|
|
38
|
+
result += char;
|
|
39
|
+
if (char === '\\') { index += 1; if (index < text.length) result += text[index]; continue; }
|
|
40
|
+
if (char === quote) quote = null;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (char === '"' || char === "'" || char === '`') { quote = char; result += char; continue; }
|
|
44
|
+
if (char === '/' && next === '/') {
|
|
45
|
+
while (index < text.length && text[index] !== '\n') index += 1;
|
|
46
|
+
result += '\n';
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (char === '/' && next === '*') {
|
|
50
|
+
index += 2;
|
|
51
|
+
while (index < text.length && !(text[index] === '*' && text[index + 1] === '/')) {
|
|
52
|
+
if (text[index] === '\n') result += '\n';
|
|
53
|
+
index += 1;
|
|
54
|
+
}
|
|
55
|
+
index += 1;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
result += char;
|
|
59
|
+
}
|
|
60
|
+
if (ext === '.html' || ext === '.htm') result = result.replace(/<!--[\s\S]*?-->/g, '');
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
function readText(path) { try { return readFileSync(path, 'utf8'); } catch { return ''; } }
|
|
64
|
+
function readJson(path, fallback) { try { return JSON.parse(readFileSync(path, 'utf8')); } catch { return fallback; } }
|
|
65
|
+
function walkFiles(root) {
|
|
66
|
+
const files = [];
|
|
67
|
+
const visit = (dir) => {
|
|
68
|
+
let entries;
|
|
69
|
+
try { entries = readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
70
|
+
for (const entry of entries) {
|
|
71
|
+
if (entry.isSymbolicLink()) continue;
|
|
72
|
+
if (entry.isDirectory()) { if (!SKIP_DIRS.has(entry.name)) visit(join(dir, entry.name)); continue; }
|
|
73
|
+
if (entry.isFile()) files.push(join(dir, entry.name));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
visit(root);
|
|
77
|
+
return files;
|
|
78
|
+
}
|
|
79
|
+
function collectFiles(root, roots) {
|
|
80
|
+
const result = [];
|
|
81
|
+
for (const item of roots) {
|
|
82
|
+
const absolute = join(root, item);
|
|
83
|
+
if (!existsSync(absolute)) continue;
|
|
84
|
+
try { if (!statSync(absolute).isDirectory()) { result.push(absolute); continue; } } catch { continue; }
|
|
85
|
+
result.push(...walkFiles(absolute));
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
const SOURCE_CODE_SKIP = /(?:^|\/)(?:node_modules|dist|build|public|runtime|vendor|_original|tests?|scripts|coverage|\.claude|\.cursor|\.agents|\.workbuddy|\.codebuddy|\.dsh|\.zcode|\.kimi-code|\.craft|\.asset-audit|\.asset-search)(?:\/|$)/i;
|
|
90
|
+
function collectSourceCode(root) {
|
|
91
|
+
return walkFiles(root).filter((file) => {
|
|
92
|
+
if (!/\.(?:ts|tsx|js|mjs|cjs)$/i.test(file)) return false;
|
|
93
|
+
if (/\.min\.(?:js|mjs|cjs)$/i.test(file)) return false;
|
|
94
|
+
const rel = toPosix(relative(root, file));
|
|
95
|
+
return !SOURCE_CODE_SKIP.test(rel);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function kindFor(value, assetType) {
|
|
99
|
+
const ext = extname(String(value).split('?')[0]).toLowerCase();
|
|
100
|
+
if (assetType === 'Texture2D') return 'texture';
|
|
101
|
+
if (assetType === 'StaticMesh' || assetType === 'SkeletalMesh') return 'model';
|
|
102
|
+
if (assetType === 'AnimSequence') return 'animation';
|
|
103
|
+
if (assetType === 'PaperFlipbook') return 'sprite';
|
|
104
|
+
if (assetType === 'SoundWave') return 'audio';
|
|
105
|
+
if (MODEL_EXTS.has(ext)) return 'model';
|
|
106
|
+
if (IMAGE_EXTS.has(ext)) return 'texture';
|
|
107
|
+
if (AUDIO_EXTS.has(ext)) return 'audio';
|
|
108
|
+
if (ext === '.bin') return 'binary';
|
|
109
|
+
if (ext === '.woff' || ext === '.woff2' || ext === '.ttf' || ext === '.otf') return 'font';
|
|
110
|
+
return 'other';
|
|
111
|
+
}
|
|
112
|
+
function looksLikeAssetUrl(value) {
|
|
113
|
+
if (typeof value !== 'string') return false;
|
|
114
|
+
const text = value.trim();
|
|
115
|
+
if (!text) return false;
|
|
116
|
+
if (text.startsWith('/Game/') || text.startsWith('Game/') || text.startsWith('test1/')) return true;
|
|
117
|
+
if (text.startsWith('https://file.craft.qq.com/')) return true;
|
|
118
|
+
return ASSET_EXTS.has(extname(text.split('?')[0]).toLowerCase());
|
|
119
|
+
}
|
|
120
|
+
function flattenLeaves(value, prefix, out) {
|
|
121
|
+
if (out === undefined) out = [];
|
|
122
|
+
if (value === null || value === undefined) return out;
|
|
123
|
+
if (Array.isArray(value)) { value.forEach((item, index) => flattenLeaves(item, prefix ? prefix + '.' + index : String(index), out)); return out; }
|
|
124
|
+
if (typeof value === 'object') { for (const [key, item] of Object.entries(value)) flattenLeaves(item, prefix ? prefix + '.' + key : key, out); return out; }
|
|
125
|
+
if (typeof value === 'string') out.push({ path: prefix, value });
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
function normalizeUrl(value) {
|
|
129
|
+
return String(value || '').trim().replace(/^https?:\/\/file\.craft\.qq\.com\//i, '').replace(/^\/Glb\//, '/').replace(/^Glb\//, '').replace(/^\/+/, '');
|
|
130
|
+
}
|
|
131
|
+
function hashFile(path) { try { return createHash('sha256').update(readFileSync(path)).digest('hex'); } catch { return null; } }
|
|
132
|
+
function makeCorpus(files) {
|
|
133
|
+
const texts = [];
|
|
134
|
+
for (const file of files) {
|
|
135
|
+
const ext = extname(file).toLowerCase();
|
|
136
|
+
if (!CODE_EXTS.has(ext) && ext !== '.json') continue;
|
|
137
|
+
const text = readText(file);
|
|
138
|
+
if (text) texts.push(stripComments(text, ext));
|
|
139
|
+
}
|
|
140
|
+
return texts.join('\n');
|
|
141
|
+
}
|
|
142
|
+
function familyDirectories(code, dirs) {
|
|
143
|
+
const found = new Set();
|
|
144
|
+
const topLevel = new Set(['models', 'audio', 'textures', 'ui', 'clouds', 'assets']);
|
|
145
|
+
for (const dir of dirs) {
|
|
146
|
+
if (topLevel.has(dir)) continue;
|
|
147
|
+
const token = dir + '/';
|
|
148
|
+
let at = code.indexOf(token);
|
|
149
|
+
while (at >= 0) {
|
|
150
|
+
const after = code.slice(at + token.length, at + token.length + 500);
|
|
151
|
+
const before = code.slice(Math.max(0, at - 140), at);
|
|
152
|
+
if (/(\+|\.concat\(|\.join\()/.test(after)) { found.add(dir); break; }
|
|
153
|
+
const assigned = before.match(/([A-Za-z_$][\w$]*)\s*=\s*['"`](?:\.\/)?$/);
|
|
154
|
+
if (assigned) {
|
|
155
|
+
const name = escapeRegExp(assigned[1]);
|
|
156
|
+
const use = new RegExp('\\b' + name + '\\b\\s*(?:\\+|\\$\\{)' + '|\\.\\.\\.\\s*' + name + '\\b' + '|\\$\\{\\s*' + name + '\\b' + '|\\.concat\\(\\s*' + name + '\\b');
|
|
157
|
+
if (use.test(code)) { found.add(dir); break; }
|
|
158
|
+
}
|
|
159
|
+
at = code.indexOf(token, at + token.length);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return found;
|
|
163
|
+
}
|
|
164
|
+
function buildBundleAssets(root) {
|
|
165
|
+
const files = collectFiles(root, ['models', 'audio', 'textures', 'ui', 'clouds', 'assets']).filter((file) => ASSET_EXTS.has(extname(file).toLowerCase()) && !CODE_EXTS.has(extname(file).toLowerCase()));
|
|
166
|
+
const assets = [];
|
|
167
|
+
for (const file of new Set(files)) {
|
|
168
|
+
const rel = toPosix(relative(root, file));
|
|
169
|
+
const kind = kindFor(rel);
|
|
170
|
+
let glb = null; let image = null; let error = null;
|
|
171
|
+
try {
|
|
172
|
+
if (kind === 'model' && extname(rel).toLowerCase() === '.glb') glb = inspectGlb(readFileSync(file));
|
|
173
|
+
else if (kind === 'texture') image = imageSize(readFileSync(file));
|
|
174
|
+
} catch (caught) { error = caught.message; }
|
|
175
|
+
assets.push({ path: rel, absolute: file, bytes: statSync(file).size, kind, glb, image, error });
|
|
176
|
+
}
|
|
177
|
+
return assets;
|
|
178
|
+
}
|
|
179
|
+
function buildBundleCorpus(root) {
|
|
180
|
+
const files = collectFiles(root, ['assets', 'ui', 'models', 'clouds']).filter((file) => ['.js', '.mjs', '.cjs', '.css', '.html', '.json'].includes(extname(file).toLowerCase()));
|
|
181
|
+
const index = join(root, 'index.html');
|
|
182
|
+
if (existsSync(index)) files.push(index);
|
|
183
|
+
return makeCorpus(files);
|
|
184
|
+
}
|
|
185
|
+
function hasUsageCode(root) {
|
|
186
|
+
const files = collectFiles(root, ['assets', 'ui', 'clouds']).filter((file) => /\.(js|mjs|cjs)$/i.test(file));
|
|
187
|
+
for (const file of files) {
|
|
188
|
+
try { if (statSync(file).size > 0) return true; } catch { /* ignore unreadable files */ }
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
function prefixPath(path) {
|
|
193
|
+
return path.split(', ').map((item) => item.startsWith('public/') ? item : 'public/' + item).join(', ');
|
|
194
|
+
}
|
|
195
|
+
function preloadFinding(code, assets) {
|
|
196
|
+
const pattern = /\[(?:\s*['"][^'"]{2,}['"]\s*,){7,}\s*['"][^'"]+['"]\s*\]/g;
|
|
197
|
+
for (const match of code.matchAll(pattern)) {
|
|
198
|
+
const at = match.index || 0;
|
|
199
|
+
const context = code.slice(Math.max(0, at - 800), at + 3000);
|
|
200
|
+
if (!/fetch\s*\(/.test(context) || !/\.glb['"`]/.test(context)) continue;
|
|
201
|
+
const names = [...match[0].matchAll(/['"`]([^'"`]+)['"`]/g)].map((item) => item[1]);
|
|
202
|
+
const matched = assets.filter((asset) => names.some((name) => {
|
|
203
|
+
const base = name.replace(/\.glb$/i, '').split('/').pop();
|
|
204
|
+
return Boolean(base) && asset.path.endsWith('/' + base + '.glb');
|
|
205
|
+
}));
|
|
206
|
+
if (!matched.length) continue;
|
|
207
|
+
return {
|
|
208
|
+
id: 'EAGER_PRELOAD', severity: 'warning', confidence: 'medium',
|
|
209
|
+
title: 'Many model files are fetched by an eager preload list', path: 'bundle script',
|
|
210
|
+
evidence: { names: names.length, matchedFiles: matched.length, bytes: matched.reduce((total, asset) => total + asset.bytes, 0) },
|
|
211
|
+
estimatedSavings: 0,
|
|
212
|
+
fix: 'Stage the preload (small warm set, idle priority) or reduce payload with animation resampling/texture resizing; keep enough warm models to avoid pop-in.',
|
|
213
|
+
verify: 'Measure first-canvas time and model-ready time separately; do not remove the preload based only on network totals.',
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
function summarizeBundle(root, assets, corpus, options) {
|
|
219
|
+
const settings = options || {};
|
|
220
|
+
const hasUsageEvidence = settings.hasUsageEvidence !== false;
|
|
221
|
+
const dirs = [...new Set(assets.map((asset) => toPosix(dirname(asset.path))))].filter((dir) => dir !== '.');
|
|
222
|
+
const family = familyDirectories(corpus, dirs);
|
|
223
|
+
const findings = [];
|
|
224
|
+
const duplicates = new Map();
|
|
225
|
+
const enriched = assets.map((asset) => {
|
|
226
|
+
const name = asset.path.split('/').pop();
|
|
227
|
+
const stem = name.replace(/\.[^.]+$/, '');
|
|
228
|
+
const dir = toPosix(dirname(asset.path));
|
|
229
|
+
const pathCount = countExact(corpus, asset.path) + countExact(corpus, './' + asset.path);
|
|
230
|
+
const nameCount = countToken(corpus, name);
|
|
231
|
+
const stemCount = pathCount === 0 && nameCount === 0 ? countToken(corpus, stem) : 0;
|
|
232
|
+
const familyHit = family.has(dir);
|
|
233
|
+
const used = pathCount > 0 || nameCount > 0 || stemCount > 0 || familyHit;
|
|
234
|
+
const confidence = pathCount > 0 || nameCount > 0 ? 'direct' : familyHit ? 'family' : 'none';
|
|
235
|
+
const hash = hashFile(asset.absolute);
|
|
236
|
+
if (hash) { if (!duplicates.has(hash)) duplicates.set(hash, []); duplicates.get(hash).push(asset.path); }
|
|
237
|
+
if (!used && hasUsageEvidence) findings.push({ id: 'UNREFERENCED_FILE', severity: 'warning', confidence: dir !== '.' && corpus.includes(dir + '/') ? 'medium' : 'high', title: 'Asset file is not referenced by scanned code', path: asset.path, evidence: { bytes: asset.bytes, refs: { path: pathCount, name: nameCount, stem: stemCount, family: familyHit } }, estimatedSavings: asset.bytes, fix: 'Confirm intent, then remove the file or exclude it from the package. Never remove a dynamic family without checking its constructor.', verify: 'Rebuild and run the game; check for 404s and missing visuals/audio.' });
|
|
238
|
+
if (asset.error) findings.push({ id: 'GLB_PARSE_ERROR', severity: 'error', confidence: 'high', title: 'GLB could not be inspected', path: asset.path, evidence: { error: asset.error, bytes: asset.bytes }, estimatedSavings: 0, fix: 'Inspect with the runtime loader; reject corrupted or unsupported GLBs.', verify: 'Load through the project runtime and confirm it renders.' });
|
|
239
|
+
if (asset.glb) {
|
|
240
|
+
const glb = asset.glb;
|
|
241
|
+
if (glb.extensionsRequired.length) findings.push({ id: 'UNSUPPORTED_GLB_EXTENSION', severity: 'error', confidence: 'high', title: 'GLB requires a glTF extension; verify the project loader supports it', path: asset.path, evidence: { extensionsRequired: glb.extensionsRequired, bytes: asset.bytes }, estimatedSavings: 0, fix: 'Confirm whether the project uses loadGlbModel (Three GLTFLoader) or a custom GLBLoader; add the needed decoder or re-export without extensionsRequired. Do not strip extensionsRequired without proof.', verify: 'Load the GLB with the project runtime and check geometry, skinning and textures.' });
|
|
242
|
+
if (glb.animationBytes > 500000 && glb.animationBytes / Math.max(1, asset.bytes) > 0.35) findings.push({ id: 'ANIMATION_DOMINANT', severity: 'warning', confidence: 'high', title: 'Animation keyframes dominate this skinned model', path: asset.path, evidence: { bytes: asset.bytes, animationBytes: glb.animationBytes, clips: glb.clips, keyframes: glb.keyframes, duration: glb.duration, keyframesPerSecond: Number(glb.keyframesPerSecond.toFixed(1)) }, estimatedSavings: Math.round(glb.animationBytes * 0.5), fix: 'Resample with gltf-transform (tolerance ~0.001), then validate clip names/durations and sampled transforms with a slerp-aware comparison.', verify: 'Run the game, compare representative poses, and confirm clips/durations are unchanged.' });
|
|
243
|
+
if (glb.textureBytes > 500000 || glb.images.some((image) => (image.width || 0) > 1024 || (image.height || 0) > 1024)) findings.push({ id: 'LARGE_TEXTURE', severity: 'warning', confidence: 'high', title: 'Model embeds large textures', path: asset.path, evidence: { bytes: asset.bytes, textureBytes: glb.textureBytes, images: glb.images.map((image) => ({ width: image.width, height: image.height, bytes: image.bytes, format: image.format })) }, estimatedSavings: Math.round(glb.textureBytes * 0.5), fix: 'Resize embedded textures to the smallest size that survives the actual viewing distance, then re-embed; keep alpha and color-space semantics.', verify: 'Compare the model at the closest gameplay distance; check seams, alpha edges and UI readability.' });
|
|
244
|
+
if (!glb.clips && glb.nodes > glb.meshes + 5 && glb.nodes > glb.meshes * 1.5 && asset.bytes > 500000) findings.push({ id: 'PRUNE_CANDIDATE', severity: 'info', confidence: 'medium', title: 'Static model carries many empty/auxiliary nodes', path: asset.path, evidence: { bytes: asset.bytes, nodes: glb.nodes, meshes: glb.meshes }, estimatedSavings: Math.round(asset.bytes * 0.1), fix: 'Run gltf-transform prune (and dedup); keep nodes the game looks up by name.', verify: 'Load through the project runtime and confirm named anchors and materials still resolve.' });
|
|
245
|
+
} else if (asset.kind === 'texture' && asset.image) {
|
|
246
|
+
if (asset.bytes > 1000000 || asset.image.width > 1024 || asset.image.height > 1024) findings.push({ id: 'LARGE_TEXTURE', severity: 'warning', confidence: 'high', title: 'Texture is larger than the common 1024 px budget', path: asset.path, evidence: { bytes: asset.bytes, width: asset.image.width, height: asset.image.height, format: asset.image.format }, estimatedSavings: Math.round(asset.bytes * 0.5), fix: 'Resize to the smallest size that survives the viewing distance; preserve aspect ratio, alpha and format.', verify: 'Compare in the real camera distance and target screen size.' });
|
|
247
|
+
}
|
|
248
|
+
return { path: asset.path, bytes: asset.bytes, kind: asset.kind, used: hasUsageEvidence ? used : null, confidence: hasUsageEvidence ? confidence : 'unknown', refs: { path: pathCount, name: nameCount, stem: stemCount, family: familyHit }, glb: asset.glb, image: asset.image, error: asset.error };
|
|
249
|
+
});
|
|
250
|
+
for (const [hash, paths] of duplicates) {
|
|
251
|
+
if (paths.length < 2) continue;
|
|
252
|
+
const first = assets.find((asset) => asset.path === paths[0]);
|
|
253
|
+
const bytes = first ? first.bytes : 0;
|
|
254
|
+
findings.push({ id: 'DUPLICATE_FILE', severity: 'warning', confidence: 'high', title: 'Identical asset files are packaged more than once', path: paths.join(', '), evidence: { hash: hash.slice(0, 12), files: paths.length, bytesEach: bytes }, estimatedSavings: bytes * (paths.length - 1), fix: 'Keep one copy and reference it from all consumers; verify the export does not require a distinct filename per slot.', verify: 'Rebuild and confirm every consumer still loads the shared asset.' });
|
|
255
|
+
}
|
|
256
|
+
const preload = preloadFinding(corpus, assets);
|
|
257
|
+
if (preload) findings.push(preload);
|
|
258
|
+
if (!hasUsageEvidence) findings.push({ id: 'NO_USAGE_CORPUS', severity: 'warning', confidence: 'high', title: 'No built code was scanned; asset usage cannot be determined', path: 'bundle script', evidence: { assets: assets.length }, estimatedSavings: 0, fix: 'Build the project and scan the built output, or use source mode with configs. Do not delete assets from this report.', verify: 'Re-run after a successful build and confirm asset references appear.' });
|
|
259
|
+
const glbAssets = enriched.filter((asset) => asset.glb);
|
|
260
|
+
const usedBytes = hasUsageEvidence ? enriched.filter((asset) => asset.used).reduce((total, asset) => total + asset.bytes, 0) : 0;
|
|
261
|
+
const unusedBytes = hasUsageEvidence ? enriched.filter((asset) => !asset.used).reduce((total, asset) => total + asset.bytes, 0) : 0;
|
|
262
|
+
const textureBytes = glbAssets.reduce((total, asset) => total + asset.glb.textureBytes, 0) + enriched.filter((asset) => asset.kind === 'texture').reduce((total, asset) => total + asset.bytes, 0);
|
|
263
|
+
return { assets: enriched, findings, summary: { files: enriched.length, bytes: enriched.reduce((total, asset) => total + asset.bytes, 0), usedBytes, unusedBytes, familyBytes: enriched.filter((asset) => asset.confidence === 'family').reduce((total, asset) => total + asset.bytes, 0), glbFiles: glbAssets.length, animationBytes: glbAssets.reduce((total, asset) => total + asset.glb.animationBytes, 0), textureBytes, duplicateGroups: [...duplicates.values()].filter((paths) => paths.length > 1).length, usageEvidence: hasUsageEvidence } };
|
|
264
|
+
}
|
|
265
|
+
function collectControls(configDir) {
|
|
266
|
+
const controls = new Map();
|
|
267
|
+
if (!existsSync(configDir)) return controls;
|
|
268
|
+
for (const name of readdirSync(configDir)) {
|
|
269
|
+
if (!name.endsWith('.json') || name.endsWith('.controls.json') || name === 'scene_assets.json') continue;
|
|
270
|
+
const stem = name.replace(/\.json$/, '');
|
|
271
|
+
const json = readJson(join(configDir, name), null);
|
|
272
|
+
if (!json || typeof json !== 'object' || Array.isArray(json)) continue;
|
|
273
|
+
const inline = (value, prefix) => {
|
|
274
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return;
|
|
275
|
+
const key = prefix === stem || prefix.startsWith(stem + '.') ? prefix : stem + '.' + prefix;
|
|
276
|
+
if (value.type === 'resource') controls.set(key, value);
|
|
277
|
+
for (const [childKey, child] of Object.entries(value)) inline(child, prefix ? prefix + '.' + childKey : childKey);
|
|
278
|
+
};
|
|
279
|
+
inline(json, '');
|
|
280
|
+
}
|
|
281
|
+
for (const name of readdirSync(configDir)) {
|
|
282
|
+
if (!name.endsWith('.controls.json')) continue;
|
|
283
|
+
const json = readJson(join(configDir, name), {});
|
|
284
|
+
const stem = name.replace(/\.controls\.json$/, '');
|
|
285
|
+
const walk = (value, prefix) => {
|
|
286
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return;
|
|
287
|
+
if (value.type) controls.set(stem + '.' + prefix, value);
|
|
288
|
+
for (const [key, child] of Object.entries(value)) walk(child, prefix ? prefix + '.' + key : key);
|
|
289
|
+
};
|
|
290
|
+
walk(json, '');
|
|
291
|
+
}
|
|
292
|
+
return controls;
|
|
293
|
+
}
|
|
294
|
+
function collectSourceSlots(root) {
|
|
295
|
+
const runtime = readJson(join(root, 'game-runtime.json'), {});
|
|
296
|
+
const configDir = join(root, runtime.configs || 'configs');
|
|
297
|
+
const controls = collectControls(configDir);
|
|
298
|
+
const slots = [];
|
|
299
|
+
const seen = new Set();
|
|
300
|
+
const knownUrls = new Set();
|
|
301
|
+
const add = (slot) => {
|
|
302
|
+
const key = normalizeUrl(slot.url);
|
|
303
|
+
if (slot.manifest && key && knownUrls.has(key)) return;
|
|
304
|
+
if (!slot.manifest && key) knownUrls.add(key);
|
|
305
|
+
if (!seen.has(slot.id)) { seen.add(slot.id); slots.push(slot); }
|
|
306
|
+
};
|
|
307
|
+
if (existsSync(configDir)) {
|
|
308
|
+
for (const name of readdirSync(configDir)) {
|
|
309
|
+
if (!name.endsWith('.json') || name.endsWith('.controls.json') || name === 'scene_assets.json') continue;
|
|
310
|
+
const stem = name.replace(/\.json$/, '');
|
|
311
|
+
const json = readJson(join(configDir, name), null);
|
|
312
|
+
if (!json || typeof json !== 'object' || Array.isArray(json)) continue;
|
|
313
|
+
for (const leaf of flattenLeaves(json)) {
|
|
314
|
+
const id = leaf.path === stem || leaf.path.startsWith(stem + '.') ? leaf.path : stem + '.' + leaf.path;
|
|
315
|
+
const control = controls.get(id) || (id.endsWith('.value') ? controls.get(id.slice(0, -6)) : null);
|
|
316
|
+
const declared = control && control.type === 'resource';
|
|
317
|
+
if (!declared && !looksLikeAssetUrl(leaf.value)) continue;
|
|
318
|
+
add({ id, url: leaf.value, kind: kindFor(leaf.value, control && control.asset_type), source: 'configs/' + name, configFile: stem, path: leaf.path, controls: control ? { type: control.type, asset_type: control.asset_type } : null });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const sceneAssets = readJson(join(configDir, 'scene_assets.json'), {});
|
|
323
|
+
if (sceneAssets && typeof sceneAssets === 'object') {
|
|
324
|
+
for (const [key, entry] of Object.entries(sceneAssets)) {
|
|
325
|
+
const url = typeof entry === 'string' ? entry : entry && entry.value;
|
|
326
|
+
if (typeof url === 'string' && url) add({ id: 'scene_assets.' + key, url, kind: kindFor(url), source: 'configs/scene_assets.json', sceneAsset: true });
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const manifest = readJson(join(root, 'SPEC', 'res', 'asset-manifest.json'), null);
|
|
330
|
+
if (manifest && typeof manifest === 'object' && !Array.isArray(manifest)) {
|
|
331
|
+
for (const [slot, entry] of Object.entries(manifest)) {
|
|
332
|
+
if (!entry || typeof entry !== 'object') continue;
|
|
333
|
+
const url = entry.path || entry.Path || entry.file_path || entry.FilePath || entry.asset_path;
|
|
334
|
+
if (typeof url === 'string' && url) add({ id: 'manifest.' + slot, url, kind: kindFor(url, entry.asset_type), source: 'SPEC/res/asset-manifest.json', manifest: { slot, status: entry.status || null, category: entry.category || null } });
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return slots;
|
|
338
|
+
}
|
|
339
|
+
function collectSourceFindings(root, slots) {
|
|
340
|
+
const srcRoot = join(root, 'src');
|
|
341
|
+
const srcFiles = existsSync(srcRoot) ? walkFiles(srcRoot) : [];
|
|
342
|
+
const codeFiles = collectSourceCode(root);
|
|
343
|
+
const cleanSource = codeFiles.map((file) => stripComments(readText(file), extname(file))).join('\n');
|
|
344
|
+
const findings = [];
|
|
345
|
+
const imports = new Map();
|
|
346
|
+
const defaultImport = /import\s+([A-Za-z_$][\w$]*)\s+from\s+['"]([^'"]*configs\/([^'"]+)\.json)['"]/g;
|
|
347
|
+
const namespaceImport = /import\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"]([^'"]*configs\/([^'"]+)\.json)['"]/g;
|
|
348
|
+
const aliasImport = /import\s*\{\s*default\s+as\s+([A-Za-z_$][\w$]*)\s*\}\s*from\s+['"]([^'"]*configs\/([^'"]+)\.json)['"]/g;
|
|
349
|
+
for (const match of cleanSource.matchAll(defaultImport)) imports.set(match[3], match[1]);
|
|
350
|
+
for (const match of cleanSource.matchAll(namespaceImport)) imports.set(match[3], match[1]);
|
|
351
|
+
for (const match of cleanSource.matchAll(aliasImport)) imports.set(match[3], match[1]);
|
|
352
|
+
for (const slot of slots) {
|
|
353
|
+
if (!slot.configFile || !slot.path) { slot.usage = countExact(cleanSource, slot.url) > 0 ? 'direct' : slot.sceneAsset ? 'direct' : slot.manifest ? 'unknown' : 'unreferenced'; continue; }
|
|
354
|
+
const local = imports.get(slot.configFile);
|
|
355
|
+
if (!local) {
|
|
356
|
+
if (countExact(cleanSource, slot.url) > 0) slot.usage = 'direct';
|
|
357
|
+
else if (cleanSource.includes('configs/' + slot.configFile + '.json')) slot.usage = 'dynamic';
|
|
358
|
+
else slot.usage = 'unreferenced';
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
if (new RegExp('(?:Object\\s*\\.\\s*(?:entries|values|keys)|\\.\\.\\.)\\s*\\(?\\s*' + escapeRegExp(local) + '\\b').test(cleanSource)) { slot.usage = 'dynamic'; continue; }
|
|
362
|
+
const dotted = new RegExp(escapeRegExp(local) + '\\.' + slot.path.split('.').map(escapeRegExp).join('\\.') + '(?![A-Za-z0-9_])');
|
|
363
|
+
const indexed = new RegExp(escapeRegExp(local) + '\\s*\\[\\s*[\'"]' + escapeRegExp(slot.path) + '[\'"]\\s*\\]');
|
|
364
|
+
slot.usage = dotted.test(cleanSource) || indexed.test(cleanSource) ? 'direct' : 'unreferenced';
|
|
365
|
+
}
|
|
366
|
+
const sceneRefs = [];
|
|
367
|
+
if (existsSync(srcRoot)) for (const file of walkFiles(join(srcRoot, 'scenes'))) {
|
|
368
|
+
if (!file.endsWith('scene.ts')) continue;
|
|
369
|
+
for (const match of readText(file).matchAll(/['"]([^'"]*\/Game\/[^'"]+)['"]/g)) sceneRefs.push({ file: toPosix(relative(root, file)), url: match[1] });
|
|
370
|
+
}
|
|
371
|
+
const sceneValues = new Set(slots.filter((slot) => slot.sceneAsset).map((slot) => normalizeUrl(slot.url)));
|
|
372
|
+
for (const ref of sceneRefs) if (!sceneValues.has(normalizeUrl(ref.url))) findings.push({ id: 'SCENE_ASSET_UNREGISTERED', severity: 'error', confidence: 'high', title: 'Scene data references a /Game asset that is not registered', path: ref.file, evidence: { url: ref.url }, estimatedSavings: 0, fix: 'Regenerate configs/scene_assets.json through the export/build flow; the packager silently drops unregistered scene assets.', verify: 'Run npm run build and confirm the asset is present in the package.' });
|
|
373
|
+
for (const file of srcFiles) {
|
|
374
|
+
const rel = toPosix(relative(root, file));
|
|
375
|
+
if ((rel.includes('/scenes/') && rel.endsWith('/scene.ts')) || rel.endsWith('assets.json')) continue;
|
|
376
|
+
for (const match of readText(file).matchAll(HARDCODED_URL)) findings.push({ id: 'HARDCODED_URL', severity: 'error', confidence: 'high', title: 'Asset URL is written directly in source instead of configs/assets.json', path: rel, evidence: { url: match[2] }, estimatedSavings: 0, fix: 'Move the URL into configs/assets.json, import the JSON and consume resolveAssetUrl/loadGlbModel.', verify: 'Run npm run build; the asset wiring assertion must pass.' });
|
|
377
|
+
}
|
|
378
|
+
if (/\bGLTFLoader\b|\bDRACOLoader\b/.test(cleanSource)) findings.push({ id: 'BYPASS_GLB_LOADER', severity: 'warning', confidence: 'medium', title: 'Source uses a raw glTF loader for assets', path: 'source', evidence: { matches: ['GLTFLoader', 'DRACOLoader'].filter((name) => cleanSource.includes(name)) }, estimatedSavings: 0, fix: 'Use loadGlbModel from runtime/lightgame/1.1.0/tools/glb.mjs; a custom pipeline must keep URL rewriting and manager.addHandler on a per-load manager.', verify: 'Confirm LOD fallback, compressed-texture selection and PNG fallback.' });
|
|
379
|
+
const HOT_FUNCTION = /\b(?:function\s+(?:render|update|tick|animate|loop)\b|(?:render|update|tick|animate|loop)\s*[:=]\s*(?:async\s*)?(?:function|\())/;
|
|
380
|
+
const COLD_FUNCTION = /\b(?:function\s+(?:init|setup|boot|load|preload|start|create|enter)\b|(?:init|setup|boot|load|preload|start|create|enter)\s*[:=]\s*(?:async\s*)?(?:function|\())/;
|
|
381
|
+
const loadSites = [];
|
|
382
|
+
for (const match of cleanSource.matchAll(LOAD_CALLS)) {
|
|
383
|
+
const at = match.index || 0;
|
|
384
|
+
const context = cleanSource.slice(Math.max(0, at - 300), at + 200);
|
|
385
|
+
loadSites.push({ api: match[1], hot: HOT_FUNCTION.test(context) && !COLD_FUNCTION.test(context) });
|
|
386
|
+
}
|
|
387
|
+
for (const site of loadSites.filter((item) => item.hot)) findings.push({ id: 'LOAD_IN_HOT_PATH', severity: 'warning', confidence: 'low', title: 'Model/asset load appears inside a render or loop path', path: 'source', evidence: { api: site.api }, estimatedSavings: 0, fix: 'Load during init or scene entry, keep the handle, and reuse/copy the loaded result.', verify: 'Profile the representative frame and confirm no network/parse work during rendering.' });
|
|
388
|
+
if (loadSites.length && !/\bdispose\s*\(/.test(cleanSource)) findings.push({ id: 'NO_DISPOSE', severity: 'info', confidence: 'medium', title: 'No model/resource disposal path was found', path: 'source', evidence: { loadSites: loadSites.length }, estimatedSavings: 0, fix: 'Release owned geometries/materials/textures on scene switch or teardown, and clear the AssetLoader cache if used.', verify: 'Switch/reload the scene and confirm GPU resource counts do not grow monotonically.' });
|
|
389
|
+
for (const slot of slots) {
|
|
390
|
+
if (slot.usage === 'unreferenced') findings.push({ id: 'UNREFERENCED_SLOT', severity: 'warning', confidence: 'medium', title: 'Declared asset slot has no provable consumer', path: slot.source, evidence: { slot: slot.id, url: slot.url, kind: slot.kind }, estimatedSavings: 0, fix: 'Confirm intent, then remove the slot and its controls or wire it to a real consumer. If the JSON is consumed dynamically, do not delete.', verify: 'Run npm run build and exercise the owning feature.' });
|
|
391
|
+
else if (slot.usage === 'dynamic') findings.push({ id: 'UNKNOWN_USAGE', severity: 'info', confidence: 'low', title: 'Config is consumed dynamically; usage cannot be proven statically', path: slot.source, evidence: { slot: slot.id, url: slot.url }, estimatedSavings: 0, fix: 'Inspect the dynamic access manually; do not treat this slot as unused.', verify: 'Exercise the code path that enumerates the config.' });
|
|
392
|
+
if (!slot.controls && !slot.sceneAsset && !slot.manifest) findings.push({ id: 'CONTROLS_MISSING', severity: 'info', confidence: 'medium', title: 'Asset slot has no resource control metadata', path: slot.source, evidence: { slot: slot.id, url: slot.url }, estimatedSavings: 0, fix: 'Add type:resource and asset_type to the matching *.controls.json.', verify: 'Open the config panel and confirm the control appears.' });
|
|
393
|
+
}
|
|
394
|
+
const byUrl = new Map();
|
|
395
|
+
for (const slot of slots) { const key = normalizeUrl(slot.url); if (!byUrl.has(key)) byUrl.set(key, []); byUrl.get(key).push(slot); }
|
|
396
|
+
for (const [url, group] of byUrl) if (group.length > 1) findings.push({ id: 'DUPLICATE_URL', severity: 'info', confidence: 'high', title: 'The same asset URL is registered under multiple slots', path: group.map((slot) => slot.source).join(', '), evidence: { url, slots: group.map((slot) => slot.id) }, estimatedSavings: 0, fix: 'Keep one canonical slot or load once and share the result; retain aliases only if the panel needs them.', verify: 'Confirm every consumer still resolves the URL after consolidation.' });
|
|
397
|
+
return { findings, sourceFiles: codeFiles.length, usage: slots.map((slot) => ({ id: slot.id, url: slot.url, kind: slot.kind, source: slot.source, usage: slot.usage || 'unknown' })) };
|
|
398
|
+
}
|
|
399
|
+
export function scanProject(projectRoot, options) {
|
|
400
|
+
const settings = options || {};
|
|
401
|
+
const mode = settings.mode || 'auto';
|
|
402
|
+
const root = resolve(projectRoot);
|
|
403
|
+
const hasSource = existsSync(join(root, 'src')) && existsSync(join(root, 'configs'));
|
|
404
|
+
const hasBundle = existsSync(join(root, 'index.html')) && existsSync(join(root, 'assets'));
|
|
405
|
+
const resolvedMode = mode === 'auto' ? (hasSource ? 'source' : hasBundle ? 'bundle' : 'source') : mode;
|
|
406
|
+
const findings = [];
|
|
407
|
+
let assets = [];
|
|
408
|
+
let summary = {};
|
|
409
|
+
let usage = [];
|
|
410
|
+
|
|
411
|
+
if (resolvedMode === 'bundle') {
|
|
412
|
+
const result = summarizeBundle(root, buildBundleAssets(root), buildBundleCorpus(root), { hasUsageEvidence: hasUsageCode(root) });
|
|
413
|
+
assets = result.assets;
|
|
414
|
+
summary = result.summary;
|
|
415
|
+
findings.push(...result.findings);
|
|
416
|
+
} else {
|
|
417
|
+
const publicRoot = join(root, 'public');
|
|
418
|
+
const hasPublicAssets = existsSync(join(publicRoot, 'models')) || existsSync(join(publicRoot, 'audio')) || existsSync(join(publicRoot, 'textures'));
|
|
419
|
+
const slots = collectSourceSlots(root);
|
|
420
|
+
const sourceResult = collectSourceFindings(root, slots);
|
|
421
|
+
findings.push(...sourceResult.findings);
|
|
422
|
+
usage = sourceResult.usage;
|
|
423
|
+
summary = {
|
|
424
|
+
slots: slots.length,
|
|
425
|
+
used: usage.filter((item) => item.usage === 'direct').length,
|
|
426
|
+
dynamic: usage.filter((item) => item.usage === 'dynamic').length,
|
|
427
|
+
unreferenced: usage.filter((item) => item.usage === 'unreferenced').length,
|
|
428
|
+
sourceFiles: sourceResult.sourceFiles,
|
|
429
|
+
};
|
|
430
|
+
if (!slots.length) {
|
|
431
|
+
summary.note = hasPublicAssets
|
|
432
|
+
? 'No config asset slots; assets are mirrored under public/.'
|
|
433
|
+
: 'No config asset slots; source-level checks still ran.';
|
|
434
|
+
}
|
|
435
|
+
if (hasPublicAssets) {
|
|
436
|
+
const extraCorpus = [join(root, 'index.html'), join(root, 'dist', 'index.html'), join(root, 'zoo', 'apply_ui.mjs'), join(root, 'zoo', 'ui', 'index.dist.template.html'), ...collectFiles(root, ['zoo/ui'])].filter((file) => existsSync(file));
|
|
437
|
+
const publicCorpus = buildBundleCorpus(publicRoot) + ' ' + makeCorpus(extraCorpus);
|
|
438
|
+
const publicResult = summarizeBundle(publicRoot, buildBundleAssets(publicRoot), publicCorpus, { hasUsageEvidence: hasUsageCode(publicRoot) });
|
|
439
|
+
assets = publicResult.assets.map((asset) => Object.assign({}, asset, { path: 'public/' + asset.path }));
|
|
440
|
+
findings.push(...publicResult.findings.map((finding) => Object.assign({}, finding, { path: finding.path && finding.path !== 'bundle script' ? prefixPath(finding.path) : finding.path })));
|
|
441
|
+
summary = Object.assign({}, summary, {
|
|
442
|
+
publicFiles: publicResult.summary.files,
|
|
443
|
+
publicBytes: publicResult.summary.bytes,
|
|
444
|
+
publicUnusedBytes: publicResult.summary.unusedBytes,
|
|
445
|
+
publicGlbFiles: publicResult.summary.glbFiles,
|
|
446
|
+
publicAnimationBytes: publicResult.summary.animationBytes,
|
|
447
|
+
publicTextureBytes: publicResult.summary.textureBytes,
|
|
448
|
+
publicDuplicateGroups: publicResult.summary.duplicateGroups,
|
|
449
|
+
publicUsageEvidence: publicResult.summary.usageEvidence,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
findings.sort((a, b) => (b.estimatedSavings - a.estimatedSavings) || (['error', 'warning', 'info'].indexOf(a.severity) - ['error', 'warning', 'info'].indexOf(b.severity)));
|
|
454
|
+
return { schemaVersion: 1, project: root, mode: resolvedMode, generatedAt: new Date().toISOString(), summary: Object.assign({}, summary, { findings: findings.length, errorFindings: findings.filter((finding) => finding.severity === 'error').length, warningFindings: findings.filter((finding) => finding.severity === 'warning').length }), assets, usage, findings };
|
|
455
|
+
}
|
package/resources/targets/cursor/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
4
|
+
import { formatBytes } from './lib/glb.mjs';
|
|
5
|
+
import { scanProject } from './lib/scan.mjs';
|
|
6
|
+
|
|
7
|
+
function parseArgs(argv) {
|
|
8
|
+
const args = { project: process.env.CRAFT_PROJECT_DIR || process.cwd(), mode: 'auto', top: 15, out: null, json: false };
|
|
9
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
10
|
+
const item = argv[index];
|
|
11
|
+
if (item === '--project') args.project = argv[++index];
|
|
12
|
+
else if (item === '--mode') args.mode = argv[++index];
|
|
13
|
+
else if (item === '--top') args.top = Number(argv[++index]);
|
|
14
|
+
else if (item === '--out') args.out = argv[++index];
|
|
15
|
+
else if (item === '--json') args.json = true;
|
|
16
|
+
else if (item === '--help' || item === '-h') args.help = true;
|
|
17
|
+
else throw new Error('Unknown argument: ' + item);
|
|
18
|
+
}
|
|
19
|
+
if (!['auto', 'source', 'bundle'].includes(args.mode)) throw new Error('--mode must be auto, source or bundle');
|
|
20
|
+
if (!Number.isFinite(args.top) || args.top < 1) throw new Error('--top must be a positive number');
|
|
21
|
+
return args;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function reportPath(project, requested) {
|
|
25
|
+
const target = requested ? (isAbsolute(requested) ? requested : resolve(project, requested)) : join(project, '.asset-audit', 'report.json');
|
|
26
|
+
const rel = relative(project, target);
|
|
27
|
+
if (rel.startsWith('..') || isAbsolute(rel)) throw new Error('--out must stay inside the project');
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function printSummary(report, outPath, top) {
|
|
32
|
+
const lines = [];
|
|
33
|
+
const summary = report.summary;
|
|
34
|
+
lines.push('Asset usage audit (' + report.mode + ')');
|
|
35
|
+
if (report.mode === 'bundle') {
|
|
36
|
+
lines.push('Files: ' + summary.files + ' · ' + formatBytes(summary.bytes));
|
|
37
|
+
lines.push('Used: ' + formatBytes(summary.usedBytes) + ' · dynamic-family: ' + formatBytes(summary.familyBytes) + ' · unused: ' + formatBytes(summary.unusedBytes));
|
|
38
|
+
lines.push('GLB: ' + summary.glbFiles + ' models · animation ' + formatBytes(summary.animationBytes) + ' · textures ' + formatBytes(summary.textureBytes));
|
|
39
|
+
} else {
|
|
40
|
+
lines.push('Slots: ' + summary.slots + ' · used ' + (summary.used || 0) + ' · dynamic ' + (summary.dynamic || 0) + ' · unreferenced ' + (summary.unreferenced || 0));
|
|
41
|
+
if (summary.publicFiles) {
|
|
42
|
+
lines.push('Public assets: ' + summary.publicFiles + ' files · ' + formatBytes(summary.publicBytes) + ' · unused ' + formatBytes(summary.publicUnusedBytes));
|
|
43
|
+
lines.push('Public GLB: ' + summary.publicGlbFiles + ' models · animation ' + formatBytes(summary.publicAnimationBytes) + ' · textures ' + formatBytes(summary.publicTextureBytes));
|
|
44
|
+
}
|
|
45
|
+
if (summary.note) lines.push(summary.note);
|
|
46
|
+
}
|
|
47
|
+
lines.push('Findings: ' + summary.findings + ' (' + summary.errorFindings + ' errors, ' + summary.warningFindings + ' warnings)');
|
|
48
|
+
const visible = report.findings.slice(0, top);
|
|
49
|
+
if (visible.length) {
|
|
50
|
+
lines.push('Top findings:');
|
|
51
|
+
visible.forEach((finding, index) => {
|
|
52
|
+
const saving = finding.estimatedSavings > 0 ? ' · ~' + formatBytes(finding.estimatedSavings) + ' potential' : '';
|
|
53
|
+
lines.push(' ' + (index + 1) + '. ' + finding.id + ' · ' + finding.severity + ' · ' + finding.path + saving);
|
|
54
|
+
if (finding.evidence) lines.push(' ' + JSON.stringify(finding.evidence).slice(0, 240));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
lines.push('Report: ' + outPath);
|
|
58
|
+
console.log(lines.join('\n'));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
const args = parseArgs(process.argv.slice(2));
|
|
63
|
+
if (args.help) {
|
|
64
|
+
console.log('Usage: node scan-assets.mjs [--project DIR] [--mode auto|source|bundle] [--out FILE] [--top N] [--json]');
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
const project = resolve(args.project);
|
|
68
|
+
const outPath = reportPath(project, args.out);
|
|
69
|
+
const report = scanProject(project, { mode: args.mode });
|
|
70
|
+
mkdirSync(dirname(outPath), { recursive: true });
|
|
71
|
+
writeFileSync(outPath, JSON.stringify(report, null, 2) + '\n');
|
|
72
|
+
if (args.json) console.log(JSON.stringify(report, null, 2));
|
|
73
|
+
else printSummary(report, outPath, args.top);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error('FAIL — ' + (error && error.message ? error.message : String(error)));
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: export-config
|
|
3
|
+
description: Craft Cursor 项目专用;导出当前 3D / Three.js 工程的资源与可调参数配置;新增资源槽、修改配置、构建或上传前排查时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 3D / Three.js 配置导出
|
|
7
|
+
|
|
8
|
+
模板已自带 scripts/skill-modules/export-config,Vite 中 gameConfig() 与 lightgame() 并列。默认值写 configs/*.json,控件元数据写同名 *.controls.json;保持业务普通 JSON import。
|
|
9
|
+
|
|
10
|
+
在项目目录执行 `node "${CRAFT_SKILL_DIR}/scripts/export-config.mjs"`。MCP 的工程检查也通过 SDK hook 调用本工程已同步版本的本地技能入口;技能与普通 `npm run config:export` 共用项目内导出流程,不查找相邻工程的上下文。
|
|
11
|
+
|
|
12
|
+
脚本同步 @slot、assets.json 与资源控件,再导出 unified_data_control_config.json,保留已有有效覆盖值。导出后核实资源 slot 有真实消费者,参数修改能改变游戏,必要加载已成功。地址规则见 [AssetUrl](../../knowledge/AssetUrl.md)。
|
|
13
|
+
|
|
14
|
+
只有配置模块确实缺失或明确升级时,才执行 `node "${CRAFT_SKILL_DIR}/scripts/install.mjs" --project "${CRAFT_PROJECT_DIR}"`;它会覆盖该模块,先检查已有改动。API 以随技能 assets/tooling/*.d.mts 为准。
|
|
15
|
+
|
|
16
|
+
导出成功不等于玩法或画面通过。继续使用 craft_game_check 与 craft_game_review 验证本次最终状态。
|
package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
import { exportProjectConfig } from './project.mjs';
|
|
4
|
+
|
|
5
|
+
export async function runCli(args = process.argv.slice(2)) {
|
|
6
|
+
if ((args[0] ?? 'export-config') !== 'export-config') throw new Error('Usage: cli.mjs export-config [--project <directory>] [--check]');
|
|
7
|
+
let project = process.cwd(), check = false;
|
|
8
|
+
for (let index = 1; index < args.length; index++) {
|
|
9
|
+
if (args[index] === '--check') check = true;
|
|
10
|
+
else if (args[index] === '--project' && args[index + 1] && !args[index + 1].startsWith('--')) project = args[++index];
|
|
11
|
+
else throw new Error(`Invalid export-config option: ${args[index]}`);
|
|
12
|
+
}
|
|
13
|
+
const result = await exportProjectConfig(resolve(project), { check, onWarn: message => console.warn(`[LightGame config] ${message}`) });
|
|
14
|
+
console.log(`[LightGame] ${result.entries.length} controls ${result.changed ? 'exported' : 'unchanged'}`);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
19
|
+
runCli().catch(error => { console.error(`[LightGame config] ${error.message}`); process.exitCode = 1; });
|
|
20
|
+
}
|
package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ControlMetadata {
|
|
2
|
+
type?: 'int' | 'float' | 'number' | 'num_slider' | 'bool' | 'boolean' | 'switch' | 'enum' | 'dropdown' | 'string' | 'text' | 'color' | 'resource';
|
|
3
|
+
enabled?: boolean; expose?: boolean; title?: string; description?: string;
|
|
4
|
+
min?: number; max?: number; step?: number; unit?: string; alpha?: boolean;
|
|
5
|
+
options?: Array<string | number | {value: string | number; label?: string}>;
|
|
6
|
+
tab?: string; group?: string; priority?: number;
|
|
7
|
+
category?: string; subcategory?: string; asset_type?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ConfigEntry {
|
|
10
|
+
schema: string; enabled: boolean; title: string; description: string;
|
|
11
|
+
locator: { tab: string; group: string; priority: number };
|
|
12
|
+
control: Record<string, unknown> & { type: string; default: unknown; value?: unknown; origin?: unknown };
|
|
13
|
+
}
|
|
14
|
+
export interface ConfigOptions { onWarn?: (message: string) => void; cdnBase?: string }
|
|
15
|
+
export function normalizeAssetUrl(value: unknown, cdnBase?: string): string;
|
|
16
|
+
export function inferControl(value: unknown, metadata?: ControlMetadata): ConfigEntry['control'] | null;
|
|
17
|
+
export function validateControlValue(control: ConfigEntry['control'], value: unknown): boolean;
|
|
18
|
+
export function createConfigEntries(owner: string, data: object, metadata?: Record<string, ControlMetadata>, previous?: ConfigEntry[], options?: ConfigOptions): ConfigEntry[];
|
|
19
|
+
export function resolveConfig<T extends object>(owner: string, data: T, metadata?: Record<string, ControlMetadata>, entries?: ConfigEntry[], options?: ConfigOptions): T;
|
package/resources/targets/cursor/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function rewriteLibraryGlbMount(path){const value=String(path??"").trim();if(!value||/^(?:data:|blob:)/i.test(value))return value;const parts=value.match(/^([^?#]*)([?#].*)?$/);if(!parts)return value;const pathname=parts[1],rest=parts[2]??"";if(!/\.(?:glb|gltf)$/i.test(pathname))return value;if(pathname.startsWith("/Glb/Game/")||pathname.startsWith("Glb/Game/"))return value;if(pathname.startsWith("/Game/"))return`/Glb${pathname}${rest}`;if(pathname.startsWith("Game/"))return`Glb/${pathname}${rest}`;if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))try{const url=new URL(value);if(url.pathname.startsWith("/Game/")&&/\.(?:glb|gltf)$/i.test(url.pathname)){url.pathname=`/Glb${url.pathname}`;return url.href}}catch{}return value}__name(rewriteLibraryGlbMount,"rewriteLibraryGlbMount");function resolveAssetUrl(path,{cdnBaseUrl="",baseUrl}={}){const value=rewriteLibraryGlbMount(path);if(!value)throw new TypeError("Asset path must not be empty");if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))return value;const encoded=encodeURI(value).replace(/%25([\da-f]{2})/gi,"%$1");const localPrefix=/^(?:assets|game|res|cfg|fonts)\//.test(value);if(cdnBaseUrl&&!localPrefix&&(value.startsWith("/Game/")||value.startsWith("/Glb/")||!/^(?:\/|\.\.?\/)/.test(value))){return`${cdnBaseUrl.replace(/\/+$/,"")}/${encoded.replace(/^\/+/,"")}`}return baseUrl?new URL(encoded,baseUrl).href:encoded}__name(resolveAssetUrl,"resolveAssetUrl");var has=__name((value,key)=>Object.prototype.hasOwnProperty.call(value,key),"has");var record=__name(value=>value!==null&&typeof value==="object"&&!Array.isArray(value),"record");var equal=__name((a,b)=>typeof a===typeof b&&(typeof a==="number"?Math.abs(a-b)<1e-9:a===b),"equal");var colorPattern=/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i;var reserved=new Set(["__proto__","prototype","constructor"]);function assertKey(key,label){if(!key||key.includes(".")||reserved.has(key))throw new TypeError(`${label}: config keys must be nonempty, safe and contain no dots (${key})`)}__name(assertKey,"assertKey");function normalizeAssetUrl(value,cdnBase="https://file.craft.qq.com"){const path=String(value??"").trim().replaceAll("\\","/");return path?resolveAssetUrl(path,{cdnBaseUrl:cdnBase}):""}__name(normalizeAssetUrl,"normalizeAssetUrl");function inferControl(value,metadata={}){if(metadata.enabled===false||metadata.expose===false)return null;const kind=metadata.type??(typeof value==="number"?"number":typeof value==="boolean"?"boolean":typeof value==="string"&&colorPattern.test(value)?"color":void 0);if(!kind)return null;let control;switch(kind){case"int":case"float":case"number":case"num_slider":{if(typeof value!=="number"||!Number.isFinite(value))throw new TypeError("numeric controls require a finite numeric default");const span=Math.max(1,Math.abs(value)*2);const min=metadata.min??Math.min(0,value-span);const max=metadata.max??Math.max(1,value+span);const step=metadata.step??(kind==="int"||kind!=="float"&&Number.isInteger(value)?1:.01);if(![min,max,step].every(Number.isFinite)||min>max||step<=0||value<min||value>max)throw new TypeError("numeric min/max/step must be finite, contain the default, and step must be positive");control={type:"num_slider",default:value,min,max,step,unit:metadata.unit??""};if(kind==="int")control.integer=true;break}case"bool":case"boolean":case"switch":if(typeof value!=="boolean")throw new TypeError("switch controls require a boolean default");control={type:"switch",default:value};break;case"enum":case"dropdown":{const options=metadata.options?.map(option=>record(option)?{value:option.value,label:String(option.label??option.value)}:{value:option,label:String(option)});if(!options?.length||options.some(option=>!["string","number"].includes(typeof option.value))||new Set(options.map(option=>`${typeof option.value}:${option.value}`)).size!==options.length||!options.some(option=>equal(option.value,value)))throw new TypeError("dropdown options must be unique scalar values and contain the default");control={type:"dropdown",default:value,options};break}case"string":case"text":if(typeof value!=="string")throw new TypeError("text controls require a string default");control={type:"text",default:value};break;case"color":if(typeof value!=="string"||!colorPattern.test(value))throw new TypeError("color controls require a hexadecimal color default");control={type:"color",default:value,alpha:metadata.alpha??(value.length===5||value.length===9)};break;case"resource":if(typeof value!=="string")throw new TypeError("resource controls require a string default");control={type:"resource",default:value};for(const key of["category","subcategory","asset_type"])if(metadata[key]!==void 0)control[key]=metadata[key];break;default:throw new TypeError(`unsupported control type: ${kind}`)}return control}__name(inferControl,"inferControl");function validateControlValue(control,value){switch(control.type){case"num_slider":return typeof value==="number"&&Number.isFinite(value)&&value>=control.min&&value<=control.max&&(!control.integer||Number.isInteger(value));case"switch":return typeof value==="boolean";case"color":return typeof value==="string"&&colorPattern.test(value);case"dropdown":return control.options.some(option=>equal(option.value,value));case"text":case"resource":return typeof value==="string";default:return false}}__name(validateControlValue,"validateControlValue");function leaves(data,metadata,owner){if(!record(data)||!record(metadata))throw new TypeError(`${owner}: config and controls must be JSON objects`);const output=[];const seen=new Set;function walk(value,parts){if(Array.isArray(value))return;if(record(value)){for(const[key,child]of Object.entries(value)){assertKey(key,owner);walk(child,[...parts,key])}return}const path=parts.join(".");const meta=metadata[path]??{};if(!record(meta))throw new TypeError(`${owner}.${path}: controls metadata must be an object`);seen.add(path);try{const control=inferControl(value,meta);if(control)output.push({path,parts,control,meta,value})}catch(error){throw new TypeError(`${owner}.${path}: ${error.message}`)}}__name(walk,"walk");walk(data,[]);for(const key of Object.keys(metadata))if(!seen.has(key))throw new TypeError(`${owner}.${key}: control refers to a missing scalar field (arrays are not exposed)`);return output}__name(leaves,"leaves");function createConfigEntries(owner,data,metadata={},previous=[],options={}){assertKey(owner,"config filename");const oldBySchema=new Map((Array.isArray(previous)?previous:[]).map(item=>[item.schema,item]));return leaves(data,metadata,owner).map(({path,control,meta,value})=>{const schema=`${owner}.${path}`;const old=oldBySchema.get(schema);const oldControl=old?.control;let selected=value;let stale=oldControl?.previous_value;if(oldControl){const candidate=has(oldControl,"change_value")?oldControl.change_value:has(oldControl,"value")?oldControl.value:oldControl.default;const origin=has(oldControl,"origin")?oldControl.origin:oldControl.default;if(!equal(origin,value)&&equal(candidate,origin)){selected=value;stale=void 0}else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate)){selected=candidate;if(!equal(candidate,value))stale=void 0}else if(!equal(candidate,value)){stale=candidate;options.onWarn?.(`${schema}: saved override is incompatible with the current default or constraints; using code default`)}}return{schema,enabled:old?.enabled!==false,title:meta.title??old?.title??path,description:meta.description??old?.description??"",locator:{tab:meta.tab??owner,group:meta.group??path.split(".")[0],priority:meta.priority??0},control:{...control,...control.type==="resource"?Object.fromEntries(["category","subcategory","asset_type"].filter(key=>control[key]===void 0&&oldControl?.[key]!==void 0).map(key=>[key,oldControl[key]])):{},origin:value,value:selected,...stale!==void 0?{previous_value:stale}:{}}}})}__name(createConfigEntries,"createConfigEntries");function resolveConfig(owner,data,metadata={},entries=[],options={}){const result=JSON.parse(JSON.stringify(data));const index=new Map((Array.isArray(entries)?entries:[]).map(item=>[item.schema,item]));for(const{path,parts,control,value}of leaves(data,metadata,owner)){const item=index.get(`${owner}.${path}`);let selected=value;if(item?.enabled!==false&&item?.control){const stored=item.control;const candidate=has(stored,"change_value")?stored.change_value:has(stored,"value")?stored.value:stored.default;const origin=has(stored,"origin")?stored.origin:stored.default;if(!equal(origin,value)&&equal(candidate,origin))selected=value;else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate))selected=candidate;else options.onWarn?.(`${owner}.${path}: ignored incompatible saved override`)}if(control.type==="resource")selected=normalizeAssetUrl(selected,options.cdnBase);let parent=result;for(const key of parts.slice(0,-1))parent=parent[key];parent[parts.at(-1)]=selected}return result}__name(resolveConfig,"resolveConfig");export{createConfigEntries,inferControl,normalizeAssetUrl,resolveConfig,validateControlValue};
|