@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
|
@@ -3,57 +3,45 @@ import { randomBytes } from 'node:crypto';
|
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
4
|
import { sendJson, parseJsonBody } from '../core/http-utils.mjs';
|
|
5
5
|
|
|
6
|
-
export async function openControlPanel(platform,{ allowLocalAuth=true
|
|
6
|
+
export async function openControlPanel(platform,{ allowLocalAuth=true }={}) {
|
|
7
7
|
const csrf=randomBytes(32).toString('hex');
|
|
8
8
|
const template=await readFile(new URL('./control-panel.html',import.meta.url),'utf8');
|
|
9
|
-
let port,origin;
|
|
10
|
-
const secure=
|
|
11
|
-
res.setHeader('Content-Security-Policy',`default-src 'none'; script-src 'nonce-${csrf}'; style-src 'unsafe-inline'; connect-src 'self'; img-src 'self' data: blob:; frame-src
|
|
9
|
+
let port,origin,activeRequests=0;
|
|
10
|
+
const secure=res=>{
|
|
11
|
+
res.setHeader('Content-Security-Policy',`default-src 'none'; script-src 'nonce-${csrf}'; style-src 'unsafe-inline'; connect-src 'self'; img-src 'self' data: blob:; frame-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'`);
|
|
12
12
|
};
|
|
13
13
|
const server=http.createServer(async(req,res)=>{
|
|
14
|
+
activeRequests++;
|
|
15
|
+
try {
|
|
14
16
|
res.setHeader('Cache-Control','no-store');res.setHeader('X-Content-Type-Options','nosniff');res.setHeader('Referrer-Policy','no-referrer');
|
|
15
17
|
if(req.headers.host!==`127.0.0.1:${port}` || (req.headers.origin && req.headers.origin!==origin) || req.headers['sec-fetch-site']==='cross-site') {
|
|
16
18
|
req.resume();sendJson(res,403,{error:'Only same-origin requests are accepted'});return;
|
|
17
19
|
}
|
|
18
20
|
try {
|
|
19
21
|
const url=new URL(req.url,origin);
|
|
20
|
-
const page=/^\/publish\/([A-Za-z0-9_-]{43})$/.exec(url.pathname);
|
|
21
|
-
if(publishPanel && req.method==='GET' && page) {
|
|
22
|
-
const data=await publishPanel.document(page[1]);
|
|
23
|
-
const html=await readFile(new URL('publication-page.html',publicationDirectory),'utf8');
|
|
24
|
-
secure(res,data.runtime_url ? new URL(data.runtime_url).origin : undefined);
|
|
25
|
-
res.writeHead(200,{'Content-Type':'text/html; charset=utf-8'});
|
|
26
|
-
res.end(html.replaceAll('__CSRF__',csrf).replaceAll('__PUBLISH_CAP__',page[1]));return;
|
|
27
|
-
}
|
|
28
|
-
if(publishPanel && req.method==='GET' && url.pathname==='/publication-page.mjs') {
|
|
29
|
-
const script=await readFile(new URL('publication-page.mjs',publicationDirectory));
|
|
30
|
-
res.writeHead(200,{'Content-Type':'text/javascript; charset=utf-8'});res.end(script);return;
|
|
31
|
-
}
|
|
32
22
|
if(req.method==='GET' && url.pathname==='/') {
|
|
33
23
|
if(!allowLocalAuth) {sendJson(res,404,{error:'Update credentials in the host AI IDE Craft MCP settings and reconnect'});return;}
|
|
34
24
|
secure(res);res.writeHead(200,{'Content-Type':'text/html; charset=utf-8'});res.end(template.replaceAll('__CSRF__',csrf));return;
|
|
35
25
|
}
|
|
36
26
|
if(req.method==='GET' && url.pathname==='/data') {sendJson(res,200,await platform.status());return;}
|
|
37
|
-
const api=/^\/api\/publish\/([A-Za-z0-9_-]{43})\/(state|cover|prepare|review|submit|status|task)$/.exec(url.pathname);
|
|
38
27
|
const auth=allowLocalAuth && ['/login','/logout'].includes(url.pathname);
|
|
39
28
|
if(req.method==='POST') {
|
|
40
|
-
if(
|
|
29
|
+
if(!auth) {req.resume();sendJson(res,404,{error:'Not found'});return;}
|
|
41
30
|
if(req.headers.origin!==origin || req.headers['x-craft-csrf']!==csrf || req.headers['content-type']!=='application/json') {
|
|
42
31
|
req.resume();sendJson(res,403,{error:'Invalid local control request'});return;
|
|
43
32
|
}
|
|
44
|
-
const body=await parseJsonBody(req,
|
|
45
|
-
const result=
|
|
46
|
-
url.pathname==='/login' ? await platform.login(body.token) : platform.logout();
|
|
33
|
+
const body=await parseJsonBody(req,8192);
|
|
34
|
+
const result=url.pathname==='/login' ? await platform.login(body.token) : platform.logout();
|
|
47
35
|
sendJson(res,200,result);return;
|
|
48
36
|
}
|
|
49
|
-
if(publishPanel && api) {sendJson(res,200,await publishPanel.handle(api[1],api[2],req.method,url.searchParams));return;}
|
|
50
37
|
req.resume();sendJson(res,404,{error:'Not found'});
|
|
51
38
|
} catch(error) {
|
|
52
39
|
sendJson(res,Number.isInteger(error.status) && error.status>=400 && error.status<600 ? error.status : 400,
|
|
53
40
|
{error:error.message,platform:platform.base,...error.detail});
|
|
54
41
|
}
|
|
42
|
+
} finally { activeRequests--; }
|
|
55
43
|
});
|
|
56
44
|
await new Promise((resolve,reject)=>{server.once('error',reject);server.listen(0,'127.0.0.1',resolve);});
|
|
57
|
-
port=server.address().port;origin=`http://127.0.0.1:${port}`;
|
|
58
|
-
return {url:origin,close:async()=>{
|
|
45
|
+
port=server.address().port;origin=`http://127.0.0.1:${port}`;
|
|
46
|
+
return {url:origin,get activeRequests(){return activeRequests;},close:async()=>{server.closeAllConnections();await new Promise(resolve=>server.close(resolve));}};
|
|
59
47
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
2
4
|
import { mkdir, realpath, readFile } from 'node:fs/promises';
|
|
3
5
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -16,22 +18,23 @@ import { libraryCapabilities } from '../game-workflow/library-catalog.mjs';
|
|
|
16
18
|
import { checkGame, validateSteps } from '../game-workflow/check.mjs';
|
|
17
19
|
import { DraftUploads, draftUploadView } from '../game-workflow/draft-uploads.mjs';
|
|
18
20
|
import { DraftBindings } from '../game-workflow/draft-bindings.mjs';
|
|
19
|
-
import { Publications } from '../game-workflow/publications.mjs';
|
|
20
21
|
import { Previews } from '../preview/local-static-preview.mjs';
|
|
21
22
|
import { openControlPanel } from './control-panel.mjs';
|
|
22
|
-
import { createPublishPanel } from './publish-panel.mjs';
|
|
23
|
-
import { openPublicationPreview } from './publication-preview.mjs';
|
|
24
23
|
import { loadEngineResources, loadEngineResource } from '../game-workflow/engines.mjs';
|
|
25
24
|
import { assetCapabilities } from '../game-workflow/resource-catalog.mjs';
|
|
26
25
|
import { takeConnectorToken, ConnectorAuthStore, connectorLoginAction } from '../core/connector-auth.mjs';
|
|
27
26
|
import { generationFields, importFields, generationInputs, searchFields, importSource } from './asset-tools.mjs';
|
|
28
|
-
import { publicationTools } from './publication-tools.mjs';
|
|
29
27
|
import { clientIde } from '../integrations/hosts.mjs';
|
|
28
|
+
import { currentWork, withWork, guardWork } from '../game-workflow/work-scope.mjs';
|
|
29
|
+
import { getRuntimeIdentity } from '../integrations/runtime.mjs';
|
|
30
|
+
import { UpdateSession } from './update-session.mjs';
|
|
31
|
+
import { registerRuntimeConnection } from '../integrations/runtime-gc.mjs';
|
|
30
32
|
|
|
31
33
|
// Consume before any project/build subprocess can inherit the credential.
|
|
32
34
|
let connectorToken = takeConnectorToken();
|
|
33
35
|
const connectorAuth = connectorToken !== undefined;
|
|
34
36
|
const { version } = JSON.parse(await readFile(new URL('../../package.json',import.meta.url),'utf8'));
|
|
37
|
+
const runtimeIdentity={...await getRuntimeIdentity(fileURLToPath(new URL('../..',import.meta.url))),instance_id:randomUUID(),pid:process.pid,activation_mode:'next_mcp_start'};
|
|
35
38
|
await mkdir(getWorkspaceRoot(),{ recursive:true });
|
|
36
39
|
const root = await realpath(getWorkspaceRoot()), state = getUserDataDir(), resources = process.env.CRAFT_MCP_RESOURCES_DIR;
|
|
37
40
|
const store = new RequestStore(path.join(state,'requests'),root); await store.init();
|
|
@@ -54,22 +57,30 @@ const reviewed = new Set();
|
|
|
54
57
|
const uploadStore = new RequestStore(path.join(state,'uploads'),root); await uploadStore.init();
|
|
55
58
|
const resourcePaths = { capture:path.join(resources,'game_visual_qa.mjs'), evidence:path.join(path.dirname(uploadStore.directory),'checks') };
|
|
56
59
|
const drafts = new DraftUploads(platform,uploadStore,resourcePaths.evidence,new DraftBindings(getProjectBindingsDir(),root));
|
|
57
|
-
const publicationStore = new RequestStore(path.join(state,'publications'),root); await publicationStore.init();
|
|
58
|
-
const publications = new Publications(platform,publicationStore,drafts,resourcePaths.evidence);
|
|
59
60
|
const mutations = new Set();
|
|
60
61
|
let closing = false;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
let authInteraction=false;
|
|
63
|
+
async function validateWork(work,{preparing=false}={}) {
|
|
64
|
+
await leases.assert(work.name,work.work_id,{ready:!preparing,context_revision:work.context_revision});
|
|
65
|
+
if(!preparing) await projects.assertRevision(work.name,work.context_revision);
|
|
66
|
+
}
|
|
67
|
+
const panel=await openControlPanel(platform,{ allowLocalAuth:!connectorAuth });
|
|
68
|
+
function runtimeBusy({excludeUpdate=false}={}) {
|
|
69
|
+
if(platform.store.getSession().loggedIn) authInteraction=false;
|
|
70
|
+
const busy={work_count:leases.activeCount,task_count:tasks.activeCount,mutation_count:mutations.size,
|
|
71
|
+
interaction_count:panel.activeRequests+Number(authInteraction),
|
|
72
|
+
update_count:Math.max(0,updates.activeOperations-Number(excludeUpdate))};
|
|
73
|
+
return {...busy,can_reconnect:!closing && Object.values(busy).every(count=>count===0)};
|
|
74
|
+
}
|
|
75
|
+
const updates=new UpdateSession({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity,projects,host,workspace:root,platform:platform.base,busy:runtimeBusy});
|
|
76
|
+
let runtimeConnection;
|
|
77
|
+
if(process.env.CRAFT_INSTALLATION_FILE && !await updates.scopeError()) {
|
|
78
|
+
try { runtimeConnection=await registerRuntimeConnection({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity}); }
|
|
79
|
+
catch { process.stderr.write('[craft] Runtime cleanup is unavailable for this connection; MCP remains active.\n'); }
|
|
67
80
|
}
|
|
68
|
-
const publishPanel=createPublishPanel({ platform,projects,tasks,drafts,publications,checkedTask,mutate:mutateProject,viewTask,
|
|
69
|
-
coverDirectory:path.join(state,'publication-covers'),preview:async check=>openPublicationPreview(check,resourcePaths.evidence,undefined,{ assetOrigins:await assets.approvedResourceOrigins(check.name),platformOrigin:platform.base }) });
|
|
70
|
-
const panel=await openControlPanel(platform,{ allowLocalAuth:!connectorAuth,publishPanel });
|
|
71
81
|
function loginAction() {
|
|
72
82
|
if (connectorAuth) return connectorLoginAction();
|
|
83
|
+
authInteraction=true;
|
|
73
84
|
const url = panel.url;
|
|
74
85
|
return { status:'action_required',reason:'login',human_action_required:true,url,
|
|
75
86
|
user_message:`请点击[连接 Craft 账号](${url}),在本机页面输入 Token 后,回到这里说“继续”。Token 无需发送到聊天中。` };
|
|
@@ -77,11 +88,18 @@ function loginAction() {
|
|
|
77
88
|
const nameField = { name:{ type:'string', pattern:'^[a-z][a-z0-9-]{0,47}$', description:'Stable local project name. Reuse it for follow-up edits.' } };
|
|
78
89
|
const engineField = { engine:{ type:'string',enum:['js','js3d'],description:'Choose js for 2D/Phaser, js3d for 3D/Three.js. New games default to js; existing games keep their saved engine. Never change an existing game engine.' } };
|
|
79
90
|
const taskField = { task_id:{ type:'string' } };
|
|
80
|
-
const
|
|
81
|
-
const
|
|
91
|
+
const workField = {work_id:{type:'string',description:'Exact work_id from the completed prepare. Keep it for this editing work; release when finished.'}};
|
|
92
|
+
const workTools=new Set(['craft_assets_generate','craft_assets_search','craft_assets_import','craft_game_check','craft_game_review','craft_game_deliver','craft_game_upload','craft_preview_stop','craft_task_cancel']);
|
|
93
|
+
const draftFields = { ...nameField, check_task_id:{ type:'string', description:'ID of the passing check for this exact draft build. Reuse the same ID to recover an upload.' },
|
|
94
|
+
upload_mode:{type:'string',enum:['current_project','new_project'],description:'Defaults to current_project: append a version using local source/dist and make it current, without merging Web edits. Use new_project only when the user explicitly asks for a new cloud project; success switches the local binding.'},
|
|
95
|
+
request_key:{type:'string',pattern:'^[A-Za-z0-9_-]{1,80}$',description:'Required for new_project. Create a new key for an explicitly new upload operation; reuse the exact key, mode and check_task_id on retry or status queries.'} };
|
|
96
|
+
const tool = (name,description,properties={},required=[])=>({ name,description,inputSchema:{ type:'object',properties:{...properties,...(workTools.has(name)?workField:{})},required:[...required,...(workTools.has(name)?['work_id']:[])],additionalProperties:false },...(['craft_game_info','craft_update_check'].includes(name)?{annotations:{readOnlyHint:true,destructiveHint:false,idempotentHint:true}}:name==='craft_update'?{annotations:{readOnlyHint:false,destructiveHint:false}}:{}) });
|
|
82
97
|
const tools = [
|
|
83
|
-
tool('
|
|
84
|
-
tool('
|
|
98
|
+
tool('craft_update_check','Read-only check of the configured npm channel, actual running version, installed target and optional existing project compatibility. Never installs, writes receipts or updates project files. At the first Craft task in a session, check with its request_key. If update_available and automatic_update_enabled, call craft_update with the same key. A newer installed target takes effect at the next MCP start or user reconnect.',{...nameField,request_key:{type:'string'}}),
|
|
99
|
+
tool('craft_update','Download, verify and install a compatible newer release, preserving the running process and current work. mode=auto (default) respects the configured policy; manual is only for an explicit user update request. Pass an existing project name for compatibility checking and reuse the check request_key. pending_reconnect means installed, not running: wait for next MCP start or user reconnect, then verify actual version/build_id/active_verified and host scope with craft_game_info before new preparation. Do not reload automatically or replay paid operations. prepare(resume) then refreshes the project context and Skills.',{...nameField,request_key:{type:'string'},mode:{type:'string',enum:['auto','manual']}},['request_key']),
|
|
100
|
+
tool('craft_game_info','Read-only inspection of installed or project context, versions, integrity, preparation, occupancy and preview. Never updates or registers a project and never acquires editing ownership. full_integrity=true checks managed files without repairing. To edit, call prepare mode=create/resume; to inspect only, read existing files without prepare.',{...nameField,...engineField,full_integrity:{type:'boolean'}}),
|
|
101
|
+
tool('craft_game_prepare','Begin an editing work. create requires a new directory and installs dependencies; resume requires an existing Craft game, synchronizes compatible installed context and recovery entries without reseeding, installing dependencies or building. Reuse request_key for retries; pass work_id to inspect the same active work without upgrading it. Poll prepare completion, retain work_id/context_revision, and reread returned local context before editing. Release when finished.',{...nameField,...engineField,...workField,mode:{type:'string',enum:['create','resume']},request_key:{type:'string'}},['name','mode','request_key']),
|
|
102
|
+
tool('craft_game_release','Finish this editing work after all background tasks complete or are cancelled and cleaned up. Releases ownership without disconnecting MCP or stopping a preview. Does not accept or publish a game. Idempotent for the exact ended work_id.',{...nameField,...workField},['name','work_id']),
|
|
85
103
|
tool('craft_assets_generate','Generate and import 1 to 8 assets when selected by the current engine context and user requirements: image/image_edit, static_mesh, skeletal_mesh, music, video, sprite_sheet or animation (video_url + model_resource_id). Use assets[].kind; inspect craft_game_info.aigc for capabilities. Platform charges automatically. Reuse request_key after failures or restart; never repeat an uncertain paid submission with a new key. Poll craft_task_status and wire the returned config_file slots into the game.',{...nameField,...generationFields},['name']),
|
|
86
104
|
tool('craft_assets_search','Search the Craft asset library without generating assets. Read craft_game_info.library for categories matching the saved engine. Submit 1 to 8 slot/category/query entries; inspect candidates, scores, metadata and per-slot errors. Poll craft_task_status, then import chosen source=library with search_id/candidate_id. No arbitrary URLs or external search credentials.',{...nameField,...searchFields},['name','queries']),
|
|
87
105
|
tool('craft_assets_import','Import existing AIGC outputs by resource_id, or selected library candidates with source=library, search_id and candidate_id. One source per batch. Never generates assets. Preserves the original AIGC URL or library Path and updates engine configs/controls without downloading payloads. Poll craft_task_status.',{...nameField,...importFields},['name','assets']),
|
|
@@ -99,11 +117,8 @@ const tools = [
|
|
|
99
117
|
tool('craft_game_deliver','Prepare a verified preview after a current passing check and visual review. Craft does not launch the process. Run result.start.script with the external host terminal tool in the background, then poll craft_game_info(name).preview until running=true and snapshot matches this delivery. Verify the page before reporting its URL. The host or OS may reclaim it; restart using the returned command.',{
|
|
100
118
|
...taskField,visual_passed:{ type:'boolean' },visual_notes:{ type:'string',minLength:10,maxLength:2000 },
|
|
101
119
|
},['task_id','visual_passed','visual_notes']),
|
|
102
|
-
tool('craft_game_upload','
|
|
103
|
-
tool('
|
|
104
|
-
...draftFields,publication_id:{ type:'string' },
|
|
105
|
-
},['name']),
|
|
106
|
-
...publicationTools(nameField,tool),
|
|
120
|
+
tool('craft_game_upload','Before uploading, tell the user that local source/dist will become the current cloud version and Web edits not synced locally are not included; history remains available for rollback. Default: append to the bound project (create on first upload). Only explicit user requests select new_project. Poll craft_task_status; retry with the same check_task_id, upload_mode and request_key. On success report version_number (vN), appid and project_url; publication remains in Craft Web.',draftFields,['name','check_task_id']),
|
|
121
|
+
tool('craft_game_upload_status','Read the private upload receipt for this check, including the Craft Web project link when complete.',draftFields,['name','check_task_id']),
|
|
107
122
|
tool('craft_preview_stop','Stop this project host-launched preview and cancel pending starts, including an earlier session preview.',nameField,['name']),
|
|
108
123
|
tool('craft_auth_open','Check login first. Return a login URL only when unauthenticated; an authenticated account continues without a login URL. Image generation uses automatic platform billing. Never read credentials or automate login.'),
|
|
109
124
|
tool('craft_auth_status','Check the Craft account without exposing credentials.'),
|
|
@@ -111,23 +126,36 @@ const tools = [
|
|
|
111
126
|
];
|
|
112
127
|
// The connection and prepare result use the same maintained workflow; clients may omit initialize instructions from their model context.
|
|
113
128
|
const server = new Server({ name:'craft-local',version },{ capabilities:{ tools:{} },instructions:guide });
|
|
129
|
+
let connectionReady=Promise.resolve();
|
|
130
|
+
server.oninitialized=()=>{
|
|
131
|
+
if(closing) return;
|
|
132
|
+
connectionReady=(async()=>{
|
|
133
|
+
const confirmation=await updates.connected();
|
|
134
|
+
if(confirmation.status==='active_verified') {
|
|
135
|
+
try { await runtimeConnection?.collect(); }
|
|
136
|
+
catch { process.stderr.write('[craft] Runtime cleanup skipped; MCP remains active.\n'); }
|
|
137
|
+
}
|
|
138
|
+
})();
|
|
139
|
+
};
|
|
114
140
|
server.setRequestHandler(ListToolsRequestSchema,async()=>({ tools }));
|
|
115
141
|
function viewTask(task) {
|
|
116
|
-
if (
|
|
142
|
+
if (task.kind === 'upload') {
|
|
117
143
|
if (task.owner !== platform.account().user_id || task.platform !== platform.base) throw new Error('Draft task belongs to a different account or platform');
|
|
118
144
|
const { owner, platform:target, ...view } = task;
|
|
119
|
-
return
|
|
145
|
+
return view.result ? { ...view,result:draftUploadView({ ...view.result,platform:target }) } : view;
|
|
120
146
|
}
|
|
121
147
|
if (!task.result?.artifacts) return task;
|
|
122
|
-
const { artifacts,snapshot_id,...result } = task.result;
|
|
148
|
+
const { artifacts,snapshot_id,source_snapshot,...result } = task.result;
|
|
123
149
|
return { ...task,result };
|
|
124
150
|
}
|
|
125
151
|
async function checkedTask(id, name, resumeUpload = false) {
|
|
126
152
|
const task = await tasks.get(id);
|
|
127
153
|
if (task.kind !== 'check' || task.status !== 'completed' || !task.result?.gate?.passed) throw new Error('A completed passing game check is required');
|
|
128
154
|
if (name !== undefined && task.name !== name) throw new Error('Game check belongs to a different project');
|
|
155
|
+
const work=currentWork();
|
|
156
|
+
if(!work || work.name!==task.name) throw new Error('A prepared work for this project is required');
|
|
157
|
+
await validateWork(work);
|
|
129
158
|
const { project,engine } = await projects.describe(task.name);
|
|
130
|
-
await leases.acquire(task.name);
|
|
131
159
|
if (task.result.engine && task.result.engine !== engine) throw new Error('Game engine changed since verification');
|
|
132
160
|
if (tasks.busy(task.name) || (!resumeUpload && task.result.source !== await fingerprint(project))) throw new Error('Game changed since verification; check again');
|
|
133
161
|
return { task, project };
|
|
@@ -135,6 +163,7 @@ async function checkedTask(id, name, resumeUpload = false) {
|
|
|
135
163
|
server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
136
164
|
let lock;
|
|
137
165
|
try {
|
|
166
|
+
await connectionReady;
|
|
138
167
|
if (closing) throw new Error('Craft is shutting down');
|
|
139
168
|
const definition = tools.find(t=>t.name === request.params.name), args = request.params.arguments ?? {};
|
|
140
169
|
if (!definition) throw new Error('Unknown tool');
|
|
@@ -143,33 +172,86 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
143
172
|
if (!field || (field.type === 'integer' ? !Number.isSafeInteger(value) : field.type === 'array' ? !Array.isArray(value) : typeof value !== field.type) || (field.enum && !field.enum.includes(value))) throw new Error('Invalid argument: ' + key);
|
|
144
173
|
}
|
|
145
174
|
for (const key of definition.inputSchema.required) if (args[key] === undefined) throw new Error('Missing argument: ' + key);
|
|
146
|
-
|
|
175
|
+
let work, updateWarning;
|
|
176
|
+
const preparing=definition.name==='craft_game_prepare';
|
|
177
|
+
if(preparing) {
|
|
147
178
|
projects.file(args.name);
|
|
148
|
-
if
|
|
149
|
-
|
|
150
|
-
|
|
179
|
+
if(!args.work_id && !leases.hasRequest(args.name,args.request_key)) {
|
|
180
|
+
// Another work may still be creating the files inspected by the update check.
|
|
181
|
+
if((await leases.observe(args.name)).occupied) throw Object.assign(new Error('This project has an active work. Wait for it to finish and release before preparing another work.'),{detail:{code:'CRAFT_PROJECT_IN_USE'}});
|
|
182
|
+
const update=await updates.check({name:args.name,intent:args.mode,request_key:args.request_key});
|
|
183
|
+
if(closing) throw new Error('Craft is shutting down; project work was not started');
|
|
184
|
+
if(update.can_continue===false || ['pending_reconnect','incompatible','error'].includes(update.status)) {
|
|
185
|
+
const blocked={status:update.status,not_started:true,explicitly_not_started:true,reconnect_required:update.reconnect_required===true,update,
|
|
186
|
+
...(update.connection_handoff ? {connection_handoff:update.connection_handoff} : {}),
|
|
187
|
+
next:update.next ?? 'Resolve the update diagnostic, then retry this prepare with the same request_key. No project work was acquired.'};
|
|
188
|
+
return {content:[{type:'text',text:JSON.stringify(blocked)}]};
|
|
189
|
+
}
|
|
190
|
+
if (['update_failed','offline'].includes(update.status)) updateWarning=update;
|
|
191
|
+
}
|
|
192
|
+
work=await leases.acquire(args.name,{...args,host});
|
|
193
|
+
if(work.task_id) {
|
|
194
|
+
if(work.status==='active') await validateWork(work);
|
|
195
|
+
return {content:[{type:'text',text:JSON.stringify(viewTask(await tasks.get(work.task_id,0)))}]};
|
|
196
|
+
}
|
|
197
|
+
} else if(workTools.has(definition.name)) {
|
|
198
|
+
const task=args.task_id ? await tasks.get(args.task_id) : null;
|
|
199
|
+
const name=args.name??task?.name;
|
|
200
|
+
work=await leases.assert(name,args.work_id,{ready:definition.name!=='craft_task_cancel'});
|
|
201
|
+
if(definition.name==='craft_task_cancel' && task.work_id!==work.work_id) throw new Error('Cannot cancel a task belonging to another work');
|
|
202
|
+
if(definition.name!=='craft_task_cancel') await validateWork(work);
|
|
203
|
+
}
|
|
204
|
+
if(work) {
|
|
205
|
+
if(mutations.has(work.name) || (definition.name!=='craft_task_cancel' && tasks.busy(work.name))) throw new Error('Project has a running operation; wait or cancel it first');
|
|
206
|
+
mutations.add(work.name); lock=work.name;
|
|
151
207
|
}
|
|
208
|
+
return await withWork(work,work ? ()=>validateWork(work,{preparing:preparing || definition.name==='craft_task_cancel'}) : undefined,async()=>{
|
|
152
209
|
let result;
|
|
153
210
|
switch (definition.name) {
|
|
211
|
+
case 'craft_update_check': result=await updates.inspect(args); break;
|
|
212
|
+
case 'craft_update': result=await updates.install(args); break;
|
|
154
213
|
case 'craft_game_info': {
|
|
155
|
-
const
|
|
214
|
+
const occupancy=args.name ? await leases.observe(args.name) : undefined;
|
|
215
|
+
const project = args.name ? await projects.inspect(args.name,{full:args.full_integrity===true}) : undefined;
|
|
156
216
|
if (project && args.engine && args.engine !== project.engine) throw new Error('Project engine is fixed to ' + project.engine);
|
|
157
|
-
const selected = project
|
|
158
|
-
|
|
217
|
+
const selected = !project && args.engine ? await loadEngineResource(engines[args.engine].resources,args.engine,engines[args.engine].bundle.id,engines[args.engine].host) : undefined;
|
|
218
|
+
if(project) {
|
|
219
|
+
const after=await leases.observe(args.name);
|
|
220
|
+
if((after.occupied && after.status==='preparing') || (occupancy?.occupied && occupancy.status==='preparing')) project.preparation={status:'updating',reason:'A work is preparing context; query again after completion'};
|
|
221
|
+
else if(occupancy?.occupied!==after.occupied || occupancy?.generation!==after.generation) project.preparation={status:'updating',reason:'Work ownership changed during inspection; query again'};
|
|
222
|
+
else if(after.occupied && project.preparation.status==='ready') project.preparation.status='active';
|
|
223
|
+
if(project.preparation.status==='updating') project.integrity={status:'unchecked',reason:'Context changed during inspection; query again after preparation'};
|
|
224
|
+
}
|
|
225
|
+
const updateStatus=await updates.status();
|
|
226
|
+
result = { version, runtime:{...runtimeIdentity,busy:runtimeBusy(),activation:updateStatus.activation??{status:updateStatus.status}},update:updateStatus,host, workspace:root, workspace_layout:'<workspace>/<name>', platform:platform.base, engine:project?.engine ?? selected?.engine ?? null, supported_engines:Object.keys(engines),
|
|
159
227
|
context_binding:project?.context_binding,
|
|
228
|
+
version_status:project?.version_status,integrity:project?.integrity,preparation:project?.preparation,registration_required:project?.registration_required,occupancy,project_context:project?.project_context,
|
|
160
229
|
project:project?.project, preview:project ? await previews.status(project.project) : undefined,
|
|
161
|
-
llm:'external AI IDE host', images:'Craft platform', aigc:assetCapabilities(selected?.engine),library:libraryCapabilities(selected?.engine),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
instructions:selected?.instructions ?? guide, context:selected?.context ?? {workflow:bootstrapWorkflow,target:{host,scope:'bootstrap'}},
|
|
230
|
+
llm:'external AI IDE host', images:'Craft platform', aigc:assetCapabilities(selected?.engine),library:libraryCapabilities(selected?.engine),draft_upload:true,publish_in_web:true,
|
|
231
|
+
concurrency:{workspace_sessions:'multiple',project_works:1,readonly_queries:'unlocked',release:'craft_game_release(name, work_id); abnormal process exit expires within 30 seconds'},
|
|
232
|
+
lifecycle:{version:1,prepare_modes:['create','resume'],request_key_required:true,work_id_required:true,query_updates_context:false},
|
|
233
|
+
instructions:project ? 'Read-only query. For editing, prepare mode=resume, poll to completion, then read the returned local context and keep work_id until release. An inspection alone does not authorize editing.' : selected?.instructions ?? guide, context:project?.context ?? selected?.context ?? {workflow:bootstrapWorkflow,target:{host,scope:'bootstrap'}},
|
|
165
234
|
installed_contexts:Object.fromEntries(Object.entries(engines).map(([engine,entry])=>[engine,{host:entry.host ?? 'legacy',version:entry.bundle.version ?? null,bundle_id:entry.bundle.id}])) }; break;
|
|
166
235
|
}
|
|
167
|
-
case 'craft_game_prepare':
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
236
|
+
case 'craft_game_prepare': {
|
|
237
|
+
result=await tasks.start(args.name,'prepare',async signal=>{
|
|
238
|
+
try {
|
|
239
|
+
const project=await projects.prepare(args.name,args.engine,signal,{mode:args.mode,guard:()=>leases.assert(args.name,work.work_id,{ready:false})});
|
|
240
|
+
await guardWork();
|
|
241
|
+
if(project.created) await installProjectDependencies(project.project,undefined,signal);
|
|
242
|
+
const selected=await projects.resourcesFor(project);
|
|
243
|
+
await leases.update(args.name,work.work_id,{status:'active',context_revision:project.context_revision});
|
|
244
|
+
return {...project,...(updateWarning?{update_warning:updateWarning}:{}),work_id:work.work_id,workspace:root,instructions:selected.instructions,context:{...selected.context,...(project.context_sync?{sync:project.context_sync}:{})},next:'Read the returned project-local workflow, engine entrypoint and skill index now. Retain work_id/context_revision throughout editing and pass work_id to workflow tools. After completing or pausing edits, record progress and call craft_game_release. A later editing task must prepare mode=resume again; an info query never updates context.'};
|
|
245
|
+
} catch(error) {await leases.release(args.name,work.work_id,'failed').catch(()=>{}); throw error;}
|
|
246
|
+
});
|
|
247
|
+
await leases.update(args.name,work.work_id,{task_id:result.task_id});
|
|
248
|
+
if(updateWarning) result={...result,update_warning:updateWarning};
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
case 'craft_game_release': {
|
|
252
|
+
if(mutations.has(args.name) || tasks.busy(args.name)) throw new Error('Background work is running; wait or cancel and wait for cleanup before release');
|
|
253
|
+
result=await leases.release(args.name,args.work_id); break;
|
|
254
|
+
}
|
|
173
255
|
case 'craft_assets_generate': {
|
|
174
256
|
const inputs=generationInputs(args);
|
|
175
257
|
await projects.owned(args.name);
|
|
@@ -210,16 +292,15 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
210
292
|
case 'craft_task_status': result = viewTask(await tasks.get(args.task_id,args.wait_ms ?? 15000)); break;
|
|
211
293
|
case 'craft_task_cancel': {
|
|
212
294
|
const current = await tasks.get(args.task_id);
|
|
213
|
-
if (
|
|
214
|
-
await leases.
|
|
295
|
+
if (current.kind === 'upload') viewTask(current);
|
|
296
|
+
await leases.assert(current.name,args.work_id,{ready:false});
|
|
215
297
|
const task = await tasks.cancel(args.task_id);
|
|
216
298
|
result = viewTask(task);
|
|
217
299
|
if (['images','assets'].includes(task.kind)) {
|
|
218
300
|
try { result.remote = await assets.cancelRemote(task.name,task.request_keys); }
|
|
219
301
|
catch (error) { result.remote_cancellation_confirmed = false; result.remote_error = error.message; }
|
|
220
302
|
}
|
|
221
|
-
if (task.kind === 'upload') result.next = 'Check
|
|
222
|
-
if (task.kind === 'publish_submit') result.next = 'Query craft_game_publish_status with the original publication_id. Cancellation does not retract a remote review or public version.';
|
|
303
|
+
if (task.kind === 'upload') result.next = 'Check craft_game_upload_status before retrying. A remote draft may already exist.';
|
|
223
304
|
break;
|
|
224
305
|
}
|
|
225
306
|
case 'craft_game_review': {
|
|
@@ -240,52 +321,19 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
240
321
|
const status = await platform.status();
|
|
241
322
|
if (!status.authenticated) { result = loginAction(); break; }
|
|
242
323
|
// An already authorized upload resumes its frozen check, even after later source edits.
|
|
243
|
-
const resume = await drafts.hasRequest(args.name,args.check_task_id,status.user_id);
|
|
324
|
+
const resume = await drafts.hasRequest(args.name,args.check_task_id,status.user_id,args);
|
|
244
325
|
const { task } = await checkedTask(args.check_task_id,args.name,resume);
|
|
245
|
-
result = viewTask(await tasks.start(args.name,'upload',signal=>drafts.upload(task,status.user_id,signal),
|
|
246
|
-
{ owner:status.user_id, platform:platform.base, check_task_id:args.check_task_id }));
|
|
326
|
+
result = viewTask(await tasks.start(args.name,'upload',signal=>drafts.upload(task,status.user_id,signal,args),
|
|
327
|
+
{ owner:status.user_id, platform:platform.base, check_task_id:args.check_task_id,upload_mode:args.upload_mode ?? 'current_project',request_key:args.request_key }));
|
|
247
328
|
break;
|
|
248
329
|
}
|
|
249
|
-
case '
|
|
330
|
+
case 'craft_game_upload_status': {
|
|
250
331
|
projects.file(args.name);
|
|
251
|
-
if (Boolean(args.check_task_id) === Boolean(args.publication_id)) throw new Error('Supply exactly one of check_task_id or publication_id');
|
|
252
|
-
const status = await platform.status();
|
|
253
|
-
result = status.authenticated ? args.publication_id
|
|
254
|
-
? await publications.status(args.name,args.publication_id,status.user_id)
|
|
255
|
-
: await drafts.status(args.name,args.check_task_id,status.user_id) : loginAction();
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
case 'craft_game_publish_open': {
|
|
259
|
-
const status=await platform.status();
|
|
260
|
-
result=status.authenticated ? await publishPanel.open(args.name,args.check_task_id,args.publication_id) : loginAction(); break;
|
|
261
|
-
}
|
|
262
|
-
case 'craft_game_publish_options': {
|
|
263
332
|
const status = await platform.status();
|
|
264
|
-
result = status.authenticated ?
|
|
265
|
-
minimum_playtest_seconds:30,display_screenshots:{ minimum:1,maximum:5 },material_visibility:'public_on_upload' } : loginAction();
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
case 'craft_game_publish_prepare': {
|
|
269
|
-
const status = await platform.status();
|
|
270
|
-
if (!status.authenticated) { result = loginAction(); break; }
|
|
271
|
-
const { task,project } = await checkedTask(args.check_task_id,args.name,await drafts.hasRequest(args.name,args.check_task_id,status.user_id));
|
|
272
|
-
result = viewTask(await tasks.start(args.name,'publish_prepare',signal=>publications.prepare(task,project,args.materials,status.user_id,signal),
|
|
273
|
-
{ owner:status.user_id,platform:platform.base,check_task_id:args.check_task_id }));
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
case 'craft_game_publish_review': {
|
|
277
|
-
const status = await platform.status();
|
|
278
|
-
if (!status.authenticated) { result = loginAction(); break; }
|
|
279
|
-
return await publications.review(args.name,args.publication_id,status.user_id);
|
|
280
|
-
}
|
|
281
|
-
case 'craft_game_publish_submit': {
|
|
282
|
-
const status = await platform.status();
|
|
283
|
-
if (!status.authenticated) { result = loginAction(); break; }
|
|
284
|
-
result = viewTask(await tasks.start(args.name,'publish_submit',signal=>publications.submit(args.name,args.publication_id,args.revision,args.confirmed,status.user_id,signal),
|
|
285
|
-
{ owner:status.user_id,platform:platform.base,publication_id:args.publication_id }));
|
|
333
|
+
result = status.authenticated ? await drafts.status(args.name,args.check_task_id,status.user_id,undefined,args) : loginAction();
|
|
286
334
|
break;
|
|
287
335
|
}
|
|
288
|
-
case 'craft_preview_stop': await
|
|
336
|
+
case 'craft_preview_stop': await guardWork(); result = await previews.stop(await projects.owned(args.name)); break;
|
|
289
337
|
case 'craft_auth_open': {
|
|
290
338
|
const status = await platform.status();
|
|
291
339
|
result = !status.authenticated ? loginAction() :
|
|
@@ -298,19 +346,30 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
298
346
|
break;
|
|
299
347
|
}
|
|
300
348
|
case 'craft_auth_logout': {
|
|
349
|
+
authInteraction=false;
|
|
301
350
|
result = platform.logout();
|
|
302
351
|
if (connectorAuth) result.user_message = '本进程已退出登录。要移除宿主 AI IDE 保存的凭证,请在 MCP 凭证设置中断开或清除凭证;重新连接会再次注入。';
|
|
303
352
|
break;
|
|
304
353
|
}
|
|
305
354
|
}
|
|
355
|
+
if(work && !preparing && definition.name!=='craft_task_cancel') await guardWork();
|
|
306
356
|
return { content:[{ type:'text',text:JSON.stringify(result) }] };
|
|
357
|
+
});
|
|
307
358
|
} catch (error) { return { isError:true,content:[{ type:'text',text:JSON.stringify({ error:error.message,...error.detail }) }] }; }
|
|
308
359
|
finally { if (lock) mutations.delete(lock); }
|
|
309
360
|
});
|
|
310
|
-
|
|
311
|
-
|
|
361
|
+
let shutdownPromise;
|
|
362
|
+
function shutdown() {
|
|
363
|
+
if(shutdownPromise) return shutdownPromise;
|
|
312
364
|
closing = true;
|
|
313
|
-
|
|
365
|
+
shutdownPromise=(async()=>{
|
|
366
|
+
await updates.close();
|
|
367
|
+
await connectionReady.catch(()=>{});
|
|
368
|
+
await tasks.close(); await leases.close(); await panel.close(); await server.close();
|
|
369
|
+
try { await runtimeConnection?.close(); }
|
|
370
|
+
catch { process.stderr.write('[craft] Runtime cleanup skipped during shutdown.\n'); }
|
|
371
|
+
})();
|
|
372
|
+
return shutdownPromise;
|
|
314
373
|
}
|
|
315
374
|
for (const signal of ['SIGINT','SIGTERM']) process.once(signal,()=>{ void shutdown().then(()=>process.exit(0)); });
|
|
316
375
|
process.stdin.once('end',()=>{ void shutdown(); });
|
|
@@ -11,8 +11,14 @@ process.env.CLIENT_WORKSPACE_ROOT = workspace;
|
|
|
11
11
|
process.env.CRAFT_WEB_URL ??= pkg.craft.platform;
|
|
12
12
|
const profile = createHash('sha256').update(workspace + '\n' + process.env.CRAFT_WEB_URL).digest('hex').slice(0,16);
|
|
13
13
|
process.env.CLIENT_DATA_DIR ||= path.join(getAppDataRoot(),profile);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// A managed connection runs one complete package. Environment values left by
|
|
15
|
+
// an older installation must not attach another package's resources or tools.
|
|
16
|
+
const packagePaths={PLAYWRIGHT_PACKAGE_ROOT:fileURLToPath(new URL('../../node_modules/',import.meta.url)),
|
|
17
|
+
CRAFT_MCP_RESOURCES_DIR:fileURLToPath(new URL('../../resources/',import.meta.url))};
|
|
18
|
+
for(const [key,value] of Object.entries(packagePaths)) {
|
|
19
|
+
if(process.env.CRAFT_INSTALLATION_FILE) process.env[key]=value;
|
|
20
|
+
else process.env[key] ||= value;
|
|
21
|
+
}
|
|
16
22
|
// Select profile paths before loading the server and its credential store.
|
|
17
23
|
try { await import('./server.mjs'); }
|
|
18
24
|
catch (error) {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
3
|
+
import { loadEngineResources } from '../game-workflow/engines.mjs';
|
|
4
|
+
import { readContextLock, checkProjectCompatibility } from '../game-workflow/project-bundles.mjs';
|
|
5
|
+
import { checkForUpdate, readUpdateStatus, readInstallation, confirmActiveInstallation } from '../integrations/updates.mjs';
|
|
6
|
+
import { connectionHandoff } from '../integrations/connection-handoff.mjs';
|
|
7
|
+
|
|
8
|
+
// This connection owns one complete package for its entire lifetime. An
|
|
9
|
+
// installer probe or another connection can never replace its runtime identity.
|
|
10
|
+
export class UpdateSession {
|
|
11
|
+
constructor({installationFile, current, projects, host, workspace, platform, busy}) {
|
|
12
|
+
Object.assign(this,{installationFile,current,projects,host,workspace,platform,busy});
|
|
13
|
+
this.operations=new Set();
|
|
14
|
+
this.receipts=new Map();
|
|
15
|
+
this.closing=false;
|
|
16
|
+
}
|
|
17
|
+
get activeOperations() { return this.operations.size; }
|
|
18
|
+
run(operation) {
|
|
19
|
+
if(this.closing) return Promise.resolve({status:'error',code:'connection_closing',message:'Craft is shutting down; reconnect before starting new work',
|
|
20
|
+
current:this.current,can_continue:false,activation_required:false,explicitly_not_started:true});
|
|
21
|
+
const pending=Promise.resolve().then(operation);
|
|
22
|
+
this.operations.add(pending);
|
|
23
|
+
return pending.finally(()=>this.operations.delete(pending));
|
|
24
|
+
}
|
|
25
|
+
async close() {
|
|
26
|
+
this.closing=true;
|
|
27
|
+
// Installation/Skill/config commits and connection receipts must finish or
|
|
28
|
+
// roll back before the process acknowledges a graceful shutdown.
|
|
29
|
+
await Promise.allSettled([...this.operations]);
|
|
30
|
+
}
|
|
31
|
+
async scopeError() {
|
|
32
|
+
if(!this.installationFile) return null;
|
|
33
|
+
try {
|
|
34
|
+
const state=await readInstallation(this.installationFile);
|
|
35
|
+
const normalize=value=>{const resolved=path.resolve(value);return process.platform==='win32'?resolved.toLowerCase():resolved;};
|
|
36
|
+
if(state.host!==this.host || normalize(state.workspace)!==normalize(this.workspace) || new URL(state.platform).origin!==new URL(this.platform).origin) throw new Error('Craft installation host, workspace or platform differs from this connection; run install with the intended scope and reconnect');
|
|
37
|
+
return null;
|
|
38
|
+
} catch(error) {return {status:'error',code:'installation_scope_mismatch',message:error.message,current:this.current,can_continue:false,activation_required:false};}
|
|
39
|
+
}
|
|
40
|
+
async status() {
|
|
41
|
+
const error=await this.scopeError();if(error) return error;
|
|
42
|
+
if(this.connectionError) return this.connectionError;
|
|
43
|
+
return this.withHandoff({...await readUpdateStatus({installationFile:this.installationFile,current:this.current}),
|
|
44
|
+
...(this.last ? {last_check:this.last} : {})},{intent:'inspect'});
|
|
45
|
+
}
|
|
46
|
+
withHandoff(result,{intent='inspect',name,request_key,excludeUpdate=false}={}) {
|
|
47
|
+
if(!result.reconnect_required || !result.target || ['error','incompatible','migration_required'].includes(result.status)) return result;
|
|
48
|
+
const busy=this.busy?.({excludeUpdate});
|
|
49
|
+
const handoff=connectionHandoff({host:this.host,target:result.target,current:this.current,workspace:this.workspace,platform:this.platform,
|
|
50
|
+
busy,intent,name,requestKey:request_key});
|
|
51
|
+
return {...result,...(busy?{busy}:{}),connection_handoff:handoff,next:handoff.next};
|
|
52
|
+
}
|
|
53
|
+
connected() { return this.run(()=>this.confirmConnection()); }
|
|
54
|
+
async confirmConnection() {
|
|
55
|
+
if(!this.installationFile) return {status:'unmanaged'};
|
|
56
|
+
const error=await this.scopeError();if(error) return this.connectionError=error;
|
|
57
|
+
try {
|
|
58
|
+
const status=await readUpdateStatus({installationFile:this.installationFile,current:this.current});
|
|
59
|
+
if(status.status==='error') return this.connectionError=status;
|
|
60
|
+
if(status.activation?.status!=='active_verified') return this.withHandoff(status,{excludeUpdate:true});
|
|
61
|
+
return await confirmActiveInstallation({installationFile:this.installationFile,current:this.current});
|
|
62
|
+
}
|
|
63
|
+
catch(error) {
|
|
64
|
+
return this.connectionError={status:'error',code:'connection_verification_failed',message:error.message,current:this.current,
|
|
65
|
+
can_continue:false,activation_required:false,reconnect_required:true,explicitly_not_started:true};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
check(args={}) { return this.run(()=>this.checkCurrent(args)); }
|
|
69
|
+
inspect({name,request_key}={}) { return this.check({name,request_key,intent:'inspect'}); }
|
|
70
|
+
install({name,request_key,mode='auto'}={}) {
|
|
71
|
+
if(!request_key) throw new Error('Update request_key is required');
|
|
72
|
+
if(!['auto','manual'].includes(mode)) throw new Error('Invalid update mode');
|
|
73
|
+
return this.check({name,request_key,intent:mode==='manual'?'update':'auto'});
|
|
74
|
+
}
|
|
75
|
+
async checkCurrent({name,intent='inspect',request_key}={}) {
|
|
76
|
+
const error=await this.scopeError();if(error) return error;
|
|
77
|
+
if(this.connectionError) return this.connectionError;
|
|
78
|
+
if(name!==undefined) this.projects.file(name);
|
|
79
|
+
if(intent==='resume' && !name) throw new Error('Project name is required when checking a resume');
|
|
80
|
+
if(request_key!==undefined && !/^[a-zA-Z0-9._:-]{1,128}$/.test(request_key)) throw new Error('Invalid update request_key');
|
|
81
|
+
const project=name && ['inspect','resume','auto','update'].includes(intent) ? await this.projects.inspect(name) : null;
|
|
82
|
+
const projectCompatibility=project ? async packageRoot=>{
|
|
83
|
+
const {engines}=await loadEngineResources(path.join(packageRoot,'resources'),this.host);
|
|
84
|
+
const candidate=engines[project.engine];
|
|
85
|
+
await checkProjectCompatibility(project.project,candidate.bundle);
|
|
86
|
+
const lock=await readContextLock(project.project,project.engine);
|
|
87
|
+
if(lock?.schema>=2 && !isDeepStrictEqual(lock.compatibility,candidate.bundle.compatibility)) throw new Error('New Craft context is incompatible with this project; keep its engine and migrate explicitly');
|
|
88
|
+
const previous=lock?.contexts?.[this.host];
|
|
89
|
+
if(previous && previous.bundle_id!==candidate.bundle.id) {
|
|
90
|
+
const difference=candidate.bundle.version.split('.').map((value,i)=>Number(value)-Number(previous.version?.split('.')[i])).find(value=>value!==0)??0;
|
|
91
|
+
if(!Number.isFinite(difference)||difference<=0) throw new Error('Candidate context is older or has a conflicting version for this project');
|
|
92
|
+
}
|
|
93
|
+
} : undefined;
|
|
94
|
+
const result=await checkForUpdate({installationFile:this.installationFile,current:this.current,intent,
|
|
95
|
+
requestKey:request_key ? `${intent==='create'?'create':`${name??'global'}:${intent}`}:${request_key}` : undefined,projectCompatibility,
|
|
96
|
+
registryReceipt:request_key ? this.receipts.get(request_key) : undefined});
|
|
97
|
+
if(request_key && result.remote && result.source && result.checked_at) {
|
|
98
|
+
// Cache metadata, never a project's compatibility verdict. Different
|
|
99
|
+
// projects and preparation retries must be validated independently.
|
|
100
|
+
this.receipts.set(request_key,{source_key:JSON.stringify(result.source),remote:result.remote,checked_at:result.checked_at});
|
|
101
|
+
for(const [key,value] of this.receipts) if(Date.now()-Date.parse(value.checked_at)>=300000) this.receipts.delete(key);
|
|
102
|
+
while(this.receipts.size>128) this.receipts.delete(this.receipts.keys().next().value);
|
|
103
|
+
}
|
|
104
|
+
this.last=this.withHandoff(result,{intent,name,request_key,excludeUpdate:true});
|
|
105
|
+
return this.last;
|
|
106
|
+
}
|
|
107
|
+
}
|