n8n 2.33.2 → 2.34.0

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 (982) hide show
  1. package/dist/active-executions.d.ts +2 -2
  2. package/dist/active-executions.js +18 -13
  3. package/dist/active-executions.js.map +1 -1
  4. package/dist/agent-library-bundle.js +158 -137
  5. package/dist/auth/auth.service.d.ts +1 -0
  6. package/dist/auth/auth.service.js +8 -1
  7. package/dist/auth/auth.service.js.map +1 -1
  8. package/dist/build.tsbuildinfo +1 -1
  9. package/dist/chat/chat-execution-manager.js +8 -5
  10. package/dist/chat/chat-execution-manager.js.map +1 -1
  11. package/dist/commands/base-command.js +3 -2
  12. package/dist/commands/base-command.js.map +1 -1
  13. package/dist/commands/import/workflow.js +1 -1
  14. package/dist/commands/import/workflow.js.map +1 -1
  15. package/dist/commands/start.d.ts +0 -1
  16. package/dist/commands/start.js +4 -32
  17. package/dist/commands/start.js.map +1 -1
  18. package/dist/constants/oauth2-triggers.d.ts +2 -0
  19. package/dist/constants/oauth2-triggers.js +11 -0
  20. package/dist/constants/oauth2-triggers.js.map +1 -0
  21. package/dist/controllers/api-keys.controller.js +0 -3
  22. package/dist/controllers/api-keys.controller.js.map +1 -1
  23. package/dist/controllers/e2e.controller.d.ts +7 -0
  24. package/dist/controllers/e2e.controller.js +12 -1
  25. package/dist/controllers/e2e.controller.js.map +1 -1
  26. package/dist/crash-journal.js +2 -2
  27. package/dist/crash-journal.js.map +1 -1
  28. package/dist/credentials/credentials.controller.d.ts +2 -0
  29. package/dist/credentials/credentials.controller.js +23 -4
  30. package/dist/credentials/credentials.controller.js.map +1 -1
  31. package/dist/credentials/credentials.service.d.ts +5 -1
  32. package/dist/credentials/credentials.service.js +45 -8
  33. package/dist/credentials/credentials.service.js.map +1 -1
  34. package/dist/credentials-helper.d.ts +3 -1
  35. package/dist/credentials-helper.js +39 -1
  36. package/dist/credentials-helper.js.map +1 -1
  37. package/dist/credentials-overwrites.d.ts +2 -1
  38. package/dist/credentials-overwrites.js +4 -5
  39. package/dist/credentials-overwrites.js.map +1 -1
  40. package/dist/environments.ee/variables/variables.service.ee.d.ts +4 -0
  41. package/dist/environments.ee/variables/variables.service.ee.js +10 -6
  42. package/dist/environments.ee/variables/variables.service.ee.js.map +1 -1
  43. package/dist/errors/http-error-serializers.js +10 -1
  44. package/dist/errors/http-error-serializers.js.map +1 -1
  45. package/dist/errors/response-errors/workflow-publish-blocked.error.d.ts +6 -0
  46. package/dist/errors/response-errors/workflow-publish-blocked.error.js +19 -0
  47. package/dist/errors/response-errors/workflow-publish-blocked.error.js.map +1 -0
  48. package/dist/errors/webhook-response-too-large.error.d.ts +7 -0
  49. package/dist/errors/webhook-response-too-large.error.js +11 -0
  50. package/dist/errors/webhook-response-too-large.error.js.map +1 -0
  51. package/dist/eventbus/event-message-classes/event-message-mcp.d.ts +33 -0
  52. package/dist/eventbus/event-message-classes/event-message-mcp.js +29 -0
  53. package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -0
  54. package/dist/eventbus/event-message-classes/index.d.ts +6 -3
  55. package/dist/eventbus/event-message-classes/index.js +7 -1
  56. package/dist/eventbus/event-message-classes/index.js.map +1 -1
  57. package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -0
  58. package/dist/eventbus/message-event-bus/message-event-bus.js +4 -0
  59. package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
  60. package/dist/eventbus/message-event-bus-writer/message-event-bus-log-writer.js +3 -0
  61. package/dist/eventbus/message-event-bus-writer/message-event-bus-log-writer.js.map +1 -1
  62. package/dist/events/maps/relay.event-map.d.ts +18 -1
  63. package/dist/events/maps/workflow-publication-metrics.event-map.d.ts +5 -0
  64. package/dist/events/relays/log-streaming.event-relay.d.ts +3 -0
  65. package/dist/events/relays/log-streaming.event-relay.js +33 -0
  66. package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
  67. package/dist/events/relays/telemetry.event-relay.js +10 -0
  68. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  69. package/dist/execution-lifecycle/execution-lifecycle-hooks.js +46 -18
  70. package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
  71. package/dist/executions/enqueued-execution-recovery.service.d.ts +21 -0
  72. package/dist/executions/enqueued-execution-recovery.service.js +79 -0
  73. package/dist/executions/enqueued-execution-recovery.service.js.map +1 -0
  74. package/dist/executions/execution-data/execution-data-json-store.d.ts +3 -6
  75. package/dist/executions/execution-data/execution-data-json-store.js +2 -15
  76. package/dist/executions/execution-data/execution-data-json-store.js.map +1 -1
  77. package/dist/executions/execution-persistence.js.map +1 -1
  78. package/dist/executions/execution-recovery.service.js +23 -12
  79. package/dist/executions/execution-recovery.service.js.map +1 -1
  80. package/dist/external-hooks.d.ts +3 -2
  81. package/dist/external-hooks.js.map +1 -1
  82. package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js +4 -0
  83. package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js.map +1 -1
  84. package/dist/interfaces.d.ts +6 -0
  85. package/dist/metrics/prometheus/scheduler-metrics.service.d.ts +7 -2
  86. package/dist/metrics/prometheus/scheduler-metrics.service.js +29 -1
  87. package/dist/metrics/prometheus/scheduler-metrics.service.js.map +1 -1
  88. package/dist/metrics/prometheus/workflow-publication-metrics.service.d.ts +1 -0
  89. package/dist/metrics/prometheus/workflow-publication-metrics.service.js +22 -1
  90. package/dist/metrics/prometheus/workflow-publication-metrics.service.js.map +1 -1
  91. package/dist/modules/agent-evals/agent-eval-case-generation.service.d.ts +25 -0
  92. package/dist/modules/agent-evals/agent-eval-case-generation.service.js +192 -0
  93. package/dist/modules/agent-evals/agent-eval-case-generation.service.js.map +1 -0
  94. package/dist/modules/agent-evals/agent-eval-rating.service.d.ts +23 -0
  95. package/dist/modules/agent-evals/agent-eval-rating.service.js +124 -0
  96. package/dist/modules/agent-evals/agent-eval-rating.service.js.map +1 -0
  97. package/dist/modules/agent-evals/agent-eval-record-mappers.d.ts +5 -0
  98. package/dist/modules/agent-evals/agent-eval-record-mappers.js +68 -0
  99. package/dist/modules/agent-evals/agent-eval-record-mappers.js.map +1 -0
  100. package/dist/modules/agent-evals/agent-eval-runner.service.d.ts +42 -0
  101. package/dist/modules/agent-evals/agent-eval-runner.service.js +409 -0
  102. package/dist/modules/agent-evals/agent-eval-runner.service.js.map +1 -0
  103. package/dist/modules/agent-evals/agent-eval.service.d.ts +31 -0
  104. package/dist/modules/agent-evals/agent-eval.service.js +138 -0
  105. package/dist/modules/agent-evals/agent-eval.service.js.map +1 -0
  106. package/dist/modules/agent-evals/agent-evals-flag-gate.d.ts +8 -0
  107. package/dist/{services/trigger-auth-identity-seeder-proxy.service.js → modules/agent-evals/agent-evals-flag-gate.js} +18 -16
  108. package/dist/modules/agent-evals/agent-evals-flag-gate.js.map +1 -0
  109. package/dist/modules/agent-evals/agent-evals-required-modules.d.ts +2 -0
  110. package/dist/modules/agent-evals/agent-evals-required-modules.js +12 -0
  111. package/dist/modules/agent-evals/agent-evals-required-modules.js.map +1 -0
  112. package/dist/modules/agent-evals/agent-evals.controller.d.ts +33 -0
  113. package/dist/modules/agent-evals/agent-evals.controller.js +172 -0
  114. package/dist/modules/agent-evals/agent-evals.controller.js.map +1 -0
  115. package/dist/modules/agent-evals/agent-evals.module.d.ts +4 -0
  116. package/dist/modules/agent-evals/agent-evals.module.js +24 -0
  117. package/dist/modules/agent-evals/agent-evals.module.js.map +1 -0
  118. package/dist/modules/agent-evals/case-generation/case-generation-prompt.d.ts +37 -0
  119. package/dist/modules/agent-evals/case-generation/case-generation-prompt.js +87 -0
  120. package/dist/modules/agent-evals/case-generation/case-generation-prompt.js.map +1 -0
  121. package/dist/modules/agent-evals/case-generation/dimensions.d.ts +11 -0
  122. package/dist/modules/agent-evals/case-generation/dimensions.js +54 -0
  123. package/dist/modules/agent-evals/case-generation/dimensions.js.map +1 -0
  124. package/dist/modules/agents/adapters/agents-credential-provider.d.ts +3 -1
  125. package/dist/modules/agents/adapters/agents-credential-provider.js +15 -0
  126. package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
  127. package/dist/modules/agents/agent-chat-attachment.service.d.ts +46 -0
  128. package/dist/modules/agents/agent-chat-attachment.service.js +144 -0
  129. package/dist/modules/agents/agent-chat-attachment.service.js.map +1 -0
  130. package/dist/modules/agents/agent-chat.controller.d.ts +15 -1
  131. package/dist/modules/agents/agent-chat.controller.js +177 -34
  132. package/dist/modules/agents/agent-chat.controller.js.map +1 -1
  133. package/dist/modules/agents/agent-config.service.d.ts +10 -3
  134. package/dist/modules/agents/agent-config.service.js +44 -5
  135. package/dist/modules/agents/agent-config.service.js.map +1 -1
  136. package/dist/modules/agents/agent-custom-tools.service.d.ts +7 -3
  137. package/dist/modules/agents/agent-custom-tools.service.js +44 -7
  138. package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
  139. package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +14 -2
  140. package/dist/modules/agents/agent-execution-orchestrator.service.js +85 -9
  141. package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
  142. package/dist/modules/agents/agent-execution.service.d.ts +4 -1
  143. package/dist/modules/agents/agent-execution.service.js +7 -2
  144. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  145. package/dist/modules/agents/agent-integration-persistence.service.d.ts +14 -7
  146. package/dist/modules/agents/agent-integration-persistence.service.js +35 -7
  147. package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
  148. package/dist/modules/agents/agent-integrations.controller.d.ts +1 -9
  149. package/dist/modules/agents/agent-integrations.controller.js +12 -16
  150. package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
  151. package/dist/modules/agents/agent-knowledge-file-store.d.ts +24 -0
  152. package/dist/modules/agents/agent-knowledge-file-store.js +100 -0
  153. package/dist/modules/agents/agent-knowledge-file-store.js.map +1 -0
  154. package/dist/modules/agents/agent-knowledge-retrieval.d.ts +3 -1
  155. package/dist/modules/agents/agent-knowledge-retrieval.js +1 -1
  156. package/dist/modules/agents/agent-knowledge-retrieval.js.map +1 -1
  157. package/dist/modules/agents/agent-knowledge-sandbox.service.d.ts +4 -3
  158. package/dist/modules/agents/agent-knowledge-sandbox.service.js +17 -8
  159. package/dist/modules/agents/agent-knowledge-sandbox.service.js.map +1 -1
  160. package/dist/modules/agents/agent-knowledge-storage.d.ts +0 -1
  161. package/dist/modules/agents/agent-knowledge-storage.js +0 -10
  162. package/dist/modules/agents/agent-knowledge-storage.js.map +1 -1
  163. package/dist/modules/agents/agent-knowledge.service.d.ts +3 -4
  164. package/dist/modules/agents/agent-knowledge.service.js +25 -27
  165. package/dist/modules/agents/agent-knowledge.service.js.map +1 -1
  166. package/dist/modules/agents/agent-mcp-access.controller.d.ts +14 -0
  167. package/dist/modules/agents/agent-mcp-access.controller.js +49 -0
  168. package/dist/modules/agents/agent-mcp-access.controller.js.map +1 -0
  169. package/dist/modules/agents/agent-mcp-access.service.d.ts +22 -0
  170. package/dist/modules/agents/agent-mcp-access.service.js +83 -0
  171. package/dist/modules/agents/agent-mcp-access.service.js.map +1 -0
  172. package/dist/modules/agents/agent-message-mapper.js +9 -0
  173. package/dist/modules/agents/agent-message-mapper.js.map +1 -1
  174. package/dist/modules/agents/agent-model-catalog.service.d.ts +1 -1
  175. package/dist/modules/agents/agent-model-catalog.service.js +22 -7
  176. package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
  177. package/dist/modules/agents/agent-modification-telemetry.service.d.ts +25 -0
  178. package/dist/modules/agents/agent-modification-telemetry.service.js +119 -0
  179. package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -0
  180. package/dist/modules/agents/agent-publish.controller.js +4 -4
  181. package/dist/modules/agents/agent-publish.controller.js.map +1 -1
  182. package/dist/modules/agents/agent-publish.service.d.ts +23 -9
  183. package/dist/modules/agents/agent-publish.service.js +146 -33
  184. package/dist/modules/agents/agent-publish.service.js.map +1 -1
  185. package/dist/modules/agents/agent-runtime-cache.service.js +1 -1
  186. package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
  187. package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +6 -2
  188. package/dist/modules/agents/agent-runtime-reconstruction.service.js +16 -6
  189. package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
  190. package/dist/modules/agents/agent-setup-completion.service.d.ts +19 -0
  191. package/dist/modules/agents/agent-setup-completion.service.js +79 -0
  192. package/dist/modules/agents/agent-setup-completion.service.js.map +1 -0
  193. package/dist/modules/agents/agent-skills.service.d.ts +8 -6
  194. package/dist/modules/agents/agent-skills.service.js +55 -12
  195. package/dist/modules/agents/agent-skills.service.js.map +1 -1
  196. package/dist/modules/agents/agent-sse-stream.js +35 -0
  197. package/dist/modules/agents/agent-sse-stream.js.map +1 -1
  198. package/dist/modules/agents/agent-task.service.d.ts +7 -5
  199. package/dist/modules/agents/agent-task.service.js +56 -21
  200. package/dist/modules/agents/agent-task.service.js.map +1 -1
  201. package/dist/modules/agents/agent-tasks.controller.js +18 -6
  202. package/dist/modules/agents/agent-tasks.controller.js.map +1 -1
  203. package/dist/modules/agents/agent-test-chat.service.d.ts +3 -1
  204. package/dist/modules/agents/agent-test-chat.service.js +7 -3
  205. package/dist/modules/agents/agent-test-chat.service.js.map +1 -1
  206. package/dist/modules/agents/agent-validation.service.d.ts +5 -2
  207. package/dist/modules/agents/agent-validation.service.js +22 -4
  208. package/dist/modules/agents/agent-validation.service.js.map +1 -1
  209. package/dist/modules/agents/agent-workflow-execution.service.d.ts +1 -1
  210. package/dist/modules/agents/agent-workflow-execution.service.js +13 -7
  211. package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
  212. package/dist/modules/agents/agents-config.controller.d.ts +1 -5
  213. package/dist/modules/agents/agents-config.controller.js +7 -2
  214. package/dist/modules/agents/agents-config.controller.js.map +1 -1
  215. package/dist/modules/agents/agents-skills.controller.js +12 -3
  216. package/dist/modules/agents/agents-skills.controller.js.map +1 -1
  217. package/dist/modules/agents/agents-tools.service.js +1 -5
  218. package/dist/modules/agents/agents-tools.service.js.map +1 -1
  219. package/dist/modules/agents/agents.controller.js +3 -1
  220. package/dist/modules/agents/agents.controller.js.map +1 -1
  221. package/dist/modules/agents/agents.module.d.ts +1 -1
  222. package/dist/modules/agents/agents.module.js +10 -11
  223. package/dist/modules/agents/agents.module.js.map +1 -1
  224. package/dist/modules/agents/agents.service.d.ts +12 -4
  225. package/dist/modules/agents/agents.service.js +52 -4
  226. package/dist/modules/agents/agents.service.js.map +1 -1
  227. package/dist/modules/agents/builder/agents-builder-prompts.d.ts +2 -2
  228. package/dist/modules/agents/builder/agents-builder-prompts.js +13 -11
  229. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
  230. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +3 -6
  231. package/dist/modules/agents/builder/agents-builder-tools.service.js +37 -84
  232. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  233. package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -7
  234. package/dist/modules/agents/builder/agents-builder.service.js +27 -34
  235. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  236. package/dist/modules/agents/builder/builder-config-telemetry.d.ts +1 -10
  237. package/dist/modules/agents/builder/builder-config-telemetry.js +0 -64
  238. package/dist/modules/agents/builder/builder-config-telemetry.js.map +1 -1
  239. package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +5 -1
  240. package/dist/modules/agents/builder/builder-model-live-lookup.service.js +23 -2
  241. package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
  242. package/dist/modules/agents/builder/format-preview-context.js +3 -0
  243. package/dist/modules/agents/builder/format-preview-context.js.map +1 -1
  244. package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
  245. package/dist/modules/agents/builder/interactive/configure-channel.tool.js +6 -5
  246. package/dist/modules/agents/builder/interactive/configure-channel.tool.js.map +1 -1
  247. package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +0 -5
  248. package/dist/modules/agents/builder/interactive/finish-setup.tool.js +28 -45
  249. package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
  250. package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +1 -0
  251. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +88 -8
  252. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  253. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +1 -1
  254. package/dist/modules/agents/builder/prompts/initial-build.prompt.d.ts +1 -1
  255. package/dist/modules/agents/builder/prompts/initial-build.prompt.js +8 -15
  256. package/dist/modules/agents/builder/prompts/initial-build.prompt.js.map +1 -1
  257. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +2 -2
  258. package/dist/modules/agents/builder/skills/external-services.skill.js +10 -11
  259. package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
  260. package/dist/modules/agents/entities/agent-chat-attachment.entity.d.ts +16 -0
  261. package/dist/modules/agents/entities/agent-chat-attachment.entity.js +70 -0
  262. package/dist/modules/agents/entities/agent-chat-attachment.entity.js.map +1 -0
  263. package/dist/modules/agents/entities/agent-execution.entity.d.ts +6 -0
  264. package/dist/modules/agents/entities/agent-execution.entity.js +4 -0
  265. package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
  266. package/dist/modules/agents/entities/agent-file.entity.d.ts +3 -2
  267. package/dist/modules/agents/entities/agent-file.entity.js +6 -3
  268. package/dist/modules/agents/entities/agent-file.entity.js.map +1 -1
  269. package/dist/modules/agents/entities/agent.entity.d.ts +2 -0
  270. package/dist/modules/agents/entities/agent.entity.js +8 -0
  271. package/dist/modules/agents/entities/agent.entity.js.map +1 -1
  272. package/dist/modules/agents/execution-log/agent-execution-log-store.d.ts +3 -6
  273. package/dist/modules/agents/execution-log/agent-execution-log-store.js +2 -15
  274. package/dist/modules/agents/execution-log/agent-execution-log-store.js.map +1 -1
  275. package/dist/modules/agents/execution-recorder.d.ts +11 -0
  276. package/dist/modules/agents/execution-recorder.js +69 -0
  277. package/dist/modules/agents/execution-recorder.js.map +1 -1
  278. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +6 -2
  279. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
  280. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +8 -2
  281. package/dist/modules/agents/integrations/agent-chat-bridge.js +114 -16
  282. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  283. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +4 -1
  284. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +40 -7
  285. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
  286. package/dist/modules/agents/integrations/agent-chat-integration.d.ts +16 -1
  287. package/dist/modules/agents/integrations/agent-chat-integration.js +1 -0
  288. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
  289. package/dist/modules/agents/integrations/agent-chat-message-context.d.ts +2 -1
  290. package/dist/modules/agents/integrations/agent-chat-message-context.js +1 -0
  291. package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
  292. package/dist/modules/agents/integrations/agent-chat-stream-consumer.d.ts +2 -0
  293. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +27 -12
  294. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
  295. package/dist/modules/agents/integrations/agent-chat-suspension-cards.d.ts +7 -0
  296. package/dist/modules/agents/integrations/agent-chat-suspension-cards.js +1 -0
  297. package/dist/modules/agents/integrations/agent-chat-suspension-cards.js.map +1 -1
  298. package/dist/modules/agents/integrations/callback-store.d.ts +4 -1
  299. package/dist/modules/agents/integrations/callback-store.js +11 -3
  300. package/dist/modules/agents/integrations/callback-store.js.map +1 -1
  301. package/dist/modules/agents/integrations/chat-integration.service.d.ts +10 -4
  302. package/dist/modules/agents/integrations/chat-integration.service.js +108 -35
  303. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  304. package/dist/modules/agents/integrations/integration-action-executor.d.ts +2 -0
  305. package/dist/modules/agents/integrations/integration-action-executor.js +52 -1
  306. package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
  307. package/dist/modules/agents/integrations/integration-context-query-executor.js +2 -1
  308. package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -1
  309. package/dist/modules/agents/integrations/integration-error-codes.d.ts +1 -0
  310. package/dist/modules/agents/integrations/integration-error-codes.js +1 -0
  311. package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -1
  312. package/dist/modules/agents/integrations/integration-tool-definitions.js +20 -0
  313. package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
  314. package/dist/modules/agents/integrations/integration-tool-descriptions.js +6 -0
  315. package/dist/modules/agents/integrations/integration-tool-descriptions.js.map +1 -1
  316. package/dist/modules/agents/integrations/integration-tool-execution.js +5 -0
  317. package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
  318. package/dist/modules/agents/integrations/integration-tool-factory.d.ts +7 -7
  319. package/dist/modules/agents/integrations/integration-tool-factory.js +1 -1
  320. package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
  321. package/dist/modules/agents/integrations/integration-tool-schema.d.ts +11 -8
  322. package/dist/modules/agents/integrations/integration-tool-schema.js +7 -7
  323. package/dist/modules/agents/integrations/integration-tool-schema.js.map +1 -1
  324. package/dist/modules/agents/integrations/integration-tool-types.d.ts +3 -1
  325. package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +8 -6
  326. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +39 -14
  327. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
  328. package/dist/modules/agents/integrations/n8n-memory.js +2 -1
  329. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
  330. package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.d.ts +6 -1
  331. package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js +36 -24
  332. package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js.map +1 -1
  333. package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +6 -1
  334. package/dist/modules/agents/integrations/platforms/slack-integration.js +3 -0
  335. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
  336. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.d.ts +15 -2
  337. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js +9 -0
  338. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js.map +1 -1
  339. package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +4 -1
  340. package/dist/modules/agents/integrations/platforms/telegram-integration.js +22 -2
  341. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
  342. package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +1 -3
  343. package/dist/modules/agents/integrations/slack-app-setup.service.js +9 -10
  344. package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
  345. package/dist/modules/agents/json-config/from-json-config.js +4 -3
  346. package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
  347. package/dist/modules/agents/json-config/mcp-client-factory.d.ts +4 -0
  348. package/dist/modules/agents/json-config/mcp-client-factory.js +12 -0
  349. package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -1
  350. package/dist/modules/agents/json-config/model-config.d.ts +5 -2
  351. package/dist/modules/agents/json-config/model-config.js +15 -1
  352. package/dist/modules/agents/json-config/model-config.js.map +1 -1
  353. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js +22 -3
  354. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js.map +1 -1
  355. package/dist/modules/agents/register-blob-byte-stores.d.ts +8 -0
  356. package/dist/modules/agents/register-blob-byte-stores.js +21 -0
  357. package/dist/modules/agents/register-blob-byte-stores.js.map +1 -0
  358. package/dist/modules/agents/repositories/agent-chat-attachment.repository.d.ts +19 -0
  359. package/dist/modules/agents/repositories/agent-chat-attachment.repository.js +38 -0
  360. package/dist/modules/agents/repositories/agent-chat-attachment.repository.js.map +1 -0
  361. package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +6 -1
  362. package/dist/modules/agents/repositories/agent-checkpoint.repository.js +22 -3
  363. package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -1
  364. package/dist/modules/agents/repositories/agent.repository.d.ts +23 -1
  365. package/dist/modules/agents/repositories/agent.repository.js +85 -5
  366. package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
  367. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +60 -1
  368. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
  369. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +12 -3
  370. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +124 -60
  371. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
  372. package/dist/modules/agents/tools/workflow-tool-factory.js +30 -1
  373. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  374. package/dist/modules/agents/utils/agent-capabilities.d.ts +14 -0
  375. package/dist/modules/agents/utils/agent-capabilities.js +35 -0
  376. package/dist/modules/agents/utils/agent-capabilities.js.map +1 -0
  377. package/dist/modules/agents/utils/agent-config-hash.d.ts +2 -0
  378. package/dist/modules/agents/utils/agent-config-hash.js +23 -0
  379. package/dist/modules/agents/utils/agent-config-hash.js.map +1 -0
  380. package/dist/modules/agents/utils/agent-execution-counter.d.ts +3 -1
  381. package/dist/modules/agents/utils/agent-execution-counter.js +4 -1
  382. package/dist/modules/agents/utils/agent-execution-counter.js.map +1 -1
  383. package/dist/modules/agents/utils/execution-to-message-mapper.d.ts +1 -1
  384. package/dist/modules/agents/utils/execution-to-message-mapper.js +33 -16
  385. package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
  386. package/dist/modules/agents/utils/inbound-attachments.d.ts +4 -0
  387. package/dist/modules/agents/utils/inbound-attachments.js +50 -0
  388. package/dist/modules/agents/utils/inbound-attachments.js.map +1 -0
  389. package/dist/modules/agents/utils/messages-envelope.js +5 -1
  390. package/dist/modules/agents/utils/messages-envelope.js.map +1 -1
  391. package/dist/modules/breaking-changes/breaking-changes.controller.d.ts +5 -2
  392. package/dist/modules/breaking-changes/breaking-changes.controller.js +16 -2
  393. package/dist/modules/breaking-changes/breaking-changes.controller.js.map +1 -1
  394. package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.d.ts +10 -0
  395. package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.js +42 -0
  396. package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.js.map +1 -0
  397. package/dist/modules/breaking-changes/breaking-changes.migration.service.d.ts +31 -0
  398. package/dist/modules/breaking-changes/breaking-changes.migration.service.js +120 -0
  399. package/dist/modules/breaking-changes/breaking-changes.migration.service.js.map +1 -0
  400. package/dist/modules/breaking-changes/breaking-changes.module.js +2 -0
  401. package/dist/modules/breaking-changes/breaking-changes.module.js.map +1 -1
  402. package/dist/modules/breaking-changes/breaking-changes.service.d.ts +3 -2
  403. package/dist/modules/breaking-changes/breaking-changes.service.js +9 -13
  404. package/dist/modules/breaking-changes/breaking-changes.service.js.map +1 -1
  405. package/dist/modules/breaking-changes/group-nodes-by-type.d.ts +2 -0
  406. package/dist/modules/breaking-changes/group-nodes-by-type.js +15 -0
  407. package/dist/modules/breaking-changes/group-nodes-by-type.js.map +1 -0
  408. package/dist/modules/breaking-changes/migrations/ai-transform-to-code.migration.d.ts +2 -0
  409. package/dist/modules/breaking-changes/migrations/ai-transform-to-code.migration.js +24 -0
  410. package/dist/modules/breaking-changes/migrations/ai-transform-to-code.migration.js.map +1 -0
  411. package/dist/modules/breaking-changes/migrations/index.d.ts +2 -0
  412. package/dist/modules/breaking-changes/migrations/index.js +6 -0
  413. package/dist/modules/breaking-changes/migrations/index.js.map +1 -0
  414. package/dist/modules/breaking-changes/migrations/node-migration.d.ts +10 -0
  415. package/dist/modules/breaking-changes/migrations/node-migration.js +3 -0
  416. package/dist/modules/breaking-changes/migrations/node-migration.js.map +1 -0
  417. package/dist/modules/breaking-changes/rules/index.d.ts +2 -0
  418. package/dist/modules/breaking-changes/rules/index.js +2 -0
  419. package/dist/modules/breaking-changes/rules/index.js.map +1 -1
  420. package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.d.ts +11 -0
  421. package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js +53 -0
  422. package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js.map +1 -0
  423. package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.d.ts +10 -0
  424. package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js +62 -0
  425. package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js.map +1 -0
  426. package/dist/modules/chat-hub/chat-hub-execution.service.js +2 -1
  427. package/dist/modules/chat-hub/chat-hub-execution.service.js.map +1 -1
  428. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +0 -3
  429. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
  430. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +4 -2
  431. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +7 -4
  432. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
  433. package/dist/modules/external-secrets.ee/external-secrets-manager.ee.d.ts +2 -4
  434. package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js +27 -20
  435. package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js.map +1 -1
  436. package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.d.ts +24 -6
  437. package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js +184 -43
  438. package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js.map +1 -1
  439. package/dist/modules/insights/insights-collection.service.js +3 -0
  440. package/dist/modules/insights/insights-collection.service.js.map +1 -1
  441. package/dist/modules/insights/insights-compaction.service.js +2 -2
  442. package/dist/modules/insights/insights-compaction.service.js.map +1 -1
  443. package/dist/modules/instance-ai/eval/agent-execution.service.d.ts +1 -1
  444. package/dist/modules/instance-ai/eval/agent-execution.service.js +16 -7
  445. package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
  446. package/dist/modules/instance-ai/eval/execution.service.d.ts +6 -1
  447. package/dist/modules/instance-ai/eval/execution.service.js +45 -3
  448. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  449. package/dist/modules/instance-ai/eval/ledger-snapshot.d.ts +1 -0
  450. package/dist/modules/instance-ai/eval/ledger-snapshot.js +11 -0
  451. package/dist/modules/instance-ai/eval/ledger-snapshot.js.map +1 -0
  452. package/dist/modules/instance-ai/eval/llm-wire-server.js +26 -2
  453. package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
  454. package/dist/modules/instance-ai/eval/mock-handler.d.ts +3 -1
  455. package/dist/modules/instance-ai/eval/mock-handler.js +60 -2
  456. package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
  457. package/dist/modules/instance-ai/eval/mock-quirks.js +5 -4
  458. package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
  459. package/dist/modules/instance-ai/eval/openai-responses-envelope.js +11 -2
  460. package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -1
  461. package/dist/modules/instance-ai/eval/pin-data-generator.d.ts +2 -1
  462. package/dist/modules/instance-ai/eval/pin-data-generator.js +28 -12
  463. package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -1
  464. package/dist/modules/instance-ai/eval/provider-shapes.js +101 -8
  465. package/dist/modules/instance-ai/eval/provider-shapes.js.map +1 -1
  466. package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.d.ts +3 -1
  467. package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.js +8 -1
  468. package/dist/modules/instance-ai/eval/thread-credential-allowlist.service.js.map +1 -1
  469. package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +2 -0
  470. package/dist/modules/instance-ai/eval/workflow-analysis.js +9 -0
  471. package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
  472. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js +3 -1
  473. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
  474. package/dist/modules/instance-ai/instance-ai-credit.service.js +2 -1
  475. package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -1
  476. package/dist/modules/instance-ai/instance-ai-error-reporter.service.d.ts +9 -2
  477. package/dist/modules/instance-ai/instance-ai-error-reporter.service.js +25 -11
  478. package/dist/modules/instance-ai/instance-ai-error-reporter.service.js.map +1 -1
  479. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +1 -1
  480. package/dist/modules/instance-ai/instance-ai.adapter.service.js +33 -21
  481. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  482. package/dist/modules/instance-ai/instance-ai.controller.js +1 -1
  483. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  484. package/dist/modules/instance-ai/instance-ai.service.js +160 -38
  485. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  486. package/dist/modules/instance-ai/node-definition-resolver.js +1 -5
  487. package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
  488. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +2 -0
  489. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +20 -0
  490. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -1
  491. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +5 -1
  492. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
  493. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +1 -0
  494. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +3 -0
  495. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -1
  496. package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.d.ts +2 -0
  497. package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js +7 -2
  498. package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
  499. package/dist/modules/ldap.ee/helpers.ee.d.ts +2 -1
  500. package/dist/modules/ldap.ee/helpers.ee.js +11 -2
  501. package/dist/modules/ldap.ee/helpers.ee.js.map +1 -1
  502. package/dist/modules/ldap.ee/ldap.errors.d.ts +5 -0
  503. package/dist/modules/ldap.ee/ldap.errors.js +11 -0
  504. package/dist/modules/ldap.ee/ldap.errors.js.map +1 -0
  505. package/dist/modules/ldap.ee/ldap.service.ee.d.ts +2 -2
  506. package/dist/modules/ldap.ee/ldap.service.ee.js +29 -7
  507. package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
  508. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.d.ts +1 -1
  509. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js +10 -2
  510. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -1
  511. package/dist/modules/mcp/mcp-protected-resource.d.ts +4 -2
  512. package/dist/modules/mcp/mcp-protected-resource.js +17 -5
  513. package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
  514. package/dist/modules/mcp/mcp-scopes.d.ts +1 -0
  515. package/dist/modules/mcp/mcp-scopes.js +35 -7
  516. package/dist/modules/mcp/mcp-scopes.js.map +1 -1
  517. package/dist/modules/mcp/mcp-tool-availability.d.ts +3 -0
  518. package/dist/modules/mcp/mcp-tool-availability.js +7 -0
  519. package/dist/modules/mcp/mcp-tool-availability.js.map +1 -0
  520. package/dist/modules/mcp/mcp.constants.d.ts +1 -0
  521. package/dist/modules/mcp/mcp.constants.js +2 -1
  522. package/dist/modules/mcp/mcp.constants.js.map +1 -1
  523. package/dist/modules/mcp/mcp.controller.d.ts +1 -1
  524. package/dist/modules/mcp/mcp.controller.js +10 -18
  525. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  526. package/dist/modules/mcp/mcp.service.d.ts +6 -2
  527. package/dist/modules/mcp/mcp.service.js +72 -4
  528. package/dist/modules/mcp/mcp.service.js.map +1 -1
  529. package/dist/modules/mcp/mcp.settings.controller.d.ts +4 -2
  530. package/dist/modules/mcp/mcp.settings.controller.js +6 -3
  531. package/dist/modules/mcp/mcp.settings.controller.js.map +1 -1
  532. package/dist/modules/mcp/mcp.types.d.ts +2 -1
  533. package/dist/modules/mcp/mcp.types.js.map +1 -1
  534. package/dist/modules/mcp/tools/agents/agent-reference.d.ts +9 -0
  535. package/dist/modules/mcp/tools/agents/agent-reference.js +169 -0
  536. package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -0
  537. package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +87 -0
  538. package/dist/modules/mcp/tools/agents/agent-tools.service.js +1157 -0
  539. package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -0
  540. package/dist/modules/mcp/tools/get-execution.tool.js +4 -4
  541. package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
  542. package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +1 -1
  543. package/dist/modules/mcp/tools/get-workflow-details.tool.js +7 -4
  544. package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
  545. package/dist/modules/mcp/tools/get-workflow-version.tool.js +1 -1
  546. package/dist/modules/mcp/tools/get-workflow-version.tool.js.map +1 -1
  547. package/dist/modules/mcp/tools/list-credentials.tool.js +1 -1
  548. package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
  549. package/dist/modules/mcp/tools/list-tags.tool.js +3 -3
  550. package/dist/modules/mcp/tools/list-tags.tool.js.map +1 -1
  551. package/dist/modules/mcp/tools/prepare-workflow-pin-data.tool.js +3 -3
  552. package/dist/modules/mcp/tools/prepare-workflow-pin-data.tool.js.map +1 -1
  553. package/dist/modules/mcp/tools/publish-workflow.tool.js +14 -2
  554. package/dist/modules/mcp/tools/publish-workflow.tool.js.map +1 -1
  555. package/dist/modules/mcp/tools/schemas.d.ts +381 -0
  556. package/dist/modules/mcp/tools/schemas.js +25 -1
  557. package/dist/modules/mcp/tools/schemas.js.map +1 -1
  558. package/dist/modules/mcp/tools/search-executions.tool.js +3 -3
  559. package/dist/modules/mcp/tools/search-executions.tool.js.map +1 -1
  560. package/dist/modules/mcp/tools/search-projects.tool.js +1 -1
  561. package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
  562. package/dist/modules/mcp/tools/test-workflow.tool.js +2 -2
  563. package/dist/modules/mcp/tools/test-workflow.tool.js.map +1 -1
  564. package/dist/modules/mcp/tools/webhook-utils.d.ts +1 -1
  565. package/dist/modules/mcp/tools/webhook-utils.js +5 -1
  566. package/dist/modules/mcp/tools/webhook-utils.js.map +1 -1
  567. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +12 -1
  568. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  569. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +55 -29
  570. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -1
  571. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +1 -1
  572. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
  573. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +1 -1
  574. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
  575. package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +1 -1
  576. package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
  577. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +1 -0
  578. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +27 -3
  579. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
  580. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +10 -1
  581. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +14 -4
  582. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
  583. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +119 -15
  584. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  585. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +1 -1
  586. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
  587. package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +15 -1
  588. package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +46 -18
  589. package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
  590. package/dist/modules/mcp-registry/registry/mcp-registry-search.d.ts +1 -0
  591. package/dist/modules/mcp-registry/registry/mcp-registry-search.js +8 -6
  592. package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -1
  593. package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +1 -0
  594. package/dist/modules/mcp-registry/registry/mcp-registry.service.js +3 -0
  595. package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
  596. package/dist/modules/n8n-packages/engine/import-blocked.error.js +3 -1
  597. package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
  598. package/dist/modules/n8n-packages/engine/import-gates.d.ts +11 -0
  599. package/dist/modules/n8n-packages/engine/import-gates.js +34 -0
  600. package/dist/modules/n8n-packages/engine/import-gates.js.map +1 -0
  601. package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +17 -8
  602. package/dist/modules/n8n-packages/engine/import-orchestrator.js +42 -24
  603. package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
  604. package/dist/modules/n8n-packages/engine/import-result.d.ts +16 -4
  605. package/dist/modules/n8n-packages/engine/import-result.js +56 -20
  606. package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
  607. package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +4 -2
  608. package/dist/modules/n8n-packages/engine/import-telemetry.js +25 -5
  609. package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
  610. package/dist/modules/n8n-packages/engine/n8n-package-parser.js +4 -0
  611. package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
  612. package/dist/modules/n8n-packages/engine/package-layout.d.ts +1 -0
  613. package/dist/modules/n8n-packages/engine/package-layout.js +9 -0
  614. package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -1
  615. package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +3 -1
  616. package/dist/modules/n8n-packages/engine/project-package-importer.js +68 -25
  617. package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
  618. package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +3 -1
  619. package/dist/modules/n8n-packages/engine/workflow-package-importer.js +54 -16
  620. package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
  621. package/dist/modules/n8n-packages/entities/folder/folder.exporter.d.ts +1 -0
  622. package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +1 -0
  623. package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -1
  624. package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +2 -0
  625. package/dist/modules/n8n-packages/entities/project/project-importer.js +9 -1
  626. package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
  627. package/dist/modules/n8n-packages/entities/project/project.exporter.d.ts +1 -0
  628. package/dist/modules/n8n-packages/entities/project/project.exporter.js +2 -0
  629. package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -1
  630. package/dist/modules/n8n-packages/entities/project/project.serializer.js +3 -0
  631. package/dist/modules/n8n-packages/entities/project/project.serializer.js.map +1 -1
  632. package/dist/modules/n8n-packages/entities/reference.d.ts +6 -0
  633. package/dist/modules/n8n-packages/entities/reference.js +3 -0
  634. package/dist/modules/n8n-packages/entities/reference.js.map +1 -0
  635. package/dist/modules/n8n-packages/entities/requirements.types.d.ts +2 -0
  636. package/dist/modules/n8n-packages/entities/requirements.types.js +1 -0
  637. package/dist/modules/n8n-packages/entities/requirements.types.js.map +1 -1
  638. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.d.ts +24 -0
  639. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js +69 -0
  640. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js.map +1 -0
  641. package/dist/modules/n8n-packages/entities/tag/tag-importer.d.ts +14 -0
  642. package/dist/modules/n8n-packages/entities/tag/tag-importer.js +142 -0
  643. package/dist/modules/n8n-packages/entities/tag/tag-importer.js.map +1 -0
  644. package/dist/modules/n8n-packages/entities/tag/tag-requirements.extractor.d.ts +6 -0
  645. package/dist/modules/n8n-packages/entities/tag/tag-requirements.extractor.js +23 -0
  646. package/dist/modules/n8n-packages/entities/tag/tag-requirements.extractor.js.map +1 -0
  647. package/dist/modules/n8n-packages/entities/tag/tag.exporter.d.ts +15 -0
  648. package/dist/modules/n8n-packages/entities/tag/tag.exporter.js +45 -0
  649. package/dist/modules/n8n-packages/entities/tag/tag.exporter.js.map +1 -0
  650. package/dist/modules/n8n-packages/entities/tag/tag.types.d.ts +48 -0
  651. package/dist/modules/n8n-packages/entities/tag/tag.types.js +10 -0
  652. package/dist/modules/n8n-packages/entities/tag/tag.types.js.map +1 -0
  653. package/dist/modules/n8n-packages/entities/variable/variable-importer.d.ts +8 -2
  654. package/dist/modules/n8n-packages/entities/variable/variable-importer.js +82 -6
  655. package/dist/modules/n8n-packages/entities/variable/variable-importer.js.map +1 -1
  656. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.d.ts +1 -0
  657. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js +9 -4
  658. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js.map +1 -1
  659. package/dist/modules/n8n-packages/entities/variable/variable.types.d.ts +31 -1
  660. package/dist/modules/n8n-packages/entities/variable/variable.types.js +36 -0
  661. package/dist/modules/n8n-packages/entities/variable/variable.types.js.map +1 -1
  662. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.d.ts +1 -0
  663. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.js +4 -3
  664. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow-resolver.js.map +1 -1
  665. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.d.ts +4 -1
  666. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js +10 -6
  667. package/dist/modules/n8n-packages/entities/workflow/auto-included-workflow.exporter.js.map +1 -1
  668. package/dist/modules/n8n-packages/entities/workflow/references/caller-ids.reference.d.ts +3 -0
  669. package/dist/modules/n8n-packages/entities/workflow/references/caller-ids.reference.js +20 -0
  670. package/dist/modules/n8n-packages/entities/workflow/references/caller-ids.reference.js.map +1 -0
  671. package/dist/modules/n8n-packages/entities/workflow/references/error-workflow.reference.d.ts +3 -0
  672. package/dist/modules/n8n-packages/entities/workflow/references/error-workflow.reference.js +25 -0
  673. package/dist/modules/n8n-packages/entities/workflow/references/error-workflow.reference.js.map +1 -0
  674. package/dist/modules/n8n-packages/entities/workflow/references/extract-workflow-requirements.d.ts +3 -0
  675. package/dist/modules/n8n-packages/entities/workflow/references/extract-workflow-requirements.js +16 -0
  676. package/dist/modules/n8n-packages/entities/workflow/references/extract-workflow-requirements.js.map +1 -0
  677. package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.d.ts +6 -0
  678. package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.js +55 -0
  679. package/dist/modules/n8n-packages/entities/workflow/references/sub-workflow-node.reference.js.map +1 -0
  680. package/dist/modules/n8n-packages/entities/workflow/references/workflow-references.d.ts +3 -0
  681. package/dist/modules/n8n-packages/entities/workflow/references/workflow-references.js +12 -0
  682. package/dist/modules/n8n-packages/entities/workflow/references/workflow-references.js.map +1 -0
  683. package/dist/modules/n8n-packages/entities/workflow/sub-workflow-ordering.d.ts +4 -0
  684. package/dist/modules/n8n-packages/entities/workflow/sub-workflow-ordering.js +45 -0
  685. package/dist/modules/n8n-packages/entities/workflow/sub-workflow-ordering.js.map +1 -0
  686. package/dist/modules/n8n-packages/entities/workflow/workflow-dependency-resolver.d.ts +2 -3
  687. package/dist/modules/n8n-packages/entities/workflow/workflow-dependency-resolver.js +7 -5
  688. package/dist/modules/n8n-packages/entities/workflow/workflow-dependency-resolver.js.map +1 -1
  689. package/dist/modules/n8n-packages/entities/workflow/workflow-import.types.d.ts +14 -3
  690. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.d.ts +5 -6
  691. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +25 -19
  692. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
  693. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +11 -2
  694. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +17 -2
  695. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
  696. package/dist/modules/n8n-packages/entities/workflow/workflow-requirement.exporter.d.ts +7 -1
  697. package/dist/modules/n8n-packages/entities/workflow/workflow-requirement.exporter.js +28 -7
  698. package/dist/modules/n8n-packages/entities/workflow/workflow-requirement.exporter.js.map +1 -1
  699. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +4 -1
  700. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +11 -5
  701. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
  702. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +3 -1
  703. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +6 -1
  704. package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
  705. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +5 -1
  706. package/dist/modules/n8n-packages/n8n-packages.service.js +32 -9
  707. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
  708. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +49 -4
  709. package/dist/modules/n8n-packages/n8n-packages.types.js +15 -1
  710. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  711. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +95 -11
  712. package/dist/modules/n8n-packages/spec/manifest.schema.js +2 -0
  713. package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
  714. package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +52 -7
  715. package/dist/modules/n8n-packages/spec/requirements.schema.js +10 -1
  716. package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
  717. package/dist/modules/n8n-packages/spec/serialized/project.schema.d.ts +18 -0
  718. package/dist/modules/n8n-packages/spec/serialized/project.schema.js +5 -0
  719. package/dist/modules/n8n-packages/spec/serialized/project.schema.js.map +1 -1
  720. package/dist/modules/n8n-packages/spec/serialized/tag.schema.d.ts +12 -0
  721. package/dist/modules/n8n-packages/spec/serialized/tag.schema.js +11 -0
  722. package/dist/modules/n8n-packages/spec/serialized/tag.schema.js.map +1 -0
  723. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +3 -0
  724. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +1 -0
  725. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
  726. package/dist/modules/oauth-server/database/entities/oauth-client.entity.d.ts +1 -0
  727. package/dist/modules/oauth-server/database/entities/oauth-client.entity.js +4 -0
  728. package/dist/modules/oauth-server/database/entities/oauth-client.entity.js.map +1 -1
  729. package/dist/modules/oauth-server/database/repositories/oauth-user-consent.repository.d.ts +1 -0
  730. package/dist/modules/oauth-server/database/repositories/oauth-user-consent.repository.js +13 -1
  731. package/dist/modules/oauth-server/database/repositories/oauth-user-consent.repository.js.map +1 -1
  732. package/dist/modules/oauth-server/oauth-flow.service.d.ts +17 -0
  733. package/dist/modules/oauth-server/oauth-flow.service.js +100 -0
  734. package/dist/modules/oauth-server/oauth-flow.service.js.map +1 -0
  735. package/dist/modules/oauth-server/oauth-server.module.js +5 -5
  736. package/dist/modules/oauth-server/oauth-server.module.js.map +1 -1
  737. package/dist/modules/oauth-server/oauth-server.service.d.ts +8 -2
  738. package/dist/modules/oauth-server/oauth-server.service.js +64 -11
  739. package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
  740. package/dist/modules/oauth-server/oauth.controller.js +3 -1
  741. package/dist/modules/oauth-server/oauth.controller.js.map +1 -1
  742. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.d.ts +38 -0
  743. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js +95 -0
  744. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-resource.resolver.js.map +1 -0
  745. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.d.ts +37 -0
  746. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js +88 -0
  747. package/dist/modules/oauth-server/protected-resource-resolvers/form-trigger-test-resource.resolver.js.map +1 -0
  748. package/dist/modules/oauth-server/protected-resource-resolvers/index.d.ts +1 -0
  749. package/dist/modules/oauth-server/protected-resource-resolvers/index.js +20 -0
  750. package/dist/modules/oauth-server/protected-resource-resolvers/index.js.map +1 -0
  751. package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +5 -0
  752. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +16 -1
  753. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
  754. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.d.ts +19 -0
  755. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js +107 -0
  756. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-test-trigger-resource.resolver.js.map +1 -0
  757. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.d.ts +21 -0
  758. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js +109 -0
  759. package/dist/modules/oauth-server/protected-resource-resolvers/workflow-webhook-trigger-resource.resolver.js.map +1 -0
  760. package/dist/modules/otel/otel-lifecycle-handler.d.ts +0 -1
  761. package/dist/modules/otel/otel-lifecycle-handler.js +1 -4
  762. package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
  763. package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +4 -0
  764. package/dist/modules/provisioning.ee/provisioning.service.ee.js +102 -20
  765. package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
  766. package/dist/modules/provisioning.ee/role-deletion-checker.ee.d.ts +3 -1
  767. package/dist/modules/provisioning.ee/role-deletion-checker.ee.js +13 -5
  768. package/dist/modules/provisioning.ee/role-deletion-checker.ee.js.map +1 -1
  769. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +7 -1
  770. package/dist/modules/source-control.ee/source-control-import.service.ee.js +33 -7
  771. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  772. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +8 -0
  773. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +4 -0
  774. package/dist/modules/source-control.ee/source-control.service.ee.js +5 -2
  775. package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
  776. package/dist/modules/source-control.ee/types/import-result.d.ts +2 -0
  777. package/dist/modules/sso-oidc/constants.d.ts +2 -0
  778. package/dist/modules/sso-oidc/constants.js +3 -1
  779. package/dist/modules/sso-oidc/constants.js.map +1 -1
  780. package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +4 -1
  781. package/dist/modules/sso-oidc/oidc.controller.ee.js +54 -1
  782. package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
  783. package/dist/modules/sso-oidc/oidc.service.ee.d.ts +9 -2
  784. package/dist/modules/sso-oidc/oidc.service.ee.js +44 -15
  785. package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
  786. package/dist/modules/sso-saml/saml-helpers.js +2 -3
  787. package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
  788. package/dist/modules/sso-saml/saml.service.ee.js +2 -3
  789. package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
  790. package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.d.ts +10 -0
  791. package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.js +54 -0
  792. package/dist/modules/workflow-reviews.ee/workflow-review-feature-gate.service.js.map +1 -0
  793. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +31 -0
  794. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +219 -0
  795. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -0
  796. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.d.ts +9 -0
  797. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js +40 -0
  798. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js.map +1 -0
  799. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +19 -18
  800. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +163 -155
  801. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -1
  802. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.d.ts +6 -2
  803. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js +29 -4
  804. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js.map +1 -1
  805. package/dist/modules/workflow-reviews.ee/workflow-review.mapper.d.ts +3 -0
  806. package/dist/modules/workflow-reviews.ee/workflow-review.mapper.js +12 -0
  807. package/dist/modules/workflow-reviews.ee/workflow-review.mapper.js.map +1 -0
  808. package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +4 -0
  809. package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -1
  810. package/dist/node-catalog/node-catalog.service.d.ts +1 -0
  811. package/dist/node-catalog/node-catalog.service.js +11 -3
  812. package/dist/node-catalog/node-catalog.service.js.map +1 -1
  813. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  814. package/dist/permissions.ee/project-scope.service.d.ts +9 -0
  815. package/dist/permissions.ee/project-scope.service.js +34 -0
  816. package/dist/permissions.ee/project-scope.service.js.map +1 -0
  817. package/dist/public-api/types.d.ts +11 -1
  818. package/dist/public-api/v1/handlers/ldap/ldap.handler.d.ts +10 -0
  819. package/dist/public-api/v1/handlers/ldap/ldap.handler.js +76 -0
  820. package/dist/public-api/v1/handlers/ldap/ldap.handler.js.map +1 -0
  821. package/dist/public-api/v1/handlers/ldap/ldap.mapper.d.ts +17 -0
  822. package/dist/public-api/v1/handlers/ldap/ldap.mapper.js +35 -0
  823. package/dist/public-api/v1/handlers/ldap/ldap.mapper.js.map +1 -0
  824. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +1 -0
  825. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +4 -0
  826. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
  827. package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.handler.d.ts +8 -0
  828. package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.handler.js +38 -0
  829. package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.handler.js.map +1 -0
  830. package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.mapper.d.ts +5 -0
  831. package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.mapper.js +12 -0
  832. package/dist/public-api/v1/handlers/sso-oidc/sso-oidc.mapper.js.map +1 -0
  833. package/dist/public-api/v1/openapi.yml +789 -9
  834. package/dist/push/index.js +1 -1
  835. package/dist/push/index.js.map +1 -1
  836. package/dist/push/origin-validator.d.ts +2 -1
  837. package/dist/push/origin-validator.js +15 -2
  838. package/dist/push/origin-validator.js.map +1 -1
  839. package/dist/push/sse.push.js +2 -0
  840. package/dist/push/sse.push.js.map +1 -1
  841. package/dist/scaling/job-processor.d.ts +3 -2
  842. package/dist/scaling/job-processor.js +17 -14
  843. package/dist/scaling/job-processor.js.map +1 -1
  844. package/dist/scaling/scaling.service.d.ts +3 -2
  845. package/dist/scaling/scaling.service.js +19 -16
  846. package/dist/scaling/scaling.service.js.map +1 -1
  847. package/dist/scaling/webhook-response-relay.d.ts +34 -0
  848. package/dist/scaling/webhook-response-relay.js +323 -0
  849. package/dist/scaling/webhook-response-relay.js.map +1 -0
  850. package/dist/scheduling/durable-job-provisioner.d.ts +2 -1
  851. package/dist/scheduling/durable-job-provisioner.js +21 -3
  852. package/dist/scheduling/durable-job-provisioner.js.map +1 -1
  853. package/dist/scheduling/durable-scheduler.js +22 -0
  854. package/dist/scheduling/durable-scheduler.js.map +1 -1
  855. package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js +2 -1
  856. package/dist/scheduling/poll-trigger-node/poll-trigger-job-registrar.js.map +1 -1
  857. package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.js +11 -4
  858. package/dist/scheduling/schedule-trigger-node/schedule-trigger-job-registrar.js.map +1 -1
  859. package/dist/security-audit/security-audit.service.js +1 -1
  860. package/dist/security-audit/security-audit.service.js.map +1 -1
  861. package/dist/services/ai-gateway.service.d.ts +3 -0
  862. package/dist/services/ai-gateway.service.js +16 -0
  863. package/dist/services/ai-gateway.service.js.map +1 -1
  864. package/dist/services/credentials-tester.service.d.ts +7 -0
  865. package/dist/services/credentials-tester.service.js +69 -9
  866. package/dist/services/credentials-tester.service.js.map +1 -1
  867. package/dist/services/frontend.service.js +14 -0
  868. package/dist/services/frontend.service.js.map +1 -1
  869. package/dist/services/oauth2-flow-proxy.service.d.ts +11 -0
  870. package/dist/services/oauth2-flow-proxy.service.js +34 -0
  871. package/dist/services/oauth2-flow-proxy.service.js.map +1 -0
  872. package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
  873. package/dist/services/project.service.ee.d.ts +5 -0
  874. package/dist/services/project.service.ee.js +15 -1
  875. package/dist/services/project.service.ee.js.map +1 -1
  876. package/dist/services/protected-resource.registry.d.ts +2 -1
  877. package/dist/services/protected-resource.registry.js +7 -2
  878. package/dist/services/protected-resource.registry.js.map +1 -1
  879. package/dist/services/pruning/workflow-history-compaction.service.js +3 -2
  880. package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
  881. package/dist/services/tag.service.d.ts +2 -1
  882. package/dist/services/tag.service.js +14 -31
  883. package/dist/services/tag.service.js.map +1 -1
  884. package/dist/sso.ee/sso-helpers.d.ts +1 -0
  885. package/dist/sso.ee/sso-helpers.js +8 -0
  886. package/dist/sso.ee/sso-helpers.js.map +1 -1
  887. package/dist/task-runners/errors/task-request-timeout.error.d.ts +2 -2
  888. package/dist/task-runners/errors/task-request-timeout.error.js +3 -3
  889. package/dist/task-runners/errors/task-request-timeout.error.js.map +1 -1
  890. package/dist/task-runners/task-broker/errors/task-requester-accept-timeout.error.d.ts +4 -0
  891. package/dist/task-runners/task-broker/errors/task-requester-accept-timeout.error.js +11 -0
  892. package/dist/task-runners/task-broker/errors/task-requester-accept-timeout.error.js.map +1 -0
  893. package/dist/task-runners/task-broker/errors/task-runner-unreachable.error.d.ts +4 -0
  894. package/dist/task-runners/task-broker/errors/task-runner-unreachable.error.js +11 -0
  895. package/dist/task-runners/task-broker/errors/task-runner-unreachable.error.js.map +1 -0
  896. package/dist/task-runners/task-broker/task-broker-ws-server.d.ts +9 -1
  897. package/dist/task-runners/task-broker/task-broker-ws-server.js +61 -32
  898. package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
  899. package/dist/task-runners/task-broker/task-broker.service.d.ts +18 -1
  900. package/dist/task-runners/task-broker/task-broker.service.js +134 -63
  901. package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
  902. package/dist/task-runners/task-managers/task-requester.d.ts +1 -0
  903. package/dist/task-runners/task-managers/task-requester.js +4 -1
  904. package/dist/task-runners/task-managers/task-requester.js.map +1 -1
  905. package/dist/task-runners/task-runner-module.js +2 -2
  906. package/dist/task-runners/task-runner-module.js.map +1 -1
  907. package/dist/telemetry/index.d.ts +3 -1
  908. package/dist/telemetry/index.js +15 -8
  909. package/dist/telemetry/index.js.map +1 -1
  910. package/dist/utils/ai-service-retry.js +2 -4
  911. package/dist/utils/ai-service-retry.js.map +1 -1
  912. package/dist/wait-tracker.js +6 -2
  913. package/dist/wait-tracker.js.map +1 -1
  914. package/dist/webhooks/test-webhooks.d.ts +1 -0
  915. package/dist/webhooks/test-webhooks.js +14 -9
  916. package/dist/webhooks/test-webhooks.js.map +1 -1
  917. package/dist/webhooks/webhook-helpers.js +69 -16
  918. package/dist/webhooks/webhook-helpers.js.map +1 -1
  919. package/dist/webhooks/webhook.service.d.ts +4 -0
  920. package/dist/webhooks/webhook.service.js +40 -12
  921. package/dist/webhooks/webhook.service.js.map +1 -1
  922. package/dist/workflow-execute-additional-data.js +2 -0
  923. package/dist/workflow-execute-additional-data.js.map +1 -1
  924. package/dist/workflow-helpers.d.ts +4 -1
  925. package/dist/workflow-helpers.js +22 -0
  926. package/dist/workflow-helpers.js.map +1 -1
  927. package/dist/workflow-runner.d.ts +2 -1
  928. package/dist/workflow-runner.js +4 -4
  929. package/dist/workflow-runner.js.map +1 -1
  930. package/dist/workflows/publication/published-workflow-trigger-deactivator.d.ts +11 -3
  931. package/dist/workflows/publication/published-workflow-trigger-deactivator.js +66 -23
  932. package/dist/workflows/publication/published-workflow-trigger-deactivator.js.map +1 -1
  933. package/dist/workflows/publication/workflow-publication-lifecycle-lock.d.ts +0 -5
  934. package/dist/workflows/publication/workflow-publication-lifecycle-lock.js +0 -44
  935. package/dist/workflows/publication/workflow-publication-lifecycle-lock.js.map +1 -1
  936. package/dist/workflows/publication/workflow-publication-outbox-consumer.js +3 -0
  937. package/dist/workflows/publication/workflow-publication-outbox-consumer.js.map +1 -1
  938. package/dist/workflows/publication/workflow-publication-reconciler.service.d.ts +4 -2
  939. package/dist/workflows/publication/workflow-publication-reconciler.service.js +43 -30
  940. package/dist/workflows/publication/workflow-publication-reconciler.service.js.map +1 -1
  941. package/dist/workflows/triggers/trigger-activation-retry.js +2 -1
  942. package/dist/workflows/triggers/trigger-activation-retry.js.map +1 -1
  943. package/dist/workflows/triggers/workflow-trigger-activator.js +8 -1
  944. package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
  945. package/dist/workflows/workflow-finder.service.d.ts +1 -0
  946. package/dist/workflows/workflow-finder.service.js +3 -1
  947. package/dist/workflows/workflow-finder.service.js.map +1 -1
  948. package/dist/workflows/workflow-publish-guard-proxy.service.d.ts +8 -0
  949. package/dist/workflows/workflow-publish-guard-proxy.service.js +26 -0
  950. package/dist/workflows/workflow-publish-guard-proxy.service.js.map +1 -0
  951. package/dist/workflows/workflow-validation.service.d.ts +1 -0
  952. package/dist/workflows/workflow-validation.service.js +23 -8
  953. package/dist/workflows/workflow-validation.service.js.map +1 -1
  954. package/dist/workflows/workflow.service.d.ts +7 -3
  955. package/dist/workflows/workflow.service.ee.d.ts +4 -1
  956. package/dist/workflows/workflow.service.js +75 -30
  957. package/dist/workflows/workflow.service.js.map +1 -1
  958. package/dist/workflows/workflows.controller.d.ts +4 -1
  959. package/package.json +39 -39
  960. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.d.ts +0 -2
  961. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.js +0 -19
  962. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/index.js.map +0 -1
  963. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.d.ts +0 -20
  964. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.js +0 -12
  965. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/metadata.js.map +0 -1
  966. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.d.ts +0 -12
  967. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js +0 -85
  968. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-extractor.js.map +0 -1
  969. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.d.ts +0 -10
  970. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.js +0 -77
  971. package/dist/modules/dynamic-credentials.ee/context-establishment-hooks/n8n-oauth/n8n-oauth-seeder.js.map +0 -1
  972. package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.d.ts +0 -2
  973. package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.js +0 -23
  974. package/dist/modules/n8n-packages/entities/workflow/static-sub-workflow-id.js.map +0 -1
  975. package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.d.ts +0 -7
  976. package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.js +0 -41
  977. package/dist/modules/n8n-packages/entities/workflow/workflow-requirements.extractor.js.map +0 -1
  978. package/dist/services/trigger-auth-identity-seeder-proxy.service.d.ts +0 -10
  979. package/dist/services/trigger-auth-identity-seeder-proxy.service.js.map +0 -1
  980. package/dist/workflows/publication/published-workflow-enqueuer.d.ts +0 -13
  981. package/dist/workflows/publication/published-workflow-enqueuer.js +0 -50
  982. package/dist/workflows/publication/published-workflow-enqueuer.js.map +0 -1
@@ -0,0 +1,1157 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.McpAgentToolsService = void 0;
13
+ const agent_config_1 = require("@n8n/ai-utilities/agent-config");
14
+ const api_types_1 = require("@n8n/api-types");
15
+ const backend_network_1 = require("@n8n/backend-network");
16
+ const config_1 = require("@n8n/config");
17
+ const di_1 = require("@n8n/di");
18
+ const is_record_1 = require("@n8n/utils/is-record");
19
+ const n8n_workflow_1 = require("n8n-workflow");
20
+ const zod_1 = require("zod");
21
+ const zod_to_json_schema_1 = require("zod-to-json-schema");
22
+ const credentials_service_1 = require("../../../../credentials/credentials.service");
23
+ const forbidden_error_1 = require("../../../../errors/response-errors/forbidden.error");
24
+ const agent_config_service_1 = require("../../../../modules/agents/agent-config.service");
25
+ const agent_custom_tools_service_1 = require("../../../../modules/agents/agent-custom-tools.service");
26
+ const agent_integration_persistence_service_1 = require("../../../../modules/agents/agent-integration-persistence.service");
27
+ const agent_model_catalog_service_1 = require("../../../../modules/agents/agent-model-catalog.service");
28
+ const agent_publish_service_1 = require("../../../../modules/agents/agent-publish.service");
29
+ const agent_skills_service_1 = require("../../../../modules/agents/agent-skills.service");
30
+ const agent_task_service_1 = require("../../../../modules/agents/agent-task.service");
31
+ const agent_validation_service_1 = require("../../../../modules/agents/agent-validation.service");
32
+ const agents_service_1 = require("../../../../modules/agents/agents.service");
33
+ const attachable_workflows_service_1 = require("../../../../modules/agents/attachable-workflows.service");
34
+ const agent_chat_integration_1 = require("../../../../modules/agents/integrations/agent-chat-integration");
35
+ const chat_integration_service_1 = require("../../../../modules/agents/integrations/chat-integration.service");
36
+ const agent_config_composition_1 = require("../../../../modules/agents/json-config/agent-config-composition");
37
+ const mcp_client_factory_1 = require("../../../../modules/agents/json-config/mcp-client-factory");
38
+ const sanitize_unknown_agent_credentials_1 = require("../../../../modules/agents/json-config/sanitize-unknown-agent-credentials");
39
+ const model_catalog_1 = require("../../../../modules/agents/model-catalog");
40
+ const agent_secure_runtime_1 = require("../../../../modules/agents/runtime/agent-secure-runtime");
41
+ const agent_config_hash_1 = require("../../../../modules/agents/utils/agent-config-hash");
42
+ const agent_credential_provider_1 = require("../../../../modules/agents/utils/agent-credential-provider");
43
+ const mcp_registry_service_1 = require("../../../../modules/mcp-registry/registry/mcp-registry.service");
44
+ const node_types_1 = require("../../../../node-types");
45
+ const oauth_service_1 = require("../../../../oauth/oauth.service");
46
+ const check_access_1 = require("../../../../permissions.ee/check-access");
47
+ const project_scope_service_1 = require("../../../../permissions.ee/project-scope.service");
48
+ const url_service_1 = require("../../../../services/url.service");
49
+ const telemetry_1 = require("../../../../telemetry");
50
+ const ai_proxy_fetch_1 = require("../../../../utils/ai-proxy-fetch");
51
+ const agent_reference_1 = require("./agent-reference");
52
+ const mcp_constants_1 = require("../../mcp.constants");
53
+ const MCP_SERVER_DISCOVERY_LIMIT = 20;
54
+ const INTEGRATIONS_NOT_IN_CONFIG_MESSAGE = "Integrations can't be changed through config.replace or config.patch. Use update_agent_integration to configure or disconnect Slack, Telegram, or Linear. Configuration never publishes the Agent; an unpublished Agent's channel stays inactive until publish_agent is called.";
55
+ const MCP_AGENT_CONFIG_MESSAGES = {
56
+ emptyInstructionsFollowUp: 'retrying the mutation.',
57
+ dynamicSelectorFollowUp: 'Ask the user for the concrete value and write it into nodeParameters as a literal.',
58
+ };
59
+ function integrationsField(config) {
60
+ return (0, is_record_1.isRecord)(config) ? config.integrations : undefined;
61
+ }
62
+ function collectClearedCredentialIds(original, sanitized, ids) {
63
+ if (Array.isArray(original) && Array.isArray(sanitized)) {
64
+ original.forEach((entry, index) => collectClearedCredentialIds(entry, sanitized[index], ids));
65
+ return;
66
+ }
67
+ if (!(0, is_record_1.isRecord)(original) || !(0, is_record_1.isRecord)(sanitized))
68
+ return;
69
+ for (const [key, value] of Object.entries(original)) {
70
+ if (typeof value === 'string' && value !== '' && sanitized[key] === '') {
71
+ ids.add(value);
72
+ continue;
73
+ }
74
+ collectClearedCredentialIds(value, sanitized[key], ids);
75
+ }
76
+ }
77
+ function integrationsChanged(current, next) {
78
+ return (JSON.stringify(current.integrations ?? []) !== JSON.stringify(integrationsField(next) ?? []));
79
+ }
80
+ const TELEGRAM_SETTINGS_JSON_SCHEMA = (0, zod_to_json_schema_1.zodToJsonSchema)(api_types_1.AgentTelegramSettingsSchema);
81
+ const httpUrlSchema = zod_1.z
82
+ .string()
83
+ .url()
84
+ .refine((value) => /^https?:\/\//i.test(value), { message: 'Must be a valid HTTP(S) URL' });
85
+ const agentIdentityShape = {
86
+ agentId: zod_1.z.string().min(1).describe('Agent ID'),
87
+ };
88
+ const getAgentInput = {
89
+ ...agentIdentityShape,
90
+ versionId: zod_1.z
91
+ .string()
92
+ .min(1)
93
+ .optional()
94
+ .describe('Read a published version snapshot instead of the draft, e.g. the activeVersionId. Snapshots are read-only, so the response has no configHash.'),
95
+ };
96
+ const publishAgentInput = {
97
+ ...agentIdentityShape,
98
+ versionId: zod_1.z
99
+ .string()
100
+ .min(1)
101
+ .optional()
102
+ .describe('Republish a previously published version instead of the current draft. The draft is left untouched.'),
103
+ };
104
+ const revertAgentInput = {
105
+ ...agentIdentityShape,
106
+ versionId: zod_1.z
107
+ .string()
108
+ .min(1)
109
+ .optional()
110
+ .describe('Published version to restore the draft from; defaults to the currently published version'),
111
+ };
112
+ const listAgentVersionsInput = {
113
+ ...agentIdentityShape,
114
+ limit: zod_1.z.number().int().min(1).max(100).optional().default(20),
115
+ offset: zod_1.z.number().int().min(0).optional().default(0),
116
+ };
117
+ const searchAgentsInput = {
118
+ projectId: zod_1.z.string().min(1).optional().describe('Restrict results to one project'),
119
+ query: zod_1.z.string().optional().describe('Filter by Agent name'),
120
+ publishedOnly: zod_1.z.boolean().optional().default(false),
121
+ excludeAgentId: zod_1.z.string().optional().describe('Agent ID to omit, useful for sub-agent search'),
122
+ limit: zod_1.z.number().int().min(1).max(100).optional().default(50),
123
+ };
124
+ const initialAgentConfigSchema = api_types_1.AgentJsonConfigBaseSchema.omit({
125
+ name: true,
126
+ skills: true,
127
+ tasks: true,
128
+ integrations: true,
129
+ }).superRefine((config, ctx) => {
130
+ if (config.credential?.trim() && (0, api_types_1.isDraftAgentConfig)(config)) {
131
+ ctx.addIssue({
132
+ code: zod_1.z.ZodIssueCode.custom,
133
+ path: ['credential'],
134
+ message: 'A credential requires a model to be set',
135
+ });
136
+ }
137
+ if (config.tools?.some((tool) => tool.type === 'custom')) {
138
+ ctx.addIssue({
139
+ code: zod_1.z.ZodIssueCode.custom,
140
+ path: ['tools'],
141
+ message: 'Create custom tools with mutate_agent after creating the Agent',
142
+ });
143
+ }
144
+ });
145
+ const createAgentInput = {
146
+ projectId: zod_1.z.string().min(1),
147
+ name: zod_1.z.string().trim().min(1).max(128),
148
+ config: initialAgentConfigSchema
149
+ .optional()
150
+ .describe('Optional initial Agent config without name, skills, tasks, or custom tools. The top-level name is injected into the config.'),
151
+ };
152
+ const jsonPatchValueSchema = zod_1.z.union([
153
+ zod_1.z.null(),
154
+ zod_1.z.boolean(),
155
+ zod_1.z.number(),
156
+ zod_1.z.string(),
157
+ zod_1.z.array(zod_1.z.unknown()),
158
+ zod_1.z.record(zod_1.z.unknown()),
159
+ ]);
160
+ const jsonPatchOperationSchema = zod_1.z.discriminatedUnion('op', [
161
+ zod_1.z.object({ op: zod_1.z.literal('add'), path: zod_1.z.string(), value: jsonPatchValueSchema }),
162
+ zod_1.z.object({ op: zod_1.z.literal('remove'), path: zod_1.z.string() }),
163
+ zod_1.z.object({ op: zod_1.z.literal('replace'), path: zod_1.z.string(), value: jsonPatchValueSchema }),
164
+ zod_1.z.object({ op: zod_1.z.literal('move'), from: zod_1.z.string(), path: zod_1.z.string() }),
165
+ zod_1.z.object({ op: zod_1.z.literal('copy'), from: zod_1.z.string(), path: zod_1.z.string() }),
166
+ zod_1.z.object({ op: zod_1.z.literal('test'), path: zod_1.z.string(), value: jsonPatchValueSchema }),
167
+ ]);
168
+ const mutationOperationSchema = zod_1.z.discriminatedUnion('type', [
169
+ zod_1.z.object({ type: zod_1.z.literal('config.replace'), config: zod_1.z.record(zod_1.z.unknown()) }),
170
+ zod_1.z.object({
171
+ type: zod_1.z.literal('config.patch'),
172
+ patch: zod_1.z.array(jsonPatchOperationSchema).min(1),
173
+ }),
174
+ zod_1.z.object({
175
+ type: zod_1.z.literal('skill.upsert'),
176
+ skillId: zod_1.z.string().optional(),
177
+ skill: api_types_1.agentSkillSchema,
178
+ }),
179
+ zod_1.z.object({ type: zod_1.z.literal('skill.delete'), skillId: zod_1.z.string().min(1) }),
180
+ zod_1.z.object({
181
+ type: zod_1.z.literal('task.upsert'),
182
+ taskId: zod_1.z.string().optional(),
183
+ task: api_types_1.agentTaskSchema,
184
+ enabled: zod_1.z.boolean().optional(),
185
+ }),
186
+ zod_1.z.object({ type: zod_1.z.literal('task.delete'), taskId: zod_1.z.string().min(1) }),
187
+ zod_1.z.object({ type: zod_1.z.literal('customTool.upsert'), code: zod_1.z.string().min(1) }),
188
+ zod_1.z.object({ type: zod_1.z.literal('customTool.delete'), toolId: zod_1.z.string().min(1) }),
189
+ ]);
190
+ const mutateAgentInput = {
191
+ ...agentIdentityShape,
192
+ baseConfigHash: zod_1.z
193
+ .string()
194
+ .min(1)
195
+ .describe('Latest configHash returned by get_agent or a successful mutation'),
196
+ operation: mutationOperationSchema,
197
+ };
198
+ const discoverAssetsInput = {
199
+ projectId: zod_1.z.string().min(1),
200
+ kind: zod_1.z.enum(['models', 'integrations', 'workflows', 'subagents', 'mcpServers']),
201
+ query: zod_1.z
202
+ .string()
203
+ .trim()
204
+ .min(1)
205
+ .optional()
206
+ .describe('Optional filter for workflows, subagents, or MCP servers'),
207
+ provider: zod_1.z
208
+ .enum(api_types_1.AGENT_MODEL_PROVIDERS)
209
+ .optional()
210
+ .describe('Model provider for kind=models; omit to get a provider summary without model lists'),
211
+ credentialId: zod_1.z
212
+ .string()
213
+ .min(1)
214
+ .optional()
215
+ .describe('Accessible credential used to verify models for the selected provider'),
216
+ excludeAgentId: zod_1.z.string().optional().describe('Agent to omit when kind=subagents'),
217
+ };
218
+ const verifyMcpServerInput = {
219
+ projectId: zod_1.z.string().min(1),
220
+ name: zod_1.z
221
+ .string()
222
+ .min(1)
223
+ .max(64)
224
+ .regex(/^[a-zA-Z0-9_-]+$/),
225
+ url: httpUrlSchema.describe('HTTP(S) MCP server endpoint'),
226
+ transport: zod_1.z.enum(['sse', 'streamableHttp']).optional().default('streamableHttp'),
227
+ authentication: zod_1.z
228
+ .union([api_types_1.McpAuthenticationSchemaTypes, zod_1.z.string().endsWith('McpOAuth2Api')])
229
+ .optional()
230
+ .default('none')
231
+ .describe('Authentication method; every value other than none requires credential'),
232
+ credential: zod_1.z
233
+ .string()
234
+ .min(1)
235
+ .optional()
236
+ .describe('Accessible credential ID; required when authentication is not none'),
237
+ connectionTimeoutMs: zod_1.z.number().int().min(1).max(120_000).optional(),
238
+ };
239
+ const updateIntegrationInput = {
240
+ ...agentIdentityShape,
241
+ action: zod_1.z.enum(['connect', 'disconnect']),
242
+ type: zod_1.z.string().min(1).describe('Integration type returned by discover_agent_assets'),
243
+ credentialId: zod_1.z.string().min(1).describe('Accessible credential for this integration'),
244
+ settings: zod_1.z
245
+ .record(zod_1.z.unknown())
246
+ .optional()
247
+ .describe('Integration settings; required for Telegram connect operations'),
248
+ };
249
+ const emptyInput = {};
250
+ function toolResult(data, isError = false) {
251
+ return {
252
+ content: [{ type: 'text', text: JSON.stringify(data) }],
253
+ structuredContent: data,
254
+ ...(isError ? { isError: true } : {}),
255
+ };
256
+ }
257
+ let McpAgentToolsService = class McpAgentToolsService {
258
+ constructor(telemetry, credentialsService, agentsService, agentConfigService, agentValidationService, agentPublishService, agentSkillsService, agentTaskService, agentCustomToolsService, agentSecureRuntime, integrationPersistenceService, chatIntegrationService, chatIntegrationRegistry, agentModelCatalogService, attachableWorkflowsService, mcpRegistryService, nodeTypes, oauthService, outboundHttp, ssrfConfig, ssrfProtectionService, urlService, projectScopeService) {
259
+ this.telemetry = telemetry;
260
+ this.credentialsService = credentialsService;
261
+ this.agentsService = agentsService;
262
+ this.agentConfigService = agentConfigService;
263
+ this.agentValidationService = agentValidationService;
264
+ this.agentPublishService = agentPublishService;
265
+ this.agentSkillsService = agentSkillsService;
266
+ this.agentTaskService = agentTaskService;
267
+ this.agentCustomToolsService = agentCustomToolsService;
268
+ this.agentSecureRuntime = agentSecureRuntime;
269
+ this.integrationPersistenceService = integrationPersistenceService;
270
+ this.chatIntegrationService = chatIntegrationService;
271
+ this.chatIntegrationRegistry = chatIntegrationRegistry;
272
+ this.agentModelCatalogService = agentModelCatalogService;
273
+ this.attachableWorkflowsService = attachableWorkflowsService;
274
+ this.mcpRegistryService = mcpRegistryService;
275
+ this.nodeTypes = nodeTypes;
276
+ this.oauthService = oauthService;
277
+ this.outboundHttp = outboundHttp;
278
+ this.ssrfConfig = ssrfConfig;
279
+ this.ssrfProtectionService = ssrfProtectionService;
280
+ this.urlService = urlService;
281
+ this.projectScopeService = projectScopeService;
282
+ }
283
+ registerTools(server, user, allowedToolNames) {
284
+ const registerIfAllowed = (tool) => {
285
+ if (allowedToolNames && !allowedToolNames.has(tool.name))
286
+ return;
287
+ this.register(server, tool);
288
+ };
289
+ registerIfAllowed(this.searchAgentsTool(user));
290
+ registerIfAllowed(this.getAgentTool(user));
291
+ registerIfAllowed(this.createAgentTool(user));
292
+ registerIfAllowed(this.mutateAgentTool(user));
293
+ registerIfAllowed(this.validateAgentTool(user));
294
+ registerIfAllowed(this.publishAgentTool(user));
295
+ registerIfAllowed(this.unpublishAgentTool(user));
296
+ registerIfAllowed(this.revertAgentTool(user));
297
+ registerIfAllowed(this.listAgentVersionsTool(user));
298
+ registerIfAllowed(this.deleteAgentTool(user));
299
+ registerIfAllowed(this.discoverAssetsTool(user));
300
+ registerIfAllowed(this.verifyMcpServerTool(user));
301
+ registerIfAllowed(this.updateIntegrationTool(user));
302
+ registerIfAllowed(this.referenceTool(user));
303
+ if (allowedToolNames && !allowedToolNames.has('get_agent_builder_reference'))
304
+ return;
305
+ server.resource('agent-builder-reference', agent_reference_1.AGENT_BUILDER_REFERENCE_URI, { description: 'Reference for creating and managing n8n Agents through MCP.' }, () => ({
306
+ contents: [
307
+ {
308
+ uri: agent_reference_1.AGENT_BUILDER_REFERENCE_URI,
309
+ mimeType: 'text/markdown',
310
+ text: agent_reference_1.AGENT_BUILDER_REFERENCE,
311
+ },
312
+ ],
313
+ }));
314
+ }
315
+ register(server, tool) {
316
+ server.registerTool(tool.name, tool.config, tool.handler);
317
+ }
318
+ searchAgentsTool(user) {
319
+ return {
320
+ name: 'search_agents',
321
+ config: {
322
+ description: 'Search Agents the current user can access. Use publishedOnly and excludeAgentId to discover saved sub-agents. Other agent tools only operate on agents with availableInMCP: true.',
323
+ inputSchema: searchAgentsInput,
324
+ annotations: {
325
+ title: 'Search Agents',
326
+ readOnlyHint: true,
327
+ destructiveHint: false,
328
+ idempotentHint: true,
329
+ openWorldHint: false,
330
+ },
331
+ },
332
+ handler: async (input) => await this.run(user, 'search_agents', { projectId: input.projectId }, async () => {
333
+ let projectIds;
334
+ if (input.projectId) {
335
+ await this.assertScope(user, input.projectId, 'agent:list');
336
+ projectIds = [input.projectId];
337
+ }
338
+ else {
339
+ projectIds = await this.projectScopeService.getProjectIds(user, ['agent:list']);
340
+ }
341
+ const agents = await this.agentsService.findSummariesInProjects(projectIds, {
342
+ query: input.query?.trim() || undefined,
343
+ publishedOnly: input.publishedOnly,
344
+ excludeAgentId: input.excludeAgentId,
345
+ limit: input.limit,
346
+ });
347
+ const data = agents.map((agent) => ({
348
+ id: agent.id,
349
+ name: agent.name,
350
+ projectId: agent.projectId,
351
+ published: agent.activeVersionId !== null,
352
+ availableInMCP: agent.availableInMCP,
353
+ updatedAt: agent.updatedAt.toISOString(),
354
+ }));
355
+ return { ok: true, data, count: data.length };
356
+ }),
357
+ };
358
+ }
359
+ getAgentTool(user) {
360
+ return {
361
+ name: 'get_agent',
362
+ config: {
363
+ description: 'Read an Agent draft, sidecar resources, runnable state, and configHash. Call before mutate_agent. Pass versionId to inspect a published version snapshot instead of the draft.',
364
+ inputSchema: getAgentInput,
365
+ annotations: {
366
+ title: 'Get Agent',
367
+ readOnlyHint: true,
368
+ destructiveHint: false,
369
+ idempotentHint: true,
370
+ openWorldHint: false,
371
+ },
372
+ },
373
+ handler: async ({ agentId, versionId }) => await this.run(user, 'get_agent', { agentId, ...(versionId ? { versionId } : {}) }, async () => {
374
+ const agent = await this.resolveAgent(user, agentId);
375
+ await this.assertScope(user, agent.projectId, 'agent:read');
376
+ const snapshot = versionId
377
+ ? await this.getAgentVersionSnapshot(agent.projectId, agentId, versionId)
378
+ : await this.getAgentSnapshot(user, agent);
379
+ return { ok: true, ...snapshot };
380
+ }),
381
+ };
382
+ }
383
+ createAgentTool(user) {
384
+ return {
385
+ name: mcp_constants_1.MCP_CREATE_AGENT_TOOL_NAME,
386
+ config: {
387
+ description: 'Create an Agent draft, optionally with its initial model, credential, instructions, and ordinary tool configuration. Returns its n8n editor URL. Use mutate_agent afterward for skills, tasks, and custom tools.',
388
+ inputSchema: createAgentInput,
389
+ annotations: {
390
+ title: 'Create Agent',
391
+ readOnlyHint: false,
392
+ destructiveHint: false,
393
+ idempotentHint: false,
394
+ openWorldHint: false,
395
+ },
396
+ },
397
+ handler: async ({ projectId, name, config }) => await this.run(user, 'create_agent', { projectId }, async () => {
398
+ await this.assertScope(user, projectId, 'agent:create');
399
+ const initialConfig = config ? { ...config, name } : undefined;
400
+ if (initialConfig) {
401
+ const validation = await this.agentConfigService.validateConfig(initialConfig);
402
+ if (!validation.valid) {
403
+ throw new n8n_workflow_1.UserError(`Invalid initial Agent config: ${validation.error}`);
404
+ }
405
+ await this.assertAccessibleCredentials(initialConfig, user, projectId);
406
+ }
407
+ const agent = await this.agentsService.create(projectId, name, {
408
+ availableInMCP: true,
409
+ });
410
+ let configHash;
411
+ let versionId = agent.versionId;
412
+ try {
413
+ if (initialConfig) {
414
+ const result = await this.agentConfigService.updateConfig(agent.id, projectId, initialConfig, user, { modifiedBy: 'mcp' });
415
+ configHash = (0, agent_config_hash_1.getAgentConfigHash)(result.config);
416
+ versionId = result.versionId;
417
+ }
418
+ else {
419
+ configHash = await this.fetchConfigHash(projectId, agent.id);
420
+ }
421
+ }
422
+ catch (error) {
423
+ await this.agentsService.delete(agent.id, projectId);
424
+ throw error;
425
+ }
426
+ return {
427
+ ok: true,
428
+ agent: {
429
+ id: agent.id,
430
+ name: agent.name,
431
+ projectId: agent.projectId,
432
+ published: false,
433
+ versionId,
434
+ activeVersionId: agent.activeVersionId,
435
+ },
436
+ configHash,
437
+ url: this.getAgentUrl(projectId, agent.id),
438
+ };
439
+ }),
440
+ };
441
+ }
442
+ mutateAgentTool(user) {
443
+ return {
444
+ name: 'mutate_agent',
445
+ config: {
446
+ description: 'Apply one config, skill, task, or custom-tool mutation to an Agent draft. The operation fields sit directly on the operation object (no value wrapper), e.g. { "type": "config.patch", "patch": [...] }. Returns the next configHash for subsequent mutations.',
447
+ inputSchema: mutateAgentInput,
448
+ annotations: {
449
+ title: 'Mutate Agent',
450
+ readOnlyHint: false,
451
+ destructiveHint: true,
452
+ idempotentHint: false,
453
+ openWorldHint: false,
454
+ },
455
+ },
456
+ handler: async (input) => await this.run(user, 'mutate_agent', { agentId: input.agentId, type: input.operation.type }, async () => {
457
+ const agent = await this.resolveAgent(user, input.agentId);
458
+ const projectId = agent.projectId;
459
+ await this.assertScope(user, projectId, 'agent:update');
460
+ const config = this.configFromEntity(agent);
461
+ const configHash = (0, agent_config_hash_1.getAgentConfigHash)(config);
462
+ if (configHash !== input.baseConfigHash) {
463
+ return {
464
+ ok: false,
465
+ code: 'stale_config',
466
+ agentId: input.agentId,
467
+ configHash,
468
+ message: 'Call get_agent before retrying the mutation.',
469
+ };
470
+ }
471
+ const { resource, config: newConfig } = await this.applyMutation(user, input, config, projectId);
472
+ return {
473
+ ok: true,
474
+ agentId: input.agentId,
475
+ operation: input.operation.type,
476
+ configHash: newConfig
477
+ ? (0, agent_config_hash_1.getAgentConfigHash)(newConfig)
478
+ : await this.fetchConfigHash(projectId, input.agentId),
479
+ ...(resource ? { resource } : {}),
480
+ };
481
+ }),
482
+ };
483
+ }
484
+ validateAgentTool(user) {
485
+ return {
486
+ name: 'validate_agent',
487
+ config: {
488
+ description: 'Validate an Agent draft, sidecar references, and user-accessible credentials. Returns its n8n editor URL.',
489
+ inputSchema: agentIdentityShape,
490
+ annotations: {
491
+ title: 'Validate Agent',
492
+ readOnlyHint: true,
493
+ destructiveHint: false,
494
+ idempotentHint: true,
495
+ openWorldHint: false,
496
+ },
497
+ },
498
+ handler: async ({ agentId }) => await this.run(user, 'validate_agent', { agentId }, async () => {
499
+ const agent = await this.resolveAgent(user, agentId);
500
+ await this.assertScope(user, agent.projectId, 'agent:read');
501
+ return {
502
+ ok: true,
503
+ ...(await this.validateAgent(user, agent)),
504
+ url: this.getAgentUrl(agent.projectId, agentId),
505
+ };
506
+ }),
507
+ };
508
+ }
509
+ publishAgentTool(user) {
510
+ return {
511
+ name: 'publish_agent',
512
+ config: {
513
+ description: 'Publish a valid Agent draft and activate its tasks and integrations. Pass versionId to republish a previously published version instead. Only call after the user explicitly requests or confirms publication; completing a build does not imply approval.',
514
+ inputSchema: publishAgentInput,
515
+ annotations: {
516
+ title: 'Publish Agent',
517
+ readOnlyHint: false,
518
+ destructiveHint: false,
519
+ idempotentHint: true,
520
+ openWorldHint: true,
521
+ },
522
+ },
523
+ handler: async ({ agentId, versionId }) => await this.run(user, 'publish_agent', { agentId, ...(versionId ? { versionId } : {}) }, async () => {
524
+ const agent = await this.resolveAgent(user, agentId);
525
+ const projectId = agent.projectId;
526
+ await this.assertScope(user, projectId, 'agent:publish');
527
+ if (!versionId) {
528
+ const validation = await this.validateAgent(user, agent);
529
+ if (!validation.valid) {
530
+ throw new n8n_workflow_1.UserError(`Agent is not runnable: ${[...validation.errors, ...validation.missing].join(', ')}`);
531
+ }
532
+ }
533
+ const { agent: publishedAgent } = await this.agentPublishService.publishAgent(agentId, projectId, user, { by: 'mcp', trigger: 'explicit' }, versionId);
534
+ return {
535
+ ok: true,
536
+ agentId,
537
+ published: true,
538
+ versionId: publishedAgent.versionId,
539
+ activeVersionId: publishedAgent.activeVersionId,
540
+ url: this.getAgentUrl(projectId, agentId),
541
+ };
542
+ }),
543
+ };
544
+ }
545
+ revertAgentTool(user) {
546
+ return {
547
+ name: 'revert_agent',
548
+ config: {
549
+ description: 'Restore an Agent draft from a published version, overwriting the draft config, skills, tasks, and custom tools. Does not publish. Inspect the version with get_agent first; the response returns the new configHash.',
550
+ inputSchema: revertAgentInput,
551
+ annotations: {
552
+ title: 'Revert Agent',
553
+ readOnlyHint: false,
554
+ destructiveHint: true,
555
+ idempotentHint: true,
556
+ openWorldHint: false,
557
+ },
558
+ },
559
+ handler: async ({ agentId, versionId }) => await this.run(user, 'revert_agent', { agentId, ...(versionId ? { versionId } : {}) }, async () => {
560
+ const { projectId } = await this.resolveAgent(user, agentId);
561
+ await this.assertScope(user, projectId, 'agent:update');
562
+ const agent = versionId
563
+ ? await this.agentPublishService.revertToVersion(agentId, projectId, versionId, user, 'mcp')
564
+ : await this.agentPublishService.revertToPublishedAgent(agentId, projectId, user, 'mcp');
565
+ return {
566
+ ok: true,
567
+ agentId,
568
+ versionId: agent.versionId,
569
+ activeVersionId: agent.activeVersionId,
570
+ configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(agent)),
571
+ url: this.getAgentUrl(projectId, agentId),
572
+ };
573
+ }),
574
+ };
575
+ }
576
+ listAgentVersionsTool(user) {
577
+ return {
578
+ name: 'list_agent_versions',
579
+ config: {
580
+ description: 'List the publish history of an Agent, newest first. Pass a versionId to get_agent to inspect a version before revert_agent or publish_agent.',
581
+ inputSchema: listAgentVersionsInput,
582
+ annotations: {
583
+ title: 'List Agent Versions',
584
+ readOnlyHint: true,
585
+ destructiveHint: false,
586
+ idempotentHint: true,
587
+ openWorldHint: false,
588
+ },
589
+ },
590
+ handler: async ({ agentId, limit, offset }) => await this.run(user, 'list_agent_versions', { agentId }, async () => {
591
+ const { projectId } = await this.resolveAgent(user, agentId);
592
+ await this.assertScope(user, projectId, 'agent:read');
593
+ const versions = await this.agentPublishService.listPublishHistory(agentId, projectId, limit, offset);
594
+ return { ok: true, data: versions, count: versions.length };
595
+ }),
596
+ };
597
+ }
598
+ unpublishAgentTool(user) {
599
+ return {
600
+ name: 'unpublish_agent',
601
+ config: {
602
+ description: 'Unpublish an Agent and stop its live tasks and integrations.',
603
+ inputSchema: agentIdentityShape,
604
+ annotations: {
605
+ title: 'Unpublish Agent',
606
+ readOnlyHint: false,
607
+ destructiveHint: true,
608
+ idempotentHint: true,
609
+ openWorldHint: true,
610
+ },
611
+ },
612
+ handler: async ({ agentId }) => await this.run(user, 'unpublish_agent', { agentId }, async () => {
613
+ const { projectId } = await this.resolveAgent(user, agentId);
614
+ await this.assertScope(user, projectId, 'agent:unpublish');
615
+ const agent = await this.agentPublishService.unpublishAgent(agentId, projectId, user, 'mcp');
616
+ return {
617
+ ok: true,
618
+ agentId,
619
+ published: false,
620
+ versionId: agent.versionId,
621
+ activeVersionId: agent.activeVersionId,
622
+ };
623
+ }),
624
+ };
625
+ }
626
+ deleteAgentTool(user) {
627
+ return {
628
+ name: 'delete_agent',
629
+ config: {
630
+ description: 'Permanently delete an Agent and its associated resources.',
631
+ inputSchema: agentIdentityShape,
632
+ annotations: {
633
+ title: 'Delete Agent',
634
+ readOnlyHint: false,
635
+ destructiveHint: true,
636
+ idempotentHint: true,
637
+ openWorldHint: true,
638
+ },
639
+ },
640
+ handler: async ({ agentId }) => await this.run(user, 'delete_agent', { agentId }, async () => {
641
+ const { projectId } = await this.resolveAgent(user, agentId);
642
+ await this.assertScope(user, projectId, 'agent:delete');
643
+ const deleted = await this.agentsService.delete(agentId, projectId);
644
+ if (!deleted)
645
+ throw new n8n_workflow_1.UserError(`Agent "${agentId}" not found`);
646
+ return { ok: true, deleted: true, agentId };
647
+ }),
648
+ };
649
+ }
650
+ discoverAssetsTool(user) {
651
+ return {
652
+ name: 'discover_agent_assets',
653
+ config: {
654
+ description: 'Discover model catalogs, chat integrations, attachable workflows, published sub-agents, or MCP registry servers.',
655
+ inputSchema: discoverAssetsInput,
656
+ annotations: {
657
+ title: 'Discover Agent Assets',
658
+ readOnlyHint: true,
659
+ destructiveHint: false,
660
+ idempotentHint: true,
661
+ openWorldHint: true,
662
+ },
663
+ },
664
+ handler: async (input) => await this.run(user, 'discover_agent_assets', { projectId: input.projectId, kind: input.kind }, async () => {
665
+ await this.assertScope(user, input.projectId, 'agent:read');
666
+ return {
667
+ ok: true,
668
+ kind: input.kind,
669
+ data: await this.discoverAssets(user, input),
670
+ };
671
+ }),
672
+ };
673
+ }
674
+ verifyMcpServerTool(user) {
675
+ return {
676
+ name: 'verify_agent_mcp_server',
677
+ config: {
678
+ description: 'Test an MCP server with a user-accessible credential and return its available tools. Call before writing an mcpServers config entry; validate_agent performs no live MCP check.',
679
+ inputSchema: verifyMcpServerInput,
680
+ annotations: {
681
+ title: 'Verify Agent MCP Server',
682
+ readOnlyHint: true,
683
+ destructiveHint: false,
684
+ idempotentHint: true,
685
+ openWorldHint: true,
686
+ },
687
+ },
688
+ handler: async (input) => await this.run(user, 'verify_agent_mcp_server', { projectId: input.projectId, authentication: input.authentication }, async () => await this.verifyMcpServer(user, input)),
689
+ };
690
+ }
691
+ updateIntegrationTool(user) {
692
+ return {
693
+ name: 'update_agent_integration',
694
+ config: {
695
+ description: "Configure or disconnect a Slack, Telegram, or Linear conversation integration. This is the only way to manage integrations; config.replace and config.patch can't change them. Configuration never publishes the Agent. If the Agent is already published, connecting starts the channel immediately. Otherwise, the channel stays inactive until publish_agent is called.",
696
+ inputSchema: updateIntegrationInput,
697
+ annotations: {
698
+ title: 'Update Agent Integration',
699
+ readOnlyHint: false,
700
+ destructiveHint: true,
701
+ idempotentHint: true,
702
+ openWorldHint: true,
703
+ },
704
+ },
705
+ handler: async (input) => await this.run(user, 'update_agent_integration', {
706
+ agentId: input.agentId,
707
+ action: input.action,
708
+ type: input.type,
709
+ }, async () => await this.updateIntegration(user, input)),
710
+ };
711
+ }
712
+ referenceTool(user) {
713
+ return {
714
+ name: 'get_agent_builder_reference',
715
+ config: {
716
+ description: 'Return the required reference for Agent configuration and mutate_agent operations. Read before building an Agent.',
717
+ inputSchema: emptyInput,
718
+ annotations: {
719
+ title: 'Get Agent Builder Reference',
720
+ readOnlyHint: true,
721
+ destructiveHint: false,
722
+ idempotentHint: true,
723
+ openWorldHint: false,
724
+ },
725
+ },
726
+ handler: async () => await this.run(user, 'get_agent_builder_reference', {}, () => ({
727
+ ok: true,
728
+ uri: agent_reference_1.AGENT_BUILDER_REFERENCE_URI,
729
+ guide: agent_reference_1.AGENT_BUILDER_GUIDE,
730
+ configSchema: agent_reference_1.AGENT_CONFIG_JSON_SCHEMA,
731
+ })),
732
+ };
733
+ }
734
+ async getAgentSnapshot(user, agent) {
735
+ const { id: agentId, projectId } = agent;
736
+ const config = this.configFromEntity(agent);
737
+ const credentialProvider = this.credentialProvider(user, projectId);
738
+ const [runnable, skills, tasks] = await Promise.all([
739
+ this.agentValidationService.validateAgentIsRunnable(agentId, projectId, credentialProvider),
740
+ this.agentSkillsService.listSkills(agentId, projectId),
741
+ this.agentTaskService.list(agentId),
742
+ ]);
743
+ const taskEnabled = new Map((config.tasks ?? []).map((task) => [task.id, task.enabled]));
744
+ const { integrations: _integrations, ...editableConfig } = config;
745
+ return {
746
+ agent: {
747
+ id: agent.id,
748
+ name: agent.name,
749
+ projectId: agent.projectId,
750
+ published: agent.activeVersionId !== null,
751
+ versionId: agent.versionId,
752
+ activeVersionId: agent.activeVersionId,
753
+ createdAt: agent.createdAt.toISOString(),
754
+ updatedAt: agent.updatedAt.toISOString(),
755
+ },
756
+ config: editableConfig,
757
+ configHash: (0, agent_config_hash_1.getAgentConfigHash)(config),
758
+ isRunnable: runnable.missing.length === 0,
759
+ missing: runnable.missing,
760
+ skills,
761
+ tasks: tasks.map((task) => ({ ...task, enabled: taskEnabled.get(task.id) ?? false })),
762
+ customTools: Object.entries(agent.tools ?? {}).map(([id, tool]) => ({
763
+ id,
764
+ descriptor: tool.descriptor,
765
+ })),
766
+ integrations: agent.integrations ?? [],
767
+ };
768
+ }
769
+ async getAgentVersionSnapshot(projectId, agentId, versionId) {
770
+ const { agent, version, tasks } = await this.agentPublishService.getVersion(agentId, projectId, versionId);
771
+ if (!version.schema)
772
+ throw new n8n_workflow_1.UserError(`Version "${versionId}" has no JSON config.`);
773
+ const { integrations: _integrations, ...editableConfig } = version.schema;
774
+ return {
775
+ agent: {
776
+ id: agent.id,
777
+ name: agent.name,
778
+ projectId: agent.projectId,
779
+ published: agent.activeVersionId !== null,
780
+ versionId: agent.versionId,
781
+ activeVersionId: agent.activeVersionId,
782
+ },
783
+ version: {
784
+ versionId: version.versionId,
785
+ author: version.author,
786
+ createdAt: version.createdAt.toISOString(),
787
+ isActive: version.versionId === agent.activeVersionId,
788
+ },
789
+ config: editableConfig,
790
+ skills: version.skills ?? {},
791
+ tasks: tasks.map((task) => ({
792
+ id: task.taskId,
793
+ name: task.name,
794
+ objective: task.objective,
795
+ cronExpression: task.cronExpression,
796
+ enabled: task.enabled,
797
+ })),
798
+ customTools: Object.entries(version.tools ?? {}).map(([id, tool]) => ({
799
+ id,
800
+ descriptor: tool.descriptor,
801
+ })),
802
+ };
803
+ }
804
+ async fetchConfigHash(projectId, agentId) {
805
+ return (0, agent_config_hash_1.getAgentConfigHash)(await this.agentConfigService.getConfig(agentId, projectId));
806
+ }
807
+ configFromEntity(agent) {
808
+ const config = (0, agent_config_composition_1.composeJsonConfig)(agent);
809
+ if (!config)
810
+ throw new n8n_workflow_1.UserError('Agent has no JSON config yet.');
811
+ return config;
812
+ }
813
+ getAgentUrl(projectId, agentId) {
814
+ return `${this.urlService.getInstanceBaseUrl()}/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}`;
815
+ }
816
+ async applyMutation(user, input, config, projectId) {
817
+ const { agentId, operation } = input;
818
+ const telemetryContext = { user, modifiedBy: 'mcp' };
819
+ switch (operation.type) {
820
+ case 'config.replace': {
821
+ if (operation.config.integrations !== undefined) {
822
+ throw new n8n_workflow_1.UserError(INTEGRATIONS_NOT_IN_CONFIG_MESSAGE);
823
+ }
824
+ this.assertSanitizeStable(operation.config, config);
825
+ this.assertPassesConfigGuards(operation.config, config);
826
+ await this.assertAccessibleCredentials(operation.config, user, projectId);
827
+ const result = await this.agentConfigService.updateConfig(agentId, projectId, operation.config, user, { clearOmittedOptionalFields: true, modifiedBy: 'mcp' });
828
+ return { config: result.config };
829
+ }
830
+ case 'config.patch': {
831
+ const jsonpatch = (await import('fast-json-patch')).default;
832
+ const patchError = jsonpatch.validate(operation.patch, config);
833
+ if (patchError)
834
+ throw new n8n_workflow_1.UserError(patchError.message ?? 'Invalid JSON patch');
835
+ const patched = jsonpatch.applyPatch(jsonpatch.deepClone(config), operation.patch).newDocument;
836
+ if (integrationsChanged(config, patched)) {
837
+ throw new n8n_workflow_1.UserError(INTEGRATIONS_NOT_IN_CONFIG_MESSAGE);
838
+ }
839
+ this.assertSanitizeStable(patched, config);
840
+ this.assertPassesConfigGuards(patched, config);
841
+ await this.assertAccessibleCredentials(patched, user, projectId);
842
+ const result = await this.agentConfigService.updateConfig(agentId, projectId, patched, user, {
843
+ clearOmittedOptionalFields: true,
844
+ modifiedBy: 'mcp',
845
+ });
846
+ return { config: result.config };
847
+ }
848
+ case 'skill.upsert':
849
+ if (operation.skillId) {
850
+ const result = await this.agentSkillsService.updateSkill(agentId, projectId, operation.skillId, operation.skill, telemetryContext);
851
+ return { resource: { type: 'skill', id: result.id } };
852
+ }
853
+ else {
854
+ const result = await this.agentSkillsService.createAndAttachSkill(agentId, projectId, operation.skill, telemetryContext);
855
+ return { resource: { type: 'skill', id: result.id } };
856
+ }
857
+ case 'skill.delete':
858
+ await this.agentSkillsService.deleteSkill(agentId, projectId, operation.skillId, telemetryContext);
859
+ return { resource: { type: 'skill', id: operation.skillId } };
860
+ case 'task.upsert':
861
+ if (operation.taskId) {
862
+ const result = await this.agentTaskService.update(agentId, projectId, operation.taskId, operation.task, telemetryContext);
863
+ if (operation.enabled !== undefined) {
864
+ const updated = await this.setTaskEnabled(user, agentId, projectId, operation.taskId, operation.enabled, config);
865
+ return { resource: { type: 'task', id: result.id }, config: updated };
866
+ }
867
+ return { resource: { type: 'task', id: result.id } };
868
+ }
869
+ else {
870
+ const result = await this.agentTaskService.create(agentId, projectId, {
871
+ ...operation.task,
872
+ enabled: operation.enabled ?? true,
873
+ }, telemetryContext);
874
+ return { resource: { type: 'task', id: result.id } };
875
+ }
876
+ case 'task.delete':
877
+ await this.agentTaskService.delete(agentId, projectId, operation.taskId, telemetryContext);
878
+ return { resource: { type: 'task', id: operation.taskId } };
879
+ case 'customTool.upsert': {
880
+ const descriptor = await this.agentSecureRuntime.describeToolSecurely(operation.code);
881
+ const isAttached = (config.tools ?? []).some((tool) => tool.type === 'custom' && tool.id === descriptor.name);
882
+ const built = await this.agentCustomToolsService.buildCustomTool(agentId, projectId, operation.code, descriptor, telemetryContext, { recordTelemetry: isAttached });
883
+ if (isAttached) {
884
+ return { resource: { type: 'customTool', id: built.id }, config };
885
+ }
886
+ const next = {
887
+ ...config,
888
+ tools: [...(config.tools ?? []), { type: 'custom', id: built.id }],
889
+ };
890
+ await this.assertAccessibleCredentials(next, user, projectId);
891
+ const result = await this.agentConfigService.updateConfig(agentId, projectId, next, user, {
892
+ modifiedBy: 'mcp',
893
+ });
894
+ return { resource: { type: 'customTool', id: built.id }, config: result.config };
895
+ }
896
+ case 'customTool.delete':
897
+ await this.agentCustomToolsService.deleteCustomTool(agentId, projectId, operation.toolId, telemetryContext);
898
+ return { resource: { type: 'customTool', id: operation.toolId } };
899
+ }
900
+ }
901
+ assertSanitizeStable(config, baseConfig) {
902
+ const sanitized = (0, api_types_1.sanitizeAgentJsonConfig)(config);
903
+ if (JSON.stringify(sanitized) === JSON.stringify(config))
904
+ return;
905
+ if (!(0, is_record_1.isRecord)(config) || !(0, is_record_1.isRecord)(sanitized))
906
+ return;
907
+ const base = baseConfig;
908
+ const fields = Object.keys(config).filter((key) => {
909
+ const submitted = JSON.stringify(config[key]);
910
+ return (submitted !== JSON.stringify(sanitized[key]) && submitted !== JSON.stringify(base[key]));
911
+ });
912
+ if (fields.length === 0)
913
+ return;
914
+ throw new n8n_workflow_1.UserError(`Config contains entries the schema does not support (in: ${fields.join(', ')}); saving would silently drop them. Compare against the config schema from get_agent_builder_reference — e.g. sub-agents belong under subAgents.agents, not tools.`);
915
+ }
916
+ assertPassesConfigGuards(next, baseConfig) {
917
+ const parsed = api_types_1.AgentJsonConfigSchema.safeParse((0, api_types_1.sanitizeAgentJsonConfig)(next));
918
+ if (!parsed.success)
919
+ return;
920
+ const errors = (0, agent_config_1.rejectIfEmptyInstructions)(parsed.data, MCP_AGENT_CONFIG_MESSAGES) ??
921
+ (0, agent_config_1.rejectIfUnsupportedNativeWebSearch)(parsed.data) ??
922
+ (0, agent_config_1.rejectIfDynamicSelectorUsesFromAi)(parsed.data, baseConfig, this.nodeTypes, MCP_AGENT_CONFIG_MESSAGES);
923
+ if (errors) {
924
+ throw new n8n_workflow_1.UserError(errors.map((error) => `${error.path}: ${error.message}`).join('; '));
925
+ }
926
+ }
927
+ async assertAccessibleCredentials(config, user, projectId) {
928
+ const accessibleIds = new Set((await this.credentialProvider(user, projectId).list()).map((credential) => credential.id));
929
+ const sanitized = (0, sanitize_unknown_agent_credentials_1.sanitizeUnknownAgentCredentials)(config, accessibleIds);
930
+ if (JSON.stringify(sanitized) === JSON.stringify(config))
931
+ return;
932
+ const ids = new Set();
933
+ collectClearedCredentialIds(config, sanitized, ids);
934
+ throw new n8n_workflow_1.UserError(`Config references credentials you cannot use in this project: ${[...ids].join(', ')}. Saving would silently clear them. Use list_credentials to find an accessible credential, or remove the reference.`);
935
+ }
936
+ async setTaskEnabled(user, agentId, projectId, taskId, enabled, config) {
937
+ let found = false;
938
+ const tasks = (config.tasks ?? []).map((task) => {
939
+ if (task.id !== taskId)
940
+ return task;
941
+ found = true;
942
+ return { ...task, enabled };
943
+ });
944
+ if (!found)
945
+ throw new n8n_workflow_1.UserError(`Task "${taskId}" is not attached to the Agent`);
946
+ const next = { ...config, tasks };
947
+ await this.assertAccessibleCredentials(next, user, projectId);
948
+ const result = await this.agentConfigService.updateConfig(agentId, projectId, next, user, {
949
+ modifiedBy: 'mcp',
950
+ });
951
+ return result.config;
952
+ }
953
+ async validateAgent(user, agent) {
954
+ const projectId = agent.projectId;
955
+ const config = this.configFromEntity(agent);
956
+ const credentialProvider = this.credentialProvider(user, projectId);
957
+ const [schema, configuration] = await Promise.all([
958
+ this.agentConfigService.validateConfig(config),
959
+ this.agentValidationService.validateLoadedAgentConfiguration(agent, projectId, credentialProvider, 'publish'),
960
+ ]);
961
+ const errors = schema.valid ? [] : [schema.error];
962
+ const missing = [...new Set(configuration.issues.map((issue) => issue.path))];
963
+ return {
964
+ valid: errors.length === 0 && missing.length === 0,
965
+ errors,
966
+ missing,
967
+ };
968
+ }
969
+ async discoverAssets(user, input) {
970
+ switch (input.kind) {
971
+ case 'models': {
972
+ if (input.provider) {
973
+ return await this.agentModelCatalogService.getProviderModels(user, input.projectId, input.provider, input.credentialId);
974
+ }
975
+ const catalog = (0, model_catalog_1.filterOfferedAgentModelProviders)(await (await import('@n8n/agents')).fetchProviderCatalog());
976
+ return {
977
+ providers: Object.values(catalog).map((provider) => ({
978
+ provider: provider.id,
979
+ name: provider.name,
980
+ modelCount: Object.keys(provider.models).length,
981
+ })),
982
+ hint: 'Pass provider (and optionally credentialId) to list the models of one provider.',
983
+ };
984
+ }
985
+ case 'integrations':
986
+ return this.integrationPersistenceService.listChatIntegrations().map((integration) => ({
987
+ ...integration,
988
+ settingsRequired: integration.type === 'telegram',
989
+ ...(integration.type === 'telegram'
990
+ ? {
991
+ settingsSchema: TELEGRAM_SETTINGS_JSON_SCHEMA,
992
+ settingsGuidance: 'Pass accessMode=public with allowedUsers=[], or accessMode=private with at least one Telegram user ID or username.',
993
+ }
994
+ : {}),
995
+ }));
996
+ case 'workflows':
997
+ return await this.attachableWorkflowsService.list(user, input.projectId, input.query);
998
+ case 'subagents': {
999
+ const summaries = await this.agentsService.findSummariesInProjects([input.projectId], {
1000
+ query: input.query?.trim() || undefined,
1001
+ publishedOnly: true,
1002
+ excludeAgentId: input.excludeAgentId,
1003
+ });
1004
+ return summaries.map((agent) => ({ agentId: agent.id, name: agent.name }));
1005
+ }
1006
+ case 'mcpServers':
1007
+ return input.query
1008
+ ? await this.mcpRegistryService.search([input.query])
1009
+ : await this.mcpRegistryService.list(MCP_SERVER_DISCOVERY_LIMIT);
1010
+ }
1011
+ }
1012
+ async verifyMcpServer(user, input) {
1013
+ await this.assertScope(user, input.projectId, 'agent:read');
1014
+ const credentialProvider = this.credentialProvider(user, input.projectId);
1015
+ if (input.authentication !== 'none') {
1016
+ if (!input.credential) {
1017
+ throw new n8n_workflow_1.UserError('credential is required when authentication is not none');
1018
+ }
1019
+ await this.requireAccessibleCredential(credentialProvider, input.credential);
1020
+ }
1021
+ const tools = await (0, mcp_client_factory_1.listMcpServerTools)({
1022
+ name: input.name,
1023
+ url: input.url,
1024
+ transport: input.transport,
1025
+ authentication: input.authentication,
1026
+ credential: input.credential,
1027
+ ...(input.connectionTimeoutMs !== undefined
1028
+ ? { connectionTimeoutMs: input.connectionTimeoutMs }
1029
+ : {}),
1030
+ }, {
1031
+ credentialProvider,
1032
+ oauthService: this.oauthService,
1033
+ projectId: input.projectId,
1034
+ proxyFetch: (0, ai_proxy_fetch_1.createAiMcpFetch)(this.outboundHttp, this.ssrfConfig, this.ssrfProtectionService),
1035
+ });
1036
+ return { ok: true, tools };
1037
+ }
1038
+ async updateIntegration(user, input) {
1039
+ const agent = await this.resolveAgent(user, input.agentId);
1040
+ const projectId = agent.projectId;
1041
+ await this.assertScope(user, projectId, 'agent:update');
1042
+ return input.action === 'disconnect'
1043
+ ? await this.disconnectIntegration(user, input, agent)
1044
+ : await this.connectIntegration(user, input, agent, projectId);
1045
+ }
1046
+ async disconnectIntegration(user, input, agent) {
1047
+ const persisted = (agent.integrations ?? []).find((item) => item.type === input.type && item.credentialId === input.credentialId);
1048
+ const parsed = api_types_1.AgentIntegrationSchema.safeParse({
1049
+ type: input.type,
1050
+ credentialId: input.credentialId,
1051
+ });
1052
+ const integration = persisted ?? (parsed.success ? parsed.data : undefined);
1053
+ if (integration) {
1054
+ await this.chatIntegrationService.disconnectChannel(input.agentId, integration);
1055
+ }
1056
+ else {
1057
+ await this.chatIntegrationService.disconnect(input.agentId, {
1058
+ type: input.type,
1059
+ credentialId: input.credentialId,
1060
+ });
1061
+ }
1062
+ const saved = await this.integrationPersistenceService.removeCredentialIntegration(agent, input.type, input.credentialId, { user, modifiedBy: 'mcp', broadcast: false });
1063
+ return {
1064
+ ok: true,
1065
+ agentId: input.agentId,
1066
+ integration: { type: input.type, credentialId: input.credentialId },
1067
+ connected: false,
1068
+ published: saved.activeVersionId !== null,
1069
+ activeVersionId: saved.activeVersionId,
1070
+ configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(saved)),
1071
+ };
1072
+ }
1073
+ async connectIntegration(user, input, agent, projectId) {
1074
+ const candidate = {
1075
+ type: input.type,
1076
+ credentialId: input.credentialId,
1077
+ ...(input.settings ? { settings: input.settings } : {}),
1078
+ };
1079
+ const parsed = api_types_1.AgentIntegrationSchema.safeParse(candidate);
1080
+ if (!parsed.success)
1081
+ throw new n8n_workflow_1.UserError(`Invalid integration: ${parsed.error.message}`);
1082
+ if (parsed.data.type === 'telegram' && !parsed.data.settings) {
1083
+ throw new n8n_workflow_1.UserError('Telegram integration settings are required');
1084
+ }
1085
+ const credential = await this.requireAccessibleCredential(this.credentialProvider(user, projectId), input.credentialId);
1086
+ const implementation = this.chatIntegrationRegistry.require(parsed.data.type);
1087
+ if (!implementation.credentialTypes.includes(credential.type)) {
1088
+ throw new n8n_workflow_1.UserError(`${implementation.displayLabel} integrations do not support ${credential.type} credentials`);
1089
+ }
1090
+ const saved = await this.integrationPersistenceService.saveCredentialIntegration(agent, parsed.data, { user, modifiedBy: 'mcp', broadcast: false });
1091
+ const result = {
1092
+ ok: true,
1093
+ agentId: input.agentId,
1094
+ integration: { type: input.type, credentialId: input.credentialId },
1095
+ configured: true,
1096
+ published: saved.activeVersionId !== null,
1097
+ activeVersionId: saved.activeVersionId,
1098
+ configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(saved)),
1099
+ };
1100
+ if (saved.activeVersionId === null)
1101
+ return { ...result, connected: false };
1102
+ await this.chatIntegrationService.connect(input.agentId, parsed.data, projectId);
1103
+ await this.chatIntegrationService.broadcastIntegrationChange(input.agentId, parsed.data, 'connect');
1104
+ return {
1105
+ ...result,
1106
+ connected: true,
1107
+ };
1108
+ }
1109
+ credentialProvider(user, projectId) {
1110
+ return (0, agent_credential_provider_1.createAgentCredentialProvider)(this.credentialsService, projectId, user);
1111
+ }
1112
+ async requireAccessibleCredential(credentialProvider, credentialId) {
1113
+ const credential = (await credentialProvider.list()).find((item) => item.id === credentialId);
1114
+ if (!credential)
1115
+ throw new n8n_workflow_1.UserError('Credential not found or not accessible');
1116
+ return credential;
1117
+ }
1118
+ async resolveAgent(user, agentId) {
1119
+ const agent = await this.agentsService.findByIdForUser(agentId, user);
1120
+ if (!agent)
1121
+ throw new n8n_workflow_1.UserError(`Agent "${agentId}" not found`);
1122
+ if (!agent.availableInMCP) {
1123
+ throw new n8n_workflow_1.UserError('Agent is not available in MCP. Enable MCP access from the agents list, or from the MCP settings page.');
1124
+ }
1125
+ return agent;
1126
+ }
1127
+ async assertScope(user, projectId, scope) {
1128
+ if (!(await (0, check_access_1.userHasScopes)(user, [scope], false, { projectId }))) {
1129
+ throw new forbidden_error_1.ForbiddenError('You do not have permission to access agents in this project.');
1130
+ }
1131
+ }
1132
+ async run(user, toolName, parameters, action) {
1133
+ const telemetryPayload = {
1134
+ user_id: user.id,
1135
+ tool_name: toolName,
1136
+ parameters,
1137
+ };
1138
+ try {
1139
+ const data = await action();
1140
+ telemetryPayload.results = { success: data.ok !== false };
1141
+ this.telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
1142
+ return toolResult(data, data.ok === false);
1143
+ }
1144
+ catch (error) {
1145
+ const message = error instanceof Error ? error.message : String(error);
1146
+ telemetryPayload.results = { success: false, error: message };
1147
+ this.telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
1148
+ return toolResult({ ok: false, code: 'agent_tool_error', error: message }, true);
1149
+ }
1150
+ }
1151
+ };
1152
+ exports.McpAgentToolsService = McpAgentToolsService;
1153
+ exports.McpAgentToolsService = McpAgentToolsService = __decorate([
1154
+ (0, di_1.Service)(),
1155
+ __metadata("design:paramtypes", [telemetry_1.Telemetry, credentials_service_1.CredentialsService, agents_service_1.AgentsService, agent_config_service_1.AgentConfigService, agent_validation_service_1.AgentValidationService, agent_publish_service_1.AgentPublishService, agent_skills_service_1.AgentSkillsService, agent_task_service_1.AgentTaskService, agent_custom_tools_service_1.AgentCustomToolsService, agent_secure_runtime_1.AgentSecureRuntime, agent_integration_persistence_service_1.AgentIntegrationPersistenceService, chat_integration_service_1.ChatIntegrationService, agent_chat_integration_1.ChatIntegrationRegistry, agent_model_catalog_service_1.AgentModelCatalogService, attachable_workflows_service_1.AttachableWorkflowsService, mcp_registry_service_1.McpRegistryService, node_types_1.NodeTypes, oauth_service_1.OauthService, backend_network_1.OutboundHttp, config_1.SsrfProtectionConfig, backend_network_1.SsrfProtectionService, url_service_1.UrlService, project_scope_service_1.ProjectScopeService])
1156
+ ], McpAgentToolsService);
1157
+ //# sourceMappingURL=agent-tools.service.js.map