codika 3.0.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 (403) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/dist/cli/commands/completion.d.ts +15 -0
  4. package/dist/cli/commands/completion.d.ts.map +1 -0
  5. package/dist/cli/commands/completion.js +810 -0
  6. package/dist/cli/commands/completion.js.map +1 -0
  7. package/dist/cli/commands/config/clear.d.ts +12 -0
  8. package/dist/cli/commands/config/clear.d.ts.map +1 -0
  9. package/dist/cli/commands/config/clear.js +35 -0
  10. package/dist/cli/commands/config/clear.js.map +1 -0
  11. package/dist/cli/commands/config/index.d.ts +15 -0
  12. package/dist/cli/commands/config/index.d.ts.map +1 -0
  13. package/dist/cli/commands/config/index.js +21 -0
  14. package/dist/cli/commands/config/index.js.map +1 -0
  15. package/dist/cli/commands/config/set.d.ts +41 -0
  16. package/dist/cli/commands/config/set.d.ts.map +1 -0
  17. package/dist/cli/commands/config/set.js +185 -0
  18. package/dist/cli/commands/config/set.js.map +1 -0
  19. package/dist/cli/commands/config/show.d.ts +12 -0
  20. package/dist/cli/commands/config/show.d.ts.map +1 -0
  21. package/dist/cli/commands/config/show.js +45 -0
  22. package/dist/cli/commands/config/show.js.map +1 -0
  23. package/dist/cli/commands/deploy/documents.d.ts +12 -0
  24. package/dist/cli/commands/deploy/documents.d.ts.map +1 -0
  25. package/dist/cli/commands/deploy/documents.js +217 -0
  26. package/dist/cli/commands/deploy/documents.js.map +1 -0
  27. package/dist/cli/commands/deploy/index.d.ts +14 -0
  28. package/dist/cli/commands/deploy/index.d.ts.map +1 -0
  29. package/dist/cli/commands/deploy/index.js +21 -0
  30. package/dist/cli/commands/deploy/index.js.map +1 -0
  31. package/dist/cli/commands/deploy/process-data-ingestion.d.ts +13 -0
  32. package/dist/cli/commands/deploy/process-data-ingestion.d.ts.map +1 -0
  33. package/dist/cli/commands/deploy/process-data-ingestion.js +226 -0
  34. package/dist/cli/commands/deploy/process-data-ingestion.js.map +1 -0
  35. package/dist/cli/commands/deploy/use-case.d.ts +9 -0
  36. package/dist/cli/commands/deploy/use-case.d.ts.map +1 -0
  37. package/dist/cli/commands/deploy/use-case.js +212 -0
  38. package/dist/cli/commands/deploy/use-case.js.map +1 -0
  39. package/dist/cli/commands/get/execution.d.ts +9 -0
  40. package/dist/cli/commands/get/execution.d.ts.map +1 -0
  41. package/dist/cli/commands/get/execution.js +159 -0
  42. package/dist/cli/commands/get/execution.js.map +1 -0
  43. package/dist/cli/commands/get/index.d.ts +13 -0
  44. package/dist/cli/commands/get/index.d.ts.map +1 -0
  45. package/dist/cli/commands/get/index.js +20 -0
  46. package/dist/cli/commands/get/index.js.map +1 -0
  47. package/dist/cli/commands/get/skills.d.ts +15 -0
  48. package/dist/cli/commands/get/skills.d.ts.map +1 -0
  49. package/dist/cli/commands/get/skills.js +135 -0
  50. package/dist/cli/commands/get/skills.js.map +1 -0
  51. package/dist/cli/commands/get/use-case.d.ts +9 -0
  52. package/dist/cli/commands/get/use-case.d.ts.map +1 -0
  53. package/dist/cli/commands/get/use-case.js +186 -0
  54. package/dist/cli/commands/get/use-case.js.map +1 -0
  55. package/dist/cli/commands/init.d.ts +14 -0
  56. package/dist/cli/commands/init.d.ts.map +1 -0
  57. package/dist/cli/commands/init.js +347 -0
  58. package/dist/cli/commands/init.js.map +1 -0
  59. package/dist/cli/commands/integration/delete.d.ts +13 -0
  60. package/dist/cli/commands/integration/delete.d.ts.map +1 -0
  61. package/dist/cli/commands/integration/delete.js +140 -0
  62. package/dist/cli/commands/integration/delete.js.map +1 -0
  63. package/dist/cli/commands/integration/index.d.ts +13 -0
  64. package/dist/cli/commands/integration/index.d.ts.map +1 -0
  65. package/dist/cli/commands/integration/index.js +20 -0
  66. package/dist/cli/commands/integration/index.js.map +1 -0
  67. package/dist/cli/commands/integration/list.d.ts +13 -0
  68. package/dist/cli/commands/integration/list.d.ts.map +1 -0
  69. package/dist/cli/commands/integration/list.js +129 -0
  70. package/dist/cli/commands/integration/list.js.map +1 -0
  71. package/dist/cli/commands/integration/set.d.ts +13 -0
  72. package/dist/cli/commands/integration/set.d.ts.map +1 -0
  73. package/dist/cli/commands/integration/set.js +253 -0
  74. package/dist/cli/commands/integration/set.js.map +1 -0
  75. package/dist/cli/commands/list/executions.d.ts +12 -0
  76. package/dist/cli/commands/list/executions.d.ts.map +1 -0
  77. package/dist/cli/commands/list/executions.js +168 -0
  78. package/dist/cli/commands/list/executions.js.map +1 -0
  79. package/dist/cli/commands/list/index.d.ts +11 -0
  80. package/dist/cli/commands/list/index.d.ts.map +1 -0
  81. package/dist/cli/commands/list/index.js +14 -0
  82. package/dist/cli/commands/list/index.js.map +1 -0
  83. package/dist/cli/commands/logout.d.ts +12 -0
  84. package/dist/cli/commands/logout.d.ts.map +1 -0
  85. package/dist/cli/commands/logout.js +58 -0
  86. package/dist/cli/commands/logout.js.map +1 -0
  87. package/dist/cli/commands/project/create.d.ts +8 -0
  88. package/dist/cli/commands/project/create.d.ts.map +1 -0
  89. package/dist/cli/commands/project/create.js +109 -0
  90. package/dist/cli/commands/project/create.js.map +1 -0
  91. package/dist/cli/commands/project/index.d.ts +12 -0
  92. package/dist/cli/commands/project/index.d.ts.map +1 -0
  93. package/dist/cli/commands/project/index.js +15 -0
  94. package/dist/cli/commands/project/index.js.map +1 -0
  95. package/dist/cli/commands/publish.d.ts +12 -0
  96. package/dist/cli/commands/publish.d.ts.map +1 -0
  97. package/dist/cli/commands/publish.js +152 -0
  98. package/dist/cli/commands/publish.js.map +1 -0
  99. package/dist/cli/commands/redeploy.d.ts +11 -0
  100. package/dist/cli/commands/redeploy.d.ts.map +1 -0
  101. package/dist/cli/commands/redeploy.js +166 -0
  102. package/dist/cli/commands/redeploy.js.map +1 -0
  103. package/dist/cli/commands/status.d.ts +63 -0
  104. package/dist/cli/commands/status.d.ts.map +1 -0
  105. package/dist/cli/commands/status.js +290 -0
  106. package/dist/cli/commands/status.js.map +1 -0
  107. package/dist/cli/commands/trigger.d.ts +8 -0
  108. package/dist/cli/commands/trigger.d.ts.map +1 -0
  109. package/dist/cli/commands/trigger.js +247 -0
  110. package/dist/cli/commands/trigger.js.map +1 -0
  111. package/dist/cli/commands/use.d.ts +13 -0
  112. package/dist/cli/commands/use.d.ts.map +1 -0
  113. package/dist/cli/commands/use.js +92 -0
  114. package/dist/cli/commands/use.js.map +1 -0
  115. package/dist/cli/commands/verify/index.d.ts +13 -0
  116. package/dist/cli/commands/verify/index.d.ts.map +1 -0
  117. package/dist/cli/commands/verify/index.js +18 -0
  118. package/dist/cli/commands/verify/index.js.map +1 -0
  119. package/dist/cli/commands/verify/use-case.d.ts +23 -0
  120. package/dist/cli/commands/verify/use-case.d.ts.map +1 -0
  121. package/dist/cli/commands/verify/use-case.js +94 -0
  122. package/dist/cli/commands/verify/use-case.js.map +1 -0
  123. package/dist/cli/commands/verify/workflow.d.ts +22 -0
  124. package/dist/cli/commands/verify/workflow.d.ts.map +1 -0
  125. package/dist/cli/commands/verify/workflow.js +82 -0
  126. package/dist/cli/commands/verify/workflow.js.map +1 -0
  127. package/dist/cli/commands/whoami.d.ts +13 -0
  128. package/dist/cli/commands/whoami.d.ts.map +1 -0
  129. package/dist/cli/commands/whoami.js +126 -0
  130. package/dist/cli/commands/whoami.js.map +1 -0
  131. package/dist/cli/index.d.ts +24 -0
  132. package/dist/cli/index.d.ts.map +1 -0
  133. package/dist/cli/index.js +90 -0
  134. package/dist/cli/index.js.map +1 -0
  135. package/dist/cli/templates/claude-md-template.d.ts +12 -0
  136. package/dist/cli/templates/claude-md-template.d.ts.map +1 -0
  137. package/dist/cli/templates/claude-md-template.js +162 -0
  138. package/dist/cli/templates/claude-md-template.js.map +1 -0
  139. package/dist/cli/templates/config-template.d.ts +18 -0
  140. package/dist/cli/templates/config-template.d.ts.map +1 -0
  141. package/dist/cli/templates/config-template.js +350 -0
  142. package/dist/cli/templates/config-template.js.map +1 -0
  143. package/dist/cli/templates/skill-templates.d.ts +24 -0
  144. package/dist/cli/templates/skill-templates.d.ts.map +1 -0
  145. package/dist/cli/templates/skill-templates.js +117 -0
  146. package/dist/cli/templates/skill-templates.js.map +1 -0
  147. package/dist/cli/templates/slug.d.ts +9 -0
  148. package/dist/cli/templates/slug.d.ts.map +1 -0
  149. package/dist/cli/templates/slug.js +17 -0
  150. package/dist/cli/templates/slug.js.map +1 -0
  151. package/dist/cli/templates/workflow-templates.d.ts +693 -0
  152. package/dist/cli/templates/workflow-templates.d.ts.map +1 -0
  153. package/dist/cli/templates/workflow-templates.js +516 -0
  154. package/dist/cli/templates/workflow-templates.js.map +1 -0
  155. package/dist/cli/utils/output.d.ts +65 -0
  156. package/dist/cli/utils/output.d.ts.map +1 -0
  157. package/dist/cli/utils/output.js +188 -0
  158. package/dist/cli/utils/output.js.map +1 -0
  159. package/dist/cli/utils/validation-output.d.ts +21 -0
  160. package/dist/cli/utils/validation-output.d.ts.map +1 -0
  161. package/dist/cli/utils/validation-output.js +204 -0
  162. package/dist/cli/utils/validation-output.js.map +1 -0
  163. package/dist/data/integration-fields.d.ts +27 -0
  164. package/dist/data/integration-fields.d.ts.map +1 -0
  165. package/dist/data/integration-fields.js +361 -0
  166. package/dist/data/integration-fields.js.map +1 -0
  167. package/dist/index.d.ts +25 -0
  168. package/dist/index.d.ts.map +1 -0
  169. package/dist/index.js +39 -0
  170. package/dist/index.js.map +1 -0
  171. package/dist/types/process-types.d.ts +740 -0
  172. package/dist/types/process-types.d.ts.map +1 -0
  173. package/dist/types/process-types.js +22 -0
  174. package/dist/types/process-types.js.map +1 -0
  175. package/dist/utils/config.d.ts +127 -0
  176. package/dist/utils/config.d.ts.map +1 -0
  177. package/dist/utils/config.js +315 -0
  178. package/dist/utils/config.js.map +1 -0
  179. package/dist/utils/data-ingestion-deploy-client.d.ts +53 -0
  180. package/dist/utils/data-ingestion-deploy-client.d.ts.map +1 -0
  181. package/dist/utils/data-ingestion-deploy-client.js +63 -0
  182. package/dist/utils/data-ingestion-deploy-client.js.map +1 -0
  183. package/dist/utils/data-ingestion-deployer.d.ts +78 -0
  184. package/dist/utils/data-ingestion-deployer.d.ts.map +1 -0
  185. package/dist/utils/data-ingestion-deployer.js +119 -0
  186. package/dist/utils/data-ingestion-deployer.js.map +1 -0
  187. package/dist/utils/deploy-client.d.ts +55 -0
  188. package/dist/utils/deploy-client.d.ts.map +1 -0
  189. package/dist/utils/deploy-client.js +73 -0
  190. package/dist/utils/deploy-client.js.map +1 -0
  191. package/dist/utils/deployment-archiver.d.ts +110 -0
  192. package/dist/utils/deployment-archiver.d.ts.map +1 -0
  193. package/dist/utils/deployment-archiver.js +158 -0
  194. package/dist/utils/deployment-archiver.js.map +1 -0
  195. package/dist/utils/document-deploy-client.d.ts +41 -0
  196. package/dist/utils/document-deploy-client.d.ts.map +1 -0
  197. package/dist/utils/document-deploy-client.js +46 -0
  198. package/dist/utils/document-deploy-client.js.map +1 -0
  199. package/dist/utils/encryption.d.ts +85 -0
  200. package/dist/utils/encryption.d.ts.map +1 -0
  201. package/dist/utils/encryption.js +162 -0
  202. package/dist/utils/encryption.js.map +1 -0
  203. package/dist/utils/execution-client.d.ts +71 -0
  204. package/dist/utils/execution-client.d.ts.map +1 -0
  205. package/dist/utils/execution-client.js +56 -0
  206. package/dist/utils/execution-client.js.map +1 -0
  207. package/dist/utils/integration-client.d.ts +134 -0
  208. package/dist/utils/integration-client.d.ts.map +1 -0
  209. package/dist/utils/integration-client.js +109 -0
  210. package/dist/utils/integration-client.js.map +1 -0
  211. package/dist/utils/list-executions-client.d.ts +47 -0
  212. package/dist/utils/list-executions-client.d.ts.map +1 -0
  213. package/dist/utils/list-executions-client.js +50 -0
  214. package/dist/utils/list-executions-client.js.map +1 -0
  215. package/dist/utils/metadata-client.d.ts +90 -0
  216. package/dist/utils/metadata-client.d.ts.map +1 -0
  217. package/dist/utils/metadata-client.js +66 -0
  218. package/dist/utils/metadata-client.js.map +1 -0
  219. package/dist/utils/project-client.d.ts +70 -0
  220. package/dist/utils/project-client.d.ts.map +1 -0
  221. package/dist/utils/project-client.js +63 -0
  222. package/dist/utils/project-client.js.map +1 -0
  223. package/dist/utils/project-json.d.ts +71 -0
  224. package/dist/utils/project-json.d.ts.map +1 -0
  225. package/dist/utils/project-json.js +129 -0
  226. package/dist/utils/project-json.js.map +1 -0
  227. package/dist/utils/publish-client.d.ts +53 -0
  228. package/dist/utils/publish-client.d.ts.map +1 -0
  229. package/dist/utils/publish-client.js +64 -0
  230. package/dist/utils/publish-client.js.map +1 -0
  231. package/dist/utils/redeploy-client.d.ts +39 -0
  232. package/dist/utils/redeploy-client.d.ts.map +1 -0
  233. package/dist/utils/redeploy-client.js +51 -0
  234. package/dist/utils/redeploy-client.js.map +1 -0
  235. package/dist/utils/skill-parser.d.ts +52 -0
  236. package/dist/utils/skill-parser.d.ts.map +1 -0
  237. package/dist/utils/skill-parser.js +127 -0
  238. package/dist/utils/skill-parser.js.map +1 -0
  239. package/dist/utils/skills-client.d.ts +39 -0
  240. package/dist/utils/skills-client.d.ts.map +1 -0
  241. package/dist/utils/skills-client.js +32 -0
  242. package/dist/utils/skills-client.js.map +1 -0
  243. package/dist/utils/trigger-client.d.ts +78 -0
  244. package/dist/utils/trigger-client.d.ts.map +1 -0
  245. package/dist/utils/trigger-client.js +81 -0
  246. package/dist/utils/trigger-client.js.map +1 -0
  247. package/dist/utils/use-case-deployer.d.ts +93 -0
  248. package/dist/utils/use-case-deployer.d.ts.map +1 -0
  249. package/dist/utils/use-case-deployer.js +270 -0
  250. package/dist/utils/use-case-deployer.js.map +1 -0
  251. package/dist/utils/version-manager.d.ts +63 -0
  252. package/dist/utils/version-manager.d.ts.map +1 -0
  253. package/dist/utils/version-manager.js +91 -0
  254. package/dist/utils/version-manager.js.map +1 -0
  255. package/dist/utils/workflow-encoding.d.ts +26 -0
  256. package/dist/utils/workflow-encoding.d.ts.map +1 -0
  257. package/dist/utils/workflow-encoding.js +41 -0
  258. package/dist/utils/workflow-encoding.js.map +1 -0
  259. package/dist/validation/fixer.d.ts +56 -0
  260. package/dist/validation/fixer.d.ts.map +1 -0
  261. package/dist/validation/fixer.js +168 -0
  262. package/dist/validation/fixer.js.map +1 -0
  263. package/dist/validation/rules/codika-init-required.d.ts +18 -0
  264. package/dist/validation/rules/codika-init-required.d.ts.map +1 -0
  265. package/dist/validation/rules/codika-init-required.js +70 -0
  266. package/dist/validation/rules/codika-init-required.js.map +1 -0
  267. package/dist/validation/rules/codika-submit-result.d.ts +22 -0
  268. package/dist/validation/rules/codika-submit-result.d.ts.map +1 -0
  269. package/dist/validation/rules/codika-submit-result.js +144 -0
  270. package/dist/validation/rules/codika-submit-result.js.map +1 -0
  271. package/dist/validation/rules/error-branch-required.d.ts +24 -0
  272. package/dist/validation/rules/error-branch-required.d.ts.map +1 -0
  273. package/dist/validation/rules/error-branch-required.js +103 -0
  274. package/dist/validation/rules/error-branch-required.js.map +1 -0
  275. package/dist/validation/rules/index.d.ts +18 -0
  276. package/dist/validation/rules/index.d.ts.map +1 -0
  277. package/dist/validation/rules/index.js +28 -0
  278. package/dist/validation/rules/index.js.map +1 -0
  279. package/dist/validation/rules/schedule-webhook-convergence.d.ts +24 -0
  280. package/dist/validation/rules/schedule-webhook-convergence.d.ts.map +1 -0
  281. package/dist/validation/rules/schedule-webhook-convergence.js +129 -0
  282. package/dist/validation/rules/schedule-webhook-convergence.js.map +1 -0
  283. package/dist/validation/rules/subworkflow-min-params.d.ts +21 -0
  284. package/dist/validation/rules/subworkflow-min-params.d.ts.map +1 -0
  285. package/dist/validation/rules/subworkflow-min-params.js +84 -0
  286. package/dist/validation/rules/subworkflow-min-params.js.map +1 -0
  287. package/dist/validation/runner.d.ts +43 -0
  288. package/dist/validation/runner.d.ts.map +1 -0
  289. package/dist/validation/runner.js +335 -0
  290. package/dist/validation/runner.js.map +1 -0
  291. package/dist/validation/types.d.ts +155 -0
  292. package/dist/validation/types.d.ts.map +1 -0
  293. package/dist/validation/types.js +8 -0
  294. package/dist/validation/types.js.map +1 -0
  295. package/dist/validation/use-case-scripts/calledby-consistency.d.ts +23 -0
  296. package/dist/validation/use-case-scripts/calledby-consistency.d.ts.map +1 -0
  297. package/dist/validation/use-case-scripts/calledby-consistency.js +236 -0
  298. package/dist/validation/use-case-scripts/calledby-consistency.js.map +1 -0
  299. package/dist/validation/use-case-scripts/config-exports.d.ts +17 -0
  300. package/dist/validation/use-case-scripts/config-exports.d.ts.map +1 -0
  301. package/dist/validation/use-case-scripts/config-exports.js +93 -0
  302. package/dist/validation/use-case-scripts/config-exports.js.map +1 -0
  303. package/dist/validation/use-case-scripts/custom-integration-schema.d.ts +21 -0
  304. package/dist/validation/use-case-scripts/custom-integration-schema.d.ts.map +1 -0
  305. package/dist/validation/use-case-scripts/custom-integration-schema.js +378 -0
  306. package/dist/validation/use-case-scripts/custom-integration-schema.js.map +1 -0
  307. package/dist/validation/use-case-scripts/index.d.ts +27 -0
  308. package/dist/validation/use-case-scripts/index.d.ts.map +1 -0
  309. package/dist/validation/use-case-scripts/index.js +52 -0
  310. package/dist/validation/use-case-scripts/index.js.map +1 -0
  311. package/dist/validation/use-case-scripts/integration-inheritance.d.ts +35 -0
  312. package/dist/validation/use-case-scripts/integration-inheritance.d.ts.map +1 -0
  313. package/dist/validation/use-case-scripts/integration-inheritance.js +348 -0
  314. package/dist/validation/use-case-scripts/integration-inheritance.js.map +1 -0
  315. package/dist/validation/use-case-scripts/schema-types.d.ts +21 -0
  316. package/dist/validation/use-case-scripts/schema-types.d.ts.map +1 -0
  317. package/dist/validation/use-case-scripts/schema-types.js +134 -0
  318. package/dist/validation/use-case-scripts/schema-types.js.map +1 -0
  319. package/dist/validation/use-case-scripts/skill-consistency.d.ts +21 -0
  320. package/dist/validation/use-case-scripts/skill-consistency.d.ts.map +1 -0
  321. package/dist/validation/use-case-scripts/skill-consistency.js +180 -0
  322. package/dist/validation/use-case-scripts/skill-consistency.js.map +1 -0
  323. package/dist/validation/use-case-scripts/subworkflow-references.d.ts +22 -0
  324. package/dist/validation/use-case-scripts/subworkflow-references.d.ts.map +1 -0
  325. package/dist/validation/use-case-scripts/subworkflow-references.js +139 -0
  326. package/dist/validation/use-case-scripts/subworkflow-references.js.map +1 -0
  327. package/dist/validation/use-case-scripts/trigger-type-consistency.d.ts +25 -0
  328. package/dist/validation/use-case-scripts/trigger-type-consistency.d.ts.map +1 -0
  329. package/dist/validation/use-case-scripts/trigger-type-consistency.js +265 -0
  330. package/dist/validation/use-case-scripts/trigger-type-consistency.js.map +1 -0
  331. package/dist/validation/use-case-scripts/trigger-types.d.ts +20 -0
  332. package/dist/validation/use-case-scripts/trigger-types.d.ts.map +1 -0
  333. package/dist/validation/use-case-scripts/trigger-types.js +177 -0
  334. package/dist/validation/use-case-scripts/trigger-types.js.map +1 -0
  335. package/dist/validation/use-case-scripts/triggers-required.d.ts +23 -0
  336. package/dist/validation/use-case-scripts/triggers-required.d.ts.map +1 -0
  337. package/dist/validation/use-case-scripts/triggers-required.js +111 -0
  338. package/dist/validation/use-case-scripts/triggers-required.js.map +1 -0
  339. package/dist/validation/use-case-scripts/webhook-path-consistency.d.ts +28 -0
  340. package/dist/validation/use-case-scripts/webhook-path-consistency.d.ts.map +1 -0
  341. package/dist/validation/use-case-scripts/webhook-path-consistency.js +288 -0
  342. package/dist/validation/use-case-scripts/webhook-path-consistency.js.map +1 -0
  343. package/dist/validation/use-case-scripts/workflow-imports.d.ts +16 -0
  344. package/dist/validation/use-case-scripts/workflow-imports.d.ts.map +1 -0
  345. package/dist/validation/use-case-scripts/workflow-imports.js +206 -0
  346. package/dist/validation/use-case-scripts/workflow-imports.js.map +1 -0
  347. package/dist/validation/workflow-scripts/credential-placeholders.d.ts +21 -0
  348. package/dist/validation/workflow-scripts/credential-placeholders.d.ts.map +1 -0
  349. package/dist/validation/workflow-scripts/credential-placeholders.js +278 -0
  350. package/dist/validation/workflow-scripts/credential-placeholders.js.map +1 -0
  351. package/dist/validation/workflow-scripts/db-always-output.d.ts +16 -0
  352. package/dist/validation/workflow-scripts/db-always-output.d.ts.map +1 -0
  353. package/dist/validation/workflow-scripts/db-always-output.js +95 -0
  354. package/dist/validation/workflow-scripts/db-always-output.js.map +1 -0
  355. package/dist/validation/workflow-scripts/exec-workflow-wait.d.ts +15 -0
  356. package/dist/validation/workflow-scripts/exec-workflow-wait.d.ts.map +1 -0
  357. package/dist/validation/workflow-scripts/exec-workflow-wait.js +85 -0
  358. package/dist/validation/workflow-scripts/exec-workflow-wait.js.map +1 -0
  359. package/dist/validation/workflow-scripts/index.d.ts +31 -0
  360. package/dist/validation/workflow-scripts/index.d.ts.map +1 -0
  361. package/dist/validation/workflow-scripts/index.js +58 -0
  362. package/dist/validation/workflow-scripts/index.js.map +1 -0
  363. package/dist/validation/workflow-scripts/instparm-quoting.d.ts +21 -0
  364. package/dist/validation/workflow-scripts/instparm-quoting.d.ts.map +1 -0
  365. package/dist/validation/workflow-scripts/instparm-quoting.js +59 -0
  366. package/dist/validation/workflow-scripts/instparm-quoting.js.map +1 -0
  367. package/dist/validation/workflow-scripts/llm-model-id.d.ts +17 -0
  368. package/dist/validation/workflow-scripts/llm-model-id.d.ts.map +1 -0
  369. package/dist/validation/workflow-scripts/llm-model-id.js +171 -0
  370. package/dist/validation/workflow-scripts/llm-model-id.js.map +1 -0
  371. package/dist/validation/workflow-scripts/llm-output-access.d.ts +23 -0
  372. package/dist/validation/workflow-scripts/llm-output-access.d.ts.map +1 -0
  373. package/dist/validation/workflow-scripts/llm-output-access.js +274 -0
  374. package/dist/validation/workflow-scripts/llm-output-access.js.map +1 -0
  375. package/dist/validation/workflow-scripts/merge-before-terminal.d.ts +20 -0
  376. package/dist/validation/workflow-scripts/merge-before-terminal.d.ts.map +1 -0
  377. package/dist/validation/workflow-scripts/merge-before-terminal.js +87 -0
  378. package/dist/validation/workflow-scripts/merge-before-terminal.js.map +1 -0
  379. package/dist/validation/workflow-scripts/placeholder-syntax.d.ts +29 -0
  380. package/dist/validation/workflow-scripts/placeholder-syntax.d.ts.map +1 -0
  381. package/dist/validation/workflow-scripts/placeholder-syntax.js +154 -0
  382. package/dist/validation/workflow-scripts/placeholder-syntax.js.map +1 -0
  383. package/dist/validation/workflow-scripts/retry-backoff.d.ts +16 -0
  384. package/dist/validation/workflow-scripts/retry-backoff.d.ts.map +1 -0
  385. package/dist/validation/workflow-scripts/retry-backoff.js +197 -0
  386. package/dist/validation/workflow-scripts/retry-backoff.js.map +1 -0
  387. package/dist/validation/workflow-scripts/webhook-id.d.ts +17 -0
  388. package/dist/validation/workflow-scripts/webhook-id.d.ts.map +1 -0
  389. package/dist/validation/workflow-scripts/webhook-id.js +79 -0
  390. package/dist/validation/workflow-scripts/webhook-id.js.map +1 -0
  391. package/dist/validation/workflow-scripts/workflow-format.d.ts +16 -0
  392. package/dist/validation/workflow-scripts/workflow-format.d.ts.map +1 -0
  393. package/dist/validation/workflow-scripts/workflow-format.js +51 -0
  394. package/dist/validation/workflow-scripts/workflow-format.js.map +1 -0
  395. package/dist/validation/workflow-scripts/workflow-sanitization.d.ts +21 -0
  396. package/dist/validation/workflow-scripts/workflow-sanitization.d.ts.map +1 -0
  397. package/dist/validation/workflow-scripts/workflow-sanitization.js +78 -0
  398. package/dist/validation/workflow-scripts/workflow-sanitization.js.map +1 -0
  399. package/dist/validation/workflow-scripts/workflow-settings.d.ts +19 -0
  400. package/dist/validation/workflow-scripts/workflow-settings.d.ts.map +1 -0
  401. package/dist/validation/workflow-scripts/workflow-settings.js +131 -0
  402. package/dist/validation/workflow-scripts/workflow-settings.js.map +1 -0
  403. package/package.json +64 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Script: INSTPARM-QUOTE
3
+ *
4
+ * Checks that INSTPARM placeholders are not incorrectly quoted.
5
+ *
6
+ * CORRECT: const x = {{INSTPARM_NAME_MRAPTSNI}};
7
+ * INCORRECT: const x = '{{INSTPARM_NAME_MRAPTSNI}}';
8
+ *
9
+ * When INSTPARM placeholders are quoted, they become string literals
10
+ * instead of being replaced with the actual value at runtime.
11
+ *
12
+ * This script provides auto-fix capability to remove the quotes.
13
+ */
14
+ export const metadata = {
15
+ id: 'INSTPARM-QUOTE',
16
+ name: 'instparm_quoting',
17
+ severity: 'must',
18
+ description: 'INSTPARM placeholders should not be wrapped in quotes',
19
+ details: 'Remove quotes around INSTPARM placeholders so they are properly replaced at runtime',
20
+ fixable: true,
21
+ category: 'placeholder',
22
+ };
23
+ // Regex to find quoted INSTPARM placeholders
24
+ // Matches: '{{INSTPARM_..._MRAPTSNI}}' or "{{INSTPARM_..._MRAPTSNI}}"
25
+ const QUOTED_INSTPARM_REGEX = /(['"])(\{\{INSTPARM_[A-Z0-9_]+_MRAPTSNI\}\})\1/g;
26
+ /**
27
+ * Check for incorrectly quoted INSTPARM placeholders
28
+ */
29
+ export function checkInstparmQuoting(content, path) {
30
+ const findings = [];
31
+ // Reset regex state
32
+ QUOTED_INSTPARM_REGEX.lastIndex = 0;
33
+ let match;
34
+ while ((match = QUOTED_INSTPARM_REGEX.exec(content)) !== null) {
35
+ const quote = match[1];
36
+ const placeholder = match[2];
37
+ const fullMatch = match[0];
38
+ // Calculate line number
39
+ const lineNumber = content.substring(0, match.index).split('\n').length;
40
+ findings.push({
41
+ rule: metadata.id,
42
+ severity: metadata.severity,
43
+ path,
44
+ message: `INSTPARM placeholder should not be quoted: ${fullMatch}`,
45
+ raw_details: `Remove the ${quote} quotes around ${placeholder}. Quoted placeholders become string literals instead of being replaced with values.`,
46
+ line: lineNumber,
47
+ fixable: true,
48
+ fix: {
49
+ description: `Remove quotes around ${placeholder}`,
50
+ apply: (fileContent) => {
51
+ // Replace this specific quoted placeholder with unquoted version
52
+ return fileContent.replace(fullMatch, placeholder);
53
+ },
54
+ },
55
+ });
56
+ }
57
+ return findings;
58
+ }
59
+ //# sourceMappingURL=instparm-quoting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instparm-quoting.js","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/instparm-quoting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GA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,EAAE,CAAC,WAAmB,EAAE,EAAE;oBAC7B,iEAAiE;oBACjE,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;gBACrD,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Script: LLM-MODEL-ID
3
+ *
4
+ * Checks that LLM model nodes use current, valid model IDs.
5
+ * Uses an allowlist of known-good models per provider node type.
6
+ * Any model not in the allowlist is flagged as a MUST violation with auto-fix.
7
+ *
8
+ * ## Updating the Allowlist
9
+ *
10
+ * When a provider releases new models or retires old ones, update the
11
+ * ALLOWED_MODELS map below. Each entry maps an n8n node type to the list
12
+ * of currently valid model IDs and a default for auto-fix.
13
+ */
14
+ import type { Finding, RuleMetadata } from '../types.js';
15
+ export declare const metadata: RuleMetadata;
16
+ export declare function checkLlmModelId(content: string, path: string): Finding[];
17
+ //# sourceMappingURL=llm-model-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-model-id.d.ts","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-model-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,QAAQ,EAAE,YAUtB,CAAC;AAgIF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAmExE"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Script: LLM-MODEL-ID
3
+ *
4
+ * Checks that LLM model nodes use current, valid model IDs.
5
+ * Uses an allowlist of known-good models per provider node type.
6
+ * Any model not in the allowlist is flagged as a MUST violation with auto-fix.
7
+ *
8
+ * ## Updating the Allowlist
9
+ *
10
+ * When a provider releases new models or retires old ones, update the
11
+ * ALLOWED_MODELS map below. Each entry maps an n8n node type to the list
12
+ * of currently valid model IDs and a default for auto-fix.
13
+ */
14
+ export const metadata = {
15
+ id: 'LLM-MODEL-ID',
16
+ name: 'llm_model_id',
17
+ severity: 'must',
18
+ description: 'LLM model nodes must use current, non-deprecated model IDs',
19
+ details: 'Retired or unknown model IDs will fail at runtime with "resource not found" errors. ' +
20
+ 'Only use model IDs from the provider allowlist. Run with --fix to auto-replace.',
21
+ fixable: true,
22
+ category: 'ai-nodes',
23
+ };
24
+ const ALLOWED_MODELS = {
25
+ '@n8n/n8n-nodes-langchain.lmChatAnthropic': {
26
+ providerName: 'Anthropic',
27
+ allowed: [
28
+ 'claude-sonnet-4-20250514',
29
+ 'claude-opus-4-20250514',
30
+ 'claude-haiku-4-5-20251001',
31
+ // Short aliases (resolve to the same models)
32
+ 'claude-sonnet-4-6',
33
+ 'claude-opus-4-6',
34
+ 'claude-haiku-4-5',
35
+ ],
36
+ default: 'claude-sonnet-4-20250514',
37
+ tierMap: {
38
+ opus: 'claude-opus-4-20250514',
39
+ haiku: 'claude-haiku-4-5-20251001',
40
+ sonnet: 'claude-sonnet-4-20250514',
41
+ },
42
+ },
43
+ // Add more providers as needed:
44
+ // '@n8n/n8n-nodes-langchain.lmChatOpenAi': {
45
+ // providerName: 'OpenAI',
46
+ // allowed: ['gpt-4o', 'gpt-4o-mini', ...],
47
+ // default: 'gpt-4o',
48
+ // tierMap: { mini: 'gpt-4o-mini' },
49
+ // },
50
+ };
51
+ /**
52
+ * Extract the model ID string from a node's parameters.
53
+ * Handles both the __rl resource-list pattern and plain string values.
54
+ */
55
+ function extractModelId(node) {
56
+ const model = node.parameters?.model;
57
+ if (!model)
58
+ return null;
59
+ if (typeof model === 'string')
60
+ return model;
61
+ if (typeof model === 'object') {
62
+ const m = model;
63
+ if (typeof m.value === 'string')
64
+ return m.value;
65
+ }
66
+ return null;
67
+ }
68
+ /**
69
+ * Pick the best replacement model based on the deprecated model's name.
70
+ * Falls back to the provider default if no tier keyword matches.
71
+ */
72
+ function pickReplacement(deprecatedModelId, provider) {
73
+ const lower = deprecatedModelId.toLowerCase();
74
+ for (const [keyword, replacement] of Object.entries(provider.tierMap)) {
75
+ if (lower.includes(keyword)) {
76
+ return replacement;
77
+ }
78
+ }
79
+ return provider.default;
80
+ }
81
+ /**
82
+ * Get a human-readable name for a model ID (e.g. "Claude Sonnet 4").
83
+ */
84
+ function getDisplayName(modelId, provider) {
85
+ for (const [keyword, id] of Object.entries(provider.tierMap)) {
86
+ if (id === modelId) {
87
+ return `${provider.providerName} ${keyword.charAt(0).toUpperCase() + keyword.slice(1)}`;
88
+ }
89
+ }
90
+ return modelId;
91
+ }
92
+ /**
93
+ * Get approximate line number for a node in the workflow JSON.
94
+ */
95
+ function getLineNumberForNode(content, nodeId) {
96
+ const lines = content.split('\n');
97
+ for (let i = 0; i < lines.length; i++) {
98
+ if (lines[i].includes(`"id": "${nodeId}"`)) {
99
+ return i + 1;
100
+ }
101
+ }
102
+ return 1;
103
+ }
104
+ // ---------------------------------------------------------------------------
105
+ // Main validation function
106
+ // ---------------------------------------------------------------------------
107
+ export function checkLlmModelId(content, path) {
108
+ const findings = [];
109
+ let workflow;
110
+ try {
111
+ workflow = JSON.parse(content);
112
+ }
113
+ catch {
114
+ return findings;
115
+ }
116
+ if (!workflow.nodes || !Array.isArray(workflow.nodes)) {
117
+ return findings;
118
+ }
119
+ for (const node of workflow.nodes) {
120
+ const provider = ALLOWED_MODELS[node.type];
121
+ if (!provider)
122
+ continue;
123
+ const modelId = extractModelId(node);
124
+ if (!modelId)
125
+ continue;
126
+ if (provider.allowed.includes(modelId))
127
+ continue;
128
+ // Model is not in the allowlist — flag it
129
+ const replacement = pickReplacement(modelId, provider);
130
+ const displayName = getDisplayName(replacement, provider);
131
+ const lineNumber = getLineNumberForNode(content, node.id);
132
+ findings.push({
133
+ rule: metadata.id,
134
+ severity: metadata.severity,
135
+ path,
136
+ message: `Node "${node.name}" uses unknown or deprecated ${provider.providerName} model "${modelId}". Use "${replacement}" (${displayName}).`,
137
+ raw_details: `The model "${modelId}" is not in the current ${provider.providerName} allowlist and may be ` +
138
+ `retired. Replace with "${replacement}".\n\n` +
139
+ `Current allowed models: ${provider.allowed.join(', ')}`,
140
+ nodeId: node.id,
141
+ line: lineNumber,
142
+ guideRef: {
143
+ path: 'integrations/anthropic.md',
144
+ section: 'Available Models',
145
+ },
146
+ fixable: true,
147
+ fix: {
148
+ description: `Replace "${modelId}" with "${replacement}"`,
149
+ apply: (fileContent) => {
150
+ const parsed = JSON.parse(fileContent);
151
+ const targetNode = parsed.nodes.find((n) => n.id === node.id);
152
+ if (targetNode?.parameters?.model) {
153
+ const m = targetNode.parameters.model;
154
+ if (typeof m === 'string') {
155
+ targetNode.parameters.model = replacement;
156
+ }
157
+ else if (typeof m === 'object' && m.value) {
158
+ m.value = replacement;
159
+ if (m.cachedResultName) {
160
+ m.cachedResultName = displayName;
161
+ }
162
+ }
163
+ }
164
+ return JSON.stringify(parsed, null, 2);
165
+ },
166
+ },
167
+ });
168
+ }
169
+ return findings;
170
+ }
171
+ //# sourceMappingURL=llm-model-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-model-id.js","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-model-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,4DAA4D;IACzE,OAAO,EACL,sFAAsF;QACtF,iFAAiF;IACnF,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,UAAU;CACrB,CAAC;AAqBF,MAAM,cAAc,GAAmC;IACrD,0CAA0C,EAAE;QAC1C,YAAY,EAAE,WAAW;QACzB,OAAO,EAAE;YACP,0BAA0B;YAC1B,wBAAwB;YACxB,2BAA2B;YAC3B,6CAA6C;YAC7C,mBAAmB;YACnB,iBAAiB;YAC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M,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;oBAC5E,IAAI,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;wBAClC,MAAM,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC;wBACtC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;4BAC1B,UAAU,CAAC,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC;wBAC5C,CAAC;6BAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;4BAC5C,CAAC,CAAC,KAAK,GAAG,WAAW,CAAC;4BACtB,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;gCACvB,CAAC,CAAC,gBAAgB,GAAG,WAAW,CAAC;4BACnC,CAAC;wBACH,CAAC;oBACH,CAAC;oBACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACzC,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Script: LLM-OUTPUT-ACCESS
3
+ *
4
+ * Checks that LLM chain outputs are correctly accessed via the .output property
5
+ * when using a Structured Output Parser.
6
+ *
7
+ * CORRECT: $json.output.fieldName
8
+ * CORRECT: $('LLM Node').first().json.output.fieldName
9
+ * INCORRECT: $json.fieldName (missing .output)
10
+ * INCORRECT: $('LLM Node').first().json.fieldName (missing .output)
11
+ *
12
+ * When chainLlm is used with outputParserStructured, the result is wrapped in
13
+ * an `output` property. Accessing fields directly without .output will fail.
14
+ *
15
+ * This script provides auto-fix capability to add the .output prefix.
16
+ */
17
+ import type { Finding, RuleMetadata } from '../types.js';
18
+ export declare const metadata: RuleMetadata;
19
+ /**
20
+ * Main validation function
21
+ */
22
+ export declare function checkLlmOutputAccess(content: string, path: string): Finding[];
23
+ //# sourceMappingURL=llm-output-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-output-access.d.ts","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-output-access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,QAAQ,EAAE,YAUtB,CAAC;AAmRF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAuD7E"}
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Script: LLM-OUTPUT-ACCESS
3
+ *
4
+ * Checks that LLM chain outputs are correctly accessed via the .output property
5
+ * when using a Structured Output Parser.
6
+ *
7
+ * CORRECT: $json.output.fieldName
8
+ * CORRECT: $('LLM Node').first().json.output.fieldName
9
+ * INCORRECT: $json.fieldName (missing .output)
10
+ * INCORRECT: $('LLM Node').first().json.fieldName (missing .output)
11
+ *
12
+ * When chainLlm is used with outputParserStructured, the result is wrapped in
13
+ * an `output` property. Accessing fields directly without .output will fail.
14
+ *
15
+ * This script provides auto-fix capability to add the .output prefix.
16
+ */
17
+ export const metadata = {
18
+ id: 'LLM-OUTPUT-ACCESS',
19
+ name: 'llm_output_access',
20
+ severity: 'must',
21
+ description: 'LLM chain outputs must be accessed via .output property when using structured output parser',
22
+ details: 'When chainLlm is used with outputParserStructured, the result is wrapped in an output property. ' +
23
+ 'Use $json.output.fieldName instead of $json.fieldName',
24
+ fixable: true,
25
+ category: 'ai-nodes',
26
+ };
27
+ /**
28
+ * Find all chainLlm nodes that have hasOutputParser: true
29
+ */
30
+ function findChainLlmNodesWithParser(workflow) {
31
+ return workflow.nodes.filter(node => node.type === '@n8n/n8n-nodes-langchain.chainLlm' &&
32
+ node.parameters?.hasOutputParser === true);
33
+ }
34
+ /**
35
+ * Find nodes directly connected downstream from a given node (via main connection)
36
+ */
37
+ function findDirectDownstreamNodes(workflow, nodeName) {
38
+ const connections = workflow.connections[nodeName];
39
+ if (!connections?.main)
40
+ return [];
41
+ const downstreamNodes = [];
42
+ for (const branch of connections.main) {
43
+ for (const conn of branch) {
44
+ if (conn.type === 'main') {
45
+ downstreamNodes.push(conn.node);
46
+ }
47
+ }
48
+ }
49
+ return downstreamNodes;
50
+ }
51
+ /**
52
+ * Get all node names that have chainLlm with output parser
53
+ */
54
+ function getChainLlmNodeNames(workflow) {
55
+ const names = new Set();
56
+ for (const node of workflow.nodes) {
57
+ if (node.type === '@n8n/n8n-nodes-langchain.chainLlm' &&
58
+ node.parameters?.hasOutputParser === true) {
59
+ names.add(node.name);
60
+ }
61
+ }
62
+ return names;
63
+ }
64
+ /**
65
+ * Check if a node is directly downstream from any chainLlm node with output parser
66
+ */
67
+ function isDirectlyConnectedToChainLlm(workflow, nodeId, chainLlmNames) {
68
+ const node = workflow.nodes.find(n => n.id === nodeId);
69
+ if (!node)
70
+ return false;
71
+ // Check if any chainLlm node connects to this node
72
+ for (const chainName of chainLlmNames) {
73
+ const downstreamNodes = findDirectDownstreamNodes(workflow, chainName);
74
+ if (downstreamNodes.includes(node.name)) {
75
+ return true;
76
+ }
77
+ }
78
+ return false;
79
+ }
80
+ /**
81
+ * Escape special regex characters in a string
82
+ */
83
+ function escapeRegex(str) {
84
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
85
+ }
86
+ /**
87
+ * Check for direct $json.fieldName access (should be $json.output.fieldName)
88
+ * This only applies to nodes directly connected to chainLlm
89
+ */
90
+ function checkDirectJsonAccess(content, node, path) {
91
+ const findings = [];
92
+ const nodeJson = JSON.stringify(node);
93
+ // Pattern to find $json.fieldName (but not $json.output.fieldName)
94
+ // Negative lookahead to skip $json.output
95
+ const directAccessRegex = /\$json\.(?!output[\.\?\s])([a-zA-Z_][a-zA-Z0-9_]*)/g;
96
+ // Also check for defensive patterns that should be skipped
97
+ const defensivePattern = /\$json\.output\?\.[a-zA-Z_]+\s*\|\|\s*\$json\.[a-zA-Z_]+/;
98
+ // If the node has a defensive pattern, skip it entirely
99
+ if (defensivePattern.test(nodeJson)) {
100
+ return findings;
101
+ }
102
+ let match;
103
+ directAccessRegex.lastIndex = 0;
104
+ while ((match = directAccessRegex.exec(nodeJson)) !== null) {
105
+ const fieldName = match[1];
106
+ const fullMatch = match[0];
107
+ // Skip if this is part of a defensive pattern (check surrounding context)
108
+ const contextStart = Math.max(0, match.index - 50);
109
+ const contextEnd = Math.min(nodeJson.length, match.index + fullMatch.length + 50);
110
+ const context = nodeJson.substring(contextStart, contextEnd);
111
+ // Skip if this looks like a fallback pattern: $json.output?.field || $json.field
112
+ if (/\$json\.output\?\.\w+\s*\|\|/.test(context)) {
113
+ continue;
114
+ }
115
+ // Calculate approximate line number in the original content
116
+ const lineNumber = getLineNumberForNode(content, node.id);
117
+ findings.push({
118
+ rule: metadata.id,
119
+ severity: metadata.severity,
120
+ path,
121
+ message: `LLM chain output accessed without .output prefix: ${fullMatch} should be $json.output.${fieldName}`,
122
+ raw_details: `When chainLlm is used with outputParserStructured, the output is wrapped in an 'output' property. Change ${fullMatch} to $json.output.${fieldName}`,
123
+ nodeId: node.id,
124
+ line: lineNumber,
125
+ fixable: true,
126
+ fix: {
127
+ description: `Change ${fullMatch} to $json.output.${fieldName}`,
128
+ apply: (fileContent) => {
129
+ // Find the specific node in the content and fix it
130
+ const parsed = JSON.parse(fileContent);
131
+ const targetNode = parsed.nodes.find((n) => n.id === node.id);
132
+ if (targetNode) {
133
+ const nodeStr = JSON.stringify(targetNode);
134
+ // Replace $json.fieldName with $json.output.fieldName (but not $json.output.*)
135
+ const fixedNodeStr = nodeStr.replace(new RegExp(`\\$json\\.(?!output[.?\\s])${escapeRegex(fieldName)}`, 'g'), `$json.output.${fieldName}`);
136
+ const fixedNode = JSON.parse(fixedNodeStr);
137
+ const nodeIndex = parsed.nodes.findIndex((n) => n.id === node.id);
138
+ parsed.nodes[nodeIndex] = fixedNode;
139
+ }
140
+ return JSON.stringify(parsed, null, 2);
141
+ },
142
+ },
143
+ });
144
+ }
145
+ return findings;
146
+ }
147
+ /**
148
+ * Check for named reference access like $('NodeName').first().json.fieldName
149
+ * This applies to any node referencing a chainLlm node by name
150
+ */
151
+ function checkNamedReferenceAccess(content, node, chainLlmNames, path) {
152
+ const findings = [];
153
+ const nodeJson = JSON.stringify(node);
154
+ for (const chainName of chainLlmNames) {
155
+ // Escape the node name for use in regex
156
+ const escapedName = escapeRegex(chainName);
157
+ // Pattern to find $('NodeName').first().json.fieldName or $('NodeName').item.json.fieldName
158
+ // or $("NodeName") with double quotes
159
+ // But NOT .json.output.fieldName (which is correct)
160
+ // Using word boundary \b to properly detect "output" as a complete word
161
+ const namedRefRegex = new RegExp(`\\$\\(['"]${escapedName}['"]\\)\\.(first\\(\\)|item|all\\(\\)\\[\\d+\\])\\.json\\.(?!output\\b)([a-zA-Z_][a-zA-Z0-9_]*)`, 'g');
162
+ // Also check for defensive patterns
163
+ const defensivePattern = new RegExp(`\\$\\(['"]${escapedName}['"]\\).*\\.json\\.output\\?\\.[a-zA-Z_]+\\s*\\|\\|`);
164
+ if (defensivePattern.test(nodeJson)) {
165
+ continue;
166
+ }
167
+ let match;
168
+ namedRefRegex.lastIndex = 0;
169
+ while ((match = namedRefRegex.exec(nodeJson)) !== null) {
170
+ const accessor = match[1]; // first(), item, or all()[0]
171
+ const fieldName = match[2];
172
+ const fullMatch = match[0];
173
+ // Skip if this is part of a defensive pattern
174
+ const contextStart = Math.max(0, match.index - 50);
175
+ const contextEnd = Math.min(nodeJson.length, match.index + fullMatch.length + 50);
176
+ const context = nodeJson.substring(contextStart, contextEnd);
177
+ if (/\.json\.output\?\.\w+\s*\|\|/.test(context)) {
178
+ continue;
179
+ }
180
+ const lineNumber = getLineNumberForNode(content, node.id);
181
+ findings.push({
182
+ rule: metadata.id,
183
+ severity: metadata.severity,
184
+ path,
185
+ message: `LLM chain '${chainName}' output accessed without .output prefix: should be $('${chainName}').${accessor}.json.output.${fieldName}`,
186
+ raw_details: `When chainLlm is used with outputParserStructured, the output is wrapped in an 'output' property. Add .output before .${fieldName}`,
187
+ nodeId: node.id,
188
+ line: lineNumber,
189
+ fixable: true,
190
+ fix: {
191
+ description: `Add .output prefix when accessing ${chainName} output`,
192
+ apply: (fileContent) => {
193
+ const parsed = JSON.parse(fileContent);
194
+ const targetNode = parsed.nodes.find((n) => n.id === node.id);
195
+ if (targetNode) {
196
+ const nodeStr = JSON.stringify(targetNode);
197
+ // Replace .json.fieldName with .json.output.fieldName for this specific node reference
198
+ const fixRegex = new RegExp(`(\\$\\(['"]${escapedName}['"]\\)\\.(first\\(\\)|item|all\\(\\)\\[\\d+\\])\\.json)\\.(?!output)${escapeRegex(fieldName)}`, 'g');
199
+ const fixedNodeStr = nodeStr.replace(fixRegex, `$1.output.${fieldName}`);
200
+ const fixedNode = JSON.parse(fixedNodeStr);
201
+ const nodeIndex = parsed.nodes.findIndex((n) => n.id === node.id);
202
+ parsed.nodes[nodeIndex] = fixedNode;
203
+ }
204
+ return JSON.stringify(parsed, null, 2);
205
+ },
206
+ },
207
+ });
208
+ }
209
+ }
210
+ return findings;
211
+ }
212
+ /**
213
+ * Get approximate line number for a node in the workflow JSON
214
+ */
215
+ function getLineNumberForNode(content, nodeId) {
216
+ const lines = content.split('\n');
217
+ for (let i = 0; i < lines.length; i++) {
218
+ if (lines[i].includes(`"id": "${nodeId}"`)) {
219
+ return i + 1;
220
+ }
221
+ }
222
+ return 1;
223
+ }
224
+ /**
225
+ * Main validation function
226
+ */
227
+ export function checkLlmOutputAccess(content, path) {
228
+ const findings = [];
229
+ // Try to parse the workflow JSON
230
+ let workflow;
231
+ try {
232
+ workflow = JSON.parse(content);
233
+ }
234
+ catch {
235
+ // Not valid JSON, skip
236
+ return findings;
237
+ }
238
+ // Make sure it's a workflow with nodes
239
+ if (!workflow.nodes || !Array.isArray(workflow.nodes)) {
240
+ return findings;
241
+ }
242
+ // Find all chainLlm nodes with output parsers
243
+ const chainLlmNodes = findChainLlmNodesWithParser(workflow);
244
+ if (chainLlmNodes.length === 0) {
245
+ return findings;
246
+ }
247
+ // Get the names of all chainLlm nodes with output parsers
248
+ const chainLlmNames = getChainLlmNodeNames(workflow);
249
+ // Check each node in the workflow
250
+ for (const node of workflow.nodes) {
251
+ // Skip the chainLlm nodes themselves
252
+ if (node.type === '@n8n/n8n-nodes-langchain.chainLlm') {
253
+ continue;
254
+ }
255
+ // Skip output parser nodes
256
+ if (node.type === '@n8n/n8n-nodes-langchain.outputParserStructured') {
257
+ continue;
258
+ }
259
+ // Skip model nodes
260
+ if (node.type.includes('lmChat')) {
261
+ continue;
262
+ }
263
+ // Check for direct $json access if this node is directly connected to a chainLlm
264
+ if (isDirectlyConnectedToChainLlm(workflow, node.id, chainLlmNames)) {
265
+ const directFindings = checkDirectJsonAccess(content, node, path);
266
+ findings.push(...directFindings);
267
+ }
268
+ // Check for named reference access in all nodes
269
+ const namedFindings = checkNamedReferenceAccess(content, node, chainLlmNames, path);
270
+ findings.push(...namedFindings);
271
+ }
272
+ return findings;
273
+ }
274
+ //# sourceMappingURL=llm-output-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-output-access.js","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-output-access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,6FAA6F;IAC1G,OAAO,EACL,kGAAkG;QAClG,uDAAuD;IACzD,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,UAAU;CACrB,CAAC;AAoBF;;GAEG;AACH,SAAS,2BAA2B,CAAC,QAAwB;IAC3D,OA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QAED,mBAAmB;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,SAAS;QACX,CAAC;QAED,iFAAiF;QACjF,IAAI,6BAA6B,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC;YACpE,MAAM,cAAc,GAAG,qBAAqB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAClE,QAAQ,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;QACnC,CAAC;QAED,gDAAgD;QAChD,MAAM,aAAa,GAAG,yBAAyB,CAAC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QACpF,QAAQ,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Script: MERGE-BEFORE-TERMINAL
3
+ *
4
+ * Validates that Merge nodes are never directly connected to terminal
5
+ * Codika nodes (Submit Result / Report Error / Ingestion Callback).
6
+ *
7
+ * A Merge node immediately before a terminal Codika node causes the
8
+ * workflow to hang indefinitely: the Merge waits for ALL inputs, but
9
+ * typically only one conditional branch executes.
10
+ *
11
+ * Merge → Code → Submit Result is fine (indirect).
12
+ * Merge → Submit Result is a MUST-fix violation (direct).
13
+ */
14
+ import type { Finding, RuleMetadata } from '../types.js';
15
+ export declare const metadata: RuleMetadata;
16
+ /**
17
+ * Check for Merge nodes directly connected to terminal Codika nodes
18
+ */
19
+ export declare function checkMergeBeforeTerminal(content: string, path: string): Finding[];
20
+ //# sourceMappingURL=merge-before-terminal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-before-terminal.d.ts","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/merge-before-terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,QAAQ,EAAE,YAWtB,CAAC;AAMF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CA+DjF"}