unreal-engine-mcp-server 0.5.21 → 0.5.30
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/CHANGELOG.md +247 -4
- package/README.md +140 -85
- package/dist/automation/bridge.d.ts +8 -0
- package/dist/automation/bridge.d.ts.map +1 -1
- package/dist/automation/bridge.js +94 -14
- package/dist/automation/bridge.js.map +1 -1
- package/dist/automation/connection-manager.d.ts.map +1 -1
- package/dist/automation/connection-manager.js +13 -5
- package/dist/automation/connection-manager.js.map +1 -1
- package/dist/automation/handshake.d.ts.map +1 -1
- package/dist/automation/handshake.js +40 -27
- package/dist/automation/handshake.js.map +1 -1
- package/dist/automation/index.d.ts +1 -1
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.js +0 -1
- package/dist/automation/index.js.map +1 -1
- package/dist/automation/message-handler.d.ts.map +1 -1
- package/dist/automation/message-handler.js +13 -9
- package/dist/automation/message-handler.js.map +1 -1
- package/dist/automation/message-schema.d.ts.map +1 -1
- package/dist/automation/message-schema.js +19 -18
- package/dist/automation/message-schema.js.map +1 -1
- package/dist/automation/request-tracker.d.ts +1 -0
- package/dist/automation/request-tracker.d.ts.map +1 -1
- package/dist/automation/request-tracker.js +30 -31
- package/dist/automation/request-tracker.js.map +1 -1
- package/dist/automation/types.d.ts +38 -32
- package/dist/automation/types.d.ts.map +1 -1
- package/dist/cli.js +14 -16
- package/dist/cli.js.map +1 -1
- package/dist/config/class-aliases.d.ts.map +1 -1
- package/dist/config/class-aliases.js +10 -2
- package/dist/config/class-aliases.js.map +1 -1
- package/dist/config.d.ts +9 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +58 -32
- package/dist/config.js.map +1 -1
- package/dist/handlers/resource-handlers.d.ts +15 -2
- package/dist/handlers/resource-handlers.d.ts.map +1 -1
- package/dist/handlers/resource-handlers.js +46 -63
- package/dist/handlers/resource-handlers.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -48
- package/dist/index.js.map +1 -1
- package/dist/resources/assets.d.ts.map +1 -1
- package/dist/resources/assets.js +34 -9
- package/dist/resources/assets.js.map +1 -1
- package/dist/resources/levels.d.ts +3 -0
- package/dist/resources/levels.d.ts.map +1 -1
- package/dist/resources/levels.js +33 -17
- package/dist/resources/levels.js.map +1 -1
- package/dist/server/resource-registry.d.ts +15 -2
- package/dist/server/resource-registry.d.ts.map +1 -1
- package/dist/server/resource-registry.js +9 -8
- package/dist/server/resource-registry.js.map +1 -1
- package/dist/server/tool-registry.d.ts +0 -1
- package/dist/server/tool-registry.d.ts.map +1 -1
- package/dist/server/tool-registry.js +91 -101
- package/dist/server/tool-registry.js.map +1 -1
- package/dist/server-setup.d.ts +5 -2
- package/dist/server-setup.d.ts.map +1 -1
- package/dist/server-setup.js +15 -19
- package/dist/server-setup.js.map +1 -1
- package/dist/services/health-monitor.d.ts +3 -0
- package/dist/services/health-monitor.d.ts.map +1 -1
- package/dist/services/health-monitor.js +30 -11
- package/dist/services/health-monitor.js.map +1 -1
- package/dist/services/metrics-server.d.ts +1 -1
- package/dist/services/metrics-server.d.ts.map +1 -1
- package/dist/services/metrics-server.js +65 -3
- package/dist/services/metrics-server.js.map +1 -1
- package/dist/tools/base-tool.d.ts.map +1 -1
- package/dist/tools/base-tool.js +14 -16
- package/dist/tools/base-tool.js.map +1 -1
- package/dist/tools/consolidated-tool-definitions.d.ts +16 -1
- package/dist/tools/consolidated-tool-definitions.d.ts.map +1 -1
- package/dist/tools/consolidated-tool-definitions.js +1479 -2538
- package/dist/tools/consolidated-tool-definitions.js.map +1 -1
- package/dist/tools/consolidated-tool-handlers.d.ts.map +1 -1
- package/dist/tools/consolidated-tool-handlers.js +195 -217
- package/dist/tools/consolidated-tool-handlers.js.map +1 -1
- package/dist/tools/dynamic-handler-registry.d.ts +1 -0
- package/dist/tools/dynamic-handler-registry.d.ts.map +1 -1
- package/dist/tools/dynamic-handler-registry.js +15 -7
- package/dist/tools/dynamic-handler-registry.js.map +1 -1
- package/dist/tools/dynamic-tool-manager.d.ts +1 -1
- package/dist/tools/dynamic-tool-manager.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-manager.js +30 -18
- package/dist/tools/dynamic-tool-manager.js.map +1 -1
- package/dist/tools/editor.d.ts +2 -2
- package/dist/tools/editor.d.ts.map +1 -1
- package/dist/tools/editor.js +4 -4
- package/dist/tools/editor.js.map +1 -1
- package/dist/tools/handlers/actor-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/actor-handlers.js +66 -7
- package/dist/tools/handlers/actor-handlers.js.map +1 -1
- package/dist/tools/handlers/ai-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/ai-handlers.js +24 -13
- package/dist/tools/handlers/ai-handlers.js.map +1 -1
- package/dist/tools/handlers/animation-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/animation-authoring-handlers.js +285 -218
- package/dist/tools/handlers/animation-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/animation-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/animation-handlers.js +69 -21
- package/dist/tools/handlers/animation-handlers.js.map +1 -1
- package/dist/tools/handlers/asset-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/asset-handlers.js +75 -16
- package/dist/tools/handlers/asset-handlers.js.map +1 -1
- package/dist/tools/handlers/audio-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/audio-authoring-handlers.js +102 -9
- package/dist/tools/handlers/audio-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/audio-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/audio-handlers.js +48 -13
- package/dist/tools/handlers/audio-handlers.js.map +1 -1
- package/dist/tools/handlers/blueprint-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/blueprint-handlers.js +28 -48
- package/dist/tools/handlers/blueprint-handlers.js.map +1 -1
- package/dist/tools/handlers/character-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/character-handlers.js +13 -12
- package/dist/tools/handlers/character-handlers.js.map +1 -1
- package/dist/tools/handlers/combat-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/combat-handlers.js +12 -12
- package/dist/tools/handlers/combat-handlers.js.map +1 -1
- package/dist/tools/handlers/common-handlers.d.ts +14 -0
- package/dist/tools/handlers/common-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/common-handlers.js +117 -9
- package/dist/tools/handlers/common-handlers.js.map +1 -1
- package/dist/tools/handlers/editor-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/editor-handlers.js +139 -67
- package/dist/tools/handlers/editor-handlers.js.map +1 -1
- package/dist/tools/handlers/effect-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/effect-handlers.js +324 -36
- package/dist/tools/handlers/effect-handlers.js.map +1 -1
- package/dist/tools/handlers/environment-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/environment-handlers.js +186 -21
- package/dist/tools/handlers/environment-handlers.js.map +1 -1
- package/dist/tools/handlers/game-framework-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/game-framework-handlers.js +10 -12
- package/dist/tools/handlers/game-framework-handlers.js.map +1 -1
- package/dist/tools/handlers/gas-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/gas-handlers.js +136 -20
- package/dist/tools/handlers/gas-handlers.js.map +1 -1
- package/dist/tools/handlers/geometry-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/geometry-handlers.js +130 -7
- package/dist/tools/handlers/geometry-handlers.js.map +1 -1
- package/dist/tools/handlers/graph-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/graph-handlers.js +46 -11
- package/dist/tools/handlers/graph-handlers.js.map +1 -1
- package/dist/tools/handlers/input-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/input-handlers.js +33 -75
- package/dist/tools/handlers/input-handlers.js.map +1 -1
- package/dist/tools/handlers/inspect-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/inspect-handlers.js +136 -39
- package/dist/tools/handlers/inspect-handlers.js.map +1 -1
- package/dist/tools/handlers/interaction-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/interaction-handlers.js +14 -12
- package/dist/tools/handlers/interaction-handlers.js.map +1 -1
- package/dist/tools/handlers/inventory-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/inventory-handlers.js +19 -12
- package/dist/tools/handlers/inventory-handlers.js.map +1 -1
- package/dist/tools/handlers/level-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/level-handlers.js +166 -149
- package/dist/tools/handlers/level-handlers.js.map +1 -1
- package/dist/tools/handlers/level-structure-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/level-structure-handlers.js +18 -34
- package/dist/tools/handlers/level-structure-handlers.js.map +1 -1
- package/dist/tools/handlers/manage-tools-handlers.js +3 -3
- package/dist/tools/handlers/manage-tools-handlers.js.map +1 -1
- package/dist/tools/handlers/material-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/material-authoring-handlers.js +382 -41
- package/dist/tools/handlers/material-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/navigation-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/navigation-handlers.js +11 -36
- package/dist/tools/handlers/navigation-handlers.js.map +1 -1
- package/dist/tools/handlers/networking-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/networking-handlers.js +17 -15
- package/dist/tools/handlers/networking-handlers.js.map +1 -1
- package/dist/tools/handlers/niagara-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/niagara-authoring-handlers.js +24 -23
- package/dist/tools/handlers/niagara-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/pcg-handlers.d.ts +4 -0
- package/dist/tools/handlers/pcg-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/pcg-handlers.js +77 -0
- package/dist/tools/handlers/pcg-handlers.js.map +1 -0
- package/dist/tools/handlers/performance-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/performance-handlers.js +35 -42
- package/dist/tools/handlers/performance-handlers.js.map +1 -1
- package/dist/tools/handlers/pipeline-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/pipeline-handlers.js +157 -39
- package/dist/tools/handlers/pipeline-handlers.js.map +1 -1
- package/dist/tools/handlers/sequence-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/sequence-handlers.js +6 -4
- package/dist/tools/handlers/sequence-handlers.js.map +1 -1
- package/dist/tools/handlers/sessions-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/sessions-handlers.js +7 -15
- package/dist/tools/handlers/sessions-handlers.js.map +1 -1
- package/dist/tools/handlers/spline-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/spline-handlers.js +8 -35
- package/dist/tools/handlers/spline-handlers.js.map +1 -1
- package/dist/tools/handlers/system-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/system-handlers.js +100 -26
- package/dist/tools/handlers/system-handlers.js.map +1 -1
- package/dist/tools/handlers/texture-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/texture-handlers.js +14 -0
- package/dist/tools/handlers/texture-handlers.js.map +1 -1
- package/dist/tools/handlers/volume-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/volume-handlers.js +6 -33
- package/dist/tools/handlers/volume-handlers.js.map +1 -1
- package/dist/tools/handlers/widget-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/widget-authoring-handlers.js +26 -20
- package/dist/tools/handlers/widget-authoring-handlers.js.map +1 -1
- package/dist/tools/level.d.ts +2 -2
- package/dist/tools/level.d.ts.map +1 -1
- package/dist/tools/level.js +2 -1
- package/dist/tools/level.js.map +1 -1
- package/dist/tools/property-dictionary.js +1 -1
- package/dist/tools/property-dictionary.js.map +1 -1
- package/dist/tools/schemas/core-tools.d.ts +1 -1
- package/dist/tools/schemas/core-tools.d.ts.map +1 -1
- package/dist/tools/schemas/core-tools.js +94 -57
- package/dist/tools/schemas/core-tools.js.map +1 -1
- package/dist/tools/tool-definition-utils.d.ts +8 -0
- package/dist/tools/tool-definition-utils.d.ts.map +1 -1
- package/dist/tools/tool-definition-utils.js +20 -0
- package/dist/tools/tool-definition-utils.js.map +1 -1
- package/dist/types/automation-responses.d.ts +26 -33
- package/dist/types/automation-responses.d.ts.map +1 -1
- package/dist/types/env.d.ts.map +1 -1
- package/dist/types/env.js +7 -6
- package/dist/types/env.js.map +1 -1
- package/dist/types/handler-types.d.ts +41 -20
- package/dist/types/handler-types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/tool-interfaces.d.ts +5 -873
- package/dist/types/tool-interfaces.d.ts.map +1 -1
- package/dist/types/tool-types.d.ts +35 -1
- package/dist/types/tool-types.d.ts.map +1 -1
- package/dist/unreal-bridge.d.ts.map +1 -1
- package/dist/unreal-bridge.js +16 -6
- package/dist/unreal-bridge.js.map +1 -1
- package/dist/utils/action-constants.d.ts +4 -1
- package/dist/utils/action-constants.d.ts.map +1 -1
- package/dist/utils/action-constants.js +4 -1
- package/dist/utils/action-constants.js.map +1 -1
- package/dist/utils/command-validator.d.ts.map +1 -1
- package/dist/utils/command-validator.js +5 -4
- package/dist/utils/command-validator.js.map +1 -1
- package/dist/utils/elicitation.d.ts +5 -2
- package/dist/utils/elicitation.d.ts.map +1 -1
- package/dist/utils/elicitation.js +38 -21
- package/dist/utils/elicitation.js.map +1 -1
- package/dist/utils/environment-snapshot.d.ts +17 -0
- package/dist/utils/environment-snapshot.d.ts.map +1 -0
- package/dist/utils/environment-snapshot.js +242 -0
- package/dist/utils/environment-snapshot.js.map +1 -0
- package/dist/utils/error-handler.d.ts +1 -11
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +41 -25
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/ini-reader.js +4 -4
- package/dist/utils/ini-reader.js.map +1 -1
- package/dist/utils/log-reader.d.ts +29 -0
- package/dist/utils/log-reader.d.ts.map +1 -0
- package/dist/utils/log-reader.js +229 -0
- package/dist/utils/log-reader.js.map +1 -0
- package/dist/utils/log-redaction.d.ts +4 -0
- package/dist/utils/log-redaction.d.ts.map +1 -0
- package/dist/utils/log-redaction.js +27 -0
- package/dist/utils/log-redaction.js.map +1 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +20 -7
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/normalize.d.ts.map +1 -1
- package/dist/utils/normalize.js +31 -30
- package/dist/utils/normalize.js.map +1 -1
- package/dist/utils/path-security.d.ts.map +1 -1
- package/dist/utils/path-security.js +20 -11
- package/dist/utils/path-security.js.map +1 -1
- package/dist/utils/response-factory.d.ts +1 -1
- package/dist/utils/response-factory.d.ts.map +1 -1
- package/dist/utils/response-factory.js +17 -3
- package/dist/utils/response-factory.js.map +1 -1
- package/dist/utils/response-validator.d.ts.map +1 -1
- package/dist/utils/response-validator.js +114 -47
- package/dist/utils/response-validator.js.map +1 -1
- package/dist/utils/safe-json.d.ts.map +1 -1
- package/dist/utils/safe-json.js +24 -18
- package/dist/utils/safe-json.js.map +1 -1
- package/dist/utils/type-coercion.d.ts +2 -3
- package/dist/utils/type-coercion.d.ts.map +1 -1
- package/dist/utils/type-coercion.js +42 -14
- package/dist/utils/type-coercion.js.map +1 -1
- package/dist/utils/type-guards.d.ts +2 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +4 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/unreal-command-queue.d.ts +2 -0
- package/dist/utils/unreal-command-queue.d.ts.map +1 -1
- package/dist/utils/unreal-command-queue.js +80 -54
- package/dist/utils/unreal-command-queue.js.map +1 -1
- package/dist/utils/validation.d.ts +2 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +44 -34
- package/dist/utils/validation.js.map +1 -1
- package/package.json +4 -6
- package/server.json +3 -3
- package/dist/graphql/loaders.d.ts +0 -64
- package/dist/graphql/loaders.d.ts.map +0 -1
- package/dist/graphql/loaders.js +0 -117
- package/dist/graphql/loaders.js.map +0 -1
- package/dist/graphql/resolvers.d.ts +0 -373
- package/dist/graphql/resolvers.d.ts.map +0 -1
- package/dist/graphql/resolvers.js +0 -776
- package/dist/graphql/resolvers.js.map +0 -1
- package/dist/graphql/schema.d.ts +0 -5
- package/dist/graphql/schema.d.ts.map +0 -1
- package/dist/graphql/schema.js +0 -437
- package/dist/graphql/schema.js.map +0 -1
- package/dist/graphql/server.d.ts +0 -25
- package/dist/graphql/server.d.ts.map +0 -1
- package/dist/graphql/server.js +0 -119
- package/dist/graphql/server.js.map +0 -1
- package/dist/graphql/types.d.ts +0 -9
- package/dist/graphql/types.d.ts.map +0 -1
- package/dist/graphql/types.js +0 -2
- package/dist/graphql/types.js.map +0 -1
- package/dist/tools/actors.d.ts +0 -212
- package/dist/tools/actors.d.ts.map +0 -1
- package/dist/tools/actors.js +0 -456
- package/dist/tools/actors.js.map +0 -1
- package/dist/tools/animation.d.ts +0 -274
- package/dist/tools/animation.d.ts.map +0 -1
- package/dist/tools/animation.js +0 -773
- package/dist/tools/animation.js.map +0 -1
- package/dist/tools/assets.d.ts +0 -82
- package/dist/tools/assets.d.ts.map +0 -1
- package/dist/tools/assets.js +0 -383
- package/dist/tools/assets.js.map +0 -1
- package/dist/tools/blueprint.d.ts +0 -271
- package/dist/tools/blueprint.d.ts.map +0 -1
- package/dist/tools/blueprint.js +0 -828
- package/dist/tools/blueprint.js.map +0 -1
- package/dist/tools/environment.d.ts +0 -37
- package/dist/tools/environment.d.ts.map +0 -1
- package/dist/tools/environment.js +0 -338
- package/dist/tools/environment.js.map +0 -1
- package/dist/tools/foliage.d.ts +0 -140
- package/dist/tools/foliage.d.ts.map +0 -1
- package/dist/tools/foliage.js +0 -405
- package/dist/tools/foliage.js.map +0 -1
- package/dist/tools/landscape.d.ts +0 -120
- package/dist/tools/landscape.d.ts.map +0 -1
- package/dist/tools/landscape.js +0 -454
- package/dist/tools/landscape.js.map +0 -1
- package/dist/tools/lighting.d.ts +0 -240
- package/dist/tools/lighting.d.ts.map +0 -1
- package/dist/tools/lighting.js +0 -856
- package/dist/tools/lighting.js.map +0 -1
- package/dist/tools/logs.d.ts +0 -45
- package/dist/tools/logs.d.ts.map +0 -1
- package/dist/tools/logs.js +0 -235
- package/dist/tools/logs.js.map +0 -1
- package/dist/tools/niagara.d.ts +0 -277
- package/dist/tools/niagara.d.ts.map +0 -1
- package/dist/tools/niagara.js +0 -325
- package/dist/tools/niagara.js.map +0 -1
- package/dist/tools/physics.d.ts +0 -191
- package/dist/tools/physics.d.ts.map +0 -1
- package/dist/tools/physics.js +0 -492
- package/dist/tools/physics.js.map +0 -1
- package/dist/tools/sequence.d.ts +0 -139
- package/dist/tools/sequence.d.ts.map +0 -1
- package/dist/tools/sequence.js +0 -261
- package/dist/tools/sequence.js.map +0 -1
package/dist/tools/blueprint.js
DELETED
|
@@ -1,828 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from './base-tool.js';
|
|
2
|
-
import { Logger } from '../utils/logger.js';
|
|
3
|
-
import { validateAssetParams, concurrencyDelay } from '../utils/validation.js';
|
|
4
|
-
import { coerceString } from '../utils/result-helpers.js';
|
|
5
|
-
export class BlueprintTools extends BaseTool {
|
|
6
|
-
log = new Logger('BlueprintTools');
|
|
7
|
-
pluginBlueprintActionsAvailable = null;
|
|
8
|
-
async sendAction(action, payload = {}, options) {
|
|
9
|
-
const envDefault = Number(process.env.MCP_AUTOMATION_REQUEST_TIMEOUT_MS ?? '120000');
|
|
10
|
-
const defaultTimeout = Number.isFinite(envDefault) && envDefault > 0 ? envDefault : 120000;
|
|
11
|
-
const finalTimeout = typeof options?.timeoutMs === 'number' && options?.timeoutMs > 0 ? options.timeoutMs : defaultTimeout;
|
|
12
|
-
try {
|
|
13
|
-
const response = await this.sendAutomationRequest(action, payload, { timeoutMs: finalTimeout, waitForEvent: !!options?.waitForEvent, waitForEventTimeoutMs: options?.waitForEventTimeoutMs });
|
|
14
|
-
const success = response && response.success !== false;
|
|
15
|
-
const result = (response.result ?? response);
|
|
16
|
-
return { success, message: response.message ?? undefined, error: response.success === false ? (response.error ?? response.message) : undefined, result, requestId: response.requestId };
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
const errMsg = err instanceof Error ? err.message : String(err);
|
|
20
|
-
return { success: false, error: errMsg, message: errMsg };
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
isUnknownActionResponse(res) {
|
|
24
|
-
if (!res)
|
|
25
|
-
return false;
|
|
26
|
-
const errStr = typeof res.error === 'string' ? res.error : '';
|
|
27
|
-
const msgStr = typeof res.message === 'string' ? res.message : '';
|
|
28
|
-
const txt = (errStr || msgStr).toLowerCase();
|
|
29
|
-
return txt.includes('unknown_action') || txt.includes('unknown automation action') || txt.includes('not_implemented') || txt === 'unknown_plugin_action';
|
|
30
|
-
}
|
|
31
|
-
buildCandidates(rawName) {
|
|
32
|
-
const trimmed = coerceString(rawName)?.trim();
|
|
33
|
-
if (!trimmed)
|
|
34
|
-
return [];
|
|
35
|
-
const normalized = trimmed.replace(/\\/g, '/').replace(/\/\/+/g, '/');
|
|
36
|
-
const withoutLeading = normalized.replace(/^\/+/, '');
|
|
37
|
-
const basename = withoutLeading.split('/').pop() ?? withoutLeading;
|
|
38
|
-
const candidates = [];
|
|
39
|
-
if (normalized.includes('/')) {
|
|
40
|
-
if (normalized.startsWith('/'))
|
|
41
|
-
candidates.push(normalized);
|
|
42
|
-
if (basename) {
|
|
43
|
-
candidates.push(`/Game/Blueprints/${basename}`);
|
|
44
|
-
candidates.push(`/Game/${basename}`);
|
|
45
|
-
}
|
|
46
|
-
if (!normalized.startsWith('/'))
|
|
47
|
-
candidates.push(`/${withoutLeading}`);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
if (basename) {
|
|
51
|
-
candidates.push(`/Game/Blueprints/${basename}`);
|
|
52
|
-
candidates.push(`/Game/${basename}`);
|
|
53
|
-
}
|
|
54
|
-
candidates.push(normalized);
|
|
55
|
-
candidates.push(`/${withoutLeading}`);
|
|
56
|
-
}
|
|
57
|
-
return candidates.filter(Boolean);
|
|
58
|
-
}
|
|
59
|
-
async createBlueprint(params) {
|
|
60
|
-
try {
|
|
61
|
-
const validation = validateAssetParams({ name: params.name, savePath: params.savePath || '/Game/Blueprints' });
|
|
62
|
-
if (!validation.valid)
|
|
63
|
-
return { success: false, message: `Failed to create blueprint: ${validation.error}`, error: validation.error };
|
|
64
|
-
const sanitized = validation.sanitized;
|
|
65
|
-
const payload = { name: sanitized.name, blueprintType: params.blueprintType ?? 'Actor', savePath: sanitized.savePath ?? '/Game/Blueprints', parentClass: params.parentClass, properties: params.properties, waitForCompletion: !!params.waitForCompletion };
|
|
66
|
-
await concurrencyDelay();
|
|
67
|
-
if (this.pluginBlueprintActionsAvailable === false) {
|
|
68
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_create' };
|
|
69
|
-
}
|
|
70
|
-
const envPluginTimeout = Number(process.env.MCP_AUTOMATION_PLUGIN_CREATE_TIMEOUT_MS ?? process.env.MCP_AUTOMATION_REQUEST_TIMEOUT_MS ?? '15000');
|
|
71
|
-
const pluginTimeout = Number.isFinite(envPluginTimeout) && envPluginTimeout > 0 ? envPluginTimeout : 15000;
|
|
72
|
-
try {
|
|
73
|
-
const res = await this.sendAction('blueprint_create', payload, { timeoutMs: typeof params.timeoutMs === 'number' ? params.timeoutMs : pluginTimeout, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
74
|
-
if (res && res.success) {
|
|
75
|
-
this.pluginBlueprintActionsAvailable = true;
|
|
76
|
-
const createdPath = `${sanitized.savePath}/${sanitized.name}`.replace('//', '/');
|
|
77
|
-
return {
|
|
78
|
-
...res,
|
|
79
|
-
blueprint: res.result ?? { name: sanitized.name },
|
|
80
|
-
blueprintPath: createdPath,
|
|
81
|
-
path: createdPath,
|
|
82
|
-
message: res.message || `Created blueprint ${sanitized.name}`
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
if (res && this.isUnknownActionResponse(res)) {
|
|
86
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
87
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_create' };
|
|
88
|
-
}
|
|
89
|
-
return res;
|
|
90
|
-
}
|
|
91
|
-
catch (err) {
|
|
92
|
-
const errTxt = String(err ?? '');
|
|
93
|
-
const isTimeout = errTxt.includes('Request timed out') || errTxt.includes('-32001') || errTxt.toLowerCase().includes('timeout');
|
|
94
|
-
if (isTimeout) {
|
|
95
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
96
|
-
}
|
|
97
|
-
return { success: false, error: String(err), message: String(err) };
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
catch (err) {
|
|
101
|
-
return { success: false, error: String(err), message: String(err) };
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
async modifyConstructionScript(params) {
|
|
105
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
106
|
-
if (!blueprintPath)
|
|
107
|
-
return { success: false, message: 'Blueprint path is required', error: 'INVALID_BLUEPRINT_PATH' };
|
|
108
|
-
if (!Array.isArray(params.operations) || params.operations.length === 0)
|
|
109
|
-
return { success: false, message: 'At least one SCS operation is required', error: 'MISSING_OPERATIONS' };
|
|
110
|
-
const operations = params.operations.map((op) => {
|
|
111
|
-
if (op && typeof op === 'object' && op.op && !op.type) {
|
|
112
|
-
return { ...op, type: op.op };
|
|
113
|
-
}
|
|
114
|
-
return op;
|
|
115
|
-
});
|
|
116
|
-
const payload = { blueprintPath, operations };
|
|
117
|
-
if (typeof params.compile === 'boolean')
|
|
118
|
-
payload.compile = params.compile;
|
|
119
|
-
if (typeof params.save === 'boolean')
|
|
120
|
-
payload.save = params.save;
|
|
121
|
-
const res = await this.sendAction('blueprint_modify_scs', payload, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
122
|
-
if (res && res.result && typeof res.result === 'object' && res.result?.error === 'SCS_UNAVAILABLE') {
|
|
123
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
124
|
-
return { success: false, error: 'SCS_UNAVAILABLE', message: 'Plugin does not support construction script modification (blueprint_modify_scs)' };
|
|
125
|
-
}
|
|
126
|
-
if (res && res.success)
|
|
127
|
-
this.pluginBlueprintActionsAvailable = true;
|
|
128
|
-
if (res && this.isUnknownActionResponse(res)) {
|
|
129
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
130
|
-
}
|
|
131
|
-
return res;
|
|
132
|
-
}
|
|
133
|
-
async addComponent(params) {
|
|
134
|
-
const blueprintName = coerceString(params.blueprintName);
|
|
135
|
-
if (!blueprintName)
|
|
136
|
-
return { success: false, message: 'Blueprint name is required', error: 'INVALID_BLUEPRINT' };
|
|
137
|
-
const componentClass = coerceString(params.componentType);
|
|
138
|
-
if (!componentClass)
|
|
139
|
-
return { success: false, message: 'Component class is required', error: 'INVALID_COMPONENT_CLASS' };
|
|
140
|
-
const rawComponentName = coerceString(params.componentName) ?? params.componentName;
|
|
141
|
-
if (!rawComponentName)
|
|
142
|
-
return { success: false, message: 'Component name is required', error: 'INVALID_COMPONENT_NAME' };
|
|
143
|
-
const sanitizedComponentName = rawComponentName.replace(/[^A-Za-z0-9_]/g, '_');
|
|
144
|
-
const candidates = this.buildCandidates(blueprintName);
|
|
145
|
-
const primary = candidates[0];
|
|
146
|
-
if (!primary)
|
|
147
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
148
|
-
try {
|
|
149
|
-
const op = { type: 'add_component', componentName: sanitizedComponentName, componentClass, attachTo: params.attachTo, transform: params.transform, properties: params.properties };
|
|
150
|
-
const svcResult = await this.modifyConstructionScript({ blueprintPath: primary, operations: [op], compile: params.compile, save: params.save, timeoutMs: params.timeoutMs, waitForCompletion: params.waitForCompletion, waitForCompletionTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
151
|
-
if (svcResult && svcResult.success) {
|
|
152
|
-
this.pluginBlueprintActionsAvailable = true;
|
|
153
|
-
return { ...svcResult, component: sanitizedComponentName, componentName: sanitizedComponentName, componentType: componentClass, componentClass, blueprintPath: svcResult.blueprintPath ?? primary };
|
|
154
|
-
}
|
|
155
|
-
if (svcResult && (this.isUnknownActionResponse(svcResult) || (svcResult.error && svcResult.error === 'SCS_UNAVAILABLE'))) {
|
|
156
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
157
|
-
return { success: false, error: 'SCS_UNAVAILABLE', message: 'Plugin does not support construction script modification (blueprint_modify_scs)' };
|
|
158
|
-
}
|
|
159
|
-
return svcResult;
|
|
160
|
-
}
|
|
161
|
-
catch (err) {
|
|
162
|
-
return { success: false, error: String(err) };
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
async waitForBlueprint(blueprintRef, options) {
|
|
166
|
-
const candidates = Array.isArray(blueprintRef) ? blueprintRef : this.buildCandidates(blueprintRef);
|
|
167
|
-
if (!candidates || candidates.length === 0)
|
|
168
|
-
return { success: false, error: 'Invalid blueprint reference', checked: [] };
|
|
169
|
-
const shouldExist = options?.shouldExist !== false;
|
|
170
|
-
if (this.pluginBlueprintActionsAvailable === false) {
|
|
171
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_exists' };
|
|
172
|
-
}
|
|
173
|
-
const envDefault = Number(process.env.MCP_AUTOMATION_SCS_TIMEOUT_MS ?? process.env.MCP_AUTOMATION_REQUEST_TIMEOUT_MS ?? '15000');
|
|
174
|
-
const defaultTimeout = Number.isFinite(envDefault) && envDefault > 0 ? envDefault : 15000;
|
|
175
|
-
const totalTimeout = typeof options?.timeoutMs === 'number' && options.timeoutMs > 0 ? options.timeoutMs : defaultTimeout;
|
|
176
|
-
const perCheck = Math.min(5000, Math.max(shouldExist ? 1000 : 250, Math.floor(totalTimeout / Math.max(shouldExist ? 6 : 1, 1))));
|
|
177
|
-
const unknownResponse = () => {
|
|
178
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
179
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_exists' };
|
|
180
|
-
};
|
|
181
|
-
const successResponse = (candidate, resolvedPath) => {
|
|
182
|
-
this.pluginBlueprintActionsAvailable = true;
|
|
183
|
-
return { success: true, found: resolvedPath ?? candidate };
|
|
184
|
-
};
|
|
185
|
-
const notFoundResponse = () => ({
|
|
186
|
-
success: false,
|
|
187
|
-
error: 'BLUEPRINT_NOT_FOUND',
|
|
188
|
-
message: 'Blueprint not found',
|
|
189
|
-
checked: candidates
|
|
190
|
-
});
|
|
191
|
-
const checkCandidates = async () => {
|
|
192
|
-
for (const candidate of candidates) {
|
|
193
|
-
try {
|
|
194
|
-
const resp = await this.sendAction('blueprint_exists', { blueprintCandidates: [candidate], requestedPath: candidate }, { timeoutMs: Math.min(perCheck, totalTimeout) });
|
|
195
|
-
if (!resp)
|
|
196
|
-
continue;
|
|
197
|
-
const resultObj = resp.result && typeof resp.result === 'object' ? resp.result : null;
|
|
198
|
-
const resolvedPath = resultObj?.blueprintPath;
|
|
199
|
-
const exists = resultObj?.exists === true;
|
|
200
|
-
if (exists) {
|
|
201
|
-
return successResponse(candidate, resolvedPath);
|
|
202
|
-
}
|
|
203
|
-
if (!shouldExist && resultObj && resultObj.exists === false) {
|
|
204
|
-
return notFoundResponse();
|
|
205
|
-
}
|
|
206
|
-
if (resp.success === false) {
|
|
207
|
-
if (this.isUnknownActionResponse(resp)) {
|
|
208
|
-
return unknownResponse();
|
|
209
|
-
}
|
|
210
|
-
return {
|
|
211
|
-
success: false,
|
|
212
|
-
error: resp.error ?? 'BLUEPRINT_CHECK_FAILED',
|
|
213
|
-
message: resp.message ?? 'Failed to verify blueprint existence'
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
catch (_err) {
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return null;
|
|
222
|
-
};
|
|
223
|
-
if (!shouldExist) {
|
|
224
|
-
const immediate = await checkCandidates();
|
|
225
|
-
if (immediate)
|
|
226
|
-
return immediate;
|
|
227
|
-
return notFoundResponse();
|
|
228
|
-
}
|
|
229
|
-
const start = Date.now();
|
|
230
|
-
while (Date.now() - start < totalTimeout) {
|
|
231
|
-
const result = await checkCandidates();
|
|
232
|
-
if (result)
|
|
233
|
-
return result;
|
|
234
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
235
|
-
}
|
|
236
|
-
if (this.pluginBlueprintActionsAvailable === null) {
|
|
237
|
-
return unknownResponse();
|
|
238
|
-
}
|
|
239
|
-
return { success: false, error: `Timeout waiting for blueprint after ${totalTimeout}ms`, checked: candidates };
|
|
240
|
-
}
|
|
241
|
-
async getBlueprint(params) {
|
|
242
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
243
|
-
const primary = candidates[0];
|
|
244
|
-
if (!primary)
|
|
245
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
246
|
-
try {
|
|
247
|
-
const pluginResp = await this.sendAction('blueprint_get', { blueprintCandidates: candidates, requestedPath: primary }, { timeoutMs: params.timeoutMs });
|
|
248
|
-
if (pluginResp && pluginResp.success) {
|
|
249
|
-
if (pluginResp && typeof pluginResp === 'object') {
|
|
250
|
-
return { ...pluginResp, blueprint: pluginResp.result, blueprintPath: primary };
|
|
251
|
-
}
|
|
252
|
-
return pluginResp;
|
|
253
|
-
}
|
|
254
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
255
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_get' };
|
|
256
|
-
}
|
|
257
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_GET_FAILED', message: pluginResp?.message ?? 'Failed to get blueprint via automation bridge' };
|
|
258
|
-
}
|
|
259
|
-
catch (err) {
|
|
260
|
-
return { success: false, error: String(err), message: String(err) };
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
async getBlueprintInfo(params) {
|
|
264
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
265
|
-
if (!blueprintPath) {
|
|
266
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
267
|
-
}
|
|
268
|
-
const candidates = this.buildCandidates(blueprintPath);
|
|
269
|
-
const primary = candidates[0] ?? blueprintPath;
|
|
270
|
-
try {
|
|
271
|
-
const resp = await this.sendAction('blueprint_get', { blueprintCandidates: candidates.length > 0 ? candidates : [primary], requestedPath: primary }, { timeoutMs: params.timeoutMs });
|
|
272
|
-
if (resp && resp.success) {
|
|
273
|
-
const result = resp.result ?? resp;
|
|
274
|
-
const resolvedPath = typeof result?.resolvedPath === 'string' ? result.resolvedPath : primary;
|
|
275
|
-
return {
|
|
276
|
-
success: true,
|
|
277
|
-
message: resp.message ?? `Blueprint metadata retrieved for ${resolvedPath}`,
|
|
278
|
-
blueprintPath: resolvedPath,
|
|
279
|
-
blueprint: result,
|
|
280
|
-
result,
|
|
281
|
-
requestId: resp.requestId
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
if (resp && this.isUnknownActionResponse(resp)) {
|
|
285
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_get' };
|
|
286
|
-
}
|
|
287
|
-
return { success: false, error: resp?.error ?? 'BLUEPRINT_GET_FAILED', message: resp?.message ?? 'Failed to get blueprint via automation bridge' };
|
|
288
|
-
}
|
|
289
|
-
catch (err) {
|
|
290
|
-
return { success: false, error: String(err), message: String(err) };
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
async probeSubobjectDataHandle(opts = {}) {
|
|
294
|
-
return await this.sendAction('blueprint_probe_subobject_handle', { componentClass: opts.componentClass });
|
|
295
|
-
}
|
|
296
|
-
async setBlueprintDefault(params) {
|
|
297
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
298
|
-
const primary = candidates[0];
|
|
299
|
-
if (!primary)
|
|
300
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
301
|
-
return await this.sendAction('blueprint_set_default', { blueprintCandidates: candidates, requestedPath: primary, propertyName: params.propertyName, value: params.value });
|
|
302
|
-
}
|
|
303
|
-
async addVariable(params) {
|
|
304
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
305
|
-
const primary = candidates[0];
|
|
306
|
-
if (!primary)
|
|
307
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
308
|
-
const pluginResp = await this.sendAction('blueprint_add_variable', { blueprintCandidates: candidates, requestedPath: primary, variableName: params.variableName, variableType: params.variableType, defaultValue: params.defaultValue, category: params.category, isReplicated: params.isReplicated, isPublic: params.isPublic, variablePinType: params.variablePinType }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
309
|
-
if (pluginResp && pluginResp.success) {
|
|
310
|
-
return pluginResp;
|
|
311
|
-
}
|
|
312
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
313
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_variable' };
|
|
314
|
-
}
|
|
315
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_ADD_VARIABLE_FAILED', message: pluginResp?.message ?? 'Failed to add variable via automation bridge' };
|
|
316
|
-
}
|
|
317
|
-
async removeVariable(params) {
|
|
318
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
319
|
-
const primary = candidates[0];
|
|
320
|
-
if (!primary)
|
|
321
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
322
|
-
const pluginResp = await this.sendAction('blueprint_remove_variable', { blueprintCandidates: candidates, requestedPath: primary, variableName: params.variableName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
323
|
-
if (pluginResp && pluginResp.success)
|
|
324
|
-
return pluginResp;
|
|
325
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
326
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_remove_variable' };
|
|
327
|
-
}
|
|
328
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_REMOVE_VARIABLE_FAILED', message: pluginResp?.message ?? 'Failed to remove variable via automation bridge' };
|
|
329
|
-
}
|
|
330
|
-
async renameVariable(params) {
|
|
331
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
332
|
-
const primary = candidates[0];
|
|
333
|
-
if (!primary)
|
|
334
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
335
|
-
const pluginResp = await this.sendAction('blueprint_rename_variable', { blueprintCandidates: candidates, requestedPath: primary, oldName: params.oldName, newName: params.newName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
336
|
-
if (pluginResp && pluginResp.success)
|
|
337
|
-
return pluginResp;
|
|
338
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
339
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_rename_variable' };
|
|
340
|
-
}
|
|
341
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_RENAME_VARIABLE_FAILED', message: pluginResp?.message ?? 'Failed to rename variable via automation bridge' };
|
|
342
|
-
}
|
|
343
|
-
async addEvent(params) {
|
|
344
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
345
|
-
const primary = candidates[0];
|
|
346
|
-
if (!primary)
|
|
347
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
348
|
-
const pluginResp = await this.sendAction('blueprint_add_event', { blueprintCandidates: candidates, requestedPath: primary, eventType: params.eventType, customEventName: params.customEventName, parameters: params.parameters }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
349
|
-
if (pluginResp && pluginResp.success) {
|
|
350
|
-
return pluginResp;
|
|
351
|
-
}
|
|
352
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
353
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_event' };
|
|
354
|
-
}
|
|
355
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_ADD_EVENT_FAILED', message: pluginResp?.message ?? 'Failed to add event via automation bridge' };
|
|
356
|
-
}
|
|
357
|
-
async removeEvent(params) {
|
|
358
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
359
|
-
const primary = candidates[0];
|
|
360
|
-
if (!primary)
|
|
361
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
362
|
-
const finalEventName = params.eventName || params.customEventName;
|
|
363
|
-
if (!finalEventName)
|
|
364
|
-
return { success: false, error: 'INVALID_ARGUMENT', message: 'eventName is required' };
|
|
365
|
-
try {
|
|
366
|
-
const pluginResp = await this.sendAction('blueprint_remove_event', { blueprintCandidates: candidates, requestedPath: primary, eventName: finalEventName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
367
|
-
if (pluginResp && pluginResp.success) {
|
|
368
|
-
return pluginResp;
|
|
369
|
-
}
|
|
370
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
371
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_remove_event' };
|
|
372
|
-
}
|
|
373
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_REMOVE_EVENT_FAILED', message: pluginResp?.message ?? 'Failed to remove event via automation bridge' };
|
|
374
|
-
}
|
|
375
|
-
catch (err) {
|
|
376
|
-
return { success: false, error: String(err), message: String(err) };
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
async addFunction(params) {
|
|
380
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
381
|
-
const primary = candidates[0];
|
|
382
|
-
if (!primary)
|
|
383
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
384
|
-
const pluginResp = await this.sendAction('blueprint_add_function', { blueprintCandidates: candidates, requestedPath: primary, functionName: params.functionName, inputs: params.inputs, outputs: params.outputs, isPublic: params.isPublic, category: params.category }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
385
|
-
if (pluginResp && pluginResp.success) {
|
|
386
|
-
return pluginResp;
|
|
387
|
-
}
|
|
388
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
389
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_function' };
|
|
390
|
-
}
|
|
391
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_ADD_FUNCTION_FAILED', message: pluginResp?.message ?? 'Failed to add function via automation bridge' };
|
|
392
|
-
}
|
|
393
|
-
async setVariableMetadata(params) {
|
|
394
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
395
|
-
const primary = candidates[0];
|
|
396
|
-
if (!primary)
|
|
397
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
398
|
-
const pluginResp = await this.sendAction('blueprint_set_variable_metadata', { blueprintCandidates: candidates, requestedPath: primary, variableName: params.variableName, metadata: params.metadata }, { timeoutMs: params.timeoutMs });
|
|
399
|
-
if (pluginResp && pluginResp.success) {
|
|
400
|
-
return pluginResp;
|
|
401
|
-
}
|
|
402
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
403
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_set_variable_metadata' };
|
|
404
|
-
}
|
|
405
|
-
return { success: false, error: pluginResp?.error ?? 'SET_VARIABLE_METADATA_FAILED', message: pluginResp?.message ?? 'Failed to set variable metadata via automation bridge' };
|
|
406
|
-
}
|
|
407
|
-
async addConstructionScript(params) {
|
|
408
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
409
|
-
const primary = candidates[0];
|
|
410
|
-
if (!primary)
|
|
411
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
412
|
-
const pluginResp = await this.sendAction('blueprint_add_construction_script', { blueprintCandidates: candidates, requestedPath: primary, scriptName: params.scriptName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
|
|
413
|
-
if (pluginResp && pluginResp.success)
|
|
414
|
-
return pluginResp;
|
|
415
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
416
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_construction_script' };
|
|
417
|
-
}
|
|
418
|
-
return { success: false, error: pluginResp?.error ?? 'ADD_CONSTRUCTION_SCRIPT_FAILED', message: pluginResp?.message ?? 'Failed to add construction script via automation bridge' };
|
|
419
|
-
}
|
|
420
|
-
async compileBlueprint(params) {
|
|
421
|
-
try {
|
|
422
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
423
|
-
const primary = candidates[0] ?? params.blueprintName;
|
|
424
|
-
const pluginResp = await this.sendAction('blueprint_compile', { requestedPath: primary, saveAfterCompile: params.saveAfterCompile });
|
|
425
|
-
if (pluginResp && pluginResp.success) {
|
|
426
|
-
return {
|
|
427
|
-
...pluginResp,
|
|
428
|
-
blueprint: primary,
|
|
429
|
-
message: pluginResp.message || `Compiled ${primary}`
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
433
|
-
this.pluginBlueprintActionsAvailable = false;
|
|
434
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_compile' };
|
|
435
|
-
}
|
|
436
|
-
return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_COMPILE_FAILED', message: pluginResp?.message ?? 'Failed to compile blueprint via automation bridge' };
|
|
437
|
-
}
|
|
438
|
-
catch (err) {
|
|
439
|
-
return { success: false, error: String(err) };
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
async getBlueprintSCS(params) {
|
|
443
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
444
|
-
if (!blueprintPath) {
|
|
445
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
446
|
-
}
|
|
447
|
-
try {
|
|
448
|
-
const pluginResp = await this.sendAction('get_blueprint_scs', { blueprint_path: blueprintPath }, { timeoutMs: params.timeoutMs });
|
|
449
|
-
if (pluginResp && pluginResp.success)
|
|
450
|
-
return pluginResp;
|
|
451
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
452
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement get_blueprint_scs' };
|
|
453
|
-
}
|
|
454
|
-
return { success: false, error: pluginResp?.error ?? 'GET_SCS_FAILED', message: pluginResp?.message ?? 'Failed to get SCS via automation bridge' };
|
|
455
|
-
}
|
|
456
|
-
catch (err) {
|
|
457
|
-
return { success: false, error: String(err), message: String(err) };
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
async addSCSComponent(params) {
|
|
461
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
462
|
-
if (!blueprintPath) {
|
|
463
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
464
|
-
}
|
|
465
|
-
const componentClass = coerceString(params.componentClass);
|
|
466
|
-
if (!componentClass) {
|
|
467
|
-
return { success: false, error: 'INVALID_COMPONENT_CLASS', message: 'Component class is required' };
|
|
468
|
-
}
|
|
469
|
-
const componentName = coerceString(params.componentName);
|
|
470
|
-
if (!componentName) {
|
|
471
|
-
return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' };
|
|
472
|
-
}
|
|
473
|
-
try {
|
|
474
|
-
const payload = {
|
|
475
|
-
blueprint_path: blueprintPath,
|
|
476
|
-
component_class: componentClass,
|
|
477
|
-
component_name: componentName
|
|
478
|
-
};
|
|
479
|
-
if (params.parentComponent) {
|
|
480
|
-
payload.parent_component = params.parentComponent;
|
|
481
|
-
}
|
|
482
|
-
if (params.meshPath) {
|
|
483
|
-
payload.mesh_path = params.meshPath;
|
|
484
|
-
}
|
|
485
|
-
if (params.materialPath) {
|
|
486
|
-
payload.material_path = params.materialPath;
|
|
487
|
-
}
|
|
488
|
-
const pluginResp = await this.sendAction('add_scs_component', payload, { timeoutMs: params.timeoutMs });
|
|
489
|
-
if (pluginResp && pluginResp.success === false) {
|
|
490
|
-
if (pluginResp?.message) {
|
|
491
|
-
this.log.warn?.(`addSCSComponent reported warning: ${pluginResp?.message}`);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
if (pluginResp && pluginResp.success)
|
|
495
|
-
return pluginResp;
|
|
496
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
497
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement add_scs_component' };
|
|
498
|
-
}
|
|
499
|
-
return { success: false, error: pluginResp?.error ?? 'ADD_SCS_COMPONENT_FAILED', message: pluginResp?.message ?? 'Failed to add SCS component via automation bridge' };
|
|
500
|
-
}
|
|
501
|
-
catch (err) {
|
|
502
|
-
return { success: false, error: String(err), message: String(err) };
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
async removeSCSComponent(params) {
|
|
506
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
507
|
-
if (!blueprintPath) {
|
|
508
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
509
|
-
}
|
|
510
|
-
const componentName = coerceString(params.componentName);
|
|
511
|
-
if (!componentName) {
|
|
512
|
-
return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' };
|
|
513
|
-
}
|
|
514
|
-
try {
|
|
515
|
-
const pluginResp = await this.sendAction('remove_scs_component', { blueprint_path: blueprintPath, component_name: componentName }, { timeoutMs: params.timeoutMs });
|
|
516
|
-
if (pluginResp && pluginResp.success === false) {
|
|
517
|
-
if (pluginResp?.message) {
|
|
518
|
-
this.log.warn?.(`removeSCSComponent reported warning: ${pluginResp?.message}`);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
if (pluginResp && pluginResp.success)
|
|
522
|
-
return pluginResp;
|
|
523
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
524
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement remove_scs_component' };
|
|
525
|
-
}
|
|
526
|
-
return { success: false, error: pluginResp?.error ?? 'REMOVE_SCS_COMPONENT_FAILED', message: pluginResp?.message ?? 'Failed to remove SCS component via automation bridge' };
|
|
527
|
-
}
|
|
528
|
-
catch (err) {
|
|
529
|
-
return { success: false, error: String(err), message: String(err) };
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
async reparentSCSComponent(params) {
|
|
533
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
534
|
-
if (!blueprintPath) {
|
|
535
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
536
|
-
}
|
|
537
|
-
const componentName = coerceString(params.componentName);
|
|
538
|
-
if (!componentName) {
|
|
539
|
-
return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' };
|
|
540
|
-
}
|
|
541
|
-
try {
|
|
542
|
-
const pluginResp = await this.sendAction('reparent_scs_component', {
|
|
543
|
-
blueprint_path: blueprintPath,
|
|
544
|
-
component_name: componentName,
|
|
545
|
-
new_parent: params.newParent || ''
|
|
546
|
-
}, { timeoutMs: params.timeoutMs });
|
|
547
|
-
if (pluginResp && pluginResp.success === false) {
|
|
548
|
-
if (pluginResp?.message) {
|
|
549
|
-
this.log.warn?.(`reparentSCSComponent reported warning: ${pluginResp?.message}`);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
if (pluginResp && pluginResp.success)
|
|
553
|
-
return pluginResp;
|
|
554
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
555
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement reparent_scs_component' };
|
|
556
|
-
}
|
|
557
|
-
return { success: false, error: pluginResp?.error ?? 'REPARENT_SCS_COMPONENT_FAILED', message: pluginResp?.message ?? 'Failed to reparent SCS component via automation bridge' };
|
|
558
|
-
}
|
|
559
|
-
catch (err) {
|
|
560
|
-
return { success: false, error: String(err), message: String(err) };
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
async setSCSComponentTransform(params) {
|
|
564
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
565
|
-
if (!blueprintPath) {
|
|
566
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
567
|
-
}
|
|
568
|
-
const componentName = coerceString(params.componentName);
|
|
569
|
-
if (!componentName) {
|
|
570
|
-
return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' };
|
|
571
|
-
}
|
|
572
|
-
try {
|
|
573
|
-
const payload = {
|
|
574
|
-
blueprint_path: blueprintPath,
|
|
575
|
-
component_name: componentName
|
|
576
|
-
};
|
|
577
|
-
if (params.location)
|
|
578
|
-
payload.location = params.location;
|
|
579
|
-
if (params.rotation)
|
|
580
|
-
payload.rotation = params.rotation;
|
|
581
|
-
if (params.scale)
|
|
582
|
-
payload.scale = params.scale;
|
|
583
|
-
const pluginResp = await this.sendAction('set_scs_component_transform', payload, { timeoutMs: params.timeoutMs });
|
|
584
|
-
if (pluginResp && pluginResp.success === false) {
|
|
585
|
-
if (pluginResp?.message) {
|
|
586
|
-
this.log.warn?.(`setSCSComponentTransform reported warning: ${pluginResp?.message}`);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
if (pluginResp && pluginResp.success)
|
|
590
|
-
return pluginResp;
|
|
591
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
592
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement set_scs_component_transform' };
|
|
593
|
-
}
|
|
594
|
-
return { success: false, error: pluginResp?.error ?? 'SET_SCS_TRANSFORM_FAILED', message: pluginResp?.message ?? 'Failed to set SCS component transform via automation bridge' };
|
|
595
|
-
}
|
|
596
|
-
catch (err) {
|
|
597
|
-
return { success: false, error: String(err), message: String(err) };
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
async setSCSComponentProperty(params) {
|
|
601
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
602
|
-
if (!blueprintPath) {
|
|
603
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
604
|
-
}
|
|
605
|
-
const componentName = coerceString(params.componentName);
|
|
606
|
-
if (!componentName) {
|
|
607
|
-
return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' };
|
|
608
|
-
}
|
|
609
|
-
const propertyName = coerceString(params.propertyName);
|
|
610
|
-
if (!propertyName) {
|
|
611
|
-
return { success: false, error: 'INVALID_PROPERTY_NAME', message: 'Property name is required' };
|
|
612
|
-
}
|
|
613
|
-
try {
|
|
614
|
-
const propertyValueJson = JSON.stringify({ value: params.propertyValue });
|
|
615
|
-
const pluginResp = await this.sendAction('set_scs_component_property', {
|
|
616
|
-
blueprint_path: blueprintPath,
|
|
617
|
-
component_name: componentName,
|
|
618
|
-
property_name: propertyName,
|
|
619
|
-
property_value: propertyValueJson
|
|
620
|
-
}, { timeoutMs: params.timeoutMs });
|
|
621
|
-
if (pluginResp && pluginResp.success === false) {
|
|
622
|
-
if (pluginResp?.message) {
|
|
623
|
-
this.log.warn?.(`setSCSComponentProperty reported warning: ${pluginResp?.message}`);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
if (pluginResp && pluginResp.success)
|
|
627
|
-
return pluginResp;
|
|
628
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
629
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement set_scs_component_property' };
|
|
630
|
-
}
|
|
631
|
-
return { success: false, error: pluginResp?.error ?? 'SET_SCS_PROPERTY_FAILED', message: pluginResp?.message ?? 'Failed to set SCS component property via automation bridge' };
|
|
632
|
-
}
|
|
633
|
-
catch (err) {
|
|
634
|
-
return { success: false, error: String(err), message: String(err) };
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
async getNodes(params) {
|
|
638
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
639
|
-
if (!blueprintPath) {
|
|
640
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
641
|
-
}
|
|
642
|
-
try {
|
|
643
|
-
const payload = {
|
|
644
|
-
subAction: 'get_nodes',
|
|
645
|
-
blueprintPath: blueprintPath,
|
|
646
|
-
graphName: params.graphName || 'EventGraph'
|
|
647
|
-
};
|
|
648
|
-
const pluginResp = await this.sendAction('manage_blueprint_graph', payload, { timeoutMs: params.timeoutMs });
|
|
649
|
-
if (pluginResp && pluginResp.success) {
|
|
650
|
-
return {
|
|
651
|
-
success: true,
|
|
652
|
-
nodes: pluginResp.result.nodes,
|
|
653
|
-
graphName: pluginResp.result.graphName
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
|
|
657
|
-
return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement get_nodes' };
|
|
658
|
-
}
|
|
659
|
-
return { success: false, error: pluginResp?.error ?? 'GET_NODES_FAILED', message: pluginResp?.message ?? 'Failed to get blueprint nodes' };
|
|
660
|
-
}
|
|
661
|
-
catch (err) {
|
|
662
|
-
return { success: false, error: String(err), message: String(err) };
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
async addNode(params) {
|
|
666
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
667
|
-
const primary = candidates[0];
|
|
668
|
-
if (!primary)
|
|
669
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
670
|
-
const payload = {
|
|
671
|
-
subAction: 'create_node',
|
|
672
|
-
assetPath: primary,
|
|
673
|
-
nodeType: params.nodeType,
|
|
674
|
-
graphName: params.graphName,
|
|
675
|
-
memberName: params.functionName,
|
|
676
|
-
variableName: params.variableName,
|
|
677
|
-
nodeName: params.nodeName,
|
|
678
|
-
eventName: params.eventName,
|
|
679
|
-
memberClass: params.memberClass,
|
|
680
|
-
x: params.posX,
|
|
681
|
-
y: params.posY
|
|
682
|
-
};
|
|
683
|
-
const res = await this.sendAction('manage_blueprint_graph', payload, { timeoutMs: params.timeoutMs });
|
|
684
|
-
return res;
|
|
685
|
-
}
|
|
686
|
-
async deleteNode(params) {
|
|
687
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
688
|
-
if (!blueprintPath)
|
|
689
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
690
|
-
if (!params.nodeId)
|
|
691
|
-
return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' };
|
|
692
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
693
|
-
subAction: 'delete_node',
|
|
694
|
-
blueprintPath: blueprintPath,
|
|
695
|
-
graphName: params.graphName || 'EventGraph',
|
|
696
|
-
nodeId: params.nodeId
|
|
697
|
-
}, { timeoutMs: params.timeoutMs });
|
|
698
|
-
return res;
|
|
699
|
-
}
|
|
700
|
-
async createRerouteNode(params) {
|
|
701
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
702
|
-
if (!blueprintPath)
|
|
703
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
704
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
705
|
-
subAction: 'create_reroute_node',
|
|
706
|
-
blueprintPath: blueprintPath,
|
|
707
|
-
graphName: params.graphName || 'EventGraph',
|
|
708
|
-
x: params.x,
|
|
709
|
-
y: params.y
|
|
710
|
-
}, { timeoutMs: params.timeoutMs });
|
|
711
|
-
return res;
|
|
712
|
-
}
|
|
713
|
-
async setNodeProperty(params) {
|
|
714
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
715
|
-
if (!blueprintPath)
|
|
716
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
717
|
-
if (!params.nodeId)
|
|
718
|
-
return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' };
|
|
719
|
-
if (!params.propertyName)
|
|
720
|
-
return { success: false, error: 'INVALID_PROPERTY', message: 'Property name is required' };
|
|
721
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
722
|
-
subAction: 'set_node_property',
|
|
723
|
-
blueprintPath: blueprintPath,
|
|
724
|
-
graphName: params.graphName || 'EventGraph',
|
|
725
|
-
nodeId: params.nodeId,
|
|
726
|
-
propertyName: params.propertyName,
|
|
727
|
-
value: params.value
|
|
728
|
-
}, { timeoutMs: params.timeoutMs });
|
|
729
|
-
return res;
|
|
730
|
-
}
|
|
731
|
-
async getNodeDetails(params) {
|
|
732
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
733
|
-
if (!blueprintPath)
|
|
734
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
735
|
-
if (!params.nodeId)
|
|
736
|
-
return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' };
|
|
737
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
738
|
-
subAction: 'get_node_details',
|
|
739
|
-
blueprintPath: blueprintPath,
|
|
740
|
-
graphName: params.graphName || 'EventGraph',
|
|
741
|
-
nodeId: params.nodeId
|
|
742
|
-
}, { timeoutMs: params.timeoutMs });
|
|
743
|
-
return res;
|
|
744
|
-
}
|
|
745
|
-
async getGraphDetails(params) {
|
|
746
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
747
|
-
if (!blueprintPath)
|
|
748
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
749
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
750
|
-
subAction: 'get_graph_details',
|
|
751
|
-
blueprintPath: blueprintPath,
|
|
752
|
-
graphName: params.graphName || 'EventGraph'
|
|
753
|
-
}, { timeoutMs: params.timeoutMs });
|
|
754
|
-
return res;
|
|
755
|
-
}
|
|
756
|
-
async getPinDetails(params) {
|
|
757
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
758
|
-
if (!blueprintPath)
|
|
759
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
760
|
-
if (!params.nodeId)
|
|
761
|
-
return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' };
|
|
762
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
763
|
-
subAction: 'get_pin_details',
|
|
764
|
-
blueprintPath: blueprintPath,
|
|
765
|
-
graphName: params.graphName || 'EventGraph',
|
|
766
|
-
nodeId: params.nodeId,
|
|
767
|
-
pinName: params.pinName
|
|
768
|
-
}, { timeoutMs: params.timeoutMs });
|
|
769
|
-
return res;
|
|
770
|
-
}
|
|
771
|
-
async listNodeTypes(params = {}) {
|
|
772
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
773
|
-
subAction: 'list_node_types',
|
|
774
|
-
blueprintPath: params.blueprintPath || '/Game/Temp',
|
|
775
|
-
graphName: 'EventGraph'
|
|
776
|
-
}, { timeoutMs: params.timeoutMs });
|
|
777
|
-
return res;
|
|
778
|
-
}
|
|
779
|
-
async setPinDefaultValue(params) {
|
|
780
|
-
const blueprintPath = coerceString(params.blueprintPath);
|
|
781
|
-
if (!blueprintPath)
|
|
782
|
-
return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' };
|
|
783
|
-
if (!params.nodeId)
|
|
784
|
-
return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' };
|
|
785
|
-
if (!params.pinName)
|
|
786
|
-
return { success: false, error: 'INVALID_PIN_NAME', message: 'Pin name is required' };
|
|
787
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
788
|
-
subAction: 'set_pin_default_value',
|
|
789
|
-
blueprintPath: blueprintPath,
|
|
790
|
-
graphName: params.graphName || 'EventGraph',
|
|
791
|
-
nodeId: params.nodeId,
|
|
792
|
-
pinName: params.pinName,
|
|
793
|
-
value: params.value
|
|
794
|
-
}, { timeoutMs: params.timeoutMs });
|
|
795
|
-
return res;
|
|
796
|
-
}
|
|
797
|
-
async connectPins(params) {
|
|
798
|
-
const candidates = this.buildCandidates(params.blueprintName);
|
|
799
|
-
const primary = candidates[0];
|
|
800
|
-
if (!primary)
|
|
801
|
-
return { success: false, error: 'Invalid blueprint name' };
|
|
802
|
-
let fromNodeId = params.sourceNodeGuid;
|
|
803
|
-
let fromPinName = params.sourcePinName;
|
|
804
|
-
if (fromNodeId && fromNodeId.includes('.') && !fromPinName) {
|
|
805
|
-
const parts = fromNodeId.split('.');
|
|
806
|
-
fromNodeId = parts[0];
|
|
807
|
-
fromPinName = parts.slice(1).join('.');
|
|
808
|
-
}
|
|
809
|
-
let toNodeId = params.targetNodeGuid;
|
|
810
|
-
let toPinName = params.targetPinName;
|
|
811
|
-
if (toNodeId && toNodeId.includes('.') && !toPinName) {
|
|
812
|
-
const parts = toNodeId.split('.');
|
|
813
|
-
toNodeId = parts[0];
|
|
814
|
-
toPinName = parts.slice(1).join('.');
|
|
815
|
-
}
|
|
816
|
-
const res = await this.sendAction('manage_blueprint_graph', {
|
|
817
|
-
subAction: 'connect_pins',
|
|
818
|
-
assetPath: primary,
|
|
819
|
-
graphName: 'EventGraph',
|
|
820
|
-
fromNodeId: fromNodeId,
|
|
821
|
-
toNodeId: toNodeId,
|
|
822
|
-
fromPinName: fromPinName,
|
|
823
|
-
toPinName: toPinName
|
|
824
|
-
}, { timeoutMs: params.timeoutMs });
|
|
825
|
-
return res;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
//# sourceMappingURL=blueprint.js.map
|