@craft_eco/craft-mcp 0.1.28 → 0.1.29
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 +23 -17
- package/bin/craft-mcp.mjs +4 -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 +5 -0
- package/dist-server/game-workflow/context-state.mjs +67 -0
- package/dist-server/game-workflow/draft-uploads.mjs +3 -0
- 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 +246 -129
- 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 +86 -10
- package/dist-server/game-workflow/publications.mjs +5 -1
- package/dist-server/game-workflow/tasks.mjs +6 -1
- package/dist-server/game-workflow/work-scope.mjs +7 -0
- package/dist-server/integrations/config.mjs +145 -71
- package/dist-server/integrations/connection-handoff.mjs +42 -0
- package/dist-server/integrations/dsh-config.mjs +182 -0
- package/dist-server/integrations/files.mjs +54 -54
- package/dist-server/integrations/hosts.mjs +55 -35
- package/dist-server/integrations/install.mjs +205 -86
- package/dist-server/integrations/installation-state.mjs +84 -0
- package/dist-server/integrations/runtime-gc.mjs +188 -0
- package/dist-server/integrations/runtime.mjs +126 -72
- package/dist-server/integrations/updates.mjs +225 -0
- package/dist-server/integrations/version-policy.mjs +32 -0
- package/dist-server/mcp/control-panel.mjs +5 -2
- package/dist-server/mcp/publish-panel.mjs +7 -2
- package/dist-server/mcp/server.mjs +134 -26
- package/dist-server/mcp/start.mjs +8 -2
- package/dist-server/mcp/update-session.mjs +92 -0
- package/package.json +2 -2
- package/resources/context-filter-report.json +177 -0
- package/resources/craft-create/SKILL.md +19 -11
- package/resources/craft-update/SKILL.md +25 -0
- package/resources/targets/claude/js/bootstrap/SKILL.md +18 -0
- package/resources/targets/claude/js/context-filter-report.json +27 -0
- package/resources/targets/claude/js/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/claude/js/target.json +61 -0
- package/resources/targets/claude/js3d/bootstrap/SKILL.md +18 -0
- package/resources/targets/claude/js3d/context-filter-report.json +27 -0
- package/resources/targets/claude/js3d/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/claude/js3d/target.json +60 -0
- package/resources/targets/codebuddy/js/bootstrap/SKILL.md +5 -1
- package/resources/targets/codebuddy/js/context-filter-report.json +27 -0
- package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +18 -19
- 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 +10 -4
- package/resources/targets/codebuddy/js/target.json +1 -1
- package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +5 -1
- package/resources/targets/codebuddy/js3d/context-filter-report.json +27 -0
- package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +18 -19
- 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 +10 -4
- package/resources/targets/codebuddy/js3d/target.json +1 -1
- package/resources/targets/codex/js/bootstrap/SKILL.md +9 -1
- package/resources/targets/codex/js/context-filter-report.json +27 -0
- package/resources/targets/codex/js/craft-game-maker/SKILL.md +18 -19
- 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 +9 -1
- package/resources/targets/codex/js3d/context-filter-report.json +27 -0
- package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +18 -19
- 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 +18 -0
- package/resources/targets/cursor/js/context-filter-report.json +27 -0
- package/resources/targets/cursor/js/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/cursor/js/target.json +61 -0
- package/resources/targets/cursor/js3d/bootstrap/SKILL.md +18 -0
- package/resources/targets/cursor/js3d/context-filter-report.json +27 -0
- package/resources/targets/cursor/js3d/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/cursor/js3d/target.json +60 -0
- package/resources/targets/dsh/js/bootstrap/SKILL.md +18 -0
- package/resources/targets/dsh/js/context-filter-report.json +27 -0
- package/resources/targets/dsh/js/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/dsh/js/target.json +61 -0
- package/resources/targets/dsh/js3d/bootstrap/SKILL.md +18 -0
- package/resources/targets/dsh/js3d/context-filter-report.json +27 -0
- package/resources/targets/dsh/js3d/craft-game-maker/SKILL.md +76 -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 +13 -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 +18 -0
- package/resources/targets/kimi/js/context-filter-report.json +27 -0
- package/resources/targets/kimi/js/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/kimi/js/target.json +61 -0
- package/resources/targets/kimi/js3d/bootstrap/SKILL.md +18 -0
- package/resources/targets/kimi/js3d/context-filter-report.json +27 -0
- package/resources/targets/kimi/js3d/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/kimi/js3d/target.json +60 -0
- package/resources/targets/workbuddy/js/bootstrap/SKILL.md +24 -14
- package/resources/targets/workbuddy/js/context-filter-report.json +27 -0
- package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +18 -19
- 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 +29 -25
- 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 +19 -7
- package/resources/targets/workbuddy/js/target.json +1 -1
- package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +24 -14
- package/resources/targets/workbuddy/js3d/context-filter-report.json +27 -0
- package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +18 -19
- 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 +30 -26
- 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 +19 -7
- package/resources/targets/workbuddy/js3d/target.json +1 -1
- package/resources/targets/zcode/js/bootstrap/SKILL.md +18 -0
- package/resources/targets/zcode/js/context-filter-report.json +27 -0
- package/resources/targets/zcode/js/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/zcode/js/target.json +61 -0
- package/resources/targets/zcode/js3d/bootstrap/SKILL.md +18 -0
- package/resources/targets/zcode/js3d/context-filter-report.json +27 -0
- package/resources/targets/zcode/js3d/craft-game-maker/SKILL.md +76 -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 +13 -0
- package/resources/targets/zcode/js3d/target.json +60 -0
- package/vendor/craft-runtime/SOURCE.json +2 -2
- package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
- package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
- package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
- package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +0 -14
- package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +0 -9
- package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
- package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +0 -14
- package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +0 -12
- package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +0 -9
- package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +0 -9
- package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +0 -14
- package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +0 -12
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { mkdir } from 'node:fs/promises';
|
|
3
|
+
import lockfile from 'proper-lockfile';
|
|
4
|
+
import { readInstallation, readInstallationSnapshot, activationStatus, registryOrigin, installedSkillEntries, skillRuntimeIdentity, sameRuntimeIdentity, activationMode } from './installation-state.mjs';
|
|
5
|
+
import { compareVersions, requireForwardVersion, parseVersion } from './version-policy.mjs';
|
|
6
|
+
import { stageRegistryRuntime, getRuntimeIdentity, probeRuntime } from './runtime.mjs';
|
|
7
|
+
import { optionalFile, assertPlainPath, commitFiles } from './files.mjs';
|
|
8
|
+
import { hostPaths, hostEnvironment, installTargets } from './hosts.mjs';
|
|
9
|
+
import { craftConfig, mergeConfig } from './config.mjs';
|
|
10
|
+
import { assertDshSharedScope } from './dsh-config.mjs';
|
|
11
|
+
import { connectionHandoff } from './connection-handoff.mjs';
|
|
12
|
+
import os from 'node:os';
|
|
13
|
+
|
|
14
|
+
export { readInstallation } from './installation-state.mjs';
|
|
15
|
+
const pending = new Map();
|
|
16
|
+
const receiptLifetime = 5 * 60 * 1000;
|
|
17
|
+
|
|
18
|
+
function result(state, current, status, extra = {}) {
|
|
19
|
+
return { status, installation_id: state.id, source: state.source, policy: state.policy,
|
|
20
|
+
current, target: state.target, activation: activationStatus(current, state.target),
|
|
21
|
+
activation_mode: state.activation_mode ?? 'legacy_front', migration_required: state.schema === 1,
|
|
22
|
+
activation_required: false, reconnect_required: !sameRuntimeIdentity(current, state.target), explicitly_not_started: true, ...extra };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function readUpdateStatus({ installationFile, current }) {
|
|
26
|
+
if (!installationFile) return { status: 'unmanaged', current, activation_required: false, note: 'Run the standard Craft installer once to enable automatic updates.' };
|
|
27
|
+
try {
|
|
28
|
+
const state = await readInstallation(installationFile);
|
|
29
|
+
const activation = activationStatus(current, state.target);
|
|
30
|
+
return result(state, current, state.schema === 1 ? 'migration_required' : activation.status === 'active_verified' ? 'current' : activation.status, { last_check: state.last_check, can_continue: state.schema === 2 && activation.status === 'active_verified' });
|
|
31
|
+
} catch (error) { return { status: 'error', code: 'invalid_installation', message: error.message, current, can_continue: false, activation_required: false }; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function queryRegistry(source, { fetchImpl = fetch, timeoutMs = 15000 } = {}) {
|
|
35
|
+
const registry = registryOrigin(source.registry);
|
|
36
|
+
const url = new URL(encodeURIComponent(source.package) + '/' + encodeURIComponent(source.channel), registry);
|
|
37
|
+
const response = await fetchImpl(url, { headers: { accept: 'application/json' }, signal: AbortSignal.timeout(timeoutMs) });
|
|
38
|
+
if (!response.ok) throw Object.assign(new Error('npm version check failed (HTTP ' + response.status + ')'), { code: response.status >= 400 && response.status < 500 && ![408, 429].includes(response.status) ? 'INVALID_REGISTRY_METADATA' : 'REGISTRY_UNAVAILABLE' });
|
|
39
|
+
let data;
|
|
40
|
+
try { data = await response.json(); if (data.name !== source.package) throw new Error('npm returned a different package identity'); parseVersion(data.version); }
|
|
41
|
+
catch { throw Object.assign(new Error('npm returned invalid package identity metadata'), { code: 'INVALID_REGISTRY_METADATA' }); }
|
|
42
|
+
const integrity = data.dist?.integrity ?? (data.dist?.shasum && /^[a-f0-9]{40}$/.test(data.dist.shasum) ? 'sha1-' + Buffer.from(data.dist.shasum, 'hex').toString('base64') : undefined);
|
|
43
|
+
if (!integrity || !String(integrity).split(/\s+/).some(value => /^(sha512|sha384|sha256|sha1)-[A-Za-z0-9+/]+={0,2}$/.test(value))) throw Object.assign(new Error('npm package integrity metadata is missing or invalid'), { code: 'INVALID_REGISTRY_METADATA' });
|
|
44
|
+
return { package: data.name, version: data.version, integrity, node: data.engines?.node ?? null };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function within(root, file) {
|
|
48
|
+
const relative = path.relative(path.resolve(root), path.resolve(file));
|
|
49
|
+
return relative === '' || (!relative.startsWith('..' + path.sep) && relative !== '..' && !path.isAbsolute(relative));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function candidateSkills(state, identity) {
|
|
53
|
+
// Skill locations are explicit installer-owned destinations. Do not infer a
|
|
54
|
+
// user's home from a custom CODEX_HOME or rewrite unrelated host directories.
|
|
55
|
+
const changes = [];
|
|
56
|
+
for (const { name, file, marker } of installedSkillEntries(state)) {
|
|
57
|
+
await assertPlainPath(file);
|
|
58
|
+
const desired = await optionalFile(path.join(identity.package_root, 'resources', name, 'SKILL.md'));
|
|
59
|
+
if (desired === null) throw new Error('Updated runtime is missing the managed ' + name + ' Skill');
|
|
60
|
+
if (!desired.includes(marker)) throw new Error('Updated runtime has an invalid managed Skill marker');
|
|
61
|
+
const before = await optionalFile(file);
|
|
62
|
+
if (before && !before.includes(marker)) throw new Error('User-owned Skill preserved: ' + file);
|
|
63
|
+
changes.push({ file, before, after: desired });
|
|
64
|
+
}
|
|
65
|
+
return changes;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export async function confirmActiveInstallation({ installationFile, current }) {
|
|
69
|
+
if (!current?.instance_id) throw new Error('An actual runtime instance is required to confirm the installation');
|
|
70
|
+
const unlock = await lockfile.lock(installationFile, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
|
|
71
|
+
try {
|
|
72
|
+
const { state, text: before } = await readInstallationSnapshot(installationFile);
|
|
73
|
+
if (state.schema !== 2 || state.activation_mode !== activationMode) throw new Error('Legacy Craft installation requires the standard installer before reconnecting');
|
|
74
|
+
if (activationStatus(current, state.target).status !== 'active_verified') throw new Error('The current connection does not match the configured update target');
|
|
75
|
+
if (!sameRuntimeIdentity(await getRuntimeIdentity(current.package_root), state.target)) throw new Error('The running package files do not match the configured update target');
|
|
76
|
+
const skills = await candidateSkills(state, current);
|
|
77
|
+
if (skills.some(change => change.before !== change.after)) throw new Error('Installed global Skills differ from the configured runtime; run install again');
|
|
78
|
+
const previous = state.connection_verification;
|
|
79
|
+
const receipt = previous?.instance_id === current.instance_id ? previous : { version: current.version, build_id: current.build_id, instance_id: current.instance_id, confirmed_at: new Date().toISOString() };
|
|
80
|
+
const written = await commitFiles([{ file: installationFile, before, after: receipt === previous ? before : JSON.stringify({ ...state, connection_verification: receipt }, null, 2) + '\n' }]);
|
|
81
|
+
return { status: 'active_verified', ...receipt, ...written, scope: 'current_connection' };
|
|
82
|
+
} finally { await unlock(); }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function hostUpdate(state, installationFile, identity) {
|
|
86
|
+
await assertPlainPath(state.config);
|
|
87
|
+
if (state.host === 'dsh') assertDshSharedScope({ dshHome: path.dirname(state.config) });
|
|
88
|
+
const before = await optionalFile(state.config);
|
|
89
|
+
if (before === null) throw new Error('Craft host configuration is missing; run install again');
|
|
90
|
+
const existing = craftConfig(before, state.host, state.server_id);
|
|
91
|
+
const samePath = (a, b) => typeof a === 'string' && typeof b === 'string' && (process.platform === 'win32' ? path.resolve(a).toLowerCase() === path.resolve(b).toLowerCase() : path.resolve(a) === path.resolve(b));
|
|
92
|
+
const workspaceIndex = existing?.args?.indexOf('--workspace') ?? -1;
|
|
93
|
+
if (!existing || !samePath(existing.env?.CRAFT_INSTALLATION_FILE, installationFile) || existing.env?.CRAFT_CLIENT_IDE !== state.host ||
|
|
94
|
+
!samePath(workspaceIndex >= 0 ? existing.args[workspaceIndex + 1] : existing.env?.CLIENT_WORKSPACE_ROOT, state.workspace) ||
|
|
95
|
+
new URL(existing.env?.CRAFT_WEB_URL).origin !== new URL(state.platform).origin) throw new Error('Craft host configuration scope changed; run install with the intended scope');
|
|
96
|
+
const connection = { command: process.execPath, args: [identity.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace, CRAFT_INSTALLATION_FILE: installationFile } };
|
|
97
|
+
return { file: state.config, before, after: mergeConfig(before, state.host, connection, { previousName: state.server_id, enable: false }) };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function checkLocked({ installationFile, current, intent, requestKey, projectCompatibility, lookup, materialize, probe }) {
|
|
101
|
+
const snapshot = await readInstallationSnapshot(installationFile), before = snapshot.text;
|
|
102
|
+
let state = snapshot.state;
|
|
103
|
+
if (current.package !== state.source.package) return result(state, current, 'error', { code: 'package_mismatch', can_continue: false });
|
|
104
|
+
try { requireForwardVersion(state.target, current); }
|
|
105
|
+
catch (error) { return result(state, current, 'error', { code: 'target_not_forward', message: error.message, can_continue: false }); }
|
|
106
|
+
let pendingIncompatible;
|
|
107
|
+
const activationPending = !sameRuntimeIdentity(current, state.target);
|
|
108
|
+
if (activationPending) {
|
|
109
|
+
try { if (projectCompatibility) await projectCompatibility(state.target.package_root); }
|
|
110
|
+
catch (error) { pendingIncompatible = error.message; }
|
|
111
|
+
if (!pendingIncompatible && intent !== 'inspect') return result(state, current, 'pending_reconnect', { reconnect_required: true, can_continue: false });
|
|
112
|
+
}
|
|
113
|
+
let currentIncompatible = pendingIncompatible;
|
|
114
|
+
if (!currentIncompatible) {
|
|
115
|
+
try { if (projectCompatibility) await projectCompatibility(current.package_root); }
|
|
116
|
+
catch (error) { currentIncompatible = error.message; }
|
|
117
|
+
}
|
|
118
|
+
const keepCurrent = (status, extra = {}) => result(state, current, currentIncompatible ? 'incompatible' : status,
|
|
119
|
+
{ ...extra, can_continue: state.schema === 2 && !activationPending && !currentIncompatible && extra.can_continue !== false, ...(currentIncompatible ? { underlying_status: status, message: currentIncompatible } : {}) });
|
|
120
|
+
if (state.policy.mode === 'off' && !['inspect', 'update'].includes(intent)) return keepCurrent('disabled');
|
|
121
|
+
let remote, checkedAt;
|
|
122
|
+
const last = state.last_check;
|
|
123
|
+
if (requestKey && last?.request_key === requestKey && last.remote && Date.now() - Date.parse(last.checked_at) < receiptLifetime && last.source_key === JSON.stringify(state.source)) {
|
|
124
|
+
remote = last.remote; checkedAt = last.checked_at;
|
|
125
|
+
} else {
|
|
126
|
+
try { remote = await lookup(state.source); checkedAt = new Date().toISOString(); }
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (error.code === 'INVALID_REGISTRY_METADATA') return result(state, current, 'error', { code: 'invalid_registry_metadata', message: error.message, can_continue: false });
|
|
129
|
+
// Network failure is an unknown remote state, never proof of latest.
|
|
130
|
+
return keepCurrent('offline', { checked_at: new Date().toISOString(), remote_status: 'unknown', message: error.message, can_continue: state.schema === 2 && !currentIncompatible && !activationPending && state.policy.offline === 'allow-existing' });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
if (remote.package !== state.source.package) throw new Error('npm package identity mismatch');
|
|
135
|
+
parseVersion(remote.version);
|
|
136
|
+
} catch (error) { return result(state, current, 'error', { code: 'invalid_registry_identity', message: error.message, can_continue: false }); }
|
|
137
|
+
const receipt = { checked_at: checkedAt, ...(requestKey ? { request_key: requestKey } : {}), source_key: JSON.stringify(state.source), remote };
|
|
138
|
+
// A staged target can be unsuitable for this particular project. Keep it as
|
|
139
|
+
// the minimum version while looking for a newer compatible replacement.
|
|
140
|
+
const comparison = compareVersions(remote.version, state.target.version);
|
|
141
|
+
if (comparison === 0 && state.target.origin?.kind === 'npm' && state.target.origin.registry === state.source.registry && state.target.origin.integrity !== remote.integrity) {
|
|
142
|
+
return result(state, current, 'error', { code: 'same_version_integrity_changed', checked_at: checkedAt, remote, message: 'The registry reports different bytes for an installed package version; automatic replacement refused', can_continue: false });
|
|
143
|
+
}
|
|
144
|
+
if (comparison <= 0 || intent === 'inspect') {
|
|
145
|
+
const after = { ...state, last_check: receipt };
|
|
146
|
+
await commitFiles([{ file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }]);
|
|
147
|
+
state = after;
|
|
148
|
+
if (currentIncompatible && comparison <= 0) return keepCurrent(comparison < 0 ? 'local_ahead' : 'current', { checked_at: checkedAt, remote });
|
|
149
|
+
const remoteStatus = comparison < 0 ? 'local_ahead' : comparison === 0 ? 'current' : 'available';
|
|
150
|
+
return result(after, current, state.schema === 1 && comparison <= 0 ? 'migration_required' : activationPending && comparison <= 0 ? 'pending_reconnect' : remoteStatus, { checked_at: checkedAt, remote,
|
|
151
|
+
...(activationPending ? { remote_status: remoteStatus } : {}),
|
|
152
|
+
...(comparison === 0 ? { remote_build_status: state.target.origin?.integrity === remote.integrity ? 'integrity_matches' : 'not_compared_local_install' } : {}),
|
|
153
|
+
...(currentIncompatible ? { current_compatibility: { status: 'incompatible', message: currentIncompatible } } : {}), can_continue: state.schema === 2 && !currentIncompatible && !activationPending });
|
|
154
|
+
}
|
|
155
|
+
const runtimeRoot = state.runtime_root;
|
|
156
|
+
if (!path.isAbsolute(runtimeRoot ?? '')) return result(state, current, 'error', { code: 'invalid_runtime_root', can_continue: false });
|
|
157
|
+
await mkdir(runtimeRoot, { recursive: true });
|
|
158
|
+
const unlock = await lockfile.lock(runtimeRoot, { stale: 120000, retries: { retries: 20, minTimeout: 250, maxTimeout: 1000 } });
|
|
159
|
+
try {
|
|
160
|
+
const runtime = await materialize(state.source, remote, runtimeRoot);
|
|
161
|
+
const identity = await getRuntimeIdentity(runtime.package_root ?? path.resolve(path.dirname(runtime.entry), '..'));
|
|
162
|
+
if (!within(runtimeRoot, identity.package_root) || identity.package !== state.source.package || identity.version !== remote.version) throw new Error('Candidate runtime identity/path mismatch');
|
|
163
|
+
requireForwardVersion(identity, state.target);
|
|
164
|
+
if (projectCompatibility) {
|
|
165
|
+
try { await projectCompatibility(identity.package_root); }
|
|
166
|
+
catch (error) { return result(state, current, 'incompatible', { checked_at: checkedAt, remote, message: error.message, can_continue: false }); }
|
|
167
|
+
}
|
|
168
|
+
const verified = await probe({ command: process.execPath, args: [identity.entry, '--workspace', state.workspace], env: { CRAFT_CLIENT_IDE: state.host, CRAFT_WEB_URL: state.platform, CLIENT_WORKSPACE_ROOT: state.workspace } },
|
|
169
|
+
{ version: identity.version, build_id: identity.build_id, host: state.host, workspace: state.workspace, platform: state.platform });
|
|
170
|
+
if (verified.runtime?.activation_mode !== activationMode) throw new Error('Candidate runtime does not support activation at the next MCP start');
|
|
171
|
+
const skillChanges = await candidateSkills(state, identity), configChange = await hostUpdate(state, installationFile, identity);
|
|
172
|
+
const target = { ...identity, origin: { kind: 'npm', registry: state.source.registry, integrity: remote.integrity } };
|
|
173
|
+
const after = { ...state, schema: 2, activation_mode: activationMode, anchor: identity, target, skills_runtime: skillRuntimeIdentity(identity), last_check: receipt, updated_at: new Date().toISOString() };
|
|
174
|
+
delete after.connection_verification;
|
|
175
|
+
await commitFiles([...skillChanges, { file: installationFile, before, after: JSON.stringify(after, null, 2) + '\n' }, configChange]);
|
|
176
|
+
state = after;
|
|
177
|
+
return result(state, current, 'pending_reconnect', { checked_at: checkedAt, remote, reconnect_required: true, can_continue: false, verified: { ...verified, scope: 'standalone_probe' } });
|
|
178
|
+
} catch (error) { return result(state, current, 'error', { checked_at: checkedAt, remote, code: 'candidate_rejected', message: error.message, can_continue: false }); }
|
|
179
|
+
finally { await unlock(); }
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export async function checkForUpdate({ installationFile, current, intent = 'inspect', requestKey, projectCompatibility, lookup = queryRegistry, materialize = stageRegistryRuntime, probe = probeRuntime }) {
|
|
183
|
+
if (!installationFile) return { status: 'unmanaged', current, can_continue: true, activation_required: false, note: 'Install Craft once to enable automatic updates.' };
|
|
184
|
+
if (!['inspect', 'create', 'resume', 'update'].includes(intent)) throw new Error('Invalid update intent');
|
|
185
|
+
// Serialize per installation across processes. A shared promise only merges
|
|
186
|
+
// the same logical request in this process; a later work still checks npm.
|
|
187
|
+
const key = requestKey ? JSON.stringify([installationFile, current.build_id, current.instance_id, intent, requestKey]) : Symbol('unkeyed update');
|
|
188
|
+
if (pending.has(key)) return pending.get(key);
|
|
189
|
+
const operation = (async () => {
|
|
190
|
+
let unlock;
|
|
191
|
+
try {
|
|
192
|
+
unlock = await lockfile.lock(installationFile, { stale: 120000, retries: { retries: 30, minTimeout: 100, maxTimeout: 500 } });
|
|
193
|
+
return await checkLocked({ installationFile, current, intent, requestKey, projectCompatibility, lookup, materialize, probe });
|
|
194
|
+
} catch (error) { return { status: 'error', code: 'update_failed', message: error.message, current, can_continue: false, activation_required: false }; }
|
|
195
|
+
finally { await unlock?.(); }
|
|
196
|
+
})();
|
|
197
|
+
pending.set(key, operation);
|
|
198
|
+
try { return await operation; } finally { if (pending.get(key) === operation) pending.delete(key); }
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export async function runUpdateCommand(args) {
|
|
202
|
+
const [command, ...rest] = args, options = {};
|
|
203
|
+
for (let i = 0; i < rest.length; i += 2) {
|
|
204
|
+
const key = rest[i]?.replace(/^--/, '');
|
|
205
|
+
if (rest[i] !== '--ide' || !rest[i + 1] || Object.hasOwn(options, key)) throw new Error('Use craft-mcp ' + command + ' --ide <host>');
|
|
206
|
+
options[key] = rest[i + 1];
|
|
207
|
+
}
|
|
208
|
+
const results = [];
|
|
209
|
+
for (const host of installTargets(options.ide)) {
|
|
210
|
+
const paths = hostPaths(os.homedir(), host, process.env.CODEX_HOME, hostEnvironment());
|
|
211
|
+
await assertPlainPath(paths.config);
|
|
212
|
+
assertDshSharedScope(paths);
|
|
213
|
+
const connection = craftConfig(await optionalFile(paths.config) ?? '', host);
|
|
214
|
+
const installationFile = connection?.env?.CRAFT_INSTALLATION_FILE;
|
|
215
|
+
if (!installationFile) throw new Error(host + ': Install Craft once before using automatic updates');
|
|
216
|
+
const state = await readInstallation(installationFile);
|
|
217
|
+
const current = await getRuntimeIdentity(state.target.package_root);
|
|
218
|
+
const update = await checkForUpdate({ installationFile, current, intent: command === 'update' ? 'update' : 'inspect', requestKey: 'cli-' + Date.now() });
|
|
219
|
+
// A CLI can inspect configured files, but cannot prove a host connection.
|
|
220
|
+
results.push({ host, ...update, activation: { status: 'pending_connection_verification', expected: update.target }, can_continue: false, scope: 'configured_runtime', note: 'Call craft_game_info in the actual host connection to confirm activation.',
|
|
221
|
+
...(!['error','incompatible','migration_required'].includes(update.status) ? {connection_handoff:connectionHandoff({host,target:update.target,workspace:state.workspace,platform:state.platform,intent:command==='update'?'update':'inspect'})} : {}) });
|
|
222
|
+
if (['error', 'incompatible'].includes(update.status)) process.exitCode = 1;
|
|
223
|
+
}
|
|
224
|
+
process.stdout.write(JSON.stringify({ hosts: results }, null, 2) + '\n');
|
|
225
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const pattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
2
|
+
|
|
3
|
+
export function parseVersion(value) {
|
|
4
|
+
const match = typeof value === 'string' && pattern.exec(value);
|
|
5
|
+
if (!match) throw new Error('Invalid Craft version: ' + value);
|
|
6
|
+
const numbers = match.slice(1, 4).map(Number), prerelease = match[4]?.split('.') ?? [];
|
|
7
|
+
if (numbers.some(number => !Number.isSafeInteger(number)) || prerelease.some(part => /^\d+$/.test(part) && (part.length > 1 && part[0] === '0'))) throw new Error('Invalid Craft version: ' + value);
|
|
8
|
+
return { numbers, prerelease };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function compareVersions(left, right) {
|
|
12
|
+
const a = parseVersion(left), b = parseVersion(right);
|
|
13
|
+
for (let i = 0; i < 3; i++) if (a.numbers[i] !== b.numbers[i]) return a.numbers[i] < b.numbers[i] ? -1 : 1;
|
|
14
|
+
if (!a.prerelease.length || !b.prerelease.length) return a.prerelease.length === b.prerelease.length ? 0 : a.prerelease.length ? -1 : 1;
|
|
15
|
+
for (let i = 0; i < Math.max(a.prerelease.length, b.prerelease.length); i++) {
|
|
16
|
+
const x = a.prerelease[i], y = b.prerelease[i];
|
|
17
|
+
if (x === y) continue;
|
|
18
|
+
if (x === undefined || y === undefined) return x === undefined ? -1 : 1;
|
|
19
|
+
const xn = /^\d+$/.test(x), yn = /^\d+$/.test(y);
|
|
20
|
+
if (xn && yn) return BigInt(x) < BigInt(y) ? -1 : 1;
|
|
21
|
+
if (xn !== yn) return xn ? -1 : 1;
|
|
22
|
+
return x < y ? -1 : 1;
|
|
23
|
+
}
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function requireForwardVersion(next, previous) {
|
|
28
|
+
if (!previous) return;
|
|
29
|
+
const comparison = compareVersions(next.version, previous.version);
|
|
30
|
+
if (comparison < 0) throw new Error('Craft downgrade refused: ' + previous.version + ' -> ' + next.version);
|
|
31
|
+
if (comparison === 0 && previous.build_id && next.build_id && previous.build_id !== next.build_id) throw new Error('Craft same-version build replacement refused; publish a new version');
|
|
32
|
+
}
|
|
@@ -6,11 +6,13 @@ import { sendJson, parseJsonBody } from '../core/http-utils.mjs';
|
|
|
6
6
|
export async function openControlPanel(platform,{ allowLocalAuth=true,publishPanel,publicationDirectory=new URL('./',import.meta.url) }={}) {
|
|
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;
|
|
9
|
+
let port,origin,activeRequests=0;
|
|
10
10
|
const secure=(res,frameOrigin)=>{
|
|
11
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 ${frameOrigin || "'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;
|
|
@@ -52,8 +54,9 @@ export async function openControlPanel(platform,{ allowLocalAuth=true,publishPan
|
|
|
52
54
|
sendJson(res,Number.isInteger(error.status) && error.status>=400 && error.status<600 ? error.status : 400,
|
|
53
55
|
{error:error.message,platform:platform.base,...error.detail});
|
|
54
56
|
}
|
|
57
|
+
} finally { activeRequests--; }
|
|
55
58
|
});
|
|
56
59
|
await new Promise((resolve,reject)=>{server.once('error',reject);server.listen(0,'127.0.0.1',resolve);});
|
|
57
60
|
port=server.address().port;origin=`http://127.0.0.1:${port}`;publishPanel?.bindOrigin(origin);
|
|
58
|
-
return {url:origin,close:async()=>{await publishPanel?.close();server.closeAllConnections();await new Promise(resolve=>server.close(resolve));}};
|
|
61
|
+
return {url:origin,get activeRequests(){return activeRequests;},close:async()=>{await publishPanel?.close();server.closeAllConnections();await new Promise(resolve=>server.close(resolve));}};
|
|
59
62
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomBytes, randomUUID, createHash } from 'node:crypto';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { currentWork } from '../game-workflow/work-scope.mjs';
|
|
3
4
|
import { mkdir,writeFile,rm,lstat,realpath } from 'node:fs/promises';
|
|
4
5
|
import { privateDirectory } from '../game-workflow/request-store.mjs';
|
|
5
6
|
import { imageExtension } from '../game-workflow/asset-formats.mjs';
|
|
@@ -73,6 +74,10 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
73
74
|
for (const [cap,scope] of scopes) if (!current(scope)) void retire(cap,scope);
|
|
74
75
|
});
|
|
75
76
|
return {
|
|
77
|
+
get activeCount() { return scopes.size; },
|
|
78
|
+
async releaseWork(workId) {
|
|
79
|
+
for (const [cap,scope] of scopes) if (scope.work?.work_id===workId) await retire(cap,scope);
|
|
80
|
+
},
|
|
76
81
|
bindOrigin(value) { origin=value; },
|
|
77
82
|
async open(name,checkId,publicationId) {
|
|
78
83
|
if (closed || !origin) throw failure('Local publication panel is unavailable');
|
|
@@ -82,7 +87,7 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
82
87
|
const context=await checkedTask(checkId,name,resume);
|
|
83
88
|
for (const [cap,existing] of scopes) if (!current(existing)) await retire(cap,existing);
|
|
84
89
|
if (scopes.size >= 32) throw failure('Close and reconnect Craft to reopen the local publication panel');
|
|
85
|
-
const scope={ name,check_task_id:checkId,check:context.task,project:context.project,owner:account.user_id,
|
|
90
|
+
const scope={ name,work:currentWork(),check_task_id:checkId,check:context.task,project:context.project,owner:account.user_id,
|
|
86
91
|
platform:platform.base,token:session.token,created:now(),tasks:new Set() };
|
|
87
92
|
if (publicationId) {
|
|
88
93
|
const existing=await publications.status(name,selectedId(publicationId),account.user_id);
|
|
@@ -195,7 +200,7 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
195
200
|
return publications.submit(scope.name,body.publication_id,body.revision,true,scope.owner,signal);
|
|
196
201
|
},{ owner:scope.owner,platform:scope.platform,publication_id:body.publication_id });
|
|
197
202
|
scope.tasks.add(task.task_id); scope.task_id=task.task_id; return viewTask(task);
|
|
198
|
-
});
|
|
203
|
+
},scope.work);
|
|
199
204
|
},
|
|
200
205
|
async close() {
|
|
201
206
|
closed=true; unsubscribe?.();
|
|
@@ -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';
|
|
@@ -27,11 +29,16 @@ import { takeConnectorToken, ConnectorAuthStore, connectorLoginAction } from '..
|
|
|
27
29
|
import { generationFields, importFields, generationInputs, searchFields, importSource } from './asset-tools.mjs';
|
|
28
30
|
import { publicationTools } from './publication-tools.mjs';
|
|
29
31
|
import { clientIde } from '../integrations/hosts.mjs';
|
|
32
|
+
import { currentWork, withWork, guardWork } from '../game-workflow/work-scope.mjs';
|
|
33
|
+
import { getRuntimeIdentity } from '../integrations/runtime.mjs';
|
|
34
|
+
import { UpdateSession } from './update-session.mjs';
|
|
35
|
+
import { registerRuntimeConnection } from '../integrations/runtime-gc.mjs';
|
|
30
36
|
|
|
31
37
|
// Consume before any project/build subprocess can inherit the credential.
|
|
32
38
|
let connectorToken = takeConnectorToken();
|
|
33
39
|
const connectorAuth = connectorToken !== undefined;
|
|
34
40
|
const { version } = JSON.parse(await readFile(new URL('../../package.json',import.meta.url),'utf8'));
|
|
41
|
+
const runtimeIdentity={...await getRuntimeIdentity(fileURLToPath(new URL('../..',import.meta.url))),instance_id:randomUUID(),pid:process.pid,activation_mode:'next_mcp_start'};
|
|
35
42
|
await mkdir(getWorkspaceRoot(),{ recursive:true });
|
|
36
43
|
const root = await realpath(getWorkspaceRoot()), state = getUserDataDir(), resources = process.env.CRAFT_MCP_RESOURCES_DIR;
|
|
37
44
|
const store = new RequestStore(path.join(state,'requests'),root); await store.init();
|
|
@@ -58,18 +65,41 @@ const publicationStore = new RequestStore(path.join(state,'publications'),root);
|
|
|
58
65
|
const publications = new Publications(platform,publicationStore,drafts,resourcePaths.evidence);
|
|
59
66
|
const mutations = new Set();
|
|
60
67
|
let closing = false;
|
|
61
|
-
|
|
68
|
+
let authInteraction=false;
|
|
69
|
+
async function validateWork(work,{preparing=false}={}) {
|
|
70
|
+
await leases.assert(work.name,work.work_id,{ready:!preparing,context_revision:work.context_revision});
|
|
71
|
+
if(!preparing) await projects.assertRevision(work.name,work.context_revision);
|
|
72
|
+
}
|
|
73
|
+
async function mutateProject(name,operation,work) {
|
|
62
74
|
projects.file(name);
|
|
63
75
|
if (closing || mutations.has(name) || tasks.busy(name)) throw new Error('Project has a running operation');
|
|
64
76
|
mutations.add(name);
|
|
65
|
-
try {
|
|
77
|
+
try {
|
|
78
|
+
if(!work || work.name!==name) throw new Error('Publication page requires its original prepared work; reopen after preparing a new work');
|
|
79
|
+
await validateWork(work);
|
|
80
|
+
return await withWork(work,()=>validateWork(work),async()=>{const result=await operation(); await guardWork(); return result;});
|
|
81
|
+
}
|
|
66
82
|
finally { mutations.delete(name); }
|
|
67
83
|
}
|
|
68
84
|
const publishPanel=createPublishPanel({ platform,projects,tasks,drafts,publications,checkedTask,mutate:mutateProject,viewTask,
|
|
69
85
|
coverDirectory:path.join(state,'publication-covers'),preview:async check=>openPublicationPreview(check,resourcePaths.evidence,undefined,{ assetOrigins:await assets.approvedResourceOrigins(check.name),platformOrigin:platform.base }) });
|
|
70
86
|
const panel=await openControlPanel(platform,{ allowLocalAuth:!connectorAuth,publishPanel });
|
|
87
|
+
function runtimeBusy({excludeUpdate=false}={}) {
|
|
88
|
+
if(platform.store.getSession().loggedIn) authInteraction=false;
|
|
89
|
+
const busy={work_count:leases.activeCount,task_count:tasks.activeCount,mutation_count:mutations.size,
|
|
90
|
+
interaction_count:panel.activeRequests+publishPanel.activeCount+Number(authInteraction),
|
|
91
|
+
update_count:Math.max(0,updates.activeOperations-Number(excludeUpdate))};
|
|
92
|
+
return {...busy,can_reconnect:!closing && Object.values(busy).every(count=>count===0)};
|
|
93
|
+
}
|
|
94
|
+
const updates=new UpdateSession({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity,projects,host,workspace:root,platform:platform.base,busy:runtimeBusy});
|
|
95
|
+
let runtimeConnection;
|
|
96
|
+
if(process.env.CRAFT_INSTALLATION_FILE && !await updates.scopeError()) {
|
|
97
|
+
try { runtimeConnection=await registerRuntimeConnection({installationFile:process.env.CRAFT_INSTALLATION_FILE,current:runtimeIdentity}); }
|
|
98
|
+
catch { process.stderr.write('[craft] Runtime cleanup is unavailable for this connection; MCP remains active.\n'); }
|
|
99
|
+
}
|
|
71
100
|
function loginAction() {
|
|
72
101
|
if (connectorAuth) return connectorLoginAction();
|
|
102
|
+
authInteraction=true;
|
|
73
103
|
const url = panel.url;
|
|
74
104
|
return { status:'action_required',reason:'login',human_action_required:true,url,
|
|
75
105
|
user_message:`请点击[连接 Craft 账号](${url}),在本机页面输入 Token 后,回到这里说“继续”。Token 无需发送到聊天中。` };
|
|
@@ -77,11 +107,15 @@ function loginAction() {
|
|
|
77
107
|
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
108
|
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
109
|
const taskField = { task_id:{ type:'string' } };
|
|
110
|
+
const workField = {work_id:{type:'string',description:'Exact work_id from the completed prepare. Keep it for this editing work; release when finished.'}};
|
|
111
|
+
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_game_publish_prepare','craft_game_publish_review','craft_game_publish_submit','craft_game_publish_open','craft_preview_stop','craft_task_cancel']);
|
|
80
112
|
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.' } };
|
|
81
|
-
const tool = (name,description,properties={},required=[])=>({ name,description,inputSchema:{ type:'object',properties,required,additionalProperties:false } });
|
|
113
|
+
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 },...(name==='craft_game_info'?{annotations:{readOnlyHint:true,destructiveHint:false,idempotentHint:true}}:{}) });
|
|
82
114
|
const tools = [
|
|
83
|
-
tool('
|
|
84
|
-
tool('
|
|
115
|
+
tool('craft_update_check','Check the configured npm channel at the first Craft request of a new session. inspect only checks and may save a private check receipt; it never installs, reconnects or changes global Skills or projects. create/resume/update install compatible newer releases when enabled. pending_reconnect means the new package is installed but this connection remains on its original package; no requested game operation has started. Follow connection_handoff after this call returns: recheck current busy state and host rules, use a real available Codex host reload capability once, otherwise prompt for reconnect/restart. WorkBuddy may require full tray exit; request trust only if the host actually prompts. Verify current-chat version/build_id/instance_id/active_verified and host scope, then retry only unstarted prepare with the same request_key and reread local context. Never replay paid operations.',{...nameField,intent:{type:'string',enum:['inspect','create','resume','update']},request_key:{type:'string'}},['intent']),
|
|
116
|
+
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'}}),
|
|
117
|
+
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']),
|
|
118
|
+
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
119
|
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
120
|
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
121
|
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']),
|
|
@@ -111,6 +145,17 @@ const tools = [
|
|
|
111
145
|
];
|
|
112
146
|
// The connection and prepare result use the same maintained workflow; clients may omit initialize instructions from their model context.
|
|
113
147
|
const server = new Server({ name:'craft-local',version },{ capabilities:{ tools:{} },instructions:guide });
|
|
148
|
+
let connectionReady=Promise.resolve();
|
|
149
|
+
server.oninitialized=()=>{
|
|
150
|
+
if(closing) return;
|
|
151
|
+
connectionReady=(async()=>{
|
|
152
|
+
const confirmation=await updates.connected();
|
|
153
|
+
if(confirmation.status==='active_verified') {
|
|
154
|
+
try { await runtimeConnection?.collect(); }
|
|
155
|
+
catch { process.stderr.write('[craft] Runtime cleanup skipped; MCP remains active.\n'); }
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
};
|
|
114
159
|
server.setRequestHandler(ListToolsRequestSchema,async()=>({ tools }));
|
|
115
160
|
function viewTask(task) {
|
|
116
161
|
if (['upload','publish_prepare','publish_submit'].includes(task.kind)) {
|
|
@@ -126,8 +171,10 @@ async function checkedTask(id, name, resumeUpload = false) {
|
|
|
126
171
|
const task = await tasks.get(id);
|
|
127
172
|
if (task.kind !== 'check' || task.status !== 'completed' || !task.result?.gate?.passed) throw new Error('A completed passing game check is required');
|
|
128
173
|
if (name !== undefined && task.name !== name) throw new Error('Game check belongs to a different project');
|
|
174
|
+
const work=currentWork();
|
|
175
|
+
if(!work || work.name!==task.name) throw new Error('A prepared work for this project is required');
|
|
176
|
+
await validateWork(work);
|
|
129
177
|
const { project,engine } = await projects.describe(task.name);
|
|
130
|
-
await leases.acquire(task.name);
|
|
131
178
|
if (task.result.engine && task.result.engine !== engine) throw new Error('Game engine changed since verification');
|
|
132
179
|
if (tasks.busy(task.name) || (!resumeUpload && task.result.source !== await fingerprint(project))) throw new Error('Game changed since verification; check again');
|
|
133
180
|
return { task, project };
|
|
@@ -135,6 +182,7 @@ async function checkedTask(id, name, resumeUpload = false) {
|
|
|
135
182
|
server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
136
183
|
let lock;
|
|
137
184
|
try {
|
|
185
|
+
await connectionReady;
|
|
138
186
|
if (closing) throw new Error('Craft is shutting down');
|
|
139
187
|
const definition = tools.find(t=>t.name === request.params.name), args = request.params.arguments ?? {};
|
|
140
188
|
if (!definition) throw new Error('Unknown tool');
|
|
@@ -143,33 +191,82 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
143
191
|
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
192
|
}
|
|
145
193
|
for (const key of definition.inputSchema.required) if (args[key] === undefined) throw new Error('Missing argument: ' + key);
|
|
146
|
-
|
|
194
|
+
let work;
|
|
195
|
+
const preparing=definition.name==='craft_game_prepare';
|
|
196
|
+
if(preparing) {
|
|
147
197
|
projects.file(args.name);
|
|
148
|
-
if
|
|
149
|
-
|
|
150
|
-
|
|
198
|
+
if(!args.work_id && !leases.hasRequest(args.name,args.request_key)) {
|
|
199
|
+
const update=await updates.check({name:args.name,intent:args.mode,request_key:args.request_key});
|
|
200
|
+
if(closing) throw new Error('Craft is shutting down; project work was not started');
|
|
201
|
+
if(update.can_continue===false || ['pending_reconnect','incompatible','error'].includes(update.status)) {
|
|
202
|
+
const blocked={status:update.status,not_started:true,explicitly_not_started:true,reconnect_required:update.reconnect_required===true,update,
|
|
203
|
+
...(update.connection_handoff ? {connection_handoff:update.connection_handoff} : {}),
|
|
204
|
+
next:update.next ?? 'Resolve the update diagnostic, then retry this prepare with the same request_key. No project work was acquired.'};
|
|
205
|
+
return {content:[{type:'text',text:JSON.stringify(blocked)}]};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
work=await leases.acquire(args.name,{...args,host});
|
|
209
|
+
if(work.task_id) {
|
|
210
|
+
if(work.status==='active') await validateWork(work);
|
|
211
|
+
return {content:[{type:'text',text:JSON.stringify(viewTask(await tasks.get(work.task_id,0)))}]};
|
|
212
|
+
}
|
|
213
|
+
} else if(workTools.has(definition.name)) {
|
|
214
|
+
const task=args.task_id ? await tasks.get(args.task_id) : null;
|
|
215
|
+
const name=args.name??task?.name;
|
|
216
|
+
work=await leases.assert(name,args.work_id,{ready:definition.name!=='craft_task_cancel'});
|
|
217
|
+
if(definition.name==='craft_task_cancel' && task.work_id!==work.work_id) throw new Error('Cannot cancel a task belonging to another work');
|
|
218
|
+
if(definition.name!=='craft_task_cancel') await validateWork(work);
|
|
151
219
|
}
|
|
220
|
+
if(work) {
|
|
221
|
+
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');
|
|
222
|
+
mutations.add(work.name); lock=work.name;
|
|
223
|
+
}
|
|
224
|
+
return await withWork(work,work ? ()=>validateWork(work,{preparing:preparing || definition.name==='craft_task_cancel'}) : undefined,async()=>{
|
|
152
225
|
let result;
|
|
153
226
|
switch (definition.name) {
|
|
227
|
+
case 'craft_update_check': result=await updates.check(args); break;
|
|
154
228
|
case 'craft_game_info': {
|
|
155
|
-
const
|
|
229
|
+
const occupancy=args.name ? await leases.observe(args.name) : undefined;
|
|
230
|
+
const project = args.name ? await projects.inspect(args.name,{full:args.full_integrity===true}) : undefined;
|
|
156
231
|
if (project && args.engine && args.engine !== project.engine) throw new Error('Project engine is fixed to ' + project.engine);
|
|
157
|
-
const selected = project
|
|
158
|
-
|
|
232
|
+
const selected = !project && args.engine ? await loadEngineResource(engines[args.engine].resources,args.engine,engines[args.engine].bundle.id,engines[args.engine].host) : undefined;
|
|
233
|
+
if(project) {
|
|
234
|
+
const after=await leases.observe(args.name);
|
|
235
|
+
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'};
|
|
236
|
+
else if(occupancy?.occupied!==after.occupied || occupancy?.generation!==after.generation) project.preparation={status:'updating',reason:'Work ownership changed during inspection; query again'};
|
|
237
|
+
else if(after.occupied && project.preparation.status==='ready') project.preparation.status='active';
|
|
238
|
+
if(project.preparation.status==='updating') project.integrity={status:'unchecked',reason:'Context changed during inspection; query again after preparation'};
|
|
239
|
+
}
|
|
240
|
+
const updateStatus=await updates.status();
|
|
241
|
+
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
242
|
context_binding:project?.context_binding,
|
|
243
|
+
version_status:project?.version_status,integrity:project?.integrity,preparation:project?.preparation,registration_required:project?.registration_required,occupancy,project_context:project?.project_context,
|
|
160
244
|
project:project?.project, preview:project ? await previews.status(project.project) : undefined,
|
|
161
245
|
llm:'external AI IDE host', images:'Craft platform', aigc:assetCapabilities(selected?.engine),library:libraryCapabilities(selected?.engine),publishing:true,draft_upload:true,
|
|
162
246
|
publication:{ local_page:true,open_tool:'craft_game_publish_open',requires:'Open the independent local page to preview the frozen build and confirm its exact reviewed materials; platform publish_enabled and ACE gates',material_visibility:'public_on_upload' },
|
|
163
|
-
concurrency:{workspace_sessions:'multiple',
|
|
164
|
-
|
|
247
|
+
concurrency:{workspace_sessions:'multiple',project_works:1,readonly_queries:'unlocked',release:'craft_game_release(name, work_id); abnormal process exit expires within 30 seconds'},
|
|
248
|
+
lifecycle:{version:1,prepare_modes:['create','resume'],request_key_required:true,work_id_required:true,query_updates_context:false},
|
|
249
|
+
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
250
|
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
251
|
}
|
|
167
|
-
case 'craft_game_prepare':
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
252
|
+
case 'craft_game_prepare': {
|
|
253
|
+
result=await tasks.start(args.name,'prepare',async signal=>{
|
|
254
|
+
try {
|
|
255
|
+
const project=await projects.prepare(args.name,args.engine,signal,{mode:args.mode,guard:()=>leases.assert(args.name,work.work_id,{ready:false})});
|
|
256
|
+
await guardWork();
|
|
257
|
+
if(project.created) await installProjectDependencies(project.project,undefined,signal);
|
|
258
|
+
const selected=await projects.resourcesFor(project);
|
|
259
|
+
await leases.update(args.name,work.work_id,{status:'active',context_revision:project.context_revision});
|
|
260
|
+
return {...project,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.'};
|
|
261
|
+
} catch(error) {await leases.release(args.name,work.work_id,'failed').catch(()=>{}); throw error;}
|
|
262
|
+
});
|
|
263
|
+
await leases.update(args.name,work.work_id,{task_id:result.task_id});
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case 'craft_game_release': {
|
|
267
|
+
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');
|
|
268
|
+
result=await leases.release(args.name,args.work_id); await publishPanel.releaseWork(args.work_id); break;
|
|
269
|
+
}
|
|
173
270
|
case 'craft_assets_generate': {
|
|
174
271
|
const inputs=generationInputs(args);
|
|
175
272
|
await projects.owned(args.name);
|
|
@@ -211,7 +308,7 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
211
308
|
case 'craft_task_cancel': {
|
|
212
309
|
const current = await tasks.get(args.task_id);
|
|
213
310
|
if (['upload','publish_prepare','publish_submit'].includes(current.kind)) viewTask(current);
|
|
214
|
-
await leases.
|
|
311
|
+
await leases.assert(current.name,args.work_id,{ready:false});
|
|
215
312
|
const task = await tasks.cancel(args.task_id);
|
|
216
313
|
result = viewTask(task);
|
|
217
314
|
if (['images','assets'].includes(task.kind)) {
|
|
@@ -285,7 +382,7 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
285
382
|
{ owner:status.user_id,platform:platform.base,publication_id:args.publication_id }));
|
|
286
383
|
break;
|
|
287
384
|
}
|
|
288
|
-
case 'craft_preview_stop': await
|
|
385
|
+
case 'craft_preview_stop': await guardWork(); result = await previews.stop(await projects.owned(args.name)); break;
|
|
289
386
|
case 'craft_auth_open': {
|
|
290
387
|
const status = await platform.status();
|
|
291
388
|
result = !status.authenticated ? loginAction() :
|
|
@@ -298,19 +395,30 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
298
395
|
break;
|
|
299
396
|
}
|
|
300
397
|
case 'craft_auth_logout': {
|
|
398
|
+
authInteraction=false;
|
|
301
399
|
result = platform.logout();
|
|
302
400
|
if (connectorAuth) result.user_message = '本进程已退出登录。要移除宿主 AI IDE 保存的凭证,请在 MCP 凭证设置中断开或清除凭证;重新连接会再次注入。';
|
|
303
401
|
break;
|
|
304
402
|
}
|
|
305
403
|
}
|
|
404
|
+
if(work && !preparing && definition.name!=='craft_task_cancel') await guardWork();
|
|
306
405
|
return { content:[{ type:'text',text:JSON.stringify(result) }] };
|
|
406
|
+
});
|
|
307
407
|
} catch (error) { return { isError:true,content:[{ type:'text',text:JSON.stringify({ error:error.message,...error.detail }) }] }; }
|
|
308
408
|
finally { if (lock) mutations.delete(lock); }
|
|
309
409
|
});
|
|
310
|
-
|
|
311
|
-
|
|
410
|
+
let shutdownPromise;
|
|
411
|
+
function shutdown() {
|
|
412
|
+
if(shutdownPromise) return shutdownPromise;
|
|
312
413
|
closing = true;
|
|
313
|
-
|
|
414
|
+
shutdownPromise=(async()=>{
|
|
415
|
+
await updates.close();
|
|
416
|
+
await connectionReady.catch(()=>{});
|
|
417
|
+
await tasks.close(); await leases.close(); await panel.close(); await server.close();
|
|
418
|
+
try { await runtimeConnection?.close(); }
|
|
419
|
+
catch { process.stderr.write('[craft] Runtime cleanup skipped during shutdown.\n'); }
|
|
420
|
+
})();
|
|
421
|
+
return shutdownPromise;
|
|
314
422
|
}
|
|
315
423
|
for (const signal of ['SIGINT','SIGTERM']) process.once(signal,()=>{ void shutdown().then(()=>process.exit(0)); });
|
|
316
424
|
process.stdin.once('end',()=>{ void shutdown(); });
|