ue-mcp 1.4.12 → 1.4.13
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 +4 -5
- package/dist/bridge/bridge-timeouts.js +16 -0
- package/dist/bridge/bridge-timeouts.js.map +1 -1
- package/dist/bridge/bridge.d.ts +58 -3
- package/dist/bridge/bridge.js +149 -8
- package/dist/bridge/bridge.js.map +1 -1
- package/dist/cli/cli-commands.js +7 -1
- package/dist/cli/cli-commands.js.map +1 -1
- package/dist/cli/doctor.d.ts +9 -0
- package/dist/cli/doctor.js +63 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/editor-flag.js +5 -1
- package/dist/cli/editor-flag.js.map +1 -1
- package/dist/cli/extension-cli.d.ts +3 -0
- package/dist/cli/extension-cli.js +83 -16
- package/dist/cli/extension-cli.js.map +1 -1
- package/dist/cli/flow-cli.js +3 -1
- package/dist/cli/flow-cli.js.map +1 -1
- package/dist/cli/init-core.d.ts +74 -1
- package/dist/cli/init-core.js +231 -38
- package/dist/cli/init-core.js.map +1 -1
- package/dist/cli/init.js +86 -22
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/login-cli.d.ts +27 -1
- package/dist/cli/login-cli.js +130 -17
- package/dist/cli/login-cli.js.map +1 -1
- package/dist/cli/plugin-cli.js +1 -1
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/tools-cli.d.ts +14 -0
- package/dist/cli/tools-cli.js +270 -0
- package/dist/cli/tools-cli.js.map +1 -0
- package/dist/cli/ui/ansi.d.ts +2 -0
- package/dist/cli/ui/ansi.js +8 -0
- package/dist/cli/ui/ansi.js.map +1 -1
- package/dist/codeintel/config-hierarchy.d.ts +73 -0
- package/dist/codeintel/config-hierarchy.js +165 -0
- package/dist/codeintel/config-hierarchy.js.map +1 -0
- package/dist/config/project.d.ts +12 -4
- package/dist/config/project.js.map +1 -1
- package/dist/core/archive.d.ts +8 -0
- package/dist/core/archive.js +40 -0
- package/dist/core/archive.js.map +1 -0
- package/dist/core/env.d.ts +4 -0
- package/dist/core/env.js +4 -0
- package/dist/core/env.js.map +1 -1
- package/dist/core/errors.d.ts +9 -1
- package/dist/core/errors.js +8 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/png.d.ts +31 -0
- package/dist/core/png.js +308 -0
- package/dist/core/png.js.map +1 -0
- package/dist/core/types.d.ts +31 -0
- package/dist/daemon/daemon.js +16 -2
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/extension-install.d.ts +14 -0
- package/dist/daemon/extension-install.js +25 -29
- package/dist/daemon/extension-install.js.map +1 -1
- package/dist/daemon/install-names.d.ts +10 -0
- package/dist/daemon/install-names.js +39 -0
- package/dist/daemon/install-names.js.map +1 -0
- package/dist/daemon/tools-routes.d.ts +23 -0
- package/dist/daemon/tools-routes.js +46 -0
- package/dist/daemon/tools-routes.js.map +1 -0
- package/dist/diagram/action.d.ts +25 -0
- package/dist/diagram/action.js +141 -0
- package/dist/diagram/action.js.map +1 -0
- package/dist/diagram/adapters.d.ts +48 -0
- package/dist/diagram/adapters.js +569 -0
- package/dist/diagram/adapters.js.map +1 -0
- package/dist/diagram/mermaid.d.ts +22 -0
- package/dist/diagram/mermaid.js +164 -0
- package/dist/diagram/mermaid.js.map +1 -0
- package/dist/diagram/model.d.ts +59 -0
- package/dist/diagram/model.js +17 -0
- package/dist/diagram/model.js.map +1 -0
- package/dist/diagram/png.d.ts +17 -0
- package/dist/diagram/png.js +48 -0
- package/dist/diagram/png.js.map +1 -0
- package/dist/diagram/select.d.ts +26 -0
- package/dist/diagram/select.js +146 -0
- package/dist/diagram/select.js.map +1 -0
- package/dist/diagram/svg.d.ts +10 -0
- package/dist/diagram/svg.js +254 -0
- package/dist/diagram/svg.js.map +1 -0
- package/dist/diagram/theme.d.ts +33 -0
- package/dist/diagram/theme.js +37 -0
- package/dist/diagram/theme.js.map +1 -0
- package/dist/dispatch/call-pipeline.d.ts +8 -0
- package/dist/dispatch/call-pipeline.js +19 -2
- package/dist/dispatch/call-pipeline.js.map +1 -1
- package/dist/dispatch/inline-image.d.ts +70 -0
- package/dist/dispatch/inline-image.js +198 -0
- package/dist/dispatch/inline-image.js.map +1 -0
- package/dist/dispatch/lease-paths.d.ts +16 -0
- package/dist/dispatch/lease-paths.js +42 -0
- package/dist/dispatch/lease-paths.js.map +1 -0
- package/dist/dispatch/leases.d.ts +71 -0
- package/dist/dispatch/leases.js +191 -0
- package/dist/dispatch/leases.js.map +1 -0
- package/dist/dispatch/offline.js +17 -0
- package/dist/dispatch/offline.js.map +1 -1
- package/dist/dispatch/server-dispatch.d.ts +32 -1
- package/dist/dispatch/server-dispatch.js +70 -2
- package/dist/dispatch/server-dispatch.js.map +1 -1
- package/dist/editor/bridge-binaries.d.ts +2 -0
- package/dist/editor/bridge-binaries.js +12 -22
- package/dist/editor/bridge-binaries.js.map +1 -1
- package/dist/editor/dialog-guard.d.ts +10 -0
- package/dist/editor/dialog-guard.js +26 -4
- package/dist/editor/dialog-guard.js.map +1 -1
- package/dist/editor/editor-plugin.d.ts +16 -0
- package/dist/editor/editor-plugin.js +98 -0
- package/dist/editor/editor-plugin.js.map +1 -0
- package/dist/editor/engine-root.d.ts +2 -0
- package/dist/editor/engine-root.js +2 -2
- package/dist/editor/engine-root.js.map +1 -1
- package/dist/editor/install-marker.d.ts +2 -0
- package/dist/editor/install-marker.js +13 -6
- package/dist/editor/install-marker.js.map +1 -1
- package/dist/extensions/registry-auth.d.ts +60 -1
- package/dist/extensions/registry-auth.js +202 -5
- package/dist/extensions/registry-auth.js.map +1 -1
- package/dist/extensions/skill-catalog.d.ts +20 -0
- package/dist/extensions/skill-catalog.js +56 -0
- package/dist/extensions/skill-catalog.js.map +1 -0
- package/dist/flow/flow-tool.js +10 -2
- package/dist/flow/flow-tool.js.map +1 -1
- package/dist/flow/guarded-bridge.d.ts +6 -4
- package/dist/flow/guarded-bridge.js +11 -5
- package/dist/flow/guarded-bridge.js.map +1 -1
- package/dist/flow/loader.js +19 -0
- package/dist/flow/loader.js.map +1 -1
- package/dist/flow/run-action.js +37 -5
- package/dist/flow/run-action.js.map +1 -1
- package/dist/flow/write-methods.js +4 -0
- package/dist/flow/write-methods.js.map +1 -1
- package/dist/integrations/agent-guides.d.ts +29 -0
- package/dist/integrations/agent-guides.js +125 -0
- package/dist/integrations/agent-guides.js.map +1 -0
- package/dist/integrations/claude-code/mcp-client-config.d.ts +16 -4
- package/dist/integrations/claude-code/mcp-client-config.js +57 -10
- package/dist/integrations/claude-code/mcp-client-config.js.map +1 -1
- package/dist/integrations/claude-code/unreal-mcp-entries.d.ts +33 -0
- package/dist/integrations/claude-code/unreal-mcp-entries.js +159 -0
- package/dist/integrations/claude-code/unreal-mcp-entries.js.map +1 -0
- package/dist/integrations/epic/project-status.d.ts +25 -0
- package/dist/integrations/epic/project-status.js +35 -0
- package/dist/integrations/epic/project-status.js.map +1 -0
- package/dist/integrations/epic/toolset-settings.d.ts +28 -0
- package/dist/integrations/epic/toolset-settings.js +136 -0
- package/dist/integrations/epic/toolset-settings.js.map +1 -0
- package/dist/integrations/epic/unreal-assistant.d.ts +64 -0
- package/dist/integrations/epic/unreal-assistant.js +209 -0
- package/dist/integrations/epic/unreal-assistant.js.map +1 -0
- package/dist/integrations/epic/unreal-canvas.d.ts +48 -0
- package/dist/integrations/epic/unreal-canvas.js +126 -0
- package/dist/integrations/epic/unreal-canvas.js.map +1 -0
- package/dist/integrations/epic/unreal-mcp-server.d.ts +74 -0
- package/dist/integrations/epic/unreal-mcp-server.js +231 -0
- package/dist/integrations/epic/unreal-mcp-server.js.map +1 -0
- package/dist/server/context-projection.js +5 -3
- package/dist/server/context-projection.js.map +1 -1
- package/dist/server/editor-resources.d.ts +39 -0
- package/dist/server/editor-resources.js +94 -0
- package/dist/server/editor-resources.js.map +1 -0
- package/dist/server/mcp-server.d.ts +7 -0
- package/dist/server/mcp-server.js +49 -13
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/runtime.js +21 -1
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/skill-prompts.d.ts +16 -0
- package/dist/server/skill-prompts.js +22 -0
- package/dist/server/skill-prompts.js.map +1 -0
- package/dist/sessions/session-load.d.ts +16 -0
- package/dist/sessions/session-load.js +64 -20
- package/dist/sessions/session-load.js.map +1 -1
- package/dist/sessions/session.d.ts +9 -0
- package/dist/sessions/session.js +8 -0
- package/dist/sessions/session.js.map +1 -1
- package/dist/surface/action-signature.js +9 -0
- package/dist/surface/action-signature.js.map +1 -1
- package/dist/surface/category-state.d.ts +119 -0
- package/dist/surface/category-state.js +232 -0
- package/dist/surface/category-state.js.map +1 -0
- package/dist/surface/context/call-envelope.d.ts +7 -0
- package/dist/surface/context/call-envelope.js +11 -0
- package/dist/surface/context/call-envelope.js.map +1 -1
- package/dist/surface/context/instructions.d.ts +2 -0
- package/dist/surface/context/instructions.js +20 -10
- package/dist/surface/context/instructions.js.map +1 -1
- package/dist/surface/context/micro-context.d.ts +7 -0
- package/dist/surface/context/micro-context.js +70 -14
- package/dist/surface/context/micro-context.js.map +1 -1
- package/dist/surface/context/tool-search.js +6 -2
- package/dist/surface/context/tool-search.js.map +1 -1
- package/dist/surface/epic-engines.d.ts +24 -0
- package/dist/surface/epic-engines.js +32 -0
- package/dist/surface/epic-engines.js.map +1 -0
- package/dist/surface/epic-input.d.ts +27 -2
- package/dist/surface/epic-input.js +39 -2
- package/dist/surface/epic-input.js.map +1 -1
- package/dist/surface/epic-surface.d.ts +15 -17
- package/dist/surface/epic-surface.js +13 -57
- package/dist/surface/epic-surface.js.map +1 -1
- package/dist/surface/registered-surface.d.ts +21 -4
- package/dist/surface/registered-surface.js +67 -23
- package/dist/surface/registered-surface.js.map +1 -1
- package/dist/surface/schemas.d.ts +8 -0
- package/dist/surface/schemas.js +14 -3
- package/dist/surface/schemas.js.map +1 -1
- package/dist/tool-counts.json +38 -31
- package/dist/tools/ai-assistant-wait.d.ts +17 -0
- package/dist/tools/ai-assistant-wait.js +45 -0
- package/dist/tools/ai-assistant-wait.js.map +1 -0
- package/dist/tools/animation.js +14 -8
- package/dist/tools/animation.js.map +1 -1
- package/dist/tools/asset.js +18 -5
- package/dist/tools/asset.js.map +1 -1
- package/dist/tools/audio.js +3 -0
- package/dist/tools/audio.js.map +1 -1
- package/dist/tools/blueprint.js +7 -0
- package/dist/tools/blueprint.js.map +1 -1
- package/dist/tools/canvas-results.d.ts +32 -0
- package/dist/tools/canvas-results.js +137 -0
- package/dist/tools/canvas-results.js.map +1 -0
- package/dist/tools/canvas.d.ts +19 -0
- package/dist/tools/canvas.js +254 -0
- package/dist/tools/canvas.js.map +1 -0
- package/dist/tools/chooser.js +42 -6
- package/dist/tools/chooser.js.map +1 -1
- package/dist/tools/demo.js +2 -2
- package/dist/tools/demo.js.map +1 -1
- package/dist/tools/editor/batch.js +1 -1
- package/dist/tools/editor/batch.js.map +1 -1
- package/dist/tools/editor-csv-profile.d.ts +62 -0
- package/dist/tools/editor-csv-profile.js +266 -0
- package/dist/tools/editor-csv-profile.js.map +1 -0
- package/dist/tools/editor.js +41 -12
- package/dist/tools/editor.js.map +1 -1
- package/dist/tools/epic/animation.generated.d.ts +1 -1
- package/dist/tools/epic/animation.generated.js +5051 -695
- package/dist/tools/epic/animation.generated.js.map +1 -1
- package/dist/tools/epic/asset.generated.d.ts +1 -1
- package/dist/tools/epic/asset.generated.js +848 -156
- package/dist/tools/epic/asset.generated.js.map +1 -1
- package/dist/tools/epic/audio.generated.d.ts +6 -0
- package/dist/tools/epic/audio.generated.js +323 -0
- package/dist/tools/epic/audio.generated.js.map +1 -0
- package/dist/tools/epic/blueprint.generated.d.ts +1 -1
- package/dist/tools/epic/blueprint.generated.js +467 -118
- package/dist/tools/epic/blueprint.generated.js.map +1 -1
- package/dist/tools/epic/catalog-engines.d.ts +2 -0
- package/dist/tools/epic/catalog-engines.js +4 -0
- package/dist/tools/epic/catalog-engines.js.map +1 -0
- package/dist/tools/epic/conversation.generated.js +11 -11
- package/dist/tools/epic/conversation.generated.js.map +1 -1
- package/dist/tools/epic/dataflow.generated.d.ts +1 -1
- package/dist/tools/epic/dataflow.generated.js +349 -29
- package/dist/tools/epic/dataflow.generated.js.map +1 -1
- package/dist/tools/epic/editor.generated.d.ts +1 -1
- package/dist/tools/epic/editor.generated.js +575 -41
- package/dist/tools/epic/editor.generated.js.map +1 -1
- package/dist/tools/epic/effects.d.ts +9 -3
- package/dist/tools/epic/effects.js +3384 -33
- package/dist/tools/epic/effects.js.map +1 -1
- package/dist/tools/epic/epic.generated.d.ts +1 -1
- package/dist/tools/epic/epic.generated.js +68 -10
- package/dist/tools/epic/epic.generated.js.map +1 -1
- package/dist/tools/epic/gameplay.generated.d.ts +1 -1
- package/dist/tools/epic/gameplay.generated.js +502 -45
- package/dist/tools/epic/gameplay.generated.js.map +1 -1
- package/dist/tools/epic/gas.generated.d.ts +1 -1
- package/dist/tools/epic/gas.generated.js +29 -21
- package/dist/tools/epic/gas.generated.js.map +1 -1
- package/dist/tools/epic/index.d.ts +4 -0
- package/dist/tools/epic/index.js +4 -0
- package/dist/tools/epic/index.js.map +1 -1
- package/dist/tools/epic/level.generated.d.ts +1 -1
- package/dist/tools/epic/level.generated.js +524 -95
- package/dist/tools/epic/level.generated.js.map +1 -1
- package/dist/tools/epic/material.generated.d.ts +1 -1
- package/dist/tools/epic/material.generated.js +152 -76
- package/dist/tools/epic/material.generated.js.map +1 -1
- package/dist/tools/epic/niagara.generated.d.ts +1 -1
- package/dist/tools/epic/niagara.generated.js +124 -115
- package/dist/tools/epic/niagara.generated.js.map +1 -1
- package/dist/tools/epic/pcg.generated.d.ts +1 -1
- package/dist/tools/epic/pcg.generated.js +322 -47
- package/dist/tools/epic/pcg.generated.js.map +1 -1
- package/dist/tools/epic/plugins.generated.d.ts +1 -1
- package/dist/tools/epic/plugins.generated.js +143 -36
- package/dist/tools/epic/plugins.generated.js.map +1 -1
- package/dist/tools/epic/project.generated.d.ts +1 -1
- package/dist/tools/epic/project.generated.js +144 -31
- package/dist/tools/epic/project.generated.js.map +1 -1
- package/dist/tools/epic/reflection.generated.d.ts +1 -1
- package/dist/tools/epic/reflection.generated.js +33 -16
- package/dist/tools/epic/reflection.generated.js.map +1 -1
- package/dist/tools/epic/source_control.generated.d.ts +6 -0
- package/dist/tools/epic/source_control.generated.js +260 -0
- package/dist/tools/epic/source_control.generated.js.map +1 -0
- package/dist/tools/epic/statetree.generated.d.ts +1 -1
- package/dist/tools/epic/statetree.generated.js +292 -20
- package/dist/tools/epic/statetree.generated.js.map +1 -1
- package/dist/tools/epic/toolset-routes.d.ts +6 -0
- package/dist/tools/epic/toolset-routes.js +74 -0
- package/dist/tools/epic/toolset-routes.js.map +1 -0
- package/dist/tools/epic/widget.generated.d.ts +1 -1
- package/dist/tools/epic/widget.generated.js +797 -85
- package/dist/tools/epic/widget.generated.js.map +1 -1
- package/dist/tools/epic.js +22 -4
- package/dist/tools/epic.js.map +1 -1
- package/dist/tools/gameplay.js +10 -0
- package/dist/tools/gameplay.js.map +1 -1
- package/dist/tools/graph-diagrams.d.ts +15 -0
- package/dist/tools/graph-diagrams.js +153 -0
- package/dist/tools/graph-diagrams.js.map +1 -0
- package/dist/tools/landscape.js +12 -1
- package/dist/tools/landscape.js.map +1 -1
- package/dist/tools/level.js +35 -1
- package/dist/tools/level.js.map +1 -1
- package/dist/tools/material.js +7 -1
- package/dist/tools/material.js.map +1 -1
- package/dist/tools/networking.js +1 -0
- package/dist/tools/networking.js.map +1 -1
- package/dist/tools/pcg.js +8 -1
- package/dist/tools/pcg.js.map +1 -1
- package/dist/tools/project/categories.d.ts +74 -0
- package/dist/tools/project/categories.js +405 -0
- package/dist/tools/project/categories.js.map +1 -0
- package/dist/tools/project/config.js +93 -0
- package/dist/tools/project/config.js.map +1 -1
- package/dist/tools/project/leases.d.ts +8 -0
- package/dist/tools/project/leases.js +107 -0
- package/dist/tools/project/leases.js.map +1 -0
- package/dist/tools/project/localization.d.ts +7 -0
- package/dist/tools/project/localization.js +21 -0
- package/dist/tools/project/localization.js.map +1 -0
- package/dist/tools/project/sessions.js +29 -1
- package/dist/tools/project/sessions.js.map +1 -1
- package/dist/tools/project.js +25 -4
- package/dist/tools/project.js.map +1 -1
- package/dist/tools/source_control.js +3 -0
- package/dist/tools/source_control.js.map +1 -1
- package/dist/tools/specs/animation.generated.js +3 -3
- package/dist/tools/specs/animation.generated.js.map +1 -1
- package/dist/tools/specs/asset.generated.js +223 -12
- package/dist/tools/specs/asset.generated.js.map +1 -1
- package/dist/tools/specs/chooser.generated.js +1039 -63
- package/dist/tools/specs/chooser.generated.js.map +1 -1
- package/dist/tools/specs/demo.generated.js +11 -3
- package/dist/tools/specs/demo.generated.js.map +1 -1
- package/dist/tools/specs/editor.generated.js +444 -15
- package/dist/tools/specs/editor.generated.js.map +1 -1
- package/dist/tools/specs/epic.generated.js +215 -3
- package/dist/tools/specs/epic.generated.js.map +1 -1
- package/dist/tools/specs/gameplay.generated.js +175 -4
- package/dist/tools/specs/gameplay.generated.js.map +1 -1
- package/dist/tools/specs/landscape.generated.js +483 -7
- package/dist/tools/specs/landscape.generated.js.map +1 -1
- package/dist/tools/specs/level.generated.js +1218 -68
- package/dist/tools/specs/level.generated.js.map +1 -1
- package/dist/tools/specs/networking.generated.js +83 -0
- package/dist/tools/specs/networking.generated.js.map +1 -1
- package/dist/tools/specs/pcg.generated.js +125 -5
- package/dist/tools/specs/pcg.generated.js.map +1 -1
- package/dist/tools/specs/project.generated.js +134 -0
- package/dist/tools/specs/project.generated.js.map +1 -1
- package/dist/tools/specs/statetree.generated.js +245 -9
- package/dist/tools/specs/statetree.generated.js.map +1 -1
- package/dist/tools/specs/widget.generated.js +362 -3
- package/dist/tools/specs/widget.generated.js.map +1 -1
- package/dist/tools/statetree.js +12 -1
- package/dist/tools/statetree.js.map +1 -1
- package/dist/tools/widget.js +12 -0
- package/dist/tools/widget.js.map +1 -1
- package/dist/tools.js +2 -0
- package/dist/tools.js.map +1 -1
- package/dist/ue-mcp.default.yml +14785 -983
- package/package.json +4 -2
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/BridgePortConfig.cpp +56 -4
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/BridgeRequestContext.h +54 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/BridgeServer.cpp +203 -18
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/BridgeServer.h +42 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/HandlerCatalog.cpp +6 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/HandlerDeferred.cpp +225 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/HandlerLevelSwitch.h +123 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/HandlerScriptErrors.h +44 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Animation/AnimationHandlers.cpp +7 -7
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Asset/AssetHandlers.cpp +15 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Asset/AssetHandlers.h +9 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Asset/AssetHandlers_Import.cpp +147 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Asset/AssetHandlers_Redirectors.cpp +11 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Asset/AssetHandlers_SemanticSearch.cpp +435 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Chooser/ChooserHandlers.cpp +363 -331
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Chooser/ChooserHandlers.h +30 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Chooser/ChooserHandlers_Authoring.cpp +2178 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Chooser/HandlerChooserShared.h +1005 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Demo/DemoHandlers.cpp +104 -11
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Demo/DemoHandlers.h +19 -1
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Dialog/DialogHandlers.cpp +54 -2
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Dialog/DialogHandlers.h +9 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers.cpp +31 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers.h +15 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers_CsvProfile.cpp +272 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers_MapCheck.cpp +197 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers_Profiling.cpp +11 -16
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers_PythonPaths.cpp +237 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers_TraceAnalysis.cpp +790 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Epic/EpicHandlers.cpp +201 -56
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Epic/EpicHandlers.h +30 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Epic/EpicHandlers_AIAssistant.cpp +510 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Epic/EpicHandlers_MCP.cpp +394 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Epic/EpicHandlers_Toolsets.cpp +542 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Epic/MCPAIAssistantListener.h +19 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Gas/GasHandlers_Runtime.cpp +10 -7
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Landscape/LandscapeHandlers.cpp +9 -23
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Landscape/LandscapeHandlers.h +4 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Landscape/LandscapeHandlers_Sculpt.cpp +7 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Landscape/LandscapeHandlers_Splines.cpp +1253 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Landscape/LandscapeHandlers_Splines.h +39 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelGeneratorRecords.h +84 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers.cpp +57 -12
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers.h +33 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_Blockout.cpp +987 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_Blockout.h +23 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_PerfAudit.cpp +925 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_ReplaceActors.cpp +387 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_SplineGen.cpp +813 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_SplineGen.h +22 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Level/LevelHandlers_WorldPartitionSubsystem.cpp +1238 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Localization/LocalizationHandlers.cpp +982 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Localization/LocalizationHandlers.h +32 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/MachineLearning/MachineLearningHandlers.cpp +44 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/MachineLearning/MachineLearningHandlers.h +29 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/MachineLearning/MachineLearningHandlers_LearningAgents.cpp +491 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/MachineLearning/MachineLearningHandlers_NNE.cpp +532 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Networking/NetworkingHandlers.cpp +14 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Networking/NetworkingHandlers.h +2 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Networking/NetworkingHandlers_Audit.cpp +496 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/PCG/PCGEdgeValidation.h +150 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/PCG/PCGHandlers.cpp +26 -1
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/PCG/PCGHandlers.h +5 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/PCG/PCGHandlers_CustomHLSL.cpp +290 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/PCG/PCGHandlers_LevelToAsset.cpp +34 -3
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Sequencer/MovieRenderQueueHandlers.cpp +1215 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Sequencer/MovieRenderQueueHandlers.h +27 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/StateTree/StateTreeHandlers.cpp +72 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/StateTree/StateTreeHandlers.h +11 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/StateTree/StateTreeHandlers_NodesAndBindings.cpp +1172 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Widget/WidgetHandlers.cpp +4 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Widget/WidgetHandlers_MVVM.cpp +396 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Widget/WidgetHandlers_MVVM.h +32 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/DialogBlockingWindowTests.cpp +74 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/HandlerSpecContractTests.cpp +4 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Public/HandlerDeferred.h +76 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Public/HandlerEngineVersion.h +4 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Public/HandlerMVVMBackend.h +92 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Public/HandlerStaticInvoke.h +96 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/UE_MCP_Bridge.Build.cs +75 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_BridgeMVVM/Private/UE_MCP_BridgeMVVMModule.cpp +1277 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_BridgeMVVM/UE_MCP_BridgeMVVM.Build.cs +58 -0
- package/plugin/ue_mcp_bridge/UE_MCP_Bridge.uplugin +7 -2
- package/skills/ue-mcp-animation/SKILL.md +4 -4
- package/skills/ue-mcp-epic-routing/SKILL.md +4 -0
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Widget/WidgetHandlers.cpp
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#include "WidgetHandlers.h"
|
|
2
|
+
#include "WidgetHandlers_MVVM.h"
|
|
2
3
|
#include "HandlerRegistry.h"
|
|
3
4
|
#include "HandlerUtils.h"
|
|
4
5
|
#include "WidgetGuidMap.h"
|
|
@@ -650,6 +651,9 @@ void FWidgetHandlers::RegisterHandlers(FMCPHandlerRegistry& Registry)
|
|
|
650
651
|
Registry.RegisterHandler(TEXT("audit_commonui"), &AuditCommonUI, {
|
|
651
652
|
MCPParam::Optional(TEXT("assetPath"), EType::String, TEXT("Widget Blueprint whose CommonUI wiring to check as well")).Alias(TEXT("path")),
|
|
652
653
|
});
|
|
654
|
+
|
|
655
|
+
// Viewmodel (UMG MVVM) authoring, in its own translation unit.
|
|
656
|
+
FWidgetMVVMHandlers::RegisterHandlers(Registry);
|
|
653
657
|
}
|
|
654
658
|
|
|
655
659
|
UWidget* FWidgetHandlers::FindWidgetByNameRecursive(UWidget* Root, const FString& WidgetName)
|
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Widget/WidgetHandlers_MVVM.cpp
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
// Viewmodel (UMG MVVM) authoring. See WidgetHandlers_MVVM.h and
|
|
2
|
+
// Public/HandlerMVVMBackend.h for how the work is split with UE_MCP_BridgeMVVM.
|
|
3
|
+
|
|
4
|
+
#include "WidgetHandlers_MVVM.h"
|
|
5
|
+
#include "WidgetHandlers.h"
|
|
6
|
+
#include "WidgetGuidMap.h"
|
|
7
|
+
#include "HandlerRegistry.h"
|
|
8
|
+
#include "HandlerUtils.h"
|
|
9
|
+
#include "HandlerMVVMBackend.h"
|
|
10
|
+
#include "WidgetBlueprint.h"
|
|
11
|
+
#include "Interfaces/IPluginManager.h"
|
|
12
|
+
#include "Modules/ModuleManager.h"
|
|
13
|
+
|
|
14
|
+
namespace UEMCP
|
|
15
|
+
{
|
|
16
|
+
static IMCPMVVMBackend*& MCPMVVMBackendSlot()
|
|
17
|
+
{
|
|
18
|
+
static IMCPMVVMBackend* Slot = nullptr;
|
|
19
|
+
return Slot;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
void SetMVVMBackend(IMCPMVVMBackend* Backend)
|
|
23
|
+
{
|
|
24
|
+
MCPMVVMBackendSlot() = Backend;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
IMCPMVVMBackend* GetMVVMBackend()
|
|
28
|
+
{
|
|
29
|
+
return MCPMVVMBackendSlot();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The backend, loading UE_MCP_BridgeMVVM on first use once the plugin is known to be enabled. */
|
|
34
|
+
static IMCPMVVMBackend* MCPMVVMRequireBackend(FString& OutError)
|
|
35
|
+
{
|
|
36
|
+
if (IMCPMVVMBackend* Backend = UEMCP::GetMVVMBackend())
|
|
37
|
+
{
|
|
38
|
+
return Backend;
|
|
39
|
+
}
|
|
40
|
+
const TSharedPtr<IPlugin> Plugin = IPluginManager::Get().FindPlugin(TEXT("ModelViewViewModel"));
|
|
41
|
+
if (!Plugin.IsValid())
|
|
42
|
+
{
|
|
43
|
+
OutError = TEXT("The UMG Viewmodel plugin (ModelViewViewModel) is not installed in this engine, so viewmodels cannot be authored.");
|
|
44
|
+
return nullptr;
|
|
45
|
+
}
|
|
46
|
+
if (!Plugin->IsEnabled())
|
|
47
|
+
{
|
|
48
|
+
OutError = TEXT("The UMG Viewmodel plugin (ModelViewViewModel) is not enabled in this project. Enable it with project(action=\"enable_plugin\", pluginName=\"ModelViewViewModel\") and restart the editor.");
|
|
49
|
+
return nullptr;
|
|
50
|
+
}
|
|
51
|
+
FModuleManager::Get().LoadModule(TEXT("UE_MCP_BridgeMVVM"));
|
|
52
|
+
if (IMCPMVVMBackend* Backend = UEMCP::GetMVVMBackend())
|
|
53
|
+
{
|
|
54
|
+
return Backend;
|
|
55
|
+
}
|
|
56
|
+
OutError = TEXT("The UMG Viewmodel plugin is enabled but the bridge's UE_MCP_BridgeMVVM module did not load. Rebuild the UE_MCP_Bridge plugin; the editor log names the load failure.");
|
|
57
|
+
return nullptr;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* "KismetTextLibrary.Conv_IntToText" and "UKismetTextLibrary::Conv_IntToText"
|
|
62
|
+
* become "/Script/Engine.KismetTextLibrary:Conv_IntToText", the form the
|
|
63
|
+
* backend resolves without the class resolver. A "Class:Function" path and a
|
|
64
|
+
* bare function name (one on the widget blueprint) pass through.
|
|
65
|
+
*/
|
|
66
|
+
static bool MCPMVVMNormalizeConversionFunction(FString& InOut, FString& OutError)
|
|
67
|
+
{
|
|
68
|
+
if (InOut.IsEmpty() || (InOut.Contains(TEXT(":")) && !InOut.Contains(TEXT("::"))))
|
|
69
|
+
{
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
FString ClassPart;
|
|
73
|
+
FString FunctionPart;
|
|
74
|
+
if (!InOut.Split(TEXT("::"), &ClassPart, &FunctionPart, ESearchCase::CaseSensitive, ESearchDir::FromEnd)
|
|
75
|
+
&& !InOut.Split(TEXT("."), &ClassPart, &FunctionPart, ESearchCase::CaseSensitive, ESearchDir::FromEnd))
|
|
76
|
+
{
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
UClass* Owner = MCPResolveClass(ClassPart);
|
|
80
|
+
if (!Owner)
|
|
81
|
+
{
|
|
82
|
+
OutError = FString::Printf(TEXT("conversionFunction '%s': no class '%s'."), *InOut, *ClassPart);
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
InOut = FString::Printf(TEXT("%s:%s"), *Owner->GetPathName(), *FunctionPart);
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Resolve the Widget Blueprint, run one backend operation and turn its outcome
|
|
91
|
+
* into the response: the created/existed/updated/deleted answer, the inverse
|
|
92
|
+
* call or the reason there is none, and the save.
|
|
93
|
+
*/
|
|
94
|
+
enum class EMCPMVVMReads : uint8
|
|
95
|
+
{
|
|
96
|
+
Plain,
|
|
97
|
+
/** The operation takes viewModelClass, resolved here. */
|
|
98
|
+
ViewModelClass,
|
|
99
|
+
/** The operation takes conversionFunction, normalized here. */
|
|
100
|
+
ConversionFunction,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
static TSharedPtr<FJsonValue> MCPMVVMRun(const TCHAR* Operation, const TSharedPtr<FJsonObject>& Params, EMCPMVVMReads Reads = EMCPMVVMReads::Plain)
|
|
104
|
+
{
|
|
105
|
+
FString AssetPath;
|
|
106
|
+
if (TSharedPtr<FJsonValue> Missing = RequireString(Params, TEXT("assetPath"), AssetPath))
|
|
107
|
+
{
|
|
108
|
+
return Missing;
|
|
109
|
+
}
|
|
110
|
+
TSharedPtr<FJsonValue> ResolveError;
|
|
111
|
+
UWidgetBlueprint* WidgetBP = MCPWidget::ResolveWidgetBlueprintOrError(AssetPath, ResolveError);
|
|
112
|
+
if (!WidgetBP)
|
|
113
|
+
{
|
|
114
|
+
return ResolveError;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// The class resolver lives in this module, so classes are resolved here and
|
|
118
|
+
// handed to the backend as paths.
|
|
119
|
+
TSharedPtr<FJsonObject> Args = MakeShared<FJsonObject>(*Params);
|
|
120
|
+
FString ViewModelClass;
|
|
121
|
+
if (Reads == EMCPMVVMReads::ViewModelClass && TryGetStringParam(Params, TEXT("viewModelClass"), ViewModelClass) && !ViewModelClass.IsEmpty())
|
|
122
|
+
{
|
|
123
|
+
UClass* Resolved = MCPResolveClass(ViewModelClass);
|
|
124
|
+
if (!Resolved)
|
|
125
|
+
{
|
|
126
|
+
return MCPClassNotFoundError(ViewModelClass, TEXT("viewModelClass"));
|
|
127
|
+
}
|
|
128
|
+
Args->SetStringField(TEXT("viewModelClass"), Resolved->GetPathName());
|
|
129
|
+
}
|
|
130
|
+
FString Conversion;
|
|
131
|
+
if (Reads == EMCPMVVMReads::ConversionFunction && TryGetStringParam(Params, TEXT("conversionFunction"), Conversion))
|
|
132
|
+
{
|
|
133
|
+
FString NormalizeError;
|
|
134
|
+
if (!MCPMVVMNormalizeConversionFunction(Conversion, NormalizeError))
|
|
135
|
+
{
|
|
136
|
+
return MCPError(NormalizeError);
|
|
137
|
+
}
|
|
138
|
+
Args->SetStringField(TEXT("conversionFunction"), Conversion);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
FString BackendError;
|
|
142
|
+
IMCPMVVMBackend* Backend = MCPMVVMRequireBackend(BackendError);
|
|
143
|
+
if (!Backend)
|
|
144
|
+
{
|
|
145
|
+
return MCPError(BackendError);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
FMCPMVVMOutcome Outcome = Backend->Run(Operation, WidgetBP, Args);
|
|
149
|
+
|
|
150
|
+
TSharedPtr<FJsonObject> Result = Outcome.bOk ? MCPSuccess() : MCPErrorObject(Outcome.Error);
|
|
151
|
+
if (Outcome.Data.IsValid())
|
|
152
|
+
{
|
|
153
|
+
for (const auto& Entry : Outcome.Data->Values)
|
|
154
|
+
{
|
|
155
|
+
const TPair<FString, TSharedPtr<FJsonValue>> Pair(Entry.Key, Entry.Value);
|
|
156
|
+
Result->SetField(Pair.Key, Pair.Value);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
Result->SetStringField(TEXT("assetPath"), AssetPath);
|
|
160
|
+
|
|
161
|
+
switch (Outcome.Change)
|
|
162
|
+
{
|
|
163
|
+
case FMCPMVVMOutcome::EChange::Created:
|
|
164
|
+
MCPSetCreated(Result);
|
|
165
|
+
break;
|
|
166
|
+
case FMCPMVVMOutcome::EChange::Existed:
|
|
167
|
+
MCPSetExisted(Result);
|
|
168
|
+
Result->SetBoolField(TEXT("unchanged"), true);
|
|
169
|
+
break;
|
|
170
|
+
case FMCPMVVMOutcome::EChange::Updated:
|
|
171
|
+
MCPSetUpdated(Result);
|
|
172
|
+
break;
|
|
173
|
+
case FMCPMVVMOutcome::EChange::Deleted:
|
|
174
|
+
Result->SetBoolField(TEXT("deleted"), true);
|
|
175
|
+
break;
|
|
176
|
+
case FMCPMVVMOutcome::EChange::AlreadyDeleted:
|
|
177
|
+
Result->SetBoolField(TEXT("alreadyDeleted"), true);
|
|
178
|
+
break;
|
|
179
|
+
default:
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (!Outcome.RollbackMethod.IsEmpty())
|
|
184
|
+
{
|
|
185
|
+
TSharedPtr<FJsonObject> Payload = Outcome.RollbackPayload;
|
|
186
|
+
if (!Payload.IsValid()) Payload = MakeShared<FJsonObject>();
|
|
187
|
+
Payload->SetStringField(TEXT("assetPath"), AssetPath);
|
|
188
|
+
MCPSetRollback(Result, Outcome.RollbackMethod, Payload);
|
|
189
|
+
}
|
|
190
|
+
else if (!Outcome.NoRollbackReason.IsEmpty())
|
|
191
|
+
{
|
|
192
|
+
MCPSetNoRollback(Result, Outcome.NoRollbackReason);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (Outcome.bModified)
|
|
196
|
+
{
|
|
197
|
+
// Saved without compiling: a viewmodel edit leaves the blueprint dirty the
|
|
198
|
+
// way the editor does, and compile_widget_viewmodels compiles it and
|
|
199
|
+
// reports each binding's errors.
|
|
200
|
+
FString SaveError;
|
|
201
|
+
const bool bSaved = SaveAssetPackageChecked(WidgetBP, SaveError);
|
|
202
|
+
if (Outcome.bOk)
|
|
203
|
+
{
|
|
204
|
+
MCPNoteSaveOutcome(Result, AssetPath, bSaved, SaveError);
|
|
205
|
+
}
|
|
206
|
+
Result->SetStringField(TEXT("compileStatus"), WidgetCompileStatusString(WidgetBP));
|
|
207
|
+
}
|
|
208
|
+
return MCPResult(Result);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
void FWidgetMVVMHandlers::RegisterHandlers(FMCPHandlerRegistry& Registry)
|
|
212
|
+
{
|
|
213
|
+
using EType = EMCPParamType;
|
|
214
|
+
auto AssetPath = []()
|
|
215
|
+
{
|
|
216
|
+
return MCPParam::Required(TEXT("assetPath"), EType::String, TEXT("Widget Blueprint asset path, e.g. /Game/UI/WBP_Example")).Alias(TEXT("path"));
|
|
217
|
+
};
|
|
218
|
+
// The binding fields add and update share. Paths start with a viewmodel
|
|
219
|
+
// name, a widget name or Self, then walk fields: PlayerVM.Health.
|
|
220
|
+
auto BindingFields = [](TArray<FMCPParamSpec>& Out, bool bForAdd)
|
|
221
|
+
{
|
|
222
|
+
Out.Add(MCPParam::Optional(TEXT("sourcePath"), EType::String, TEXT("Source of the value: a viewmodel name, a widget name or Self, then its fields, e.g. PlayerVM.Health")));
|
|
223
|
+
Out.Add(bForAdd
|
|
224
|
+
? MCPParam::Optional(TEXT("destinationPath"), EType::String, TEXT("Where the value goes, same form, e.g. HealthBar.Percent. Required unless a destinationToSource conversion binds the widget through conversionArguments"))
|
|
225
|
+
: MCPParam::Optional(TEXT("destinationPath"), EType::String, TEXT("Where the value goes, same form, e.g. HealthBar.Percent")));
|
|
226
|
+
Out.Add(MCPParam::Optional(TEXT("bindingMode"), EType::String, bForAdd ? TEXT("Direction and frequency (default OneWayToDestination)") : TEXT("Direction and frequency"))
|
|
227
|
+
.Enum({ TEXT("OneTimeToDestination"), TEXT("OneWayToDestination"), TEXT("TwoWay"), TEXT("OneWayToSource") }));
|
|
228
|
+
Out.Add(MCPParam::Optional(TEXT("executionMode"), EType::String, TEXT("When the binding runs; Default uses the project setting"))
|
|
229
|
+
.Enum({ TEXT("Default"), TEXT("Immediate"), TEXT("Delayed"), TEXT("Tick"), TEXT("Auto") }));
|
|
230
|
+
Out.Add(MCPParam::Optional(TEXT("conversionFunction"), EType::String, bForAdd
|
|
231
|
+
? TEXT("Pure function converting the value: Class.Function (KismetTextLibrary.Conv_IntToText), /Script/Module.Class:Function, or a function on this widget blueprint")
|
|
232
|
+
: TEXT("Pure function converting the value, as for add; an empty string removes the conversion")));
|
|
233
|
+
Out.Add(MCPParam::Optional(TEXT("conversionArguments"), EType::Object, TEXT("Conversion inputs by pin name: a literal (string, number, boolean or {literal}) or {path} bound to a field. The input sourcePath is not given to goes to the first free input")));
|
|
234
|
+
Out.Add(MCPParam::Optional(TEXT("conversionDirection"), EType::String, TEXT("Which way the conversion runs (default sourceToDestination, destinationToSource for OneWayToSource)"))
|
|
235
|
+
.Enum({ TEXT("sourceToDestination"), TEXT("destinationToSource") }));
|
|
236
|
+
Out.Add(MCPParam::Optional(TEXT("enabled"), EType::Boolean, TEXT("Whether the binding runs by default (default true)")));
|
|
237
|
+
Out.Add(MCPParam::Optional(TEXT("includeInCompile"), EType::Boolean, TEXT("False keeps the binding in the editor but out of the compiled class (default true)")));
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
Registry.RegisterHandler(TEXT("list_widget_viewmodels"), &ListViewModels, {
|
|
241
|
+
AssetPath(),
|
|
242
|
+
});
|
|
243
|
+
Registry.RegisterHandler(TEXT("add_widget_viewmodel"), &AddViewModel, {
|
|
244
|
+
AssetPath(),
|
|
245
|
+
MCPParam::Required(TEXT("viewModelClass"), EType::String, TEXT("Viewmodel class: a native MVVMViewModelBase subclass name or path, or a Blueprint viewmodel asset path")),
|
|
246
|
+
MCPParam::Optional(TEXT("viewModelName"), EType::String, TEXT("Name of the generated viewmodel property (default the class name)")),
|
|
247
|
+
MCPParam::Optional(TEXT("creationType"), EType::String, TEXT("How the widget gets its instance (default the first type the class allows, usually CreateInstance). Context is UE 5.8+"))
|
|
248
|
+
.Enum({ TEXT("Manual"), TEXT("CreateInstance"), TEXT("GlobalViewModelCollection"), TEXT("PropertyPath"), TEXT("Resolver"), TEXT("Context") }),
|
|
249
|
+
MCPParam::Optional(TEXT("globalViewModelIdentifier"), EType::String, TEXT("Identifier in the global viewmodel collection, for creationType GlobalViewModelCollection")),
|
|
250
|
+
MCPParam::Optional(TEXT("viewModelPropertyPath"), EType::String, TEXT("Property or function path that returns the instance, for creationType PropertyPath")),
|
|
251
|
+
MCPParam::Optional(TEXT("optional"), EType::Boolean, TEXT("Do not warn when the instance is not set or found")),
|
|
252
|
+
MCPParam::Optional(TEXT("createSetter"), EType::Boolean, TEXT("Generate a public setter for the viewmodel")),
|
|
253
|
+
MCPParam::Optional(TEXT("createGetter"), EType::Boolean, TEXT("Generate a public getter for the viewmodel (default true)")),
|
|
254
|
+
MCPParam::Optional(TEXT("viewModelId"), EType::String, TEXT("Reuse this viewmodel id; the rollback of remove_widget_viewmodel passes the removed one so its bindings resolve again")),
|
|
255
|
+
});
|
|
256
|
+
Registry.RegisterHandler(TEXT("remove_widget_viewmodel"), &RemoveViewModel, {
|
|
257
|
+
AssetPath(),
|
|
258
|
+
MCPParam::Required(TEXT("viewModelName"), EType::String, TEXT("Name of the viewmodel to remove")),
|
|
259
|
+
});
|
|
260
|
+
Registry.RegisterHandler(TEXT("list_widget_viewmodel_bindings"), &ListViewModelBindings, {
|
|
261
|
+
AssetPath(),
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
TArray<FMCPParamSpec> AddSpec = { AssetPath() };
|
|
265
|
+
BindingFields(AddSpec, true);
|
|
266
|
+
Registry.RegisterHandler(TEXT("add_widget_viewmodel_binding"), &AddViewModelBinding, AddSpec);
|
|
267
|
+
|
|
268
|
+
TArray<FMCPParamSpec> UpdateSpec = {
|
|
269
|
+
AssetPath(),
|
|
270
|
+
MCPParam::Required(TEXT("bindingId"), EType::String, TEXT("Binding id, as list_widget_viewmodel_bindings reports it")),
|
|
271
|
+
};
|
|
272
|
+
BindingFields(UpdateSpec, false);
|
|
273
|
+
Registry.RegisterHandler(TEXT("update_widget_viewmodel_binding"), &UpdateViewModelBinding, UpdateSpec);
|
|
274
|
+
|
|
275
|
+
Registry.RegisterHandler(TEXT("remove_widget_viewmodel_binding"), &RemoveViewModelBinding, {
|
|
276
|
+
AssetPath(),
|
|
277
|
+
MCPParam::Required(TEXT("bindingId"), EType::String, TEXT("Binding id, as list_widget_viewmodel_bindings reports it")),
|
|
278
|
+
});
|
|
279
|
+
Registry.RegisterHandler(TEXT("compile_widget_viewmodels"), &CompileViewModels, {
|
|
280
|
+
AssetPath(),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::ListViewModels(const TSharedPtr<FJsonObject>& Params)
|
|
285
|
+
{
|
|
286
|
+
return MCPMVVMRun(TEXT("list_widget_viewmodels"), Params);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::AddViewModel(const TSharedPtr<FJsonObject>& Params)
|
|
290
|
+
{
|
|
291
|
+
MCPReadParamsAhead(Params, {
|
|
292
|
+
TEXT("assetPath"), TEXT("viewModelClass"), TEXT("viewModelName"), TEXT("creationType"),
|
|
293
|
+
TEXT("globalViewModelIdentifier"), TEXT("viewModelPropertyPath"), TEXT("optional"),
|
|
294
|
+
TEXT("createSetter"), TEXT("createGetter"), TEXT("viewModelId"),
|
|
295
|
+
});
|
|
296
|
+
return MCPMVVMRun(TEXT("add_widget_viewmodel"), Params, EMCPMVVMReads::ViewModelClass);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::RemoveViewModel(const TSharedPtr<FJsonObject>& Params)
|
|
300
|
+
{
|
|
301
|
+
MCPReadParamsAhead(Params, { TEXT("assetPath"), TEXT("viewModelName") });
|
|
302
|
+
return MCPMVVMRun(TEXT("remove_widget_viewmodel"), Params);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::ListViewModelBindings(const TSharedPtr<FJsonObject>& Params)
|
|
306
|
+
{
|
|
307
|
+
return MCPMVVMRun(TEXT("list_widget_viewmodel_bindings"), Params);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::AddViewModelBinding(const TSharedPtr<FJsonObject>& Params)
|
|
311
|
+
{
|
|
312
|
+
MCPReadParamsAhead(Params, {
|
|
313
|
+
TEXT("assetPath"), TEXT("sourcePath"), TEXT("destinationPath"), TEXT("bindingMode"), TEXT("executionMode"),
|
|
314
|
+
TEXT("conversionFunction"), TEXT("conversionArguments"), TEXT("conversionDirection"),
|
|
315
|
+
TEXT("enabled"), TEXT("includeInCompile"),
|
|
316
|
+
});
|
|
317
|
+
return MCPMVVMRun(TEXT("add_widget_viewmodel_binding"), Params, EMCPMVVMReads::ConversionFunction);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::UpdateViewModelBinding(const TSharedPtr<FJsonObject>& Params)
|
|
321
|
+
{
|
|
322
|
+
MCPReadParamsAhead(Params, {
|
|
323
|
+
TEXT("assetPath"), TEXT("bindingId"), TEXT("sourcePath"), TEXT("destinationPath"), TEXT("bindingMode"),
|
|
324
|
+
TEXT("executionMode"), TEXT("conversionFunction"), TEXT("conversionArguments"), TEXT("conversionDirection"),
|
|
325
|
+
TEXT("enabled"), TEXT("includeInCompile"),
|
|
326
|
+
});
|
|
327
|
+
return MCPMVVMRun(TEXT("update_widget_viewmodel_binding"), Params, EMCPMVVMReads::ConversionFunction);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::RemoveViewModelBinding(const TSharedPtr<FJsonObject>& Params)
|
|
331
|
+
{
|
|
332
|
+
MCPReadParamsAhead(Params, { TEXT("assetPath"), TEXT("bindingId") });
|
|
333
|
+
return MCPMVVMRun(TEXT("remove_widget_viewmodel_binding"), Params);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
TSharedPtr<FJsonValue> FWidgetMVVMHandlers::CompileViewModels(const TSharedPtr<FJsonObject>& Params)
|
|
337
|
+
{
|
|
338
|
+
FString AssetPath;
|
|
339
|
+
if (TSharedPtr<FJsonValue> Missing = RequireString(Params, TEXT("assetPath"), AssetPath))
|
|
340
|
+
{
|
|
341
|
+
return Missing;
|
|
342
|
+
}
|
|
343
|
+
TSharedPtr<FJsonValue> ResolveError;
|
|
344
|
+
UWidgetBlueprint* WidgetBP = MCPWidget::ResolveWidgetBlueprintOrError(AssetPath, ResolveError);
|
|
345
|
+
if (!WidgetBP)
|
|
346
|
+
{
|
|
347
|
+
return ResolveError;
|
|
348
|
+
}
|
|
349
|
+
FString BackendError;
|
|
350
|
+
IMCPMVVMBackend* Backend = MCPMVVMRequireBackend(BackendError);
|
|
351
|
+
if (!Backend)
|
|
352
|
+
{
|
|
353
|
+
return MCPError(BackendError);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const bool bWasUpToDate = WidgetBP->Status == BS_UpToDate || WidgetBP->Status == BS_UpToDateWithWarnings;
|
|
357
|
+
const MCPWidgetGuidMap::FSyncReport Report = MCPWidgetGuidMap::CompileChecked(WidgetBP);
|
|
358
|
+
if (Report.WasRefused())
|
|
359
|
+
{
|
|
360
|
+
return MCPWidgetGuidMap::BlockedError(AssetPath, Report);
|
|
361
|
+
}
|
|
362
|
+
FString SaveError;
|
|
363
|
+
const bool bSaved = MCPWidgetGuidMap::SaveIfCompiled(WidgetBP, Report, SaveError);
|
|
364
|
+
|
|
365
|
+
auto Result = MCPSuccess();
|
|
366
|
+
Result->SetStringField(TEXT("assetPath"), AssetPath);
|
|
367
|
+
MCPNoteSaveOutcome(Result, AssetPath, bSaved, SaveError);
|
|
368
|
+
|
|
369
|
+
// The viewmodel compiler records each binding's problems on the view, which
|
|
370
|
+
// is what the editor's binding panel shows; read them back after the compile.
|
|
371
|
+
const FMCPMVVMOutcome Bindings = Backend->Run(TEXT("list_widget_viewmodel_bindings"), WidgetBP, Params);
|
|
372
|
+
int32 BindingErrors = 0;
|
|
373
|
+
if (Bindings.bOk && Bindings.Data.IsValid())
|
|
374
|
+
{
|
|
375
|
+
const TArray<TSharedPtr<FJsonValue>>* Rows = nullptr;
|
|
376
|
+
if (Bindings.Data->TryGetArrayField(TEXT("bindings"), Rows) && Rows)
|
|
377
|
+
{
|
|
378
|
+
for (const TSharedPtr<FJsonValue>& Row : *Rows)
|
|
379
|
+
{
|
|
380
|
+
const TSharedPtr<FJsonObject>* RowObject = nullptr;
|
|
381
|
+
const TArray<TSharedPtr<FJsonValue>>* Errors = nullptr;
|
|
382
|
+
if (Row.IsValid() && Row->TryGetObject(RowObject) && RowObject && (*RowObject)->TryGetArrayField(TEXT("errors"), Errors) && Errors)
|
|
383
|
+
{
|
|
384
|
+
BindingErrors += Errors->Num();
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
Result->SetArrayField(TEXT("bindings"), *Rows);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
Result->SetNumberField(TEXT("bindingErrorCount"), BindingErrors);
|
|
391
|
+
|
|
392
|
+
Result->SetBoolField(TEXT("changed"), !bWasUpToDate);
|
|
393
|
+
MCPSetNoRollback(Result, TEXT("A compile regenerates the widget blueprint's class from its current graphs and view. The previous class is not kept, so no call restores it; the authored data the compile read is unchanged."));
|
|
394
|
+
MCPSetWidgetCompileOutcome(Result, WidgetBP, AssetPath, Report, TEXT("compile_widget_viewmodels"));
|
|
395
|
+
return MCPResult(Result);
|
|
396
|
+
}
|
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Widget/WidgetHandlers_MVVM.h
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "CoreMinimal.h"
|
|
4
|
+
#include "Dom/JsonObject.h"
|
|
5
|
+
#include "Dom/JsonValue.h"
|
|
6
|
+
|
|
7
|
+
class FMCPHandlerRegistry;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Viewmodel (UMG MVVM) authoring on Widget Blueprints: the viewmodels a widget
|
|
11
|
+
* blueprint declares, the bindings between their fields and the widgets, and a
|
|
12
|
+
* compile that reports each binding's errors. The MVVM work is done by the
|
|
13
|
+
* UE_MCP_BridgeMVVM module through Public/HandlerMVVMBackend.h, because the
|
|
14
|
+
* plugin it needs may be disabled; these handlers own the specs, the parameter
|
|
15
|
+
* reads, the asset resolution and the response.
|
|
16
|
+
*
|
|
17
|
+
* Registered by FWidgetHandlers::RegisterHandlers, under the widget category.
|
|
18
|
+
*/
|
|
19
|
+
class FWidgetMVVMHandlers
|
|
20
|
+
{
|
|
21
|
+
public:
|
|
22
|
+
static void RegisterHandlers(FMCPHandlerRegistry& Registry);
|
|
23
|
+
|
|
24
|
+
static TSharedPtr<FJsonValue> ListViewModels(const TSharedPtr<FJsonObject>& Params);
|
|
25
|
+
static TSharedPtr<FJsonValue> AddViewModel(const TSharedPtr<FJsonObject>& Params);
|
|
26
|
+
static TSharedPtr<FJsonValue> RemoveViewModel(const TSharedPtr<FJsonObject>& Params);
|
|
27
|
+
static TSharedPtr<FJsonValue> ListViewModelBindings(const TSharedPtr<FJsonObject>& Params);
|
|
28
|
+
static TSharedPtr<FJsonValue> AddViewModelBinding(const TSharedPtr<FJsonObject>& Params);
|
|
29
|
+
static TSharedPtr<FJsonValue> UpdateViewModelBinding(const TSharedPtr<FJsonObject>& Params);
|
|
30
|
+
static TSharedPtr<FJsonValue> RemoveViewModelBinding(const TSharedPtr<FJsonObject>& Params);
|
|
31
|
+
static TSharedPtr<FJsonValue> CompileViewModels(const TSharedPtr<FJsonObject>& Params);
|
|
32
|
+
};
|
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/DialogBlockingWindowTests.cpp
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#include "Misc/AutomationTest.h"
|
|
19
19
|
#include "Misc/ScopeExit.h"
|
|
20
20
|
#include "Widgets/Docking/SDockTab.h"
|
|
21
|
+
#include "Widgets/Layout/SBorder.h"
|
|
21
22
|
#include "Widgets/Input/SButton.h"
|
|
22
23
|
#include "Widgets/SWindow.h"
|
|
23
24
|
#include "Widgets/Text/STextBlock.h"
|
|
@@ -130,6 +131,79 @@ bool FMCPDialogBlockingWindowTest::RunTest(const FString& Parameters)
|
|
|
130
131
|
return true;
|
|
131
132
|
}
|
|
132
133
|
|
|
134
|
+
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
|
|
135
|
+
FMCPDialogProgressWindowTest,
|
|
136
|
+
"UE.MCP.Dialog.Gate.AProgressWindowIsNotAPrompt",
|
|
137
|
+
EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter)
|
|
138
|
+
|
|
139
|
+
bool FMCPDialogProgressWindowTest::RunTest(const FString& Parameters)
|
|
140
|
+
{
|
|
141
|
+
if (!FSlateApplication::IsInitialized())
|
|
142
|
+
{
|
|
143
|
+
AddInfo(TEXT("Slate is not initialized in this run, so there are no windows to classify."));
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// #1851: a save opens a "Validating Assets" progress window, and calls
|
|
148
|
+
// that landed while it was up were refused as if a dialog were blocking.
|
|
149
|
+
// The editor pushes that window with AddModalWindow's bSlowTaskWindow,
|
|
150
|
+
// which sets the modal flag and skips the modal loop. The widget it hosts
|
|
151
|
+
// is private to UnrealEd, so the stand-in is an SBorder (its base class)
|
|
152
|
+
// recorded under the private class's name, which is all the walk reads.
|
|
153
|
+
// The Cancel button is real: the validation task shows one, and it is what
|
|
154
|
+
// made the window look like a prompt with a button to press.
|
|
155
|
+
const auto MakeProgressWindow = [](const ANSICHAR* WidgetTypeName)
|
|
156
|
+
{
|
|
157
|
+
const TSharedRef<SWidget> Content =
|
|
158
|
+
MakeTDecl<SBorder>(WidgetTypeName, __FILE__, __LINE__, RequiredArgs::MakeRequiredArgs())
|
|
159
|
+
<<= SBorder::FArguments()
|
|
160
|
+
[
|
|
161
|
+
SNew(SButton)[SNew(STextBlock).Text(FText::FromString(TEXT("Cancel")))]
|
|
162
|
+
];
|
|
163
|
+
const TSharedRef<SWindow> Window = MakeOffscreenWindow(Content, TEXT(""));
|
|
164
|
+
Window->SetAsModalWindow();
|
|
165
|
+
return Window;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
for (const ANSICHAR* TypeName : { "SSlowTaskWidget", "SBuildProgressWidget" })
|
|
169
|
+
{
|
|
170
|
+
const TSharedRef<SWindow> Window = MakeProgressWindow(TypeName);
|
|
171
|
+
const FString TypeLabel(ANSI_TO_TCHAR(TypeName));
|
|
172
|
+
FString Reason;
|
|
173
|
+
TestTrue(FString::Printf(TEXT("%s: recognised as a progress window"), *TypeLabel),
|
|
174
|
+
FDialogHandlers::IsProgressWindow(Window, &Reason));
|
|
175
|
+
TestTrue(FString::Printf(TEXT("%s: the reason says the game thread keeps running"), *TypeLabel),
|
|
176
|
+
Reason.Contains(TEXT("game thread keeps running")));
|
|
177
|
+
TestEqual(FString::Printf(TEXT("%s: on the modal stack and still not a prompt"), *TypeLabel),
|
|
178
|
+
(int32)FDialogHandlers::ClassifyWindow(Window), (int32)EMCPPromptKind::NotAPrompt);
|
|
179
|
+
TestFalse(FString::Printf(TEXT("%s: not a blocking window either"), *TypeLabel),
|
|
180
|
+
FDialogHandlers::IsBlockingWindow(Window));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// The gap between FinalizeSlowTask emptying the window and Slate
|
|
184
|
+
// destroying it on the next tick.
|
|
185
|
+
{
|
|
186
|
+
const TSharedRef<SWindow> Window = MakeOffscreenWindow(SNullWidget::NullWidget, TEXT(""));
|
|
187
|
+
Window->SetAsModalWindow();
|
|
188
|
+
TestEqual(TEXT("an emptied modal on its way out is not a prompt"),
|
|
189
|
+
(int32)FDialogHandlers::ClassifyWindow(Window), (int32)EMCPPromptKind::NotAPrompt);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// The same button in an ordinary modal is still a question the game
|
|
193
|
+
// thread is parked behind. Losing this would let a real prompt through.
|
|
194
|
+
{
|
|
195
|
+
const TSharedRef<SWindow> Window = MakeOffscreenWindow(
|
|
196
|
+
SNew(SBorder)[SNew(SButton)[SNew(STextBlock).Text(FText::FromString(TEXT("Cancel")))]],
|
|
197
|
+
TEXT("Delete Assets"));
|
|
198
|
+
Window->SetAsModalWindow();
|
|
199
|
+
TestFalse(TEXT("an ordinary modal is not a progress window"), FDialogHandlers::IsProgressWindow(Window));
|
|
200
|
+
TestEqual(TEXT("and is still classified as modal"),
|
|
201
|
+
(int32)FDialogHandlers::ClassifyWindow(Window), (int32)EMCPPromptKind::Modal);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
|
|
133
207
|
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
|
|
134
208
|
FMCPDialogGateBlocksOnlyForModalTest,
|
|
135
209
|
"UE.MCP.Dialog.Gate.OnlyAModalParksTheGameThread",
|
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/HandlerSpecContractTests.cpp
CHANGED
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
#include "Handlers/Dialog/DialogHandlers.h"
|
|
41
41
|
#include "Handlers/Editor/EditorHandlers.h"
|
|
42
42
|
#include "Handlers/Sequencer/SequencerHandlers.h"
|
|
43
|
+
#include "Handlers/Sequencer/MovieRenderQueueHandlers.h"
|
|
44
|
+
#include "Handlers/MachineLearning/MachineLearningHandlers.h"
|
|
43
45
|
#include "Handlers/PCG/PCGHandlers.h"
|
|
44
46
|
#include "Handlers/Niagara/NiagaraHandlers.h"
|
|
45
47
|
#include "Handlers/Material/MaterialHandlers.h"
|
|
@@ -210,6 +212,8 @@ bool FMCPHandlerSpecContractTest::RunTest(const FString& Parameters)
|
|
|
210
212
|
FMassHandlers::RegisterHandlers(Registry);
|
|
211
213
|
FEditorHandlers::RegisterHandlers(Registry);
|
|
212
214
|
FSequencerHandlers::RegisterHandlers(Registry);
|
|
215
|
+
FMovieRenderQueueHandlers::RegisterHandlers(Registry);
|
|
216
|
+
FMachineLearningHandlers::RegisterHandlers(Registry);
|
|
213
217
|
FDialogHandlers::RegisterHandlers(Registry);
|
|
214
218
|
FPCGHandlers::RegisterHandlers(Registry);
|
|
215
219
|
FNiagaraHandlers::RegisterHandlers(Registry);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "CoreMinimal.h"
|
|
4
|
+
#include "Dom/JsonValue.h"
|
|
5
|
+
#include "HAL/CriticalSection.h"
|
|
6
|
+
#include "Templates/Function.h"
|
|
7
|
+
|
|
8
|
+
class FEvent;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An answer a handler gives after it has returned. The handler defers on the
|
|
12
|
+
* game thread with MCPDeferRequest(), returns MCPDeferredMarker(), and calls
|
|
13
|
+
* Complete from any thread. The connection thread waits for it, forwards
|
|
14
|
+
* progress to the client, and runs the cancel hook when the client cancels or
|
|
15
|
+
* stops waiting first.
|
|
16
|
+
*/
|
|
17
|
+
class UE_MCP_BRIDGE_API FMCPDeferredCall : public TSharedFromThis<FMCPDeferredCall, ESPMode::ThreadSafe>
|
|
18
|
+
{
|
|
19
|
+
public:
|
|
20
|
+
FMCPDeferredCall();
|
|
21
|
+
~FMCPDeferredCall();
|
|
22
|
+
|
|
23
|
+
/** The answer. The first one wins; any later one, or one after a cancel, is dropped. Any thread. */
|
|
24
|
+
void Complete(const TSharedPtr<FJsonValue>& Result);
|
|
25
|
+
|
|
26
|
+
/** Progress for the client. Total <= 0 means unknown. Any thread. */
|
|
27
|
+
void ReportProgress(double Progress, double Total, const FString& Message);
|
|
28
|
+
|
|
29
|
+
/** Run on the game thread, once, if the call is cancelled before it completes; at once when it already was. */
|
|
30
|
+
void OnCancel(TFunction<void(const FString& Reason)> Hook);
|
|
31
|
+
|
|
32
|
+
/** Stop waiting and schedule the cancel hook on the game thread. No effect once complete. Any thread. */
|
|
33
|
+
void Cancel(const FString& Reason);
|
|
34
|
+
|
|
35
|
+
bool IsCancelled() const;
|
|
36
|
+
bool IsComplete() const;
|
|
37
|
+
|
|
38
|
+
/** What a cancel does and does not reach, for the cancelled answer. Any thread. */
|
|
39
|
+
void SetCancelNote(const FString& Note);
|
|
40
|
+
FString GetCancelNote() const;
|
|
41
|
+
|
|
42
|
+
/** Connection thread: true once Complete or Cancel ran, waiting at most Ms. */
|
|
43
|
+
bool Wait(uint32 Ms);
|
|
44
|
+
TSharedPtr<FJsonValue> GetResult() const;
|
|
45
|
+
|
|
46
|
+
/** The progress reported since the last take, if any. */
|
|
47
|
+
bool TakeProgress(double& OutProgress, double& OutTotal, FString& OutMessage);
|
|
48
|
+
|
|
49
|
+
private:
|
|
50
|
+
mutable FCriticalSection Lock;
|
|
51
|
+
FEvent* DoneEvent = nullptr;
|
|
52
|
+
TSharedPtr<FJsonValue> Result;
|
|
53
|
+
bool bComplete = false;
|
|
54
|
+
bool bCancelled = false;
|
|
55
|
+
TFunction<void(const FString&)> CancelHook;
|
|
56
|
+
double Progress = 0.0;
|
|
57
|
+
double Total = 0.0;
|
|
58
|
+
FString ProgressMessage;
|
|
59
|
+
bool bProgressPending = false;
|
|
60
|
+
FString CancelNote;
|
|
61
|
+
FString CancelReason;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
using FMCPDeferredCallRef = TSharedRef<FMCPDeferredCall, ESPMode::ThreadSafe>;
|
|
65
|
+
using FMCPDeferredCallPtr = TSharedPtr<FMCPDeferredCall, ESPMode::ThreadSafe>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Game thread, inside a handler: defer the answer to the bridge request being
|
|
69
|
+
* served. Null when the handler was called in-process rather than for a bridge
|
|
70
|
+
* request, and then it has to answer now.
|
|
71
|
+
*/
|
|
72
|
+
UE_MCP_BRIDGE_API FMCPDeferredCallPtr MCPDeferRequest();
|
|
73
|
+
|
|
74
|
+
/** What a handler returns after MCPDeferRequest. */
|
|
75
|
+
UE_MCP_BRIDGE_API TSharedPtr<FJsonValue> MCPDeferredMarker();
|
|
76
|
+
UE_MCP_BRIDGE_API bool MCPIsDeferredMarker(const TSharedPtr<FJsonValue>& Value);
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
// it must not depend on this one).
|
|
41
41
|
#define UE_MCP_HAS_5_8_API ((ENGINE_MAJOR_VERSION > 5) || (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 8))
|
|
42
42
|
|
|
43
|
+
// True on UE 5.9+. Gates the Unreal MCP plugin's out-of-line
|
|
44
|
+
// FModelContextProtocolToolRequestId constructors (inline before 5.9).
|
|
45
|
+
#define UE_MCP_HAS_5_9_API ((ENGINE_MAJOR_VERSION > 5) || (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 9))
|
|
46
|
+
|
|
43
47
|
// ── Engine API shims ─────────────────────────────────────────────────────────
|
|
44
48
|
//
|
|
45
49
|
// Where an engine API was renamed or wrapped between 5.4 and 5.8, the shim goes
|