n8n 2.20.6 → 2.21.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 (580) hide show
  1. package/dist/abstract-server.d.ts +1 -0
  2. package/dist/abstract-server.js +10 -3
  3. package/dist/abstract-server.js.map +1 -1
  4. package/dist/agent-library-bundle.js +5989 -0
  5. package/dist/auth/auth.service.js +3 -3
  6. package/dist/auth/auth.service.js.map +1 -1
  7. package/dist/build.tsbuildinfo +1 -1
  8. package/dist/commands/execute-batch.d.ts +2 -2
  9. package/dist/commands/export/workflow.d.ts +2 -2
  10. package/dist/commands/import/workflow.d.ts +3 -0
  11. package/dist/commands/import/workflow.js +15 -1
  12. package/dist/commands/import/workflow.js.map +1 -1
  13. package/dist/commands/start.js +2 -0
  14. package/dist/commands/start.js.map +1 -1
  15. package/dist/constants.d.ts +1 -0
  16. package/dist/constants.js +6 -1
  17. package/dist/constants.js.map +1 -1
  18. package/dist/controller.registry.js +6 -0
  19. package/dist/controller.registry.js.map +1 -1
  20. package/dist/controllers/auth.controller.js +7 -2
  21. package/dist/controllers/auth.controller.js.map +1 -1
  22. package/dist/controllers/me.controller.d.ts +1 -0
  23. package/dist/controllers/me.controller.js +4 -1
  24. package/dist/controllers/me.controller.js.map +1 -1
  25. package/dist/controllers/users.controller.d.ts +2 -2
  26. package/dist/credentials/credentials.service.d.ts +1 -0
  27. package/dist/credentials/credentials.service.js +11 -4
  28. package/dist/credentials/credentials.service.js.map +1 -1
  29. package/dist/evaluation.ee/evaluation-api-error.d.ts +7 -0
  30. package/dist/evaluation.ee/evaluation-api-error.js +16 -0
  31. package/dist/evaluation.ee/evaluation-api-error.js.map +1 -0
  32. package/dist/evaluation.ee/evaluation-config-validator.d.ts +30 -0
  33. package/dist/evaluation.ee/evaluation-config-validator.js +236 -0
  34. package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -0
  35. package/dist/evaluation.ee/evaluation-config.controller.d.ts +24 -0
  36. package/dist/evaluation.ee/evaluation-config.controller.js +94 -0
  37. package/dist/evaluation.ee/evaluation-config.controller.js.map +1 -0
  38. package/dist/evaluation.ee/evaluation-config.service.d.ts +18 -0
  39. package/dist/evaluation.ee/evaluation-config.service.js +74 -0
  40. package/dist/evaluation.ee/evaluation-config.service.js.map +1 -0
  41. package/dist/evaluation.ee/llm-judge-provider-registry.d.ts +13 -0
  42. package/dist/evaluation.ee/llm-judge-provider-registry.js +122 -0
  43. package/dist/evaluation.ee/llm-judge-provider-registry.js.map +1 -0
  44. package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +5 -0
  45. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +32 -10
  46. package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
  47. package/dist/evaluation.ee/test-runner/workflow-compiler.service.d.ts +22 -0
  48. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +285 -0
  49. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -0
  50. package/dist/evaluation.ee/test-runs.controller.ee.d.ts +3 -0
  51. package/dist/evaluation.ee/test-runs.controller.ee.js +26 -9
  52. package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
  53. package/dist/evaluation.ee/test-runs.types.ee.d.ts +3 -0
  54. package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -0
  55. package/dist/eventbus/message-event-bus/message-event-bus.js +54 -46
  56. package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
  57. package/dist/events/maps/relay.event-map.d.ts +3 -0
  58. package/dist/instance-settings-loader/instance-settings-loader.service.d.ts +4 -2
  59. package/dist/instance-settings-loader/instance-settings-loader.service.js +7 -3
  60. package/dist/instance-settings-loader/instance-settings-loader.service.js.map +1 -1
  61. package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.d.ts +20 -0
  62. package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js +235 -0
  63. package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js.map +1 -0
  64. package/dist/instance-settings-loader/loaders/{sso.instance-settings-loader.d.ts → sso/oidc.instance-settings-loader.d.ts} +4 -10
  65. package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js +98 -0
  66. package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js.map +1 -0
  67. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.d.ts +10 -0
  68. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +65 -0
  69. package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -0
  70. package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.d.ts +12 -0
  71. package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js +75 -0
  72. package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js.map +1 -0
  73. package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.d.ts +15 -0
  74. package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js +75 -0
  75. package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js.map +1 -0
  76. package/dist/load-nodes-and-credentials.d.ts +3 -3
  77. package/dist/load-nodes-and-credentials.js +25 -17
  78. package/dist/load-nodes-and-credentials.js.map +1 -1
  79. package/dist/modules/agents/adapters/agents-credential-provider.d.ts +12 -0
  80. package/dist/modules/agents/adapters/agents-credential-provider.js +63 -0
  81. package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -0
  82. package/dist/modules/agents/agent-execution.service.d.ts +42 -0
  83. package/dist/modules/agents/agent-execution.service.js +153 -0
  84. package/dist/modules/agents/agent-execution.service.js.map +1 -0
  85. package/dist/modules/agents/agent-message-mapper.d.ts +5 -0
  86. package/dist/modules/agents/agent-message-mapper.js +43 -0
  87. package/dist/modules/agents/agent-message-mapper.js.map +1 -0
  88. package/dist/modules/agents/agent-skills.service.d.ts +24 -0
  89. package/dist/modules/agents/agent-skills.service.js +166 -0
  90. package/dist/modules/agents/agent-skills.service.js.map +1 -0
  91. package/dist/modules/agents/agent-sse-stream.d.ts +15 -0
  92. package/dist/modules/agents/agent-sse-stream.js +194 -0
  93. package/dist/modules/agents/agent-sse-stream.js.map +1 -0
  94. package/dist/modules/agents/agents-tools.service.d.ts +18 -0
  95. package/dist/modules/agents/agents-tools.service.js +193 -0
  96. package/dist/modules/agents/agents-tools.service.js.map +1 -0
  97. package/dist/modules/agents/agents.controller.d.ts +260 -0
  98. package/dist/modules/agents/agents.controller.js +818 -0
  99. package/dist/modules/agents/agents.controller.js.map +1 -0
  100. package/dist/modules/agents/agents.module.d.ts +12 -0
  101. package/dist/modules/agents/agents.module.js +136 -0
  102. package/dist/modules/agents/agents.module.js.map +1 -0
  103. package/dist/modules/agents/agents.service.d.ts +151 -0
  104. package/dist/modules/agents/agents.service.js +1134 -0
  105. package/dist/modules/agents/agents.service.js.map +1 -0
  106. package/dist/modules/agents/builder/agents-builder-prompts.d.ts +27 -0
  107. package/dist/modules/agents/builder/agents-builder-prompts.js +584 -0
  108. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -0
  109. package/dist/modules/agents/builder/agents-builder-settings.controller.d.ts +11 -0
  110. package/dist/modules/agents/builder/agents-builder-settings.controller.js +61 -0
  111. package/dist/modules/agents/builder/agents-builder-settings.controller.js.map +1 -0
  112. package/dist/modules/agents/builder/agents-builder-settings.service.d.ts +31 -0
  113. package/dist/modules/agents/builder/agents-builder-settings.service.js +199 -0
  114. package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -0
  115. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +31 -0
  116. package/dist/modules/agents/builder/agents-builder-tools.service.js +420 -0
  117. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -0
  118. package/dist/modules/agents/builder/agents-builder.service.d.ts +26 -0
  119. package/dist/modules/agents/builder/agents-builder.service.js +164 -0
  120. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -0
  121. package/dist/modules/agents/builder/builder-model-lookup.service.d.ts +17 -0
  122. package/dist/modules/agents/builder/builder-model-lookup.service.js +67 -0
  123. package/dist/modules/agents/builder/builder-model-lookup.service.js.map +1 -0
  124. package/dist/modules/agents/builder/builder-tool-names.d.ts +14 -0
  125. package/dist/modules/agents/builder/builder-tool-names.js +17 -0
  126. package/dist/modules/agents/builder/builder-tool-names.js.map +1 -0
  127. package/dist/modules/agents/builder/errors.d.ts +6 -0
  128. package/dist/modules/agents/builder/errors.js +13 -0
  129. package/dist/modules/agents/builder/errors.js.map +1 -0
  130. package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +5 -0
  131. package/dist/modules/agents/builder/interactive/ask-credential.tool.js +29 -0
  132. package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -0
  133. package/dist/modules/agents/builder/interactive/ask-llm.tool.d.ts +2 -0
  134. package/dist/modules/agents/builder/interactive/ask-llm.tool.js +27 -0
  135. package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -0
  136. package/dist/modules/agents/builder/interactive/ask-question.tool.d.ts +2 -0
  137. package/dist/modules/agents/builder/interactive/ask-question.tool.js +26 -0
  138. package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -0
  139. package/dist/modules/agents/builder/interactive/index.d.ts +4 -0
  140. package/dist/modules/agents/builder/interactive/index.js +12 -0
  141. package/dist/modules/agents/builder/interactive/index.js.map +1 -0
  142. package/dist/modules/agents/builder/interactive/llm-provider-defaults.d.ts +17 -0
  143. package/dist/modules/agents/builder/interactive/llm-provider-defaults.js +60 -0
  144. package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +1 -0
  145. package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +13 -0
  146. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +136 -0
  147. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -0
  148. package/dist/modules/agents/entities/agent-checkpoint.entity.d.ts +9 -0
  149. package/dist/modules/agents/entities/agent-checkpoint.entity.js +43 -0
  150. package/dist/modules/agents/entities/agent-checkpoint.entity.js.map +1 -0
  151. package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +16 -0
  152. package/dist/modules/agents/entities/agent-execution-thread.entity.js +74 -0
  153. package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -0
  154. package/dist/modules/agents/entities/agent-execution.entity.d.ts +26 -0
  155. package/dist/modules/agents/entities/agent-execution.entity.js +100 -0
  156. package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -0
  157. package/dist/modules/agents/entities/agent-message.entity.d.ts +10 -0
  158. package/dist/modules/agents/entities/agent-message.entity.js +47 -0
  159. package/dist/modules/agents/entities/agent-message.entity.js.map +1 -0
  160. package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +8 -0
  161. package/dist/modules/agents/entities/agent-observation-cursor.entity.js +37 -0
  162. package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -0
  163. package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +8 -0
  164. package/dist/modules/agents/entities/agent-observation-lock.entity.js +37 -0
  165. package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -0
  166. package/dist/modules/agents/entities/agent-observation.entity.d.ts +10 -0
  167. package/dist/modules/agents/entities/agent-observation.entity.js +47 -0
  168. package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -0
  169. package/dist/modules/agents/entities/agent-published-version.entity.d.ts +22 -0
  170. package/dist/modules/agents/entities/agent-published-version.entity.js +67 -0
  171. package/dist/modules/agents/entities/agent-published-version.entity.js.map +1 -0
  172. package/dist/modules/agents/entities/agent-resource.entity.d.ts +5 -0
  173. package/dist/modules/agents/entities/agent-resource.entity.js +29 -0
  174. package/dist/modules/agents/entities/agent-resource.entity.js.map +1 -0
  175. package/dist/modules/agents/entities/agent-thread.entity.d.ts +6 -0
  176. package/dist/modules/agents/entities/agent-thread.entity.js +33 -0
  177. package/dist/modules/agents/entities/agent-thread.entity.js.map +1 -0
  178. package/dist/modules/agents/entities/agent.entity.d.ts +24 -0
  179. package/dist/modules/agents/entities/agent.entity.js +74 -0
  180. package/dist/modules/agents/entities/agent.entity.js.map +1 -0
  181. package/dist/modules/agents/execution-recorder.d.ts +82 -0
  182. package/dist/modules/agents/execution-recorder.js +272 -0
  183. package/dist/modules/agents/execution-recorder.js.map +1 -0
  184. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +62 -0
  185. package/dist/modules/agents/integrations/agent-chat-bridge.js +540 -0
  186. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -0
  187. package/dist/modules/agents/integrations/agent-chat-integration.d.ts +39 -0
  188. package/dist/modules/agents/integrations/agent-chat-integration.js +45 -0
  189. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -0
  190. package/dist/modules/agents/integrations/agent-schedule.service.d.ts +30 -0
  191. package/dist/modules/agents/integrations/agent-schedule.service.js +327 -0
  192. package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -0
  193. package/dist/modules/agents/integrations/callback-store.d.ts +11 -0
  194. package/dist/modules/agents/integrations/callback-store.js +30 -0
  195. package/dist/modules/agents/integrations/callback-store.js.map +1 -0
  196. package/dist/modules/agents/integrations/chat-integration.service.d.ts +58 -0
  197. package/dist/modules/agents/integrations/chat-integration.service.js +397 -0
  198. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -0
  199. package/dist/modules/agents/integrations/component-mapper.d.ts +57 -0
  200. package/dist/modules/agents/integrations/component-mapper.js +223 -0
  201. package/dist/modules/agents/integrations/component-mapper.js.map +1 -0
  202. package/dist/modules/agents/integrations/cron-validation.d.ts +1 -0
  203. package/dist/modules/agents/integrations/cron-validation.js +8 -0
  204. package/dist/modules/agents/integrations/cron-validation.js.map +1 -0
  205. package/dist/modules/agents/integrations/esm-loader.d.ts +5 -0
  206. package/dist/modules/agents/integrations/esm-loader.js +24 -0
  207. package/dist/modules/agents/integrations/esm-loader.js.map +1 -0
  208. package/dist/modules/agents/integrations/integrations-sync.d.ts +4 -0
  209. package/dist/modules/agents/integrations/integrations-sync.js +78 -0
  210. package/dist/modules/agents/integrations/integrations-sync.js.map +1 -0
  211. package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +36 -0
  212. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +148 -0
  213. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -0
  214. package/dist/modules/agents/integrations/n8n-memory.d.ts +76 -0
  215. package/dist/modules/agents/integrations/n8n-memory.js +383 -0
  216. package/dist/modules/agents/integrations/n8n-memory.js.map +1 -0
  217. package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +14 -0
  218. package/dist/modules/agents/integrations/platforms/linear-integration.js +83 -0
  219. package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -0
  220. package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +12 -0
  221. package/dist/modules/agents/integrations/platforms/slack-integration.js +81 -0
  222. package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -0
  223. package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +30 -0
  224. package/dist/modules/agents/integrations/platforms/telegram-integration.js +122 -0
  225. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -0
  226. package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +47 -0
  227. package/dist/modules/agents/integrations/rich-interaction-tool.js +109 -0
  228. package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -0
  229. package/dist/modules/agents/integrations/types.d.ts +8 -0
  230. package/dist/modules/agents/integrations/types.js +12 -0
  231. package/dist/modules/agents/integrations/types.js.map +1 -0
  232. package/dist/modules/agents/json-config/agent-config-composition.d.ts +9 -0
  233. package/dist/modules/agents/json-config/agent-config-composition.js +27 -0
  234. package/dist/modules/agents/json-config/agent-config-composition.js.map +1 -0
  235. package/dist/modules/agents/json-config/agent-json-config.d.ts +1022 -0
  236. package/dist/modules/agents/json-config/agent-json-config.js +128 -0
  237. package/dist/modules/agents/json-config/agent-json-config.js.map +1 -0
  238. package/dist/modules/agents/json-config/credential-field-mapping.d.ts +4 -0
  239. package/dist/modules/agents/json-config/credential-field-mapping.js +41 -0
  240. package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -0
  241. package/dist/modules/agents/json-config/from-json-config.d.ts +18 -0
  242. package/dist/modules/agents/json-config/from-json-config.js +209 -0
  243. package/dist/modules/agents/json-config/from-json-config.js.map +1 -0
  244. package/dist/modules/agents/json-config/integration-config.d.ts +61 -0
  245. package/dist/modules/agents/json-config/integration-config.js +33 -0
  246. package/dist/modules/agents/json-config/integration-config.js.map +1 -0
  247. package/dist/modules/agents/json-config/provider-tool-aliases.d.ts +1 -0
  248. package/dist/modules/agents/json-config/provider-tool-aliases.js +15 -0
  249. package/dist/modules/agents/json-config/provider-tool-aliases.js.map +1 -0
  250. package/dist/modules/agents/json-config/schema-text-serializer.d.ts +2 -0
  251. package/dist/modules/agents/json-config/schema-text-serializer.js +205 -0
  252. package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -0
  253. package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +6 -0
  254. package/dist/modules/agents/repositories/agent-checkpoint.repository.js +35 -0
  255. package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -0
  256. package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +18 -0
  257. package/dist/modules/agents/repositories/agent-execution-thread.repository.js +120 -0
  258. package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -0
  259. package/dist/modules/agents/repositories/agent-execution.repository.d.ts +10 -0
  260. package/dist/modules/agents/repositories/agent-execution.repository.js +59 -0
  261. package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -0
  262. package/dist/modules/agents/repositories/agent-message.repository.d.ts +5 -0
  263. package/dist/modules/agents/repositories/agent-message.repository.js +26 -0
  264. package/dist/modules/agents/repositories/agent-message.repository.js.map +1 -0
  265. package/dist/modules/agents/repositories/agent-observation-cursor.repository.d.ts +5 -0
  266. package/dist/modules/agents/repositories/agent-observation-cursor.repository.js +26 -0
  267. package/dist/modules/agents/repositories/agent-observation-cursor.repository.js.map +1 -0
  268. package/dist/modules/agents/repositories/agent-observation-lock.repository.d.ts +5 -0
  269. package/dist/modules/agents/repositories/agent-observation-lock.repository.js +26 -0
  270. package/dist/modules/agents/repositories/agent-observation-lock.repository.js.map +1 -0
  271. package/dist/modules/agents/repositories/agent-observation.repository.d.ts +5 -0
  272. package/dist/modules/agents/repositories/agent-observation.repository.js +26 -0
  273. package/dist/modules/agents/repositories/agent-observation.repository.js.map +1 -0
  274. package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +20 -0
  275. package/dist/modules/agents/repositories/agent-published-version.repository.js +35 -0
  276. package/dist/modules/agents/repositories/agent-published-version.repository.js.map +1 -0
  277. package/dist/modules/agents/repositories/agent-resource.repository.d.ts +5 -0
  278. package/dist/modules/agents/repositories/agent-resource.repository.js +26 -0
  279. package/dist/modules/agents/repositories/agent-resource.repository.js.map +1 -0
  280. package/dist/modules/agents/repositories/agent-thread.repository.d.ts +5 -0
  281. package/dist/modules/agents/repositories/agent-thread.repository.js +26 -0
  282. package/dist/modules/agents/repositories/agent-thread.repository.js.map +1 -0
  283. package/dist/modules/agents/repositories/agent.repository.d.ts +9 -0
  284. package/dist/modules/agents/repositories/agent.repository.js +50 -0
  285. package/dist/modules/agents/repositories/agent.repository.js.map +1 -0
  286. package/dist/modules/agents/runtime/agent-isolate-pool.d.ts +48 -0
  287. package/dist/modules/agents/runtime/agent-isolate-pool.js +246 -0
  288. package/dist/modules/agents/runtime/agent-isolate-pool.js.map +1 -0
  289. package/dist/modules/agents/runtime/agent-secure-runtime.d.ts +21 -0
  290. package/dist/modules/agents/runtime/agent-secure-runtime.js +281 -0
  291. package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -0
  292. package/dist/modules/agents/runtime/sandbox-polyfills.d.ts +1 -0
  293. package/dist/modules/agents/runtime/sandbox-polyfills.js +74 -0
  294. package/dist/modules/agents/runtime/sandbox-polyfills.js.map +1 -0
  295. package/dist/modules/agents/tool-registry.d.ts +13 -0
  296. package/dist/modules/agents/tool-registry.js +42 -0
  297. package/dist/modules/agents/tool-registry.js.map +1 -0
  298. package/dist/modules/agents/tools/environment-tool.d.ts +3 -0
  299. package/dist/modules/agents/tools/environment-tool.js +26 -0
  300. package/dist/modules/agents/tools/environment-tool.js.map +1 -0
  301. package/dist/modules/agents/tools/node-tool-factory.d.ts +10 -0
  302. package/dist/modules/agents/tools/node-tool-factory.js +100 -0
  303. package/dist/modules/agents/tools/node-tool-factory.js.map +1 -0
  304. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +43 -0
  305. package/dist/modules/agents/tools/workflow-tool-factory.js +404 -0
  306. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -0
  307. package/dist/modules/agents/tracing/builder-telemetry.d.ts +12 -0
  308. package/dist/modules/agents/tracing/builder-telemetry.js +48 -0
  309. package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -0
  310. package/dist/modules/agents/types/components.d.ts +71 -0
  311. package/dist/modules/agents/types/components.js +3 -0
  312. package/dist/modules/agents/types/components.js.map +1 -0
  313. package/dist/modules/agents/types/index.d.ts +1 -0
  314. package/dist/modules/agents/types/index.js +3 -0
  315. package/dist/modules/agents/types/index.js.map +1 -0
  316. package/dist/modules/agents/utils/agent-draft.utils.d.ts +2 -0
  317. package/dist/modules/agents/utils/agent-draft.utils.js +11 -0
  318. package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -0
  319. package/dist/modules/agents/utils/agent-resource-id.d.ts +3 -0
  320. package/dist/modules/agents/utils/agent-resource-id.js +14 -0
  321. package/dist/modules/agents/utils/agent-resource-id.js.map +1 -0
  322. package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -2
  323. package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +4 -4
  324. package/dist/modules/chat-hub/chat-hub.types.d.ts +2 -2
  325. package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
  326. package/dist/modules/community-packages/community-packages.config.js +2 -2
  327. package/dist/modules/community-packages/community-packages.config.js.map +1 -1
  328. package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +4 -1
  329. package/dist/modules/community-packages/community-packages.lifecycle.service.js +14 -2
  330. package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
  331. package/dist/modules/community-packages/community-packages.module.d.ts +1 -1
  332. package/dist/modules/community-packages/community-packages.module.js +10 -5
  333. package/dist/modules/community-packages/community-packages.module.js.map +1 -1
  334. package/dist/modules/data-table/data-table.service.js +6 -0
  335. package/dist/modules/data-table/data-table.service.js.map +1 -1
  336. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/slack-signature-identifier.d.ts +1 -1
  337. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.d.ts +2 -0
  338. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js +10 -0
  339. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js.map +1 -1
  340. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +1 -1
  341. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +16 -4
  342. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
  343. package/dist/modules/dynamic-credentials.ee/workflow-status.controller.d.ts +3 -3
  344. package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +11 -3
  345. package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
  346. package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js +4 -2
  347. package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js.map +1 -1
  348. package/dist/modules/encryption-key-manager/encryption-key-manager.module.js +5 -2
  349. package/dist/modules/encryption-key-manager/encryption-key-manager.module.js.map +1 -1
  350. package/dist/modules/encryption-key-manager/encryption-key.controller.d.ts +3 -3
  351. package/dist/modules/encryption-key-manager/encryption-key.controller.js +8 -2
  352. package/dist/modules/encryption-key-manager/encryption-key.controller.js.map +1 -1
  353. package/dist/modules/encryption-key-manager/key-manager.service.d.ts +5 -1
  354. package/dist/modules/encryption-key-manager/key-manager.service.js +11 -4
  355. package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
  356. package/dist/modules/insights/insights-collection.service.js +1 -0
  357. package/dist/modules/insights/insights-collection.service.js.map +1 -1
  358. package/dist/modules/instance-ai/eval/mock-handler.js +17 -49
  359. package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
  360. package/dist/modules/instance-ai/filesystem/local-gateway-registry.d.ts +1 -0
  361. package/dist/modules/instance-ai/filesystem/local-gateway-registry.js +21 -3
  362. package/dist/modules/instance-ai/filesystem/local-gateway-registry.js.map +1 -1
  363. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +3 -2
  364. package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -9
  365. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  366. package/dist/modules/instance-ai/instance-ai-test.controller.d.ts +21 -2
  367. package/dist/modules/instance-ai/instance-ai-test.controller.js +35 -3
  368. package/dist/modules/instance-ai/instance-ai-test.controller.js.map +1 -1
  369. package/dist/modules/instance-ai/instance-ai.adapter.service.js +72 -42
  370. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  371. package/dist/modules/instance-ai/instance-ai.controller.d.ts +2 -0
  372. package/dist/modules/instance-ai/instance-ai.controller.js +25 -1
  373. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  374. package/dist/modules/instance-ai/instance-ai.module.d.ts +0 -1
  375. package/dist/modules/instance-ai/instance-ai.module.js +0 -2
  376. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  377. package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -5
  378. package/dist/modules/instance-ai/instance-ai.service.js +723 -76
  379. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  380. package/dist/modules/instance-ai/liveness/index.d.ts +1 -0
  381. package/dist/modules/instance-ai/liveness/index.js +7 -0
  382. package/dist/modules/instance-ai/liveness/index.js.map +1 -0
  383. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +72 -0
  384. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +123 -0
  385. package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -0
  386. package/dist/modules/instance-ai/message-parser.js +85 -6
  387. package/dist/modules/instance-ai/message-parser.js.map +1 -1
  388. package/dist/modules/instance-ai/storage/db-snapshot-storage.js +4 -0
  389. package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
  390. package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +1 -0
  391. package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +1 -1
  392. package/dist/modules/instance-ai/web-research/fetch-and-extract.js +23 -7
  393. package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
  394. package/dist/modules/mcp/mcp.service.d.ts +3 -3
  395. package/dist/modules/mcp/mcp.service.js +12 -9
  396. package/dist/modules/mcp/mcp.service.js.map +1 -1
  397. package/dist/modules/mcp/tools/get-execution.tool.js +6 -4
  398. package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
  399. package/dist/modules/mcp/tools/list-credentials.tool.d.ts +40 -0
  400. package/dist/modules/mcp/tools/list-credentials.tool.js +148 -0
  401. package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -0
  402. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +5 -4
  403. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  404. package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +2 -2
  405. package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +3 -3
  406. package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +1 -1
  407. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +2 -2
  408. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +2 -2
  409. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
  410. package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +3 -2
  411. package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
  412. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +3 -3
  413. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
  414. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +1 -1
  415. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +12 -4
  416. package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
  417. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +2 -2
  418. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +12 -5
  419. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
  420. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +1 -2
  421. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  422. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +1 -1
  423. package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
  424. package/dist/modules/mcp/tools/workflow-validation.utils.d.ts +5 -1
  425. package/dist/modules/mcp/tools/workflow-validation.utils.js +4 -2
  426. package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
  427. package/dist/modules/mcp-registry/mcp-registry-node-loader.d.ts +27 -0
  428. package/dist/modules/mcp-registry/mcp-registry-node-loader.js +105 -0
  429. package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -0
  430. package/dist/modules/mcp-registry/mcp-registry-node-loader.test.d.ts +1 -0
  431. package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js +244 -0
  432. package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js.map +1 -0
  433. package/dist/modules/mcp-registry/mcp-registry.module.d.ts +4 -0
  434. package/dist/modules/mcp-registry/mcp-registry.module.js +60 -0
  435. package/dist/modules/mcp-registry/mcp-registry.module.js.map +1 -0
  436. package/dist/modules/mcp-registry/node-description-transform.d.ts +8 -0
  437. package/dist/modules/mcp-registry/node-description-transform.js +133 -0
  438. package/dist/modules/mcp-registry/node-description-transform.js.map +1 -0
  439. package/dist/modules/mcp-registry/node-description-transform.test.d.ts +1 -0
  440. package/dist/modules/mcp-registry/node-description-transform.test.js +286 -0
  441. package/dist/modules/mcp-registry/node-description-transform.test.js.map +1 -0
  442. package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +8 -0
  443. package/dist/modules/mcp-registry/registry/mcp-registry.service.js +31 -0
  444. package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -0
  445. package/dist/modules/mcp-registry/registry/mcp-registry.service.test.d.ts +1 -0
  446. package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js +41 -0
  447. package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js.map +1 -0
  448. package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +36 -0
  449. package/dist/modules/mcp-registry/registry/mcp-registry.types.js +3 -0
  450. package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -0
  451. package/dist/modules/mcp-registry/registry/mock-servers.d.ts +3 -0
  452. package/dist/modules/mcp-registry/registry/mock-servers.js +80 -0
  453. package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -0
  454. package/dist/modules/otel/execution-level-tracer.d.ts +1 -1
  455. package/dist/modules/otel/execution-level-tracer.js +24 -9
  456. package/dist/modules/otel/execution-level-tracer.js.map +1 -1
  457. package/dist/modules/otel/execution-level-tracer.types.d.ts +9 -7
  458. package/dist/modules/otel/execution-level-tracer.types.js +14 -0
  459. package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
  460. package/dist/modules/quick-connect/quick-connect.config.d.ts +176 -0
  461. package/dist/modules/quick-connect/quick-connect.config.js +8 -0
  462. package/dist/modules/quick-connect/quick-connect.config.js.map +1 -1
  463. package/dist/modules/quick-connect/quick-connect.module.d.ts +15 -0
  464. package/dist/modules/redaction/executions/execution-redaction.service.d.ts +1 -3
  465. package/dist/modules/redaction/executions/execution-redaction.service.js +2 -6
  466. package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
  467. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +2 -2
  468. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +1 -1
  469. package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +3 -1
  470. package/dist/modules/sso-oidc/oidc.controller.ee.js +8 -1
  471. package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
  472. package/dist/node-catalog/index.d.ts +1 -0
  473. package/dist/node-catalog/index.js +6 -0
  474. package/dist/node-catalog/index.js.map +1 -0
  475. package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts → node-catalog/node-catalog.service.d.ts} +9 -15
  476. package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js → node-catalog/node-catalog.service.js} +38 -28
  477. package/dist/node-catalog/node-catalog.service.js.map +1 -0
  478. package/dist/node-execution/ephemeral-node-executor.d.ts +47 -0
  479. package/dist/node-execution/ephemeral-node-executor.js +289 -0
  480. package/dist/node-execution/ephemeral-node-executor.js.map +1 -0
  481. package/dist/node-execution/index.d.ts +2 -0
  482. package/dist/node-execution/index.js +8 -0
  483. package/dist/node-execution/index.js.map +1 -0
  484. package/dist/public-api/v1/handlers/audit/audit.handler.d.ts +5 -4
  485. package/dist/public-api/v1/handlers/audit/audit.handler.js +5 -9
  486. package/dist/public-api/v1/handlers/audit/audit.handler.js.map +1 -1
  487. package/dist/public-api/v1/handlers/community-packages/community-packages.handler.d.ts +20 -17
  488. package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js +12 -39
  489. package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js.map +1 -1
  490. package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +12 -49
  491. package/dist/public-api/v1/handlers/credentials/credentials.handler.js +6 -5
  492. package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
  493. package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.d.ts +8 -19
  494. package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js +11 -11
  495. package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js.map +1 -1
  496. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.d.ts +9 -17
  497. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +19 -23
  498. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
  499. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.d.ts +9 -23
  500. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +17 -27
  501. package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
  502. package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +11 -9
  503. package/dist/public-api/v1/handlers/discover/discover.handler.js +5 -3
  504. package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
  505. package/dist/public-api/v1/handlers/executions/executions.handler.d.ts +12 -11
  506. package/dist/public-api/v1/handlers/executions/executions.handler.js +46 -80
  507. package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
  508. package/dist/public-api/v1/handlers/folders/folders.handler.d.ts +12 -17
  509. package/dist/public-api/v1/handlers/folders/folders.handler.js +17 -20
  510. package/dist/public-api/v1/handlers/folders/folders.handler.js.map +1 -1
  511. package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +5 -4
  512. package/dist/public-api/v1/handlers/insights/insights.handler.js +9 -5
  513. package/dist/public-api/v1/handlers/insights/insights.handler.js.map +1 -1
  514. package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +28 -11
  515. package/dist/public-api/v1/handlers/projects/projects.handler.js +44 -75
  516. package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
  517. package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +5 -6
  518. package/dist/public-api/v1/handlers/source-control/source-control.handler.js +3 -2
  519. package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +1 -1
  520. package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +9 -8
  521. package/dist/public-api/v1/handlers/tags/tags.handler.js +11 -8
  522. package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
  523. package/dist/public-api/v1/handlers/users/users.handler.ee.d.ts +14 -11
  524. package/dist/public-api/v1/handlers/users/users.handler.ee.js +7 -8
  525. package/dist/public-api/v1/handlers/users/users.handler.ee.js.map +1 -1
  526. package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +13 -7
  527. package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -3
  528. package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
  529. package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +17 -49
  530. package/dist/public-api/v1/handlers/workflows/workflows.handler.js +27 -46
  531. package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
  532. package/dist/public-api/v1/shared/handler.types.d.ts +7 -1
  533. package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -2
  534. package/dist/public-api/v1/shared/middlewares/global.middleware.js +7 -6
  535. package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
  536. package/dist/scaling/constants.d.ts +2 -2
  537. package/dist/scaling/job-processor.js +2 -0
  538. package/dist/scaling/job-processor.js.map +1 -1
  539. package/dist/scaling/pubsub/pubsub.event-map.d.ts +9 -0
  540. package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
  541. package/dist/scaling/scaling.types.d.ts +1 -0
  542. package/dist/server.d.ts +2 -0
  543. package/dist/server.js +2 -0
  544. package/dist/server.js.map +1 -1
  545. package/dist/services/frontend.service.js +7 -14
  546. package/dist/services/frontend.service.js.map +1 -1
  547. package/dist/services/import.service.d.ts +9 -3
  548. package/dist/services/import.service.js +72 -5
  549. package/dist/services/import.service.js.map +1 -1
  550. package/dist/services/proxy-token-manager.js.map +1 -0
  551. package/dist/services/workflow-statistics.service.js +1 -0
  552. package/dist/services/workflow-statistics.service.js.map +1 -1
  553. package/dist/task-runners/task-broker/task-broker.service.d.ts +2 -0
  554. package/dist/task-runners/task-broker/task-broker.service.js +13 -1
  555. package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
  556. package/dist/utils/ttl-map.d.ts +17 -0
  557. package/dist/utils/ttl-map.js +80 -0
  558. package/dist/utils/ttl-map.js.map +1 -0
  559. package/dist/webhooks/test-webhooks.d.ts +3 -1
  560. package/dist/webhooks/test-webhooks.js +11 -3
  561. package/dist/webhooks/test-webhooks.js.map +1 -1
  562. package/dist/workflow-execute-additional-data.d.ts +2 -1
  563. package/dist/workflow-execute-additional-data.js +34 -0
  564. package/dist/workflow-execute-additional-data.js.map +1 -1
  565. package/dist/workflow-helpers.d.ts +1 -0
  566. package/dist/workflow-helpers.js +15 -0
  567. package/dist/workflow-helpers.js.map +1 -1
  568. package/dist/workflow-runner.js +2 -0
  569. package/dist/workflow-runner.js.map +1 -1
  570. package/dist/workflows/workflow-creation.service.js +1 -0
  571. package/dist/workflows/workflow-creation.service.js.map +1 -1
  572. package/dist/workflows/workflow.service.js +4 -0
  573. package/dist/workflows/workflow.service.js.map +1 -1
  574. package/package.json +40 -25
  575. package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js +0 -203
  576. package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js.map +0 -1
  577. package/dist/modules/instance-ai/proxy-token-manager.js.map +0 -1
  578. package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +0 -1
  579. /package/dist/{modules/instance-ai → services}/proxy-token-manager.d.ts +0 -0
  580. /package/dist/{modules/instance-ai → services}/proxy-token-manager.js +0 -0
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contentPartToDto = contentPartToDto;
4
+ exports.messageToDto = messageToDto;
5
+ exports.messagesToDto = messagesToDto;
6
+ function contentPartToDto(part) {
7
+ const dto = { type: part.type };
8
+ if ('text' in part && typeof part.text === 'string')
9
+ dto.text = part.text;
10
+ if ('toolName' in part && typeof part.toolName === 'string')
11
+ dto.toolName = part.toolName;
12
+ if ('toolCallId' in part && typeof part.toolCallId === 'string') {
13
+ dto.toolCallId = part.toolCallId;
14
+ }
15
+ if ('input' in part)
16
+ dto.input = part.input;
17
+ if ('state' in part && typeof part.state === 'string')
18
+ dto.state = part.state;
19
+ if ('output' in part)
20
+ dto.output = part.output;
21
+ if ('error' in part && typeof part.error === 'string')
22
+ dto.error = part.error;
23
+ return dto;
24
+ }
25
+ function messageToDto(msg) {
26
+ if (!('role' in msg) || !Array.isArray(msg.content))
27
+ return null;
28
+ return {
29
+ id: msg.id,
30
+ role: msg.role,
31
+ content: msg.content.map(contentPartToDto),
32
+ };
33
+ }
34
+ function messagesToDto(msgs) {
35
+ const out = [];
36
+ for (const m of msgs) {
37
+ const dto = messageToDto(m);
38
+ if (dto)
39
+ out.push(dto);
40
+ }
41
+ return out;
42
+ }
43
+ //# sourceMappingURL=agent-message-mapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-message-mapper.js","sourceRoot":"","sources":["../../../src/modules/agents/agent-message-mapper.ts"],"names":[],"mappings":";;AAGA,4CAYC;AAED,oCAOC;AAED,sCAOC;AA9BD,SAAgB,gBAAgB,CAAC,IAAoB;IACpD,MAAM,GAAG,GAAqC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAClE,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAC1E,IAAI,UAAU,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ;QAAE,GAAG,C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CAAC;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type AgentSkill, type AgentSkillMutationResponse } from '@n8n/api-types';
2
+ import { Logger } from '@n8n/backend-common';
3
+ import { Agent } from './entities/agent.entity';
4
+ import type { AgentJsonConfig } from './json-config/agent-json-config';
5
+ import { AgentRepository } from './repositories/agent.repository';
6
+ type AgentSkillEntries = Agent['skills'];
7
+ export declare class AgentSkillsService {
8
+ private readonly logger;
9
+ private readonly agentRepository;
10
+ constructor(logger: Logger, agentRepository: AgentRepository);
11
+ listSkills(agentId: string, projectId: string): Promise<Record<string, AgentSkill>>;
12
+ getSkill(agentId: string, projectId: string, skillId: string): Promise<AgentSkill>;
13
+ createSkill(agentId: string, projectId: string, skill: AgentSkill): Promise<AgentSkillMutationResponse>;
14
+ createAndAttachSkill(agentId: string, projectId: string, skill: AgentSkill): Promise<AgentSkillMutationResponse>;
15
+ updateSkill(agentId: string, projectId: string, skillId: string, updates: Partial<AgentSkill>): Promise<AgentSkillMutationResponse>;
16
+ deleteSkill(agentId: string, projectId: string, skillId: string): Promise<void>;
17
+ removeUnreferencedSkills(entity: Agent, config: AgentJsonConfig): void;
18
+ getMissingSkillIds(config: AgentJsonConfig | null, skills: AgentSkillEntries): string[];
19
+ snapshotConfiguredSkills(config: AgentJsonConfig | null, skills: AgentSkillEntries): AgentSkillEntries | null;
20
+ private validateSkill;
21
+ private addSkill;
22
+ private attachSkillRef;
23
+ }
24
+ export {};
@@ -0,0 +1,166 @@
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.AgentSkillsService = void 0;
13
+ const api_types_1 = require("@n8n/api-types");
14
+ const backend_common_1 = require("@n8n/backend-common");
15
+ const di_1 = require("@n8n/di");
16
+ const n8n_workflow_1 = require("n8n-workflow");
17
+ const not_found_error_1 = require("../../errors/response-errors/not-found.error");
18
+ const agent_draft_utils_1 = require("./utils/agent-draft.utils");
19
+ const agent_repository_1 = require("./repositories/agent.repository");
20
+ const agent_resource_id_1 = require("./utils/agent-resource-id");
21
+ let AgentSkillsService = class AgentSkillsService {
22
+ constructor(logger, agentRepository) {
23
+ this.logger = logger;
24
+ this.agentRepository = agentRepository;
25
+ }
26
+ async listSkills(agentId, projectId) {
27
+ const entity = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
28
+ if (!entity)
29
+ throw new not_found_error_1.NotFoundError('Agent not found');
30
+ return entity.skills ?? {};
31
+ }
32
+ async getSkill(agentId, projectId, skillId) {
33
+ const skills = await this.listSkills(agentId, projectId);
34
+ const skill = skills[skillId];
35
+ if (!skill)
36
+ throw new not_found_error_1.NotFoundError('Skill not found');
37
+ return skill;
38
+ }
39
+ async createSkill(agentId, projectId, skill) {
40
+ const entity = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
41
+ if (!entity)
42
+ throw new not_found_error_1.NotFoundError('Agent not found');
43
+ this.validateSkill(skill);
44
+ const skillId = this.addSkill(entity, skill);
45
+ (0, agent_draft_utils_1.markAgentDraftDirty)(entity);
46
+ const saved = await this.agentRepository.save(entity);
47
+ this.logger.debug('Created agent skill', { agentId, projectId, skillId });
48
+ return { id: skillId, skill, versionId: saved.versionId };
49
+ }
50
+ async createAndAttachSkill(agentId, projectId, skill) {
51
+ const entity = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
52
+ if (!entity)
53
+ throw new not_found_error_1.NotFoundError('Agent not found');
54
+ if (!entity.schema)
55
+ throw new n8n_workflow_1.UserError('Agent has no JSON config yet.');
56
+ this.validateSkill(skill);
57
+ const skillId = this.addSkill(entity, skill);
58
+ this.attachSkillRef(entity, skillId);
59
+ (0, agent_draft_utils_1.markAgentDraftDirty)(entity);
60
+ const saved = await this.agentRepository.save(entity);
61
+ this.logger.debug('Created and attached agent skill', { agentId, projectId, skillId });
62
+ return { id: skillId, skill, versionId: saved.versionId };
63
+ }
64
+ async updateSkill(agentId, projectId, skillId, updates) {
65
+ const entity = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
66
+ if (!entity)
67
+ throw new not_found_error_1.NotFoundError('Agent not found');
68
+ const existing = entity.skills?.[skillId];
69
+ if (!existing)
70
+ throw new not_found_error_1.NotFoundError('Skill not found');
71
+ const updated = { ...existing, ...updates };
72
+ this.validateSkill(updated);
73
+ entity.skills = {
74
+ ...(entity.skills ?? {}),
75
+ [skillId]: updated,
76
+ };
77
+ (0, agent_draft_utils_1.markAgentDraftDirty)(entity);
78
+ const saved = await this.agentRepository.save(entity);
79
+ this.logger.debug('Updated agent skill', { agentId, projectId, skillId });
80
+ return { id: skillId, skill: updated, versionId: saved.versionId };
81
+ }
82
+ async deleteSkill(agentId, projectId, skillId) {
83
+ const entity = await this.agentRepository.findByIdAndProjectId(agentId, projectId);
84
+ if (!entity)
85
+ throw new not_found_error_1.NotFoundError('Agent not found');
86
+ const skills = { ...(entity.skills ?? {}) };
87
+ if (!skills[skillId])
88
+ throw new not_found_error_1.NotFoundError('Skill not found');
89
+ delete skills[skillId];
90
+ entity.skills = skills;
91
+ if (entity.schema?.skills) {
92
+ entity.schema.skills = entity.schema.skills.filter((t) => t.id !== skillId);
93
+ }
94
+ (0, agent_draft_utils_1.markAgentDraftDirty)(entity);
95
+ await this.agentRepository.save(entity);
96
+ this.logger.debug('Deleted agent skill', { agentId, projectId, skillId });
97
+ }
98
+ removeUnreferencedSkills(entity, config) {
99
+ const referencedSkillIds = new Set((config.skills ?? []).map((t) => t.id));
100
+ const orphanSkillIds = Object.keys(entity.skills ?? {}).filter((id) => !referencedSkillIds.has(id));
101
+ if (orphanSkillIds.length === 0)
102
+ return;
103
+ const skills = { ...(entity.skills ?? {}) };
104
+ for (const id of orphanSkillIds) {
105
+ delete skills[id];
106
+ }
107
+ entity.skills = skills;
108
+ }
109
+ getMissingSkillIds(config, skills) {
110
+ const refs = config?.skills ?? [];
111
+ const seen = new Set();
112
+ const missing = [];
113
+ for (const ref of refs) {
114
+ if (seen.has(ref.id))
115
+ continue;
116
+ seen.add(ref.id);
117
+ if (!skills[ref.id])
118
+ missing.push(ref.id);
119
+ }
120
+ return missing;
121
+ }
122
+ snapshotConfiguredSkills(config, skills) {
123
+ if (!config)
124
+ return null;
125
+ const missing = this.getMissingSkillIds(config, skills);
126
+ if (missing.length > 0) {
127
+ throw new n8n_workflow_1.UserError(`Cannot publish agent with missing skill bodies: ${missing.join(', ')}`);
128
+ }
129
+ const snapshot = {};
130
+ for (const ref of config.skills ?? []) {
131
+ const skill = skills[ref.id];
132
+ if (skill)
133
+ snapshot[ref.id] = { ...skill };
134
+ }
135
+ return snapshot;
136
+ }
137
+ validateSkill(skill) {
138
+ const result = api_types_1.agentSkillSchema.safeParse(skill);
139
+ if (!result.success) {
140
+ throw new n8n_workflow_1.UserError(`Invalid agent skill: ${result.error.issues[0]?.message ?? 'Invalid skill'}`);
141
+ }
142
+ }
143
+ addSkill(entity, skill) {
144
+ const skillId = (0, agent_resource_id_1.generateAgentResourceId)('skill', Object.keys(entity.skills ?? {}));
145
+ entity.skills = {
146
+ ...(entity.skills ?? {}),
147
+ [skillId]: skill,
148
+ };
149
+ return skillId;
150
+ }
151
+ attachSkillRef(entity, skillId) {
152
+ if (!entity.schema)
153
+ throw new n8n_workflow_1.UserError('Agent has no JSON config yet.');
154
+ entity.schema.skills = [
155
+ ...(entity.schema.skills ?? []).filter((ref) => ref.id !== skillId),
156
+ { type: 'skill', id: skillId },
157
+ ];
158
+ }
159
+ };
160
+ exports.AgentSkillsService = AgentSkillsService;
161
+ exports.AgentSkillsService = AgentSkillsService = __decorate([
162
+ (0, di_1.Service)(),
163
+ __metadata("design:paramtypes", [backend_common_1.Logger,
164
+ agent_repository_1.AgentRepository])
165
+ ], AgentSkillsService);
166
+ //# sourceMappingURL=agent-skills.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-skills.service.js","sourceRoot":"","sources":["../../../src/modules/agents/agent-skills.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAoG;AACpG,wDAA6C;AAC7C,gCAAkC;AAClC,+CAAyC;AAEzC,8EAAyE;AAEzE,iEAAgE;AAGhE,sEAAkE;AAClE,iEAAoE;AAK7D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC9B,YACkB,MAAc,EACd,eAAgC;QADhC,WAAM,GAAN,MAAM,CAAQ;QACd,oBAAe,GAAf,eAAe,CAAiB;IAC/C,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,OAAe,EAAE,SAAiB;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,+BAAa,CAAC,iBAAiB,CAAC,CAAC;QAExD,OAAO,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAe,EAAE,SAAiB,EAAE,OAAe;QACjE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,+BAAa,CAAC,iBAAiB,CAAC,CAAC;QA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AAE,OAAe;QACpD,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,MAAM,IAAI,wBAAS,CAAC,+BAA+B,CAAC,CAAC;QAEzE,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG;YACtB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC;YACnE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE;SAC9B,CAAC;IACH,CAAC;CACD,CAAA;AAzLY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,YAAO,GAAE;qCAGiB,uBAAM;QACG,kCAAe;GAHtC,kBAAkB,CAyL9B"}
@@ -0,0 +1,15 @@
1
+ import { type StreamChunk } from '@n8n/agents';
2
+ import type { AgentSseEvent } from '@n8n/api-types';
3
+ import type { Response } from 'express';
4
+ export type FlushableResponse = Response & {
5
+ flush?: () => void;
6
+ };
7
+ export interface ToolEventCallbacks {
8
+ toolInputStart?: (toolName: string) => void;
9
+ toolInputDelta?: (toolCallId: string, delta: string) => void;
10
+ toolResult?: (toolName: string) => void;
11
+ }
12
+ export declare function initSseStream(res: FlushableResponse): {
13
+ send: (event: AgentSseEvent) => void;
14
+ };
15
+ export declare function pumpChunks(chunks: AsyncIterable<StreamChunk>, send: (e: AgentSseEvent) => void, onToolEvent?: ToolEventCallbacks): Promise<boolean>;
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initSseStream = initSseStream;
4
+ exports.pumpChunks = pumpChunks;
5
+ const agents_1 = require("@n8n/agents");
6
+ function initSseStream(res) {
7
+ res.setHeader('Content-Type', 'text/event-stream; charset=UTF-8');
8
+ res.setHeader('Cache-Control', 'no-cache');
9
+ res.setHeader('Connection', 'keep-alive');
10
+ res.setHeader('X-Accel-Buffering', 'no');
11
+ res.flushHeaders();
12
+ res.socket?.setNoDelay?.(true);
13
+ const send = (event) => {
14
+ res.write(`data: ${JSON.stringify(event)}\n\n`);
15
+ res.flush?.();
16
+ };
17
+ return { send };
18
+ }
19
+ function toAgentSseMessage(message) {
20
+ if (!('content' in message) || !Array.isArray(message.content))
21
+ return undefined;
22
+ const content = [];
23
+ for (const part of message.content) {
24
+ if (part.type === 'text' && 'text' in part) {
25
+ content.push({ type: 'text', text: part.text });
26
+ }
27
+ else if (part.type === 'reasoning' && 'text' in part) {
28
+ content.push({ type: 'reasoning', text: part.text });
29
+ }
30
+ }
31
+ if (content.length === 0)
32
+ return undefined;
33
+ return { role: message.role, content };
34
+ }
35
+ function emitTextLikeChunk(chunk, send) {
36
+ switch (chunk.type) {
37
+ case 'text-start':
38
+ send({ type: 'text-start', id: chunk.id });
39
+ break;
40
+ case 'text-delta':
41
+ if (chunk.delta)
42
+ send({ type: 'text-delta', id: chunk.id, delta: chunk.delta });
43
+ break;
44
+ case 'text-end':
45
+ send({ type: 'text-end', id: chunk.id });
46
+ break;
47
+ case 'reasoning-start':
48
+ send({ type: 'reasoning-start', id: chunk.id });
49
+ break;
50
+ case 'reasoning-delta':
51
+ if (chunk.delta)
52
+ send({ type: 'reasoning-delta', id: chunk.id, delta: chunk.delta });
53
+ break;
54
+ case 'reasoning-end':
55
+ send({ type: 'reasoning-end', id: chunk.id });
56
+ break;
57
+ }
58
+ }
59
+ function handleWorkingMemoryChunk(chunk, ctx) {
60
+ const { send, workingMemoryToolCallIds } = ctx;
61
+ const isWmName = 'toolName' in chunk && chunk.toolName === agents_1.UPDATE_WORKING_MEMORY_TOOL_NAME;
62
+ if (chunk.type === 'tool-input-delta') {
63
+ return workingMemoryToolCallIds.has(chunk.toolCallId);
64
+ }
65
+ if (!isWmName)
66
+ return false;
67
+ if (chunk.type === 'tool-input-start' || chunk.type === 'tool-call') {
68
+ workingMemoryToolCallIds.add(chunk.toolCallId);
69
+ return true;
70
+ }
71
+ if (chunk.type === 'tool-execution-start')
72
+ return true;
73
+ if (chunk.type === 'tool-result') {
74
+ if (chunk.isError) {
75
+ const errMsg = chunk.output instanceof Error ? chunk.output.message : String(chunk.output);
76
+ send({ type: 'error', message: `Working memory update failed: ${errMsg}` });
77
+ }
78
+ else {
79
+ send({ type: 'working-memory-update', toolName: chunk.toolName });
80
+ }
81
+ return true;
82
+ }
83
+ return false;
84
+ }
85
+ function emitToolChunk(chunk, ctx) {
86
+ const { send, onToolEvent } = ctx;
87
+ if (chunk.type !== 'tool-call-suspended' && handleWorkingMemoryChunk(chunk, ctx)) {
88
+ return { suspended: false };
89
+ }
90
+ switch (chunk.type) {
91
+ case 'tool-input-start':
92
+ send({
93
+ type: 'tool-input-start',
94
+ toolCallId: chunk.toolCallId,
95
+ toolName: chunk.toolName,
96
+ });
97
+ onToolEvent?.toolInputStart?.(chunk.toolName);
98
+ break;
99
+ case 'tool-input-delta':
100
+ if (chunk.delta) {
101
+ send({ type: 'tool-input-delta', toolCallId: chunk.toolCallId, delta: chunk.delta });
102
+ onToolEvent?.toolInputDelta?.(chunk.toolCallId, chunk.delta);
103
+ }
104
+ break;
105
+ case 'tool-call':
106
+ send({
107
+ type: 'tool-call',
108
+ toolCallId: chunk.toolCallId,
109
+ toolName: chunk.toolName,
110
+ input: chunk.input,
111
+ });
112
+ break;
113
+ case 'tool-execution-start':
114
+ send({
115
+ type: 'tool-execution-start',
116
+ toolCallId: chunk.toolCallId,
117
+ toolName: chunk.toolName,
118
+ });
119
+ break;
120
+ case 'tool-result':
121
+ send({
122
+ type: 'tool-result',
123
+ toolCallId: chunk.toolCallId,
124
+ toolName: chunk.toolName,
125
+ output: chunk.output,
126
+ ...(chunk.isError !== undefined && { isError: chunk.isError }),
127
+ });
128
+ onToolEvent?.toolResult?.(chunk.toolName);
129
+ break;
130
+ case 'tool-call-suspended': {
131
+ const payload = {
132
+ toolCallId: chunk.toolCallId,
133
+ runId: chunk.runId,
134
+ toolName: chunk.toolName,
135
+ input: chunk.suspendPayload,
136
+ };
137
+ send({ type: 'tool-call-suspended', payload });
138
+ return { suspended: true };
139
+ }
140
+ }
141
+ return { suspended: false };
142
+ }
143
+ function emitChunkEvents(chunk, ctx) {
144
+ switch (chunk.type) {
145
+ case 'start-step':
146
+ ctx.send({ type: 'start-step' });
147
+ return { suspended: false };
148
+ case 'finish-step':
149
+ ctx.send({ type: 'finish-step' });
150
+ return { suspended: false };
151
+ case 'text-start':
152
+ case 'text-delta':
153
+ case 'text-end':
154
+ case 'reasoning-start':
155
+ case 'reasoning-delta':
156
+ case 'reasoning-end':
157
+ emitTextLikeChunk(chunk, ctx.send);
158
+ return { suspended: false };
159
+ case 'tool-input-start':
160
+ case 'tool-input-delta':
161
+ case 'tool-call':
162
+ case 'tool-execution-start':
163
+ case 'tool-result':
164
+ case 'tool-call-suspended':
165
+ return emitToolChunk(chunk, ctx);
166
+ case 'message': {
167
+ const sseMessage = toAgentSseMessage(chunk.message);
168
+ if (sseMessage)
169
+ ctx.send({ type: 'message', message: sseMessage });
170
+ return { suspended: false };
171
+ }
172
+ case 'error': {
173
+ const errMsg = chunk.error instanceof Error ? chunk.error.message : String(chunk.error);
174
+ ctx.send({ type: 'error', message: errMsg });
175
+ return { suspended: false };
176
+ }
177
+ default:
178
+ return { suspended: false };
179
+ }
180
+ }
181
+ async function pumpChunks(chunks, send, onToolEvent) {
182
+ const ctx = {
183
+ send,
184
+ onToolEvent,
185
+ workingMemoryToolCallIds: new Set(),
186
+ };
187
+ for await (const chunk of chunks) {
188
+ const { suspended } = emitChunkEvents(chunk, ctx);
189
+ if (suspended)
190
+ return true;
191
+ }
192
+ return false;
193
+ }
194
+ //# sourceMappingURL=agent-sse-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-sse-stream.js","sourceRoot":"","sources":["../../../src/modules/agents/agent-sse-stream.ts"],"names":[],"mappings":";;AAsCA,sCAcC;AA2OD,gCAgBC;AA/SD,wCAAmG;AAsCnG,SAAgB,aAAa,CAAC,GAAsB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CAAC;IAEF,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAClC,MAAM,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAClD,IAAI,SAAS;YAAE,OAAO,IAAI,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { BuiltTool, CredentialProvider } from '@n8n/agents';
2
+ import { Logger } from '@n8n/backend-common';
3
+ import { EphemeralNodeExecutor } from '../../node-execution';
4
+ import { NodeCatalogService } from '../../node-catalog';
5
+ export declare const isExecutableNodeType: (nodeId: string) => boolean;
6
+ export declare const isAgentToolNodeType: (nodeId: string) => boolean;
7
+ export declare class AgentsToolsService {
8
+ private readonly logger;
9
+ private readonly nodeCatalogService;
10
+ private readonly ephemeralNodeExecutor;
11
+ constructor(logger: Logger, nodeCatalogService: NodeCatalogService, ephemeralNodeExecutor: EphemeralNodeExecutor);
12
+ getSharedTools(credentialProvider: CredentialProvider, listCredentialsUsageHint: string): BuiltTool[];
13
+ getRuntimeTools(credentialProvider: CredentialProvider, projectId: string): BuiltTool[];
14
+ private buildSearchNodesTool;
15
+ private buildGetNodeTypesTool;
16
+ private buildListCredentialsTool;
17
+ private buildRunNodeTool;
18
+ }