n8n 2.34.4 → 2.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (658) 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/get-resource-locator-options.tool.d.ts +2 -2
  136. package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +1 -0
  137. package/dist/modules/agents/builder/interactive/finish-setup.tool.js +4 -2
  138. package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
  139. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +68 -2
  140. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  141. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +1 -0
  142. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
  143. package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
  144. package/dist/modules/agents/builder/prompts/tools.prompt.js +5 -2
  145. package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
  146. package/dist/modules/agents/builder/skills/external-services.skill.js +26 -2
  147. package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
  148. package/dist/modules/agents/entities/agent-credential-dependency.entity.d.ts +9 -0
  149. package/dist/modules/agents/entities/agent-credential-dependency.entity.js +40 -0
  150. package/dist/modules/agents/entities/agent-credential-dependency.entity.js.map +1 -0
  151. package/dist/modules/agents/entities/agent-execution.entity.d.ts +1 -1
  152. package/dist/modules/agents/entities/agent-execution.entity.js +2 -1
  153. package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
  154. package/dist/modules/agents/execution-recorder.d.ts +7 -1
  155. package/dist/modules/agents/execution-recorder.js +64 -8
  156. package/dist/modules/agents/execution-recorder.js.map +1 -1
  157. package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +6 -2
  158. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +24 -3
  159. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
  160. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +3 -2
  161. package/dist/modules/agents/integrations/agent-chat-bridge.js +30 -13
  162. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  163. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +3 -2
  164. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +25 -12
  165. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
  166. package/dist/modules/agents/integrations/agent-chat-integration.d.ts +38 -6
  167. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
  168. package/dist/modules/agents/integrations/agent-chat-message-context.js +13 -6
  169. package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
  170. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js +7 -1
  171. package/dist/modules/agents/integrations/agent-chat-stream-consumer.js.map +1 -1
  172. package/dist/modules/agents/integrations/callback-store.d.ts +13 -4
  173. package/dist/modules/agents/integrations/callback-store.js +44 -18
  174. package/dist/modules/agents/integrations/callback-store.js.map +1 -1
  175. package/dist/modules/agents/integrations/chat-integration.service.d.ts +7 -3
  176. package/dist/modules/agents/integrations/chat-integration.service.js +59 -22
  177. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  178. package/dist/modules/agents/integrations/component-mapper.d.ts +1 -1
  179. package/dist/modules/agents/integrations/component-mapper.js +1 -1
  180. package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
  181. package/dist/modules/agents/integrations/esm-loader.d.ts +1 -0
  182. package/dist/modules/agents/integrations/esm-loader.js +4 -0
  183. package/dist/modules/agents/integrations/esm-loader.js.map +1 -1
  184. package/dist/modules/agents/integrations/integration-action-executor.d.ts +2 -0
  185. package/dist/modules/agents/integrations/integration-action-executor.js +74 -20
  186. package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
  187. package/dist/modules/agents/integrations/integration-tool-definitions.js +35 -2
  188. package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
  189. package/dist/modules/agents/integrations/integration-tool-execution.js +10 -5
  190. package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
  191. package/dist/modules/agents/integrations/integration-tool-schema.js +8 -2
  192. package/dist/modules/agents/integrations/integration-tool-schema.js.map +1 -1
  193. package/dist/modules/agents/integrations/integration-tool-types.d.ts +2 -0
  194. package/dist/modules/agents/integrations/n8n-memory.js +6 -7
  195. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
  196. package/dist/modules/agents/integrations/platforms/discord-gateway.d.ts +32 -0
  197. package/dist/modules/agents/integrations/platforms/discord-gateway.js +138 -0
  198. package/dist/modules/agents/integrations/platforms/discord-gateway.js.map +1 -0
  199. package/dist/modules/agents/integrations/platforms/discord-integration.d.ts +73 -0
  200. package/dist/modules/agents/integrations/platforms/discord-integration.js +364 -0
  201. package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -0
  202. package/dist/modules/agents/integrations/platforms/discord-operations.d.ts +64 -0
  203. package/dist/modules/agents/integrations/platforms/discord-operations.js +176 -0
  204. package/dist/modules/agents/integrations/platforms/discord-operations.js.map +1 -0
  205. package/dist/modules/agents/integrations/platforms/{slack-bridge-behavior.d.ts → slack/slack-bridge-behavior.d.ts} +3 -3
  206. package/dist/modules/agents/integrations/platforms/slack/slack-bridge-behavior.js.map +1 -0
  207. package/dist/modules/agents/integrations/platforms/{slack-integration.d.ts → slack/slack-integration.d.ts} +11 -6
  208. package/dist/modules/agents/integrations/platforms/{slack-integration.js → slack/slack-integration.js} +32 -23
  209. package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -0
  210. package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.d.ts +35 -0
  211. package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.js +150 -0
  212. package/dist/modules/agents/integrations/platforms/slack/slack-manual-setup.service.js.map +1 -0
  213. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.d.ts +36 -0
  214. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +193 -0
  215. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -0
  216. package/dist/modules/agents/integrations/platforms/slack/slack-operations.d.ts +10 -0
  217. package/dist/modules/agents/integrations/platforms/{slack-operations.js → slack/slack-operations.js} +1 -57
  218. package/dist/modules/agents/integrations/platforms/slack/slack-operations.js.map +1 -0
  219. package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js +6 -36
  220. package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js.map +1 -1
  221. package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +3 -2
  222. package/dist/modules/agents/integrations/platforms/telegram-integration.js +14 -5
  223. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
  224. package/dist/modules/agents/integrations/platforms/typing-indicator.d.ts +9 -0
  225. package/dist/modules/agents/integrations/platforms/typing-indicator.js +42 -0
  226. package/dist/modules/agents/integrations/platforms/typing-indicator.js.map +1 -0
  227. package/dist/modules/agents/integrations/recording/recording-adapter.js +11 -0
  228. package/dist/modules/agents/integrations/recording/recording-adapter.js.map +1 -1
  229. package/dist/modules/agents/json-config/node-tool-ai-gateway.service.d.ts +9 -0
  230. package/dist/modules/agents/json-config/node-tool-ai-gateway.service.js +34 -0
  231. package/dist/modules/agents/json-config/node-tool-ai-gateway.service.js.map +1 -0
  232. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.d.ts +4 -0
  233. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js +152 -0
  234. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js.map +1 -0
  235. package/dist/modules/agents/repositories/agent-credential-dependency.repository.d.ts +12 -0
  236. package/dist/modules/agents/repositories/agent-credential-dependency.repository.js +92 -0
  237. package/dist/modules/agents/repositories/agent-credential-dependency.repository.js.map +1 -0
  238. package/dist/modules/agents/repositories/agent-execution.repository.d.ts +7 -0
  239. package/dist/modules/agents/repositories/agent-execution.repository.js +20 -0
  240. package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
  241. package/dist/modules/agents/repositories/agent.repository.d.ts +2 -0
  242. package/dist/modules/agents/repositories/agent.repository.js +18 -0
  243. package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
  244. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +2 -0
  245. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +69 -5
  246. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
  247. package/dist/modules/agents/tools/node-tool-factory.js +5 -1
  248. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
  249. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +7 -4
  250. package/dist/modules/agents/tools/workflow-tool-factory.js +86 -41
  251. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  252. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.d.ts +14 -0
  253. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js +50 -0
  254. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js.map +1 -0
  255. package/dist/modules/agents/tools/workflow-tool-workflow-resolver.d.ts +3 -3
  256. package/dist/modules/agents/tools/workflow-tool-workflow-resolver.js +28 -23
  257. package/dist/modules/agents/tools/workflow-tool-workflow-resolver.js.map +1 -1
  258. package/dist/modules/agents/utils/extract-agent-credential-ids.d.ts +1 -0
  259. package/dist/modules/agents/utils/extract-agent-credential-ids.js +41 -0
  260. package/dist/modules/agents/utils/extract-agent-credential-ids.js.map +1 -0
  261. package/dist/modules/agents/utils/node-tool-validation.js +2 -2
  262. package/dist/modules/agents/utils/node-tool-validation.js.map +1 -1
  263. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.d.ts +6 -2
  264. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js +26 -3
  265. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js.map +1 -1
  266. package/dist/modules/data-table/data-table-permissions.d.ts +5 -0
  267. package/dist/modules/data-table/data-table-permissions.js +14 -0
  268. package/dist/modules/data-table/data-table-permissions.js.map +1 -0
  269. package/dist/modules/data-table/data-table-proxy.service.js +2 -0
  270. package/dist/modules/data-table/data-table-proxy.service.js.map +1 -1
  271. package/dist/modules/data-table/data-table.controller.d.ts +1 -1
  272. package/dist/modules/data-table/data-table.controller.js +7 -19
  273. package/dist/modules/data-table/data-table.controller.js.map +1 -1
  274. package/dist/modules/data-table/data-table.service.d.ts +3 -0
  275. package/dist/modules/data-table/data-table.service.js.map +1 -1
  276. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.d.ts +1 -0
  277. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js +8 -0
  278. package/dist/modules/dynamic-credentials.ee/services/credential-check-proxy.service.js.map +1 -1
  279. package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.d.ts +1 -0
  280. package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js +100 -3
  281. package/dist/modules/external-secrets.ee/providers/azure-key-vault/azure-key-vault.js.map +1 -1
  282. package/dist/modules/external-secrets.ee/providers/azure-key-vault/types.d.ts +4 -0
  283. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.d.ts +2 -1
  284. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js +11 -5
  285. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js.map +1 -1
  286. package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +6 -3
  287. package/dist/modules/insights/database/repositories/insights-by-period.repository.js +31 -11
  288. package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
  289. package/dist/modules/insights/insights.controller.js +13 -7
  290. package/dist/modules/insights/insights.controller.js.map +1 -1
  291. package/dist/modules/insights/insights.service.d.ts +6 -3
  292. package/dist/modules/insights/insights.service.js +6 -3
  293. package/dist/modules/insights/insights.service.js.map +1 -1
  294. package/dist/modules/instance-ai/eval/agent-execution.service.js +10 -3
  295. package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
  296. package/dist/modules/instance-ai/eval/execution.service.d.ts +1 -0
  297. package/dist/modules/instance-ai/eval/execution.service.js +37 -3
  298. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  299. package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +5 -1
  300. package/dist/modules/instance-ai/eval/thread-restore.service.js +67 -9
  301. package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
  302. package/dist/modules/instance-ai/instance-ai-model-catalog.service.d.ts +15 -0
  303. package/dist/modules/instance-ai/instance-ai-model-catalog.service.js +130 -0
  304. package/dist/modules/instance-ai/instance-ai-model-catalog.service.js.map +1 -0
  305. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +17 -1
  306. package/dist/modules/instance-ai/instance-ai-settings.service.js +234 -24
  307. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  308. package/dist/modules/instance-ai/instance-ai-verification.service.d.ts +20 -0
  309. package/dist/modules/instance-ai/instance-ai-verification.service.js +232 -0
  310. package/dist/modules/instance-ai/instance-ai-verification.service.js.map +1 -0
  311. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +4 -0
  312. package/dist/modules/instance-ai/instance-ai.adapter.service.js +78 -4
  313. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  314. package/dist/modules/instance-ai/instance-ai.controller.d.ts +9 -2
  315. package/dist/modules/instance-ai/instance-ai.controller.js +84 -2
  316. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  317. package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -0
  318. package/dist/modules/instance-ai/instance-ai.module.js +3 -7
  319. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  320. package/dist/modules/instance-ai/instance-ai.service.d.ts +5 -1
  321. package/dist/modules/instance-ai/instance-ai.service.js +231 -60
  322. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  323. package/dist/modules/instance-ai/node-definition-resolver.d.ts +0 -1
  324. package/dist/modules/instance-ai/node-definition-resolver.js +0 -19
  325. package/dist/modules/instance-ai/node-definition-resolver.js.map +1 -1
  326. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.d.ts +1 -0
  327. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js +37 -2
  328. package/dist/modules/instance-ai/sandbox/instance-ai-sandbox.service.js.map +1 -1
  329. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js +6 -6
  330. package/dist/modules/instance-ai/storage/typeorm-observation-log-store.js.map +1 -1
  331. package/dist/modules/instance-ai/suspended-run-restorer.service.d.ts +1 -1
  332. package/dist/modules/instance-ai/suspended-run-restorer.service.js +9 -0
  333. package/dist/modules/instance-ai/suspended-run-restorer.service.js.map +1 -1
  334. package/dist/modules/mcp/mcp-protected-resource.d.ts +3 -4
  335. package/dist/modules/mcp/mcp-protected-resource.js +4 -4
  336. package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
  337. package/dist/modules/mcp/mcp-scopes.js +2 -0
  338. package/dist/modules/mcp/mcp-scopes.js.map +1 -1
  339. package/dist/modules/mcp/mcp-server-middleware.service.js +1 -0
  340. package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
  341. package/dist/modules/mcp/mcp.constants.d.ts +4 -0
  342. package/dist/modules/mcp/mcp.constants.js +5 -1
  343. package/dist/modules/mcp/mcp.constants.js.map +1 -1
  344. package/dist/modules/mcp/mcp.controller.js +14 -14
  345. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  346. package/dist/modules/mcp/mcp.service.d.ts +4 -3
  347. package/dist/modules/mcp/mcp.service.js +49 -34
  348. package/dist/modules/mcp/mcp.service.js.map +1 -1
  349. package/dist/modules/mcp/mcp.types.d.ts +31 -5
  350. package/dist/modules/mcp/mcp.types.js.map +1 -1
  351. package/dist/modules/mcp/mcp.utils.d.ts +1 -0
  352. package/dist/modules/mcp/mcp.utils.js +22 -5
  353. package/dist/modules/mcp/mcp.utils.js.map +1 -1
  354. package/dist/modules/mcp/tool-schema.util.d.ts +3 -0
  355. package/dist/modules/mcp/tool-schema.util.js +32 -0
  356. package/dist/modules/mcp/tool-schema.util.js.map +1 -0
  357. package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
  358. package/dist/modules/mcp/tools/agents/agent-reference.js +17 -6
  359. package/dist/modules/mcp/tools/agents/agent-reference.js.map +1 -1
  360. package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +9 -8
  361. package/dist/modules/mcp/tools/agents/agent-tools.service.js +207 -52
  362. package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
  363. package/dist/modules/mcp/tools/execute-workflow.tool.js +1 -1
  364. package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
  365. package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +4 -1
  366. package/dist/modules/mcp/tools/get-workflow-details.tool.js +60 -23
  367. package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
  368. package/dist/modules/mcp/tools/list-credentials.tool.js +1 -1
  369. package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
  370. package/dist/modules/mcp/tools/schemas.d.ts +81 -40
  371. package/dist/modules/mcp/tools/schemas.js +31 -11
  372. package/dist/modules/mcp/tools/schemas.js.map +1 -1
  373. package/dist/modules/mcp/tools/search-workflows.tool.js +1 -9
  374. package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
  375. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.d.ts +1 -1
  376. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +2 -7
  377. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -1
  378. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +2 -11
  379. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
  380. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +2 -2
  381. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +2 -1
  382. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
  383. package/dist/modules/mcp-registry/registry/mcp-registry-search.d.ts +1 -0
  384. package/dist/modules/mcp-registry/registry/mcp-registry-search.js +17 -5
  385. package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -1
  386. package/dist/modules/n8n-packages/engine/import-blocked.error.js +2 -0
  387. package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
  388. package/dist/modules/n8n-packages/engine/import-gates.d.ts +3 -4
  389. package/dist/modules/n8n-packages/engine/import-gates.js +10 -8
  390. package/dist/modules/n8n-packages/engine/import-gates.js.map +1 -1
  391. package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +6 -2
  392. package/dist/modules/n8n-packages/engine/import-orchestrator.js +36 -8
  393. package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -1
  394. package/dist/modules/n8n-packages/engine/import-result.d.ts +2 -0
  395. package/dist/modules/n8n-packages/engine/import-result.js +13 -2
  396. package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
  397. package/dist/modules/n8n-packages/engine/import-telemetry.js +8 -2
  398. package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
  399. package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +3 -0
  400. package/dist/modules/n8n-packages/engine/n8n-package-parser.js +29 -0
  401. package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
  402. package/dist/modules/n8n-packages/engine/package-layout.d.ts +18 -1
  403. package/dist/modules/n8n-packages/engine/package-layout.js +36 -7
  404. package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -1
  405. package/dist/modules/n8n-packages/engine/project-package-importer.js +28 -16
  406. package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
  407. package/dist/modules/n8n-packages/engine/workflow-package-importer.js +12 -12
  408. package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
  409. package/dist/modules/n8n-packages/entities/project/project-conflict-policy.d.ts +7 -0
  410. package/dist/modules/n8n-packages/entities/project/project-conflict-policy.js +12 -0
  411. package/dist/modules/n8n-packages/entities/project/project-conflict-policy.js.map +1 -0
  412. package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +13 -3
  413. package/dist/modules/n8n-packages/entities/project/project-importer.d.ts +3 -3
  414. package/dist/modules/n8n-packages/entities/project/project-importer.js +58 -29
  415. package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
  416. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.d.ts +4 -1
  417. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js +10 -3
  418. package/dist/modules/n8n-packages/entities/tag/tag-import-decision.js.map +1 -1
  419. package/dist/modules/n8n-packages/entities/tag/tag-importer.d.ts +1 -4
  420. package/dist/modules/n8n-packages/entities/tag/tag-importer.js +22 -10
  421. package/dist/modules/n8n-packages/entities/tag/tag-importer.js.map +1 -1
  422. package/dist/modules/n8n-packages/entities/tag/tag.types.d.ts +13 -0
  423. package/dist/modules/n8n-packages/entities/tag/tag.types.js +36 -0
  424. package/dist/modules/n8n-packages/entities/tag/tag.types.js.map +1 -1
  425. package/dist/modules/n8n-packages/entities/variable/variable-importer.d.ts +6 -5
  426. package/dist/modules/n8n-packages/entities/variable/variable-importer.js +85 -21
  427. package/dist/modules/n8n-packages/entities/variable/variable-importer.js.map +1 -1
  428. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.d.ts +1 -0
  429. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js +8 -3
  430. package/dist/modules/n8n-packages/entities/variable/variable-missing-mode.js.map +1 -1
  431. package/dist/modules/n8n-packages/entities/variable/variable.exporter.d.ts +1 -0
  432. package/dist/modules/n8n-packages/entities/variable/variable.exporter.js +18 -23
  433. package/dist/modules/n8n-packages/entities/variable/variable.exporter.js.map +1 -1
  434. package/dist/modules/n8n-packages/entities/variable/variable.types.d.ts +21 -2
  435. package/dist/modules/n8n-packages/entities/variable/variable.types.js +15 -0
  436. package/dist/modules/n8n-packages/entities/variable/variable.types.js.map +1 -1
  437. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.d.ts +6 -2
  438. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js +33 -11
  439. package/dist/modules/n8n-packages/entities/workflow/workflow-publisher.js.map +1 -1
  440. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +35 -3
  441. package/dist/modules/n8n-packages/n8n-packages.types.js +12 -1
  442. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  443. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +0 -11
  444. package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +0 -10
  445. package/dist/modules/n8n-packages/spec/requirements.schema.js +0 -1
  446. package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
  447. package/dist/modules/n8n-packages/spec/serialized/variable.schema.d.ts +3 -3
  448. package/dist/modules/n8n-packages/spec/serialized/variable.schema.js +3 -2
  449. package/dist/modules/n8n-packages/spec/serialized/variable.schema.js.map +1 -1
  450. package/dist/modules/oauth-server/oauth-server.service.js +2 -2
  451. package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
  452. package/dist/modules/otel/execution-level-tracer.d.ts +2 -0
  453. package/dist/modules/otel/execution-level-tracer.js +4 -0
  454. package/dist/modules/otel/execution-level-tracer.js.map +1 -1
  455. package/dist/modules/redaction/redaction-context-hook.d.ts +3 -1
  456. package/dist/modules/redaction/redaction-context-hook.js +9 -2
  457. package/dist/modules/redaction/redaction-context-hook.js.map +1 -1
  458. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +4 -1
  459. package/dist/modules/source-control.ee/source-control-import.service.ee.js +26 -6
  460. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  461. package/dist/modules/workflow-index/workflow-dependency-query.service.d.ts +8 -1
  462. package/dist/modules/workflow-index/workflow-dependency-query.service.js +76 -18
  463. package/dist/modules/workflow-index/workflow-dependency-query.service.js.map +1 -1
  464. package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.d.ts +16 -0
  465. package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js +95 -0
  466. package/dist/modules/workflow-reviews.ee/workflow-review-auto-close.service.js.map +1 -0
  467. package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.d.ts +15 -0
  468. package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.js +52 -0
  469. package/dist/modules/workflow-reviews.ee/workflow-review-decision-eligibility.service.js.map +1 -0
  470. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +3 -1
  471. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +10 -4
  472. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
  473. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js +1 -1
  474. package/dist/modules/workflow-reviews.ee/workflow-review-publish-guard.service.js.map +1 -1
  475. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +9 -5
  476. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +71 -40
  477. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +1 -1
  478. package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js +3 -0
  479. package/dist/modules/workflow-reviews.ee/workflow-reviews.module.js.map +1 -1
  480. package/dist/node-execution/ephemeral-node-executor.js +20 -13
  481. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  482. package/dist/oauth/dcr-managed-fields.d.ts +6 -0
  483. package/dist/oauth/dcr-managed-fields.js +13 -0
  484. package/dist/oauth/dcr-managed-fields.js.map +1 -0
  485. package/dist/oauth/oauth.service.d.ts +1 -0
  486. package/dist/oauth/oauth.service.js +24 -25
  487. package/dist/oauth/oauth.service.js.map +1 -1
  488. package/dist/posthog/index.d.ts +2 -0
  489. package/dist/posthog/index.js +19 -0
  490. package/dist/posthog/index.js.map +1 -1
  491. package/dist/public-api/public-api-controller.registry.d.ts +1 -0
  492. package/dist/public-api/public-api-controller.registry.js +36 -35
  493. package/dist/public-api/public-api-controller.registry.js.map +1 -1
  494. package/dist/public-api/public-api-route-resolver.d.ts +38 -0
  495. package/dist/public-api/public-api-route-resolver.js +136 -0
  496. package/dist/public-api/public-api-route-resolver.js.map +1 -0
  497. package/dist/public-api/types.d.ts +3 -6
  498. package/dist/public-api/v1/controllers/index.d.ts +1 -0
  499. package/dist/public-api/v1/controllers/index.js +1 -0
  500. package/dist/public-api/v1/controllers/index.js.map +1 -1
  501. package/dist/public-api/v1/controllers/roles.public.controller.d.ts +11 -0
  502. package/dist/public-api/v1/controllers/roles.public.controller.js +65 -0
  503. package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -0
  504. package/dist/public-api/v1/controllers/tags.public.controller.js +9 -2
  505. package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
  506. package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +10 -2
  507. package/dist/public-api/v1/controllers/workflows.public.controller.js +132 -4
  508. package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
  509. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +7 -15
  510. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
  511. package/dist/public-api/v1/handlers/decorator-routed.handler.d.ts +2 -0
  512. package/dist/public-api/v1/handlers/decorator-routed.handler.js +10 -0
  513. package/dist/public-api/v1/handlers/decorator-routed.handler.js.map +1 -0
  514. package/dist/public-api/v1/handlers/discover/discover.service.js +54 -49
  515. package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
  516. package/dist/public-api/v1/handlers/executions/executions.handler.js +25 -65
  517. package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
  518. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +2 -0
  519. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
  520. package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -1
  521. package/dist/public-api/v1/handlers/workflows/workflows.handler.js +44 -122
  522. package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
  523. package/dist/public-api/v1/openapi-gen/decorator-routes.d.ts +18 -0
  524. package/dist/public-api/v1/openapi-gen/decorator-routes.js +160 -0
  525. package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -0
  526. package/dist/public-api/v1/openapi-gen/generate.d.ts +25 -0
  527. package/dist/public-api/v1/openapi-gen/generate.js +149 -0
  528. package/dist/public-api/v1/openapi-gen/generate.js.map +1 -0
  529. package/dist/public-api/v1/openapi-gen/zod-extend.d.ts +1 -0
  530. package/dist/public-api/v1/openapi-gen/zod-extend.js +6 -0
  531. package/dist/public-api/v1/openapi-gen/zod-extend.js.map +1 -0
  532. package/dist/public-api/v1/openapi.yml +625 -166
  533. package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -3
  534. package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
  535. package/dist/scaling/constants.d.ts +2 -2
  536. package/dist/scaling/constants.js +1 -0
  537. package/dist/scaling/constants.js.map +1 -1
  538. package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -1
  539. package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
  540. package/dist/server.js +1 -0
  541. package/dist/server.js.map +1 -1
  542. package/dist/{modules/mcp/tools/workflow-builder → services}/ai-gateway-eligibility.d.ts +1 -0
  543. package/dist/{modules/mcp/tools/workflow-builder → services}/ai-gateway-eligibility.js +7 -1
  544. package/dist/services/ai-gateway-eligibility.js.map +1 -0
  545. package/dist/services/ai-gateway.service.d.ts +2 -0
  546. package/dist/services/ai-gateway.service.js +17 -3
  547. package/dist/services/ai-gateway.service.js.map +1 -1
  548. package/dist/services/cache/cache.service.d.ts +2 -0
  549. package/dist/services/cache/cache.service.js +21 -0
  550. package/dist/services/cache/cache.service.js.map +1 -1
  551. package/dist/services/cache/redis.cache-manager.d.ts +1 -0
  552. package/dist/services/cache/redis.cache-manager.js +6 -0
  553. package/dist/services/cache/redis.cache-manager.js.map +1 -1
  554. package/dist/services/credentials-tester.service.d.ts +5 -1
  555. package/dist/services/credentials-tester.service.js +9 -3
  556. package/dist/services/credentials-tester.service.js.map +1 -1
  557. package/dist/services/folder.service.js.map +1 -1
  558. package/dist/services/free-ai-credits.service.js +1 -1
  559. package/dist/services/free-ai-credits.service.js.map +1 -1
  560. package/dist/services/frontend.service.js +3 -1
  561. package/dist/services/frontend.service.js.map +1 -1
  562. package/dist/services/node-resource-explorer.service.d.ts +13 -0
  563. package/dist/services/node-resource-explorer.service.js +117 -0
  564. package/dist/services/node-resource-explorer.service.js.map +1 -1
  565. package/dist/services/ownership-transfer/ownership-transfer.manifest.json +1 -1
  566. package/dist/services/project.service.ee.d.ts +3 -3
  567. package/dist/services/project.service.ee.js +4 -7
  568. package/dist/services/project.service.ee.js.map +1 -1
  569. package/dist/services/role-authorization.d.ts +3 -0
  570. package/dist/services/role-authorization.js +14 -0
  571. package/dist/services/role-authorization.js.map +1 -0
  572. package/dist/services/tag.service.d.ts +5 -2
  573. package/dist/services/tag.service.js +9 -2
  574. package/dist/services/tag.service.js.map +1 -1
  575. package/dist/task-runners/task-broker/auth/task-broker-auth.controller.d.ts +1 -0
  576. package/dist/task-runners/task-broker/auth/task-broker-auth.controller.js +2 -2
  577. package/dist/task-runners/task-broker/auth/task-broker-auth.controller.js.map +1 -1
  578. package/dist/task-runners/task-broker/auth/task-broker-auth.service.d.ts +6 -2
  579. package/dist/task-runners/task-broker/auth/task-broker-auth.service.js +8 -4
  580. package/dist/task-runners/task-broker/auth/task-broker-auth.service.js.map +1 -1
  581. package/dist/task-runners/task-broker/task-broker-server.d.ts +1 -0
  582. package/dist/task-runners/task-broker/task-broker-server.js +13 -3
  583. package/dist/task-runners/task-broker/task-broker-server.js.map +1 -1
  584. package/dist/task-runners/task-broker/task-broker-ws-server.d.ts +1 -0
  585. package/dist/task-runners/task-broker/task-broker-ws-server.js +8 -5
  586. package/dist/task-runners/task-broker/task-broker-ws-server.js.map +1 -1
  587. package/dist/task-runners/task-broker/task-broker.service.js +2 -9
  588. package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
  589. package/dist/task-runners/task-runner-lifecycle-events.d.ts +0 -1
  590. package/dist/task-runners/task-runner-process-base.d.ts +2 -2
  591. package/dist/task-runners/task-runner-process-base.js +14 -10
  592. package/dist/task-runners/task-runner-process-base.js.map +1 -1
  593. package/dist/task-runners/task-runner-process-js.d.ts +1 -2
  594. package/dist/task-runners/task-runner-process-js.js +4 -4
  595. package/dist/task-runners/task-runner-process-js.js.map +1 -1
  596. package/dist/task-runners/task-runner-process-py.d.ts +1 -2
  597. package/dist/task-runners/task-runner-process-py.js +2 -2
  598. package/dist/task-runners/task-runner-process-py.js.map +1 -1
  599. package/dist/utils/node-definition-dirs.d.ts +1 -0
  600. package/dist/utils/node-definition-dirs.js +24 -0
  601. package/dist/utils/node-definition-dirs.js.map +1 -0
  602. package/dist/webhooks/constants.d.ts +1 -0
  603. package/dist/webhooks/constants.js +2 -1
  604. package/dist/webhooks/constants.js.map +1 -1
  605. package/dist/webhooks/live-webhooks.d.ts +4 -2
  606. package/dist/webhooks/live-webhooks.js +25 -4
  607. package/dist/webhooks/live-webhooks.js.map +1 -1
  608. package/dist/webhooks/webhook-execution-context.d.ts +5 -2
  609. package/dist/webhooks/webhook-execution-context.js +10 -0
  610. package/dist/webhooks/webhook-execution-context.js.map +1 -1
  611. package/dist/webhooks/webhook-helpers.js +9 -8
  612. package/dist/webhooks/webhook-helpers.js.map +1 -1
  613. package/dist/webhooks/webhook.service.d.ts +5 -1
  614. package/dist/webhooks/webhook.service.js +52 -9
  615. package/dist/webhooks/webhook.service.js.map +1 -1
  616. package/dist/workflow-runner.js.map +1 -1
  617. package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +3 -0
  618. package/dist/workflows/triggers/trigger-execution-context.factory.js +43 -38
  619. package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
  620. package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +0 -1
  621. package/dist/workflows/triggers/webhook-trigger-registrar.js +1 -16
  622. package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
  623. package/dist/workflows/workflow-finder.service.d.ts +20 -31
  624. package/dist/workflows/workflow-finder.service.js +42 -9
  625. package/dist/workflows/workflow-finder.service.js.map +1 -1
  626. package/dist/workflows/workflow-mutation-hooks-proxy.service.d.ts +14 -0
  627. package/dist/workflows/workflow-mutation-hooks-proxy.service.js +35 -0
  628. package/dist/workflows/workflow-mutation-hooks-proxy.service.js.map +1 -0
  629. package/dist/workflows/workflow-sharing.service.d.ts +4 -1
  630. package/dist/workflows/workflow-sharing.service.js +14 -2
  631. package/dist/workflows/workflow-sharing.service.js.map +1 -1
  632. package/dist/workflows/workflow.service.d.ts +9 -6
  633. package/dist/workflows/workflow.service.ee.d.ts +3 -3
  634. package/dist/workflows/workflow.service.ee.js +20 -7
  635. package/dist/workflows/workflow.service.ee.js.map +1 -1
  636. package/dist/workflows/workflow.service.js +33 -9
  637. package/dist/workflows/workflow.service.js.map +1 -1
  638. package/package.json +43 -39
  639. package/templates/form-shell.handlebars +418 -0
  640. package/templates/form-trigger.handlebars +30 -1
  641. package/dist/modules/agents/integrations/platforms/slack-bridge-behavior.js.map +0 -1
  642. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +0 -1
  643. package/dist/modules/agents/integrations/platforms/slack-operations.d.ts +0 -17
  644. package/dist/modules/agents/integrations/platforms/slack-operations.js.map +0 -1
  645. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.d.ts +0 -48
  646. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js +0 -42
  647. package/dist/modules/agents/integrations/platforms/slack-tool-definitions.js.map +0 -1
  648. package/dist/modules/agents/integrations/slack-app-setup.service.d.ts +0 -54
  649. package/dist/modules/agents/integrations/slack-app-setup.service.js +0 -326
  650. package/dist/modules/agents/integrations/slack-app-setup.service.js.map +0 -1
  651. package/dist/modules/mcp/tools/workflow-builder/ai-gateway-eligibility.js.map +0 -1
  652. package/dist/public-api/v1/handlers/executions/executions.service.d.ts +0 -14
  653. package/dist/public-api/v1/handlers/executions/executions.service.js +0 -49
  654. package/dist/public-api/v1/handlers/executions/executions.service.js.map +0 -1
  655. package/dist/public-api/v1/handlers/workflows/workflows.service.d.ts +0 -13
  656. package/dist/public-api/v1/handlers/workflows/workflows.service.js +0 -98
  657. package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +0 -1
  658. /package/dist/modules/agents/integrations/platforms/{slack-bridge-behavior.js → slack/slack-bridge-behavior.js} +0 -0
@@ -0,0 +1,73 @@
1
+ import type { RichCardComponentType } from '@n8n/api-types';
2
+ import { Logger } from '@n8n/backend-common';
3
+ import { OutboundHttp } from '@n8n/backend-network';
4
+ import type { Message, Thread } from 'chat';
5
+ import { InstanceSettings } from 'n8n-core';
6
+ import { AgentRepository } from '../../repositories/agent.repository';
7
+ import { AgentChatIntegration, type AgentChatIntegrationContext, type ActionDecisionMessageParams, type BridgeExecutionContext, type BridgeMessageContextParams, type BridgeResumeExecutionContext, type PlatformAgentContext, type PlatformContextQueryParams, type SettleActionMessageParams, type WebhookRequestContext, type WebhookRequestResolution } from '../agent-chat-integration';
8
+ import type { ChatInstance } from '../chat-integration.service';
9
+ import type { SuspendComponent } from '../component-mapper';
10
+ import type { ReplyExpectation } from '../integration-tools';
11
+ export declare class DiscordIntegration extends AgentChatIntegration {
12
+ private readonly logger;
13
+ private readonly agentRepository;
14
+ readonly type = "discord";
15
+ readonly credentialTypes: string[];
16
+ readonly displayLabel = "Discord";
17
+ readonly displayIcon = "discord";
18
+ readonly builderGuidance: {
19
+ capabilities: string[];
20
+ useIntegrationWhen: string[];
21
+ useNodeToolWhen: string[];
22
+ };
23
+ readonly supportedComponents: readonly RichCardComponentType[];
24
+ readonly actionToolDefinitions: import("../integration-tool-types").IntegrationActionDefinition[];
25
+ readonly contextToolDefinitions: import("../integration-tool-types").IntegrationContextQueryDefinition[];
26
+ readonly contextToolGuidance: string[];
27
+ readonly actionToolGuidance: string[];
28
+ readonly needsShortCallbackData = true;
29
+ readonly disableStreaming = true;
30
+ readonly deleteActionMessageBeforeResume = false;
31
+ resolveWebhookRequest(request: WebhookRequestContext): WebhookRequestResolution;
32
+ matchesWebhookConnection(credential: Record<string, unknown>, connectionSelector: string): boolean;
33
+ private readonly pendingConnections;
34
+ private readonly gateway;
35
+ private readonly httpClient;
36
+ constructor(logger: Logger, instanceSettings: InstanceSettings, agentRepository: AgentRepository, outboundHttp: OutboundHttp);
37
+ onBeforeConnect(ctx: AgentChatIntegrationContext): Promise<void>;
38
+ createAdapter(ctx: AgentChatIntegrationContext): Promise<unknown>;
39
+ onConnected(ctx: AgentChatIntegrationContext): Promise<void>;
40
+ onDisconnected(ctx: AgentChatIntegrationContext): Promise<void>;
41
+ settleActionMessage(params: SettleActionMessageParams): Promise<void>;
42
+ shouldSubscribeToNewMention({ thread }: {
43
+ thread: Thread;
44
+ message: Message;
45
+ }): boolean;
46
+ getReplyExpectation(params: {
47
+ message: BridgeMessageContextParams['message'];
48
+ isNewMention: boolean;
49
+ }): ReplyExpectation;
50
+ executeContextQuery(params: PlatformContextQueryParams): Promise<unknown>;
51
+ startAllGateways(): void;
52
+ stopAllGateways(): Promise<void>;
53
+ getPlatformAgentContext(chat: ChatInstance): PlatformAgentContext;
54
+ prepareInboundText(text: string, context: PlatformAgentContext): string;
55
+ createBridgeExecutionContext(params: BridgeMessageContextParams): Promise<BridgeExecutionContext>;
56
+ createResumeExecutionContext(params: {
57
+ thread: BridgeMessageContextParams['thread'];
58
+ logger: BridgeMessageContextParams['logger'];
59
+ agentId: string;
60
+ }): Promise<BridgeResumeExecutionContext>;
61
+ private startTyping;
62
+ formatActionDecisionMessage({ approved, selectedLabel, raw, user, }: ActionDecisionMessageParams): string;
63
+ normalizeComponents(components: SuspendComponent[]): SuspendComponent[];
64
+ private sessionKey;
65
+ private assertBotTokenAvailable;
66
+ private validateDiscordCredential;
67
+ private createAdapterLogger;
68
+ private extractBotToken;
69
+ private extractPublicKey;
70
+ private extractApplicationId;
71
+ private requireCredentialField;
72
+ private extractCardText;
73
+ }
@@ -0,0 +1,364 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DiscordIntegration = void 0;
13
+ const backend_common_1 = require("@n8n/backend-common");
14
+ const backend_network_1 = require("@n8n/backend-network");
15
+ const decorators_1 = require("@n8n/decorators");
16
+ const di_1 = require("@n8n/di");
17
+ const is_record_1 = require("@n8n/utils/is-record");
18
+ const n8n_core_1 = require("n8n-core");
19
+ const bad_request_error_1 = require("../../../../errors/response-errors/bad-request.error");
20
+ const conflict_error_1 = require("../../../../errors/response-errors/conflict.error");
21
+ const agent_repository_1 = require("../../repositories/agent.repository");
22
+ const agent_chat_integration_1 = require("../agent-chat-integration");
23
+ const esm_loader_1 = require("../esm-loader");
24
+ const integration_tool_definitions_1 = require("../integration-tool-definitions");
25
+ const discord_gateway_1 = require("./discord-gateway");
26
+ const discord_operations_1 = require("./discord-operations");
27
+ const typing_indicator_1 = require("./typing-indicator");
28
+ const DISCORD_TYPING_REFRESH_MS = 8000;
29
+ const DISCORD_API_URL = 'https://discord.com/api/v10';
30
+ let DiscordIntegration = class DiscordIntegration extends agent_chat_integration_1.AgentChatIntegration {
31
+ resolveWebhookRequest(request) {
32
+ if (request.headers['x-discord-gateway-token'] !== undefined) {
33
+ return { type: 'reject', response: { status: 404, body: { error: 'Not found' } } };
34
+ }
35
+ if (!(0, is_record_1.isRecord)(request.body) || typeof request.body.application_id !== 'string') {
36
+ return { type: 'no_match' };
37
+ }
38
+ return { type: 'select', connectionSelector: request.body.application_id };
39
+ }
40
+ matchesWebhookConnection(credential, connectionSelector) {
41
+ const applicationId = credential.applicationId;
42
+ return typeof applicationId === 'string' && applicationId.trim() === connectionSelector;
43
+ }
44
+ constructor(logger, instanceSettings, agentRepository, outboundHttp) {
45
+ super();
46
+ this.logger = logger;
47
+ this.agentRepository = agentRepository;
48
+ this.type = 'discord';
49
+ this.credentialTypes = ['discordBotApi'];
50
+ this.displayLabel = 'Discord';
51
+ this.displayIcon = 'discord';
52
+ this.builderGuidance = {
53
+ capabilities: [
54
+ 'Receive Discord mentions and direct messages as agent triggers.',
55
+ 'Respond in Discord channels, threads, and direct messages.',
56
+ 'Edit existing messages and add emoji reactions in the current Discord conversation.',
57
+ 'Render Discord embeds with buttons.',
58
+ ],
59
+ useIntegrationWhen: [
60
+ 'The agent should be chatted with from Discord or act as a Discord bot.',
61
+ 'The agent needs to reply to Discord users in the same conversation context.',
62
+ 'The agent needs to update or react to a Discord message in the current conversation.',
63
+ 'The agent should send Discord messages as the connected Discord bot.',
64
+ ],
65
+ useNodeToolWhen: [
66
+ 'Discord is only a backend API step and the agent does not need to be connected as a Discord chat surface.',
67
+ 'The request is a one-off Discord operation from another trigger without ongoing Discord conversation context.',
68
+ ],
69
+ };
70
+ this.supportedComponents = [
71
+ 'section',
72
+ 'button',
73
+ 'divider',
74
+ 'fields',
75
+ 'image',
76
+ ];
77
+ this.actionToolDefinitions = (0, integration_tool_definitions_1.resolveIntegrationActionDefinitions)([
78
+ 'respond',
79
+ 'send_dm',
80
+ 'send_channel_message',
81
+ 'edit_message',
82
+ 'add_reaction',
83
+ 'do_not_respond',
84
+ ]);
85
+ this.contextToolDefinitions = (0, integration_tool_definitions_1.resolveIntegrationContextQueryDefinitions)([
86
+ 'get_current_message_context',
87
+ 'get_current_subject',
88
+ 'search_channels',
89
+ ]);
90
+ this.contextToolGuidance = [
91
+ 'Use search_channels to turn a channel name such as "general" into a channel ID. The same name can appear in more than one server — guildName tells them apart. When the result includes nextCursor, pass it back to continue searching the bot’s remaining servers.',
92
+ ];
93
+ this.actionToolGuidance = [
94
+ 'For edit_message, pass the messageId returned by a previous Discord action or get_current_message_context. The current Discord conversation is selected automatically.',
95
+ 'For send_channel_message, channelId must be shaped "discord:<guildId>:<channelId>" — pass the value returned by search_channels or get_current_message_context. A bare Discord channel ID copied from the Discord app is rejected.',
96
+ 'A Discord mention is answered inside a thread created off that message. Use send_channel_message when the reply belongs in the channel itself rather than that thread.',
97
+ ];
98
+ this.needsShortCallbackData = true;
99
+ this.disableStreaming = true;
100
+ this.deleteActionMessageBeforeResume = false;
101
+ this.pendingConnections = new Map();
102
+ this.gateway = new discord_gateway_1.DiscordGateway(logger, instanceSettings);
103
+ this.httpClient = outboundHttp.requests({
104
+ ssrf: 'disabled',
105
+ });
106
+ }
107
+ async onBeforeConnect(ctx) {
108
+ const others = await this.agentRepository.findByIntegrationCredential(this.type, ctx.credentialId, ctx.projectId, ctx.agentId);
109
+ if (others.length > 0) {
110
+ throw new conflict_error_1.ConflictError(`Discord credential is already connected to agent "${others[0].name}"`);
111
+ }
112
+ await this.validateDiscordCredential(ctx);
113
+ }
114
+ async createAdapter(ctx) {
115
+ const botToken = this.extractBotToken(ctx.credential);
116
+ const publicKey = this.extractPublicKey(ctx.credential);
117
+ const applicationId = this.extractApplicationId(ctx.credential);
118
+ const { createDiscordAdapter } = await (0, esm_loader_1.loadDiscordAdapter)();
119
+ this.assertBotTokenAvailable(this.sessionKey(ctx), botToken);
120
+ const adapter = createDiscordAdapter({
121
+ botToken,
122
+ publicKey,
123
+ applicationId,
124
+ mentionRoleIds: [],
125
+ apiUrl: DISCORD_API_URL,
126
+ logger: this.createAdapterLogger(),
127
+ });
128
+ this.pendingConnections.set(this.sessionKey(ctx), {
129
+ adapter: adapter,
130
+ botToken,
131
+ });
132
+ return adapter;
133
+ }
134
+ async onConnected(ctx) {
135
+ const key = this.sessionKey(ctx);
136
+ const connection = this.pendingConnections.get(key);
137
+ this.pendingConnections.delete(key);
138
+ if (!connection)
139
+ return;
140
+ await this.gateway.discard(key);
141
+ this.gateway.register(key, {
142
+ ...connection,
143
+ ingressEnabled: ctx.ingressEnabled,
144
+ });
145
+ }
146
+ async onDisconnected(ctx) {
147
+ const key = this.sessionKey(ctx);
148
+ this.pendingConnections.delete(key);
149
+ await this.gateway.discard(key);
150
+ }
151
+ async settleActionMessage(params) {
152
+ const botToken = this.gateway.botTokenFor(`${params.agentId}:${params.integration.credentialId}`);
153
+ if (!botToken) {
154
+ throw new Error('Discord connection is not available to settle the action card');
155
+ }
156
+ await (0, discord_operations_1.settleDiscordActionMessage)({
157
+ httpClient: this.httpClient,
158
+ apiUrl: DISCORD_API_URL,
159
+ botToken,
160
+ threadId: params.threadId,
161
+ messageId: params.messageId,
162
+ content: params.content,
163
+ });
164
+ }
165
+ shouldSubscribeToNewMention({ thread }) {
166
+ const parts = thread.id.split(':');
167
+ if (parts[0] !== 'discord' || parts.length < 3)
168
+ return true;
169
+ if (parts[1] === '@me')
170
+ return true;
171
+ return Boolean(parts[3]);
172
+ }
173
+ getReplyExpectation(params) {
174
+ if (params.isNewMention || params.message.isMention === true)
175
+ return 'required';
176
+ const parts = params.message.threadId.split(':');
177
+ const isGuildThread = parts[0] === 'discord' && Boolean(parts[1] && parts[1] !== '@me' && parts[2] && parts[3]);
178
+ return isGuildThread ? 'optional' : 'required';
179
+ }
180
+ async executeContextQuery(params) {
181
+ const { agentId, integration } = params.descriptor;
182
+ const botToken = this.gateway.botTokenFor(`${agentId}:${integration.credentialId}`);
183
+ return await (0, discord_operations_1.executeDiscordContextQuery)({
184
+ httpClient: this.httpClient,
185
+ apiUrl: DISCORD_API_URL,
186
+ botToken,
187
+ query: params.query,
188
+ input: params.input,
189
+ });
190
+ }
191
+ startAllGateways() {
192
+ this.gateway.startAll();
193
+ }
194
+ async stopAllGateways() {
195
+ await this.gateway.pauseAll();
196
+ }
197
+ getPlatformAgentContext(chat) {
198
+ const adapter = chat.getAdapter(this.type);
199
+ if (!(0, is_record_1.isRecord)(adapter))
200
+ return {};
201
+ const agentUserId = adapter.botUserId;
202
+ return typeof agentUserId === 'string' && agentUserId ? { agentUserId } : {};
203
+ }
204
+ prepareInboundText(text, context) {
205
+ const trimmed = text.trim();
206
+ if (!context.agentUserId)
207
+ return trimmed;
208
+ return stripDiscordSelfMention(trimmed, context.agentUserId);
209
+ }
210
+ async createBridgeExecutionContext(params) {
211
+ return {
212
+ platformAgentContext: this.getPlatformAgentContext(params.chat),
213
+ statusHandle: params.replyExpectation === 'optional'
214
+ ? undefined
215
+ : this.startTyping(params.thread, params.logger, params.agentId),
216
+ };
217
+ }
218
+ async createResumeExecutionContext(params) {
219
+ return {
220
+ statusHandle: this.startTyping(params.thread, params.logger, params.agentId),
221
+ };
222
+ }
223
+ startTyping(thread, logger, agentId) {
224
+ return (0, typing_indicator_1.startTypingIndicator)(thread, {
225
+ logger,
226
+ agentId,
227
+ platform: 'Discord',
228
+ refreshMs: DISCORD_TYPING_REFRESH_MS,
229
+ });
230
+ }
231
+ formatActionDecisionMessage({ approved, selectedLabel, raw, user, }) {
232
+ const responder = user.fullName || user.userName || user.userId;
233
+ const outcome = approved === undefined
234
+ ? `✅ ${selectedLabel || 'Action'} selected by ${responder}`
235
+ : approved
236
+ ? `✅ Approved by ${responder}`
237
+ : `🚫 Declined by ${responder}`;
238
+ const originalText = this.extractCardText(raw);
239
+ return originalText ? `${originalText}\n\n${outcome}` : outcome;
240
+ }
241
+ normalizeComponents(components) {
242
+ const normalized = [];
243
+ for (const c of components) {
244
+ switch (c.type) {
245
+ case 'select':
246
+ case 'radio_select':
247
+ for (const opt of c.options ?? []) {
248
+ normalized.push({ type: 'button', label: opt.label, value: opt.value });
249
+ }
250
+ break;
251
+ default:
252
+ normalized.push(c);
253
+ }
254
+ }
255
+ return normalized;
256
+ }
257
+ sessionKey(ctx) {
258
+ return `${ctx.agentId}:${ctx.credentialId}`;
259
+ }
260
+ assertBotTokenAvailable(sessionKey, botToken) {
261
+ for (const [key, connection] of this.pendingConnections) {
262
+ if (key === sessionKey)
263
+ continue;
264
+ if (connection.botToken === botToken) {
265
+ throw new conflict_error_1.ConflictError('This Discord bot token is already connected to another agent on this instance');
266
+ }
267
+ }
268
+ if (this.gateway.sessionKeyUsingBotToken(botToken, sessionKey)) {
269
+ throw new conflict_error_1.ConflictError('This Discord bot token is already connected to another agent on this instance');
270
+ }
271
+ }
272
+ async validateDiscordCredential(ctx) {
273
+ const botToken = this.extractBotToken(ctx.credential);
274
+ const publicKey = this.extractPublicKey(ctx.credential);
275
+ const applicationId = this.extractApplicationId(ctx.credential);
276
+ const result = await (0, discord_operations_1.fetchDiscordApplicationMetadata)({
277
+ httpClient: this.httpClient,
278
+ apiUrl: DISCORD_API_URL,
279
+ botToken,
280
+ });
281
+ if (!result.ok) {
282
+ if (result.kind === 'http' && (result.status === 401 || result.status === 403)) {
283
+ throw new bad_request_error_1.BadRequestError('The Discord Bot Token was rejected. Check that the token is correct and has not been regenerated.');
284
+ }
285
+ throw new bad_request_error_1.BadRequestError('Discord did not return application metadata for this bot token. Verify the Application ID, Public Key, and Bot Token belong to the same Discord application.');
286
+ }
287
+ if (result.application.id !== applicationId) {
288
+ throw new bad_request_error_1.BadRequestError('The Discord Application ID does not match this bot token. Copy the Application ID from the same Discord application that issued the token.');
289
+ }
290
+ if (result.application.verify_key.toLowerCase() !== publicKey.toLowerCase()) {
291
+ throw new bad_request_error_1.BadRequestError('The Discord Public Key does not match this bot token. Copy the Public Key from the same Discord application that issued the token.');
292
+ }
293
+ }
294
+ createAdapterLogger() {
295
+ const forward = (level) => (message, ..._args) => {
296
+ this.logger[level](`[DiscordAdapter] ${message}`);
297
+ };
298
+ const logger = {
299
+ child: () => logger,
300
+ debug: forward('debug'),
301
+ info: forward('info'),
302
+ warn: forward('warn'),
303
+ error: forward('error'),
304
+ };
305
+ return logger;
306
+ }
307
+ extractBotToken(credential) {
308
+ return this.requireCredentialField(credential, 'botToken', 'The Discord credential is missing a Bot Token. Copy it from the Bot section of the Discord Developer Portal.');
309
+ }
310
+ extractPublicKey(credential) {
311
+ return this.requireCredentialField(credential, 'publicKey', 'The Discord credential is missing a Public Key. Copy it from the application General Information page in the Discord Developer Portal.');
312
+ }
313
+ extractApplicationId(credential) {
314
+ return this.requireCredentialField(credential, 'applicationId', 'The Discord credential is missing an Application ID. Copy it from the application General Information page in the Discord Developer Portal.');
315
+ }
316
+ requireCredentialField(credential, field, message) {
317
+ const value = credential[field];
318
+ if (typeof value === 'string' && value.trim())
319
+ return value.trim();
320
+ throw new Error(message);
321
+ }
322
+ extractCardText(raw) {
323
+ if (!(0, is_record_1.isRecord)(raw) || !(0, is_record_1.isRecord)(raw.message))
324
+ return '';
325
+ const { content, embeds } = raw.message;
326
+ if (typeof content === 'string' && content)
327
+ return content;
328
+ if (Array.isArray(embeds)) {
329
+ const [firstEmbed] = embeds;
330
+ if ((0, is_record_1.isRecord)(firstEmbed) && typeof firstEmbed.description === 'string') {
331
+ return firstEmbed.description;
332
+ }
333
+ }
334
+ return '';
335
+ }
336
+ };
337
+ exports.DiscordIntegration = DiscordIntegration;
338
+ __decorate([
339
+ (0, decorators_1.OnLeaderTakeover)(),
340
+ __metadata("design:type", Function),
341
+ __metadata("design:paramtypes", []),
342
+ __metadata("design:returntype", void 0)
343
+ ], DiscordIntegration.prototype, "startAllGateways", null);
344
+ __decorate([
345
+ (0, decorators_1.OnLeaderStepdown)(),
346
+ (0, decorators_1.OnShutdown)(),
347
+ __metadata("design:type", Function),
348
+ __metadata("design:paramtypes", []),
349
+ __metadata("design:returntype", Promise)
350
+ ], DiscordIntegration.prototype, "stopAllGateways", null);
351
+ exports.DiscordIntegration = DiscordIntegration = __decorate([
352
+ (0, di_1.Service)(),
353
+ __metadata("design:paramtypes", [backend_common_1.Logger, n8n_core_1.InstanceSettings, agent_repository_1.AgentRepository, backend_network_1.OutboundHttp])
354
+ ], DiscordIntegration);
355
+ function stripDiscordSelfMention(text, userId) {
356
+ return text
357
+ .replace(new RegExp(`(^|\\s)<@!?${escapeRegExp(userId)}>`, 'g'), '$1')
358
+ .replace(/\s+/g, ' ')
359
+ .trim();
360
+ }
361
+ function escapeRegExp(value) {
362
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
363
+ }
364
+ //# sourceMappingURL=discord-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discord-integration.js","sourceRoot":"","sources":["../../../../../src/modules/agents/integrations/platforms/discord-integration.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,wDAA6C;AAC7C,0DAA4E;AAC5E,gDAAiF;AACjF,gCAAkC;AAClC,oDAAgD;AAEhD,uCAA4C;AAE5C,kFAA6E;AAC7E,4EAAwE;AAExE,0EAAsE;AACtE,sEAYmC;AAGnC,8CAAmD;AAEnD,kFAGyC;AACzC,uDAI2B;AAC3B,6DAI8B;AAC9B,yDAA0D;AAG1D,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAOvC,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAoB/C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,6CAAoB;IAwE3D,qBAAqB,CAAC,OAA8B;QAEnD,IAAI,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,KAA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AGD,SAAS,YAAY,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { HttpRequestClient } from '@n8n/backend-network';
2
+ import { z } from 'zod';
3
+ export declare function downloadDiscordAttachment(attachmentUrl: string, httpClient: HttpRequestClient): Promise<Buffer>;
4
+ export declare const discordSearchChannelsSchema: z.ZodObject<{
5
+ query: z.ZodString;
6
+ limit: z.ZodDefault<z.ZodNumber>;
7
+ cursor: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ query: string;
10
+ limit: number;
11
+ cursor?: string | undefined;
12
+ }, {
13
+ query: string;
14
+ limit?: number | undefined;
15
+ cursor?: string | undefined;
16
+ }>;
17
+ export type DiscordSearchChannelsInput = z.infer<typeof discordSearchChannelsSchema>;
18
+ export interface DiscordChannelSearchResult {
19
+ channelId: string;
20
+ name: string;
21
+ guildId: string;
22
+ guildName: string;
23
+ }
24
+ export declare function searchDiscordChannels(params: {
25
+ httpClient: HttpRequestClient;
26
+ apiUrl: string;
27
+ botToken: string;
28
+ input: DiscordSearchChannelsInput;
29
+ }): Promise<unknown>;
30
+ export declare function executeDiscordContextQuery(params: {
31
+ httpClient: HttpRequestClient;
32
+ apiUrl: string;
33
+ botToken: string | undefined;
34
+ query: string;
35
+ input: Record<string, unknown>;
36
+ }): Promise<unknown>;
37
+ export declare function resolveDiscordMessageTargetChannelId(threadId: string): string;
38
+ export declare function settleDiscordActionMessage(params: {
39
+ httpClient: HttpRequestClient;
40
+ apiUrl: string;
41
+ botToken: string;
42
+ threadId: string;
43
+ messageId: string;
44
+ content: string;
45
+ }): Promise<void>;
46
+ export interface DiscordApplicationMetadata {
47
+ id: string;
48
+ verify_key: string;
49
+ }
50
+ export declare function fetchDiscordApplicationMetadata(params: {
51
+ httpClient: HttpRequestClient;
52
+ apiUrl: string;
53
+ botToken: string;
54
+ }): Promise<{
55
+ ok: true;
56
+ application: DiscordApplicationMetadata;
57
+ } | {
58
+ ok: false;
59
+ kind: 'http';
60
+ status: number;
61
+ } | {
62
+ ok: false;
63
+ kind: 'incomplete';
64
+ }>;