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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#include "HandlerRegistry.h"
|
|
3
3
|
#include "HandlerUtils.h"
|
|
4
4
|
#include "HandlerAssetDelete.h"
|
|
5
|
+
#include "HandlerLevelSwitch.h"
|
|
5
6
|
|
|
6
7
|
#include "Handlers/VolumeHelpers_Internal.h"
|
|
7
8
|
|
|
@@ -126,16 +127,77 @@ void FDemoHandlers::RegisterHandlers(FMCPHandlerRegistry& Registry)
|
|
|
126
127
|
Registry.RegisterHandler(TEXT("demo_get_steps"), &DemoGetSteps, {});
|
|
127
128
|
Registry.RegisterHandler(TEXT("demo_cleanup"), &DemoCleanup, TArray<FMCPParamSpec>(),
|
|
128
129
|
MCPSpec::ContractExempt(TEXT("Takes no parameters and acts unconditionally: switches levels and deletes the demo scene")));
|
|
129
|
-
Registry.RegisterHandler(TEXT("demo_go_home"), &DemoGoHome,
|
|
130
|
-
|
|
130
|
+
Registry.RegisterHandler(TEXT("demo_go_home"), &DemoGoHome, {
|
|
131
|
+
MCPParam::Optional(TEXT("discardUnsaved"), EType::Boolean, TEXT("Switch even though the open map has unsaved changes, discarding them (default false)")),
|
|
132
|
+
}, MCPSpec::ContractExempt(TEXT("Creates the home level if missing and opens it before the contract path can fail")));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
namespace DemoHome
|
|
136
|
+
{
|
|
137
|
+
/** A package the demo owns: under /Game/Demo, or one of its level's external packages. */
|
|
138
|
+
static bool IsDemoPackage(const FString& PackageName)
|
|
139
|
+
{
|
|
140
|
+
return PackageName.StartsWith(DemoConstants::MAT_DIR + TEXT("/"))
|
|
141
|
+
|| PackageName.StartsWith(TEXT("/Game/__ExternalActors__/Demo/"))
|
|
142
|
+
|| PackageName.StartsWith(TEXT("/Game/__ExternalObjects__/Demo/"));
|
|
143
|
+
}
|
|
131
144
|
}
|
|
132
145
|
|
|
133
146
|
// Ensures /Game/MCP_Home exists on disk and loads it. Idempotent.
|
|
134
|
-
|
|
147
|
+
//
|
|
148
|
+
// #1851: the engine's LoadLevel refuses on unsaved changes from UE 5.9 and
|
|
149
|
+
// its answer used to be ignored, so a dirty never-saved startup map was
|
|
150
|
+
// reported as home while the editor stayed on it. Unsaved changes are now
|
|
151
|
+
// answered for first, by Discard, and the open map is checked afterwards.
|
|
152
|
+
bool FDemoHandlers::EnsureHomeLevelLoaded(FString& OutError, EMCPHomeDiscard Discard, TArray<FString>* OutDirty, TArray<FString>* OutDiscarded)
|
|
135
153
|
{
|
|
136
154
|
ULevelEditorSubsystem* LevelSub = GEditor ? GEditor->GetEditorSubsystem<ULevelEditorSubsystem>() : nullptr;
|
|
137
155
|
if (!LevelSub) { OutError = TEXT("LevelEditorSubsystem not available"); return false; }
|
|
138
156
|
|
|
157
|
+
// Already standing in it: reloading would only throw away its own unsaved edits.
|
|
158
|
+
if (MCPLevelSwitch::OpenMapPackageName() == DemoConstants::HOME_LEVEL)
|
|
159
|
+
{
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const TArray<UPackage*> Dirty = MCPLevelSwitch::CollectDirtyPackages(GetEditorWorld());
|
|
164
|
+
const TArray<FString> DirtyNames = MCPLevelSwitch::PackageNames(Dirty);
|
|
165
|
+
if (DirtyNames.Num() > 0)
|
|
166
|
+
{
|
|
167
|
+
TArray<FString> NotDiscardable;
|
|
168
|
+
if (Discard == EMCPHomeDiscard::Refuse)
|
|
169
|
+
{
|
|
170
|
+
NotDiscardable = DirtyNames;
|
|
171
|
+
}
|
|
172
|
+
else if (Discard == EMCPHomeDiscard::DemoPackagesOnly)
|
|
173
|
+
{
|
|
174
|
+
NotDiscardable = DirtyNames.FilterByPredicate([](const FString& Name) { return !DemoHome::IsDemoPackage(Name); });
|
|
175
|
+
}
|
|
176
|
+
if (NotDiscardable.Num() > 0)
|
|
177
|
+
{
|
|
178
|
+
if (OutDirty) *OutDirty = DirtyNames;
|
|
179
|
+
const bool bUnsavedMap = NotDiscardable.ContainsByPredicate([](const FString& Name) { return MCPLevelSwitch::IsUnsavedMapPackage(Name); });
|
|
180
|
+
OutError = FString::Printf(
|
|
181
|
+
TEXT("The open map has %d unsaved package(s) that switching to %s would discard (%s), so the editor was left where it is. ")
|
|
182
|
+
TEXT("Pass discardUnsaved=true to drop them, or save them first%s."),
|
|
183
|
+
NotDiscardable.Num(), *DemoConstants::HOME_LEVEL, *FString::Join(NotDiscardable, TEXT(", ")),
|
|
184
|
+
bUnsavedMap
|
|
185
|
+
? TEXT("; a never-saved map has no file to save to, so for it discarding is the only way off")
|
|
186
|
+
: TEXT(" with level(save) or editor(save_dirty)"));
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const TArray<FString> StillDirty = MCPLevelSwitch::DiscardChanges(Dirty);
|
|
190
|
+
if (StillDirty.Num() > 0)
|
|
191
|
+
{
|
|
192
|
+
if (OutDirty) *OutDirty = StillDirty;
|
|
193
|
+
OutError = FString::Printf(
|
|
194
|
+
TEXT("Could not discard %d unsaved package(s): each was dirty again as soon as its flag was cleared (%s). The editor was left where it is."),
|
|
195
|
+
StillDirty.Num(), *FString::Join(StillDirty, TEXT(", ")));
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
if (OutDiscarded) *OutDiscarded = DirtyNames;
|
|
199
|
+
}
|
|
200
|
+
|
|
139
201
|
if (!UEditorAssetLibrary::DoesAssetExist(DemoConstants::HOME_LEVEL))
|
|
140
202
|
{
|
|
141
203
|
// Create + save a blank level on disk so subsequent loads have a
|
|
@@ -151,9 +213,19 @@ bool FDemoHandlers::EnsureHomeLevelLoaded(FString& OutError)
|
|
|
151
213
|
return false;
|
|
152
214
|
}
|
|
153
215
|
}
|
|
154
|
-
else
|
|
216
|
+
else if (!MCPLevelSwitch::LoadLevel(*LevelSub, DemoConstants::HOME_LEVEL, /*bDiscardUnsaved*/ DirtyNames.Num() > 0))
|
|
155
217
|
{
|
|
156
|
-
|
|
218
|
+
OutError = FString::Printf(TEXT("The engine refused to load %s; the output log carries its reason."), *DemoConstants::HOME_LEVEL);
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// The open world is the proof, not the subsystem's answer.
|
|
223
|
+
const FString OpenMap = MCPLevelSwitch::OpenMapPackageName();
|
|
224
|
+
if (OpenMap != DemoConstants::HOME_LEVEL)
|
|
225
|
+
{
|
|
226
|
+
OutError = FString::Printf(TEXT("The editor reported %s loaded, but the open map is '%s'. Check the output log."),
|
|
227
|
+
*DemoConstants::HOME_LEVEL, *OpenMap);
|
|
228
|
+
return false;
|
|
157
229
|
}
|
|
158
230
|
return true;
|
|
159
231
|
}
|
|
@@ -180,13 +252,22 @@ TSharedPtr<FJsonValue> FDemoHandlers::DemoGoHome(const TSharedPtr<FJsonObject>&
|
|
|
180
252
|
}
|
|
181
253
|
}
|
|
182
254
|
|
|
255
|
+
const bool bDiscardUnsaved = OptionalBool(Params, TEXT("discardUnsaved"), false);
|
|
183
256
|
FString Err;
|
|
184
|
-
|
|
257
|
+
TArray<FString> Dirty;
|
|
258
|
+
TArray<FString> Discarded;
|
|
259
|
+
if (!EnsureHomeLevelLoaded(Err, bDiscardUnsaved ? EMCPHomeDiscard::Everything : EMCPHomeDiscard::Refuse, &Dirty, &Discarded))
|
|
185
260
|
{
|
|
186
|
-
|
|
261
|
+
TSharedPtr<FJsonObject> Refusal = MCPErrorObject(Err);
|
|
262
|
+
if (Dirty.Num() > 0) Refusal->SetArrayField(TEXT("dirtyPackages"), MCPStringListToJson(Dirty));
|
|
263
|
+
Refusal->SetStringField(TEXT("openMap"), MCPLevelSwitch::OpenMapPackageName());
|
|
264
|
+
if (Discarded.Num() > 0) Refusal->SetArrayField(TEXT("discardedPackages"), MCPStringListToJson(Discarded));
|
|
265
|
+
return MCPResult(Refusal);
|
|
187
266
|
}
|
|
188
267
|
auto Result = MCPSuccess();
|
|
189
268
|
Result->SetStringField(TEXT("levelPath"), DemoConstants::HOME_LEVEL);
|
|
269
|
+
// Said whichever way it went, so a caller never has to infer that unsaved work was dropped.
|
|
270
|
+
Result->SetArrayField(TEXT("discardedPackages"), MCPStringListToJson(Discarded));
|
|
190
271
|
Result->SetStringField(TEXT("previousLevelPath"), PreviousLevelPath);
|
|
191
272
|
Result->SetBoolField(TEXT("homeLevelCreated"), !bHomeExisted);
|
|
192
273
|
// Idempotency: already standing in the home level means this opened nothing.
|
|
@@ -201,13 +282,23 @@ TSharedPtr<FJsonValue> FDemoHandlers::DemoGoHome(const TSharedPtr<FJsonObject>&
|
|
|
201
282
|
TSharedPtr<FJsonObject> Payload = MakeShared<FJsonObject>();
|
|
202
283
|
Payload->SetStringField(TEXT("levelPath"), PreviousLevelPath);
|
|
203
284
|
MCPSetRollback(Result, TEXT("load_level"), Payload);
|
|
204
|
-
Result->SetBoolField(TEXT("rollbackLossy"), !bHomeExisted);
|
|
285
|
+
Result->SetBoolField(TEXT("rollbackLossy"), !bHomeExisted || Discarded.Num() > 0);
|
|
286
|
+
FString LossNote;
|
|
205
287
|
if (!bHomeExisted)
|
|
206
288
|
{
|
|
207
|
-
|
|
289
|
+
LossNote = FString::Printf(
|
|
208
290
|
TEXT("The previous level is reopened, but '%s' was created on disk by this call and stays there. "
|
|
209
291
|
"Delete it with asset(delete) as well if the rollback has to leave no trace."),
|
|
210
|
-
*DemoConstants::HOME_LEVEL)
|
|
292
|
+
*DemoConstants::HOME_LEVEL);
|
|
293
|
+
}
|
|
294
|
+
if (Discarded.Num() > 0)
|
|
295
|
+
{
|
|
296
|
+
if (!LossNote.IsEmpty()) LossNote += TEXT(" ");
|
|
297
|
+
LossNote += TEXT("The previous level is reopened from disk; the unsaved changes discarded by this call do not come back.");
|
|
298
|
+
}
|
|
299
|
+
if (!LossNote.IsEmpty())
|
|
300
|
+
{
|
|
301
|
+
Result->SetStringField(TEXT("rollbackNote"), LossNote);
|
|
211
302
|
}
|
|
212
303
|
}
|
|
213
304
|
else
|
|
@@ -394,7 +485,9 @@ TSharedPtr<FJsonValue> FDemoHandlers::DemoCleanup(const TSharedPtr<FJsonObject>&
|
|
|
394
485
|
// Untitled-map trap described above, so a failed anchor stops the cleanup.
|
|
395
486
|
{
|
|
396
487
|
FString HomeErr;
|
|
397
|
-
|
|
488
|
+
// The demo level is deleted below, so its unsaved changes are the
|
|
489
|
+
// cleanup's to drop. Anybody else's are not.
|
|
490
|
+
if (!EnsureHomeLevelLoaded(HomeErr, EMCPHomeDiscard::DemoPackagesOnly))
|
|
398
491
|
{
|
|
399
492
|
return MCPError(FString::Printf(
|
|
400
493
|
TEXT("Cleanup stopped before deleting anything: the editor could not be moved to %s (%s)."),
|
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
class FMCPHandlerRegistry;
|
|
8
8
|
|
|
9
|
+
/** What EnsureHomeLevelLoaded may do with unsaved changes in the open map (#1851). */
|
|
10
|
+
enum class EMCPHomeDiscard : uint8
|
|
11
|
+
{
|
|
12
|
+
/** Refuse, naming the dirty packages. */
|
|
13
|
+
Refuse,
|
|
14
|
+
/** Discard the demo's own packages, which cleanup deletes anyway; refuse on any other. */
|
|
15
|
+
DemoPackagesOnly,
|
|
16
|
+
/** Discard every dirty package the switch would lose. */
|
|
17
|
+
Everything,
|
|
18
|
+
};
|
|
19
|
+
|
|
9
20
|
/**
|
|
10
21
|
* Demo scene builder handlers - Neon Shrine demo.
|
|
11
22
|
* Ports the Python demo.py scene builder to C++ for the UE MCP Bridge.
|
|
@@ -30,7 +41,14 @@ private:
|
|
|
30
41
|
// Ensures /Game/MCP_Home exists on disk and loads it. Used by cleanup +
|
|
31
42
|
// go_home to keep the editor anchored to a saved level instead of an
|
|
32
43
|
// auto-generated Untitled (which traps the editor in a save dialog).
|
|
33
|
-
|
|
44
|
+
// True only when the home level is the open map afterwards. On a refusal
|
|
45
|
+
// for unsaved changes OutDirty names them; OutDiscarded names what a
|
|
46
|
+
// discard dropped.
|
|
47
|
+
static bool EnsureHomeLevelLoaded(
|
|
48
|
+
FString& OutError,
|
|
49
|
+
EMCPHomeDiscard Discard = EMCPHomeDiscard::Refuse,
|
|
50
|
+
TArray<FString>* OutDirty = nullptr,
|
|
51
|
+
TArray<FString>* OutDiscarded = nullptr);
|
|
34
52
|
|
|
35
53
|
// ---- Individual step implementations (19 steps) ----
|
|
36
54
|
static TSharedPtr<FJsonObject> StepCreateLevel();
|
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Dialog/DialogHandlers.cpp
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
#include "Framework/Application/SlateApplication.h"
|
|
46
46
|
#include "Framework/Docking/TabManager.h"
|
|
47
47
|
#include "Widgets/SWindow.h"
|
|
48
|
+
#include "Widgets/SNullWidget.h"
|
|
48
49
|
#include "Widgets/IToolTip.h"
|
|
49
50
|
#include "Widgets/SToolTip.h"
|
|
50
51
|
#include "Widgets/Text/STextBlock.h"
|
|
@@ -1044,9 +1045,20 @@ namespace MCPDialogWindows
|
|
|
1044
1045
|
}
|
|
1045
1046
|
FSlateApplication& Slate = FSlateApplication::Get();
|
|
1046
1047
|
TArray<FFoundWindow> Found;
|
|
1048
|
+
// A progress window is on the modal stack too, pushed by the editor's
|
|
1049
|
+
// slow-task feedback without the modal loop, so the stack alone does not
|
|
1050
|
+
// say the game thread is parked (#1851).
|
|
1047
1051
|
if (TSharedPtr<SWindow> Modal = Slate.GetActiveModalWindow())
|
|
1048
1052
|
{
|
|
1049
|
-
|
|
1053
|
+
FString ProgressReason;
|
|
1054
|
+
if (!FDialogHandlers::IsProgressWindow(Modal.ToSharedRef(), &ProgressReason))
|
|
1055
|
+
{
|
|
1056
|
+
Found.Add({ Modal, EMCPPromptKind::Modal });
|
|
1057
|
+
}
|
|
1058
|
+
else if (OutSkipped)
|
|
1059
|
+
{
|
|
1060
|
+
OutSkipped->Add({ Modal->GetTitle().ToString(), ProgressReason });
|
|
1061
|
+
}
|
|
1050
1062
|
}
|
|
1051
1063
|
Gather(Slate.GetInteractiveTopLevelWindows(), Found, OutSkipped);
|
|
1052
1064
|
if (Found.Num() == 0)
|
|
@@ -1477,13 +1489,53 @@ const TCHAR* FDialogHandlers::PromptKindName(EMCPPromptKind Kind)
|
|
|
1477
1489
|
}
|
|
1478
1490
|
}
|
|
1479
1491
|
|
|
1492
|
+
bool FDialogHandlers::IsProgressWindow(const TSharedRef<SWindow>& Window, FString* OutReason)
|
|
1493
|
+
{
|
|
1494
|
+
// The editor's feedback context builds both of its progress windows with
|
|
1495
|
+
// the widget as the window's whole content (FeedbackContextEditor.cpp,
|
|
1496
|
+
// StartSlowTask and ShowBuildProgressWindow), and pushes both with
|
|
1497
|
+
// AddModalWindow(..., bSlowTaskWindow=true). The widget classes are private
|
|
1498
|
+
// to UnrealEd, so they are matched by the type name SNew records.
|
|
1499
|
+
static const FName SlowTaskWidgetType(TEXT("SSlowTaskWidget"));
|
|
1500
|
+
static const FName BuildProgressWidgetType(TEXT("SBuildProgressWidget"));
|
|
1501
|
+
const TSharedRef<SWidget> Content = Window->GetContent();
|
|
1502
|
+
const FName ContentType = Content->GetType();
|
|
1503
|
+
if (ContentType == SlowTaskWidgetType || ContentType == BuildProgressWidgetType)
|
|
1504
|
+
{
|
|
1505
|
+
if (OutReason)
|
|
1506
|
+
{
|
|
1507
|
+
*OutReason = TEXT("reports the progress of a slow task; the game thread keeps running the task behind it, so it holds nothing and asks nothing");
|
|
1508
|
+
}
|
|
1509
|
+
return true;
|
|
1510
|
+
}
|
|
1511
|
+
// FinalizeSlowTask empties the window before it asks for it to be
|
|
1512
|
+
// destroyed, and destruction waits for the next Slate tick. A modal with
|
|
1513
|
+
// no content in that gap is the progress window going away, not a prompt.
|
|
1514
|
+
if (Window->IsModalWindow() && Content == SNullWidget::NullWidget)
|
|
1515
|
+
{
|
|
1516
|
+
if (OutReason)
|
|
1517
|
+
{
|
|
1518
|
+
*OutReason = TEXT("has no content and is being closed; it holds nothing and asks nothing");
|
|
1519
|
+
}
|
|
1520
|
+
return true;
|
|
1521
|
+
}
|
|
1522
|
+
return false;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1480
1525
|
EMCPPromptKind FDialogHandlers::ClassifyWindow(const TSharedRef<SWindow>& Window, FString* OutSkipReason)
|
|
1481
1526
|
{
|
|
1482
1527
|
if (OutSkipReason) OutSkipReason->Reset();
|
|
1483
1528
|
|
|
1484
1529
|
if (!Window->IsRegularWindow()) return EMCPPromptKind::NotAPrompt;
|
|
1530
|
+
// Before the modal test: a slow-task progress window is pushed with
|
|
1531
|
+
// AddModalWindow's bSlowTaskWindow, which skips the modal loop, so it sets
|
|
1532
|
+
// bIsModalWindow while the game thread keeps running the work it reports.
|
|
1533
|
+
// Its one button is the task's Cancel, and pressing that because a call
|
|
1534
|
+
// arrived would abort the save or validation behind it (#1851).
|
|
1535
|
+
if (IsProgressWindow(Window, OutSkipReason)) return EMCPPromptKind::NotAPrompt;
|
|
1485
1536
|
// bIsModalWindow is set by FSlateApplication::AddModalWindow and nothing
|
|
1486
|
-
// else, so
|
|
1537
|
+
// else, so apart from the progress windows above this is the one case in
|
|
1538
|
+
// which the game thread is parked.
|
|
1487
1539
|
if (Window->IsModalWindow()) return EMCPPromptKind::Modal;
|
|
1488
1540
|
// Unparented and not modal: a top-level window of its own.
|
|
1489
1541
|
if (!Window->GetParentWindow().IsValid()) return EMCPPromptKind::NotAPrompt;
|
|
@@ -120,6 +120,15 @@ public:
|
|
|
120
120
|
* candidate. */
|
|
121
121
|
static EMCPPromptKind ClassifyWindow(const TSharedRef<class SWindow>& Window, FString* OutSkipReason = nullptr);
|
|
122
122
|
|
|
123
|
+
/** Is this one of the editor's own progress windows (a slow task's, a
|
|
124
|
+
* build's), or a modal already emptied for closing? (#1851)
|
|
125
|
+
*
|
|
126
|
+
* Those sit on Slate's modal stack without the modal loop: the game thread
|
|
127
|
+
* keeps running the work they report, so they are neither a prompt nor a
|
|
128
|
+
* reason to refuse a call. OutReason carries the sentence list_dialogs
|
|
129
|
+
* reports under notTreatedAsDialogs. */
|
|
130
|
+
static bool IsProgressWindow(const TSharedRef<class SWindow>& Window, FString* OutReason = nullptr);
|
|
131
|
+
|
|
123
132
|
/** Is the editor waiting on an answer from this window? (#1078)
|
|
124
133
|
*
|
|
125
134
|
* True for either prompt kind. Whether the game thread is PARKED behind
|
package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/Editor/EditorHandlers.cpp
CHANGED
|
@@ -440,6 +440,9 @@ void FEditorHandlers::RegisterHandlers(FMCPHandlerRegistry& Registry)
|
|
|
440
440
|
MCPParam::Optional(TEXT("maxLines"), EType::Integer, TEXT("Messages to return (default 200)")),
|
|
441
441
|
MCPParam::Optional(TEXT("severity"), EType::String, TEXT("Severity-name substring: Error | Warning | PerformanceWarning | Info")),
|
|
442
442
|
});
|
|
443
|
+
// #1828: Map Check runs and UMapCheckSubsystem logging, and Python's additional sys.path entries.
|
|
444
|
+
RegisterMapCheckHandlers(Registry);
|
|
445
|
+
RegisterPythonPathHandlers(Registry);
|
|
443
446
|
Registry.RegisterHandler(TEXT("get_build_status"), &GetBuildStatus, NoParams);
|
|
444
447
|
Registry.RegisterHandler(TEXT("pie_control"), &PieControl, {
|
|
445
448
|
MCPParam::Optional(TEXT("pieAction"), EType::String, TEXT("start | stop | status (default status)")),
|
|
@@ -572,6 +575,34 @@ void FEditorHandlers::RegisterHandlers(FMCPHandlerRegistry& Registry)
|
|
|
572
575
|
Registry.RegisterHandler(TEXT("get_standalone_status"), &GetStandaloneStatus, NoParams);
|
|
573
576
|
Registry.RegisterHandler(TEXT("stop_standalone_game"), &StopStandaloneGame, NoParams,
|
|
574
577
|
MCPSpec::ContractExempt(TEXT("terminates the standalone game process")));
|
|
578
|
+
// Analysis runs on worker threads behind a deferred answer, and a long
|
|
579
|
+
// trace takes minutes, so the wait is far past the default budget.
|
|
580
|
+
// Mirrored in src/bridge/bridge-timeouts.ts.
|
|
581
|
+
Registry.RegisterHandlerWithTimeout(TEXT("analyze_insights_trace"), &AnalyzeInsightsTrace, 600.0f, {
|
|
582
|
+
MCPParam::Optional(TEXT("file"), EType::String, TEXT(".utrace to analyse, absolute or relative to Saved/Profiling (default the newest .utrace there)")),
|
|
583
|
+
MCPParam::Optional(TEXT("startSeconds"), EType::Number, TEXT("Window start, seconds from the start of the trace (default 0)")),
|
|
584
|
+
MCPParam::Optional(TEXT("endSeconds"), EType::Number, TEXT("Window end, seconds from the start of the trace (default the end)")),
|
|
585
|
+
MCPParam::Optional(TEXT("hitchThresholdMs"), EType::Number, TEXT("A frame at or over this many milliseconds is a hitch (default 50)")),
|
|
586
|
+
MCPParam::Optional(TEXT("worstFrames"), EType::Integer, TEXT("Slowest frames to list with their top timers (default 10, max 50)")),
|
|
587
|
+
MCPParam::Optional(TEXT("topTimers"), EType::Integer, TEXT("Timers to list over the window (default 20, max 200)")),
|
|
588
|
+
MCPParam::Optional(TEXT("timersPerFrame"), EType::Integer, TEXT("Timers listed per worst frame, by exclusive time (default 5, max 20)")),
|
|
589
|
+
MCPParam::Optional(TEXT("maxHitches"), EType::Integer, TEXT("Hitch rows returned; count covers them all (default 50, max 500)")),
|
|
590
|
+
MCPParam::Optional(TEXT("maxBookmarks"), EType::Integer, TEXT("Bookmark rows returned; count covers them all (default 100, max 1000)")),
|
|
591
|
+
MCPParam::Optional(TEXT("threads"), EType::String, TEXT("game (default): timers on the game thread only | all: every CPU thread")).Enum({ TEXT("game"), TEXT("all") }),
|
|
592
|
+
MCPParam::Optional(TEXT("timerSort"), EType::String, TEXT("Order of topTimers: inclusive (default) or exclusive time")).Enum({ TEXT("inclusive"), TEXT("exclusive") }),
|
|
593
|
+
MCPParam::Optional(TEXT("frameType"), EType::String, TEXT("Frames to measure: game (default) or rendering")).Enum({ TEXT("game"), TEXT("rendering") }),
|
|
594
|
+
MCPParam::Optional(TEXT("dumpToFile"), EType::Boolean, TEXT("Write the full analysis to a JSON file and return the headline numbers with its path (default false)")),
|
|
595
|
+
MCPParam::Optional(TEXT("outputPath"), EType::String, TEXT("File for dumpToFile; relative paths resolve under Saved/ (default Saved/UE_MCP/TraceAnalysis/<trace>.analysis.json)")),
|
|
596
|
+
});
|
|
597
|
+
// Both wait for a frame boundary the CSV profiler acts on, behind a
|
|
598
|
+
// deferred answer. Mirrored in src/bridge/bridge-timeouts.ts.
|
|
599
|
+
Registry.RegisterHandlerWithTimeout(TEXT("start_csv_profile"), &StartCsvProfile, 30.0f, {
|
|
600
|
+
MCPParam::Optional(TEXT("captureName"), EType::String, TEXT("File name for the capture, without extension (default <Project>_<timestamp>)")),
|
|
601
|
+
MCPParam::Optional(TEXT("maxFrames"), EType::Number, TEXT("End the capture by itself after this many frames (default: run until stop_csv_profile)")),
|
|
602
|
+
MCPParam::Optional(TEXT("folder"), EType::String, TEXT("Output folder (default <Project>/Saved/Profiling/CSV)")),
|
|
603
|
+
}, MCPSpec::ContractExempt(TEXT("starts a CSV profiler capture")));
|
|
604
|
+
Registry.RegisterHandlerWithTimeout(TEXT("stop_csv_profile"), &StopCsvProfile, 90.0f, {},
|
|
605
|
+
MCPSpec::ContractExempt(TEXT("ends the running CSV profiler capture")));
|
|
575
606
|
Registry.RegisterHandler(TEXT("reload_handlers"), &ReloadHandlers, NoParams,
|
|
576
607
|
MCPSpec::ContractExempt(TEXT("reloads the Python bridge handlers from disk")));
|
|
577
608
|
// save_asset is owned by FAssetHandlers (#768: adds force, file size, mtime).
|
|
@@ -150,6 +150,15 @@ private:
|
|
|
150
150
|
static TSharedPtr<FJsonValue> GetOutputLog(const TSharedPtr<FJsonObject>& Params);
|
|
151
151
|
static TSharedPtr<FJsonValue> SearchLog(const TSharedPtr<FJsonObject>& Params);
|
|
152
152
|
static TSharedPtr<FJsonValue> GetMessageLog(const TSharedPtr<FJsonObject>& Params);
|
|
153
|
+
// #1828: Map Check runs and messages. EditorHandlers_MapCheck.cpp.
|
|
154
|
+
static void RegisterMapCheckHandlers(class FMCPHandlerRegistry& Registry);
|
|
155
|
+
static TSharedPtr<FJsonValue> RunMapCheck(const TSharedPtr<FJsonObject>& Params);
|
|
156
|
+
static TSharedPtr<FJsonValue> LogMapCheckMessage(const TSharedPtr<FJsonObject>& Params);
|
|
157
|
+
// #1828: Python additional search paths. EditorHandlers_PythonPaths.cpp.
|
|
158
|
+
static void RegisterPythonPathHandlers(class FMCPHandlerRegistry& Registry);
|
|
159
|
+
static TSharedPtr<FJsonValue> AddPythonPath(const TSharedPtr<FJsonObject>& Params);
|
|
160
|
+
static TSharedPtr<FJsonValue> RemovePythonPath(const TSharedPtr<FJsonObject>& Params);
|
|
161
|
+
static TSharedPtr<FJsonValue> ListPythonPaths(const TSharedPtr<FJsonObject>& Params);
|
|
153
162
|
static TSharedPtr<FJsonValue> GetBuildStatus(const TSharedPtr<FJsonObject>& Params);
|
|
154
163
|
static TSharedPtr<FJsonValue> PieControl(const TSharedPtr<FJsonObject>& Params);
|
|
155
164
|
static TSharedPtr<FJsonValue> PieStartIgnoringBlueprintErrors(const TSharedPtr<FJsonObject>& Params);
|
|
@@ -204,6 +213,12 @@ private:
|
|
|
204
213
|
static TSharedPtr<FJsonValue> LaunchStandaloneGame(const TSharedPtr<FJsonObject>& Params);
|
|
205
214
|
static TSharedPtr<FJsonValue> GetStandaloneStatus(const TSharedPtr<FJsonObject>& Params);
|
|
206
215
|
static TSharedPtr<FJsonValue> StopStandaloneGame(const TSharedPtr<FJsonObject>& Params);
|
|
216
|
+
// Reading a recorded .utrace back through TraceServices, in
|
|
217
|
+
// EditorHandlers_TraceAnalysis.cpp.
|
|
218
|
+
static TSharedPtr<FJsonValue> AnalyzeInsightsTrace(const TSharedPtr<FJsonObject>& Params);
|
|
219
|
+
// The CSV profiler with a named capture, in EditorHandlers_CsvProfile.cpp.
|
|
220
|
+
static TSharedPtr<FJsonValue> StartCsvProfile(const TSharedPtr<FJsonObject>& Params);
|
|
221
|
+
static TSharedPtr<FJsonValue> StopCsvProfile(const TSharedPtr<FJsonObject>& Params);
|
|
207
222
|
|
|
208
223
|
static TSharedPtr<FJsonValue> ReloadHandlers(const TSharedPtr<FJsonObject>& Params);
|
|
209
224
|
// #378: flush dirty packages and report per-package success/failure
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// editor(start_csv_profile) / editor(stop_csv_profile): the CSV profiler, the
|
|
2
|
+
// per-frame stat recorder behind the `csvprofile start` / `csvprofile stop`
|
|
3
|
+
// console commands, driven with a named capture and an answer that says where
|
|
4
|
+
// the file landed.
|
|
5
|
+
//
|
|
6
|
+
// The console command returns nothing and the profiler acts on the next frame
|
|
7
|
+
// boundary, so a caller using it had to guess the file name and poll the
|
|
8
|
+
// folder. These actions call FCsvProfiler directly and wait (through the
|
|
9
|
+
// deferred-answer pattern, HandlerDeferred.h) for the two moments that matter:
|
|
10
|
+
// the capture really beginning, which is when the output path is fixed, and the
|
|
11
|
+
// file being completely written after the stop, which is when the CSV profiler
|
|
12
|
+
// fulfils the future EndCapture returns. editor(summarize_csv_profile) reads the
|
|
13
|
+
// file back on the server side.
|
|
14
|
+
//
|
|
15
|
+
// Engine versions. BeginCapture, EndCapture (returning TSharedFuture<FString>),
|
|
16
|
+
// GetOutputFilename and GetCaptureFrameNumber have the same shape on every
|
|
17
|
+
// supported engine. IsCapturing is a const member up to 5.7 and static from
|
|
18
|
+
// 5.8; it is called through the instance pointer, which compiles either way.
|
|
19
|
+
// FCsvProfiler::GetDefaultDirectory is 5.8+, so the default folder is built
|
|
20
|
+
// here from FPaths::ProfilingDir(), which is what that function returns.
|
|
21
|
+
//
|
|
22
|
+
// Helpers are prefixed MCPCsvProfile for the unity build.
|
|
23
|
+
|
|
24
|
+
#include "EditorHandlers.h"
|
|
25
|
+
|
|
26
|
+
#include "HandlerDeferred.h"
|
|
27
|
+
#include "HandlerUtils.h"
|
|
28
|
+
|
|
29
|
+
#include "Containers/Ticker.h"
|
|
30
|
+
#include "HAL/FileManager.h"
|
|
31
|
+
#include "HAL/PlatformTime.h"
|
|
32
|
+
#include "Misc/App.h"
|
|
33
|
+
#include "Misc/DateTime.h"
|
|
34
|
+
#include "Misc/Paths.h"
|
|
35
|
+
#include "ProfilingDebugging/CsvProfiler.h"
|
|
36
|
+
|
|
37
|
+
#include "Dom/JsonObject.h"
|
|
38
|
+
#include "Dom/JsonValue.h"
|
|
39
|
+
|
|
40
|
+
namespace
|
|
41
|
+
{
|
|
42
|
+
/** Where captures go when the caller names no folder: the folder the CSV
|
|
43
|
+
* profiler itself defaults to. */
|
|
44
|
+
FString MCPCsvProfileDefaultFolder()
|
|
45
|
+
{
|
|
46
|
+
return FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::ProfilingDir(), TEXT("CSV")));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** File stem for a capture: the caller's name made file-safe, or a
|
|
50
|
+
* timestamped default, without a .csv extension (the profiler adds it). */
|
|
51
|
+
FString MCPCsvProfileStem(FString Name)
|
|
52
|
+
{
|
|
53
|
+
Name.TrimStartAndEndInline();
|
|
54
|
+
if (Name.EndsWith(TEXT(".csv.gz"), ESearchCase::IgnoreCase)) Name.LeftChopInline(7);
|
|
55
|
+
else if (Name.EndsWith(TEXT(".csv"), ESearchCase::IgnoreCase)) Name.LeftChopInline(4);
|
|
56
|
+
Name = FPaths::MakeValidFileName(Name);
|
|
57
|
+
if (Name.IsEmpty())
|
|
58
|
+
{
|
|
59
|
+
const FString Project = FApp::GetProjectName();
|
|
60
|
+
Name = FString::Printf(TEXT("%s_%s"), Project.IsEmpty() ? TEXT("Csv") : *Project,
|
|
61
|
+
*FDateTime::Now().ToString(TEXT("%Y%m%d_%H%M%S")));
|
|
62
|
+
}
|
|
63
|
+
return Name;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void MCPCsvProfileDescribeFile(TSharedPtr<FJsonObject> Result, const FString& Path)
|
|
67
|
+
{
|
|
68
|
+
const FString Absolute = FPaths::ConvertRelativePathToFull(Path);
|
|
69
|
+
Result->SetStringField(TEXT("csvPath"), Absolute);
|
|
70
|
+
const bool bExists = FPaths::FileExists(Absolute);
|
|
71
|
+
Result->SetBoolField(TEXT("csvExists"), bExists);
|
|
72
|
+
if (bExists)
|
|
73
|
+
{
|
|
74
|
+
Result->SetNumberField(TEXT("csvBytes"), static_cast<double>(IFileManager::Get().FileSize(*Absolute)));
|
|
75
|
+
}
|
|
76
|
+
Result->SetBoolField(TEXT("compressed"), Absolute.EndsWith(TEXT(".gz"), ESearchCase::IgnoreCase));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// start_csv_profile -- begin a named CSV capture.
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
TSharedPtr<FJsonValue> FEditorHandlers::StartCsvProfile(const TSharedPtr<FJsonObject>& Params)
|
|
84
|
+
{
|
|
85
|
+
MCP_CHECK_GAME_THREAD();
|
|
86
|
+
|
|
87
|
+
const FString CaptureName = OptionalString(Params, TEXT("captureName"));
|
|
88
|
+
const int32 MaxFrames = static_cast<int32>(OptionalNumber(Params, TEXT("maxFrames"), -1.0));
|
|
89
|
+
FString Folder = OptionalString(Params, TEXT("folder"));
|
|
90
|
+
Folder.TrimStartAndEndInline();
|
|
91
|
+
|
|
92
|
+
#if CSV_PROFILER
|
|
93
|
+
FCsvProfiler* Csv = FCsvProfiler::Get();
|
|
94
|
+
if (!Csv)
|
|
95
|
+
{
|
|
96
|
+
return MCPError(TEXT("The CSV profiler is not available in this process."));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// One capture at a time per process. A second start would be queued by
|
|
100
|
+
// the engine behind the first and silently ignored, so it is reported
|
|
101
|
+
// instead of being sent.
|
|
102
|
+
if (Csv->IsCapturing())
|
|
103
|
+
{
|
|
104
|
+
TSharedPtr<FJsonObject> Existing = MCPSuccess();
|
|
105
|
+
MCPSetExisted(Existing);
|
|
106
|
+
Existing->SetBoolField(TEXT("started"), false);
|
|
107
|
+
Existing->SetBoolField(TEXT("alreadyCapturing"), true);
|
|
108
|
+
Existing->SetNumberField(TEXT("capturedFrames"), Csv->GetCaptureFrameNumber());
|
|
109
|
+
MCPCsvProfileDescribeFile(Existing, Csv->GetOutputFilename());
|
|
110
|
+
Existing->SetStringField(TEXT("note"),
|
|
111
|
+
TEXT("A CSV capture was already running, so nothing was started. Stop it with editor(stop_csv_profile) first."));
|
|
112
|
+
return MCPResult(Existing);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (Folder.IsEmpty())
|
|
116
|
+
{
|
|
117
|
+
Folder = MCPCsvProfileDefaultFolder();
|
|
118
|
+
}
|
|
119
|
+
else
|
|
120
|
+
{
|
|
121
|
+
FString Resolved;
|
|
122
|
+
if (auto Err = MCPRequireWritablePath(Folder, Resolved)) return Err;
|
|
123
|
+
Folder = Resolved;
|
|
124
|
+
}
|
|
125
|
+
while (Folder.EndsWith(TEXT("/")) || Folder.EndsWith(TEXT("\\"))) Folder.LeftChopInline(1);
|
|
126
|
+
IFileManager::Get().MakeDirectory(*Folder, /*Tree=*/true);
|
|
127
|
+
|
|
128
|
+
const FString Stem = MCPCsvProfileStem(CaptureName);
|
|
129
|
+
const FString Predicted = FPaths::Combine(Folder, Stem + TEXT(".csv"));
|
|
130
|
+
const int32 FramesToCapture = MaxFrames > 0 ? MaxFrames : -1;
|
|
131
|
+
|
|
132
|
+
Csv->BeginCapture(FramesToCapture, Folder, Stem, ECsvProfilerFlags::None);
|
|
133
|
+
|
|
134
|
+
auto BuildStarted = [Stem, FramesToCapture](const FString& Path, bool bConfirmed) -> TSharedPtr<FJsonObject>
|
|
135
|
+
{
|
|
136
|
+
TSharedPtr<FJsonObject> Result = MCPSuccess();
|
|
137
|
+
MCPSetCreated(Result);
|
|
138
|
+
Result->SetBoolField(TEXT("started"), true);
|
|
139
|
+
Result->SetBoolField(TEXT("alreadyCapturing"), false);
|
|
140
|
+
Result->SetBoolField(TEXT("captureConfirmed"), bConfirmed);
|
|
141
|
+
Result->SetStringField(TEXT("captureName"), Stem);
|
|
142
|
+
Result->SetNumberField(TEXT("maxFrames"), FramesToCapture);
|
|
143
|
+
MCPCsvProfileDescribeFile(Result, Path);
|
|
144
|
+
Result->SetStringField(TEXT("note"), FramesToCapture > 0
|
|
145
|
+
? TEXT("The capture ends by itself after maxFrames frames; editor(stop_csv_profile) ends it sooner and reports the finished file.")
|
|
146
|
+
: TEXT("The CSV file is written as frames are captured and is only complete after editor(stop_csv_profile)."));
|
|
147
|
+
TSharedPtr<FJsonObject> Payload = MakeShared<FJsonObject>();
|
|
148
|
+
MCPSetRollback(Result, TEXT("stop_csv_profile"), Payload);
|
|
149
|
+
return Result;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// The capture begins at the next frame boundary, which is when the path is
|
|
153
|
+
// fixed (and when a forced-compression setting would turn .csv into
|
|
154
|
+
// .csv.gz). A bridge request waits for that; an in-process call reports
|
|
155
|
+
// the path the profiler was asked for.
|
|
156
|
+
const FMCPDeferredCallPtr Deferred = MCPDeferRequest();
|
|
157
|
+
if (!Deferred)
|
|
158
|
+
{
|
|
159
|
+
return MCPResult(BuildStarted(Predicted, false));
|
|
160
|
+
}
|
|
161
|
+
Deferred->SetCancelNote(TEXT("Only the wait was stopped. The capture request had already been queued; stop it with editor(stop_csv_profile)."));
|
|
162
|
+
const double Deadline = FPlatformTime::Seconds() + 15.0;
|
|
163
|
+
FTSTicker::GetCoreTicker().AddTicker(FTickerDelegate::CreateLambda(
|
|
164
|
+
[Deferred, Deadline, Predicted, BuildStarted](float) -> bool
|
|
165
|
+
{
|
|
166
|
+
if (Deferred->IsCancelled()) return false;
|
|
167
|
+
FCsvProfiler* Profiler = FCsvProfiler::Get();
|
|
168
|
+
if (Profiler && Profiler->IsCapturing())
|
|
169
|
+
{
|
|
170
|
+
Deferred->Complete(MCPResult(BuildStarted(Profiler->GetOutputFilename(), true)));
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (FPlatformTime::Seconds() > Deadline)
|
|
174
|
+
{
|
|
175
|
+
Deferred->Complete(MCPError(FString::Printf(
|
|
176
|
+
TEXT("The CSV capture was requested but had not begun after 15 s. The profiler refuses to start when it cannot create the file (%s); check the output log for LogCsvProfiler."),
|
|
177
|
+
*Predicted)));
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
181
|
+
}));
|
|
182
|
+
return MCPDeferredMarker();
|
|
183
|
+
#else
|
|
184
|
+
return MCPError(TEXT("This build compiles the CSV profiler out (CSV_PROFILER is 0), so there is nothing to start."));
|
|
185
|
+
#endif
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// stop_csv_profile -- end the capture and report the finished file.
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
TSharedPtr<FJsonValue> FEditorHandlers::StopCsvProfile(const TSharedPtr<FJsonObject>& Params)
|
|
192
|
+
{
|
|
193
|
+
MCP_CHECK_GAME_THREAD();
|
|
194
|
+
|
|
195
|
+
#if CSV_PROFILER
|
|
196
|
+
FCsvProfiler* Csv = FCsvProfiler::Get();
|
|
197
|
+
if (!Csv)
|
|
198
|
+
{
|
|
199
|
+
return MCPError(TEXT("The CSV profiler is not available in this process."));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (!Csv->IsCapturing())
|
|
203
|
+
{
|
|
204
|
+
TSharedPtr<FJsonObject> NoOp = MCPSuccess();
|
|
205
|
+
NoOp->SetBoolField(TEXT("wasCapturing"), false);
|
|
206
|
+
NoOp->SetBoolField(TEXT("stopped"), false);
|
|
207
|
+
NoOp->SetBoolField(TEXT("unchanged"), true);
|
|
208
|
+
NoOp->SetBoolField(TEXT("writing"), Csv->IsWritingFile());
|
|
209
|
+
const FString Last = Csv->GetOutputFilename();
|
|
210
|
+
if (!Last.IsEmpty()) MCPCsvProfileDescribeFile(NoOp, Last);
|
|
211
|
+
NoOp->SetStringField(TEXT("note"),
|
|
212
|
+
TEXT("No CSV capture was running, so nothing was stopped. csvPath, when present, is the last capture's file."));
|
|
213
|
+
MCPSetNoRollback(NoOp, TEXT("Nothing was stopped, so there is nothing to undo."));
|
|
214
|
+
return MCPResult(NoOp);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const FString Path = Csv->GetOutputFilename();
|
|
218
|
+
const int32 Frames = Csv->GetCaptureFrameNumber();
|
|
219
|
+
const TSharedFuture<FString> Written = Csv->EndCapture();
|
|
220
|
+
|
|
221
|
+
auto BuildStopped = [Path, Frames](const FString& FinalPath, bool bWritten) -> TSharedPtr<FJsonObject>
|
|
222
|
+
{
|
|
223
|
+
TSharedPtr<FJsonObject> Result = MCPSuccess();
|
|
224
|
+
MCPSetUpdated(Result);
|
|
225
|
+
Result->SetBoolField(TEXT("wasCapturing"), true);
|
|
226
|
+
Result->SetBoolField(TEXT("stopped"), true);
|
|
227
|
+
Result->SetBoolField(TEXT("writing"), !bWritten);
|
|
228
|
+
Result->SetNumberField(TEXT("capturedFrames"), Frames);
|
|
229
|
+
MCPCsvProfileDescribeFile(Result, FinalPath.IsEmpty() ? Path : FinalPath);
|
|
230
|
+
if (!bWritten)
|
|
231
|
+
{
|
|
232
|
+
Result->SetStringField(TEXT("note"),
|
|
233
|
+
TEXT("The stop was queued but the file was still being written when this answered; its size will grow until the profiler finishes."));
|
|
234
|
+
}
|
|
235
|
+
// Restarting is the inverse in the same lossy sense as stop_trace's:
|
|
236
|
+
// a new capture writes a NEW file and the frames in between are absent.
|
|
237
|
+
TSharedPtr<FJsonObject> Payload = MakeShared<FJsonObject>();
|
|
238
|
+
Payload->SetStringField(TEXT("captureName"), FPaths::GetBaseFilename(FinalPath.IsEmpty() ? Path : FinalPath) + TEXT("_resumed"));
|
|
239
|
+
MCPSetRollback(Result, TEXT("start_csv_profile"), Payload);
|
|
240
|
+
Result->SetStringField(TEXT("rollbackNote"),
|
|
241
|
+
TEXT("Rolling back starts a NEW capture under a new name. A finished CSV cannot be reopened, so the frames in the gap are lost."));
|
|
242
|
+
return Result;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const FMCPDeferredCallPtr Deferred = MCPDeferRequest();
|
|
246
|
+
if (!Deferred || !Written.IsValid())
|
|
247
|
+
{
|
|
248
|
+
return MCPResult(BuildStopped(Path, Written.IsValid() && Written.IsReady()));
|
|
249
|
+
}
|
|
250
|
+
Deferred->SetCancelNote(TEXT("Only the wait was stopped. The capture had already been ended and the profiler finishes writing the file on its own."));
|
|
251
|
+
const double Deadline = FPlatformTime::Seconds() + 60.0;
|
|
252
|
+
FTSTicker::GetCoreTicker().AddTicker(FTickerDelegate::CreateLambda(
|
|
253
|
+
[Deferred, Deadline, Written, BuildStopped](float) -> bool
|
|
254
|
+
{
|
|
255
|
+
if (Deferred->IsCancelled()) return false;
|
|
256
|
+
if (Written.IsReady())
|
|
257
|
+
{
|
|
258
|
+
Deferred->Complete(MCPResult(BuildStopped(Written.Get(), true)));
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
if (FPlatformTime::Seconds() > Deadline)
|
|
262
|
+
{
|
|
263
|
+
Deferred->Complete(MCPResult(BuildStopped(FString(), false)));
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
return true;
|
|
267
|
+
}));
|
|
268
|
+
return MCPDeferredMarker();
|
|
269
|
+
#else
|
|
270
|
+
return MCPError(TEXT("This build compiles the CSV profiler out (CSV_PROFILER is 0), so there is nothing to stop."));
|
|
271
|
+
#endif
|
|
272
|
+
}
|