unreal-engine-mcp-server 0.5.0 → 0.5.2
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/.env.example +1 -1
- package/.github/release-drafter-config.yml +51 -0
- package/.github/workflows/greetings.yml +5 -1
- package/.github/workflows/labeler.yml +2 -1
- package/.github/workflows/publish-mcp.yml +2 -4
- package/.github/workflows/release-drafter.yml +3 -2
- package/.github/workflows/release.yml +3 -3
- package/CHANGELOG.md +109 -0
- package/CONTRIBUTING.md +1 -1
- package/GEMINI.md +115 -0
- package/Public/Plugin_setup_guide.mp4 +0 -0
- package/README.md +166 -200
- package/dist/automation/bridge.d.ts +1 -2
- package/dist/automation/bridge.js +24 -23
- package/dist/automation/connection-manager.d.ts +1 -0
- package/dist/automation/connection-manager.js +10 -0
- package/dist/automation/message-handler.js +5 -4
- package/dist/automation/request-tracker.d.ts +4 -0
- package/dist/automation/request-tracker.js +11 -3
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +4 -0
- package/dist/graphql/loaders.d.ts +64 -0
- package/dist/graphql/loaders.js +117 -0
- package/dist/graphql/resolvers.d.ts +3 -3
- package/dist/graphql/resolvers.js +33 -30
- package/dist/graphql/server.js +3 -1
- package/dist/graphql/types.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -2
- package/dist/server-setup.d.ts +0 -1
- package/dist/server-setup.js +0 -40
- package/dist/tools/actors.d.ts +58 -24
- package/dist/tools/actors.js +22 -6
- package/dist/tools/assets.d.ts +19 -71
- package/dist/tools/assets.js +28 -22
- package/dist/tools/base-tool.d.ts +4 -4
- package/dist/tools/base-tool.js +1 -1
- package/dist/tools/blueprint.d.ts +45 -61
- package/dist/tools/blueprint.js +43 -14
- package/dist/tools/consolidated-tool-definitions.js +2 -1
- package/dist/tools/consolidated-tool-handlers.js +96 -110
- package/dist/tools/dynamic-handler-registry.d.ts +11 -9
- package/dist/tools/dynamic-handler-registry.js +17 -95
- package/dist/tools/editor.d.ts +19 -193
- package/dist/tools/editor.js +11 -2
- package/dist/tools/environment.d.ts +8 -14
- package/dist/tools/foliage.d.ts +18 -143
- package/dist/tools/foliage.js +4 -2
- package/dist/tools/handlers/actor-handlers.d.ts +1 -1
- package/dist/tools/handlers/actor-handlers.js +14 -13
- package/dist/tools/handlers/asset-handlers.js +454 -454
- package/dist/tools/handlers/sequence-handlers.d.ts +1 -1
- package/dist/tools/handlers/sequence-handlers.js +24 -13
- package/dist/tools/introspection.d.ts +1 -1
- package/dist/tools/introspection.js +1 -1
- package/dist/tools/landscape.d.ts +16 -116
- package/dist/tools/landscape.js +7 -3
- package/dist/tools/level.d.ts +22 -103
- package/dist/tools/level.js +26 -18
- package/dist/tools/lighting.d.ts +54 -7
- package/dist/tools/lighting.js +9 -5
- package/dist/tools/materials.d.ts +1 -1
- package/dist/tools/materials.js +5 -1
- package/dist/tools/niagara.js +37 -2
- package/dist/tools/performance.d.ts +0 -1
- package/dist/tools/performance.js +0 -1
- package/dist/tools/physics.js +5 -1
- package/dist/tools/sequence.d.ts +24 -24
- package/dist/tools/sequence.js +13 -0
- package/dist/tools/ui.d.ts +0 -2
- package/dist/types/automation-responses.d.ts +115 -0
- package/dist/types/automation-responses.js +2 -0
- package/dist/types/responses.d.ts +249 -0
- package/dist/types/responses.js +2 -0
- package/dist/types/tool-interfaces.d.ts +135 -135
- package/dist/types/tool-types.d.ts +2 -0
- package/dist/unreal-bridge.js +4 -4
- package/dist/utils/command-validator.js +7 -5
- package/dist/utils/error-handler.d.ts +24 -2
- package/dist/utils/error-handler.js +58 -23
- package/dist/utils/normalize.d.ts +7 -4
- package/dist/utils/normalize.js +12 -10
- package/dist/utils/path-security.d.ts +2 -0
- package/dist/utils/path-security.js +24 -0
- package/dist/utils/response-factory.d.ts +4 -4
- package/dist/utils/response-factory.js +15 -21
- package/dist/utils/response-validator.js +88 -73
- package/dist/utils/unreal-command-queue.d.ts +2 -0
- package/dist/utils/unreal-command-queue.js +8 -1
- package/docs/Migration-Guide-v0.5.0.md +1 -9
- package/docs/handler-mapping.md +4 -2
- package/docs/testing-guide.md +2 -2
- package/package.json +12 -6
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeSubsystem.cpp +298 -33
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AnimationHandlers.cpp +7 -8
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintGraphHandlers.cpp +229 -319
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintHandlers.cpp +98 -0
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EffectHandlers.cpp +24 -0
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EnvironmentHandlers.cpp +96 -0
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LightingHandlers.cpp +52 -5
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_ProcessRequest.cpp +5 -268
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SequenceHandlers.cpp +57 -2
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpConnectionManager.cpp +0 -1
- package/scripts/run-all-tests.mjs +25 -20
- package/server.json +3 -2
- package/src/automation/bridge.ts +27 -25
- package/src/automation/connection-manager.ts +18 -0
- package/src/automation/message-handler.ts +33 -8
- package/src/automation/request-tracker.ts +39 -7
- package/src/config.ts +1 -1
- package/src/constants.ts +7 -0
- package/src/graphql/loaders.ts +244 -0
- package/src/graphql/resolvers.ts +47 -49
- package/src/graphql/server.ts +3 -1
- package/src/graphql/types.ts +3 -0
- package/src/index.ts +15 -2
- package/src/resources/assets.ts +5 -4
- package/src/server/tool-registry.ts +3 -3
- package/src/server-setup.ts +3 -37
- package/src/tools/actors.ts +77 -44
- package/src/tools/animation.ts +1 -0
- package/src/tools/assets.ts +76 -65
- package/src/tools/base-tool.ts +3 -3
- package/src/tools/blueprint.ts +170 -104
- package/src/tools/consolidated-tool-definitions.ts +2 -1
- package/src/tools/consolidated-tool-handlers.ts +129 -150
- package/src/tools/dynamic-handler-registry.ts +22 -140
- package/src/tools/editor.ts +43 -29
- package/src/tools/environment.ts +21 -27
- package/src/tools/foliage.ts +28 -25
- package/src/tools/handlers/actor-handlers.ts +16 -17
- package/src/tools/handlers/asset-handlers.ts +484 -484
- package/src/tools/handlers/sequence-handlers.ts +85 -62
- package/src/tools/introspection.ts +7 -7
- package/src/tools/landscape.ts +34 -28
- package/src/tools/level.ts +100 -80
- package/src/tools/lighting.ts +25 -20
- package/src/tools/materials.ts +9 -3
- package/src/tools/niagara.ts +44 -2
- package/src/tools/performance.ts +1 -2
- package/src/tools/physics.ts +7 -1
- package/src/tools/sequence.ts +42 -26
- package/src/tools/ui.ts +1 -3
- package/src/types/automation-responses.ts +119 -0
- package/src/types/responses.ts +355 -0
- package/src/types/tool-interfaces.ts +135 -135
- package/src/types/tool-types.ts +4 -0
- package/src/unreal-bridge.ts +71 -26
- package/src/utils/command-validator.ts +47 -5
- package/src/utils/error-handler.ts +128 -45
- package/src/utils/normalize.test.ts +162 -0
- package/src/utils/normalize.ts +38 -16
- package/src/utils/path-security.ts +43 -0
- package/src/utils/response-factory.ts +29 -24
- package/src/utils/response-validator.ts +103 -87
- package/src/utils/safe-json.test.ts +90 -0
- package/src/utils/unreal-command-queue.ts +13 -1
- package/src/utils/validation.test.ts +184 -0
- package/tests/test-animation.mjs +358 -33
- package/tests/test-asset-graph.mjs +311 -0
- package/tests/test-audio.mjs +314 -116
- package/tests/test-behavior-tree.mjs +327 -144
- package/tests/test-blueprint-graph.mjs +343 -12
- package/tests/test-control-editor.mjs +85 -53
- package/tests/test-graphql.mjs +58 -8
- package/tests/test-input.mjs +349 -0
- package/tests/test-inspect.mjs +291 -61
- package/tests/test-landscape.mjs +304 -48
- package/tests/test-lighting.mjs +428 -0
- package/tests/test-manage-level.mjs +70 -51
- package/tests/test-performance.mjs +539 -0
- package/tests/test-sequence.mjs +82 -46
- package/tests/test-system.mjs +72 -33
- package/tests/test-wasm.mjs +98 -8
- package/vitest.config.ts +35 -0
- package/.github/release-drafter.yml +0 -148
- package/dist/prompts/index.d.ts +0 -21
- package/dist/prompts/index.js +0 -217
- package/dist/tools/blueprint/helpers.d.ts +0 -29
- package/dist/tools/blueprint/helpers.js +0 -182
- package/src/prompts/index.ts +0 -249
- package/src/tools/blueprint/helpers.ts +0 -189
- package/tests/test-blueprint-events.mjs +0 -35
- package/tests/test-extra-tools.mjs +0 -38
- package/tests/test-render.mjs +0 -33
- package/tests/test-search-assets.mjs +0 -66
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Behavior Tree Test Suite
|
|
3
|
+
* Comprehensive Behavior Tree Test Suite
|
|
4
4
|
* Tool: manage_behavior_tree
|
|
5
|
+
* Coverage: All 6 actions with success, error, and edge cases
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
import { runToolTests } from './test-runner.mjs';
|
|
@@ -9,252 +10,434 @@ import { runToolTests } from './test-runner.mjs';
|
|
|
9
10
|
const btPath = '/Game/AI/BT_TestTree';
|
|
10
11
|
|
|
11
12
|
const testCases = [
|
|
12
|
-
//
|
|
13
|
+
// === PRE-CLEANUP ===
|
|
13
14
|
{
|
|
14
|
-
scenario:
|
|
15
|
-
toolName:
|
|
15
|
+
scenario: 'Pre-cleanup: Delete existing BT',
|
|
16
|
+
toolName: 'manage_asset',
|
|
17
|
+
arguments: { action: 'delete', assetPaths: [btPath] },
|
|
18
|
+
expected: 'success|not_found'
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
// === CREATE ===
|
|
22
|
+
{
|
|
23
|
+
scenario: 'Create Behavior Tree',
|
|
24
|
+
toolName: 'manage_behavior_tree',
|
|
16
25
|
arguments: {
|
|
17
|
-
action:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// Fallback: use generic create_asset with BehaviorTree class if supported,
|
|
21
|
-
// otherwise 'create_behavior_tree' might be needed in manage_asset or manage_behavior_tree.
|
|
22
|
-
// Checking consolidated definitions: manage_behavior_tree has add_node etc, but no create_tree.
|
|
23
|
-
// manage_asset has import/create_material... maybe generic create?
|
|
24
|
-
// Let's assume we use a pre-existing one or create one via a helper if available.
|
|
25
|
-
// For test, let's try to create one using manage_asset generic if possible, or skip creation.
|
|
26
|
-
// Let's try to assume it exists or use a known path.
|
|
27
|
-
// For robustness, let's try to create via a python command in 'system_control' if we can't natively.
|
|
28
|
-
action: "execute_console_command",
|
|
29
|
-
command: "py.exec \"unreal.AssetToolsHelpers.get_asset_tools().create_asset('BT_TestTree', '/Game/AI', unreal.BehaviorTree, unreal.BehaviorTreeFactory())\""
|
|
26
|
+
action: 'create',
|
|
27
|
+
name: 'BT_TestTree',
|
|
28
|
+
savePath: '/Game/AI'
|
|
30
29
|
},
|
|
31
|
-
|
|
32
|
-
expected: "success"
|
|
30
|
+
expected: 'success'
|
|
33
31
|
},
|
|
32
|
+
|
|
33
|
+
// === ADD NODES (add_node) ===
|
|
34
34
|
{
|
|
35
|
-
scenario:
|
|
36
|
-
toolName:
|
|
35
|
+
scenario: 'Add Root Selector Node',
|
|
36
|
+
toolName: 'manage_behavior_tree',
|
|
37
37
|
arguments: {
|
|
38
|
-
action:
|
|
38
|
+
action: 'add_node',
|
|
39
39
|
assetPath: btPath,
|
|
40
|
-
nodeType:
|
|
41
|
-
nodeId:
|
|
40
|
+
nodeType: 'Selector',
|
|
41
|
+
nodeId: 'RootSelector',
|
|
42
42
|
x: 0,
|
|
43
43
|
y: 0
|
|
44
44
|
},
|
|
45
|
-
expected:
|
|
45
|
+
expected: 'success'
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
scenario:
|
|
49
|
-
toolName:
|
|
48
|
+
scenario: 'Add Sequence Node',
|
|
49
|
+
toolName: 'manage_behavior_tree',
|
|
50
50
|
arguments: {
|
|
51
|
-
action:
|
|
51
|
+
action: 'add_node',
|
|
52
52
|
assetPath: btPath,
|
|
53
|
-
nodeType:
|
|
54
|
-
nodeId:
|
|
53
|
+
nodeType: 'Sequence',
|
|
54
|
+
nodeId: 'MainSequence',
|
|
55
55
|
x: -200,
|
|
56
56
|
y: 150
|
|
57
57
|
},
|
|
58
|
-
expected:
|
|
58
|
+
expected: 'success'
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
scenario:
|
|
62
|
-
toolName:
|
|
61
|
+
scenario: 'Add Task Node (Wait)',
|
|
62
|
+
toolName: 'manage_behavior_tree',
|
|
63
63
|
arguments: {
|
|
64
|
-
action:
|
|
64
|
+
action: 'add_node',
|
|
65
65
|
assetPath: btPath,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
nodeType: 'Task',
|
|
67
|
+
nodeId: 'WaitTask',
|
|
68
|
+
x: -300,
|
|
69
|
+
y: 300,
|
|
70
|
+
comment: 'Wait 5 seconds'
|
|
68
71
|
},
|
|
69
|
-
expected:
|
|
72
|
+
expected: 'success'
|
|
70
73
|
},
|
|
71
74
|
{
|
|
72
|
-
scenario:
|
|
73
|
-
toolName:
|
|
75
|
+
scenario: 'Add Decorator Node',
|
|
76
|
+
toolName: 'manage_behavior_tree',
|
|
74
77
|
arguments: {
|
|
75
|
-
action:
|
|
78
|
+
action: 'add_node',
|
|
76
79
|
assetPath: btPath,
|
|
77
|
-
nodeType:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
x: -
|
|
80
|
+
nodeType: 'Decorator',
|
|
81
|
+
nodeId: 'BBDecorator',
|
|
82
|
+
parentNodeId: 'MainSequence',
|
|
83
|
+
x: -400,
|
|
84
|
+
y: 200
|
|
85
|
+
},
|
|
86
|
+
expected: 'success'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
scenario: 'Add Service Node',
|
|
90
|
+
toolName: 'manage_behavior_tree',
|
|
91
|
+
arguments: {
|
|
92
|
+
action: 'add_node',
|
|
93
|
+
assetPath: btPath,
|
|
94
|
+
nodeType: 'Service',
|
|
95
|
+
nodeId: 'FocusService',
|
|
96
|
+
parentNodeId: 'RootSelector',
|
|
97
|
+
x: 100,
|
|
98
|
+
y: 100
|
|
99
|
+
},
|
|
100
|
+
expected: 'success'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
scenario: 'Add SimpleParallel Node',
|
|
104
|
+
toolName: 'manage_behavior_tree',
|
|
105
|
+
arguments: {
|
|
106
|
+
action: 'add_node',
|
|
107
|
+
assetPath: btPath,
|
|
108
|
+
nodeType: 'SimpleParallel',
|
|
109
|
+
nodeId: 'ParallelNode',
|
|
110
|
+
x: 200,
|
|
111
|
+
y: 150
|
|
112
|
+
},
|
|
113
|
+
expected: 'success'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
scenario: 'Add MoveTo Task',
|
|
117
|
+
toolName: 'manage_behavior_tree',
|
|
118
|
+
arguments: {
|
|
119
|
+
action: 'add_node',
|
|
120
|
+
assetPath: btPath,
|
|
121
|
+
nodeType: 'Task',
|
|
122
|
+
nodeId: 'MoveToTask',
|
|
123
|
+
x: 200,
|
|
81
124
|
y: 300
|
|
82
125
|
},
|
|
83
|
-
expected:
|
|
126
|
+
expected: 'success'
|
|
84
127
|
},
|
|
85
128
|
{
|
|
86
|
-
scenario:
|
|
87
|
-
toolName:
|
|
129
|
+
scenario: 'Add FinishWithResult Task',
|
|
130
|
+
toolName: 'manage_behavior_tree',
|
|
88
131
|
arguments: {
|
|
89
|
-
action:
|
|
132
|
+
action: 'add_node',
|
|
90
133
|
assetPath: btPath,
|
|
91
|
-
|
|
92
|
-
|
|
134
|
+
nodeType: 'Task',
|
|
135
|
+
nodeId: 'FinishTask',
|
|
136
|
+
x: 300,
|
|
137
|
+
y: 300
|
|
93
138
|
},
|
|
94
|
-
expected:
|
|
139
|
+
expected: 'success'
|
|
95
140
|
},
|
|
141
|
+
|
|
142
|
+
// === CONNECT NODES (connect_nodes) ===
|
|
96
143
|
{
|
|
97
|
-
scenario:
|
|
98
|
-
toolName:
|
|
144
|
+
scenario: 'Connect Root to Sequence',
|
|
145
|
+
toolName: 'manage_behavior_tree',
|
|
99
146
|
arguments: {
|
|
100
|
-
action:
|
|
147
|
+
action: 'connect_nodes',
|
|
101
148
|
assetPath: btPath,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"WaitTime": 5.0
|
|
105
|
-
}
|
|
149
|
+
parentNodeId: 'RootSelector',
|
|
150
|
+
childNodeId: 'MainSequence'
|
|
106
151
|
},
|
|
107
|
-
expected:
|
|
152
|
+
expected: 'success'
|
|
108
153
|
},
|
|
109
154
|
{
|
|
110
|
-
scenario:
|
|
111
|
-
toolName:
|
|
155
|
+
scenario: 'Connect Sequence to WaitTask',
|
|
156
|
+
toolName: 'manage_behavior_tree',
|
|
112
157
|
arguments: {
|
|
113
|
-
action:
|
|
158
|
+
action: 'connect_nodes',
|
|
114
159
|
assetPath: btPath,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
parentNodeId: "MainSequence", // Decorators attach to nodes (composites/tasks)
|
|
118
|
-
nodeId: "BBDecorator"
|
|
160
|
+
parentNodeId: 'MainSequence',
|
|
161
|
+
childNodeId: 'WaitTask'
|
|
119
162
|
},
|
|
120
|
-
expected:
|
|
163
|
+
expected: 'success'
|
|
121
164
|
},
|
|
122
165
|
{
|
|
123
|
-
scenario:
|
|
124
|
-
toolName:
|
|
166
|
+
scenario: 'Connect Root to Parallel',
|
|
167
|
+
toolName: 'manage_behavior_tree',
|
|
125
168
|
arguments: {
|
|
126
|
-
action:
|
|
169
|
+
action: 'connect_nodes',
|
|
127
170
|
assetPath: btPath,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"BlackboardKey": "TargetActor"
|
|
131
|
-
}
|
|
171
|
+
parentNodeId: 'RootSelector',
|
|
172
|
+
childNodeId: 'ParallelNode'
|
|
132
173
|
},
|
|
133
|
-
expected:
|
|
174
|
+
expected: 'success'
|
|
134
175
|
},
|
|
135
176
|
{
|
|
136
|
-
scenario:
|
|
137
|
-
toolName:
|
|
177
|
+
scenario: 'Connect Parallel to MoveTo',
|
|
178
|
+
toolName: 'manage_behavior_tree',
|
|
138
179
|
arguments: {
|
|
139
|
-
action:
|
|
180
|
+
action: 'connect_nodes',
|
|
140
181
|
assetPath: btPath,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
parentNodeId: "RootSelector",
|
|
144
|
-
nodeId: "FocusService"
|
|
182
|
+
parentNodeId: 'ParallelNode',
|
|
183
|
+
childNodeId: 'MoveToTask'
|
|
145
184
|
},
|
|
146
|
-
expected:
|
|
185
|
+
expected: 'success'
|
|
147
186
|
},
|
|
187
|
+
|
|
188
|
+
// === SET NODE PROPERTIES (set_node_properties) ===
|
|
148
189
|
{
|
|
149
|
-
scenario:
|
|
150
|
-
toolName:
|
|
190
|
+
scenario: 'Set WaitTask property (WaitTime)',
|
|
191
|
+
toolName: 'manage_behavior_tree',
|
|
151
192
|
arguments: {
|
|
152
|
-
action:
|
|
193
|
+
action: 'set_node_properties',
|
|
153
194
|
assetPath: btPath,
|
|
154
|
-
nodeId:
|
|
195
|
+
nodeId: 'WaitTask',
|
|
196
|
+
properties: { WaitTime: 5.0 }
|
|
155
197
|
},
|
|
156
|
-
expected:
|
|
198
|
+
expected: 'success'
|
|
157
199
|
},
|
|
158
200
|
{
|
|
159
|
-
scenario:
|
|
160
|
-
toolName:
|
|
201
|
+
scenario: 'Set Decorator property (BlackboardKey)',
|
|
202
|
+
toolName: 'manage_behavior_tree',
|
|
161
203
|
arguments: {
|
|
162
|
-
action:
|
|
204
|
+
action: 'set_node_properties',
|
|
163
205
|
assetPath: btPath,
|
|
164
|
-
|
|
165
|
-
|
|
206
|
+
nodeId: 'BBDecorator',
|
|
207
|
+
properties: { BlackboardKey: 'TargetActor' }
|
|
166
208
|
},
|
|
167
|
-
expected:
|
|
209
|
+
expected: 'success'
|
|
168
210
|
},
|
|
169
211
|
{
|
|
170
|
-
scenario:
|
|
171
|
-
toolName:
|
|
212
|
+
scenario: 'Set RootSelector comment',
|
|
213
|
+
toolName: 'manage_behavior_tree',
|
|
172
214
|
arguments: {
|
|
173
|
-
action:
|
|
215
|
+
action: 'set_node_properties',
|
|
174
216
|
assetPath: btPath,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
217
|
+
nodeId: 'RootSelector',
|
|
218
|
+
comment: 'Main Entry Point'
|
|
219
|
+
},
|
|
220
|
+
expected: 'success'
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
scenario: 'Set multiple properties',
|
|
224
|
+
toolName: 'manage_behavior_tree',
|
|
225
|
+
arguments: {
|
|
226
|
+
action: 'set_node_properties',
|
|
227
|
+
assetPath: btPath,
|
|
228
|
+
nodeId: 'MoveToTask',
|
|
229
|
+
properties: { AcceptableRadius: 50.0, bStopOnOverlap: true }
|
|
230
|
+
},
|
|
231
|
+
expected: 'success'
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
// === BREAK CONNECTIONS (break_connections) ===
|
|
235
|
+
{
|
|
236
|
+
scenario: 'Break Root to Sequence connection',
|
|
237
|
+
toolName: 'manage_behavior_tree',
|
|
238
|
+
arguments: {
|
|
239
|
+
action: 'break_connections',
|
|
240
|
+
assetPath: btPath,
|
|
241
|
+
parentNodeId: 'RootSelector',
|
|
242
|
+
childNodeId: 'MainSequence'
|
|
243
|
+
},
|
|
244
|
+
expected: 'success'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
scenario: 'Reconnect Root to Sequence',
|
|
248
|
+
toolName: 'manage_behavior_tree',
|
|
249
|
+
arguments: {
|
|
250
|
+
action: 'connect_nodes',
|
|
251
|
+
assetPath: btPath,
|
|
252
|
+
parentNodeId: 'RootSelector',
|
|
253
|
+
childNodeId: 'MainSequence'
|
|
254
|
+
},
|
|
255
|
+
expected: 'success'
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
// === REMOVE NODES (remove_node) ===
|
|
259
|
+
{
|
|
260
|
+
scenario: 'Remove FinishTask',
|
|
261
|
+
toolName: 'manage_behavior_tree',
|
|
262
|
+
arguments: {
|
|
263
|
+
action: 'remove_node',
|
|
264
|
+
assetPath: btPath,
|
|
265
|
+
nodeId: 'FinishTask'
|
|
266
|
+
},
|
|
267
|
+
expected: 'success'
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
scenario: 'Remove FocusService',
|
|
271
|
+
toolName: 'manage_behavior_tree',
|
|
272
|
+
arguments: {
|
|
273
|
+
action: 'remove_node',
|
|
274
|
+
assetPath: btPath,
|
|
275
|
+
nodeId: 'FocusService'
|
|
276
|
+
},
|
|
277
|
+
expected: 'success'
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
// === REAL-WORLD SCENARIO: AI Patrol Tree ===
|
|
281
|
+
{
|
|
282
|
+
scenario: 'Patrol - Create Second BT',
|
|
283
|
+
toolName: 'manage_behavior_tree',
|
|
284
|
+
arguments: {
|
|
285
|
+
action: 'create',
|
|
286
|
+
name: 'BT_Patrol',
|
|
287
|
+
savePath: '/Game/AI'
|
|
288
|
+
},
|
|
289
|
+
expected: 'success'
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
scenario: 'Patrol - Add Root',
|
|
293
|
+
toolName: 'manage_behavior_tree',
|
|
294
|
+
arguments: {
|
|
295
|
+
action: 'add_node',
|
|
296
|
+
assetPath: '/Game/AI/BT_Patrol',
|
|
297
|
+
nodeType: 'Sequence',
|
|
298
|
+
nodeId: 'PatrolRoot',
|
|
299
|
+
x: 0,
|
|
300
|
+
y: 0
|
|
301
|
+
},
|
|
302
|
+
expected: 'success'
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
scenario: 'Patrol - Add MoveToPatrol',
|
|
306
|
+
toolName: 'manage_behavior_tree',
|
|
307
|
+
arguments: {
|
|
308
|
+
action: 'add_node',
|
|
309
|
+
assetPath: '/Game/AI/BT_Patrol',
|
|
310
|
+
nodeType: 'Task',
|
|
311
|
+
nodeId: 'MoveToPatrol',
|
|
312
|
+
x: 0,
|
|
178
313
|
y: 150
|
|
179
314
|
},
|
|
180
|
-
expected:
|
|
315
|
+
expected: 'success'
|
|
181
316
|
},
|
|
182
317
|
{
|
|
183
|
-
scenario:
|
|
184
|
-
toolName:
|
|
318
|
+
scenario: 'Patrol - Add Wait',
|
|
319
|
+
toolName: 'manage_behavior_tree',
|
|
185
320
|
arguments: {
|
|
186
|
-
action:
|
|
321
|
+
action: 'add_node',
|
|
322
|
+
assetPath: '/Game/AI/BT_Patrol',
|
|
323
|
+
nodeType: 'Task',
|
|
324
|
+
nodeId: 'WaitAtPatrol',
|
|
325
|
+
x: 100,
|
|
326
|
+
y: 150
|
|
327
|
+
},
|
|
328
|
+
expected: 'success'
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
scenario: 'Patrol - Connect nodes',
|
|
332
|
+
toolName: 'manage_behavior_tree',
|
|
333
|
+
arguments: {
|
|
334
|
+
action: 'connect_nodes',
|
|
335
|
+
assetPath: '/Game/AI/BT_Patrol',
|
|
336
|
+
parentNodeId: 'PatrolRoot',
|
|
337
|
+
childNodeId: 'MoveToPatrol'
|
|
338
|
+
},
|
|
339
|
+
expected: 'success'
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
// === ERROR CASES ===
|
|
343
|
+
{
|
|
344
|
+
scenario: 'Error: Add invalid node type',
|
|
345
|
+
toolName: 'manage_behavior_tree',
|
|
346
|
+
arguments: {
|
|
347
|
+
action: 'add_node',
|
|
187
348
|
assetPath: btPath,
|
|
188
|
-
|
|
189
|
-
childNodeId: "ParallelNode"
|
|
349
|
+
nodeType: 'InvalidType'
|
|
190
350
|
},
|
|
191
|
-
expected:
|
|
351
|
+
expected: 'error'
|
|
192
352
|
},
|
|
193
353
|
{
|
|
194
|
-
scenario:
|
|
195
|
-
toolName:
|
|
354
|
+
scenario: 'Error: Connect cycle',
|
|
355
|
+
toolName: 'manage_behavior_tree',
|
|
196
356
|
arguments: {
|
|
197
|
-
action:
|
|
357
|
+
action: 'connect_nodes',
|
|
198
358
|
assetPath: btPath,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
nodeId: "MoveToTask",
|
|
202
|
-
x: 200,
|
|
203
|
-
y: 300
|
|
359
|
+
parentNodeId: 'MoveToTask',
|
|
360
|
+
childNodeId: 'RootSelector'
|
|
204
361
|
},
|
|
205
|
-
expected:
|
|
362
|
+
expected: 'error'
|
|
206
363
|
},
|
|
207
364
|
{
|
|
208
|
-
scenario:
|
|
209
|
-
toolName:
|
|
365
|
+
scenario: 'Error: Set property on invalid node',
|
|
366
|
+
toolName: 'manage_behavior_tree',
|
|
210
367
|
arguments: {
|
|
211
|
-
action:
|
|
368
|
+
action: 'set_node_properties',
|
|
212
369
|
assetPath: btPath,
|
|
213
|
-
|
|
370
|
+
nodeId: 'NonExistentNode',
|
|
371
|
+
properties: { Val: 1 }
|
|
214
372
|
},
|
|
215
|
-
expected:
|
|
373
|
+
expected: 'error|not_found'
|
|
216
374
|
},
|
|
217
375
|
{
|
|
218
|
-
scenario:
|
|
219
|
-
toolName:
|
|
376
|
+
scenario: 'Error: Remove non-existent node',
|
|
377
|
+
toolName: 'manage_behavior_tree',
|
|
220
378
|
arguments: {
|
|
221
|
-
action:
|
|
379
|
+
action: 'remove_node',
|
|
222
380
|
assetPath: btPath,
|
|
223
|
-
|
|
224
|
-
childNodeId: "RootSelector"
|
|
381
|
+
nodeId: 'GhostNode'
|
|
225
382
|
},
|
|
226
|
-
expected:
|
|
383
|
+
expected: 'error|not_found'
|
|
227
384
|
},
|
|
228
385
|
{
|
|
229
|
-
scenario:
|
|
230
|
-
toolName:
|
|
386
|
+
scenario: 'Error: Connect to non-existent parent',
|
|
387
|
+
toolName: 'manage_behavior_tree',
|
|
231
388
|
arguments: {
|
|
232
|
-
action:
|
|
389
|
+
action: 'connect_nodes',
|
|
233
390
|
assetPath: btPath,
|
|
234
|
-
|
|
235
|
-
|
|
391
|
+
parentNodeId: 'NonExistentParent',
|
|
392
|
+
childNodeId: 'WaitTask'
|
|
236
393
|
},
|
|
237
|
-
expected:
|
|
394
|
+
expected: 'error|not_found'
|
|
238
395
|
},
|
|
239
396
|
{
|
|
240
|
-
scenario:
|
|
241
|
-
toolName:
|
|
397
|
+
scenario: 'Error: Create without name',
|
|
398
|
+
toolName: 'manage_behavior_tree',
|
|
242
399
|
arguments: {
|
|
243
|
-
action:
|
|
400
|
+
action: 'create',
|
|
401
|
+
savePath: '/Game/AI'
|
|
402
|
+
},
|
|
403
|
+
expected: 'error|missing'
|
|
404
|
+
},
|
|
405
|
+
|
|
406
|
+
// === EDGE CASES ===
|
|
407
|
+
{
|
|
408
|
+
scenario: 'Edge: Negative coordinates',
|
|
409
|
+
toolName: 'manage_behavior_tree',
|
|
410
|
+
arguments: {
|
|
411
|
+
action: 'add_node',
|
|
244
412
|
assetPath: btPath,
|
|
245
|
-
|
|
246
|
-
|
|
413
|
+
nodeType: 'Selector',
|
|
414
|
+
nodeId: 'NegPosNode',
|
|
415
|
+
x: -1000,
|
|
416
|
+
y: -1000
|
|
247
417
|
},
|
|
248
|
-
expected:
|
|
418
|
+
expected: 'success'
|
|
249
419
|
},
|
|
250
420
|
{
|
|
251
|
-
scenario:
|
|
252
|
-
toolName:
|
|
421
|
+
scenario: 'Edge: Empty properties object',
|
|
422
|
+
toolName: 'manage_behavior_tree',
|
|
423
|
+
arguments: {
|
|
424
|
+
action: 'set_node_properties',
|
|
425
|
+
assetPath: btPath,
|
|
426
|
+
nodeId: 'RootSelector',
|
|
427
|
+
properties: {}
|
|
428
|
+
},
|
|
429
|
+
expected: 'success'
|
|
430
|
+
},
|
|
431
|
+
|
|
432
|
+
// === CLEANUP ===
|
|
433
|
+
{
|
|
434
|
+
scenario: 'Cleanup: Delete test BT assets',
|
|
435
|
+
toolName: 'manage_asset',
|
|
253
436
|
arguments: {
|
|
254
|
-
action:
|
|
255
|
-
assetPaths: [btPath]
|
|
437
|
+
action: 'delete',
|
|
438
|
+
assetPaths: [btPath, '/Game/AI/BT_Patrol']
|
|
256
439
|
},
|
|
257
|
-
expected:
|
|
440
|
+
expected: 'success'
|
|
258
441
|
}
|
|
259
442
|
];
|
|
260
443
|
|