unreal-engine-mcp-server 0.5.4 → 0.5.6

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.
Files changed (561) hide show
  1. package/CHANGELOG.md +350 -0
  2. package/dist/automation/bridge.d.ts.map +1 -0
  3. package/dist/automation/bridge.js +5 -4
  4. package/dist/automation/bridge.js.map +1 -0
  5. package/dist/automation/connection-manager.d.ts.map +1 -0
  6. package/dist/automation/connection-manager.js.map +1 -0
  7. package/dist/automation/handshake.d.ts.map +1 -0
  8. package/dist/automation/handshake.js.map +1 -0
  9. package/dist/automation/index.d.ts.map +1 -0
  10. package/dist/automation/index.js.map +1 -0
  11. package/dist/automation/message-handler.d.ts.map +1 -0
  12. package/dist/automation/message-handler.js.map +1 -0
  13. package/dist/automation/request-tracker.d.ts.map +1 -0
  14. package/dist/automation/request-tracker.js.map +1 -0
  15. package/dist/automation/types.d.ts +7 -0
  16. package/dist/automation/types.d.ts.map +1 -0
  17. package/dist/automation/types.js.map +1 -0
  18. package/dist/cli.d.ts.map +1 -0
  19. package/dist/cli.js +6 -4
  20. package/dist/cli.js.map +1 -0
  21. package/dist/config/class-aliases.d.ts.map +1 -0
  22. package/dist/config/class-aliases.js.map +1 -0
  23. package/dist/config.d.ts.map +1 -0
  24. package/dist/config.js.map +1 -0
  25. package/dist/constants.d.ts.map +1 -0
  26. package/dist/constants.js.map +1 -0
  27. package/dist/graphql/loaders.d.ts.map +1 -0
  28. package/dist/graphql/loaders.js.map +1 -0
  29. package/dist/graphql/resolvers.d.ts +174 -69
  30. package/dist/graphql/resolvers.d.ts.map +1 -0
  31. package/dist/graphql/resolvers.js +82 -67
  32. package/dist/graphql/resolvers.js.map +1 -0
  33. package/dist/graphql/schema.d.ts.map +1 -0
  34. package/dist/graphql/schema.js.map +1 -0
  35. package/dist/graphql/server.d.ts.map +1 -0
  36. package/dist/graphql/server.js.map +1 -0
  37. package/dist/graphql/types.d.ts.map +1 -0
  38. package/dist/graphql/types.js.map +1 -0
  39. package/dist/handlers/resource-handlers.d.ts.map +1 -0
  40. package/dist/handlers/resource-handlers.js.map +1 -0
  41. package/dist/index.d.ts +2 -1
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +70 -9
  44. package/dist/index.js.map +1 -0
  45. package/dist/resources/actors.d.ts +7 -4
  46. package/dist/resources/actors.d.ts.map +1 -0
  47. package/dist/resources/actors.js +15 -12
  48. package/dist/resources/actors.js.map +1 -0
  49. package/dist/resources/assets.d.ts +43 -2
  50. package/dist/resources/assets.d.ts.map +1 -0
  51. package/dist/resources/assets.js +21 -12
  52. package/dist/resources/assets.js.map +1 -0
  53. package/dist/resources/levels.d.ts.map +1 -0
  54. package/dist/resources/levels.js +7 -5
  55. package/dist/resources/levels.js.map +1 -0
  56. package/dist/schemas/index.d.ts +4 -0
  57. package/dist/schemas/index.d.ts.map +1 -0
  58. package/dist/schemas/index.js +4 -0
  59. package/dist/schemas/index.js.map +1 -0
  60. package/dist/schemas/parser.d.ts +20 -0
  61. package/dist/schemas/parser.d.ts.map +1 -0
  62. package/dist/schemas/parser.js +61 -0
  63. package/dist/schemas/parser.js.map +1 -0
  64. package/dist/schemas/primitives.d.ts +221 -0
  65. package/dist/schemas/primitives.d.ts.map +1 -0
  66. package/dist/schemas/primitives.js +115 -0
  67. package/dist/schemas/primitives.js.map +1 -0
  68. package/dist/schemas/responses.d.ts +362 -0
  69. package/dist/schemas/responses.d.ts.map +1 -0
  70. package/dist/schemas/responses.js +252 -0
  71. package/dist/schemas/responses.js.map +1 -0
  72. package/dist/server/resource-registry.d.ts.map +1 -0
  73. package/dist/server/resource-registry.js.map +1 -0
  74. package/dist/server/tool-registry.d.ts.map +1 -0
  75. package/dist/server/tool-registry.js +22 -17
  76. package/dist/server/tool-registry.js.map +1 -0
  77. package/dist/server-setup.d.ts.map +1 -0
  78. package/dist/server-setup.js.map +1 -0
  79. package/dist/services/health-monitor.d.ts +1 -1
  80. package/dist/services/health-monitor.d.ts.map +1 -0
  81. package/dist/services/health-monitor.js +4 -3
  82. package/dist/services/health-monitor.js.map +1 -0
  83. package/dist/services/metrics-server.d.ts.map +1 -0
  84. package/dist/services/metrics-server.js.map +1 -0
  85. package/dist/tools/actors.d.ts +27 -27
  86. package/dist/tools/actors.d.ts.map +1 -0
  87. package/dist/tools/actors.js +14 -10
  88. package/dist/tools/actors.js.map +1 -0
  89. package/dist/tools/animation.d.ts +15 -23
  90. package/dist/tools/animation.d.ts.map +1 -0
  91. package/dist/tools/animation.js +17 -13
  92. package/dist/tools/animation.js.map +1 -0
  93. package/dist/tools/assets.d.ts.map +1 -0
  94. package/dist/tools/assets.js +18 -12
  95. package/dist/tools/assets.js.map +1 -0
  96. package/dist/tools/audio.d.ts +10 -10
  97. package/dist/tools/audio.d.ts.map +1 -0
  98. package/dist/tools/audio.js.map +1 -0
  99. package/dist/tools/base-tool.d.ts.map +1 -0
  100. package/dist/tools/base-tool.js.map +1 -0
  101. package/dist/tools/behavior-tree.d.ts +24 -24
  102. package/dist/tools/behavior-tree.d.ts.map +1 -0
  103. package/dist/tools/behavior-tree.js.map +1 -0
  104. package/dist/tools/blueprint.d.ts +14 -3
  105. package/dist/tools/blueprint.d.ts.map +1 -0
  106. package/dist/tools/blueprint.js +5 -3
  107. package/dist/tools/blueprint.js.map +1 -0
  108. package/dist/tools/consolidated-tool-definitions.d.ts +32 -32
  109. package/dist/tools/consolidated-tool-definitions.d.ts.map +1 -0
  110. package/dist/tools/consolidated-tool-definitions.js.map +1 -0
  111. package/dist/tools/consolidated-tool-handlers.d.ts +1 -1
  112. package/dist/tools/consolidated-tool-handlers.d.ts.map +1 -0
  113. package/dist/tools/consolidated-tool-handlers.js +26 -21
  114. package/dist/tools/consolidated-tool-handlers.js.map +1 -0
  115. package/dist/tools/debug.d.ts +25 -7
  116. package/dist/tools/debug.d.ts.map +1 -0
  117. package/dist/tools/debug.js +3 -1
  118. package/dist/tools/debug.js.map +1 -0
  119. package/dist/tools/dynamic-handler-registry.d.ts +1 -1
  120. package/dist/tools/dynamic-handler-registry.d.ts.map +1 -0
  121. package/dist/tools/dynamic-handler-registry.js +3 -1
  122. package/dist/tools/dynamic-handler-registry.js.map +1 -0
  123. package/dist/tools/editor.d.ts.map +1 -0
  124. package/dist/tools/editor.js +8 -6
  125. package/dist/tools/editor.js.map +1 -0
  126. package/dist/tools/engine.d.ts +1 -1
  127. package/dist/tools/engine.d.ts.map +1 -0
  128. package/dist/tools/engine.js +4 -2
  129. package/dist/tools/engine.js.map +1 -0
  130. package/dist/tools/environment.d.ts.map +1 -0
  131. package/dist/tools/environment.js +4 -3
  132. package/dist/tools/environment.js.map +1 -0
  133. package/dist/tools/foliage.d.ts.map +1 -0
  134. package/dist/tools/foliage.js +8 -8
  135. package/dist/tools/foliage.js.map +1 -0
  136. package/dist/tools/handlers/actor-handlers.d.ts +2 -1
  137. package/dist/tools/handlers/actor-handlers.d.ts.map +1 -0
  138. package/dist/tools/handlers/actor-handlers.js +56 -33
  139. package/dist/tools/handlers/actor-handlers.js.map +1 -0
  140. package/dist/tools/handlers/animation-handlers.d.ts +2 -1
  141. package/dist/tools/handlers/animation-handlers.d.ts.map +1 -0
  142. package/dist/tools/handlers/animation-handlers.js +74 -67
  143. package/dist/tools/handlers/animation-handlers.js.map +1 -0
  144. package/dist/tools/handlers/argument-helper.d.ts +24 -4
  145. package/dist/tools/handlers/argument-helper.d.ts.map +1 -0
  146. package/dist/tools/handlers/argument-helper.js +139 -4
  147. package/dist/tools/handlers/argument-helper.js.map +1 -0
  148. package/dist/tools/handlers/asset-handlers.d.ts +2 -1
  149. package/dist/tools/handlers/asset-handlers.d.ts.map +1 -0
  150. package/dist/tools/handlers/asset-handlers.js +155 -94
  151. package/dist/tools/handlers/asset-handlers.js.map +1 -0
  152. package/dist/tools/handlers/audio-handlers.d.ts +2 -1
  153. package/dist/tools/handlers/audio-handlers.d.ts.map +1 -0
  154. package/dist/tools/handlers/audio-handlers.js +82 -80
  155. package/dist/tools/handlers/audio-handlers.js.map +1 -0
  156. package/dist/tools/handlers/blueprint-handlers.d.ts +3 -5
  157. package/dist/tools/handlers/blueprint-handlers.d.ts.map +1 -0
  158. package/dist/tools/handlers/blueprint-handlers.js +150 -142
  159. package/dist/tools/handlers/blueprint-handlers.js.map +1 -0
  160. package/dist/tools/handlers/common-handlers.d.ts +2 -3
  161. package/dist/tools/handlers/common-handlers.d.ts.map +1 -0
  162. package/dist/tools/handlers/common-handlers.js.map +1 -0
  163. package/dist/tools/handlers/editor-handlers.d.ts.map +1 -0
  164. package/dist/tools/handlers/editor-handlers.js +12 -2
  165. package/dist/tools/handlers/editor-handlers.js.map +1 -0
  166. package/dist/tools/handlers/effect-handlers.d.ts +2 -1
  167. package/dist/tools/handlers/effect-handlers.d.ts.map +1 -0
  168. package/dist/tools/handlers/effect-handlers.js +70 -68
  169. package/dist/tools/handlers/effect-handlers.js.map +1 -0
  170. package/dist/tools/handlers/environment-handlers.d.ts +2 -1
  171. package/dist/tools/handlers/environment-handlers.d.ts.map +1 -0
  172. package/dist/tools/handlers/environment-handlers.js +86 -74
  173. package/dist/tools/handlers/environment-handlers.js.map +1 -0
  174. package/dist/tools/handlers/graph-handlers.d.ts +1 -1
  175. package/dist/tools/handlers/graph-handlers.d.ts.map +1 -0
  176. package/dist/tools/handlers/graph-handlers.js +63 -2
  177. package/dist/tools/handlers/graph-handlers.js.map +1 -0
  178. package/dist/tools/handlers/input-handlers.d.ts +2 -5
  179. package/dist/tools/handlers/input-handlers.d.ts.map +1 -0
  180. package/dist/tools/handlers/input-handlers.js +5 -4
  181. package/dist/tools/handlers/input-handlers.js.map +1 -0
  182. package/dist/tools/handlers/inspect-handlers.d.ts +2 -1
  183. package/dist/tools/handlers/inspect-handlers.d.ts.map +1 -0
  184. package/dist/tools/handlers/inspect-handlers.js +61 -37
  185. package/dist/tools/handlers/inspect-handlers.js.map +1 -0
  186. package/dist/tools/handlers/level-handlers.d.ts +2 -2
  187. package/dist/tools/handlers/level-handlers.d.ts.map +1 -0
  188. package/dist/tools/handlers/level-handlers.js +43 -39
  189. package/dist/tools/handlers/level-handlers.js.map +1 -0
  190. package/dist/tools/handlers/lighting-handlers.d.ts +12 -1
  191. package/dist/tools/handlers/lighting-handlers.d.ts.map +1 -0
  192. package/dist/tools/handlers/lighting-handlers.js +90 -47
  193. package/dist/tools/handlers/lighting-handlers.js.map +1 -0
  194. package/dist/tools/handlers/performance-handlers.d.ts +2 -1
  195. package/dist/tools/handlers/performance-handlers.d.ts.map +1 -0
  196. package/dist/tools/handlers/performance-handlers.js +55 -40
  197. package/dist/tools/handlers/performance-handlers.js.map +1 -0
  198. package/dist/tools/handlers/pipeline-handlers.d.ts.map +1 -0
  199. package/dist/tools/handlers/pipeline-handlers.js.map +1 -0
  200. package/dist/tools/handlers/sequence-handlers.d.ts.map +1 -0
  201. package/dist/tools/handlers/sequence-handlers.js.map +1 -0
  202. package/dist/tools/handlers/system-handlers.d.ts +3 -2
  203. package/dist/tools/handlers/system-handlers.d.ts.map +1 -0
  204. package/dist/tools/handlers/system-handlers.js +105 -52
  205. package/dist/tools/handlers/system-handlers.js.map +1 -0
  206. package/dist/tools/input.d.ts.map +1 -0
  207. package/dist/tools/input.js +3 -1
  208. package/dist/tools/input.js.map +1 -0
  209. package/dist/tools/introspection.d.ts +14 -14
  210. package/dist/tools/introspection.d.ts.map +1 -0
  211. package/dist/tools/introspection.js +54 -45
  212. package/dist/tools/introspection.js.map +1 -0
  213. package/dist/tools/landscape.d.ts.map +1 -0
  214. package/dist/tools/landscape.js +15 -13
  215. package/dist/tools/landscape.js.map +1 -0
  216. package/dist/tools/level.d.ts.map +1 -0
  217. package/dist/tools/level.js +3 -2
  218. package/dist/tools/level.js.map +1 -0
  219. package/dist/tools/lighting.d.ts +32 -59
  220. package/dist/tools/lighting.d.ts.map +1 -0
  221. package/dist/tools/lighting.js +56 -19
  222. package/dist/tools/lighting.js.map +1 -0
  223. package/dist/tools/logs.d.ts.map +1 -0
  224. package/dist/tools/logs.js +2 -1
  225. package/dist/tools/logs.js.map +1 -0
  226. package/dist/tools/materials.d.ts +42 -14
  227. package/dist/tools/materials.d.ts.map +1 -0
  228. package/dist/tools/materials.js +15 -9
  229. package/dist/tools/materials.js.map +1 -0
  230. package/dist/tools/niagara.d.ts +63 -39
  231. package/dist/tools/niagara.d.ts.map +1 -0
  232. package/dist/tools/niagara.js +43 -33
  233. package/dist/tools/niagara.js.map +1 -0
  234. package/dist/tools/performance.d.ts +12 -11
  235. package/dist/tools/performance.d.ts.map +1 -0
  236. package/dist/tools/performance.js +3 -2
  237. package/dist/tools/performance.js.map +1 -0
  238. package/dist/tools/physics.d.ts +37 -20
  239. package/dist/tools/physics.d.ts.map +1 -0
  240. package/dist/tools/physics.js +37 -30
  241. package/dist/tools/physics.js.map +1 -0
  242. package/dist/tools/property-dictionary.d.ts.map +1 -0
  243. package/dist/tools/property-dictionary.js.map +1 -0
  244. package/dist/tools/sequence.d.ts +1 -1
  245. package/dist/tools/sequence.d.ts.map +1 -0
  246. package/dist/tools/sequence.js +8 -4
  247. package/dist/tools/sequence.js.map +1 -0
  248. package/dist/tools/tool-definition-utils.d.ts.map +1 -0
  249. package/dist/tools/tool-definition-utils.js.map +1 -0
  250. package/dist/tools/ui.d.ts +11 -11
  251. package/dist/tools/ui.d.ts.map +1 -0
  252. package/dist/tools/ui.js +7 -3
  253. package/dist/tools/ui.js.map +1 -0
  254. package/dist/types/automation-responses.d.ts.map +1 -0
  255. package/dist/types/automation-responses.js.map +1 -0
  256. package/dist/types/env.d.ts.map +1 -0
  257. package/dist/types/env.js.map +1 -0
  258. package/dist/types/handler-types.d.ts +112 -3
  259. package/dist/types/handler-types.d.ts.map +1 -0
  260. package/dist/types/handler-types.js.map +1 -0
  261. package/dist/types/tool-interfaces.d.ts +39 -21
  262. package/dist/types/tool-interfaces.d.ts.map +1 -0
  263. package/dist/types/tool-interfaces.js.map +1 -0
  264. package/dist/types/tool-types.d.ts +8 -8
  265. package/dist/types/tool-types.d.ts.map +1 -0
  266. package/dist/types/tool-types.js.map +1 -0
  267. package/dist/unreal-bridge.d.ts +8 -6
  268. package/dist/unreal-bridge.d.ts.map +1 -0
  269. package/dist/unreal-bridge.js +16 -3
  270. package/dist/unreal-bridge.js.map +1 -0
  271. package/dist/utils/command-validator.d.ts.map +1 -0
  272. package/dist/utils/command-validator.js.map +1 -0
  273. package/dist/utils/elicitation.d.ts +2 -5
  274. package/dist/utils/elicitation.d.ts.map +1 -0
  275. package/dist/utils/elicitation.js +3 -2
  276. package/dist/utils/elicitation.js.map +1 -0
  277. package/dist/utils/error-handler.d.ts.map +1 -0
  278. package/dist/utils/error-handler.js.map +1 -0
  279. package/dist/utils/ini-reader.d.ts +1 -1
  280. package/dist/utils/ini-reader.d.ts.map +1 -0
  281. package/dist/utils/ini-reader.js.map +1 -0
  282. package/dist/utils/logger.d.ts +4 -4
  283. package/dist/utils/logger.d.ts.map +1 -0
  284. package/dist/utils/logger.js.map +1 -0
  285. package/dist/utils/normalize.d.ts +2 -2
  286. package/dist/utils/normalize.d.ts.map +1 -0
  287. package/dist/utils/normalize.js +4 -3
  288. package/dist/utils/normalize.js.map +1 -0
  289. package/dist/utils/path-security.d.ts.map +1 -0
  290. package/dist/utils/path-security.js.map +1 -0
  291. package/dist/utils/response-factory.d.ts +2 -2
  292. package/dist/utils/response-factory.d.ts.map +1 -0
  293. package/dist/utils/response-factory.js +3 -1
  294. package/dist/utils/response-factory.js.map +1 -0
  295. package/dist/utils/response-validator.d.ts +4 -4
  296. package/dist/utils/response-validator.d.ts.map +1 -0
  297. package/dist/utils/response-validator.js +31 -23
  298. package/dist/utils/response-validator.js.map +1 -0
  299. package/dist/utils/result-helpers.d.ts.map +1 -0
  300. package/dist/utils/result-helpers.js.map +1 -0
  301. package/dist/utils/safe-json.d.ts.map +1 -0
  302. package/dist/utils/safe-json.js.map +1 -0
  303. package/dist/utils/unreal-command-queue.d.ts +2 -2
  304. package/dist/utils/unreal-command-queue.d.ts.map +1 -0
  305. package/dist/utils/unreal-command-queue.js +4 -3
  306. package/dist/utils/unreal-command-queue.js.map +1 -0
  307. package/dist/utils/validation.d.ts +1 -1
  308. package/dist/utils/validation.d.ts.map +1 -0
  309. package/dist/utils/validation.js.map +1 -0
  310. package/dist/wasm/index.d.ts +2 -2
  311. package/dist/wasm/index.d.ts.map +1 -0
  312. package/dist/wasm/index.js +11 -7
  313. package/dist/wasm/index.js.map +1 -0
  314. package/package.json +12 -34
  315. package/server.json +2 -2
  316. package/.dockerignore +0 -57
  317. package/.env.example +0 -26
  318. package/.env.production +0 -61
  319. package/.eslintrc.json +0 -0
  320. package/.eslintrc.override.json +0 -8
  321. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -94
  322. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  323. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -56
  324. package/.github/copilot-instructions.md +0 -478
  325. package/.github/dependabot.yml +0 -19
  326. package/.github/labeler.yml +0 -24
  327. package/.github/labels.yml +0 -70
  328. package/.github/pull_request_template.md +0 -42
  329. package/.github/release-drafter-config.yml +0 -51
  330. package/.github/workflows/auto-merge.yml +0 -38
  331. package/.github/workflows/ci.yml +0 -38
  332. package/.github/workflows/dependency-review.yml +0 -17
  333. package/.github/workflows/gemini-issue-triage.yml +0 -172
  334. package/.github/workflows/greetings.yml +0 -27
  335. package/.github/workflows/labeler.yml +0 -17
  336. package/.github/workflows/links.yml +0 -80
  337. package/.github/workflows/pr-size-labeler.yml +0 -137
  338. package/.github/workflows/publish-mcp.yml +0 -79
  339. package/.github/workflows/release-drafter.yml +0 -24
  340. package/.github/workflows/release.yml +0 -112
  341. package/.github/workflows/semantic-pull-request.yml +0 -35
  342. package/.github/workflows/smoke-test.yml +0 -36
  343. package/.github/workflows/stale.yml +0 -28
  344. package/CONTRIBUTING.md +0 -140
  345. package/Dockerfile +0 -37
  346. package/GEMINI.md +0 -115
  347. package/Public/Plugin_setup_guide.mp4 +0 -0
  348. package/Public/icon.png +0 -0
  349. package/claude_desktop_config_example.json +0 -15
  350. package/dist/types/responses.d.ts +0 -249
  351. package/dist/types/responses.js +0 -2
  352. package/docs/GraphQL-API.md +0 -888
  353. package/docs/Migration-Guide-v0.5.0.md +0 -684
  354. package/docs/Roadmap.md +0 -53
  355. package/docs/WebAssembly-Integration.md +0 -628
  356. package/docs/editor-plugin-extension.md +0 -370
  357. package/docs/handler-mapping.md +0 -249
  358. package/docs/native-automation-progress.md +0 -128
  359. package/docs/testing-guide.md +0 -423
  360. package/eslint.config.mjs +0 -68
  361. package/mcp-config-example.json +0 -14
  362. package/plugins/McpAutomationBridge/Config/FilterPlugin.ini +0 -8
  363. package/plugins/McpAutomationBridge/McpAutomationBridge.uplugin +0 -64
  364. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/McpAutomationBridge.Build.cs +0 -189
  365. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeGlobals.cpp +0 -22
  366. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeGlobals.h +0 -30
  367. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeHelpers.h +0 -1983
  368. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeModule.cpp +0 -72
  369. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeSettings.cpp +0 -46
  370. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeSubsystem.cpp +0 -846
  371. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AnimationHandlers.cpp +0 -2393
  372. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AssetQueryHandlers.cpp +0 -300
  373. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AssetWorkflowHandlers.cpp +0 -2807
  374. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AudioHandlers.cpp +0 -1087
  375. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BehaviorTreeHandlers.cpp +0 -488
  376. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintCreationHandlers.cpp +0 -643
  377. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintCreationHandlers.h +0 -31
  378. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintGraphHandlers.cpp +0 -1094
  379. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintHandlers.cpp +0 -5750
  380. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintHandlers_List.cpp +0 -152
  381. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_ControlHandlers.cpp +0 -2614
  382. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_DebugHandlers.cpp +0 -42
  383. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EditorFunctionHandlers.cpp +0 -1237
  384. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EffectHandlers.cpp +0 -1725
  385. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EnvironmentHandlers.cpp +0 -2265
  386. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_FoliageHandlers.cpp +0 -954
  387. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_InputHandlers.cpp +0 -209
  388. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_InsightsHandlers.cpp +0 -41
  389. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LandscapeHandlers.cpp +0 -1164
  390. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LevelHandlers.cpp +0 -762
  391. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LightingHandlers.cpp +0 -663
  392. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LogHandlers.cpp +0 -136
  393. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_MaterialGraphHandlers.cpp +0 -494
  394. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_NiagaraGraphHandlers.cpp +0 -278
  395. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_NiagaraHandlers.cpp +0 -625
  396. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_PerformanceHandlers.cpp +0 -401
  397. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_PipelineHandlers.cpp +0 -67
  398. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_ProcessRequest.cpp +0 -472
  399. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_PropertyHandlers.cpp +0 -2634
  400. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_RenderHandlers.cpp +0 -189
  401. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SCSHandlers.cpp +0 -917
  402. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SCSHandlers.h +0 -39
  403. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SequenceHandlers.cpp +0 -2706
  404. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SequencerHandlers.cpp +0 -519
  405. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_TestHandlers.cpp +0 -38
  406. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_UiHandlers.cpp +0 -668
  407. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_WorldPartitionHandlers.cpp +0 -346
  408. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpBridgeWebSocket.cpp +0 -1345
  409. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpBridgeWebSocket.h +0 -149
  410. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpConnectionManager.cpp +0 -782
  411. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Public/McpAutomationBridgeSettings.h +0 -115
  412. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Public/McpAutomationBridgeSubsystem.h +0 -796
  413. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Public/McpConnectionManager.h +0 -117
  414. package/scripts/check-unreal-connection.mjs +0 -19
  415. package/scripts/clean-tmp.js +0 -23
  416. package/scripts/patch-wasm.js +0 -26
  417. package/scripts/run-all-tests.mjs +0 -136
  418. package/scripts/smoke-test.ts +0 -94
  419. package/scripts/sync-mcp-plugin.js +0 -143
  420. package/scripts/test-no-plugin-alternates.mjs +0 -113
  421. package/scripts/validate-server.js +0 -46
  422. package/scripts/verify-automation-bridge.js +0 -200
  423. package/src/automation/bridge.ts +0 -630
  424. package/src/automation/connection-manager.ts +0 -148
  425. package/src/automation/handshake.ts +0 -99
  426. package/src/automation/index.ts +0 -2
  427. package/src/automation/message-handler.ts +0 -192
  428. package/src/automation/request-tracker.ts +0 -155
  429. package/src/automation/types.ts +0 -108
  430. package/src/cli.ts +0 -34
  431. package/src/config/class-aliases.ts +0 -65
  432. package/src/config.ts +0 -73
  433. package/src/constants.ts +0 -29
  434. package/src/graphql/loaders.ts +0 -244
  435. package/src/graphql/resolvers.ts +0 -1008
  436. package/src/graphql/schema.ts +0 -452
  437. package/src/graphql/server.ts +0 -156
  438. package/src/graphql/types.ts +0 -10
  439. package/src/handlers/resource-handlers.ts +0 -186
  440. package/src/index.ts +0 -243
  441. package/src/resources/actors.ts +0 -127
  442. package/src/resources/assets.ts +0 -286
  443. package/src/resources/levels.ts +0 -68
  444. package/src/server/resource-registry.ts +0 -47
  445. package/src/server/tool-registry.ts +0 -354
  446. package/src/server-setup.ts +0 -114
  447. package/src/services/health-monitor.ts +0 -132
  448. package/src/services/metrics-server.ts +0 -176
  449. package/src/tools/actors.ts +0 -564
  450. package/src/tools/animation.ts +0 -941
  451. package/src/tools/assets.ts +0 -394
  452. package/src/tools/audio.ts +0 -499
  453. package/src/tools/base-tool.ts +0 -52
  454. package/src/tools/behavior-tree.ts +0 -45
  455. package/src/tools/blueprint.ts +0 -940
  456. package/src/tools/consolidated-tool-definitions.ts +0 -1256
  457. package/src/tools/consolidated-tool-handlers.ts +0 -302
  458. package/src/tools/debug.ts +0 -622
  459. package/src/tools/dynamic-handler-registry.ts +0 -33
  460. package/src/tools/editor.ts +0 -435
  461. package/src/tools/engine.ts +0 -43
  462. package/src/tools/environment.ts +0 -281
  463. package/src/tools/foliage.ts +0 -596
  464. package/src/tools/handlers/actor-handlers.ts +0 -244
  465. package/src/tools/handlers/animation-handlers.ts +0 -237
  466. package/src/tools/handlers/argument-helper.ts +0 -142
  467. package/src/tools/handlers/asset-handlers.ts +0 -550
  468. package/src/tools/handlers/audio-handlers.ts +0 -194
  469. package/src/tools/handlers/blueprint-handlers.ts +0 -380
  470. package/src/tools/handlers/common-handlers.ts +0 -108
  471. package/src/tools/handlers/editor-handlers.ts +0 -124
  472. package/src/tools/handlers/effect-handlers.ts +0 -224
  473. package/src/tools/handlers/environment-handlers.ts +0 -183
  474. package/src/tools/handlers/graph-handlers.ts +0 -117
  475. package/src/tools/handlers/input-handlers.ts +0 -28
  476. package/src/tools/handlers/inspect-handlers.ts +0 -450
  477. package/src/tools/handlers/level-handlers.ts +0 -253
  478. package/src/tools/handlers/lighting-handlers.ts +0 -151
  479. package/src/tools/handlers/performance-handlers.ts +0 -132
  480. package/src/tools/handlers/pipeline-handlers.ts +0 -194
  481. package/src/tools/handlers/sequence-handlers.ts +0 -438
  482. package/src/tools/handlers/system-handlers.ts +0 -564
  483. package/src/tools/input.ts +0 -160
  484. package/src/tools/introspection.ts +0 -689
  485. package/src/tools/landscape.ts +0 -649
  486. package/src/tools/level.ts +0 -989
  487. package/src/tools/lighting.ts +0 -1052
  488. package/src/tools/logs.ts +0 -219
  489. package/src/tools/materials.ts +0 -295
  490. package/src/tools/niagara.ts +0 -485
  491. package/src/tools/performance.ts +0 -661
  492. package/src/tools/physics.ts +0 -679
  493. package/src/tools/property-dictionary.ts +0 -98
  494. package/src/tools/sequence.ts +0 -385
  495. package/src/tools/tool-definition-utils.ts +0 -35
  496. package/src/tools/ui.ts +0 -452
  497. package/src/types/automation-responses.ts +0 -119
  498. package/src/types/env.ts +0 -17
  499. package/src/types/handler-types.ts +0 -442
  500. package/src/types/responses.ts +0 -355
  501. package/src/types/tool-interfaces.ts +0 -250
  502. package/src/types/tool-types.ts +0 -575
  503. package/src/unreal-bridge.ts +0 -693
  504. package/src/utils/command-validator.ts +0 -139
  505. package/src/utils/elicitation.ts +0 -132
  506. package/src/utils/error-handler.ts +0 -287
  507. package/src/utils/ini-reader.ts +0 -86
  508. package/src/utils/logger.ts +0 -35
  509. package/src/utils/normalize.test.ts +0 -162
  510. package/src/utils/normalize.ts +0 -146
  511. package/src/utils/path-security.ts +0 -43
  512. package/src/utils/response-factory.ts +0 -44
  513. package/src/utils/response-validator.ts +0 -395
  514. package/src/utils/result-helpers.ts +0 -195
  515. package/src/utils/safe-json.test.ts +0 -90
  516. package/src/utils/safe-json.ts +0 -70
  517. package/src/utils/unreal-command-queue.ts +0 -166
  518. package/src/utils/validation.test.ts +0 -184
  519. package/src/utils/validation.ts +0 -312
  520. package/src/wasm/index.ts +0 -838
  521. package/test-server.mjs +0 -100
  522. package/tests/test-animation.mjs +0 -369
  523. package/tests/test-asset-advanced.mjs +0 -82
  524. package/tests/test-asset-graph.mjs +0 -311
  525. package/tests/test-audio.mjs +0 -417
  526. package/tests/test-automation-timeouts.mjs +0 -98
  527. package/tests/test-behavior-tree.mjs +0 -444
  528. package/tests/test-blueprint-graph.mjs +0 -410
  529. package/tests/test-blueprint.mjs +0 -577
  530. package/tests/test-client-mode.mjs +0 -86
  531. package/tests/test-console-command.mjs +0 -56
  532. package/tests/test-control-actor.mjs +0 -425
  533. package/tests/test-control-editor.mjs +0 -112
  534. package/tests/test-graphql.mjs +0 -372
  535. package/tests/test-input.mjs +0 -349
  536. package/tests/test-inspect.mjs +0 -302
  537. package/tests/test-landscape.mjs +0 -316
  538. package/tests/test-lighting.mjs +0 -428
  539. package/tests/test-manage-asset.mjs +0 -438
  540. package/tests/test-manage-level.mjs +0 -89
  541. package/tests/test-materials.mjs +0 -356
  542. package/tests/test-niagara.mjs +0 -185
  543. package/tests/test-no-inline-python.mjs +0 -122
  544. package/tests/test-performance.mjs +0 -539
  545. package/tests/test-plugin-handshake.mjs +0 -82
  546. package/tests/test-runner.mjs +0 -993
  547. package/tests/test-sequence.mjs +0 -104
  548. package/tests/test-system.mjs +0 -96
  549. package/tests/test-wasm.mjs +0 -283
  550. package/tests/test-world-partition.mjs +0 -215
  551. package/tsconfig.json +0 -56
  552. package/vitest.config.ts +0 -35
  553. package/wasm/Cargo.lock +0 -363
  554. package/wasm/Cargo.toml +0 -42
  555. package/wasm/LICENSE +0 -21
  556. package/wasm/README.md +0 -253
  557. package/wasm/src/dependency_resolver.rs +0 -377
  558. package/wasm/src/lib.rs +0 -153
  559. package/wasm/src/property_parser.rs +0 -271
  560. package/wasm/src/transform_math.rs +0 -396
  561. package/wasm/tests/integration.rs +0 -109
@@ -1,940 +0,0 @@
1
- import { BaseTool } from './base-tool.js';
2
- import { IBlueprintTools, StandardActionResponse } from '../types/tool-interfaces.js';
3
- import { Logger } from '../utils/logger.js';
4
- import { validateAssetParams, concurrencyDelay } from '../utils/validation.js';
5
- import { coerceString } from '../utils/result-helpers.js';
6
-
7
- /** Response from automation actions */
8
- interface ActionResponse extends StandardActionResponse {
9
- result?: Record<string, unknown>;
10
- requestId?: string;
11
- blueprint?: string;
12
- blueprintPath?: string;
13
- component?: string;
14
- componentName?: string;
15
- componentType?: string;
16
- componentClass?: string;
17
- found?: string;
18
- checked?: string[];
19
- path?: string;
20
- nodes?: unknown[];
21
- graphName?: string;
22
- }
23
-
24
- /** Response type guard */
25
- interface ActionResponseInput {
26
- success?: boolean;
27
- message?: string;
28
- error?: string;
29
- result?: unknown;
30
- requestId?: string;
31
- [key: string]: unknown;
32
- }
33
-
34
- export class BlueprintTools extends BaseTool implements IBlueprintTools {
35
- private log = new Logger('BlueprintTools');
36
- private pluginBlueprintActionsAvailable: boolean | null = null;
37
-
38
- private async sendAction(action: string, payload: Record<string, unknown> = {}, options?: { timeoutMs?: number; waitForEvent?: boolean; waitForEventTimeoutMs?: number }): Promise<ActionResponse> {
39
- const envDefault = Number(process.env.MCP_AUTOMATION_REQUEST_TIMEOUT_MS ?? '120000');
40
- const defaultTimeout = Number.isFinite(envDefault) && envDefault > 0 ? envDefault : 120000;
41
- const finalTimeout = typeof options?.timeoutMs === 'number' && options?.timeoutMs > 0 ? options.timeoutMs : defaultTimeout;
42
- try {
43
- const response = await this.sendAutomationRequest(action, payload, { timeoutMs: finalTimeout, waitForEvent: !!options?.waitForEvent, waitForEventTimeoutMs: options?.waitForEventTimeoutMs }) as ActionResponseInput;
44
- const success = response && response.success !== false;
45
- const result = (response.result ?? response) as Record<string, unknown>;
46
- return { success, message: response.message ?? undefined, error: response.success === false ? (response.error ?? response.message) : undefined, result, requestId: response.requestId };
47
- } catch (err: unknown) {
48
- const errMsg = err instanceof Error ? err.message : String(err);
49
- return { success: false, error: errMsg, message: errMsg };
50
- }
51
- }
52
-
53
- private isUnknownActionResponse(res: ActionResponse | StandardActionResponse | null | undefined): boolean {
54
- if (!res) return false;
55
- const errStr = typeof res.error === 'string' ? res.error : '';
56
- const msgStr = typeof res.message === 'string' ? res.message : '';
57
- const txt = (errStr || msgStr).toLowerCase();
58
- // Only treat specific error codes as "not implemented"
59
- return txt.includes('unknown_action') || txt.includes('unknown automation action') || txt.includes('not_implemented') || txt === 'unknown_plugin_action';
60
- }
61
-
62
- private buildCandidates(rawName: string | undefined): string[] {
63
- const trimmed = coerceString(rawName)?.trim();
64
- if (!trimmed) return [];
65
- const normalized = trimmed.replace(/\\/g, '/').replace(/\/\/+/g, '/');
66
- const withoutLeading = normalized.replace(/^\/+/, '');
67
- const basename = withoutLeading.split('/').pop() ?? withoutLeading;
68
- const candidates: string[] = [];
69
- if (normalized.includes('/')) {
70
- if (normalized.startsWith('/')) candidates.push(normalized);
71
- if (basename) {
72
- candidates.push(`/Game/Blueprints/${basename}`);
73
- candidates.push(`/Game/${basename}`);
74
- }
75
- if (!normalized.startsWith('/')) candidates.push(`/${withoutLeading}`);
76
- } else {
77
- if (basename) {
78
- candidates.push(`/Game/Blueprints/${basename}`);
79
- candidates.push(`/Game/${basename}`);
80
- }
81
- candidates.push(normalized);
82
- candidates.push(`/${withoutLeading}`);
83
- }
84
- return candidates.filter(Boolean);
85
- }
86
-
87
- async createBlueprint(params: { name: string; blueprintType?: string; savePath?: string; parentClass?: string; properties?: Record<string, unknown>; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
88
- try {
89
- const validation = validateAssetParams({ name: params.name, savePath: params.savePath || '/Game/Blueprints' });
90
- if (!validation.valid) return { success: false, message: `Failed to create blueprint: ${validation.error}`, error: validation.error };
91
- const sanitized = validation.sanitized;
92
- const payload: Record<string, unknown> = { name: sanitized.name, blueprintType: params.blueprintType ?? 'Actor', savePath: sanitized.savePath ?? '/Game/Blueprints', parentClass: params.parentClass, properties: params.properties, waitForCompletion: !!params.waitForCompletion };
93
- await concurrencyDelay();
94
-
95
- if (this.pluginBlueprintActionsAvailable === false) {
96
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_create' } as const;
97
- }
98
-
99
- const envPluginTimeout = Number(process.env.MCP_AUTOMATION_PLUGIN_CREATE_TIMEOUT_MS ?? process.env.MCP_AUTOMATION_REQUEST_TIMEOUT_MS ?? '15000');
100
- const pluginTimeout = Number.isFinite(envPluginTimeout) && envPluginTimeout > 0 ? envPluginTimeout : 15000;
101
- try {
102
- const res = await this.sendAction('blueprint_create', payload, { timeoutMs: typeof params.timeoutMs === 'number' ? params.timeoutMs : pluginTimeout, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
103
- if (res && res.success) {
104
- this.pluginBlueprintActionsAvailable = true;
105
- // Enrich response for Validator
106
- return {
107
- ...res,
108
- blueprint: sanitized.name,
109
- path: `${sanitized.savePath}/${sanitized.name}`.replace('//', '/'),
110
- message: res.message || `Created blueprint ${sanitized.name}`
111
- };
112
- }
113
- if (res && this.isUnknownActionResponse(res)) {
114
- this.pluginBlueprintActionsAvailable = false;
115
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_create' } as const;
116
- }
117
- return res;
118
- } catch (err: unknown) {
119
- // ... (unchanged catch block)
120
- const errTxt = String(err ?? '');
121
- const isTimeout = errTxt.includes('Request timed out') || errTxt.includes('-32001') || errTxt.toLowerCase().includes('timeout');
122
- if (isTimeout) {
123
- this.pluginBlueprintActionsAvailable = false;
124
- }
125
- return { success: false, error: String(err), message: String(err) } as const;
126
- }
127
- } catch (err: unknown) {
128
- return { success: false, error: String(err), message: String(err) };
129
- }
130
- }
131
-
132
- async modifyConstructionScript(params: { blueprintPath: string; operations: any[]; compile?: boolean; save?: boolean; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
133
- const blueprintPath = coerceString(params.blueprintPath);
134
- if (!blueprintPath) return { success: false, message: 'Blueprint path is required', error: 'INVALID_BLUEPRINT_PATH' };
135
- if (!Array.isArray(params.operations) || params.operations.length === 0) return { success: false, message: 'At least one SCS operation is required', error: 'MISSING_OPERATIONS' };
136
-
137
- // Fix: Map 'op' to 'type' if missing, for backward compatibility or user convenience
138
- const operations = params.operations.map(op => {
139
- if (op && typeof op === 'object' && op.op && !op.type) {
140
- return { ...op, type: op.op };
141
- }
142
- return op;
143
- });
144
-
145
- const payload: Record<string, unknown> = { blueprintPath, operations };
146
- if (typeof params.compile === 'boolean') payload.compile = params.compile;
147
- if (typeof params.save === 'boolean') payload.save = params.save;
148
- const res = await this.sendAction('blueprint_modify_scs', payload, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
149
-
150
- if (res && res.result && typeof res.result === 'object' && res.result?.error === 'SCS_UNAVAILABLE') {
151
- this.pluginBlueprintActionsAvailable = false;
152
- return { success: false, error: 'SCS_UNAVAILABLE', message: 'Plugin does not support construction script modification (blueprint_modify_scs)' } as const;
153
- }
154
- if (res && res.success) this.pluginBlueprintActionsAvailable = true;
155
- if (res && this.isUnknownActionResponse(res)) {
156
- this.pluginBlueprintActionsAvailable = false;
157
- }
158
- return res;
159
- }
160
-
161
- async addComponent(params: { blueprintName: string; componentType: string; componentName: string; attachTo?: string; transform?: Record<string, unknown>; properties?: Record<string, unknown>; compile?: boolean; save?: boolean; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
162
- const blueprintName = coerceString(params.blueprintName);
163
- if (!blueprintName) return { success: false as const, message: 'Blueprint name is required', error: 'INVALID_BLUEPRINT' };
164
- const componentClass = coerceString(params.componentType);
165
- if (!componentClass) return { success: false as const, message: 'Component class is required', error: 'INVALID_COMPONENT_CLASS' };
166
- const rawComponentName = coerceString(params.componentName) ?? params.componentName;
167
- if (!rawComponentName) return { success: false as const, message: 'Component name is required', error: 'INVALID_COMPONENT_NAME' };
168
- const sanitizedComponentName = rawComponentName.replace(/[^A-Za-z0-9_]/g, '_');
169
- const candidates = this.buildCandidates(blueprintName);
170
- const primary = candidates[0];
171
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
172
- try {
173
- const op = { type: 'add_component', componentName: sanitizedComponentName, componentClass, attachTo: params.attachTo, transform: params.transform, properties: params.properties };
174
- const svcResult = await this.modifyConstructionScript({ blueprintPath: primary, operations: [op], compile: params.compile, save: params.save, timeoutMs: params.timeoutMs, waitForCompletion: params.waitForCompletion, waitForCompletionTimeoutMs: params.waitForCompletionTimeoutMs });
175
- if (svcResult && svcResult.success) {
176
- this.pluginBlueprintActionsAvailable = true;
177
- return { ...svcResult, component: sanitizedComponentName, componentName: sanitizedComponentName, componentType: componentClass, componentClass, blueprintPath: svcResult.blueprintPath ?? primary } as const;
178
- }
179
- if (svcResult && (this.isUnknownActionResponse(svcResult) || (svcResult.error && svcResult.error === 'SCS_UNAVAILABLE'))) {
180
- this.pluginBlueprintActionsAvailable = false;
181
- return { success: false, error: 'SCS_UNAVAILABLE', message: 'Plugin does not support construction script modification (blueprint_modify_scs)' } as const;
182
- }
183
- return svcResult;
184
- } catch (err: unknown) {
185
- return { success: false, error: String(err) };
186
- }
187
- }
188
-
189
- async waitForBlueprint(blueprintRef: string | string[], timeoutMs?: number): Promise<StandardActionResponse> {
190
- const candidates = Array.isArray(blueprintRef) ? blueprintRef : this.buildCandidates(blueprintRef as string | undefined);
191
- if (!candidates || candidates.length === 0) return { success: false, error: 'Invalid blueprint reference', checked: [] };
192
- if (this.pluginBlueprintActionsAvailable === false) {
193
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_exists' };
194
- }
195
-
196
- const start = Date.now();
197
- const envDefault = Number(process.env.MCP_AUTOMATION_SCS_TIMEOUT_MS ?? process.env.MCP_AUTOMATION_REQUEST_TIMEOUT_MS ?? '15000');
198
- // Default to 15s (15000ms) instead of 120s to avoid long hangs on non-existent assets
199
- const defaultTimeout = Number.isFinite(envDefault) && envDefault > 0 ? envDefault : 15000;
200
- const tot = typeof timeoutMs === 'number' && timeoutMs > 0 ? timeoutMs : defaultTimeout;
201
- const perCheck = Math.min(5000, Math.max(1000, Math.floor(tot / 6)));
202
- while (Date.now() - start < tot) {
203
- for (const candidate of candidates) {
204
- try {
205
- const r = await this.sendAction('blueprint_exists', { blueprintCandidates: [candidate], requestedPath: candidate }, { timeoutMs: Math.min(perCheck, tot) });
206
- if (r && r.success && r.result && (r.result.exists === true || r.result.found)) {
207
- this.pluginBlueprintActionsAvailable = true;
208
- return { success: true, found: r.result.found ?? candidate };
209
- }
210
- if (r && r.success === false && this.isUnknownActionResponse(r)) {
211
- this.pluginBlueprintActionsAvailable = false;
212
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_exists' };
213
- }
214
- } catch (_e) {
215
- // ignore and try next candidate
216
- }
217
- }
218
- await new Promise((r) => setTimeout(r, 1000));
219
- }
220
- if (this.pluginBlueprintActionsAvailable === null) {
221
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin availability unknown; blueprint_exists not implemented by plugin' };
222
- }
223
- return { success: false, error: `Timeout waiting for blueprint after ${tot}ms`, checked: candidates };
224
- }
225
-
226
- async getBlueprint(params: { blueprintName: string; timeoutMs?: number; }): Promise<StandardActionResponse> {
227
- const candidates = this.buildCandidates(params.blueprintName);
228
- const primary = candidates[0];
229
- if (!primary) return { success: false, error: 'Invalid blueprint name' } as const;
230
- try {
231
- const pluginResp = await this.sendAction('blueprint_get', { blueprintCandidates: candidates, requestedPath: primary }, { timeoutMs: params.timeoutMs });
232
- if (pluginResp && pluginResp.success) {
233
- if (pluginResp && typeof pluginResp === 'object') {
234
- return { ...pluginResp, blueprint: pluginResp.result, blueprintPath: primary };
235
- }
236
- return pluginResp;
237
- }
238
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
239
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_get' } as const;
240
- }
241
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_GET_FAILED', message: pluginResp?.message ?? 'Failed to get blueprint via automation bridge' } as const;
242
- } catch (err: unknown) {
243
- return { success: false, error: String(err), message: String(err) } as const;
244
- }
245
- }
246
-
247
- async getBlueprintInfo(params: { blueprintPath: string; timeoutMs?: number }): Promise<StandardActionResponse> {
248
- const blueprintPath = coerceString(params.blueprintPath);
249
- if (!blueprintPath) {
250
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
251
- }
252
-
253
- const candidates = this.buildCandidates(blueprintPath);
254
- const primary = candidates[0] ?? blueprintPath;
255
-
256
- try {
257
- const resp = await this.sendAction('blueprint_get', { blueprintCandidates: candidates.length > 0 ? candidates : [primary], requestedPath: primary }, { timeoutMs: params.timeoutMs });
258
- if (resp && resp.success) {
259
- const result = resp.result ?? resp;
260
- const resolvedPath = typeof result?.resolvedPath === 'string' ? result.resolvedPath : primary;
261
- return {
262
- success: true,
263
- message: resp.message ?? `Blueprint metadata retrieved for ${resolvedPath}`,
264
- blueprintPath: resolvedPath,
265
- blueprint: result,
266
- result,
267
- requestId: resp.requestId
268
- };
269
- }
270
-
271
- if (resp && this.isUnknownActionResponse(resp)) {
272
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_get' } as const;
273
- }
274
-
275
- return { success: false, error: resp?.error ?? 'BLUEPRINT_GET_FAILED', message: resp?.message ?? 'Failed to get blueprint via automation bridge' } as const;
276
- } catch (err: unknown) {
277
- return { success: false, error: String(err), message: String(err) } as const;
278
- }
279
- }
280
-
281
- async probeSubobjectDataHandle(opts: { componentClass?: string } = {}): Promise<StandardActionResponse> {
282
- return await this.sendAction('blueprint_probe_subobject_handle', { componentClass: opts.componentClass });
283
- }
284
-
285
- async setBlueprintDefault(params: { blueprintName: string; propertyName: string; value: unknown }): Promise<StandardActionResponse> {
286
- const candidates = this.buildCandidates(params.blueprintName);
287
- const primary = candidates[0];
288
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
289
- return await this.sendAction('blueprint_set_default', { blueprintCandidates: candidates, requestedPath: primary, propertyName: params.propertyName, value: params.value }) as any;
290
- }
291
-
292
- async addVariable(params: { blueprintName: string; variableName: string; variableType: string; defaultValue?: any; category?: string; isReplicated?: boolean; isPublic?: boolean; variablePinType?: Record<string, unknown>; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
293
- const candidates = this.buildCandidates(params.blueprintName);
294
- const primary = candidates[0];
295
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
296
- const pluginResp = await this.sendAction('blueprint_add_variable', { blueprintCandidates: candidates, requestedPath: primary, variableName: params.variableName, variableType: params.variableType, defaultValue: params.defaultValue, category: params.category, isReplicated: params.isReplicated, isPublic: params.isPublic, variablePinType: params.variablePinType }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
297
- if (pluginResp && pluginResp.success) {
298
- return pluginResp as any;
299
- }
300
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
301
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_variable' } as const;
302
- }
303
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_ADD_VARIABLE_FAILED', message: pluginResp?.message ?? 'Failed to add variable via automation bridge' } as const;
304
- }
305
-
306
- async removeVariable(params: { blueprintName: string; variableName: string; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
307
- const candidates = this.buildCandidates(params.blueprintName);
308
- const primary = candidates[0];
309
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
310
- const pluginResp = await this.sendAction('blueprint_remove_variable', { blueprintCandidates: candidates, requestedPath: primary, variableName: params.variableName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
311
- if (pluginResp && pluginResp.success) return pluginResp as any;
312
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
313
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_remove_variable' } as const;
314
- }
315
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_REMOVE_VARIABLE_FAILED', message: pluginResp?.message ?? 'Failed to remove variable via automation bridge' } as const;
316
- }
317
-
318
- async renameVariable(params: { blueprintName: string; oldName: string; newName: string; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
319
- const candidates = this.buildCandidates(params.blueprintName);
320
- const primary = candidates[0];
321
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
322
- const pluginResp = await this.sendAction('blueprint_rename_variable', { blueprintCandidates: candidates, requestedPath: primary, oldName: params.oldName, newName: params.newName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
323
- if (pluginResp && pluginResp.success) return pluginResp as any;
324
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
325
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_rename_variable' } as const;
326
- }
327
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_RENAME_VARIABLE_FAILED', message: pluginResp?.message ?? 'Failed to rename variable via automation bridge' } as const;
328
- }
329
-
330
-
331
-
332
- async addEvent(params: { blueprintName: string; eventType: string; customEventName?: string; parameters?: Array<{ name: string; type: string }>; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
333
- const candidates = this.buildCandidates(params.blueprintName);
334
- const primary = candidates[0];
335
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
336
- const pluginResp = await this.sendAction('blueprint_add_event', { blueprintCandidates: candidates, requestedPath: primary, eventType: params.eventType, customEventName: params.customEventName, parameters: params.parameters }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
337
- if (pluginResp && pluginResp.success) {
338
- return pluginResp as any;
339
- }
340
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
341
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_event' } as const;
342
- }
343
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_ADD_EVENT_FAILED', message: pluginResp?.message ?? 'Failed to add event via automation bridge' } as const;
344
- }
345
-
346
- async removeEvent(params: { blueprintName: string; eventName: string; customEventName?: string; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
347
- const candidates = this.buildCandidates(params.blueprintName);
348
- const primary = candidates[0];
349
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
350
-
351
- // Fix: Allow customEventName as alias for eventName
352
- const finalEventName = params.eventName || params.customEventName;
353
- if (!finalEventName) return { success: false, error: 'INVALID_ARGUMENT', message: 'eventName is required' } as const;
354
-
355
- try {
356
- const pluginResp = await this.sendAction('blueprint_remove_event', { blueprintCandidates: candidates, requestedPath: primary, eventName: finalEventName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
357
- if (pluginResp && pluginResp.success) {
358
- return pluginResp as any;
359
- }
360
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
361
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_remove_event' } as const;
362
- }
363
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_REMOVE_EVENT_FAILED', message: pluginResp?.message ?? 'Failed to remove event via automation bridge' } as const;
364
- } catch (err: unknown) {
365
- return { success: false, error: String(err), message: String(err) } as const;
366
- }
367
- }
368
-
369
- async addFunction(params: { blueprintName: string; functionName: string; inputs?: Array<{ name: string; type: string }>; outputs?: Array<{ name: string; type: string }>; isPublic?: boolean; category?: string; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
370
- const candidates = this.buildCandidates(params.blueprintName);
371
- const primary = candidates[0];
372
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
373
- const pluginResp = await this.sendAction('blueprint_add_function', { blueprintCandidates: candidates, requestedPath: primary, functionName: params.functionName, inputs: params.inputs, outputs: params.outputs, isPublic: params.isPublic, category: params.category }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
374
- if (pluginResp && pluginResp.success) {
375
- return pluginResp as any;
376
- }
377
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
378
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_function' } as const;
379
- }
380
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_ADD_FUNCTION_FAILED', message: pluginResp?.message ?? 'Failed to add function via automation bridge' } as const;
381
- }
382
-
383
- async setVariableMetadata(params: { blueprintName: string; variableName: string; metadata: Record<string, unknown>; timeoutMs?: number }): Promise<StandardActionResponse> {
384
- const candidates = this.buildCandidates(params.blueprintName);
385
- const primary = candidates[0];
386
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
387
- const pluginResp = await this.sendAction('blueprint_set_variable_metadata', { blueprintCandidates: candidates, requestedPath: primary, variableName: params.variableName, metadata: params.metadata }, { timeoutMs: params.timeoutMs });
388
- if (pluginResp && pluginResp.success) {
389
- return pluginResp as any;
390
- }
391
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
392
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_set_variable_metadata' } as const;
393
- }
394
- return { success: false, error: pluginResp?.error ?? 'SET_VARIABLE_METADATA_FAILED', message: pluginResp?.message ?? 'Failed to set variable metadata via automation bridge' } as const;
395
- }
396
-
397
- async addConstructionScript(params: { blueprintName: string; scriptName: string; timeoutMs?: number; waitForCompletion?: boolean; waitForCompletionTimeoutMs?: number }): Promise<StandardActionResponse> {
398
- const candidates = this.buildCandidates(params.blueprintName);
399
- const primary = candidates[0];
400
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
401
- const pluginResp = await this.sendAction('blueprint_add_construction_script', { blueprintCandidates: candidates, requestedPath: primary, scriptName: params.scriptName }, { timeoutMs: params.timeoutMs, waitForEvent: !!params.waitForCompletion, waitForEventTimeoutMs: params.waitForCompletionTimeoutMs });
402
- if (pluginResp && pluginResp.success) return pluginResp as any;
403
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
404
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_add_construction_script' } as const;
405
- }
406
- return { success: false, error: pluginResp?.error ?? 'ADD_CONSTRUCTION_SCRIPT_FAILED', message: pluginResp?.message ?? 'Failed to add construction script via automation bridge' } as const;
407
- }
408
-
409
- async compileBlueprint(params: { blueprintName: string; saveAfterCompile?: boolean; }): Promise<StandardActionResponse> {
410
- try {
411
- const candidates = this.buildCandidates(params.blueprintName);
412
- const primary = candidates[0] ?? params.blueprintName;
413
- const pluginResp = await this.sendAction('blueprint_compile', { requestedPath: primary, saveAfterCompile: params.saveAfterCompile });
414
- if (pluginResp && pluginResp.success) {
415
- return {
416
- ...pluginResp,
417
- blueprint: primary,
418
- message: pluginResp.message || `Compiled ${primary}`
419
- } as any;
420
- }
421
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
422
- this.pluginBlueprintActionsAvailable = false;
423
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement blueprint_compile' } as const;
424
- }
425
- return { success: false, error: pluginResp?.error ?? 'BLUEPRINT_COMPILE_FAILED', message: pluginResp?.message ?? 'Failed to compile blueprint via automation bridge' } as const;
426
- } catch (err: unknown) {
427
- return { success: false, error: String(err) };
428
- }
429
- }
430
-
431
- async getBlueprintSCS(params: { blueprintPath: string; timeoutMs?: number }): Promise<StandardActionResponse> {
432
- const blueprintPath = coerceString(params.blueprintPath);
433
- if (!blueprintPath) {
434
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
435
- }
436
-
437
- try {
438
- const pluginResp = await this.sendAction('get_blueprint_scs',
439
- { blueprint_path: blueprintPath },
440
- { timeoutMs: params.timeoutMs });
441
-
442
- if (pluginResp && pluginResp.success) return pluginResp as any;
443
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
444
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement get_blueprint_scs' } as const;
445
- }
446
- return { success: false, error: pluginResp?.error ?? 'GET_SCS_FAILED', message: pluginResp?.message ?? 'Failed to get SCS via automation bridge' } as const;
447
- } catch (err: unknown) {
448
- return { success: false, error: String(err), message: String(err) } as const;
449
- }
450
- }
451
-
452
- async addSCSComponent(params: {
453
- blueprintPath: string;
454
- componentClass: string;
455
- componentName: string;
456
- parentComponent?: string;
457
- meshPath?: string;
458
- materialPath?: string;
459
- timeoutMs?: number;
460
- }): Promise<StandardActionResponse> {
461
- const blueprintPath = coerceString(params.blueprintPath);
462
- if (!blueprintPath) {
463
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
464
- }
465
-
466
- const componentClass = coerceString(params.componentClass);
467
- if (!componentClass) {
468
- return { success: false, error: 'INVALID_COMPONENT_CLASS', message: 'Component class is required' } as const;
469
- }
470
-
471
- const componentName = coerceString(params.componentName);
472
- if (!componentName) {
473
- return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' } as const;
474
- }
475
-
476
- try {
477
- const payload: Record<string, unknown> = {
478
- blueprint_path: blueprintPath,
479
- component_class: componentClass,
480
- component_name: componentName
481
- };
482
-
483
- if (params.parentComponent) {
484
- payload.parent_component = params.parentComponent;
485
- }
486
- if (params.meshPath) {
487
- payload.mesh_path = params.meshPath;
488
- }
489
- if (params.materialPath) {
490
- payload.material_path = params.materialPath;
491
- }
492
-
493
- const pluginResp = await this.sendAction('add_scs_component', payload, { timeoutMs: params.timeoutMs });
494
-
495
- if (pluginResp && pluginResp.success === false) {
496
- if (pluginResp?.message) {
497
- this.log.warn?.(`addSCSComponent reported warning: ${pluginResp?.message}`);
498
- }
499
- }
500
- if (pluginResp && pluginResp.success) return pluginResp as any;
501
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
502
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement add_scs_component' } as const;
503
- }
504
- return { success: false, error: pluginResp?.error ?? 'ADD_SCS_COMPONENT_FAILED', message: pluginResp?.message ?? 'Failed to add SCS component via automation bridge' } as const;
505
- } catch (err: unknown) {
506
- return { success: false, error: String(err), message: String(err) } as const;
507
- }
508
- }
509
-
510
- async removeSCSComponent(params: { blueprintPath: string; componentName: string; timeoutMs?: number }): Promise<StandardActionResponse> {
511
- const blueprintPath = coerceString(params.blueprintPath);
512
- if (!blueprintPath) {
513
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
514
- }
515
-
516
- const componentName = coerceString(params.componentName);
517
- if (!componentName) {
518
- return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' } as const;
519
- }
520
-
521
- try {
522
- const pluginResp = await this.sendAction('remove_scs_component',
523
- { blueprint_path: blueprintPath, component_name: componentName },
524
- { timeoutMs: params.timeoutMs });
525
-
526
- if (pluginResp && pluginResp.success === false) {
527
- if (pluginResp?.message) {
528
- this.log.warn?.(`removeSCSComponent reported warning: ${pluginResp?.message}`);
529
- }
530
- }
531
- if (pluginResp && pluginResp.success) return pluginResp as any;
532
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
533
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement remove_scs_component' } as const;
534
- }
535
- return { success: false, error: pluginResp?.error ?? 'REMOVE_SCS_COMPONENT_FAILED', message: pluginResp?.message ?? 'Failed to remove SCS component via automation bridge' } as const;
536
- } catch (err: unknown) {
537
- return { success: false, error: String(err), message: String(err) } as const;
538
- }
539
- }
540
-
541
- async reparentSCSComponent(params: {
542
- blueprintPath: string;
543
- componentName: string;
544
- newParent: string;
545
- timeoutMs?: number;
546
- }): Promise<StandardActionResponse> {
547
- const blueprintPath = coerceString(params.blueprintPath);
548
- if (!blueprintPath) {
549
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
550
- }
551
-
552
- const componentName = coerceString(params.componentName);
553
- if (!componentName) {
554
- return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' } as const;
555
- }
556
-
557
- try {
558
- const pluginResp = await this.sendAction('reparent_scs_component',
559
- {
560
- blueprint_path: blueprintPath,
561
- component_name: componentName,
562
- new_parent: params.newParent || ''
563
- },
564
- { timeoutMs: params.timeoutMs });
565
-
566
- if (pluginResp && pluginResp.success === false) {
567
- if (pluginResp?.message) {
568
- this.log.warn?.(`reparentSCSComponent reported warning: ${pluginResp?.message}`);
569
- }
570
- }
571
- if (pluginResp && pluginResp.success) return pluginResp as any;
572
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
573
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement reparent_scs_component' } as const;
574
- }
575
- return { success: false, error: pluginResp?.error ?? 'REPARENT_SCS_COMPONENT_FAILED', message: pluginResp?.message ?? 'Failed to reparent SCS component via automation bridge' } as const;
576
- } catch (err: unknown) {
577
- return { success: false, error: String(err), message: String(err) } as const;
578
- }
579
- }
580
-
581
- async setSCSComponentTransform(params: {
582
- blueprintPath: string;
583
- componentName: string;
584
- location?: [number, number, number];
585
- rotation?: [number, number, number];
586
- scale?: [number, number, number];
587
- timeoutMs?: number;
588
- }): Promise<StandardActionResponse> {
589
- const blueprintPath = coerceString(params.blueprintPath);
590
- if (!blueprintPath) {
591
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
592
- }
593
-
594
- const componentName = coerceString(params.componentName);
595
- if (!componentName) {
596
- return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' } as const;
597
- }
598
-
599
- try {
600
- const payload: Record<string, unknown> = {
601
- blueprint_path: blueprintPath,
602
- component_name: componentName
603
- };
604
-
605
- if (params.location) payload.location = params.location;
606
- if (params.rotation) payload.rotation = params.rotation;
607
- if (params.scale) payload.scale = params.scale;
608
-
609
- const pluginResp = await this.sendAction('set_scs_component_transform', payload, { timeoutMs: params.timeoutMs });
610
-
611
- if (pluginResp && pluginResp.success === false) {
612
- if (pluginResp?.message) {
613
- this.log.warn?.(`setSCSComponentTransform reported warning: ${pluginResp?.message}`);
614
- }
615
- }
616
- if (pluginResp && pluginResp.success) return pluginResp as any;
617
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
618
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement set_scs_component_transform' } as const;
619
- }
620
- return { success: false, error: pluginResp?.error ?? 'SET_SCS_TRANSFORM_FAILED', message: pluginResp?.message ?? 'Failed to set SCS component transform via automation bridge' } as const;
621
- } catch (err: unknown) {
622
- return { success: false, error: String(err), message: String(err) } as const;
623
- }
624
- }
625
-
626
- async setSCSComponentProperty(params: {
627
- blueprintPath: string;
628
- componentName: string;
629
- propertyName: string;
630
- propertyValue: any;
631
- timeoutMs?: number;
632
- }): Promise<StandardActionResponse> {
633
- const blueprintPath = coerceString(params.blueprintPath);
634
- if (!blueprintPath) {
635
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
636
- }
637
-
638
- const componentName = coerceString(params.componentName);
639
- if (!componentName) {
640
- return { success: false, error: 'INVALID_COMPONENT_NAME', message: 'Component name is required' } as const;
641
- }
642
-
643
- const propertyName = coerceString(params.propertyName);
644
- if (!propertyName) {
645
- return { success: false, error: 'INVALID_PROPERTY_NAME', message: 'Property name is required' } as const;
646
- }
647
-
648
- try {
649
- const propertyValueJson = JSON.stringify({ value: params.propertyValue });
650
-
651
- const pluginResp = await this.sendAction('set_scs_component_property',
652
- {
653
- blueprint_path: blueprintPath,
654
- component_name: componentName,
655
- property_name: propertyName,
656
- property_value: propertyValueJson
657
- },
658
- { timeoutMs: params.timeoutMs });
659
-
660
- if (pluginResp && pluginResp.success === false) {
661
- if (pluginResp?.message) {
662
- this.log.warn?.(`setSCSComponentProperty reported warning: ${pluginResp?.message}`);
663
- }
664
- }
665
- if (pluginResp && pluginResp.success) return pluginResp as any;
666
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
667
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement set_scs_component_property' } as const;
668
- }
669
- return { success: false, error: pluginResp?.error ?? 'SET_SCS_PROPERTY_FAILED', message: pluginResp?.message ?? 'Failed to set SCS component property via automation bridge' } as const;
670
- } catch (err: unknown) {
671
- return { success: false, error: String(err), message: String(err) } as const;
672
- }
673
- }
674
-
675
- async getNodes(params: {
676
- blueprintPath: string;
677
- graphName?: string;
678
- timeoutMs?: number;
679
- }): Promise<StandardActionResponse> {
680
- const blueprintPath = coerceString(params.blueprintPath);
681
- if (!blueprintPath) {
682
- return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
683
- }
684
-
685
- try {
686
- const payload: Record<string, unknown> = {
687
- subAction: 'get_nodes',
688
- blueprintPath: blueprintPath,
689
- graphName: params.graphName || 'EventGraph'
690
- };
691
- const pluginResp = await this.sendAction('manage_blueprint_graph', payload, { timeoutMs: params.timeoutMs });
692
- if (pluginResp && pluginResp.success) {
693
- return {
694
- success: true,
695
- nodes: (pluginResp.result as Record<string, unknown>).nodes,
696
- graphName: (pluginResp.result as Record<string, unknown>).graphName
697
- };
698
- }
699
- if (pluginResp && this.isUnknownActionResponse(pluginResp)) {
700
- return { success: false, error: 'UNKNOWN_PLUGIN_ACTION', message: 'Automation plugin does not implement get_nodes' } as const;
701
- }
702
- return { success: false, error: pluginResp?.error ?? 'GET_NODES_FAILED', message: pluginResp?.message ?? 'Failed to get blueprint nodes' } as const;
703
- } catch (err: unknown) {
704
- return { success: false, error: String(err), message: String(err) } as const;
705
- }
706
- }
707
-
708
-
709
- async addNode(params: {
710
- blueprintName: string;
711
- nodeType: string;
712
- graphName?: string;
713
- functionName?: string;
714
- variableName?: string;
715
- nodeName?: string;
716
- eventName?: string;
717
- memberClass?: string;
718
- posX?: number;
719
- posY?: number;
720
- timeoutMs?: number;
721
- }): Promise<StandardActionResponse> {
722
- const candidates = this.buildCandidates(params.blueprintName);
723
- const primary = candidates[0];
724
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
725
-
726
- // Fix: C++ expects 'manage_blueprint_graph' with 'subAction' = 'create_node'
727
- const payload: Record<string, unknown> = {
728
- subAction: 'create_node',
729
- assetPath: primary, // C++ expects 'assetPath' or 'blueprintPath'
730
- nodeType: params.nodeType,
731
- graphName: params.graphName,
732
- memberName: params.functionName, // C++ maps 'memberName' to FunctionName
733
- variableName: params.variableName,
734
- nodeName: params.nodeName,
735
- eventName: params.eventName,
736
- memberClass: params.memberClass,
737
- x: params.posX,
738
- y: params.posY
739
- };
740
- const res = await this.sendAction('manage_blueprint_graph', payload, { timeoutMs: params.timeoutMs });
741
- return res as any;
742
- }
743
-
744
- async deleteNode(params: {
745
- blueprintPath: string;
746
- nodeId: string;
747
- graphName?: string;
748
- timeoutMs?: number;
749
- }): Promise<StandardActionResponse> {
750
- const blueprintPath = coerceString(params.blueprintPath);
751
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
752
- if (!params.nodeId) return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' } as const;
753
-
754
- const res = await this.sendAction('manage_blueprint_graph', {
755
- subAction: 'delete_node',
756
- blueprintPath: blueprintPath,
757
- graphName: params.graphName || 'EventGraph',
758
- nodeId: params.nodeId
759
- }, { timeoutMs: params.timeoutMs });
760
- return res as any;
761
- }
762
-
763
- async createRerouteNode(params: {
764
- blueprintPath: string;
765
- graphName?: string;
766
- x: number;
767
- y: number;
768
- timeoutMs?: number;
769
- }): Promise<StandardActionResponse> {
770
- const blueprintPath = coerceString(params.blueprintPath);
771
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
772
-
773
- const res = await this.sendAction('manage_blueprint_graph', {
774
- subAction: 'create_reroute_node',
775
- blueprintPath: blueprintPath,
776
- graphName: params.graphName || 'EventGraph',
777
- x: params.x,
778
- y: params.y
779
- }, { timeoutMs: params.timeoutMs });
780
- return res as any;
781
- }
782
-
783
- async setNodeProperty(params: {
784
- blueprintPath: string;
785
- nodeId: string;
786
- propertyName: string;
787
- value: string;
788
- graphName?: string;
789
- timeoutMs?: number;
790
- }): Promise<StandardActionResponse> {
791
- const blueprintPath = coerceString(params.blueprintPath);
792
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
793
- if (!params.nodeId) return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' } as const;
794
- if (!params.propertyName) return { success: false, error: 'INVALID_PROPERTY', message: 'Property name is required' } as const;
795
-
796
- const res = await this.sendAction('manage_blueprint_graph', {
797
- subAction: 'set_node_property',
798
- blueprintPath: blueprintPath,
799
- graphName: params.graphName || 'EventGraph',
800
- nodeId: params.nodeId,
801
- propertyName: params.propertyName,
802
- value: params.value
803
- }, { timeoutMs: params.timeoutMs });
804
- return res as any;
805
- }
806
-
807
- async getNodeDetails(params: {
808
- blueprintPath: string;
809
- nodeId: string;
810
- graphName?: string;
811
- timeoutMs?: number;
812
- }): Promise<StandardActionResponse> {
813
- const blueprintPath = coerceString(params.blueprintPath);
814
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
815
- if (!params.nodeId) return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' } as const;
816
-
817
- const res = await this.sendAction('manage_blueprint_graph', {
818
- subAction: 'get_node_details',
819
- blueprintPath: blueprintPath,
820
- graphName: params.graphName || 'EventGraph',
821
- nodeId: params.nodeId
822
- }, { timeoutMs: params.timeoutMs });
823
- return res as any;
824
- }
825
-
826
- async getGraphDetails(params: {
827
- blueprintPath: string;
828
- graphName?: string;
829
- timeoutMs?: number;
830
- }): Promise<StandardActionResponse> {
831
- const blueprintPath = coerceString(params.blueprintPath);
832
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
833
-
834
- const res = await this.sendAction('manage_blueprint_graph', {
835
- subAction: 'get_graph_details',
836
- blueprintPath: blueprintPath,
837
- graphName: params.graphName || 'EventGraph'
838
- }, { timeoutMs: params.timeoutMs });
839
- return res as any;
840
- }
841
-
842
- async getPinDetails(params: {
843
- blueprintPath: string;
844
- nodeId: string;
845
- pinName?: string;
846
- graphName?: string;
847
- timeoutMs?: number;
848
- }): Promise<StandardActionResponse> {
849
- const blueprintPath = coerceString(params.blueprintPath);
850
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
851
- if (!params.nodeId) return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' } as const;
852
-
853
- const res = await this.sendAction('manage_blueprint_graph', {
854
- subAction: 'get_pin_details',
855
- blueprintPath: blueprintPath,
856
- graphName: params.graphName || 'EventGraph',
857
- nodeId: params.nodeId,
858
- pinName: params.pinName
859
- }, { timeoutMs: params.timeoutMs });
860
- return res as any;
861
- }
862
-
863
- async listNodeTypes(params: {
864
- blueprintPath?: string;
865
- timeoutMs?: number;
866
- } = {}): Promise<StandardActionResponse> {
867
- const res = await this.sendAction('manage_blueprint_graph', {
868
- subAction: 'list_node_types',
869
- blueprintPath: params.blueprintPath || '/Game/Temp',
870
- graphName: 'EventGraph'
871
- }, { timeoutMs: params.timeoutMs });
872
- return res as any;
873
- }
874
-
875
- async setPinDefaultValue(params: {
876
- blueprintPath: string;
877
- nodeId: string;
878
- pinName: string;
879
- value: string;
880
- graphName?: string;
881
- timeoutMs?: number;
882
- }): Promise<StandardActionResponse> {
883
- const blueprintPath = coerceString(params.blueprintPath);
884
- if (!blueprintPath) return { success: false, error: 'INVALID_BLUEPRINT_PATH', message: 'Blueprint path is required' } as const;
885
- if (!params.nodeId) return { success: false, error: 'INVALID_NODE_ID', message: 'Node ID is required' } as const;
886
- if (!params.pinName) return { success: false, error: 'INVALID_PIN_NAME', message: 'Pin name is required' } as const;
887
-
888
- const res = await this.sendAction('manage_blueprint_graph', {
889
- subAction: 'set_pin_default_value',
890
- blueprintPath: blueprintPath,
891
- graphName: params.graphName || 'EventGraph',
892
- nodeId: params.nodeId,
893
- pinName: params.pinName,
894
- value: params.value
895
- }, { timeoutMs: params.timeoutMs });
896
- return res as any;
897
- }
898
-
899
-
900
- async connectPins(params: {
901
- blueprintName: string;
902
- sourceNodeGuid: string;
903
- targetNodeGuid: string;
904
- sourcePinName?: string;
905
- targetPinName?: string;
906
- timeoutMs?: number;
907
- }): Promise<StandardActionResponse> {
908
- const candidates = this.buildCandidates(params.blueprintName);
909
- const primary = candidates[0];
910
- if (!primary) return { success: false as const, error: 'Invalid blueprint name' };
911
-
912
- // Fix: C++ expects 'manage_blueprint_graph' with 'subAction' = 'connect_pins'
913
- let fromNodeId = params.sourceNodeGuid;
914
- let fromPinName = params.sourcePinName;
915
- if (fromNodeId && fromNodeId.includes('.') && !fromPinName) {
916
- const parts = fromNodeId.split('.');
917
- fromNodeId = parts[0];
918
- fromPinName = parts.slice(1).join('.');
919
- }
920
-
921
- let toNodeId = params.targetNodeGuid;
922
- let toPinName = params.targetPinName;
923
- if (toNodeId && toNodeId.includes('.') && !toPinName) {
924
- const parts = toNodeId.split('.');
925
- toNodeId = parts[0];
926
- toPinName = parts.slice(1).join('.');
927
- }
928
-
929
- const res = await this.sendAction('manage_blueprint_graph', {
930
- subAction: 'connect_pins',
931
- assetPath: primary,
932
- graphName: 'EventGraph',
933
- fromNodeId: fromNodeId,
934
- toNodeId: toNodeId,
935
- fromPinName: fromPinName,
936
- toPinName: toPinName
937
- }, { timeoutMs: params.timeoutMs });
938
- return res as any;
939
- }
940
- }