@n8n/ai-workflow-builder 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/dist/agents/responder.agent.d.ts +1 -0
  2. package/dist/agents/responder.agent.js +9 -33
  3. package/dist/agents/responder.agent.js.map +1 -1
  4. package/dist/agents/supervisor.agent.d.ts +1 -0
  5. package/dist/agents/supervisor.agent.js +7 -38
  6. package/dist/agents/supervisor.agent.js.map +1 -1
  7. package/dist/ai-workflow-builder-agent.service.d.ts +2 -1
  8. package/dist/ai-workflow-builder-agent.service.js +18 -12
  9. package/dist/ai-workflow-builder-agent.service.js.map +1 -1
  10. package/dist/build.tsbuildinfo +1 -1
  11. package/dist/chains/conversation-compact.js +2 -13
  12. package/dist/chains/conversation-compact.js.map +1 -1
  13. package/dist/chains/parameter-updater.js +21 -7
  14. package/dist/chains/parameter-updater.js.map +1 -1
  15. package/dist/chains/prompt-categorization.js +3 -81
  16. package/dist/chains/prompt-categorization.js.map +1 -1
  17. package/dist/chains/workflow-name.js +2 -10
  18. package/dist/chains/workflow-name.js.map +1 -1
  19. package/dist/constants.d.ts +2 -0
  20. package/dist/constants.js +3 -1
  21. package/dist/constants.js.map +1 -1
  22. package/dist/multi-agent-workflow-subgraphs.d.ts +38 -1
  23. package/dist/multi-agent-workflow-subgraphs.js +34 -2
  24. package/dist/multi-agent-workflow-subgraphs.js.map +1 -1
  25. package/dist/parent-graph-state.d.ts +4 -0
  26. package/dist/parent-graph-state.js +14 -1
  27. package/dist/parent-graph-state.js.map +1 -1
  28. package/dist/prompts/agents/builder.prompt.d.ts +1 -0
  29. package/dist/prompts/agents/builder.prompt.js +242 -0
  30. package/dist/prompts/agents/builder.prompt.js.map +1 -0
  31. package/dist/prompts/agents/configurator.prompt.d.ts +2 -0
  32. package/dist/prompts/agents/configurator.prompt.js +125 -0
  33. package/dist/prompts/agents/configurator.prompt.js.map +1 -0
  34. package/dist/prompts/agents/discovery.prompt.d.ts +11 -0
  35. package/dist/prompts/agents/discovery.prompt.js +259 -0
  36. package/dist/prompts/agents/discovery.prompt.js.map +1 -0
  37. package/dist/prompts/agents/responder.prompt.d.ts +1 -0
  38. package/dist/prompts/agents/responder.prompt.js +41 -0
  39. package/dist/prompts/agents/responder.prompt.js.map +1 -0
  40. package/dist/prompts/agents/supervisor.prompt.d.ts +1 -0
  41. package/dist/prompts/agents/supervisor.prompt.js +43 -0
  42. package/dist/prompts/agents/supervisor.prompt.js.map +1 -0
  43. package/dist/prompts/builder/index.d.ts +2 -0
  44. package/dist/prompts/builder/index.js +7 -0
  45. package/dist/prompts/builder/index.js.map +1 -0
  46. package/dist/prompts/builder/prompt-builder.d.ts +17 -0
  47. package/dist/prompts/builder/prompt-builder.js +147 -0
  48. package/dist/prompts/builder/prompt-builder.js.map +1 -0
  49. package/dist/prompts/builder/types.d.ts +22 -0
  50. package/dist/prompts/builder/types.js +3 -0
  51. package/dist/prompts/builder/types.js.map +1 -0
  52. package/dist/prompts/chains/categorization.prompt.d.ts +43 -0
  53. package/dist/prompts/chains/categorization.prompt.js +86 -0
  54. package/dist/prompts/chains/categorization.prompt.js.map +1 -0
  55. package/dist/prompts/chains/compact.prompt.d.ts +2 -0
  56. package/dist/prompts/chains/compact.prompt.js +16 -0
  57. package/dist/prompts/chains/compact.prompt.js.map +1 -0
  58. package/dist/prompts/chains/parameter-updater/examples/if-node.d.ts +2 -0
  59. package/dist/{chains/prompts/examples/basic/if-node-examples.js → prompts/chains/parameter-updater/examples/if-node.js} +6 -3
  60. package/dist/prompts/chains/parameter-updater/examples/if-node.js.map +1 -0
  61. package/dist/prompts/chains/parameter-updater/examples/index.d.ts +6 -0
  62. package/dist/prompts/chains/parameter-updater/examples/index.js +16 -0
  63. package/dist/prompts/chains/parameter-updater/examples/index.js.map +1 -0
  64. package/dist/prompts/chains/parameter-updater/examples/resource-locator.d.ts +2 -0
  65. package/dist/{chains/prompts/examples/advanced/resource-locator-examples.js → prompts/chains/parameter-updater/examples/resource-locator.js} +7 -3
  66. package/dist/prompts/chains/parameter-updater/examples/resource-locator.js.map +1 -0
  67. package/dist/prompts/chains/parameter-updater/examples/set-node.d.ts +2 -0
  68. package/dist/{chains/prompts/examples/basic/set-node-examples.js → prompts/chains/parameter-updater/examples/set-node.js} +6 -3
  69. package/dist/prompts/chains/parameter-updater/examples/set-node.js.map +1 -0
  70. package/dist/prompts/chains/parameter-updater/examples/simple-updates.d.ts +2 -0
  71. package/dist/{chains/prompts/examples/basic → prompts/chains/parameter-updater/examples}/simple-updates.js +8 -5
  72. package/dist/prompts/chains/parameter-updater/examples/simple-updates.js.map +1 -0
  73. package/dist/prompts/chains/parameter-updater/examples/switch-node.d.ts +2 -0
  74. package/dist/prompts/chains/parameter-updater/examples/switch-node.js +131 -0
  75. package/dist/prompts/chains/parameter-updater/examples/switch-node.js.map +1 -0
  76. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.d.ts +2 -0
  77. package/dist/{chains/prompts/examples/advanced/tool-node-examples.js → prompts/chains/parameter-updater/examples/tool-nodes.js} +6 -3
  78. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.js.map +1 -0
  79. package/dist/prompts/chains/parameter-updater/guides/gmail.d.ts +2 -0
  80. package/dist/prompts/chains/parameter-updater/guides/gmail.js +28 -0
  81. package/dist/prompts/chains/parameter-updater/guides/gmail.js.map +1 -0
  82. package/dist/prompts/chains/parameter-updater/guides/http-request.d.ts +2 -0
  83. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/http-request.js +34 -8
  84. package/dist/prompts/chains/parameter-updater/guides/http-request.js.map +1 -0
  85. package/dist/prompts/chains/parameter-updater/guides/if-node.d.ts +2 -0
  86. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/if-node.js +6 -5
  87. package/dist/prompts/chains/parameter-updater/guides/if-node.js.map +1 -0
  88. package/dist/prompts/chains/parameter-updater/guides/index.d.ts +9 -0
  89. package/dist/prompts/chains/parameter-updater/guides/index.js +22 -0
  90. package/dist/prompts/chains/parameter-updater/guides/index.js.map +1 -0
  91. package/dist/prompts/chains/parameter-updater/guides/resource-locator.d.ts +2 -0
  92. package/dist/{chains/prompts/parameter-types → prompts/chains/parameter-updater/guides}/resource-locator.js +6 -2
  93. package/dist/prompts/chains/parameter-updater/guides/resource-locator.js.map +1 -0
  94. package/dist/prompts/chains/parameter-updater/guides/set-node.d.ts +2 -0
  95. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/set-node.js +5 -2
  96. package/dist/prompts/chains/parameter-updater/guides/set-node.js.map +1 -0
  97. package/dist/prompts/chains/parameter-updater/guides/switch-node.d.ts +2 -0
  98. package/dist/prompts/chains/parameter-updater/guides/switch-node.js +75 -0
  99. package/dist/prompts/chains/parameter-updater/guides/switch-node.js.map +1 -0
  100. package/dist/prompts/chains/parameter-updater/guides/system-message.d.ts +2 -0
  101. package/dist/{chains/prompts/parameter-types → prompts/chains/parameter-updater/guides}/system-message.js +25 -4
  102. package/dist/prompts/chains/parameter-updater/guides/system-message.js.map +1 -0
  103. package/dist/prompts/chains/parameter-updater/guides/text-fields.d.ts +2 -0
  104. package/dist/{chains/prompts/parameter-types → prompts/chains/parameter-updater/guides}/text-fields.js +11 -2
  105. package/dist/prompts/chains/parameter-updater/guides/text-fields.js.map +1 -0
  106. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.d.ts +2 -0
  107. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/tool-nodes.js +5 -2
  108. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js.map +1 -0
  109. package/dist/prompts/chains/parameter-updater/index.d.ts +8 -0
  110. package/dist/prompts/chains/parameter-updater/index.js +35 -0
  111. package/dist/prompts/chains/parameter-updater/index.js.map +1 -0
  112. package/dist/prompts/chains/parameter-updater/instance-url.d.ts +1 -0
  113. package/dist/{chains/prompts → prompts/chains/parameter-updater}/instance-url.js +5 -6
  114. package/dist/prompts/chains/parameter-updater/instance-url.js.map +1 -0
  115. package/dist/{chains/prompts/base/core-instructions.d.ts → prompts/chains/parameter-updater/parameter-updater.prompt.d.ts} +3 -0
  116. package/dist/{chains/prompts/base/core-instructions.js → prompts/chains/parameter-updater/parameter-updater.prompt.js} +25 -2
  117. package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.js.map +1 -0
  118. package/dist/prompts/chains/parameter-updater/registry.d.ts +4 -0
  119. package/dist/prompts/chains/parameter-updater/registry.js +65 -0
  120. package/dist/prompts/chains/parameter-updater/registry.js.map +1 -0
  121. package/dist/prompts/chains/parameter-updater/types.d.ts +18 -0
  122. package/dist/prompts/chains/parameter-updater/types.js +3 -0
  123. package/dist/prompts/chains/parameter-updater/types.js.map +1 -0
  124. package/dist/prompts/chains/parameter-updater/utils.d.ts +2 -0
  125. package/dist/prompts/chains/parameter-updater/utils.js +16 -0
  126. package/dist/prompts/chains/parameter-updater/utils.js.map +1 -0
  127. package/dist/prompts/chains/workflow-name.prompt.d.ts +2 -0
  128. package/dist/prompts/chains/workflow-name.prompt.js +11 -0
  129. package/dist/prompts/chains/workflow-name.prompt.js.map +1 -0
  130. package/dist/prompts/index.d.ts +12 -0
  131. package/dist/prompts/index.js +50 -0
  132. package/dist/prompts/index.js.map +1 -0
  133. package/dist/{tools/prompts/main-agent.prompt.js → prompts/legacy-agent.prompt.js} +14 -31
  134. package/dist/prompts/legacy-agent.prompt.js.map +1 -0
  135. package/dist/subgraphs/builder.subgraph.d.ts +2 -0
  136. package/dist/subgraphs/builder.subgraph.js +2 -163
  137. package/dist/subgraphs/builder.subgraph.js.map +1 -1
  138. package/dist/subgraphs/configurator.subgraph.d.ts +2 -0
  139. package/dist/subgraphs/configurator.subgraph.js +3 -84
  140. package/dist/subgraphs/configurator.subgraph.js.map +1 -1
  141. package/dist/subgraphs/discovery.subgraph.d.ts +18 -0
  142. package/dist/subgraphs/discovery.subgraph.js +28 -220
  143. package/dist/subgraphs/discovery.subgraph.js.map +1 -1
  144. package/dist/tools/add-node.tool.js +1 -1
  145. package/dist/tools/best-practices/chatbot.js +6 -7
  146. package/dist/tools/best-practices/chatbot.js.map +1 -1
  147. package/dist/tools/best-practices/content-generation.js +38 -2
  148. package/dist/tools/best-practices/content-generation.js.map +1 -1
  149. package/dist/tools/best-practices/data-transformation.js +17 -22
  150. package/dist/tools/best-practices/data-transformation.js.map +1 -1
  151. package/dist/tools/best-practices/index.js +2 -1
  152. package/dist/tools/best-practices/index.js.map +1 -1
  153. package/dist/types/config.d.ts +2 -0
  154. package/dist/types/coordination.d.ts +8 -2
  155. package/dist/types/coordination.js +4 -0
  156. package/dist/types/coordination.js.map +1 -1
  157. package/dist/types/discovery-types.d.ts +2 -0
  158. package/dist/utils/coordination-log.d.ts +2 -1
  159. package/dist/utils/coordination-log.js.map +1 -1
  160. package/dist/utils/state-modifier.d.ts +32 -0
  161. package/dist/utils/state-modifier.js +112 -0
  162. package/dist/utils/state-modifier.js.map +1 -0
  163. package/dist/utils/state-reducers.d.ts +4 -0
  164. package/dist/utils/state-reducers.js +25 -0
  165. package/dist/utils/state-reducers.js.map +1 -0
  166. package/dist/utils/stream-processor.js +2 -30
  167. package/dist/utils/stream-processor.js.map +1 -1
  168. package/dist/utils/subgraph-helpers.d.ts +3 -0
  169. package/dist/utils/subgraph-helpers.js +23 -0
  170. package/dist/utils/subgraph-helpers.js.map +1 -1
  171. package/dist/validation/checks/connections.js +9 -16
  172. package/dist/validation/checks/connections.js.map +1 -1
  173. package/dist/validation/checks/credentials.d.ts +3 -0
  174. package/dist/validation/checks/credentials.js +125 -0
  175. package/dist/validation/checks/credentials.js.map +1 -0
  176. package/dist/validation/checks/index.d.ts +1 -0
  177. package/dist/validation/checks/index.js +3 -1
  178. package/dist/validation/checks/index.js.map +1 -1
  179. package/dist/validation/checks/tools.js +0 -10
  180. package/dist/validation/checks/tools.js.map +1 -1
  181. package/dist/validation/programmatic.js +2 -0
  182. package/dist/validation/programmatic.js.map +1 -1
  183. package/dist/validation/types.d.ts +4 -1
  184. package/dist/validation/types.js +2 -0
  185. package/dist/validation/types.js.map +1 -1
  186. package/dist/validation/utils/node-type-map.d.ts +8 -0
  187. package/dist/validation/utils/node-type-map.js +50 -0
  188. package/dist/validation/utils/node-type-map.js.map +1 -0
  189. package/dist/workflow-builder-agent.d.ts +7 -3
  190. package/dist/workflow-builder-agent.js +24 -15
  191. package/dist/workflow-builder-agent.js.map +1 -1
  192. package/dist/workflow-state.js +3 -14
  193. package/dist/workflow-state.js.map +1 -1
  194. package/package.json +8 -7
  195. package/dist/chains/prompts/base/common-patterns.d.ts +0 -1
  196. package/dist/chains/prompts/base/common-patterns.js +0 -13
  197. package/dist/chains/prompts/base/common-patterns.js.map +0 -1
  198. package/dist/chains/prompts/base/core-instructions.js.map +0 -1
  199. package/dist/chains/prompts/base/expression-rules.d.ts +0 -1
  200. package/dist/chains/prompts/base/expression-rules.js +0 -15
  201. package/dist/chains/prompts/base/expression-rules.js.map +0 -1
  202. package/dist/chains/prompts/base/output-format.d.ts +0 -1
  203. package/dist/chains/prompts/base/output-format.js +0 -7
  204. package/dist/chains/prompts/base/output-format.js.map +0 -1
  205. package/dist/chains/prompts/examples/advanced/resource-locator-examples.d.ts +0 -1
  206. package/dist/chains/prompts/examples/advanced/resource-locator-examples.js.map +0 -1
  207. package/dist/chains/prompts/examples/advanced/tool-node-examples.d.ts +0 -1
  208. package/dist/chains/prompts/examples/advanced/tool-node-examples.js.map +0 -1
  209. package/dist/chains/prompts/examples/basic/if-node-examples.d.ts +0 -1
  210. package/dist/chains/prompts/examples/basic/if-node-examples.js.map +0 -1
  211. package/dist/chains/prompts/examples/basic/set-node-examples.d.ts +0 -1
  212. package/dist/chains/prompts/examples/basic/set-node-examples.js.map +0 -1
  213. package/dist/chains/prompts/examples/basic/simple-updates.d.ts +0 -1
  214. package/dist/chains/prompts/examples/basic/simple-updates.js.map +0 -1
  215. package/dist/chains/prompts/instance-url.d.ts +0 -1
  216. package/dist/chains/prompts/instance-url.js.map +0 -1
  217. package/dist/chains/prompts/node-types/http-request.d.ts +0 -1
  218. package/dist/chains/prompts/node-types/http-request.js.map +0 -1
  219. package/dist/chains/prompts/node-types/if-node.d.ts +0 -1
  220. package/dist/chains/prompts/node-types/if-node.js.map +0 -1
  221. package/dist/chains/prompts/node-types/set-node.d.ts +0 -1
  222. package/dist/chains/prompts/node-types/set-node.js.map +0 -1
  223. package/dist/chains/prompts/node-types/tool-nodes.d.ts +0 -1
  224. package/dist/chains/prompts/node-types/tool-nodes.js.map +0 -1
  225. package/dist/chains/prompts/parameter-types/resource-locator.d.ts +0 -1
  226. package/dist/chains/prompts/parameter-types/resource-locator.js.map +0 -1
  227. package/dist/chains/prompts/parameter-types/system-message.d.ts +0 -1
  228. package/dist/chains/prompts/parameter-types/system-message.js.map +0 -1
  229. package/dist/chains/prompts/parameter-types/text-fields.d.ts +0 -1
  230. package/dist/chains/prompts/parameter-types/text-fields.js.map +0 -1
  231. package/dist/chains/prompts/prompt-builder.d.ts +0 -15
  232. package/dist/chains/prompts/prompt-builder.js +0 -140
  233. package/dist/chains/prompts/prompt-builder.js.map +0 -1
  234. package/dist/chains/prompts/prompt-config.d.ts +0 -5
  235. package/dist/chains/prompts/prompt-config.js +0 -52
  236. package/dist/chains/prompts/prompt-config.js.map +0 -1
  237. package/dist/tools/prompts/main-agent.prompt.js.map +0 -1
  238. /package/dist/{tools/prompts/main-agent.prompt.d.ts → prompts/legacy-agent.prompt.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-state.js","sourceRoot":"","sources":["../src/workflow-state.ts"],"names":[],"mappings":";;;AAqCA,8DAsBC;AA1DD,uDAAwD;AACxD,oDAAwE;AAUxE,SAAS,iBAAiB,CACzB,OAAmC,EACnC,MAA8C;IAE9C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACX,CAAC;IAED,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;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B;QAC1D,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzD,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KACjB,CAAC;IAEF,mBAAmB,EAAE,IAAA,sBAAU,EAAW;QACzC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzD,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KACjB,CAAC;IAGF,eAAe,EAAE,IAAA,sBAAU,EAAS;QACnC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC;QACzB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;KACtB,CAAC;IAIF,kBAAkB,EAAE,IAAA,sBAAU,EAAwB;QACrD,OAAO,EAAE,0CAAyB;QAClC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KACnB,CAAC;IAGF,WAAW,EAAE,IAAA,sBAAU,EAAW;QACjC,OAAO,EAAE,mCAAkB;QAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KACjB,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/ai-workflow-builder",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "src/index.ts",
6
6
  "types": "dist/index.d.ts",
@@ -21,17 +21,17 @@
21
21
  "@langchain/core": "1.1.0",
22
22
  "@langchain/langgraph": "1.0.2",
23
23
  "@langchain/openai": "1.1.3",
24
- "@n8n_io/ai-assistant-sdk": "1.17.0",
24
+ "@n8n_io/ai-assistant-sdk": "1.19.1",
25
25
  "csv-parse": "5.5.0",
26
26
  "langsmith": "^0.3.45",
27
27
  "lodash": "4.17.21",
28
28
  "picocolors": "1.0.1",
29
29
  "zod": "3.25.67",
30
- "@n8n/config": "2.0.0",
31
- "@n8n/backend-common": "1.0.2",
32
- "@n8n/di": "0.10.0",
33
- "@n8n/utils": "1.20.0",
34
- "n8n-workflow": "2.0.1"
30
+ "@n8n/backend-common": "1.1.1",
31
+ "@n8n/utils": "1.21.0",
32
+ "n8n-workflow": "2.1.0",
33
+ "@n8n/config": "2.0.1",
34
+ "@n8n/di": "0.10.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/cli-progress": "^3.11.5",
@@ -79,6 +79,7 @@
79
79
  "eval:langsmith": "USE_LANGSMITH_EVAL=true tsx evaluations",
80
80
  "eval:generate": "GENERATE_TEST_CASES=true tsx evaluations",
81
81
  "eval:categorize": "tsx scripts/categorize-prompts.ts",
82
+ "workflow:mermaid": "tsx scripts/workflow-to-mermaid.ts",
82
83
  "eval:pairwise": "USE_PAIRWISE_EVAL=true tsx evaluations",
83
84
  "python:check": "cd evaluations/programmatic/python && just check",
84
85
  "python:test": "cd evaluations/programmatic/python && just test",
@@ -1 +0,0 @@
1
- export declare const COMMON_PATTERNS = "\n## Common Parameter Update Patterns\n\n### HTTP Request Node Updates\n- URL: Set directly or use expressions\n- Method: GET, POST, PUT, DELETE, etc.\n- Headers: Add/update in headerParameters.parameters array\n- Body: Update bodyParameters.parameters for POST/PUT\n- Authentication: Update authentication settings";
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMMON_PATTERNS = void 0;
4
- exports.COMMON_PATTERNS = `
5
- ## Common Parameter Update Patterns
6
-
7
- ### HTTP Request Node Updates
8
- - URL: Set directly or use expressions
9
- - Method: GET, POST, PUT, DELETE, etc.
10
- - Headers: Add/update in headerParameters.parameters array
11
- - Body: Update bodyParameters.parameters for POST/PUT
12
- - Authentication: Update authentication settings`;
13
- //# sourceMappingURL=common-patterns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common-patterns.js","sourceRoot":"","sources":["../../../../src/chains/prompts/base/common-patterns.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;;;;;;;;iDAQkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-instructions.js","sourceRoot":"","sources":["../../../../src/chains/prompts/base/core-instructions.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;qMAwBoK,CAAC"}
@@ -1 +0,0 @@
1
- export declare const EXPRESSION_RULES = "\n## CRITICAL: Correctly Formatting n8n Expressions\nWhen using expressions to reference data from other nodes:\n- ALWAYS use the format: `={{ $('Node Name').item.json.field }}`\n- NEVER omit the equals sign before the double curly braces\n- ALWAYS use DOUBLE curly braces, never single\n- NEVER use emojis or special characters inside expressions as they will break the expression\n- INCORRECT: `{ $('Node Name').item.json.field }` (missing =, single braces)\n- INCORRECT: `{{ $('Node Name').item.json.field }}` (missing =)\n- INCORRECT: `={{ $('\uD83D\uDC4D Node').item.json.field }}` (contains emoji)\n- CORRECT: `={{ $('Previous Node').item.json.field }}`";
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EXPRESSION_RULES = void 0;
4
- exports.EXPRESSION_RULES = `
5
- ## CRITICAL: Correctly Formatting n8n Expressions
6
- When using expressions to reference data from other nodes:
7
- - ALWAYS use the format: \`={{ $('Node Name').item.json.field }}\`
8
- - NEVER omit the equals sign before the double curly braces
9
- - ALWAYS use DOUBLE curly braces, never single
10
- - NEVER use emojis or special characters inside expressions as they will break the expression
11
- - INCORRECT: \`{ $('Node Name').item.json.field }\` (missing =, single braces)
12
- - INCORRECT: \`{{ $('Node Name').item.json.field }}\` (missing =)
13
- - INCORRECT: \`={{ $('👍 Node').item.json.field }}\` (contains emoji)
14
- - CORRECT: \`={{ $('Previous Node').item.json.field }}\``;
15
- //# sourceMappingURL=expression-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expression-rules.js","sourceRoot":"","sources":["../../../../src/chains/prompts/base/expression-rules.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;;;;;;;;;;yDAUyB,CAAC"}
@@ -1 +0,0 @@
1
- export declare const OUTPUT_FORMAT = "\n## Output Format\nReturn ONLY the complete updated parameters object that matches the node's parameter structure. Include ALL parameters, both modified and unmodified.";
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OUTPUT_FORMAT = void 0;
4
- exports.OUTPUT_FORMAT = `
5
- ## Output Format
6
- Return ONLY the complete updated parameters object that matches the node's parameter structure. Include ALL parameters, both modified and unmodified.`;
7
- //# sourceMappingURL=output-format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output-format.js","sourceRoot":"","sources":["../../../../src/chains/prompts/base/output-format.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;;sJAEyH,CAAC"}
@@ -1 +0,0 @@
1
- export declare const RESOURCE_LOCATOR_EXAMPLES = "\n### ResourceLocator Examples\n\n#### Example 1: Slack Node - Channel by ID\nCurrent Parameters:\n{\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"value\": \"\",\n \"mode\": \"list\"\n },\n \"otherOptions\": {}\n}\n\nRequested Changes: Send to channel C0122KQ70S7E\n\nExpected Output:\n{\n \"select\": \"channel\",\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"C0122KQ70S7E\"\n },\n \"otherOptions\": {}\n}\n\n#### Example 2: Google Drive Node - File by URL\nCurrent Parameters:\n{\n \"operation\": \"download\",\n \"fileId\": {\n \"__rl\": true,\n \"value\": \"\",\n \"mode\": \"list\"\n }\n}\n\nRequested Changes: Use file https://drive.google.com/file/d/1ABC123XYZ/view\n\nExpected Output:\n{\n \"operation\": \"download\",\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://drive.google.com/file/d/1ABC123XYZ/view\"\n }\n}\n\n#### Example 3: Notion Node - Page ID from Expression\nCurrent Parameters:\n{\n \"resource\": \"databasePage\",\n \"operation\": \"get\",\n \"pageId\": {\n \"__rl\": true,\n \"value\": \"hardcoded-page-id\",\n \"mode\": \"id\"\n }\n}\n\nRequested Changes: Use page ID from the previous node's output\n\nExpected Output:\n{\n \"resource\": \"databasePage\",\n \"operation\": \"get\",\n \"pageId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Previous Node').item.json.pageId }}\"\n }\n}";
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-locator-examples.js","sourceRoot":"","sources":["../../../../../src/chains/prompts/examples/advanced/resource-locator-examples.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EvC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const TOOL_NODE_EXAMPLES = "\n### Tool Node Examples\n\n#### Example 1: Gmail Tool - Send Email with AI\nCurrent Parameters: {}\nRequested Changes: Let AI determine recipient, subject, and message\nExpected Output:\n{\n \"sendTo\": \"={{ $fromAI('to') }}\",\n \"subject\": \"={{ $fromAI('subject') }}\",\n \"message\": \"={{ $fromAI('message_html') }}\",\n \"options\": {}\n}\n\n#### Example 2: Google Calendar Tool - Filter by Date\nCurrent Parameters:\n{\n \"operation\": \"getAll\",\n \"calendar\": {\n \"__rl\": true,\n \"value\": \"primary\",\n \"mode\": \"list\"\n }\n}\n\nRequested Changes: Let AI determine date range for filtering\n\nExpected Output:\n{\n \"operation\": \"getAll\",\n \"calendar\": {\n \"__rl\": true,\n \"value\": \"primary\",\n \"mode\": \"list\"\n },\n \"timeMin\": \"={{ $fromAI('After', '', 'string') }}\",\n \"timeMax\": \"={{ $fromAI('Before', '', 'string') }}\"\n}\n\n#### Example 3: Slack Tool - Send Message\nCurrent Parameters:\n{\n \"resource\": \"message\"\n}\n\nRequested Changes: Let AI determine channel and message content\n\nExpected Output:\n{\n \"resource\": \"message\",\n \"channelId\": \"={{ $fromAI('channel') }}\",\n \"messageText\": \"={{ $fromAI('message') }}\"\n}\n\n#### Example 4: Tool Node with Mixed Content\nCurrent Parameters:\n{\n \"sendTo\": \"admin@company.com\"\n}\n\nRequested Changes: Keep admin email but let AI add additional recipients and determine subject\n\nExpected Output:\n{\n \"sendTo\": \"=admin@company.com, {{ $fromAI('additional_recipients') }}\",\n \"subject\": \"={{ $fromAI('subject') }} - Automated Report\"\n}";
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-node-examples.js","sourceRoot":"","sources":["../../../../../src/chains/prompts/examples/advanced/tool-node-examples.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEhC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const IF_NODE_EXAMPLES = "\n### IF Node Examples\n\n#### Example 1: Simple String Condition\nCurrent Parameters: {}\nRequested Changes: Check if order status equals \"pending\"\nExpected Output:\n{\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": false,\n \"leftValue\": \"\",\n \"typeValidation\": \"loose\"\n },\n \"conditions\": [\n {\n \"id\": \"id-1\",\n \"leftValue\": \"={{ $('Previous Node').item.json.orderStatus }}\",\n \"rightValue\": \"pending\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n }\n }\n ],\n \"combinator\": \"and\"\n }\n}\n\n#### Example 2: Check if Field Exists\nCurrent Parameters: {}\nRequested Changes: Check if email field exists in the data\nExpected Output:\n{\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": false,\n \"leftValue\": \"\",\n \"typeValidation\": \"loose\"\n },\n \"conditions\": [\n {\n \"id\": \"id-1\",\n \"leftValue\": \"={{ $('Previous Node').item.json.email }}\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"exists\"\n }\n }\n ],\n \"combinator\": \"and\"\n }\n}\n\n#### Example 3: Multiple Conditions with AND\nCurrent Parameters: {}\nRequested Changes: Check if status is active AND score is 50 or higher\nExpected Output:\n{\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": false,\n \"leftValue\": \"\",\n \"typeValidation\": \"loose\"\n },\n \"conditions\": [\n {\n \"id\": \"id-1\",\n \"leftValue\": \"={{ $('Set').item.json.status }}\",\n \"rightValue\": \"active\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\"\n }\n },\n {\n \"id\": \"id-2\",\n \"leftValue\": \"={{ $('Set').item.json.score }}\",\n \"rightValue\": \"50\",\n \"operator\": {\n \"type\": \"number\",\n \"operation\": \"gte\"\n }\n }\n ],\n \"combinator\": \"and\"\n }\n}\n\n#### Example 3: IF Node - Complex Multi-Type Conditions\nCurrent Parameters: {}\n\nRequested Changes:\n- Check if email is not empty AND verified is true AND permissions array contains \"write\"\n\nExpected Output:\n{\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": true,\n \"leftValue\": \"\",\n \"typeValidation\": \"strict\"\n },\n \"conditions\": [\n {\n \"id\": \"id-1\",\n \"leftValue\": \"={{ $('Set').item.json.email }}\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"notEmpty\"\n }\n },\n {\n \"id\": \"id-2\",\n \"leftValue\": \"={{ $('Set').item.json.verified }}\",\n \"operator\": {\n \"type\": \"boolean\",\n \"operation\": \"true\"\n }\n },\n {\n \"id\": \"id-3\",\n \"leftValue\": \"={{ $('Set').item.json.permissions }}\",\n \"rightValue\": \"write\",\n \"operator\": {\n \"type\": \"array\",\n \"operation\": \"contains\"\n }\n }\n ],\n \"combinator\": \"and\"\n }\n}\n";
@@ -1 +0,0 @@
1
- {"version":3,"file":"if-node-examples.js","sourceRoot":"","sources":["../../../../../src/chains/prompts/examples/basic/if-node-examples.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqI/B,CAAC"}
@@ -1 +0,0 @@
1
- export declare const SET_NODE_EXAMPLES = "\n### Set Node Examples\n\n#### Example 1: Simple String Assignment\nCurrent Parameters: {}\nRequested Changes: Set message to \"Hello World\"\nExpected Output:\n{\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"id-1\",\n \"name\": \"message\",\n \"value\": \"Hello World\",\n \"type\": \"string\"\n }\n ]\n },\n \"options\": {}\n}\n\n#### Example 2: Multiple Type Assignments\nCurrent Parameters: {}\nRequested Changes:\n- Set productName to \"Widget\"\n- Set price to 19.99\n- Set inStock to true\n- Set categories to electronics and gadgets\n\nExpected Output:\n{\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"id-1\",\n \"name\": \"productName\",\n \"value\": \"Widget\",\n \"type\": \"string\"\n },\n {\n \"id\": \"id-2\",\n \"name\": \"price\",\n \"value\": 19.99,\n \"type\": \"number\"\n },\n {\n \"id\": \"id-3\",\n \"name\": \"inStock\",\n \"value\": true,\n \"type\": \"boolean\"\n },\n {\n \"id\": \"id-4\",\n \"name\": \"categories\",\n \"value\": \"[\\\"electronics\\\", \\\"gadgets\\\"]\",\n \"type\": \"array\"\n }\n ]\n },\n \"options\": {}\n}\n\n#### Example 3: Expression-Based Assignments\nCurrent Parameters: {}\nRequested Changes:\n- Set userId from HTTP Request node\n- Calculate totalPrice from quantity and unit price\n\nExpected Output:\n{\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"id-1\",\n \"name\": \"userId\",\n \"value\": \"={{ $('HTTP Request').item.json.id }}\",\n \"type\": \"string\"\n },\n {\n \"id\": \"id-2\",\n \"name\": \"totalPrice\",\n \"value\": \"={{ $('Set').item.json.quantity * $('Set').item.json.unitPrice }}\",\n \"type\": \"number\"\n }\n ]\n },\n \"options\": {}\n}\n\n#### Example 4: Set Node - Complex Object and Array Creation\nCurrent Parameters:\n{\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"existing-1\",\n \"name\": \"orderId\",\n \"value\": \"12345\",\n \"type\": \"string\"\n }\n ]\n },\n \"options\": {}\n}\n\nRequested Changes:\n- Keep orderId\n- Add customer object with name and email from previous nodes\n- Add items array from JSON string\n- Set processed timestamp\n\nExpected Output:\n{\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"existing-1\",\n \"name\": \"orderId\",\n \"value\": \"12345\",\n \"type\": \"string\"\n },\n {\n \"id\": \"id-2\",\n \"name\": \"customer\",\n \"value\": \"={{ JSON.stringify({ \\\"name\\\": $('Form').item.json.customerName, \\\"email\\\": $('Form').item.json.customerEmail }) }}\",\n \"type\": \"object\"\n },\n {\n \"id\": \"id-3\",\n \"name\": \"items\",\n \"value\": \"={{ $('HTTP Request').item.json.itemsJson }}\",\n \"type\": \"array\"\n },\n {\n \"id\": \"id-4\",\n \"name\": \"processedAt\",\n \"value\": \"={{ $now.toISO() }}\",\n \"type\": \"string\"\n }\n ]\n },\n \"options\": {}\n}\n";
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-node-examples.js","sourceRoot":"","sources":["../../../../../src/chains/prompts/examples/basic/set-node-examples.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+IhC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const SIMPLE_UPDATE_EXAMPLES = "\n## Examples of Parameter Updates\n\n### Example 1: Update HTTP Request URL\nChange: \"Set the URL to call the weather API for London\"\nCurrent parameters: { \"url\": \"https://api.example.com\", \"method\": \"GET\" }\nUpdated parameters: { \"url\": \"https://api.openweathermap.org/data/2.5/weather?q=London\", \"method\": \"GET\" }\n\n### Example 2: Add a header\nChange: \"Add an API key header with value from credentials\"\nCurrent parameters: { \"url\": \"...\", \"sendHeaders\": false }\nUpdated parameters: {\n \"url\": \"...\",\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"X-API-Key\",\n \"value\": \"={{ $credentials.apiKey }}\"\n }\n ]\n }\n}\n\n### Example 3: Update condition\nChange: \"Check if temperature is above 25 degrees\"\nCurrent parameters: { \"conditions\": { \"conditions\": [] } }\nUpdated parameters: {\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": false,\n \"leftValue\": \"\",\n \"typeValidation\": \"loose\"\n },\n \"conditions\": [\n {\n \"leftValue\": \"={{ $('Weather Node').item.json.main.temp }}\",\n \"rightValue\": 25,\n \"operator\": {\n \"type\": \"number\",\n \"operation\": \"gt\"\n }\n }\n ],\n \"combinator\": \"and\"\n }\n}";
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-updates.js","sourceRoot":"","sources":["../../../../../src/chains/prompts/examples/basic/simple-updates.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CpC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const instanceUrlPrompt = "\n<instance_url>\nThe n8n instance base URL is: {instanceUrl}\n\nThis URL is essential for webhook nodes and chat triggers as it provides the base URL for:\n- Webhook URLs that external services need to call\n- Chat trigger URLs for conversational interfaces\n- Any node that requires the full instance URL to generate proper callback URLs\n\nWhen working with webhook or chat trigger nodes, use this URL as the base for constructing proper endpoint URLs.\n</instance_url>\n";
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance-url.js","sourceRoot":"","sources":["../../../src/chains/prompts/instance-url.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;CAWhC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const HTTP_REQUEST_GUIDE = "\n### HTTP Request Node Updates\n\n#### Common Parameters\n- **url**: The endpoint URL (can use expressions)\n- **method**: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS\n- **authentication**: Type of auth (none, genericCredentialType, etc.)\n- **sendHeaders**: Boolean to enable custom headers\n- **headerParameters**: Array of header key-value pairs\n- **sendBody**: Boolean to enable request body (for POST/PUT/PATCH)\n- **bodyParameters**: Array of body parameters or raw body content\n- **contentType**: json, form, raw, etc.\n- **options**: Additional options like timeout, proxy, etc.\n\n#### Header Structure\n{\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"Header-Name\",\n \"value\": \"Header Value or {{ expression }}\"\n }\n ]\n }\n}\n\n#### Body Structure (JSON)\n{\n \"sendBody\": true,\n \"contentType\": \"json\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"fieldName\",\n \"value\": \"fieldValue or {{ expression }}\"\n }\n ]\n }\n}\n\n#### Authentication Options\n- **none**: No authentication\n- **genericCredentialType**: Use stored credentials\n- **predefinedCredentialType**: Use specific credential type\n- Can also set custom auth headers\n\n#### Common Patterns\n1. **Adding API Key Header**:\n - Enable sendHeaders\n - Add header with name \"X-API-Key\" or \"Authorization\"\n\n2. **Setting Request Body**:\n - Enable sendBody\n - Set contentType (usually \"json\")\n - Add parameters to bodyParameters.parameters array\n\n3. **Dynamic URLs**:\n - Can use expressions: \"=https://api.example.com/{{ $('Set').item.json.endpoint }}\"\n - Can reference previous node data\n\n4. **Query Parameters**:\n - Can be part of URL or set in options.queryParameters\n\n#### Example: HTTP Request with Headers and Body\nCurrent Parameters:\n{\n \"method\": \"GET\",\n \"url\": \"https://api.example.com/data\"\n}\n\nRequested Changes:\n- Change to POST method\n- Add API key header\n- Add JSON body with user ID and status\n\nExpected Output:\n{\n \"method\": \"POST\",\n \"url\": \"https://api.example.com/data\",\n \"sendHeaders\": true,\n \"headerParameters\": {\n \"parameters\": [\n {\n \"name\": \"X-API-Key\",\n \"value\": \"={{ $credentials.apiKey }}\"\n },\n {\n \"name\": \"Content-Type\",\n \"value\": \"application/json\"\n }\n ]\n },\n \"sendBody\": true,\n \"contentType\": \"json\",\n \"bodyParameters\": {\n \"parameters\": [\n {\n \"name\": \"userId\",\n \"value\": \"={{ $('Previous Node').item.json.id }}\"\n },\n {\n \"name\": \"status\",\n \"value\": \"active\"\n }\n ]\n },\n \"options\": {}\n}";
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-request.js","sourceRoot":"","sources":["../../../../src/chains/prompts/node-types/http-request.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4GhC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const IF_NODE_GUIDE = "\n### IF Node Updates - Comprehensive Guide\n\nThe IF node uses a complex filter structure for conditional logic. Understanding the correct operator format is crucial.\n\n#### IF Node Structure\n```json\n{\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": false, // For string comparisons\n \"leftValue\": \"\", // Optional default left value\n \"typeValidation\": \"loose\" // \"strict\" or \"loose\"\n },\n \"conditions\": [\n {\n \"id\": \"unique-id\", // Optional, auto-generated\n \"leftValue\": \"={{ $('Node').item.json.field }}\",\n \"rightValue\": \"value\", // Can be expression or literal\n \"operator\": {\n \"type\": \"string|number|boolean|dateTime|array|object\",\n \"operation\": \"specific-operation\"\n }\n }\n ],\n \"combinator\": \"and\" // \"and\" or \"or\"\n }\n}\n```\n\n#### Complete Operator Reference\n\n##### String Operators\n- **exists**: Check if value exists (singleValue: true, no rightValue needed)\n `{ \"type\": \"string\", \"operation\": \"exists\" }`\n- **notExists**: Check if value doesn't exist (singleValue: true)\n `{ \"type\": \"string\", \"operation\": \"notExists\" }`\n- **empty**: Check if string is empty (singleValue: true)\n `{ \"type\": \"string\", \"operation\": \"empty\" }`\n- **notEmpty**: Check if string is not empty (singleValue: true)\n `{ \"type\": \"string\", \"operation\": \"notEmpty\" }`\n- **equals**: Exact match\n `{ \"type\": \"string\", \"operation\": \"equals\" }`\n- **notEquals**: Not equal\n `{ \"type\": \"string\", \"operation\": \"notEquals\" }`\n- **contains**: Contains substring\n `{ \"type\": \"string\", \"operation\": \"contains\" }`\n- **notContains**: Doesn't contain substring\n `{ \"type\": \"string\", \"operation\": \"notContains\" }`\n- **startsWith**: Starts with string\n `{ \"type\": \"string\", \"operation\": \"startsWith\" }`\n- **notStartsWith**: Doesn't start with\n `{ \"type\": \"string\", \"operation\": \"notStartsWith\" }`\n- **endsWith**: Ends with string\n `{ \"type\": \"string\", \"operation\": \"endsWith\" }`\n- **notEndsWith**: Doesn't end with\n `{ \"type\": \"string\", \"operation\": \"notEndsWith\" }`\n- **regex**: Matches regex pattern\n `{ \"type\": \"string\", \"operation\": \"regex\" }`\n- **notRegex**: Doesn't match regex\n `{ \"type\": \"string\", \"operation\": \"notRegex\" }`\n\n##### Number Operators\n- **exists**: Check if number exists (singleValue: true)\n `{ \"type\": \"number\", \"operation\": \"exists\" }`\n- **notExists**: Check if number doesn't exist (singleValue: true)\n `{ \"type\": \"number\", \"operation\": \"notExists\" }`\n- **equals**: Equal to\n `{ \"type\": \"number\", \"operation\": \"equals\" }`\n- **notEquals**: Not equal to\n `{ \"type\": \"number\", \"operation\": \"notEquals\" }`\n- **gt**: Greater than\n `{ \"type\": \"number\", \"operation\": \"gt\" }`\n- **lt**: Less than\n `{ \"type\": \"number\", \"operation\": \"lt\" }`\n- **gte**: Greater than or equal\n `{ \"type\": \"number\", \"operation\": \"gte\" }`\n- **lte**: Less than or equal\n `{ \"type\": \"number\", \"operation\": \"lte\" }`\n\n##### DateTime Operators\n- **exists**: Check if date exists (singleValue: true)\n `{ \"type\": \"dateTime\", \"operation\": \"exists\" }`\n- **notExists**: Check if date doesn't exist (singleValue: true)\n `{ \"type\": \"dateTime\", \"operation\": \"notExists\" }`\n- **equals**: Same date/time\n `{ \"type\": \"dateTime\", \"operation\": \"equals\" }`\n- **notEquals**: Different date/time\n `{ \"type\": \"dateTime\", \"operation\": \"notEquals\" }`\n- **after**: After date\n `{ \"type\": \"dateTime\", \"operation\": \"after\" }`\n- **before**: Before date\n `{ \"type\": \"dateTime\", \"operation\": \"before\" }`\n- **afterOrEquals**: After or same date\n `{ \"type\": \"dateTime\", \"operation\": \"afterOrEquals\" }`\n- **beforeOrEquals**: Before or same date\n `{ \"type\": \"dateTime\", \"operation\": \"beforeOrEquals\" }`\n\n##### Boolean Operators\n- **exists**: Check if boolean exists (singleValue: true)\n `{ \"type\": \"boolean\", \"operation\": \"exists\" }`\n- **notExists**: Check if boolean doesn't exist (singleValue: true)\n `{ \"type\": \"boolean\", \"operation\": \"notExists\" }`\n- **true**: Is true (singleValue: true)\n `{ \"type\": \"boolean\", \"operation\": \"true\" }`\n- **false**: Is false (singleValue: true)\n `{ \"type\": \"boolean\", \"operation\": \"false\" }`\n- **equals**: Equal to boolean value\n `{ \"type\": \"boolean\", \"operation\": \"equals\" }`\n- **notEquals**: Not equal to boolean value\n `{ \"type\": \"boolean\", \"operation\": \"notEquals\" }`\n\n##### Array Operators\n- **exists**: Check if array exists (singleValue: true)\n `{ \"type\": \"array\", \"operation\": \"exists\" }`\n- **notExists**: Check if array doesn't exist (singleValue: true)\n `{ \"type\": \"array\", \"operation\": \"notExists\" }`\n- **empty**: Array is empty (singleValue: true)\n `{ \"type\": \"array\", \"operation\": \"empty\" }`\n- **notEmpty**: Array is not empty (singleValue: true)\n `{ \"type\": \"array\", \"operation\": \"notEmpty\" }`\n- **contains**: Array contains value\n `{ \"type\": \"array\", \"operation\": \"contains\" }`\n- **notContains**: Array doesn't contain value\n `{ \"type\": \"array\", \"operation\": \"notContains\" }`\n- **lengthEquals**: Array length equals\n `{ \"type\": \"array\", \"operation\": \"lengthEquals\" }`\n- **lengthNotEquals**: Array length not equals\n `{ \"type\": \"array\", \"operation\": \"lengthNotEquals\" }`\n- **lengthGt**: Array length greater than\n `{ \"type\": \"array\", \"operation\": \"lengthGt\" }`\n- **lengthLt**: Array length less than\n `{ \"type\": \"array\", \"operation\": \"lengthLt\" }`\n- **lengthGte**: Array length greater or equal\n `{ \"type\": \"array\", \"operation\": \"lengthGte\" }`\n- **lengthLte**: Array length less or equal\n `{ \"type\": \"array\", \"operation\": \"lengthLte\" }`\n\n##### Object Operators\n- **exists**: Check if object exists (singleValue: true)\n `{ \"type\": \"object\", \"operation\": \"exists\" }`\n- **notExists**: Check if object doesn't exist (singleValue: true)\n `{ \"type\": \"object\", \"operation\": \"notExists\" }`\n- **empty**: Object is empty (singleValue: true)\n `{ \"type\": \"object\", \"operation\": \"empty\" }`\n- **notEmpty**: Object is not empty (singleValue: true)\n `{ \"type\": \"object\", \"operation\": \"notEmpty\" }`\n\n#### Important Notes:\n1. **singleValue operators**: When using exists, notExists, empty, notEmpty, true, or false operators, DO NOT include a rightValue in the condition\n2. **Expression values**: Both leftValue and rightValue can be expressions using `={{ ... }}` syntax\n3. **Type matching**: The operator type must match the data type you're comparing\n4. **Case sensitivity**: Only applies to string comparisons when caseSensitive is true in options\n5. **Type validation**: \"loose\" allows type coercion, \"strict\" requires exact type matches";
@@ -1 +0,0 @@
1
- {"version":3,"file":"if-node.js","sourceRoot":"","sources":["../../../../src/chains/prompts/node-types/if-node.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FAyJ8D,CAAC"}
@@ -1 +0,0 @@
1
- export declare const SET_NODE_GUIDE = "\n### Set Node Updates - Comprehensive Type Handling Guide\n\nThe Set node uses assignments to create or modify data fields. Each assignment has a specific type that determines how the value is formatted and processed.\n\n#### Assignment Structure\n```json\n{\n \"id\": \"unique-id\",\n \"name\": \"field_name\",\n \"value\": \"field_value\", // Format depends on type\n \"type\": \"string|number|boolean|array|object\"\n}\n```\n\n**CRITICAL**: ALWAYS use \"value\" field for ALL types. NEVER use type-specific fields like \"stringValue\", \"numberValue\", \"booleanValue\", etc. The field is ALWAYS named \"value\" regardless of the type.\n\n#### Type-Specific Value Formatting\n\n##### String Type\n- **Format**: Direct string value or expression\n- **Examples**:\n - Literal: `\"Hello World\"`\n - Expression: `\"={{ $('Previous Node').item.json.message }}\"`\n - With embedded expressions: `\"=Order #{{ $('Set').item.json.orderId }} processed\"`\n- **Use when**: Text data, IDs, names, messages, dates as strings\n\n##### Number Type\n- **Format**: Direct numeric value (NOT as a string)\n- **Examples**:\n - Integer: `123`\n - Decimal: `45.67`\n - Negative: `-100`\n - Expression: `\"={{ $('HTTP Request').item.json.count }}\"`\n- **CRITICAL**: Use actual numbers, not strings: `123` not `\"123\"`\n- **Use when**: Quantities, prices, scores, numeric calculations\n\n##### Boolean Type\n- **Format**: Direct boolean value (NOT as a string)\n- **Examples**:\n - True: `true`\n - False: `false`\n - Expression: `\"={{ $('IF').item.json.isActive }}\"`\n- **CRITICAL**: Use actual booleans, not strings: `true` not `\"true\"`\n- **CRITICAL**: The field name is \"value\", NOT \"booleanValue\"\n- **Use when**: Flags, toggles, yes/no values, active/inactive states\n\n##### Array Type\n- **Format**: JSON stringified array\n- **Examples**:\n - Simple array: `\"[1, 2, 3]\"`\n - String array: `\"[\\\"apple\\\", \\\"banana\\\", \\\"orange\\\"]\"`\n - Mixed array: `\"[\\\"item1\\\", 123, true]\"`\n - Expression: `\"={{ JSON.stringify($('Previous Node').item.json.items) }}\"`\n- **CRITICAL**: Arrays must be JSON stringified\n- **Use when**: Lists, collections, multiple values\n\n##### Object Type\n- **Format**: JSON stringified object\n- **Examples**:\n - Simple object: `\"{ \\\"name\\\": \\\"John\\\", \\\"age\\\": 30 }\"`\n - Nested object: `\"{ \\\"user\\\": { \\\"id\\\": 123, \\\"role\\\": \\\"admin\\\" } }\"`\n - Expression: `\"={{ JSON.stringify($('Set').item.json.userData) }}\"`\n- **CRITICAL**: Objects must be JSON stringified with escaped quotes\n- **Use when**: Complex data structures, grouped properties\n\n#### Important Type Selection Rules\n\n1. **Analyze the requested data type**:\n - \"Set count to 5\" \u2192 number type with value: `5`\n - \"Set message to hello\" \u2192 string type with value: `\"hello\"`\n - \"Set active to true\" \u2192 boolean type with value: `true`\n - \"Set tags to apple, banana\" \u2192 array type with value: `\"[\\\"apple\\\", \\\"banana\\\"]\"`\n\n2. **Expression handling**:\n - All types can use expressions with `\"={{ ... }}\"`\n - For arrays/objects from expressions, use `JSON.stringify()`\n\n3. **Common mistakes to avoid**:\n - WRONG: Setting number as string: `{ \"value\": \"123\", \"type\": \"number\" }`\n - CORRECT: `{ \"value\": 123, \"type\": \"number\" }`\n - WRONG: Setting boolean as string: `{ \"value\": \"false\", \"type\": \"boolean\" }`\n - CORRECT: `{ \"value\": false, \"type\": \"boolean\" }`\n - WRONG: Using type-specific field names: `{ \"booleanValue\": true, \"type\": \"boolean\" }`\n - CORRECT: `{ \"value\": true, \"type\": \"boolean\" }`\n - WRONG: Setting array without stringification: `{ \"value\": [1,2,3], \"type\": \"array\" }`\n - CORRECT: `{ \"value\": \"[1,2,3]\", \"type\": \"array\" }`";
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-node.js","sourceRoot":"","sources":["../../../../src/chains/prompts/node-types/set-node.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAsF4B,CAAC"}
@@ -1 +0,0 @@
1
- export declare const TOOL_NODES_GUIDE = "\n## CRITICAL: $fromAI Expression Support for Tool Nodes\n\nTool nodes (nodes ending with \"Tool\" like Gmail Tool, Google Calendar Tool, etc.) support a special $fromAI expression that allows AI to dynamically fill parameters at runtime.\n\n### When to Use $fromAI\n- ONLY available in tool nodes (node types ending with \"Tool\")\n- Use when the AI should determine the value based on context\n- Ideal for parameters that vary based on user input or conversation context\n\n### $fromAI Syntax\n`={{ $fromAI('key', 'description', 'type', defaultValue) }}`\n\n### Parameters\n- key: Unique identifier (1-64 chars, alphanumeric/underscore/hyphen)\n- description: Optional description for the AI (use empty string '' if not needed)\n- type: 'string' | 'number' | 'boolean' | 'json' (defaults to 'string')\n- defaultValue: Optional fallback value\n\n### Tool Node Examples\n\n#### Gmail Tool - Sending Email\n{\n \"sendTo\": \"={{ $fromAI('to') }}\",\n \"subject\": \"={{ $fromAI('subject') }}\",\n \"message\": \"={{ $fromAI('message_html') }}\"\n}\n\n#### Google Calendar Tool - Filtering Events\n{\n \"timeMin\": \"={{ $fromAI('After', '', 'string') }}\",\n \"timeMax\": \"={{ $fromAI('Before', '', 'string') }}\"\n}\n\n### Mixed Usage Examples\nYou can combine $fromAI with regular text:\n- \"Subject: {{ $fromAI('subject') }} - Automated\"\n- \"Dear {{ $fromAI('recipientName', 'Customer name', 'string', 'Customer') }},\"\n\n### Important Rules\n1. ONLY use $fromAI in tool nodes (check if node type ends with \"Tool\")\n2. For timeMin/timeMax and similar date fields, use appropriate key names\n3. The AI will fill these values based on context during execution\n4. Don't use $fromAI in regular nodes like Set, IF, HTTP Request, etc.\n\n## Tool Node Parameter Guidelines\n\n### Identifying Tool Nodes\n1. CHECK NODE TYPE: If the node type ends with \"Tool\", it supports $fromAI expressions\n2. COMMON TOOL NODES:\n - Gmail Tool (gmailTool): to, subject, message \u2192 use $fromAI\n - Google Calendar Tool (googleCalendarTool): timeMin, timeMax \u2192 use $fromAI\n - Slack Tool (slackTool): channel, message \u2192 use $fromAI\n - Microsoft Teams Tool: channel, message \u2192 use $fromAI\n - Telegram Tool: chatId, text \u2192 use $fromAI\n - Other communication/document tools: content fields \u2192 use $fromAI\n\n### When to Use $fromAI in Tool Nodes\n1. DYNAMIC VALUES: Use $fromAI for values that should be determined by AI based on context\n2. USER INPUT FIELDS: Recipients, subjects, messages, date ranges\n3. PRESERVE EXISTING: If a parameter already uses $fromAI, keep it unless explicitly asked to change\n4. DATE/TIME FIELDS: Use descriptive key names for clarity\n\n### Tool Node Parameter Patterns\n- Email recipients: \"={{ $fromAI('to') }}\"\n- Email subjects: \"={{ $fromAI('subject') }}\"\n- Message content: \"={{ $fromAI('message_html') }}\" or \"={{ $fromAI('message') }}\"\n- Date ranges: \"={{ $fromAI('After', '', 'string') }}\"\n- Channel IDs: \"={{ $fromAI('channel') }}\"";
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-nodes.js","sourceRoot":"","sources":["../../../../src/chains/prompts/node-types/tool-nodes.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAoEW,CAAC"}
@@ -1 +0,0 @@
1
- export declare const RESOURCE_LOCATOR_GUIDE = "\n## IMPORTANT: ResourceLocator Parameter Handling\n\nResourceLocator parameters are special fields used for selecting resources like Slack channels, Google Drive files, Notion pages, etc. They MUST have a specific structure:\n\n### Required ResourceLocator Structure:\n```json\n{\n \"__rl\": true,\n \"mode\": \"id\" | \"url\" | \"list\" | \"name\",\n \"value\": \"the-actual-value\"\n}\n```\n\n### Mode Detection Guidelines:\n- Use mode \"url\" when the value is a URL (starts with http:// or https://)\n- Use mode \"id\" when the value looks like an ID (alphanumeric string)\n- Use mode \"name\" when the value has a prefix like # (Slack channels) or @ (users)\n- Use mode \"list\" when referencing a dropdown selection (rarely needed in updates)\n\n### ResourceLocator Examples:\n\n#### Example 1: Slack Channel by ID\nParameter name: channelId\nChange: \"Set channel to C0122KQ70S7E\"\nOutput:\n```json\n{\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"C0122KQ70S7E\"\n }\n}\n```\n\n#### Example 2: Google Drive File by URL\nParameter name: fileId\nChange: \"Use file https://drive.google.com/file/d/1Nvdl7bEfDW33cKQuwfItPhIk479--WYY/view\"\nOutput:\n```json\n{\n \"fileId\": {\n \"__rl\": true,\n \"mode\": \"url\",\n \"value\": \"https://drive.google.com/file/d/1Nvdl7bEfDW33cKQuwfItPhIk479--WYY/view\"\n }\n}\n```\n\n#### Example 3: Notion Page by ID\nParameter name: pageId\nChange: \"Set page ID to 123e4567-e89b-12d3\"\nOutput:\n```json\n{\n \"pageId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"123e4567-e89b-12d3\"\n }\n}\n```\n\n#### Example 4: Slack Channel by Name\nParameter name: channelId\nChange: \"Send to #general channel\"\nOutput:\n```json\n{\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"name\",\n \"value\": \"#general\"\n }\n}\n```\n\n#### Example 5: Using Expression with ResourceLocator\nParameter name: channelId\nChange: \"Use channel ID from previous node\"\nOutput:\n```json\n{\n \"channelId\": {\n \"__rl\": true,\n \"mode\": \"id\",\n \"value\": \"={{ $('Previous Node').item.json.channelId }}\"\n }\n}\n```";
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-locator.js","sourceRoot":"","sources":["../../../../src/chains/prompts/parameter-types/resource-locator.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0F/B,CAAC"}
@@ -1 +0,0 @@
1
- export declare const SYSTEM_MESSAGE_GUIDE = "\n## CRITICAL: System Message vs User Prompt Separation\n\nAI nodes (AI Agent, LLM Chain, Anthropic, OpenAI, etc.) have TWO distinct prompt fields that MUST be used correctly:\n\n### Field Separation\n1. **System Message** - Model's persistent identity, role, and instructions\n2. **User Message/Text** - Dynamic user context and data references per execution\n\n**Node-specific field names:**\n- AI Agent: `options.systemMessage` and `text`\n- LLM Chain: `messages.messageValues[]` with system role and `text`\n- Anthropic: `options.system` and `messages.values[]`\n- OpenAI: `messages.values[]` with role \"system\" vs \"user\"\n\n### System Message\nUse for STATIC, ROLE-DEFINING content:\n- Agent identity: \"You are a [role] agent...\"\n- Task description: \"Your task is to...\"\n- Step-by-step instructions: \"1. Do X, 2. Do Y, 3. Do Z\"\n- Behavioral guidelines: \"Always...\", \"Never...\"\n- Tool coordination: \"Call the Research Tool to..., then call...\"\n\n### Text Parameter\nUse for DYNAMIC, EXECUTION-SPECIFIC content:\n- User input: \"={{ $json.chatInput }}\"\n- Workflow context: \"=The research topic is: {{ $json.topic }}\"\n- Data from previous nodes: \"=Process this data: {{ $json.data }}\"\n- Variable context: \"=Analyze for user: {{ $json.userId }}\"\n\n### Common Mistakes to Avoid\n\n\u274C **WRONG - Everything in text field:**\n{\n \"text\": \"=You are an orchestrator agent that coordinates specialized agents. Your task is to: 1) Call Research Agent Tool, 2) Call Fact-Check Agent Tool, 3) Generate report. Research topic: {{ $json.researchTopic }}\"\n}\n\n\u2705 **CORRECT - Properly separated:**\n{\n \"text\": \"=The research topic is: {{ $json.researchTopic }}\",\n \"options\": {\n \"systemMessage\": \"You are an orchestrator agent that coordinates specialized agents.\\n\\nYour task is to:\\n1. Call the Research Agent Tool to gather information\\n2. Call the Fact-Check Agent Tool to verify findings\\n3. Generate a comprehensive report\\n\\nReturn ONLY the final report.\"\n }\n}\n\n### Update Pattern Examples\n\nExample 1 - AI Agent with orchestration:\nInstructions: [\n \"Set text to '=Research topic: {{ $json.researchTopic }}'\",\n \"Set system message to 'You are an orchestrator coordinating research tasks.\\n\\nSteps:\\n1. Call Research Agent Tool\\n2. Call Fact-Check Agent Tool\\n3. Call Report Writer Agent Tool\\n4. Return final HTML report'\"\n]\n\nExample 2 - Chat-based AI node:\nInstructions: [\n \"Set text to '=User question: {{ $json.chatInput }}'\",\n \"Set system message to 'You are a helpful customer support assistant. Answer questions clearly and professionally. Escalate to human if needed.'\"\n]\n\nExample 3 - Data processing with AI:\nInstructions: [\n \"Set text to '=Process this data: {{ $json.inputData }}'\",\n \"Set system message to 'You are a data analysis assistant.\\n\\nTasks:\\n1. Validate data structure\\n2. Calculate statistics\\n3. Identify anomalies\\n4. Return JSON with findings'\"\n]\n\n### Why This Matters\n- **Consistency**: System message stays the same across executions\n- **Maintainability**: Easy to update AI behavior without touching data flow\n- **Best Practice**: Follows standard AI prompt engineering patterns\n- **Clarity**: Separates \"what the AI model is\" from \"what data to process\"\n";
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-message.js","sourceRoot":"","sources":["../../../../src/chains/prompts/parameter-types/system-message.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsEnC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const TEXT_FIELDS_GUIDE = "\n## Text Field Expression Formatting\n\n### PREFERRED METHOD: Embedding expressions directly within text\n```\n\"text\": \"=ALERT: It is currently {{ $('Weather Node').item.json.weather }} in {{ $('Weather Node').item.json.city }}!\"\n```\n\n### Alternative method: Using string concatenation (use only when needed)\n```\n\"text\": \"={{ 'ALERT: It is currently ' + $('Weather Node').item.json.weather + ' in ' + $('Weather Node').item.json.city + '!' }}\"\n```\n\n### Key Points:\n- Use the embedded expression format when mixing static text with dynamic values\n- The entire string must start with = when using expressions\n- Expressions within text use single curly braces {{ }}\n- The outer expression wrapper uses double curly braces ={{ }}";
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-fields.js","sourceRoot":"","sources":["../../../../src/chains/prompts/parameter-types/text-fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;+DAiB8B,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { INodeTypeDescription } from 'n8n-workflow';
2
- import type { PromptBuilderContext } from '../../types/config';
3
- export declare class ParameterUpdatePromptBuilder {
4
- static buildSystemPrompt(context: PromptBuilderContext): string;
5
- private static hasSystemMessageParameters;
6
- private static isSetNode;
7
- private static isIfNode;
8
- private static isHttpRequestNode;
9
- private static isToolNode;
10
- private static needsResourceLocatorGuide;
11
- private static hasTextFields;
12
- private static selectRelevantExamples;
13
- static hasResourceLocatorParameters(nodeDefinition: INodeTypeDescription): boolean;
14
- static estimateTokens(prompt: string): number;
15
- }
@@ -1,140 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParameterUpdatePromptBuilder = void 0;
4
- const common_patterns_1 = require("./base/common-patterns");
5
- const core_instructions_1 = require("./base/core-instructions");
6
- const expression_rules_1 = require("./base/expression-rules");
7
- const output_format_1 = require("./base/output-format");
8
- const resource_locator_examples_1 = require("./examples/advanced/resource-locator-examples");
9
- const tool_node_examples_1 = require("./examples/advanced/tool-node-examples");
10
- const if_node_examples_1 = require("./examples/basic/if-node-examples");
11
- const set_node_examples_1 = require("./examples/basic/set-node-examples");
12
- const simple_updates_1 = require("./examples/basic/simple-updates");
13
- const http_request_1 = require("./node-types/http-request");
14
- const if_node_1 = require("./node-types/if-node");
15
- const set_node_1 = require("./node-types/set-node");
16
- const tool_nodes_1 = require("./node-types/tool-nodes");
17
- const resource_locator_1 = require("./parameter-types/resource-locator");
18
- const system_message_1 = require("./parameter-types/system-message");
19
- const text_fields_1 = require("./parameter-types/text-fields");
20
- const prompt_config_1 = require("./prompt-config");
21
- class ParameterUpdatePromptBuilder {
22
- static buildSystemPrompt(context) {
23
- const options = context.options ?? {};
24
- const sections = [];
25
- sections.push(core_instructions_1.CORE_INSTRUCTIONS);
26
- sections.push(expression_rules_1.EXPRESSION_RULES);
27
- if (this.hasSystemMessageParameters(context.nodeDefinition)) {
28
- sections.push(system_message_1.SYSTEM_MESSAGE_GUIDE);
29
- }
30
- else if (this.isSetNode(context.nodeType)) {
31
- sections.push(set_node_1.SET_NODE_GUIDE);
32
- }
33
- else if (this.isIfNode(context.nodeType)) {
34
- sections.push(if_node_1.IF_NODE_GUIDE);
35
- }
36
- else if (this.isHttpRequestNode(context.nodeType)) {
37
- sections.push(http_request_1.HTTP_REQUEST_GUIDE);
38
- }
39
- if (this.isToolNode(context.nodeType)) {
40
- sections.push(tool_nodes_1.TOOL_NODES_GUIDE);
41
- }
42
- if (context.hasResourceLocatorParams || this.needsResourceLocatorGuide(context)) {
43
- sections.push(resource_locator_1.RESOURCE_LOCATOR_GUIDE);
44
- }
45
- if (this.hasTextFields(context.nodeDefinition)) {
46
- sections.push(text_fields_1.TEXT_FIELDS_GUIDE);
47
- }
48
- sections.push(common_patterns_1.COMMON_PATTERNS);
49
- if (options.includeExamples !== false) {
50
- const examples = this.selectRelevantExamples(context);
51
- if (examples.length > 0) {
52
- sections.push('\n## Relevant Examples');
53
- sections.push.apply(sections, examples);
54
- }
55
- }
56
- sections.push(output_format_1.OUTPUT_FORMAT);
57
- const finalPrompt = sections.join('\n');
58
- return finalPrompt;
59
- }
60
- static hasSystemMessageParameters(nodeDefinition) {
61
- if (!nodeDefinition.properties)
62
- return false;
63
- const hasSystemMessageParam = nodeDefinition.properties.some((prop) => {
64
- if (prop.name === 'options' && prop.type === 'collection') {
65
- const collectionProp = prop;
66
- if (Array.isArray(collectionProp.options)) {
67
- return collectionProp.options.some((opt) => opt.name === 'systemMessage' || opt.name === 'system');
68
- }
69
- }
70
- if (prop.name === 'messages' &&
71
- (prop.type === 'fixedCollection' || prop.type === 'collection')) {
72
- return true;
73
- }
74
- return false;
75
- });
76
- return hasSystemMessageParam;
77
- }
78
- static isSetNode(nodeType) {
79
- const category = (0, prompt_config_1.getNodeTypeCategory)(nodeType);
80
- return category === 'set';
81
- }
82
- static isIfNode(nodeType) {
83
- const category = (0, prompt_config_1.getNodeTypeCategory)(nodeType);
84
- return category === 'if';
85
- }
86
- static isHttpRequestNode(nodeType) {
87
- const category = (0, prompt_config_1.getNodeTypeCategory)(nodeType);
88
- return category === 'httpRequest';
89
- }
90
- static isToolNode(nodeType) {
91
- const category = (0, prompt_config_1.getNodeTypeCategory)(nodeType);
92
- return category === 'tool';
93
- }
94
- static needsResourceLocatorGuide(context) {
95
- return (0, prompt_config_1.mentionsResourceKeywords)(context.requestedChanges, context.config);
96
- }
97
- static hasTextFields(nodeDefinition) {
98
- if (!nodeDefinition.properties)
99
- return false;
100
- return nodeDefinition.properties.some((prop) => prop.type === 'string' && prop.typeOptions?.multipleValues !== true);
101
- }
102
- static selectRelevantExamples(context) {
103
- const examples = [];
104
- const config = context.config ?? prompt_config_1.DEFAULT_PROMPT_CONFIG;
105
- const maxExamples = context.options?.maxExamples ?? config.maxExamples;
106
- if (this.isToolNode(context.nodeType)) {
107
- examples.push(tool_node_examples_1.TOOL_NODE_EXAMPLES);
108
- }
109
- else if (this.isSetNode(context.nodeType)) {
110
- examples.push(set_node_examples_1.SET_NODE_EXAMPLES);
111
- }
112
- else if (this.isIfNode(context.nodeType)) {
113
- examples.push(if_node_examples_1.IF_NODE_EXAMPLES);
114
- }
115
- if (context.hasResourceLocatorParams) {
116
- examples.push(resource_locator_examples_1.RESOURCE_LOCATOR_EXAMPLES);
117
- }
118
- if (examples.length === 0) {
119
- examples.push(simple_updates_1.SIMPLE_UPDATE_EXAMPLES);
120
- }
121
- return examples.slice(0, maxExamples);
122
- }
123
- static hasResourceLocatorParameters(nodeDefinition) {
124
- if (!nodeDefinition.properties)
125
- return false;
126
- const checkProperties = (properties) => {
127
- for (const prop of properties) {
128
- if (prop.type === 'resourceLocator' || prop.type === 'fixedCollection')
129
- return true;
130
- }
131
- return false;
132
- };
133
- return checkProperties(nodeDefinition.properties);
134
- }
135
- static estimateTokens(prompt) {
136
- return Math.ceil(prompt.length / 4);
137
- }
138
- }
139
- exports.ParameterUpdatePromptBuilder = ParameterUpdatePromptBuilder;
140
- //# sourceMappingURL=prompt-builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../../src/chains/prompts/prompt-builder.ts"],"names":[],"mappings":";;;AAEA,4DAAyD;AACzD,gEAA6D;AAC7D,8DAA2D;AAC3D,wDAAqD;AACrD,6FAA0F;AAC1F,+EAA4E;AAC5E,wEAAqE;AACrE,0EAAuE;AACvE,oEAAyE;AACzE,4DAA+D;AAC/D,kDAAqD;AACrD,oDAAuD;AACvD,wDAA2D;AAC3D,yEAA4E;AAC5E,qEAAwE;AACxE,+DAAkE;AAClE,mDAIyB;AAGzB,MAAa,4BAA4B;IAIxC,MAAM,CAAC,iBAAiB,CAAC,OAA6B;QACrD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;QACtC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAG9B,QAAQ,CAAC,IAAI,CAAC,qCAAiB,CAAC,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,mCAAgB,CAAC,CAAC;QAGhC,IAAI,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YAC7D,QAAQ,CAAC,IAAI,CAAC,qCAAoB,CAAC,CAAC;QACrC,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7C,QAAQ,CAAC,IAAI,CAAC,yBAAc,CAAC,CAAC;QAC/B,CAAC;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,QAAQ,CAAC,IAAI,CAAC,uBAAa,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,QAAQ,CAAC,IAAI,CAAC,iC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AC,IAAI,CAAC,uCAAsB,CAAC,CAAC;QACvC,CAAC;QAGD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC;IAKD,MAAM,CAAC,4BAA4B,CAAC,cAAoC;QACvE,IAAI,CAAC,cAAc,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QAE7C,MAAM,eAAe,GAAG,CAAC,UAA6B,EAAW,EAAE;YAClE,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;gBAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB;oBAAE,OAAO,IAAI,CAAC;YACrF,CAAC;YACD,OAAO,KAAK,CAAC;QACd,CAAC,CAAC;QAEF,OAAO,eAAe,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAKD,MAAM,CAAC,cAAc,CAAC,MAAc;QAEnC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;CACD;AAlMD,oEAkMC"}
@@ -1,5 +0,0 @@
1
- import type { NodePromptConfig } from '../../types/config';
2
- export declare const DEFAULT_PROMPT_CONFIG: NodePromptConfig;
3
- export declare function getNodeTypeCategory(nodeType: string, config?: NodePromptConfig): string | null;
4
- export declare function mentionsResourceKeywords(changes: string[], config?: NodePromptConfig): boolean;
5
- export declare function mentionsTextKeywords(changes: string[], config?: NodePromptConfig): boolean;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_PROMPT_CONFIG = void 0;
4
- exports.getNodeTypeCategory = getNodeTypeCategory;
5
- exports.mentionsResourceKeywords = mentionsResourceKeywords;
6
- exports.mentionsTextKeywords = mentionsTextKeywords;
7
- exports.DEFAULT_PROMPT_CONFIG = {
8
- nodeTypePatterns: {
9
- set: ['n8n-nodes-base.set', 'set'],
10
- if: ['n8n-nodes-base.if', 'if', 'filter'],
11
- httpRequest: ['n8n-nodes-base.httpRequest', 'httprequest', 'webhook', 'n8n-nodes-base.webhook'],
12
- tool: ['Tool', '.tool'],
13
- },
14
- parameterKeywords: {
15
- resourceLocator: [
16
- 'channel',
17
- 'file',
18
- 'page',
19
- 'document',
20
- 'sheet',
21
- 'folder',
22
- 'database',
23
- 'board',
24
- 'list',
25
- 'space',
26
- ],
27
- textExpressions: ['message', 'text', 'content', 'body', 'description', 'title', 'subject'],
28
- },
29
- maxExamples: 3,
30
- targetTokenBudget: 3000,
31
- };
32
- function getNodeTypeCategory(nodeType, config = exports.DEFAULT_PROMPT_CONFIG) {
33
- const lowerType = nodeType.toLowerCase();
34
- for (const [category, patterns] of Object.entries(config.nodeTypePatterns)) {
35
- if (patterns.some((pattern) => lowerType.includes(pattern.toLowerCase()))) {
36
- return category;
37
- }
38
- }
39
- if (nodeType.endsWith('Tool') || nodeType.includes('.tool')) {
40
- return 'tool';
41
- }
42
- return null;
43
- }
44
- function mentionsResourceKeywords(changes, config = exports.DEFAULT_PROMPT_CONFIG) {
45
- const changesText = changes.join(' ').toLowerCase();
46
- return config.parameterKeywords.resourceLocator.some((keyword) => changesText.includes(keyword));
47
- }
48
- function mentionsTextKeywords(changes, config = exports.DEFAULT_PROMPT_CONFIG) {
49
- const changesText = changes.join(' ').toLowerCase();
50
- return config.parameterKeywords.textExpressions.some((keyword) => changesText.includes(keyword));
51
- }
52
- //# sourceMappingURL=prompt-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt-config.js","sourceRoot":"","sources":["../../../src/chains/prompts/prompt-config.ts"],"names":[],"mappings":";;;AAiCA,kDAkBC;AAKD,4DAMC;AAKD,oDAMC;AAvEY,QAAA,qBAAqB,GAAqB;IACtD,gBAAgB,EAAE;QACjB,GAAG,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC;QAClC,EAAE,EAAE,CAAC,mBAAmB,EAAE,IAAI,EAAE,QA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