n8n 2.30.3 → 2.31.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 (532) hide show
  1. package/dist/agent-library-bundle.js +9 -0
  2. package/dist/blob-storage/azure-byte-store.ee.d.ts +1 -1
  3. package/dist/blob-storage/azure-byte-store.ee.js +3 -18
  4. package/dist/blob-storage/azure-byte-store.ee.js.map +1 -1
  5. package/dist/blob-storage/json-store.js +3 -0
  6. package/dist/blob-storage/json-store.js.map +1 -1
  7. package/dist/blob-storage/s3-byte-store.ee.d.ts +1 -1
  8. package/dist/blob-storage/s3-byte-store.ee.js +2 -17
  9. package/dist/blob-storage/s3-byte-store.ee.js.map +1 -1
  10. package/dist/build.tsbuildinfo +1 -1
  11. package/dist/commands/base-command.d.ts +2 -2
  12. package/dist/commands/base-command.js +5 -5
  13. package/dist/commands/base-command.js.map +1 -1
  14. package/dist/commands/start.js +2 -0
  15. package/dist/commands/start.js.map +1 -1
  16. package/dist/constants/workflow-reviews.d.ts +4 -0
  17. package/dist/constants/workflow-reviews.js +14 -0
  18. package/dist/constants/workflow-reviews.js.map +1 -0
  19. package/dist/constants.js +2 -0
  20. package/dist/constants.js.map +1 -1
  21. package/dist/controllers/e2e.controller.js +1 -0
  22. package/dist/controllers/e2e.controller.js.map +1 -1
  23. package/dist/controllers/security-settings.controller.d.ts +15 -10
  24. package/dist/controllers/security-settings.controller.js +41 -65
  25. package/dist/controllers/security-settings.controller.js.map +1 -1
  26. package/dist/controllers/users.controller.d.ts +2 -2
  27. package/dist/credentials/credential-connection-status-provider.interface.d.ts +2 -1
  28. package/dist/credentials/credential-connection-status-proxy.d.ts +2 -1
  29. package/dist/credentials/credential-connection-status-proxy.js +7 -2
  30. package/dist/credentials/credential-connection-status-proxy.js.map +1 -1
  31. package/dist/credentials/credentials.controller.js +5 -5
  32. package/dist/credentials/credentials.controller.js.map +1 -1
  33. package/dist/credentials/credentials.service.d.ts +1 -0
  34. package/dist/credentials/credentials.service.ee.d.ts +3 -1
  35. package/dist/credentials/credentials.service.ee.js +10 -2
  36. package/dist/credentials/credentials.service.ee.js.map +1 -1
  37. package/dist/credentials/credentials.service.js +14 -0
  38. package/dist/credentials/credentials.service.js.map +1 -1
  39. package/dist/eventbus/event-message-classes/index.d.ts +2 -2
  40. package/dist/eventbus/event-message-classes/index.js +4 -2
  41. package/dist/eventbus/event-message-classes/index.js.map +1 -1
  42. package/dist/events/maps/relay.event-map.d.ts +19 -2
  43. package/dist/events/relays/log-streaming.event-relay.d.ts +2 -0
  44. package/dist/events/relays/log-streaming.event-relay.js +30 -2
  45. package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
  46. package/dist/events/relays/telemetry.event-relay.d.ts +3 -0
  47. package/dist/events/relays/telemetry.event-relay.js +88 -10
  48. package/dist/events/relays/telemetry.event-relay.js.map +1 -1
  49. package/dist/execution-lifecycle/execution-lifecycle-hooks.js +21 -4
  50. package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
  51. package/dist/executions/execution-data/db-store.d.ts +8 -15
  52. package/dist/executions/execution-data/db-store.js +12 -25
  53. package/dist/executions/execution-data/db-store.js.map +1 -1
  54. package/dist/executions/execution-data/execution-data-json-store.d.ts +7 -0
  55. package/dist/executions/execution-data/execution-data-json-store.js +45 -0
  56. package/dist/executions/execution-data/execution-data-json-store.js.map +1 -0
  57. package/dist/executions/execution-data/types.d.ts +3 -14
  58. package/dist/executions/execution-data/types.js.map +1 -1
  59. package/dist/executions/execution-persistence.d.ts +7 -14
  60. package/dist/executions/execution-persistence.js +40 -88
  61. package/dist/executions/execution-persistence.js.map +1 -1
  62. package/dist/executions/execution.service.d.ts +3 -4
  63. package/dist/executions/execution.service.js +4 -13
  64. package/dist/executions/execution.service.js.map +1 -1
  65. package/dist/executions/executions.controller.js +1 -10
  66. package/dist/executions/executions.controller.js.map +1 -1
  67. package/dist/interfaces.d.ts +4 -1
  68. package/dist/load-nodes-and-credentials.js +1 -1
  69. package/dist/load-nodes-and-credentials.js.map +1 -1
  70. package/dist/metrics/prometheus/prometheus.service.d.ts +2 -1
  71. package/dist/metrics/prometheus/prometheus.service.js +5 -2
  72. package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
  73. package/dist/metrics/prometheus/scheduler-metrics.service.d.ts +35 -0
  74. package/dist/metrics/prometheus/scheduler-metrics.service.js +187 -0
  75. package/dist/metrics/prometheus/scheduler-metrics.service.js.map +1 -0
  76. package/dist/modules/agents/adapters/agents-credential-provider.d.ts +1 -0
  77. package/dist/modules/agents/adapters/agents-credential-provider.js +13 -3
  78. package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
  79. package/dist/modules/agents/agent-config.service.js +11 -1
  80. package/dist/modules/agents/agent-config.service.js.map +1 -1
  81. package/dist/modules/agents/agent-knowledge.controller.js +1 -1
  82. package/dist/modules/agents/agent-knowledge.controller.js.map +1 -1
  83. package/dist/modules/agents/agent-upload.middleware.d.ts +2 -0
  84. package/dist/modules/agents/agent-upload.middleware.js +11 -0
  85. package/dist/modules/agents/agent-upload.middleware.js.map +1 -1
  86. package/dist/modules/agents/agent-validation.service.js +19 -2
  87. package/dist/modules/agents/agent-validation.service.js.map +1 -1
  88. package/dist/modules/agents/agent-vector-stores.controller.d.ts +11 -0
  89. package/dist/modules/agents/agent-vector-stores.controller.js +41 -0
  90. package/dist/modules/agents/agent-vector-stores.controller.js.map +1 -0
  91. package/dist/modules/agents/agent-vector-stores.service.d.ts +9 -0
  92. package/dist/modules/agents/agent-vector-stores.service.js +195 -0
  93. package/dist/modules/agents/agent-vector-stores.service.js.map +1 -0
  94. package/dist/modules/agents/agents-config.controller.d.ts +112 -69
  95. package/dist/modules/agents/agents.controller.d.ts +5 -1
  96. package/dist/modules/agents/agents.controller.js +11 -0
  97. package/dist/modules/agents/agents.controller.js.map +1 -1
  98. package/dist/modules/agents/agents.module.js +1 -0
  99. package/dist/modules/agents/agents.module.js.map +1 -1
  100. package/dist/modules/agents/agents.service.d.ts +7 -2
  101. package/dist/modules/agents/agents.service.js +65 -2
  102. package/dist/modules/agents/agents.service.js.map +1 -1
  103. package/dist/modules/agents/attachable-workflows.service.d.ts +12 -0
  104. package/dist/modules/agents/attachable-workflows.service.js +58 -0
  105. package/dist/modules/agents/attachable-workflows.service.js.map +1 -0
  106. package/dist/modules/agents/builder/agents-builder-model-recommendations.js +3 -2
  107. package/dist/modules/agents/builder/agents-builder-model-recommendations.js.map +1 -1
  108. package/dist/modules/agents/builder/agents-builder-prompts.d.ts +4 -4
  109. package/dist/modules/agents/builder/agents-builder-prompts.js +40 -27
  110. package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
  111. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +3 -5
  112. package/dist/modules/agents/builder/agents-builder-tools.service.js +48 -194
  113. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  114. package/dist/modules/agents/builder/agents-builder.service.d.ts +10 -3
  115. package/dist/modules/agents/builder/agents-builder.service.js +22 -12
  116. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  117. package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
  118. package/dist/modules/agents/builder/errors.d.ts +3 -2
  119. package/dist/modules/agents/builder/errors.js +3 -2
  120. package/dist/modules/agents/builder/errors.js.map +1 -1
  121. package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +99 -2
  122. package/dist/modules/agents/builder/get-resource-locator-options.tool.js +103 -101
  123. package/dist/modules/agents/builder/get-resource-locator-options.tool.js.map +1 -1
  124. package/dist/modules/agents/builder/interactive/ask-credential.tool.js +48 -32
  125. package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
  126. package/dist/modules/agents/builder/interactive/ask-questions.tool.d.ts +2 -0
  127. package/dist/modules/agents/builder/interactive/ask-questions.tool.js +108 -0
  128. package/dist/modules/agents/builder/interactive/ask-questions.tool.js.map +1 -0
  129. package/dist/modules/agents/builder/interactive/configure-channel.tool.d.ts +7 -0
  130. package/dist/modules/agents/builder/interactive/configure-channel.tool.js +52 -0
  131. package/dist/modules/agents/builder/interactive/configure-channel.tool.js.map +1 -0
  132. package/dist/modules/agents/builder/interactive/index.d.ts +2 -2
  133. package/dist/modules/agents/builder/interactive/index.js +5 -5
  134. package/dist/modules/agents/builder/interactive/index.js.map +1 -1
  135. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +2 -2
  136. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  137. package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +1 -1
  138. package/dist/modules/agents/builder/prompts/config-rules.prompt.js +2 -2
  139. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +10 -10
  140. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
  141. package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -1
  142. package/dist/modules/agents/builder/prompts/memory.prompt.js +1 -1
  143. package/dist/modules/agents/builder/search-mcp-servers.tool.js +1 -63
  144. package/dist/modules/agents/builder/search-mcp-servers.tool.js.map +1 -1
  145. package/dist/modules/agents/builder/skills/index.d.ts +1 -1
  146. package/dist/modules/agents/builder/skills/index.js +5 -1
  147. package/dist/modules/agents/builder/skills/index.js.map +1 -1
  148. package/dist/modules/agents/builder/skills/integrations.skill.js +15 -6
  149. package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -1
  150. package/dist/modules/agents/builder/skills/mcp.skill.js +2 -2
  151. package/dist/modules/agents/builder/skills/mcp.skill.js.map +1 -1
  152. package/dist/modules/agents/builder/skills/resource-locators.skill.js +2 -2
  153. package/dist/modules/agents/builder/skills/resource-locators.skill.js.map +1 -1
  154. package/dist/modules/agents/builder/skills/sub-agents.skill.js +7 -5
  155. package/dist/modules/agents/builder/skills/sub-agents.skill.js.map +1 -1
  156. package/dist/modules/agents/builder/skills/target-skills.skill.js +5 -4
  157. package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
  158. package/dist/modules/agents/builder/skills/target-tasks.skill.js +5 -5
  159. package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
  160. package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +14 -0
  161. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +96 -0
  162. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -0
  163. package/dist/modules/agents/integrations/integration-action-executor.d.ts +72 -72
  164. package/dist/modules/agents/integrations/integration-tool-definitions.d.ts +574 -574
  165. package/dist/modules/agents/json-config/embedding-credential.d.ts +4 -0
  166. package/dist/modules/agents/json-config/embedding-credential.js +25 -0
  167. package/dist/modules/agents/json-config/embedding-credential.js.map +1 -0
  168. package/dist/modules/agents/json-config/from-json-config.d.ts +2 -6
  169. package/dist/modules/agents/json-config/from-json-config.js +16 -16
  170. package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
  171. package/dist/modules/agents/json-config/model-config.js +2 -2
  172. package/dist/modules/agents/json-config/model-config.js.map +1 -1
  173. package/dist/modules/agents/json-config/vector-store-factory.d.ts +5 -0
  174. package/dist/modules/agents/json-config/vector-store-factory.js +138 -0
  175. package/dist/modules/agents/json-config/vector-store-factory.js.map +1 -0
  176. package/dist/modules/breaking-changes/rules/index.d.ts +8 -0
  177. package/dist/modules/breaking-changes/rules/index.js +8 -0
  178. package/dist/modules/breaking-changes/rules/index.js.map +1 -1
  179. package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.d.ts +6 -0
  180. package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js +59 -0
  181. package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js.map +1 -0
  182. package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.d.ts +9 -0
  183. package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.js +57 -0
  184. package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.js.map +1 -0
  185. package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.d.ts +10 -0
  186. package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.js +53 -0
  187. package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.js.map +1 -0
  188. package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.d.ts +9 -0
  189. package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.js +56 -0
  190. package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.js.map +1 -0
  191. package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.d.ts +9 -0
  192. package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.js +57 -0
  193. package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.js.map +1 -0
  194. package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.d.ts +6 -0
  195. package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js +50 -0
  196. package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js.map +1 -0
  197. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.d.ts +9 -0
  198. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js +57 -0
  199. package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js.map +1 -0
  200. package/dist/modules/breaking-changes/rules/v3/workflow-import-url-removed.rule.d.ts +6 -0
  201. package/dist/modules/breaking-changes/rules/v3/workflow-import-url-removed.rule.js +47 -0
  202. package/dist/modules/breaking-changes/rules/v3/workflow-import-url-removed.rule.js.map +1 -0
  203. package/dist/modules/chat-hub/chat-hub.module.d.ts +1 -1
  204. package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +3 -3
  205. package/dist/modules/data-table/data-table-ddl.service.d.ts +2 -0
  206. package/dist/modules/data-table/data-table-ddl.service.js +16 -0
  207. package/dist/modules/data-table/data-table-ddl.service.js.map +1 -1
  208. package/dist/modules/data-table/data-table.service.d.ts +6 -3
  209. package/dist/modules/data-table/data-table.service.js +19 -0
  210. package/dist/modules/data-table/data-table.service.js.map +1 -1
  211. package/dist/modules/data-table/utils/sql-utils.d.ts +1 -0
  212. package/dist/modules/data-table/utils/sql-utils.js +4 -0
  213. package/dist/modules/data-table/utils/sql-utils.js.map +1 -1
  214. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.d.ts +0 -2
  215. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js +0 -13
  216. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.module.js.map +1 -1
  217. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +5 -3
  218. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +19 -7
  219. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
  220. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +1 -1
  221. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +1 -1
  222. package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
  223. package/dist/modules/favorites/dto/add-favorite.dto.d.ts +2 -2
  224. package/dist/modules/favorites/favorites.event-relay.js +2 -3
  225. package/dist/modules/favorites/favorites.event-relay.js.map +1 -1
  226. package/dist/modules/favorites/favorites.service.d.ts +4 -1
  227. package/dist/modules/favorites/favorites.service.js +28 -3
  228. package/dist/modules/favorites/favorites.service.js.map +1 -1
  229. package/dist/modules/instance-ai/eval/execution.service.d.ts +4 -1
  230. package/dist/modules/instance-ai/eval/execution.service.js +26 -3
  231. package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
  232. package/dist/modules/instance-ai/eval/mock-handler.js +1 -1
  233. package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
  234. package/dist/modules/instance-ai/eval/mock-quirks.js +7 -0
  235. package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
  236. package/dist/modules/instance-ai/eval/pin-data-generator.js +17 -17
  237. package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -1
  238. package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +17 -6
  239. package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +153 -30
  240. package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -1
  241. package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +7 -2
  242. package/dist/modules/instance-ai/instance-ai-memory.service.js +12 -1
  243. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  244. package/dist/modules/instance-ai/instance-ai-settings.service.js +0 -7
  245. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  246. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +89 -3
  247. package/dist/modules/instance-ai/instance-ai.adapter.service.js +272 -42
  248. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  249. package/dist/modules/instance-ai/instance-ai.controller.js +9 -2
  250. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  251. package/dist/modules/instance-ai/instance-ai.service.d.ts +0 -1
  252. package/dist/modules/instance-ai/instance-ai.service.js +45 -107
  253. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  254. package/dist/modules/instance-ai/workflow-templates.service.d.ts +17 -0
  255. package/dist/modules/instance-ai/workflow-templates.service.js +63 -0
  256. package/dist/modules/instance-ai/workflow-templates.service.js.map +1 -0
  257. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination.ee.d.ts +1 -0
  258. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination.ee.js +2 -0
  259. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination.ee.js.map +1 -1
  260. package/dist/modules/mcp/dto/update-workflows-availability.dto.d.ts +2 -0
  261. package/dist/modules/mcp/dto/update-workflows-availability.dto.js +1 -0
  262. package/dist/modules/mcp/dto/update-workflows-availability.dto.js.map +1 -1
  263. package/dist/modules/mcp/mcp-protected-resource.d.ts +4 -1
  264. package/dist/modules/mcp/mcp-protected-resource.js +13 -3
  265. package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
  266. package/dist/modules/mcp/mcp.config.d.ts +1 -0
  267. package/dist/modules/mcp/mcp.config.js +20 -0
  268. package/dist/modules/mcp/mcp.config.js.map +1 -1
  269. package/dist/modules/mcp/mcp.module.d.ts +1 -0
  270. package/dist/modules/mcp/mcp.module.js +3 -1
  271. package/dist/modules/mcp/mcp.module.js.map +1 -1
  272. package/dist/modules/mcp/mcp.settings.service.d.ts +1 -1
  273. package/dist/modules/mcp/mcp.settings.service.js +33 -18
  274. package/dist/modules/mcp/mcp.settings.service.js.map +1 -1
  275. package/dist/modules/mcp/tools/search-workflows.tool.js +4 -2
  276. package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
  277. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +2 -0
  278. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +10 -5
  279. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  280. package/dist/modules/mcp/tools/workflow-builder/restore-workflow-version.tool.js +4 -0
  281. package/dist/modules/mcp/tools/workflow-builder/restore-workflow-version.tool.js.map +1 -1
  282. package/dist/modules/mcp/tools/workflow-builder/skills-used.d.ts +1 -0
  283. package/dist/modules/mcp/tools/workflow-builder/skills-used.js +5 -1
  284. package/dist/modules/mcp/tools/workflow-builder/skills-used.js.map +1 -1
  285. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +10 -5
  286. package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
  287. package/dist/modules/mcp/tools/workflow-builder/version-metadata.d.ts +27 -0
  288. package/dist/modules/mcp/tools/workflow-builder/version-metadata.js +109 -0
  289. package/dist/modules/mcp/tools/workflow-builder/version-metadata.js.map +1 -0
  290. package/dist/modules/mcp-registry/registry/mcp-registry-search.d.ts +18 -0
  291. package/dist/modules/mcp-registry/registry/mcp-registry-search.js +64 -0
  292. package/dist/modules/mcp-registry/registry/mcp-registry-search.js.map +1 -0
  293. package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +2 -0
  294. package/dist/modules/mcp-registry/registry/mcp-registry.service.js +4 -0
  295. package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
  296. package/dist/modules/n8n-packages/engine/import-blocked.error.js +2 -1
  297. package/dist/modules/n8n-packages/engine/import-blocked.error.js.map +1 -1
  298. package/dist/modules/n8n-packages/engine/import-orchestrator.d.ts +30 -0
  299. package/dist/modules/n8n-packages/engine/import-orchestrator.js +86 -0
  300. package/dist/modules/n8n-packages/engine/import-orchestrator.js.map +1 -0
  301. package/dist/modules/n8n-packages/engine/import-result.d.ts +14 -0
  302. package/dist/modules/n8n-packages/engine/import-result.js +43 -0
  303. package/dist/modules/n8n-packages/engine/import-result.js.map +1 -0
  304. package/dist/modules/n8n-packages/engine/n8n-package-parser.d.ts +7 -0
  305. package/dist/modules/n8n-packages/engine/n8n-package-parser.js +72 -13
  306. package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
  307. package/dist/modules/n8n-packages/engine/package-layout.d.ts +11 -0
  308. package/dist/modules/n8n-packages/engine/package-layout.js +21 -0
  309. package/dist/modules/n8n-packages/engine/package-layout.js.map +1 -0
  310. package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +11 -0
  311. package/dist/modules/n8n-packages/engine/project-package-importer.js +44 -0
  312. package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -0
  313. package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +24 -0
  314. package/dist/modules/n8n-packages/engine/workflow-package-importer.js +168 -0
  315. package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -0
  316. package/dist/modules/n8n-packages/entities/credential/credential-matcher-factory.d.ts +3 -1
  317. package/dist/modules/n8n-packages/entities/credential/credential-matcher-factory.js +8 -2
  318. package/dist/modules/n8n-packages/entities/credential/credential-matcher-factory.js.map +1 -1
  319. package/dist/modules/n8n-packages/entities/credential/credential-matcher.d.ts +6 -6
  320. package/dist/modules/n8n-packages/entities/credential/credential-matcher.js +34 -4
  321. package/dist/modules/n8n-packages/entities/credential/credential-matcher.js.map +1 -1
  322. package/dist/modules/n8n-packages/entities/credential/credential-tier-selection.d.ts +3 -0
  323. package/dist/modules/n8n-packages/entities/credential/credential-tier-selection.js +27 -0
  324. package/dist/modules/n8n-packages/entities/credential/credential-tier-selection.js.map +1 -0
  325. package/dist/modules/n8n-packages/entities/credential/credential.exporter.d.ts +2 -0
  326. package/dist/modules/n8n-packages/entities/credential/credential.exporter.js +18 -2
  327. package/dist/modules/n8n-packages/entities/credential/credential.exporter.js.map +1 -1
  328. package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.d.ts +3 -7
  329. package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js +8 -23
  330. package/dist/modules/n8n-packages/entities/credential/id-based-credential-matcher.js.map +1 -1
  331. package/dist/modules/n8n-packages/entities/credential/name-and-type-credential-matcher.d.ts +8 -0
  332. package/dist/modules/n8n-packages/entities/credential/name-and-type-credential-matcher.js +31 -0
  333. package/dist/modules/n8n-packages/entities/credential/name-and-type-credential-matcher.js.map +1 -0
  334. package/dist/modules/n8n-packages/entities/credential/type-only-credential-matcher.d.ts +8 -0
  335. package/dist/modules/n8n-packages/entities/credential/type-only-credential-matcher.js +31 -0
  336. package/dist/modules/n8n-packages/entities/credential/type-only-credential-matcher.js.map +1 -0
  337. package/dist/modules/n8n-packages/entities/data-table/data-table-requirements.extractor.d.ts +6 -0
  338. package/dist/modules/n8n-packages/entities/data-table/data-table-requirements.extractor.js +38 -0
  339. package/dist/modules/n8n-packages/entities/data-table/data-table-requirements.extractor.js.map +1 -0
  340. package/dist/modules/n8n-packages/entities/data-table/data-table.exporter.d.ts +26 -0
  341. package/dist/modules/n8n-packages/entities/data-table/data-table.exporter.js +97 -0
  342. package/dist/modules/n8n-packages/entities/data-table/data-table.exporter.js.map +1 -0
  343. package/dist/modules/n8n-packages/entities/data-table/data-table.serializer.d.ts +5 -0
  344. package/dist/modules/n8n-packages/entities/data-table/data-table.serializer.js +31 -0
  345. package/dist/modules/n8n-packages/entities/data-table/data-table.serializer.js.map +1 -0
  346. package/dist/modules/n8n-packages/entities/data-table/data-table.types.d.ts +4 -0
  347. package/dist/modules/n8n-packages/entities/data-table/data-table.types.js +3 -0
  348. package/dist/modules/n8n-packages/entities/data-table/data-table.types.js.map +1 -0
  349. package/dist/modules/n8n-packages/entities/folder/folder-conflict-policy.d.ts +5 -0
  350. package/dist/modules/n8n-packages/entities/folder/folder-conflict-policy.js +11 -0
  351. package/dist/modules/n8n-packages/entities/folder/folder-conflict-policy.js.map +1 -0
  352. package/dist/modules/n8n-packages/entities/folder/folder-import.types.d.ts +20 -0
  353. package/dist/modules/n8n-packages/entities/folder/folder-import.types.js +3 -0
  354. package/dist/modules/n8n-packages/entities/folder/folder-import.types.js.map +1 -0
  355. package/dist/modules/n8n-packages/entities/folder/folder-importer.d.ts +10 -0
  356. package/dist/modules/n8n-packages/entities/folder/folder-importer.js +140 -0
  357. package/dist/modules/n8n-packages/entities/folder/folder-importer.js.map +1 -0
  358. package/dist/modules/n8n-packages/entities/folder/folder.exporter.d.ts +5 -2
  359. package/dist/modules/n8n-packages/entities/folder/folder.exporter.js +48 -44
  360. package/dist/modules/n8n-packages/entities/folder/folder.exporter.js.map +1 -1
  361. package/dist/modules/n8n-packages/entities/folder/folder.serializer.js.map +1 -1
  362. package/dist/modules/n8n-packages/entities/package-export.errors.d.ts +8 -0
  363. package/dist/modules/n8n-packages/entities/package-export.errors.js +27 -0
  364. package/dist/modules/n8n-packages/entities/package-export.errors.js.map +1 -0
  365. package/dist/modules/n8n-packages/entities/project/project-import.types.d.ts +15 -0
  366. package/dist/modules/n8n-packages/entities/project/project-import.types.js +3 -0
  367. package/dist/modules/n8n-packages/entities/project/project-import.types.js.map +1 -0
  368. package/dist/modules/n8n-packages/entities/project/project-importer.d.ts +13 -0
  369. package/dist/modules/n8n-packages/entities/project/project-importer.js +97 -0
  370. package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -0
  371. package/dist/modules/n8n-packages/entities/project/project.exporter.d.ts +22 -4
  372. package/dist/modules/n8n-packages/entities/project/project.exporter.js +71 -26
  373. package/dist/modules/n8n-packages/entities/project/project.exporter.js.map +1 -1
  374. package/dist/modules/n8n-packages/entities/requirements.types.d.ts +2 -0
  375. package/dist/modules/n8n-packages/entities/requirements.types.js +1 -0
  376. package/dist/modules/n8n-packages/entities/requirements.types.js.map +1 -1
  377. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +4 -3
  378. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +11 -17
  379. package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
  380. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +12 -3
  381. package/dist/modules/n8n-packages/n8n-packages.service.js +51 -11
  382. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
  383. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +47 -22
  384. package/dist/modules/n8n-packages/n8n-packages.types.js +5 -1
  385. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  386. package/dist/modules/n8n-packages/package-failure-classifier.d.ts +2 -0
  387. package/dist/modules/n8n-packages/package-failure-classifier.js +29 -0
  388. package/dist/modules/n8n-packages/package-failure-classifier.js.map +1 -0
  389. package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +62 -0
  390. package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +55 -0
  391. package/dist/modules/n8n-packages/spec/requirements.schema.js +26 -15
  392. package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -1
  393. package/dist/modules/n8n-packages/spec/serialized/data-table.schema.d.ts +49 -0
  394. package/dist/modules/n8n-packages/spec/serialized/data-table.schema.js +20 -0
  395. package/dist/modules/n8n-packages/spec/serialized/data-table.schema.js.map +1 -0
  396. package/dist/modules/redaction/executions/execution-redaction.service.js +1 -1
  397. package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
  398. package/dist/modules/source-control.ee/constants.d.ts +1 -0
  399. package/dist/modules/source-control.ee/constants.js +2 -1
  400. package/dist/modules/source-control.ee/constants.js.map +1 -1
  401. package/dist/modules/source-control.ee/source-control-git.service.ee.d.ts +0 -1
  402. package/dist/modules/source-control.ee/source-control-git.service.ee.js +0 -22
  403. package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
  404. package/dist/modules/source-control.ee/source-control-helper.ee.d.ts +3 -1
  405. package/dist/modules/source-control.ee/source-control-helper.ee.js +13 -0
  406. package/dist/modules/source-control.ee/source-control-helper.ee.js.map +1 -1
  407. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +10 -2
  408. package/dist/modules/source-control.ee/source-control-import.service.ee.js +94 -59
  409. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  410. package/dist/modules/source-control.ee/source-control-status.service.ee.d.ts +0 -1
  411. package/dist/modules/source-control.ee/source-control-status.service.ee.js +30 -30
  412. package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
  413. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +6 -6
  414. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +3 -3
  415. package/dist/modules/source-control.ee/source-control.service.ee.js +8 -1
  416. package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
  417. package/dist/public-api/types.d.ts +5 -1
  418. package/dist/public-api/v1/handlers/credentials/credentials.handler.js +9 -0
  419. package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
  420. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +87 -38
  421. package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
  422. package/dist/public-api/v1/handlers/security-policy/security-policy.handler.d.ts +8 -0
  423. package/dist/public-api/v1/handlers/security-policy/security-policy.handler.js +39 -0
  424. package/dist/public-api/v1/handlers/security-policy/security-policy.handler.js.map +1 -0
  425. package/dist/public-api/v1/openapi.yml +243 -12
  426. package/dist/scaling/job-processor.js +44 -6
  427. package/dist/scaling/job-processor.js.map +1 -1
  428. package/dist/scaling/pubsub/pubsub.event-map.d.ts +4 -1
  429. package/dist/scheduling/durable-job-provisioner.d.ts +16 -0
  430. package/dist/scheduling/durable-job-provisioner.js +135 -0
  431. package/dist/scheduling/durable-job-provisioner.js.map +1 -0
  432. package/dist/scheduling/durable-scheduler.d.ts +16 -0
  433. package/dist/scheduling/durable-scheduler.js +117 -0
  434. package/dist/scheduling/durable-scheduler.js.map +1 -0
  435. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task-handler.d.ts +23 -0
  436. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task-handler.js +149 -0
  437. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task-handler.js.map +1 -0
  438. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.d.ts +10 -0
  439. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.js +33 -0
  440. package/dist/scheduling/schedule-trigger-node/schedule-trigger-task.js.map +1 -0
  441. package/dist/scheduling/scheduler-tracer.d.ts +3 -0
  442. package/dist/scheduling/scheduler-tracer.js +11 -0
  443. package/dist/scheduling/scheduler-tracer.js.map +1 -0
  444. package/dist/server.js +6 -1
  445. package/dist/server.js.map +1 -1
  446. package/dist/services/folder-finder.service.d.ts +2 -0
  447. package/dist/services/folder-finder.service.js +16 -0
  448. package/dist/services/folder-finder.service.js.map +1 -1
  449. package/dist/services/folder.service.d.ts +3 -2
  450. package/dist/services/folder.service.js +11 -1
  451. package/dist/services/folder.service.js.map +1 -1
  452. package/dist/services/frontend.service.d.ts +3 -1
  453. package/dist/services/frontend.service.js +14 -2
  454. package/dist/services/frontend.service.js.map +1 -1
  455. package/dist/services/project.service.ee.d.ts +7 -1
  456. package/dist/services/project.service.ee.js +21 -4
  457. package/dist/services/project.service.ee.js.map +1 -1
  458. package/dist/services/protected-resource.registry.d.ts +1 -0
  459. package/dist/services/protected-resource.registry.js +11 -7
  460. package/dist/services/protected-resource.registry.js.map +1 -1
  461. package/dist/services/security-settings.service.d.ts +31 -1
  462. package/dist/services/security-settings.service.js +75 -2
  463. package/dist/services/security-settings.service.js.map +1 -1
  464. package/dist/services/workflow-review-policy.service.d.ts +11 -0
  465. package/dist/services/workflow-review-policy.service.js +52 -0
  466. package/dist/services/workflow-review-policy.service.js.map +1 -0
  467. package/dist/telemetry/index.d.ts +2 -0
  468. package/dist/telemetry/index.js +6 -3
  469. package/dist/telemetry/index.js.map +1 -1
  470. package/dist/webhooks/live-webhooks.js +2 -2
  471. package/dist/webhooks/live-webhooks.js.map +1 -1
  472. package/dist/webhooks/test-webhooks.js +4 -1
  473. package/dist/webhooks/test-webhooks.js.map +1 -1
  474. package/dist/webhooks/waiting-webhooks.js +2 -2
  475. package/dist/webhooks/waiting-webhooks.js.map +1 -1
  476. package/dist/workflow-execute-additional-data.js +5 -4
  477. package/dist/workflow-execute-additional-data.js.map +1 -1
  478. package/dist/workflow-helpers.js +26 -0
  479. package/dist/workflow-helpers.js.map +1 -1
  480. package/dist/workflows/triggers/webhook-trigger-registrar.js +22 -15
  481. package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
  482. package/dist/workflows/triggers/workflow-trigger-activator.js +1 -7
  483. package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
  484. package/dist/workflows/workflow-creation.service.d.ts +2 -0
  485. package/dist/workflows/workflow-creation.service.js +4 -2
  486. package/dist/workflows/workflow-creation.service.js.map +1 -1
  487. package/dist/workflows/workflow-execution.service.js +8 -5
  488. package/dist/workflows/workflow-execution.service.js.map +1 -1
  489. package/dist/workflows/workflow-finder.service.d.ts +5 -2
  490. package/dist/workflows/workflow-finder.service.js +25 -2
  491. package/dist/workflows/workflow-finder.service.js.map +1 -1
  492. package/dist/workflows/workflow-history/workflow-history.service.d.ts +4 -1
  493. package/dist/workflows/workflow-history/workflow-history.service.js +3 -1
  494. package/dist/workflows/workflow-history/workflow-history.service.js.map +1 -1
  495. package/dist/workflows/workflow-validation.service.js +3 -3
  496. package/dist/workflows/workflow-validation.service.js.map +1 -1
  497. package/dist/workflows/workflow.request.d.ts +7 -22
  498. package/dist/workflows/workflow.service.d.ts +2 -0
  499. package/dist/workflows/workflow.service.js +4 -2
  500. package/dist/workflows/workflow.service.js.map +1 -1
  501. package/dist/workflows/workflows.controller.d.ts +1 -1
  502. package/dist/workflows/workflows.controller.js +8 -3
  503. package/dist/workflows/workflows.controller.js.map +1 -1
  504. package/package.json +45 -40
  505. package/templates/form-trigger-completion.handlebars +6 -6
  506. package/dist/executions/execution-data/azure-store.ee.d.ts +0 -15
  507. package/dist/executions/execution-data/azure-store.ee.js +0 -117
  508. package/dist/executions/execution-data/azure-store.ee.js.map +0 -1
  509. package/dist/executions/execution-data/fs-store.d.ts +0 -16
  510. package/dist/executions/execution-data/fs-store.js +0 -118
  511. package/dist/executions/execution-data/fs-store.js.map +0 -1
  512. package/dist/executions/execution-data/s3-store.ee.d.ts +0 -15
  513. package/dist/executions/execution-data/s3-store.ee.js +0 -116
  514. package/dist/executions/execution-data/s3-store.ee.js.map +0 -1
  515. package/dist/modules/agents/builder/from-ai-node-parameters.d.ts +0 -7
  516. package/dist/modules/agents/builder/from-ai-node-parameters.js +0 -43
  517. package/dist/modules/agents/builder/from-ai-node-parameters.js.map +0 -1
  518. package/dist/modules/agents/builder/interactive/ask-llm.tool.d.ts +0 -2
  519. package/dist/modules/agents/builder/interactive/ask-llm.tool.js +0 -25
  520. package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +0 -1
  521. package/dist/modules/agents/builder/interactive/ask-question.tool.d.ts +0 -2
  522. package/dist/modules/agents/builder/interactive/ask-question.tool.js +0 -27
  523. package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +0 -1
  524. package/dist/modules/agents/json-config/model-id.d.ts +0 -1
  525. package/dist/modules/agents/json-config/model-id.js +0 -8
  526. package/dist/modules/agents/json-config/model-id.js.map +0 -1
  527. package/dist/modules/agents/json-config/native-web-search-provider-tools.d.ts +0 -7
  528. package/dist/modules/agents/json-config/native-web-search-provider-tools.js +0 -55
  529. package/dist/modules/agents/json-config/native-web-search-provider-tools.js.map +0 -1
  530. package/dist/modules/n8n-packages/engine/import-pipeline.d.ts +0 -28
  531. package/dist/modules/n8n-packages/engine/import-pipeline.js +0 -204
  532. package/dist/modules/n8n-packages/engine/import-pipeline.js.map +0 -1
@@ -2,13 +2,13 @@ export declare function getAgentStateSection(configJson: string, configHash: str
2
2
  export declare const TARGET_AGENT_SECTION = "## Builder vs Target Agent\n\nYou are the builder agent, not the target agent.\nThe target agent is the AI agent you are configuring for the user. Changes to\nconfig, tools, memory, integrations, and target-agent skills affect the target\nagent, not your own builder behavior.";
3
3
  export declare function getConversationModeSection(agentPreviewPath: string): string;
4
4
  export declare function getBuilderSkillRoutingSection(): string;
5
- export declare const INTERACTIVE_TOOLS_SECTION = "## Interactive tools\n\nThese tools render a UI card in the chat and suspend your run until the user\nresponds. Treat the resume value as authoritative; it is the user's choice and\nmust be persisted exactly as returned.\n\nOnce you are building, ask for any specific decision, choice, value, or\nclarification through one of these tools rather than in plain prose. Use\n`ask_llm` for the model/credential, `ask_credential` for node-tool credentials,\nand `ask_question` for everything else. Exception: the opening reply to a\ngreeting, a \"what do you do\", or a vague intent \u2014 there you reply\nconversationally and ask for the overall goal, per \"When To Build vs When To\nConverse\".\n\n- `ask_llm`: use when the user must choose, confirm, configure, or change the\n target agent's main provider, model, or LLM credential.\n- `ask_credential`: use once per required node-tool credential slot before\n the config mutation that introduces the tool.\n- `ask_question`: the default way to ask the user anything that isn't a model or\n credential choice. Pass discrete `options` when the answer is one or more\n choices from a known small set, or an empty `options` array for an open-ended\n question (renders a freeform card). Never add your own \"Other\" option \u2014 the card\n always includes a freeform field.\n- Never call two interactive tools in parallel. The run suspends on the first.\n- Never re-ask a question the user already answered in this thread.\n- After resume, continue with the next concrete tool action. Do not narrate the\n answer back to the user.";
5
+ export declare const INTERACTIVE_TOOLS_SECTION = "## Interactive tools\n\nThese tools render a UI card in the chat and suspend your run until the user\nresponds. Treat the resume value as authoritative; it is the user's choice and\nmust be persisted exactly as returned.\n\nOnce you are building, ask for any specific decision, choice, value, or\nclarification through one of these tools rather than in plain prose. Use\n`ask_credential` for node-tool credentials, `configure_channel` for\nchat-channel connections, and `ask_questions` for everything else, including\nthe model/credential choice \u2014 resolve the answer with `resolve_llm`.\nException: the opening reply to a greeting, a \"what do you do\", or a vague\nintent \u2014 there you reply conversationally and ask for the overall goal, per\n\"When To Build vs When To Converse\".\n\n- `ask_credential`: use once per required node-tool credential slot before\n the config mutation that introduces the tool. NEVER use it for a chat-channel\n credential \u2014 use `configure_channel` instead.\n- `configure_channel`: ALWAYS use this to connect a chat platform (Slack,\n Telegram, ...) as an agent channel, with a type from `list_integration_types`.\n The setup UI creates and persists the credential itself.\n- `ask_questions`: the default way to ask the user anything that isn't a\n node-tool credential or channel choice, including when the user must choose,\n confirm, configure, or change the target agent's main provider, model, or\n LLM credential \u2014 resolve the answer with `resolve_llm`. Batch every\n question you currently need into a single call instead of asking one at a\n time. Each question is single-select, multi-select, or free-text; pass\n discrete `options` for a known small set of choices, or `type: \"text\"` for\n an open-ended question.\n- Never call two interactive tools in parallel. The run suspends on the first.\n- Never re-ask a question the user already answered in this thread.\n- After resume, continue with the next concrete tool action. Do not narrate the\n answer back to the user.";
6
6
  export declare const N8N_EXPRESSIONS_SECTION = "## n8n expressions\n\nNode tool parameters inside `nodeParameters` can use n8n expressions.\nPrefer `$fromAI` whenever the target agent should decide a value at runtime.\nDo not use `$fromAI` for stable resource IDs that the target agent cannot know\nat runtime, such as Linear `teamId`, project IDs, channel IDs, calendar IDs,\ndatabase IDs, table IDs, or other dynamic \"Name or ID\" selectors. Resolve those\nwith the `agent-builder-resource-locators` skill, `ask_credential`, and\n`get_resource_locator_options`; write the returned `parameterValue` into\n`nodeParameters`.\n\n- `={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldName', 'What value to provide', 'string') }}`\n- `={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('count', 'How many items', 'number') }}`\n- `={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('enabled', 'Whether to enable this option', 'boolean') }}`\n- `={{ $now.toISO() }}` for current date/time.\n- `={{ $today }}` for the start of today.\n\nAlways wrap expressions in `={{ }}`. Never pipe AI-chosen node-tool fields\nthrough `$json`; use `$fromAI` for those fields instead.";
7
7
  export declare const READ_CONFIG_FRESHNESS_SECTION = "## Config Freshness\n\nThe agent config can change at any time \u2014 the user can edit it directly in the UI\nbetween your turns \u2014 so your memory of it is NEVER authoritative. Never assume the\nconfig's contents or answer from memory, conversation history, or earlier tool\nresults.\n\nAlways call `read_config` first whenever a request touches the config, including:\n\n- Answering any question about the current config: which tools, skills, model,\n memory, or integrations are configured, whether a specific item is present, or\n what a value is currently set to.\n- Before any `write_config` or `patch_config`: use only the freshly returned\n `config` and `configHash` as the write base, never a remembered snapshot.\n\nExample: you added a tool earlier, the user then removed it in the UI, and now\nasks you to add it back. Do NOT assume it is still there \u2014 call `read_config`\nfirst, then act on the real current state.\n\nIf `write_config` or `patch_config` returns `stage: \"stale\"`, retry once\nfrom the returned `config` and `configHash`. For any independent later\nchange, call `read_config` again.";
8
- export declare const IMPORTANT_SECTION = "## Important\n\n- Credentials are user-controlled. Use `resolve_llm` or `ask_llm` for the\n target agent's main model, and `ask_credential` for node-tool,\n integration, or Episodic Memory credentials. Never copy credential IDs from\n `list_credentials` into config.\n- To get a specific decision, choice, or value for a build step, use\n `ask_question` (discrete options for a known set, empty options for\n open-ended), or `ask_llm`/`ask_credential` for model and credential choices \u2014\n not plain prose. Replying conversationally to a greeting or vague intent to ask\n for the overall goal is fine; see \"When To Build vs When To Converse\".\n- Tool preference order for real-world integrations:\n 1. MCP servers (`search_mcp_servers`) \u2014 always check first\n 2. Node tools (`search_nodes`)\n\t\t- Exception: generic web search is configured via `config.webSearch`, including Brave and SearXNG fallback search credentials via `config.webSearch.fallbackSearchCredentials`. Do not call `search_nodes` for web search.\n 3. Workflow tools (`list_workflows`)\n 4. Custom tools (`build_custom_tool`) \u2014 last resort\n- `build_custom_tool` stores code only; register the returned id in config.\n- `create_skill` stores a target-agent skill body only. Write a specific routing\n `description` and a `body` that follows the structured template (Overview,\n Inputs, Steps, Rules, Example, Gotchas); keep asking clarifying questions until\n you have the domain detail to fill it with concrete content \u2014 never a vague or\n placeholder skill. It is active only after `read_config` plus `patch_config` or\n `write_config` adds `{ \"type\": \"skill\", \"id\": \"<returned id>\" }` to `skills`.\n Load `agent-builder-target-skills` for the full workflow and the template.\n- `create_task` creates a recurring scheduled task (name + objective + cron) for\n the target agent. The objective MUST follow the structured template (Objective,\n Context, Steps, Output, Constraints, Success criteria) with every section filled\n in; keep asking clarifying questions until you can complete every section and the\n schedule is clear. A task can only use tools the agent already has, so if its\n steps need a capability the agent is missing (an integration, node/workflow tool,\n or web search), add it to the agent config first \u2014 follow the tool-preference\n order above via `read_config` + `patch_config`/`write_config` \u2014 before calling\n `create_task`. `create_task` adds a `{ type: \"task\", id, enabled }` ref to\n `config.tasks` (the config is the source of truth) and the task runs once the\n agent is published; disable or remove a task by editing `config.tasks`. Load\n `agent-builder-target-tasks` for the full workflow and the template.\n- Fresh agents must include enabled n8n session-scoped memory unless the user\n explicitly asks to disable memory.";
8
+ export declare const IMPORTANT_SECTION = "## Important\n\n- Credentials are user-controlled. Use `resolve_llm` (asking via\n `ask_questions` first when the user must choose) for the target agent's\n main model, `ask_credential` for node-tool or Episodic Memory credentials,\n and `configure_channel` (never `ask_credential`) for chat-channel\n credentials. Never copy credential IDs from `list_credentials` into config.\n- To get a specific decision, choice, or value for a build step, use\n `ask_questions` (discrete options for a known set, `type: \"text\"` for\n open-ended; batch multiple questions into one call) for model, credential,\n and other choices, or `ask_credential`/`configure_channel` for node-tool\n and channel credentials \u2014 not plain prose. Replying conversationally to a\n greeting or vague intent to ask for the overall goal is fine; see \"When To\n Build vs When To Converse\".\n- Tool preference order for real-world integrations:\n 1. MCP servers (`search_mcp_servers`) \u2014 always check first\n 2. Node tools (`search_nodes`)\n\t\t- Exception: generic web search is configured via `config.webSearch`, including Brave and SearXNG fallback search credentials via `config.webSearch.fallbackSearchCredentials`. Do not call `search_nodes` for web search.\n 3. Workflow tools (`list_workflows`)\n 4. Custom tools (`build_custom_tool`) \u2014 last resort\n- `build_custom_tool` stores code only; register the returned id in config.\n- `create_skill` stores a target-agent skill body only. Write a specific routing\n `description` and a `body` that follows the structured template (Overview,\n Inputs, Steps, Rules, Example, Gotchas); keep asking clarifying questions until\n you have the domain detail to fill it with concrete content \u2014 never a vague or\n placeholder skill. It is active only after `read_config` plus `patch_config` or\n `write_config` adds `{ \"type\": \"skill\", \"id\": \"<returned id>\" }` to `skills`.\n Load `agent-builder-target-skills` for the full workflow and the template.\n- `create_task` creates a recurring scheduled task (name + objective + cron) for\n the target agent. The objective MUST follow the structured template (Objective,\n Context, Steps, Output, Constraints, Success criteria) with every section filled\n in; keep asking clarifying questions until you can complete every section and the\n schedule is clear. A task can only use tools the agent already has, so if its\n steps need a capability the agent is missing (an integration, node/workflow tool,\n or web search), add it to the agent config first \u2014 follow the tool-preference\n order above via `read_config` + `patch_config`/`write_config` \u2014 before calling\n `create_task`. `create_task` adds a `{ type: \"task\", id, enabled }` ref to\n `config.tasks` (the config is the source of truth) and the task runs once the\n agent is published; disable or remove a task by editing `config.tasks`. Load\n `agent-builder-target-tasks` for the full workflow and the template.\n- Fresh agents must include enabled n8n session-scoped memory unless the user\n explicitly asks to disable memory.";
9
9
  export declare const RESPONSE_STYLE_SECTION = "## Response Style\n\nBe concise. After a build step, give a 1-2 sentence summary of what changed and\none useful next step if there is one. Do not narrate reasoning before tool\ncalls, reprint JSON, or list what is already visible in the sidebar.";
10
- export declare const WORKFLOW_SECTION = "## Workflow\n\n1. If the agent has no `instructions` and `credential` yet, call\n `resolve_llm` when the user specified a provider/model, or call `ask_llm` if user didn't specify a provider/model.\n2. Draft real target-agent `instructions`; never write empty placeholders.\n3. Use `ask_question` for clarifying questions with discrete options.\n4. Before adding any node tool that needs credentials, call `ask_credential`\n for each required slot.\n5. Prefer existing workflow tools and node tools over custom tools for\n real-world integrations.\n6. Use `create_skill` for reusable target-agent instruction bundles, then\n attach the returned id to `skills` through `read_config` plus\n `patch_config` or `write_config`.\n7. Before every `write_config` or `patch_config`, call `read_config` in the\n same turn and use the returned `configHash` as `baseConfigHash`.";
11
- export declare const FEW_SHOT_FLOWS_SECTION = "## Example flows\n\n### New agent: \"Build me a Slack triage agent\"\n1. `ask_llm({ purpose: \"Choose a model\" })` -> resolved provider, model, and credential.\n2. `search_nodes({ query: \"slack\" })`, then `get_node_types(...)`.\n3. `ask_credential(...)` for the Slack credential slot.\n4. `read_config()`.\n5. `write_config(...)` with model, credential, instructions, and Slack tool.\n\n### New agent: \"Use Anthropic via OpenRouter\"\n1. `resolve_llm({ provider: \"openrouter\" })`.\n2. `read_config()`.\n3. `write_config(...)` with `model: \"openrouter/{resolvedModel}\"`,\n `credential`, and requested instructions.\n\n### Change the existing model\n1. `ask_llm({ purpose: \"Choose a different model\" })`.\n2. `read_config()`.\n3. `patch_config(...)` replacing `/model` and `/credential`.\n\n### Add a node tool to an existing agent\n1. Search and inspect the node type.\n2. `ask_credential` for every required slot.\n3. `read_config()`.\n4. `patch_config(...)` adding the node tool to `/tools/-`.\n\n### Add a node tool when credential setup is skipped\n1. Search and inspect the node type.\n2. `ask_credential(...)` -> `{ skipped: true }`.\n3. `read_config()`.\n4. `patch_config(...)` adding the tool and omitting only the skipped\n credential slot. Do not abort the tool addition.\n\n### Add MCP integration: \"Connect Notion MCP\"\n1. `load_skill({ \"skillId\": \"agent-builder-mcp\" })`.\n2. `search_mcp_servers({ queries: [\"notion\"] })`.\n3. `ask_credential({ credentialType: \"<result.credentialType>\" })`.\n4. `verify_mcp_server({ name, url, transport, authentication, credential })`.\n5. `read_config()`.\n6. `patch_config(...)` adding a new `/mcpServers/-` entry (including\n `metadata.nodeTypeName` when returned by `search_mcp_servers`).\n\n### Ambiguous request: \"Make it post somewhere\"\n1. `ask_question(...)` with the known destination choices.\n2. Continue the chosen branch with node discovery, credentials, and config\n mutation.";
10
+ export declare const WORKFLOW_SECTION = "## Workflow\n\n1. If the agent has no `instructions` and `credential` yet, call\n `resolve_llm` when the user specified a provider/model, or ask via\n `ask_questions` and call `resolve_llm` with the answer if they didn't.\n2. Draft real target-agent `instructions`; never write empty placeholders.\n3. Use `ask_questions` for clarifying questions with discrete options, batching\n multiple questions into one call.\n4. Before adding any node tool that needs credentials, call `ask_credential`\n for each required slot.\n5. Prefer existing workflow tools and node tools over custom tools for\n real-world integrations.\n6. Use `create_skill` for reusable target-agent instruction bundles, then\n attach the returned id to `skills` through `read_config` plus\n `patch_config` or `write_config`.\n7. Before every `write_config` or `patch_config`, call `read_config` in the\n same turn and use the returned `configHash` as `baseConfigHash`.";
11
+ export declare const FEW_SHOT_FLOWS_SECTION = "## Example flows\n\n### New agent: \"Build me a Slack triage agent\"\n1. `ask_questions({ ... })` for the model choice, then\n `resolve_llm({ provider, model })` -> resolved provider, model, and credential.\n2. `search_nodes({ query: \"slack\" })`, then `get_node_types(...)`.\n3. `ask_credential(...)` for the Slack credential slot.\n4. `read_config()`.\n5. `write_config(...)` with model, credential, instructions, and Slack tool.\n\n### New agent: \"Use Anthropic via OpenRouter\"\n1. `resolve_llm({ provider: \"openrouter\" })`.\n2. `read_config()`.\n3. `write_config(...)` with `model: \"openrouter/{resolvedModel}\"`,\n `credential`, and requested instructions.\n\n### Change the existing model\n1. `ask_questions({ ... })` for the new model choice, then\n `resolve_llm({ provider, model })`.\n2. `read_config()`.\n3. `patch_config(...)` replacing `/model` and `/credential`.\n\n### Add a node tool to an existing agent\n1. Search and inspect the node type.\n2. `ask_credential` for every required slot.\n3. `read_config()`.\n4. `patch_config(...)` adding the node tool to `/tools/-`.\n\n### Add a node tool when credential setup is skipped\n1. Search and inspect the node type.\n2. `ask_credential(...)` -> `{ skipped: true }`.\n3. `read_config()`.\n4. `patch_config(...)` adding the tool and omitting only the skipped\n credential slot. Do not abort the tool addition.\n\n### Add MCP integration: \"Connect Notion MCP\"\n1. `load_skill({ \"skillId\": \"agent-builder-mcp\" })`.\n2. `search_mcp_servers({ queries: [\"notion\"] })`.\n3. `ask_credential({ credentialType: \"<result.credentialType>\" })`.\n4. `verify_mcp_server({ name, url, transport, authentication, credential })`.\n5. `read_config()`.\n6. `patch_config(...)` adding a new `/mcpServers/-` entry (including\n `metadata.nodeTypeName` when returned by `search_mcp_servers`).\n\n### Ambiguous request: \"Make it post somewhere\"\n1. `ask_questions(...)` with the known destination choices.\n2. Continue the chosen branch with node discovery, credentials, and config\n mutation.";
12
12
  export interface BuilderPromptContext {
13
13
  configJson: string;
14
14
  configHash: string | null;
@@ -93,21 +93,27 @@ must be persisted exactly as returned.
93
93
 
94
94
  Once you are building, ask for any specific decision, choice, value, or
95
95
  clarification through one of these tools rather than in plain prose. Use
96
- \`ask_llm\` for the model/credential, \`ask_credential\` for node-tool credentials,
97
- and \`ask_question\` for everything else. Exception: the opening reply to a
98
- greeting, a "what do you do", or a vague intent — there you reply
99
- conversationally and ask for the overall goal, per "When To Build vs When To
100
- Converse".
101
-
102
- - \`ask_llm\`: use when the user must choose, confirm, configure, or change the
103
- target agent's main provider, model, or LLM credential.
96
+ \`ask_credential\` for node-tool credentials, \`configure_channel\` for
97
+ chat-channel connections, and \`ask_questions\` for everything else, including
98
+ the model/credential choice resolve the answer with \`resolve_llm\`.
99
+ Exception: the opening reply to a greeting, a "what do you do", or a vague
100
+ intent — there you reply conversationally and ask for the overall goal, per
101
+ "When To Build vs When To Converse".
102
+
104
103
  - \`ask_credential\`: use once per required node-tool credential slot before
105
- the config mutation that introduces the tool.
106
- - \`ask_question\`: the default way to ask the user anything that isn't a model or
107
- credential choice. Pass discrete \`options\` when the answer is one or more
108
- choices from a known small set, or an empty \`options\` array for an open-ended
109
- question (renders a freeform card). Never add your own "Other" option — the card
110
- always includes a freeform field.
104
+ the config mutation that introduces the tool. NEVER use it for a chat-channel
105
+ credential use \`configure_channel\` instead.
106
+ - \`configure_channel\`: ALWAYS use this to connect a chat platform (Slack,
107
+ Telegram, ...) as an agent channel, with a type from \`list_integration_types\`.
108
+ The setup UI creates and persists the credential itself.
109
+ - \`ask_questions\`: the default way to ask the user anything that isn't a
110
+ node-tool credential or channel choice, including when the user must choose,
111
+ confirm, configure, or change the target agent's main provider, model, or
112
+ LLM credential — resolve the answer with \`resolve_llm\`. Batch every
113
+ question you currently need into a single call instead of asking one at a
114
+ time. Each question is single-select, multi-select, or free-text; pass
115
+ discrete \`options\` for a known small set of choices, or \`type: "text"\` for
116
+ an open-ended question.
111
117
  - Never call two interactive tools in parallel. The run suspends on the first.
112
118
  - Never re-ask a question the user already answered in this thread.
113
119
  - After resume, continue with the next concrete tool action. Do not narrate the
@@ -158,15 +164,18 @@ change, call \`read_config\` again.`;
158
164
  exports.IMPORTANT_SECTION = `\
159
165
  ## Important
160
166
 
161
- - Credentials are user-controlled. Use \`resolve_llm\` or \`ask_llm\` for the
162
- target agent's main model, and \`ask_credential\` for node-tool,
163
- integration, or Episodic Memory credentials. Never copy credential IDs from
164
- \`list_credentials\` into config.
167
+ - Credentials are user-controlled. Use \`resolve_llm\` (asking via
168
+ \`ask_questions\` first when the user must choose) for the target agent's
169
+ main model, \`ask_credential\` for node-tool or Episodic Memory credentials,
170
+ and \`configure_channel\` (never \`ask_credential\`) for chat-channel
171
+ credentials. Never copy credential IDs from \`list_credentials\` into config.
165
172
  - To get a specific decision, choice, or value for a build step, use
166
- \`ask_question\` (discrete options for a known set, empty options for
167
- open-ended), or \`ask_llm\`/\`ask_credential\` for model and credential choices —
168
- not plain prose. Replying conversationally to a greeting or vague intent to ask
169
- for the overall goal is fine; see "When To Build vs When To Converse".
173
+ \`ask_questions\` (discrete options for a known set, \`type: "text"\` for
174
+ open-ended; batch multiple questions into one call) for model, credential,
175
+ and other choices, or \`ask_credential\`/\`configure_channel\` for node-tool
176
+ and channel credentials not plain prose. Replying conversationally to a
177
+ greeting or vague intent to ask for the overall goal is fine; see "When To
178
+ Build vs When To Converse".
170
179
  - Tool preference order for real-world integrations:
171
180
  1. MCP servers (\`search_mcp_servers\`) — always check first
172
181
  2. Node tools (\`search_nodes\`)
@@ -205,9 +214,11 @@ exports.WORKFLOW_SECTION = `\
205
214
  ## Workflow
206
215
 
207
216
  1. If the agent has no \`instructions\` and \`credential\` yet, call
208
- \`resolve_llm\` when the user specified a provider/model, or call \`ask_llm\` if user didn't specify a provider/model.
217
+ \`resolve_llm\` when the user specified a provider/model, or ask via
218
+ \`ask_questions\` and call \`resolve_llm\` with the answer if they didn't.
209
219
  2. Draft real target-agent \`instructions\`; never write empty placeholders.
210
- 3. Use \`ask_question\` for clarifying questions with discrete options.
220
+ 3. Use \`ask_questions\` for clarifying questions with discrete options, batching
221
+ multiple questions into one call.
211
222
  4. Before adding any node tool that needs credentials, call \`ask_credential\`
212
223
  for each required slot.
213
224
  5. Prefer existing workflow tools and node tools over custom tools for
@@ -221,7 +232,8 @@ exports.FEW_SHOT_FLOWS_SECTION = `\
221
232
  ## Example flows
222
233
 
223
234
  ### New agent: "Build me a Slack triage agent"
224
- 1. \`ask_llm({ purpose: "Choose a model" })\` -> resolved provider, model, and credential.
235
+ 1. \`ask_questions({ ... })\` for the model choice, then
236
+ \`resolve_llm({ provider, model })\` -> resolved provider, model, and credential.
225
237
  2. \`search_nodes({ query: "slack" })\`, then \`get_node_types(...)\`.
226
238
  3. \`ask_credential(...)\` for the Slack credential slot.
227
239
  4. \`read_config()\`.
@@ -234,7 +246,8 @@ exports.FEW_SHOT_FLOWS_SECTION = `\
234
246
  \`credential\`, and requested instructions.
235
247
 
236
248
  ### Change the existing model
237
- 1. \`ask_llm({ purpose: "Choose a different model" })\`.
249
+ 1. \`ask_questions({ ... })\` for the new model choice, then
250
+ \`resolve_llm({ provider, model })\`.
238
251
  2. \`read_config()\`.
239
252
  3. \`patch_config(...)\` replacing \`/model\` and \`/credential\`.
240
253
 
@@ -261,7 +274,7 @@ exports.FEW_SHOT_FLOWS_SECTION = `\
261
274
  \`metadata.nodeTypeName\` when returned by \`search_mcp_servers\`).
262
275
 
263
276
  ### Ambiguous request: "Make it post somewhere"
264
- 1. \`ask_question(...)\` with the known destination choices.
277
+ 1. \`ask_questions(...)\` with the known destination choices.
265
278
  2. Continue the chosen branch with node discovery, credentials, and config
266
279
  mutation.`;
267
280
  function buildBuilderPrompt(ctx) {
@@ -1 +1 @@
1
- {"version":3,"file":"agents-builder-prompts.js","sourceRoot":"","sources":["../../../../src/modules/agents/builder/agents-builder-prompts.ts"],"names":[],"mappings":";;;AAKA,oDAwBC;AAUD,gEAiBC;AAMD,sEA8BC;AAuMD,gDA8BC;AAjUD,6EAA2E;AAC3E,yEAAuE;AACvE,2DAAwD;AACxD,yDAAsD;AAEtD,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;AAEY,QAAA,oBAAoB,GAAG;;;;;;sCAME,CAAC;AAEvC,SAAgB,0BAA0B,CAAC,gBAAwB;IAClE,OAAO;;;;;;;;;;;yBAWiB,gBAAgB;;;;oEAI2B,CAAC;AACrE,CAAC;AAMD,SAAgB,6BAA6B;IAC5C,MAAM,KAAK,GAAa;QACvB,iFAAiF;YAChF,kFAAkF;YAClF,0DAA0D;QAC3D,0JAA0J;QAC1J,4WAA4W;QAC5W,mLAAmL;QACnL,wEAAwE;QACxE,0FAA0F;KAC1F,CAAC;IAEF,OAAO;;;;;;;;EAQN,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;2CASyB,CAAC;AAC5C,CAAC;AAEY,QAAA,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA2Bd,CAAC;AAEf,QAAA,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;6DAmBsB,CAAC;AAEjD,QAAA,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;;;;oCAsBT,CAAC;AAExB,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAuCI,CAAC;AAEzB,QAAA,sBAAsB,GAAG;;;;;qEAK+B,CAAC;AAEzD,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;wEAewC,CAAC;AAE5D,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8CzB,CAAC;AAYd,SAAgB,kBAAkB,CAAC,GAAyB;IAC3D,MAAM,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,2BAA2B,GAC3B,GAAG,GAAG,CAAC;IAER,MAAM,QAAQ,GAAG;QAChB,6IAA6I;QAC7I,4BAAoB;QACpB,oBAAoB,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,CAAC;QACvE,0BAA0B,CAAC,gBAAgB,CAAC;QAC5C,IAAA,gDAAuB,GAAE;QACzB,IAAA,4CAAqB,EAAC,2BAA2B,CAAC;QAClD,6BAAa;QACb,2BAAY;QACZ,6BAA6B,EAAE;QAC/B,iCAAyB;QACzB,+BAAuB;QACvB,qCAA6B;QAC7B,wBAAgB;QAChB,8BAAsB;QACtB,yBAAiB;QACjB,8BAAsB;KACtB,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"agents-builder-prompts.js","sourceRoot":"","sources":["../../../../src/modules/agents/builder/agents-builder-prompts.ts"],"names":[],"mappings":";;;AAKA,oDAwBC;AAUD,gEAiBC;AAMD,sEA8BC;AAoND,gDA8BC;AA9UD,6EAA2E;AAC3E,yEAAuE;AACvE,2DAAwD;AACxD,yDAAsD;AAEtD,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;AAEY,QAAA,oBAAoB,GAAG;;;;;;sCAME,CAAC;AAEvC,SAAgB,0BAA0B,CAAC,gBAAwB;IAClE,OAAO;;;;;;;;;;;yBAWiB,gBAAgB;;;;oEAI2B,CAAC;AACrE,CAAC;AAMD,SAAgB,6BAA6B;IAC5C,MAAM,KAAK,GAAa;QACvB,iFAAiF;YAChF,kFAAkF;YAClF,0DAA0D;QAC3D,0JAA0J;QAC1J,4WAA4W;QAC5W,mLAAmL;QACnL,wEAAwE;QACxE,0FAA0F;KAC1F,CAAC;IAEF,OAAO;;;;;;;;EAQN,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;2CASyB,CAAC;AAC5C,CAAC;AAEY,QAAA,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiCd,CAAC;AAEf,QAAA,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;6DAmBsB,CAAC;AAEjD,QAAA,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;;;;oCAsBT,CAAC;AAExB,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA0CI,CAAC;AAEzB,QAAA,sBAAsB,GAAG;;;;;qEAK+B,CAAC;AAEzD,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;wEAiBwC,CAAC;AAE5D,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAgDzB,CAAC;AAYd,SAAgB,kBAAkB,CAAC,GAAyB;IAC3D,MAAM,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,2BAA2B,GAC3B,GAAG,GAAG,CAAC;IAER,MAAM,QAAQ,GAAG;QAChB,6IAA6I;QAC7I,4BAAoB;QACpB,oBAAoB,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,CAAC;QACvE,0BAA0B,CAAC,gBAAgB,CAAC;QAC5C,IAAA,gDAAuB,GAAE;QACzB,IAAA,4CAAqB,EAAC,2BAA2B,CAAC;QAClD,6BAAa;QACb,2BAAY;QACZ,6BAA6B,EAAE;QAC/B,iCAAyB;QACzB,+BAAuB;QACvB,qCAA6B;QAC7B,wBAAgB;QAChB,8BAAsB;QACtB,yBAAiB;QACjB,8BAAsB;KACtB,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
@@ -3,7 +3,6 @@ import { type AgentJsonConfig } from '@n8n/api-types';
3
3
  import { OutboundHttp, SsrfProtectionService } from '@n8n/backend-network';
4
4
  import { SsrfProtectionConfig } from '@n8n/config';
5
5
  import type { User } from '@n8n/db';
6
- import { WorkflowRepository } from '@n8n/db';
7
6
  import { CredentialTypes } from '../../../credential-types';
8
7
  import { McpRegistryService } from '../../../modules/mcp-registry/registry/mcp-registry.service';
9
8
  import { NodeTypes } from '../../../node-types';
@@ -17,6 +16,7 @@ import { AgentSkillsService } from '../agent-skills.service';
17
16
  import { AgentTaskService } from '../agent-task.service';
18
17
  import { AgentsToolsService } from '../agents-tools.service';
19
18
  import { AgentsService } from '../agents.service';
19
+ import { AttachableWorkflowsService } from '../attachable-workflows.service';
20
20
  import { BuilderModelLiveLookupService } from './builder-model-live-lookup.service';
21
21
  import { AgentRepository } from '../repositories/agent.repository';
22
22
  import { AgentSecureRuntime } from '../runtime/agent-secure-runtime';
@@ -38,7 +38,7 @@ export declare class AgentsBuilderToolsService {
38
38
  private readonly agentIntegrationPersistenceService;
39
39
  private readonly agentSkillsService;
40
40
  private readonly secureRuntime;
41
- private readonly workflowRepository;
41
+ private readonly attachableWorkflowsService;
42
42
  private readonly agentsToolsService;
43
43
  private readonly builderModelLiveLookupService;
44
44
  private readonly mcpRegistryService;
@@ -52,9 +52,7 @@ export declare class AgentsBuilderToolsService {
52
52
  private readonly nodeTypes;
53
53
  private readonly ssrfConfig;
54
54
  private readonly ssrfProtectionService;
55
- constructor(agentsService: AgentsService, agentConfigService: AgentConfigService, agentCustomToolsService: AgentCustomToolsService, agentIntegrationPersistenceService: AgentIntegrationPersistenceService, agentSkillsService: AgentSkillsService, secureRuntime: AgentSecureRuntime, workflowRepository: WorkflowRepository, agentsToolsService: AgentsToolsService, builderModelLiveLookupService: BuilderModelLiveLookupService, mcpRegistryService: McpRegistryService, oauthService: OauthService, credentialTypes: CredentialTypes, agentTaskService: AgentTaskService, agentRepository: AgentRepository, aiService: AiService, outboundHttp: OutboundHttp, dynamicNodeParametersService: DynamicNodeParametersService, nodeTypes: NodeTypes, ssrfConfig: SsrfProtectionConfig, ssrfProtectionService: SsrfProtectionService);
56
- private getDynamicSelectorPath;
57
- private rejectIfDynamicSelectorUsesFromAi;
55
+ constructor(agentsService: AgentsService, agentConfigService: AgentConfigService, agentCustomToolsService: AgentCustomToolsService, agentIntegrationPersistenceService: AgentIntegrationPersistenceService, agentSkillsService: AgentSkillsService, secureRuntime: AgentSecureRuntime, attachableWorkflowsService: AttachableWorkflowsService, agentsToolsService: AgentsToolsService, builderModelLiveLookupService: BuilderModelLiveLookupService, mcpRegistryService: McpRegistryService, oauthService: OauthService, credentialTypes: CredentialTypes, agentTaskService: AgentTaskService, agentRepository: AgentRepository, aiService: AiService, outboundHttp: OutboundHttp, dynamicNodeParametersService: DynamicNodeParametersService, nodeTypes: NodeTypes, ssrfConfig: SsrfProtectionConfig, ssrfProtectionService: SsrfProtectionService);
58
56
  getTools(agentId: string, projectId: string, credentialProvider: CredentialProvider, user: User): BuilderTools;
59
57
  private getJsonTools;
60
58
  private getSharedTools;
@@ -45,11 +45,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
45
45
  exports.AgentsBuilderToolsService = void 0;
46
46
  exports.getAgentConfigHash = getAgentConfigHash;
47
47
  const tool_1 = require("@n8n/agents/tool");
48
- const node_catalog_1 = require("@n8n/ai-utilities/node-catalog");
48
+ const agent_config_1 = require("@n8n/ai-utilities/agent-config");
49
49
  const api_types_1 = require("@n8n/api-types");
50
50
  const backend_network_1 = require("@n8n/backend-network");
51
51
  const config_1 = require("@n8n/config");
52
- const db_1 = require("@n8n/db");
53
52
  const di_1 = require("@n8n/di");
54
53
  const is_record_1 = require("@n8n/utils/is-record");
55
54
  const node_crypto_1 = require("node:crypto");
@@ -68,9 +67,9 @@ const agent_skills_service_1 = require("../agent-skills.service");
68
67
  const agent_task_service_1 = require("../agent-task.service");
69
68
  const agents_tools_service_1 = require("../agents-tools.service");
70
69
  const agents_service_1 = require("../agents.service");
70
+ const attachable_workflows_service_1 = require("../attachable-workflows.service");
71
71
  const builder_model_live_lookup_service_1 = require("./builder-model-live-lookup.service");
72
72
  const builder_tool_names_1 = require("./builder-tool-names");
73
- const from_ai_node_parameters_1 = require("./from-ai-node-parameters");
74
73
  const get_resource_locator_options_tool_1 = require("./get-resource-locator-options.tool");
75
74
  const interactive_1 = require("./interactive");
76
75
  const search_mcp_servers_tool_1 = require("./search-mcp-servers.tool");
@@ -78,18 +77,17 @@ const skill_body_template_1 = require("./skill-body-template");
78
77
  const task_objective_template_1 = require("./task-objective-template");
79
78
  const verify_mcp_server_tool_1 = require("./verify-mcp-server.tool");
80
79
  const agent_config_composition_1 = require("../json-config/agent-config-composition");
81
- const model_id_1 = require("../json-config/model-id");
82
- const native_web_search_provider_tools_1 = require("../json-config/native-web-search-provider-tools");
83
80
  const agent_repository_1 = require("../repositories/agent.repository");
84
81
  const agent_secure_runtime_1 = require("../runtime/agent-secure-runtime");
85
- const EMPTY_INSTRUCTIONS_ERROR = {
86
- path: '/instructions',
87
- message: 'Refusing to write an agent with empty instructions. Ask the user what the agent should do before calling write_config or patch_config again.',
88
- };
89
82
  const STALE_CONFIG_ERROR = {
90
83
  path: '(root)',
91
84
  message: 'Agent config changed since you last read it. Call read_config and retry with the returned configHash.',
92
85
  };
86
+ const CLI_AGENT_CONFIG_MESSAGES = {
87
+ emptyInstructionsFollowUp: 'saving the config again.',
88
+ dynamicSelectorFollowUp: 'Load skill agent-builder-resource-locators, resolve a credential if missing, then call ' +
89
+ 'get_resource_locator_options and write the returned parameterValue into nodeParameters.',
90
+ };
93
91
  const createSkillInputSchema = zod_1.z
94
92
  .object({
95
93
  name: api_types_1.agentSkillSchema.shape.name.describe('Human-readable skill name'),
@@ -103,54 +101,6 @@ const createSkillInputSchema = zod_1.z
103
101
  .describe('Markdown-only supporting files under references/... paths. References are not automatically loaded; instructions must say exactly when to load each reference by path.'),
104
102
  })
105
103
  .strict();
106
- function rejectIfEmptyInstructions(config) {
107
- if (!config.instructions.trim()) {
108
- return { errors: [EMPTY_INSTRUCTIONS_ERROR] };
109
- }
110
- return null;
111
- }
112
- function rejectIfUnsupportedNativeWebSearch(config) {
113
- const webSearch = config.config?.webSearch;
114
- const requestsNativeWebSearch = webSearch?.enabled === true &&
115
- (webSearch.provider === undefined ||
116
- webSearch.provider === 'auto' ||
117
- webSearch.provider === 'native');
118
- if (!requestsNativeWebSearch || (0, native_web_search_provider_tools_1.hasNativeWebSearchProvider)(config.model))
119
- return null;
120
- return {
121
- errors: [
122
- {
123
- path: '/config/webSearch/provider',
124
- message: 'Native web search is only supported for Anthropic and OpenAI models. Use Brave or SearXNG fallback web search for this model.',
125
- },
126
- ],
127
- };
128
- }
129
- function isNodeTool(tool) {
130
- return tool?.type === 'node';
131
- }
132
- function hasSameNodeType(left, right) {
133
- return (left.node.nodeType === right.node.nodeType &&
134
- left.node.nodeTypeVersion === right.node.nodeTypeVersion);
135
- }
136
- function hasSameNodeToolIdentity(left, right) {
137
- return left.name === right.name && hasSameNodeType(left, right);
138
- }
139
- function findPreviousNodeTool(previousConfig, currentTool, currentToolIndex) {
140
- const previousTools = previousConfig?.tools ?? [];
141
- const sameIndexTool = previousTools[currentToolIndex];
142
- if (isNodeTool(sameIndexTool) && hasSameNodeToolIdentity(sameIndexTool, currentTool)) {
143
- return sameIndexTool;
144
- }
145
- const matchingTools = previousTools.filter((tool) => isNodeTool(tool) && hasSameNodeToolIdentity(tool, currentTool));
146
- return matchingTools.length === 1 ? matchingTools[0] : null;
147
- }
148
- function getPreviousFromAiReferences(previousConfig, currentTool, currentToolIndex) {
149
- const previousTool = findPreviousNodeTool(previousConfig, currentTool, currentToolIndex);
150
- if (!previousTool)
151
- return [];
152
- return (0, from_ai_node_parameters_1.collectFromAiParameterReferences)(previousTool.node.nodeParameters);
153
- }
154
104
  function canonicalizeJson(value) {
155
105
  if (Array.isArray(value)) {
156
106
  return value.map((item) => canonicalizeJson(item));
@@ -178,39 +128,8 @@ function snapshotFromConfig(config, updatedAt, versionId) {
178
128
  versionId,
179
129
  };
180
130
  }
181
- function applyNativeWebSearchBuilderDefaults(config) {
182
- const providerTools = (0, native_web_search_provider_tools_1.getNativeWebSearchProviderTools)(config, {
183
- includeDefaultArgs: true,
184
- defaultEnabled: true,
185
- });
186
- const webSearch = config.config?.webSearch;
187
- const fallbackWebSearch = webSearch?.enabled === true &&
188
- (webSearch.provider === 'brave' || webSearch.provider === 'searxng');
189
- const hasNativeWebSearch = !fallbackWebSearch && webSearch?.enabled !== false && (0, native_web_search_provider_tools_1.hasNativeWebSearchProvider)(config.model);
190
- if (!hasNativeWebSearch) {
191
- const { webSearch, ...restConfig } = config.config ?? {};
192
- const { config: _config, providerTools: _providerTools, ...restAgentConfig } = config;
193
- const normalizedConfig = {
194
- ...restConfig,
195
- ...(fallbackWebSearch ? { webSearch } : {}),
196
- };
197
- return {
198
- ...restAgentConfig,
199
- ...(Object.keys(normalizedConfig).length > 0 ? { config: normalizedConfig } : {}),
200
- ...(Object.keys(providerTools).length > 0 ? { providerTools } : {}),
201
- };
202
- }
203
- return {
204
- ...config,
205
- config: {
206
- ...(config.config ?? {}),
207
- webSearch: { enabled: true },
208
- },
209
- providerTools,
210
- };
211
- }
212
131
  function applyPromptCachingBuilderDefaults(config) {
213
- const providerPrefix = (0, model_id_1.getProviderPrefix)(config.model);
132
+ const providerPrefix = (0, agent_config_1.getProviderPrefix)(config.model);
214
133
  const capability = api_types_1.PROVIDER_CAPABILITIES[providerPrefix]?.promptCaching ?? false;
215
134
  const resolved = (0, api_types_1.resolvePromptCaching)(config.config?.promptCaching, capability);
216
135
  if (!resolved) {
@@ -232,14 +151,14 @@ function applyPromptCachingBuilderDefaults(config) {
232
151
  };
233
152
  }
234
153
  let AgentsBuilderToolsService = class AgentsBuilderToolsService {
235
- constructor(agentsService, agentConfigService, agentCustomToolsService, agentIntegrationPersistenceService, agentSkillsService, secureRuntime, workflowRepository, agentsToolsService, builderModelLiveLookupService, mcpRegistryService, oauthService, credentialTypes, agentTaskService, agentRepository, aiService, outboundHttp, dynamicNodeParametersService, nodeTypes, ssrfConfig, ssrfProtectionService) {
154
+ constructor(agentsService, agentConfigService, agentCustomToolsService, agentIntegrationPersistenceService, agentSkillsService, secureRuntime, attachableWorkflowsService, agentsToolsService, builderModelLiveLookupService, mcpRegistryService, oauthService, credentialTypes, agentTaskService, agentRepository, aiService, outboundHttp, dynamicNodeParametersService, nodeTypes, ssrfConfig, ssrfProtectionService) {
236
155
  this.agentsService = agentsService;
237
156
  this.agentConfigService = agentConfigService;
238
157
  this.agentCustomToolsService = agentCustomToolsService;
239
158
  this.agentIntegrationPersistenceService = agentIntegrationPersistenceService;
240
159
  this.agentSkillsService = agentSkillsService;
241
160
  this.secureRuntime = secureRuntime;
242
- this.workflowRepository = workflowRepository;
161
+ this.attachableWorkflowsService = attachableWorkflowsService;
243
162
  this.agentsToolsService = agentsToolsService;
244
163
  this.builderModelLiveLookupService = builderModelLiveLookupService;
245
164
  this.mcpRegistryService = mcpRegistryService;
@@ -254,59 +173,6 @@ let AgentsBuilderToolsService = class AgentsBuilderToolsService {
254
173
  this.ssrfConfig = ssrfConfig;
255
174
  this.ssrfProtectionService = ssrfProtectionService;
256
175
  }
257
- getDynamicSelectorPath(nodeTypeDescription, parameterPath) {
258
- const normalizedPath = (0, node_catalog_1.normalizeParameterPath)(parameterPath);
259
- const pathParts = normalizedPath.split('.');
260
- for (let length = pathParts.length; length > 0; length--) {
261
- const candidatePath = pathParts.slice(0, length).join('.');
262
- const property = (0, node_catalog_1.findNodeParameterProperty)(nodeTypeDescription.description.properties, candidatePath);
263
- if (!property)
264
- continue;
265
- const lookup = (0, node_catalog_1.getDynamicNodeParameterLookup)(property);
266
- if (lookup)
267
- return candidatePath;
268
- }
269
- return null;
270
- }
271
- rejectIfDynamicSelectorUsesFromAi(config, previousConfig) {
272
- const errors = [];
273
- for (const [toolIndex, tool] of (config.tools ?? []).entries()) {
274
- if (tool.type !== 'node')
275
- continue;
276
- const fromAiReferences = (0, from_ai_node_parameters_1.collectFromAiParameterReferences)(tool.node.nodeParameters);
277
- if (fromAiReferences.length === 0)
278
- continue;
279
- let nodeTypeDescription;
280
- try {
281
- nodeTypeDescription = this.nodeTypes.getByNameAndVersion(tool.node.nodeType, tool.node.nodeTypeVersion);
282
- }
283
- catch {
284
- continue;
285
- }
286
- const previousFromAiReferences = getPreviousFromAiReferences(previousConfig, tool, toolIndex);
287
- const reportedDynamicPaths = new Set();
288
- for (const fromAiReference of fromAiReferences) {
289
- const { parameterPath, jsonPointer } = fromAiReference;
290
- const dynamicPath = this.getDynamicSelectorPath(nodeTypeDescription, parameterPath);
291
- if (!dynamicPath || reportedDynamicPaths.has(dynamicPath))
292
- continue;
293
- if ((0, from_ai_node_parameters_1.hasMatchingFromAiParameterReference)(previousFromAiReferences, fromAiReference)) {
294
- continue;
295
- }
296
- reportedDynamicPaths.add(dynamicPath);
297
- errors.push({
298
- path: `/tools/${toolIndex}/node/nodeParameters/${jsonPointer}`,
299
- message: `Node tool "${tool.name}" parameter "${dynamicPath}" is a dynamic selector. ` +
300
- 'Do not use $fromAI for this value. Load skill agent-builder-resource-locators, ' +
301
- 'use ask_credential if credentials are missing, then call get_resource_locator_options ' +
302
- 'and write the returned parameterValue into nodeParameters.',
303
- });
304
- }
305
- }
306
- if (errors.length === 0)
307
- return null;
308
- return { errors };
309
- }
310
176
  getTools(agentId, projectId, credentialProvider, user) {
311
177
  return {
312
178
  json: this.getJsonTools(agentId, projectId, credentialProvider, user),
@@ -367,21 +233,21 @@ let AgentsBuilderToolsService = class AgentsBuilderToolsService {
367
233
  if (!zodResult.success) {
368
234
  return { ok: false, errors: (0, api_types_1.formatZodErrors)(zodResult.error) };
369
235
  }
370
- const emptyInstructions = rejectIfEmptyInstructions(zodResult.data);
236
+ const emptyInstructions = (0, agent_config_1.rejectIfEmptyInstructions)(zodResult.data, CLI_AGENT_CONFIG_MESSAGES);
371
237
  if (emptyInstructions) {
372
- return { ok: false, errors: emptyInstructions.errors };
238
+ return { ok: false, errors: emptyInstructions };
373
239
  }
374
- const unsupportedNativeWebSearch = rejectIfUnsupportedNativeWebSearch(zodResult.data);
240
+ const unsupportedNativeWebSearch = (0, agent_config_1.rejectIfUnsupportedNativeWebSearch)(zodResult.data);
375
241
  if (unsupportedNativeWebSearch) {
376
- return { ok: false, errors: unsupportedNativeWebSearch.errors };
242
+ return { ok: false, errors: unsupportedNativeWebSearch };
377
243
  }
378
- const dynamicSelectorFromAi = this.rejectIfDynamicSelectorUsesFromAi(zodResult.data, snapshot.config);
244
+ const dynamicSelectorFromAi = (0, agent_config_1.rejectIfDynamicSelectorUsesFromAi)(zodResult.data, snapshot.config, this.nodeTypes, CLI_AGENT_CONFIG_MESSAGES);
379
245
  if (dynamicSelectorFromAi) {
380
- return { ok: false, errors: dynamicSelectorFromAi.errors };
246
+ return { ok: false, errors: dynamicSelectorFromAi };
381
247
  }
382
- const normalizedConfig = applyPromptCachingBuilderDefaults(applyNativeWebSearchBuilderDefaults(zodResult.data));
248
+ const configWithDefaults = applyPromptCachingBuilderDefaults((0, agent_config_1.applyNativeWebSearchDefaultOn)(zodResult.data));
383
249
  try {
384
- const result = await this.agentConfigService.updateConfig(agentId, projectId, normalizedConfig);
250
+ const result = await this.agentConfigService.updateConfig(agentId, projectId, configWithDefaults);
385
251
  return {
386
252
  ok: true,
387
253
  ...snapshotFromConfig(result.config, result.updatedAt, result.versionId),
@@ -455,21 +321,21 @@ let AgentsBuilderToolsService = class AgentsBuilderToolsService {
455
321
  if (!zodResult.success) {
456
322
  return { ok: false, stage: 'schema', errors: (0, api_types_1.formatZodErrors)(zodResult.error) };
457
323
  }
458
- const emptyInstructions = rejectIfEmptyInstructions(zodResult.data);
324
+ const emptyInstructions = (0, agent_config_1.rejectIfEmptyInstructions)(zodResult.data, CLI_AGENT_CONFIG_MESSAGES);
459
325
  if (emptyInstructions) {
460
- return { ok: false, stage: 'schema', errors: emptyInstructions.errors };
326
+ return { ok: false, stage: 'schema', errors: emptyInstructions };
461
327
  }
462
- const unsupportedNativeWebSearch = rejectIfUnsupportedNativeWebSearch(zodResult.data);
328
+ const unsupportedNativeWebSearch = (0, agent_config_1.rejectIfUnsupportedNativeWebSearch)(zodResult.data);
463
329
  if (unsupportedNativeWebSearch) {
464
- return { ok: false, stage: 'schema', errors: unsupportedNativeWebSearch.errors };
330
+ return { ok: false, stage: 'schema', errors: unsupportedNativeWebSearch };
465
331
  }
466
- const dynamicSelectorFromAi = this.rejectIfDynamicSelectorUsesFromAi(zodResult.data, snapshot.config);
332
+ const dynamicSelectorFromAi = (0, agent_config_1.rejectIfDynamicSelectorUsesFromAi)(zodResult.data, snapshot.config, this.nodeTypes, CLI_AGENT_CONFIG_MESSAGES);
467
333
  if (dynamicSelectorFromAi) {
468
- return { ok: false, stage: 'schema', errors: dynamicSelectorFromAi.errors };
334
+ return { ok: false, stage: 'schema', errors: dynamicSelectorFromAi };
469
335
  }
470
- const normalizedConfig = applyPromptCachingBuilderDefaults(applyNativeWebSearchBuilderDefaults(zodResult.data));
336
+ const configWithDefaults = applyPromptCachingBuilderDefaults((0, agent_config_1.applyNativeWebSearchDefaultOn)(zodResult.data));
471
337
  try {
472
- const result = await this.agentConfigService.updateConfig(agentId, projectId, normalizedConfig);
338
+ const result = await this.agentConfigService.updateConfig(agentId, projectId, configWithDefaults);
473
339
  return {
474
340
  ok: true,
475
341
  ...snapshotFromConfig(result.config, result.updatedAt, result.versionId),
@@ -533,8 +399,14 @@ let AgentsBuilderToolsService = class AgentsBuilderToolsService {
533
399
  isCredentialTypeKnown: (credentialType) => this.credentialTypes.recognizes(credentialType),
534
400
  isAssistantProxyEnabled: () => this.aiService.isProxyEnabled(),
535
401
  }),
536
- (0, interactive_1.buildAskLlmTool)(),
537
- (0, interactive_1.buildAskQuestionTool)(),
402
+ (0, interactive_1.buildAskQuestionsTool)(),
403
+ (0, interactive_1.buildConfigureChannelTool)({
404
+ agentId,
405
+ projectId,
406
+ listChatIntegrationTypes: () => this.agentIntegrationPersistenceService
407
+ .listChatIntegrations()
408
+ .map((integration) => integration.type),
409
+ }),
538
410
  (0, verify_mcp_server_tool_1.buildVerifyMcpServerTool)({
539
411
  credentialProvider,
540
412
  oauthService: this.oauthService,
@@ -616,8 +488,8 @@ let AgentsBuilderToolsService = class AgentsBuilderToolsService {
616
488
  'parameter for the template. You MUST NOT call this tool with a vague, broad, or placeholder ' +
617
489
  'objective, an objective missing any section, or an unclear schedule. First make sure you can ' +
618
490
  'fill every section of the template and know how often/when it should run; if anything is ' +
619
- 'ambiguous, ask the user clarifying questions (ask_question with discrete options for choices, ' +
620
- 'or empty options for open-ended) and only call create_task once the objective is complete and the cadence ' +
491
+ 'ambiguous, ask the user clarifying questions (ask_questions with discrete options for choices, ' +
492
+ 'or type: "text" for open-ended) and only call create_task once the objective is complete and the cadence ' +
621
493
  'is known. This adds a `{ type: "task", id, enabled }` ref to the agent config (config.tasks) ' +
622
494
  'and the task starts running once the agent is (re)published. Returns { ok: true, task } or ' +
623
495
  '{ ok: false, errors }.')
@@ -660,36 +532,18 @@ let AgentsBuilderToolsService = class AgentsBuilderToolsService {
660
532
  .description('List the n8n workflows that can be attached as tools via `type: "workflow"` in the agent config. ' +
661
533
  'ALWAYS call this at the start — workflows are the preferred way to give agents real capabilities ' +
662
534
  '(sending emails, creating calendar events, querying databases, calling APIs, etc.). ' +
663
- 'Only returns workflows with supported trigger types.')
664
- .input(zod_1.z.object({}))
665
- .handler(async () => {
666
- const workflows = await this.workflowRepository.find({
667
- select: ['id', 'name', 'nodes', 'active', 'updatedAt'],
668
- where: { shared: { projectId } },
669
- relations: ['shared'],
670
- order: { updatedAt: 'DESC' },
671
- take: 100,
672
- });
673
- const SUPPORTED_TRIGGERS = {
674
- 'n8n-nodes-base.manualTrigger': 'manual',
675
- 'n8n-nodes-base.executeWorkflowTrigger': 'executeWorkflow',
676
- 'n8n-nodes-base.chatTrigger': 'chat',
677
- 'n8n-nodes-base.scheduleTrigger': 'schedule',
678
- 'n8n-nodes-base.formTrigger': 'form',
535
+ 'Only returns workflows with supported trigger types. Pass `searchTerm` to narrow by workflow name; ' +
536
+ 'omitting it returns the 10 most recently updated attachable workflows.')
537
+ .input(zod_1.z.object({
538
+ searchTerm: zod_1.z
539
+ .string()
540
+ .optional()
541
+ .describe('Optional workflow-name search term. Omit to return the first 10 results.'),
542
+ }))
543
+ .handler(async ({ searchTerm }) => {
544
+ return {
545
+ workflows: await this.attachableWorkflowsService.list(user, projectId, searchTerm),
679
546
  };
680
- const compatible = workflows
681
- .map((w) => {
682
- const triggerNode = (w.nodes ?? []).find((n) => SUPPORTED_TRIGGERS[n.type]);
683
- if (!triggerNode)
684
- return null;
685
- return {
686
- name: w.name,
687
- active: w.active,
688
- triggerType: SUPPORTED_TRIGGERS[triggerNode.type],
689
- };
690
- })
691
- .filter(Boolean);
692
- return { workflows: compatible };
693
547
  })
694
548
  .build();
695
549
  return [
@@ -725,7 +579,7 @@ exports.AgentsBuilderToolsService = AgentsBuilderToolsService = __decorate([
725
579
  agent_integration_persistence_service_1.AgentIntegrationPersistenceService,
726
580
  agent_skills_service_1.AgentSkillsService,
727
581
  agent_secure_runtime_1.AgentSecureRuntime,
728
- db_1.WorkflowRepository,
582
+ attachable_workflows_service_1.AttachableWorkflowsService,
729
583
  agents_tools_service_1.AgentsToolsService,
730
584
  builder_model_live_lookup_service_1.BuilderModelLiveLookupService,
731
585
  mcp_registry_service_1.McpRegistryService,