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
|
@@ -1,776 +0,0 @@
|
|
|
1
|
-
import { sanitizePath } from '../utils/path-security.js';
|
|
2
|
-
import { sanitizeAssetName, sanitizePath as normalizeAndSanitizePath } from '../utils/validation.js';
|
|
3
|
-
export const scalarResolvers = {
|
|
4
|
-
Vector: {
|
|
5
|
-
serialize: (value) => {
|
|
6
|
-
if (!value)
|
|
7
|
-
return null;
|
|
8
|
-
return typeof value === 'object' && 'x' in value && 'y' in value && 'z' in value
|
|
9
|
-
? value
|
|
10
|
-
: null;
|
|
11
|
-
},
|
|
12
|
-
parseValue: (value) => value,
|
|
13
|
-
parseLiteral: (ast) => {
|
|
14
|
-
if (ast.kind === 'ObjectValue' && ast.fields) {
|
|
15
|
-
const result = {};
|
|
16
|
-
ast.fields.forEach((field) => {
|
|
17
|
-
result[field.name.value] = field.value.value;
|
|
18
|
-
});
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
Rotator: {
|
|
25
|
-
serialize: (value) => {
|
|
26
|
-
if (!value)
|
|
27
|
-
return null;
|
|
28
|
-
return typeof value === 'object' && 'pitch' in value && 'yaw' in value && 'roll' in value
|
|
29
|
-
? value
|
|
30
|
-
: null;
|
|
31
|
-
},
|
|
32
|
-
parseValue: (value) => value,
|
|
33
|
-
parseLiteral: (ast) => {
|
|
34
|
-
if (ast.kind === 'ObjectValue' && ast.fields) {
|
|
35
|
-
const result = {};
|
|
36
|
-
ast.fields.forEach((field) => {
|
|
37
|
-
result[field.name.value] = field.value.value;
|
|
38
|
-
});
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
Transform: {
|
|
45
|
-
serialize: (value) => value,
|
|
46
|
-
parseValue: (value) => value,
|
|
47
|
-
parseLiteral: (ast) => {
|
|
48
|
-
if (ast.kind === 'ObjectValue' && ast.fields) {
|
|
49
|
-
const result = {};
|
|
50
|
-
ast.fields.forEach((field) => {
|
|
51
|
-
if (field.value.kind === 'ObjectValue' && field.value.fields) {
|
|
52
|
-
result[field.name.value] = {};
|
|
53
|
-
const nestedObj = result[field.name.value];
|
|
54
|
-
field.value.fields.forEach((f) => {
|
|
55
|
-
nestedObj[f.name.value] = f.value.value;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
result[field.name.value] = field.value.value;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
JSON: {
|
|
68
|
-
serialize: (value) => value,
|
|
69
|
-
parseValue: (value) => value,
|
|
70
|
-
parseLiteral: (ast) => {
|
|
71
|
-
switch (ast.kind) {
|
|
72
|
-
case 'StringValue':
|
|
73
|
-
return ast.value;
|
|
74
|
-
case 'BooleanValue':
|
|
75
|
-
return ast.value;
|
|
76
|
-
case 'IntValue':
|
|
77
|
-
case 'FloatValue':
|
|
78
|
-
return Number(ast.value);
|
|
79
|
-
case 'ObjectValue':
|
|
80
|
-
if (ast.fields) {
|
|
81
|
-
const result = {};
|
|
82
|
-
ast.fields.forEach((field) => {
|
|
83
|
-
result[field.name.value] = scalarResolvers.JSON.parseLiteral(field.value);
|
|
84
|
-
});
|
|
85
|
-
return result;
|
|
86
|
-
}
|
|
87
|
-
return {};
|
|
88
|
-
case 'ListValue':
|
|
89
|
-
return (ast.values ?? []).map((v) => scalarResolvers.JSON.parseLiteral(v));
|
|
90
|
-
default:
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
import { Logger } from '../utils/logger.js';
|
|
97
|
-
const log = new Logger('GraphQL:Resolvers');
|
|
98
|
-
class GraphQLResolverError extends Error {
|
|
99
|
-
extensions;
|
|
100
|
-
constructor(message, code = 'UNREAL_ENGINE_ERROR', originalError) {
|
|
101
|
-
super(message);
|
|
102
|
-
this.name = 'GraphQLResolverError';
|
|
103
|
-
this.extensions = {
|
|
104
|
-
code,
|
|
105
|
-
originalError: originalError?.message
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function createResolverError(operation, error) {
|
|
110
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
111
|
-
log.error(`${operation} failed:`, message);
|
|
112
|
-
return new GraphQLResolverError(`${operation} failed: ${message}`, 'UNREAL_ENGINE_ERROR', error instanceof Error ? error : undefined);
|
|
113
|
-
}
|
|
114
|
-
function logAutomationFailure(source, response) {
|
|
115
|
-
try {
|
|
116
|
-
if (!response || response.success !== false) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const errorText = (response.error || response.message || '').toString();
|
|
120
|
-
if (errorText.length === 0) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
log.error(`${source} automation failure:`, errorText);
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
async function getActorProperties(bridge, actorName) {
|
|
129
|
-
try {
|
|
130
|
-
const result = await bridge.getObjectProperty({
|
|
131
|
-
objectPath: actorName,
|
|
132
|
-
propertyName: '*',
|
|
133
|
-
timeoutMs: 5000
|
|
134
|
-
});
|
|
135
|
-
return result.success ? result.value || {} : {};
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
log.error('Failed to get actor properties:', error);
|
|
139
|
-
return {};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
async function listAssets(automationBridge, filter, pagination) {
|
|
143
|
-
try {
|
|
144
|
-
const safeFilter = { ...filter };
|
|
145
|
-
if (safeFilter.pathStartsWith) {
|
|
146
|
-
safeFilter.pathStartsWith = normalizeAndSanitizePath(safeFilter.pathStartsWith);
|
|
147
|
-
}
|
|
148
|
-
const response = await automationBridge.sendAutomationRequest('list_assets', {
|
|
149
|
-
filter: safeFilter,
|
|
150
|
-
pagination: pagination || { offset: 0, limit: 50 }
|
|
151
|
-
}, { timeoutMs: 30000 });
|
|
152
|
-
if (response.success && response.result) {
|
|
153
|
-
const result = response.result;
|
|
154
|
-
return {
|
|
155
|
-
assets: (result.assets || []),
|
|
156
|
-
totalCount: (result.totalCount || 0)
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
logAutomationFailure('list_assets', response);
|
|
160
|
-
log.warn('Failed to list assets - returning empty set');
|
|
161
|
-
return { assets: [], totalCount: 0 };
|
|
162
|
-
}
|
|
163
|
-
catch (error) {
|
|
164
|
-
log.error('Failed to list assets:', error);
|
|
165
|
-
throw createResolverError('listAssets', error);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
async function listActors(automationBridge, filter) {
|
|
169
|
-
try {
|
|
170
|
-
const response = await automationBridge.sendAutomationRequest('list_actors', {
|
|
171
|
-
filter: filter || {}
|
|
172
|
-
}, { timeoutMs: 30000 });
|
|
173
|
-
if (response.success && response.result) {
|
|
174
|
-
const result = response.result;
|
|
175
|
-
return {
|
|
176
|
-
actors: (result.actors || [])
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
logAutomationFailure('list_actors', response);
|
|
180
|
-
return { actors: [] };
|
|
181
|
-
}
|
|
182
|
-
catch (error) {
|
|
183
|
-
log.error('Failed to list actors:', error);
|
|
184
|
-
return { actors: [] };
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
export const resolvers = {
|
|
188
|
-
Query: {
|
|
189
|
-
assets: async (_, args, context) => {
|
|
190
|
-
const { filter, pagination } = args;
|
|
191
|
-
const { assets, totalCount } = await listAssets(context.automationBridge, filter, pagination);
|
|
192
|
-
const edges = assets.map((asset, index) => ({
|
|
193
|
-
node: asset,
|
|
194
|
-
cursor: Buffer.from(`${asset.path}:${index}`).toString('base64')
|
|
195
|
-
}));
|
|
196
|
-
return {
|
|
197
|
-
edges,
|
|
198
|
-
pageInfo: {
|
|
199
|
-
hasNextPage: (pagination?.offset || 0) + assets.length < totalCount,
|
|
200
|
-
hasPreviousPage: (pagination?.offset || 0) > 0,
|
|
201
|
-
startCursor: edges.length > 0 ? edges[0].cursor : null,
|
|
202
|
-
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null
|
|
203
|
-
},
|
|
204
|
-
totalCount
|
|
205
|
-
};
|
|
206
|
-
},
|
|
207
|
-
asset: async (_, { path }, context) => {
|
|
208
|
-
try {
|
|
209
|
-
if (!context.loaders) {
|
|
210
|
-
throw new Error('Loaders not initialized');
|
|
211
|
-
}
|
|
212
|
-
return await context.loaders.assetLoader.load(sanitizePath(path));
|
|
213
|
-
}
|
|
214
|
-
catch (error) {
|
|
215
|
-
log.error('Failed to get asset:', error);
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
actors: async (_, args, context) => {
|
|
220
|
-
const { filter, pagination } = args;
|
|
221
|
-
const { actors } = await listActors(context.automationBridge, filter);
|
|
222
|
-
const offset = pagination?.offset ?? 0;
|
|
223
|
-
const limit = pagination?.limit ?? 50;
|
|
224
|
-
const paginatedActors = actors.slice(offset, offset + limit);
|
|
225
|
-
const edges = paginatedActors.map((actor, index) => ({
|
|
226
|
-
node: actor,
|
|
227
|
-
cursor: Buffer.from(`${actor.name}:${offset + index}`).toString('base64')
|
|
228
|
-
}));
|
|
229
|
-
return {
|
|
230
|
-
edges,
|
|
231
|
-
pageInfo: {
|
|
232
|
-
hasNextPage: offset + paginatedActors.length < actors.length,
|
|
233
|
-
hasPreviousPage: offset > 0,
|
|
234
|
-
startCursor: edges.length > 0 ? edges[0].cursor : null,
|
|
235
|
-
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null
|
|
236
|
-
},
|
|
237
|
-
totalCount: actors.length
|
|
238
|
-
};
|
|
239
|
-
},
|
|
240
|
-
actor: async (_, { name }, context) => {
|
|
241
|
-
try {
|
|
242
|
-
if (!context.loaders) {
|
|
243
|
-
throw new Error('Loaders not initialized');
|
|
244
|
-
}
|
|
245
|
-
return await context.loaders.actorLoader.load(name);
|
|
246
|
-
}
|
|
247
|
-
catch (error) {
|
|
248
|
-
log.error('Failed to get actor:', error);
|
|
249
|
-
return null;
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
blueprints: async (_, args, context) => {
|
|
253
|
-
const { filter, pagination } = args;
|
|
254
|
-
try {
|
|
255
|
-
const safeFilter = { ...filter };
|
|
256
|
-
if (safeFilter.pathStartsWith) {
|
|
257
|
-
safeFilter.pathStartsWith = normalizeAndSanitizePath(safeFilter.pathStartsWith);
|
|
258
|
-
}
|
|
259
|
-
const response = await context.automationBridge.sendAutomationRequest('list_blueprints', {
|
|
260
|
-
filter: safeFilter,
|
|
261
|
-
pagination: pagination || { offset: 0, limit: 50 }
|
|
262
|
-
}, { timeoutMs: 30000 });
|
|
263
|
-
const resultObj = (response.result ?? {});
|
|
264
|
-
const blueprints = response.success && response.result
|
|
265
|
-
? (resultObj.blueprints || [])
|
|
266
|
-
: [];
|
|
267
|
-
const edges = blueprints.map((blueprint, index) => ({
|
|
268
|
-
node: blueprint,
|
|
269
|
-
cursor: Buffer.from(`${blueprint.path}:${index}`).toString('base64')
|
|
270
|
-
}));
|
|
271
|
-
const totalCount = resultObj.totalCount || 0;
|
|
272
|
-
return {
|
|
273
|
-
edges,
|
|
274
|
-
pageInfo: {
|
|
275
|
-
hasNextPage: (pagination?.offset || 0) + blueprints.length < totalCount,
|
|
276
|
-
hasPreviousPage: (pagination?.offset || 0) > 0,
|
|
277
|
-
startCursor: edges.length > 0 ? edges[0].cursor : null,
|
|
278
|
-
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null
|
|
279
|
-
},
|
|
280
|
-
totalCount: blueprints.length
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
catch (error) {
|
|
284
|
-
log.error('Failed to list blueprints:', error);
|
|
285
|
-
return {
|
|
286
|
-
edges: [],
|
|
287
|
-
pageInfo: {
|
|
288
|
-
hasNextPage: false,
|
|
289
|
-
hasPreviousPage: false,
|
|
290
|
-
startCursor: null,
|
|
291
|
-
endCursor: null
|
|
292
|
-
},
|
|
293
|
-
totalCount: 0
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
blueprint: async (_, { path }, context) => {
|
|
298
|
-
if (!context.loaders) {
|
|
299
|
-
throw new Error('Loaders not initialized');
|
|
300
|
-
}
|
|
301
|
-
return await context.loaders.blueprintLoader.load(sanitizePath(path));
|
|
302
|
-
},
|
|
303
|
-
levels: async (_, __, context) => {
|
|
304
|
-
try {
|
|
305
|
-
const response = await context.automationBridge.sendAutomationRequest('list_levels', {}, { timeoutMs: 10000 });
|
|
306
|
-
if (response.success && response.result) {
|
|
307
|
-
const resultObj = response.result;
|
|
308
|
-
return (resultObj.levels || []);
|
|
309
|
-
}
|
|
310
|
-
return [];
|
|
311
|
-
}
|
|
312
|
-
catch (error) {
|
|
313
|
-
log.error('Failed to list levels:', error);
|
|
314
|
-
return [];
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
currentLevel: async (_, __, context) => {
|
|
318
|
-
try {
|
|
319
|
-
const response = await context.automationBridge.sendAutomationRequest('get_current_level', {}, { timeoutMs: 10000 });
|
|
320
|
-
if (response.success && response.result) {
|
|
321
|
-
return response.result;
|
|
322
|
-
}
|
|
323
|
-
return null;
|
|
324
|
-
}
|
|
325
|
-
catch (error) {
|
|
326
|
-
log.error('Failed to get current level:', error);
|
|
327
|
-
return null;
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
materials: async (_, args, context) => {
|
|
331
|
-
const { filter, pagination } = args;
|
|
332
|
-
try {
|
|
333
|
-
const materialFilter = { ...filter, class: 'MaterialInterface' };
|
|
334
|
-
const { assets, totalCount } = await listAssets(context.automationBridge, materialFilter, pagination);
|
|
335
|
-
const offset = pagination?.offset ?? 0;
|
|
336
|
-
const edges = assets.map((material, index) => ({
|
|
337
|
-
node: material,
|
|
338
|
-
cursor: Buffer.from(`${material.path}:${offset + index}`).toString('base64')
|
|
339
|
-
}));
|
|
340
|
-
return {
|
|
341
|
-
edges,
|
|
342
|
-
pageInfo: {
|
|
343
|
-
hasNextPage: (pagination?.offset || 0) + assets.length < totalCount,
|
|
344
|
-
hasPreviousPage: (pagination?.offset || 0) > 0,
|
|
345
|
-
startCursor: edges.length > 0 ? edges[0].cursor : null,
|
|
346
|
-
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null
|
|
347
|
-
},
|
|
348
|
-
totalCount
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
catch (error) {
|
|
352
|
-
log.error('Failed to list materials:', error);
|
|
353
|
-
return {
|
|
354
|
-
edges: [],
|
|
355
|
-
pageInfo: {
|
|
356
|
-
hasNextPage: false,
|
|
357
|
-
hasPreviousPage: false,
|
|
358
|
-
startCursor: null,
|
|
359
|
-
endCursor: null
|
|
360
|
-
},
|
|
361
|
-
totalCount: 0
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
sequences: async (_, args, context) => {
|
|
366
|
-
const { filter, pagination } = args;
|
|
367
|
-
try {
|
|
368
|
-
const sequenceFilter = { ...filter, class: 'LevelSequence' };
|
|
369
|
-
const { assets, totalCount } = await listAssets(context.automationBridge, sequenceFilter, pagination);
|
|
370
|
-
const offset = pagination?.offset ?? 0;
|
|
371
|
-
const edges = assets.map((sequence, index) => ({
|
|
372
|
-
node: sequence,
|
|
373
|
-
cursor: Buffer.from(`${sequence.path}:${offset + index}`).toString('base64')
|
|
374
|
-
}));
|
|
375
|
-
return {
|
|
376
|
-
edges,
|
|
377
|
-
pageInfo: {
|
|
378
|
-
hasNextPage: (pagination?.offset || 0) + assets.length < totalCount,
|
|
379
|
-
hasPreviousPage: (pagination?.offset || 0) > 0,
|
|
380
|
-
startCursor: edges.length > 0 ? edges[0].cursor : null,
|
|
381
|
-
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null
|
|
382
|
-
},
|
|
383
|
-
totalCount
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
catch (error) {
|
|
387
|
-
log.error('Failed to list sequences:', error);
|
|
388
|
-
return {
|
|
389
|
-
edges: [],
|
|
390
|
-
pageInfo: {
|
|
391
|
-
hasNextPage: false,
|
|
392
|
-
hasPreviousPage: false,
|
|
393
|
-
startCursor: null,
|
|
394
|
-
endCursor: null
|
|
395
|
-
},
|
|
396
|
-
totalCount: 0
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
worldPartitionCells: async (_, __, context) => {
|
|
401
|
-
try {
|
|
402
|
-
const response = await context.automationBridge.sendAutomationRequest('manage_world_partition', { subAction: 'get_cells' }, { timeoutMs: 10000 });
|
|
403
|
-
if (response.success && response.result) {
|
|
404
|
-
const resultObj = response.result;
|
|
405
|
-
return (resultObj.cells || []);
|
|
406
|
-
}
|
|
407
|
-
return [];
|
|
408
|
-
}
|
|
409
|
-
catch (error) {
|
|
410
|
-
log.error('Failed to list world partition cells:', error);
|
|
411
|
-
return [];
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
niagaraSystems: async (_, args, context) => {
|
|
415
|
-
const { filter, pagination } = args;
|
|
416
|
-
try {
|
|
417
|
-
const niagaraFilter = { ...filter, class: 'NiagaraSystem' };
|
|
418
|
-
const { assets, totalCount } = await listAssets(context.automationBridge, niagaraFilter, pagination);
|
|
419
|
-
const offset = pagination?.offset ?? 0;
|
|
420
|
-
const edges = assets.map((asset, index) => ({
|
|
421
|
-
node: {
|
|
422
|
-
...asset,
|
|
423
|
-
emitters: [],
|
|
424
|
-
parameters: []
|
|
425
|
-
},
|
|
426
|
-
cursor: Buffer.from(`${asset.path}:${offset + index}`).toString('base64')
|
|
427
|
-
}));
|
|
428
|
-
return {
|
|
429
|
-
edges,
|
|
430
|
-
pageInfo: {
|
|
431
|
-
hasNextPage: (pagination?.offset || 0) + assets.length < totalCount,
|
|
432
|
-
hasPreviousPage: (pagination?.offset || 0) > 0,
|
|
433
|
-
startCursor: edges.length > 0 ? edges[0].cursor : null,
|
|
434
|
-
endCursor: edges.length > 0 ? edges[edges.length - 1].cursor : null
|
|
435
|
-
},
|
|
436
|
-
totalCount
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
catch (error) {
|
|
440
|
-
log.error('Failed to list niagara systems:', error);
|
|
441
|
-
return {
|
|
442
|
-
edges: [],
|
|
443
|
-
pageInfo: {
|
|
444
|
-
hasNextPage: false,
|
|
445
|
-
hasPreviousPage: false,
|
|
446
|
-
startCursor: null,
|
|
447
|
-
endCursor: null
|
|
448
|
-
},
|
|
449
|
-
totalCount: 0
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
niagaraSystem: async (_, { path }, context) => {
|
|
454
|
-
try {
|
|
455
|
-
const asset = await context.automationBridge.sendAutomationRequest('get_asset', { assetPath: sanitizePath(path) }, { timeoutMs: 10000 });
|
|
456
|
-
const resultObj = (asset.result ?? {});
|
|
457
|
-
if (asset.success && asset.result && resultObj.class === 'NiagaraSystem') {
|
|
458
|
-
return {
|
|
459
|
-
...resultObj,
|
|
460
|
-
emitters: [],
|
|
461
|
-
parameters: []
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
return null;
|
|
465
|
-
}
|
|
466
|
-
catch (error) {
|
|
467
|
-
log.error('Failed to get niagara system:', error);
|
|
468
|
-
return null;
|
|
469
|
-
}
|
|
470
|
-
},
|
|
471
|
-
search: async (_, { query, type }, context) => {
|
|
472
|
-
try {
|
|
473
|
-
const response = await context.automationBridge.sendAutomationRequest('search', {
|
|
474
|
-
query,
|
|
475
|
-
type: type || 'ALL'
|
|
476
|
-
}, { timeoutMs: 30000 });
|
|
477
|
-
if (response.success && response.result) {
|
|
478
|
-
const resultObj = response.result;
|
|
479
|
-
return (resultObj.results || []);
|
|
480
|
-
}
|
|
481
|
-
return [];
|
|
482
|
-
}
|
|
483
|
-
catch (error) {
|
|
484
|
-
log.error('Failed to search:', error);
|
|
485
|
-
return [];
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
Mutation: {
|
|
490
|
-
duplicateAsset: async (_, { path, newName }, context) => {
|
|
491
|
-
try {
|
|
492
|
-
const response = await context.automationBridge.sendAutomationRequest('duplicate_asset', {
|
|
493
|
-
assetPath: sanitizePath(path),
|
|
494
|
-
newName: sanitizeAssetName(newName)
|
|
495
|
-
}, { timeoutMs: 60000 });
|
|
496
|
-
if (response.success && response.result) {
|
|
497
|
-
return response.result;
|
|
498
|
-
}
|
|
499
|
-
throw new Error(response.error || 'Failed to duplicate asset');
|
|
500
|
-
}
|
|
501
|
-
catch (error) {
|
|
502
|
-
log.error('Failed to duplicate asset:', error);
|
|
503
|
-
throw error;
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
moveAsset: async (_, { path, newPath }, context) => {
|
|
507
|
-
try {
|
|
508
|
-
const response = await context.automationBridge.sendAutomationRequest('move_asset', {
|
|
509
|
-
assetPath: sanitizePath(path),
|
|
510
|
-
destinationPath: sanitizePath(newPath)
|
|
511
|
-
}, { timeoutMs: 60000 });
|
|
512
|
-
if (response.success && response.result) {
|
|
513
|
-
return response.result;
|
|
514
|
-
}
|
|
515
|
-
throw new Error(response.error || 'Failed to move asset');
|
|
516
|
-
}
|
|
517
|
-
catch (error) {
|
|
518
|
-
log.error('Failed to move asset:', error);
|
|
519
|
-
throw error;
|
|
520
|
-
}
|
|
521
|
-
},
|
|
522
|
-
deleteAsset: async (_, { path }, context) => {
|
|
523
|
-
try {
|
|
524
|
-
const response = await context.automationBridge.sendAutomationRequest('delete_asset', {
|
|
525
|
-
assetPath: sanitizePath(path)
|
|
526
|
-
}, { timeoutMs: 30000 });
|
|
527
|
-
return response.success || false;
|
|
528
|
-
}
|
|
529
|
-
catch (error) {
|
|
530
|
-
log.error('Failed to delete asset:', error);
|
|
531
|
-
return false;
|
|
532
|
-
}
|
|
533
|
-
},
|
|
534
|
-
spawnActor: async (_, { input }, context) => {
|
|
535
|
-
try {
|
|
536
|
-
const response = await context.automationBridge.sendAutomationRequest('spawn_actor', { ...input }, { timeoutMs: 10000 });
|
|
537
|
-
if (response.success && response.result) {
|
|
538
|
-
return response.result;
|
|
539
|
-
}
|
|
540
|
-
throw new Error(response.error || 'Failed to spawn actor');
|
|
541
|
-
}
|
|
542
|
-
catch (error) {
|
|
543
|
-
log.error('Failed to spawn actor:', error);
|
|
544
|
-
throw error;
|
|
545
|
-
}
|
|
546
|
-
},
|
|
547
|
-
deleteActor: async (_, { name }, context) => {
|
|
548
|
-
try {
|
|
549
|
-
const response = await context.automationBridge.sendAutomationRequest('delete_actor', {
|
|
550
|
-
actorName: name
|
|
551
|
-
}, { timeoutMs: 10000 });
|
|
552
|
-
return response.success || false;
|
|
553
|
-
}
|
|
554
|
-
catch (error) {
|
|
555
|
-
log.error('Failed to delete actor:', error);
|
|
556
|
-
return false;
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
setActorTransform: async (_, { name, transform }, context) => {
|
|
560
|
-
try {
|
|
561
|
-
const response = await context.automationBridge.sendAutomationRequest('set_actor_transform', {
|
|
562
|
-
actorName: name,
|
|
563
|
-
transform
|
|
564
|
-
}, { timeoutMs: 10000 });
|
|
565
|
-
if (response.success && response.result) {
|
|
566
|
-
return response.result;
|
|
567
|
-
}
|
|
568
|
-
throw new Error(response.error || 'Failed to set actor transform');
|
|
569
|
-
}
|
|
570
|
-
catch (error) {
|
|
571
|
-
log.error('Failed to set actor transform:', error);
|
|
572
|
-
throw error;
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
createBlueprint: async (_, { input }, context) => {
|
|
576
|
-
try {
|
|
577
|
-
const sanitizedInput = {
|
|
578
|
-
...input,
|
|
579
|
-
name: sanitizeAssetName(input.name),
|
|
580
|
-
path: input.path ? sanitizePath(input.path) : undefined
|
|
581
|
-
};
|
|
582
|
-
const response = await context.automationBridge.sendAutomationRequest('create_blueprint', sanitizedInput, { timeoutMs: 60000 });
|
|
583
|
-
if (response.success && response.result) {
|
|
584
|
-
return response.result;
|
|
585
|
-
}
|
|
586
|
-
throw new Error(response.error || 'Failed to create blueprint');
|
|
587
|
-
}
|
|
588
|
-
catch (error) {
|
|
589
|
-
log.error('Failed to create blueprint:', error);
|
|
590
|
-
throw error;
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
addVariableToBlueprint: async (_, { path, input }, context) => {
|
|
594
|
-
try {
|
|
595
|
-
const response = await context.automationBridge.sendAutomationRequest('add_variable_to_blueprint', {
|
|
596
|
-
blueprintPath: sanitizePath(path),
|
|
597
|
-
...input
|
|
598
|
-
}, { timeoutMs: 30000 });
|
|
599
|
-
if (response.success && response.result) {
|
|
600
|
-
return response.result;
|
|
601
|
-
}
|
|
602
|
-
throw new Error(response.error || 'Failed to add variable to blueprint');
|
|
603
|
-
}
|
|
604
|
-
catch (error) {
|
|
605
|
-
log.error('Failed to add variable to blueprint:', error);
|
|
606
|
-
throw error;
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
addFunctionToBlueprint: async (_, { path, input }, context) => {
|
|
610
|
-
try {
|
|
611
|
-
const response = await context.automationBridge.sendAutomationRequest('add_function_to_blueprint', {
|
|
612
|
-
blueprintPath: sanitizePath(path),
|
|
613
|
-
...input
|
|
614
|
-
}, { timeoutMs: 30000 });
|
|
615
|
-
if (response.success && response.result) {
|
|
616
|
-
return response.result;
|
|
617
|
-
}
|
|
618
|
-
throw new Error(response.error || 'Failed to add function to blueprint');
|
|
619
|
-
}
|
|
620
|
-
catch (error) {
|
|
621
|
-
log.error('Failed to add function to blueprint:', error);
|
|
622
|
-
throw error;
|
|
623
|
-
}
|
|
624
|
-
},
|
|
625
|
-
loadLevel: async (_, { path }, context) => {
|
|
626
|
-
try {
|
|
627
|
-
const response = await context.automationBridge.sendAutomationRequest('load_level', {
|
|
628
|
-
levelPath: sanitizePath(path)
|
|
629
|
-
}, { timeoutMs: 30000 });
|
|
630
|
-
if (response.success && response.result) {
|
|
631
|
-
return response.result;
|
|
632
|
-
}
|
|
633
|
-
throw new Error(response.error || 'Failed to load level');
|
|
634
|
-
}
|
|
635
|
-
catch (error) {
|
|
636
|
-
log.error('Failed to load level:', error);
|
|
637
|
-
throw error;
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
saveLevel: async (_, { path }, context) => {
|
|
641
|
-
try {
|
|
642
|
-
const response = await context.automationBridge.sendAutomationRequest('save_level', {
|
|
643
|
-
levelPath: path ? sanitizePath(path) : undefined
|
|
644
|
-
}, { timeoutMs: 30000 });
|
|
645
|
-
return response.success || false;
|
|
646
|
-
}
|
|
647
|
-
catch (error) {
|
|
648
|
-
log.error('Failed to save level:', error);
|
|
649
|
-
return false;
|
|
650
|
-
}
|
|
651
|
-
},
|
|
652
|
-
createMaterialInstance: async (_, { parentPath, name, parameters }, context) => {
|
|
653
|
-
try {
|
|
654
|
-
const response = await context.automationBridge.sendAutomationRequest('create_material_instance', {
|
|
655
|
-
parentMaterialPath: sanitizePath(parentPath),
|
|
656
|
-
instanceName: sanitizeAssetName(name),
|
|
657
|
-
parameters: parameters || {}
|
|
658
|
-
}, { timeoutMs: 30000 });
|
|
659
|
-
if (response.success && response.result) {
|
|
660
|
-
return response.result;
|
|
661
|
-
}
|
|
662
|
-
throw new Error(response.error || 'Failed to create material instance');
|
|
663
|
-
}
|
|
664
|
-
catch (error) {
|
|
665
|
-
log.error('Failed to create material instance:', error);
|
|
666
|
-
throw error;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
Asset: {
|
|
671
|
-
dependencies: async (parent, _, context) => {
|
|
672
|
-
try {
|
|
673
|
-
const response = await context.automationBridge.sendAutomationRequest('get_asset_dependencies', {
|
|
674
|
-
assetPath: parent.path
|
|
675
|
-
}, { timeoutMs: 10000 });
|
|
676
|
-
if (response.success && response.result) {
|
|
677
|
-
const resultObj = response.result;
|
|
678
|
-
return (resultObj.dependencies || []);
|
|
679
|
-
}
|
|
680
|
-
return [];
|
|
681
|
-
}
|
|
682
|
-
catch (error) {
|
|
683
|
-
log.error('Failed to get asset dependencies:', error);
|
|
684
|
-
return [];
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
dependents: async (parent, _, context) => {
|
|
688
|
-
try {
|
|
689
|
-
const response = await context.automationBridge.sendAutomationRequest('get_asset_dependents', {
|
|
690
|
-
assetPath: parent.path
|
|
691
|
-
}, { timeoutMs: 10000 });
|
|
692
|
-
if (response.success && response.result) {
|
|
693
|
-
const resultObj = response.result;
|
|
694
|
-
return (resultObj.dependents || []);
|
|
695
|
-
}
|
|
696
|
-
return [];
|
|
697
|
-
}
|
|
698
|
-
catch (error) {
|
|
699
|
-
log.error('Failed to get asset dependents:', error);
|
|
700
|
-
return [];
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
},
|
|
704
|
-
Actor: {
|
|
705
|
-
properties: async (parent, _, context) => {
|
|
706
|
-
return await getActorProperties(context.bridge, parent.name);
|
|
707
|
-
},
|
|
708
|
-
components: async (parent, _, context) => {
|
|
709
|
-
try {
|
|
710
|
-
const response = await context.automationBridge.sendAutomationRequest('get_actor_components', {
|
|
711
|
-
actorName: parent.name
|
|
712
|
-
}, { timeoutMs: 10000 });
|
|
713
|
-
if (response.success && response.result) {
|
|
714
|
-
const resultObj = response.result;
|
|
715
|
-
return (resultObj.components || []);
|
|
716
|
-
}
|
|
717
|
-
return [];
|
|
718
|
-
}
|
|
719
|
-
catch (error) {
|
|
720
|
-
log.error('Failed to get actor components:', error);
|
|
721
|
-
return [];
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
},
|
|
725
|
-
Blueprint: {
|
|
726
|
-
variables: async (parent, _args, _context) => {
|
|
727
|
-
return parent.variables || [];
|
|
728
|
-
},
|
|
729
|
-
functions: async (parent, _args, _context) => {
|
|
730
|
-
return parent.functions || [];
|
|
731
|
-
},
|
|
732
|
-
events: async (parent, _args, _context) => {
|
|
733
|
-
return parent.events || [];
|
|
734
|
-
},
|
|
735
|
-
components: async (parent, _args, _context) => {
|
|
736
|
-
return parent.components || [];
|
|
737
|
-
}
|
|
738
|
-
},
|
|
739
|
-
Material: {
|
|
740
|
-
parameters: async (parent, _, context) => {
|
|
741
|
-
try {
|
|
742
|
-
const response = await context.automationBridge.sendAutomationRequest('get_material_parameters', {
|
|
743
|
-
materialPath: parent.path
|
|
744
|
-
}, { timeoutMs: 10000 });
|
|
745
|
-
if (response.success && response.result) {
|
|
746
|
-
const resultObj = response.result;
|
|
747
|
-
return (resultObj.parameters || []);
|
|
748
|
-
}
|
|
749
|
-
return [];
|
|
750
|
-
}
|
|
751
|
-
catch (error) {
|
|
752
|
-
log.error('Failed to get material parameters:', error);
|
|
753
|
-
return [];
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
Sequence: {
|
|
758
|
-
tracks: async (parent, _, context) => {
|
|
759
|
-
try {
|
|
760
|
-
const response = await context.automationBridge.sendAutomationRequest('get_sequence_tracks', {
|
|
761
|
-
sequencePath: parent.path
|
|
762
|
-
}, { timeoutMs: 10000 });
|
|
763
|
-
if (response.success && response.result) {
|
|
764
|
-
const resultObj = response.result;
|
|
765
|
-
return (resultObj.tracks || []);
|
|
766
|
-
}
|
|
767
|
-
return [];
|
|
768
|
-
}
|
|
769
|
-
catch (error) {
|
|
770
|
-
log.error('Failed to get sequence tracks:', error);
|
|
771
|
-
return [];
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
//# sourceMappingURL=resolvers.js.map
|