n8n 2.34.4 → 2.35.1

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 (677) hide show
  1. package/dist/active-workflow-manager.js +2 -14
  2. package/dist/active-workflow-manager.js.map +1 -1
  3. package/dist/agent-library-bundle.js +6 -6
  4. package/dist/build.tsbuildinfo +1 -1
  5. package/dist/controllers/ai.controller.js +3 -0
  6. package/dist/controllers/ai.controller.js.map +1 -1
  7. package/dist/controllers/role.controller.d.ts +0 -1
  8. package/dist/controllers/role.controller.js +6 -14
  9. package/dist/controllers/role.controller.js.map +1 -1
  10. package/dist/credentials/credentials.controller.d.ts +1 -1
  11. package/dist/credentials/credentials.controller.js +7 -1
  12. package/dist/credentials/credentials.controller.js.map +1 -1
  13. package/dist/credentials/credentials.service.d.ts +2 -1
  14. package/dist/credentials/credentials.service.js +24 -0
  15. package/dist/credentials/credentials.service.js.map +1 -1
  16. package/dist/credentials-helper.js +4 -7
  17. package/dist/credentials-helper.js.map +1 -1
  18. package/dist/deprecation/deprecation.service.js +5 -0
  19. package/dist/deprecation/deprecation.service.js.map +1 -1
  20. package/dist/eventbus/event-message-classes/index.js.map +1 -1
  21. package/dist/events/maps/relay.event-map.d.ts +9 -0
  22. package/dist/events/relays/telemetry.event-relay.d.ts +4 -2
  23. package/dist/events/relays/telemetry.event-relay.js +23 -7
  24. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  25. package/dist/execution-lifecycle/execute-error-workflow.js +19 -5
  26. package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
  27. package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
  28. package/dist/executions/execution-persistence.d.ts +6 -4
  29. package/dist/executions/execution-persistence.js +7 -14
  30. package/dist/executions/execution-persistence.js.map +1 -1
  31. package/dist/executions/execution.service.d.ts +31 -2
  32. package/dist/executions/execution.service.js +108 -1
  33. package/dist/executions/execution.service.js.map +1 -1
  34. package/dist/middlewares/body-parser.js +3 -2
  35. package/dist/middlewares/body-parser.js.map +1 -1
  36. package/dist/middlewares/cors.js +1 -1
  37. package/dist/middlewares/cors.js.map +1 -1
  38. package/dist/modules/agent-evals/agent-eval-rating.service.d.ts +12 -15
  39. package/dist/modules/agent-evals/agent-eval-rating.service.js +33 -46
  40. package/dist/modules/agent-evals/agent-eval-rating.service.js.map +1 -1
  41. package/dist/modules/agent-evals/agent-eval-record-mappers.d.ts +3 -2
  42. package/dist/modules/agent-evals/agent-eval-record-mappers.js +13 -0
  43. package/dist/modules/agent-evals/agent-eval-record-mappers.js.map +1 -1
  44. package/dist/modules/agent-evals/agent-eval-runner.service.js +15 -7
  45. package/dist/modules/agent-evals/agent-eval-runner.service.js.map +1 -1
  46. package/dist/modules/agent-evals/agent-eval.service.d.ts +8 -3
  47. package/dist/modules/agent-evals/agent-eval.service.js +6 -6
  48. package/dist/modules/agent-evals/agent-eval.service.js.map +1 -1
  49. package/dist/modules/agent-evals/agent-evals-required-modules.js +2 -2
  50. package/dist/modules/agent-evals/agent-evals-required-modules.js.map +1 -1
  51. package/dist/modules/agent-evals/agent-evals.controller.d.ts +12 -4
  52. package/dist/modules/agent-evals/agent-evals.controller.js +50 -9
  53. package/dist/modules/agent-evals/agent-evals.controller.js.map +1 -1
  54. package/dist/modules/agents/agent-chat.controller.d.ts +3 -5
  55. package/dist/modules/agents/agent-chat.controller.js +19 -25
  56. package/dist/modules/agents/agent-chat.controller.js.map +1 -1
  57. package/dist/modules/agents/agent-config.service.d.ts +5 -1
  58. package/dist/modules/agents/agent-config.service.js +10 -3
  59. package/dist/modules/agents/agent-config.service.js.map +1 -1
  60. package/dist/modules/agents/agent-credential-index.listener.d.ts +11 -0
  61. package/dist/modules/agents/agent-credential-index.listener.js +55 -0
  62. package/dist/modules/agents/agent-credential-index.listener.js.map +1 -0
  63. package/dist/modules/agents/agent-credential-index.service.d.ts +14 -0
  64. package/dist/modules/agents/agent-credential-index.service.js +57 -0
  65. package/dist/modules/agents/agent-credential-index.service.js.map +1 -0
  66. package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +5 -0
  67. package/dist/modules/agents/agent-execution-orchestrator.service.js +89 -23
  68. package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
  69. package/dist/modules/agents/agent-execution-update-broadcaster.d.ts +20 -0
  70. package/dist/modules/agents/agent-execution-update-broadcaster.js +65 -0
  71. package/dist/modules/agents/agent-execution-update-broadcaster.js.map +1 -0
  72. package/dist/modules/agents/agent-execution.service.d.ts +30 -4
  73. package/dist/modules/agents/agent-execution.service.js +217 -46
  74. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  75. package/dist/modules/agents/agent-integration-management.service.d.ts +33 -0
  76. package/dist/modules/agents/agent-integration-management.service.js +80 -0
  77. package/dist/modules/agents/agent-integration-management.service.js.map +1 -0
  78. package/dist/modules/agents/agent-integration-persistence.service.d.ts +3 -1
  79. package/dist/modules/agents/agent-integration-persistence.service.js +6 -2
  80. package/dist/modules/agents/agent-integration-persistence.service.js.map +1 -1
  81. package/dist/modules/agents/agent-integrations.controller.d.ts +4 -24
  82. package/dist/modules/agents/agent-integrations.controller.js +28 -114
  83. package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
  84. package/dist/modules/agents/agent-interrupted-execution-sweeper.d.ts +11 -0
  85. package/dist/modules/agents/agent-interrupted-execution-sweeper.js +63 -0
  86. package/dist/modules/agents/agent-interrupted-execution-sweeper.js.map +1 -0
  87. package/dist/modules/agents/agent-model-catalog.service.d.ts +1 -0
  88. package/dist/modules/agents/agent-model-catalog.service.js +37 -8
  89. package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
  90. package/dist/modules/agents/agent-publish.service.d.ts +3 -1
  91. package/dist/modules/agents/agent-publish.service.js +8 -2
  92. package/dist/modules/agents/agent-publish.service.js.map +1 -1
  93. package/dist/modules/agents/agent-run-tracing.service.d.ts +1 -0
  94. package/dist/modules/agents/agent-run-tracing.service.js +4 -1
  95. package/dist/modules/agents/agent-run-tracing.service.js.map +1 -1
  96. package/dist/modules/agents/agent-runtime-cache.service.js +1 -1
  97. package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
  98. package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +3 -1
  99. package/dist/modules/agents/agent-runtime-reconstruction.service.js +14 -8
  100. package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
  101. package/dist/modules/agents/agent-slack-integrations.controller.d.ts +23 -0
  102. package/dist/modules/agents/agent-slack-integrations.controller.js +98 -0
  103. package/dist/modules/agents/agent-slack-integrations.controller.js.map +1 -0
  104. package/dist/modules/agents/agent-test-run.service.d.ts +134 -0
  105. package/dist/modules/agents/agent-test-run.service.js +240 -0
  106. package/dist/modules/agents/agent-test-run.service.js.map +1 -0
  107. package/dist/modules/agents/agent-validation.service.d.ts +1 -0
  108. package/dist/modules/agents/agent-validation.service.js +32 -13
  109. package/dist/modules/agents/agent-validation.service.js.map +1 -1
  110. package/dist/modules/agents/agent-workflow-execution.service.d.ts +5 -1
  111. package/dist/modules/agents/agent-workflow-execution.service.js +137 -64
  112. package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
  113. package/dist/modules/agents/agents-config.controller.d.ts +8 -0
  114. package/dist/modules/agents/agents.module.d.ts +3 -1
  115. package/dist/modules/agents/agents.module.js +35 -1
  116. package/dist/modules/agents/agents.module.js.map +1 -1
  117. package/dist/modules/agents/agents.service.d.ts +4 -2
  118. package/dist/modules/agents/agents.service.js +6 -2
  119. package/dist/modules/agents/agents.service.js.map +1 -1
  120. package/dist/modules/agents/attachable-workflows.service.d.ts +1 -0
  121. package/dist/modules/agents/attachable-workflows.service.js +2 -1
  122. package/dist/modules/agents/attachable-workflows.service.js.map +1 -1
  123. package/dist/modules/agents/builder/agents-builder-prompts.d.ts +2 -2
  124. package/dist/modules/agents/builder/agents-builder-prompts.js +26 -7
  125. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
  126. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +4 -2
  127. package/dist/modules/agents/builder/agents-builder-tools.service.js +130 -2
  128. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  129. package/dist/modules/agents/builder/builder-model-live-lookup.service.d.ts +16 -1
  130. package/dist/modules/agents/builder/builder-model-live-lookup.service.js +69 -22
  131. package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
  132. package/dist/modules/agents/builder/builder-tool-names.d.ts +1 -0
  133. package/dist/modules/agents/builder/builder-tool-names.js +1 -0
  134. package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
  135. package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +1 -0
  136. package/dist/modules/agents/builder/interactive/finish-setup.tool.js +4 -2
  137. package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
  138. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +68 -2
  139. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  140. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +1 -0
  141. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
  142. package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
  143. package/dist/modules/agents/builder/prompts/tools.prompt.js +5 -2
  144. package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
  145. package/dist/modules/agents/builder/skills/external-services.skill.js +26 -2
  146. package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
  147. package/dist/modules/agents/entities/agent-credential-dependency.entity.d.ts +9 -0
  148. package/dist/modules/agents/entities/agent-credential-dependency.entity.js +40 -0
  149. package/dist/modules/agents/entities/agent-credential-dependency.entity.js.map +1 -0
  150. package/dist/modules/agents/entities/agent-execution.entity.d.ts +1 -1
  151. package/dist/modules/agents/entities/agent-execution.entity.js +2 -1
  152. package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
  153. package/dist/modules/agents/execution-recorder.d.ts +7 -1
  154. package/dist/modules/agents/execution-recorder.js +64 -8
  155. package/dist/modules/agents/execution-recorder.js.map +1 -1
  156. package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +6 -2
  157. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +24 -3
  158. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
  159. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +3 -2
  160. package/dist/modules/agents/integrations/agent-chat-bridge.js +30 -13
  161. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  162. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +3 -2
  163. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +25 -12
  164. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
  165. package/dist/modules/agents/integrations/agent-chat-integration.d.ts +38 -6
  166. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
  167. package/dist/modules/agents/integrations/agent-chat-message-context.js +13 -6
  168. package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
  169. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +7 -1
  170. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
  171. package/dist/modules/agents/integrations/callback-store.d.ts +13 -4
  172. package/dist/modules/agents/integrations/callback-store.js +44 -18
  173. package/dist/modules/agents/integrations/callback-store.js.map +1 -1
  174. package/dist/modules/agents/integrations/chat-integration.service.d.ts +7 -3
  175. package/dist/modules/agents/integrations/chat-integration.service.js +59 -22
  176. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  177. package/dist/modules/agents/integrations/component-mapper.d.ts +1 -1
  178. package/dist/modules/agents/integrations/component-mapper.js +1 -1
  179. package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
  180. package/dist/modules/agents/integrations/esm-loader.d.ts +1 -0
  181. package/dist/modules/agents/integrations/esm-loader.js +4 -0
  182. package/dist/modules/agents/integrations/esm-loader.js.map +1 -1
  183. package/dist/modules/agents/integrations/integration-action-executor.d.ts +2 -0
  184. package/dist/modules/agents/integrations/integration-action-executor.js +74 -20
  185. package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
  186. package/dist/modules/agents/integrations/integration-tool-definitions.js +35 -2
  187. package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
  188. package/dist/modules/agents/integrations/integration-tool-execution.js +10 -5
  189. package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
  190. package/dist/modules/agents/integrations/integration-tool-schema.js +8 -2
  191. package/dist/modules/agents/integrations/integration-tool-schema.js.map +1 -1
  192. package/dist/modules/agents/integrations/integration-tool-types.d.ts +2 -0
  193. package/dist/modules/agents/integrations/n8n-memory.js +6 -7
  194. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
  195. package/dist/modules/agents/integrations/platforms/discord-gateway.d.ts +32 -0
  196. package/dist/modules/agents/integrations/platforms/discord-gateway.js +138 -0
  197. package/dist/modules/agents/integrations/platforms/discord-gateway.js.map +1 -0
  198. package/dist/modules/agents/integrations/platforms/discord-integration.d.ts +73 -0
  199. package/dist/modules/agents/integrations/platforms/discord-integration.js +364 -0
  200. package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -0
  201. package/dist/modules/agents/integrations/platforms/discord-operations.d.ts +64 -0
  202. package/dist/modules/agents/integrations/platforms/discord-operations.js +176 -0
  203. package/dist/modules/agents/integrations/platforms/discord-operations.js.map +1 -0
  204. package/dist/modules/agents/integrations/platforms/{slack-bridge-behavior.d.ts → slack/slack-bridge-behavior.d.ts} +3 -3
  205. package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js.map +1 -0
  206. package/dist/modules/agents/integrations/platforms/{slack-integration.d.ts → slack/slack-integration.d.ts} +11 -6
  207. package/dist/modules/agents/integrations/platforms/{slack-integration.js → slack/slack-integration.js} +32 -23
  208. package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -0
  209. package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.d.ts +35 -0
  210. package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.js +150 -0
  211. package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.js.map +1 -0
  212. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.d.ts +36 -0
  213. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +193 -0
  214. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -0
  215. package/dist/modules/agents/integrations/platforms/slack/slack-operations.d.ts +10 -0
  216. package/dist/modules/agents/integrations/platforms/{slack-operations.js → slack/slack-operations.js} +1 -57
  217. package/dist/modules/agents/integrations/platforms/slack/slack-operations.js.map +1 -0
  218. package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js +6 -36
  219. package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js.map +1 -1
  220. package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +3 -2
  221. package/dist/modules/agents/integrations/platforms/telegram-integration.js +14 -5
  222. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
  223. package/dist/modules/agents/integrations/platforms/typing-indicator.d.ts +9 -0
  224. package/dist/modules/agents/integrations/platforms/typing-indicator.js +42 -0
  225. package/dist/modules/agents/integrations/platforms/typing-indicator.js.map +1 -0
  226. package/dist/modules/agents/integrations/recording/recording-adapter.js +11 -0
  227. package/dist/modules/agents/integrations/recording/recording-adapter.js.map +1 -1
  228. package/dist/modules/agents/json-config/node-tool-ai-gateway.service.d.ts +9 -0
  229. package/dist/modules/agents/json-config/node-tool-ai-gateway.service.js +34 -0
  230. package/dist/modules/agents/json-config/node-tool-ai-gateway.service.js.map +1 -0
  231. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.d.ts +4 -0
  232. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js +152 -0
  233. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js.map +1 -0
  234. package/dist/modules/agents/repositories/agent-credential-dependency.repository.d.ts +12 -0
  235. package/dist/modules/agents/repositories/agent-credential-dependency.repository.js +92 -0
  236. package/dist/modules/agents/repositories/agent-credential-dependency.repository.js.map +1 -0
  237. package/dist/modules/agents/repositories/agent-execution.repository.d.ts +7 -0
  238. package/dist/modules/agents/repositories/agent-execution.repository.js +20 -0
  239. package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
  240. package/dist/modules/agents/repositories/agent.repository.d.ts +2 -0
  241. package/dist/modules/agents/repositories/agent.repository.js +18 -0
  242. package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
  243. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +2 -0
  244. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +69 -5
  245. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
  246. package/dist/modules/agents/tools/node-tool-factory.js +5 -1
  247. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
  248. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +7 -4
  249. package/dist/modules/agents/tools/workflow-tool-factory.js +86 -41
  250. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  251. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.d.ts +14 -0
  252. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js +50 -0
  253. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js.map +1 -0
  254. package/dist/modules/agents/tools/workflow-tool-workflow-resolver.d.ts +3 -3
  255. package/dist/modules/agents/tools/workflow-tool-workflow-resolver.js +28 -23
  256. package/dist/modules/agents/tools/workflow-tool-workflow-resolver.js.map +1 -1
  257. package/dist/modules/agents/utils/extract-agent-credential-ids.d.ts +1 -0
  258. package/dist/modules/agents/utils/extract-agent-credential-ids.js +41 -0
  259. package/dist/modules/agents/utils/extract-agent-credential-ids.js.map +1 -0
  260. package/dist/modules/agents/utils/node-tool-validation.js +2 -2
  261. package/dist/modules/agents/utils/node-tool-validation.js.map +1 -1
  262. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.d.ts +6 -2
  263. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js +26 -3
  264. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js.map +1 -1
  265. package/dist/modules/data-table/data-table-permissions.d.ts +5 -0
  266. package/dist/modules/data-table/data-table-permissions.js +14 -0
  267. package/dist/modules/data-table/data-table-permissions.js.map +1 -0
  268. package/dist/modules/data-table/data-table-proxy.service.js +2 -0
  269. package/dist/modules/data-table/data-table-proxy.service.js.map +1 -1
  270. package/dist/modules/data-table/data-table.controller.d.ts +1 -1
  271. package/dist/modules/data-table/data-table.controller.js +7 -19
  272. package/dist/modules/data-table/data-table.controller.js.map +1 -1
  273. package/dist/modules/data-table/data-table.service.d.ts +3 -0
  274. package/dist/modules/data-table/data-table.service.js.map +1 -1
  275. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +1 -0
  276. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +8 -0
  277. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
  278. package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.d.ts +1 -0
  279. package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js +100 -3
  280. package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js.map +1 -1
  281. package/dist/modules/external-secrets.ee/providers/azure-key-vault/types.d.ts +4 -0
  282. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.d.ts +2 -1
  283. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js +11 -5
  284. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js.map +1 -1
  285. package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +6 -3
  286. package/dist/modules/insights/database/repositories/insights-by-period.repository.js +31 -11
  287. package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
  288. package/dist/modules/insights/insights.controller.js +13 -7
  289. package/dist/modules/insights/insights.controller.js.map +1 -1
  290. package/dist/modules/insights/insights.service.d.ts +6 -3
  291. package/dist/modules/insights/insights.service.js +6 -3
  292. package/dist/modules/insights/insights.service.js.map +1 -1
  293. package/dist/modules/instance-ai/eval/agent-execution.service.js +10 -3
  294. package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
  295. package/dist/modules/instance-ai/eval/execution.service.d.ts +1 -0
  296. package/dist/modules/instance-ai/eval/execution.service.js +37 -3
  297. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  298. package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +5 -1
  299. package/dist/modules/instance-ai/eval/thread-restore.service.js +67 -9
  300. package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
  301. package/dist/modules/instance-ai/instance-ai-credit-display.d.ts +9 -0
  302. package/dist/modules/instance-ai/instance-ai-credit-display.js +15 -0
  303. package/dist/modules/instance-ai/instance-ai-credit-display.js.map +1 -0
  304. package/dist/modules/instance-ai/instance-ai-credit.service.d.ts +11 -1
  305. package/dist/modules/instance-ai/instance-ai-credit.service.js +52 -9
  306. package/dist/modules/instance-ai/instance-ai-credit.service.js.map +1 -1
  307. package/dist/modules/instance-ai/instance-ai-model-catalog.service.d.ts +15 -0
  308. package/dist/modules/instance-ai/instance-ai-model-catalog.service.js +130 -0
  309. package/dist/modules/instance-ai/instance-ai-model-catalog.service.js.map +1 -0
  310. package/dist/modules/instance-ai/instance-ai-model.service.d.ts +2 -4
  311. package/dist/modules/instance-ai/instance-ai-model.service.js.map +1 -1
  312. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +19 -1
  313. package/dist/modules/instance-ai/instance-ai-settings.service.js +240 -24
  314. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  315. package/dist/modules/instance-ai/instance-ai-verification.service.d.ts +20 -0
  316. package/dist/modules/instance-ai/instance-ai-verification.service.js +232 -0
  317. package/dist/modules/instance-ai/instance-ai-verification.service.js.map +1 -0
  318. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +4 -0
  319. package/dist/modules/instance-ai/instance-ai.adapter.service.js +78 -4
  320. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  321. package/dist/modules/instance-ai/instance-ai.controller.d.ts +10 -6
  322. package/dist/modules/instance-ai/instance-ai.controller.js +84 -2
  323. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  324. package/dist/modules/instance-ai/instance-ai.module.d.ts +3 -1
  325. package/dist/modules/instance-ai/instance-ai.module.js +4 -7
  326. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  327. package/dist/modules/instance-ai/instance-ai.service.d.ts +7 -6
  328. package/dist/modules/instance-ai/instance-ai.service.js +238 -63
  329. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  330. package/dist/modules/instance-ai/node-definition-resolver.d.ts +0 -1
  331. package/dist/modules/instance-ai/node-definition-resolver.js +0 -19
  332. package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
  333. package/dist/modules/instance-ai/repositories/instance-ai-message.repository.d.ts +1 -0
  334. package/dist/modules/instance-ai/repositories/instance-ai-message.repository.js +10 -0
  335. package/dist/modules/instance-ai/repositories/instance-ai-message.repository.js.map +1 -1
  336. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.d.ts +1 -0
  337. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +37 -2
  338. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
  339. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +6 -6
  340. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -1
  341. package/dist/modules/instance-ai/suspended-run-restorer.service.d.ts +1 -1
  342. package/dist/modules/instance-ai/suspended-run-restorer.service.js +9 -0
  343. package/dist/modules/instance-ai/suspended-run-restorer.service.js.map +1 -1
  344. package/dist/modules/mcp/mcp-protected-resource.d.ts +3 -4
  345. package/dist/modules/mcp/mcp-protected-resource.js +4 -4
  346. package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
  347. package/dist/modules/mcp/mcp-scopes.js +2 -0
  348. package/dist/modules/mcp/mcp-scopes.js.map +1 -1
  349. package/dist/modules/mcp/mcp-server-middleware.service.js +1 -0
  350. package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
  351. package/dist/modules/mcp/mcp.constants.d.ts +4 -0
  352. package/dist/modules/mcp/mcp.constants.js +5 -1
  353. package/dist/modules/mcp/mcp.constants.js.map +1 -1
  354. package/dist/modules/mcp/mcp.controller.js +14 -14
  355. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  356. package/dist/modules/mcp/mcp.service.d.ts +4 -3
  357. package/dist/modules/mcp/mcp.service.js +49 -34
  358. package/dist/modules/mcp/mcp.service.js.map +1 -1
  359. package/dist/modules/mcp/mcp.types.d.ts +31 -5
  360. package/dist/modules/mcp/mcp.types.js.map +1 -1
  361. package/dist/modules/mcp/mcp.utils.d.ts +1 -0
  362. package/dist/modules/mcp/mcp.utils.js +22 -5
  363. package/dist/modules/mcp/mcp.utils.js.map +1 -1
  364. package/dist/modules/mcp/tool-schema.util.d.ts +3 -0
  365. package/dist/modules/mcp/tool-schema.util.js +32 -0
  366. package/dist/modules/mcp/tool-schema.util.js.map +1 -0
  367. package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
  368. package/dist/modules/mcp/tools/agents/agent-reference.js +17 -6
  369. package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -1
  370. package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +9 -8
  371. package/dist/modules/mcp/tools/agents/agent-tools.service.js +207 -52
  372. package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
  373. package/dist/modules/mcp/tools/execute-workflow.tool.js +1 -1
  374. package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
  375. package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +4 -1
  376. package/dist/modules/mcp/tools/get-workflow-details.tool.js +60 -23
  377. package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
  378. package/dist/modules/mcp/tools/list-credentials.tool.js +1 -1
  379. package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
  380. package/dist/modules/mcp/tools/schemas.d.ts +81 -40
  381. package/dist/modules/mcp/tools/schemas.js +31 -11
  382. package/dist/modules/mcp/tools/schemas.js.map +1 -1
  383. package/dist/modules/mcp/tools/search-workflows.tool.js +1 -9
  384. package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
  385. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.d.ts +1 -1
  386. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +2 -7
  387. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -1
  388. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +2 -11
  389. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
  390. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +2 -2
  391. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +2 -1
  392. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
  393. package/dist/modules/mcp-registry/registry/mcp-registry-search.d.ts +1 -0
  394. package/dist/modules/mcp-registry/registry/mcp-registry-search.js +17 -5
  395. package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -1
  396. package/dist/modules/n8n-packages/engine/import-blocked.error.js +2 -0
  397. package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
  398. package/dist/modules/n8n-packages/engine/import-gates.d.ts +3 -4
  399. package/dist/modules/n8n-packages/engine/import-gates.js +10 -8
  400. package/dist/modules/n8n-packages/engine/import-gates.js.map +1 -1
  401. package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +6 -2
  402. package/dist/modules/n8n-packages/engine/import-orchestrator.js +36 -8
  403. package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
  404. package/dist/modules/n8n-packages/engine/import-result.d.ts +2 -0
  405. package/dist/modules/n8n-packages/engine/import-result.js +13 -2
  406. package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
  407. package/dist/modules/n8n-packages/engine/import-telemetry.js +8 -2
  408. package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
  409. package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +3 -0
  410. package/dist/modules/n8n-packages/engine/n8n-package-parser.js +29 -0
  411. package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
  412. package/dist/modules/n8n-packages/engine/package-layout.d.ts +18 -1
  413. package/dist/modules/n8n-packages/engine/package-layout.js +36 -7
  414. package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -1
  415. package/dist/modules/n8n-packages/engine/project-package-importer.js +28 -16
  416. package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
  417. package/dist/modules/n8n-packages/engine/workflow-package-importer.js +12 -12
  418. package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
  419. package/dist/modules/n8n-packages/entities/project/project-conflict-policy.d.ts +7 -0
  420. package/dist/modules/n8n-packages/entities/project/project-conflict-policy.js +12 -0
  421. package/dist/modules/n8n-packages/entities/project/project-conflict-policy.js.map +1 -0
  422. package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +13 -3
  423. package/dist/modules/n8n-packages/entities/project/project-importer.d.ts +3 -3
  424. package/dist/modules/n8n-packages/entities/project/project-importer.js +58 -29
  425. package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
  426. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.d.ts +4 -1
  427. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js +10 -3
  428. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js.map +1 -1
  429. package/dist/modules/n8n-packages/entities/tag/tag-importer.d.ts +1 -4
  430. package/dist/modules/n8n-packages/entities/tag/tag-importer.js +22 -10
  431. package/dist/modules/n8n-packages/entities/tag/tag-importer.js.map +1 -1
  432. package/dist/modules/n8n-packages/entities/tag/tag.types.d.ts +13 -0
  433. package/dist/modules/n8n-packages/entities/tag/tag.types.js +36 -0
  434. package/dist/modules/n8n-packages/entities/tag/tag.types.js.map +1 -1
  435. package/dist/modules/n8n-packages/entities/variable/variable-importer.d.ts +6 -5
  436. package/dist/modules/n8n-packages/entities/variable/variable-importer.js +85 -21
  437. package/dist/modules/n8n-packages/entities/variable/variable-importer.js.map +1 -1
  438. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.d.ts +1 -0
  439. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js +8 -3
  440. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js.map +1 -1
  441. package/dist/modules/n8n-packages/entities/variable/variable.exporter.d.ts +1 -0
  442. package/dist/modules/n8n-packages/entities/variable/variable.exporter.js +18 -23
  443. package/dist/modules/n8n-packages/entities/variable/variable.exporter.js.map +1 -1
  444. package/dist/modules/n8n-packages/entities/variable/variable.types.d.ts +21 -2
  445. package/dist/modules/n8n-packages/entities/variable/variable.types.js +15 -0
  446. package/dist/modules/n8n-packages/entities/variable/variable.types.js.map +1 -1
  447. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +6 -2
  448. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +33 -11
  449. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
  450. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +35 -3
  451. package/dist/modules/n8n-packages/n8n-packages.types.js +12 -1
  452. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  453. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +0 -11
  454. package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +0 -10
  455. package/dist/modules/n8n-packages/spec/requirements.schema.js +0 -1
  456. package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
  457. package/dist/modules/n8n-packages/spec/serialized/variable.schema.d.ts +3 -3
  458. package/dist/modules/n8n-packages/spec/serialized/variable.schema.js +3 -2
  459. package/dist/modules/n8n-packages/spec/serialized/variable.schema.js.map +1 -1
  460. package/dist/modules/oauth-server/oauth-server.service.js +2 -2
  461. package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
  462. package/dist/modules/otel/execution-level-tracer.d.ts +2 -0
  463. package/dist/modules/otel/execution-level-tracer.js +4 -0
  464. package/dist/modules/otel/execution-level-tracer.js.map +1 -1
  465. package/dist/modules/redaction/redaction-context-hook.d.ts +3 -1
  466. package/dist/modules/redaction/redaction-context-hook.js +9 -2
  467. package/dist/modules/redaction/redaction-context-hook.js.map +1 -1
  468. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +4 -1
  469. package/dist/modules/source-control.ee/source-control-import.service.ee.js +26 -6
  470. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  471. package/dist/modules/workflow-index/workflow-dependency-query.service.d.ts +8 -1
  472. package/dist/modules/workflow-index/workflow-dependency-query.service.js +76 -18
  473. package/dist/modules/workflow-index/workflow-dependency-query.service.js.map +1 -1
  474. package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.d.ts +16 -0
  475. package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js +95 -0
  476. package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js.map +1 -0
  477. package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.d.ts +15 -0
  478. package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.js +52 -0
  479. package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.js.map +1 -0
  480. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +3 -1
  481. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +10 -4
  482. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
  483. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js +1 -1
  484. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js.map +1 -1
  485. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +9 -5
  486. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +71 -40
  487. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -1
  488. package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +3 -0
  489. package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -1
  490. package/dist/node-execution/ephemeral-node-executor.js +20 -13
  491. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  492. package/dist/oauth/dcr-managed-fields.d.ts +6 -0
  493. package/dist/oauth/dcr-managed-fields.js +13 -0
  494. package/dist/oauth/dcr-managed-fields.js.map +1 -0
  495. package/dist/oauth/oauth.service.d.ts +1 -0
  496. package/dist/oauth/oauth.service.js +24 -25
  497. package/dist/oauth/oauth.service.js.map +1 -1
  498. package/dist/posthog/index.d.ts +2 -0
  499. package/dist/posthog/index.js +19 -0
  500. package/dist/posthog/index.js.map +1 -1
  501. package/dist/public-api/public-api-controller.registry.d.ts +1 -0
  502. package/dist/public-api/public-api-controller.registry.js +36 -35
  503. package/dist/public-api/public-api-controller.registry.js.map +1 -1
  504. package/dist/public-api/public-api-route-resolver.d.ts +38 -0
  505. package/dist/public-api/public-api-route-resolver.js +136 -0
  506. package/dist/public-api/public-api-route-resolver.js.map +1 -0
  507. package/dist/public-api/types.d.ts +3 -6
  508. package/dist/public-api/v1/controllers/index.d.ts +1 -0
  509. package/dist/public-api/v1/controllers/index.js +1 -0
  510. package/dist/public-api/v1/controllers/index.js.map +1 -1
  511. package/dist/public-api/v1/controllers/roles.public.controller.d.ts +11 -0
  512. package/dist/public-api/v1/controllers/roles.public.controller.js +65 -0
  513. package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -0
  514. package/dist/public-api/v1/controllers/tags.public.controller.js +9 -2
  515. package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
  516. package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +10 -2
  517. package/dist/public-api/v1/controllers/workflows.public.controller.js +132 -4
  518. package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
  519. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +7 -15
  520. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
  521. package/dist/public-api/v1/handlers/decorator-routed.handler.d.ts +2 -0
  522. package/dist/public-api/v1/handlers/decorator-routed.handler.js +10 -0
  523. package/dist/public-api/v1/handlers/decorator-routed.handler.js.map +1 -0
  524. package/dist/public-api/v1/handlers/discover/discover.service.js +54 -49
  525. package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
  526. package/dist/public-api/v1/handlers/executions/executions.handler.js +25 -65
  527. package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
  528. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +2 -0
  529. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
  530. package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -1
  531. package/dist/public-api/v1/handlers/workflows/workflows.handler.js +44 -122
  532. package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
  533. package/dist/public-api/v1/openapi-gen/decorator-routes.d.ts +18 -0
  534. package/dist/public-api/v1/openapi-gen/decorator-routes.js +160 -0
  535. package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -0
  536. package/dist/public-api/v1/openapi-gen/generate.d.ts +25 -0
  537. package/dist/public-api/v1/openapi-gen/generate.js +149 -0
  538. package/dist/public-api/v1/openapi-gen/generate.js.map +1 -0
  539. package/dist/public-api/v1/openapi-gen/zod-extend.d.ts +1 -0
  540. package/dist/public-api/v1/openapi-gen/zod-extend.js +6 -0
  541. package/dist/public-api/v1/openapi-gen/zod-extend.js.map +1 -0
  542. package/dist/public-api/v1/openapi.yml +625 -166
  543. package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -3
  544. package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
  545. package/dist/scaling/constants.d.ts +2 -2
  546. package/dist/scaling/constants.js +1 -0
  547. package/dist/scaling/constants.js.map +1 -1
  548. package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -1
  549. package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
  550. package/dist/server.js +1 -0
  551. package/dist/server.js.map +1 -1
  552. package/dist/{modules/mcp/tools/workflow-builder → services}/ai-gateway-eligibility.d.ts +1 -0
  553. package/dist/{modules/mcp/tools/workflow-builder → services}/ai-gateway-eligibility.js +7 -1
  554. package/dist/services/ai-gateway-eligibility.js.map +1 -0
  555. package/dist/services/ai-gateway.service.d.ts +2 -0
  556. package/dist/services/ai-gateway.service.js +17 -3
  557. package/dist/services/ai-gateway.service.js.map +1 -1
  558. package/dist/services/ai.service.d.ts +1 -0
  559. package/dist/services/ai.service.js +4 -0
  560. package/dist/services/ai.service.js.map +1 -1
  561. package/dist/services/cache/cache.service.d.ts +2 -0
  562. package/dist/services/cache/cache.service.js +21 -0
  563. package/dist/services/cache/cache.service.js.map +1 -1
  564. package/dist/services/cache/redis.cache-manager.d.ts +1 -0
  565. package/dist/services/cache/redis.cache-manager.js +6 -0
  566. package/dist/services/cache/redis.cache-manager.js.map +1 -1
  567. package/dist/services/credentials-tester.service.d.ts +5 -1
  568. package/dist/services/credentials-tester.service.js +9 -3
  569. package/dist/services/credentials-tester.service.js.map +1 -1
  570. package/dist/services/folder.service.js.map +1 -1
  571. package/dist/services/free-ai-credits.service.js +1 -1
  572. package/dist/services/free-ai-credits.service.js.map +1 -1
  573. package/dist/services/frontend.service.js +3 -1
  574. package/dist/services/frontend.service.js.map +1 -1
  575. package/dist/services/instance-activation.service.d.ts +10 -0
  576. package/dist/services/instance-activation.service.js +48 -0
  577. package/dist/services/instance-activation.service.js.map +1 -0
  578. package/dist/services/node-resource-explorer.service.d.ts +13 -0
  579. package/dist/services/node-resource-explorer.service.js +117 -0
  580. package/dist/services/node-resource-explorer.service.js.map +1 -1
  581. package/dist/services/ownership-transfer/ownership-transfer.manifest.json +1 -1
  582. package/dist/services/project.service.ee.d.ts +3 -3
  583. package/dist/services/project.service.ee.js +4 -7
  584. package/dist/services/project.service.ee.js.map +1 -1
  585. package/dist/services/role-authorization.d.ts +3 -0
  586. package/dist/services/role-authorization.js +14 -0
  587. package/dist/services/role-authorization.js.map +1 -0
  588. package/dist/services/tag.service.d.ts +5 -2
  589. package/dist/services/tag.service.js +9 -2
  590. package/dist/services/tag.service.js.map +1 -1
  591. package/dist/services/workflow-statistics.service.d.ts +1 -0
  592. package/dist/services/workflow-statistics.service.js +12 -0
  593. package/dist/services/workflow-statistics.service.js.map +1 -1
  594. package/dist/task-runners/task-broker/auth/task-broker-auth.controller.d.ts +1 -0
  595. package/dist/task-runners/task-broker/auth/task-broker-auth.controller.js +2 -2
  596. package/dist/task-runners/task-broker/auth/task-broker-auth.controller.js.map +1 -1
  597. package/dist/task-runners/task-broker/auth/task-broker-auth.service.d.ts +6 -2
  598. package/dist/task-runners/task-broker/auth/task-broker-auth.service.js +8 -4
  599. package/dist/task-runners/task-broker/auth/task-broker-auth.service.js.map +1 -1
  600. package/dist/task-runners/task-broker/task-broker-server.d.ts +1 -0
  601. package/dist/task-runners/task-broker/task-broker-server.js +13 -3
  602. package/dist/task-runners/task-broker/task-broker-server.js.map +1 -1
  603. package/dist/task-runners/task-broker/task-broker-ws-server.d.ts +1 -0
  604. package/dist/task-runners/task-broker/task-broker-ws-server.js +8 -5
  605. package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
  606. package/dist/task-runners/task-broker/task-broker.service.js +2 -9
  607. package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
  608. package/dist/task-runners/task-runner-lifecycle-events.d.ts +0 -1
  609. package/dist/task-runners/task-runner-process-base.d.ts +2 -2
  610. package/dist/task-runners/task-runner-process-base.js +14 -10
  611. package/dist/task-runners/task-runner-process-base.js.map +1 -1
  612. package/dist/task-runners/task-runner-process-js.d.ts +1 -2
  613. package/dist/task-runners/task-runner-process-js.js +4 -4
  614. package/dist/task-runners/task-runner-process-js.js.map +1 -1
  615. package/dist/task-runners/task-runner-process-py.d.ts +1 -2
  616. package/dist/task-runners/task-runner-process-py.js +2 -2
  617. package/dist/task-runners/task-runner-process-py.js.map +1 -1
  618. package/dist/utils/node-definition-dirs.d.ts +1 -0
  619. package/dist/utils/node-definition-dirs.js +24 -0
  620. package/dist/utils/node-definition-dirs.js.map +1 -0
  621. package/dist/webhooks/constants.d.ts +1 -0
  622. package/dist/webhooks/constants.js +2 -1
  623. package/dist/webhooks/constants.js.map +1 -1
  624. package/dist/webhooks/live-webhooks.d.ts +4 -2
  625. package/dist/webhooks/live-webhooks.js +25 -4
  626. package/dist/webhooks/live-webhooks.js.map +1 -1
  627. package/dist/webhooks/webhook-execution-context.d.ts +5 -2
  628. package/dist/webhooks/webhook-execution-context.js +10 -0
  629. package/dist/webhooks/webhook-execution-context.js.map +1 -1
  630. package/dist/webhooks/webhook-helpers.js +9 -8
  631. package/dist/webhooks/webhook-helpers.js.map +1 -1
  632. package/dist/webhooks/webhook.service.d.ts +5 -1
  633. package/dist/webhooks/webhook.service.js +52 -9
  634. package/dist/webhooks/webhook.service.js.map +1 -1
  635. package/dist/workflow-runner.js.map +1 -1
  636. package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +3 -0
  637. package/dist/workflows/triggers/trigger-execution-context.factory.js +43 -38
  638. package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
  639. package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +0 -1
  640. package/dist/workflows/triggers/webhook-trigger-registrar.js +1 -16
  641. package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
  642. package/dist/workflows/workflow-finder.service.d.ts +20 -31
  643. package/dist/workflows/workflow-finder.service.js +42 -9
  644. package/dist/workflows/workflow-finder.service.js.map +1 -1
  645. package/dist/workflows/workflow-mutation-hooks-proxy.service.d.ts +14 -0
  646. package/dist/workflows/workflow-mutation-hooks-proxy.service.js +35 -0
  647. package/dist/workflows/workflow-mutation-hooks-proxy.service.js.map +1 -0
  648. package/dist/workflows/workflow-sharing.service.d.ts +4 -1
  649. package/dist/workflows/workflow-sharing.service.js +14 -2
  650. package/dist/workflows/workflow-sharing.service.js.map +1 -1
  651. package/dist/workflows/workflow.service.d.ts +9 -6
  652. package/dist/workflows/workflow.service.ee.d.ts +3 -3
  653. package/dist/workflows/workflow.service.ee.js +20 -7
  654. package/dist/workflows/workflow.service.ee.js.map +1 -1
  655. package/dist/workflows/workflow.service.js +33 -9
  656. package/dist/workflows/workflow.service.js.map +1 -1
  657. package/package.json +45 -41
  658. package/templates/form-shell.handlebars +418 -0
  659. package/templates/form-trigger.handlebars +30 -1
  660. package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js.map +0 -1
  661. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +0 -1
  662. package/dist/modules/agents/integrations/platforms/slack-operations.d.ts +0 -17
  663. package/dist/modules/agents/integrations/platforms/slack-operations.js.map +0 -1
  664. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.d.ts +0 -48
  665. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js +0 -42
  666. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js.map +0 -1
  667. package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +0 -54
  668. package/dist/modules/agents/integrations/slack-app-setup.service.js +0 -326
  669. package/dist/modules/agents/integrations/slack-app-setup.service.js.map +0 -1
  670. package/dist/modules/mcp/tools/workflow-builder/ai-gateway-eligibility.js.map +0 -1
  671. package/dist/public-api/v1/handlers/executions/executions.service.d.ts +0 -14
  672. package/dist/public-api/v1/handlers/executions/executions.service.js +0 -49
  673. package/dist/public-api/v1/handlers/executions/executions.service.js.map +0 -1
  674. package/dist/public-api/v1/handlers/workflows/workflows.service.d.ts +0 -13
  675. package/dist/public-api/v1/handlers/workflows/workflows.service.js +0 -98
  676. package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +0 -1
  677. /package/dist/modules/agents/integrations/platforms/{slack-bridge-behavior.js → slack/slack-bridge-behavior.js} +0 -0
@@ -5,5 +5,5 @@ export declare const AGENT_CONFIG_JSON_SCHEMA: import("zod-to-json-schema").Json
5
5
  [key: string]: import("zod-to-json-schema").JsonSchema7Type;
6
6
  } | undefined;
7
7
  };
8
- export declare const AGENT_BUILDER_GUIDE = "# n8n Agent management\n\nUse the Agent MCP tools to create and edit persisted n8n Agents. The MCP client is the\norchestrator: there is no nested conversational Agent Builder.\n\n## Choose an Agent or workflow\n\nAn n8n Agent is a first-class persisted resource with its own instructions, model, tools, skills,\ntasks, memory, integrations, and lifecycle. An AI Agent node is a node inside a workflow whose\ntrigger, surrounding graph, and lifecycle are owned by that workflow.\n\nIf the request is actually a fixed trigger or schedule with enumerable, repeatable steps, it is\nprobably a workflow \u2014 explain the mismatch and ask before building the alternative. Never substitute\na Chat Trigger plus an AI Agent node for a requested n8n Agent.\n\n## Build sequence\n\n1. Use search_projects to identify the project, or search_agents and get_agent for an existing Agent.\n By-ID tools (get_agent, mutate_agent, validate_agent, publish_agent, unpublish_agent,\n revert_agent, list_agent_versions, delete_agent, update_agent_integration) take an agentId alone\n and resolve the project from it.\n2. Use discover_agent_assets plus list_credentials, search_nodes, get_node_types, and\n explore_node_resources to ground model, tool, workflow, integration, and credential choices.\n3. For a new Agent, call create_agent with the initial config after discovering its assets. The\n top-level name is injected into config; omit config only when the Agent ID is needed first.\n4. Call mutate_agent once per logical sidecar or subsequent mutation, always passing the latest\n configHash. Skills, tasks, and custom tools are created after the Agent because they need\n server-generated IDs.\n5. Call validate_agent and resolve every reported error. A valid Agent is a completed draft; do not\n publish it merely to finish the build.\n6. Report that the draft is ready, include a clickable link using the `url` returned by\n validate_agent, and ask whether the user wants to publish it.\n7. Call publish_agent only when the user explicitly requested publication, activation, deployment,\n or making the Agent live, or confirms publication after the build.\n8. Use update_agent_integration to configure chat integrations. Configuration never publishes the\n Agent. A configured channel stays inactive until explicit publication unless the Agent already has an active version.\n\n## Publication approval\n\nBuilding, editing, validating, or configuring an Agent never implies permission to publish or\nrepublish it. Leave the Agent as a draft by default. An explicit request to publish, activate,\ndeploy, or make live counts as approval; otherwise ask after validation and wait for the answer\nbefore calling publish_agent. Configuring a channel on an already published Agent connects it\nimmediately, so confirm that external connection before calling update_agent_integration.\n\n## Version history\n\nlist_agent_versions lists an Agent's published versions; get_agent with a versionId inspects one\nbefore acting on it. revert_agent restores the draft from a version without publishing, returning a\nfresh configHash for further mutations. publish_agent with a versionId republishes that version\ndirectly, leaving the draft untouched; as a (re)publication it requires the same explicit approval.\n\nIn publish, unpublish, and revert responses, `activeVersionId` identifies the live published\nversion (null when unpublished) while `versionId` is the draft's internal pointer \u2014 do not report\n`versionId` as a published version.\n\n## mutate_agent operations\n\nPass a single `operation` object whose `type` selects the mutation. Each operation's fields sit\ndirectly on that object \u2014 there is no `value` wrapper. For example:\n\n```json\n{ \"type\": \"config.patch\", \"patch\": [{ \"op\": \"add\", \"path\": \"/tools/-\", \"value\": { \"type\": \"workflow\", \"workflow\": \"My Workflow\", \"name\": \"my_tool\" } }] }\n```\n\n- config.replace: Set `config` to the complete editable Agent JSON configuration. Must not include\n integrations; use update_agent_integration for those.\n- config.patch: Set `patch` to an array of RFC 6902 operations (add, remove, replace, move, copy,\n test). Paths under /integrations are rejected; use update_agent_integration for those.\n- skill.upsert: Set `skill` to the complete skill body. Omit `skillId` to create and attach a new\n skill, or pass it to replace an existing skill body.\n- skill.delete: Set `skillId` to the skill to delete; its config reference is removed.\n- task.upsert: Set `task` to the complete task body. Omit `taskId` to create and attach a new\n scheduled task, or pass it to replace an existing one. `enabled` controls the task config reference.\n- task.delete: Set `taskId` to the task to delete; its config reference is removed.\n- customTool.upsert: Set `code` to the tool source; it is compiled, validated, stored, and attached.\n Only `@n8n/agents` and `zod` imports are available. The default export must be a Tool builder\n chain with `description`, `input` (a Zod schema), and `handler`; `output` is optional:\n\n ```typescript\n import { Tool } from '@n8n/agents';\n import { z } from 'zod';\n\n export default new Tool('get_current_datetime')\n \t.description('Return the current date and time as an ISO 8601 string')\n \t.input(z.object({}))\n \t.handler(async () => new Date().toISOString());\n ```\n- customTool.delete: Set `toolId` to the custom tool to delete; its config reference is removed.\n\nEvery mutation requires baseConfigHash from get_agent or the previous successful mutation. Mutation\nresponses contain only the next configHash and the affected resource ID, not the full Agent. On a\nstale_config response, call get_agent and retry against the returned snapshot.\n\n## Agent JSON configuration\n\nThe required runnable fields are name, model, credential, and instructions. Common optional fields\ninclude tools, skills, tasks, memory, subAgents, providerTools, mcpServers, vectorStores,\npersonalisation, and config. Integrations are not part of this config (see below).\n\nTool references use these forms:\n\n- Custom tool: { \"type\": \"custom\", \"id\": \"tool_name\" }\n- Workflow tool: { \"type\": \"workflow\", \"workflow\": \"Workflow Name\", \"name\": \"tool_name\" }\n- Node tool: { \"type\": \"node\", \"name\": \"tool_name\", \"node\": { \"nodeType\": \"...\",\n \"nodeTypeVersion\": 1, \"nodeParameters\": {}, \"credentials\": {} } }\n\nCreating a resource does not give the Agent access to it. For example, a data table created with\ncreate_data_table is only usable by the Agent once it is attached as a node tool\n(n8n-nodes-base.dataTable); discover it with search_nodes usage=\"agentTool\" like any other node.\n\nSub-agents are not tool entries. Configure them under the top-level `subAgents` field:\n{ \"subAgents\": { \"agents\": [{ \"agentId\": \"...\", \"useWhen\": \"...\" }] } }\n\nDo not guess node parameters or stable resource IDs. Discover the node definition and live resource\noptions first. Never place credential secret data in Agent configuration or MCP tool arguments; use\ncredential IDs returned by list_credentials.\n\nSkills and tasks have separately persisted bodies. Always manage them through mutate_agent instead\nof manually inventing their IDs. Saved sub-agents must be published Agents from the same project.\nUse discover_agent_assets with kind=subagents to obtain valid IDs.\n\nChat integrations are conversation surfaces, not ordinary node tools. Use an integration when users\nshould invoke and converse with the Agent in Slack, Telegram, or Linear. Use a node/workflow tool\nwhen the Agent only needs to call that service as an API.\n\nIntegrations are persisted separately from editable config. get_agent reports them in a read-only\nintegrations field, but config.replace and config.patch can't add, change, or remove them, and they\nnever appear in the config schema above. Manage them exclusively with update_agent_integration,\nwhich validates the credential and persists the configuration without publishing. A configured\nchannel stays inactive until publish_agent is called unless the Agent already has an active version;\nin that case, it connects immediately to the existing active snapshot.\n\n## MCP servers\n\nThe top-level `mcpServers` config array connects external MCP tool catalogs to the Agent. Discover\nregistry-backed servers with discover_agent_assets kind=mcpServers, or use a URL the user provides.\nWhen the server requires authentication, resolve an accessible credential ID with list_credentials\nfirst; the same ID is passed to verification and stored in the config entry. Credentials cannot be\ncreated through these tools \u2014 when none exists, ask the user to create one in n8n.\n\nBefore writing an entry into mcpServers, call verify_agent_mcp_server with the same name, url,\ntransport, authentication, and credential. The server does not need to be attached to the Agent\nfirst: verification opens a temporary connection and returns the server's live tools. validate_agent\nnever performs this handshake, so an unverified entry can pass validation and still fail at runtime.\nConfirm the returned tools cover the requested capability and use the list to populate toolFilter\ninstead of guessing tool names. If verification fails, report the error and resolve it with the user\ninstead of persisting a broken server. Only when the user cannot supply the URL or credential yet,\npersist the known fields without inventing values and skip verification.\n";
8
+ export declare const AGENT_BUILDER_GUIDE = "# n8n Agent management\n\nUse the Agent MCP tools to create and edit persisted n8n Agents. The MCP client is the\norchestrator: there is no nested conversational Agent Builder.\n\n## Choose an Agent or workflow\n\nAn n8n Agent is a first-class persisted resource with its own instructions, model, tools, skills,\ntasks, memory, integrations, and lifecycle. An AI Agent node is a node inside a workflow whose\ntrigger, surrounding graph, and lifecycle are owned by that workflow.\n\nIf the request is actually a fixed trigger or schedule with enumerable, repeatable steps, it is\nprobably a workflow \u2014 explain the mismatch and ask before building the alternative. Never substitute\na Chat Trigger plus an AI Agent node for a requested n8n Agent.\n\n## Build sequence\n\n1. Use search_projects to identify the project, or search_agents and get_agent for an existing Agent.\n By-ID tools (get_agent, mutate_agent, validate_agent, call_agent, publish_agent,\n unpublish_agent, revert_agent, list_agent_versions, delete_agent, update_agent_integration) take\n an agentId alone and resolve the project from it.\n2. Use discover_agent_assets plus list_credentials, search_nodes, get_node_types, and\n explore_node_resources to ground model, tool, workflow, integration, and credential choices.\n3. For a new Agent, call create_agent with the initial config after discovering its assets. The\n top-level name is injected into config; omit config only when the Agent ID is needed first.\n4. Call mutate_agent once per logical sidecar or subsequent mutation, always passing the latest\n configHash. Skills, tasks, and custom tools are created after the Agent because they need\n server-generated IDs.\n5. Call validate_agent and resolve every reported error. A valid Agent is a completed draft; do not\n publish it merely to finish the build.\n6. After validation succeeds, if call_agent is available and authorized, send one representative\n message before reporting the draft ready. Otherwise, report the successfully validated draft\n ready without a test run.\n7. Report that the draft is ready, include a clickable link using the `url` returned by\n validate_agent, and ask whether the user wants to publish it.\n8. Call publish_agent only when the user explicitly requested publication, activation, deployment,\n or making the Agent live, or confirms publication after the build.\n9. Use update_agent_integration to configure chat integrations. Configuration never publishes the\n Agent. A configured channel stays inactive until explicit publication unless the Agent already has an active version.\n\n## Draft test runs\n\ncall_agent verifies the draft Agent's behavior through built-in Preview chat, not configured channel\ntriggers, platform context, message delivery, or replies. Real tools and credentials are used, so\nside effects are possible. If the test exposes errors, report them and ask whether to fix them rather\nthan mutating the Agent automatically. Every approval decision must come from the human; resume each\nreturned approval individually.\n\n## Publication approval\n\nBuilding, editing, validating, or configuring an Agent never implies permission to publish or\nrepublish it. Leave the Agent as a draft by default. An explicit request to publish, activate,\ndeploy, or make live counts as approval; otherwise ask after validation and wait for the answer\nbefore calling publish_agent. Configuring a channel on an already published Agent connects it\nimmediately, so confirm that external connection before calling update_agent_integration.\n\n## Version history\n\nlist_agent_versions lists an Agent's published versions; get_agent with a versionId inspects one\nbefore acting on it. revert_agent restores the draft from a version without publishing, returning a\nfresh configHash for further mutations. publish_agent with a versionId republishes that version\ndirectly, leaving the draft untouched; as a (re)publication it requires the same explicit approval.\n\nIn publish, unpublish, and revert responses, `activeVersionId` identifies the live published\nversion (null when unpublished) while `versionId` is the draft's internal pointer \u2014 do not report\n`versionId` as a published version.\n\n## mutate_agent operations\n\nPass a single `operation` object whose `type` selects the mutation. Each operation's fields sit\ndirectly on that object \u2014 there is no `value` wrapper. For example:\n\n```json\n{ \"type\": \"config.patch\", \"patch\": [{ \"op\": \"add\", \"path\": \"/tools/-\", \"value\": { \"type\": \"workflow\", \"workflow\": \"My Workflow\", \"name\": \"my_tool\" } }] }\n```\n\n- config.replace: Set `config` to the complete editable Agent JSON configuration. Must not include\n integrations; use update_agent_integration for those.\n- config.patch: Set `patch` to an array of RFC 6902 operations (add, remove, replace, move, copy,\n test). Paths under /integrations are rejected; use update_agent_integration for those.\n- skill.upsert: Set `skill` to the complete skill body. Omit `skillId` to create and attach a new\n skill, or pass it to replace an existing skill body.\n- skill.delete: Set `skillId` to the skill to delete; its config reference is removed.\n- task.upsert: Set `task` to the complete task body. Omit `taskId` to create and attach a new\n scheduled task, or pass it to replace an existing one. `enabled` controls the task config reference.\n- task.delete: Set `taskId` to the task to delete; its config reference is removed.\n- customTool.upsert: Set `code` to the tool source; it is compiled, validated, stored, and attached.\n Only `@n8n/agents` and `zod` imports are available. The default export must be a Tool builder\n chain with `description`, `input` (a Zod schema), and `handler`; `output` is optional:\n\n ```typescript\n import { Tool } from '@n8n/agents';\n import { z } from 'zod';\n\n export default new Tool('get_current_datetime')\n \t.description('Return the current date and time as an ISO 8601 string')\n \t.input(z.object({}))\n \t.handler(async () => new Date().toISOString());\n ```\n- customTool.delete: Set `toolId` to the custom tool to delete; its config reference is removed.\n\nEvery mutation requires baseConfigHash from get_agent or the previous successful mutation. Mutation\nresponses contain only the next configHash and the affected resource ID, not the full Agent. On a\nstale_config response, call get_agent and retry against the returned snapshot.\n\n## Agent JSON configuration\n\nThe required runnable fields are name, model, credential, and instructions. Common optional fields\ninclude tools, skills, tasks, memory, subAgents, providerTools, mcpServers, vectorStores,\npersonalisation, and config. Integrations are not part of this config (see below).\n\nTool references use these forms:\n\n- Custom tool: { \"type\": \"custom\", \"id\": \"tool_name\" }\n- Workflow tool: { \"type\": \"workflow\", \"workflow\": \"Workflow Name\", \"name\": \"tool_name\" }\n- Node tool: { \"type\": \"node\", \"name\": \"tool_name\", \"node\": { \"nodeType\": \"...\",\n \"nodeTypeVersion\": 1, \"nodeParameters\": {}, \"credentials\": {} } }\n\nCreating a resource does not give the Agent access to it. For example, a data table created with\ncreate_data_table is only usable by the Agent once it is attached as a node tool\n(n8n-nodes-base.dataTable); discover it with search_nodes usage=\"agentTool\" like any other node.\n\nSub-agents are not tool entries. Configure them under the top-level `subAgents` field:\n{ \"subAgents\": { \"agents\": [{ \"agentId\": \"...\", \"useWhen\": \"...\" }] } }\n\nDo not guess node parameters or stable resource IDs. Discover the node definition and live resource\noptions first. Never place credential secret data in Agent configuration or MCP tool arguments; use\ncredential IDs returned by list_credentials.\n\nSkills and tasks have separately persisted bodies. Always manage them through mutate_agent instead\nof manually inventing their IDs. Saved sub-agents must be published Agents from the same project.\nUse discover_agent_assets with kind=subagents to obtain valid IDs.\n\nChat integrations are conversation surfaces, not ordinary node tools. Use an integration when users\nshould invoke and converse with the Agent in Slack, Telegram, or Linear. Use a node/workflow tool\nwhen the Agent only needs to call that service as an API.\n\nIntegrations are persisted separately from editable config. get_agent reports them in a read-only\nintegrations field, but config.replace and config.patch can't add, change, or remove them, and they\nnever appear in the config schema above. Manage them exclusively with update_agent_integration,\nwhich validates the credential and persists the configuration without publishing. A configured\nchannel stays inactive until publish_agent is called unless the Agent already has an active version;\nin that case, it connects immediately to the existing active snapshot.\n\n## MCP servers\n\nThe top-level `mcpServers` config array connects external MCP tool catalogs to the Agent. Discover\nregistry-backed servers with discover_agent_assets kind=mcpServers, or use a URL the user provides.\nWhen the server requires authentication, resolve an accessible credential ID with list_credentials\nfirst; the same ID is passed to verification and stored in the config entry. Credentials cannot be\ncreated through these tools \u2014 when none exists, ask the user to create one in n8n.\n\nBefore writing an entry into mcpServers, call verify_agent_mcp_server with the same name, url,\ntransport, authentication, and credential. The server does not need to be attached to the Agent\nfirst: verification opens a temporary connection and returns the server's live tools. validate_agent\nnever performs this handshake, so an unverified entry can pass validation and still fail at runtime.\nConfirm the returned tools cover the requested capability and use the list to populate toolFilter\ninstead of guessing tool names. If verification fails, report the error and resolve it with the user\ninstead of persisting a broken server. Only when the user cannot supply the URL or credential yet,\npersist the known fields without inventing values and skip verification.\n";
9
9
  export declare const AGENT_BUILDER_REFERENCE: string;
@@ -26,9 +26,9 @@ a Chat Trigger plus an AI Agent node for a requested n8n Agent.
26
26
  ## Build sequence
27
27
 
28
28
  1. Use search_projects to identify the project, or search_agents and get_agent for an existing Agent.
29
- By-ID tools (get_agent, mutate_agent, validate_agent, publish_agent, unpublish_agent,
30
- revert_agent, list_agent_versions, delete_agent, update_agent_integration) take an agentId alone
31
- and resolve the project from it.
29
+ By-ID tools (get_agent, mutate_agent, validate_agent, call_agent, publish_agent,
30
+ unpublish_agent, revert_agent, list_agent_versions, delete_agent, update_agent_integration) take
31
+ an agentId alone and resolve the project from it.
32
32
  2. Use discover_agent_assets plus list_credentials, search_nodes, get_node_types, and
33
33
  explore_node_resources to ground model, tool, workflow, integration, and credential choices.
34
34
  3. For a new Agent, call create_agent with the initial config after discovering its assets. The
@@ -38,13 +38,24 @@ a Chat Trigger plus an AI Agent node for a requested n8n Agent.
38
38
  server-generated IDs.
39
39
  5. Call validate_agent and resolve every reported error. A valid Agent is a completed draft; do not
40
40
  publish it merely to finish the build.
41
- 6. Report that the draft is ready, include a clickable link using the \`url\` returned by
41
+ 6. After validation succeeds, if call_agent is available and authorized, send one representative
42
+ message before reporting the draft ready. Otherwise, report the successfully validated draft
43
+ ready without a test run.
44
+ 7. Report that the draft is ready, include a clickable link using the \`url\` returned by
42
45
  validate_agent, and ask whether the user wants to publish it.
43
- 7. Call publish_agent only when the user explicitly requested publication, activation, deployment,
46
+ 8. Call publish_agent only when the user explicitly requested publication, activation, deployment,
44
47
  or making the Agent live, or confirms publication after the build.
45
- 8. Use update_agent_integration to configure chat integrations. Configuration never publishes the
48
+ 9. Use update_agent_integration to configure chat integrations. Configuration never publishes the
46
49
  Agent. A configured channel stays inactive until explicit publication unless the Agent already has an active version.
47
50
 
51
+ ## Draft test runs
52
+
53
+ call_agent verifies the draft Agent's behavior through built-in Preview chat, not configured channel
54
+ triggers, platform context, message delivery, or replies. Real tools and credentials are used, so
55
+ side effects are possible. If the test exposes errors, report them and ask whether to fix them rather
56
+ than mutating the Agent automatically. Every approval decision must come from the human; resume each
57
+ returned approval individually.
58
+
48
59
  ## Publication approval
49
60
 
50
61
  Building, editing, validating, or configuring an Agent never implies permission to publish or
@@ -1 +1 @@
1
- {"version":3,"file":"agent-reference.js","sourceRoot":"","sources":["../../../../../src/modules/mcp/tools/agents/agent-reference.ts"],"names":[],"mappings":";;;AAAA,8CAA2D;AAC3D,2DAAqD;AAExC,QAAA,2BAA2B,GAAG,wBAAwB,CAAC;AAIpE,MAAM,6BAA6B,GAAG,qCAAyB,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhF,QAAA,wBAAwB,GAAG,IAAA,oCAAe,EAAC,6BAA6B,EAAE;IACtF,IAAI,EAAE,iBAAiB;CACvB,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqJlC,CAAC;AAEW,QAAA,uBAAuB,GAAG,GAAG,QAAA,mBAAmB;;;;;EAK3D,IAAI,CAAC,SAAS,CAAC,QAAA,wBAAwB,EAAE,IAAI,EAAE,CAAC,CAAC;;CAElD,CAAC"}
1
+ {"version":3,"file":"agent-reference.js","sourceRoot":"","sources":["../../../../../src/modules/mcp/tools/agents/agent-reference.ts"],"names":[],"mappings":";;;AAAA,8CAA2D;AAC3D,2DAAqD;AAExC,QAAA,2BAA2B,GAAG,wBAAwB,CAAC;AAIpE,MAAM,6BAA6B,GAAG,qCAAyB,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhF,QAAA,wBAAwB,GAAG,IAAA,oCAAe,EAAC,6BAA6B,EAAE;IACtF,IAAI,EAAE,iBAAiB;CACvB,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKlC,CAAC;AAEW,QAAA,uBAAuB,GAAG,GAAG,QAAA,mBAAmB;;;;;EAK3D,IAAI,CAAC,SAAS,CAAC,QAAA,wBAAwB,EAAE,IAAI,EAAE,CAAC,CAAC;;CAElD,CAAC"}
@@ -1,20 +1,19 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
1
  import { OutboundHttp, SsrfProtectionService } from '@n8n/backend-network';
3
2
  import { SsrfProtectionConfig } from '@n8n/config';
4
3
  import type { User } from '@n8n/db';
5
4
  import { CredentialsService } from '../../../../credentials/credentials.service';
6
5
  import { AgentConfigService } from '../../../../modules/agents/agent-config.service';
7
6
  import { AgentCustomToolsService } from '../../../../modules/agents/agent-custom-tools.service';
7
+ import { AgentIntegrationManagementService } from '../../../../modules/agents/agent-integration-management.service';
8
8
  import { AgentIntegrationPersistenceService } from '../../../../modules/agents/agent-integration-persistence.service';
9
9
  import { AgentModelCatalogService } from '../../../../modules/agents/agent-model-catalog.service';
10
10
  import { AgentPublishService } from '../../../../modules/agents/agent-publish.service';
11
11
  import { AgentSkillsService } from '../../../../modules/agents/agent-skills.service';
12
12
  import { AgentTaskService } from '../../../../modules/agents/agent-task.service';
13
+ import { AgentTestRunService } from '../../../../modules/agents/agent-test-run.service';
13
14
  import { AgentValidationService } from '../../../../modules/agents/agent-validation.service';
14
15
  import { AgentsService } from '../../../../modules/agents/agents.service';
15
16
  import { AttachableWorkflowsService } from '../../../../modules/agents/attachable-workflows.service';
16
- import { ChatIntegrationRegistry } from '../../../../modules/agents/integrations/agent-chat-integration';
17
- import { ChatIntegrationService } from '../../../../modules/agents/integrations/chat-integration.service';
18
17
  import { AgentSecureRuntime } from '../../../../modules/agents/runtime/agent-secure-runtime';
19
18
  import { McpRegistryService } from '../../../../modules/mcp-registry/registry/mcp-registry.service';
20
19
  import { NodeTypes } from '../../../../node-types';
@@ -22,6 +21,7 @@ import { OauthService } from '../../../../oauth/oauth.service';
22
21
  import { ProjectScopeService } from '../../../../permissions.ee/project-scope.service';
23
22
  import { UrlService } from '../../../../services/url.service';
24
23
  import { Telemetry } from '../../../../telemetry';
24
+ import type { RegisterResourceFn, RegisterToolFn } from '../../mcp.types';
25
25
  export declare class McpAgentToolsService {
26
26
  private readonly telemetry;
27
27
  private readonly credentialsService;
@@ -31,11 +31,11 @@ export declare class McpAgentToolsService {
31
31
  private readonly agentPublishService;
32
32
  private readonly agentSkillsService;
33
33
  private readonly agentTaskService;
34
+ private readonly agentTestRunService;
34
35
  private readonly agentCustomToolsService;
35
36
  private readonly agentSecureRuntime;
36
37
  private readonly integrationPersistenceService;
37
- private readonly chatIntegrationService;
38
- private readonly chatIntegrationRegistry;
38
+ private readonly integrationManagementService;
39
39
  private readonly agentModelCatalogService;
40
40
  private readonly attachableWorkflowsService;
41
41
  private readonly mcpRegistryService;
@@ -46,14 +46,14 @@ export declare class McpAgentToolsService {
46
46
  private readonly ssrfProtectionService;
47
47
  private readonly urlService;
48
48
  private readonly projectScopeService;
49
- constructor(telemetry: Telemetry, credentialsService: CredentialsService, agentsService: AgentsService, agentConfigService: AgentConfigService, agentValidationService: AgentValidationService, agentPublishService: AgentPublishService, agentSkillsService: AgentSkillsService, agentTaskService: AgentTaskService, agentCustomToolsService: AgentCustomToolsService, agentSecureRuntime: AgentSecureRuntime, integrationPersistenceService: AgentIntegrationPersistenceService, chatIntegrationService: ChatIntegrationService, chatIntegrationRegistry: ChatIntegrationRegistry, agentModelCatalogService: AgentModelCatalogService, attachableWorkflowsService: AttachableWorkflowsService, mcpRegistryService: McpRegistryService, nodeTypes: NodeTypes, oauthService: OauthService, outboundHttp: OutboundHttp, ssrfConfig: SsrfProtectionConfig, ssrfProtectionService: SsrfProtectionService, urlService: UrlService, projectScopeService: ProjectScopeService);
50
- registerTools(server: McpServer, user: User, allowedToolNames?: Set<string>): void;
51
- private register;
49
+ constructor(telemetry: Telemetry, credentialsService: CredentialsService, agentsService: AgentsService, agentConfigService: AgentConfigService, agentValidationService: AgentValidationService, agentPublishService: AgentPublishService, agentSkillsService: AgentSkillsService, agentTaskService: AgentTaskService, agentTestRunService: AgentTestRunService, agentCustomToolsService: AgentCustomToolsService, agentSecureRuntime: AgentSecureRuntime, integrationPersistenceService: AgentIntegrationPersistenceService, integrationManagementService: AgentIntegrationManagementService, agentModelCatalogService: AgentModelCatalogService, attachableWorkflowsService: AttachableWorkflowsService, mcpRegistryService: McpRegistryService, nodeTypes: NodeTypes, oauthService: OauthService, outboundHttp: OutboundHttp, ssrfConfig: SsrfProtectionConfig, ssrfProtectionService: SsrfProtectionService, urlService: UrlService, projectScopeService: ProjectScopeService);
50
+ registerTools(registerTool: RegisterToolFn, registerResource: RegisterResourceFn, user: User, allowedToolNames?: Set<string>): void;
52
51
  private searchAgentsTool;
53
52
  private getAgentTool;
54
53
  private createAgentTool;
55
54
  private mutateAgentTool;
56
55
  private validateAgentTool;
56
+ private callAgentTool;
57
57
  private publishAgentTool;
58
58
  private revertAgentTool;
59
59
  private listAgentVersionsTool;
@@ -68,6 +68,7 @@ export declare class McpAgentToolsService {
68
68
  private fetchConfigHash;
69
69
  private configFromEntity;
70
70
  private getAgentUrl;
71
+ private callAgent;
71
72
  private applyMutation;
72
73
  private assertSanitizeStable;
73
74
  private assertPassesConfigGuards;
@@ -23,16 +23,16 @@ const credentials_service_1 = require("../../../../credentials/credentials.servi
23
23
  const forbidden_error_1 = require("../../../../errors/response-errors/forbidden.error");
24
24
  const agent_config_service_1 = require("../../../../modules/agents/agent-config.service");
25
25
  const agent_custom_tools_service_1 = require("../../../../modules/agents/agent-custom-tools.service");
26
+ const agent_integration_management_service_1 = require("../../../../modules/agents/agent-integration-management.service");
26
27
  const agent_integration_persistence_service_1 = require("../../../../modules/agents/agent-integration-persistence.service");
27
28
  const agent_model_catalog_service_1 = require("../../../../modules/agents/agent-model-catalog.service");
28
29
  const agent_publish_service_1 = require("../../../../modules/agents/agent-publish.service");
29
30
  const agent_skills_service_1 = require("../../../../modules/agents/agent-skills.service");
30
31
  const agent_task_service_1 = require("../../../../modules/agents/agent-task.service");
32
+ const agent_test_run_service_1 = require("../../../../modules/agents/agent-test-run.service");
31
33
  const agent_validation_service_1 = require("../../../../modules/agents/agent-validation.service");
32
34
  const agents_service_1 = require("../../../../modules/agents/agents.service");
33
35
  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
36
  const agent_config_composition_1 = require("../../../../modules/agents/json-config/agent-config-composition");
37
37
  const mcp_client_factory_1 = require("../../../../modules/agents/json-config/mcp-client-factory");
38
38
  const sanitize_unknown_agent_credentials_1 = require("../../../../modules/agents/json-config/sanitize-unknown-agent-credentials");
@@ -246,6 +246,26 @@ const updateIntegrationInput = {
246
246
  .optional()
247
247
  .describe('Integration settings; required for Telegram connect operations'),
248
248
  };
249
+ const callAgentRequestSchema = zod_1.z.discriminatedUnion('type', [
250
+ zod_1.z
251
+ .object({
252
+ type: zod_1.z.literal('message'),
253
+ message: zod_1.z.string().trim().min(1),
254
+ sessionId: zod_1.z.string().trim().min(1).optional(),
255
+ })
256
+ .strict(),
257
+ zod_1.z
258
+ .object({
259
+ type: zod_1.z.literal('approval'),
260
+ approved: zod_1.z.boolean(),
261
+ continuation: agent_test_run_service_1.agentTestRunContinuationSchema,
262
+ })
263
+ .strict(),
264
+ ]);
265
+ const callAgentInput = {
266
+ ...agentIdentityShape,
267
+ request: callAgentRequestSchema,
268
+ };
249
269
  const emptyInput = {};
250
270
  function toolResult(data, isError = false) {
251
271
  return {
@@ -255,7 +275,7 @@ function toolResult(data, isError = false) {
255
275
  };
256
276
  }
257
277
  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) {
278
+ constructor(telemetry, credentialsService, agentsService, agentConfigService, agentValidationService, agentPublishService, agentSkillsService, agentTaskService, agentTestRunService, agentCustomToolsService, agentSecureRuntime, integrationPersistenceService, integrationManagementService, agentModelCatalogService, attachableWorkflowsService, mcpRegistryService, nodeTypes, oauthService, outboundHttp, ssrfConfig, ssrfProtectionService, urlService, projectScopeService) {
259
279
  this.telemetry = telemetry;
260
280
  this.credentialsService = credentialsService;
261
281
  this.agentsService = agentsService;
@@ -264,11 +284,11 @@ let McpAgentToolsService = class McpAgentToolsService {
264
284
  this.agentPublishService = agentPublishService;
265
285
  this.agentSkillsService = agentSkillsService;
266
286
  this.agentTaskService = agentTaskService;
287
+ this.agentTestRunService = agentTestRunService;
267
288
  this.agentCustomToolsService = agentCustomToolsService;
268
289
  this.agentSecureRuntime = agentSecureRuntime;
269
290
  this.integrationPersistenceService = integrationPersistenceService;
270
- this.chatIntegrationService = chatIntegrationService;
271
- this.chatIntegrationRegistry = chatIntegrationRegistry;
291
+ this.integrationManagementService = integrationManagementService;
272
292
  this.agentModelCatalogService = agentModelCatalogService;
273
293
  this.attachableWorkflowsService = attachableWorkflowsService;
274
294
  this.mcpRegistryService = mcpRegistryService;
@@ -280,17 +300,19 @@ let McpAgentToolsService = class McpAgentToolsService {
280
300
  this.urlService = urlService;
281
301
  this.projectScopeService = projectScopeService;
282
302
  }
283
- registerTools(server, user, allowedToolNames) {
303
+ registerTools(registerTool, registerResource, user, allowedToolNames) {
304
+ const isCallAgentAvailable = allowedToolNames?.has(mcp_constants_1.MCP_CALL_AGENT_TOOL_NAME) ?? true;
284
305
  const registerIfAllowed = (tool) => {
285
306
  if (allowedToolNames && !allowedToolNames.has(tool.name))
286
307
  return;
287
- this.register(server, tool);
308
+ registerTool(tool);
288
309
  };
289
310
  registerIfAllowed(this.searchAgentsTool(user));
290
311
  registerIfAllowed(this.getAgentTool(user));
291
312
  registerIfAllowed(this.createAgentTool(user));
292
313
  registerIfAllowed(this.mutateAgentTool(user));
293
- registerIfAllowed(this.validateAgentTool(user));
314
+ registerIfAllowed(this.validateAgentTool(user, isCallAgentAvailable));
315
+ registerIfAllowed(this.callAgentTool(user));
294
316
  registerIfAllowed(this.publishAgentTool(user));
295
317
  registerIfAllowed(this.unpublishAgentTool(user));
296
318
  registerIfAllowed(this.revertAgentTool(user));
@@ -302,18 +324,20 @@ let McpAgentToolsService = class McpAgentToolsService {
302
324
  registerIfAllowed(this.referenceTool(user));
303
325
  if (allowedToolNames && !allowedToolNames.has('get_agent_builder_reference'))
304
326
  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);
327
+ registerResource({
328
+ name: 'agent-builder-reference',
329
+ uri: agent_reference_1.AGENT_BUILDER_REFERENCE_URI,
330
+ config: { description: 'Reference for creating and managing n8n Agents through MCP.' },
331
+ read: () => ({
332
+ contents: [
333
+ {
334
+ uri: agent_reference_1.AGENT_BUILDER_REFERENCE_URI,
335
+ mimeType: 'text/markdown',
336
+ text: agent_reference_1.AGENT_BUILDER_REFERENCE,
337
+ },
338
+ ],
339
+ }),
340
+ });
317
341
  }
318
342
  searchAgentsTool(user) {
319
343
  return {
@@ -481,7 +505,7 @@ let McpAgentToolsService = class McpAgentToolsService {
481
505
  }),
482
506
  };
483
507
  }
484
- validateAgentTool(user) {
508
+ validateAgentTool(user, isCallAgentAvailable) {
485
509
  return {
486
510
  name: 'validate_agent',
487
511
  config: {
@@ -498,14 +522,50 @@ let McpAgentToolsService = class McpAgentToolsService {
498
522
  handler: async ({ agentId }) => await this.run(user, 'validate_agent', { agentId }, async () => {
499
523
  const agent = await this.resolveAgent(user, agentId);
500
524
  await this.assertScope(user, agent.projectId, 'agent:read');
525
+ const validation = await this.validateAgent(user, agent);
526
+ const shouldSuggestCallAgent = validation.valid &&
527
+ isCallAgentAvailable &&
528
+ (await (0, check_access_1.userHasScopes)(user, ['agent:execute'], false, { projectId: agent.projectId }));
501
529
  return {
502
530
  ok: true,
503
- ...(await this.validateAgent(user, agent)),
531
+ ...validation,
504
532
  url: this.getAgentUrl(agent.projectId, agentId),
533
+ ...(shouldSuggestCallAgent
534
+ ? {
535
+ nextStep: {
536
+ tool: mcp_constants_1.MCP_CALL_AGENT_TOOL_NAME,
537
+ reason: 'Test the runnable draft before reporting it ready',
538
+ },
539
+ }
540
+ : {}),
505
541
  };
506
542
  }),
507
543
  };
508
544
  }
545
+ callAgentTool(user) {
546
+ return {
547
+ name: mcp_constants_1.MCP_CALL_AGENT_TOOL_NAME,
548
+ config: {
549
+ description: 'Test an Agent draft through built-in Preview chat. Start or continue a conversation with a message request, or resume one returned approval after the human decides. This uses real tools and credentials, so external side effects are possible.',
550
+ inputSchema: callAgentInput,
551
+ annotations: {
552
+ title: 'Call Agent',
553
+ readOnlyHint: false,
554
+ destructiveHint: true,
555
+ idempotentHint: false,
556
+ openWorldHint: true,
557
+ },
558
+ },
559
+ handler: async (input, extra) => {
560
+ const abortSignal = (0, is_record_1.isRecord)(extra) && extra.signal instanceof AbortSignal ? extra.signal : undefined;
561
+ return await this.run(user, mcp_constants_1.MCP_CALL_AGENT_TOOL_NAME, { agentId: input.agentId }, async () => {
562
+ const agent = await this.resolveAgent(user, input.agentId);
563
+ await this.assertScope(user, agent.projectId, 'agent:execute');
564
+ return await this.callAgent(user, agent, input.request, abortSignal);
565
+ });
566
+ },
567
+ };
568
+ }
509
569
  publishAgentTool(user) {
510
570
  return {
511
571
  name: 'publish_agent',
@@ -813,6 +873,118 @@ let McpAgentToolsService = class McpAgentToolsService {
813
873
  getAgentUrl(projectId, agentId) {
814
874
  return `${this.urlService.getInstanceBaseUrl()}/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}`;
815
875
  }
876
+ async callAgent(user, agent, request, abortSignal) {
877
+ const { id: agentId, projectId } = agent;
878
+ const previewUrl = `${this.getAgentUrl(projectId, agentId)}/preview`;
879
+ try {
880
+ let result;
881
+ if (request.type === 'message') {
882
+ result = await this.agentTestRunService.executeDraftRun({
883
+ agentId,
884
+ projectId,
885
+ message: request.message,
886
+ sessionId: request.sessionId,
887
+ credentialProvider: this.credentialProvider(user, projectId),
888
+ user,
889
+ source: 'mcp',
890
+ abortSignal,
891
+ });
892
+ }
893
+ else {
894
+ result = await this.agentTestRunService.resumeDraftApproval({
895
+ agentId,
896
+ projectId,
897
+ continuation: request.continuation,
898
+ approved: request.approved,
899
+ user,
900
+ source: 'mcp',
901
+ abortSignal,
902
+ });
903
+ }
904
+ if (result.status === 'session_not_found') {
905
+ return {
906
+ ok: false,
907
+ status: 'error',
908
+ code: 'session_not_found',
909
+ message: 'Session not found.',
910
+ };
911
+ }
912
+ if (result.status === 'agent_misconfigured') {
913
+ return {
914
+ ok: false,
915
+ status: 'error',
916
+ code: 'agent_misconfigured',
917
+ message: "This agent isn't ready to run yet. Finish configuring it and try again.",
918
+ missing: result.missing,
919
+ };
920
+ }
921
+ if (result.status === 'completed')
922
+ return { ok: true, ...result };
923
+ const approvals = (0, agent_test_run_service_1.collectStandardApprovals)(result);
924
+ if (approvals) {
925
+ return {
926
+ ok: true,
927
+ status: 'suspended',
928
+ response: result.response,
929
+ sessionId: result.sessionId,
930
+ ...(result.executionId ? { executionId: result.executionId } : {}),
931
+ approvals,
932
+ };
933
+ }
934
+ const canOpenPreview = await (0, check_access_1.userHasScopes)(user, ['project:read', 'agent:read'], false, {
935
+ projectId,
936
+ });
937
+ const previewAccessNote = canOpenPreview
938
+ ? undefined
939
+ : 'Your access permits running this agent but not opening Preview. Share the Preview URL with a project member who has project and agent read access.';
940
+ const cancelled = await this.agentTestRunService.cancelSuspendedRuns({
941
+ agentId,
942
+ suspensions: result.suspensions,
943
+ userId: user.id,
944
+ });
945
+ if (!cancelled) {
946
+ return {
947
+ ok: false,
948
+ status: 'error',
949
+ code: 'cancellation_failed',
950
+ message: 'This test needs approval, but its suspended run could not be cancelled. Open Preview before continuing this session.',
951
+ sessionId: result.sessionId,
952
+ previewUrl,
953
+ ...(previewAccessNote ? { previewAccessNote } : {}),
954
+ };
955
+ }
956
+ return {
957
+ ok: true,
958
+ status: 'approval_required',
959
+ response: result.response,
960
+ sessionId: result.sessionId,
961
+ ...(result.executionId ? { executionId: result.executionId } : {}),
962
+ suspensions: result.suspensions.map(({ runId, toolCallId, toolName }) => ({
963
+ runId,
964
+ toolCallId,
965
+ toolName,
966
+ })),
967
+ previewUrl,
968
+ ...(previewAccessNote ? { previewAccessNote } : {}),
969
+ };
970
+ }
971
+ catch (error) {
972
+ if (error instanceof agent_test_run_service_1.InvalidAgentTestRunCheckpointError) {
973
+ return {
974
+ ok: false,
975
+ status: 'error',
976
+ code: error.code,
977
+ message: error.message,
978
+ };
979
+ }
980
+ return {
981
+ ok: false,
982
+ status: 'error',
983
+ code: 'execution_failed',
984
+ message: error instanceof Error ? error.message : 'Agent test run failed.',
985
+ };
986
+ }
987
+ }
816
988
  async applyMutation(user, input, config, projectId) {
817
989
  const { agentId, operation } = input;
818
990
  const telemetryContext = { user, modifiedBy: 'mcp' };
@@ -1041,25 +1213,16 @@ let McpAgentToolsService = class McpAgentToolsService {
1041
1213
  await this.assertScope(user, projectId, 'agent:update');
1042
1214
  return input.action === 'disconnect'
1043
1215
  ? await this.disconnectIntegration(user, input, agent)
1044
- : await this.connectIntegration(user, input, agent, projectId);
1216
+ : await this.connectIntegration(user, input, agent);
1045
1217
  }
1046
1218
  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({
1219
+ const { savedAgent: saved } = await this.integrationManagementService.disconnect({
1220
+ agent,
1221
+ user,
1049
1222
  type: input.type,
1050
1223
  credentialId: input.credentialId,
1224
+ modifiedBy: 'mcp',
1051
1225
  });
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
1226
  return {
1064
1227
  ok: true,
1065
1228
  agentId: input.agentId,
@@ -1070,24 +1233,18 @@ let McpAgentToolsService = class McpAgentToolsService {
1070
1233
  configHash: (0, agent_config_hash_1.getAgentConfigHash)(this.configFromEntity(saved)),
1071
1234
  };
1072
1235
  }
1073
- async connectIntegration(user, input, agent, projectId) {
1236
+ async connectIntegration(user, input, agent) {
1074
1237
  const candidate = {
1075
1238
  type: input.type,
1076
1239
  credentialId: input.credentialId,
1077
1240
  ...(input.settings ? { settings: input.settings } : {}),
1078
1241
  };
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 });
1242
+ const { savedAgent: saved } = await this.integrationManagementService.connect({
1243
+ agent,
1244
+ user,
1245
+ integration: candidate,
1246
+ modifiedBy: 'mcp',
1247
+ });
1091
1248
  const result = {
1092
1249
  ok: true,
1093
1250
  agentId: input.agentId,
@@ -1099,8 +1256,6 @@ let McpAgentToolsService = class McpAgentToolsService {
1099
1256
  };
1100
1257
  if (saved.activeVersionId === null)
1101
1258
  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
1259
  return {
1105
1260
  ...result,
1106
1261
  connected: true,
@@ -1152,6 +1307,6 @@ let McpAgentToolsService = class McpAgentToolsService {
1152
1307
  exports.McpAgentToolsService = McpAgentToolsService;
1153
1308
  exports.McpAgentToolsService = McpAgentToolsService = __decorate([
1154
1309
  (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])
1310
+ __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_test_run_service_1.AgentTestRunService, agent_custom_tools_service_1.AgentCustomToolsService, agent_secure_runtime_1.AgentSecureRuntime, agent_integration_persistence_service_1.AgentIntegrationPersistenceService, agent_integration_management_service_1.AgentIntegrationManagementService, 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
1311
  ], McpAgentToolsService);
1157
1312
  //# sourceMappingURL=agent-tools.service.js.map