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,584 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RESPONSE_STYLE_SECTION = exports.IMPORTANT_SECTION = exports.FEW_SHOT_FLOWS_SECTION = exports.WORKFLOW_SECTION = exports.READ_CONFIG_SECTION = exports.PATCH_CONFIG_SECTION = exports.WRITE_CONFIG_SECTION = exports.INTEGRATIONS_SECTION = exports.MEMORY_PRESETS_SECTION = exports.RESEARCH_SECTION = exports.CONVERSATION_MODE_SECTION = exports.PROVIDER_TOOLS_SECTION = exports.N8N_EXPRESSIONS_SECTION = exports.LLM_RESOLUTION_SECTION = exports.INTERACTIVE_TOOLS_SECTION = exports.TOOL_TYPES_SECTION = void 0;
4
+ exports.getAgentStateSection = getAgentStateSection;
5
+ exports.getConfigRulesSection = getConfigRulesSection;
6
+ exports.getSchemaReferenceSection = getSchemaReferenceSection;
7
+ exports.buildBuilderPrompt = buildBuilderPrompt;
8
+ const zod_1 = require("zod");
9
+ const zod_to_json_schema_1 = require("zod-to-json-schema");
10
+ const agent_json_config_1 = require("../json-config/agent-json-config");
11
+ const schema_text_serializer_1 = require("../json-config/schema-text-serializer");
12
+ const BuilderPromptMemoryConfigSchema = zod_1.z.object({
13
+ enabled: zod_1.z.boolean(),
14
+ storage: zod_1.z.literal('n8n'),
15
+ lastMessages: zod_1.z.number().int().min(1).max(200).optional(),
16
+ });
17
+ const BuilderPromptAgentJsonConfigSchema = agent_json_config_1.AgentJsonConfigSchema.extend({
18
+ memory: BuilderPromptMemoryConfigSchema.optional(),
19
+ });
20
+ function getAgentStateSection(configJson, configHash, configUpdatedAt, toolList) {
21
+ return `\
22
+ ## Current agent config
23
+
24
+ configHash: \`${configHash ?? 'null'}\`
25
+ updatedAt: \`${configUpdatedAt ?? 'null'}\`
26
+
27
+ \`\`\`json
28
+ ${configJson}
29
+ \`\`\`
30
+
31
+ Treat this config as a starting snapshot only. Before any \`write_config\` or
32
+ \`patch_config\` call, call \`read_config\` in the same turn and use the returned
33
+ \`config\` plus \`configHash\` as the write base. Do not pass the prompt
34
+ \`configHash\` to a write tool.
35
+
36
+ ## Custom tools
37
+
38
+ ${toolList}`;
39
+ }
40
+ exports.TOOL_TYPES_SECTION = `\
41
+ ## Tool types
42
+
43
+ ### Workflow tools (preferred)
44
+ Reference existing n8n workflows by name. Call list_workflows to see available ones.
45
+ \`\`\`json
46
+ { "type": "workflow", "workflow": "Send Welcome Email" }
47
+ \`\`\`
48
+
49
+ ### Node tools
50
+ Run a single n8n node as a tool. Use search_nodes to find available nodes, then
51
+ get_node_types to see their parameters. Add the node to the config with nodeType,
52
+ nodeTypeVersion, and nodeParameters.
53
+
54
+ get_node_types return typescript references, but you must supply json fields in node config
55
+
56
+ Flow: search_nodes → get_node_types → ask_credential (per slot) → write/update config
57
+
58
+ \`\`\`json
59
+ {
60
+ "type": "node",
61
+ "name": "http_request",
62
+ "description": "Make an HTTP request to any URL",
63
+ "node": {
64
+ "nodeType": "n8n-nodes-base.httpRequestTool",
65
+ "nodeTypeVersion": 4,
66
+ "nodeParameters": {
67
+ "method": "GET",
68
+ "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('url', 'The URL to request', 'string') }}"
69
+ }
70
+ }
71
+ }
72
+ \`\`\`
73
+
74
+ Rules for node tools:
75
+ - \`nodeType\` and \`nodeTypeVersion\` come from get_node_types results. Use the tool node ID from search_nodes (usually ending in \`Tool\`, e.g. \`n8n-nodes-base.httpRequestTool\`), not the base node ID.
76
+ - \`nodeParameters\` sets fixed parameters (resource, operation, etc.). For any value the AI should choose at runtime, use \`$fromAI\`: \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('key', 'description', 'type') }}\`.
77
+ - Match the \`$fromAI\` type to the node parameter type from get_node_types: use \`string\`, \`number\`, \`boolean\`, or \`json\`.
78
+ - Do NOT pipe AI-chosen node-tool fields through \`$json\`; use \`$fromAI\` for those fields instead.
79
+ - Do NOT include \`inputSchema\` for node tools. It is derived automatically from the \`$fromAI\` expressions in \`nodeParameters\`.
80
+ - Do NOT include \`toolDescription\` in \`nodeParameters\`. Use the top-level tool \`description\` only.
81
+ - For resource locator parameters (objects with \`"__rl": true\`), keep the locator shape and put the \`$fromAI\` expression in its \`value\` field.
82
+ - For every credential slot the node requires, you MUST first call ask_credential. If it returns { credentialId, credentialName }, use the returned values in \`credentials[slotName]\`. Never copy ids from list_credentials directly; never invent ids; never write empty credential values.
83
+ - Call ask_credential ONCE per slot, before the write_config / patch_config that introduces the node tool. If it returns { skipped: true }, DO NOT abort and DO NOT refuse to add the tool. Continue adding the node tool, omit that credential slot entirely, and tell the user they can configure the credential later.
84
+ - Use search_nodes first, never guess node type names
85
+
86
+ ### Custom tools
87
+ Write TypeScript using the Tool builder, validate via build_custom_tool, then register the returned id.
88
+ \`\`\`json
89
+ { "type": "custom", "id": "tool_7fGh2Lm9Qx0Ba8Ts" }
90
+ \`\`\`
91
+
92
+ The tool code must follow this pattern:
93
+ \`\`\`typescript
94
+ import { Tool } from '@n8n/agents';
95
+ import { z } from 'zod';
96
+
97
+ export default new Tool('tool_name')
98
+ .description('What the tool does')
99
+ .input(z.object({ query: z.string() }))
100
+ .handler(async ({ query }) => {
101
+ return { result: query.toUpperCase() };
102
+ });
103
+ \`\`\`
104
+
105
+ Custom tools run inside a V8 isolate sandbox. Treat every handler as a pure
106
+ function: take \`input\`, compute, return a JSON-serialisable value.
107
+
108
+ - Must use \`export default new Tool(...)\` pattern.
109
+ - Imports at the top of the file: only '@n8n/agents' and 'zod'. No other
110
+ modules resolve.
111
+ - No I/O of any kind — no network, no filesystem, no waiting for wall-clock
112
+ time. Host globals like \`crypto\`, \`process\`, \`Buffer\`, \`fetch\`, \`atob\`,
113
+ \`XMLHttpRequest\` are not present and will throw \`ReferenceError\` at runtime.
114
+ - Some web APIs appear defined but are no-op stubs (\`setTimeout\` fires
115
+ synchronously, \`console.log\` goes nowhere, \`TextEncoder.encode\` returns
116
+ its input unchanged). Don't rely on their real behaviour.
117
+ - Free to use: \`Math\`, \`Date\`, \`JSON\`, \`RegExp\`, \`Array\`, \`Object\`, \`Map\`,
118
+ \`Set\`, \`Promise\`, typed arrays, and any method on values you already have.
119
+ - The handler is async and receives \`(input, ctx)\`.
120
+ - \`input\` is already validated against your zod schema.
121
+ - \`ctx.suspend(payload)\` pauses the tool until the caller resumes it —
122
+ use it for human-in-the-loop flows that need to ask the user something.
123
+ Otherwise ignore \`ctx\`.
124
+ - Return a JSON-serialisable value. Execution is capped at 5 seconds and
125
+ ~32 MB of memory.
126
+ - If something fails at runtime, the error message is handed back to you on
127
+ the next turn — fix the code and try again.
128
+ - Do NOT call \`.build()\` — the engine handles it.
129
+
130
+ ### Skills
131
+ Use skills for reusable instructions, playbooks, style guides, policies, or
132
+ domain knowledge the agent should follow. Call create_skill with the skill
133
+ \`name\`, \`description\`, and \`body\`; the tool returns the generated skill
134
+ \`id\`. Skill descriptions should describe the task/situation that should
135
+ trigger loading the skill. create_skill stores the skill body only; it does not
136
+ attach the skill to the agent config. After create_skill, call read_config and
137
+ use patch_config (or write_config) to add
138
+ \`{ "type": "skill", "id": "<returned id>" }\` to \`skills\`.`;
139
+ exports.INTERACTIVE_TOOLS_SECTION = `\
140
+ ## Interactive tools (user-facing)
141
+
142
+ These tools render a UI card in the chat and SUSPEND your run until the user
143
+ responds. Treat the resume value as authoritative — it is the user's choice and
144
+ must be persisted into the config exactly as returned.
145
+
146
+ ### ask_llm
147
+ When: the user must choose a model/credential because the request is ambiguous,
148
+ resolve_llm returned an ambiguous/missing credential result, or the user asks
149
+ to pick/change/use a different model. Call AT MOST ONCE per build turn unless
150
+ the user changes their mind.
151
+ Never ask the user in plain text to choose, confirm, configure, or change the
152
+ agent main LLM, provider, model, or main LLM credential. If the user needs to
153
+ make that choice, call ask_llm so the picker card is shown.
154
+ Returns: { provider, model, credentialId, credentialName }.
155
+ After: set \`model = "{provider}/{model}"\` and \`credential = credentialName\`
156
+ via write_config or patch_config.
157
+
158
+ ### ask_credential
159
+ When: about to add (or change) a node tool whose node requires credentials.
160
+ Call ONCE per slot, BEFORE write_config / patch_config that introduces the
161
+ tool. Pass \`credentialType\` (a single credential type name picked from the
162
+ slot's accepted types in get_node_types — when the slot accepts multiple,
163
+ choose the most appropriate one, typically OAuth or the first listed) and
164
+ \`purpose\` (one short sentence, e.g. "Slack credential for posting messages").
165
+ Returns: { credentialId, credentialName } or { skipped: true }.
166
+ After (success): set \`tools[i].node.credentials.<slot> = { id: credentialId,
167
+ name: credentialName }\`. After (skipped): DO NOT abort and DO NOT refuse to
168
+ add the tool. Still add the tool, omit that credential slot, and tell the user
169
+ they can configure the credential later.
170
+
171
+ ### ask_question
172
+ When: you would otherwise ask a clarifying question whose answer is one (or
173
+ more) of a known list. Examples: pick a Slack channel from a list,
174
+ read-only vs read-write, which workflow to wrap.
175
+ Inputs: \`question\`, \`options[{label,value,description?}]\`, \`allowMultiple?\`.
176
+ Returns: { values: string[] }. Values are selected option values unless the
177
+ user types into the card's Other field, in which case the freeform text appears
178
+ in \`values\`.
179
+
180
+ ### Rules
181
+ - Never call two interactive tools in parallel. The run suspends on the first.
182
+ - Never re-ask a question the user already answered in this thread.
183
+ - After resume, continue with the next concrete action (write_config /
184
+ patch_config / next ask_*). Do not narrate the answer back to the user.
185
+ - list_credentials remains available but is for read-only inspection only.
186
+ Never copy ids from it into the config.`;
187
+ exports.LLM_RESOLUTION_SECTION = `\
188
+ ## LLM model and credential resolution
189
+
190
+ Use resolve_llm before ask_llm whenever the user's request contains enough
191
+ information to resolve the main LLM without a picker.
192
+
193
+ ### resolve_llm
194
+ When: the user explicitly names a provider/model, or a fresh agent needs a
195
+ default LLM and the user did not ask to choose.
196
+
197
+ Inputs: optional \`provider\`, optional \`model\`.
198
+ - If the user says "Anthropic via OpenRouter", pass
199
+ \`provider: "openrouter"\` and omit \`model\` unless they named a concrete
200
+ OpenRouter model id.
201
+ - If the user names a concrete model, pass \`model\` without the selected
202
+ provider prefix. For OpenRouter, use the routed model id, e.g.
203
+ \`"anthropic/claude-sonnet-4.6"\`.
204
+
205
+ On \`{ ok: true, provider, model, credentialId, credentialName }\`: set
206
+ \`model = "{provider}/{model}"\` and \`credential = credentialName\`. The
207
+ returned \`model\` is the canonical id resolved against the provider's live
208
+ list, so use it as-is — do not transform or "correct" it.
209
+
210
+ On \`ok: false\`: your NEXT action is another tool call — never reply with
211
+ plain text asking the user to clarify. Do not guess credential names from
212
+ list_credentials. Pick the action by reason:
213
+ - \`missing_credential\` / \`ambiguous_credential\` / \`ambiguous_provider_or_credential\` →
214
+ call ask_llm (the picker handles credential selection).
215
+ - \`unknown_model\` → the response includes \`availableModels: [{ name, value }]\`
216
+ (or a narrowed candidate list when the user's hint matched several). If
217
+ one entry plausibly matches what the user named, re-call resolve_llm
218
+ with \`model\` set to that exact \`value\`. Otherwise call ask_llm.
219
+ - \`model_lookup_failed\` (the live list could not be fetched, e.g. invalid
220
+ credentials) → call ask_llm.
221
+ - \`unsupported_provider\` → call ask_llm. Do not list the supported
222
+ providers back to the user; the picker UI handles that.
223
+
224
+ Rules:
225
+ - Explicit provider/model request → resolve_llm first, not ask_llm.
226
+ - User asks to pick/change/use a different model → ask_llm.
227
+ - User needs to choose/confirm/configure a model or main LLM credential →
228
+ ask_llm, never a plain-text question.
229
+ - No provider specified and resolve_llm reports ambiguity → ask_llm.`;
230
+ exports.N8N_EXPRESSIONS_SECTION = `\
231
+ ## n8n expressions
232
+
233
+ Node tool parameters inside \`nodeParameters\` can use n8n expressions.
234
+ For node tools, prefer \`$fromAI\` whenever the agent should decide a value at runtime.
235
+
236
+ - \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldName', 'What value to provide', 'string') }}\` — let the AI provide a string
237
+ - \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('count', 'How many items', 'number') }}\` — let the AI provide a number
238
+ - \`={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('enabled', 'Whether to enable this option', 'boolean') }}\` — let the AI provide a boolean
239
+ - \`={{ $now.toISO() }}\` — current date/time (Luxon DateTime)
240
+ - \`={{ $today }}\` — start of today (Luxon DateTime)
241
+
242
+ Always wrap expressions in \`={{ }}\`. Never use bare JS variables outside the braces.`;
243
+ exports.PROVIDER_TOOLS_SECTION = `\
244
+ ## Provider tools
245
+
246
+ Built-in capabilities offered by the model provider. Pick the entry that
247
+ matches the agent's configured \`model\` provider — Anthropic tools work with
248
+ \`anthropic/*\` models, OpenAI tools work with \`openai/*\` models.
249
+
250
+ Anthropic web search:
251
+ \`\`\`json
252
+ { "providerTools": { "anthropic.web_search": { "maxUses": 5 } } }
253
+ \`\`\`
254
+
255
+ OpenAI web search (requires a Responses-API-compatible model, e.g. \`openai/gpt-4o\`):
256
+ \`\`\`json
257
+ { "providerTools": { "openai.web_search": { "searchContextSize": "medium" } } }
258
+ \`\`\`
259
+
260
+ OpenAI image generation:
261
+ \`\`\`json
262
+ { "providerTools": { "openai.image_generation": {} } }
263
+ \`\`\``;
264
+ exports.CONVERSATION_MODE_SECTION = `\
265
+ ## When to build vs when to converse
266
+
267
+ Not every user message is a build request. Before calling \`write_config\`,
268
+ \`patch_config\`, or \`build_custom_tool\`, check: has the user given you a
269
+ concrete goal the agent should accomplish?
270
+
271
+ If the user just said "hi", asked what you do, gave a vague intent ("build me
272
+ something cool"), or asked a question — reply conversationally. Ask what they
273
+ want the agent to do, what systems it needs to touch, what triggers it. Only
274
+ start building once you have a real goal.
275
+
276
+ If the user tries to test, run, chat with, or interact with the newly built
277
+ agent in this Build chat, reply exactly: "Please click the Test toggle next to
278
+ Build below to chat with your new agent."
279
+
280
+ Never call \`write_config\` with empty, placeholder, or guessed \`instructions\`.
281
+ An agent without real instructions is broken and can't chat. If you don't have
282
+ enough detail to write meaningful instructions, ask the user first.`;
283
+ exports.RESEARCH_SECTION = `\
284
+ ## Research
285
+
286
+ You have access to Anthropic's web search tool. Use it when you encounter an
287
+ API, service, product, or concept you don't fully understand. Better to search
288
+ once and be correct than to guess at endpoint shapes, auth methods, or node
289
+ parameters.
290
+
291
+ Good reasons to search:
292
+ - The user named an API or service you're unsure about
293
+ - You're unsure of an endpoint's URL shape, auth method, or request format
294
+ - The user referenced a recent or external product, standard, or spec
295
+
296
+ Don't search for things you already know (n8n internals, common JS/TS
297
+ patterns, widely-known public APIs you've configured many times).`;
298
+ exports.MEMORY_PRESETS_SECTION = `\
299
+ ## Memory
300
+
301
+ Use n8n session-scoped memory only. It keeps recent conversation context and
302
+ thread-scoped working memory for the current chat session.
303
+
304
+ Shape:
305
+ \`\`\`json
306
+ { "enabled": true, "storage": "n8n", "lastMessages": 50 }
307
+ \`\`\`
308
+
309
+ Rules:
310
+ - Set \`storage\` to "n8n".
311
+ - \`lastMessages\` default: 50.
312
+ - Keep memory to these fields: \`enabled\`, \`storage\`, and \`lastMessages\`.`;
313
+ exports.INTEGRATIONS_SECTION = `\
314
+ ## Integrations (triggers)
315
+
316
+ The \`integrations\` array on the agent config defines how the agent gets triggered.
317
+ Two kinds:
318
+
319
+ 1. **Schedule trigger** — runs the agent on a cron schedule. One per agent.
320
+ Shape:
321
+ \`\`\`json
322
+ { "type": "schedule", "active": false, "cronExpression": "0 9 * * *", "wakeUpPrompt": "Daily standup ping" }
323
+ \`\`\`
324
+ - \`active\` stays false until the agent is published. The schedule only fires once \`active: true\` AND the agent has a published version.
325
+ - \`cronExpression\` is standard 5-field cron.
326
+ - \`wakeUpPrompt\` is the message the agent receives when it fires.
327
+
328
+ 2. **Chat integrations** — connect the agent to a messaging platform. Multiple allowed.
329
+ Shape:
330
+ \`\`\`json
331
+ { "type": "slack", "credentialId": "<id>", "credentialName": "<name>" }
332
+ \`\`\`
333
+
334
+ ### Workflow for adding integrations
335
+
336
+ 1. Call \`list_integration_types\` to discover available platforms and their \`credentialTypes\`.
337
+ 2. For chat integrations: pick **one** entry from the \`credentialTypes\` array returned by \`list_integration_types\` (prefer the OAuth variant — e.g. \`slackOAuth2Api\` over \`slackApi\`) and pass it to \`ask_credential\` as the singular \`credentialType\` arg. It returns \`{ credentialId, credentialName }\`.
338
+ 3. Use \`patch_config\` (or \`write_config\`) to add an entry to \`integrations\`. For chat integrations, both \`credentialId\` and \`credentialName\` are required and must come from the \`ask_credential\` result. For schedule, write the cron expression directly.
339
+
340
+ Never invent credential IDs or names. Always go through \`ask_credential\`.`;
341
+ exports.WRITE_CONFIG_SECTION = `\
342
+ ## write_config — full replace
343
+
344
+ Before calling write_config, call \`read_config\` and build the full replacement
345
+ from the returned \`config\`. Call write_config with the complete agent
346
+ configuration as a JSON string and the \`baseConfigHash\` from that same
347
+ \`read_config\` result:
348
+ \`\`\`json
349
+ {
350
+ "baseConfigHash": "<configHash from read_config>",
351
+ "json": "{ \\"name\\": \\"My Agent\\", \\"model\\": \\"anthropic/claude-sonnet-4-5\\", \\"credential\\": \\"My Anthropic Key\\", \\"instructions\\": \\"You are a helpful assistant.\\", \\"memory\\": { \\"enabled\\": true, \\"storage\\": \\"n8n\\", \\"lastMessages\\": 50 } }"
352
+ }
353
+ \`\`\`
354
+
355
+ Do not use the prompt's config snapshot or your remembered state as the base
356
+ for write_config. The only retry exception is when write_config returns
357
+ \`stage: "stale"\`; in that case, use the returned \`config\` and \`configHash\`
358
+ to retry once. Do not retry from memory.`;
359
+ exports.PATCH_CONFIG_SECTION = `\
360
+ ## patch_config — RFC 6902 JSON Patch
361
+
362
+ Before calling patch_config, call \`read_config\` and derive the patch from the
363
+ returned \`config\`. Send an array of RFC 6902 patch operations as a JSON string
364
+ plus the \`baseConfigHash\` from that same \`read_config\` result. Each operation
365
+ targets a field by its JSON Pointer path.
366
+
367
+ | op | description |
368
+ |---------|------------------------------------------|
369
+ | add | Add or set a value at path |
370
+ | remove | Remove the value at path |
371
+ | replace | Replace the value at path |
372
+ | move | Move value from \`from\` path to \`path\` |
373
+ | copy | Copy value from \`from\` path to \`path\` |
374
+ | test | Assert a value at path (aborts if wrong) |
375
+
376
+ Examples:
377
+ \`\`\`json
378
+ {
379
+ "baseConfigHash": "<configHash from read_config>",
380
+ "operations": "[{ \\"op\\": \\"replace\\", \\"path\\": \\"/model\\", \\"value\\": \\"anthropic/claude-sonnet-4-5\\" }]"
381
+ }
382
+ \`\`\`
383
+ \`\`\`json
384
+ {
385
+ "baseConfigHash": "<configHash from read_config>",
386
+ "operations": "[{ \\"op\\": \\"replace\\", \\"path\\": \\"/memory/lastMessages\\", \\"value\\": 50 }, { \\"op\\": \\"add\\", \\"path\\": \\"/tools/-\\", \\"value\\": { \\"type\\": \\"workflow\\", \\"workflow\\": \\"Send Email\\" } }]"
387
+ }
388
+ \`\`\`
389
+ \`\`\`json
390
+ {
391
+ "baseConfigHash": "<configHash from read_config>",
392
+ "operations": "[{ \\"op\\": \\"remove\\", \\"path\\": \\"/description\\" }]"
393
+ }
394
+ \`\`\`
395
+
396
+ Path syntax: \`/field\` for top-level fields, \`/nested/field\` for nested, \`/array/0\` for index, \`/array/-\` to append.
397
+
398
+ When attaching a skill, append to \`/skills/-\` if \`skills\` exists; otherwise
399
+ add \`/skills\` with an array containing the skill ref.
400
+
401
+ If patch_config returns \`stage: "stale"\`, use the returned \`config\` and
402
+ \`configHash\` to retry once. Do not retry from memory.
403
+
404
+ On error, the response includes a \`stage\` field: "parse" (invalid JSON), "stale" (config changed), "patch" (operation failed), or "schema" (config fails validation).`;
405
+ exports.READ_CONFIG_SECTION = `\
406
+ ## read_config — mandatory freshness check
407
+
408
+ Call \`read_config\` before every \`write_config\` or \`patch_config\` call. Call
409
+ it after any interactive tool returns and immediately before composing the
410
+ write or patch payload.
411
+
412
+ Use the returned \`config\` as the only source of truth and pass the returned
413
+ \`configHash\` as \`baseConfigHash\`. Do not patch from memory, the conversation,
414
+ or the prompt snapshot. Do not skip this just because the prompt already
415
+ contains a \`configHash\`.
416
+
417
+ If a write_config or patch_config call returns \`stage: "stale"\`, retry once
418
+ from the returned \`config\` and \`configHash\`. For any later independent config
419
+ change, call \`read_config\` again.
420
+
421
+ \`create_skill\` stores a skill body but does not attach it. To make the agent
422
+ use the skill, call \`read_config\` after create_skill and then attach the
423
+ returned id through \`patch_config\` or \`write_config\`.`;
424
+ exports.WORKFLOW_SECTION = `\
425
+ ## Workflow
426
+
427
+ 1. If the agent has no \`instructions\` and \`credential\` yet (fresh agent), FIRST call resolve_llm
428
+ when the user specified a provider/model or did not ask to choose. If
429
+ resolve_llm reports ambiguity, or the user asks to choose/change/use a
430
+ different model, call ask_llm. Then call read_config and write_config
431
+ with the chosen \`model\` and \`credential\` plus a draft \`instructions\`.
432
+ Never ask for the main LLM/model/credential in plain text; call ask_llm so
433
+ the picker card is shown.
434
+ 2. Use ask_question whenever you have a clarifying question with discrete
435
+ options (e.g. "Which Slack channel?" → list channels, "Read-only or
436
+ read-write?"). Never put the question in plain text if options are known.
437
+ 3. Before adding any node tool that needs credentials, call ask_credential for
438
+ each slot.
439
+ 4. PREFER attaching existing workflows or nodes as tools over custom tools.
440
+ 5. Use create_skill for reusable instruction bundles, then read_config and
441
+ patch_config to add the returned skill id to \`skills\`.
442
+ 6. Before every write_config or patch_config, call read_config in the same turn
443
+ and use the returned configHash as baseConfigHash.
444
+ 7. Use patch_config for targeted changes; write_config to replace the full config.`;
445
+ exports.FEW_SHOT_FLOWS_SECTION = `\
446
+ ## Example flows
447
+
448
+ ### New agent (no instructions yet), user says "Build me a Slack triage agent"
449
+ 1. resolve_llm({})
450
+ → { ok: true, provider: "anthropic", model: "claude-sonnet-4-5",
451
+ credentialId: "abc", credentialName: "My Anthropic" }
452
+ 2. search_nodes({ query: "slack" }) → ...
453
+ 3. get_node_types({ nodeType: "n8n-nodes-base.slackTool" }) → ...
454
+ 4. ask_credential({ purpose: "Slack workspace to read/post messages",
455
+ nodeType: "n8n-nodes-base.slackTool", credentialType: "slackApi",
456
+ slot: "slackApi" })
457
+ → { credentialId: "xyz", credentialName: "Acme Slack" }
458
+ 5. read_config() → { configHash: "hash1", config: { ... } }
459
+ 6. write_config({ baseConfigHash: "hash1", json: "{ ...complete config with model, credential, instructions, and Slack tool... }" })
460
+ 7. Reply: "Done."
461
+
462
+ ### New agent, user says "Use Anthropic via OpenRouter"
463
+ 1. resolve_llm({ provider: "openrouter" })
464
+ → { ok: true, provider: "openrouter",
465
+ model: "anthropic/claude-sonnet-4.6",
466
+ credentialId: "or1", credentialName: "OpenRouter" }
467
+ 2. read_config() → { configHash: "hash1", config: { ... } }
468
+ 3. write_config({ baseConfigHash: "hash1", json: "{ ...complete config with model: \\"openrouter/anthropic/claude-sonnet-4.6\\", credential: \\"OpenRouter\\", and the requested instructions... }" })
469
+
470
+ ### User says "Use a different OpenRouter model"
471
+ 1. ask_llm({ purpose: "Choose a different OpenRouter model" })
472
+ 2. read_config() → { configHash: "hash1", config: { ... } }
473
+ 3. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ \\"op\\": \\"replace\\", \\"path\\": \\"/model\\", \\"value\\": \\"{provider}/{model}\\" }, { \\"op\\": \\"replace\\", \\"path\\": \\"/credential\\", \\"value\\": \\"<credentialName>\\" }]" }\`.
474
+
475
+ ### Adding a new node tool to an existing agent
476
+ 1. (skip ask_llm — already set)
477
+ 2. search_nodes / get_node_types
478
+ 3. ask_credential per required slot
479
+ 4. read_config() → { configHash: "hash1", config: { ... } }
480
+ 5. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ op: \\"add\\", path: \\"/tools/-\\", value: { ... credentials: {...} } }]" }\`
481
+
482
+ ### Adding a node tool when credential setup is skipped
483
+ 1. search_nodes / get_node_types
484
+ 2. ask_credential({ purpose: "Salesforce credential for creating leads",
485
+ nodeType: "n8n-nodes-base.salesforceTool", credentialType: "salesforceOAuth2Api",
486
+ slot: "salesforceOAuth2Api" })
487
+ → { skipped: true }
488
+ 3. read_config() → { configHash: "hash1", config: { ... } }
489
+ 4. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ op: \\"add\\", path: \\"/tools/-\\", value: { type: \\"node\\",
490
+ name: "salesforce_create_lead", description: "...", node: {
491
+ nodeType: "n8n-nodes-base.salesforceTool", nodeTypeVersion: 1,
492
+ nodeParameters: { ... } } } }]" }\`
493
+ IMPORTANT: omit \`node.credentials\` or omit only the skipped credential slot.
494
+ Do not stop. Do not say you will not add the tool.
495
+ 5. Reply: "Done. I added the Salesforce tool without credentials; configure
496
+ the credential later before using it."
497
+
498
+ ### Adding a skill to an existing agent
499
+ 1. create_skill({ name: "Summarize Meetings", description: "Use when summarizing meeting notes or transcripts", body: "Extract decisions, risks, and action items." })
500
+ → { id: "skill_0Ab9ZkLm3Pq7Xy2N", ... }
501
+ 2. read_config() → { configHash: "hash1", config: { ... } }
502
+ 3. patch_config with \`{ baseConfigHash: "hash1", operations: "[{ \\"op\\": \\"add\\", \\"path\\": \\"/skills/-\\", \\"value\\": { \\"type\\": \\"skill\\", \\"id\\": \\"skill_0Ab9ZkLm3Pq7Xy2N\\" } }]" }\`
503
+ 4. Reply: "Done. I added the skill."
504
+
505
+ ### Ambiguous request: "Make it post somewhere"
506
+ 1. ask_question({ question: "Where should the agent post?",
507
+ options: [
508
+ { label: "Slack", value: "slack" },
509
+ { label: "Discord", value: "discord" },
510
+ { label: "Email", value: "email" } ] })
511
+ 2. Continue with the chosen branch (search_nodes → ask_credential → read_config → patch_config).`;
512
+ exports.IMPORTANT_SECTION = `\
513
+ ## Important
514
+
515
+ - Credentials are user-controlled. ALWAYS use ask_llm (for the agent's main
516
+ LLM picker), resolve_llm (for explicit/default main LLM resolution), and
517
+ ask_credential (for every node-tool credential slot).
518
+ Never read credential ids from list_credentials into the config.
519
+ - When you need to clarify an ambiguous user request and the answer is a
520
+ choice from a small set, use ask_question instead of asking in prose.
521
+ - Use search_nodes + get_node_types to discover nodes before adding node tools
522
+ - Prefer workflow tools and node tools over custom tools for real-world interactions
523
+ - n8n session-scoped memory is the default -- always enable it unless told otherwise
524
+ - \`build_custom_tool\` generates an opaque custom tool id, then compiles and stores the tool code. Register the returned id in the config separately by adding a \`{ type: "custom", id }\` entry to \`tools\` via write_config or patch_config
525
+ - \`create_skill\` stores the skill body only. It is not active until you add a \`{ type: "skill", id }\` entry to \`skills\` via read_config and patch_config/write_config.`;
526
+ exports.RESPONSE_STYLE_SECTION = `\
527
+ ## Response style
528
+
529
+ Be concise but informative.
530
+
531
+ - After a build step (write_config, patch_config, build_custom_tool), give a
532
+ 1–2 sentence summary of what you changed and, if useful, one thing the user
533
+ might try next. No field-by-field narration, no JSON repetition, no
534
+ re-stating the user's request back to them.
535
+ - Do not narrate your reasoning before a tool call (no "Let me check the
536
+ credentials first…"). Just do it, then summarise the result.
537
+ - The config and tools speak for themselves — the user can inspect them
538
+ directly, so don't re-list what's visible in the sidebar.`;
539
+ function getConfigRulesSection(builderModel) {
540
+ return `\
541
+ ## Agent config rules
542
+
543
+ - \`model\` must be "provider/model-name" format (e.g. "anthropic/claude-sonnet-4-5")
544
+ - \`credential\` must be the \`credentialName\` returned by a prior resolve_llm or ask_llm tool call. Do not guess.
545
+ - \`memory.storage\` must be "n8n"
546
+ - \`memory.lastMessages\` default: 50
547
+ - Use n8n session-scoped memory for all agents
548
+ - If the agent has no \`model\`/\`credential\` yet, call resolve_llm or ask_llm before defaulting; only fall back to '${builderModel}' as the in-config placeholder string when the user explicitly declines to pick.`;
549
+ }
550
+ function getSchemaReferenceSection() {
551
+ const jsonSchemaText = (0, schema_text_serializer_1.jsonSchemaToCompactText)((0, zod_to_json_schema_1.zodToJsonSchema)(BuilderPromptAgentJsonConfigSchema));
552
+ return `\
553
+ ## Config schema reference
554
+
555
+ \`\`\`
556
+ ${jsonSchemaText}
557
+ \`\`\``;
558
+ }
559
+ function buildBuilderPrompt(ctx) {
560
+ const { configJson, configHash, configUpdatedAt, toolList, builderModel } = ctx;
561
+ return [
562
+ 'You are an expert agent builder. You help users create and configure AI agents by writing raw JSON configuration and building custom tools.',
563
+ getAgentStateSection(configJson, configHash, configUpdatedAt, toolList),
564
+ exports.READ_CONFIG_SECTION,
565
+ exports.CONVERSATION_MODE_SECTION,
566
+ exports.TOOL_TYPES_SECTION,
567
+ exports.LLM_RESOLUTION_SECTION,
568
+ exports.INTERACTIVE_TOOLS_SECTION,
569
+ exports.N8N_EXPRESSIONS_SECTION,
570
+ exports.PROVIDER_TOOLS_SECTION,
571
+ exports.MEMORY_PRESETS_SECTION,
572
+ exports.INTEGRATIONS_SECTION,
573
+ exports.RESEARCH_SECTION,
574
+ getConfigRulesSection(builderModel),
575
+ getSchemaReferenceSection(),
576
+ exports.WORKFLOW_SECTION,
577
+ exports.WRITE_CONFIG_SECTION,
578
+ exports.PATCH_CONFIG_SECTION,
579
+ exports.FEW_SHOT_FLOWS_SECTION,
580
+ exports.IMPORTANT_SECTION,
581
+ exports.RESPONSE_STYLE_SECTION,
582
+ ].join('\n\n');
583
+ }
584
+ //# sourceMappingURL=agents-builder-prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents-builder-prompts.js","sourceRoot":"","sources":["../../../../src/modules/agents/builder/agents-builder-prompts.ts"],"names":[],"mappings":";;;AAqBA,oDAwBC;AA6gBD,sDAUC;AAED,8DAUC;AAcD,gDAyBC;AAtnBD,6BAAwB;AACxB,2DAAqD;AAErD,wEAAyE;AACzE,kFAAgF;AAEhF,MAAM,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAEH,MAAM,kCAAkC,GAAG,yCAAqB,CAAC,MAAM,CAAC;IACvE,MAAM,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAMH,SAAgB,oBAAoB,CACnC,UAAkB,EAClB,UAAyB,EACzB,eAA8B,EAC9B,QAAgB;IAEhB,OAAO;;;gBAGQ,UAAU,IAAI,MAAM;eACrB,eAAe,IAAI,MAAM;;;EAGtC,UAAU;;;;;;;;;;EAUV,QAAQ,EAAE,CAAC;AACb,CAAC;AAMY,QAAA,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAkG4B,CAAC;AAElD,QAAA,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CA+CC,CAAC;AAE9B,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEA0C+B,CAAC;AAEzD,QAAA,uBAAuB,GAAG;;;;;;;;;;;;uFAYgD,CAAC;AAE3E,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;OAoB/B,CAAC;AAEK,QAAA,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;oEAkB2B,CAAC;AAExD,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;kEAckC,CAAC;AAEtD,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;+EAcyC,CAAC;AAEnE,QAAA,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA2BwC,CAAC;AAEhE,QAAA,oBAAoB,GAAG;;;;;;;;;;;;;;;;;yCAiBK,CAAC;AAE7B,QAAA,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wKA6CoI,CAAC;AAE5J,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;0DAkBuB,CAAC;AAE9C,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;mFAoBmD,CAAC;AAEvE,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iGAkE2D,CAAC;AAErF,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;6KAa4I,CAAC;AAEjK,QAAA,sBAAsB,GAAG;;;;;;;;;;;;4DAYsB,CAAC;AAM7D,SAAgB,qBAAqB,CAAC,YAAoB;IACzD,OAAO;;;;;;;;wHAQgH,YAAY,kFAAkF,CAAC;AACvN,CAAC;AAED,SAAgB,yBAAyB;IACxC,MAAM,cAAc,GAAG,IAAA,gDAAuB,EAC7C,IAAA,oCAAe,EAAC,kCAAkC,CAAgB,CAClE,CAAC;IACF,OAAO;;;;EAIN,cAAc;OACT,CAAC;AACR,CAAC;AAcD,SAAgB,kBAAkB,CAAC,GAAyB;IAC3D,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,GAAG,CAAC;IAEhF,OAAO;QACN,6IAA6I;QAC7I,oBAAoB,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,CAAC;QACvE,2BAAmB;QACnB,iCAAyB;QACzB,0BAAkB;QAClB,8BAAsB;QACtB,iCAAyB;QACzB,+BAAuB;QACvB,8BAAsB;QACtB,8BAAsB;QACtB,4BAAoB;QACpB,wBAAgB;QAChB,qBAAqB,CAAC,YAAY,CAAC;QACnC,yBAAyB,EAAE;QAC3B,wBAAgB;QAChB,4BAAoB;QACpB,4BAAoB;QACpB,8BAAsB;QACtB,yBAAiB;QACjB,8BAAsB;KACtB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type AgentBuilderAdminSettingsResponse, type AgentBuilderStatusResponse } from '@n8n/api-types';
2
+ import { AuthenticatedRequest } from '@n8n/db';
3
+ import type { Response } from 'express';
4
+ import { AgentsBuilderSettingsService } from './agents-builder-settings.service';
5
+ export declare class AgentsBuilderSettingsController {
6
+ private readonly settingsService;
7
+ constructor(settingsService: AgentsBuilderSettingsService);
8
+ getAdminSettings(_req: AuthenticatedRequest): Promise<AgentBuilderAdminSettingsResponse>;
9
+ updateAdminSettings(req: AuthenticatedRequest, _res: Response): Promise<AgentBuilderAdminSettingsResponse>;
10
+ getStatus(): Promise<AgentBuilderStatusResponse>;
11
+ }
@@ -0,0 +1,61 @@
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.AgentsBuilderSettingsController = void 0;
13
+ const api_types_1 = require("@n8n/api-types");
14
+ const decorators_1 = require("@n8n/decorators");
15
+ const bad_request_error_1 = require("../../../errors/response-errors/bad-request.error");
16
+ const agents_builder_settings_service_1 = require("./agents-builder-settings.service");
17
+ let AgentsBuilderSettingsController = class AgentsBuilderSettingsController {
18
+ constructor(settingsService) {
19
+ this.settingsService = settingsService;
20
+ }
21
+ async getAdminSettings(_req) {
22
+ return await this.settingsService.getAdminSettings();
23
+ }
24
+ async updateAdminSettings(req, _res) {
25
+ const parseResult = api_types_1.AgentBuilderAdminSettingsUpdateDto.safeParse(req.body);
26
+ if (!parseResult.success) {
27
+ throw new bad_request_error_1.BadRequestError(parseResult.error.errors[0]?.message ?? 'Invalid request body');
28
+ }
29
+ await this.settingsService.updateAdminSettings(parseResult.data);
30
+ return await this.settingsService.getAdminSettings();
31
+ }
32
+ async getStatus() {
33
+ return await this.settingsService.getStatus();
34
+ }
35
+ };
36
+ exports.AgentsBuilderSettingsController = AgentsBuilderSettingsController;
37
+ __decorate([
38
+ (0, decorators_1.Get)('/settings'),
39
+ (0, decorators_1.GlobalScope)('agent:manage'),
40
+ __metadata("design:type", Function),
41
+ __metadata("design:paramtypes", [Object]),
42
+ __metadata("design:returntype", Promise)
43
+ ], AgentsBuilderSettingsController.prototype, "getAdminSettings", null);
44
+ __decorate([
45
+ (0, decorators_1.Patch)('/settings'),
46
+ (0, decorators_1.GlobalScope)('agent:manage'),
47
+ __metadata("design:type", Function),
48
+ __metadata("design:paramtypes", [Object, Object]),
49
+ __metadata("design:returntype", Promise)
50
+ ], AgentsBuilderSettingsController.prototype, "updateAdminSettings", null);
51
+ __decorate([
52
+ (0, decorators_1.Get)('/status'),
53
+ __metadata("design:type", Function),
54
+ __metadata("design:paramtypes", []),
55
+ __metadata("design:returntype", Promise)
56
+ ], AgentsBuilderSettingsController.prototype, "getStatus", null);
57
+ exports.AgentsBuilderSettingsController = AgentsBuilderSettingsController = __decorate([
58
+ (0, decorators_1.RestController)('/agent-builder'),
59
+ __metadata("design:paramtypes", [agents_builder_settings_service_1.AgentsBuilderSettingsService])
60
+ ], AgentsBuilderSettingsController);
61
+ //# sourceMappingURL=agents-builder-settings.controller.js.map