n8n 2.25.6 → 2.26.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 (641) hide show
  1. package/dist/active-executions.js +1 -1
  2. package/dist/active-executions.js.map +1 -1
  3. package/dist/active-workflow-manager.d.ts +7 -7
  4. package/dist/active-workflow-manager.js +20 -20
  5. package/dist/active-workflow-manager.js.map +1 -1
  6. package/dist/agent-library-bundle.js +42 -10
  7. package/dist/build.tsbuildinfo +1 -1
  8. package/dist/chat/chat-execution-manager.d.ts +3 -1
  9. package/dist/chat/chat-execution-manager.js +6 -3
  10. package/dist/chat/chat-execution-manager.js.map +1 -1
  11. package/dist/chat/chat-service.types.d.ts +4 -4
  12. package/dist/commands/base-command.js +2 -2
  13. package/dist/commands/base-command.js.map +1 -1
  14. package/dist/commands/execute-batch.d.ts +2 -2
  15. package/dist/commands/execute.d.ts +2 -2
  16. package/dist/commands/export/credentials.d.ts +4 -4
  17. package/dist/commands/export/entities.d.ts +2 -2
  18. package/dist/commands/export/workflow.d.ts +4 -4
  19. package/dist/commands/import/credentials.d.ts +2 -2
  20. package/dist/commands/import/workflow.d.ts +2 -2
  21. package/dist/commands/start.js +1 -1
  22. package/dist/commands/start.js.map +1 -1
  23. package/dist/commands/ttwf/generate.d.ts +2 -2
  24. package/dist/controllers/annotation-tags.controller.ee.d.ts +1 -1
  25. package/dist/controllers/api-keys.controller.d.ts +16 -4
  26. package/dist/controllers/api-keys.controller.js +11 -8
  27. package/dist/controllers/api-keys.controller.js.map +1 -1
  28. package/dist/controllers/e2e.controller.d.ts +15 -0
  29. package/dist/controllers/e2e.controller.js +60 -0
  30. package/dist/controllers/e2e.controller.js.map +1 -1
  31. package/dist/controllers/oauth/oauth1-credential.controller.js +7 -9
  32. package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
  33. package/dist/controllers/oauth/oauth2-credential.controller.js +3 -3
  34. package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
  35. package/dist/controllers/project.controller.d.ts +1 -1
  36. package/dist/controllers/project.controller.js +9 -1
  37. package/dist/controllers/project.controller.js.map +1 -1
  38. package/dist/controllers/security-settings.controller.d.ts +1 -1
  39. package/dist/controllers/security-settings.controller.js +18 -14
  40. package/dist/controllers/security-settings.controller.js.map +1 -1
  41. package/dist/controllers/telemetry.controller.d.ts +4 -1
  42. package/dist/controllers/telemetry.controller.js +61 -2
  43. package/dist/controllers/telemetry.controller.js.map +1 -1
  44. package/dist/controllers/users.controller.d.ts +2 -2
  45. package/dist/credentials/credential-connection-status-provider.interface.d.ts +1 -0
  46. package/dist/credentials/credential-connection-status-proxy.d.ts +1 -0
  47. package/dist/credentials/credential-connection-status-proxy.js +5 -0
  48. package/dist/credentials/credential-connection-status-proxy.js.map +1 -1
  49. package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -0
  50. package/dist/credentials/credentials.controller.d.ts +3 -1
  51. package/dist/credentials/credentials.controller.js +23 -2
  52. package/dist/credentials/credentials.controller.js.map +1 -1
  53. package/dist/credentials-helper.js +3 -0
  54. package/dist/credentials-helper.js.map +1 -1
  55. package/dist/errors/http-error-serializers.js +22 -2
  56. package/dist/errors/http-error-serializers.js.map +1 -1
  57. package/dist/errors/response-errors/conflict.error.d.ts +2 -1
  58. package/dist/errors/response-errors/conflict.error.js +2 -1
  59. package/dist/errors/response-errors/conflict.error.js.map +1 -1
  60. package/dist/evaluation.ee/evaluation-config-validator.d.ts +1 -0
  61. package/dist/evaluation.ee/evaluation-config-validator.js +69 -0
  62. package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -1
  63. package/dist/evaluation.ee/test-runner/evaluation-metrics.ee.js +2 -1
  64. package/dist/evaluation.ee/test-runner/evaluation-metrics.ee.js.map +1 -1
  65. package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +6 -2
  66. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +59 -16
  67. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
  68. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +28 -1
  69. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -1
  70. package/dist/evaluation.ee/test-runs.controller.ee.js +6 -1
  71. package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
  72. package/dist/events/event.service.d.ts +2 -1
  73. package/dist/events/event.service.js.map +1 -1
  74. package/dist/events/maps/execution-data.event-map.d.ts +14 -0
  75. package/dist/events/maps/execution-data.event-map.js +3 -0
  76. package/dist/events/maps/execution-data.event-map.js.map +1 -0
  77. package/dist/events/maps/relay.event-map.d.ts +19 -5
  78. package/dist/events/relays/log-streaming.event-relay.js +2 -0
  79. package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
  80. package/dist/events/relays/telemetry.event-relay.d.ts +3 -0
  81. package/dist/events/relays/telemetry.event-relay.js +47 -6
  82. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  83. package/dist/execution-lifecycle/save-execution-progress.js +3 -3
  84. package/dist/execution-lifecycle/save-execution-progress.js.map +1 -1
  85. package/dist/execution-lifecycle/shared/shared-hook-functions.js +3 -3
  86. package/dist/execution-lifecycle/shared/shared-hook-functions.js.map +1 -1
  87. package/dist/executions/execution-persistence.d.ts +8 -1
  88. package/dist/executions/execution-persistence.js +183 -42
  89. package/dist/executions/execution-persistence.js.map +1 -1
  90. package/dist/executions/execution-recovery.service.d.ts +3 -1
  91. package/dist/executions/execution-recovery.service.js +7 -4
  92. package/dist/executions/execution-recovery.service.js.map +1 -1
  93. package/dist/executions/execution.service.d.ts +1 -0
  94. package/dist/executions/execution.service.js +21 -7
  95. package/dist/executions/execution.service.js.map +1 -1
  96. package/dist/interfaces.d.ts +1 -1
  97. package/dist/load-nodes-and-credentials.js +6 -0
  98. package/dist/load-nodes-and-credentials.js.map +1 -1
  99. package/dist/metrics/prometheus-metrics.service.d.ts +5 -2
  100. package/dist/metrics/prometheus-metrics.service.js +74 -3
  101. package/dist/metrics/prometheus-metrics.service.js.map +1 -1
  102. package/dist/metrics/types.d.ts +1 -1
  103. package/dist/modules/agents/agent-execution.service.d.ts +2 -0
  104. package/dist/modules/agents/agent-execution.service.js +2 -2
  105. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  106. package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +84 -0
  107. package/dist/modules/agents/agent-runtime-reconstruction.service.js +362 -0
  108. package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -0
  109. package/dist/modules/agents/agent-sse-stream.js +15 -1
  110. package/dist/modules/agents/agent-sse-stream.js.map +1 -1
  111. package/dist/modules/agents/agents-tools.service.js +8 -1
  112. package/dist/modules/agents/agents-tools.service.js.map +1 -1
  113. package/dist/modules/agents/agents.controller.d.ts +34 -19
  114. package/dist/modules/agents/agents.controller.js +39 -3
  115. package/dist/modules/agents/agents.controller.js.map +1 -1
  116. package/dist/modules/agents/agents.module.d.ts +1 -1
  117. package/dist/modules/agents/agents.service.d.ts +13 -31
  118. package/dist/modules/agents/agents.service.js +154 -282
  119. package/dist/modules/agents/agents.service.js.map +1 -1
  120. package/dist/modules/agents/builder/agents-builder-prompts.js +1 -0
  121. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
  122. package/dist/modules/agents/builder/agents-builder-tools.service.js +21 -2
  123. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  124. package/dist/modules/agents/builder/agents-builder.service.js +3 -11
  125. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  126. package/dist/modules/agents/builder/builder-tool-names.d.ts +1 -0
  127. package/dist/modules/agents/builder/builder-tool-names.js +1 -0
  128. package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
  129. package/dist/modules/agents/builder/interactive/ask-question.tool.js +1 -1
  130. package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
  131. package/dist/modules/agents/builder/interactive/llm-provider-defaults.js +10 -0
  132. package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +1 -1
  133. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +5 -3
  134. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
  135. package/dist/modules/agents/builder/prompts/config-rules.prompt.js +7 -2
  136. package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
  137. package/dist/modules/agents/builder/skills/index.js +2 -0
  138. package/dist/modules/agents/builder/skills/index.js.map +1 -1
  139. package/dist/modules/agents/builder/skills/sub-agents.skill.d.ts +2 -0
  140. package/dist/modules/agents/builder/skills/sub-agents.skill.js +101 -0
  141. package/dist/modules/agents/builder/skills/sub-agents.skill.js.map +1 -0
  142. package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +2 -0
  143. package/dist/modules/agents/entities/agent-execution-thread.entity.js +8 -0
  144. package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -1
  145. package/dist/modules/agents/entities/agent-execution.entity.js +1 -1
  146. package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -1
  147. package/dist/modules/agents/execution-recorder.d.ts +3 -0
  148. package/dist/modules/agents/execution-recorder.js +75 -10
  149. package/dist/modules/agents/execution-recorder.js.map +1 -1
  150. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +4 -7
  151. package/dist/modules/agents/integrations/agent-chat-bridge.js +138 -105
  152. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  153. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
  154. package/dist/modules/agents/integrations/chat-integration.service.d.ts +5 -0
  155. package/dist/modules/agents/integrations/chat-integration.service.js +5 -0
  156. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  157. package/dist/modules/agents/integrations/component-mapper.d.ts +21 -11
  158. package/dist/modules/agents/integrations/component-mapper.js +50 -20
  159. package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
  160. package/dist/modules/agents/integrations/integration-action-executor.d.ts +1 -0
  161. package/dist/modules/agents/integrations/integration-action-executor.js +20 -9
  162. package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -1
  163. package/dist/modules/agents/integrations/integration-tools.js +176 -31
  164. package/dist/modules/agents/integrations/integration-tools.js.map +1 -1
  165. package/dist/modules/agents/integrations/platforms/slack-integration.js +1 -1
  166. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
  167. package/dist/modules/agents/integrations/platforms/telegram-integration.js +1 -1
  168. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
  169. package/dist/modules/agents/json-config/credential-field-mapping.js +1 -0
  170. package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -1
  171. package/dist/modules/agents/json-config/from-json-config.d.ts +2 -1
  172. package/dist/modules/agents/json-config/from-json-config.js +41 -15
  173. package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
  174. package/dist/modules/agents/json-config/mcp-client-factory.d.ts +0 -6
  175. package/dist/modules/agents/json-config/mcp-client-factory.js +2 -31
  176. package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -1
  177. package/dist/modules/agents/json-config/model-config.d.ts +2 -0
  178. package/dist/modules/agents/json-config/model-config.js +11 -0
  179. package/dist/modules/agents/json-config/model-config.js.map +1 -0
  180. package/dist/modules/agents/json-config/model-id.d.ts +1 -0
  181. package/dist/modules/agents/json-config/model-id.js +8 -0
  182. package/dist/modules/agents/json-config/model-id.js.map +1 -0
  183. package/dist/modules/agents/json-config/native-web-search-provider-tools.d.ts +0 -1
  184. package/dist/modules/agents/json-config/native-web-search-provider-tools.js +3 -7
  185. package/dist/modules/agents/json-config/native-web-search-provider-tools.js.map +1 -1
  186. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.d.ts +1 -0
  187. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js +63 -0
  188. package/dist/modules/agents/json-config/sanitize-unknown-agent-credentials.js.map +1 -0
  189. package/dist/modules/agents/model-catalog.d.ts +1 -0
  190. package/dist/modules/agents/model-catalog.js +15 -0
  191. package/dist/modules/agents/model-catalog.js.map +1 -0
  192. package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +5 -1
  193. package/dist/modules/agents/repositories/agent-execution-thread.repository.js +5 -3
  194. package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -1
  195. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.d.ts +17 -0
  196. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +66 -0
  197. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -0
  198. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +27 -0
  199. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +235 -0
  200. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -0
  201. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.d.ts +20 -0
  202. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js +87 -0
  203. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js.map +1 -0
  204. package/dist/modules/agents/tools/knowledge/csv.operation.d.ts +2 -2
  205. package/dist/modules/agents/tools/knowledge/schemas.d.ts +91 -91
  206. package/dist/modules/agents/tools/node-tool-factory.js +9 -12
  207. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -1
  208. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +2 -3
  209. package/dist/modules/agents/tools/workflow-tool-factory.js +6 -4
  210. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  211. package/dist/modules/agents/utils/agent-stream.d.ts +2 -0
  212. package/dist/modules/agents/utils/agent-stream.js +27 -0
  213. package/dist/modules/agents/utils/agent-stream.js.map +1 -0
  214. package/dist/modules/agents/utils/execution-to-message-mapper.js +2 -0
  215. package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
  216. package/dist/modules/agents/utils/structured-output-error.d.ts +1 -0
  217. package/dist/modules/agents/utils/structured-output-error.js +34 -0
  218. package/dist/modules/agents/utils/structured-output-error.js.map +1 -0
  219. package/dist/modules/chat-hub/chat-hub-execution-watcher.service.d.ts +3 -3
  220. package/dist/modules/chat-hub/chat-hub-execution-watcher.service.js +5 -5
  221. package/dist/modules/chat-hub/chat-hub-execution-watcher.service.js.map +1 -1
  222. package/dist/modules/chat-hub/chat-hub-execution.service.d.ts +3 -1
  223. package/dist/modules/chat-hub/chat-hub-execution.service.js +6 -3
  224. package/dist/modules/chat-hub/chat-hub-execution.service.js.map +1 -1
  225. package/dist/modules/chat-hub/chat-hub-title.service.d.ts +4 -3
  226. package/dist/modules/chat-hub/chat-hub-title.service.js +5 -5
  227. package/dist/modules/chat-hub/chat-hub-title.service.js.map +1 -1
  228. package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -2
  229. package/dist/modules/chat-hub/chat-hub.service.d.ts +4 -3
  230. package/dist/modules/chat-hub/chat-hub.service.js +5 -5
  231. package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
  232. package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +4 -4
  233. package/dist/modules/chat-hub/chat-hub.types.d.ts +5 -5
  234. package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
  235. package/dist/modules/data-table/data-table.module.d.ts +1 -1
  236. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.d.ts +2 -2
  237. package/dist/modules/dynamic-credentials.ee/credential-resolvers/n8n-credential-resolver.d.ts +1 -0
  238. package/dist/modules/dynamic-credentials.ee/credential-resolvers/n8n-credential-resolver.js +3 -0
  239. package/dist/modules/dynamic-credentials.ee/credential-resolvers/n8n-credential-resolver.js.map +1 -1
  240. package/dist/modules/dynamic-credentials.ee/database/repositories/dynamic-credential-user-entry.repository.d.ts +5 -0
  241. package/dist/modules/dynamic-credentials.ee/database/repositories/dynamic-credential-user-entry.repository.js +15 -0
  242. package/dist/modules/dynamic-credentials.ee/database/repositories/dynamic-credential-user-entry.repository.js.map +1 -1
  243. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +9 -1
  244. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +57 -3
  245. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
  246. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +14 -3
  247. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
  248. package/dist/modules/external-secrets.ee/providers/infisical.d.ts +20 -14
  249. package/dist/modules/external-secrets.ee/providers/infisical.js +215 -90
  250. package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
  251. package/dist/modules/favorites/dto/add-favorite.dto.d.ts +1 -1
  252. package/dist/modules/insights/database/entities/insights-shared.d.ts +1 -1
  253. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.d.ts +2 -1
  254. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js +2 -3
  255. package/dist/modules/insights/database/repositories/insights-by-period-query.helper.js.map +1 -1
  256. package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +3 -3
  257. package/dist/modules/insights/insights.service.d.ts +3 -3
  258. package/dist/modules/instance-ai/entities/index.d.ts +1 -0
  259. package/dist/modules/instance-ai/entities/index.js +3 -1
  260. package/dist/modules/instance-ai/entities/index.js.map +1 -1
  261. package/dist/modules/instance-ai/entities/instance-ai-mcp-registry-connection.entity.d.ts +12 -0
  262. package/dist/modules/instance-ai/entities/instance-ai-mcp-registry-connection.entity.js +42 -0
  263. package/dist/modules/instance-ai/entities/instance-ai-mcp-registry-connection.entity.js.map +1 -0
  264. package/dist/modules/instance-ai/entities/instance-ai-thread.entity.d.ts +3 -1
  265. package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js +10 -0
  266. package/dist/modules/instance-ai/entities/instance-ai-thread.entity.js.map +1 -1
  267. package/dist/modules/instance-ai/eval/execution.service.d.ts +8 -2
  268. package/dist/modules/instance-ai/eval/execution.service.js +183 -40
  269. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  270. package/dist/modules/instance-ai/eval/workflow-analysis.js +5 -0
  271. package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
  272. package/dist/modules/instance-ai/extract-resolved-node-parameters.d.ts +1 -2
  273. package/dist/modules/instance-ai/extract-resolved-node-parameters.js +4 -2
  274. package/dist/modules/instance-ai/extract-resolved-node-parameters.js.map +1 -1
  275. package/dist/modules/instance-ai/instance-ai-gateway.service.d.ts +31 -0
  276. package/dist/modules/instance-ai/instance-ai-gateway.service.js +84 -0
  277. package/dist/modules/instance-ai/instance-ai-gateway.service.js.map +1 -0
  278. package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +1 -1
  279. package/dist/modules/instance-ai/instance-ai-memory.service.js +5 -4
  280. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  281. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +10 -1
  282. package/dist/modules/instance-ai/instance-ai-settings.service.js +47 -5
  283. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  284. package/dist/modules/instance-ai/instance-ai-test.controller.d.ts +6 -2
  285. package/dist/modules/instance-ai/instance-ai-test.controller.js +17 -3
  286. package/dist/modules/instance-ai/instance-ai-test.controller.js.map +1 -1
  287. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +5 -5
  288. package/dist/modules/instance-ai/instance-ai.adapter.service.js +104 -36
  289. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  290. package/dist/modules/instance-ai/instance-ai.controller.d.ts +8 -6
  291. package/dist/modules/instance-ai/instance-ai.controller.js +31 -36
  292. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  293. package/dist/modules/instance-ai/instance-ai.module.d.ts +4 -1
  294. package/dist/modules/instance-ai/instance-ai.module.js +7 -6
  295. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  296. package/dist/modules/instance-ai/instance-ai.service.d.ts +50 -41
  297. package/dist/modules/instance-ai/instance-ai.service.js +599 -246
  298. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  299. package/dist/modules/instance-ai/internal-messages.js +1 -1
  300. package/dist/modules/instance-ai/internal-messages.js.map +1 -1
  301. package/dist/modules/instance-ai/mcp/index.d.ts +1 -0
  302. package/dist/modules/instance-ai/mcp/index.js +18 -0
  303. package/dist/modules/instance-ai/mcp/index.js.map +1 -0
  304. package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.d.ts +17 -0
  305. package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js +125 -0
  306. package/dist/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.js.map +1 -0
  307. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.d.ts +35 -0
  308. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +264 -0
  309. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -0
  310. package/dist/modules/instance-ai/planned-task-action-runner.d.ts +91 -0
  311. package/dist/modules/instance-ai/planned-task-action-runner.js +138 -0
  312. package/dist/modules/instance-ai/planned-task-action-runner.js.map +1 -0
  313. package/dist/modules/instance-ai/repositories/index.d.ts +1 -0
  314. package/dist/modules/instance-ai/repositories/index.js +3 -1
  315. package/dist/modules/instance-ai/repositories/index.js.map +1 -1
  316. package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -1
  317. package/dist/modules/instance-ai/repositories/instance-ai-mcp-registry-connection.repository.d.ts +5 -0
  318. package/dist/modules/instance-ai/repositories/instance-ai-mcp-registry-connection.repository.js +26 -0
  319. package/dist/modules/instance-ai/repositories/instance-ai-mcp-registry-connection.repository.js.map +1 -0
  320. package/dist/modules/instance-ai/sandbox-provider.d.ts +4 -0
  321. package/dist/modules/instance-ai/sandbox-provider.js +19 -0
  322. package/dist/modules/instance-ai/sandbox-provider.js.map +1 -0
  323. package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -1
  324. package/dist/modules/instance-ai/storage/typeorm-agent-memory.d.ts +4 -1
  325. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js +103 -12
  326. package/dist/modules/instance-ai/storage/typeorm-agent-memory.js.map +1 -1
  327. package/dist/modules/instance-ai/trace-replay-state.d.ts +2 -0
  328. package/dist/modules/instance-ai/trace-replay-state.js +56 -6
  329. package/dist/modules/instance-ai/trace-replay-state.js.map +1 -1
  330. package/dist/modules/instance-ai/workflow-verification-obligation-service.d.ts +20 -0
  331. package/dist/modules/instance-ai/workflow-verification-obligation-service.js +59 -0
  332. package/dist/modules/instance-ai/workflow-verification-obligation-service.js.map +1 -0
  333. package/dist/modules/instance-ai/workflow-verification-task-projector.d.ts +21 -0
  334. package/dist/modules/instance-ai/workflow-verification-task-projector.js +323 -0
  335. package/dist/modules/instance-ai/workflow-verification-task-projector.js.map +1 -0
  336. package/dist/modules/mcp/database/entities/oauth-authorization-code.entity.d.ts +1 -0
  337. package/dist/modules/mcp/database/entities/oauth-authorization-code.entity.js +4 -0
  338. package/dist/modules/mcp/database/entities/oauth-authorization-code.entity.js.map +1 -1
  339. package/dist/modules/mcp/mcp-oauth-authorization-code.service.d.ts +3 -1
  340. package/dist/modules/mcp/mcp-oauth-authorization-code.service.js +35 -5
  341. package/dist/modules/mcp/mcp-oauth-authorization-code.service.js.map +1 -1
  342. package/dist/modules/mcp/mcp-oauth-consent.service.js +1 -1
  343. package/dist/modules/mcp/mcp-oauth-consent.service.js.map +1 -1
  344. package/dist/modules/mcp/mcp-oauth-service.d.ts +4 -2
  345. package/dist/modules/mcp/mcp-oauth-service.js +60 -9
  346. package/dist/modules/mcp/mcp-oauth-service.js.map +1 -1
  347. package/dist/modules/mcp/mcp-oauth-token.service.d.ts +8 -6
  348. package/dist/modules/mcp/mcp-oauth-token.service.js +53 -16
  349. package/dist/modules/mcp/mcp-oauth-token.service.js.map +1 -1
  350. package/dist/modules/mcp/mcp-server-middleware.service.js +2 -1
  351. package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
  352. package/dist/modules/mcp/mcp.constants.d.ts +1 -0
  353. package/dist/modules/mcp/mcp.constants.js +2 -1
  354. package/dist/modules/mcp/mcp.constants.js.map +1 -1
  355. package/dist/modules/mcp/mcp.controller.js +1 -1
  356. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  357. package/dist/modules/mcp/mcp.service.d.ts +7 -4
  358. package/dist/modules/mcp/mcp.service.js +60 -9
  359. package/dist/modules/mcp/mcp.service.js.map +1 -1
  360. package/dist/modules/mcp/mcp.types.d.ts +5 -4
  361. package/dist/modules/mcp/mcp.utils.d.ts +2 -4
  362. package/dist/modules/mcp/mcp.utils.js.map +1 -1
  363. package/dist/modules/mcp/oauth-session.service.d.ts +1 -0
  364. package/dist/modules/mcp/oauth-session.service.js.map +1 -1
  365. package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +7 -7
  366. package/dist/modules/mcp/tools/get-execution.tool.d.ts +1 -1
  367. package/dist/modules/mcp/tools/get-execution.tool.js +3 -3
  368. package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
  369. package/dist/modules/mcp/tools/schemas.d.ts +28 -28
  370. package/dist/modules/mcp/tools/search-projects.tool.d.ts +2 -1
  371. package/dist/modules/mcp/tools/search-projects.tool.js +16 -7
  372. package/dist/modules/mcp/tools/search-projects.tool.js.map +1 -1
  373. package/dist/modules/mcp/tools/workflow-builder/constants.d.ts +1 -1
  374. package/dist/modules/mcp/tools/workflow-builder/constants.js +2 -2
  375. package/dist/modules/mcp/tools/workflow-builder/constants.js.map +1 -1
  376. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +1 -0
  377. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +9 -2
  378. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  379. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.d.ts +27 -0
  380. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +123 -0
  381. package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -0
  382. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +2 -2
  383. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +1 -1
  384. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
  385. package/dist/modules/mcp/tools/workflow-builder/skills-used.d.ts +1 -0
  386. package/dist/modules/mcp/tools/workflow-builder/skills-used.js +26 -0
  387. package/dist/modules/mcp/tools/workflow-builder/skills-used.js.map +1 -0
  388. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +20 -19
  389. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +9 -2
  390. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  391. package/dist/modules/mcp/tools/workflow-builder/validate-node.tool.d.ts +2 -2
  392. package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +19 -19
  393. package/dist/modules/mcp-registry/mcp-registry-node-loader.js +3 -2
  394. package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -1
  395. package/dist/modules/mcp-registry/mcp-registry.controller.d.ts +7 -0
  396. package/dist/modules/mcp-registry/mcp-registry.controller.js +54 -0
  397. package/dist/modules/mcp-registry/mcp-registry.controller.js.map +1 -0
  398. package/dist/modules/mcp-registry/mcp-registry.module.js +1 -0
  399. package/dist/modules/mcp-registry/mcp-registry.module.js.map +1 -1
  400. package/dist/modules/mcp-registry/node-description-transform.d.ts +5 -3
  401. package/dist/modules/mcp-registry/node-description-transform.js +82 -24
  402. package/dist/modules/mcp-registry/node-description-transform.js.map +1 -1
  403. package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js +8 -4
  404. package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js.map +1 -1
  405. package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +1 -0
  406. package/dist/modules/mcp-registry/registry/mcp-registry.service.js +7 -0
  407. package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
  408. package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +35 -1
  409. package/dist/modules/mcp-registry/registry/mcp-registry.types.js +13 -0
  410. package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
  411. package/dist/modules/mcp-registry/registry/mock-servers.d.ts +2 -0
  412. package/dist/modules/mcp-registry/registry/mock-servers.js +45 -1
  413. package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -1
  414. package/dist/modules/n8n-packages/engine/import-pipeline.d.ts +5 -3
  415. package/dist/modules/n8n-packages/engine/import-pipeline.js +36 -25
  416. package/dist/modules/n8n-packages/engine/import-pipeline.js.map +1 -1
  417. package/dist/modules/n8n-packages/entities/credential/credential-importer.d.ts +9 -0
  418. package/dist/modules/n8n-packages/entities/credential/credential-importer.js +41 -0
  419. package/dist/modules/n8n-packages/entities/credential/credential-importer.js.map +1 -0
  420. package/dist/modules/n8n-packages/entities/credential/credential-matcher-factory.d.ts +8 -0
  421. package/dist/modules/n8n-packages/entities/credential/credential-matcher-factory.js +35 -0
  422. package/dist/modules/n8n-packages/entities/credential/credential-matcher-factory.js.map +1 -0
  423. package/dist/modules/n8n-packages/entities/credential/credential-matcher.d.ts +18 -0
  424. package/dist/modules/n8n-packages/entities/credential/credential-matcher.js +34 -0
  425. package/dist/modules/n8n-packages/entities/credential/credential-matcher.js.map +1 -0
  426. package/dist/modules/n8n-packages/entities/credential/credential-missing-mode-factory.d.ts +7 -0
  427. package/dist/modules/n8n-packages/entities/credential/credential-missing-mode-factory.js +35 -0
  428. package/dist/modules/n8n-packages/entities/credential/credential-missing-mode-factory.js.map +1 -0
  429. package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.d.ts +7 -0
  430. package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.js +17 -0
  431. package/dist/modules/n8n-packages/entities/credential/credential-missing-mode.js.map +1 -0
  432. package/dist/modules/n8n-packages/entities/credential/credential-resolution-error.d.ts +3 -0
  433. package/dist/modules/n8n-packages/entities/credential/credential-resolution-error.js +14 -0
  434. package/dist/modules/n8n-packages/entities/credential/credential-resolution-error.js.map +1 -0
  435. package/dist/modules/n8n-packages/entities/credential/credential.types.d.ts +30 -0
  436. package/dist/modules/n8n-packages/entities/credential/credential.types.js +12 -0
  437. package/dist/modules/n8n-packages/entities/credential/credential.types.js.map +1 -1
  438. package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.d.ts +13 -0
  439. package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js +47 -0
  440. package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js.map +1 -0
  441. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-fail.handler.d.ts +9 -0
  442. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-fail.handler.js +41 -0
  443. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-fail.handler.js.map +1 -0
  444. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-handler.d.ts +10 -0
  445. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-handler.js +20 -0
  446. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-handler.js.map +1 -0
  447. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-new-version.handler.d.ts +11 -0
  448. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-new-version.handler.js +42 -0
  449. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-new-version.handler.js.map +1 -0
  450. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-skip.handler.d.ts +9 -0
  451. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-skip.handler.js +33 -0
  452. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy-skip.handler.js.map +1 -0
  453. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.factory.d.ts +10 -0
  454. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.factory.js +37 -0
  455. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.factory.js.map +1 -0
  456. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.types.d.ts +20 -0
  457. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.types.js +3 -0
  458. package/dist/modules/n8n-packages/entities/workflow/workflow-conflict-policy.types.js.map +1 -0
  459. package/dist/modules/n8n-packages/entities/workflow/workflow-import-match.service.d.ts +7 -0
  460. package/dist/modules/n8n-packages/entities/workflow/workflow-import-match.service.js +54 -0
  461. package/dist/modules/n8n-packages/entities/workflow/workflow-import-match.service.js.map +1 -0
  462. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.d.ts +14 -0
  463. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +47 -0
  464. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -0
  465. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +23 -1
  466. package/dist/modules/n8n-packages/n8n-packages.types.js +21 -0
  467. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  468. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +41 -31
  469. package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
  470. package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +17 -7
  471. package/dist/modules/n8n-packages/spec/requirements.schema.js +17 -1
  472. package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
  473. package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +2 -2
  474. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +40 -33
  475. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +2 -1
  476. package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
  477. package/dist/modules/n8n-packages/utils/import-package-upload.js +1 -1
  478. package/dist/modules/oauth-jwe/oauth-jwe.schemas.d.ts +18 -18
  479. package/dist/modules/otel/otel-lifecycle-handler.d.ts +6 -2
  480. package/dist/modules/otel/otel-lifecycle-handler.js +30 -17
  481. package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
  482. package/dist/modules/quick-connect/quick-connect.config.d.ts +29 -29
  483. package/dist/modules/quick-connect/quick-connect.module.d.ts +11 -11
  484. package/dist/modules/redaction/executions/execution-redaction.interfaces.d.ts +1 -1
  485. package/dist/modules/redaction/executions/execution-redaction.service.d.ts +1 -0
  486. package/dist/modules/redaction/executions/execution-redaction.service.js +25 -11
  487. package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
  488. package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.js +1 -1
  489. package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.js.map +1 -1
  490. package/dist/modules/redaction/instance-redaction-enforcement.service.d.ts +9 -7
  491. package/dist/modules/redaction/instance-redaction-enforcement.service.js +32 -14
  492. package/dist/modules/redaction/instance-redaction-enforcement.service.js.map +1 -1
  493. package/dist/modules/redaction/redaction-context-hook.js +14 -16
  494. package/dist/modules/redaction/redaction-context-hook.js.map +1 -1
  495. package/dist/modules/redaction/redaction-enforcement.service.d.ts +5 -5
  496. package/dist/modules/redaction/redaction-enforcement.service.js +13 -11
  497. package/dist/modules/redaction/redaction-enforcement.service.js.map +1 -1
  498. package/dist/modules/redaction/redaction-policy.d.ts +7 -0
  499. package/dist/modules/redaction/redaction-policy.js +31 -0
  500. package/dist/modules/redaction/redaction-policy.js.map +1 -0
  501. package/dist/modules/redaction/redaction.module.js +1 -0
  502. package/dist/modules/redaction/redaction.module.js.map +1 -1
  503. package/dist/modules/source-control.ee/source-control-import.service.ee.js +1 -1
  504. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  505. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +4 -4
  506. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +2 -2
  507. package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +1 -1
  508. package/dist/modules/sso-oidc/oidc.service.ee.d.ts +2 -1
  509. package/dist/modules/sso-oidc/oidc.service.ee.js +35 -18
  510. package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
  511. package/dist/modules/token-exchange/token-exchange.schemas.d.ts +12 -12
  512. package/dist/node-execution/ephemeral-node-executor.js +3 -0
  513. package/dist/node-execution/ephemeral-node-executor.js.map +1 -1
  514. package/dist/oauth/oauth.service.d.ts +20 -6
  515. package/dist/oauth/oauth.service.js +80 -18
  516. package/dist/oauth/oauth.service.js.map +1 -1
  517. package/dist/public-api/v1/handlers/executions/executions.handler.js +4 -4
  518. package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
  519. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +3 -0
  520. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
  521. package/dist/public-api/v1/handlers/users/users.service.ee.js +1 -0
  522. package/dist/public-api/v1/handlers/users/users.service.ee.js.map +1 -1
  523. package/dist/public-api/v1/handlers/workflows/workflows.service.js +2 -0
  524. package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +1 -1
  525. package/dist/public-api/v1/openapi.yml +169 -6
  526. package/dist/response-helper.js +16 -1
  527. package/dist/response-helper.js.map +1 -1
  528. package/dist/scaling/constants.d.ts +2 -2
  529. package/dist/scaling/job-processor.d.ts +3 -1
  530. package/dist/scaling/job-processor.js +6 -3
  531. package/dist/scaling/job-processor.js.map +1 -1
  532. package/dist/scaling/pubsub/pubsub.event-map.d.ts +1 -0
  533. package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
  534. package/dist/scaling/scaling.service.d.ts +3 -1
  535. package/dist/scaling/scaling.service.js +5 -2
  536. package/dist/scaling/scaling.service.js.map +1 -1
  537. package/dist/security-audit/risk-reporters/credentials-risk-reporter.d.ts +4 -3
  538. package/dist/security-audit/risk-reporters/credentials-risk-reporter.js +6 -4
  539. package/dist/security-audit/risk-reporters/credentials-risk-reporter.js.map +1 -1
  540. package/dist/services/ai-workflow-builder.service.d.ts +1 -2
  541. package/dist/services/ai-workflow-builder.service.js +2 -3
  542. package/dist/services/ai-workflow-builder.service.js.map +1 -1
  543. package/dist/services/dynamic-node-parameters.service.js +3 -5
  544. package/dist/services/dynamic-node-parameters.service.js.map +1 -1
  545. package/dist/services/frontend.service.js +2 -0
  546. package/dist/services/frontend.service.js.map +1 -1
  547. package/dist/services/project.service.ee.d.ts +1 -0
  548. package/dist/services/project.service.ee.js +34 -2
  549. package/dist/services/project.service.ee.js.map +1 -1
  550. package/dist/services/public-api-key.service.d.ts +25 -7
  551. package/dist/services/public-api-key.service.js +93 -14
  552. package/dist/services/public-api-key.service.js.map +1 -1
  553. package/dist/services/role.service.d.ts +3 -3
  554. package/dist/task-runners/errors/task-cancelled.error.d.ts +4 -0
  555. package/dist/task-runners/errors/task-cancelled.error.js +11 -0
  556. package/dist/task-runners/errors/task-cancelled.error.js.map +1 -0
  557. package/dist/task-runners/task-managers/task-requester.js +2 -1
  558. package/dist/task-runners/task-managers/task-requester.js.map +1 -1
  559. package/dist/telemetry/index.js +2 -2
  560. package/dist/tool-generation/hitl-tools.js +1 -1
  561. package/dist/tool-generation/hitl-tools.js.map +1 -1
  562. package/dist/utils/auth-fetch.d.ts +6 -0
  563. package/dist/utils/auth-fetch.js +33 -0
  564. package/dist/utils/auth-fetch.js.map +1 -0
  565. package/dist/wait-tracker.d.ts +6 -1
  566. package/dist/wait-tracker.js +43 -18
  567. package/dist/wait-tracker.js.map +1 -1
  568. package/dist/webhooks/waiting-webhooks.d.ts +3 -3
  569. package/dist/webhooks/waiting-webhooks.js +5 -5
  570. package/dist/webhooks/waiting-webhooks.js.map +1 -1
  571. package/dist/webhooks/webhook-helpers.js +1 -19
  572. package/dist/webhooks/webhook-helpers.js.map +1 -1
  573. package/dist/webhooks/webhook-server.d.ts +1 -0
  574. package/dist/webhooks/webhook-server.js +39 -0
  575. package/dist/webhooks/webhook-server.js.map +1 -1
  576. package/dist/workflow-execute-additional-data.d.ts +3 -2
  577. package/dist/workflow-execute-additional-data.js +42 -15
  578. package/dist/workflow-execute-additional-data.js.map +1 -1
  579. package/dist/workflow-helpers.d.ts +2 -2
  580. package/dist/workflow-helpers.js +5 -3
  581. package/dist/workflow-helpers.js.map +1 -1
  582. package/dist/workflow-runner.d.ts +3 -1
  583. package/dist/workflow-runner.js +8 -2
  584. package/dist/workflow-runner.js.map +1 -1
  585. package/dist/workflows/utils.d.ts +2 -0
  586. package/dist/workflows/utils.js +6 -0
  587. package/dist/workflows/utils.js.map +1 -1
  588. package/dist/workflows/workflow-creation.service.d.ts +7 -3
  589. package/dist/workflows/workflow-creation.service.js +38 -14
  590. package/dist/workflows/workflow-creation.service.js.map +1 -1
  591. package/dist/workflows/workflow-finder.service.d.ts +9 -0
  592. package/dist/workflows/workflow-finder.service.js +60 -16
  593. package/dist/workflows/workflow-finder.service.js.map +1 -1
  594. package/dist/workflows/workflow-publication-outbox-consumer.d.ts +31 -0
  595. package/dist/workflows/workflow-publication-outbox-consumer.js +209 -0
  596. package/dist/workflows/workflow-publication-outbox-consumer.js.map +1 -0
  597. package/dist/workflows/workflow-validation.service.js +1 -1
  598. package/dist/workflows/workflow-validation.service.js.map +1 -1
  599. package/dist/workflows/workflow.service.d.ts +5 -5
  600. package/dist/workflows/workflow.service.js +1 -1
  601. package/dist/workflows/workflow.service.js.map +1 -1
  602. package/dist/workflows/workflows.controller.d.ts +29 -29
  603. package/dist/workflows/workflows.controller.js +3 -4
  604. package/dist/workflows/workflows.controller.js.map +1 -1
  605. package/package.json +38 -38
  606. package/dist/controllers/redaction-enforcement-mapper.d.ts +0 -3
  607. package/dist/controllers/redaction-enforcement-mapper.js +0 -27
  608. package/dist/controllers/redaction-enforcement-mapper.js.map +0 -1
  609. package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +0 -47
  610. package/dist/modules/agents/integrations/rich-interaction-tool.js +0 -109
  611. package/dist/modules/agents/integrations/rich-interaction-tool.js.map +0 -1
  612. package/dist/modules/instance-ai/eval/sub-agent-eval.service.d.ts +0 -13
  613. package/dist/modules/instance-ai/eval/sub-agent-eval.service.js +0 -154
  614. package/dist/modules/instance-ai/eval/sub-agent-eval.service.js.map +0 -1
  615. package/dist/modules/instance-ai/eval/sub-agent-roles.d.ts +0 -7
  616. package/dist/modules/instance-ai/eval/sub-agent-roles.js +0 -21
  617. package/dist/modules/instance-ai/eval/sub-agent-roles.js.map +0 -1
  618. package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +0 -10
  619. package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +0 -64
  620. package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +0 -1
  621. package/dist/modules/redaction/redaction.config.d.ts +0 -3
  622. package/dist/modules/redaction/redaction.config.js +0 -27
  623. package/dist/modules/redaction/redaction.config.js.map +0 -1
  624. package/dist/services/ssrf/dns-resolver.d.ts +0 -13
  625. package/dist/services/ssrf/dns-resolver.js +0 -93
  626. package/dist/services/ssrf/dns-resolver.js.map +0 -1
  627. package/dist/services/ssrf/hostname-matcher.d.ts +0 -6
  628. package/dist/services/ssrf/hostname-matcher.js +0 -38
  629. package/dist/services/ssrf/hostname-matcher.js.map +0 -1
  630. package/dist/services/ssrf/in-memory-dns-cache.service.d.ts +0 -11
  631. package/dist/services/ssrf/in-memory-dns-cache.service.js +0 -61
  632. package/dist/services/ssrf/in-memory-dns-cache.service.js.map +0 -1
  633. package/dist/services/ssrf/ip-range-builder.d.ts +0 -10
  634. package/dist/services/ssrf/ip-range-builder.js +0 -52
  635. package/dist/services/ssrf/ip-range-builder.js.map +0 -1
  636. package/dist/services/ssrf/ssrf-blocked-ip.error.d.ts +0 -6
  637. package/dist/services/ssrf/ssrf-blocked-ip.error.js +0 -21
  638. package/dist/services/ssrf/ssrf-blocked-ip.error.js.map +0 -1
  639. package/dist/services/ssrf/ssrf-protection.service.d.ts +0 -26
  640. package/dist/services/ssrf/ssrf-protection.service.js +0 -159
  641. package/dist/services/ssrf/ssrf-protection.service.js.map +0 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AUTO_FOLLOW_UP_MESSAGE = void 0;
4
4
  exports.cleanStoredUserMessage = cleanStoredUserMessage;
5
5
  exports.AUTO_FOLLOW_UP_MESSAGE = '(continue)';
6
- const TASK_CONTEXT_BLOCK = /^(?:<running-tasks>\n[\s\S]*?\n<\/running-tasks>|<planned-task-follow-up[\s\S]*?\n<\/planned-task-follow-up>|<planning-blueprint>\n[\s\S]*?\n<\/planning-blueprint>|<background-task-completed>\n[\s\S]*?\n<\/background-task-completed>)\n\n/;
6
+ const TASK_CONTEXT_BLOCK = /^(?:<running-tasks>\n[\s\S]*?\n<\/running-tasks>|<planned-task-follow-up[\s\S]*?\n<\/planned-task-follow-up>|<planning-blueprint>\n[\s\S]*?\n<\/planning-blueprint>|<background-task-completed>\n[\s\S]*?\n<\/background-task-completed>|<workflow-verification-follow-up>\n[\s\S]*?\n<\/workflow-verification-follow-up>|<workflow-setup-required>\n[\s\S]*?\n<\/workflow-setup-required>)\n\n/;
7
7
  function cleanStoredUserMessage(stored) {
8
8
  const text = stored.replace(TASK_CONTEXT_BLOCK, '');
9
9
  return text === exports.AUTO_FOLLOW_UP_MESSAGE ? null : text;
@@ -1 +1 @@
1
- {"version":3,"file":"internal-messages.js","sourceRoot":"","sources":["../../../src/modules/instance-ai/internal-messages.ts"],"names":[],"mappings":";;;AAsBA,wDAGC;AAdY,QAAA,sBAAsB,GAAG,YAAY,CAAC;AAGnD,MAAM,kBAAkB,GACvB,+OAA+O,CAAC;AAOjP,SAAgB,sBAAsB,CAAC,MAAc;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACpD,OAAO,IAAI,KAAK,8BAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"internal-messages.js","sourceRoot":"","sources":["../../../src/modules/instance-ai/internal-messages.ts"],"names":[],"mappings":";;;AAsBA,wDAGC;AAdY,QAAA,sBAAsB,GAAG,YAAY,CAAC;AAGnD,MAAM,kBAAkB,GACvB,iYAAiY,CAAC;AAOnY,SAAgB,sBAAsB,CAAC,MAAc;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACpD,OAAO,IAAI,KAAK,8BAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACtD,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './instance-ai-mcp-registry.service';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./instance-ai-mcp-registry.service"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/mcp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD"}
@@ -0,0 +1,17 @@
1
+ import type { InstanceAiMcpConnectionResponse } from '@n8n/api-types';
2
+ import { InstanceAiMcpCreateConnectionRequestDto, InstanceAiMcpUpdateConnectionRequestDto } from '@n8n/api-types';
3
+ import { AuthenticatedRequest } from '@n8n/db';
4
+ import type { Response } from 'express';
5
+ import { CredentialsFinderService } from '../../../credentials/credentials-finder.service';
6
+ import { McpRegistryService } from '../../../modules/mcp-registry/registry/mcp-registry.service';
7
+ import { InstanceAiMcpRegistryService } from './instance-ai-mcp-registry.service';
8
+ export declare class InstanceAiMcpConnectionController {
9
+ private readonly service;
10
+ private readonly credentialsFinderService;
11
+ private readonly mcpRegistryService;
12
+ constructor(service: InstanceAiMcpRegistryService, credentialsFinderService: CredentialsFinderService, mcpRegistryService: McpRegistryService);
13
+ list(req: AuthenticatedRequest): Promise<InstanceAiMcpConnectionResponse[]>;
14
+ create(req: AuthenticatedRequest, _res: Response, payload: InstanceAiMcpCreateConnectionRequestDto): Promise<InstanceAiMcpConnectionResponse>;
15
+ update(req: AuthenticatedRequest, _res: Response, id: string, _payload: InstanceAiMcpUpdateConnectionRequestDto): Promise<InstanceAiMcpConnectionResponse>;
16
+ delete(req: AuthenticatedRequest, _res: Response, id: string): Promise<void>;
17
+ }
@@ -0,0 +1,125 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.InstanceAiMcpConnectionController = void 0;
16
+ const api_types_1 = require("@n8n/api-types");
17
+ const decorators_1 = require("@n8n/decorators");
18
+ const credentials_finder_service_1 = require("../../../credentials/credentials-finder.service");
19
+ const not_found_error_1 = require("../../../errors/response-errors/not-found.error");
20
+ const mcp_registry_service_1 = require("../../../modules/mcp-registry/registry/mcp-registry.service");
21
+ const instance_ai_mcp_registry_service_1 = require("./instance-ai-mcp-registry.service");
22
+ function serverMetadata(server, slug) {
23
+ if (!server)
24
+ return { title: slug, icons: [] };
25
+ return { title: server.title, icons: server.icons };
26
+ }
27
+ let InstanceAiMcpConnectionController = class InstanceAiMcpConnectionController {
28
+ constructor(service, credentialsFinderService, mcpRegistryService) {
29
+ this.service = service;
30
+ this.credentialsFinderService = credentialsFinderService;
31
+ this.mcpRegistryService = mcpRegistryService;
32
+ }
33
+ async list(req) {
34
+ const connections = await this.service.listConnectionsForUser(req.user);
35
+ if (connections.length === 0)
36
+ return [];
37
+ const [accessibleCredentials, servers] = await Promise.all([
38
+ this.credentialsFinderService.findCredentialsForUser(req.user, ['credential:read']),
39
+ this.mcpRegistryService.getBySlugs([...new Set(connections.map((c) => c.serverSlug))]),
40
+ ]);
41
+ const credentialById = new Map(accessibleCredentials.map((c) => [c.id, c]));
42
+ const serverBySlug = new Map(servers.map((server) => [server.slug, server]));
43
+ const enriched = [];
44
+ for (const connection of connections) {
45
+ const credential = credentialById.get(connection.credentialId);
46
+ if (!credential)
47
+ continue;
48
+ enriched.push(toResponse(connection, credential.name, credential.type, serverMetadata(serverBySlug.get(connection.serverSlug), connection.serverSlug)));
49
+ }
50
+ return enriched;
51
+ }
52
+ async create(req, _res, payload) {
53
+ const { connection, credential, server } = await this.service.createConnection(req.user, payload);
54
+ return toResponse(connection, credential.name, credential.type, serverMetadata(server, connection.serverSlug));
55
+ }
56
+ async update(req, _res, id, _payload) {
57
+ const connections = await this.service.listConnectionsForUser(req.user);
58
+ const connection = connections.find((c) => c.id === id);
59
+ if (!connection) {
60
+ throw new not_found_error_1.NotFoundError('MCP registry connection not found');
61
+ }
62
+ const credential = await this.credentialsFinderService.findCredentialForUser(connection.credentialId, req.user, ['credential:read']);
63
+ if (!credential) {
64
+ throw new not_found_error_1.NotFoundError('Credential not found for connection');
65
+ }
66
+ const server = await this.mcpRegistryService.get(connection.serverSlug);
67
+ return toResponse(connection, credential.name, credential.type, serverMetadata(server, connection.serverSlug));
68
+ }
69
+ async delete(req, _res, id) {
70
+ await this.service.deleteConnection(req.user, id);
71
+ }
72
+ };
73
+ exports.InstanceAiMcpConnectionController = InstanceAiMcpConnectionController;
74
+ __decorate([
75
+ (0, decorators_1.Get)('/'),
76
+ (0, decorators_1.GlobalScope)('instanceAi:message'),
77
+ __metadata("design:type", Function),
78
+ __metadata("design:paramtypes", [Object]),
79
+ __metadata("design:returntype", Promise)
80
+ ], InstanceAiMcpConnectionController.prototype, "list", null);
81
+ __decorate([
82
+ (0, decorators_1.Post)('/'),
83
+ (0, decorators_1.GlobalScope)('instanceAi:message'),
84
+ __param(2, decorators_1.Body),
85
+ __metadata("design:type", Function),
86
+ __metadata("design:paramtypes", [Object, Object, api_types_1.InstanceAiMcpCreateConnectionRequestDto]),
87
+ __metadata("design:returntype", Promise)
88
+ ], InstanceAiMcpConnectionController.prototype, "create", null);
89
+ __decorate([
90
+ (0, decorators_1.Patch)('/:id'),
91
+ (0, decorators_1.GlobalScope)('instanceAi:message'),
92
+ __param(2, (0, decorators_1.Param)('id')),
93
+ __param(3, decorators_1.Body),
94
+ __metadata("design:type", Function),
95
+ __metadata("design:paramtypes", [Object, Object, String, api_types_1.InstanceAiMcpUpdateConnectionRequestDto]),
96
+ __metadata("design:returntype", Promise)
97
+ ], InstanceAiMcpConnectionController.prototype, "update", null);
98
+ __decorate([
99
+ (0, decorators_1.Delete)('/:id'),
100
+ (0, decorators_1.GlobalScope)('instanceAi:message'),
101
+ __param(2, (0, decorators_1.Param)('id')),
102
+ __metadata("design:type", Function),
103
+ __metadata("design:paramtypes", [Object, Object, String]),
104
+ __metadata("design:returntype", Promise)
105
+ ], InstanceAiMcpConnectionController.prototype, "delete", null);
106
+ exports.InstanceAiMcpConnectionController = InstanceAiMcpConnectionController = __decorate([
107
+ (0, decorators_1.RestController)('/instance-ai/mcp/connections'),
108
+ __metadata("design:paramtypes", [instance_ai_mcp_registry_service_1.InstanceAiMcpRegistryService,
109
+ credentials_finder_service_1.CredentialsFinderService,
110
+ mcp_registry_service_1.McpRegistryService])
111
+ ], InstanceAiMcpConnectionController);
112
+ function toResponse(connection, credentialName, credentialType, server) {
113
+ return {
114
+ id: connection.id,
115
+ serverSlug: connection.serverSlug,
116
+ serverTitle: server.title,
117
+ serverIcons: server.icons,
118
+ credentialId: connection.credentialId,
119
+ credentialName,
120
+ credentialType,
121
+ createdAt: connection.createdAt.toISOString(),
122
+ updatedAt: connection.updatedAt.toISOString(),
123
+ };
124
+ }
125
+ //# sourceMappingURL=instance-ai-mcp-connection.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-ai-mcp-connection.controller.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/mcp/instance-ai-mcp-connection.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,8CAGwB;AAExB,gDASyB;AAGzB,yFAAoF;AACpF,8EAAyE;AACzE,+FAA0F;AAI1F,yFAAkF;AAOlF,SAAS,cAAc,CAAC,MAAqC,EAAE,IAAY;IAC1E,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACrD,CAAC;AAGM,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC7C,YACkB,OAAqC,EACrC,wBAAkD,EAClD,kBAAsC;QAFtC,YAAO,GAAP,OAAO,CAA8B;QACrC,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,uBAAkB,GAAlB,kBAAkB,CAAoB;IACrD,CAAC;IAIE,AAAN,KA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AM,CAAC,KAAK;QACzB,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,cAAc;QACd,cAAc;QACd,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE;QAC7C,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE;KAC7C,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { Logger } from '@n8n/backend-common';
2
+ import type { CredentialsEntity, User } from '@n8n/db';
3
+ import type { McpServerConfig } from '@n8n/instance-ai';
4
+ import { CredentialsFinderService } from '../../../credentials/credentials-finder.service';
5
+ import { CredentialsService } from '../../../credentials/credentials.service';
6
+ import { EventService } from '../../../events/event.service';
7
+ import { McpRegistryService } from '../../../modules/mcp-registry/registry/mcp-registry.service';
8
+ import type { McpRegistryServer } from '../../../modules/mcp-registry/registry/mcp-registry.types';
9
+ import { OauthService } from '../../../oauth/oauth.service';
10
+ import type { InstanceAiMcpRegistryConnection } from '../entities/instance-ai-mcp-registry-connection.entity';
11
+ import { InstanceAiMcpRegistryConnectionRepository } from '../repositories/instance-ai-mcp-registry-connection.repository';
12
+ export declare class InstanceAiMcpRegistryService {
13
+ private readonly connectionRepository;
14
+ private readonly mcpRegistryService;
15
+ private readonly credentialsFinderService;
16
+ private readonly credentialsService;
17
+ private readonly oauthService;
18
+ private readonly eventService;
19
+ private readonly logger;
20
+ constructor(logger: Logger, connectionRepository: InstanceAiMcpRegistryConnectionRepository, mcpRegistryService: McpRegistryService, credentialsFinderService: CredentialsFinderService, credentialsService: CredentialsService, oauthService: OauthService, eventService: EventService);
21
+ listConnectionsForUser(user: User): Promise<InstanceAiMcpRegistryConnection[]>;
22
+ createConnection(user: User, input: {
23
+ serverSlug: string;
24
+ credentialId: string;
25
+ }): Promise<{
26
+ connection: InstanceAiMcpRegistryConnection;
27
+ credential: CredentialsEntity;
28
+ server: McpRegistryServer;
29
+ }>;
30
+ deleteConnection(user: User, id: string): Promise<void>;
31
+ getRegistryMcpServers(user: User): Promise<McpServerConfig[]>;
32
+ private resolveRegistryServer;
33
+ private buildOAuth2FetchContext;
34
+ private getCredentialWithData;
35
+ }
@@ -0,0 +1,264 @@
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.InstanceAiMcpRegistryService = void 0;
13
+ const backend_common_1 = require("@n8n/backend-common");
14
+ const di_1 = require("@n8n/di");
15
+ const typeorm_1 = require("@n8n/typeorm");
16
+ const node_crypto_1 = require("node:crypto");
17
+ const credentials_finder_service_1 = require("../../../credentials/credentials-finder.service");
18
+ const credentials_service_1 = require("../../../credentials/credentials.service");
19
+ const conflict_error_1 = require("../../../errors/response-errors/conflict.error");
20
+ const not_found_error_1 = require("../../../errors/response-errors/not-found.error");
21
+ const event_service_1 = require("../../../events/event.service");
22
+ const mcp_registry_service_1 = require("../../../modules/mcp-registry/registry/mcp-registry.service");
23
+ const oauth_service_1 = require("../../../oauth/oauth.service");
24
+ const auth_fetch_1 = require("../../../utils/auth-fetch");
25
+ const instance_ai_mcp_registry_connection_repository_1 = require("../repositories/instance-ai-mcp-registry-connection.repository");
26
+ function readString(data, key) {
27
+ const value = data[key];
28
+ return typeof value === 'string' && value.length > 0 ? value : undefined;
29
+ }
30
+ function readAccessToken(tokenData) {
31
+ return readString(tokenData, 'accessToken') ?? readString(tokenData, 'access_token');
32
+ }
33
+ function readOAuthTokenData(data) {
34
+ const tokenData = data.oauthTokenData;
35
+ return (0, backend_common_1.isObjectLiteral)(tokenData) ? tokenData : null;
36
+ }
37
+ function getPreferredRemote(remotes) {
38
+ const streamable = remotes.find((remote) => remote.type === 'streamable-http');
39
+ if (streamable?.url) {
40
+ return { transport: 'streamableHttp', endpointUrl: streamable.url };
41
+ }
42
+ const sse = remotes.find((remote) => remote.type === 'sse');
43
+ if (sse?.url) {
44
+ return { transport: 'sse', endpointUrl: sse.url };
45
+ }
46
+ return null;
47
+ }
48
+ const MCP_REGISTRY_SERVER_PREFIX = 'mcp_';
49
+ const MAX_MCP_SERVER_NAME_LENGTH = 24;
50
+ function buildServerName(serverSlug, sequence) {
51
+ const safeSlug = serverSlug.replace(/[^A-Za-z0-9_-]/g, '_');
52
+ const baseName = `${MCP_REGISTRY_SERVER_PREFIX}${safeSlug}`;
53
+ if (sequence <= 1) {
54
+ return baseName.slice(0, MAX_MCP_SERVER_NAME_LENGTH);
55
+ }
56
+ const suffix = `_${sequence}`;
57
+ const maxBaseLength = Math.max(0, MAX_MCP_SERVER_NAME_LENGTH - suffix.length);
58
+ return `${baseName.slice(0, maxBaseLength)}${suffix}`;
59
+ }
60
+ let InstanceAiMcpRegistryService = class InstanceAiMcpRegistryService {
61
+ constructor(logger, connectionRepository, mcpRegistryService, credentialsFinderService, credentialsService, oauthService, eventService) {
62
+ this.connectionRepository = connectionRepository;
63
+ this.mcpRegistryService = mcpRegistryService;
64
+ this.credentialsFinderService = credentialsFinderService;
65
+ this.credentialsService = credentialsService;
66
+ this.oauthService = oauthService;
67
+ this.eventService = eventService;
68
+ this.logger = logger.scoped('instance-ai');
69
+ }
70
+ async listConnectionsForUser(user) {
71
+ return await this.connectionRepository.findBy({ userId: user.id });
72
+ }
73
+ async createConnection(user, input) {
74
+ const server = await this.mcpRegistryService.get(input.serverSlug);
75
+ if (!server) {
76
+ throw new not_found_error_1.NotFoundError(`Unknown MCP registry server: ${input.serverSlug}`);
77
+ }
78
+ const existing = await this.connectionRepository.findOneBy({
79
+ userId: user.id,
80
+ serverSlug: input.serverSlug,
81
+ });
82
+ if (existing) {
83
+ throw new conflict_error_1.ConflictError('This MCP server is already connected. Disconnect first to use a different credential.');
84
+ }
85
+ const credential = await this.credentialsFinderService.findCredentialForUser(input.credentialId, user, ['credential:read']);
86
+ if (!credential) {
87
+ throw new not_found_error_1.NotFoundError('Credential not found or not accessible');
88
+ }
89
+ const entity = this.connectionRepository.create({
90
+ id: (0, node_crypto_1.randomUUID)(),
91
+ userId: user.id,
92
+ serverSlug: input.serverSlug,
93
+ credentialId: input.credentialId,
94
+ });
95
+ try {
96
+ const connection = await this.connectionRepository.save(entity);
97
+ this.eventService.emit('instance-ai-mcp-registry-connection-created', {
98
+ userId: user.id,
99
+ serverSlug: input.serverSlug,
100
+ });
101
+ return { connection, credential, server };
102
+ }
103
+ catch (error) {
104
+ if (isUniqueConstraintViolation(error)) {
105
+ throw new conflict_error_1.ConflictError('A connection for this MCP server with this credential already exists');
106
+ }
107
+ throw error;
108
+ }
109
+ }
110
+ async deleteConnection(user, id) {
111
+ const connection = await this.connectionRepository.findOneBy({ id, userId: user.id });
112
+ if (!connection) {
113
+ throw new not_found_error_1.NotFoundError('MCP registry connection not found');
114
+ }
115
+ await this.connectionRepository.delete({ id });
116
+ this.eventService.emit('instance-ai-mcp-registry-connection-deleted', {
117
+ userId: user.id,
118
+ serverSlug: connection.serverSlug,
119
+ });
120
+ }
121
+ async getRegistryMcpServers(user) {
122
+ const connections = await this.connectionRepository.findBy({ userId: user.id });
123
+ if (connections.length === 0) {
124
+ return [];
125
+ }
126
+ const sortedConnections = connections.sort((left, right) => left.id.localeCompare(right.id));
127
+ const slugs = [...new Set(sortedConnections.map((connection) => connection.serverSlug))];
128
+ const servers = await this.mcpRegistryService.getBySlugs(slugs);
129
+ const serverBySlug = new Map(servers.map((server) => [server.slug, server]));
130
+ const slugCounts = new Map();
131
+ const resolved = [];
132
+ for (const connection of sortedConnections) {
133
+ const server = serverBySlug.get(connection.serverSlug);
134
+ if (!server) {
135
+ this.logger.warn('Skipping MCP registry connection with missing server slug', {
136
+ connectionId: connection.id,
137
+ serverSlug: connection.serverSlug,
138
+ userId: user.id,
139
+ });
140
+ continue;
141
+ }
142
+ const resolvedServer = this.resolveRegistryServer(connection.id, connection.serverSlug, connection.credentialId, server.authType, server.remotes);
143
+ if (!resolvedServer) {
144
+ continue;
145
+ }
146
+ const nextCount = (slugCounts.get(resolvedServer.serverSlug) ?? 0) + 1;
147
+ slugCounts.set(resolvedServer.serverSlug, nextCount);
148
+ const serverConfig = {
149
+ name: buildServerName(resolvedServer.serverSlug, nextCount),
150
+ url: resolvedServer.endpointUrl,
151
+ transport: resolvedServer.transport,
152
+ cacheKey: `registry-connection:${connection.id}`,
153
+ };
154
+ if (resolvedServer.authType === 'oauth2') {
155
+ const oauth2FetchContext = await this.buildOAuth2FetchContext(resolvedServer, user, connection.id);
156
+ if (!oauth2FetchContext) {
157
+ continue;
158
+ }
159
+ serverConfig.fetch = (0, auth_fetch_1.createAuthFetch)({
160
+ initialHeaders: { Authorization: `Bearer ${oauth2FetchContext.accessToken}` },
161
+ onUnauthorized: async () => {
162
+ if (!oauth2FetchContext.projectId) {
163
+ return null;
164
+ }
165
+ return await this.oauthService.refreshOAuth2CredentialById(oauth2FetchContext.credentialId, oauth2FetchContext.projectId);
166
+ },
167
+ });
168
+ }
169
+ resolved.push(serverConfig);
170
+ }
171
+ return resolved;
172
+ }
173
+ resolveRegistryServer(connectionId, serverSlug, credentialId, authType, remotes) {
174
+ const remote = getPreferredRemote(remotes);
175
+ if (!remote) {
176
+ this.logger.warn('Skipping MCP registry connection without supported remote transport', {
177
+ connectionId,
178
+ serverSlug,
179
+ credentialId,
180
+ });
181
+ return null;
182
+ }
183
+ return {
184
+ serverSlug,
185
+ credentialId,
186
+ authType,
187
+ endpointUrl: remote.endpointUrl,
188
+ transport: remote.transport,
189
+ };
190
+ }
191
+ async buildOAuth2FetchContext(config, user, connectionId) {
192
+ const credentialWithData = await this.getCredentialWithData(config.credentialId, user);
193
+ if (!credentialWithData) {
194
+ this.logger.warn('Skipping MCP registry connection with inaccessible credential', {
195
+ connectionId,
196
+ serverSlug: config.serverSlug,
197
+ credentialId: config.credentialId,
198
+ userId: user.id,
199
+ });
200
+ return null;
201
+ }
202
+ const tokenData = readOAuthTokenData(credentialWithData.data);
203
+ if (!tokenData) {
204
+ this.logger.warn('Skipping MCP registry connection without OAuth2 token data', {
205
+ connectionId,
206
+ serverSlug: config.serverSlug,
207
+ credentialId: config.credentialId,
208
+ });
209
+ return null;
210
+ }
211
+ const accessToken = readAccessToken(tokenData);
212
+ if (!accessToken) {
213
+ this.logger.warn('Skipping MCP registry connection without access token', {
214
+ connectionId,
215
+ serverSlug: config.serverSlug,
216
+ credentialId: config.credentialId,
217
+ });
218
+ return null;
219
+ }
220
+ const projectId = credentialWithData.credential.shared?.[0]?.projectId ?? null;
221
+ if (!projectId) {
222
+ this.logger.warn('Skipping OAuth2 token refresh for credential without project sharing', {
223
+ connectionId,
224
+ serverSlug: config.serverSlug,
225
+ credentialId: config.credentialId,
226
+ });
227
+ }
228
+ return {
229
+ credentialId: config.credentialId,
230
+ accessToken,
231
+ projectId,
232
+ };
233
+ }
234
+ async getCredentialWithData(credentialId, user) {
235
+ const credential = await this.credentialsFinderService.findCredentialForUser(credentialId, user, ['credential:read']);
236
+ if (!credential) {
237
+ return null;
238
+ }
239
+ const data = await this.credentialsService.decrypt(credential, true);
240
+ if (!(0, backend_common_1.isObjectLiteral)(data) || Object.keys(data).length === 0) {
241
+ return null;
242
+ }
243
+ return { credential, data };
244
+ }
245
+ };
246
+ exports.InstanceAiMcpRegistryService = InstanceAiMcpRegistryService;
247
+ exports.InstanceAiMcpRegistryService = InstanceAiMcpRegistryService = __decorate([
248
+ (0, di_1.Service)(),
249
+ __metadata("design:paramtypes", [backend_common_1.Logger,
250
+ instance_ai_mcp_registry_connection_repository_1.InstanceAiMcpRegistryConnectionRepository,
251
+ mcp_registry_service_1.McpRegistryService,
252
+ credentials_finder_service_1.CredentialsFinderService,
253
+ credentials_service_1.CredentialsService,
254
+ oauth_service_1.OauthService,
255
+ event_service_1.EventService])
256
+ ], InstanceAiMcpRegistryService);
257
+ function isUniqueConstraintViolation(error) {
258
+ if (!(error instanceof typeorm_1.QueryFailedError))
259
+ return false;
260
+ const driverError = error.driverError;
261
+ const code = driverError?.code;
262
+ return code === '23505' || code === 'SQLITE_CONSTRAINT_UNIQUE';
263
+ }
264
+ //# sourceMappingURL=instance-ai-mcp-registry.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-ai-mcp-registry.service.js","sourceRoot":"","sources":["../../../../src/modules/instance-ai/mcp/instance-ai-mcp-registry.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA8D;AAE9D,gCAAkC;AAElC,0CAAgD;AAChD,6CAAyC;AAGzC,yFAAoF;AACpF,2EAAuE;AACvE,4EAAwE;AACxE,8EAAyE;AACzE,0DAAsD;AACtD,+FAA0F;AAK1F,yDAAqD;AACrD,mDAAqD;AAGrD,mIAA2H;AAkB3H,SAAS,UAAU,CAAC,IAA6B,EAAE,GAAW;IAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,SAAkC;IAC1D,OAAO,UAAU,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,UAAU,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAoC;IAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC;IACtC,OAAO,IAAA,gCAAe,EAAC,SAAS,CAAC,CAAC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C,wBAAwB,CAAC,qBAAqB,CAC3E,YAAY,EACZ,IAAI,EACJ,CAAC,iBAAiB,CAAC,CACnB,CAAC;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,IAAA,gCAAe,EAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;CACD,CAAA;AAzQY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,YAAO,GAAE;qCAKA,uBAAM;QACyB,0FAAyC;QAC3C,yCAAkB;QACZ,qDAAwB;QAC9B,wCAAkB;QACxB,4BAAY;QACZ,4BAAY;GAVhC,4BAA4B,CAyQxC;AAED,SAAS,2BAA2B,CAAC,KAAc;IAClD,IAAI,CAAC,CAAC,KAAK,YAAY,0BAAgB,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,MAAM,WAAW,GAAG,KAAK,CAAC,WAAgC,CAAC;IAC3D,MAAM,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC;IAC/B,OAAO,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,0BAA0B,CAAC;AAChE,CAAC"}
@@ -0,0 +1,91 @@
1
+ import type { Logger } from '@n8n/backend-common';
2
+ import type { User } from '@n8n/db';
3
+ import type { PlannedTaskGraph, PlannedTaskRecord, PlannedTaskSchedulerAction, PlannedTaskService, PlannedWorkflowVerification, WorkflowBuildOutcome } from '@n8n/instance-ai';
4
+ export type PlannedBuildFollowUp = {
5
+ isPlannedBuildFollowUp: true;
6
+ buildTaskId: string;
7
+ workItemId: string;
8
+ isSupportingWorkflowTask?: boolean;
9
+ savedOutcome?: WorkflowBuildOutcome;
10
+ };
11
+ export type PlannedTaskRunScope = {
12
+ user: User;
13
+ threadId: string;
14
+ };
15
+ export type PlannedTaskActionRunnerResult = {
16
+ type: 'done';
17
+ } | {
18
+ type: 'continue-scheduling';
19
+ };
20
+ export type PlannedTaskView = {
21
+ sync(scope: PlannedTaskRunScope, graph: PlannedTaskGraph): Promise<void>;
22
+ };
23
+ export type PlannedTaskRunGate = {
24
+ hasLiveRun(threadId: string): boolean;
25
+ };
26
+ export type PlannedTaskDispatcher = {
27
+ dispatch(input: {
28
+ scope: PlannedTaskRunScope;
29
+ graph: PlannedTaskGraph;
30
+ tasks: PlannedTaskRecord[];
31
+ }): Promise<void>;
32
+ };
33
+ export type PlannedTaskFollowUpStarter = {
34
+ startReplan(input: {
35
+ scope: PlannedTaskRunScope;
36
+ graph: PlannedTaskGraph;
37
+ failedTask: PlannedTaskRecord;
38
+ }): Promise<string>;
39
+ startWorkflowVerification(input: {
40
+ scope: PlannedTaskRunScope;
41
+ graph: PlannedTaskGraph;
42
+ verification: PlannedWorkflowVerification;
43
+ }): Promise<string>;
44
+ startSynthesis(input: {
45
+ scope: PlannedTaskRunScope;
46
+ graph: PlannedTaskGraph;
47
+ }): Promise<string>;
48
+ startWorkflowBuild(input: {
49
+ scope: PlannedTaskRunScope;
50
+ graph: PlannedTaskGraph;
51
+ task: PlannedTaskRecord;
52
+ workItemId: string;
53
+ }): Promise<string>;
54
+ startCheckpoint(input: {
55
+ scope: PlannedTaskRunScope;
56
+ graph: PlannedTaskGraph;
57
+ task: PlannedTaskRecord;
58
+ }): Promise<string>;
59
+ };
60
+ export type PlannedWorkflowVerificationTracker = {
61
+ scheduled(verification: PlannedWorkflowVerification): void;
62
+ followUpStartAttempted(verification: PlannedWorkflowVerification, started: boolean): void;
63
+ };
64
+ export type PlannedWorkflowVerificationGate = {
65
+ revalidate(verification: PlannedWorkflowVerification): Promise<PlannedWorkflowVerification | undefined>;
66
+ };
67
+ type PlannedTaskActionRunnerDeps = {
68
+ scope: PlannedTaskRunScope;
69
+ plannedTaskService: PlannedTaskService;
70
+ logger: Logger;
71
+ view: PlannedTaskView;
72
+ runGate: PlannedTaskRunGate;
73
+ dispatcher: PlannedTaskDispatcher;
74
+ followUps: PlannedTaskFollowUpStarter;
75
+ workflowVerificationGate: PlannedWorkflowVerificationGate;
76
+ workflowVerificationTracker: PlannedWorkflowVerificationTracker;
77
+ };
78
+ export declare class PlannedTaskActionRunner {
79
+ private readonly deps;
80
+ constructor(deps: PlannedTaskActionRunnerDeps);
81
+ run(action: Exclude<PlannedTaskSchedulerAction, {
82
+ type: 'none';
83
+ }>): Promise<PlannedTaskActionRunnerResult>;
84
+ private runReplan;
85
+ private runWorkflowVerification;
86
+ private runSynthesize;
87
+ private runWorkflowBuild;
88
+ private runCheckpoint;
89
+ private runDispatch;
90
+ }
91
+ export {};