unreal-engine-mcp-server 0.5.20 → 0.5.21
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 +7 -0
- package/README.md +5 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +19 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/consolidated-tool-definitions.d.ts.map +1 -1
- package/dist/tools/consolidated-tool-definitions.js +20 -16
- package/dist/tools/consolidated-tool-definitions.js.map +1 -1
- package/dist/tools/consolidated-tool-handlers.js +1 -3
- package/dist/tools/consolidated-tool-handlers.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 +48 -1
- package/dist/tools/dynamic-tool-manager.js.map +1 -1
- package/dist/tools/handlers/animation-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/animation-authoring-handlers.js +266 -43
- 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 +289 -34
- 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 +10 -4
- package/dist/tools/handlers/asset-handlers.js.map +1 -1
- package/dist/tools/handlers/audio-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/audio-handlers.js +66 -26
- package/dist/tools/handlers/audio-handlers.js.map +1 -1
- package/dist/tools/handlers/common-handlers.d.ts +1 -0
- package/dist/tools/handlers/common-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/common-handlers.js +13 -3
- 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 +18 -7
- 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 +91 -69
- package/dist/tools/handlers/effect-handlers.js.map +1 -1
- package/dist/tools/handlers/gas-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/gas-handlers.js +35 -22
- package/dist/tools/handlers/gas-handlers.js.map +1 -1
- package/dist/tools/handlers/inspect-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/inspect-handlers.js +6 -2
- package/dist/tools/handlers/inspect-handlers.js.map +1 -1
- package/dist/tools/handlers/inventory-handlers.js +7 -7
- package/dist/tools/handlers/inventory-handlers.js.map +1 -1
- package/dist/tools/handlers/manage-tools-handlers.js +2 -2
- package/dist/tools/handlers/manage-tools-handlers.js.map +1 -1
- package/dist/tools/handlers/performance-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/performance-handlers.js +11 -29
- 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 +140 -13
- 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 +27 -0
- package/dist/tools/handlers/sequence-handlers.js.map +1 -1
- package/dist/tools/handlers/system-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/system-handlers.js +10 -5
- package/dist/tools/handlers/system-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 +21 -5
- package/dist/tools/handlers/widget-authoring-handlers.js.map +1 -1
- package/dist/tools/schemas/core-tools.js +1 -1
- package/dist/tools/schemas/core-tools.js.map +1 -1
- package/dist/utils/path-security.d.ts.map +1 -1
- package/dist/utils/path-security.js +18 -1
- package/dist/utils/path-security.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +5 -2
- package/dist/utils/validation.js.map +1 -1
- package/package.json +25 -2
- package/server.json +2 -2
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
import { executeAutomationRequest } from './common-handlers.js';
|
|
2
2
|
import { normalizeArgs, extractString, extractOptionalString, extractOptionalNumber, extractOptionalBoolean, extractOptionalArray, extractOptionalObject, } from './argument-helper.js';
|
|
3
3
|
import { ResponseFactory } from '../../utils/response-factory.js';
|
|
4
|
+
import { sanitizePath } from '../../utils/path-security.js';
|
|
5
|
+
function validatePath(path, fieldName) {
|
|
6
|
+
try {
|
|
7
|
+
const sanitized = sanitizePath(path);
|
|
8
|
+
return { valid: true, sanitized };
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
return {
|
|
12
|
+
valid: false,
|
|
13
|
+
error: ResponseFactory.error(e instanceof Error ? e.message : `Invalid ${fieldName}: path traversal or illegal characters detected`, 'SECURITY_VIOLATION')
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
4
17
|
export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
5
18
|
try {
|
|
19
|
+
const allPathParams = [
|
|
20
|
+
'path', 'savePath', 'skeletonPath', 'skeletalMeshPath', 'sourceSkeleton', 'targetSkeleton',
|
|
21
|
+
'assetPath', 'animationPath', 'blueprintPath', 'retargeterPath', 'meshPath', 'montagePath',
|
|
22
|
+
'animSequencePath', 'animPath', 'animAssetPath', 'animMontagePath', 'blendSpacePath', 'rigPath'
|
|
23
|
+
];
|
|
24
|
+
for (const param of allPathParams) {
|
|
25
|
+
const value = args[param];
|
|
26
|
+
if (value && typeof value === 'string') {
|
|
27
|
+
const pathValidation = validatePath(value, param);
|
|
28
|
+
if (!pathValidation.valid) {
|
|
29
|
+
return pathValidation.error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
6
33
|
switch (action) {
|
|
7
34
|
case 'create_animation_sequence': {
|
|
8
35
|
const params = normalizeArgs(args, [
|
|
@@ -40,7 +67,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
40
67
|
{ key: 'frameRate' },
|
|
41
68
|
{ key: 'save', default: true },
|
|
42
69
|
]);
|
|
43
|
-
const
|
|
70
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
71
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
72
|
+
if (!pathValidation.valid) {
|
|
73
|
+
return pathValidation.error;
|
|
74
|
+
}
|
|
75
|
+
const assetPath = pathValidation.sanitized;
|
|
44
76
|
const numFrames = extractOptionalNumber(params, 'numFrames') ?? 30;
|
|
45
77
|
const frameRate = extractOptionalNumber(params, 'frameRate');
|
|
46
78
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -62,7 +94,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
62
94
|
{ key: 'boneName', required: true },
|
|
63
95
|
{ key: 'save', default: true },
|
|
64
96
|
]);
|
|
65
|
-
const
|
|
97
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
98
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
99
|
+
if (!pathValidation.valid) {
|
|
100
|
+
return pathValidation.error;
|
|
101
|
+
}
|
|
102
|
+
const assetPath = pathValidation.sanitized;
|
|
66
103
|
const boneName = extractString(params, 'boneName');
|
|
67
104
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
68
105
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -86,7 +123,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
86
123
|
{ key: 'scale' },
|
|
87
124
|
{ key: 'save', default: true },
|
|
88
125
|
]);
|
|
89
|
-
const
|
|
126
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
127
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
128
|
+
if (!pathValidation.valid) {
|
|
129
|
+
return pathValidation.error;
|
|
130
|
+
}
|
|
131
|
+
const assetPath = pathValidation.sanitized;
|
|
90
132
|
const boneName = extractString(params, 'boneName');
|
|
91
133
|
const frame = extractOptionalNumber(params, 'frame') ?? 0;
|
|
92
134
|
const location = extractOptionalObject(params, 'location');
|
|
@@ -117,7 +159,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
117
159
|
{ key: 'createIfMissing', default: true },
|
|
118
160
|
{ key: 'save', default: true },
|
|
119
161
|
]);
|
|
120
|
-
const
|
|
162
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
163
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
164
|
+
if (!pathValidation.valid) {
|
|
165
|
+
return pathValidation.error;
|
|
166
|
+
}
|
|
167
|
+
const assetPath = pathValidation.sanitized;
|
|
121
168
|
const curveName = extractString(params, 'curveName');
|
|
122
169
|
const frame = extractOptionalNumber(params, 'frame') ?? 0;
|
|
123
170
|
const value = extractOptionalNumber(params, 'value') ?? 0;
|
|
@@ -146,7 +193,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
146
193
|
{ key: 'notifyName' },
|
|
147
194
|
{ key: 'save', default: true },
|
|
148
195
|
]);
|
|
149
|
-
const
|
|
196
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
197
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
198
|
+
if (!pathValidation.valid) {
|
|
199
|
+
return pathValidation.error;
|
|
200
|
+
}
|
|
201
|
+
const assetPath = pathValidation.sanitized;
|
|
150
202
|
const notifyClass = extractString(params, 'notifyClass');
|
|
151
203
|
const frame = extractOptionalNumber(params, 'frame') ?? 0;
|
|
152
204
|
const trackIndex = extractOptionalNumber(params, 'trackIndex') ?? 0;
|
|
@@ -176,7 +228,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
176
228
|
{ key: 'notifyName' },
|
|
177
229
|
{ key: 'save', default: true },
|
|
178
230
|
]);
|
|
179
|
-
const
|
|
231
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
232
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
233
|
+
if (!pathValidation.valid) {
|
|
234
|
+
return pathValidation.error;
|
|
235
|
+
}
|
|
236
|
+
const assetPath = pathValidation.sanitized;
|
|
180
237
|
const notifyClass = extractString(params, 'notifyClass');
|
|
181
238
|
const startFrame = extractOptionalNumber(params, 'startFrame') ?? 0;
|
|
182
239
|
const endFrame = extractOptionalNumber(params, 'endFrame') ?? 10;
|
|
@@ -205,7 +262,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
205
262
|
{ key: 'frame', required: true },
|
|
206
263
|
{ key: 'save', default: true },
|
|
207
264
|
]);
|
|
208
|
-
const
|
|
265
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
266
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
267
|
+
if (!pathValidation.valid) {
|
|
268
|
+
return pathValidation.error;
|
|
269
|
+
}
|
|
270
|
+
const assetPath = pathValidation.sanitized;
|
|
209
271
|
const markerName = extractString(params, 'markerName');
|
|
210
272
|
const frame = extractOptionalNumber(params, 'frame') ?? 0;
|
|
211
273
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -229,7 +291,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
229
291
|
{ key: 'forceRootLock', default: false },
|
|
230
292
|
{ key: 'save', default: true },
|
|
231
293
|
]);
|
|
232
|
-
const
|
|
294
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
295
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
296
|
+
if (!pathValidation.valid) {
|
|
297
|
+
return pathValidation.error;
|
|
298
|
+
}
|
|
299
|
+
const assetPath = pathValidation.sanitized;
|
|
233
300
|
const enableRootMotion = extractOptionalBoolean(params, 'enableRootMotion') ?? true;
|
|
234
301
|
const rootMotionRootLock = extractOptionalString(params, 'rootMotionRootLock') ?? 'RefPose';
|
|
235
302
|
const forceRootLock = extractOptionalBoolean(params, 'forceRootLock') ?? false;
|
|
@@ -256,7 +323,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
256
323
|
{ key: 'basePoseFrame', default: 0 },
|
|
257
324
|
{ key: 'save', default: true },
|
|
258
325
|
]);
|
|
259
|
-
const
|
|
326
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
327
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
328
|
+
if (!pathValidation.valid) {
|
|
329
|
+
return pathValidation.error;
|
|
330
|
+
}
|
|
331
|
+
const assetPath = pathValidation.sanitized;
|
|
260
332
|
const additiveAnimType = extractOptionalString(params, 'additiveAnimType') ?? 'NoAdditive';
|
|
261
333
|
const basePoseType = extractOptionalString(params, 'basePoseType') ?? 'RefPose';
|
|
262
334
|
const basePoseAnimation = extractOptionalString(params, 'basePoseAnimation');
|
|
@@ -309,7 +381,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
309
381
|
{ key: 'startTime', required: true },
|
|
310
382
|
{ key: 'save', default: true },
|
|
311
383
|
]);
|
|
312
|
-
const
|
|
384
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
385
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
386
|
+
if (!pathValidation.valid) {
|
|
387
|
+
return pathValidation.error;
|
|
388
|
+
}
|
|
389
|
+
const assetPath = pathValidation.sanitized;
|
|
313
390
|
const sectionName = extractString(params, 'sectionName');
|
|
314
391
|
const startTime = extractOptionalNumber(params, 'startTime') ?? 0;
|
|
315
392
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -333,8 +410,18 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
333
410
|
{ key: 'startTime', default: 0 },
|
|
334
411
|
{ key: 'save', default: true },
|
|
335
412
|
]);
|
|
336
|
-
const
|
|
337
|
-
const
|
|
413
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
414
|
+
const pathValidationAsset = validatePath(rawAssetPath, 'assetPath');
|
|
415
|
+
if (!pathValidationAsset.valid) {
|
|
416
|
+
return pathValidationAsset.error;
|
|
417
|
+
}
|
|
418
|
+
const assetPath = pathValidationAsset.sanitized;
|
|
419
|
+
const rawAnimationPath = extractString(params, 'animationPath');
|
|
420
|
+
const pathValidationAnim = validatePath(rawAnimationPath, 'animationPath');
|
|
421
|
+
if (!pathValidationAnim.valid) {
|
|
422
|
+
return pathValidationAnim.error;
|
|
423
|
+
}
|
|
424
|
+
const animationPath = pathValidationAnim.sanitized;
|
|
338
425
|
const slotName = extractOptionalString(params, 'slotName') ?? 'DefaultSlot';
|
|
339
426
|
const startTime = extractOptionalNumber(params, 'startTime') ?? 0;
|
|
340
427
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -359,7 +446,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
359
446
|
{ key: 'length' },
|
|
360
447
|
{ key: 'save', default: true },
|
|
361
448
|
]);
|
|
362
|
-
const
|
|
449
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
450
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
451
|
+
if (!pathValidation.valid) {
|
|
452
|
+
return pathValidation.error;
|
|
453
|
+
}
|
|
454
|
+
const assetPath = pathValidation.sanitized;
|
|
363
455
|
const sectionName = extractString(params, 'sectionName');
|
|
364
456
|
const startTime = extractOptionalNumber(params, 'startTime');
|
|
365
457
|
const length = extractOptionalNumber(params, 'length');
|
|
@@ -386,7 +478,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
386
478
|
{ key: 'notifyName' },
|
|
387
479
|
{ key: 'save', default: true },
|
|
388
480
|
]);
|
|
389
|
-
const
|
|
481
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
482
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
483
|
+
if (!pathValidation.valid) {
|
|
484
|
+
return pathValidation.error;
|
|
485
|
+
}
|
|
486
|
+
const assetPath = pathValidation.sanitized;
|
|
390
487
|
const notifyClass = extractString(params, 'notifyClass');
|
|
391
488
|
const time = extractOptionalNumber(params, 'time') ?? 0;
|
|
392
489
|
const trackIndex = extractOptionalNumber(params, 'trackIndex') ?? 0;
|
|
@@ -413,7 +510,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
413
510
|
{ key: 'blendOption', default: 'Linear' },
|
|
414
511
|
{ key: 'save', default: true },
|
|
415
512
|
]);
|
|
416
|
-
const
|
|
513
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
514
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
515
|
+
if (!pathValidation.valid) {
|
|
516
|
+
return pathValidation.error;
|
|
517
|
+
}
|
|
518
|
+
const assetPath = pathValidation.sanitized;
|
|
417
519
|
const blendTime = extractOptionalNumber(params, 'blendTime') ?? 0.25;
|
|
418
520
|
const blendOption = extractOptionalString(params, 'blendOption') ?? 'Linear';
|
|
419
521
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -436,7 +538,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
436
538
|
{ key: 'blendOption', default: 'Linear' },
|
|
437
539
|
{ key: 'save', default: true },
|
|
438
540
|
]);
|
|
439
|
-
const
|
|
541
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
542
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
543
|
+
if (!pathValidation.valid) {
|
|
544
|
+
return pathValidation.error;
|
|
545
|
+
}
|
|
546
|
+
const assetPath = pathValidation.sanitized;
|
|
440
547
|
const blendTime = extractOptionalNumber(params, 'blendTime') ?? 0.25;
|
|
441
548
|
const blendOption = extractOptionalString(params, 'blendOption') ?? 'Linear';
|
|
442
549
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -459,7 +566,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
459
566
|
{ key: 'toSection', required: true },
|
|
460
567
|
{ key: 'save', default: true },
|
|
461
568
|
]);
|
|
462
|
-
const
|
|
569
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
570
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
571
|
+
if (!pathValidation.valid) {
|
|
572
|
+
return pathValidation.error;
|
|
573
|
+
}
|
|
574
|
+
const assetPath = pathValidation.sanitized;
|
|
463
575
|
const fromSection = extractString(params, 'fromSection');
|
|
464
576
|
const toSection = extractString(params, 'toSection');
|
|
465
577
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -555,8 +667,18 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
555
667
|
{ key: 'sampleValue', required: true },
|
|
556
668
|
{ key: 'save', default: true },
|
|
557
669
|
]);
|
|
558
|
-
const
|
|
559
|
-
const
|
|
670
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
671
|
+
const pathValidationAsset = validatePath(rawAssetPath, 'assetPath');
|
|
672
|
+
if (!pathValidationAsset.valid) {
|
|
673
|
+
return pathValidationAsset.error;
|
|
674
|
+
}
|
|
675
|
+
const assetPath = pathValidationAsset.sanitized;
|
|
676
|
+
const rawAnimationPath = extractString(params, 'animationPath');
|
|
677
|
+
const pathValidationAnim = validatePath(rawAnimationPath, 'animationPath');
|
|
678
|
+
if (!pathValidationAnim.valid) {
|
|
679
|
+
return pathValidationAnim.error;
|
|
680
|
+
}
|
|
681
|
+
const animationPath = pathValidationAnim.sanitized;
|
|
560
682
|
const sampleValue = params['sampleValue'];
|
|
561
683
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
562
684
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -581,7 +703,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
581
703
|
{ key: 'gridDivisions' },
|
|
582
704
|
{ key: 'save', default: true },
|
|
583
705
|
]);
|
|
584
|
-
const
|
|
706
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
707
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
708
|
+
if (!pathValidation.valid) {
|
|
709
|
+
return pathValidation.error;
|
|
710
|
+
}
|
|
711
|
+
const assetPath = pathValidation.sanitized;
|
|
585
712
|
const axis = extractString(params, 'axis');
|
|
586
713
|
const axisName = extractOptionalString(params, 'axisName');
|
|
587
714
|
const minValue = extractOptionalNumber(params, 'minValue');
|
|
@@ -610,7 +737,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
610
737
|
{ key: 'targetWeightInterpolationSpeed', default: 5.0 },
|
|
611
738
|
{ key: 'save', default: true },
|
|
612
739
|
]);
|
|
613
|
-
const
|
|
740
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
741
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
742
|
+
if (!pathValidation.valid) {
|
|
743
|
+
return pathValidation.error;
|
|
744
|
+
}
|
|
745
|
+
const assetPath = pathValidation.sanitized;
|
|
614
746
|
const interpolationType = extractOptionalString(params, 'interpolationType') ?? 'Lerp';
|
|
615
747
|
const targetWeightInterpolationSpeed = extractOptionalNumber(params, 'targetWeightInterpolationSpeed') ?? 5.0;
|
|
616
748
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -657,8 +789,18 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
657
789
|
{ key: 'pitch', required: true },
|
|
658
790
|
{ key: 'save', default: true },
|
|
659
791
|
]);
|
|
660
|
-
const
|
|
661
|
-
const
|
|
792
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
793
|
+
const pathValidationAsset = validatePath(rawAssetPath, 'assetPath');
|
|
794
|
+
if (!pathValidationAsset.valid) {
|
|
795
|
+
return pathValidationAsset.error;
|
|
796
|
+
}
|
|
797
|
+
const assetPath = pathValidationAsset.sanitized;
|
|
798
|
+
const rawAnimationPath = extractString(params, 'animationPath');
|
|
799
|
+
const pathValidationAnim = validatePath(rawAnimationPath, 'animationPath');
|
|
800
|
+
if (!pathValidationAnim.valid) {
|
|
801
|
+
return pathValidationAnim.error;
|
|
802
|
+
}
|
|
803
|
+
const animationPath = pathValidationAnim.sanitized;
|
|
662
804
|
const yaw = extractOptionalNumber(params, 'yaw') ?? 0;
|
|
663
805
|
const pitch = extractOptionalNumber(params, 'pitch') ?? 0;
|
|
664
806
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -675,12 +817,14 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
675
817
|
}
|
|
676
818
|
return ResponseFactory.success(res, res.message ?? 'Aim offset sample added');
|
|
677
819
|
}
|
|
678
|
-
case 'create_anim_blueprint':
|
|
820
|
+
case 'create_anim_blueprint':
|
|
821
|
+
case 'create_animation_bp':
|
|
822
|
+
case 'create_animation_blueprint': {
|
|
679
823
|
const params = normalizeArgs(args, [
|
|
680
824
|
{ key: 'name', required: true },
|
|
681
|
-
{ key: 'path', aliases: ['directory'], default: '/Game/Blueprints' },
|
|
825
|
+
{ key: 'path', aliases: ['directory', 'savePath'], default: '/Game/Blueprints' },
|
|
682
826
|
{ key: 'skeletonPath', required: true },
|
|
683
|
-
{ key: 'parentClass', default: 'AnimInstance' },
|
|
827
|
+
{ key: 'parentClass', aliases: ['parent'], default: 'AnimInstance' },
|
|
684
828
|
{ key: 'save', default: true },
|
|
685
829
|
]);
|
|
686
830
|
const name = extractString(params, 'name');
|
|
@@ -707,7 +851,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
707
851
|
{ key: 'stateMachineName', required: true },
|
|
708
852
|
{ key: 'save', default: true },
|
|
709
853
|
]);
|
|
710
|
-
const
|
|
854
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
855
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
856
|
+
if (!pathValidation.valid) {
|
|
857
|
+
return pathValidation.error;
|
|
858
|
+
}
|
|
859
|
+
const blueprintPath = pathValidation.sanitized;
|
|
711
860
|
const stateMachineName = extractString(params, 'stateMachineName');
|
|
712
861
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
713
862
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -730,10 +879,19 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
730
879
|
{ key: 'isEntryState', default: false },
|
|
731
880
|
{ key: 'save', default: true },
|
|
732
881
|
]);
|
|
733
|
-
const
|
|
882
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
883
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
884
|
+
if (!pathValidation.valid) {
|
|
885
|
+
return pathValidation.error;
|
|
886
|
+
}
|
|
887
|
+
const blueprintPath = pathValidation.sanitized;
|
|
734
888
|
const stateMachineName = extractString(params, 'stateMachineName');
|
|
735
889
|
const stateName = extractString(params, 'stateName');
|
|
736
|
-
const
|
|
890
|
+
const rawAnimationPath = extractOptionalString(params, 'animationPath');
|
|
891
|
+
const animationPath = rawAnimationPath ? validatePath(rawAnimationPath, 'animationPath') : undefined;
|
|
892
|
+
if (animationPath && !animationPath.valid) {
|
|
893
|
+
return animationPath.error;
|
|
894
|
+
}
|
|
737
895
|
const isEntryState = extractOptionalBoolean(params, 'isEntryState') ?? false;
|
|
738
896
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
739
897
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -741,7 +899,7 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
741
899
|
blueprintPath,
|
|
742
900
|
stateMachineName,
|
|
743
901
|
stateName,
|
|
744
|
-
animationPath,
|
|
902
|
+
animationPath: animationPath?.sanitized,
|
|
745
903
|
isEntryState,
|
|
746
904
|
save,
|
|
747
905
|
}));
|
|
@@ -758,7 +916,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
758
916
|
{ key: 'toState', required: true },
|
|
759
917
|
{ key: 'save', default: true },
|
|
760
918
|
]);
|
|
761
|
-
const
|
|
919
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
920
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
921
|
+
if (!pathValidation.valid) {
|
|
922
|
+
return pathValidation.error;
|
|
923
|
+
}
|
|
924
|
+
const blueprintPath = pathValidation.sanitized;
|
|
762
925
|
const stateMachineName = extractString(params, 'stateMachineName');
|
|
763
926
|
const fromState = extractString(params, 'fromState');
|
|
764
927
|
const toState = extractString(params, 'toState');
|
|
@@ -788,7 +951,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
788
951
|
{ key: 'automaticTriggerTime' },
|
|
789
952
|
{ key: 'save', default: true },
|
|
790
953
|
]);
|
|
791
|
-
const
|
|
954
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
955
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
956
|
+
if (!pathValidation.valid) {
|
|
957
|
+
return pathValidation.error;
|
|
958
|
+
}
|
|
959
|
+
const blueprintPath = pathValidation.sanitized;
|
|
792
960
|
const stateMachineName = extractString(params, 'stateMachineName');
|
|
793
961
|
const fromState = extractString(params, 'fromState');
|
|
794
962
|
const toState = extractString(params, 'toState');
|
|
@@ -823,7 +991,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
823
991
|
{ key: 'y', default: 0 },
|
|
824
992
|
{ key: 'save', default: true },
|
|
825
993
|
]);
|
|
826
|
-
const
|
|
994
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
995
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
996
|
+
if (!pathValidation.valid) {
|
|
997
|
+
return pathValidation.error;
|
|
998
|
+
}
|
|
999
|
+
const blueprintPath = pathValidation.sanitized;
|
|
827
1000
|
const blendType = extractString(params, 'blendType');
|
|
828
1001
|
const nodeName = extractOptionalString(params, 'nodeName');
|
|
829
1002
|
const x = extractOptionalNumber(params, 'x') ?? 0;
|
|
@@ -849,7 +1022,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
849
1022
|
{ key: 'cacheName', required: true },
|
|
850
1023
|
{ key: 'save', default: true },
|
|
851
1024
|
]);
|
|
852
|
-
const
|
|
1025
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
1026
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
1027
|
+
if (!pathValidation.valid) {
|
|
1028
|
+
return pathValidation.error;
|
|
1029
|
+
}
|
|
1030
|
+
const blueprintPath = pathValidation.sanitized;
|
|
853
1031
|
const cacheName = extractString(params, 'cacheName');
|
|
854
1032
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
855
1033
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -869,7 +1047,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
869
1047
|
{ key: 'slotName', required: true },
|
|
870
1048
|
{ key: 'save', default: true },
|
|
871
1049
|
]);
|
|
872
|
-
const
|
|
1050
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
1051
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
1052
|
+
if (!pathValidation.valid) {
|
|
1053
|
+
return pathValidation.error;
|
|
1054
|
+
}
|
|
1055
|
+
const blueprintPath = pathValidation.sanitized;
|
|
873
1056
|
const slotName = extractString(params, 'slotName');
|
|
874
1057
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
875
1058
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -889,7 +1072,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
889
1072
|
{ key: 'layerSetup' },
|
|
890
1073
|
{ key: 'save', default: true },
|
|
891
1074
|
]);
|
|
892
|
-
const
|
|
1075
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
1076
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
1077
|
+
if (!pathValidation.valid) {
|
|
1078
|
+
return pathValidation.error;
|
|
1079
|
+
}
|
|
1080
|
+
const blueprintPath = pathValidation.sanitized;
|
|
893
1081
|
const layerSetup = extractOptionalArray(params, 'layerSetup');
|
|
894
1082
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
895
1083
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
@@ -911,7 +1099,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
911
1099
|
{ key: 'value', required: true },
|
|
912
1100
|
{ key: 'save', default: true },
|
|
913
1101
|
]);
|
|
914
|
-
const
|
|
1102
|
+
const rawBlueprintPath = extractString(params, 'blueprintPath');
|
|
1103
|
+
const pathValidation = validatePath(rawBlueprintPath, 'blueprintPath');
|
|
1104
|
+
if (!pathValidation.valid) {
|
|
1105
|
+
return pathValidation.error;
|
|
1106
|
+
}
|
|
1107
|
+
const blueprintPath = pathValidation.sanitized;
|
|
915
1108
|
const nodeName = extractString(params, 'nodeName');
|
|
916
1109
|
const propertyName = extractString(params, 'propertyName');
|
|
917
1110
|
const value = params['value'];
|
|
@@ -961,7 +1154,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
961
1154
|
{ key: 'parentControl' },
|
|
962
1155
|
{ key: 'save', default: true },
|
|
963
1156
|
]);
|
|
964
|
-
const
|
|
1157
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
1158
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
1159
|
+
if (!pathValidation.valid) {
|
|
1160
|
+
return pathValidation.error;
|
|
1161
|
+
}
|
|
1162
|
+
const assetPath = pathValidation.sanitized;
|
|
965
1163
|
const controlName = extractString(params, 'controlName');
|
|
966
1164
|
const controlType = extractOptionalString(params, 'controlType') ?? 'Transform';
|
|
967
1165
|
const parentBone = extractOptionalString(params, 'parentBone');
|
|
@@ -989,7 +1187,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
989
1187
|
{ key: 'settings' },
|
|
990
1188
|
{ key: 'save', default: true },
|
|
991
1189
|
]);
|
|
992
|
-
const
|
|
1190
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
1191
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
1192
|
+
if (!pathValidation.valid) {
|
|
1193
|
+
return pathValidation.error;
|
|
1194
|
+
}
|
|
1195
|
+
const assetPath = pathValidation.sanitized;
|
|
993
1196
|
const unitType = extractString(params, 'unitType');
|
|
994
1197
|
const unitName = extractOptionalString(params, 'unitName');
|
|
995
1198
|
const settings = extractOptionalObject(params, 'settings');
|
|
@@ -1016,7 +1219,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
1016
1219
|
{ key: 'targetPin', required: true },
|
|
1017
1220
|
{ key: 'save', default: true },
|
|
1018
1221
|
]);
|
|
1019
|
-
const
|
|
1222
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
1223
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
1224
|
+
if (!pathValidation.valid) {
|
|
1225
|
+
return pathValidation.error;
|
|
1226
|
+
}
|
|
1227
|
+
const assetPath = pathValidation.sanitized;
|
|
1020
1228
|
const sourceElement = extractString(params, 'sourceElement');
|
|
1021
1229
|
const sourcePin = extractString(params, 'sourcePin');
|
|
1022
1230
|
const targetElement = extractString(params, 'targetElement');
|
|
@@ -1091,7 +1299,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
1091
1299
|
{ key: 'goal' },
|
|
1092
1300
|
{ key: 'save', default: true },
|
|
1093
1301
|
]);
|
|
1094
|
-
const
|
|
1302
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
1303
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
1304
|
+
if (!pathValidation.valid) {
|
|
1305
|
+
return pathValidation.error;
|
|
1306
|
+
}
|
|
1307
|
+
const assetPath = pathValidation.sanitized;
|
|
1095
1308
|
const chainName = extractString(params, 'chainName');
|
|
1096
1309
|
const startBone = extractString(params, 'startBone');
|
|
1097
1310
|
const endBone = extractString(params, 'endBone');
|
|
@@ -1144,7 +1357,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
1144
1357
|
{ key: 'targetChain', required: true },
|
|
1145
1358
|
{ key: 'save', default: true },
|
|
1146
1359
|
]);
|
|
1147
|
-
const
|
|
1360
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
1361
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
1362
|
+
if (!pathValidation.valid) {
|
|
1363
|
+
return pathValidation.error;
|
|
1364
|
+
}
|
|
1365
|
+
const assetPath = pathValidation.sanitized;
|
|
1148
1366
|
const sourceChain = extractString(params, 'sourceChain');
|
|
1149
1367
|
const targetChain = extractString(params, 'targetChain');
|
|
1150
1368
|
const save = extractOptionalBoolean(params, 'save') ?? true;
|
|
@@ -1164,7 +1382,12 @@ export async function handleAnimationAuthoringTools(action, args, tools) {
|
|
|
1164
1382
|
const params = normalizeArgs(args, [
|
|
1165
1383
|
{ key: 'assetPath', required: true },
|
|
1166
1384
|
]);
|
|
1167
|
-
const
|
|
1385
|
+
const rawAssetPath = extractString(params, 'assetPath');
|
|
1386
|
+
const pathValidation = validatePath(rawAssetPath, 'assetPath');
|
|
1387
|
+
if (!pathValidation.valid) {
|
|
1388
|
+
return pathValidation.error;
|
|
1389
|
+
}
|
|
1390
|
+
const assetPath = pathValidation.sanitized;
|
|
1168
1391
|
const res = (await executeAutomationRequest(tools, 'manage_animation_authoring', {
|
|
1169
1392
|
subAction: 'get_animation_info',
|
|
1170
1393
|
assetPath,
|