@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,144 @@
|
|
|
1
|
+
/** JS2D scene document adapter. Pure data: no renderer, listeners, or game loop. */
|
|
2
|
+
const record = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
3
|
+
const text = value => typeof value === 'string' && value.length > 0;
|
|
4
|
+
const own = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
5
|
+
|
|
6
|
+
export function scenePath(value) {
|
|
7
|
+
if (!text(value) || /[\\?#:\x00]/.test(value) || value.startsWith('/') || value.split('/').some(p => !p || p === '.' || p === '..')) {
|
|
8
|
+
throw new Error(`Invalid project path: ${String(value)}`);
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isSceneAsset(asset) {
|
|
14
|
+
if (!record(asset)) return false;
|
|
15
|
+
const caps = Array.isArray(asset.capabilities) ? asset.capabilities : [];
|
|
16
|
+
return ['file', 'procedural', 'prefab', 'terrain', 'component'].includes(asset.kind)
|
|
17
|
+
&& (caps.length ? caps.includes('scene-placeable') || caps.includes('terrain-paintable') : Array.isArray(asset.roles) && asset.roles.includes('scene'))
|
|
18
|
+
&& !(asset.kind === 'file' && asset.path && !/\.(png|jpe?g|webp|gif|svg|avif)$/i.test(asset.path));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Match Web's explicit image URL priority; runtime-box is never an asset base. */
|
|
22
|
+
export function assetImageUrl(asset) {
|
|
23
|
+
return [asset.preview?.url, asset.source?.url].find(value => typeof value === 'string' && /^https?:\/\//i.test(value)) || '';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function validateScene(scene, registry) {
|
|
27
|
+
const errors = [];
|
|
28
|
+
const fail = message => errors.push(message);
|
|
29
|
+
if (!record(registry) || registry.schemaVersion !== 1 || !Array.isArray(registry.assets)) {
|
|
30
|
+
fail('Asset registry requires schemaVersion 1 and assets[]');
|
|
31
|
+
}
|
|
32
|
+
const assets = new Map();
|
|
33
|
+
const registered = new Set();
|
|
34
|
+
for (const asset of Array.isArray(registry?.assets) ? registry.assets : []) {
|
|
35
|
+
if (!record(asset) || !text(asset.id) || registered.has(asset.id)) { fail('Asset IDs must be nonempty and unique'); continue; }
|
|
36
|
+
registered.add(asset.id);
|
|
37
|
+
if (!isSceneAsset(asset)) continue;
|
|
38
|
+
assets.set(asset.id, asset);
|
|
39
|
+
try {
|
|
40
|
+
if (asset.path) scenePath(asset.path);
|
|
41
|
+
if (asset.kind !== 'file') scenePath(asset.source?.module);
|
|
42
|
+
} catch (error) { fail(`${asset.id}: ${error.message}`); }
|
|
43
|
+
if (asset.placement !== undefined && !record(asset.placement)) fail(`${asset.id}: placement must be an object`);
|
|
44
|
+
if (asset.placement?.properties !== undefined && !record(asset.placement.properties)) fail(`${asset.id}: placement.properties must be an object`);
|
|
45
|
+
if (asset.editorSchema !== undefined && !record(asset.editorSchema)) fail(`${asset.id}: editorSchema must be an object`);
|
|
46
|
+
for (const [key, field] of Object.entries(record(asset.editorSchema) ? asset.editorSchema : {})) {
|
|
47
|
+
if (!record(field) || !['boolean', 'number', 'string', 'enum'].includes(field.type)
|
|
48
|
+
|| (field.type === 'enum' && (!Array.isArray(field.options) || !field.options.every(v => typeof v === 'string')))) fail(`${asset.id}.${key}: unsupported editorSchema field`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!record(scene) || scene.schemaVersion !== 2 || !Array.isArray(scene.layers) || !Array.isArray(scene.objects) || !Array.isArray(scene.regions)) {
|
|
52
|
+
return { ok: false, errors: [...errors, 'Scene adapter requires schemaVersion 2 with layers[], objects[], regions[]'] };
|
|
53
|
+
}
|
|
54
|
+
if (!text(scene.id) || !text(scene.name) || !text(scene.baseTerrain)) fail('Scene id, name and baseTerrain are required');
|
|
55
|
+
if (![scene.width, scene.height].every(v => Number.isInteger(v) && v >= 4 && v <= 256)
|
|
56
|
+
|| !Number.isFinite(scene.cellSize) || scene.cellSize <= 0
|
|
57
|
+
|| !Number.isFinite(scene.width * scene.cellSize) || !Number.isFinite(scene.height * scene.cellSize)) fail('Map dimensions must be 4–256 cells with a finite positive cellSize');
|
|
58
|
+
const layers = new Set();
|
|
59
|
+
for (const layer of scene.layers) {
|
|
60
|
+
if (!record(layer) || !text(layer.id) || layers.has(layer.id)) { fail('Layer IDs must be nonempty and unique'); continue; }
|
|
61
|
+
layers.add(layer.id);
|
|
62
|
+
if (!text(layer.name) || !['appearance', 'objects', 'logic'].includes(layer.group)
|
|
63
|
+
|| !['terrain', 'object', 'collision', 'trigger', 'marker'].includes(layer.kind)
|
|
64
|
+
|| !Number.isFinite(layer.order) || typeof layer.visible !== 'boolean' || typeof layer.locked !== 'boolean'
|
|
65
|
+
|| (layer.ySort !== undefined && typeof layer.ySort !== 'boolean')) fail(`${layer.id}: invalid layer`);
|
|
66
|
+
}
|
|
67
|
+
const ids = new Set();
|
|
68
|
+
for (const [collection, items] of [['objects', scene.objects], ['regions', scene.regions]]) {
|
|
69
|
+
for (const item of items) {
|
|
70
|
+
if (!record(item)) { fail(`${collection}: item must be an object`); continue; }
|
|
71
|
+
if (!text(item.id) || ids.has(item.id)) fail('Scene item IDs must be nonempty and unique across objects and regions');
|
|
72
|
+
ids.add(item.id);
|
|
73
|
+
if (!text(item.kind) || !text(item.label) || (collection === 'regions' && !['terrain', 'collision', 'trigger'].includes(item.kind))) fail(`${item.id}: invalid kind or label`);
|
|
74
|
+
if (![item.x, item.y, item.width, item.height].every(Number.isInteger) || item.width < 1 || item.height < 1
|
|
75
|
+
|| item.x < 0 || item.y < 0 || item.x + item.width > scene.width || item.y + item.height > scene.height) fail(`${item.id}: geometry must use integer cells within the map`);
|
|
76
|
+
if (!layers.has(item.layerId)) fail(`${item.id}: missing layer ${item.layerId}`);
|
|
77
|
+
if (item.zIndex !== undefined && !Number.isFinite(item.zIndex)) fail(`${item.id}: zIndex must be finite`);
|
|
78
|
+
if (item.blocksMovement !== undefined && typeof item.blocksMovement !== 'boolean') fail(`${item.id}: blocksMovement must be boolean`);
|
|
79
|
+
if (item.properties !== undefined && !record(item.properties)) fail(`${item.id}: properties must be an object`);
|
|
80
|
+
const asset = assets.get(item.assetId);
|
|
81
|
+
if (item.assetId !== undefined && (!text(item.assetId) || !asset)) fail(`${item.id}: missing placeable asset ${item.assetId}`);
|
|
82
|
+
if (asset?.kind === 'file' && !assetImageUrl(asset)) fail(`${item.id}: image asset ${asset.id} needs an explicit HTTP(S) preview.url/source.url for Web`);
|
|
83
|
+
if (asset) {
|
|
84
|
+
const properties = { ...asset.placement?.properties, ...item.properties };
|
|
85
|
+
for (const [key, field] of Object.entries(record(asset.editorSchema) ? asset.editorSchema : {})) {
|
|
86
|
+
if (!record(field) || !own(properties, key)) continue;
|
|
87
|
+
const value = properties[key];
|
|
88
|
+
if (field.type === 'enum' ? !field.options?.includes(value)
|
|
89
|
+
: typeof value !== field.type || (field.type === 'number' && (!Number.isFinite(value)
|
|
90
|
+
|| (Number.isFinite(field.min) && value < field.min) || (Number.isFinite(field.max) && value > field.max)))) fail(`${item.id}.${key}: property does not match editorSchema`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { ok: errors.length === 0, errors };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Create a detached pixel-space snapshot. Business code owns spawning/rendering/physics. */
|
|
99
|
+
export function compileScene(document, registry) {
|
|
100
|
+
const result = validateScene(document, registry);
|
|
101
|
+
if (!result.ok) throw new Error(result.errors.join('\n'));
|
|
102
|
+
const scene = structuredClone(document);
|
|
103
|
+
const assets = new Map(structuredClone(registry.assets).filter(isSceneAsset).map(asset => [asset.id, asset]));
|
|
104
|
+
const layers = [...scene.layers].sort((a, b) => a.order - b.order);
|
|
105
|
+
const layerOrder = new Map(layers.map((layer, index) => [layer.id, index]));
|
|
106
|
+
const convert = (item, collection) => {
|
|
107
|
+
const asset = assets.get(item.assetId);
|
|
108
|
+
return {
|
|
109
|
+
...item, collection, asset,
|
|
110
|
+
runtimeKind: asset?.placement?.runtimeKind || item.kind,
|
|
111
|
+
imageUrl: asset ? assetImageUrl(asset) : '',
|
|
112
|
+
properties: { ...asset?.placement?.properties, ...item.properties },
|
|
113
|
+
// Explicit false must override defaults. Layer visibility/locking is editor-only.
|
|
114
|
+
blocksMovement: item.blocksMovement ?? (collection === 'regions' && item.kind === 'collision' ? true : asset?.placement?.blocksMovement === true),
|
|
115
|
+
x: item.x * scene.cellSize, y: item.y * scene.cellSize,
|
|
116
|
+
width: item.width * scene.cellSize, height: item.height * scene.cellSize,
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const objects = scene.objects.map(item => convert(item, 'objects'));
|
|
120
|
+
const regions = scene.regions.map(item => convert(item, 'regions'));
|
|
121
|
+
const items = [...regions, ...objects].sort((a, b) => {
|
|
122
|
+
const order = layerOrder.get(a.layerId) - layerOrder.get(b.layerId);
|
|
123
|
+
if (order) return order;
|
|
124
|
+
// Web draws regions before objects within each layer; ySort precedes object zIndex.
|
|
125
|
+
if (a.collection !== b.collection) return a.collection === 'regions' ? -1 : 1;
|
|
126
|
+
if (a.collection === 'objects' && layers[layerOrder.get(a.layerId)].ySort) {
|
|
127
|
+
const y = (a.y + a.height) - (b.y + b.height);
|
|
128
|
+
if (y) return y;
|
|
129
|
+
}
|
|
130
|
+
return (a.zIndex ?? 0) - (b.zIndex ?? 0);
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
id: scene.id, name: scene.name, width: scene.width * scene.cellSize, height: scene.height * scene.cellSize,
|
|
134
|
+
cellSize: scene.cellSize, baseTerrain: scene.baseTerrain, layers, items, objects, regions,
|
|
135
|
+
blockers: items.filter(item => item.blocksMovement),
|
|
136
|
+
spawns: objects.filter(item => ['spawn', 'playerSpawn'].includes(item.kind) || ['spawn', 'playerSpawn'].includes(item.properties.role)),
|
|
137
|
+
triggers: regions.filter(item => item.kind === 'trigger'),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Pixel-space AABB query; touching edges do not overlap. No movement/physics is applied. */
|
|
142
|
+
export function overlaps(a, b) {
|
|
143
|
+
return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;
|
|
144
|
+
}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# 项目场景契约 v1
|
|
2
|
+
|
|
3
|
+
视觉扩展见 [visual-contract.md](visual-contract.md):支持 source.schema / preview.schema 槽关联及资源/实例 visual。此处 schemaVersion 不变,Skill 版本见 ../version.json,需配套编辑器 0.3.0;游戏消费者必须同步实现 visual 才算闭环。
|
|
4
|
+
|
|
5
|
+
与 [platformer-ts](../examples/platformer-ts/) 示例、[check_scene_contract.py](../scripts/check_scene_contract.py) 同版本。缺资料不凭印象发明字段。
|
|
6
|
+
|
|
7
|
+
玩法用 Phaser 3.90 消费本契约:`this.load.image` 入队、`this.add.image(x, y, key)` 摆图、Arcade 按 `listSceneBlockers` 建静态碰撞。检查与标记用本包 Python 脚本;编辑器读声明和场景文件。
|
|
8
|
+
|
|
9
|
+
编辑器按字段过滤:**缺字段会静默跳过,不会报解析失败**。每次保存只回写**当前**场景路径;加过平台资源时还可以带 `localcraft.assets.json`。不会一次覆盖其它场景。编辑器不在界面新建/删除场景。
|
|
10
|
+
|
|
11
|
+
路径一律项目根相对路径:禁止绝对路径、`..`、`./` 前缀、反斜杠、查询参数、协议。
|
|
12
|
+
|
|
13
|
+
## 文件清单
|
|
14
|
+
|
|
15
|
+
| 文件 | 格式 | 谁写 | 编辑器 |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| `localcraft.scene-editor.json` | JSON | Agent | 读 |
|
|
18
|
+
| `localcraft.assets.json` | JSON | Agent;宿主可接收编辑器新增资源提交 | 读;新增资源时可随保存提交,不能假设同时更新资源面板 |
|
|
19
|
+
| `scene.path` / `scenes[].path` 指向的 `.Scene.ts` 或 `.json` | TS / JSON | Agent;编辑器保存时只改**当前**这份 | 读/写当前场景数据 |
|
|
20
|
+
| 场景旁的 `SceneTypes.ts` | TS | Agent | 不读 |
|
|
21
|
+
| `runtimeConsumers` 里的 `.ts` | TS | Agent | 不读 |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. `localcraft.scene-editor.json`
|
|
26
|
+
|
|
27
|
+
项目根。`schemaVersion` 必须是 `1`。多场景靠本文件声明,**不是**按文件名猜。所有场景共用 `assetRegistry`。
|
|
28
|
+
|
|
29
|
+
不写 `scenes` 时按单场景,只看 `scene`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"schemaVersion": 1,
|
|
34
|
+
"scene": { "id": "main", "label": "主场景", "path": "src/scenes/Main.Scene.ts" },
|
|
35
|
+
"assetRegistry": "localcraft.assets.json",
|
|
36
|
+
"runtimeConsumers": ["src/game/sceneAdapter.ts", "src/game/sceneFileAssets.ts", "src/game/sceneBlockers.ts"]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
多个可编辑场景时写 `scenes`(1–64 条)。旧字段 `scene` 仍是默认打开的那一个,**必须和 `scenes` 里某条的 id + path 完全一致**:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"schemaVersion": 1,
|
|
45
|
+
"scene": {
|
|
46
|
+
"id": "battle",
|
|
47
|
+
"label": "战斗",
|
|
48
|
+
"path": "src/scenes/Battle.Scene.ts"
|
|
49
|
+
},
|
|
50
|
+
"scenes": [
|
|
51
|
+
{ "id": "battle", "label": "战斗", "path": "src/scenes/Battle.Scene.ts" },
|
|
52
|
+
{ "id": "start", "label": "开始背景", "path": "src/scenes/Start.Scene.ts" }
|
|
53
|
+
],
|
|
54
|
+
"assetRegistry": "localcraft.assets.json",
|
|
55
|
+
"runtimeConsumers": ["src/game/sceneAdapter.ts"]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
| 字段 | 必填 | 说明 |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `schemaVersion` | 是 | 固定 `1` |
|
|
62
|
+
| `scene.id` | 是 | 默认打开的场景 id;有 `scenes` 时必须等于其中某条的 `id` |
|
|
63
|
+
| `scene.label` | 建议 | 人读名称。这里可以用 `label` |
|
|
64
|
+
| `scene.path` | 是 | `.Scene.ts` 或 `.json`,不要写死 `Main.Scene.ts`。有 `scenes` 时必须等于其中某条的 `path` |
|
|
65
|
+
| `scenes` | 否 | 1–64 条 `{id,label,path}`。`id` 不能空;**id 和 path 各自唯一**(path 大小写不敏感) |
|
|
66
|
+
| `assetRegistry` | 是 | 资产表路径,通常 `localcraft.assets.json`,所有场景共用 |
|
|
67
|
+
| `runtimeConsumers` | 是 | 非空字符串数组。合起来必须静态 import **每一个**已声明 `path`。至少一个还必须静态 import 资产表,并实现 `listSceneFileObjects` / `enqueueSceneFileImages`(资产表还没有 `kind=file` 也要先写好)。至少一个还必须实现 `listSceneBlockers`(场景还没有 `blocksMovement: true` 也要先写好) |
|
|
68
|
+
|
|
69
|
+
编辑器**不会**在界面里新建/删除场景。要进左侧列表必须:文件已存在 + 写进声明 + 运行时静态 import。少一个声明的场景文件,宿主快照会打不开。
|
|
70
|
+
|
|
71
|
+
`scenes[]` 条目还可选 `constraints`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"id": "battle",
|
|
76
|
+
"label": "战斗",
|
|
77
|
+
"path": "src/scenes/Battle.Scene.ts",
|
|
78
|
+
"constraints": {
|
|
79
|
+
"requiredObjects": [{ "id": "player-spawn", "kind": "spawn", "assetId": "spawn" }],
|
|
80
|
+
"uniqueObjectKinds": ["spawn"],
|
|
81
|
+
"allowedObjectKinds": ["spawn", "platform", "resource"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
JSON 场景仍输出 JSON,TS 场景仍输出 TS,不自动创建第二份源。
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 2. `localcraft.assets.json`
|
|
91
|
+
|
|
92
|
+
`assetRegistry` 声明的项目根相对路径,通常是 `localcraft.assets.json`。`schemaVersion` 必须是 `1`。这是编辑器资源库的来源;宿主可随编辑器新增资源保存更新该文件,但不能据此认为 `configs/assets.json`、资源面板和业务代码已同步。已适配项目后续换图 / 加资源按 `${CLAUDE_DIR}/skills/scene-editor-compat/docs/resource-sync.md` 维护。
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"schemaVersion": 1,
|
|
97
|
+
"assets": [
|
|
98
|
+
{
|
|
99
|
+
"id": "obstacle-rock",
|
|
100
|
+
"name": "石墩",
|
|
101
|
+
"kind": "procedural",
|
|
102
|
+
"capabilities": ["scene-placeable"],
|
|
103
|
+
"source": { "module": "src/scenes/snakeGame/SnakeGameScene.ts" },
|
|
104
|
+
"placement": { "runtimeKind": "obstacle", "width": 1, "height": 1 }
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "platform:12",
|
|
108
|
+
"name": "草丛",
|
|
109
|
+
"kind": "file",
|
|
110
|
+
"capabilities": ["scene-placeable"],
|
|
111
|
+
"source": {
|
|
112
|
+
"type": "preset",
|
|
113
|
+
"url": "https://file.craft.qq.com/Game/grass.png",
|
|
114
|
+
"platformResourceId": "12"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 每条 `assets[]` 必填(要进资源库时)
|
|
122
|
+
|
|
123
|
+
| 字段 | 允许值 | 缺了会怎样 |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `id` | 非空字符串,全局唯一 | 场景无法引用 |
|
|
126
|
+
| `name` | 显示名 | 编辑器读 `name`,没有则用 `id`。**不读 `label`** |
|
|
127
|
+
| `kind` | `file` \| `procedural` \| `prefab` \| `terrain` \| `component` | **直接跳过该条,资源库没有 `#id`,属性栏仍可能显示物件** |
|
|
128
|
+
| `capabilities` | 数组,至少含下面之一 | 不进对应库 |
|
|
129
|
+
| `source` | 按 `kind` 见下表 | 契约检查失败 |
|
|
130
|
+
|
|
131
|
+
`capabilities`:
|
|
132
|
+
|
|
133
|
+
- `scene-placeable` → 场景物件库
|
|
134
|
+
- `terrain-paintable` → 地形库
|
|
135
|
+
|
|
136
|
+
没有这两项的条目(UI / 音频 / 普通数据)不会仅因出现在本文件而进入编辑器。
|
|
137
|
+
|
|
138
|
+
### `kind` 怎么选
|
|
139
|
+
|
|
140
|
+
| `kind` | 何时用 | `source` | 运行时怎么用 |
|
|
141
|
+
|---|---|---|---|
|
|
142
|
+
| `procedural` | 在某个 `.ts` 里画,没有独立图片 | `{ "module": "src/..." }`,路径必须真实存在 | 在该模块里按 `assetId` 画 |
|
|
143
|
+
| `file` | 独立图片 | `{ "url": "<图片地址>" }`,还可有 `type`、`platformResourceId` | **必须** `this.load.image(key, resolveAssetUrl(source.url))` 加载该 URL,再按格 `add.image` 摆进场景。禁止忽略 `url` 改成程序绘制 |
|
|
144
|
+
| `prefab` | 预制体 | 按项目已有声明 | 按已有接法 |
|
|
145
|
+
| `terrain` | 地形笔刷 | 按项目已有声明 | 按已有接法 |
|
|
146
|
+
| `component` | 出生点等逻辑对象 | `{ "module": "src/..." }` | 在该模块里按 `assetId` 处理 |
|
|
147
|
+
|
|
148
|
+
`kind=file` 的 `source` **不写 `module`**。没有槽绑定时从 `source.url` 加载;有 `source.schema` 时使用项目对应槽位的实际生效值,并保持 `source.url` 后备一致。交给项目 `resolveAssetUrl`,不要手拼 CDN 或另存 URL 常量表。资产表还没有 file 时,仍按 [sceneFileAssets.ts](../examples/platformer-ts/src/game/sceneFileAssets.ts) 预接空列表接口。
|
|
149
|
+
|
|
150
|
+
### 不要写在资产表里
|
|
151
|
+
|
|
152
|
+
| 错误字段 | 原因 |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `label` | 资产表显示名是 `name`。`label` 是场景 **物件** 字段 |
|
|
155
|
+
| `assetId` | 资产表主键是 `id`。`assetId` 是场景 **物件** 用来引用这个 `id` 的字段 |
|
|
156
|
+
| 资产顶层 `blocksMovement` | 实际开关在场景物件/区域顶层;新实例默认值可写 `placement.blocksMovement` |
|
|
157
|
+
|
|
158
|
+
### 可选
|
|
159
|
+
|
|
160
|
+
`category`、`preview`(`color` / `icon`)、`placement`(`runtimeKind`、默认 `width` / `height`)、`editorSchema`(`boolean` / `number` / `string` / `enum`,生成属性控件)。
|
|
161
|
+
|
|
162
|
+
`placement` 给新实例的默认格尺寸、`runtimeKind`、`blocksMovement` 与 `properties`;运行时以场景实例为准。可绘制地形的 `runtimeKind` 必须是具体类型,不能是泛称 `terrain/resource`。详见 [terrain-contract.md](terrain-contract.md),含历史数据迁移、地形渲染、默认属性及行为验收。
|
|
163
|
+
|
|
164
|
+
完整形态见 [platformer-ts/localcraft.assets.json](../examples/platformer-ts/localcraft.assets.json)。
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 3. 场景文件(每个声明的 `path`)
|
|
169
|
+
|
|
170
|
+
每个 path 各自一份文档:`id` / `name` / `width` / `height` / `cellSize` / `layers` / `objects` / `regions` 不要共用一个 `Build`。`id` 等于该条声明的 `id`。物件 `assetId` 指向**共享**注册表。
|
|
171
|
+
|
|
172
|
+
推荐 `*.Scene.ts`(后缀大小写不敏感);现有 `.json` 同样支持。类型从项目自有文件 `import type`,不依赖编辑器包。
|
|
173
|
+
|
|
174
|
+
### 3.1 TS:`export function Build(): SceneDocument`
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import type { SceneDocument } from './SceneTypes';
|
|
178
|
+
|
|
179
|
+
export function Build(): SceneDocument {
|
|
180
|
+
return {
|
|
181
|
+
schemaVersion: 2, id: 'main', name: '主场景',
|
|
182
|
+
width: 24, height: 14, cellSize: 32, baseTerrain: 'sky',
|
|
183
|
+
layers: [
|
|
184
|
+
{ id: 'objects', name: '场景物件', group: 'objects', kind: 'object', order: 10, visible: true, locked: false }
|
|
185
|
+
],
|
|
186
|
+
regions: [],
|
|
187
|
+
objects: [
|
|
188
|
+
{
|
|
189
|
+
id: 'rock-1', label: '石墩', kind: 'obstacle',
|
|
190
|
+
assetId: 'obstacle-rock', layerId: 'objects',
|
|
191
|
+
x: 3, y: 8, width: 1, height: 1
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
updatedAt: '2026-09-09T00:00:00.000Z'
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
编辑器不运行 TS,只静态解析 `Build` 的返回字面量。保存时替换这个返回对象,保留对象外的 `import type`、函数签名和注释。
|
|
200
|
+
|
|
201
|
+
**Build 形态:**
|
|
202
|
+
|
|
203
|
+
- 唯一导出;同步;无参数;非生成器;函数体只有一条 `return { ... }`
|
|
204
|
+
- 只允许静态字面量:对象、数组、字符串、有限数字、布尔、`null`、正负数字、注释、尾逗号,以及 `as` / `satisfies`
|
|
205
|
+
- 允许 `import type`、interface / type 声明
|
|
206
|
+
- 禁止:值导入、变量引用、函数调用、展开、计算属性、方法、模板字符串、`undefined`、执行语句
|
|
207
|
+
- 禁止:重复属性、危险原型属性、数组空位;文件上限 5MB
|
|
208
|
+
- TS 语法解析不代替 `tsc`;类型是否存在由项目构建验证
|
|
209
|
+
|
|
210
|
+
### 3.2 场景文档字段(TS 返回对象 / JSON 根对象相同)
|
|
211
|
+
|
|
212
|
+
`schemaVersion` 必须是 `2`。地图宽高 4~256 格。无法识别的扩展字段会保留。
|
|
213
|
+
|
|
214
|
+
| 字段 | 必填 | 说明 |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| `schemaVersion` | 是 | 固定 `2` |
|
|
217
|
+
| `id` | 是 | 与该条声明的 `id` 一致 |
|
|
218
|
+
| `name` | 是 | 场景显示名 |
|
|
219
|
+
| `width` / `height` | 是 | 格数,4~256 |
|
|
220
|
+
| `cellSize` | 是 | 每格像素 |
|
|
221
|
+
| `baseTerrain` | 是 | 底图地形 id |
|
|
222
|
+
| `layers` | 是 | 图层数组 |
|
|
223
|
+
| `regions` | 是 | 可空数组 |
|
|
224
|
+
| `objects` | 是 | 物件数组 |
|
|
225
|
+
| `updatedAt` | 是 | ISO 时间字符串 |
|
|
226
|
+
| `projectId` | 否 | |
|
|
227
|
+
|
|
228
|
+
**`layers[]`:**
|
|
229
|
+
|
|
230
|
+
| 字段 | 必填 | 允许值 |
|
|
231
|
+
|---|---|---|
|
|
232
|
+
| `id` / `name` | 是 | 字符串 |
|
|
233
|
+
| `group` | 是 | `appearance` \| `objects` \| `logic` |
|
|
234
|
+
| `kind` | 是 | `terrain` \| `object` \| `collision` \| `trigger` \| `marker` |
|
|
235
|
+
| `order` | 是 | 数字 |
|
|
236
|
+
| `visible` / `locked` | 是 | 布尔 |
|
|
237
|
+
| `ySort` | 否 | 布尔 |
|
|
238
|
+
|
|
239
|
+
图层 `kind` 不是资产表 `kind`,不要写成 `procedural`。
|
|
240
|
+
|
|
241
|
+
**`objects[]`:**
|
|
242
|
+
|
|
243
|
+
| 字段 | 必填 | 说明 |
|
|
244
|
+
|---|---|---|
|
|
245
|
+
| `id` | 是 | 物件实例 id |
|
|
246
|
+
| `label` | 是 | 物件显示名。这里用 `label`,不要改成 `name` |
|
|
247
|
+
| `kind` | 是 | 玩法分类(如 `spawn` / `platform` / `obstacle`),**不是**资产表的 `file\|procedural\|...` |
|
|
248
|
+
| `assetId` | 是 | 等于资产表某条的 `id`。出生点等逻辑对象也必须能解析 |
|
|
249
|
+
| `layerId` | 是 | 等于某图层 `id` |
|
|
250
|
+
| `x` / `y` / `width` / `height` | 是 | 整数格坐标 / 格尺寸,禁止小数(`1` 可以,`1.5` / `1.0` 都不行) |
|
|
251
|
+
| `blocksMovement` | 否 | 布尔。运行时阻挡的**唯一**开关:`true` 才挡,未写或 `false` 都不挡 |
|
|
252
|
+
| `zIndex` / `properties` | 否 | |
|
|
253
|
+
|
|
254
|
+
所有 `assetId` 必须在资产表存在,且该条已声明 `scene-placeable` 或 `terrain-paintable`。`regions[]` 若有条目,`x` / `y` / `width` / `height` 同样必须是整数;区域要挡人时也必须顶层写 `blocksMovement: true`。
|
|
255
|
+
|
|
256
|
+
### 3.3 JSON 场景
|
|
257
|
+
|
|
258
|
+
根对象就是上面这份文档,没有 `Build` 函数。已有 JSON 不要改成 TS,已有 TS 不要改成 JSON。
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 4. `SceneTypes.ts`
|
|
263
|
+
|
|
264
|
+
给项目 `tsc` 用,编辑器不读。字段名必须与第 3 节场景对象一致:物件用 `label` + `assetId`,文档用 `name`。
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
export interface SceneItem {
|
|
268
|
+
id: string; label: string; kind: string; layerId: string;
|
|
269
|
+
x: number; y: number; width: number; height: number;
|
|
270
|
+
assetId?: string; blocksMovement?: boolean; zIndex?: number;
|
|
271
|
+
properties?: Record<string, unknown>;
|
|
272
|
+
}
|
|
273
|
+
export interface SceneDocument {
|
|
274
|
+
schemaVersion: 2; id: string; name: string; projectId?: string;
|
|
275
|
+
width: number; height: number; cellSize: number; baseTerrain: string; updatedAt: string;
|
|
276
|
+
layers: Array<{
|
|
277
|
+
id: string; name: string; group: 'appearance' | 'objects' | 'logic';
|
|
278
|
+
kind: 'terrain' | 'object' | 'collision' | 'trigger' | 'marker';
|
|
279
|
+
order: number; visible: boolean; locked: boolean; ySort?: boolean;
|
|
280
|
+
}>;
|
|
281
|
+
objects: SceneItem[];
|
|
282
|
+
regions: Array<SceneItem & { kind: 'terrain' | 'collision' | 'trigger'; terrain?: string; color?: string }>;
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 5. `runtimeConsumers` 里的 `.ts`
|
|
289
|
+
|
|
290
|
+
编辑器不读这些文件。必须满足:
|
|
291
|
+
|
|
292
|
+
1. 文件存在
|
|
293
|
+
2. **非** `import type` 的静态 `import { Build } from '...'`(或等价值导入)覆盖**每一个**已声明 `path`(多场景可用 `import { Build as buildBattle }`)。只写注释或动态 `import()` 不算
|
|
294
|
+
3. 启动链路按当前玩法调用对应 `Build()`(JSON 则消费对应数据)
|
|
295
|
+
4. 至少一个 consumer 静态 import 资产表,并提供 `listSceneFileObjects` / `enqueueSceneFileImages`。资产表还没有 `kind=file` 也必须先写好——编辑器稍后加 file 条目时不会再跑适配 skill
|
|
296
|
+
5. 至少一个 consumer 提供 `listSceneBlockers`:只收顶层 `blocksMovement === true` 的物件/区域。场景里一条都没有也必须先写好——编辑器稍后勾选阻挡不会再跑适配 skill
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
import { Build as buildMain } from '../scenes/Main.Scene';
|
|
300
|
+
import { Build as buildStart } from '../scenes/Start.Scene';
|
|
301
|
+
import registry from '../../localcraft.assets.json';
|
|
302
|
+
import { listSceneFileObjects, enqueueSceneFileImages } from './sceneFileAssets';
|
|
303
|
+
import { listSceneBlockers } from './sceneBlockers';
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
单场景可继续 `import { Build } from '../scenes/Main.Scene'`。JSON 场景则 `import battle from './scenes/battle.scene.json'`。
|
|
307
|
+
|
|
308
|
+
完整 join / 入队见 [sceneFileAssets.ts](../examples/platformer-ts/src/game/sceneFileAssets.ts)。加载界面:
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
enqueueSceneFileImages(this.load, (k) => this.textures.exists(k), resolveAssetUrl);
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
开战按 `listSceneFileObjects()` 的物件格尺寸 × `cellSize` 和合并后的 `visual` 渲染,不用资产表 `placement` 覆盖实例。`setDisplaySize(width,height)` 仅适用于 stretch;contain/cover/tile 按 [视觉契约](visual-contract.md) 实现。示例中的 file 列表是最低接线,不代表已有游戏自动支持全部视觉规则。
|
|
315
|
+
|
|
316
|
+
阻挡见 [sceneBlockers.ts](../examples/platformer-ts/src/game/sceneBlockers.ts)。开战用项目已有物理按矩形建静态碰撞,例如:
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
for (const b of listSceneBlockers()) {
|
|
320
|
+
const zone = this.add.zone(b.x, b.y, b.width, b.height).setOrigin(0, 0);
|
|
321
|
+
this.physics.add.existing(zone, true);
|
|
322
|
+
this.physics.add.collider(player, zone);
|
|
323
|
+
}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
禁止用 `kind === 'obstacle'`、硬编码墙表另算一份初始碰撞。上述静态体示例只覆盖不会变化的阻挡;可移动、可清除、可开关等实例须接入项目已有状态系统,按实例更新碰撞与缓存,见 [runtime-state.md](runtime-state.md)。
|
|
327
|
+
|
|
328
|
+
支持项目相对路径、`@/`、TS 无扩展名 import。注释、普通字符串、动态 `import()` 不算接入证据。
|
|
329
|
+
|
|
330
|
+
宽高、图层顺序、`assetId`、位置、尺寸、属性必须从返回数据建世界,不能另写一份位置表。`runtimeConsumers` 合起来必须静态 import **每一个**已声明场景 path。至少一个 consumer **必须静态 import 资产表**并实现读 `source.url` 的接口;**当前没有 `kind=file` 条目也要提前写**,列表为空时入队 0 张图即可。禁止等出现 file 再补、禁止把 url 抄进 `boot.config` / `FILE_ASSETS`、禁止改成程序绘制。至少一个 consumer **必须提供 `listSceneBlockers`**;**当前没有 `blocksMovement: true` 也要提前写**,列表为空时建 0 块阻挡即可。禁止等出现阻挡再补、禁止平行墙表。UI / 战斗 / AI / 输入留在其他模块。静态 import 不能证明 `Build()` 已被调用;最终验收是「编辑场景 → 保存构建 → 游戏位置或属性真实变化」。
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 已适配 JS2D 项目的资源持续同步
|
|
2
|
+
|
|
3
|
+
适用于 `scene_editor_compat: true` 项目中已授权的资源修改。自然对话换图、素材库 / AIGC 替换、游戏资源面板交给 Agent 的配置修改,均是资源变更,不因本轮未提“场景编辑器”而跳过。编辑器新增资源的保存结果进入 Agent 后,同样维护关联;本文不新增宿主触发机制。
|
|
4
|
+
|
|
5
|
+
未适配项目不自动转换,不增加首轮适配成本。标记缺失但已有场景声明时先核对项目状态,不能丢掉旧声明或擅自重建场景。只读问题只诊断;基准版本变更、文件读取失败或资源映射不明时交回宿主,不猜测覆盖。
|
|
6
|
+
|
|
7
|
+
## 找到本次变更对应的资源
|
|
8
|
+
|
|
9
|
+
读取当前工作区的 `localcraft.scene-editor.json`,按 `assetRegistry`、`scene` / `scenes`、`runtimeConsumers` 追踪引用;再读受影响的资源配置、`@slot`、面板快照和加载 / 绘制代码。旧项目沿用已有配置与导出链路,不为同步迁移 SDK。
|
|
10
|
+
|
|
11
|
+
- 分清场景资产 `assets[].id`、场景物件 `objects[].id`、资源面板槽位 key、平台素材 ID。它们不是同一个 ID;URL 也不是稳定身份。
|
|
12
|
+
- 根据本轮目标、现有声明和实际消费者确认映射,不能仅按中文名或同一旧 URL 全量替换。同一图片可被多个不同业务资产使用;同一场景资产可被多个场景实例共用。
|
|
13
|
+
- 沿用项目已有映射;确需补映射时,使用编辑器已有的 `source.schema` 关联统一配置中的 schema,并在业务适配器中使用相同槽位。出生点静态预览使用 `preview.schema`,见 [visual-contract.md](visual-contract.md)。不复制 URL 常量表、不按名称猜绑定,也不要求 `assetId` 与槽名相等。
|
|
14
|
+
- 以本轮明确选择及宿主实际应用的配置为准,结合当前代码追踪生效值。不能拿旧资产表反向覆盖新选择;有冲突且无法判定来源时先报告。地址合法性遵守 `${CLAUDE_DIR}/knowledge/AssetUrl.md`。
|
|
15
|
+
|
|
16
|
+
## 最小同步
|
|
17
|
+
|
|
18
|
+
### 地址归一化与历史资源修复
|
|
19
|
+
|
|
20
|
+
首次适配、修复历史上传/素材库资源和每次后续换图均执行。资源最初来自上传还是素材库,不决定地址一定是完整 URL;以当前版本的实际字段为准。
|
|
21
|
+
|
|
22
|
+
1. **先锁定目标值。** 对同一 schema,编辑器按 `change_value ?? value ?? default ?? origin` 读取(空字符串不是缺失值)。结合本轮选择与项目配置应用链路确定目标。本轮 `--provide` 并已写入 JSON 的资源,目标就是 JSON 这条。先保存这一目标,再运行可能重新导出的命令;不要用旧 `configs/assets.json`、注册表或 `origin/default` 覆盖它。保留 `source.schema` / `preview.schema`;替换平台素材不能因平台 ID 变化而重建槽名或误绑到另一个槽,检查消费者是否仍从该 schema 对应槽位取值。
|
|
23
|
+
2. **区分游戏解析和编辑器解析。** 游戏可调用 `resolveAssetUrl` 补域名;编辑器仅解析声明数据。相对槽位值需要该条配置的完整 `origin/default` 站点根,或宿主实际传入的 `assetBaseUrl`。注册表的完整 URL 不会自动变成槽位的地址基准。缺少基准时,槽位无法解析,编辑器会退到 `preview.url` / `source.runtimeUrl` / `source.url` / `path`,可能不报错却显示旧图。
|
|
24
|
+
3. **只依据明确来源补全。** 遵守 AssetUrl.md 和项目现有 `resolveAssetUrl` 的配置。已确认官方 `/Game/...`、`Game/...` 由该解析器映射到官方域时,使用其等价完整 URL;`test1/...` 等路径必须有该资源元数据或实际解析配置作为依据,不能从任意第三张图片借域名。项目本地 `assets/...` 不自动拼到 CDN;找不到可供编辑器使用的真实基准/文件地址时报告缺少宿主数据,不编造 URL、鉴权参数或协议字段。不要为修地址新增 SDK 或改 Web。
|
|
25
|
+
4. **维护最新后备而非冻结旧图。** `configs/assets.json` 与 `@slot` 继续遵守原值规则,不为编辑器强制整表改成绝对 URL。对于同一张静态图片,将目标值解析后的完整 URL 写入受影响注册项的 `source.runtimeUrl`,并同步已有 `preview.url` 等更高优先级的图片后备;不存在的 `preview.url` 不必新增。`source.url` 与目标原值保持语义一致。单独的出生点/动画静帧仅维护其 `preview.schema` 对应的预览,不能拿动画 manifest 覆盖静态预览,也不能覆盖动画运行时源。保留 ID、实例摆放及原行为。
|
|
26
|
+
5. **导出后再比一次。** 同时检查最新槽位目标和编辑器最终选择的 URL。两者经已确认的解析规则应指向同一张图片;“地址非空 / 能显示 / 构建通过”不等于换图同步。不要删除 schema 只保留静态 URL,也不要修改旧默认值假装消除覆盖差异。
|
|
27
|
+
|
|
28
|
+
典型回归:源配置/注册表仍是 `Game/.../old.png`,面板 `value` 已为 `Game/.../new.png`,旧修复只补了 `preview.url=https://.../old.png`。缺少槽位地址基准时编辑器仍显示 old。应保留 new 为本轮目标,按现有配置应用链路对齐该槽,生成 new 的完整后备,并验证第二次换图依然同步;不回滚 value。
|
|
29
|
+
|
|
30
|
+
### 按操作维护
|
|
31
|
+
|
|
32
|
+
**已有资源换图:**
|
|
33
|
+
|
|
34
|
+
1. 原地更新目标资产的视觉来源,保留场景资产 ID、实例 ID、物件 `kind`、`placement.runtimeKind`、自定义属性、位置尺寸、层级与碰撞。平台素材被替换时按新素材的真实信息更新来源元数据,不保留错误的旧平台素材 ID;场景资产 ID 不因此改名。
|
|
35
|
+
2. 真实单图替换纯程序占位时,按既有契约将对应资产改为 `kind: file` 并写入有效 `source.url`,移除该条不适用的 `source.module`。只替换绘制,不把“平台 / 敌人”等业务对象降成无行为装饰,也不在旧程序图上再叠一张重复图片。prefab / component / 动画资源按项目已支持的结构处理,不能一律压成单图。
|
|
36
|
+
3. 同步对应槽位配置与 `@slot` 接线。游戏加载与编辑器必须解析到同一资源;维护 `source.schema` / `preview.schema` 对应的有效配置,同时同步该资源过期的 `preview.url`、`source.runtimeUrl`、`source.url` 后备。编辑器不执行表达式,不能把槽名写进 `source.url`。宿主快照必须包含最新统一配置,不仅是资产表。背景也遵循此规则。
|
|
37
|
+
4. 动画保留原来的 manifest、图集参数、动画播放与业务绑定。静态预览图不等于动画源,不把预览地址覆盖运行时动画地址;编辑器当前契约无法表达时明确报告该限制,不伪报“动画已同步”。
|
|
38
|
+
|
|
39
|
+
**新增资源:**
|
|
40
|
+
|
|
41
|
+
- Agent / 平台 / 上传资源:只有确实用于场景摆放或绘制的内容才登记场景 capability;纯 UI、音频不为凑齐面板而塞进场景物件库。新资产新建唯一 ID;重复摆放复用资产 ID,只为新实例创建实例 ID。
|
|
42
|
+
- 编辑器新增后交给 Agent:保留宿主已保存的注册项、场景布局和 ID;为需要展示 / 替换的真实文件资源补对应配置槽位、`@slot` 与消费者,并通过项目已有导出链路进入“游戏资源”面板。仅写场景资产表不代表面板已更新。
|
|
43
|
+
- 接入已有行为使用项目声明的构造 / 注册逻辑;没有行为声明的新增装饰不擅自变成敌人、角色或可交互物。
|
|
44
|
+
|
|
45
|
+
**删除资源:** 先查全部已声明场景、配置槽位及消费者。删除实例不等于删除共享资产;仍有其他引用时保留资产。只有用户授权的删除范围明确且引用处理完毕,才清理对应注册 / 配置,不能整表重建。
|
|
46
|
+
|
|
47
|
+
## 导出、检查与交回
|
|
48
|
+
|
|
49
|
+
1. 完成受影响配置与场景资产同步,再跑项目已有的配置导出和构建。新模板使用 `${CLAUDE_DIR}/skills/export-config/SKILL.md`;旧项目只用已有脚本。不要手改导出快照代替修改源配置,也不要清空无关的面板覆盖值。
|
|
50
|
+
2. 导出后复读受影响槽位的**实际生效值**:不能只比较 `origin` / `default`,还需按项目规则核对 `value` / `change_value` 等覆盖值。如果导出保留了旧覆盖,沿既有配置更新流程对齐本轮选择,不让其在构建时把新图覆盖回旧图。
|
|
51
|
+
3. 对照目标资产的 `kind` / `source.url`、槽位生效值、实际加载路径与预览来源;经项目 URL 解析后应指向相同目标(动画的预览与运行时源按其真实关联核对)。同时检查所有引用该资产的场景,以及稳定 ID、布局、属性和行为是否保留。多条资产明确共用同一槽位时,检查所有受影响条目。
|
|
52
|
+
4. 运行契约静态检查,再按常驻 `CLAUDE.md` 构建与 `game_visual_qa`:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python3 "${CLAUDE_SKILL_DIR}/scripts/check_scene_contract.py" --project-root "${CLAUDE_PROJECT_DIR}" --json
|
|
56
|
+
python3 "${CLAUDE_SKILL_DIR}/scripts/check_scene_resource_urls.py" --project-root "${CLAUDE_PROJECT_DIR}"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
契约检查器只验结构和静态接线。URL 检查器只读声明与统一配置,列出编辑器的选图结果,检查 schema 缺失、无法解析以及同一图片后备与生效值不一致;不联网、不改文件。只有已确认宿主实际提供时才传 `--asset-base-url`;仅在游戏解析器确实使用该基准时传 `--runtime-base-url`(用于比较目标,不模拟成宿主已传地址)。相对槽位缺少编辑器基准但已有与目标一致的完整后备,会报 warning 而非假装槽位已能解析;没有目标解析依据时标为未验证,不借另一资源的域名。检查器不运行业务代码、不验证源配置应用、HTTP 可达性、图片内容或动画,仍须完成上述人工核对与运行验证。`scene_editor_compat` 与 `sceneeditor` 功能版本仍只由标记脚本维护,版本值来自 `version/craft_feature_version.json`。
|
|
60
|
+
5. 由宿主保存包含配置、资产注册、场景与消费者的同一新版本快照。能操作宿主时重开该版本的游戏、资源面板和场景编辑器,检查本轮资源显示;只有游戏视觉 QA 时,编辑器与面板实测标为未验证,不声称三端全通过。换图后仍不显示,先比较实际载入版本与资源请求,再定位缓存或渲染,不能恢复占位掩盖问题。
|
|
61
|
+
|
|
62
|
+
重点回归:适配后程序占位换真实图、真实图 A 换 B(自然对话及面板入口)、编辑器新增资源进入面板再换图、多场景共用资产、同 URL 不同业务资产不误替换;都要检查原玩法仍正常。若本轮资源与场景无关,说明检查后无需改场景注册,不制造无关文件变化。
|
|
63
|
+
|
|
64
|
+
旧项目再加两条回归:历史上传和素材库图片只有相对路径时不丢资源、不删实例;修复可见后连续换图 A→B→C,每次检查导出后的有效值、完整后备及重开编辑器显示 C,不能仅验证第一次补全。无宿主条件时只报告静态数据检查,不声称正式环境已生效。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 场景初始数据与运行时状态
|
|
2
|
+
|
|
3
|
+
首次适配,或已适配项目修改场景实例的状态、碰撞、交互生命周期时读取。沿用项目已有玩法与状态系统,不新增 Web 协议、通用玩法框架或存档格式。
|
|
4
|
+
|
|
5
|
+
## 初始声明不等于永久状态
|
|
6
|
+
|
|
7
|
+
- `Build()` / JSON 描述场景初始布局;资产 `placement` 只提供新增实例默认值。加载时保留实例 ID、尺寸、属性与顶层 `blocksMovement`,未声明或 false 不产生初始阻挡,不按 kind 或颜色推断。
|
|
8
|
+
- 游戏开始后,使用项目已有运行时实体或状态管理承接变化。按稳定实例 ID 关联显示、交互与碰撞;多场景时用场景 ID + 实例 ID 隔离,不能只按 assetId 更新所有复用实例。
|
|
9
|
+
- 游戏中的移动、开关、清除、破坏等应同步更新对应实例的碰撞范围或启用状态及相关缓存。清除可阻挡物件时不能只隐藏图片,也不能为了清一个物件移除整类资产的碰撞。若该位置还有其他有效阻挡,应继续阻挡。
|
|
10
|
+
- 静态物件允许缓存初始阻挡;会变化的物件必须在变化时更新/失效缓存或直接查询当前状态。每帧重新读取初始 Build 也不是动态同步,会把已清除或移动的状态恢复。
|
|
11
|
+
- 重开、切场景及读档使用项目原有生命周期:清理旧碰撞体/事件绑定,按该项目的重置或持久化规则恢复。不要把本局变化自动写回编辑器场景文件;存档已有约定时沿用,不擅自清档。
|
|
12
|
+
|
|
13
|
+
## 状态转换保留原有玩法
|
|
14
|
+
|
|
15
|
+
修改地形或物件适配时核对“初始状态 → 玩家操作 → 新状态 → 下一步允许的操作”。渲染、通行和交互条件应读取一致的当前状态,不能只改变颜色,或把状态写成后续操作永远不接受的值。
|
|
16
|
+
|
|
17
|
+
具体状态名称和业务条件由项目定义。不要求所有项目支持耕作、破坏、开门或任何示例玩法;仅维护已有行为。发现与本轮适配无关的旧玩法缺陷,报告并区分,不为了通过检查重写整套玩法。
|
|
18
|
+
|
|
19
|
+
## 有针对性的回归
|
|
20
|
+
|
|
21
|
+
在隔离草稿中选择实际受影响的实例,记录操作前后数据及可观察结果:
|
|
22
|
+
|
|
23
|
+
1. 编辑并保存一个已声明的业务参数,重开后值一致,游戏实际消费者使用该实例值;对象与区域均适用,扩展字段和其他实例不变。
|
|
24
|
+
2. 涉及动态阻挡时:验证状态变化前后显示、通行一致;同资产的另一个实例不受影响;重叠的其他阻挡不被误删。按项目支持范围验证恢复、重开或场景切换,不遗留空气墙/重复碰撞。
|
|
25
|
+
3. 涉及业务状态时:走完受影响的连续操作,确认后续步骤可达,而不只看操作成功提示或第一帧。预期行为来自原项目设计,不来自编辑器统一规则。
|
|
26
|
+
4. 复验至少一条受影响范围内的原有正常路径。静态契约、构建、逻辑测试和实际游戏验证分别报告;未实际执行的项目不标通过。测试状态不混入用户最终布局。
|
|
27
|
+
|
|
28
|
+
静态检查脚本不能证明缓存更新、状态转换或游戏效果正确;不要用函数名存在、import 成功或适配标记代替运行证据。
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 地形绘制与运行时消费
|
|
2
|
+
|
|
3
|
+
首次适配含地形的项目、修改地形能力、修复“编辑器画了但游戏没变”时读取。沿用现有字段,不新增 Web 接口;编辑器侧绘制/保存校验需配套 JS2DSceneEditor 0.3.1。静态检查只能检查声明,不能证明游戏已消费。
|
|
4
|
+
|
|
5
|
+
## 分类与类型分开
|
|
6
|
+
|
|
7
|
+
- `capabilities: ["terrain-paintable"]` 决定进入地形库;`regions[].kind: "terrain"` 表示区域类别。
|
|
8
|
+
- `placement.runtimeKind` 是游戏真正支持的具体地形类型。编辑器将它原样写到新增区域的 `terrain`,不能填泛称 `terrain` / `resource` 或空值。
|
|
9
|
+
- 类型由项目定义,不局限于 water/grass,也不能根据名称、颜色或平台资产 ID 猜测。只有已实现运行时消费的笔刷才声明可绘制。
|
|
10
|
+
- `assetId` 保持资产身份;具体地形类型和资产 ID 可以不同。不同美术资源也可以共享地形类型。
|
|
11
|
+
|
|
12
|
+
例如下面仅适用于游戏已实现 `water` 且设计要求阻挡的项目:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"id": "river-surface-art",
|
|
17
|
+
"name": "河流水面",
|
|
18
|
+
"kind": "procedural",
|
|
19
|
+
"source": { "module": "src/render/ground.ts" },
|
|
20
|
+
"capabilities": ["terrain-paintable"],
|
|
21
|
+
"placement": { "runtimeKind": "water", "width": 1, "height": 1, "blocksMovement": true }
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`placement.blocksMovement` 和 `placement.properties` 是新画区域的默认值,编辑器复制到区域顶层 `blocksMovement` / `properties`。实例一旦生成,运行时读取实例值,不能用默认值覆盖玩家已调整的值。水是否挡人、湿地是否减速都由项目声明,不是编辑器内置规则。
|
|
26
|
+
|
|
27
|
+
## 游戏必须完整读取
|
|
28
|
+
|
|
29
|
+
1. 从当前场景的 `baseTerrain` 与全部 `kind === 'terrain'` 的 `regions` 构建地形。按图层 order、区域 zIndex、同序数组顺序依次覆盖,与编辑器绘制顺序一致;编辑器隐藏/锁定不删除游戏内容。
|
|
30
|
+
2. 使用项目明确的类型映射解析 `region.terrain`,不得把未知值静默 `continue`、默认变草地或写成“已适配”。出现不支持类型时给出场景、区域 ID 和类型诊断,修复声明及消费者。
|
|
31
|
+
3. 渲染、可交互地表状态从这份解析结果读取。若暴露 sand/soil-bare/soil-tilled/soil-wet,必须实现沙地显示及耕地三态初始化,不能只渲染邻水自动沙岸或将所有土壤初始化成裸土。
|
|
32
|
+
4. 运行时通行继续使用实例顶层 `blocksMovement`。重叠的阻挡区域不会因上面涂一层不阻挡的沙地而自动删除。地形绘制新增区域,不是布尔橡皮擦;如需要在原河流开路,调整原阻挡范围,不能仅覆盖颜色。
|
|
33
|
+
5. 文件贴图地形须沿资源声明加载实际图片。通用 `sceneFileAssets` 示例只遍历 objects,不代表它已经实现 regions 地形渲染。
|
|
34
|
+
6. `editorSchema` 可编辑的区域参数与物件参数遵循同一契约;保存、重开及游戏读取均保留实例值和未知扩展字段。地形在游戏中的状态变化按 [runtime-state.md](runtime-state.md) 维护,不把初始声明或默认属性重复覆盖到当前状态。
|
|
35
|
+
|
|
36
|
+
## 老项目的一次性修复
|
|
37
|
+
|
|
38
|
+
读取全部 manifest 声明的场景和资产表,定位历史 `terrain: "terrain"` 等记录。查实际运行时及精确 assetId 对应的声明,由 Agent 建立已确认的类型映射,更新注册表、新增地形消费和历史区域。无法可靠映射时报告缺口,不删区域或猜类型。保留实例 ID、资产 ID、位置、尺寸、图层、业务扩展及玩家明确设置的阻挡值;缺失默认值按设计补齐,历史 false 不未经确认强行改 true。
|
|
39
|
+
|
|
40
|
+
不要用 `asTerrain(region.terrain ?? region.assetId)` 作为错误类型回退:非空的 "terrain" 不会触发 `??`。仅在旧项目明确以 assetId 为地形键时,按受支持的映射迁移或兼容缺失类型;禁止拿不透明资产 ID 当成通用类型。
|
|
41
|
+
|
|
42
|
+
## 验收
|
|
43
|
+
|
|
44
|
+
- 对每个对外开放的笔刷,在隔离草稿实际绘制一个原地图没有的新区域,再保存退出、构建和重开;不只移动原有河流。
|
|
45
|
+
- 检查具体类型、assetId、默认属性保存正确;撤销/重做正常;未知类型应被发现而不是静默丢弃。
|
|
46
|
+
- 游戏逐项验证显示、通行以及该项目支持的耕作/浇水等状态,含非邻水沙地、多个分离水域、重叠地形、切换场景。
|
|
47
|
+
- 不将测试区域混入用户最终布局。使用旧存档的项目须另验存档覆盖与迁移;构建成功或静态 import 不等于运行验收。
|