n8n 2.37.6 → 2.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (744) hide show
  1. package/dist/active-executions.js +2 -1
  2. package/dist/active-executions.js.map +1 -1
  3. package/dist/active-workflow-manager.d.ts +5 -1
  4. package/dist/active-workflow-manager.js +64 -33
  5. package/dist/active-workflow-manager.js.map +1 -1
  6. package/dist/binary-data/binary-data-access.service.d.ts +11 -0
  7. package/dist/binary-data/binary-data-access.service.js +50 -0
  8. package/dist/binary-data/binary-data-access.service.js.map +1 -0
  9. package/dist/build.tsbuildinfo +1 -1
  10. package/dist/commands/base-command.d.ts +2 -0
  11. package/dist/commands/base-command.js +8 -0
  12. package/dist/commands/base-command.js.map +1 -1
  13. package/dist/commands/import/workflow.d.ts +1 -0
  14. package/dist/commands/import/workflow.js +12 -3
  15. package/dist/commands/import/workflow.js.map +1 -1
  16. package/dist/commands/start.d.ts +1 -0
  17. package/dist/commands/start.js +2 -1
  18. package/dist/commands/start.js.map +1 -1
  19. package/dist/constants.d.ts +2 -0
  20. package/dist/constants.js +3 -1
  21. package/dist/constants.js.map +1 -1
  22. package/dist/controllers/binary-data.controller.d.ts +5 -2
  23. package/dist/controllers/binary-data.controller.js +11 -3
  24. package/dist/controllers/binary-data.controller.js.map +1 -1
  25. package/dist/controllers/e2e.controller.d.ts +1 -6
  26. package/dist/controllers/e2e.controller.js +7 -20
  27. package/dist/controllers/e2e.controller.js.map +1 -1
  28. package/dist/controllers/invitation.controller.d.ts +1 -5
  29. package/dist/controllers/invitation.controller.js +3 -32
  30. package/dist/controllers/invitation.controller.js.map +1 -1
  31. package/dist/controllers/project.controller.d.ts +4 -10
  32. package/dist/controllers/project.controller.js +14 -114
  33. package/dist/controllers/project.controller.js.map +1 -1
  34. package/dist/controllers/telemetry.controller.js +1 -1
  35. package/dist/controllers/telemetry.controller.js.map +1 -1
  36. package/dist/controllers/users.controller.d.ts +2 -27
  37. package/dist/controllers/users.controller.js +6 -132
  38. package/dist/controllers/users.controller.js.map +1 -1
  39. package/dist/credentials/credentials-finder.service.d.ts +2 -0
  40. package/dist/credentials/credentials-finder.service.js +46 -12
  41. package/dist/credentials/credentials-finder.service.js.map +1 -1
  42. package/dist/credentials/credentials.service.d.ts +5 -2
  43. package/dist/credentials/credentials.service.js +4 -1
  44. package/dist/credentials/credentials.service.js.map +1 -1
  45. package/dist/credentials-helper.d.ts +3 -1
  46. package/dist/credentials-helper.js +10 -2
  47. package/dist/credentials-helper.js.map +1 -1
  48. package/dist/deprecation/deprecation.service.js +5 -0
  49. package/dist/deprecation/deprecation.service.js.map +1 -1
  50. package/dist/errors/http-error-serializers.js +3 -0
  51. package/dist/errors/http-error-serializers.js.map +1 -1
  52. package/dist/errors/variable-validation.error.d.ts +2 -2
  53. package/dist/errors/variable-validation.error.js +1 -1
  54. package/dist/errors/variable-validation.error.js.map +1 -1
  55. package/dist/evaluation.ee/evaluation-config-validator.js +3 -2
  56. package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -1
  57. package/dist/evaluation.ee/evaluation-dataset.service.js +8 -1
  58. package/dist/evaluation.ee/evaluation-dataset.service.js.map +1 -1
  59. package/dist/evaluation.ee/evaluation-test-run.service.d.ts +46 -0
  60. package/dist/evaluation.ee/evaluation-test-run.service.js +65 -0
  61. package/dist/evaluation.ee/evaluation-test-run.service.js.map +1 -0
  62. package/dist/evaluation.ee/insights/insights-context-builder.js +4 -2
  63. package/dist/evaluation.ee/insights/insights-context-builder.js.map +1 -1
  64. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +96 -45
  65. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -1
  66. package/dist/evaluation.ee/test-runs.controller.ee.d.ts +1 -1
  67. package/dist/evaluation.ee/test-runs.controller.ee.js +5 -2
  68. package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
  69. package/dist/execution-lifecycle/execute-error-workflow.js +3 -0
  70. package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
  71. package/dist/executions/engine-v2-execution-reader.service.d.ts +11 -0
  72. package/dist/executions/engine-v2-execution-reader.service.js +68 -0
  73. package/dist/executions/engine-v2-execution-reader.service.js.map +1 -0
  74. package/dist/executions/execution-id.d.ts +5 -0
  75. package/dist/executions/execution-id.js +10 -0
  76. package/dist/executions/execution-id.js.map +1 -0
  77. package/dist/executions/execution.service.d.ts +3 -1
  78. package/dist/executions/execution.service.js +16 -8
  79. package/dist/executions/execution.service.js.map +1 -1
  80. package/dist/executions/executions.controller.d.ts +1 -0
  81. package/dist/executions/executions.controller.js +12 -6
  82. package/dist/executions/executions.controller.js.map +1 -1
  83. package/dist/expression-observability/expression-observability.provider.js +3 -2
  84. package/dist/expression-observability/expression-observability.provider.js.map +1 -1
  85. package/dist/license/license.service.js +1 -1
  86. package/dist/license/license.service.js.map +1 -1
  87. package/dist/metrics/prometheus/instance-ai-metrics.service.js.map +1 -1
  88. package/dist/middlewares/content-security-policy.d.ts +10 -0
  89. package/dist/middlewares/content-security-policy.js +53 -0
  90. package/dist/middlewares/content-security-policy.js.map +1 -0
  91. package/dist/middlewares/index.d.ts +1 -0
  92. package/dist/middlewares/index.js +1 -0
  93. package/dist/middlewares/index.js.map +1 -1
  94. package/dist/modules/agents/agent-config.service.js +0 -3
  95. package/dist/modules/agents/agent-config.service.js.map +1 -1
  96. package/dist/modules/agents/agent-default-model-resolver.service.js +2 -4
  97. package/dist/modules/agents/agent-default-model-resolver.service.js.map +1 -1
  98. package/dist/modules/agents/agent-execution-orchestrator.service.js +13 -6
  99. package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
  100. package/dist/modules/agents/agent-execution.service.d.ts +1 -0
  101. package/dist/modules/agents/agent-execution.service.js +3 -0
  102. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  103. package/dist/modules/agents/agent-integrations.controller.d.ts +7 -5
  104. package/dist/modules/agents/agent-integrations.controller.js +10 -17
  105. package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
  106. package/dist/modules/agents/agent-interrupted-execution-sweeper.d.ts +5 -1
  107. package/dist/modules/agents/agent-interrupted-execution-sweeper.js +14 -2
  108. package/dist/modules/agents/agent-interrupted-execution-sweeper.js.map +1 -1
  109. package/dist/modules/agents/agent-model-catalog.service.js +6 -12
  110. package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
  111. package/dist/modules/agents/agent-publish.service.d.ts +2 -3
  112. package/dist/modules/agents/agent-publish.service.js +12 -5
  113. package/dist/modules/agents/agent-publish.service.js.map +1 -1
  114. package/dist/modules/agents/agent-runtime-cache.service.d.ts +5 -0
  115. package/dist/modules/agents/agent-runtime-cache.service.js +57 -3
  116. package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
  117. package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +15 -7
  118. package/dist/modules/agents/agent-runtime-reconstruction.service.js +123 -37
  119. package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
  120. package/dist/modules/agents/agent-sandbox-runtime.service.d.ts +4 -2
  121. package/dist/modules/agents/agent-sandbox-runtime.service.js +21 -11
  122. package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
  123. package/dist/modules/agents/agent-validation.service.js +0 -4
  124. package/dist/modules/agents/agent-validation.service.js.map +1 -1
  125. package/dist/modules/agents/agent-workflow-execution.service.js +1 -1
  126. package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
  127. package/dist/modules/agents/agent-workflow-tool-resume.service.d.ts +32 -0
  128. package/dist/modules/agents/agent-workflow-tool-resume.service.js +168 -0
  129. package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -0
  130. package/dist/modules/agents/agent-workspace.service.d.ts +8 -2
  131. package/dist/modules/agents/agent-workspace.service.js +15 -4
  132. package/dist/modules/agents/agent-workspace.service.js.map +1 -1
  133. package/dist/modules/agents/agents.module.d.ts +1 -1
  134. package/dist/modules/agents/agents.module.js +11 -7
  135. package/dist/modules/agents/agents.module.js.map +1 -1
  136. package/dist/modules/agents/background/agent-background-job.service.d.ts +34 -0
  137. package/dist/modules/agents/background/agent-background-job.service.js +168 -0
  138. package/dist/modules/agents/background/agent-background-job.service.js.map +1 -0
  139. package/dist/modules/agents/background/background-job-tools.d.ts +21 -0
  140. package/dist/modules/agents/background/background-job-tools.js +157 -0
  141. package/dist/modules/agents/background/background-job-tools.js.map +1 -0
  142. package/dist/modules/agents/background/sub-agent-background-runner.d.ts +27 -0
  143. package/dist/modules/agents/background/sub-agent-background-runner.js +123 -0
  144. package/dist/modules/agents/background/sub-agent-background-runner.js.map +1 -0
  145. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +4 -6
  146. package/dist/modules/agents/builder/agents-builder-tools.service.js +16 -21
  147. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  148. package/dist/modules/agents/builder/agents-builder.service.d.ts +5 -7
  149. package/dist/modules/agents/builder/agents-builder.service.js +27 -36
  150. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  151. package/dist/modules/agents/builder/call-agent-failure.d.ts +5 -0
  152. package/dist/modules/agents/builder/call-agent-failure.js +28 -0
  153. package/dist/modules/agents/builder/call-agent-failure.js.map +1 -0
  154. package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
  155. package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +3 -2
  156. package/dist/modules/agents/builder/interactive/ask-credential.tool.js +8 -9
  157. package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
  158. package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +3 -2
  159. package/dist/modules/agents/builder/interactive/finish-setup.tool.js +16 -6
  160. package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
  161. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +57 -44
  162. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  163. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +3 -2
  164. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
  165. package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
  166. package/dist/modules/agents/builder/prompts/tools.prompt.js +6 -0
  167. package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
  168. package/dist/modules/agents/builder/skills/external-services.skill.js +51 -8
  169. package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
  170. package/dist/modules/agents/builder/skills/sub-agents.skill.js +15 -12
  171. package/dist/modules/agents/builder/skills/sub-agents.skill.js.map +1 -1
  172. package/dist/modules/agents/builder/skills/target-tasks.skill.js +16 -5
  173. package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
  174. package/dist/modules/agents/entities/agent-background-job.entity.d.ts +18 -0
  175. package/dist/modules/agents/entities/agent-background-job.entity.js +78 -0
  176. package/dist/modules/agents/entities/agent-background-job.entity.js.map +1 -0
  177. package/dist/modules/agents/entities/agent-channel-status.entity.d.ts +16 -0
  178. package/dist/modules/agents/entities/agent-channel-status.entity.js +99 -0
  179. package/dist/modules/agents/entities/agent-channel-status.entity.js.map +1 -0
  180. package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +3 -3
  181. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +17 -7
  182. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
  183. package/dist/modules/agents/integrations/agent-channel-reconciler.service.d.ts +38 -0
  184. package/dist/modules/agents/integrations/agent-channel-reconciler.service.js +260 -0
  185. package/dist/modules/agents/integrations/agent-channel-reconciler.service.js.map +1 -0
  186. package/dist/modules/agents/integrations/agent-channel-status-reporter.d.ts +23 -0
  187. package/dist/modules/agents/integrations/agent-channel-status-reporter.js +114 -0
  188. package/dist/modules/agents/integrations/agent-channel-status-reporter.js.map +1 -0
  189. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +9 -0
  190. package/dist/modules/agents/integrations/agent-chat-bridge.js +53 -1
  191. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  192. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +1 -1
  193. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +3 -2
  194. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
  195. package/dist/modules/agents/integrations/agent-chat-integration.d.ts +5 -2
  196. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
  197. package/dist/modules/agents/integrations/channel-status-report.d.ts +4 -0
  198. package/dist/modules/agents/integrations/channel-status-report.js +58 -0
  199. package/dist/modules/agents/integrations/channel-status-report.js.map +1 -0
  200. package/dist/modules/agents/integrations/chat-integration.service.d.ts +17 -2
  201. package/dist/modules/agents/integrations/chat-integration.service.js +63 -35
  202. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  203. package/dist/modules/agents/integrations/credential-claim.d.ts +3 -0
  204. package/dist/modules/agents/integrations/credential-claim.js +12 -0
  205. package/dist/modules/agents/integrations/credential-claim.js.map +1 -0
  206. package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +2 -0
  207. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +25 -0
  208. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
  209. package/dist/modules/agents/integrations/platforms/discord-integration.d.ts +2 -1
  210. package/dist/modules/agents/integrations/platforms/discord-integration.js +9 -6
  211. package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -1
  212. package/dist/modules/agents/integrations/platforms/linear-integration.js +1 -1
  213. package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
  214. package/dist/modules/agents/integrations/platforms/slack/slack-integration.d.ts +2 -1
  215. package/dist/modules/agents/integrations/platforms/slack/slack-integration.js +7 -6
  216. package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -1
  217. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +1 -1
  218. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -1
  219. package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +4 -6
  220. package/dist/modules/agents/integrations/platforms/telegram-integration.js +11 -14
  221. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
  222. package/dist/modules/agents/json-config/credential-field-mapping.js +3 -0
  223. package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -1
  224. package/dist/modules/agents/llm-provider-defaults.js +16 -1
  225. package/dist/modules/agents/llm-provider-defaults.js.map +1 -1
  226. package/dist/modules/agents/repositories/agent-background-job.repository.d.ts +37 -0
  227. package/dist/modules/agents/repositories/agent-background-job.repository.js +61 -0
  228. package/dist/modules/agents/repositories/agent-background-job.repository.js.map +1 -0
  229. package/dist/modules/agents/repositories/agent-channel-status.repository.d.ts +29 -0
  230. package/dist/modules/agents/repositories/agent-channel-status.repository.js +63 -0
  231. package/dist/modules/agents/repositories/agent-channel-status.repository.js.map +1 -0
  232. package/dist/modules/agents/repositories/agent-execution.repository.d.ts +1 -0
  233. package/dist/modules/agents/repositories/agent-execution.repository.js +4 -0
  234. package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
  235. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.d.ts +4 -5
  236. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +32 -32
  237. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
  238. package/dist/modules/agents/sub-agents/format-sub-agent-tool-output.d.ts +3 -0
  239. package/dist/modules/agents/sub-agents/format-sub-agent-tool-output.js +14 -0
  240. package/dist/modules/agents/sub-agents/format-sub-agent-tool-output.js.map +1 -0
  241. package/dist/modules/agents/sub-agents/sub-agent-cleanup.service.js.map +1 -1
  242. package/dist/modules/agents/sub-agents/{sub-agent-foreground-runner.d.ts → sub-agent-runner.d.ts} +10 -7
  243. package/dist/modules/agents/sub-agents/{sub-agent-foreground-runner.js → sub-agent-runner.js} +51 -27
  244. package/dist/modules/agents/sub-agents/sub-agent-runner.js.map +1 -0
  245. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.d.ts +1 -0
  246. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js +18 -6
  247. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js.map +1 -1
  248. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +24 -13
  249. package/dist/modules/agents/tools/workflow-tool-factory.js +147 -9
  250. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  251. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.d.ts +10 -2
  252. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js +23 -4
  253. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js.map +1 -1
  254. package/dist/modules/agents/utils/provider-model-id.d.ts +2 -0
  255. package/dist/modules/agents/utils/provider-model-id.js +21 -0
  256. package/dist/modules/agents/utils/provider-model-id.js.map +1 -0
  257. package/dist/modules/community-packages/community-packages.service.d.ts +4 -0
  258. package/dist/modules/community-packages/community-packages.service.js +96 -92
  259. package/dist/modules/community-packages/community-packages.service.js.map +1 -1
  260. package/dist/modules/community-packages/npm-utils.js +1 -5
  261. package/dist/modules/community-packages/npm-utils.js.map +1 -1
  262. package/dist/modules/data-table/data-table-aggregate.service.d.ts +1 -1
  263. package/dist/modules/data-table/data-table-aggregate.service.js +1 -1
  264. package/dist/modules/data-table/data-table-aggregate.service.js.map +1 -1
  265. package/dist/modules/data-table/data-table.service.d.ts +9 -4
  266. package/dist/modules/data-table/data-table.service.js +34 -4
  267. package/dist/modules/data-table/data-table.service.js.map +1 -1
  268. package/dist/modules/data-table/errors/data-table-access-denied.error.d.ts +4 -0
  269. package/dist/modules/data-table/errors/data-table-access-denied.error.js +13 -0
  270. package/dist/modules/data-table/errors/data-table-access-denied.error.js.map +1 -0
  271. package/dist/modules/dynamic-credentials.ee/config-redaction.d.ts +5 -0
  272. package/dist/modules/dynamic-credentials.ee/config-redaction.js +81 -0
  273. package/dist/modules/dynamic-credentials.ee/config-redaction.js.map +1 -0
  274. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.d.ts +2 -3
  275. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js +2 -4
  276. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js.map +1 -1
  277. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +1 -0
  278. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +18 -4
  279. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
  280. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +3 -2
  281. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
  282. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +22 -4
  283. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
  284. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +1 -0
  285. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +12 -2
  286. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
  287. package/dist/modules/encryption-key-manager/key-manager.service.d.ts +7 -2
  288. package/dist/modules/encryption-key-manager/key-manager.service.js +27 -8
  289. package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
  290. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.d.ts +6 -0
  291. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js +31 -0
  292. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js.map +1 -0
  293. package/dist/modules/engine-v2/engine-control-plane-client.d.ts +9 -0
  294. package/dist/modules/engine-v2/engine-control-plane-client.js +51 -0
  295. package/dist/modules/engine-v2/engine-control-plane-client.js.map +1 -0
  296. package/dist/modules/engine-v2/engine-control-plane-server.d.ts +14 -0
  297. package/dist/modules/engine-v2/engine-control-plane-server.js +84 -0
  298. package/dist/modules/engine-v2/engine-control-plane-server.js.map +1 -0
  299. package/dist/modules/engine-v2/engine-data-plane-client.d.ts +3 -1
  300. package/dist/modules/engine-v2/engine-data-plane-client.js +16 -1
  301. package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
  302. package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.d.ts +18 -0
  303. package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.js +150 -0
  304. package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.js.map +1 -0
  305. package/dist/modules/engine-v2/engine-lifecycle-event.controller.d.ts +7 -0
  306. package/dist/modules/engine-v2/engine-lifecycle-event.controller.js +34 -0
  307. package/dist/modules/engine-v2/engine-lifecycle-event.controller.js.map +1 -0
  308. package/dist/modules/engine-v2/engine-v2.constants.d.ts +2 -0
  309. package/dist/modules/engine-v2/engine-v2.constants.js +6 -0
  310. package/dist/modules/engine-v2/engine-v2.constants.js.map +1 -0
  311. package/dist/modules/engine-v2/engine-v2.module.js +4 -0
  312. package/dist/modules/engine-v2/engine-v2.module.js.map +1 -1
  313. package/dist/modules/engine-v2/engine-v2.runtime.d.ts +3 -1
  314. package/dist/modules/engine-v2/engine-v2.runtime.js +6 -2
  315. package/dist/modules/engine-v2/engine-v2.runtime.js.map +1 -1
  316. package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js +1 -1
  317. package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js.map +1 -1
  318. package/dist/modules/external-secrets.ee/providers/infisical.js +1 -1
  319. package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
  320. package/dist/modules/external-secrets.ee/providers/vault.js +1 -1
  321. package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
  322. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.d.ts +5 -3
  323. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js +16 -4
  324. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js.map +1 -1
  325. package/dist/modules/git-connections.ee/git-connections.service.d.ts +4 -2
  326. package/dist/modules/git-connections.ee/git-connections.service.js +87 -4
  327. package/dist/modules/git-connections.ee/git-connections.service.js.map +1 -1
  328. package/dist/modules/instance-ai/browser/browser-local-mcp-server.d.ts +3 -2
  329. package/dist/modules/instance-ai/browser/browser-local-mcp-server.js +48 -30
  330. package/dist/modules/instance-ai/browser/browser-local-mcp-server.js.map +1 -1
  331. package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
  332. package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +2 -28
  333. package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +5 -228
  334. package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -1
  335. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.d.ts +1 -3
  336. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js +2 -8
  337. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
  338. package/dist/modules/instance-ai/instance-ai-memory.service.js +1 -3
  339. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  340. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -0
  341. package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -2
  342. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  343. package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.d.ts +0 -2
  344. package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js +1 -2
  345. package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js.map +1 -1
  346. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -3
  347. package/dist/modules/instance-ai/instance-ai.adapter.service.js +101 -44
  348. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  349. package/dist/modules/instance-ai/instance-ai.controller.d.ts +1 -1
  350. package/dist/modules/instance-ai/instance-ai.controller.js +75 -83
  351. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  352. package/dist/modules/instance-ai/instance-ai.module.js +8 -16
  353. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  354. package/dist/modules/instance-ai/instance-ai.service.d.ts +2 -0
  355. package/dist/modules/instance-ai/instance-ai.service.js +55 -11
  356. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  357. package/dist/modules/instance-ai/internal-messages.d.ts +7 -0
  358. package/dist/modules/instance-ai/internal-messages.js +32 -2
  359. package/dist/modules/instance-ai/internal-messages.js.map +1 -1
  360. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.d.ts +2 -5
  361. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +4 -7
  362. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -1
  363. package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
  364. package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
  365. package/dist/modules/instance-ai/workflow-templates.service.js +1 -1
  366. package/dist/modules/instance-ai/workflow-templates.service.js.map +1 -1
  367. package/dist/modules/ldap.ee/ldap.controller.ee.d.ts +4 -2
  368. package/dist/modules/ldap.ee/ldap.controller.ee.js +9 -2
  369. package/dist/modules/ldap.ee/ldap.controller.ee.js.map +1 -1
  370. package/dist/modules/ldap.ee/ldap.service.ee.js +4 -0
  371. package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
  372. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js +1 -1
  373. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -1
  374. package/dist/modules/mcp/mcp-server-middleware.service.js +1 -0
  375. package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
  376. package/dist/modules/mcp/mcp.constants.d.ts +2 -0
  377. package/dist/modules/mcp/mcp.constants.js +3 -1
  378. package/dist/modules/mcp/mcp.constants.js.map +1 -1
  379. package/dist/modules/mcp/mcp.controller.js +20 -6
  380. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  381. package/dist/modules/mcp/mcp.types.d.ts +1 -0
  382. package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
  383. package/dist/modules/mcp/tools/agents/agent-reference.js +2 -2
  384. package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +2 -5
  385. package/dist/modules/mcp/tools/agents/agent-tools.service.js +5 -9
  386. package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
  387. package/dist/modules/n8n-packages/engine/import-result.d.ts +2 -1
  388. package/dist/modules/n8n-packages/engine/import-result.js +1 -0
  389. package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
  390. package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +5 -1
  391. package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
  392. package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +4 -5
  393. package/dist/modules/n8n-packages/engine/project-package-importer.js +9 -7
  394. package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
  395. package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +4 -5
  396. package/dist/modules/n8n-packages/engine/workflow-package-importer.js +18 -20
  397. package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
  398. package/dist/modules/n8n-packages/entities/credential/credential-importer.js +1 -0
  399. package/dist/modules/n8n-packages/entities/credential/credential-importer.js.map +1 -1
  400. package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js +12 -12
  401. package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map +1 -1
  402. package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.d.ts +4 -0
  403. package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.js +34 -0
  404. package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.js.map +1 -0
  405. package/dist/modules/n8n-packages/entities/project/project-importer.js +1 -1
  406. package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
  407. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +22 -14
  408. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
  409. package/dist/modules/n8n-packages/io/directory/directory-package-reader.d.ts +21 -0
  410. package/dist/modules/n8n-packages/io/directory/directory-package-reader.js +146 -0
  411. package/dist/modules/n8n-packages/io/directory/directory-package-reader.js.map +1 -0
  412. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +5 -1
  413. package/dist/modules/n8n-packages/n8n-packages.service.js +36 -0
  414. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
  415. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +10 -2
  416. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  417. package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.d.ts +1 -0
  418. package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.js +4 -0
  419. package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.js.map +1 -1
  420. package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.d.ts +1 -0
  421. package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.js.map +1 -1
  422. package/dist/modules/oauth-server/oauth-server.service.d.ts +1 -1
  423. package/dist/modules/oauth-server/oauth-server.service.js +12 -16
  424. package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
  425. package/dist/modules/oauth-server/oauth-token.service.d.ts +2 -1
  426. package/dist/modules/oauth-server/oauth-token.service.js +15 -3
  427. package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
  428. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.d.ts +22 -0
  429. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js +60 -0
  430. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js.map +1 -0
  431. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.d.ts +24 -0
  432. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.js +62 -0
  433. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.js.map +1 -0
  434. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.d.ts +22 -0
  435. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.js +56 -0
  436. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.js.map +1 -0
  437. package/dist/modules/oauth-server/protected-resource-resolvers/index.js +4 -0
  438. package/dist/modules/oauth-server/protected-resource-resolvers/index.js.map +1 -1
  439. package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +4 -0
  440. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +17 -1
  441. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
  442. package/dist/modules/oauth-server/resource-identity.d.ts +2 -0
  443. package/dist/modules/oauth-server/resource-identity.js +15 -0
  444. package/dist/modules/oauth-server/resource-identity.js.map +1 -0
  445. package/dist/modules/otel/otel.service.js +14 -7
  446. package/dist/modules/otel/otel.service.js.map +1 -1
  447. package/dist/modules/policy-infrastructure/policy-decision.service.d.ts +1 -0
  448. package/dist/modules/policy-infrastructure/policy-decision.service.js +3 -0
  449. package/dist/modules/policy-infrastructure/policy-decision.service.js.map +1 -1
  450. package/dist/modules/policy-infrastructure/policy-infrastructure.module.js +1 -0
  451. package/dist/modules/policy-infrastructure/policy-infrastructure.module.js.map +1 -1
  452. package/dist/modules/policy-infrastructure/policy-lifecycle-handler.d.ts +9 -0
  453. package/dist/modules/policy-infrastructure/policy-lifecycle-handler.js +45 -0
  454. package/dist/modules/policy-infrastructure/policy-lifecycle-handler.js.map +1 -0
  455. package/dist/modules/quick-connect/handlers/firecrawl.handler.js +1 -1
  456. package/dist/modules/quick-connect/handlers/firecrawl.handler.js.map +1 -1
  457. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +18 -1
  458. package/dist/modules/source-control.ee/source-control-import.service.ee.js +11 -3
  459. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  460. package/dist/modules/source-control.ee/source-control-status.service.ee.js +2 -0
  461. package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
  462. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +32 -0
  463. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +16 -0
  464. package/dist/modules/source-control.ee/source-control.service.ee.js +11 -2
  465. package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
  466. package/dist/modules/source-control.ee/types/import-result.d.ts +2 -1
  467. package/dist/modules/sso-oidc/oidc.controller.ee.js +2 -2
  468. package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
  469. package/dist/modules/sso-oidc/oidc.service.ee.js +1 -1
  470. package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
  471. package/dist/modules/sso-oidc/views/oidc-test-result.d.ts +2 -2
  472. package/dist/modules/sso-oidc/views/oidc-test-result.js +10 -4
  473. package/dist/modules/sso-oidc/views/oidc-test-result.js.map +1 -1
  474. package/dist/modules/sso-saml/saml.controller.ee.js +2 -2
  475. package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
  476. package/dist/modules/sso-saml/saml.service.ee.js +1 -1
  477. package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
  478. package/dist/modules/sso-saml/views/init-sso-post.d.ts +1 -1
  479. package/dist/modules/sso-saml/views/init-sso-post.js +2 -2
  480. package/dist/modules/sso-saml/views/init-sso-post.js.map +1 -1
  481. package/dist/modules/token-exchange/services/jwks-resolver.js +1 -1
  482. package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -1
  483. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.d.ts +7 -0
  484. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.js +38 -0
  485. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.js.map +1 -0
  486. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.d.ts +9 -0
  487. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.js +41 -0
  488. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.js.map +1 -0
  489. package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.d.ts +8 -0
  490. package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js +37 -0
  491. package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js.map +1 -0
  492. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.d.ts +17 -0
  493. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.js +96 -0
  494. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.js.map +1 -0
  495. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +20 -0
  496. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +69 -0
  497. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -0
  498. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +18 -0
  499. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +63 -0
  500. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -0
  501. package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +1 -0
  502. package/dist/modules/type-availability-policies/type-availability-policies.module.js +6 -0
  503. package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
  504. package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.d.ts +3 -5
  505. package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js +7 -9
  506. package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js.map +1 -1
  507. package/dist/modules/workflow-reviews.ee/{workflow-review-access.service.d.ts → workflow-review-authorization.service.d.ts} +12 -3
  508. package/dist/modules/workflow-reviews.ee/{workflow-review-access.service.js → workflow-review-authorization.service.js} +52 -17
  509. package/dist/modules/workflow-reviews.ee/workflow-review-authorization.service.js.map +1 -0
  510. package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.d.ts +14 -0
  511. package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.js +17 -0
  512. package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.js.map +1 -0
  513. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +8 -12
  514. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +28 -82
  515. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
  516. package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.d.ts +7 -6
  517. package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js +80 -110
  518. package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js.map +1 -1
  519. package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.d.ts +17 -0
  520. package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.js +69 -0
  521. package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.js.map +1 -0
  522. package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.d.ts +34 -0
  523. package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.js +237 -0
  524. package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.js.map +1 -0
  525. package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.d.ts +10 -0
  526. package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js +57 -0
  527. package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js.map +1 -0
  528. package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.d.ts +17 -0
  529. package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.js +93 -0
  530. package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.js.map +1 -0
  531. package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.d.ts +34 -0
  532. package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.js +268 -0
  533. package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.js.map +1 -0
  534. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.d.ts +7 -3
  535. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js +13 -9
  536. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js.map +1 -1
  537. package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.d.ts +9 -0
  538. package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.js +37 -0
  539. package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.js.map +1 -0
  540. package/dist/oauth/oauth.service.js +0 -1
  541. package/dist/oauth/oauth.service.js.map +1 -1
  542. package/dist/permissions.ee/check-access.js +11 -7
  543. package/dist/permissions.ee/check-access.js.map +1 -1
  544. package/dist/permissions.ee/project-scope.service.d.ts +1 -0
  545. package/dist/permissions.ee/project-scope.service.js +7 -2
  546. package/dist/permissions.ee/project-scope.service.js.map +1 -1
  547. package/dist/policy/evaluate-content-import-safely.d.ts +5 -0
  548. package/dist/policy/evaluate-content-import-safely.js +18 -0
  549. package/dist/policy/evaluate-content-import-safely.js.map +1 -0
  550. package/dist/policy/policy-enforcement-backend.d.ts +1 -0
  551. package/dist/policy/policy-enforcement.service.d.ts +2 -2
  552. package/dist/policy/policy-enforcement.service.js +10 -14
  553. package/dist/policy/policy-enforcement.service.js.map +1 -1
  554. package/dist/policy/policy-violation.error.d.ts +2 -0
  555. package/dist/policy/policy-violation.error.js +10 -0
  556. package/dist/policy/policy-violation.error.js.map +1 -1
  557. package/dist/public-api/types.d.ts +1 -14
  558. package/dist/public-api/v1/controllers/git-connections.public.controller.d.ts +2 -1
  559. package/dist/public-api/v1/controllers/git-connections.public.controller.js +24 -3
  560. package/dist/public-api/v1/controllers/git-connections.public.controller.js.map +1 -1
  561. package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +8 -1
  562. package/dist/public-api/v1/controllers/workflows.public.controller.js +151 -14
  563. package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
  564. package/dist/public-api/v1/handlers/credentials/credentials.handler.js +1 -0
  565. package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
  566. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +33 -44
  567. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
  568. package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +1 -1
  569. package/dist/public-api/v1/handlers/discover/discover.handler.js +3 -13
  570. package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
  571. package/dist/public-api/v1/handlers/discover/discover.service.d.ts +2 -3
  572. package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
  573. package/dist/public-api/v1/handlers/evaluations/evaluations.handler.js +11 -35
  574. package/dist/public-api/v1/handlers/evaluations/evaluations.handler.js.map +1 -1
  575. package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +1 -1
  576. package/dist/public-api/v1/handlers/projects/projects.handler.js +23 -21
  577. package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
  578. package/dist/public-api/v1/handlers/users/users.handler.ee.d.ts +1 -1
  579. package/dist/public-api/v1/handlers/users/users.handler.ee.js +16 -18
  580. package/dist/public-api/v1/handlers/users/users.handler.ee.js.map +1 -1
  581. package/dist/public-api/v1/handlers/users/users.mapper.d.ts +12 -0
  582. package/dist/public-api/v1/handlers/users/users.mapper.js +27 -0
  583. package/dist/public-api/v1/handlers/users/users.mapper.js.map +1 -0
  584. package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +1 -1
  585. package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -6
  586. package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
  587. package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -4
  588. package/dist/public-api/v1/handlers/workflows/workflows.handler.js +0 -102
  589. package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
  590. package/dist/public-api/v1/openapi.yml +4779 -2848
  591. package/dist/response-helper.js +3 -0
  592. package/dist/response-helper.js.map +1 -1
  593. package/dist/scaling/constants.d.ts +2 -2
  594. package/dist/scaling/constants.js +2 -0
  595. package/dist/scaling/constants.js.map +1 -1
  596. package/dist/scaling/pubsub/pubsub.event-map.d.ts +8 -1
  597. package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
  598. package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js +2 -7
  599. package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js.map +1 -1
  600. package/dist/security/content-security-policy.d.ts +8 -0
  601. package/dist/security/content-security-policy.js +18 -0
  602. package/dist/security/content-security-policy.js.map +1 -0
  603. package/dist/security-audit/risk-reporters/instance-risk-reporter.js +1 -1
  604. package/dist/security-audit/risk-reporters/instance-risk-reporter.js.map +1 -1
  605. package/dist/server.js +22 -21
  606. package/dist/server.js.map +1 -1
  607. package/dist/services/active-workflows.service.d.ts +3 -1
  608. package/dist/services/active-workflows.service.js +11 -9
  609. package/dist/services/active-workflows.service.js.map +1 -1
  610. package/dist/services/ai-gateway.service.js +1 -1
  611. package/dist/services/ai-gateway.service.js.map +1 -1
  612. package/dist/services/credentials-tester.service.js +7 -1
  613. package/dist/services/credentials-tester.service.js.map +1 -1
  614. package/dist/services/engine-data-plane-proxy.service.d.ts +4 -1
  615. package/dist/services/engine-data-plane-proxy.service.js +5 -0
  616. package/dist/services/engine-data-plane-proxy.service.js.map +1 -1
  617. package/dist/services/engine-v2-dispatcher.service.d.ts +5 -2
  618. package/dist/services/engine-v2-dispatcher.service.js +46 -24
  619. package/dist/services/engine-v2-dispatcher.service.js.map +1 -1
  620. package/dist/services/engine-v2-push-registry.service.d.ts +8 -0
  621. package/dist/services/engine-v2-push-registry.service.js +51 -0
  622. package/dist/services/engine-v2-push-registry.service.js.map +1 -0
  623. package/dist/services/engine-v2-push-session.d.ts +23 -0
  624. package/dist/services/engine-v2-push-session.js +24 -0
  625. package/dist/services/engine-v2-push-session.js.map +1 -0
  626. package/dist/services/folder-finder.service.js +10 -8
  627. package/dist/services/folder-finder.service.js.map +1 -1
  628. package/dist/services/folder.service.d.ts +1 -1
  629. package/dist/services/folder.service.js +1 -7
  630. package/dist/services/folder.service.js.map +1 -1
  631. package/dist/services/import.service.d.ts +14 -3
  632. package/dist/services/import.service.js +27 -2
  633. package/dist/services/import.service.js.map +1 -1
  634. package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
  635. package/dist/services/project.service.ee.d.ts +48 -9
  636. package/dist/services/project.service.ee.js +131 -17
  637. package/dist/services/project.service.ee.js.map +1 -1
  638. package/dist/services/role.service.js +10 -5
  639. package/dist/services/role.service.js.map +1 -1
  640. package/dist/services/user.service.d.ts +41 -8
  641. package/dist/services/user.service.js +174 -8
  642. package/dist/services/user.service.js.map +1 -1
  643. package/dist/task-runners/task-runner-process-py.d.ts +1 -1
  644. package/dist/task-runners/task-runner-process-py.js.map +1 -1
  645. package/dist/telemetry/index.js +1 -1
  646. package/dist/telemetry/index.js.map +1 -1
  647. package/dist/utils/ai-proxy-fetch.d.ts +3 -4
  648. package/dist/utils/ai-proxy-fetch.js +3 -5
  649. package/dist/utils/ai-proxy-fetch.js.map +1 -1
  650. package/dist/utils/strapi-utils.js +1 -1
  651. package/dist/utils/strapi-utils.js.map +1 -1
  652. package/dist/utils/ttl-map.d.ts +1 -0
  653. package/dist/utils/ttl-map.js +9 -0
  654. package/dist/utils/ttl-map.js.map +1 -1
  655. package/dist/webhooks/constants.d.ts +2 -0
  656. package/dist/webhooks/constants.js +2 -1
  657. package/dist/webhooks/constants.js.map +1 -1
  658. package/dist/webhooks/live-webhooks.js +1 -1
  659. package/dist/webhooks/live-webhooks.js.map +1 -1
  660. package/dist/webhooks/test-webhook-registrations.service.d.ts +1 -0
  661. package/dist/webhooks/test-webhook-registrations.service.js.map +1 -1
  662. package/dist/webhooks/test-webhooks.d.ts +6 -2
  663. package/dist/webhooks/test-webhooks.js +29 -6
  664. package/dist/webhooks/test-webhooks.js.map +1 -1
  665. package/dist/webhooks/waiting-forms.js +3 -4
  666. package/dist/webhooks/waiting-forms.js.map +1 -1
  667. package/dist/webhooks/waiting-webhooks.js +4 -0
  668. package/dist/webhooks/waiting-webhooks.js.map +1 -1
  669. package/dist/webhooks/webhook-helpers.d.ts +3 -1
  670. package/dist/webhooks/webhook-helpers.js +24 -1
  671. package/dist/webhooks/webhook-helpers.js.map +1 -1
  672. package/dist/webhooks/webhook-response-headers.d.ts +1 -0
  673. package/dist/webhooks/webhook-response-headers.js +6 -0
  674. package/dist/webhooks/webhook-response-headers.js.map +1 -1
  675. package/dist/workflow-execute-additional-data.js +5 -0
  676. package/dist/workflow-execute-additional-data.js.map +1 -1
  677. package/dist/workflow-helpers.d.ts +3 -2
  678. package/dist/workflow-helpers.js +35 -24
  679. package/dist/workflow-helpers.js.map +1 -1
  680. package/dist/workflows/publication/publication-result.d.ts +5 -0
  681. package/dist/workflows/publication/publication-status-reporter.d.ts +1 -0
  682. package/dist/workflows/publication/publication-status-reporter.js +23 -5
  683. package/dist/workflows/publication/publication-status-reporter.js.map +1 -1
  684. package/dist/workflows/publication/workflow-publication-applier.d.ts +6 -1
  685. package/dist/workflows/publication/workflow-publication-applier.js +63 -10
  686. package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
  687. package/dist/workflows/triggers/poll-backoff.service.d.ts +2 -2
  688. package/dist/workflows/triggers/poll-backoff.service.js +3 -3
  689. package/dist/workflows/triggers/poll-backoff.service.js.map +1 -1
  690. package/dist/workflows/triggers/poll-cursor.service.d.ts +2 -2
  691. package/dist/workflows/triggers/poll-cursor.service.js +4 -1
  692. package/dist/workflows/triggers/poll-cursor.service.js.map +1 -1
  693. package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +6 -4
  694. package/dist/workflows/triggers/trigger-execution-context.factory.js +13 -7
  695. package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
  696. package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +1 -0
  697. package/dist/workflows/triggers/webhook-trigger-registrar.js +3 -0
  698. package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
  699. package/dist/workflows/triggers/workflow-trigger-activator.d.ts +10 -1
  700. package/dist/workflows/triggers/workflow-trigger-activator.js +78 -38
  701. package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
  702. package/dist/workflows/workflow-creation.service.d.ts +17 -4
  703. package/dist/workflows/workflow-creation.service.js +96 -16
  704. package/dist/workflows/workflow-creation.service.js.map +1 -1
  705. package/dist/workflows/workflow-execution.service.js +2 -0
  706. package/dist/workflows/workflow-execution.service.js.map +1 -1
  707. package/dist/workflows/workflow-finder.service.js +67 -56
  708. package/dist/workflows/workflow-finder.service.js.map +1 -1
  709. package/dist/workflows/workflow-validation.service.js +3 -2
  710. package/dist/workflows/workflow-validation.service.js.map +1 -1
  711. package/dist/workflows/workflow.service.d.ts +4 -1
  712. package/dist/workflows/workflow.service.ee.d.ts +9 -3
  713. package/dist/workflows/workflow.service.ee.js +16 -2
  714. package/dist/workflows/workflow.service.ee.js.map +1 -1
  715. package/dist/workflows/workflow.service.js +25 -4
  716. package/dist/workflows/workflow.service.js.map +1 -1
  717. package/dist/workflows/workflows.controller.d.ts +3 -5
  718. package/dist/workflows/workflows.controller.js +3 -7
  719. package/dist/workflows/workflows.controller.js.map +1 -1
  720. package/package.json +37 -37
  721. package/templates/oauth-callback.handlebars +1 -1
  722. package/templates/oauth-error-callback.handlebars +1 -1
  723. package/templates/saml-connection-test-failed.handlebars +4 -1
  724. package/templates/saml-connection-test-success.handlebars +4 -1
  725. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +0 -1
  726. package/dist/modules/instance-ai/output-redaction-config.d.ts +0 -3
  727. package/dist/modules/instance-ai/output-redaction-config.js +0 -21
  728. package/dist/modules/instance-ai/output-redaction-config.js.map +0 -1
  729. package/dist/modules/workflow-reviews.ee/workflow-review-access.service.js.map +0 -1
  730. package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.d.ts +0 -18
  731. package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js +0 -77
  732. package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js.map +0 -1
  733. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +0 -51
  734. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +0 -538
  735. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +0 -1
  736. package/dist/policy/policy-cleared.d.ts +0 -20
  737. package/dist/policy/policy-cleared.js +0 -22
  738. package/dist/policy/policy-cleared.js.map +0 -1
  739. package/dist/public-api/v1/handlers/data-tables/data-tables.service.d.ts +0 -4
  740. package/dist/public-api/v1/handlers/data-tables/data-tables.service.js +0 -44
  741. package/dist/public-api/v1/handlers/data-tables/data-tables.service.js.map +0 -1
  742. package/dist/public-api/v1/handlers/users/users.service.ee.d.ts +0 -21
  743. package/dist/public-api/v1/handlers/users/users.service.ee.js +0 -68
  744. package/dist/public-api/v1/handlers/users/users.service.ee.js.map +0 -1
@@ -6,7 +6,7 @@ function subAgentsSkill() {
6
6
  return {
7
7
  id: 'agent-builder-sub-agents',
8
8
  name: 'Agent Builder Sub-Agents',
9
- description: 'Use when configuring inline or saved sub-agent delegation for the target agent, selecting published same-project sub-agents, or changing subAgents.maxChildren.',
9
+ description: 'Use when configuring inline or saved sub-agent delegation for the target agent, selecting same-project sub-agents, or changing subAgents.maxChildren.',
10
10
  recommendedTools: ['list_sub_agents', 'ask_questions', 'read_config', 'patch_config'],
11
11
  allowedTools: [
12
12
  'list_sub_agents',
@@ -30,9 +30,8 @@ The target agent can call \`delegate_subagent\` with \`subAgentId: "inline"\`
30
30
  without any saved-agent refs. Inline subagents are ad-hoc child agents for
31
31
  one-off focused tasks.
32
32
 
33
- \`subAgents.agents\` is only for optional saved/published n8n Agent specialists
34
- that the target agent may select by id when they are a better fit than an inline
35
- subagent.
33
+ \`subAgents.agents\` is only for optional saved n8n Agent specialists that the
34
+ target agent may select by id when they are a better fit than an inline subagent.
36
35
 
37
36
  ## When to configure
38
37
 
@@ -43,19 +42,19 @@ subagent.
43
42
  delegated tasks in a run. It is not the same as \`config.toolCallConcurrency\`.
44
43
  - Do not create fields such as \`subAgents.maxConcurrentDelegations\`,
45
44
  \`delegationConcurrency\`, or \`delegateConcurrency\`.
46
- - Add saved subagent refs only when the user asks to use specific published
47
- agents, reusable specialists, named helper agents, or saved-agent delegation.
45
+ - Add saved subagent refs only when the user asks to use specific agents,
46
+ reusable specialists, named helper agents, or saved-agent delegation.
48
47
 
49
48
  ## Saved sub-agent workflow
50
49
 
51
- 1. Call \`list_sub_agents\` to discover published same-project agents that can be
52
- added. Do not write agent ids from memory, prose, or user-entered free text.
53
- 2. If published agents are available and the user has not named exact agents,
50
+ 1. Call \`list_sub_agents\` to discover same-project agents that can be added.
51
+ Do not write agent ids from memory, prose, or user-entered free text.
52
+ 2. If agents are available and the user has not named exact agents,
54
53
  call \`ask_questions\` with one \`type: "multi"\` question whose \`options\`
55
54
  are the returned agent names. Map each selected option back to the
56
55
  matching \`agentId\` from the \`list_sub_agents\` result.
57
- 3. If no published agents are available, do not configure saved subagents.
58
- Inline delegation still works without saved-agent refs.
56
+ 3. If no agents are available, do not configure saved subagents. Inline
57
+ delegation still works without saved-agent refs.
59
58
  4. Determine the parent-owned routing guidance for each selected saved
60
59
  subagent. Store it as \`useWhen\`, for example
61
60
  \`{ "agentId": "<returned-agent-id>", "useWhen": "Use for billing-policy questions and invoice investigations." }\`.
@@ -80,6 +79,10 @@ Example patch flow:
80
79
 
81
80
  ## Rules
82
81
 
82
+ - Saved subagents run their current draft in Preview/test runs and their
83
+ published version in production runs. Delegating to a never-published agent
84
+ fails in production, so tell the user to publish saved subagents the target
85
+ agent relies on before production use.
83
86
  - If the resumed values include text that is not one of the listed agent ids,
84
87
  do not persist it as an agent id; ask a follow-up.
85
88
  - \`useWhen\` is relationship-specific routing guidance owned by this parent
@@ -121,7 +124,7 @@ Example shape:
121
124
  ## Verify
122
125
 
123
126
  - Inline delegation still works even when \`subAgents.agents\` is absent.
124
- - Saved refs use only returned same-project published agent ids.
127
+ - Saved refs use only returned same-project agent ids.
125
128
  - New or updated saved refs include concrete \`useWhen\` guidance.
126
129
  - Any \`subAgents.maxChildren\` value stays within ${api_types_1.SUB_AGENT_MAX_CHILDREN_MIN} to ${api_types_1.SUB_AGENT_MAX_CHILDREN_MAX}.`,
127
130
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sub-agents.skill.js","sourceRoot":"","sources":["../../../../../src/modules/agents/builder/skills/sub-agents.skill.ts"],"names":[],"mappings":";;;AACA,8CAIwB;AAExB;IACC,OAAO;QACN,EAAE,EAAE,0BAA0B;QAC9B,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACV,iKAAiK;QAClK,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC;QACrF,YAAY,EAAE;YACb,iBAAiB;YACjB,eAAe;YACf,aAAa;YACb,cAAc;YACd,cAAc;SACd;QACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;sDAuBsC,sCAA0B,OAAO,sCAA0B,gCAAgC,0CAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAqF1H,sCAA0B,OAAO,sCAA0B,GAAG;KACjH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"sub-agents.skill.js","sourceRoot":"","sources":["../../../../../src/modules/agents/builder/skills/sub-agents.skill.ts"],"names":[],"mappings":";;;AACA,8CAIwB;AAExB;IACC,OAAO;QACN,EAAE,EAAE,0BAA0B;QAC9B,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACV,uJAAuJ;QACxJ,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC;QACrF,YAAY,EAAE;YACb,iBAAiB;YACjB,eAAe;YACf,aAAa;YACb,cAAc;YACd,cAAc;SACd;QACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;sDAsBsC,sCAA0B,OAAO,sCAA0B,gCAAgC,0CAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAyF1H,sCAA0B,OAAO,sCAA0B,GAAG;KACjH,CAAC;AACH,CAAC"}
@@ -88,9 +88,13 @@ Initial Build rules in your system prompt. Never create a placeholder or
88
88
  - For each new or replacement objective, fill every template section with
89
89
  run-specific details. Do not duplicate Agent Instructions or Skill bodies;
90
90
  name a configured capability only when it helps route the work.
91
- - Make sure the agent already has every tool the steps need (an integration,
92
- node/workflow tool, or web search). If something is missing, add it to the agent
93
- config first — a task can only use tools the agent already has.
91
+ - Make sure the agent already has every capability the steps need (an
92
+ integration, node/workflow tool, or web search). Configured chat integrations
93
+ automatically generate their context and action tools in scheduled runs too.
94
+ If the task sends through a configured platform and the integration lists the
95
+ needed action (for example \`send_dm\`), use that action; do not add a
96
+ same-platform node, MCP, or workflow tool. Add a tool only when the exact
97
+ operation is not supplied by an existing integration.
94
98
  - Translate each cadence into a valid 5-field cron expression (e.g. daily 09:00
95
99
  -> "0 9 * * *"; weekdays 08:30 -> "30 8 * * 1-5"; hourly -> "0 * * * *").
96
100
  Keep this cadence out of the objective; only a data lookback window belongs
@@ -125,8 +129,15 @@ Initial Build rules in your system prompt. Never create a placeholder or
125
129
  - To disable or remove a task, edit \`config.tasks\` with \`patch_config\` (set
126
130
  \`enabled: false\`, or drop the ref). Changes take effect on the next
127
131
  \`publish_agent\`.
128
- - \`create_tasks\` does NOT add tools — if a task needs a tool the agent lacks,
129
- add it to the config yourself first.
132
+ - \`create_tasks\` does not add config tools. This does not mean a scheduled
133
+ message needs a messaging node: configured integrations supply their generated
134
+ action tools at runtime even when the task has no inbound conversation.
135
+ - A proactive or scheduled send through a connected chat platform is not a
136
+ separate backend integration. Use the channel's \`send_dm\` or
137
+ \`send_channel_message\` action when available.
138
+ - Never claim that a task requires a same-platform messaging node solely because
139
+ it starts without an inbound conversation. If such a redundant tool already
140
+ exists and the integration covers its action, remove it.
130
141
  - Do not call \`create_tasks\` once per task when several are ready; batch them
131
142
  into one call so the whole set is stored in a single round trip.`,
132
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"target-tasks.skill.js","sourceRoot":"","sources":["../../../../../src/modules/agents/builder/skills/target-tasks.skill.ts"],"names":[],"mappings":";;;AAEA,wEAAiG;AAEjG;IACC,OAAO;QACN,EAAE,EAAE,4BAA4B;QAChC,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACV,kMAAkM;QACnM,gBAAgB,EAAE;YACjB,cAAc;YACd,YAAY;YACZ,aAAa;YACb,eAAe;YACf,aAAa;YACb,cAAc;YACd,eAAe;SACf;QACD,YAAY,EAAE;YACb,cAAc;YACd,YAAY;YACZ,aAAa;YACb,eAAe;YACf,aAAa;YACb,cAAc;YACd,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,gBAAgB;YAChB,gBAAgB;YAChB,eAAe;SACf;QACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;EAyBd,oDAA0B;;EAE1B,iDAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEAuE0C;KACjE,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"target-tasks.skill.js","sourceRoot":"","sources":["../../../../../src/modules/agents/builder/skills/target-tasks.skill.ts"],"names":[],"mappings":";;;AAEA,wEAAiG;AAEjG;IACC,OAAO;QACN,EAAE,EAAE,4BAA4B;QAChC,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACV,kMAAkM;QACnM,gBAAgB,EAAE;YACjB,cAAc;YACd,YAAY;YACZ,aAAa;YACb,eAAe;YACf,aAAa;YACb,cAAc;YACd,eAAe;SACf;QACD,YAAY,EAAE;YACb,cAAc;YACd,YAAY;YACZ,aAAa;YACb,eAAe;YACf,aAAa;YACb,cAAc;YACd,cAAc;YACd,gBAAgB;YAChB,cAAc;YACd,gBAAgB;YAChB,gBAAgB;YAChB,eAAe;SACf;QACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;EAyBd,oDAA0B;;EAE1B,iDAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEAkF0C;KACjE,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { WithTimestampsAndStringId } from '@n8n/db';
2
+ export type AgentBackgroundJobKind = 'subagent' | 'workflow';
3
+ export type AgentBackgroundJobStatus = 'running' | 'completed' | 'failed' | 'cancelled';
4
+ export declare class AgentBackgroundJob extends WithTimestampsAndStringId {
5
+ kind: AgentBackgroundJobKind;
6
+ status: AgentBackgroundJobStatus;
7
+ parentAgentId: string;
8
+ parentThreadId: string;
9
+ title: string;
10
+ subAgentId: string | null;
11
+ childThreadId: string | null;
12
+ childExecutionId: string | null;
13
+ workflowId: string | null;
14
+ timeoutAt: Date | null;
15
+ result: string | null;
16
+ error: string | null;
17
+ settledAt: Date | null;
18
+ }
@@ -0,0 +1,78 @@
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.AgentBackgroundJob = void 0;
13
+ const db_1 = require("@n8n/db");
14
+ const typeorm_1 = require("@n8n/typeorm");
15
+ let AgentBackgroundJob = class AgentBackgroundJob extends db_1.WithTimestampsAndStringId {
16
+ };
17
+ exports.AgentBackgroundJob = AgentBackgroundJob;
18
+ __decorate([
19
+ (0, typeorm_1.Column)({ type: 'varchar', length: 16 }),
20
+ __metadata("design:type", String)
21
+ ], AgentBackgroundJob.prototype, "kind", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ type: 'varchar', length: 16 }),
24
+ __metadata("design:type", String)
25
+ ], AgentBackgroundJob.prototype, "status", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: 'varchar', length: 36 }),
28
+ __metadata("design:type", String)
29
+ ], AgentBackgroundJob.prototype, "parentAgentId", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'varchar', length: 128 }),
32
+ __metadata("design:type", String)
33
+ ], AgentBackgroundJob.prototype, "parentThreadId", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
36
+ __metadata("design:type", String)
37
+ ], AgentBackgroundJob.prototype, "title", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'varchar', length: 36, nullable: true }),
40
+ __metadata("design:type", Object)
41
+ ], AgentBackgroundJob.prototype, "subAgentId", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'varchar', length: 128, nullable: true }),
44
+ __metadata("design:type", Object)
45
+ ], AgentBackgroundJob.prototype, "childThreadId", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'varchar', length: 36, nullable: true }),
48
+ __metadata("design:type", Object)
49
+ ], AgentBackgroundJob.prototype, "childExecutionId", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: 'varchar', length: 36, nullable: true }),
52
+ __metadata("design:type", Object)
53
+ ], AgentBackgroundJob.prototype, "workflowId", void 0);
54
+ __decorate([
55
+ (0, db_1.DateTimeColumn)({ precision: 3, nullable: true }),
56
+ __metadata("design:type", Object)
57
+ ], AgentBackgroundJob.prototype, "timeoutAt", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], AgentBackgroundJob.prototype, "result", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
64
+ __metadata("design:type", Object)
65
+ ], AgentBackgroundJob.prototype, "error", void 0);
66
+ __decorate([
67
+ (0, db_1.DateTimeColumn)({ precision: 3, nullable: true }),
68
+ __metadata("design:type", Object)
69
+ ], AgentBackgroundJob.prototype, "settledAt", void 0);
70
+ exports.AgentBackgroundJob = AgentBackgroundJob = __decorate([
71
+ (0, typeorm_1.Entity)({ name: 'agent_background_job' }),
72
+ (0, typeorm_1.Index)(['parentThreadId', 'status']),
73
+ (0, typeorm_1.Index)(['parentAgentId']),
74
+ (0, typeorm_1.Index)(['settledAt']),
75
+ (0, typeorm_1.Index)(['childExecutionId'], { unique: true, where: '"childExecutionId" IS NOT NULL' }),
76
+ (0, typeorm_1.Index)(['timeoutAt'], { where: '"status" = \'running\'' })
77
+ ], AgentBackgroundJob);
78
+ //# sourceMappingURL=agent-background-job.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-background-job.entity.js","sourceRoot":"","sources":["../../../../src/modules/agents/entities/agent-background-job.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAoE;AACpE,0CAAqD;AAkB9C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,8BAAyB;CAiDhE,CAAA;;AA/CA;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;gDACX;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE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1B;6BAhDX,kBAAkB;IAN9B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;IACxC,IAAA,eAAK,EAAC,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IACnC,IAAA,eAAK,EAAC,CAAC,eAAe,CAAC,CAAC;IACxB,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;IACpB,IAAA,eAAK,EAAC,CAAC,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAC;IACtF,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC;GAC7C,kBAAkB,CAiD9B"}
@@ -0,0 +1,16 @@
1
+ import { WithTimestamps } from '@n8n/db';
2
+ import { type Relation } from '@n8n/typeorm';
3
+ import { Agent } from './agent.entity';
4
+ export type AgentChannelStatusValue = 'connected' | 'error';
5
+ export declare class AgentChannelStatus extends WithTimestamps {
6
+ agentId: string;
7
+ agent: Relation<Agent>;
8
+ integrationType: string;
9
+ credentialId: string;
10
+ hostId: string;
11
+ status: AgentChannelStatusValue;
12
+ errorMessage: string | null;
13
+ attempts: number;
14
+ backoffUntil: Date | null;
15
+ expiresAt: Date | null;
16
+ }
@@ -0,0 +1,99 @@
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.AgentChannelStatus = void 0;
13
+ const db_1 = require("@n8n/db");
14
+ const typeorm_1 = require("@n8n/typeorm");
15
+ const agent_entity_1 = require("./agent.entity");
16
+ let AgentChannelStatus = class AgentChannelStatus extends db_1.WithTimestamps {
17
+ };
18
+ exports.AgentChannelStatus = AgentChannelStatus;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryColumn)({
21
+ type: 'varchar',
22
+ length: 36,
23
+ comment: 'Agent that owns this channel',
24
+ }),
25
+ __metadata("design:type", String)
26
+ ], AgentChannelStatus.prototype, "agentId", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.ManyToOne)(() => agent_entity_1.Agent, { onDelete: 'CASCADE' }),
29
+ (0, typeorm_1.JoinColumn)({ name: 'agentId' }),
30
+ __metadata("design:type", Object)
31
+ ], AgentChannelStatus.prototype, "agent", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.PrimaryColumn)({
34
+ type: 'varchar',
35
+ length: 64,
36
+ comment: 'Chat integration platform for this channel',
37
+ }),
38
+ __metadata("design:type", String)
39
+ ], AgentChannelStatus.prototype, "integrationType", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.PrimaryColumn)({
42
+ type: 'varchar',
43
+ length: 36,
44
+ comment: 'Credential connection that backs this channel; no FK so a failure is still recordable after the credential is deleted',
45
+ }),
46
+ __metadata("design:type", String)
47
+ ], AgentChannelStatus.prototype, "credentialId", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Index)(),
50
+ (0, typeorm_1.PrimaryColumn)({
51
+ type: 'varchar',
52
+ length: 128,
53
+ comment: 'Process that observed this; the only writer of this row',
54
+ }),
55
+ __metadata("design:type", String)
56
+ ], AgentChannelStatus.prototype, "hostId", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({
59
+ type: 'varchar',
60
+ length: 16,
61
+ comment: 'What this process last observed: connected or error',
62
+ }),
63
+ __metadata("design:type", String)
64
+ ], AgentChannelStatus.prototype, "status", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({
67
+ type: 'text',
68
+ nullable: true,
69
+ comment: 'Why this process could not start the channel; null once it succeeds',
70
+ }),
71
+ __metadata("design:type", Object)
72
+ ], AgentChannelStatus.prototype, "errorMessage", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({
75
+ type: 'int',
76
+ default: 0,
77
+ comment: 'Consecutive failed startup attempts by this process, reset on success',
78
+ }),
79
+ __metadata("design:type", Number)
80
+ ], AgentChannelStatus.prototype, "attempts", void 0);
81
+ __decorate([
82
+ (0, db_1.DateTimeColumn)({
83
+ nullable: true,
84
+ comment: 'Earliest this process should retry; null when there is nothing to retry',
85
+ }),
86
+ __metadata("design:type", Object)
87
+ ], AgentChannelStatus.prototype, "backoffUntil", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Index)(),
90
+ (0, db_1.DateTimeColumn)({
91
+ nullable: true,
92
+ comment: 'When this row stops counting unless its owner refreshes it; null never expires',
93
+ }),
94
+ __metadata("design:type", Object)
95
+ ], AgentChannelStatus.prototype, "expiresAt", void 0);
96
+ exports.AgentChannelStatus = AgentChannelStatus = __decorate([
97
+ (0, typeorm_1.Entity)({ name: 'agent_channel_status' })
98
+ ], AgentChannelStatus);
99
+ //# sourceMappingURL=agent-channel-status.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-channel-status.entity.js","sourceRoot":"","sources":["../../../../src/modules/agents/entities/agent-channel-status.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAyD;AACzD,0CAQsB;AAEtB,iDAAuC;AAwBhC,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,mBAAc;CAiFrD,CAAA;;AA3EA;IALC,IAAA,uBAAa,EAAC;QACd,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,8BAA8B;KACvC,CAAC;;mDACc;A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CAAC;GAC5B,kBAAkB,CAiF9B"}
@@ -1,13 +1,13 @@
1
1
  import type { CredentialProvider } from '@n8n/agents';
2
2
  import type { User } from '@n8n/db';
3
- import type { InstanceAiBuilderDelegate } from '@n8n/instance-ai';
3
+ import { type InstanceAiBuilderDelegate, type InstanceAiCredentialService } from '@n8n/instance-ai';
4
4
  import { AgentConfigService } from './agent-config.service';
5
5
  import { AgentSkillsService } from './agent-skills.service';
6
6
  import { AgentsService } from './agents.service';
7
7
  import { AgentsBuilderService } from './builder/agents-builder.service';
8
8
  import { N8nMemory } from './integrations/n8n-memory';
9
9
  import { AgentThreadRepository } from './repositories/agent-thread.repository';
10
- export declare const INSTANCE_AI_BUILDER_ADDENDUM = "## Instance AI session rules\n\nYou are running as a sub-agent inside n8n's instance AI chat; the user sees your questions as chat cards.\n\nPreview links work in this chat. Include a markdown Preview link after a successful build and when `call_agent` reports an unsupported interaction as `approval_required`, using the exact relative path from \"When To Build vs When To Converse\" (form: `[Preview](<path>)`). Do not invent absolute URLs. Do not omit the link and describe the path in plain text instead.\n\nYou can publish and unpublish the target agent with `publish_agent` and `unpublish_agent`. Never tell the user to open the agent editor and click Publish.\n\nThe Instance AI orchestrator can create workflows and data tables \u2014 never ask the user to create them manually. State missing prerequisites in your reply; the orchestrator will provision them and call you again.";
10
+ export declare const INSTANCE_AI_BUILDER_ADDENDUM = "## Instance AI session rules\n\nYou are running as a sub-agent inside n8n's instance AI chat; the user sees your questions as chat cards.\n\nPreview links work in this chat. Include a markdown Preview link after a successful build and when `call_agent` reports an unsupported interaction as `approval_required`, using the exact relative path from \"When To Build vs When To Converse\" (form: `[Preview](<path>)`). Do not invent absolute URLs. Do not omit the link and describe the path in plain text instead.\n\nYou can publish and unpublish the target agent with `publish_agent` and `unpublish_agent`. Never tell the user to open the agent editor and click Publish.\n\nThe Instance AI orchestrator can create workflows and data tables \u2014 never ask the user to create them manually. For each missing artifact, call `report_required_artifact` with its concrete requirements before your final reply; the orchestrator will provision them and call you again when the Agent needs the result.\n\nSome requested chat platforms do not have a native Agent integration. In that case, finish the Agent without adding same-platform messaging nodes as Agent tools, then report an `agent-entrypoint` workflow. It must use the platform trigger, pass the incoming message and a stable conversation identifier into Message an Agent with a custom session key, then send the Agent's text response back through the platform. This workflow invokes the Agent and must never be attached to the Agent as a workflow tool.";
11
11
  export declare class InstanceAiBuilderDelegateAdapterService {
12
12
  private readonly agentsService;
13
13
  private readonly agentsBuilderService;
@@ -17,6 +17,6 @@ export declare class InstanceAiBuilderDelegateAdapterService {
17
17
  private readonly agentSkills;
18
18
  constructor(agentsService: AgentsService, agentsBuilderService: AgentsBuilderService, n8nMemory: N8nMemory, agentThreadRepository: AgentThreadRepository, agentConfig: AgentConfigService, agentSkills: AgentSkillsService);
19
19
  private buildSubAgentSession;
20
- createDelegate(user: User, projectId: string, credentialProvider: CredentialProvider): InstanceAiBuilderDelegate;
20
+ createDelegate(user: User, projectId: string, credentialProvider: CredentialProvider, credentialService: InstanceAiCredentialService): InstanceAiBuilderDelegate;
21
21
  deleteBuilderSessions(instanceAiThreadId: string): Promise<void>;
22
22
  }
@@ -31,15 +31,21 @@ Preview links work in this chat. Include a markdown Preview link after a success
31
31
 
32
32
  You can publish and unpublish the target agent with \`publish_agent\` and \`unpublish_agent\`. Never tell the user to open the agent editor and click Publish.
33
33
 
34
- The Instance AI orchestrator can create workflows and data tables — never ask the user to create them manually. State missing prerequisites in your reply; the orchestrator will provision them and call you again.`;
34
+ The Instance AI orchestrator can create workflows and data tables — never ask the user to create them manually. For each missing artifact, call \`report_required_artifact\` with its concrete requirements before your final reply; the orchestrator will provision them and call you again when the Agent needs the result.
35
+
36
+ Some requested chat platforms do not have a native Agent integration. In that case, finish the Agent without adding same-platform messaging nodes as Agent tools, then report an \`agent-entrypoint\` workflow. It must use the platform trigger, pass the incoming message and a stable conversation identifier into Message an Agent with a custom session key, then send the Agent's text response back through the platform. This workflow invokes the Agent and must never be attached to the Agent as a workflow tool.`;
35
37
  function isTextDeltaChunk(chunk) {
36
38
  return chunk.type === 'text-delta';
37
39
  }
38
- function toBuilderTurnStream(chunks) {
40
+ function toBuilderTurnStream(chunks, requiredArtifacts) {
39
41
  let resolveText;
40
42
  const text = new Promise((resolve) => {
41
43
  resolveText = resolve;
42
44
  });
45
+ let resolveRequiredArtifacts;
46
+ const requiredArtifactsPromise = new Promise((resolve) => {
47
+ resolveRequiredArtifacts = resolve;
48
+ });
43
49
  let acc = '';
44
50
  async function* pump() {
45
51
  try {
@@ -51,9 +57,10 @@ function toBuilderTurnStream(chunks) {
51
57
  }
52
58
  finally {
53
59
  resolveText(acc);
60
+ resolveRequiredArtifacts([...requiredArtifacts]);
54
61
  }
55
62
  }
56
- return { fullStream: pump(), text };
63
+ return { fullStream: pump(), text, requiredArtifacts: requiredArtifactsPromise };
57
64
  }
58
65
  let InstanceAiBuilderDelegateAdapterService = class InstanceAiBuilderDelegateAdapterService {
59
66
  constructor(agentsService, agentsBuilderService, n8nMemory, agentThreadRepository, agentConfig, agentSkills) {
@@ -64,7 +71,7 @@ let InstanceAiBuilderDelegateAdapterService = class InstanceAiBuilderDelegateAda
64
71
  this.agentConfig = agentConfig;
65
72
  this.agentSkills = agentSkills;
66
73
  }
67
- buildSubAgentSession(session) {
74
+ buildSubAgentSession(session, onRequiredArtifact) {
68
75
  return {
69
76
  threadId: session.threadId,
70
77
  hostThreadId: session.hostThreadId,
@@ -75,9 +82,10 @@ let InstanceAiBuilderDelegateAdapterService = class InstanceAiBuilderDelegateAda
75
82
  ...(session.memoryTaskObserver ? { memoryTaskObserver: session.memoryTaskObserver } : {}),
76
83
  abortSignal: session.abortSignal,
77
84
  ...(session.mcpTools ? { mcpTools: session.mcpTools } : {}),
85
+ onRequiredArtifact,
78
86
  };
79
87
  }
80
- createDelegate(user, projectId, credentialProvider) {
88
+ createDelegate(user, projectId, credentialProvider, credentialService) {
81
89
  const assertProjectScope = async (scope) => {
82
90
  if (!(await (0, check_access_1.userHasScopes)(user, [scope], false, { projectId }))) {
83
91
  throw new forbidden_error_1.ForbiddenError('You do not have permission to access agents in this project.');
@@ -94,11 +102,13 @@ let InstanceAiBuilderDelegateAdapterService = class InstanceAiBuilderDelegateAda
94
102
  },
95
103
  streamBuild: async (agentId, message, session) => {
96
104
  await assertProjectScope('agent:update');
97
- return toBuilderTurnStream(this.agentsBuilderService.buildAgent(agentId, projectId, message, credentialProvider, user, this.buildSubAgentSession(session)));
105
+ const requiredArtifacts = [];
106
+ return toBuilderTurnStream(this.agentsBuilderService.buildAgent(agentId, projectId, message, credentialProvider, credentialService, user, this.buildSubAgentSession(session, (artifact) => requiredArtifacts.push(artifact))), requiredArtifacts);
98
107
  },
99
108
  resumeBuild: async (agentId, resume, session) => {
100
109
  await assertProjectScope('agent:update');
101
- return toBuilderTurnStream(this.agentsBuilderService.resumeBuild(agentId, projectId, resume.runId, resume.toolCallId, resume.resumeData, credentialProvider, user, this.buildSubAgentSession(session)));
110
+ const requiredArtifacts = [];
111
+ return toBuilderTurnStream(this.agentsBuilderService.resumeBuild(agentId, projectId, resume.runId, resume.toolCallId, resume.resumeData, credentialProvider, credentialService, user, this.buildSubAgentSession(session, (artifact) => requiredArtifacts.push(artifact))), requiredArtifacts);
102
112
  },
103
113
  findOpenSuspensions: async (agentId, session) => {
104
114
  await assertProjectScope('agent:update');
@@ -1 +1 @@
1
- {"version":3,"file":"instance-ai-builder-delegate.adapter.js","sourceRoot":"","sources":["../../../src/modules/agents/instance-ai-builder-delegate.adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gCAAkC;AAClC,kDAAiE;AAOjE,0CAAoC;AACpC,+CAAyC;AAEzC,8EAA0E;AAC1E,gEAA8D;AAE9D,iEAA4D;AAC5D,iEAA4D;AAC5D,qDAAiD;AACjD,6EAAwE;AAExE,0DAAsD;AACtD,oFAA+E;AAC/E,iEAA+D;AAGlD,QAAA,4BAA4B,GAAG;;;;;;;;oNAQwK,CAAC;AAErN,SAAS,gBAAgB,CACxB,KAAkB;IAElB,OAAO,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AAM,CAAC;iBACtC,CAAC;YACH,CAAC;SACD,CAAC;IACH,CAAC;IAUD,KAAK,CAAC,qBAAqB,CAAC,kBAA0B;QACrD,MAAM,MAAM,GAAG,IAAA,2CAA6B,EAAC,kBAAkB,CAAC,CAAC;QACjE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;YACrD,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE;YACpB,KAAK,EAAE,EAAE,EAAE,EAAE,IAAA,cAAI,EAAC,GAAG,MAAM,GAAG,CAAC,EAAE;SACjC,CAAC,CAAC;QACH,KAAK,MAAM,EAAE,EAAE,EAAE,IAAI,OAAO,EAAE,CAAC;YAE9B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACzE,MAAM,MAAM,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;YACxC,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;CACD,CAAA;;kDAzJY,uCAAuC;IADnD,IAAA,YAAO,GAAE;qCAGwB,8BAAa,EACN,6CAAoB,EAC/B,sBAAS,EACG,+CAAqB,EAC/B,yCAAkB,EAClB,yCAAkB;GAPrC,uCAAuC,CAyJnD"}
1
+ {"version":3,"file":"instance-ai-builder-delegate.adapter.js","sourceRoot":"","sources":["../../../src/modules/agents/instance-ai-builder-delegate.adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gCAAkC;AAClC,kDAO0B;AAE1B,0CAAoC;AACpC,+CAAyC;AAEzC,8EAA0E;AAC1E,gEAA8D;AAE9D,iEAA4D;AAC5D,iEAA4D;AAC5D,qDAAiD;AACjD,6EAAwE;AAExE,0DAAsD;AACtD,oFAA+E;AAC/E,iEAA+D;AAGlD,QAAA,4BAA4B,GAAG;;;;;;;;;;6fAUid,CAAC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sBAAsB,CAAC,EAAE,CAAC,CAAC;YACxC,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;CACD,CAAA;;kDApKY,uCAAuC;IADnD,IAAA,YAAO,GAAE;qCAGwB,8BAAa,EACN,6CAAoB,EAC/B,sBAAS,EACG,+CAAqB,EAC/B,yCAAkB,EAClB,yCAAkB;GAPrC,uCAAuC,CAoKnD"}
@@ -0,0 +1,38 @@
1
+ import { Logger } from '@n8n/backend-common';
2
+ import { AgentsConfig } from '@n8n/config';
3
+ import { ErrorReporter, InstanceSettings } from 'n8n-core';
4
+ import { AgentChannelStatusReporter } from './agent-channel-status-reporter';
5
+ import { ChatIntegrationRegistry } from './agent-chat-integration';
6
+ import { ChatIntegrationService } from './chat-integration.service';
7
+ import { AgentChannelStatusRepository } from '../repositories/agent-channel-status.repository';
8
+ import { AgentRepository } from '../repositories/agent.repository';
9
+ export type ChannelReconcileReason = 'startup' | 'leader-takeover' | 'interval';
10
+ export declare class AgentChannelReconciler {
11
+ private readonly logger;
12
+ private readonly agentsConfig;
13
+ private readonly agentRepository;
14
+ private readonly channelStatusRepository;
15
+ private readonly statusReporter;
16
+ private readonly chatIntegrationService;
17
+ private readonly integrationRegistry;
18
+ private readonly instanceSettings;
19
+ private readonly errorReporter;
20
+ private reconcileInterval;
21
+ private isInitialized;
22
+ private isShuttingDown;
23
+ private inFlight;
24
+ constructor(logger: Logger, agentsConfig: AgentsConfig, agentRepository: AgentRepository, channelStatusRepository: AgentChannelStatusRepository, statusReporter: AgentChannelStatusReporter, chatIntegrationService: ChatIntegrationService, integrationRegistry: ChatIntegrationRegistry, instanceSettings: InstanceSettings, errorReporter: ErrorReporter);
25
+ init(): void;
26
+ shutdown(): Promise<void>;
27
+ private settleInFlight;
28
+ reconcileOnLeaderTakeover(): Promise<void>;
29
+ reconcile(reason: ChannelReconcileReason): Promise<void>;
30
+ private runPass;
31
+ private runsHere;
32
+ private settleWanted;
33
+ private affirmRunning;
34
+ private releaseGhosts;
35
+ private forgetOwnOrphans;
36
+ private sweepExpired;
37
+ private refOf;
38
+ }