@craft_eco/craft-mcp 0.0.0-stage → 0.1.18
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 +53 -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 +148 -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 +59 -0
- package/dist-server/mcp/publication-page.html +86 -0
- package/dist-server/mcp/publication-page.mjs +347 -0
- package/dist-server/mcp/publication-preview.mjs +49 -0
- package/dist-server/mcp/publication-tools.mjs +22 -0
- package/dist-server/mcp/publish-panel.mjs +191 -0
- package/dist-server/mcp/server.mjs +312 -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 +169 -0
- package/dist-server/upstream/library-url.mjs +14 -0
- package/dist-server/upstream/publication-transport.mjs +81 -0
- package/package.json +33 -4
- package/resources/craft-game-maker/SKILL.md +69 -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/external-game-archive.d.ts +19 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-archive.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-archive.js +107 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-archive.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-upload.d.ts +44 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-upload.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-upload.js +106 -0
- package/vendor/agent-cli/dist/src/artifacts/external-game-upload.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 +58 -0
- package/vendor/agent-cli/dist/src/index.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/index.js +84 -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
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @craft_eco/craft-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Craft MCP provides local 2D Phaser and 3D Three.js game creation, asset workflows, gameplay checks, previews and Craft platform upload/publication tools.
|
|
4
|
+
|
|
5
|
+
Requires Node.js 22.12 or newer with npm. Both engine contexts and project templates are included; public runtime dependencies are installed by npm.
|
|
6
|
+
|
|
7
|
+
## WorkBuddy configuration
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"craft": {
|
|
13
|
+
"type": "stdio",
|
|
14
|
+
"command": "npx",
|
|
15
|
+
"args": [
|
|
16
|
+
"--yes",
|
|
17
|
+
"--prefer-online",
|
|
18
|
+
"--registry=https://registry.npmjs.org/",
|
|
19
|
+
"@craft_eco/craft-mcp@0.1.18"
|
|
20
|
+
],
|
|
21
|
+
"env": {
|
|
22
|
+
"CRAFT_WEB_URL": "https://test.craft.qq.com"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Connect your Craft account using the local login page returned by the tools. Keep tokens out of chat, game projects and shared expert files.
|
|
30
|
+
|
|
31
|
+
The configured Craft platform is https://test.craft.qq.com. Public npm availability does not enable production services or platform publishing. Private upload and public publication require matching Web services and review configuration.
|
|
32
|
+
|
|
33
|
+
Publication materials must be reviewed and confirmed before submission. Platform review covers the submitted text and images; it does not scan or execute the entire game archive.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
3
|
+
if (major < 22 || (major === 22 && minor < 12)) {
|
|
4
|
+
process.stderr.write('Craft MCP requires Node.js >=22.12.0\n');
|
|
5
|
+
process.exit(1);
|
|
6
|
+
}
|
|
7
|
+
await import('../dist-server/mcp/start.mjs');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
|
|
4
|
+
function configuredPath(key) {
|
|
5
|
+
const value = process.env[key];
|
|
6
|
+
if (!value || !path.isAbsolute(value)) throw new Error(key + ' must be an absolute path');
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
export const getUserDataDir = () => configuredPath('CLIENT_DATA_DIR');
|
|
10
|
+
export const getWorkspaceRoot = () => configuredPath('CLIENT_WORKSPACE_ROOT');
|
|
11
|
+
export const getAppDataRoot = () => process.platform === 'darwin' ? path.join(os.homedir(),'Library','Application Support','CraftWorkBuddy') :
|
|
12
|
+
process.platform === 'win32' ? path.join(process.env.LOCALAPPDATA || path.join(os.homedir(),'AppData','Local'),'CraftWorkBuddy') :
|
|
13
|
+
path.join(os.homedir(),'.local','share','craft-workbuddy');
|
|
14
|
+
export const getProjectBindingsDir = () => process.env.CRAFT_MCP_BINDINGS_DIR
|
|
15
|
+
? configuredPath('CRAFT_MCP_BINDINGS_DIR') : path.join(getAppDataRoot(),'project-bindings');
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync, unlinkSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import lockfile from 'proper-lockfile';
|
|
5
|
+
|
|
6
|
+
export class AuthStore {
|
|
7
|
+
#snapshot;
|
|
8
|
+
#listeners = new Set();
|
|
9
|
+
constructor(file) { this.file = file; }
|
|
10
|
+
onChange(listener) { this.#listeners.add(listener); return () => this.#listeners.delete(listener); }
|
|
11
|
+
getSession() {
|
|
12
|
+
// Atomic file replacement lets every MCP process observe login/logout/account changes.
|
|
13
|
+
let raw;
|
|
14
|
+
try { raw = readFileSync(this.file,'utf8'); }
|
|
15
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
16
|
+
let session;
|
|
17
|
+
try { session = raw ? JSON.parse(raw) : undefined; } catch { /* Invalid sessions are never usable. */ }
|
|
18
|
+
this.#observe(raw);
|
|
19
|
+
if (!session?.loggedIn || (session.expiresAt != null && session.expiresAt <= Date.now())) {
|
|
20
|
+
if (session?.token) this.invalidateToken(session.token);
|
|
21
|
+
return this.#empty();
|
|
22
|
+
}
|
|
23
|
+
return session;
|
|
24
|
+
}
|
|
25
|
+
saveTokenSession({ token, identity, expiresInSec }) {
|
|
26
|
+
const session = { loggedIn:true, token, identity, updatedAt:Date.now(), expiresAt:expiresInSec ? Date.now() + expiresInSec * 1000 : null };
|
|
27
|
+
this.#write(()=>{
|
|
28
|
+
const temporary = this.file + '.' + randomUUID() + '.tmp', raw = JSON.stringify(session,null,2);
|
|
29
|
+
try {
|
|
30
|
+
writeFileSync(temporary,raw,{ flag:'wx',mode:0o600 });
|
|
31
|
+
renameSync(temporary,this.file);
|
|
32
|
+
} catch (error) { if (existsSync(temporary)) unlinkSync(temporary); throw error; }
|
|
33
|
+
this.#observe(raw);
|
|
34
|
+
});
|
|
35
|
+
return session;
|
|
36
|
+
}
|
|
37
|
+
clearSession() {
|
|
38
|
+
this.#write(()=>this.#clear());
|
|
39
|
+
}
|
|
40
|
+
// A rejected in-flight token cannot clear a newer browser login.
|
|
41
|
+
invalidateToken(token) {
|
|
42
|
+
if (!token) return;
|
|
43
|
+
try {
|
|
44
|
+
this.#write(()=>{
|
|
45
|
+
let current;
|
|
46
|
+
try { current = JSON.parse(readFileSync(this.file,'utf8')); }
|
|
47
|
+
catch (error) { if (error.code !== 'ENOENT' && !(error instanceof SyntaxError)) throw error; }
|
|
48
|
+
if (current?.token === token) this.#clear();
|
|
49
|
+
});
|
|
50
|
+
} catch (error) { if (error.code !== 'ELOCKED') throw error; }
|
|
51
|
+
}
|
|
52
|
+
#write(operation) {
|
|
53
|
+
mkdirSync(path.dirname(this.file),{recursive:true,mode:0o700});
|
|
54
|
+
const release = lockfile.lockSync(this.file,{realpath:false,stale:30000,update:10000,retries:0});
|
|
55
|
+
try { return operation(); } finally { release(); }
|
|
56
|
+
}
|
|
57
|
+
#clear() {
|
|
58
|
+
const existed = existsSync(this.file);
|
|
59
|
+
if (existed) unlinkSync(this.file);
|
|
60
|
+
if (existed && this.#snapshot === undefined) this.#snapshot = '';
|
|
61
|
+
this.#observe(undefined);
|
|
62
|
+
}
|
|
63
|
+
#observe(raw) {
|
|
64
|
+
if (this.#snapshot === raw) return;
|
|
65
|
+
this.#snapshot = raw;
|
|
66
|
+
this.#notify();
|
|
67
|
+
}
|
|
68
|
+
#notify() { for (const listener of this.#listeners) listener(); }
|
|
69
|
+
#empty() { return { loggedIn:false,token:undefined,identity:null,updatedAt:0,expiresAt:null }; }
|
|
70
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Connector credentials belong to WorkBuddy; never persist them in the browser profile.
|
|
2
|
+
export function takeConnectorToken(env = process.env) {
|
|
3
|
+
const present = Object.hasOwn(env,'CRAFT_TOKEN'), token = env.CRAFT_TOKEN;
|
|
4
|
+
delete env.CRAFT_TOKEN;
|
|
5
|
+
if (!present) return undefined;
|
|
6
|
+
if (typeof token !== 'string' || token.length < 8 || token.length > 4096 || /\s/.test(token) || token.includes('${')) {
|
|
7
|
+
throw new Error('CRAFT_TOKEN 无效,请在 WorkBuddy 连接器中更新凭证并重新连接');
|
|
8
|
+
}
|
|
9
|
+
return token;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class ConnectorAuthStore {
|
|
13
|
+
#session = { loggedIn:false };
|
|
14
|
+
#listeners = new Set();
|
|
15
|
+
onChange(listener) { this.#listeners.add(listener); return () => this.#listeners.delete(listener); }
|
|
16
|
+
getSession() { return this.#session; }
|
|
17
|
+
saveTokenSession({ token, identity }) {
|
|
18
|
+
this.#session = { loggedIn:true, token, identity, updatedAt:Date.now(), expiresAt:null };
|
|
19
|
+
this.#notify();
|
|
20
|
+
return this.#session;
|
|
21
|
+
}
|
|
22
|
+
clearSession() { this.#session = { loggedIn:false }; this.#notify(); }
|
|
23
|
+
invalidateToken(token) { if (this.#session.token === token) this.clearSession(); }
|
|
24
|
+
#notify() { for (const listener of this.#listeners) listener(); }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function connectorLoginAction() {
|
|
28
|
+
return { status:'action_required', reason:'login', human_action_required:true, auth_mode:'token',
|
|
29
|
+
user_message:'请在 WorkBuddy 的 Craft 连接器中更新 CLI Token 并重新连接。凭证只在连接器表单填写,不要发送到聊天。' };
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function sendJson(res, status, data) {
|
|
2
|
+
res.writeHead(status,{ 'Content-Type':'application/json; charset=utf-8' });
|
|
3
|
+
res.end(JSON.stringify(data));
|
|
4
|
+
}
|
|
5
|
+
export async function parseJsonBody(req, maxBytes) {
|
|
6
|
+
req.setEncoding('utf8');
|
|
7
|
+
let body = '', bytes = 0;
|
|
8
|
+
for await (const chunk of req) {
|
|
9
|
+
bytes += Buffer.byteLength(chunk);
|
|
10
|
+
if (bytes > maxBytes) throw new Error('JSON request body exceeds limit');
|
|
11
|
+
body += chunk;
|
|
12
|
+
}
|
|
13
|
+
return JSON.parse(body || '{}');
|
|
14
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export function imageExtension(bytes) {
|
|
2
|
+
if (bytes.length>24 && bytes.subarray(0,8).equals(Buffer.from('89504e470d0a1a0a','hex'))) return 'png';
|
|
3
|
+
if (bytes.length>12 && bytes[0]===255 && bytes[1]===216 && bytes[2]===255) return 'jpg';
|
|
4
|
+
if (bytes.length>16 && bytes.toString('ascii',0,4)==='RIFF' && bytes.toString('ascii',8,12)==='WEBP') return 'webp';
|
|
5
|
+
throw new Error('Expected PNG, JPEG or WebP image bytes; SVG/HTML is not accepted');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function mediaExtension(bytes,family) {
|
|
9
|
+
if (family==='audio') {
|
|
10
|
+
if (bytes.length>12 && bytes.toString('ascii',0,4)==='RIFF' && bytes.toString('ascii',8,12)==='WAVE') return 'wav';
|
|
11
|
+
if (bytes.length>8 && bytes.toString('ascii',0,4)==='OggS') return 'ogg';
|
|
12
|
+
if (bytes.length>8 && bytes.toString('ascii',0,4)==='fLaC') return 'flac';
|
|
13
|
+
if (bytes.length>8 && (bytes.toString('ascii',0,3)==='ID3' || (bytes[0]===255 && (bytes[1]&0xe0)===0xe0))) return 'mp3';
|
|
14
|
+
if (bytes.length>12 && bytes.toString('ascii',4,8)==='ftyp' && bytes.toString('ascii',8,12)==='M4A ') return 'm4a';
|
|
15
|
+
}
|
|
16
|
+
if (family==='video' && bytes.length>16) {
|
|
17
|
+
if (bytes.toString('ascii',4,8)==='ftyp') return 'mp4';
|
|
18
|
+
if (bytes.subarray(0,4).equals(Buffer.from('1a45dfa3','hex'))) return 'webm';
|
|
19
|
+
}
|
|
20
|
+
throw new Error('Unsupported '+family+' output bytes');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function localizeModel(bytes,dependency) {
|
|
24
|
+
const glb = bytes.length>=20 && bytes.toString('ascii',0,4)==='glTF';
|
|
25
|
+
let document, chunks=[];
|
|
26
|
+
if (glb) {
|
|
27
|
+
if (bytes.readUInt32LE(4)!==2 || bytes.readUInt32LE(8)!==bytes.length) throw new Error('Invalid GLB header or length');
|
|
28
|
+
for (let offset=12;offset<bytes.length;) {
|
|
29
|
+
if (offset+8>bytes.length) throw new Error('Truncated GLB chunk');
|
|
30
|
+
const length=bytes.readUInt32LE(offset),type=bytes.readUInt32LE(offset+4);
|
|
31
|
+
if (length%4 || offset+8+length>bytes.length) throw new Error('Invalid GLB chunk length');
|
|
32
|
+
const data=bytes.subarray(offset+8,offset+8+length);
|
|
33
|
+
if (!chunks.length && type!==0x4e4f534a) throw new Error('GLB must start with JSON');
|
|
34
|
+
if (type===0x4e4f534a) {
|
|
35
|
+
if (document) throw new Error('GLB has multiple JSON chunks');
|
|
36
|
+
document=JSON.parse(data.toString('utf8'));
|
|
37
|
+
}
|
|
38
|
+
chunks.push({type,data});offset+=8+length;
|
|
39
|
+
}
|
|
40
|
+
} else document=JSON.parse(bytes.toString('utf8'));
|
|
41
|
+
if (!document || document.asset?.version!=='2.0') throw new Error('Expected a glTF 2.0 GLB/glTF model, not FBX or a UE reference');
|
|
42
|
+
let dependencies=0;
|
|
43
|
+
for (const kind of ['buffers','images']) {
|
|
44
|
+
if (document[kind] !== undefined && !Array.isArray(document[kind])) throw new Error('Invalid glTF '+kind);
|
|
45
|
+
for (const item of document[kind] ?? []) {
|
|
46
|
+
if (!item || typeof item!=='object') throw new Error('Invalid glTF dependency');
|
|
47
|
+
if (item.uri === undefined) continue;
|
|
48
|
+
if (typeof item.uri!=='string') throw new Error('Invalid glTF URI');
|
|
49
|
+
if (item.uri.startsWith('data:')) {
|
|
50
|
+
if (!/^data:(?:image\/(?:png|jpeg|webp)|application\/(?:octet-stream|gltf-buffer));base64,[A-Za-z0-9+/=\r\n]+$/.test(item.uri)) throw new Error('Unsupported glTF data URI');
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (++dependencies>64) throw new Error('Model has too many external dependencies');
|
|
54
|
+
item.uri=await dependency(item.uri,kind==='images'?'image':'buffer');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!glb) return {extension:'gltf',bytes:Buffer.from(JSON.stringify(document))};
|
|
58
|
+
const json=Buffer.from(JSON.stringify(document)), padded=Buffer.alloc(Math.ceil(json.length/4)*4,0x20);json.copy(padded);
|
|
59
|
+
chunks[0].data=padded;
|
|
60
|
+
const encoded=chunks.map(({type,data})=>{const header=Buffer.alloc(8);header.writeUInt32LE(data.length);header.writeUInt32LE(type,4);return Buffer.concat([header,data]);});
|
|
61
|
+
const header=Buffer.alloc(12);header.write('glTF');header.writeUInt32LE(2,4);header.writeUInt32LE(12+encoded.reduce((n,b)=>n+b.length,0),8);
|
|
62
|
+
return {extension:'glb',bytes:Buffer.concat([header,...encoded])};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function prepareAssetBytes(bytes,family,dependency) {
|
|
66
|
+
if (family==='image') return {bytes,extension:imageExtension(bytes)};
|
|
67
|
+
if (family==='model') return localizeModel(bytes,dependency);
|
|
68
|
+
if (family==='sheet') {
|
|
69
|
+
const manifest=JSON.parse(bytes.toString('utf8'));
|
|
70
|
+
if (manifest?.type!=='PaperFlipbook' || typeof manifest.url!=='string' ||
|
|
71
|
+
['rows','cols','frameCount'].some(key=>!Number.isSafeInteger(manifest[key]) || manifest[key]<1 || manifest[key]>4096) || manifest.frameCount>manifest.rows*manifest.cols) throw new Error('Invalid PaperFlipbook manifest');
|
|
72
|
+
const image=await dependency(manifest.url,'image');
|
|
73
|
+
return {extension:'json',bytes:Buffer.from(JSON.stringify({type:manifest.type,url:image,rows:manifest.rows,cols:manifest.cols,frameCount:manifest.frameCount,...(typeof manifest.loop==='boolean'?{loop:manifest.loop}:{})}))};
|
|
74
|
+
}
|
|
75
|
+
return {bytes,extension:mediaExtension(bytes,family)};
|
|
76
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { lstat, mkdir, realpath, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { boundedBody } from '../upstream/craft-aigc.mjs';
|
|
5
|
+
import { atomicJson } from './request-store.mjs';
|
|
6
|
+
import { outputType } from './resource-catalog.mjs';
|
|
7
|
+
import { imageExtension, prepareAssetBytes } from './asset-formats.mjs';
|
|
8
|
+
|
|
9
|
+
export async function safeProjectFile(project, relative, createParents = false) {
|
|
10
|
+
const root = await realpath(project);
|
|
11
|
+
if (root !== project) throw new Error('Project path changed');
|
|
12
|
+
const pieces = relative.split('/');
|
|
13
|
+
if (pieces.some(p => !p || p === '.' || p === '..' || p.includes('\\'))) throw new Error('Invalid project-relative path');
|
|
14
|
+
let current = root;
|
|
15
|
+
for (let i=0; i<pieces.length; i++) {
|
|
16
|
+
current = path.join(current, pieces[i]);
|
|
17
|
+
let stat;
|
|
18
|
+
try { stat = await lstat(current); }
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error.code !== 'ENOENT') throw error;
|
|
21
|
+
if (i < pieces.length-1 && createParents) { await mkdir(current); stat = await lstat(current); }
|
|
22
|
+
else if (i === pieces.length-1) return current;
|
|
23
|
+
else throw error;
|
|
24
|
+
}
|
|
25
|
+
if (stat.isSymbolicLink() || (i < pieces.length-1 ? !stat.isDirectory() : !stat.isFile())) throw new Error('Project path contains a link or invalid file type');
|
|
26
|
+
}
|
|
27
|
+
return current;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export async function assetConfig(project, name = 'assets.json', create = false) {
|
|
31
|
+
if (!['assets.json','models.json','animations.json','audio.json','videos.json','spritesheets.json'].includes(name)) throw new Error('Invalid asset config');
|
|
32
|
+
const file = await safeProjectFile(project, 'configs/'+name);
|
|
33
|
+
if (create) {
|
|
34
|
+
try { await writeFile(file,'{}\n',{flag:'wx'}); }
|
|
35
|
+
catch (error) { if (error.code!=='EEXIST') throw error; }
|
|
36
|
+
}
|
|
37
|
+
const data = JSON.parse(await readFile(file, 'utf8'));
|
|
38
|
+
if (!data || Array.isArray(data) || typeof data !== 'object' || Object.values(data).some(v => typeof v !== 'string')) throw new Error('configs/'+name+' must map slots to strings');
|
|
39
|
+
return { file, data };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function writeContent(project, relative, bytes) {
|
|
43
|
+
const file = await safeProjectFile(project,'public/'+relative,true);
|
|
44
|
+
try { await writeFile(file,bytes,{flag:'wx'}); }
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error.code!=='EEXIST') throw error;
|
|
47
|
+
if (createHash('sha256').update(await readFile(file)).digest('hex')!==createHash('sha256').update(bytes).digest('hex')) throw new Error('Existing asset file differs');
|
|
48
|
+
}
|
|
49
|
+
return file;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function importAsset(platform, record, signal) {
|
|
53
|
+
const library=record.source==='library',output=library?record.library:record.remote;
|
|
54
|
+
if(!library && (record.status!=='completed' || output?.status!=='completed'))throw new Error('Task has no completed output');
|
|
55
|
+
if(library && (!output?.asset_id || !output.url))throw new Error('Library asset has no selected candidate');
|
|
56
|
+
const assetType=output.asset_type, type=outputType(assetType);
|
|
57
|
+
if (record.expected_asset_type && record.expected_asset_type!==assetType) throw new Error('Generated asset type differs from the requested type');
|
|
58
|
+
if (record.config_file && record.config_file!==type.config) throw new Error('Asset config differs from the prepared target');
|
|
59
|
+
const value=library?output.url:output.result_url || output.cook_value;
|
|
60
|
+
if (!value || /^[A-Za-z]+'/.test(value)) throw new Error('No browser-compatible result URL; a UE reference or FBX cannot be used as a web asset');
|
|
61
|
+
const resolveUrl=value=>library?platform.libraryUrl(value):platform.assetUrl(value);
|
|
62
|
+
const url=await resolveUrl(value), dependencies=[];
|
|
63
|
+
const identity=library?'library-'+createHash('sha256').update(output.asset_id).digest('hex').slice(0,16):record.resource_id;
|
|
64
|
+
let totalBytes=0;
|
|
65
|
+
async function download(value,limit) {
|
|
66
|
+
const remote=await resolveUrl(value);
|
|
67
|
+
const response=await fetch(remote,{redirect:'manual',signal:AbortSignal.any([...(signal?[signal]:[]),AbortSignal.timeout(60_000)])});
|
|
68
|
+
if (!response.ok || response.status>=300) {await response.body?.cancel();throw new Error('Asset download failed: HTTP '+response.status);}
|
|
69
|
+
let data;
|
|
70
|
+
try { data=await boundedBody(response,Math.min(limit,64*1024*1024-totalBytes)); }
|
|
71
|
+
catch (error) {
|
|
72
|
+
if(error.code==='CRAFT_RESPONSE_TOO_LARGE') throw new Error('Asset exceeds size limit: each file must be at most 8 MiB (sprite-sheet manifest 1 MiB), and an asset with dependencies at most 64 MiB. Use a smaller or compressed resource.');
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
totalBytes+=data.length;
|
|
76
|
+
if (platform.account().user_id!==record.owner) throw new Error('Account changed during download');
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
79
|
+
const original=library && output.sprite ? Buffer.from(JSON.stringify({type:'PaperFlipbook',url,...output.sprite})) : await download(url,type.maxBytes);
|
|
80
|
+
const sourceHash=createHash('sha256').update(original).digest('hex');
|
|
81
|
+
const prefix=`assets/generated/${record.slot}-${identity}-${sourceHash.slice(0,12)}-deps`;
|
|
82
|
+
const prepared=await prepareAssetBytes(original,type.family,async(uri,family)=>{
|
|
83
|
+
const remote=new URL(uri,url).href, data=await download(remote,8*1024*1024);
|
|
84
|
+
const extension=family==='image'?imageExtension(data):'bin', sha256=createHash('sha256').update(data).digest('hex');
|
|
85
|
+
const relative=prefix+'/'+dependencies.length+'-'+sha256.slice(0,12)+'.'+extension;
|
|
86
|
+
signal?.throwIfAborted();
|
|
87
|
+
dependencies.push({asset_url:'/'+relative,project_file:await writeContent(record.project,relative,data),sha256,bytes:data.length});
|
|
88
|
+
return path.posix.relative('assets/generated',relative);
|
|
89
|
+
});
|
|
90
|
+
const {bytes,extension}=prepared;
|
|
91
|
+
if (bytes.length>type.maxBytes) throw new Error('Rewritten asset exceeds size limit');
|
|
92
|
+
const sha256 = createHash('sha256').update(bytes).digest('hex');
|
|
93
|
+
if (platform.account().user_id !== record.owner) throw new Error('Account changed during download');
|
|
94
|
+
const relative = `assets/generated/${record.slot}-${identity}-${sha256.slice(0,12)}.${extension}`;
|
|
95
|
+
signal?.throwIfAborted();
|
|
96
|
+
const config = await assetConfig(record.project,type.config,true);
|
|
97
|
+
const current = Object.hasOwn(config.data, record.slot) ? config.data[record.slot] : null;
|
|
98
|
+
if (current !== record.previous_asset && current !== '/' + relative) throw new Error('Asset slot changed since preparation; refusing to overwrite');
|
|
99
|
+
const controlsFile=await safeProjectFile(record.project,'configs/'+type.config.replace('.json','.controls.json'));
|
|
100
|
+
let controls={};
|
|
101
|
+
try {controls=JSON.parse(await readFile(controlsFile,'utf8'));}
|
|
102
|
+
catch (error) {if(error.code!=='ENOENT')throw error;}
|
|
103
|
+
if (!controls || Array.isArray(controls) || typeof controls!=='object') throw new Error('Invalid resource controls');
|
|
104
|
+
const control=Object.hasOwn(controls,record.slot)?controls[record.slot]:{};
|
|
105
|
+
if (!control || typeof control!=='object' || Array.isArray(control) || (control.type && control.type!=='resource') || (control.asset_type && control.asset_type!==assetType)) throw new Error('Asset controls changed; refusing to overwrite');
|
|
106
|
+
const file=await writeContent(record.project,relative,bytes);
|
|
107
|
+
Object.defineProperty(controls,record.slot,{value:{...control,type:'resource',asset_type:assetType},enumerable:true,writable:true,configurable:true});
|
|
108
|
+
await atomicJson(controlsFile,controls);
|
|
109
|
+
Object.defineProperty(config.data, record.slot, { value: '/' + relative, enumerable: true, writable: true, configurable: true });
|
|
110
|
+
await atomicJson(config.file, config.data);
|
|
111
|
+
return {slot:record.slot,asset_type:assetType,config_file:'configs/'+type.config,asset_url:'/'+relative,project_file:file,sha256,bytes:bytes.length,dependencies,...(library?{source:'library',library_asset_id:output.asset_id}:{}),
|
|
112
|
+
next:'Load this slot from configs/'+type.config+' using the selected engine guide; wire the local resource into the game, then check and preview.'};
|
|
113
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const identifier=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;
|
|
2
|
+
export function validateAssetInputs(inputs) {
|
|
3
|
+
if(!Array.isArray(inputs) || inputs.length<1 || inputs.length>8)throw new Error('Specify 1 to 8 assets');
|
|
4
|
+
const slots=new Set();
|
|
5
|
+
for(const input of inputs) {
|
|
6
|
+
const {slot,request_key}=input ?? {};
|
|
7
|
+
if(typeof slot!=='string' || typeof request_key!=='string' || !identifier.test(slot) || !identifier.test(request_key) || ['__proto__','constructor','prototype'].includes(slot) || slots.has(slot))throw new Error('Invalid or duplicate asset slot/request key');
|
|
8
|
+
slots.add(slot);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { digest } from './request-store.mjs';
|
|
2
|
+
import { assetConfig, importAsset } from './asset-import.mjs';
|
|
3
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
4
|
+
import { makeGeneration, outputType, storedGeneration } from './resource-catalog.mjs';
|
|
5
|
+
import { validateAssetInputs as validateInputs } from './asset-inputs.mjs';
|
|
6
|
+
|
|
7
|
+
const terminal = new Set(['failed','cancelled','not_found']);
|
|
8
|
+
const remoteStates = ['input_auditing','pending','pending_confirm','processing','auditing','awaiting_preview','completed','failed'];
|
|
9
|
+
|
|
10
|
+
const remoteSummary = remote => ({status:remote.status,asset_type:remote.asset_type,result_url:remote.result_url,cook_value:remote.cook_value,
|
|
11
|
+
aigc_pipeline:remote.aigc_pipeline,error_message:remote.error_message});
|
|
12
|
+
|
|
13
|
+
export class Assets {
|
|
14
|
+
constructor(platform, store, projects) { this.platform = platform; this.store = store; this.projects = projects; }
|
|
15
|
+
async plan(name, inputs, signal) {
|
|
16
|
+
validateInputs(inputs);
|
|
17
|
+
const prepared=inputs.map(input=>({input,...makeGeneration(input)}));
|
|
18
|
+
const project = await this.projects.owned(name), owner = this.platform.account().user_id;
|
|
19
|
+
signal?.throwIfAborted();
|
|
20
|
+
const records=[];
|
|
21
|
+
for (const {input,type,spec} of prepared) {
|
|
22
|
+
const {slot,request_key}=input, config=outputType(type.assetType);
|
|
23
|
+
const current=await assetConfig(project,config.config,true);
|
|
24
|
+
let record = (await this.store.list()).find(r=>r.owner === owner && r.platform === this.platform.base && r.project === project && r.request_key === request_key);
|
|
25
|
+
if (record) {
|
|
26
|
+
if (digest(record.spec) !== digest(spec) || record.slot !== slot) throw new Error('request_key is already bound to other asset parameters');
|
|
27
|
+
} else {
|
|
28
|
+
record = await this.store.create({ name, project, owner, platform:this.platform.base, slot, spec, request_key,
|
|
29
|
+
expected_asset_type:type.assetType,config_file:config.config,previous_asset:current.data[slot] ?? null,status:'prepared' });
|
|
30
|
+
}
|
|
31
|
+
records.push(record);
|
|
32
|
+
}
|
|
33
|
+
return { records };
|
|
34
|
+
}
|
|
35
|
+
async planImport(name,inputs,signal) {
|
|
36
|
+
validateInputs(inputs);
|
|
37
|
+
for (const input of inputs) {
|
|
38
|
+
if (!Number.isSafeInteger(input.resource_id) || input.resource_id<1 || Object.keys(input).some(key=>!['slot','request_key','resource_id'].includes(key))) throw new Error('Import requires slot, request_key and a positive resource_id');
|
|
39
|
+
}
|
|
40
|
+
const project=await this.projects.owned(name),owner=this.platform.account().user_id;
|
|
41
|
+
const queried=await this.platform.request('query',{ids:inputs.map(input=>input.resource_id),status:[],trigger_source:[]},owner,signal);
|
|
42
|
+
if (!Array.isArray(queried?.data)) throw new Error('Invalid task query response');
|
|
43
|
+
const records=[];
|
|
44
|
+
for (const {slot,request_key,resource_id} of inputs) {
|
|
45
|
+
const remote=queried.data.find(row=>Number(row.id)===resource_id);
|
|
46
|
+
if (!remote || Number(remote.user_id)!==owner) throw new Error('Imported resource is missing or belongs to another account');
|
|
47
|
+
const type=outputType(remote.asset_type),current=await assetConfig(project,type.config,true),spec={kind:'import',resource_id};
|
|
48
|
+
let record=(await this.store.list()).find(r=>r.owner===owner && r.platform===this.platform.base && r.project===project && r.request_key===request_key);
|
|
49
|
+
if (record && (digest(record.spec)!==digest(spec) || record.slot!==slot)) throw new Error('request_key is already bound to another asset');
|
|
50
|
+
if (record) {record.status=remote.status;record.remote=remoteSummary(remote);await this.store.save(record);}
|
|
51
|
+
record ??= await this.store.create({name,project,owner,platform:this.platform.base,slot,request_key,spec,mode:'import',resource_id,
|
|
52
|
+
expected_asset_type:remote.asset_type,config_file:type.config,previous_asset:current.data[slot] ?? null,status:remote.status,remote:remoteSummary(remote)});
|
|
53
|
+
records.push(record);
|
|
54
|
+
}
|
|
55
|
+
return {records};
|
|
56
|
+
}
|
|
57
|
+
async recover(record, signal) {
|
|
58
|
+
const data = await this.platform.request('query',{ids:[],status:remoteStates,trigger_source:[]},record.owner,signal);
|
|
59
|
+
if (!data || !Array.isArray(data.data)) throw new Error('Invalid task query response');
|
|
60
|
+
const related = data.data.filter(remote=>remote.resource_name === 'craft-mcp-' + record.request_id && Number(remote.user_id) === record.owner);
|
|
61
|
+
const {type}=storedGeneration(record.spec);
|
|
62
|
+
const matches = type.stages===2 ? related.filter(remote=>remote.aigc_pipeline===type.pipeline || (!remote.aigc_pipeline && remote.asset_type===type.assetType)) : related;
|
|
63
|
+
if (matches.length !== 1 || !Number.isSafeInteger(Number(matches[0].id)) || Number(matches[0].id) < 1) {
|
|
64
|
+
throw new Error('Original asset submission is not yet confirmed. Retry this same request later; no new generation was submitted.');
|
|
65
|
+
}
|
|
66
|
+
record.resource_id = Number(matches[0].id);record.status = matches[0].status;
|
|
67
|
+
record.resource_ids=related.map(row=>Number(row.id)).filter(id=>Number.isSafeInteger(id) && id>0);
|
|
68
|
+
await this.store.save(record);
|
|
69
|
+
}
|
|
70
|
+
async generate(records, signal) {
|
|
71
|
+
const results = [];
|
|
72
|
+
// Deliberately bounded to one submission at a time; backend admission still owns the global limit.
|
|
73
|
+
for (const record of records) {
|
|
74
|
+
signal.throwIfAborted();
|
|
75
|
+
if(record.source==='library')throw new Error('Library assets must use the library import path; generation is not permitted');
|
|
76
|
+
if (terminal.has(record.status)) throw new Error(`Asset ${record.slot} is ${record.status}; inspect the result before explicitly requesting a new asset`);
|
|
77
|
+
// The existing API has no request-level idempotency key. Reconcile an uncertain send; never blindly repeat its paid POST.
|
|
78
|
+
if (!record.resource_id && ['submitting','submission_unknown'].includes(record.status)) await this.recover(record,signal);
|
|
79
|
+
if (!record.resource_id) {
|
|
80
|
+
const {type,body}=storedGeneration(record.spec);
|
|
81
|
+
record.status = 'submitting'; await this.store.save(record);
|
|
82
|
+
try {
|
|
83
|
+
const result = await this.platform.request(type.endpoint,{...body,resource_name:'craft-mcp-'+record.request_id},record.owner,signal);
|
|
84
|
+
const ids=type.stages===2?[Number(result?.stage1_resource_id),Number(result?.stage2_resource_id)]:[Number(result?.id)];
|
|
85
|
+
if (ids.some(id=>!Number.isSafeInteger(id) || id<1) || new Set(ids).size!==ids.length) throw new Error('Invalid generation receipt');
|
|
86
|
+
record.resource_ids=ids;record.resource_id=ids.at(-1);record.status=result.status ?? 'pending';
|
|
87
|
+
await this.store.save(record);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
record.status = error.detail?.delivery_unknown === false ? 'rejected' : 'submission_unknown';
|
|
90
|
+
record.error = { message:error.message, ...error.detail }; await this.store.save(record);
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const deadline = Date.now() + (record.expected_asset_type && record.expected_asset_type!=='Texture2D'?30:10) * 60 * 1000;
|
|
95
|
+
while (true) {
|
|
96
|
+
signal.throwIfAborted();
|
|
97
|
+
await this.refresh(record,signal);
|
|
98
|
+
if (record.status === 'completed') break;
|
|
99
|
+
if (record.status==='awaiting_preview') return {assets:results,status:'action_required',reason:'asset_preview',resource_id:record.resource_id,
|
|
100
|
+
user_message:'资源 '+record.resource_id+' 等待平台预览确认,请在 Craft 资源中心完成确认后继续;复用原 request_key,不重新生成。'};
|
|
101
|
+
if (terminal.has(record.status) || record.status === 'unknown_remote_state') throw new Error(`Asset ${record.slot}: ${record.status}${record.remote?.error_message?' — '+record.remote.error_message:''}`);
|
|
102
|
+
if (Date.now() >= deadline) throw new Error('Asset generation is still running. Resume with the same request_key; no new generation was submitted.');
|
|
103
|
+
await delay(3000,undefined,{ signal });
|
|
104
|
+
}
|
|
105
|
+
signal.throwIfAborted();
|
|
106
|
+
// Import verifies the slot's before-image, content hash and project containment.
|
|
107
|
+
try {
|
|
108
|
+
record.asset=await importAsset(this.platform,record,signal);record.import_status='completed';delete record.import_error;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
record.import_status='failed';record.import_error={message:error.message};await this.store.save(record);throw error;
|
|
111
|
+
}
|
|
112
|
+
await this.store.save(record);
|
|
113
|
+
results.push({ slot:record.slot, request_key:record.request_key, resource_id:record.resource_id, ...record.asset,
|
|
114
|
+
transparent_requested:record.spec.with_matting ?? record.spec.body?.with_matting });
|
|
115
|
+
}
|
|
116
|
+
return { assets:results, next:'Wire these exact slots into the game using its selected engine guide; then craft_game_check with loop, settlement and restart steps.' };
|
|
117
|
+
}
|
|
118
|
+
async refresh(record, signal) {
|
|
119
|
+
if (record.owner !== this.platform.account().user_id || record.platform !== this.platform.base || await this.projects.owned(record.name) !== record.project) throw new Error('Asset request ownership changed');
|
|
120
|
+
const data = await this.platform.request('query',{ ids:[record.resource_id], status:[], trigger_source:[] },record.owner,signal);
|
|
121
|
+
if (!data || !Array.isArray(data.data)) throw new Error('Invalid task query response');
|
|
122
|
+
const remote = data.data.find(r=>Number(r.id) === record.resource_id);
|
|
123
|
+
if (!remote) record.status = 'not_found';
|
|
124
|
+
else {
|
|
125
|
+
if (Number(remote.user_id) !== record.owner) throw new Error('Remote task owner mismatch');
|
|
126
|
+
record.remote = remoteSummary(remote);
|
|
127
|
+
record.status = remoteStates.includes(remote.status) ? remote.status : 'unknown_remote_state';
|
|
128
|
+
}
|
|
129
|
+
await this.store.save(record);
|
|
130
|
+
return record;
|
|
131
|
+
}
|
|
132
|
+
async list(name) {
|
|
133
|
+
const project = await this.projects.owned(name), owner = this.platform.account().user_id;
|
|
134
|
+
return (await this.store.list()).filter(r=>r.project === project && r.owner === owner && r.platform === this.platform.base)
|
|
135
|
+
.map(r=>({slot:r.slot,request_key:r.request_key,status:r.status,resource_id:r.resource_id,resource_ids:r.resource_ids,
|
|
136
|
+
source:r.source ?? 'aigc',library_asset_id:r.library?.asset_id,
|
|
137
|
+
asset_type:r.library?.asset_type ?? r.remote?.asset_type ?? r.expected_asset_type,import_status:r.import_status,asset:r.asset,error:r.import_error ?? r.error}));
|
|
138
|
+
}
|
|
139
|
+
async cancelRemote(name, requestKeys) {
|
|
140
|
+
const project = await this.projects.owned(name), owner = this.platform.account().user_id, results = [];
|
|
141
|
+
for (const record of await this.store.list()) {
|
|
142
|
+
if (record.project !== project || record.owner !== owner || record.platform !== this.platform.base || !requestKeys.includes(record.request_key)) continue;
|
|
143
|
+
if (!record.resource_id) {
|
|
144
|
+
if (['prepared','rejected'].includes(record.status)) { record.status = 'cancelled'; await this.store.save(record); }
|
|
145
|
+
results.push({ request_key:record.request_key, status:record.status, remote_cancelled:false }); continue;
|
|
146
|
+
}
|
|
147
|
+
await this.refresh(record);
|
|
148
|
+
if (['input_auditing','pending','pending_confirm'].includes(record.status)) {
|
|
149
|
+
const result = await this.platform.request('cancel',{ id:record.resource_id },owner);
|
|
150
|
+
if (Number(result?.id) === record.resource_id && result.status === 'failed') { record.status = 'cancelled'; await this.store.save(record); }
|
|
151
|
+
else throw new Error('Unconfirmed remote cancellation');
|
|
152
|
+
}
|
|
153
|
+
results.push({ resource_id:record.resource_id, status:record.status });
|
|
154
|
+
if (record.resource_ids?.length>1) {
|
|
155
|
+
const related=await this.platform.request('query',{ids:record.resource_ids,status:[],trigger_source:[]},owner);
|
|
156
|
+
results.at(-1).related=related.data.filter(row=>Number(row.user_id)===owner).map(row=>({resource_id:row.id,status:row.status}));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return results;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { engineDefinition } from './engines.mjs';
|
|
5
|
+
|
|
6
|
+
// The shared runner only captures the browser. WorkBuddy performs visual judgment on returned images.
|
|
7
|
+
const [runnerFile, requestFile] = process.argv.slice(2);
|
|
8
|
+
const { captureGame } = await import(pathToFileURL(runnerFile).href);
|
|
9
|
+
const request = JSON.parse(await readFile(requestFile,'utf8'));
|
|
10
|
+
engineDefinition(request.engine);
|
|
11
|
+
const result = { build:'passed', engine:request.engine, shots:[], errors:[], unverified:[] };
|
|
12
|
+
const runDirectory = path.dirname(requestFile);
|
|
13
|
+
await captureGame(request.project, runDirectory, { ...request, capture_gameplay_probe:true }, result, path.join(runDirectory,'dist'));
|
|
14
|
+
await writeFile(path.join(path.dirname(requestFile),'capture.json'),JSON.stringify(result));
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { lstat, mkdir, readFile, realpath } from 'node:fs/promises';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { prepareLocalExecution, buildJsStatic, prepareStaticArtifacts, prepareBrowserEnvironment, runProcess } from '#craft-sdk';
|
|
6
|
+
import { fingerprint } from './projects.mjs';
|
|
7
|
+
import { atomicJson } from './request-store.mjs';
|
|
8
|
+
import { engineDefinition } from './engines.mjs';
|
|
9
|
+
import { freezeCheckedBuild } from './draft-archive.mjs';
|
|
10
|
+
|
|
11
|
+
export function validateSteps(steps) {
|
|
12
|
+
if (!Array.isArray(steps) || steps.length !== 3) throw new Error('Provide three test steps: loop, settlement, restart');
|
|
13
|
+
for (let i = 0; i < steps.length; i++) {
|
|
14
|
+
const step = steps[i];
|
|
15
|
+
if (step.phase !== ['loop','settlement','restart'][i] || !['click','press','drag','wait'].includes(step.action) ||
|
|
16
|
+
typeof step.expected !== 'string' || !step.expected.trim() || (step.ms !== undefined && (!Number.isInteger(step.ms) || step.ms < 1 || step.ms > 30000))) throw new Error('Invalid game test step');
|
|
17
|
+
if (!Array.isArray(step.assertions) || !step.assertions.length || step.assertions.length > 8) throw new Error('Each step needs game-state assertions');
|
|
18
|
+
for (const assertion of step.assertions) {
|
|
19
|
+
if (typeof assertion.path !== 'string' || !/^game\.[a-zA-Z0-9_.]{1,96}$/.test(assertion.path) || !['eq','gte'].includes(assertion.operator) ||
|
|
20
|
+
!['string','number','boolean'].includes(typeof assertion.value)) throw new Error('Assert real __GAME_PROBE__.snapshot().game fields');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function evaluateCapture(capture, steps, engine = 'js') {
|
|
26
|
+
engineDefinition(engine);
|
|
27
|
+
const issues = [...(capture.errors ?? []), ...(capture.unverified ?? [])];
|
|
28
|
+
if (capture.shots?.length !== 4) issues.push('Four screenshots required: initial, loop, settlement, restart');
|
|
29
|
+
let frames = -1;
|
|
30
|
+
for (let i = 0; i < (capture.shots ?? []).length; i++) {
|
|
31
|
+
const snapshot = capture.shots[i].gameplay_probe;
|
|
32
|
+
if (snapshot?.ready !== true || snapshot?.engine !== engine || !Number.isFinite(snapshot?.frameCount) || snapshot.frameCount <= frames) issues.push('Game probe does not match ' + engine + ', is not ready, or frames did not advance at shot ' + i);
|
|
33
|
+
frames = snapshot?.frameCount ?? frames;
|
|
34
|
+
for (const assertion of i ? steps[i - 1]?.assertions ?? [] : []) {
|
|
35
|
+
const actual = assertion.path.split('.').reduce((object,key)=>object?.[key],snapshot);
|
|
36
|
+
const passed = assertion.operator === 'eq' ? actual === assertion.value : typeof actual === 'number' && typeof assertion.value === 'number' && actual >= assertion.value;
|
|
37
|
+
if (!passed) issues.push(`${steps[i - 1].phase}: ${assertion.path} ${assertion.operator} ${JSON.stringify(assertion.value)}, actual ${JSON.stringify(actual)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { passed:issues.length === 0, issues };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function checkGame(project, resources, brief, steps, signal) {
|
|
44
|
+
if (typeof brief !== 'string' || brief.trim().length < 3 || brief.length > 8000) throw new Error('Game brief must contain 3 to 8000 characters');
|
|
45
|
+
validateSteps(steps);
|
|
46
|
+
const engine = resources.engine;
|
|
47
|
+
engineDefinition(engine);
|
|
48
|
+
const execution = await prepareLocalExecution({ workspaceDir:project, contextDir:resources.context,
|
|
49
|
+
engine, lifecycle:{ onLog:line=>process.stderr.write('[craft] ' + line + '\n') } },signal);
|
|
50
|
+
try { await execution.finish(true); } finally { await execution.close(); }
|
|
51
|
+
const source = await fingerprint(project);
|
|
52
|
+
await buildJsStatic(project,120000,{},signal);
|
|
53
|
+
if (source !== await fingerprint(project)) throw new Error('Sources changed during build; finish editing and check again');
|
|
54
|
+
const artifacts = await prepareStaticArtifacts(path.join(project,'dist'));
|
|
55
|
+
const browserEnv = await prepareBrowserEnvironment({ cwd:project, env:process.env, signal });
|
|
56
|
+
await mkdir(resources.evidence,{ recursive:true,mode:0o700 });
|
|
57
|
+
if ((await lstat(resources.evidence)).isSymbolicLink()) throw new Error('Game check directory must not be a symbolic link');
|
|
58
|
+
const snapshotId = randomUUID(), runDir = path.join(await realpath(resources.evidence),snapshotId);
|
|
59
|
+
await mkdir(runDir,{ mode:0o700 });
|
|
60
|
+
await freezeCheckedBuild(project,runDir,artifacts,signal);
|
|
61
|
+
const requestFile = path.join(runDir,'request.json');
|
|
62
|
+
await atomicJson(requestFile,{ project, engine, brief, steps, limits:{ browser_deadline_ms:180000, screenshot_timeout_ms:15000 } });
|
|
63
|
+
const result = await runProcess(process.execPath,[fileURLToPath(new URL('./capture-worker.mjs',import.meta.url)), resources.capture, requestFile],{
|
|
64
|
+
cwd:project, signal, timeoutMs:200000,
|
|
65
|
+
env:{ PATH:process.env.PATH ?? '', HOME:process.env.HOME ?? '', ...browserEnv },
|
|
66
|
+
});
|
|
67
|
+
signal.throwIfAborted();
|
|
68
|
+
if (result.exitCode !== 0 || result.timedOut) throw new Error('Game capture failed: ' + (result.stderr || result.stdout).slice(-1500));
|
|
69
|
+
const capture = JSON.parse(await readFile(path.join(runDir,'capture.json'),'utf8'));
|
|
70
|
+
if (source !== await fingerprint(project)) throw new Error('Sources changed during browser verification; check again');
|
|
71
|
+
const gate = evaluateCapture(capture,steps,engine);
|
|
72
|
+
return { engine, source, artifacts, snapshot_id:snapshotId, gate, capture, screenshots:capture.shots.map(shot=>path.join(runDir,shot.file)),
|
|
73
|
+
visual_review:'required', next:gate.passed ? 'Inspect the screenshots with WorkBuddy vision; then craft_game_deliver with this check task id.' : 'Fix the reported errors, then check again.' };
|
|
74
|
+
}
|