@craft_eco/craft-mcp 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -10
- package/bin/craft-mcp.mjs +10 -8
- package/dist-server/game-workflow/bundle-files.mjs +43 -0
- package/dist-server/game-workflow/engines.mjs +13 -6
- package/dist-server/game-workflow/project-bundles.mjs +90 -0
- package/dist-server/game-workflow/project-context.mjs +91 -0
- package/dist-server/game-workflow/projects.mjs +16 -4
- package/dist-server/game-workflow/publication-materials.mjs +18 -20
- package/dist-server/game-workflow/publications.mjs +15 -17
- package/dist-server/game-workflow/publish-capture.mjs +21 -57
- package/dist-server/integrations/config.mjs +71 -0
- package/dist-server/integrations/files.mjs +54 -0
- package/dist-server/integrations/hosts.mjs +30 -0
- package/dist-server/integrations/install.mjs +86 -0
- package/dist-server/integrations/runtime.mjs +71 -0
- package/dist-server/mcp/publication-page.mjs +18 -50
- package/dist-server/mcp/publish-panel.mjs +28 -35
- package/dist-server/mcp/server.mjs +17 -14
- package/dist-server/preview/preview-launcher.mjs +9 -2
- package/dist-server/preview/preview-start.mjs +2 -2
- package/dist-server/upstream/publication-transport.mjs +19 -19
- package/package.json +10 -2
- package/resources/craft-create/SKILL.md +14 -0
- package/resources/craft-game-maker/SKILL.md +77 -71
- package/resources/craft-game-maker/js.md +10 -10
- package/resources/craft-game-maker/js3d.md +13 -13
- package/resources/game_visual_qa.mjs +1149 -1149
- package/resources/js/bundle.json +93 -0
- package/resources/js/context/AGENTS.md +15 -102
- package/resources/js/context/knowledge/AigcWiring.md +5 -196
- package/resources/js/context/knowledge/AssetUrl.md +5 -20
- package/resources/js/context/knowledge/Layout.md +7 -0
- package/resources/js/context/knowledge/Lifecycle.md +6 -27
- package/resources/js/context/skills/aigc-generate/SKILL.md +6 -141
- package/resources/js/context/skills/asset-search/SKILL.md +5 -62
- package/resources/js/context/skills/asset-search/references/resource-config.md +9 -0
- package/resources/js/context/skills/export-config/SKILL.md +7 -19
- package/resources/js/context/skills/export-config/scripts/export-config.mjs +3 -45
- package/resources/js/context/skills/index.json +30 -0
- package/resources/js/context/skills/visual-qa/SKILL.md +6 -28
- package/resources/js/project/README.md +4 -96
- package/resources/js/project/package.json +1 -2
- package/resources/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +1 -37
- package/resources/js/project/scripts/config-export.mjs +10 -34
- package/resources/js3d/bundle.json +104 -0
- package/resources/js3d/context/AGENTS.md +16 -85
- package/resources/js3d/context/knowledge/AigcWiring.md +9 -0
- package/resources/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +9 -67
- package/resources/js3d/context/knowledge/Layout.md +7 -0
- package/resources/js3d/context/knowledge/Runtime.md +5 -30
- package/resources/js3d/context/skills/aigc-integration/SKILL.md +6 -164
- package/resources/js3d/context/skills/asset-search/SKILL.md +5 -171
- package/resources/js3d/context/skills/asset-search/references/resource-config.md +6 -94
- package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +6 -82
- package/resources/js3d/context/skills/export-config/SKILL.md +7 -11
- package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +3 -55
- package/resources/js3d/context/skills/index.json +42 -0
- package/resources/js3d/context/skills/performance-audit/SKILL.md +8 -153
- package/resources/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/js3d/project/README.md +4 -103
- package/resources/js3d/project/package.json +1 -2
- package/resources/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-scene-assets.mjs +3 -28
- package/resources/js3d/project/scripts/config-export.mjs +12 -34
- package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts +8 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.js +39 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts +5 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js +45 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +2 -1
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +2 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.js +7 -2
- package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +2 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +27 -16
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts +14 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js +119 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/static.js +20 -6
- package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-protocol.js +24 -2
- package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-steering.d.ts +21 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.js +66 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +1 -1
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -1
- package/vendor/agent-cli/dist/src/index.d.ts +4 -1
- package/vendor/agent-cli/dist/src/index.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/index.js +3 -0
- package/vendor/agent-cli/dist/src/index.js.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +29 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +18 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.d.ts +10 -0
- package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.js +15 -5
- package/vendor/agent-cli/dist/src/session/client.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.js +14 -1
- package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-observability.js +11 -0
- package/vendor/agent-cli/dist/src/session/process-observability.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.d.ts +3 -2
- package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.js +27 -9
- package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +1 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.js +8 -3
- package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-steer.d.ts +42 -0
- package/vendor/agent-cli/dist/src/session/run-steer.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-steer.js +205 -0
- package/vendor/agent-cli/dist/src/session/run-steer.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts +6 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts +21 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.js +102 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program.js +3 -0
- package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -1
- package/resources/js/context/.role/AGENTS_DESIGN.md +0 -9
- package/resources/js/context/agents/aigc-asset.md +0 -168
- package/resources/js/context/knowledge/AigcEnabled.md +0 -49
- package/resources/js/context/knowledge/FrontendComponents.md +0 -17
- package/resources/js/context/knowledge/MobileAdaptation.md +0 -73
- package/resources/js/context/knowledge/MobileAdapted.md +0 -36
- package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
- package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -115
- package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -392
- package/resources/js/context/knowledge/PlatformServices.md +0 -190
- package/resources/js/context/knowledge/ProjectDisplayConfig.md +0 -35
- package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
- package/resources/js/context/knowledge/Ui.md +0 -11
- package/resources/js/context/knowledge/UiEditorCompat.md +0 -21
- package/resources/js/context/rules/MultiplayerCapability.md +0 -23
- package/resources/js/context/rules/MultiplayerRoomEntryUX.md +0 -63
- package/resources/js/context/rules/PlatformBoundaryModules.md +0 -44
- package/resources/js/context/rules/preview_ready.md +0 -8
- package/resources/js/context/skills/aigc-generate/knowledge/audio.md +0 -39
- package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +0 -26
- package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +0 -132
- package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +0 -53
- package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +0 -52
- package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +0 -191
- package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +0 -55
- package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +0 -62
- package/resources/js/context/skills/asset-search/scripts/config.json +0 -5
- package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +0 -125
- package/resources/js/context/skills/asset-search/scripts/search.mjs +0 -760
- package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -657
- package/resources/js/context/skills/asset-search/strategies/anim2d.md +0 -42
- package/resources/js/context/skills/asset-search/strategies/audio.md +0 -34
- package/resources/js/context/skills/asset-search/strategies/effect2d.md +0 -31
- package/resources/js/context/skills/asset-search/strategies/texture-prop.md +0 -22
- package/resources/js/context/skills/asset-search/strategies/ui-common.md +0 -40
- package/resources/js/context/skills/asset-search/strategies/ui-style.md +0 -28
- package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
- package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +0 -93
- package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +0 -7
- package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +0 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +0 -208
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +0 -31
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +0 -272
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.d.mts +0 -79
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.mjs +0 -29
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/release.json +0 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/cli.mjs +0 -16
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.d.mts +0 -4
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.mjs +0 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +0 -3
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.mjs +0 -72
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.d.mts +0 -24
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.mjs +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.d.mts +0 -10
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/cli.mjs +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.d.mts +0 -19
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/installed.json +0 -6
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.d.mts +0 -6
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.mjs +0 -77
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.d.mts +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.mjs +0 -34
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +0 -156
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +0 -249
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +0 -87
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +0 -185
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +0 -294
- package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +0 -5
- package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +0 -159
- package/resources/js/context/skills/mobile-adaptation/SKILL.md +0 -277
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -50
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -862
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -135
- package/resources/js/context/skills/mobile-adaptation/references/input-config.md +0 -342
- package/resources/js/context/skills/mobile-adaptation/references/verification.md +0 -140
- package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +0 -11
- package/resources/js/context/skills/mobile-compat-qa/SKILL.md +0 -53
- package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
- package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
- package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
- package/resources/js/context/skills/optimization-suggestions/SKILL.md +0 -89
- package/resources/js/context/skills/platform-services/SKILL.md +0 -101
- package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
- package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
- package/resources/js/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/modules/log.ts +0 -35
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
- package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +0 -49
- package/resources/js/context/skills/platform-services/assets/modules/save.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
- package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
- package/resources/js/context/skills/platform-services/references/api_reference.md +0 -18
- package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
- package/resources/js/context/skills/platform-services/scripts/install.mjs +0 -148
- package/resources/js/context/skills/resolution-adaptation/SKILL.md +0 -47
- package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
- package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -249
- package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +0 -98
- package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -200
- package/resources/js/context/skills/resolution-adaptation/references/audit.md +0 -31
- package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
- package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
- package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
- package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
- package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
- package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +0 -55
- package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
- package/resources/js/context/skills/scene-editor-compat/SKILL.md +0 -94
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +0 -13
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +0 -6
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +0 -25
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +0 -18
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +0 -42
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +0 -144
- package/resources/js/context/skills/scene-editor-compat/docs/contract.md +0 -330
- package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +0 -64
- package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +0 -28
- package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +0 -47
- package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +0 -64
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +0 -38
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +0 -9
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +0 -59
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +0 -30
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +0 -66
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +0 -20
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +0 -26
- package/resources/js/context/skills/scene-editor-compat/references/contract.md +0 -73
- package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +0 -162
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +0 -853
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +0 -173
- package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -427
- package/resources/js/context/skills/scene-editor-compat/version.json +0 -1
- package/resources/js/context/skills/ui-editor-compat/SKILL.md +0 -48
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -74
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js/context/skills/ui-editor-compat/references/contract.md +0 -132
- package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
- package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
- package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
- package/resources/js/context/skills/version-update/SKILL.md +0 -192
- package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
- package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
- package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
- package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js/context/version/version.json +0 -1
- package/resources/js/project/SPEC/assist/.gitkeep +0 -0
- package/resources/js/project/SPEC/guide/.gitkeep +0 -0
- package/resources/js/project/SPEC/plan/.gitkeep +0 -0
- package/resources/js/project/SPEC/readme.md +0 -6
- package/resources/js/project/SPEC/res/.gitkeep +0 -0
- package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -29
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/release.json +0 -37
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js/project/vendor/core-manager-js/package.json +0 -33
- package/resources/js/project/vendor/core-manager-js/src/.versions.json +0 -42
- package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +0 -41
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +0 -93
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +0 -203
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +0 -106
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +0 -25
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +0 -21
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +0 -65
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +0 -340
- package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +0 -87
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +0 -92
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +0 -271
- package/resources/js/project/vendor/core-manager-js/src/index.ts +0 -31
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +0 -81
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +0 -43
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +0 -32
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +0 -141
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +0 -20
- package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +0 -183
- package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +0 -304
- package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +0 -351
- package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +0 -180
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +0 -13
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +0 -14
- package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +0 -68
- package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +0 -433
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +0 -118
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +0 -444
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +0 -485
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +0 -66
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +0 -149
- package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +0 -9
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +0 -29
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +0 -88
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +0 -122
- package/resources/js/project/vendor/core-manager-js/src/runtime.ts +0 -24
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +0 -318
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +0 -151
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +0 -235
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +0 -98
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +0 -94
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +0 -209
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +0 -106
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +0 -341
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +0 -68
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +0 -236
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +0 -22
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +0 -29
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +0 -197
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +0 -9
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +0 -555
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +0 -112
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +0 -178
- package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +0 -246
- package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +0 -139
- package/resources/js/project/vendor/core-manager-js/tsconfig.json +0 -15
- package/resources/js/project/vendor/run.sh +0 -4
- package/resources/js/project/version/craft_feature_version.json +0 -42
- package/resources/js/project/version/project_feature_version.json +0 -11
- package/resources/js3d/context/.role/AGENTS_DESIGN.md +0 -9
- package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +0 -75
- package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +0 -42
- package/resources/js3d/context/knowledge/FrontendComponents.md +0 -19
- package/resources/js3d/context/knowledge/MobileAdaptation.md +0 -73
- package/resources/js3d/context/knowledge/MobileAdapted.md +0 -36
- package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
- package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -117
- package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -430
- package/resources/js3d/context/knowledge/PlatformServices.md +0 -190
- package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +0 -35
- package/resources/js3d/context/knowledge/SceneEditorCompat.md +0 -35
- package/resources/js3d/context/knowledge/StepByStep.md +0 -21
- package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
- package/resources/js3d/context/knowledge/UiEditorCompat.md +0 -21
- package/resources/js3d/context/rules/MultiplayerCapability.md +0 -27
- package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +0 -63
- package/resources/js3d/context/rules/PlatformBoundaryModules.md +0 -44
- package/resources/js3d/context/rules/preview_ready.md +0 -8
- package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +0 -70
- package/resources/js3d/context/skills/aigc-integration/callback.md +0 -77
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +0 -23
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +0 -38
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +0 -72
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +0 -33
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +0 -36
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +0 -37
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +0 -35
- package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +0 -58
- package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +0 -62
- package/resources/js3d/context/skills/asset-search/scripts/config.json +0 -235
- package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +0 -905
- package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +0 -79
- package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +0 -74
- package/resources/js3d/context/skills/asset-search/scripts/search.mjs +0 -637
- package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -667
- package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +0 -42
- package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +0 -31
- package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +0 -89
- package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +0 -143
- package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +0 -90
- package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
- package/resources/js3d/context/skills/game-art-style/SKILL.md +0 -60
- package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
- package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +0 -38
- package/resources/js3d/context/skills/game-art-style/references/construction.md +0 -111
- package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +0 -105
- package/resources/js3d/context/skills/game-art-style/references/sources.md +0 -25
- package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +0 -175
- package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +0 -168
- package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +0 -191
- package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +0 -165
- package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +0 -173
- package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +0 -185
- package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +0 -181
- package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +0 -189
- package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +0 -88
- package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +0 -301
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -104
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -933
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -257
- package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +0 -342
- package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +0 -140
- package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +0 -11
- package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +0 -53
- package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +0 -10
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
- package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +0 -74
- package/resources/js3d/context/skills/performance-audit/references/case-notes.md +0 -93
- package/resources/js3d/context/skills/performance-audit/references/rules.md +0 -183
- package/resources/js3d/context/skills/platform-services/SKILL.md +0 -101
- package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
- package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
- package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +0 -35
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
- package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +0 -49
- package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +0 -1
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
- package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
- package/resources/js3d/context/skills/platform-services/references/api_reference.md +0 -18
- package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
- package/resources/js3d/context/skills/platform-services/scripts/install.mjs +0 -148
- package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +0 -46
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -239
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +0 -129
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -188
- package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +0 -31
- package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
- package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
- package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
- package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
- package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
- package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
- package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +0 -599
- package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +0 -141
- package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +0 -92
- package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +0 -125
- package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +0 -113
- package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -1187
- package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +0 -53
- package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +0 -4
- package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +0 -94
- package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +0 -50
- package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +0 -105
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +0 -147
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +0 -79
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +0 -56
- package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +0 -51
- package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +0 -55
- package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +0 -78
- package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +0 -84
- package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +0 -120
- package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +0 -4
- package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +0 -238
- package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +0 -59
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -61
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +0 -110
- package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
- package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
- package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
- package/resources/js3d/context/skills/version-update/SKILL.md +0 -191
- package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
- package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
- package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
- package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js3d/context/version/version.json +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -30
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +0 -39
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -7
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +0 -26
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +0 -351
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js3d/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js3d/project/vendor/core-manager-three/package.json +0 -12
- package/resources/js3d/project/vendor/core-manager-three/src/index.ts +0 -2
- package/resources/js3d/project/vendor/run.sh +0 -4
- package/resources/js3d/project/version/craft_feature_version.json +0 -42
- package/resources/js3d/project/version/project_feature_version.json +0 -11
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +0 -7
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +0 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +0 -145
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +0 -1
- /package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
- /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
- /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +0 -0
|
@@ -6,43 +6,30 @@ const pageAbort = new AbortController();
|
|
|
6
6
|
const hashPattern = /^[a-f0-9]{64}$/;
|
|
7
7
|
const idPattern = /^[A-Za-z0-9_-]{1,128}$/;
|
|
8
8
|
const imageLimit = 2 * 1024 * 1024;
|
|
9
|
-
const publishedTargetHelp = '当前版本已发布。请回到 WorkBuddy 重新验收同一个游戏,再用新的验收结果打开发布页。';
|
|
10
9
|
let context, publication, reviewedRevision, busy = false, dirty = false, needsSync = false;
|
|
11
10
|
let disposed = false, formInitialized = false, reviewGeneration = 0, statusTimer;
|
|
12
|
-
let targetVersionPublished = false;
|
|
13
11
|
let coverData, coverId, coverURL, coverGeneration = 0, coverLoading = false, imagesReady = false;
|
|
14
12
|
const stateNames = { awaiting_confirmation:'等待审阅确认', submitting:'正在提交', submitted:'已提交,等待审核', sharing:'审核中',
|
|
15
13
|
share_repacking:'发布处理中', share_completed:'审核通过', share_failed:'发布未完成', share_delisted:'审核未通过或已下架',
|
|
16
14
|
different_publication:'目标版本存在另一条发布记录', not_submitted:'尚未提交', external_draft:'私有草稿' };
|
|
17
15
|
|
|
18
16
|
function message(text) { byId('message').textContent = text; }
|
|
19
|
-
function localizedText(value, fallback) {
|
|
20
|
-
return typeof value === 'string' && /\p{Script=Han}/u.test(value) && !/\n\s+at |file:\/\/\/|[A-Za-z]:\\|\b(?:ENOENT|EACCES|EPERM)\b/.test(value) ? value : fallback;
|
|
21
|
-
}
|
|
22
17
|
function showError(error) {
|
|
23
|
-
byId('error').textContent =
|
|
18
|
+
byId('error').textContent = error instanceof Error ? error.message : String(error);
|
|
24
19
|
byId('error').hidden = false;
|
|
25
20
|
}
|
|
26
21
|
function clearError() { byId('error').textContent = ''; byId('error').hidden = true; }
|
|
27
|
-
function errorText(data
|
|
22
|
+
function errorText(data) {
|
|
28
23
|
const detail = data && typeof data === 'object' ? data : {};
|
|
29
|
-
return [
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
function isPublishedTaskFailure(task) {
|
|
33
|
-
const { reason,message:rawMessage } = task.error || {};
|
|
34
|
-
return task.kind === 'publish_prepare' && task.status === 'failed' && (reason === 'publication_version_already_published' ||
|
|
35
|
-
typeof rawMessage === 'string' && rawMessage.startsWith('This version is already published.'));
|
|
24
|
+
return [detail.error || detail.message || '本地请求未完成',
|
|
25
|
+
detail.request_id ? '请求 ID:' + detail.request_id : ''].filter(Boolean).join('\n');
|
|
36
26
|
}
|
|
37
27
|
function taskError(task, fallback) {
|
|
28
|
+
const detail = errorText(task?.error || { error:fallback });
|
|
38
29
|
if (task?.kind === 'publish_prepare' && task.status === 'failed') {
|
|
39
|
-
|
|
40
|
-
return Object.assign(new Error(publishedTargetHelp),{ targetVersionPublished:true });
|
|
41
|
-
}
|
|
42
|
-
if (task.error?.reason === 'publication_review_in_progress') return new Error(errorText(task.error,'当前版本正在审核,请回到 WorkBuddy 查看原发布记录。'));
|
|
43
|
-
return new Error(['发布材料准备失败。请重新点击「准备发布材料」重试。',errorText(task.error,'')].filter(Boolean).join('\n\n'));
|
|
30
|
+
return new Error('发布材料准备失败。请重新点击「准备发布材料」重试。\n\n' + detail);
|
|
44
31
|
}
|
|
45
|
-
return new Error(
|
|
32
|
+
return new Error(detail);
|
|
46
33
|
}
|
|
47
34
|
async function request(route, body, query) {
|
|
48
35
|
const url = new URL(apiBase + '/' + route, location.origin);
|
|
@@ -62,7 +49,7 @@ async function request(route, body, query) {
|
|
|
62
49
|
}
|
|
63
50
|
const data = await response.json().catch(() => null);
|
|
64
51
|
if (!response.ok || !data || typeof data !== 'object') {
|
|
65
|
-
const error = new Error(errorText(data
|
|
52
|
+
const error = new Error(errorText(data)); error.httpStatus = response.status;
|
|
66
53
|
error.needsSync = body !== undefined && (!data || typeof data !== 'object' || response.status >= 500); throw error;
|
|
67
54
|
}
|
|
68
55
|
return data;
|
|
@@ -80,17 +67,10 @@ function changeStep(current) {
|
|
|
80
67
|
if (index === current) item.setAttribute('aria-current','step'); else item.removeAttribute('aria-current');
|
|
81
68
|
});
|
|
82
69
|
}
|
|
83
|
-
function showPublishedTarget() {
|
|
84
|
-
targetVersionPublished = true;
|
|
85
|
-
if (!publication?.published) changeStep(0);
|
|
86
|
-
byId('status').textContent = '当前版本已发布';
|
|
87
|
-
byId('status').dataset.state = 'share_completed';
|
|
88
|
-
message(publishedTargetHelp);
|
|
89
|
-
}
|
|
90
70
|
function isInProgress() { return ['submitting','submitted','sharing','share_repacking'].includes(publication?.state); }
|
|
91
|
-
function isLocked() { return
|
|
71
|
+
function isLocked() { return publication?.published === true || isInProgress() || publication?.state === 'different_publication'; }
|
|
92
72
|
function canConfirm() {
|
|
93
|
-
return Boolean(
|
|
73
|
+
return Boolean(publication && reviewedRevision === publication.revision && imagesReady && !dirty && !needsSync &&
|
|
94
74
|
publication.materials?.open_to_recreate === false &&
|
|
95
75
|
(publication.state === 'awaiting_confirmation' || publication.finalization_retry_required === true));
|
|
96
76
|
}
|
|
@@ -98,7 +78,7 @@ function updateControls() {
|
|
|
98
78
|
byId('refresh').disabled = busy;
|
|
99
79
|
byId('materials-fields').disabled = busy || coverLoading || !context || needsSync || isLocked();
|
|
100
80
|
byId('previous-cover').hidden = context?.previous_publication?.cover_available !== true || Boolean(coverData);
|
|
101
|
-
byId('review').hidden =
|
|
81
|
+
byId('review').hidden = !publication || dirty || !['awaiting_confirmation'].includes(publication.state) && !publication.finalization_retry_required;
|
|
102
82
|
byId('review').disabled = busy || needsSync;
|
|
103
83
|
byId('confirm').disabled = busy || !canConfirm();
|
|
104
84
|
byId('submit').disabled = busy || !canConfirm() || !byId('confirm').checked;
|
|
@@ -170,12 +150,11 @@ function setPublication(value) {
|
|
|
170
150
|
value.name !== context.name || value.check_task_id !== context.check_task_id) throw new Error('发布回执与当前检查不一致,请返回 AI IDE 重新打开发布页面。');
|
|
171
151
|
if (reviewedRevision !== value.revision) { reviewedRevision = undefined; imagesReady = false; byId('confirm').checked = false; }
|
|
172
152
|
publication = value;
|
|
173
|
-
byId('status').textContent =
|
|
153
|
+
byId('status').textContent = stateNames[value.state] || value.state;
|
|
174
154
|
byId('status').dataset.state = value.state;
|
|
175
|
-
byId('publication-progress').textContent =
|
|
155
|
+
byId('publication-progress').textContent = value.status_reason || (value.published ? '当前目标版本已通过审核。' :
|
|
176
156
|
value.finalization_retry_required ? '审核后的发布收尾尚未完成,可重试同一份已确认材料。' :
|
|
177
|
-
isInProgress() ? '材料已受理,正在查询同一发布记录的审核进度。请保留此页面,不要重复提交。' :
|
|
178
|
-
value.status_reason ? '请在 Craft 平台查看此版本的审核详情。' : '');
|
|
157
|
+
isInProgress() ? '材料已受理,正在查询同一发布记录的审核进度。请保留此页面,不要重复提交。' : '');
|
|
179
158
|
if (value.published) { changeStep(3); message('当前目标版本已通过审核,可以打开已发布游戏。'); }
|
|
180
159
|
else if (isInProgress()) { changeStep(3); message('已提交审核,正在等待当前版本的结果。'); }
|
|
181
160
|
else if (!dirty) changeStep(2);
|
|
@@ -286,9 +265,6 @@ async function loadState() {
|
|
|
286
265
|
byId('cover-help').textContent = previous?.cover_available === true ? coverHelp : coverHelp + coverFallback;
|
|
287
266
|
if (!formInitialized) fillForm(state.publication?.materials ?? previous?.materials);
|
|
288
267
|
if (state.publication) setPublication(state.publication);
|
|
289
|
-
if (targetVersionPublished || state.target_version_published || state.publication?.state === 'share_completed') {
|
|
290
|
-
showPublishedTarget(); return;
|
|
291
|
-
}
|
|
292
268
|
if (state.task_id) {
|
|
293
269
|
const task = await request('task',undefined,{ task_id:state.task_id });
|
|
294
270
|
if (task.status === 'running') { changeStep(1); message('正在恢复原发布任务…'); }
|
|
@@ -296,9 +272,7 @@ async function loadState() {
|
|
|
296
272
|
const result = await waitForTask(task);
|
|
297
273
|
setPublication(await request('status',undefined,{ publication_id:result.publication_id }));
|
|
298
274
|
if (!dirty) fillForm(publication.materials);
|
|
299
|
-
} else if (task.status !== 'completed' &&
|
|
300
|
-
throw taskError(task,'原任务已中断,请回 WorkBuddy 查看。');
|
|
301
|
-
}
|
|
275
|
+
} else if (task.status !== 'completed' && !state.publication) throw taskError(task,'原任务已中断,请回 AI IDE 查看。');
|
|
302
276
|
}
|
|
303
277
|
if (publication && !dirty && (publication.state === 'awaiting_confirmation' || publication.finalization_retry_required)) {
|
|
304
278
|
await reviewPublication(publication); message('材料已准备。请核对文案、封面和全部展示截图,再确认公开提交。');
|
|
@@ -311,7 +285,7 @@ async function loadState() {
|
|
|
311
285
|
}
|
|
312
286
|
function scheduleStatus() {
|
|
313
287
|
clearTimeout(statusTimer);
|
|
314
|
-
if (disposed ||
|
|
288
|
+
if (disposed || !publication || !isInProgress()) return;
|
|
315
289
|
statusTimer = setTimeout(async () => {
|
|
316
290
|
if (busy) { scheduleStatus(); return; }
|
|
317
291
|
try {
|
|
@@ -331,13 +305,7 @@ async function perform(action) {
|
|
|
331
305
|
if (busy || disposed) return;
|
|
332
306
|
busy = true; clearTimeout(statusTimer); clearError(); updateControls();
|
|
333
307
|
try { await action(); }
|
|
334
|
-
catch (error) {
|
|
335
|
-
if (!disposed) {
|
|
336
|
-
if (error.needsSync) needsSync = true;
|
|
337
|
-
if (error.targetVersionPublished) showPublishedTarget();
|
|
338
|
-
else showError(error);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
308
|
+
catch (error) { if (!disposed) { if (error.needsSync) needsSync = true; showError(error); } }
|
|
341
309
|
finally { busy = false; updateControls(); scheduleStatus(); }
|
|
342
310
|
}
|
|
343
311
|
function clearCover(resetInput = true) {
|
|
@@ -367,7 +335,7 @@ byId('cover-file').addEventListener('change',async () => {
|
|
|
367
335
|
byId('clear-cover').onclick = () => { clearCover(); invalidateReview(); };
|
|
368
336
|
byId('materials-form').onsubmit = event => {
|
|
369
337
|
event.preventDefault();
|
|
370
|
-
if (coverLoading ||
|
|
338
|
+
if (coverLoading || !byId('materials-form').reportValidity()) return;
|
|
371
339
|
void perform(async () => {
|
|
372
340
|
const materials = materialInput();
|
|
373
341
|
reviewedRevision = undefined; imagesReady = false; byId('confirm').checked = false;
|
|
@@ -7,16 +7,12 @@ import { publicationMaterials } from '../game-workflow/publication-materials.mjs
|
|
|
7
7
|
|
|
8
8
|
const identifier = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
9
9
|
const failure = (message,status=400)=>Object.assign(new Error(message),{ status });
|
|
10
|
-
const pageChanged = 'Craft 账号已变更或发布页已失效。请回到 AI IDE 重新打开发布页。';
|
|
11
|
-
const publicationCheckMismatch = '发布记录与当前验收结果不匹配。请回到 AI IDE 打开对应的发布页。';
|
|
12
|
-
const previewUnavailable = '本地游戏预览暂不可用。请重新加载页面后再试,已保存的发布进度仍可查看。';
|
|
13
|
-
const coverRequirements = '请选择不超过 2 MiB 的 PNG 或 JPEG 封面图片。';
|
|
14
10
|
function bodyFields(body,keys,required=keys) {
|
|
15
11
|
if (!body || typeof body !== 'object' || Array.isArray(body) || Object.keys(body).some(key=>!keys.includes(key)) ||
|
|
16
|
-
required.some(key=>!Object.hasOwn(body,key))) throw failure('
|
|
12
|
+
required.some(key=>!Object.hasOwn(body,key))) throw failure('Invalid publication request');
|
|
17
13
|
}
|
|
18
14
|
function selectedId(value) {
|
|
19
|
-
if (typeof value !== 'string' || !identifier.test(value)) throw failure('
|
|
15
|
+
if (typeof value !== 'string' || !identifier.test(value)) throw failure('Invalid publication identity');
|
|
20
16
|
return value;
|
|
21
17
|
}
|
|
22
18
|
|
|
@@ -36,20 +32,20 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
36
32
|
}
|
|
37
33
|
async function scopeFor(cap) {
|
|
38
34
|
const scope = scopes.get(cap);
|
|
39
|
-
if (!scope) throw failure('
|
|
35
|
+
if (!scope) throw failure('This local publication page is unavailable. Reopen it from Craft.',404);
|
|
40
36
|
if (!current(scope)) {
|
|
41
37
|
await retire(cap,scope);
|
|
42
|
-
throw failure(
|
|
38
|
+
throw failure('Craft account or publication page changed. Reopen the page.',403);
|
|
43
39
|
}
|
|
44
40
|
return scope;
|
|
45
41
|
}
|
|
46
42
|
function requireCurrent(scope) {
|
|
47
|
-
if (!current(scope)) throw failure(
|
|
43
|
+
if (!current(scope)) throw failure('Craft account or publication page changed. Reopen the page.',403);
|
|
48
44
|
}
|
|
49
45
|
async function publication(scope,id) {
|
|
50
|
-
if (selectedId(id) !== scope.publication_id) throw failure('
|
|
46
|
+
if (selectedId(id) !== scope.publication_id) throw failure('Publication does not belong to this page',403);
|
|
51
47
|
const result = await publications.status(scope.name,id,scope.owner);
|
|
52
|
-
if (result.check_task_id !== scope.check_task_id) throw failure(
|
|
48
|
+
if (result.check_task_id !== scope.check_task_id) throw failure('Publication does not match this checked build',403);
|
|
53
49
|
requireCurrent(scope); return result;
|
|
54
50
|
}
|
|
55
51
|
async function preview(scope) {
|
|
@@ -61,7 +57,7 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
61
57
|
handle=await pending;
|
|
62
58
|
url=new URL(handle.url);
|
|
63
59
|
if (url.protocol !== 'http:' || url.hostname !== '127.0.0.1' || url.origin === origin || url.username || url.password || url.hash) {
|
|
64
|
-
throw failure('
|
|
60
|
+
throw failure('Publication preview must use an isolated loopback origin');
|
|
65
61
|
}
|
|
66
62
|
} catch {
|
|
67
63
|
if (scope.preview === pending) delete scope.preview;
|
|
@@ -79,18 +75,18 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
79
75
|
return {
|
|
80
76
|
bindOrigin(value) { origin=value; },
|
|
81
77
|
async open(name,checkId,publicationId) {
|
|
82
|
-
if (closed || !origin) throw failure('
|
|
78
|
+
if (closed || !origin) throw failure('Local publication panel is unavailable');
|
|
83
79
|
projects.file(name); selectedId(checkId);
|
|
84
80
|
const account=platform.account(),session=platform.store.getSession();
|
|
85
81
|
const resume=Boolean(publicationId) || await drafts.hasRequest(name,checkId,account.user_id);
|
|
86
82
|
const context=await checkedTask(checkId,name,resume);
|
|
87
83
|
for (const [cap,existing] of scopes) if (!current(existing)) await retire(cap,existing);
|
|
88
|
-
if (scopes.size >= 32) throw failure('
|
|
84
|
+
if (scopes.size >= 32) throw failure('Close and reconnect Craft to reopen the local publication panel');
|
|
89
85
|
const scope={ name,check_task_id:checkId,check:context.task,project:context.project,owner:account.user_id,
|
|
90
86
|
platform:platform.base,token:session.token,created:now(),tasks:new Set() };
|
|
91
87
|
if (publicationId) {
|
|
92
88
|
const existing=await publications.status(name,selectedId(publicationId),account.user_id);
|
|
93
|
-
if (existing.check_task_id !== checkId) throw failure(
|
|
89
|
+
if (existing.check_task_id !== checkId) throw failure('Publication does not match this checked build',403);
|
|
94
90
|
scope.publication_id=publicationId;
|
|
95
91
|
}
|
|
96
92
|
requireCurrent(scope);
|
|
@@ -103,14 +99,14 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
103
99
|
async document(cap) {
|
|
104
100
|
const scope=await scopeFor(cap),runtime_url=await preview(scope);
|
|
105
101
|
scope.document_loaded=true;scope.document_preview_origin=runtime_url ? new URL(runtime_url).origin : undefined;
|
|
106
|
-
return { runtime_url,...(scope.preview_unavailable ? { preview_error:
|
|
102
|
+
return { runtime_url,...(scope.preview_unavailable ? { preview_error:'Local frozen preview is unavailable. Reload this page to retry; saved publication status remains available.' } : {}) };
|
|
107
103
|
},
|
|
108
104
|
async handle(cap,action,method,query,body) {
|
|
109
105
|
const scope=await scopeFor(cap);
|
|
110
106
|
const writing=['cover','prepare','review','submit'].includes(action);
|
|
111
|
-
if (method !== (writing ? 'POST' : 'GET')) throw failure('
|
|
107
|
+
if (method !== (writing ? 'POST' : 'GET')) throw failure('Publication method is not allowed',405);
|
|
112
108
|
const allowedQuery=action === 'task' ? ['task_id'] : action === 'status' ? ['publication_id'] : [];
|
|
113
|
-
if ([...query.keys()].some(key=>!allowedQuery.includes(key)) || allowedQuery.some(key=>query.getAll(key).length !== 1)) throw failure('
|
|
109
|
+
if ([...query.keys()].some(key=>!allowedQuery.includes(key)) || allowedQuery.some(key=>query.getAll(key).length !== 1)) throw failure('Invalid publication query');
|
|
114
110
|
if (action === 'state') {
|
|
115
111
|
const [options,draft,saved,previous]=await Promise.all([
|
|
116
112
|
platform.publicationSession(scope.owner)('options'),
|
|
@@ -122,38 +118,35 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
122
118
|
const runtime_url=scope.document_loaded && !scope.document_preview_origin ? undefined : await preview(scope); requireCurrent(scope);
|
|
123
119
|
const account=platform.account();
|
|
124
120
|
scope.previous=previous;
|
|
125
|
-
const target_version_published=draft.state === 'draft_ready' && previous?.published === true && previous.conversation_id === draft.conversation_id &&
|
|
126
|
-
previous.version_id === draft.version_id;
|
|
127
121
|
return { name:scope.name,check_task_id:scope.check_task_id,engine:scope.check.result.engine,platform:scope.platform,
|
|
128
|
-
account:{ user_id:account.user_id,nickname:account.nickname },draft,options,publication:saved,
|
|
122
|
+
account:{ user_id:account.user_id,nickname:account.nickname },draft,options,publication:saved,
|
|
129
123
|
...(previous ? { previous_publication:{ materials:previous.materials,cover_available:Boolean(previous.cover_url) } } : {}),
|
|
130
124
|
task_id:scope.task_id,runtime_url,preview_unavailable:scope.preview_unavailable === true,
|
|
131
|
-
...(scope.preview_unavailable ? { preview_error:
|
|
125
|
+
...(scope.preview_unavailable ? { preview_error:'Local frozen preview is unavailable. Reload this page to retry; saved publication status remains available.' } : {}) };
|
|
132
126
|
}
|
|
133
127
|
if (action === 'task') {
|
|
134
128
|
const id=selectedId(query.get('task_id'));
|
|
135
|
-
if (!scope.tasks.has(id)) throw failure('
|
|
129
|
+
if (!scope.tasks.has(id)) throw failure('Task does not belong to this page',403);
|
|
136
130
|
const result=viewTask(await tasks.get(id)); requireCurrent(scope); return result;
|
|
137
131
|
}
|
|
138
132
|
if (action === 'status') return publication(scope,query.get('publication_id'));
|
|
139
|
-
if (!writing) throw failure('
|
|
133
|
+
if (!writing) throw failure('Unknown publication action',404);
|
|
140
134
|
return mutate(scope.name,async()=>{
|
|
141
135
|
requireCurrent(scope);
|
|
142
136
|
if (action === 'cover') {
|
|
143
137
|
bodyFields(body,['data']);
|
|
144
138
|
if (typeof body.data !== 'string' || body.data.length > Math.ceil(2*1024*1024/3)*4 ||
|
|
145
|
-
!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(body.data)) throw failure(
|
|
139
|
+
!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(body.data)) throw failure('Cover must be a PNG/JPEG image of at most 2 MiB');
|
|
146
140
|
const data=Buffer.from(body.data,'base64');
|
|
147
|
-
if (!data.length || data.length > 2*1024*1024) throw failure(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (!
|
|
151
|
-
if (!coverDirectory) throw failure('本地封面暂存不可用。请重新连接 Craft MCP 后再试。');
|
|
141
|
+
if (!data.length || data.length > 2*1024*1024) throw failure('Cover must be a PNG/JPEG image of at most 2 MiB');
|
|
142
|
+
const extension=imageExtension(data);
|
|
143
|
+
if (!['png','jpg'].includes(extension)) throw failure('Cover must be a PNG or JPEG image');
|
|
144
|
+
if (!coverDirectory) throw failure('Local cover staging is unavailable');
|
|
152
145
|
coverRoot ??= privateDirectory(coverDirectory,projects.root);
|
|
153
146
|
const root=await coverRoot;
|
|
154
147
|
const directory=scope.cover_directory ?? path.join(root,cap);
|
|
155
148
|
await mkdir(directory,{ recursive:true,mode:0o700 });
|
|
156
|
-
if ((await lstat(directory)).isSymbolicLink() || await realpath(directory) !== directory) throw failure('
|
|
149
|
+
if ((await lstat(directory)).isSymbolicLink() || await realpath(directory) !== directory) throw failure('Invalid private cover directory');
|
|
157
150
|
scope.cover_directory=directory;
|
|
158
151
|
const id=randomUUID(),file=id+'.'+extension;
|
|
159
152
|
await writeFile(path.join(directory,file),data,{ flag:'wx',mode:0o600 });
|
|
@@ -165,9 +158,9 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
165
158
|
}
|
|
166
159
|
if (action === 'prepare') {
|
|
167
160
|
bodyFields(body,['materials','cover_id','reuse_previous_cover'],['materials']); publicationMaterials(body.materials);
|
|
168
|
-
if (body.materials.cover_path !== undefined) throw failure('
|
|
169
|
-
if (body.cover_id !== undefined && (typeof body.cover_id !== 'string' || body.cover_id !== scope.cover?.id)) throw failure('
|
|
170
|
-
if (body.reuse_previous_cover !== undefined && typeof body.reuse_previous_cover !== 'boolean') throw failure('
|
|
161
|
+
if (body.materials.cover_path !== undefined) throw failure('Choose a cover image on this local page');
|
|
162
|
+
if (body.cover_id !== undefined && (typeof body.cover_id !== 'string' || body.cover_id !== scope.cover?.id)) throw failure('Cover does not belong to this page',403);
|
|
163
|
+
if (body.reuse_previous_cover !== undefined && typeof body.reuse_previous_cover !== 'boolean') throw failure('Choose whether to reuse the previous cover');
|
|
171
164
|
const stagedCover=body.cover_id ? scope.cover : undefined;
|
|
172
165
|
const resume=await drafts.hasRequest(scope.name,scope.check_task_id,scope.owner);
|
|
173
166
|
const context=await checkedTask(scope.check_task_id,scope.name,resume);
|
|
@@ -195,7 +188,7 @@ export function createPublishPanel({ platform,projects,tasks,drafts,publications
|
|
|
195
188
|
requireCurrent(scope); return result;
|
|
196
189
|
}
|
|
197
190
|
bodyFields(body,['publication_id','revision','confirmed']);
|
|
198
|
-
if (typeof body.revision !== 'string' || !/^[0-9a-f]{64}$/.test(body.revision) || body.confirmed !== true) throw failure('
|
|
191
|
+
if (typeof body.revision !== 'string' || !/^[0-9a-f]{64}$/.test(body.revision) || body.confirmed !== true) throw failure('Confirm the exact reviewed publication revision');
|
|
199
192
|
await publication(scope,body.publication_id); requireCurrent(scope);
|
|
200
193
|
const task=await tasks.start(scope.name,'publish_submit',signal=>{
|
|
201
194
|
requireCurrent(scope);
|
|
@@ -21,11 +21,12 @@ import { Previews } from '../preview/local-static-preview.mjs';
|
|
|
21
21
|
import { openControlPanel } from './control-panel.mjs';
|
|
22
22
|
import { createPublishPanel } from './publish-panel.mjs';
|
|
23
23
|
import { openPublicationPreview } from './publication-preview.mjs';
|
|
24
|
-
import { loadEngineResources } from '../game-workflow/engines.mjs';
|
|
24
|
+
import { loadEngineResources, loadEngineResource } from '../game-workflow/engines.mjs';
|
|
25
25
|
import { assetCapabilities } from '../game-workflow/resource-catalog.mjs';
|
|
26
26
|
import { takeConnectorToken, ConnectorAuthStore, connectorLoginAction } from '../core/connector-auth.mjs';
|
|
27
27
|
import { generationFields, importFields, generationInputs, searchFields, importSource } from './asset-tools.mjs';
|
|
28
28
|
import { publicationTools } from './publication-tools.mjs';
|
|
29
|
+
import { clientIde } from '../integrations/hosts.mjs';
|
|
29
30
|
|
|
30
31
|
// Consume before any project/build subprocess can inherit the credential.
|
|
31
32
|
let connectorToken = takeConnectorToken();
|
|
@@ -41,7 +42,8 @@ if (connectorAuth) {
|
|
|
41
42
|
finally { connectorToken = undefined; }
|
|
42
43
|
}
|
|
43
44
|
const { instructions:guide, engines } = await loadEngineResources(resources);
|
|
44
|
-
const
|
|
45
|
+
const host = clientIde(process.env.CRAFT_CLIENT_IDE);
|
|
46
|
+
const projects = new Projects(root,state,engines,host); await projects.init();
|
|
45
47
|
const tasks = new Tasks(state); await tasks.init();
|
|
46
48
|
const previews = new Previews(state);
|
|
47
49
|
const leases = new ProjectLeases(root,name=>tasks.cancelProject(name)); await leases.init();
|
|
@@ -122,13 +124,12 @@ function viewTask(task) {
|
|
|
122
124
|
}
|
|
123
125
|
async function checkedTask(id, name, resumeUpload = false) {
|
|
124
126
|
const task = await tasks.get(id);
|
|
125
|
-
if (task.kind !== 'check' || task.status !== 'completed' || !task.result?.gate?.passed) throw new Error('
|
|
126
|
-
if (name !== undefined && task.name !== name) throw new Error('
|
|
127
|
+
if (task.kind !== 'check' || task.status !== 'completed' || !task.result?.gate?.passed) throw new Error('A completed passing game check is required');
|
|
128
|
+
if (name !== undefined && task.name !== name) throw new Error('Game check belongs to a different project');
|
|
127
129
|
const { project,engine } = await projects.describe(task.name);
|
|
128
130
|
await leases.acquire(task.name);
|
|
129
|
-
if (task.result.engine && task.result.engine !== engine) throw new Error('
|
|
130
|
-
if (tasks.busy(task.name)) throw new Error('
|
|
131
|
-
if (!resumeUpload && task.result.source !== await fingerprint(project)) throw new Error('验收后游戏文件已变更,请重新验收当前游戏。');
|
|
131
|
+
if (task.result.engine && task.result.engine !== engine) throw new Error('Game engine changed since verification');
|
|
132
|
+
if (tasks.busy(task.name) || (!resumeUpload && task.result.source !== await fingerprint(project))) throw new Error('Game changed since verification; check again');
|
|
132
133
|
return { task, project };
|
|
133
134
|
}
|
|
134
135
|
server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
@@ -151,10 +152,11 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
151
152
|
let result;
|
|
152
153
|
switch (definition.name) {
|
|
153
154
|
case 'craft_game_info': {
|
|
154
|
-
const project = args.name ? await projects.describe(args.name) : undefined;
|
|
155
|
+
const project = args.name ? await projects.describe(args.name,{allowUnbound:true}) : undefined;
|
|
155
156
|
if (project && args.engine && args.engine !== project.engine) throw new Error('Project engine is fixed to ' + project.engine);
|
|
156
|
-
const selected =
|
|
157
|
-
result = { version, workspace:root, platform:platform.base, engine:selected?.engine ?? null, supported_engines:Object.keys(engines),
|
|
157
|
+
const selected = project ? (project.context_binding.status === 'bound' ? await projects.resourcesFor(project) : undefined) : args.engine ? await loadEngineResource(resources,args.engine,engines[args.engine].bundle.id) : undefined;
|
|
158
|
+
result = { version, host, workspace:root, workspace_layout:'<workspace>/<name>', platform:platform.base, engine:project?.engine ?? selected?.engine ?? null, supported_engines:Object.keys(engines),
|
|
159
|
+
context_binding:project?.context_binding,
|
|
158
160
|
project:project?.project, preview:project ? await previews.status(project.project) : undefined,
|
|
159
161
|
llm:'external AI IDE host', images:'Craft platform', aigc:assetCapabilities(selected?.engine),library:libraryCapabilities(selected?.engine),publishing:true,draft_upload:true,
|
|
160
162
|
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' },
|
|
@@ -164,8 +166,8 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
164
166
|
case 'craft_game_prepare': result = await tasks.start(args.name,'prepare',async signal=>{
|
|
165
167
|
const project = await projects.prepare(args.name,args.engine,signal);
|
|
166
168
|
await installProjectDependencies(project.project,undefined,signal);
|
|
167
|
-
const selected =
|
|
168
|
-
return { ...project, instructions:selected.instructions, context:selected.context, next:'
|
|
169
|
+
const selected = await projects.resourcesFor(project);
|
|
170
|
+
return { ...project, workspace:root, instructions:selected.instructions, context:selected.context, next:'Open project as the host working directory. Read context.workflow, context.engine.entrypoint and context.engine.skills_index. Select skills by their descriptions and read their entrypoints relative to context.engine.directory. The project AGENTS.md and native craft-project skill restore this pinned context in later sessions. Implement, check, review and deliver.' };
|
|
169
171
|
}); break;
|
|
170
172
|
case 'craft_assets_generate': {
|
|
171
173
|
const inputs=generationInputs(args);
|
|
@@ -199,8 +201,9 @@ server.setRequestHandler(CallToolRequestSchema,async request=>{
|
|
|
199
201
|
}
|
|
200
202
|
case 'craft_game_check': {
|
|
201
203
|
validateSteps(args.steps);
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
+
const description = await projects.describe(args.name), {project,engine} = description;
|
|
205
|
+
const bound = await projects.resourcesFor(description);
|
|
206
|
+
const selected = {...resourcePaths,engine,context:bound.context.engine.directory};
|
|
204
207
|
result = await tasks.start(args.name,'check',signal=>checkGame(project,selected,args.brief,args.steps,signal)); break;
|
|
205
208
|
}
|
|
206
209
|
case 'craft_task_status': result = viewTask(await tasks.get(args.task_id,args.wait_ms ?? 15000)); break;
|
|
@@ -7,18 +7,25 @@ import { atomicJson } from '../game-workflow/request-store.mjs';
|
|
|
7
7
|
|
|
8
8
|
// Executed by the external host terminal, never by the MCP server.
|
|
9
9
|
const run=process.argv[2];
|
|
10
|
+
const managed=process.argv[3]==='--managed';
|
|
10
11
|
try {
|
|
11
12
|
if(!run || !path.isAbsolute(run))throw new Error('Pass the absolute preview launch directory');
|
|
13
|
+
if(process.argv[3] && !managed)throw new Error('Unknown preview launch mode');
|
|
12
14
|
await writeFile(path.join(run,'stderr.log'),'',{flag:'a',mode:0o600});
|
|
13
15
|
const env={PATH:path.dirname(process.execPath)};
|
|
14
16
|
for(const name of ['SystemRoot','WINDIR','TEMP','TMP'])if(process.env[name])env[name]=process.env[name];
|
|
15
17
|
const child=spawn(process.execPath,[fileURLToPath(new URL('./preview-worker.mjs',import.meta.url)),run],{
|
|
16
|
-
cwd:run,detached
|
|
18
|
+
cwd:run,detached:!managed,windowsHide:true,stdio:'ignore',env,
|
|
17
19
|
});
|
|
18
|
-
|
|
20
|
+
const closed=managed ? once(child,'exit') : null;
|
|
21
|
+
await once(child,'spawn');
|
|
22
|
+
if(!managed)child.unref();
|
|
23
|
+
// Keep the host's background task alive; WorkBuddy reclaims descendants when its terminal task exits.
|
|
24
|
+
if(managed)for(const signal of ['SIGINT','SIGTERM'])process.once(signal,()=>child.kill(signal));
|
|
19
25
|
const receipt=JSON.stringify({status:'starting',pid:child.pid,next:'Poll craft_game_info(name).preview and verify its snapshot before reporting a URL.'})+'\n';
|
|
20
26
|
await writeFile(path.join(run,'stdout.log'),receipt,{flag:'a',mode:0o600});
|
|
21
27
|
process.stdout.write(receipt);
|
|
28
|
+
if(managed){const [code]=await closed;process.exitCode=code ?? 1;}
|
|
22
29
|
} catch(error) {
|
|
23
30
|
const message=String(error.message).slice(0,2000);
|
|
24
31
|
if(run&&path.isAbsolute(run))await atomicJson(path.join(run,'error.json'),{message}).catch(()=>{});
|
|
@@ -2,11 +2,11 @@ import path from 'node:path';
|
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
|
|
4
4
|
export function hostStart(run) {
|
|
5
|
-
const command=process.execPath,args=[fileURLToPath(new URL('./preview-launcher.mjs',import.meta.url)),run];
|
|
5
|
+
const command=process.execPath,args=[fileURLToPath(new URL('./preview-launcher.mjs',import.meta.url)),run,'--managed'];
|
|
6
6
|
const stdout=path.join(run,'stdout.log'),stderr=path.join(run,'stderr.log');
|
|
7
7
|
const quote=value=>"'"+value.replaceAll("'",process.platform==='win32'?"''":"'\\''")+"'";
|
|
8
8
|
const script=(process.platform==='win32'?'& ':'')+[command,...args].map(quote).join(' ');
|
|
9
9
|
return {command,args,cwd:run,background:true,shell:process.platform==='win32'?'powershell':'sh',script,
|
|
10
10
|
logs:{stdout,stderr,events:path.join(run,'events.jsonl')},
|
|
11
|
-
next:'Run this command
|
|
11
|
+
next:'Run this long-lived command in a host background terminal and keep that task alive. Do not wait for terminal completion before polling craft_game_info(name).preview until running=true and its snapshot matches this delivery. Verify the page before reporting its live URL. Stopping the terminal may stop the preview; use this command again if needed.'};
|
|
12
12
|
}
|
|
@@ -2,25 +2,25 @@ const idPattern = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
|
2
2
|
const hashPattern = /^[0-9a-f]{64}$/;
|
|
3
3
|
|
|
4
4
|
function identifier(value) {
|
|
5
|
-
if (typeof value !== 'string' || !idPattern.test(value)) throw new Error('
|
|
5
|
+
if (typeof value !== 'string' || !idPattern.test(value)) throw new Error('Invalid publication identifier');
|
|
6
6
|
return value;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
function imageURL(value, token, base) {
|
|
10
|
-
if (typeof value !== 'string' || value.includes(token)) throw new Error('
|
|
10
|
+
if (typeof value !== 'string' || value.includes(token)) throw new Error('Invalid publication image URL');
|
|
11
11
|
const url = new URL(value);
|
|
12
12
|
if (url.username || url.password || url.hash || url.search ||
|
|
13
13
|
(url.protocol !== 'https:' && !(url.protocol === 'http:' && new URL(base).hostname === '127.0.0.1' && url.hostname === '127.0.0.1'))) {
|
|
14
|
-
throw new Error('
|
|
14
|
+
throw new Error('Invalid publication image URL');
|
|
15
15
|
}
|
|
16
16
|
return url.href;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function previousPublication(data, conversationId, owner, token, base) {
|
|
20
|
-
if (!data || typeof data !== 'object' || !Object.hasOwn(data,'share_info')) throw new Error('
|
|
20
|
+
if (!data || typeof data !== 'object' || !Object.hasOwn(data,'share_info')) throw new Error('Invalid publication history response');
|
|
21
21
|
const previous = data.share_info;
|
|
22
22
|
if (previous === null) return;
|
|
23
|
-
if (previous?.conversation_id !== conversationId || previous.user_id !== owner) throw new Error('
|
|
23
|
+
if (previous?.conversation_id !== conversationId || previous.user_id !== owner) throw new Error('Publication history belongs to a different project or account');
|
|
24
24
|
if (!['share_completed','share_delisted'].includes(previous.status)) return;
|
|
25
25
|
|
|
26
26
|
const text = value => typeof value === 'string' && !value.includes(token) ? value : '';
|
|
@@ -28,23 +28,23 @@ function previousPublication(data, conversationId, owner, token, base) {
|
|
|
28
28
|
let tags, cover;
|
|
29
29
|
try { tags = JSON.parse(previous.game_tags); } catch { /* Old releases may have no category metadata. */ }
|
|
30
30
|
try { cover = imageURL(previous.cover_image_cos,token,base); } catch { /* Legacy covers may be unavailable. */ }
|
|
31
|
-
return { conversation_id:conversationId,version_id:identifier(previous.version_id),
|
|
31
|
+
return { conversation_id:conversationId,version_id:identifier(previous.version_id),
|
|
32
32
|
materials:{ game_name:text(previous.game_name),instructions:text(previous.instructions),game_type:text(tags?.game_type),
|
|
33
33
|
art_styles:list(tags?.art_styles),play_tags:list(Array.isArray(tags) ? tags : tags?.play_tags) },
|
|
34
34
|
...(cover ? { cover_url:cover } : {}),cover_image_source:previous.cover_image_source === 1 ? 1 : 2 };
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export function publicationSession({ base, token, owner, current, http }) {
|
|
38
|
-
if (new URL(base).pathname !== '/') throw new Error('Craft
|
|
38
|
+
if (new URL(base).pathname !== '/') throw new Error('Publication requires a Craft platform origin');
|
|
39
39
|
return async (kind, options = {}, signal) => {
|
|
40
|
-
if (!current()) throw new Error('Craft
|
|
40
|
+
if (!current()) throw new Error('Craft account changed');
|
|
41
41
|
let endpoint, method = 'GET', body, form;
|
|
42
42
|
if (kind === 'options') endpoint = '/api/ms/gamemeta/game-style';
|
|
43
43
|
else if (kind === 'image') {
|
|
44
44
|
const { image, conversation_id, version_id, external_manifest_sha256, purpose } = options;
|
|
45
45
|
if (!['cover','screenshot','audit-shot'].includes(purpose) || !hashPattern.test(external_manifest_sha256) ||
|
|
46
46
|
!Buffer.isBuffer(image?.data) || !image.data.length || image.data.length > 2 * 1024 * 1024 ||
|
|
47
|
-
!['png','jpg'].includes(image.extension)) throw new Error('
|
|
47
|
+
!['png','jpg'].includes(image.extension)) throw new Error('Invalid publication image');
|
|
48
48
|
endpoint = '/api/ms/versions/share-cover'; method = 'POST';
|
|
49
49
|
form = new FormData();
|
|
50
50
|
for (const [key,value] of Object.entries({ conversation_id:identifier(conversation_id), version_id:identifier(version_id), external_manifest_sha256, purpose })) form.set(key,value);
|
|
@@ -52,25 +52,25 @@ export function publicationSession({ base, token, owner, current, http }) {
|
|
|
52
52
|
} else if (kind === 'submit') {
|
|
53
53
|
endpoint = '/api/ms/versions/share'; method = 'POST'; body = options.input;
|
|
54
54
|
identifier(body?.client_request_id); identifier(body?.conversation_id); identifier(body?.version_id);
|
|
55
|
-
if (!hashPattern.test(body.external_manifest_sha256)) throw new Error('
|
|
55
|
+
if (!hashPattern.test(body.external_manifest_sha256)) throw new Error('Invalid publication manifest');
|
|
56
56
|
} else if (kind === 'status') endpoint = `/api/ms/versions/${identifier(options.version_id)}/detail`;
|
|
57
57
|
else if (kind === 'previous') endpoint = `/api/ms/conversations/${identifier(options.conversation_id)}/publish-context`;
|
|
58
|
-
else throw new Error('
|
|
58
|
+
else throw new Error('Unknown publication operation');
|
|
59
59
|
const data = await http(endpoint,method,body,signal,{ form,draft:true,businessErrors:true,bare:kind === 'options' });
|
|
60
|
-
if (!current()) throw new Error('
|
|
60
|
+
if (!current()) throw new Error('Craft account changed during publication');
|
|
61
61
|
if (kind === 'options') {
|
|
62
|
-
if (!data || typeof data !== 'object' || Array.isArray(data)) throw new Error('
|
|
62
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) throw new Error('Invalid publication category response');
|
|
63
63
|
const result = {};
|
|
64
64
|
for (const key of ['game_types','art_styles','play_tags']) {
|
|
65
|
-
if (!data || !Object.hasOwn(data,key)) throw new Error('
|
|
65
|
+
if (!data || !Object.hasOwn(data,key)) throw new Error('Invalid publication category response');
|
|
66
66
|
const values = data[key] ?? [];
|
|
67
|
-
if (!Array.isArray(values) || values.length > 200 || values.some(item=>typeof item !== 'string' || item.length > 100 || item.includes(token))) throw new Error('
|
|
67
|
+
if (!Array.isArray(values) || values.length > 200 || values.some(item=>typeof item !== 'string' || item.length > 100 || item.includes(token))) throw new Error('Invalid publication category response');
|
|
68
68
|
result[key] = values;
|
|
69
69
|
}
|
|
70
70
|
return result;
|
|
71
71
|
}
|
|
72
72
|
if (kind === 'image') {
|
|
73
|
-
if (!hashPattern.test(data?.sha256) || data.bytes !== options.image.data.length) throw new Error('
|
|
73
|
+
if (!hashPattern.test(data?.sha256) || data.bytes !== options.image.data.length) throw new Error('Invalid publication material receipt');
|
|
74
74
|
return { cover_url:imageURL(data.cover_url,token,base),material_id:identifier(data.material_id),sha256:data.sha256,bytes:data.bytes };
|
|
75
75
|
}
|
|
76
76
|
if (kind === 'submit') return { accepted:true };
|
|
@@ -79,7 +79,7 @@ export function publicationSession({ base, token, owner, current, http }) {
|
|
|
79
79
|
if (!publication) return { state:'not_submitted', version_id:options.version_id };
|
|
80
80
|
if (publication.version_id !== options.version_id || !hashPattern.test(publication.external_manifest_sha256) ||
|
|
81
81
|
!hashPattern.test(publication.request_sha256) || typeof publication.status !== 'string' || !/^[a-z_]{1,48}$/.test(publication.status)) {
|
|
82
|
-
throw new Error('
|
|
82
|
+
throw new Error('Invalid publication status response');
|
|
83
83
|
}
|
|
84
84
|
const result = { client_request_id:identifier(publication.client_request_id),request_sha256:publication.request_sha256,
|
|
85
85
|
external_manifest_sha256:publication.external_manifest_sha256,version_id:publication.version_id,
|
|
@@ -87,13 +87,13 @@ export function publicationSession({ base, token, owner, current, http }) {
|
|
|
87
87
|
status_reason:typeof publication.status_reason === 'string' ? publication.status_reason.split(token).join('[REDACTED]').slice(0,1000) : '' };
|
|
88
88
|
if (publication.finalization_retry_required !== undefined) {
|
|
89
89
|
if (typeof publication.finalization_retry_required !== 'boolean' ||
|
|
90
|
-
(publication.finalization_retry_required && result.state !== 'sharing')) throw new Error('
|
|
90
|
+
(publication.finalization_retry_required && result.state !== 'sharing')) throw new Error('Invalid publication finalization state');
|
|
91
91
|
result.finalization_retry_required = publication.finalization_retry_required;
|
|
92
92
|
}
|
|
93
93
|
if (publication.public_url !== undefined && publication.public_url !== '') {
|
|
94
94
|
const url = new URL(publication.public_url);
|
|
95
95
|
if (result.state !== 'share_completed' || publication.published_version_id !== options.version_id ||
|
|
96
|
-
url.origin !== new URL(base).origin || url.username || url.password || publication.public_url.includes(token)) throw new Error('
|
|
96
|
+
url.origin !== new URL(base).origin || url.username || url.password || publication.public_url.includes(token)) throw new Error('Publication URL does not match the completed version');
|
|
97
97
|
result.public_url = url.href;
|
|
98
98
|
}
|
|
99
99
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craft_eco/craft-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.12.0"
|
|
@@ -12,10 +12,16 @@
|
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
13
13
|
"playwright": "1.63.0",
|
|
14
14
|
"proper-lockfile": "4.1.2",
|
|
15
|
+
"smol-toml": "1.9.1",
|
|
16
|
+
"yaml": "2.8.1",
|
|
15
17
|
"@vscode/ripgrep": "^1.18.0",
|
|
16
18
|
"ws": "^8.21.3"
|
|
17
19
|
},
|
|
18
20
|
"description": "Craft 2D/Phaser and 3D/Three.js game-making MCP for AI IDEs supporting stdio",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://git.woa.com/EcoGame/WXUP/WXUPAgent/CraftCli.git"
|
|
24
|
+
},
|
|
19
25
|
"bin": {
|
|
20
26
|
"craft-mcp": "bin/craft-mcp.mjs"
|
|
21
27
|
},
|
|
@@ -32,5 +38,7 @@
|
|
|
32
38
|
"registry": "https://registry.npmjs.org/",
|
|
33
39
|
"access": "public"
|
|
34
40
|
},
|
|
35
|
-
"
|
|
41
|
+
"craft": {
|
|
42
|
+
"platform": "https://test.craft.qq.com"
|
|
43
|
+
}
|
|
36
44
|
}
|