@craft_eco/craft-mcp 0.0.0-stage → 0.1.14
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 +32 -2
- package/bin/craft-mcp.mjs +7 -0
- package/dist-server/core/app-paths.mjs +15 -0
- package/dist-server/core/auth-store.mjs +70 -0
- package/dist-server/core/connector-auth.mjs +30 -0
- package/dist-server/core/http-utils.mjs +14 -0
- package/dist-server/game-workflow/asset-formats.mjs +76 -0
- package/dist-server/game-workflow/asset-import.mjs +113 -0
- package/dist-server/game-workflow/asset-inputs.mjs +10 -0
- package/dist-server/game-workflow/assets.mjs +161 -0
- package/dist-server/game-workflow/capture-worker.mjs +14 -0
- package/dist-server/game-workflow/check.mjs +74 -0
- package/dist-server/game-workflow/draft-archive.mjs +91 -0
- package/dist-server/game-workflow/draft-bindings.mjs +35 -0
- package/dist-server/game-workflow/draft-uploads.mjs +207 -0
- package/dist-server/game-workflow/engines.mjs +30 -0
- package/dist-server/game-workflow/library-assets.mjs +77 -0
- package/dist-server/game-workflow/library-candidates.mjs +37 -0
- package/dist-server/game-workflow/library-catalog.mjs +45 -0
- package/dist-server/game-workflow/project-leases.mjs +52 -0
- package/dist-server/game-workflow/projects.mjs +92 -0
- package/dist-server/game-workflow/publication-materials.mjs +67 -0
- package/dist-server/game-workflow/publications.mjs +146 -0
- package/dist-server/game-workflow/publish-capture-worker.mjs +57 -0
- package/dist-server/game-workflow/publish-capture.mjs +75 -0
- package/dist-server/game-workflow/request-store.mjs +52 -0
- package/dist-server/game-workflow/resource-catalog.mjs +97 -0
- package/dist-server/game-workflow/tasks.mjs +93 -0
- package/dist-server/mcp/asset-tools.mjs +42 -0
- package/dist-server/mcp/control-panel.html +17 -0
- package/dist-server/mcp/control-panel.mjs +40 -0
- package/dist-server/mcp/publication-tools.mjs +19 -0
- package/dist-server/mcp/server.mjs +297 -0
- package/dist-server/mcp/start.mjs +20 -0
- package/dist-server/preview/local-static-preview.mjs +71 -0
- package/dist-server/preview/preview-control.mjs +35 -0
- package/dist-server/preview/preview-launcher.mjs +26 -0
- package/dist-server/preview/preview-snapshot.mjs +35 -0
- package/dist-server/preview/preview-start.mjs +12 -0
- package/dist-server/preview/preview-worker.mjs +68 -0
- package/dist-server/upstream/craft-aigc.mjs +197 -0
- package/dist-server/upstream/library-url.mjs +14 -0
- package/dist-server/upstream/publication-transport.mjs +80 -0
- package/package.json +33 -4
- package/resources/craft-game-maker/SKILL.md +67 -0
- package/resources/craft-game-maker/js.md +9 -0
- package/resources/craft-game-maker/js3d.md +12 -0
- package/resources/game_visual_qa.mjs +1143 -0
- package/resources/js/context/CLAUDE.md +54 -0
- package/resources/js/context/agents/aigc-manager.md +91 -0
- package/resources/js/context/hooks/hooks.json +20 -0
- package/resources/js/context/knowledge/AigcEnabled.md +41 -0
- package/resources/js/context/knowledge/AigcWiring.md +200 -0
- package/resources/js/context/knowledge/AssetUrl.md +24 -0
- package/resources/js/context/knowledge/FrontendComponents.md +23 -0
- package/resources/js/context/knowledge/GameProbe.md +74 -0
- package/resources/js/context/knowledge/Lifecycle.md +27 -0
- package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -0
- package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +115 -0
- package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +392 -0
- package/resources/js/context/knowledge/PlatformServices.md +184 -0
- package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -0
- package/resources/js/context/knowledge/Ui.md +11 -0
- package/resources/js/context/knowledge/UiEditorCompat.md +21 -0
- package/resources/js/context/rules/MultiplayerCapability.md +23 -0
- package/resources/js/context/rules/MultiplayerRoomEntryUX.md +63 -0
- package/resources/js/context/rules/PlatformBoundaryModules.md +43 -0
- package/resources/js/context/skills/aigc-generate/SKILL.md +301 -0
- package/resources/js/context/skills/aigc-generate/knowledge/audio.md +39 -0
- package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +14 -0
- package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +129 -0
- package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +54 -0
- package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +50 -0
- package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +201 -0
- package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +53 -0
- package/resources/js/context/skills/aigc-generate/scripts/apply-results.mjs +83 -0
- package/resources/js/context/skills/aigc-generate/scripts/config.json +29 -0
- package/resources/js/context/skills/aigc-generate/scripts/generate.mjs +1016 -0
- package/resources/js/context/skills/aigc-generate/scripts/lib/client.mjs +228 -0
- package/resources/js/context/skills/aigc-generate/scripts/lib/ledger.mjs +119 -0
- package/resources/js/context/skills/aigc-generate/scripts/lib/nstep-handoff.mjs +100 -0
- package/resources/js/context/skills/aigc-generate/scripts/lib/pipelines.mjs +441 -0
- package/resources/js/context/skills/aigc-generate/scripts/lib/queue.mjs +283 -0
- package/resources/js/context/skills/aigc-generate/scripts/lib/submit.mjs +122 -0
- package/resources/js/context/skills/aigc-generate/scripts/worker.mjs +171 -0
- package/resources/js/context/skills/asset-search/SKILL.md +73 -0
- package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +62 -0
- package/resources/js/context/skills/asset-search/scripts/config.json +5 -0
- package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +125 -0
- package/resources/js/context/skills/asset-search/scripts/recalled_sprite_paths.mjs +47 -0
- package/resources/js/context/skills/asset-search/scripts/search.mjs +749 -0
- package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +723 -0
- package/resources/js/context/skills/asset-search/strategies/audio.md +34 -0
- package/resources/js/context/skills/asset-search/strategies/character2d.md +33 -0
- package/resources/js/context/skills/asset-search/strategies/effect2d.md +31 -0
- package/resources/js/context/skills/asset-search/strategies/texture-prop.md +22 -0
- package/resources/js/context/skills/asset-search/strategies/texture-ui.md +35 -0
- package/resources/js/context/skills/asset-search/strategies/ui-common.md +40 -0
- package/resources/js/context/skills/asset-search/strategies/ui-style.md +28 -0
- package/resources/js/context/skills/display-info-setup/SKILL.md +32 -0
- package/resources/js/context/skills/display-info-setup/scripts/init_project.mjs +38 -0
- package/resources/js/context/skills/export-config/SKILL.md +20 -0
- package/resources/js/context/skills/export-config/scripts/assert-asset-wiring.mjs +72 -0
- package/resources/js/context/skills/export-config/scripts/export-config.mjs +43 -0
- package/resources/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/js/context/skills/export-config/scripts/sync-asset-controls.mjs +351 -0
- package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +163 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +92 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +7 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +22 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform.mjs +29 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/release.json +37 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.mjs +8 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +32 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +50 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +121 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +254 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +99 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +14 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +172 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +165 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +20 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +4 -0
- package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +109 -0
- package/resources/js/context/skills/mobile-adaptation/SKILL.md +260 -0
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +50 -0
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +881 -0
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -0
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -0
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +134 -0
- package/resources/js/context/skills/mobile-adaptation/references/input-config.md +311 -0
- package/resources/js/context/skills/mobile-adaptation/references/verification.md +106 -0
- package/resources/js/context/skills/optimization-suggestions/SKILL.md +89 -0
- package/resources/js/context/skills/platform-services/SKILL.md +94 -0
- package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +783 -0
- package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +57 -0
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -0
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -0
- package/resources/js/context/skills/platform-services/assets/modules/log.ts +35 -0
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +25 -0
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +1 -0
- package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +49 -0
- package/resources/js/context/skills/platform-services/assets/modules/save.mjs +1 -0
- package/resources/js/context/skills/platform-services/assets/release.json +44 -0
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -0
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -0
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -0
- package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +139 -0
- package/resources/js/context/skills/platform-services/references/api_reference.md +18 -0
- package/resources/js/context/skills/platform-services/scripts/install.mjs +134 -0
- package/resources/js/context/skills/resolution-adaptation/SKILL.md +202 -0
- package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +121 -0
- package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +254 -0
- package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +98 -0
- package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +200 -0
- package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +134 -0
- package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +119 -0
- package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +338 -0
- package/resources/js/context/skills/scene-editor-compat/SKILL.md +94 -0
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +13 -0
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +6 -0
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +25 -0
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +18 -0
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +7 -0
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +42 -0
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +144 -0
- package/resources/js/context/skills/scene-editor-compat/docs/contract.md +330 -0
- package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +64 -0
- package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +28 -0
- package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +47 -0
- package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +64 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +38 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +9 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +59 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +30 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +66 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +20 -0
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +26 -0
- package/resources/js/context/skills/scene-editor-compat/references/contract.md +73 -0
- package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +162 -0
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +853 -0
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +173 -0
- package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +427 -0
- package/resources/js/context/skills/scene-editor-compat/version.json +1 -0
- package/resources/js/context/skills/ui-editor-compat/SKILL.md +48 -0
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -0
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +74 -0
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -0
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -0
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -0
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +7 -0
- package/resources/js/context/skills/ui-editor-compat/references/contract.md +132 -0
- package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -0
- package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -0
- package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -0
- package/resources/js/context/skills/version-update/SKILL.md +192 -0
- package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -0
- package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +159 -0
- package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +157 -0
- package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js/context/skills/visual-qa/SKILL.md +36 -0
- package/resources/js/context/version/version.json +1 -0
- package/resources/js/project/.gitattributes +2 -0
- package/resources/js/project/README.md +99 -0
- 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 +6 -0
- package/resources/js/project/SPEC/res/.gitkeep +0 -0
- package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
- package/resources/js/project/configs/assets.json +1 -0
- package/resources/js/project/configs/game.controls.json +3 -0
- package/resources/js/project/configs/game.json +3 -0
- package/resources/js/project/game-runtime.json +7 -0
- package/resources/js/project/gameplay-probe.json +37 -0
- package/resources/js/project/index.html +20 -0
- package/resources/js/project/package-lock.json +1155 -0
- package/resources/js/project/package.json +23 -0
- package/resources/js/project/projectDisplayInfo.json +7 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +29 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/release.json +37 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +8 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
- package/resources/js/project/scripts/config-export.mjs +32 -0
- package/resources/js/project/scripts/refresh-runtime.mjs +50 -0
- package/resources/js/project/src/display/ui-stage.ts +121 -0
- package/resources/js/project/src/display/viewport.ts +254 -0
- package/resources/js/project/src/main.ts +99 -0
- package/resources/js/project/src/platform.ts +14 -0
- package/resources/js/project/src/scenes/LoadScene.ts +89 -0
- package/resources/js/project/src/scenes/PlayScene.ts +17 -0
- package/resources/js/project/src/screenUi.ts +172 -0
- package/resources/js/project/src/style.css +165 -0
- package/resources/js/project/tsconfig.json +20 -0
- package/resources/js/project/unified_data_control_config.json +20 -0
- package/resources/js/project/vendor/core-manager-js/package.json +33 -0
- package/resources/js/project/vendor/core-manager-js/src/.versions.json +42 -0
- package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +41 -0
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +90 -0
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +203 -0
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +106 -0
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +25 -0
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +21 -0
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +65 -0
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +340 -0
- package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +87 -0
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +92 -0
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +271 -0
- package/resources/js/project/vendor/core-manager-js/src/index.ts +31 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +81 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +43 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +32 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +141 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +20 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +183 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +304 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +351 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +180 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +13 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +14 -0
- package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +68 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +433 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +118 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +444 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +485 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +66 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +149 -0
- package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +9 -0
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +29 -0
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +88 -0
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +122 -0
- package/resources/js/project/vendor/core-manager-js/src/runtime.ts +24 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +318 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +151 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +235 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +98 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +94 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +209 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +106 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +341 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +68 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +236 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +22 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +29 -0
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +197 -0
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +9 -0
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +555 -0
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +112 -0
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +178 -0
- package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +246 -0
- package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +139 -0
- package/resources/js/project/vendor/core-manager-js/tsconfig.json +15 -0
- package/resources/js/project/vendor/run.sh +107 -0
- package/resources/js/project/version/craft_feature_version.json +42 -0
- package/resources/js/project/version/project_feature_version.json +11 -0
- package/resources/js/project/vite.config.ts +4 -0
- package/resources/js3d/context/CLAUDE.md +50 -0
- package/resources/js3d/context/hooks/hooks.json +20 -0
- package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +87 -0
- package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +69 -0
- package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +42 -0
- package/resources/js3d/context/knowledge/FrontendComponents.md +23 -0
- package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -0
- package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +117 -0
- package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +430 -0
- package/resources/js3d/context/knowledge/PlatformServices.md +162 -0
- package/resources/js3d/context/knowledge/Runtime.md +30 -0
- package/resources/js3d/context/knowledge/SceneEditorCompat.md +34 -0
- package/resources/js3d/context/knowledge/StepByStep.md +21 -0
- package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -0
- package/resources/js3d/context/knowledge/UiEditorCompat.md +21 -0
- package/resources/js3d/context/rules/MultiplayerCapability.md +27 -0
- package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +63 -0
- package/resources/js3d/context/rules/PlatformBoundaryModules.md +43 -0
- package/resources/js3d/context/skills/aigc-integration/SKILL.md +176 -0
- package/resources/js3d/context/skills/aigc-integration/callback.md +56 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +22 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +38 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +33 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +36 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +37 -0
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +35 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/config.json +3 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/lib/submit.mjs +344 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/query-music.mjs +53 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/query-results.mjs +53 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-cover.mjs +44 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-image.mjs +48 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-music.mjs +34 -0
- package/resources/js3d/context/skills/aigc-integration/scripts/submit-staticmesh.mjs +39 -0
- package/resources/js3d/context/skills/asset-search/SKILL.md +159 -0
- package/resources/js3d/context/skills/asset-search/references/resource-config.md +56 -0
- package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +62 -0
- package/resources/js3d/context/skills/asset-search/scripts/config.json +213 -0
- package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +885 -0
- package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +79 -0
- package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +74 -0
- package/resources/js3d/context/skills/asset-search/scripts/search.mjs +597 -0
- package/resources/js3d/context/skills/export-config/scripts/assert-asset-wiring.mjs +83 -0
- package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +53 -0
- package/resources/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
- package/resources/js3d/context/skills/export-config/scripts/sync-asset-controls.mjs +325 -0
- package/resources/js3d/context/skills/export-config/scripts/sync-scene-assets.mjs +181 -0
- package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +163 -0
- package/resources/js3d/context/skills/game-art-style/SKILL.md +60 -0
- 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 +38 -0
- package/resources/js3d/context/skills/game-art-style/references/construction.md +111 -0
- package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +105 -0
- package/resources/js3d/context/skills/game-art-style/references/sources.md +25 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +175 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +168 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +191 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +165 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +173 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +185 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +181 -0
- package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +189 -0
- package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +88 -0
- package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +284 -0
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +104 -0
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +952 -0
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -0
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -0
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +256 -0
- package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +311 -0
- package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +106 -0
- package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +74 -0
- package/resources/js3d/context/skills/platform-services/SKILL.md +94 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +783 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +57 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +35 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +25 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +1 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +49 -0
- package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +1 -0
- package/resources/js3d/context/skills/platform-services/assets/release.json +44 -0
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -0
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -0
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -0
- package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +139 -0
- package/resources/js3d/context/skills/platform-services/references/api_reference.md +18 -0
- package/resources/js3d/context/skills/platform-services/scripts/install.mjs +134 -0
- package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +170 -0
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +121 -0
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +244 -0
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +127 -0
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +188 -0
- package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +124 -0
- package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +117 -0
- package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +338 -0
- package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +599 -0
- package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +141 -0
- package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +92 -0
- package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +125 -0
- package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +113 -0
- package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +1187 -0
- package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +52 -0
- package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +4 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +94 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +50 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +105 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +147 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +79 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +56 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +51 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +55 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +78 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +84 -0
- package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +120 -0
- package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +4 -0
- package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +238 -0
- package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +59 -0
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -0
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +61 -0
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -0
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -0
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -0
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +7 -0
- package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +110 -0
- package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -0
- package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -0
- package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -0
- package/resources/js3d/context/skills/version-update/SKILL.md +191 -0
- package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -0
- package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +159 -0
- package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +157 -0
- package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js3d/context/version/version.json +1 -0
- package/resources/js3d/project/.gitattributes +2 -0
- package/resources/js3d/project/README.md +100 -0
- package/resources/js3d/project/configs/game.controls.json +3 -0
- package/resources/js3d/project/configs/game.json +3 -0
- package/resources/js3d/project/game-runtime.json +7 -0
- package/resources/js3d/project/gameplay-probe.json +38 -0
- package/resources/js3d/project/index.html +12 -0
- package/resources/js3d/project/package-lock.json +1204 -0
- package/resources/js3d/project/package.json +24 -0
- package/resources/js3d/project/projectDisplayInfo.json +7 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +30 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +39 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +7 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +36 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +359 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.test.mjs +25 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
- package/resources/js3d/project/scripts/config-export.mjs +32 -0
- package/resources/js3d/project/scripts/refresh-runtime.mjs +50 -0
- package/resources/js3d/project/src/display/ui-stage.ts +121 -0
- package/resources/js3d/project/src/display/viewport.ts +244 -0
- package/resources/js3d/project/src/main.ts +83 -0
- package/resources/js3d/project/src/platform.ts +14 -0
- package/resources/js3d/project/src/style.css +17 -0
- package/resources/js3d/project/tsconfig.json +20 -0
- package/resources/js3d/project/unified_data_control_config.json +20 -0
- package/resources/js3d/project/vendor/core-manager-three/package.json +12 -0
- package/resources/js3d/project/vendor/core-manager-three/src/index.ts +2 -0
- package/resources/js3d/project/vendor/run.sh +4 -0
- package/resources/js3d/project/version/craft_feature_version.json +42 -0
- package/resources/js3d/project/version/project_feature_version.json +11 -0
- package/resources/js3d/project/vite.config.ts +4 -0
- package/vendor/agent-cli/dist/runtime-tools/registry.json +6 -0
- package/vendor/agent-cli/dist/runtime-tools/tool-bundle-types.d.cts +15 -0
- package/vendor/agent-cli/dist/runtime-tools/tool-bundle.cjs +129 -0
- package/vendor/agent-cli/dist/runtime-tools/ue/blender-cook-assets.cjs +296 -0
- package/vendor/agent-cli/dist/runtime-tools/ue/context-adapter.cjs +48 -0
- package/vendor/agent-cli/dist/runtime-tools/ue/scene-process-lock.cjs +110 -0
- package/vendor/agent-cli/dist/runtime-tools/ue/tool-manifest.json +22 -0
- package/vendor/agent-cli/dist/runtime-tools/ue/ue-asset-references.cjs +305 -0
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts +3 -0
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.js +45 -0
- package/vendor/agent-cli/dist/src/artifacts/context-finalize.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +57 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.js +198 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +32 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +146 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/restore.d.ts +28 -0
- package/vendor/agent-cli/dist/src/artifacts/restore.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/restore.js +384 -0
- package/vendor/agent-cli/dist/src/artifacts/restore.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts +15 -0
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/static.js +152 -0
- package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/process.d.ts +4 -0
- package/vendor/agent-cli/dist/src/cli/commands/process.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/process.js +24 -0
- package/vendor/agent-cli/dist/src/cli/commands/process.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts +23 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-controls.js +62 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-controls.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts +9 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-mock.js +15 -0
- package/vendor/agent-cli/dist/src/cli/commands/run-mock.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/run.d.ts +3 -0
- package/vendor/agent-cli/dist/src/cli/commands/run.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/run.js +284 -0
- package/vendor/agent-cli/dist/src/cli/commands/run.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts +11 -0
- package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/commands/setup.js +161 -0
- package/vendor/agent-cli/dist/src/cli/commands/setup.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/options.d.ts +83 -0
- package/vendor/agent-cli/dist/src/cli/options.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/options.js +213 -0
- package/vendor/agent-cli/dist/src/cli/options.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts +5 -0
- package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/process-protocol.js +276 -0
- package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/registry.d.ts +55 -0
- package/vendor/agent-cli/dist/src/cli/registry.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/registry.js +99 -0
- package/vendor/agent-cli/dist/src/cli/registry.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts +44 -0
- package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js +83 -0
- package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts +28 -0
- package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/render/text-sink.js +52 -0
- package/vendor/agent-cli/dist/src/cli/render/text-sink.js.map +1 -0
- package/vendor/agent-cli/dist/src/cli.d.ts +9 -0
- package/vendor/agent-cli/dist/src/cli.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli.js +54 -0
- package/vendor/agent-cli/dist/src/cli.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/execution.d.ts +24 -0
- package/vendor/agent-cli/dist/src/component/execution.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/execution.js +131 -0
- package/vendor/agent-cli/dist/src/component/execution.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts +24 -0
- package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/platform-access/server.js +200 -0
- package/vendor/agent-cli/dist/src/component/platform-access/server.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts +31 -0
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js +57 -0
- package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/preparation.d.ts +10 -0
- package/vendor/agent-cli/dist/src/component/preparation.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/preparation.js +35 -0
- package/vendor/agent-cli/dist/src/component/preparation.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts +15 -0
- package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/runtime-tools.js +37 -0
- package/vendor/agent-cli/dist/src/component/runtime-tools.js.map +1 -0
- package/vendor/agent-cli/dist/src/component/runtime.d.ts +8 -0
- package/vendor/agent-cli/dist/src/component/runtime.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/component/runtime.js +95 -0
- package/vendor/agent-cli/dist/src/component/runtime.js.map +1 -0
- package/vendor/agent-cli/dist/src/config/config-store.d.ts +50 -0
- package/vendor/agent-cli/dist/src/config/config-store.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/config/config-store.js +117 -0
- package/vendor/agent-cli/dist/src/config/config-store.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-lease.d.ts +17 -0
- package/vendor/agent-cli/dist/src/context/cache-lease.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-lease.js +133 -0
- package/vendor/agent-cli/dist/src/context/cache-lease.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts +9 -0
- package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js +51 -0
- package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-publication.d.ts +4 -0
- package/vendor/agent-cli/dist/src/context/cache-publication.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/cache-publication.js +54 -0
- package/vendor/agent-cli/dist/src/context/cache-publication.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/client-context-view.d.ts +12 -0
- package/vendor/agent-cli/dist/src/context/client-context-view.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/client-context-view.js +100 -0
- package/vendor/agent-cli/dist/src/context/client-context-view.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-budget.d.ts +3 -0
- package/vendor/agent-cli/dist/src/context/context-budget.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-budget.js +10 -0
- package/vendor/agent-cli/dist/src/context/context-budget.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-cache.d.ts +108 -0
- package/vendor/agent-cli/dist/src/context/context-cache.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-cache.js +357 -0
- package/vendor/agent-cli/dist/src/context/context-cache.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-project.d.ts +26 -0
- package/vendor/agent-cli/dist/src/context/context-project.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-project.js +113 -0
- package/vendor/agent-cli/dist/src/context/context-project.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-resource.d.ts +4 -0
- package/vendor/agent-cli/dist/src/context/context-resource.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-resource.js +11 -0
- package/vendor/agent-cli/dist/src/context/context-resource.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts +9 -0
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js +134 -0
- package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/local-skills.d.ts +4 -0
- package/vendor/agent-cli/dist/src/context/local-skills.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/local-skills.js +157 -0
- package/vendor/agent-cli/dist/src/context/local-skills.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-context.d.ts +19 -0
- package/vendor/agent-cli/dist/src/context/member-context.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-context.js +105 -0
- package/vendor/agent-cli/dist/src/context/member-context.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-documents.d.ts +3 -0
- package/vendor/agent-cli/dist/src/context/member-documents.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-documents.js +38 -0
- package/vendor/agent-cli/dist/src/context/member-documents.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts +3 -0
- package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-profile-header.js +62 -0
- package/vendor/agent-cli/dist/src/context/member-profile-header.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-profile.d.ts +43 -0
- package/vendor/agent-cli/dist/src/context/member-profile.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-profile.js +91 -0
- package/vendor/agent-cli/dist/src/context/member-profile.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-selection.d.ts +7 -0
- package/vendor/agent-cli/dist/src/context/member-selection.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/member-selection.js +58 -0
- package/vendor/agent-cli/dist/src/context/member-selection.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts +6 -0
- package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/script-dependencies.js +24 -0
- package/vendor/agent-cli/dist/src/context/script-dependencies.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts +3 -0
- package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/shared-cache-build.js +55 -0
- package/vendor/agent-cli/dist/src/context/shared-cache-build.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/team-definition.d.ts +39 -0
- package/vendor/agent-cli/dist/src/context/team-definition.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/team-definition.js +78 -0
- package/vendor/agent-cli/dist/src/context/team-definition.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts +7 -0
- package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/team-knowledge.js +37 -0
- package/vendor/agent-cli/dist/src/context/team-knowledge.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-cache.d.ts +27 -0
- package/vendor/agent-cli/dist/src/context/template-cache.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-cache.js +100 -0
- package/vendor/agent-cli/dist/src/context/template-cache.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-seed.d.ts +32 -0
- package/vendor/agent-cli/dist/src/context/template-seed.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/template-seed.js +117 -0
- package/vendor/agent-cli/dist/src/context/template-seed.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts +19 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +292 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts +13 -0
- package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-context.js +178 -0
- package/vendor/agent-cli/dist/src/context/user-skill-context.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts +54 -0
- package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-install.js +184 -0
- package/vendor/agent-cli/dist/src/context/user-skill-install.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/zip-extract.d.ts +14 -0
- package/vendor/agent-cli/dist/src/context/zip-extract.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/context/zip-extract.js +130 -0
- package/vendor/agent-cli/dist/src/context/zip-extract.js.map +1 -0
- package/vendor/agent-cli/dist/src/index.d.ts +56 -0
- package/vendor/agent-cli/dist/src/index.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/index.js +82 -0
- package/vendor/agent-cli/dist/src/index.js.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts +68 -0
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js +242 -0
- package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts +40 -0
- package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/hook-command.js +87 -0
- package/vendor/agent-cli/dist/src/lifecycle/hook-command.js.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts +134 -0
- package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/registry.js +152 -0
- package/vendor/agent-cli/dist/src/lifecycle/registry.js.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts +40 -0
- package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js +149 -0
- package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/client.d.ts +12 -0
- package/vendor/agent-cli/dist/src/mcp/client.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/client.js +95 -0
- package/vendor/agent-cli/dist/src/mcp/client.js.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/connection.d.ts +14 -0
- package/vendor/agent-cli/dist/src/mcp/connection.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/connection.js +115 -0
- package/vendor/agent-cli/dist/src/mcp/connection.js.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/execute.d.ts +5 -0
- package/vendor/agent-cli/dist/src/mcp/execute.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/execute.js +26 -0
- package/vendor/agent-cli/dist/src/mcp/execute.js.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts +11 -0
- package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/instance-lock.js +51 -0
- package/vendor/agent-cli/dist/src/mcp/instance-lock.js.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/types.d.ts +27 -0
- package/vendor/agent-cli/dist/src/mcp/types.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/mcp/types.js +2 -0
- package/vendor/agent-cli/dist/src/mcp/types.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/input.d.ts +21 -0
- package/vendor/agent-cli/dist/src/protocol/input.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/input.js +95 -0
- package/vendor/agent-cli/dist/src/protocol/input.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts +58 -0
- package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/channel.js +337 -0
- package/vendor/agent-cli/dist/src/protocol/link/channel.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts +13 -0
- package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/codec-json.js +27 -0
- package/vendor/agent-cli/dist/src/protocol/link/codec-json.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts +57 -0
- package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/envelope.js +93 -0
- package/vendor/agent-cli/dist/src/protocol/link/envelope.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts +28 -0
- package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/liveness.js +86 -0
- package/vendor/agent-cli/dist/src/protocol/link/liveness.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts +14 -0
- package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/middleware.js +40 -0
- package/vendor/agent-cli/dist/src/protocol/link/middleware.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts +31 -0
- package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/rpc.js +90 -0
- package/vendor/agent-cli/dist/src/protocol/link/rpc.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts +32 -0
- package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js +106 -0
- package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts +509 -0
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js +131 -0
- package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +351 -0
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +103 -0
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts +9 -0
- package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/binary-read-receipts.js +58 -0
- package/vendor/agent-cli/dist/src/security/binary-read-receipts.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/command-parse.d.ts +21 -0
- package/vendor/agent-cli/dist/src/security/command-parse.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/command-parse.js +395 -0
- package/vendor/agent-cli/dist/src/security/command-parse.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/command-translate.d.ts +30 -0
- package/vendor/agent-cli/dist/src/security/command-translate.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/command-translate.js +161 -0
- package/vendor/agent-cli/dist/src/security/command-translate.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts +18 -0
- package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/context-write-policy.js +121 -0
- package/vendor/agent-cli/dist/src/security/context-write-policy.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/guard.d.ts +41 -0
- package/vendor/agent-cli/dist/src/security/guard.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/guard.js +154 -0
- package/vendor/agent-cli/dist/src/security/guard.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/mount-table.d.ts +47 -0
- package/vendor/agent-cli/dist/src/security/mount-table.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/mount-table.js +164 -0
- package/vendor/agent-cli/dist/src/security/mount-table.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts +23 -0
- package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/sandbox-path.js +110 -0
- package/vendor/agent-cli/dist/src/security/sandbox-path.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts +5 -0
- package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/tool-run-owner.js +16 -0
- package/vendor/agent-cli/dist/src/security/tool-run-owner.js.map +1 -0
- package/vendor/agent-cli/dist/src/security/tool-scope.d.ts +16 -0
- package/vendor/agent-cli/dist/src/security/tool-scope.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/security/tool-scope.js +88 -0
- package/vendor/agent-cli/dist/src/security/tool-scope.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/client.d.ts +116 -0
- package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/client.js +376 -0
- package/vendor/agent-cli/dist/src/session/client.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/custom-context.d.ts +6 -0
- package/vendor/agent-cli/dist/src/session/custom-context.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/custom-context.js +100 -0
- package/vendor/agent-cli/dist/src/session/custom-context.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/engine-decide.d.ts +38 -0
- package/vendor/agent-cli/dist/src/session/engine-decide.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/engine-decide.js +87 -0
- package/vendor/agent-cli/dist/src/session/engine-decide.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts +4 -0
- package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/execution-settlement.js +15 -0
- package/vendor/agent-cli/dist/src/session/execution-settlement.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-config.d.ts +13 -0
- package/vendor/agent-cli/dist/src/session/link-config.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-config.js +29 -0
- package/vendor/agent-cli/dist/src/session/link-config.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-outcome.d.ts +30 -0
- package/vendor/agent-cli/dist/src/session/link-outcome.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-outcome.js +67 -0
- package/vendor/agent-cli/dist/src/session/link-outcome.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-session.d.ts +76 -0
- package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/link-session.js +412 -0
- package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/local-execution.d.ts +28 -0
- package/vendor/agent-cli/dist/src/session/local-execution.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/local-execution.js +119 -0
- package/vendor/agent-cli/dist/src/session/local-execution.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/member-tools.d.ts +22 -0
- package/vendor/agent-cli/dist/src/session/member-tools.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/member-tools.js +72 -0
- package/vendor/agent-cli/dist/src/session/member-tools.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts +7 -0
- package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js +30 -0
- package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-environment.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/process-environment.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-environment.js +22 -0
- package/vendor/agent-cli/dist/src/session/process-environment.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-request.d.ts +36 -0
- package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/process-request.js +494 -0
- package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/reference-tools.d.ts +8 -0
- package/vendor/agent-cli/dist/src/session/reference-tools.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/reference-tools.js +34 -0
- package/vendor/agent-cli/dist/src/session/reference-tools.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-events.d.ts +81 -0
- package/vendor/agent-cli/dist/src/session/run-events.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-events.js +160 -0
- package/vendor/agent-cli/dist/src/session/run-events.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-setup.d.ts +76 -0
- package/vendor/agent-cli/dist/src/session/run-setup.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-setup.js +273 -0
- package/vendor/agent-cli/dist/src/session/run-setup.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +41 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.js +64 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/team-persistence.d.ts +17 -0
- package/vendor/agent-cli/dist/src/session/team-persistence.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/team-persistence.js +75 -0
- package/vendor/agent-cli/dist/src/session/team-persistence.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts +37 -0
- package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/tool-scheduler.js +232 -0
- package/vendor/agent-cli/dist/src/session/tool-scheduler.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-choice.d.ts +5 -0
- package/vendor/agent-cli/dist/src/session/user-choice.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-choice.js +80 -0
- package/vendor/agent-cli/dist/src/session/user-choice.js.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts +31 -0
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.js +104 -0
- package/vendor/agent-cli/dist/src/session/user-skill-loaded.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/app-id.d.ts +13 -0
- package/vendor/agent-cli/dist/src/shared/app-id.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/app-id.js +25 -0
- package/vendor/agent-cli/dist/src/shared/app-id.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts +13 -0
- package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/auth-headers.js +16 -0
- package/vendor/agent-cli/dist/src/shared/auth-headers.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/cli-version.d.ts +3 -0
- package/vendor/agent-cli/dist/src/shared/cli-version.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/cli-version.js +22 -0
- package/vendor/agent-cli/dist/src/shared/cli-version.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/error-detail.d.ts +14 -0
- package/vendor/agent-cli/dist/src/shared/error-detail.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/error-detail.js +29 -0
- package/vendor/agent-cli/dist/src/shared/error-detail.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/output-guard.d.ts +36 -0
- package/vendor/agent-cli/dist/src/shared/output-guard.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/output-guard.js +94 -0
- package/vendor/agent-cli/dist/src/shared/output-guard.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts +3 -0
- package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/process-cwd.js +11 -0
- package/vendor/agent-cli/dist/src/shared/process-cwd.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/process-types.d.ts +60 -0
- package/vendor/agent-cli/dist/src/shared/process-types.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/process-types.js +10 -0
- package/vendor/agent-cli/dist/src/shared/process-types.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/server-headers.d.ts +7 -0
- package/vendor/agent-cli/dist/src/shared/server-headers.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/server-headers.js +113 -0
- package/vendor/agent-cli/dist/src/shared/server-headers.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts +47 -0
- package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/shell-runtime.js +210 -0
- package/vendor/agent-cli/dist/src/shared/shell-runtime.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts +458 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/types.js +2 -0
- package/vendor/agent-cli/dist/src/shared/types.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/user-choice.d.ts +22 -0
- package/vendor/agent-cli/dist/src/shared/user-choice.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/shared/user-choice.js +2 -0
- package/vendor/agent-cli/dist/src/shared/user-choice.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts +9 -0
- package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/artifact-publisher.js +85 -0
- package/vendor/agent-cli/dist/src/tools/artifact-publisher.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/command-executor.d.ts +30 -0
- package/vendor/agent-cli/dist/src/tools/command-executor.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/command-executor.js +96 -0
- package/vendor/agent-cli/dist/src/tools/command-executor.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts +16 -0
- package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program-publish.js +104 -0
- package/vendor/agent-cli/dist/src/tools/context-program-publish.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program.d.ts +21 -0
- package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program.js +207 -0
- package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/file-ops.d.ts +61 -0
- package/vendor/agent-cli/dist/src/tools/file-ops.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/file-ops.js +477 -0
- package/vendor/agent-cli/dist/src/tools/file-ops.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/local-hands.d.ts +58 -0
- package/vendor/agent-cli/dist/src/tools/local-hands.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/local-hands.js +322 -0
- package/vendor/agent-cli/dist/src/tools/local-hands.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts +24 -0
- package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/ripgrep-search.js +160 -0
- package/vendor/agent-cli/dist/src/tools/ripgrep-search.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts +66 -0
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js +65 -0
- package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts +29 -0
- package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/tool-timeout.js +88 -0
- package/vendor/agent-cli/dist/src/tools/tool-timeout.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/write-guard.d.ts +42 -0
- package/vendor/agent-cli/dist/src/tools/write-guard.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/write-guard.js +34 -0
- package/vendor/agent-cli/dist/src/tools/write-guard.js.map +1 -0
- package/vendor/agent-cli/package.json +29 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
|
|
4
|
+
export async function readPreviewRecord(file,project) {
|
|
5
|
+
let record;
|
|
6
|
+
try {record=JSON.parse(await readFile(file,'utf8'));}catch(error){if(error.code==='ENOENT')return null;throw error;}
|
|
7
|
+
if(record.project!==project || !/^[0-9a-f-]{36}$/.test(record.instance_id) || !/^[0-9a-f]{64}$/.test(record.key) ||
|
|
8
|
+
!Number.isSafeInteger(record.pid) || record.pid<1 || !Number.isSafeInteger(record.port) || record.port<1 || record.port>65535)throw new Error('Invalid preview ownership record');
|
|
9
|
+
return record;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function publicPreview(record) {
|
|
13
|
+
return {url:`http://127.0.0.1:${record.port}/`,pid:record.pid,snapshot:record.snapshot,
|
|
14
|
+
scope:'local loopback; last successful build snapshot',status:'running',running:true,host_managed:record.host_managed===true,persistent:false,
|
|
15
|
+
lifetime:'Managed by the external host. The launcher or operating system may reclaim this process. Check live status and rerun the host start command if unavailable.',
|
|
16
|
+
stop:'Use craft_preview_stop with the project name; a new Craft session can stop this preview.'};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Explicit loopback HTTP avoids HTTP_PROXY/HTTPS_PROXY producing a misleading 502.
|
|
20
|
+
export function controlPreview(record,action) {
|
|
21
|
+
return new Promise(resolve=>{
|
|
22
|
+
const request=http.request({hostname:'127.0.0.1',port:record.port,path:'/_craft-preview/'+action,
|
|
23
|
+
method:action==='stop'?'POST':'GET',headers:{'x-craft-preview-key':record.key},timeout:1000},response=>{
|
|
24
|
+
const parts=[];let size=0;
|
|
25
|
+
response.on('data',part=>{size+=part.length;if(size>8192)response.destroy();else parts.push(part);});
|
|
26
|
+
response.on('end',()=>{
|
|
27
|
+
try {const data=JSON.parse(Buffer.concat(parts).toString());resolve(response.statusCode===200 && data.instance_id===record.instance_id && data.pid===record.pid);}
|
|
28
|
+
catch {resolve(false);}
|
|
29
|
+
});
|
|
30
|
+
response.on('error',()=>resolve(false));
|
|
31
|
+
response.on('close',()=>resolve(false));
|
|
32
|
+
});
|
|
33
|
+
request.on('timeout',()=>request.destroy());request.on('error',()=>resolve(false));request.end();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { writeFile } from 'node:fs/promises';
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { once } from 'node:events';
|
|
6
|
+
import { atomicJson } from '../game-workflow/request-store.mjs';
|
|
7
|
+
|
|
8
|
+
// Executed by the external host terminal, never by the MCP server.
|
|
9
|
+
const run=process.argv[2];
|
|
10
|
+
try {
|
|
11
|
+
if(!run || !path.isAbsolute(run))throw new Error('Pass the absolute preview launch directory');
|
|
12
|
+
await writeFile(path.join(run,'stderr.log'),'',{flag:'a',mode:0o600});
|
|
13
|
+
const env={PATH:path.dirname(process.execPath)};
|
|
14
|
+
for(const name of ['SystemRoot','WINDIR','TEMP','TMP'])if(process.env[name])env[name]=process.env[name];
|
|
15
|
+
const child=spawn(process.execPath,[fileURLToPath(new URL('./preview-worker.mjs',import.meta.url)),run],{
|
|
16
|
+
cwd:run,detached:true,windowsHide:true,stdio:'ignore',env,
|
|
17
|
+
});
|
|
18
|
+
await once(child,'spawn');child.unref();
|
|
19
|
+
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
|
+
await writeFile(path.join(run,'stdout.log'),receipt,{flag:'a',mode:0o600});
|
|
21
|
+
process.stdout.write(receipt);
|
|
22
|
+
} catch(error) {
|
|
23
|
+
const message=String(error.message).slice(0,2000);
|
|
24
|
+
if(run&&path.isAbsolute(run))await atomicJson(path.join(run,'error.json'),{message}).catch(()=>{});
|
|
25
|
+
process.stderr.write(message+'\n');process.exitCode=1;
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { open,lstat,realpath } from 'node:fs/promises';
|
|
3
|
+
import { constants } from 'node:fs';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
|
|
6
|
+
const mime={'.html':'text/html; charset=utf-8','.js':'text/javascript','.css':'text/css','.json':'application/json',
|
|
7
|
+
'.png':'image/png','.jpg':'image/jpeg','.jpeg':'image/jpeg','.svg':'image/svg+xml','.webp':'image/webp',
|
|
8
|
+
'.mp3':'audio/mpeg','.ogg':'audio/ogg','.wav':'audio/wav','.flac':'audio/flac','.m4a':'audio/mp4',
|
|
9
|
+
'.mp4':'video/mp4','.webm':'video/webm','.glb':'model/gltf-binary','.gltf':'model/gltf+json','.bin':'application/octet-stream','.woff2':'font/woff2'};
|
|
10
|
+
|
|
11
|
+
export async function snapshotFiles(project,artifacts) {
|
|
12
|
+
if(!path.isAbsolute(project) || !Array.isArray(artifacts) || !artifacts.length || artifacts.length>2000)throw new Error('Invalid preview artifacts');
|
|
13
|
+
const dist=path.join(project,'dist');
|
|
14
|
+
if((await lstat(dist)).isSymbolicLink() || await realpath(dist)!==dist)throw new Error('Preview build directory changed');
|
|
15
|
+
const files=new Map();let total=0;
|
|
16
|
+
for(const artifact of artifacts) {
|
|
17
|
+
const parts=typeof artifact.relativePath==='string'?artifact.relativePath.split('/'):[];
|
|
18
|
+
if(!parts.length || parts.some(part=>!part || part==='.' || part==='..' || part.includes('\\') || part.includes('\0')) || !/^[0-9a-f]{64}$/.test(artifact.sha256))throw new Error('Invalid preview artifact');
|
|
19
|
+
let file=dist;
|
|
20
|
+
for(const part of parts){file=path.join(file,part);if((await lstat(file)).isSymbolicLink())throw new Error('Preview source contains a symbolic link');}
|
|
21
|
+
if(file!==artifact.path)throw new Error('Preview artifact escaped the build directory');
|
|
22
|
+
const handle=await open(file,constants.O_RDONLY|(constants.O_NOFOLLOW??0));let data;
|
|
23
|
+
try {
|
|
24
|
+
const stat=await handle.stat();
|
|
25
|
+
if(!stat.isFile() || stat.size>8*1024*1024 || total+stat.size>64*1024*1024)throw new Error('Preview exceeds original SDK size limits');
|
|
26
|
+
data=await handle.readFile();if(data.length!==stat.size)throw new Error('Preview file changed during collection');
|
|
27
|
+
} finally {await handle.close();}
|
|
28
|
+
if(createHash('sha256').update(data).digest('hex')!==artifact.sha256)throw new Error('Build output changed; run craft_game_check again');
|
|
29
|
+
total+=data.length;
|
|
30
|
+
const key='/'+artifact.relativePath;if(files.has(key))throw new Error('Duplicate preview file');
|
|
31
|
+
files.set(key,{data,type:mime[path.extname(file)]??'application/octet-stream'});
|
|
32
|
+
}
|
|
33
|
+
if(!files.has('/index.html'))throw new Error('Preview has no index.html');
|
|
34
|
+
return files;
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
export function hostStart(run) {
|
|
5
|
+
const command=process.execPath,args=[fileURLToPath(new URL('./preview-launcher.mjs',import.meta.url)),run];
|
|
6
|
+
const stdout=path.join(run,'stdout.log'),stderr=path.join(run,'stderr.log');
|
|
7
|
+
const quote=value=>"'"+value.replaceAll("'",process.platform==='win32'?"''":"'\\''")+"'";
|
|
8
|
+
const script=(process.platform==='win32'?'& ':'')+[command,...args].map(quote).join(' ');
|
|
9
|
+
return {command,args,cwd:run,background:true,shell:process.platform==='win32'?'powershell':'sh',script,
|
|
10
|
+
logs:{stdout,stderr,events:path.join(run,'events.jsonl')},
|
|
11
|
+
next:'Run this command with the external host terminal tool, then poll craft_game_info(name).preview until running=true and its snapshot matches this delivery. Verify the page before reporting its live URL. The host may reclaim the process; use this command again if it stops.'};
|
|
12
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { readFile,appendFile,unlink } from 'node:fs/promises';
|
|
4
|
+
import { appendFileSync } from 'node:fs';
|
|
5
|
+
import { timingSafeEqual } from 'node:crypto';
|
|
6
|
+
import lockfile from 'proper-lockfile';
|
|
7
|
+
import { atomicJson } from '../game-workflow/request-store.mjs';
|
|
8
|
+
import { snapshotFiles } from './preview-snapshot.mjs';
|
|
9
|
+
import { controlPreview,readPreviewRecord } from './preview-control.mjs';
|
|
10
|
+
|
|
11
|
+
const run=process.argv[2];let server,release;
|
|
12
|
+
const event=(kind,details={})=>appendFile(path.join(run,'events.jsonl'),JSON.stringify({time:new Date().toISOString(),event:kind,pid:process.pid,parent_pid:process.ppid,...details})+'\n',{mode:0o600}).catch(()=>{});
|
|
13
|
+
process.on('exit',code=>{try{appendFileSync(path.join(run,'events.jsonl'),JSON.stringify({time:new Date().toISOString(),event:'exit',pid:process.pid,code})+'\n');}catch{}});
|
|
14
|
+
async function fail(error) {
|
|
15
|
+
const message=String(error?.message??error).slice(0,2000);
|
|
16
|
+
await appendFile(path.join(run,'stderr.log'),message+'\n',{mode:0o600}).catch(()=>{});
|
|
17
|
+
await event('error',{message});await atomicJson(path.join(run,'error.json'),{message}).catch(()=>{});
|
|
18
|
+
server?.closeAllConnections();server?.close();process.exitCode=1;
|
|
19
|
+
}
|
|
20
|
+
process.once('uncaughtException',error=>{void fail(error).finally(()=>process.exit(1));});
|
|
21
|
+
process.once('unhandledRejection',error=>{void fail(error).finally(()=>process.exit(1));});
|
|
22
|
+
try {
|
|
23
|
+
await event('starting');
|
|
24
|
+
const input=JSON.parse(await readFile(path.join(run,'request.json'),'utf8'));
|
|
25
|
+
if(!/^[0-9a-f]{64}$/.test(input.key) || !/^[0-9a-f-]{36}$/.test(input.instance_id))throw new Error('Invalid preview identity');
|
|
26
|
+
const files=await snapshotFiles(input.project,input.artifacts);
|
|
27
|
+
const directory=path.dirname(run);
|
|
28
|
+
release=await lockfile.lock(directory,{stale:30000,update:10000,retries:{retries:30,minTimeout:100,maxTimeout:100}});
|
|
29
|
+
const pending=JSON.parse(await readFile(path.join(directory,'pending.json'),'utf8'));
|
|
30
|
+
if(pending.instance_id!==input.instance_id || pending.project!==input.project || pending.snapshot!==input.snapshot)throw new Error('Preview start was superseded; use the latest delivery command');
|
|
31
|
+
const previous=await readPreviewRecord(path.join(directory,'active.json'),input.project);
|
|
32
|
+
if(previous?.instance_id===input.instance_id && await controlPreview(previous,'status')) {
|
|
33
|
+
await event('already_running');await release();release=null;process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
let port;const identity={instance_id:input.instance_id,pid:process.pid};
|
|
36
|
+
let closing=false;
|
|
37
|
+
const close=reason=>{if(closing)return;closing=true;void event('shutdown',{reason}).finally(()=>{server.closeAllConnections();server.close(()=>process.exit(0));});};
|
|
38
|
+
server=http.createServer((req,res)=>{
|
|
39
|
+
res.setHeader('Cache-Control','no-store');res.setHeader('X-Content-Type-Options','nosniff');
|
|
40
|
+
const origin=`http://127.0.0.1:${port}`;
|
|
41
|
+
if(req.headers.host!==`127.0.0.1:${port}` || (req.headers.origin && req.headers.origin!==origin) || req.headers['sec-fetch-site']==='cross-site'){req.resume();res.writeHead(403).end();return;}
|
|
42
|
+
let pathname;try{pathname=decodeURIComponent(new URL(req.url,origin).pathname);}catch{res.writeHead(400).end();return;}
|
|
43
|
+
if(pathname.startsWith('/_craft-preview/')) {
|
|
44
|
+
const key=req.headers['x-craft-preview-key'];
|
|
45
|
+
if(typeof key!=='string' || !/^[0-9a-f]{64}$/.test(key) || !timingSafeEqual(Buffer.from(key),Buffer.from(input.key))){req.resume();res.writeHead(403).end();return;}
|
|
46
|
+
const stopping=req.method==='POST' && pathname==='/_craft-preview/stop';
|
|
47
|
+
if(!stopping && !(req.method==='GET' && pathname==='/_craft-preview/status')){req.resume();res.writeHead(404).end();return;}
|
|
48
|
+
req.resume();res.writeHead(200,{'Content-Type':'application/json'});res.end(JSON.stringify(identity));
|
|
49
|
+
if(stopping)res.once('finish',()=>close('craft_preview_stop'));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if(!['GET','HEAD'].includes(req.method)){req.resume();res.writeHead(405).end();return;}
|
|
53
|
+
const file=files.get(pathname==='/'?'/index.html':pathname);if(!file){res.writeHead(404).end();return;}
|
|
54
|
+
res.writeHead(200,{'Content-Type':file.type,'Content-Length':file.data.length});res.end(req.method==='HEAD'?undefined:file.data);
|
|
55
|
+
});
|
|
56
|
+
await new Promise((resolve,reject)=>{server.once('error',reject);server.listen(0,'127.0.0.1',resolve);});
|
|
57
|
+
port=server.address().port;
|
|
58
|
+
for(const signal of ['SIGINT','SIGTERM'])process.once(signal,()=>close(signal));
|
|
59
|
+
const record={...identity,project:input.project,key:input.key,snapshot:input.snapshot,port,created_at:new Date().toISOString(),host_managed:true,parent_pid:process.ppid};
|
|
60
|
+
if(!await controlPreview(record,'status'))throw new Error('Preview readiness check failed');
|
|
61
|
+
await atomicJson(path.join(run,'ready.json'),record);
|
|
62
|
+
await atomicJson(path.join(directory,'active.json'),record);
|
|
63
|
+
await unlink(path.join(run,'error.json')).catch(error=>{if(error.code!=='ENOENT')throw error;});
|
|
64
|
+
await event('ready',{port});
|
|
65
|
+
if(previous)await controlPreview(previous,'stop');
|
|
66
|
+
} catch(error) {
|
|
67
|
+
await fail(error);
|
|
68
|
+
} finally {if(release)await release();}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { AuthStore } from '../core/auth-store.mjs';
|
|
2
|
+
import { resolveLibraryUrl } from './library-url.mjs';
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
import { publicationSession } from './publication-transport.mjs';
|
|
5
|
+
|
|
6
|
+
const API = Object.freeze({ me: '/api/auth/me', metadata: '/api/ms/gamemeta/file-hashes',
|
|
7
|
+
generate: '/api/res/generate-2-d-text-to-image', generate_image_edit:'/api/res/generate-2-d-image-text-to-image',
|
|
8
|
+
generate_static_mesh:'/api/res/generate-3-d-props-pipeline', generate_skeletal_mesh:'/api/res/generate-3-d-character-pipeline',
|
|
9
|
+
generate_music:'/api/res/generate-music', generate_video:'/api/res/generate-video',
|
|
10
|
+
generate_sprite_sheet:'/api/res/generate-sprite-sheet-pipeline', generate_animation:'/api/res/generate-mocap',
|
|
11
|
+
query: '/api/res/query-tasks', cancel: '/api/res/cancel-task',
|
|
12
|
+
search:'/api/ms/agent/toolbox/search/js/batch-semantic-search' });
|
|
13
|
+
const draftPath = '/api/ms/external-game-uploads';
|
|
14
|
+
const draftId = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
15
|
+
|
|
16
|
+
export class PlatformError extends Error {
|
|
17
|
+
constructor(message, detail = {}) { super(message); this.detail = detail; }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function boundedBody(response, limit) {
|
|
21
|
+
const tooLarge = () => Object.assign(new Error('Response exceeds size limit'),{ code:'CRAFT_RESPONSE_TOO_LARGE' });
|
|
22
|
+
if (Number(response.headers.get('content-length')) > limit) { await response.body?.cancel(); throw tooLarge(); }
|
|
23
|
+
const parts = []; let size = 0;
|
|
24
|
+
for await (const part of response.body ?? []) {
|
|
25
|
+
size += part.length;
|
|
26
|
+
if (size > limit) throw tooLarge();
|
|
27
|
+
parts.push(Buffer.from(part));
|
|
28
|
+
}
|
|
29
|
+
return Buffer.concat(parts);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class CraftAigc {
|
|
33
|
+
#metadata;
|
|
34
|
+
constructor(sessionFile, base, store) {
|
|
35
|
+
if (typeof base !== 'string' || !base.trim()) throw new Error('CRAFT_WEB_URL must be configured');
|
|
36
|
+
this.base = base.trim().replace(/\/+$/,'');
|
|
37
|
+
const url = new URL(this.base);
|
|
38
|
+
if (url.username || url.password || url.search || url.hash ||
|
|
39
|
+
(url.protocol !== 'https:' && !(url.protocol === 'http:' && url.hostname === '127.0.0.1'))) throw new Error('Invalid Craft gateway URL');
|
|
40
|
+
this.store = store ?? new AuthStore(sessionFile);
|
|
41
|
+
this.store.onChange(() => { this.#metadata = undefined; });
|
|
42
|
+
}
|
|
43
|
+
account() {
|
|
44
|
+
const session = this.store.getSession();
|
|
45
|
+
if (!session.loggedIn || !session.token || !session.identity?.userId) throw new Error('Craft login required; use craft_auth_open');
|
|
46
|
+
return { user_id: Number(session.identity.userId), nickname: session.identity.displayName, roles: session.identity.roles };
|
|
47
|
+
}
|
|
48
|
+
async #http(endpoint, method, body, token, signal, bare = false, { archive, form, draft = false, businessErrors = false } = {}) {
|
|
49
|
+
let response, data;
|
|
50
|
+
const search = endpoint === API.search, mutation = !search && !['GET','HEAD'].includes(method);
|
|
51
|
+
const redact = value => (token ? String(value).split(token).join('[REDACTED]') : String(value)).slice(0,400);
|
|
52
|
+
const detail = (delivery_unknown, failure_type) => {
|
|
53
|
+
const requestId = data?.request_id || response?.headers.get('x-request-id');
|
|
54
|
+
return { endpoint, http_status:response?.status, failure_type,
|
|
55
|
+
backend_code:typeof data?.code === 'number' ? data.code : undefined,
|
|
56
|
+
request_id:typeof requestId === 'string' && /^[a-zA-Z0-9_-]{1,128}$/.test(requestId) && !requestId.includes(token) ? requestId : undefined,
|
|
57
|
+
delivery_unknown };
|
|
58
|
+
};
|
|
59
|
+
try {
|
|
60
|
+
const headers = { ...(!form ? { 'Content-Type':archive ? 'application/zip' : 'application/json' } : {}),Authorization:'Bearer ' + token };
|
|
61
|
+
if (archive) headers['Content-Length'] = String(archive.bytes);
|
|
62
|
+
const payload = form ?? (archive ? Readable.from(archive.parts) : body === undefined ? undefined : JSON.stringify(body));
|
|
63
|
+
response = await fetch(this.base + endpoint, { method, redirect:'manual', headers, body:payload,
|
|
64
|
+
...(archive ? { duplex:'half' } : {}),
|
|
65
|
+
signal: AbortSignal.any([...(signal ? [signal] : []), AbortSignal.timeout(draft ? 120000 : search ? 25000 : 15000)]) });
|
|
66
|
+
// The search proxy may return an upstream service-token rejection, not a user-token rejection.
|
|
67
|
+
if (response.status === 401 && !search) this.store.invalidateToken(token);
|
|
68
|
+
if (response.status >= 300 && response.status < 400) {
|
|
69
|
+
await response.body?.cancel();
|
|
70
|
+
throw new PlatformError('Craft 接口返回了跳转,请检查平台地址和接口路由',detail(mutation,'redirect'));
|
|
71
|
+
}
|
|
72
|
+
const raw = await boundedBody(response,2 * 1024 * 1024);
|
|
73
|
+
try { data = JSON.parse(raw.toString()); }
|
|
74
|
+
catch { throw new PlatformError('Craft 接口返回非 JSON 响应,请检查接口路由或服务部署',detail(mutation,'invalid_response')); }
|
|
75
|
+
const object = data !== null && typeof data === 'object' && !Array.isArray(data);
|
|
76
|
+
if (!response.ok || (object && Object.hasOwn(data,'code') && data.code !== 0)) {
|
|
77
|
+
const message = (!draft || businessErrors) && typeof data?.message === 'string' && data.message ? redact(data.message) : 'Craft 平台请求失败';
|
|
78
|
+
throw new PlatformError(message,detail(mutation && response.status >= 500,'http'));
|
|
79
|
+
}
|
|
80
|
+
if (!bare && (!object || data.code !== 0 || !Object.hasOwn(data,'data'))) throw new PlatformError('Craft 接口响应格式不正确',detail(mutation,'invalid_response'));
|
|
81
|
+
return bare ? data : data.data;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (error instanceof PlatformError) throw error;
|
|
84
|
+
const code = error.cause?.code || error.code;
|
|
85
|
+
const network_code = typeof code === 'string' && /^[A-Z][A-Z0-9_]{1,63}$/.test(code) && !code.includes(token) ? code : undefined;
|
|
86
|
+
const failure_type = code === 'CRAFT_RESPONSE_TOO_LARGE' ? 'response_too_large' :
|
|
87
|
+
error.name === 'TimeoutError' || code === 'UND_ERR_CONNECT_TIMEOUT' ? 'timeout' : signal?.aborted ? 'aborted' : 'network';
|
|
88
|
+
const messages = { response_too_large:'Craft 接口响应超过大小限制',timeout:'连接 Craft 平台超时',aborted:'Craft 请求已取消',network:'无法连接 Craft 平台,请检查网络或代理设置' };
|
|
89
|
+
throw new PlatformError(messages[failure_type],{ ...detail(mutation,failure_type),network_code });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async login(token) {
|
|
93
|
+
if (typeof token !== 'string' || token.length < 8 || token.length > 4096 || /\s/.test(token)) throw new Error('Invalid token');
|
|
94
|
+
const account = await this.#http(API.me, 'GET', undefined, token, undefined, true);
|
|
95
|
+
this.#validateAccount(account);
|
|
96
|
+
this.store.saveTokenSession({ token, identity: { userId: String(account.user_id), staffName: '',
|
|
97
|
+
displayName: String(account.nickname || ''), roles: account.roles } });
|
|
98
|
+
return this.account();
|
|
99
|
+
}
|
|
100
|
+
#validateAccount(account) {
|
|
101
|
+
if (!Number.isSafeInteger(account?.user_id) || account.user_id < 1 || account.disabled || !account.roles?.includes('creator')) {
|
|
102
|
+
throw new Error('An active Craft creator account is required');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
logout() { this.store.clearSession(); return { authenticated: false }; }
|
|
106
|
+
async request(kind, body, owner, signal) {
|
|
107
|
+
if (!Object.hasOwn(API,kind)) throw new Error('Unknown Craft endpoint');
|
|
108
|
+
const account = this.account(), token = this.store.getSession().token;
|
|
109
|
+
if (owner !== undefined && owner !== account.user_id) throw new Error('Craft account changed');
|
|
110
|
+
const method = ['me','metadata'].includes(kind) ? 'GET' : 'POST';
|
|
111
|
+
const data = await this.#http(API[kind], method, body, token, signal, ['me','search'].includes(kind));
|
|
112
|
+
if (this.store.getSession().token !== token) throw new PlatformError('Craft account changed during request', { delivery_unknown: kind !== 'search' && method === 'POST' });
|
|
113
|
+
return kind==='search' ? JSON.parse(JSON.stringify(data).split(token).join('[REDACTED]')) : data;
|
|
114
|
+
}
|
|
115
|
+
draftSession(owner) {
|
|
116
|
+
if (new URL(this.base).pathname !== '/') throw new Error('Draft upload requires a Craft platform origin');
|
|
117
|
+
const session = this.store.getSession(), token = session.token;
|
|
118
|
+
if (!session.loggedIn || owner !== Number(session.identity?.userId) || !token) throw new Error('Craft account changed');
|
|
119
|
+
return (kind, options, signal) => this.#draft(kind,options,owner,token,signal);
|
|
120
|
+
}
|
|
121
|
+
publicationSession(owner) {
|
|
122
|
+
const session = this.store.getSession(), token = session.token;
|
|
123
|
+
if (!session.loggedIn || owner !== Number(session.identity?.userId) || !token) throw new Error('Craft account changed');
|
|
124
|
+
return publicationSession({ base:this.base,token,
|
|
125
|
+
current:()=>{ const value = this.store.getSession(); return value.loggedIn && value.token === token && Number(value.identity?.userId) === owner; },
|
|
126
|
+
http:(endpoint,method,body,signal,options)=>this.#http(endpoint,method,body,token,signal,false,options) });
|
|
127
|
+
}
|
|
128
|
+
async #draft(kind, { id, input, archive }, owner, token, signal) {
|
|
129
|
+
const current = () => {
|
|
130
|
+
const session = this.store.getSession();
|
|
131
|
+
return session.loggedIn && session.token === token && Number(session.identity?.userId) === owner;
|
|
132
|
+
};
|
|
133
|
+
if (!current()) throw new Error('Craft account changed');
|
|
134
|
+
let endpoint, method, body;
|
|
135
|
+
if (kind === 'prepare') {
|
|
136
|
+
endpoint = draftPath + '/prepare'; method = 'POST'; body = input;
|
|
137
|
+
} else {
|
|
138
|
+
if (typeof id !== 'string' || !draftId.test(id) || id.includes(token)) throw new Error('Invalid draft upload ID');
|
|
139
|
+
const base = draftPath + '/' + id;
|
|
140
|
+
if (kind === 'upload' && archive) { endpoint = base + '/content'; method = 'PUT'; }
|
|
141
|
+
else if (kind === 'commit') { endpoint = base + '/commit'; method = 'POST'; body = {}; }
|
|
142
|
+
else if (kind === 'status') { endpoint = base; method = 'GET'; }
|
|
143
|
+
else throw new Error('Unknown draft upload operation');
|
|
144
|
+
}
|
|
145
|
+
const data = await this.#http(endpoint,method,body,token,signal,false,{ archive:kind === 'upload' ? archive : undefined,draft:true });
|
|
146
|
+
if (!current()) throw new PlatformError('Craft account changed during draft upload', { delivery_unknown: method !== 'GET' });
|
|
147
|
+
const safeId = value => typeof value === 'string' && draftId.test(value) && !value.includes(token);
|
|
148
|
+
if (!safeId(data?.upload_id) || (id && data.upload_id !== id) || !['prepared','uploaded','draft_ready','expired'].includes(data.state)) {
|
|
149
|
+
throw new PlatformError('Invalid Craft draft response');
|
|
150
|
+
}
|
|
151
|
+
if ((kind === 'prepare' && data.state === 'prepared' && data.upload_path === undefined) ||
|
|
152
|
+
(data.upload_path !== undefined && data.upload_path !== `${draftPath}/${data.upload_id}/content`)) {
|
|
153
|
+
throw new PlatformError('Unexpected Craft draft upload path');
|
|
154
|
+
}
|
|
155
|
+
const result = { upload_id:data.upload_id,state:data.state };
|
|
156
|
+
if (data.state === 'draft_ready') {
|
|
157
|
+
if (!safeId(data.conversation_id) || !safeId(data.version_id)) throw new PlatformError('Invalid Craft draft version response');
|
|
158
|
+
result.conversation_id = data.conversation_id;
|
|
159
|
+
result.version_id = data.version_id;
|
|
160
|
+
if (data.external_manifest_sha256 !== undefined) {
|
|
161
|
+
if (!/^[0-9a-f]{64}$/.test(data.external_manifest_sha256)) throw new PlatformError('Invalid Craft draft manifest');
|
|
162
|
+
result.external_manifest_sha256 = data.external_manifest_sha256;
|
|
163
|
+
}
|
|
164
|
+
if (data.preview_path !== undefined) {
|
|
165
|
+
const expected = `/api/ms/versions/${data.version_id}/external-preview`;
|
|
166
|
+
if (data.preview_path !== expected) throw new PlatformError('Unexpected Craft draft preview path');
|
|
167
|
+
result.preview_path = expected;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
async status(signal) {
|
|
173
|
+
if (!this.store.getSession().loggedIn) return { authenticated: false, platform: this.base };
|
|
174
|
+
let account;
|
|
175
|
+
try { account = await this.request('me',undefined,undefined,signal); }
|
|
176
|
+
catch (error) {
|
|
177
|
+
if (!this.store.getSession().loggedIn) return { authenticated:false, platform:this.base, authentication_error:{ message:error.message,...error.detail } };
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
try { this.#validateAccount(account); if (account.user_id !== this.account().user_id) throw new Error('Craft account changed'); }
|
|
181
|
+
catch (error) { this.logout(); throw error; }
|
|
182
|
+
return { authenticated: true, platform: this.base, ...this.account() };
|
|
183
|
+
}
|
|
184
|
+
async assetUrl(value) {
|
|
185
|
+
this.account();
|
|
186
|
+
this.#metadata ??= await this.request('metadata');
|
|
187
|
+
const base = new URL(this.#metadata.cos_public_addr), url = new URL(value, base.href.replace(/\/$/,'') + '/');
|
|
188
|
+
if (url.origin !== base.origin || !url.pathname.startsWith(base.pathname.replace(/\/$/,'') + '/') || url.username || url.password || url.hash ||
|
|
189
|
+
(url.protocol !== 'https:' && !(new URL(this.base).hostname === '127.0.0.1' && url.hostname === '127.0.0.1'))) throw new Error('Asset URL is outside the platform CDN');
|
|
190
|
+
return url.href;
|
|
191
|
+
}
|
|
192
|
+
async libraryUrl(value) {
|
|
193
|
+
this.account();
|
|
194
|
+
this.#metadata ??= await this.request('metadata');
|
|
195
|
+
return resolveLibraryUrl(value,this.#metadata.cos_public_addr,this.base);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Match the engine runtime's /Game/*.glb -> /Glb/Game/*.glb library mount.
|
|
2
|
+
export function resolveLibraryUrl(value,cdn,platform) {
|
|
3
|
+
if(typeof value!=='string' || !value.trim() || value.length>4096 || /[\u0000-\u001f\\]/.test(value) || value.startsWith('//'))throw new Error('Invalid library resource path');
|
|
4
|
+
let decoded=value;
|
|
5
|
+
for(let i=0;i<3;i++) {
|
|
6
|
+
if(decoded.split(/[/?#]/).some(part=>part==='.' || part==='..'))throw new Error('Library resource path contains traversal');
|
|
7
|
+
const next=decodeURIComponent(decoded);if(next===decoded)break;decoded=next;
|
|
8
|
+
}
|
|
9
|
+
const base=new URL(cdn),url=new URL(value.trim(),base.origin+'/');
|
|
10
|
+
if(url.origin!==base.origin || url.username || url.password || url.hash ||
|
|
11
|
+
(url.protocol!=='https:' && !(url.protocol==='http:' && url.hostname==='127.0.0.1' && new URL(platform).hostname==='127.0.0.1')))throw new Error('Library resource URL is outside the platform CDN');
|
|
12
|
+
if(url.pathname.startsWith('/Game/') && /\.(?:glb|gltf)$/i.test(url.pathname))url.pathname='/Glb'+url.pathname;
|
|
13
|
+
return url.href;
|
|
14
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const idPattern = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
2
|
+
const hashPattern = /^[0-9a-f]{64}$/;
|
|
3
|
+
|
|
4
|
+
function identifier(value) {
|
|
5
|
+
if (typeof value !== 'string' || !idPattern.test(value)) throw new Error('Invalid publication identifier');
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function imageURL(value, token, base) {
|
|
10
|
+
if (typeof value !== 'string' || value.includes(token)) throw new Error('Invalid publication image URL');
|
|
11
|
+
const url = new URL(value);
|
|
12
|
+
if (url.username || url.password || url.hash || url.search ||
|
|
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('Invalid publication image URL');
|
|
15
|
+
}
|
|
16
|
+
return url.href;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function publicationSession({ base, token, current, http }) {
|
|
20
|
+
if (new URL(base).pathname !== '/') throw new Error('Publication requires a Craft platform origin');
|
|
21
|
+
return async (kind, options = {}, signal) => {
|
|
22
|
+
if (!current()) throw new Error('Craft account changed');
|
|
23
|
+
let endpoint, method = 'GET', body, form;
|
|
24
|
+
if (kind === 'options') endpoint = '/api/ms/gamemeta/game-style';
|
|
25
|
+
else if (kind === 'image') {
|
|
26
|
+
const { image, conversation_id, version_id, external_manifest_sha256, purpose } = options;
|
|
27
|
+
if (!['cover','screenshot','audit-shot'].includes(purpose) || !hashPattern.test(external_manifest_sha256) ||
|
|
28
|
+
!Buffer.isBuffer(image?.data) || !image.data.length || image.data.length > 2 * 1024 * 1024 ||
|
|
29
|
+
!['png','jpg'].includes(image.extension)) throw new Error('Invalid publication image');
|
|
30
|
+
endpoint = '/api/ms/versions/share-cover'; method = 'POST';
|
|
31
|
+
form = new FormData();
|
|
32
|
+
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);
|
|
33
|
+
form.set('cover',new Blob([image.data],{ type:image.extension === 'png' ? 'image/png' : 'image/jpeg' }),`material.${image.extension}`);
|
|
34
|
+
} else if (kind === 'submit') {
|
|
35
|
+
endpoint = '/api/ms/versions/share'; method = 'POST'; body = options.input;
|
|
36
|
+
identifier(body?.client_request_id); identifier(body?.conversation_id); identifier(body?.version_id);
|
|
37
|
+
if (!hashPattern.test(body.external_manifest_sha256)) throw new Error('Invalid publication manifest');
|
|
38
|
+
} else if (kind === 'status') endpoint = `/api/ms/versions/${identifier(options.version_id)}/detail`;
|
|
39
|
+
else throw new Error('Unknown publication operation');
|
|
40
|
+
const data = await http(endpoint,method,body,signal,{ form,draft:true,businessErrors:true });
|
|
41
|
+
if (!current()) throw new Error('Craft account changed during publication');
|
|
42
|
+
if (kind === 'options') {
|
|
43
|
+
const result = {};
|
|
44
|
+
for (const key of ['game_types','art_styles','play_tags']) {
|
|
45
|
+
if (!data || !Object.hasOwn(data,key)) throw new Error('Invalid publication category response');
|
|
46
|
+
const values = data[key] ?? [];
|
|
47
|
+
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');
|
|
48
|
+
result[key] = values;
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
if (kind === 'image') {
|
|
53
|
+
if (!hashPattern.test(data?.sha256) || data.bytes !== options.image.data.length) throw new Error('Invalid publication material receipt');
|
|
54
|
+
return { cover_url:imageURL(data.cover_url,token,base),material_id:identifier(data.material_id),sha256:data.sha256,bytes:data.bytes };
|
|
55
|
+
}
|
|
56
|
+
if (kind === 'submit') return { accepted:true };
|
|
57
|
+
const publication = data?.external_publication;
|
|
58
|
+
if (!publication) return { state:'not_submitted', version_id:options.version_id };
|
|
59
|
+
if (publication.version_id !== options.version_id || !hashPattern.test(publication.external_manifest_sha256) ||
|
|
60
|
+
!hashPattern.test(publication.request_sha256) || typeof publication.status !== 'string' || !/^[a-z_]{1,48}$/.test(publication.status)) {
|
|
61
|
+
throw new Error('Invalid publication status response');
|
|
62
|
+
}
|
|
63
|
+
const result = { client_request_id:identifier(publication.client_request_id),request_sha256:publication.request_sha256,
|
|
64
|
+
external_manifest_sha256:publication.external_manifest_sha256,version_id:publication.version_id,
|
|
65
|
+
conversation_id:identifier(publication.conversation_id),state:publication.status,
|
|
66
|
+
status_reason:typeof publication.status_reason === 'string' ? publication.status_reason.split(token).join('[REDACTED]').slice(0,1000) : '' };
|
|
67
|
+
if (publication.finalization_retry_required !== undefined) {
|
|
68
|
+
if (typeof publication.finalization_retry_required !== 'boolean' ||
|
|
69
|
+
(publication.finalization_retry_required && result.state !== 'sharing')) throw new Error('Invalid publication finalization state');
|
|
70
|
+
result.finalization_retry_required = publication.finalization_retry_required;
|
|
71
|
+
}
|
|
72
|
+
if (publication.public_url !== undefined && publication.public_url !== '') {
|
|
73
|
+
const url = new URL(publication.public_url);
|
|
74
|
+
if (result.state !== 'share_completed' || publication.published_version_id !== options.version_id ||
|
|
75
|
+
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');
|
|
76
|
+
result.public_url = url.href;
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
};
|
|
80
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craft_eco/craft-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.14",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=22.12.0"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "node bin/craft-mcp.mjs"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
13
|
+
"playwright": "1.63.0",
|
|
14
|
+
"proper-lockfile": "4.1.2",
|
|
15
|
+
"@vscode/ripgrep": "^1.18.0",
|
|
16
|
+
"ws": "^8.21.3"
|
|
17
|
+
},
|
|
18
|
+
"description": "Local Craft 2D/Phaser and 3D/Three.js game-making MCP for external LLM hosts",
|
|
19
|
+
"bin": {
|
|
20
|
+
"craft-mcp": "bin/craft-mcp.mjs"
|
|
21
|
+
},
|
|
22
|
+
"imports": {
|
|
23
|
+
"#craft-sdk": "./vendor/agent-cli/dist/src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin",
|
|
27
|
+
"dist-server",
|
|
28
|
+
"resources",
|
|
29
|
+
"vendor"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"registry": "https://registry.npmjs.org/",
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: craft-game-maker
|
|
3
|
+
description: Make or modify local Craft 2D/Phaser and 3D/Three.js games with WorkBuddy, including AI assets, gameplay checks and preview.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Craft 本地小游戏制作
|
|
7
|
+
|
|
8
|
+
WorkBuddy 负责理解需求、设计、编码和看图验收;Craft MCP 提供工程、素材召回、AIGC、构建和预览,不调用 ForgeAgent。用户描述需求后自动推进,不要求用户指定工具、安装依赖或运行构建。
|
|
9
|
+
|
|
10
|
+
## 默认交互
|
|
11
|
+
|
|
12
|
+
素材来源、获取方式、使用顺序与表现方式遵守当前引擎 `CLAUDE.md`、相关技能及用户要求。`craft_game_info` 的 library / aigc 字段分别列出可用的召回分类与生成类型。调用 AIGC 时使用实际返回的产物;生成按平台规则自动扣分,不要求工程额度或逐项确认。短音效生成已下线,音频召回仍可用。
|
|
13
|
+
|
|
14
|
+
使用平台能力前调用 `craft_auth_status`。已登录直接继续;仅未登录时展示工具返回的 `user_message`,不自行拼地址。`auth_mode:token` 由用户在 WorkBuddy 连接器表单更新凭证并重新连接;普通安装由用户在工具返回的本机页面登录。连接后复用原工程和请求继续。网络错误不要求重新登录;积分不足或服务失败如实报告并保留记录。
|
|
15
|
+
|
|
16
|
+
禁止读取凭据文件、自动填写登录页或连接器凭证表单,或要求用户把 Token 发到聊天、写配置;链接中不得带 Token。
|
|
17
|
+
|
|
18
|
+
后台任务、素材接线、测试、看图和修复持续推进,直到交付或明确受阻;需要用户登录、用户取消时停下说明。交付预览链接、玩法和操作键;生成过图片时附资源 ID 与本地路径。
|
|
19
|
+
|
|
20
|
+
使用召回时,按工程引擎提交 1~8 个 slot/category/query,轮询后检查候选、score、metadata 和错误。选中后用 `craft_assets_import` 传 `source:"library"`、search_id、candidate_id、slot、request_key;一批只含一种来源。AssetId 不当作 AIGC resource_id,不手填下载 URL。搜索操作本身不生成素材;后续素材决策遵守当前引擎上下文与用户要求,不因错误换 key 盲重试,也不把召回素材冒充 AI 产物。
|
|
21
|
+
|
|
22
|
+
## 连续工作流
|
|
23
|
+
|
|
24
|
+
1. **先读引擎说明,再制作游戏。** 新建时用 `craft_game_info(engine)` 选择 `js`(2D/Phaser)或 `js3d`(3D/Three.js),没有 3D 要求时默认 `js`;继续游戏用 `craft_game_info(name)` 获取已保存的引擎。开始设计、编码或修改前,必须用文件工具完整读取 `context.engine.entrypoint` 指向的对应引擎 `CLAUDE.md`,遵循其开发约定。不能用查看路径或本指南代替读取;无法读取时报告阻塞。只读当前引擎,其余参考文档按需加载。
|
|
25
|
+
2. 调用 `craft_game_prepare`,使用稳定的英文 name;新建时传 engine,继续时复用原 name、沿用引擎。必须轮询成功后才用 WorkBuddy 文件工具编辑工程,遵循返回的 instructions/context。工程由本会话占用至 Craft 断开;遇到 CRAFT_PROJECT_IN_USE 时回原会话继续或请用户关闭原会话的 Craft,不绕过锁写文件、不终止其他进程。并行制作使用不同 name。保留模板依赖、runtime、Vite、预览接线和配置结构。
|
|
26
|
+
3. 按当前引擎上下文与用户要求选定的素材方案调用对应工具。使用召回时遵守上述候选导入契约;调用 `craft_assets_generate(name,assets)` 时每批 1~8 项,用 kind 选择 image/image_edit、static_mesh、skeletal_mesh、music、video、sprite_sheet 或 animation。图片按画面选尺寸,角色/道具图可设 `transparent:true`;动画需要视频和宿主骨骼 ID。slot、request_key 保持稳定;恢复用原 key 和全部参数,仅用户要求重做时新建 key。已有 AIGC 任务用 `craft_assets_import` 按 resource_id 导入,禁止另行 curl 下载或重复付费生成。
|
|
27
|
+
4. 返回 task_id 后,用 `craft_task_status(wait_ms:15000)` 轮询至终态;等待生成时可写独立逻辑。遇到 login 展示工具登录链接;asset_preview 则请用户在 Craft 资源中心完成预览确认后复用原请求继续,不自动冒充预览通过。failed/interrupted 查看错误并保留记录,资源未完成不宣称完成。取消用 `craft_task_cancel`,远端 processing 可能继续;导入任务取消只停止本地导入。
|
|
28
|
+
5. 平台没有请求级幂等:超时或提交响应丢失时保留原 key,只查询认领原任务,不盲目重发付费请求;查询未找到不代表未扣分,提交未确认时稍后用原参数重试。
|
|
29
|
+
6. 完成后自动下载主文件和外部依赖,写入返回的 config_file:图片 assets.json、模型 models.json、音频 audio.json、动作 animations.json、视频 videos.json、序列帧 spritesheets.json。按引擎指南实际接线,不只写资源表,不依赖远端 URL。GLB 必须实际加载;序列帧清单的 url 相对清单地址解析;图片检查透明效果。
|
|
30
|
+
7. 调用 `craft_game_check` 执行引擎收尾、构建和浏览器采集。依次提供 `loop`、`settlement`、`restart` 三步,每步包含 action、expected 和真实玩法断言。
|
|
31
|
+
8. gate.passed 后调用 `craft_game_review`,逐一查看初始、主循环、结算、重开四张截图,检查素材、构图、比例、文字、遮挡、透明边缘和玩法反馈;有问题就修复并重验。浏览器或截图不可用时报告未验证。
|
|
32
|
+
9. 玩法和视觉均通过后,调用 `craft_game_deliver(task_id,visual_passed:true,visual_notes)`,填写实际观察。返回 awaiting_host_start 时,由 WorkBuddy 自己用终端/后台进程工具执行 `start.script`;Craft 不启动预览。轮询 `craft_game_info(name).preview`,直到 running=true 且 snapshot 与此次交付一致,打开 URL 确认画布能启动后才交付链接。预览可能被宿主或系统回收;失效时查看 start.logs,重跑启动命令并验证,用 `craft_preview_stop(name)` 停止。源码或构建产物变化后重新检查、交付。
|
|
33
|
+
|
|
34
|
+
用户要求上传 Craft 私有草稿时,先通过检查与看图,再调用 `craft_game_upload(name,check_task_id)`。同一目录、name、账号和平台自动复用 appid,修改后重新检查上传只新增版本;中断时保留原 check_task_id 重试。游戏将从私有子路径运行,构建时使用相对资源路径,包括本地图片、音频与模型。用 `craft_task_status` 等待上传,用 `craft_game_publish_status(name,check_task_id)` 查询同一版本。草稿链接需要拥有者登录,用实际云端画面确认可玩后再交付。
|
|
35
|
+
|
|
36
|
+
用户要求公开发布时,先完成私有上传,调用 `craft_game_publish_options` 获取当前分类。WorkBuddy 根据游戏准备名称、简介/操作说明、分类、标签和封面;封面可用工程内 PNG/JPEG,省略时使用真实游戏截图。调用 `craft_game_publish_prepare(name,check_task_id,materials)`,轮询完成;MCP 对同一冻结版本真实试玩至少 30 秒,生成展示图和审核抽帧,不用四张普通验收图冒充完整采集。
|
|
37
|
+
|
|
38
|
+
随后调用 `craft_game_publish_review(name,publication_id)`,向用户展示完整文案、封面、截图、目标版本、是否开放二创,以及图片上传后为公开 URL 的事实。取得用户对本次 `revision` 的明确确认后,才调用 `craft_game_publish_submit(name,publication_id,revision,confirmed:true)`。材料变化须重新准备、看图和确认;准备完成不表示获得了提交授权。
|
|
39
|
+
|
|
40
|
+
提交任务完成只表示已发起审核。用 `craft_game_publish_status(name,publication_id)` 查询,保留原 ID 恢复超时;只有当前版本 `share_completed` 且返回匹配的 `public_url` 才报告发布成功。审核失败展示原因并修改后重新准备;审核未启用、缺材料或仍在等待时不冒充通过。服务端沿用 Web 发布与 ACE,外部发布须开启平台独立开关。
|
|
41
|
+
|
|
42
|
+
若状态返回 `finalization_retry_required:true`,审核已经通过但最终存储收尾需要重试;复用原 publication_id、revision 和既有确认调用 submit,只恢复同一份已审材料的收尾,不重新准备或另发审核。
|
|
43
|
+
|
|
44
|
+
已公开的同一版本只支持原 publication_id 的幂等重试。修改已公开作品的文案或图片时,重新检查并上传新版本(保留 appid),再准备和确认新材料;旧线上版本在新版本审核期间保持不变。外部包只有 dist,不包含可编辑源码,`open_to_recreate` 必须为 false。
|
|
45
|
+
|
|
46
|
+
## 引擎参考上下文
|
|
47
|
+
|
|
48
|
+
连接时发送通用指南,选定引擎后的 info/prepare 结果附专用指南。`context.workflow` 为通用指南,`context.engine.guide` 为专用指南,`context.engine.directory` 为引擎上下文,`context.references` 为按需文档。
|
|
49
|
+
|
|
50
|
+
引擎目录也供 SDK 生命周期使用。引擎 `CLAUDE.md`、相关技能及用户要求决定素材策略;其中的 Forge 工具和组件接口按当前 MCP 能力适配,不直接调用 skill_load、spawn、game_visual_qa。构建和采集统一用 `craft_game_check`。
|
|
51
|
+
|
|
52
|
+
## 玩法观测
|
|
53
|
+
|
|
54
|
+
保留模板 `globalThis.__GAME_PROBE__.snapshot()` 中真实的 engine、ready、frameCount,增加 `game` 字段读取场景状态,如 `{score,phase,round}`。加载完成才设 ready,不伪造帧数或通过值。
|
|
55
|
+
|
|
56
|
+
测试使用真实输入,不直接改分数或强行结算。Canvas 用坐标,DOM 用 target;`qa:` 仅路由到与玩家操作相同的处理函数,每步 ms ≤ 30000。
|
|
57
|
+
|
|
58
|
+
示例(按实际玩法调整):
|
|
59
|
+
```json
|
|
60
|
+
[
|
|
61
|
+
{"phase":"loop","action":"press","key":"Space","ms":300,"expected":"接到一颗星,分数增加","assertions":[{"path":"game.score","operator":"gte","value":1}]},
|
|
62
|
+
{"phase":"settlement","action":"wait","ms":15000,"expected":"倒计时结束显示结算","assertions":[{"path":"game.phase","operator":"eq","value":"over"}]},
|
|
63
|
+
{"phase":"restart","action":"click","target":"再玩一次","expected":"新一局分数归零","assertions":[{"path":"game.phase","operator":"eq","value":"playing"},{"path":"game.score","operator":"eq","value":0}]}
|
|
64
|
+
]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
支持本地 2D/Phaser、3D/Three.js、图片、模型、音乐、视频、序列帧、视频动捕和平台审核发布;文本动作暂只支持按已有任务 ID 导入,短音效生成、UE 特效未接入。目录校验不构成同 UID 的 OS 沙箱;禁止读取宿主私有状态或修改安装包。
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 当前工程:2D / Phaser(engine=js)
|
|
2
|
+
|
|
3
|
+
使用当前工程的 Phaser 模板和本引擎上下文。制作或修改前完整读取 `context.engine.entrypoint` 对应的 `CLAUDE.md`,素材来源与流程遵守该引擎的相关技能及用户要求。再读取 `src/main.ts`、`src/scenes/LoadScene.ts`、`src/scenes/PlayScene.ts`、`configs/assets.json`、`configs/game.json`。
|
|
4
|
+
|
|
5
|
+
- `LoadScene` 负责预加载,`PlayScene` 实现玩法。图片从 `configs/assets.json` 取得本地 slot URL,沿用模板的 `slotUrl` 接线,在 LoadScene 加载并在 PlayScene 使用 texture。
|
|
6
|
+
- 使用召回时调用 craft_assets_search,分类以当前 library 能力为准。anim2d / effect2d 的 PNG 图集及帧布局会转成 spritesheets.json 指向的本地清单,加载时读取 rows、cols、frameCount 和 loop;不将整张图集当作单张角色图。不运行原上下文的检索脚本。
|
|
7
|
+
- 修改加载场景时按需读取 `context.references.loading`;补充玩法观测时读取 `context.references.game_probe`。
|
|
8
|
+
- 保留入口现有的 ready、frameCount 和预览接线,探针 `engine` 保持 `js`;在 snapshot().game 暴露真实场景状态。
|
|
9
|
+
- 使用 `craft_game_check` 构建与验证,再查看四张截图并交付。SDK 自动执行本引擎的必要收尾,不另行调用 Forge 的导出或采集工具。
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# 当前工程:3D / Three.js(engine=js3d)
|
|
2
|
+
|
|
3
|
+
使用当前工程的 Three.js 模板和本引擎上下文。制作或修改前完整读取 `context.engine.entrypoint` 对应的 `CLAUDE.md`,素材来源与流程遵守该引擎的相关技能及用户要求。再读 `src/main.ts`、`src/platform.ts`、`src/style.css`、`game-runtime.json`、`configs/game.json`、`configs/game.controls.json`;需要图片时读 `configs/assets.json`。本模板没有 Phaser 的 LoadScene/PlayScene,不创建这些场景来套用 2D 流程。
|
|
4
|
+
|
|
5
|
+
- 首次制作或修改渲染、预览接线前,按需读取 `context.references.runtime` 的相关生命周期约定。保留模板中的 renderer、camera、resize、preview.afterRender、markReady、renderForCapture 和资源释放行为。
|
|
6
|
+
- 按需求实现 Three.js 场景、相机、光照、网格、材质和真实输入交互。调用 AIGC 生成模型时,静物用 static_mesh,骨骼角色用 skeletal_mesh;已有产物通过 craft_assets_import 导入。图片只作为纹理、背景或 UI,不冒充 3D 模型。
|
|
7
|
+
- 使用召回时,分类用 staticmesh、skeletalmesh、sequence、geometry、ui、terrain_texture、audio。角色与动作需匹配返回的 skeleton_tag,搜索动作时可用 filters.SkeletonTag;保留模型 direction、box_size 并按实际加载结果调整朝向和尺度。召回导入后使用本地 config_file,不运行原上下文中的检索脚本或配置额外 Token。
|
|
8
|
+
- MCP 为 3D 工程准备 `configs/assets.json`。图片从该表取得本地 slot URL,用 Three.js 的 TextureLoader 等实际加载方式接入材质、背景或 Sprite;等待所需资源就绪,透明图片使用相应透明材质。不要使用 Phaser 专用的 slotUrl 或 texture 接口。
|
|
9
|
+
- 模型从 `configs/models.json` 加载;按工程实际 SDK 的 loadGlbModel 或 GLTFLoader 接入本地 GLB/glTF,外部贴图和 buffer 已下载并改写。动作从 animations.json 加载,结合匹配的骨骼与 AnimationMixer 使用。音乐、视频、序列帧按返回的 config_file 加载,资源路径与同名 controls 由 MCP 管理;业务仍需实际消费。
|
|
10
|
+
- 模板已有 `globalThis.__GAME_PROBE__.snapshot()`,`engine` 保持 `js3d`,保留真实 ready、frameCount、viewport 和 camera;增加 game 字段,读取实际分数、阶段、回合等状态。检查步骤使用真实输入,覆盖主循环、结算和重开。
|
|
11
|
+
- 实现问题按需读取 `context.references.pitfalls`;仅在涉及场景编辑器时读取 `context.references.scene_editor`。引擎文档中的 Forge 工具和前端组件接口按当前 MCP 能力适配,素材策略仍遵守本引擎上下文与用户要求。
|
|
12
|
+
- 用 `craft_game_check` 运行本引擎的收尾、构建和采集,再用 `craft_game_review` 看四张截图,检查空间关系、光照、遮挡、相机和纹理接线。浏览器采集可能提供渲染探针,渲染诊断不替代实际看图;通过后使用 `craft_game_deliver`。
|