next-workflow-builder 0.1.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 (754) hide show
  1. package/dist/client/components/ai-elements/canvas.d.ts +9 -0
  2. package/dist/client/components/ai-elements/canvas.d.ts.map +1 -0
  3. package/dist/client/components/ai-elements/canvas.js +7 -0
  4. package/dist/client/components/ai-elements/canvas.js.map +1 -0
  5. package/dist/client/components/ai-elements/connection.d.ts +3 -0
  6. package/dist/client/components/ai-elements/connection.d.ts.map +1 -0
  7. package/dist/client/components/ai-elements/connection.js +4 -0
  8. package/dist/client/components/ai-elements/connection.js.map +1 -0
  9. package/dist/client/components/ai-elements/controls.d.ts +2 -0
  10. package/dist/client/components/ai-elements/controls.d.ts.map +1 -0
  11. package/dist/client/components/ai-elements/controls.js +26 -0
  12. package/dist/client/components/ai-elements/controls.js.map +1 -0
  13. package/dist/client/components/ai-elements/edge.d.ts +6 -0
  14. package/dist/client/components/ai-elements/edge.d.ts.map +1 -0
  15. package/dist/client/components/ai-elements/edge.js +86 -0
  16. package/dist/client/components/ai-elements/edge.js.map +1 -0
  17. package/dist/client/components/ai-elements/node.d.ts +23 -0
  18. package/dist/client/components/ai-elements/node.d.ts.map +1 -0
  19. package/dist/client/components/ai-elements/node.js +13 -0
  20. package/dist/client/components/ai-elements/node.js.map +1 -0
  21. package/dist/client/components/ai-elements/panel.d.ts +6 -0
  22. package/dist/client/components/ai-elements/panel.d.ts.map +1 -0
  23. package/dist/client/components/ai-elements/panel.js +5 -0
  24. package/dist/client/components/ai-elements/panel.js.map +1 -0
  25. package/dist/client/components/ai-elements/prompt.d.ts +7 -0
  26. package/dist/client/components/ai-elements/prompt.d.ts.map +1 -0
  27. package/dist/client/components/ai-elements/prompt.js +220 -0
  28. package/dist/client/components/ai-elements/prompt.js.map +1 -0
  29. package/dist/client/components/ai-elements/shimmer.d.ts +10 -0
  30. package/dist/client/components/ai-elements/shimmer.d.ts.map +1 -0
  31. package/dist/client/components/ai-elements/shimmer.js +19 -0
  32. package/dist/client/components/ai-elements/shimmer.js.map +1 -0
  33. package/dist/client/components/auth/dialog.d.ts +8 -0
  34. package/dist/client/components/auth/dialog.d.ts.map +1 -0
  35. package/dist/client/components/auth/dialog.js +181 -0
  36. package/dist/client/components/auth/dialog.js.map +1 -0
  37. package/dist/client/components/deploy-button.d.ts +2 -0
  38. package/dist/client/components/deploy-button.d.ts.map +1 -0
  39. package/dist/client/components/deploy-button.js +8 -0
  40. package/dist/client/components/deploy-button.js.map +1 -0
  41. package/dist/client/components/global-modals.d.ts +2 -0
  42. package/dist/client/components/global-modals.d.ts.map +1 -0
  43. package/dist/client/components/global-modals.js +8 -0
  44. package/dist/client/components/global-modals.js.map +1 -0
  45. package/dist/client/components/icons/github-icon.d.ts +4 -0
  46. package/dist/client/components/icons/github-icon.d.ts.map +1 -0
  47. package/dist/client/components/icons/github-icon.js +5 -0
  48. package/dist/client/components/icons/github-icon.js.map +1 -0
  49. package/dist/client/components/index.d.ts +7 -0
  50. package/dist/client/components/index.d.ts.map +1 -0
  51. package/dist/client/components/index.js +8 -0
  52. package/dist/client/components/index.js.map +1 -0
  53. package/dist/client/components/layout-provider.d.ts +4 -0
  54. package/dist/client/components/layout-provider.d.ts.map +1 -0
  55. package/dist/client/components/layout-provider.js +20 -0
  56. package/dist/client/components/layout-provider.js.map +1 -0
  57. package/dist/client/components/overlays/add-connection-overlay.d.ts +14 -0
  58. package/dist/client/components/overlays/add-connection-overlay.d.ts.map +1 -0
  59. package/dist/client/components/overlays/add-connection-overlay.js +218 -0
  60. package/dist/client/components/overlays/add-connection-overlay.js.map +1 -0
  61. package/dist/client/components/overlays/api-keys-overlay.d.ts +6 -0
  62. package/dist/client/components/overlays/api-keys-overlay.d.ts.map +1 -0
  63. package/dist/client/components/overlays/api-keys-overlay.js +124 -0
  64. package/dist/client/components/overlays/api-keys-overlay.js.map +1 -0
  65. package/dist/client/components/overlays/configuration-overlay.d.ts +5 -0
  66. package/dist/client/components/overlays/configuration-overlay.d.ts.map +1 -0
  67. package/dist/client/components/overlays/configuration-overlay.js +325 -0
  68. package/dist/client/components/overlays/configuration-overlay.js.map +1 -0
  69. package/dist/client/components/overlays/confirm-overlay.d.ts +15 -0
  70. package/dist/client/components/overlays/confirm-overlay.d.ts.map +1 -0
  71. package/dist/client/components/overlays/confirm-overlay.js +31 -0
  72. package/dist/client/components/overlays/confirm-overlay.js.map +1 -0
  73. package/dist/client/components/overlays/edit-connection-overlay.d.ts +16 -0
  74. package/dist/client/components/overlays/edit-connection-overlay.d.ts.map +1 -0
  75. package/dist/client/components/overlays/edit-connection-overlay.js +213 -0
  76. package/dist/client/components/overlays/edit-connection-overlay.js.map +1 -0
  77. package/dist/client/components/overlays/export-workflow-overlay.d.ts +8 -0
  78. package/dist/client/components/overlays/export-workflow-overlay.d.ts.map +1 -0
  79. package/dist/client/components/overlays/export-workflow-overlay.js +22 -0
  80. package/dist/client/components/overlays/export-workflow-overlay.js.map +1 -0
  81. package/dist/client/components/overlays/integrations-overlay.d.ts +6 -0
  82. package/dist/client/components/overlays/integrations-overlay.d.ts.map +1 -0
  83. package/dist/client/components/overlays/integrations-overlay.js +56 -0
  84. package/dist/client/components/overlays/integrations-overlay.js.map +1 -0
  85. package/dist/client/components/overlays/make-public-overlay.d.ts +7 -0
  86. package/dist/client/components/overlays/make-public-overlay.d.ts.map +1 -0
  87. package/dist/client/components/overlays/make-public-overlay.js +17 -0
  88. package/dist/client/components/overlays/make-public-overlay.js.map +1 -0
  89. package/dist/client/components/overlays/overlay-container.d.ts +2 -0
  90. package/dist/client/components/overlays/overlay-container.d.ts.map +1 -0
  91. package/dist/client/components/overlays/overlay-container.js +236 -0
  92. package/dist/client/components/overlays/overlay-container.js.map +1 -0
  93. package/dist/client/components/overlays/overlay-footer.d.ts +3 -0
  94. package/dist/client/components/overlays/overlay-footer.d.ts.map +1 -0
  95. package/dist/client/components/overlays/overlay-footer.js +25 -0
  96. package/dist/client/components/overlays/overlay-footer.js.map +1 -0
  97. package/dist/client/components/overlays/overlay-header.d.ts +8 -0
  98. package/dist/client/components/overlays/overlay-header.d.ts.map +1 -0
  99. package/dist/client/components/overlays/overlay-header.js +32 -0
  100. package/dist/client/components/overlays/overlay-header.js.map +1 -0
  101. package/dist/client/components/overlays/overlay-provider.d.ts +17 -0
  102. package/dist/client/components/overlays/overlay-provider.d.ts.map +1 -0
  103. package/dist/client/components/overlays/overlay-provider.js +120 -0
  104. package/dist/client/components/overlays/overlay-provider.js.map +1 -0
  105. package/dist/client/components/overlays/overlay-sync.d.ts +2 -0
  106. package/dist/client/components/overlays/overlay-sync.d.ts.map +1 -0
  107. package/dist/client/components/overlays/overlay-sync.js +21 -0
  108. package/dist/client/components/overlays/overlay-sync.js.map +1 -0
  109. package/dist/client/components/overlays/overlay.d.ts +7 -0
  110. package/dist/client/components/overlays/overlay.d.ts.map +1 -0
  111. package/dist/client/components/overlays/overlay.js +9 -0
  112. package/dist/client/components/overlays/overlay.js.map +1 -0
  113. package/dist/client/components/overlays/settings-overlay.d.ts +6 -0
  114. package/dist/client/components/overlays/settings-overlay.d.ts.map +1 -0
  115. package/dist/client/components/overlays/settings-overlay.js +64 -0
  116. package/dist/client/components/overlays/settings-overlay.js.map +1 -0
  117. package/dist/client/components/overlays/types.d.ts +64 -0
  118. package/dist/client/components/overlays/types.d.ts.map +1 -0
  119. package/dist/client/components/overlays/types.js +2 -0
  120. package/dist/client/components/overlays/types.js.map +1 -0
  121. package/dist/client/components/overlays/workflow-issues-overlay.d.ts +37 -0
  122. package/dist/client/components/overlays/workflow-issues-overlay.d.ts.map +1 -0
  123. package/dist/client/components/overlays/workflow-issues-overlay.js +67 -0
  124. package/dist/client/components/overlays/workflow-issues-overlay.js.map +1 -0
  125. package/dist/client/components/pages/home-page.d.ts +3 -0
  126. package/dist/client/components/pages/home-page.d.ts.map +1 -0
  127. package/dist/client/components/pages/home-page.js +100 -0
  128. package/dist/client/components/pages/home-page.js.map +1 -0
  129. package/dist/client/components/pages/workflow-page.d.ts +4 -0
  130. package/dist/client/components/pages/workflow-page.d.ts.map +1 -0
  131. package/dist/client/components/pages/workflow-page.js +23 -0
  132. package/dist/client/components/pages/workflow-page.js.map +1 -0
  133. package/dist/client/components/pages/workflows-redirect.d.ts +3 -0
  134. package/dist/client/components/pages/workflows-redirect.d.ts.map +1 -0
  135. package/dist/client/components/pages/workflows-redirect.js +30 -0
  136. package/dist/client/components/pages/workflows-redirect.js.map +1 -0
  137. package/dist/client/components/settings/account-settings.d.ts +9 -0
  138. package/dist/client/components/settings/account-settings.d.ts.map +1 -0
  139. package/dist/client/components/settings/account-settings.js +8 -0
  140. package/dist/client/components/settings/account-settings.js.map +1 -0
  141. package/dist/client/components/settings/integrations-manager.d.ts +7 -0
  142. package/dist/client/components/settings/integrations-manager.d.ts.map +1 -0
  143. package/dist/client/components/settings/integrations-manager.js +120 -0
  144. package/dist/client/components/settings/integrations-manager.js.map +1 -0
  145. package/dist/client/components/theme-provider.d.ts +5 -0
  146. package/dist/client/components/theme-provider.d.ts.map +1 -0
  147. package/dist/client/components/theme-provider.js +6 -0
  148. package/dist/client/components/theme-provider.js.map +1 -0
  149. package/dist/client/components/ui/alert-dialog.d.ts +15 -0
  150. package/dist/client/components/ui/alert-dialog.d.ts.map +1 -0
  151. package/dist/client/components/ui/alert-dialog.js +40 -0
  152. package/dist/client/components/ui/alert-dialog.js.map +1 -0
  153. package/dist/client/components/ui/alert.d.ts +10 -0
  154. package/dist/client/components/ui/alert.d.ts.map +1 -0
  155. package/dist/client/components/ui/alert.js +25 -0
  156. package/dist/client/components/ui/alert.js.map +1 -0
  157. package/dist/client/components/ui/animated-border.d.ts +6 -0
  158. package/dist/client/components/ui/animated-border.d.ts.map +1 -0
  159. package/dist/client/components/ui/animated-border.js +34 -0
  160. package/dist/client/components/ui/animated-border.js.map +1 -0
  161. package/dist/client/components/ui/avatar.d.ts +7 -0
  162. package/dist/client/components/ui/avatar.d.ts.map +1 -0
  163. package/dist/client/components/ui/avatar.js +15 -0
  164. package/dist/client/components/ui/avatar.js.map +1 -0
  165. package/dist/client/components/ui/button-group.d.ts +12 -0
  166. package/dist/client/components/ui/button-group.d.ts.map +1 -0
  167. package/dist/client/components/ui/button-group.js +28 -0
  168. package/dist/client/components/ui/button-group.js.map +1 -0
  169. package/dist/client/components/ui/button.d.ts +11 -0
  170. package/dist/client/components/ui/button.d.ts.map +1 -0
  171. package/dist/client/components/ui/button.js +34 -0
  172. package/dist/client/components/ui/button.js.map +1 -0
  173. package/dist/client/components/ui/card.d.ts +10 -0
  174. package/dist/client/components/ui/card.d.ts.map +1 -0
  175. package/dist/client/components/ui/card.js +25 -0
  176. package/dist/client/components/ui/card.js.map +1 -0
  177. package/dist/client/components/ui/checkbox.d.ts +5 -0
  178. package/dist/client/components/ui/checkbox.d.ts.map +1 -0
  179. package/dist/client/components/ui/checkbox.js +10 -0
  180. package/dist/client/components/ui/checkbox.js.map +1 -0
  181. package/dist/client/components/ui/code-editor.d.ts +3 -0
  182. package/dist/client/components/ui/code-editor.d.ts.map +1 -0
  183. package/dist/client/components/ui/code-editor.js +17 -0
  184. package/dist/client/components/ui/code-editor.js.map +1 -0
  185. package/dist/client/components/ui/collapsible.d.ts +6 -0
  186. package/dist/client/components/ui/collapsible.d.ts.map +1 -0
  187. package/dist/client/components/ui/collapsible.js +14 -0
  188. package/dist/client/components/ui/collapsible.js.map +1 -0
  189. package/dist/client/components/ui/context-menu.d.ts +26 -0
  190. package/dist/client/components/ui/context-menu.d.ts.map +1 -0
  191. package/dist/client/components/ui/context-menu.js +52 -0
  192. package/dist/client/components/ui/context-menu.js.map +1 -0
  193. package/dist/client/components/ui/dialog.d.ts +16 -0
  194. package/dist/client/components/ui/dialog.d.ts.map +1 -0
  195. package/dist/client/components/ui/dialog.js +37 -0
  196. package/dist/client/components/ui/dialog.js.map +1 -0
  197. package/dist/client/components/ui/drawer.d.ts +14 -0
  198. package/dist/client/components/ui/drawer.d.ts.map +1 -0
  199. package/dist/client/components/ui/drawer.js +36 -0
  200. package/dist/client/components/ui/drawer.js.map +1 -0
  201. package/dist/client/components/ui/dropdown-menu.d.ts +26 -0
  202. package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -0
  203. package/dist/client/components/ui/dropdown-menu.js +52 -0
  204. package/dist/client/components/ui/dropdown-menu.js.map +1 -0
  205. package/dist/client/components/ui/input.d.ts +4 -0
  206. package/dist/client/components/ui/input.d.ts.map +1 -0
  207. package/dist/client/components/ui/input.js +7 -0
  208. package/dist/client/components/ui/input.js.map +1 -0
  209. package/dist/client/components/ui/integration-icon.d.ts +7 -0
  210. package/dist/client/components/ui/integration-icon.d.ts.map +1 -0
  211. package/dist/client/components/ui/integration-icon.js +25 -0
  212. package/dist/client/components/ui/integration-icon.js.map +1 -0
  213. package/dist/client/components/ui/integration-selector.d.ts +12 -0
  214. package/dist/client/components/ui/integration-selector.d.ts.map +1 -0
  215. package/dist/client/components/ui/integration-selector.js +198 -0
  216. package/dist/client/components/ui/integration-selector.js.map +1 -0
  217. package/dist/client/components/ui/label.d.ts +5 -0
  218. package/dist/client/components/ui/label.d.ts.map +1 -0
  219. package/dist/client/components/ui/label.js +9 -0
  220. package/dist/client/components/ui/label.js.map +1 -0
  221. package/dist/client/components/ui/resizable.d.ts +9 -0
  222. package/dist/client/components/ui/resizable.d.ts.map +1 -0
  223. package/dist/client/components/ui/resizable.js +16 -0
  224. package/dist/client/components/ui/resizable.js.map +1 -0
  225. package/dist/client/components/ui/select.d.ts +16 -0
  226. package/dist/client/components/ui/select.d.ts.map +1 -0
  227. package/dist/client/components/ui/select.js +39 -0
  228. package/dist/client/components/ui/select.js.map +1 -0
  229. package/dist/client/components/ui/separator.d.ts +5 -0
  230. package/dist/client/components/ui/separator.d.ts.map +1 -0
  231. package/dist/client/components/ui/separator.js +9 -0
  232. package/dist/client/components/ui/separator.js.map +1 -0
  233. package/dist/client/components/ui/sheet.d.ts +14 -0
  234. package/dist/client/components/ui/sheet.d.ts.map +1 -0
  235. package/dist/client/components/ui/sheet.js +41 -0
  236. package/dist/client/components/ui/sheet.js.map +1 -0
  237. package/dist/client/components/ui/sonner.d.ts +4 -0
  238. package/dist/client/components/ui/sonner.d.ts.map +1 -0
  239. package/dist/client/components/ui/sonner.js +22 -0
  240. package/dist/client/components/ui/sonner.js.map +1 -0
  241. package/dist/client/components/ui/spinner.d.ts +4 -0
  242. package/dist/client/components/ui/spinner.d.ts.map +1 -0
  243. package/dist/client/components/ui/spinner.js +9 -0
  244. package/dist/client/components/ui/spinner.js.map +1 -0
  245. package/dist/client/components/ui/tabs.d.ts +8 -0
  246. package/dist/client/components/ui/tabs.d.ts.map +1 -0
  247. package/dist/client/components/ui/tabs.js +18 -0
  248. package/dist/client/components/ui/tabs.js.map +1 -0
  249. package/dist/client/components/ui/template-autocomplete.d.ts +14 -0
  250. package/dist/client/components/ui/template-autocomplete.d.ts.map +1 -0
  251. package/dist/client/components/ui/template-autocomplete.js +239 -0
  252. package/dist/client/components/ui/template-autocomplete.js.map +1 -0
  253. package/dist/client/components/ui/template-badge-input.d.ts +10 -0
  254. package/dist/client/components/ui/template-badge-input.d.ts.map +1 -0
  255. package/dist/client/components/ui/template-badge-input.js +360 -0
  256. package/dist/client/components/ui/template-badge-input.js.map +1 -0
  257. package/dist/client/components/ui/template-badge-textarea.d.ts +11 -0
  258. package/dist/client/components/ui/template-badge-textarea.d.ts.map +1 -0
  259. package/dist/client/components/ui/template-badge-textarea.js +431 -0
  260. package/dist/client/components/ui/template-badge-textarea.js.map +1 -0
  261. package/dist/client/components/ui/timezone-select.d.ts +9 -0
  262. package/dist/client/components/ui/timezone-select.d.ts.map +1 -0
  263. package/dist/client/components/ui/timezone-select.js +87 -0
  264. package/dist/client/components/ui/timezone-select.js.map +1 -0
  265. package/dist/client/components/ui/tooltip.d.ts +8 -0
  266. package/dist/client/components/ui/tooltip.d.ts.map +1 -0
  267. package/dist/client/components/ui/tooltip.js +18 -0
  268. package/dist/client/components/ui/tooltip.js.map +1 -0
  269. package/dist/client/components/ui/workflow-icon.d.ts +4 -0
  270. package/dist/client/components/ui/workflow-icon.d.ts.map +1 -0
  271. package/dist/client/components/ui/workflow-icon.js +5 -0
  272. package/dist/client/components/ui/workflow-icon.js.map +1 -0
  273. package/dist/client/components/workflow/config/action-config-renderer.d.ts +10 -0
  274. package/dist/client/components/workflow/config/action-config-renderer.d.ts.map +1 -0
  275. package/dist/client/components/workflow/config/action-config-renderer.js +64 -0
  276. package/dist/client/components/workflow/config/action-config-renderer.js.map +1 -0
  277. package/dist/client/components/workflow/config/action-config.d.ts +9 -0
  278. package/dist/client/components/workflow/config/action-config.d.ts.map +1 -0
  279. package/dist/client/components/workflow/config/action-config.js +174 -0
  280. package/dist/client/components/workflow/config/action-config.js.map +1 -0
  281. package/dist/client/components/workflow/config/action-grid.d.ts +8 -0
  282. package/dist/client/components/workflow/config/action-grid.d.ts.map +1 -0
  283. package/dist/client/components/workflow/config/action-grid.js +162 -0
  284. package/dist/client/components/workflow/config/action-grid.js.map +1 -0
  285. package/dist/client/components/workflow/config/condition-config.d.ts +8 -0
  286. package/dist/client/components/workflow/config/condition-config.d.ts.map +1 -0
  287. package/dist/client/components/workflow/config/condition-config.js +7 -0
  288. package/dist/client/components/workflow/config/condition-config.js.map +1 -0
  289. package/dist/client/components/workflow/config/editor-config.d.ts +13 -0
  290. package/dist/client/components/workflow/config/editor-config.d.ts.map +1 -0
  291. package/dist/client/components/workflow/config/editor-config.js +34 -0
  292. package/dist/client/components/workflow/config/editor-config.js.map +1 -0
  293. package/dist/client/components/workflow/config/schema-builder.d.ts +17 -0
  294. package/dist/client/components/workflow/config/schema-builder.d.ts.map +1 -0
  295. package/dist/client/components/workflow/config/schema-builder.js +55 -0
  296. package/dist/client/components/workflow/config/schema-builder.js.map +1 -0
  297. package/dist/client/components/workflow/config/system-action.d.ts +9 -0
  298. package/dist/client/components/workflow/config/system-action.d.ts.map +1 -0
  299. package/dist/client/components/workflow/config/system-action.js +33 -0
  300. package/dist/client/components/workflow/config/system-action.js.map +1 -0
  301. package/dist/client/components/workflow/config/trigger-config.d.ts +9 -0
  302. package/dist/client/components/workflow/config/trigger-config.d.ts.map +1 -0
  303. package/dist/client/components/workflow/config/trigger-config.js +33 -0
  304. package/dist/client/components/workflow/config/trigger-config.js.map +1 -0
  305. package/dist/client/components/workflow/node-config-panel.d.ts +3 -0
  306. package/dist/client/components/workflow/node-config-panel.d.ts.map +1 -0
  307. package/dist/client/components/workflow/node-config-panel.js +353 -0
  308. package/dist/client/components/workflow/node-config-panel.js.map +1 -0
  309. package/dist/client/components/workflow/nodes/action-node.d.ts +10 -0
  310. package/dist/client/components/workflow/nodes/action-node.d.ts.map +1 -0
  311. package/dist/client/components/workflow/nodes/action-node.js +176 -0
  312. package/dist/client/components/workflow/nodes/action-node.js.map +1 -0
  313. package/dist/client/components/workflow/nodes/add-node.d.ts +9 -0
  314. package/dist/client/components/workflow/nodes/add-node.d.ts.map +1 -0
  315. package/dist/client/components/workflow/nodes/add-node.js +8 -0
  316. package/dist/client/components/workflow/nodes/add-node.js.map +1 -0
  317. package/dist/client/components/workflow/nodes/trigger-node.d.ts +8 -0
  318. package/dist/client/components/workflow/nodes/trigger-node.d.ts.map +1 -0
  319. package/dist/client/components/workflow/nodes/trigger-node.js +25 -0
  320. package/dist/client/components/workflow/nodes/trigger-node.js.map +1 -0
  321. package/dist/client/components/workflow/persistent-canvas.d.ts +2 -0
  322. package/dist/client/components/workflow/persistent-canvas.d.ts.map +1 -0
  323. package/dist/client/components/workflow/persistent-canvas.js +13 -0
  324. package/dist/client/components/workflow/persistent-canvas.js.map +1 -0
  325. package/dist/client/components/workflow/utils/code-generators.d.ts +12 -0
  326. package/dist/client/components/workflow/utils/code-generators.d.ts.map +1 -0
  327. package/dist/client/components/workflow/utils/code-generators.js +70 -0
  328. package/dist/client/components/workflow/utils/code-generators.js.map +1 -0
  329. package/dist/client/components/workflow/workflow-canvas.d.ts +3 -0
  330. package/dist/client/components/workflow/workflow-canvas.d.ts.map +1 -0
  331. package/dist/client/components/workflow/workflow-canvas.js +347 -0
  332. package/dist/client/components/workflow/workflow-canvas.js.map +1 -0
  333. package/dist/client/components/workflow/workflow-context-menu.d.ts +27 -0
  334. package/dist/client/components/workflow/workflow-context-menu.d.ts.map +1 -0
  335. package/dist/client/components/workflow/workflow-context-menu.js +156 -0
  336. package/dist/client/components/workflow/workflow-context-menu.js.map +1 -0
  337. package/dist/client/components/workflow/workflow-editor.d.ts +6 -0
  338. package/dist/client/components/workflow/workflow-editor.d.ts.map +1 -0
  339. package/dist/client/components/workflow/workflow-editor.js +443 -0
  340. package/dist/client/components/workflow/workflow-editor.js.map +1 -0
  341. package/dist/client/components/workflow/workflow-runs.d.ts +8 -0
  342. package/dist/client/components/workflow/workflow-runs.d.ts.map +1 -0
  343. package/dist/client/components/workflow/workflow-runs.js +336 -0
  344. package/dist/client/components/workflow/workflow-runs.js.map +1 -0
  345. package/dist/client/components/workflow/workflow-toolbar.d.ts +6 -0
  346. package/dist/client/components/workflow/workflow-toolbar.d.ts.map +1 -0
  347. package/dist/client/components/workflow/workflow-toolbar.js +707 -0
  348. package/dist/client/components/workflow/workflow-toolbar.js.map +1 -0
  349. package/dist/client/components/workflows/user-menu.d.ts +2 -0
  350. package/dist/client/components/workflows/user-menu.d.ts.map +1 -0
  351. package/dist/client/components/workflows/user-menu.js +65 -0
  352. package/dist/client/components/workflows/user-menu.js.map +1 -0
  353. package/dist/client/hooks/use-mobile.d.ts +2 -0
  354. package/dist/client/hooks/use-mobile.d.ts.map +1 -0
  355. package/dist/client/hooks/use-mobile.js +16 -0
  356. package/dist/client/hooks/use-mobile.js.map +1 -0
  357. package/dist/client/hooks/use-touch.d.ts +2 -0
  358. package/dist/client/hooks/use-touch.d.ts.map +1 -0
  359. package/dist/client/hooks/use-touch.js +12 -0
  360. package/dist/client/hooks/use-touch.js.map +1 -0
  361. package/dist/client/index.d.ts +11 -0
  362. package/dist/client/index.d.ts.map +1 -0
  363. package/dist/client/index.js +12 -0
  364. package/dist/client/index.js.map +1 -0
  365. package/dist/client/package.json +1 -0
  366. package/dist/lib/api-client.d.ts +330 -0
  367. package/dist/lib/api-client.d.ts.map +1 -0
  368. package/dist/lib/api-client.js +274 -0
  369. package/dist/lib/api-client.js.map +1 -0
  370. package/dist/lib/atoms/overlay.d.ts +15 -0
  371. package/dist/lib/atoms/overlay.d.ts.map +1 -0
  372. package/dist/lib/atoms/overlay.js +78 -0
  373. package/dist/lib/atoms/overlay.js.map +1 -0
  374. package/dist/lib/auth-client.d.ts +871 -0
  375. package/dist/lib/auth-client.d.ts.map +1 -0
  376. package/dist/lib/auth-client.js +10 -0
  377. package/dist/lib/auth-client.js.map +1 -0
  378. package/dist/lib/auth-providers.d.ts +12 -0
  379. package/dist/lib/auth-providers.d.ts.map +1 -0
  380. package/dist/lib/auth-providers.js +27 -0
  381. package/dist/lib/auth-providers.js.map +1 -0
  382. package/dist/lib/auth.d.ts +5 -0
  383. package/dist/lib/auth.d.ts.map +1 -0
  384. package/dist/lib/auth.js +62 -0
  385. package/dist/lib/auth.js.map +1 -0
  386. package/dist/lib/codegen-templates/condition.d.ts +3 -0
  387. package/dist/lib/codegen-templates/condition.d.ts.map +1 -0
  388. package/dist/lib/codegen-templates/condition.js +9 -0
  389. package/dist/lib/codegen-templates/condition.js.map +1 -0
  390. package/dist/lib/codegen-templates/database-query.d.ts +3 -0
  391. package/dist/lib/codegen-templates/database-query.d.ts.map +1 -0
  392. package/dist/lib/codegen-templates/database-query.js +24 -0
  393. package/dist/lib/codegen-templates/database-query.js.map +1 -0
  394. package/dist/lib/codegen-templates/http-request.d.ts +3 -0
  395. package/dist/lib/codegen-templates/http-request.d.ts.map +1 -0
  396. package/dist/lib/codegen-templates/http-request.js +44 -0
  397. package/dist/lib/codegen-templates/http-request.js.map +1 -0
  398. package/dist/lib/condition-validator.d.ts +10 -0
  399. package/dist/lib/condition-validator.d.ts.map +1 -0
  400. package/dist/lib/condition-validator.js +230 -0
  401. package/dist/lib/condition-validator.js.map +1 -0
  402. package/dist/lib/constants.d.ts +3 -0
  403. package/dist/lib/constants.d.ts.map +1 -0
  404. package/dist/lib/constants.js +3 -0
  405. package/dist/lib/constants.js.map +1 -0
  406. package/dist/lib/credential-fetcher.d.ts +4 -0
  407. package/dist/lib/credential-fetcher.d.ts.map +1 -0
  408. package/dist/lib/credential-fetcher.js +38 -0
  409. package/dist/lib/credential-fetcher.js.map +1 -0
  410. package/dist/lib/db/index.d.ts +4 -0
  411. package/dist/lib/db/index.d.ts.map +1 -0
  412. package/dist/lib/db/index.js +17 -0
  413. package/dist/lib/db/index.js.map +1 -0
  414. package/dist/lib/db/integrations.d.ts +36 -0
  415. package/dist/lib/db/integrations.d.ts.map +1 -0
  416. package/dist/lib/db/integrations.js +170 -0
  417. package/dist/lib/db/integrations.js.map +1 -0
  418. package/dist/lib/db/schema.d.ts +1474 -0
  419. package/dist/lib/db/schema.d.ts.map +1 -0
  420. package/dist/lib/db/schema.js +143 -0
  421. package/dist/lib/db/schema.js.map +1 -0
  422. package/dist/lib/integrations-store.d.ts +13 -0
  423. package/dist/lib/integrations-store.d.ts.map +1 -0
  424. package/dist/lib/integrations-store.js +10 -0
  425. package/dist/lib/integrations-store.js.map +1 -0
  426. package/dist/lib/managed-connection.d.ts +49 -0
  427. package/dist/lib/managed-connection.d.ts.map +1 -0
  428. package/dist/lib/managed-connection.js +21 -0
  429. package/dist/lib/managed-connection.js.map +1 -0
  430. package/dist/lib/monaco-theme.d.ts +29 -0
  431. package/dist/lib/monaco-theme.d.ts.map +1 -0
  432. package/dist/lib/monaco-theme.js +54 -0
  433. package/dist/lib/monaco-theme.js.map +1 -0
  434. package/dist/lib/plugin-registry.d.ts +10 -0
  435. package/dist/lib/plugin-registry.d.ts.map +1 -0
  436. package/dist/lib/plugin-registry.js +16 -0
  437. package/dist/lib/plugin-registry.js.map +1 -0
  438. package/dist/lib/steps/credentials.d.ts +14 -0
  439. package/dist/lib/steps/credentials.d.ts.map +1 -0
  440. package/dist/lib/steps/credentials.js +65 -0
  441. package/dist/lib/steps/credentials.js.map +1 -0
  442. package/dist/lib/steps/http-request.d.ts +22 -0
  443. package/dist/lib/steps/http-request.d.ts.map +1 -0
  444. package/dist/lib/steps/http-request.js +72 -0
  445. package/dist/lib/steps/http-request.js.map +1 -0
  446. package/dist/lib/steps/index.d.ts +10 -0
  447. package/dist/lib/steps/index.d.ts.map +1 -0
  448. package/dist/lib/steps/index.js +14 -0
  449. package/dist/lib/steps/index.js.map +1 -0
  450. package/dist/lib/steps/step-handler.d.ts +30 -0
  451. package/dist/lib/steps/step-handler.d.ts.map +1 -0
  452. package/dist/lib/steps/step-handler.js +105 -0
  453. package/dist/lib/steps/step-handler.js.map +1 -0
  454. package/dist/lib/steps/trigger.d.ts +21 -0
  455. package/dist/lib/steps/trigger.d.ts.map +1 -0
  456. package/dist/lib/steps/trigger.js +17 -0
  457. package/dist/lib/steps/trigger.js.map +1 -0
  458. package/dist/lib/types/integration.d.ts +3 -0
  459. package/dist/lib/types/integration.d.ts.map +1 -0
  460. package/dist/lib/types/integration.js +2 -0
  461. package/dist/lib/types/integration.js.map +1 -0
  462. package/dist/lib/utils/format-number.d.ts +2 -0
  463. package/dist/lib/utils/format-number.d.ts.map +1 -0
  464. package/dist/lib/utils/format-number.js +16 -0
  465. package/dist/lib/utils/format-number.js.map +1 -0
  466. package/dist/lib/utils/id.d.ts +2 -0
  467. package/dist/lib/utils/id.d.ts.map +1 -0
  468. package/dist/lib/utils/id.js +6 -0
  469. package/dist/lib/utils/id.js.map +1 -0
  470. package/dist/lib/utils/redact.d.ts +4 -0
  471. package/dist/lib/utils/redact.d.ts.map +1 -0
  472. package/dist/lib/utils/redact.js +143 -0
  473. package/dist/lib/utils/redact.js.map +1 -0
  474. package/dist/lib/utils/template.d.ts +18 -0
  475. package/dist/lib/utils/template.d.ts.map +1 -0
  476. package/dist/lib/utils/template.js +323 -0
  477. package/dist/lib/utils/template.js.map +1 -0
  478. package/dist/lib/utils/time.d.ts +2 -0
  479. package/dist/lib/utils/time.d.ts.map +1 -0
  480. package/dist/lib/utils/time.js +34 -0
  481. package/dist/lib/utils/time.js.map +1 -0
  482. package/dist/lib/utils.d.ts +5 -0
  483. package/dist/lib/utils.d.ts.map +1 -0
  484. package/dist/lib/utils.js +99 -0
  485. package/dist/lib/utils.js.map +1 -0
  486. package/dist/lib/workflow-codegen-sdk.d.ts +4 -0
  487. package/dist/lib/workflow-codegen-sdk.d.ts.map +1 -0
  488. package/dist/lib/workflow-codegen-sdk.js +482 -0
  489. package/dist/lib/workflow-codegen-sdk.js.map +1 -0
  490. package/dist/lib/workflow-codegen-shared.d.ts +26 -0
  491. package/dist/lib/workflow-codegen-shared.d.ts.map +1 -0
  492. package/dist/lib/workflow-codegen-shared.js +232 -0
  493. package/dist/lib/workflow-codegen-shared.js.map +1 -0
  494. package/dist/lib/workflow-codegen.d.ts +18 -0
  495. package/dist/lib/workflow-codegen.d.ts.map +1 -0
  496. package/dist/lib/workflow-codegen.js +786 -0
  497. package/dist/lib/workflow-codegen.js.map +1 -0
  498. package/dist/lib/workflow-executor.workflow.d.ts +33 -0
  499. package/dist/lib/workflow-executor.workflow.d.ts.map +1 -0
  500. package/dist/lib/workflow-executor.workflow.js +605 -0
  501. package/dist/lib/workflow-executor.workflow.js.map +1 -0
  502. package/dist/lib/workflow-logging.d.ts +29 -0
  503. package/dist/lib/workflow-logging.d.ts.map +1 -0
  504. package/dist/lib/workflow-logging.js +48 -0
  505. package/dist/lib/workflow-logging.js.map +1 -0
  506. package/dist/lib/workflow-store.d.ts +118 -0
  507. package/dist/lib/workflow-store.d.ts.map +1 -0
  508. package/dist/lib/workflow-store.js +351 -0
  509. package/dist/lib/workflow-store.js.map +1 -0
  510. package/dist/plugins/condition/components/condition-fields.d.ts +7 -0
  511. package/dist/plugins/condition/components/condition-fields.d.ts.map +1 -0
  512. package/dist/plugins/condition/components/condition-fields.js +8 -0
  513. package/dist/plugins/condition/components/condition-fields.js.map +1 -0
  514. package/dist/plugins/condition/index.d.ts +4 -0
  515. package/dist/plugins/condition/index.d.ts.map +1 -0
  516. package/dist/plugins/condition/index.js +23 -0
  517. package/dist/plugins/condition/index.js.map +1 -0
  518. package/dist/plugins/condition/steps/evaluate.d.ts +15 -0
  519. package/dist/plugins/condition/steps/evaluate.d.ts.map +1 -0
  520. package/dist/plugins/condition/steps/evaluate.js +10 -0
  521. package/dist/plugins/condition/steps/evaluate.js.map +1 -0
  522. package/dist/plugins/database/components/database-query-fields.d.ts +7 -0
  523. package/dist/plugins/database/components/database-query-fields.d.ts.map +1 -0
  524. package/dist/plugins/database/components/database-query-fields.js +18 -0
  525. package/dist/plugins/database/components/database-query-fields.js.map +1 -0
  526. package/dist/plugins/database/index.d.ts +4 -0
  527. package/dist/plugins/database/index.d.ts.map +1 -0
  528. package/dist/plugins/database/index.js +23 -0
  529. package/dist/plugins/database/index.js.map +1 -0
  530. package/dist/plugins/database/steps/query.d.ts +20 -0
  531. package/dist/plugins/database/steps/query.d.ts.map +1 -0
  532. package/dist/plugins/database/steps/query.js +92 -0
  533. package/dist/plugins/database/steps/query.js.map +1 -0
  534. package/dist/plugins/index.d.ts +10 -0
  535. package/dist/plugins/index.d.ts.map +1 -0
  536. package/dist/plugins/index.js +6 -0
  537. package/dist/plugins/index.js.map +1 -0
  538. package/dist/plugins/legacy-mappings.d.ts +2 -0
  539. package/dist/plugins/legacy-mappings.d.ts.map +1 -0
  540. package/dist/plugins/legacy-mappings.js +2 -0
  541. package/dist/plugins/legacy-mappings.js.map +1 -0
  542. package/dist/plugins/loop/components/loop-fields.d.ts +7 -0
  543. package/dist/plugins/loop/components/loop-fields.d.ts.map +1 -0
  544. package/dist/plugins/loop/components/loop-fields.js +8 -0
  545. package/dist/plugins/loop/components/loop-fields.js.map +1 -0
  546. package/dist/plugins/loop/icon.d.ts +4 -0
  547. package/dist/plugins/loop/icon.d.ts.map +1 -0
  548. package/dist/plugins/loop/icon.js +5 -0
  549. package/dist/plugins/loop/icon.js.map +1 -0
  550. package/dist/plugins/loop/index.d.ts +4 -0
  551. package/dist/plugins/loop/index.d.ts.map +1 -0
  552. package/dist/plugins/loop/index.js +52 -0
  553. package/dist/plugins/loop/index.js.map +1 -0
  554. package/dist/plugins/loop/steps/iterate.d.ts +24 -0
  555. package/dist/plugins/loop/steps/iterate.d.ts.map +1 -0
  556. package/dist/plugins/loop/steps/iterate.js +31 -0
  557. package/dist/plugins/loop/steps/iterate.js.map +1 -0
  558. package/dist/plugins/registry.d.ts +136 -0
  559. package/dist/plugins/registry.d.ts.map +1 -0
  560. package/dist/plugins/registry.js +241 -0
  561. package/dist/plugins/registry.js.map +1 -0
  562. package/dist/plugins/switch/icon.d.ts +4 -0
  563. package/dist/plugins/switch/icon.d.ts.map +1 -0
  564. package/dist/plugins/switch/icon.js +5 -0
  565. package/dist/plugins/switch/icon.js.map +1 -0
  566. package/dist/plugins/switch/index.d.ts +4 -0
  567. package/dist/plugins/switch/index.d.ts.map +1 -0
  568. package/dist/plugins/switch/index.js +81 -0
  569. package/dist/plugins/switch/index.js.map +1 -0
  570. package/dist/plugins/switch/steps/evaluate.d.ts +27 -0
  571. package/dist/plugins/switch/steps/evaluate.d.ts.map +1 -0
  572. package/dist/plugins/switch/steps/evaluate.js +81 -0
  573. package/dist/plugins/switch/steps/evaluate.js.map +1 -0
  574. package/dist/scripts/create-plugin.d.ts +3 -0
  575. package/dist/scripts/create-plugin.d.ts.map +1 -0
  576. package/dist/scripts/create-plugin.js +205 -0
  577. package/dist/scripts/create-plugin.js.map +1 -0
  578. package/dist/scripts/discover-plugins.d.ts +3 -0
  579. package/dist/scripts/discover-plugins.d.ts.map +1 -0
  580. package/dist/scripts/discover-plugins.js +729 -0
  581. package/dist/scripts/discover-plugins.js.map +1 -0
  582. package/dist/scripts/migrate-prod.d.ts +2 -0
  583. package/dist/scripts/migrate-prod.d.ts.map +1 -0
  584. package/dist/scripts/migrate-prod.js +17 -0
  585. package/dist/scripts/migrate-prod.js.map +1 -0
  586. package/dist/scripts/nwb.d.ts +3 -0
  587. package/dist/scripts/nwb.d.ts.map +1 -0
  588. package/dist/scripts/nwb.js +33 -0
  589. package/dist/scripts/nwb.js.map +1 -0
  590. package/dist/server/api/handler-utils.d.ts +22 -0
  591. package/dist/server/api/handler-utils.d.ts.map +1 -0
  592. package/dist/server/api/handler-utils.js +42 -0
  593. package/dist/server/api/handler-utils.js.map +1 -0
  594. package/dist/server/api/handlers/ai/generate/route.d.ts +3 -0
  595. package/dist/server/api/handlers/ai/generate/route.d.ts.map +1 -0
  596. package/dist/server/api/handlers/ai/generate/route.js +260 -0
  597. package/dist/server/api/handlers/ai/generate/route.js.map +1 -0
  598. package/dist/server/api/handlers/api-keys/[keyId]/route.d.ts +3 -0
  599. package/dist/server/api/handlers/api-keys/[keyId]/route.d.ts.map +1 -0
  600. package/dist/server/api/handlers/api-keys/[keyId]/route.js +25 -0
  601. package/dist/server/api/handlers/api-keys/[keyId]/route.js.map +1 -0
  602. package/dist/server/api/handlers/api-keys/route.d.ts +3 -0
  603. package/dist/server/api/handlers/api-keys/route.d.ts.map +1 -0
  604. package/dist/server/api/handlers/api-keys/route.js +84 -0
  605. package/dist/server/api/handlers/api-keys/route.js.map +1 -0
  606. package/dist/server/api/handlers/auth/route.d.ts +3 -0
  607. package/dist/server/api/handlers/auth/route.d.ts.map +1 -0
  608. package/dist/server/api/handlers/auth/route.js +14 -0
  609. package/dist/server/api/handlers/auth/route.js.map +1 -0
  610. package/dist/server/api/handlers/integrations/[integrationId]/route.d.ts +16 -0
  611. package/dist/server/api/handlers/integrations/[integrationId]/route.d.ts.map +1 -0
  612. package/dist/server/api/handlers/integrations/[integrationId]/route.js +117 -0
  613. package/dist/server/api/handlers/integrations/[integrationId]/route.js.map +1 -0
  614. package/dist/server/api/handlers/integrations/[integrationId]/test/route.d.ts +7 -0
  615. package/dist/server/api/handlers/integrations/[integrationId]/test/route.d.ts.map +1 -0
  616. package/dist/server/api/handlers/integrations/[integrationId]/test/route.js +96 -0
  617. package/dist/server/api/handlers/integrations/[integrationId]/test/route.js.map +1 -0
  618. package/dist/server/api/handlers/integrations/route.d.ts +24 -0
  619. package/dist/server/api/handlers/integrations/route.d.ts.map +1 -0
  620. package/dist/server/api/handlers/integrations/route.js +80 -0
  621. package/dist/server/api/handlers/integrations/route.js.map +1 -0
  622. package/dist/server/api/handlers/integrations/test/route.d.ts +12 -0
  623. package/dist/server/api/handlers/integrations/test/route.d.ts.map +1 -0
  624. package/dist/server/api/handlers/integrations/test/route.js +76 -0
  625. package/dist/server/api/handlers/integrations/test/route.js.map +1 -0
  626. package/dist/server/api/handlers/og/workflow/[workflowId]/route.d.ts +7 -0
  627. package/dist/server/api/handlers/og/workflow/[workflowId]/route.d.ts.map +1 -0
  628. package/dist/server/api/handlers/og/workflow/[workflowId]/route.js +197 -0
  629. package/dist/server/api/handlers/og/workflow/[workflowId]/route.js.map +1 -0
  630. package/dist/server/api/handlers/user/route.d.ts +3 -0
  631. package/dist/server/api/handlers/user/route.d.ts.map +1 -0
  632. package/dist/server/api/handlers/user/route.js +81 -0
  633. package/dist/server/api/handlers/user/route.js.map +1 -0
  634. package/dist/server/api/handlers/workflow/[workflowId]/cron/route.d.ts +3 -0
  635. package/dist/server/api/handlers/workflow/[workflowId]/cron/route.d.ts.map +1 -0
  636. package/dist/server/api/handlers/workflow/[workflowId]/cron/route.js +65 -0
  637. package/dist/server/api/handlers/workflow/[workflowId]/cron/route.js.map +1 -0
  638. package/dist/server/api/handlers/workflow/[workflowId]/execute/route.d.ts +3 -0
  639. package/dist/server/api/handlers/workflow/[workflowId]/execute/route.d.ts.map +1 -0
  640. package/dist/server/api/handlers/workflow/[workflowId]/execute/route.js +72 -0
  641. package/dist/server/api/handlers/workflow/[workflowId]/execute/route.js.map +1 -0
  642. package/dist/server/api/handlers/workflows/[workflowId]/code/route.d.ts +3 -0
  643. package/dist/server/api/handlers/workflows/[workflowId]/code/route.d.ts.map +1 -0
  644. package/dist/server/api/handlers/workflows/[workflowId]/code/route.js +24 -0
  645. package/dist/server/api/handlers/workflows/[workflowId]/code/route.js.map +1 -0
  646. package/dist/server/api/handlers/workflows/[workflowId]/cron/route.d.ts +3 -0
  647. package/dist/server/api/handlers/workflows/[workflowId]/cron/route.d.ts.map +1 -0
  648. package/dist/server/api/handlers/workflows/[workflowId]/cron/route.js +65 -0
  649. package/dist/server/api/handlers/workflows/[workflowId]/cron/route.js.map +1 -0
  650. package/dist/server/api/handlers/workflows/[workflowId]/download/route.d.ts +3 -0
  651. package/dist/server/api/handlers/workflows/[workflowId]/download/route.d.ts.map +1 -0
  652. package/dist/server/api/handlers/workflows/[workflowId]/download/route.js +24 -0
  653. package/dist/server/api/handlers/workflows/[workflowId]/download/route.js.map +1 -0
  654. package/dist/server/api/handlers/workflows/[workflowId]/duplicate/route.d.ts +3 -0
  655. package/dist/server/api/handlers/workflows/[workflowId]/duplicate/route.d.ts.map +1 -0
  656. package/dist/server/api/handlers/workflows/[workflowId]/duplicate/route.js +89 -0
  657. package/dist/server/api/handlers/workflows/[workflowId]/duplicate/route.js.map +1 -0
  658. package/dist/server/api/handlers/workflows/[workflowId]/execute/route.d.ts +3 -0
  659. package/dist/server/api/handlers/workflows/[workflowId]/execute/route.d.ts.map +1 -0
  660. package/dist/server/api/handlers/workflows/[workflowId]/execute/route.js +72 -0
  661. package/dist/server/api/handlers/workflows/[workflowId]/execute/route.js.map +1 -0
  662. package/dist/server/api/handlers/workflows/[workflowId]/executions/route.d.ts +3 -0
  663. package/dist/server/api/handlers/workflows/[workflowId]/executions/route.d.ts.map +1 -0
  664. package/dist/server/api/handlers/workflows/[workflowId]/executions/route.js +63 -0
  665. package/dist/server/api/handlers/workflows/[workflowId]/executions/route.js.map +1 -0
  666. package/dist/server/api/handlers/workflows/[workflowId]/route.d.ts +3 -0
  667. package/dist/server/api/handlers/workflows/[workflowId]/route.d.ts.map +1 -0
  668. package/dist/server/api/handlers/workflows/[workflowId]/route.js +132 -0
  669. package/dist/server/api/handlers/workflows/[workflowId]/route.js.map +1 -0
  670. package/dist/server/api/handlers/workflows/[workflowId]/webhook/route.d.ts +3 -0
  671. package/dist/server/api/handlers/workflows/[workflowId]/webhook/route.d.ts.map +1 -0
  672. package/dist/server/api/handlers/workflows/[workflowId]/webhook/route.js +111 -0
  673. package/dist/server/api/handlers/workflows/[workflowId]/webhook/route.js.map +1 -0
  674. package/dist/server/api/handlers/workflows/create/route.d.ts +3 -0
  675. package/dist/server/api/handlers/workflows/create/route.d.ts.map +1 -0
  676. package/dist/server/api/handlers/workflows/create/route.js +67 -0
  677. package/dist/server/api/handlers/workflows/create/route.js.map +1 -0
  678. package/dist/server/api/handlers/workflows/current/route.d.ts +3 -0
  679. package/dist/server/api/handlers/workflows/current/route.d.ts.map +1 -0
  680. package/dist/server/api/handlers/workflows/current/route.js +89 -0
  681. package/dist/server/api/handlers/workflows/current/route.js.map +1 -0
  682. package/dist/server/api/handlers/workflows/executions/[executionId]/logs/route.d.ts +3 -0
  683. package/dist/server/api/handlers/workflows/executions/[executionId]/logs/route.d.ts.map +1 -0
  684. package/dist/server/api/handlers/workflows/executions/[executionId]/logs/route.js +38 -0
  685. package/dist/server/api/handlers/workflows/executions/[executionId]/logs/route.js.map +1 -0
  686. package/dist/server/api/handlers/workflows/executions/[executionId]/status/route.d.ts +3 -0
  687. package/dist/server/api/handlers/workflows/executions/[executionId]/status/route.d.ts.map +1 -0
  688. package/dist/server/api/handlers/workflows/executions/[executionId]/status/route.js +35 -0
  689. package/dist/server/api/handlers/workflows/executions/[executionId]/status/route.js.map +1 -0
  690. package/dist/server/api/handlers/workflows/route.d.ts +3 -0
  691. package/dist/server/api/handlers/workflows/route.d.ts.map +1 -0
  692. package/dist/server/api/handlers/workflows/route.js +22 -0
  693. package/dist/server/api/handlers/workflows/route.js.map +1 -0
  694. package/dist/server/api/routes.d.ts +4 -0
  695. package/dist/server/api/routes.d.ts.map +1 -0
  696. package/dist/server/api/routes.js +51 -0
  697. package/dist/server/api/routes.js.map +1 -0
  698. package/dist/server/api/types.d.ts +41 -0
  699. package/dist/server/api/types.d.ts.map +1 -0
  700. package/dist/server/api/types.js +2 -0
  701. package/dist/server/api/types.js.map +1 -0
  702. package/dist/server/api/workflows.d.ts +8 -0
  703. package/dist/server/api/workflows.d.ts.map +1 -0
  704. package/dist/server/api/workflows.js +75 -0
  705. package/dist/server/api/workflows.js.map +1 -0
  706. package/dist/server/db/migrate.d.ts +2 -0
  707. package/dist/server/db/migrate.d.ts.map +1 -0
  708. package/dist/server/db/migrate.js +2 -0
  709. package/dist/server/db/migrate.js.map +1 -0
  710. package/dist/server/db/schema.d.ts +1465 -0
  711. package/dist/server/db/schema.d.ts.map +1 -0
  712. package/dist/server/db/schema.js +15 -0
  713. package/dist/server/db/schema.js.map +1 -0
  714. package/dist/server/index.d.ts +11 -0
  715. package/dist/server/index.d.ts.map +1 -0
  716. package/dist/server/index.js +9 -0
  717. package/dist/server/index.js.map +1 -0
  718. package/dist/server/plugin.d.ts +17 -0
  719. package/dist/server/plugin.d.ts.map +1 -0
  720. package/dist/server/plugin.js +27 -0
  721. package/dist/server/plugin.js.map +1 -0
  722. package/dist/server/utils.d.ts +3 -0
  723. package/dist/server/utils.d.ts.map +1 -0
  724. package/dist/server/utils.js +7 -0
  725. package/dist/server/utils.js.map +1 -0
  726. package/dist/styles/globals.css +254 -0
  727. package/package.json +130 -0
  728. package/src/plugins/_template/credentials.ts.txt +10 -0
  729. package/src/plugins/_template/icon.tsx.txt +28 -0
  730. package/src/plugins/_template/index.ts.txt +122 -0
  731. package/src/plugins/_template/steps/action.ts.txt +103 -0
  732. package/src/plugins/_template/test.ts.txt +57 -0
  733. package/src/plugins/condition/components/condition-fields.tsx +32 -0
  734. package/src/plugins/condition/index.ts +27 -0
  735. package/src/plugins/condition/steps/evaluate.ts +32 -0
  736. package/src/plugins/database/components/database-query-fields.tsx +58 -0
  737. package/src/plugins/database/index.ts +27 -0
  738. package/src/plugins/database/steps/query.ts +141 -0
  739. package/src/plugins/index.ts +37 -0
  740. package/src/plugins/legacy-mappings.ts +11 -0
  741. package/src/plugins/loop/components/loop-fields.tsx +46 -0
  742. package/src/plugins/loop/icon.tsx +21 -0
  743. package/src/plugins/loop/index.ts +57 -0
  744. package/src/plugins/loop/steps/iterate.ts +74 -0
  745. package/src/plugins/loop/workflow-executor.patch +241 -0
  746. package/src/plugins/registry.ts +660 -0
  747. package/src/plugins/switch/icon.tsx +23 -0
  748. package/src/plugins/switch/index.ts +87 -0
  749. package/src/plugins/switch/steps/evaluate.ts +139 -0
  750. package/src/plugins/switch/workflow-executor.patch +130 -0
  751. package/src/scripts/create-plugin.ts +301 -0
  752. package/src/scripts/discover-plugins.ts +1122 -0
  753. package/src/scripts/migrate-prod.ts +16 -0
  754. package/src/scripts/nwb.ts +54 -0
@@ -0,0 +1,1122 @@
1
+ #!/usr/bin/env tsx
2
+
3
+ /**
4
+ * Plugin Discovery & Registry Generation Script
5
+ *
6
+ * Imports plugins from the user-managed plugins/index.ts file, then generates
7
+ * registry files (types, step-registry, display configs, codegen templates,
8
+ * route registry) from the populated registry.
9
+ *
10
+ * plugins/index.ts is scaffolded once if it doesn't exist, then never overwritten.
11
+ * Users manage their own plugin imports (both local and npm-installed).
12
+ *
13
+ * Run this script:
14
+ * - Manually: pnpm discover-plugins
15
+ * - Automatically: Before build (in package.json)
16
+ */
17
+
18
+ import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
19
+ import { dirname, join, relative } from "node:path";
20
+ import { pathToFileURL } from "node:url";
21
+ import ts from "typescript";
22
+
23
+ const PLUGINS_DIR = join(process.cwd(), "plugins");
24
+ const OUTPUT_FILE = join(PLUGINS_DIR, "index.ts");
25
+ const TYPES_FILE = join(process.cwd(), "lib", "types", "integration.ts");
26
+ const STEP_REGISTRY_FILE = join(process.cwd(), "lib", "step-registry.ts");
27
+ const OUTPUT_CONFIGS_FILE = join(process.cwd(), "lib", "output-display-configs.ts");
28
+ const CODEGEN_REGISTRY_FILE = join(process.cwd(), "lib", "codegen-registry.ts");
29
+ const ROUTE_REGISTRY_FILE = join(process.cwd(), "lib", "route-registry.ts");
30
+ const README_FILE = join(process.cwd(), "README.md");
31
+ const PLUGINS_MARKER_REGEX =
32
+ /<!-- PLUGINS:START[^>]*-->[\s\S]*?<!-- PLUGINS:END -->/;
33
+
34
+ // System integrations that don't have plugins
35
+ const SYSTEM_INTEGRATION_TYPES = ["database"] as const;
36
+
37
+ // Regex patterns for codegen template generation
38
+ const LEADING_WHITESPACE_PATTERN = /^\s*/;
39
+
40
+ /**
41
+ * Import from local source (for development) or the installed package (for published consumers).
42
+ * Local source is tried first because dist/ may not exist during development.
43
+ */
44
+ async function importPackageOrLocal(localRelPath: string): Promise<Record<string, unknown>> {
45
+ const localPath = join(import.meta.dirname, "..", "plugins", localRelPath);
46
+ if (existsSync(localPath)) {
47
+ return await import(pathToFileURL(localPath).href);
48
+ }
49
+ return await import("next-workflow-builder/plugins");
50
+ }
51
+
52
+ /**
53
+ * Parse plugins/index.ts to extract plugin import specifiers.
54
+ * Returns both local (e.g. "./slack") and npm (e.g. "@next-workflow-builder/loop") specifiers.
55
+ * Skips non-plugin imports (client.ts, ../lib/*, re-exports, etc.).
56
+ */
57
+ function parsePluginImports(): string[] {
58
+ if (!existsSync(OUTPUT_FILE)) return [];
59
+
60
+ const content = readFileSync(OUTPUT_FILE, "utf-8");
61
+ const importRegex = /^\s*import\s+["']([^"']+)["']\s*;/gm;
62
+ const specifiers: string[] = [];
63
+
64
+ let match: RegExpExecArray | null;
65
+ while ((match = importRegex.exec(content)) !== null) {
66
+ const spec = match[1];
67
+ // Skip non-plugin imports (auto-generated lib files, client registrations, etc.)
68
+ if (
69
+ spec.includes("/client") ||
70
+ spec.startsWith("../lib/") ||
71
+ spec.startsWith("../") ||
72
+ spec === "next-workflow-builder/components" ||
73
+ spec.startsWith("next-workflow-builder/")
74
+ ) {
75
+ continue;
76
+ }
77
+ specifiers.push(spec);
78
+ }
79
+
80
+ return specifiers;
81
+ }
82
+
83
+ /**
84
+ * Import plugins listed in plugins/index.ts to populate the registry.
85
+ *
86
+ * We parse the import specifiers from plugins/index.ts, then import each plugin
87
+ * individually. This avoids importing client-only code (React components, etc.)
88
+ * that can't run in the Node.js/tsx context of discover-plugins.
89
+ *
90
+ * Because consumer plugins import `registerIntegration` from "next-workflow-builder/plugins"
91
+ * (the package specifier), they may populate a different module instance than our relative
92
+ * import of "../plugins/registry". Node.js ESM caches modules by resolved URL, so the same
93
+ * file loaded via a package specifier vs a relative path creates two separate module instances
94
+ * with separate registries.
95
+ *
96
+ * To fix this, we explicitly re-register each plugin's default export with our local registry.
97
+ */
98
+ async function importPluginsFromIndex(): Promise<void> {
99
+ const localRegistry = await import("../plugins/registry");
100
+ const specifiers = parsePluginImports();
101
+
102
+ if (specifiers.length === 0) {
103
+ console.log("No plugin imports found in plugins/index.ts");
104
+ return;
105
+ }
106
+
107
+ console.log(`Importing ${ specifiers.length } plugin(s) from plugins/index.ts...`);
108
+ for (const spec of specifiers) {
109
+ let resolvedPath: string;
110
+
111
+ if (spec.startsWith(".")) {
112
+ // Local plugin — resolve relative to plugins/ directory
113
+ resolvedPath = pathToFileURL(join(PLUGINS_DIR, spec, "index.ts")).href;
114
+ } else {
115
+ // npm package — resolve from the consumer's directory (process.cwd()),
116
+ // not from discover-plugins.ts, so the consumer's node_modules is used
117
+ try {
118
+ const { createRequire } = await import("node:module");
119
+ const require = createRequire(join(process.cwd(), "package.json"));
120
+ resolvedPath = pathToFileURL(require.resolve(spec)).href;
121
+ } catch {
122
+ resolvedPath = spec; // fallback to bare specifier
123
+ }
124
+ }
125
+
126
+ try {
127
+ const mod = await import(resolvedPath);
128
+ // Explicitly register with our local registry to avoid dual module instance issues
129
+ if (mod.default) {
130
+ localRegistry.registerIntegration(mod.default);
131
+ // Track npm-installed plugins for step-registry import path generation
132
+ if (!spec.startsWith(".")) {
133
+ npmPluginSpecifiers.set(mod.default.type, spec);
134
+ }
135
+ }
136
+ console.log(` - ${ spec }`);
137
+ } catch (error) {
138
+ console.warn(` Warning: Failed to import plugin "${ spec }":`, error);
139
+ }
140
+ }
141
+
142
+ console.log(`Registered ${ specifiers.length } plugin(s) with local registry`);
143
+ }
144
+
145
+ /**
146
+ * Format TypeScript code using Prettier
147
+ */
148
+ async function formatCode(code: string): Promise<string> {
149
+ try {
150
+ const prettier = await import("prettier");
151
+ return await prettier.format(code, { parser: "typescript" });
152
+ } catch (error) {
153
+ console.warn(" Warning: Failed to format generated code:", error);
154
+ return code;
155
+ }
156
+ }
157
+
158
+ // Track generated codegen templates
159
+ const generatedCodegenTemplates = new Map<
160
+ string,
161
+ { template: string; integrationType: string }
162
+ >();
163
+
164
+ // Track npm package specifiers for integration types (e.g. "loop" -> "@next-workflow-builder/loop")
165
+ // Used by step-registry to generate correct import paths for npm-installed plugins
166
+ const npmPluginSpecifiers = new Map<string, string>();
167
+
168
+
169
+ /**
170
+ * Discover local plugin directories (subdirectories under plugins/).
171
+ * Used for scaffolding and for finding client.ts files.
172
+ */
173
+ function discoverLocalPluginDirs(): string[] {
174
+ if (!existsSync(PLUGINS_DIR)) return [];
175
+
176
+ const entries = readdirSync(PLUGINS_DIR);
177
+ return entries.filter((entry) => {
178
+ if (
179
+ entry.startsWith("_") ||
180
+ entry.startsWith(".") ||
181
+ entry === "index.ts" ||
182
+ entry === "registry.ts" ||
183
+ entry === "system"
184
+ ) {
185
+ return false;
186
+ }
187
+ const fullPath = join(PLUGINS_DIR, entry);
188
+ try {
189
+ return statSync(fullPath).isDirectory();
190
+ } catch {
191
+ return false;
192
+ }
193
+ }).sort();
194
+ }
195
+
196
+ /**
197
+ * Scaffold plugins/index.ts if it doesn't exist yet.
198
+ * This file is user-managed — the script never overwrites it.
199
+ */
200
+ function scaffoldIndexFile(): void {
201
+ if (existsSync(OUTPUT_FILE)) {
202
+ console.log("plugins/index.ts already exists, skipping scaffold");
203
+ return;
204
+ }
205
+
206
+ // Discover local plugin directories to pre-populate the scaffold
207
+ const localPlugins = discoverLocalPluginDirs();
208
+ const imports = localPlugins.length > 0
209
+ ? localPlugins.map((plugin) => `import "./${ plugin }";`).join("\n")
210
+ : "// import \"./my-plugin\";";
211
+
212
+ // Detect plugins with client.ts for client-only registrations
213
+ const clientImports = localPlugins
214
+ .filter((plugin) => existsSync(join(PLUGINS_DIR, plugin, "client.ts")))
215
+ .map((plugin) => `import "./${ plugin }/client";`)
216
+ .join("\n");
217
+
218
+ const content = `/**
219
+ * Plugins Index
220
+ *
221
+ * This file is managed by you. Add or remove plugin imports as needed.
222
+ *
223
+ * To add a local plugin:
224
+ * import "./my-plugin";
225
+ *
226
+ * To add an npm-installed plugin:
227
+ * import "@next-workflow-builder/loop";
228
+ *
229
+ * After editing, run: pnpm discover-plugins (or it runs automatically on build)
230
+ */
231
+ "use client";
232
+
233
+ // Local plugins (side-effect imports trigger registration)
234
+ ${ imports }
235
+
236
+ // Register auto-generated data into the plugin registry
237
+ import "../lib/output-display-configs";
238
+ import "../lib/codegen-registry";
239
+ ${ clientImports ? `\n// Client-only registrations (managed connections, etc.)\n${ clientImports }` : "" }
240
+
241
+ // Re-export LayoutProvider with plugins pre-registered via side-effect imports above
242
+ export { LayoutProvider } from "next-workflow-builder/components";
243
+ `;
244
+
245
+ writeFileSync(OUTPUT_FILE, content, "utf-8");
246
+ console.log("Scaffolded plugins/index.ts");
247
+ }
248
+
249
+ /**
250
+ * Ensure generated files are listed in the consumer's .gitignore
251
+ * (it's auto-generated and should not be committed).
252
+ */
253
+ function ensureGitignore(): void {
254
+ const gitignorePath = join(process.cwd(), ".gitignore");
255
+ const SECTION_HEADER = "# Auto-generated by discover-plugins";
256
+
257
+ // Collect all absolute paths we want to ignore
258
+ // Note: OUTPUT_FILE (plugins/index.ts) is excluded — it's user-managed and should be committed
259
+ const filesToIgnore = [
260
+ TYPES_FILE,
261
+ STEP_REGISTRY_FILE,
262
+ OUTPUT_CONFIGS_FILE,
263
+ CODEGEN_REGISTRY_FILE,
264
+ ROUTE_REGISTRY_FILE,
265
+ ];
266
+
267
+ // Convert to relative paths
268
+ const relativePaths = filesToIgnore.map((file) => relative(process.cwd(), file));
269
+
270
+ let content = "";
271
+ if (existsSync(gitignorePath)) {
272
+ content = readFileSync(gitignorePath, "utf-8");
273
+ }
274
+
275
+ const existingLines = new Set(content.split("\n").map((line) => line.trim()));
276
+ const newEntries = relativePaths.filter((entry) => !existingLines.has(entry));
277
+
278
+ if (newEntries.length > 0) {
279
+ let textToAppend = "";
280
+
281
+ // 1. Ensure we start on a new line if the file doesn't end with one
282
+ if (content.length > 0 && !content.endsWith("\n")) {
283
+ textToAppend += "\n";
284
+ }
285
+
286
+ // 2. Add the comment only if it doesn't exist yet
287
+ if (!content.includes(SECTION_HEADER)) {
288
+ textToAppend += `${ SECTION_HEADER }\n`;
289
+ }
290
+
291
+ // 3. Add the new files
292
+ textToAppend += newEntries.join("\n") + "\n";
293
+
294
+ writeFileSync(gitignorePath, content + textToAppend, "utf-8");
295
+ console.log(`Updated .gitignore with ${ newEntries.length } new file(s).`);
296
+ }
297
+ }
298
+
299
+ /**
300
+ * Update the README.md with the current list of actions
301
+ */
302
+ async function updateReadme(): Promise<void> {
303
+ // Import the registry utilities (registry is already populated by importConsumerPlugins in main)
304
+ const { getAllIntegrations } = await importPackageOrLocal("registry.ts") as {
305
+ getAllIntegrations: () => { label: string; actions: { label: string }[] }[]
306
+ };
307
+
308
+ const integrations = getAllIntegrations();
309
+
310
+ if (integrations.length === 0) {
311
+ console.log("No integrations found, skipping README update");
312
+ return;
313
+ }
314
+
315
+ // Generate markdown list grouped by integration
316
+ const actionsList = integrations
317
+ .map((integration) => {
318
+ const actionLabels = integration.actions.map((a) => a.label).join(", ");
319
+ return `- **${ integration.label }**: ${ actionLabels }`;
320
+ })
321
+ .join("\n");
322
+
323
+ // Read current README
324
+ const readme = readFileSync(README_FILE, "utf-8");
325
+
326
+ // Check if markers exist
327
+ if (!readme.includes("<!-- PLUGINS:START")) {
328
+ console.log("README markers not found, skipping README update");
329
+ return;
330
+ }
331
+
332
+ // Replace content between markers
333
+ const updated = readme.replace(
334
+ PLUGINS_MARKER_REGEX,
335
+ `<!-- PLUGINS:START - Do not remove. Auto-generated by discover-plugins -->\n${ actionsList }\n<!-- PLUGINS:END -->`,
336
+ );
337
+
338
+ writeFileSync(README_FILE, updated, "utf-8");
339
+ console.log(`Updated README.md with ${ integrations.length } integration(s)`);
340
+ }
341
+
342
+ /**
343
+ * Generate the lib/types/integration.ts file with dynamic types
344
+ */
345
+ async function generateTypesFile(): Promise<void> {
346
+ // Ensure the types directory exists
347
+ const typesDir = dirname(TYPES_FILE);
348
+ if (!existsSync(typesDir)) {
349
+ mkdirSync(typesDir, { recursive: true });
350
+ }
351
+
352
+ // Get plugin types from registry
353
+ const { getIntegrationTypes } = await import("../plugins/registry");
354
+ const pluginTypes = getIntegrationTypes();
355
+
356
+ // Combine plugin types with system types
357
+ const allTypes = [...pluginTypes, ...SYSTEM_INTEGRATION_TYPES].sort();
358
+
359
+ // Generate the union type
360
+ const unionType = allTypes.map((t) => ` | "${ t }"`).join("\n");
361
+
362
+ const content = `/**
363
+ * Integration Types (Auto-Generated)
364
+ *
365
+ * This file is automatically generated by scripts/discover-plugins.ts
366
+ * DO NOT EDIT MANUALLY - your changes will be overwritten!
367
+ *
368
+ * To add a new integration type:
369
+ * 1. Create a plugin in plugins/ directory, OR
370
+ * 2. Add a system integration to SYSTEM_INTEGRATION_TYPES in discover-plugins.ts
371
+ * 3. Run: pnpm discover-plugins
372
+ *
373
+ * Generated types: ${ allTypes.join(", ") }
374
+ */
375
+
376
+ // Integration type union - plugins + system integrations
377
+ export type IntegrationType =
378
+ ${ unionType };
379
+
380
+ // Generic config type - plugins define their own keys via formFields[].configKey
381
+ export type IntegrationConfig = Record<string, string | undefined>;
382
+ `;
383
+
384
+ writeFileSync(TYPES_FILE, content, "utf-8");
385
+ console.log(
386
+ `Generated lib/types/integration.ts with ${ allTypes.length } type(s)`,
387
+ );
388
+ }
389
+
390
+ // ============================================================================
391
+ // Codegen Template Generation
392
+ // ============================================================================
393
+
394
+ /** Analysis result type for step file parsing */
395
+ type StepFileAnalysis = {
396
+ hasExportCore: boolean;
397
+ integrationType: string | null;
398
+ coreFunction: {
399
+ name: string;
400
+ params: string;
401
+ returnType: string;
402
+ body: string;
403
+ } | null;
404
+ inputTypes: string[];
405
+ imports: string[];
406
+ };
407
+
408
+ /** Create empty analysis result */
409
+ function createEmptyAnalysis(): StepFileAnalysis {
410
+ return {
411
+ hasExportCore: false,
412
+ integrationType: null,
413
+ coreFunction: null,
414
+ inputTypes: [],
415
+ imports: [],
416
+ };
417
+ }
418
+
419
+ /** Process exported variable declarations */
420
+ function processExportedVariable(
421
+ decl: ts.VariableDeclaration,
422
+ result: StepFileAnalysis,
423
+ ): void {
424
+ if (!ts.isIdentifier(decl.name)) {
425
+ return;
426
+ }
427
+
428
+ const name = decl.name.text;
429
+ const init = decl.initializer;
430
+
431
+ if (name === "_integrationType" && init && ts.isStringLiteral(init)) {
432
+ result.integrationType = init.text;
433
+ }
434
+ }
435
+
436
+ /** Check if a type name should be included in exports */
437
+ function shouldIncludeType(typeName: string): boolean {
438
+ return (
439
+ typeName.endsWith("Result") ||
440
+ typeName.endsWith("Credentials") ||
441
+ typeName.endsWith("CoreInput")
442
+ );
443
+ }
444
+
445
+ /** Check if an import should be included in exports */
446
+ function shouldIncludeImport(moduleSpec: string, importText: string): boolean {
447
+ // Skip internal imports
448
+ if (moduleSpec.startsWith("@/") || moduleSpec.startsWith(".")) {
449
+ return false;
450
+ }
451
+ // Skip server-only import
452
+ if (importText.includes("server-only")) {
453
+ return false;
454
+ }
455
+ return true;
456
+ }
457
+
458
+ /** Extract function info from a function declaration */
459
+ function extractFunctionInfo(
460
+ node: ts.FunctionDeclaration,
461
+ sourceCode: string,
462
+ ): StepFileAnalysis["coreFunction"] {
463
+ if (!(node.name && node.body)) {
464
+ return null;
465
+ }
466
+
467
+ const params = node.parameters
468
+ .map((p) => sourceCode.slice(p.pos, p.end).trim())
469
+ .join(", ");
470
+
471
+ const returnType = node.type
472
+ ? sourceCode.slice(node.type.pos, node.type.end).trim()
473
+ : "Promise<unknown>";
474
+
475
+ const body = sourceCode.slice(node.body.pos, node.body.end).trim();
476
+
477
+ return {
478
+ name: node.name.text,
479
+ params,
480
+ returnType,
481
+ body,
482
+ };
483
+ }
484
+
485
+ /** Process variable statement node */
486
+ function processVariableStatement(
487
+ node: ts.VariableStatement,
488
+ result: StepFileAnalysis,
489
+ ): void {
490
+ const isExported = node.modifiers?.some(
491
+ (m) => m.kind === ts.SyntaxKind.ExportKeyword,
492
+ );
493
+ if (!isExported) {
494
+ return;
495
+ }
496
+
497
+ for (const decl of node.declarationList.declarations) {
498
+ processExportedVariable(decl, result);
499
+ }
500
+ }
501
+
502
+ /** Process type alias node */
503
+ function processTypeAlias(
504
+ node: ts.TypeAliasDeclaration,
505
+ sourceCode: string,
506
+ result: StepFileAnalysis,
507
+ ): void {
508
+ if (shouldIncludeType(node.name.text)) {
509
+ result.inputTypes.push(sourceCode.slice(node.pos, node.end).trim());
510
+ }
511
+ }
512
+
513
+ /** Process import declaration node */
514
+ function processImportDeclaration(
515
+ node: ts.ImportDeclaration,
516
+ sourceCode: string,
517
+ result: StepFileAnalysis,
518
+ ): void {
519
+ const spec = node.moduleSpecifier;
520
+ if (!ts.isStringLiteral(spec)) {
521
+ return;
522
+ }
523
+ const importText = sourceCode.slice(node.pos, node.end).trim();
524
+ if (shouldIncludeImport(spec.text, importText)) {
525
+ result.imports.push(importText);
526
+ }
527
+ }
528
+
529
+ /** Process a single AST node for exports, types, and imports */
530
+ function processNode(
531
+ node: ts.Node,
532
+ sourceCode: string,
533
+ result: StepFileAnalysis,
534
+ ): void {
535
+ if (ts.isVariableStatement(node)) {
536
+ processVariableStatement(node, result);
537
+ return;
538
+ }
539
+
540
+ if (ts.isTypeAliasDeclaration(node)) {
541
+ processTypeAlias(node, sourceCode, result);
542
+ return;
543
+ }
544
+
545
+ if (ts.isImportDeclaration(node)) {
546
+ processImportDeclaration(node, sourceCode, result);
547
+ return;
548
+ }
549
+
550
+ // Check for stepHandler function (doesn't need to be exported)
551
+ if (ts.isFunctionDeclaration(node) && node.name?.text === "stepHandler") {
552
+ result.hasExportCore = true;
553
+ result.coreFunction = extractFunctionInfo(node, sourceCode);
554
+ }
555
+ }
556
+
557
+ /**
558
+ * Extract information about a step file's exports using TypeScript AST
559
+ */
560
+ function analyzeStepFile(filePath: string): StepFileAnalysis {
561
+ const result = createEmptyAnalysis();
562
+
563
+ if (!existsSync(filePath)) {
564
+ return result;
565
+ }
566
+
567
+ const sourceCode = readFileSync(filePath, "utf-8");
568
+ const sourceFile = ts.createSourceFile(
569
+ filePath,
570
+ sourceCode,
571
+ ts.ScriptTarget.Latest,
572
+ true,
573
+ );
574
+
575
+ // Single pass: find stepHandler function, types, and imports
576
+ ts.forEachChild(sourceFile, (node) => {
577
+ processNode(node, sourceCode, result);
578
+ });
579
+
580
+ return result;
581
+ }
582
+
583
+ /**
584
+ * Generate a codegen template from a step file's core function
585
+ */
586
+ async function generateCodegenTemplate(
587
+ stepFilePath: string,
588
+ stepFunctionName: string,
589
+ ): Promise<string | null> {
590
+ const analysis = analyzeStepFile(stepFilePath);
591
+
592
+ if (!(analysis.hasExportCore && analysis.coreFunction)) {
593
+ return null;
594
+ }
595
+
596
+ const { coreFunction, integrationType, inputTypes, imports } = analysis;
597
+
598
+ // Extract the inner body (remove outer braces)
599
+ let innerBody = coreFunction.body.trim();
600
+ if (innerBody.startsWith("{")) {
601
+ innerBody = innerBody.slice(1);
602
+ }
603
+ if (innerBody.endsWith("}")) {
604
+ innerBody = innerBody.slice(0, -1);
605
+ }
606
+ innerBody = innerBody.trim();
607
+
608
+ // Extract input type from first parameter
609
+ const inputType =
610
+ coreFunction.params
611
+ .split(",")[0]
612
+ .replace(LEADING_WHITESPACE_PATTERN, "")
613
+ .split(":")[1]
614
+ ?.trim() || "unknown";
615
+
616
+ // Build the raw template (formatter will fix indentation)
617
+ const rawTemplate = `${ imports.join("\n") }
618
+ import { fetchCredentials } from './lib/credential-helper';
619
+
620
+ function getErrorMessage(error: unknown): string {
621
+ if (error instanceof Error) return error.message;
622
+ return String(error);
623
+ }
624
+
625
+ ${ inputTypes.join("\n\n") }
626
+
627
+ export async function ${ stepFunctionName }(input: ${ inputType }): ${ coreFunction.returnType } {
628
+ "use step";
629
+ const credentials = await fetchCredentials("${ integrationType || "unknown" }");
630
+ ${ innerBody }
631
+ }`;
632
+
633
+ // Format the generated code
634
+ return await formatCode(rawTemplate);
635
+ }
636
+
637
+ /**
638
+ * Process step files and generate codegen templates
639
+ */
640
+ async function processStepFilesForCodegen(): Promise<void> {
641
+ const { getAllIntegrations, computeActionId } = await import("../plugins/registry");
642
+ const integrations = getAllIntegrations();
643
+
644
+ for (const integration of integrations) {
645
+ for (const action of integration.actions) {
646
+ // Resolve step file path: local plugins use PLUGINS_DIR, npm plugins use their package directory
647
+ let stepFilePath: string;
648
+ const npmSpec = npmPluginSpecifiers.get(integration.type);
649
+ if (npmSpec) {
650
+ try {
651
+ const { createRequire } = await import("node:module");
652
+ const require = createRequire(join(process.cwd(), "package.json"));
653
+ const pkgDir = dirname(require.resolve(`${ npmSpec }/package.json`));
654
+ stepFilePath = join(pkgDir, "steps", `${ action.stepImportPath }.ts`);
655
+ } catch {
656
+ continue; // Skip if we can't resolve the npm package
657
+ }
658
+ } else {
659
+ stepFilePath = join(
660
+ PLUGINS_DIR,
661
+ integration.type,
662
+ "steps",
663
+ `${ action.stepImportPath }.ts`,
664
+ );
665
+ }
666
+
667
+ const template = await generateCodegenTemplate(
668
+ stepFilePath,
669
+ action.stepFunction,
670
+ );
671
+
672
+ if (template) {
673
+ const actionId = computeActionId(integration.type, action.slug);
674
+ generatedCodegenTemplates.set(actionId, {
675
+ template,
676
+ integrationType: integration.type,
677
+ });
678
+ console.log(` Generated codegen template for ${ actionId }`);
679
+ }
680
+ }
681
+ }
682
+ }
683
+
684
+ /**
685
+ * Generate the lib/codegen-registry.ts file with auto-generated templates
686
+ */
687
+ function generateCodegenRegistry(): void {
688
+ const entries = Array.from(generatedCodegenTemplates.entries());
689
+
690
+ if (entries.length === 0) {
691
+ console.log("No codegen templates generated");
692
+ return;
693
+ }
694
+
695
+ // Generate template string literals
696
+ const templateEntries = entries
697
+ .map(([actionId, { template }]) => {
698
+ // Escape backticks and ${} in the template for safe embedding
699
+ const escapedTemplate = template
700
+ .replace(/\\/g, "\\\\")
701
+ .replace(/`/g, "\\`")
702
+ .replace(/\$\{/g, "\\${");
703
+ return ` "${ actionId }": \`${ escapedTemplate }\`,`;
704
+ })
705
+ .join("\n\n");
706
+
707
+ const content = `/**
708
+ * Codegen Registry (Auto-Generated)
709
+ *
710
+ * This file is automatically generated by scripts/discover-plugins.ts
711
+ * DO NOT EDIT MANUALLY - your changes will be overwritten!
712
+ *
713
+ * Contains auto-generated codegen templates for steps with stepHandler.
714
+ * These templates are used when exporting workflows to standalone projects.
715
+ *
716
+ * Generated templates: ${ entries.length }
717
+ */
718
+
719
+ import { registerCodegenTemplates } from "next-workflow-builder/plugins";
720
+
721
+ /**
722
+ * Auto-generated codegen templates
723
+ * Maps action IDs to their generated export code templates
724
+ */
725
+ export const AUTO_GENERATED_TEMPLATES: Record<string, string> = {
726
+ ${ templateEntries }
727
+ };
728
+
729
+ // Register templates into the plugin registry so the package can access them
730
+ registerCodegenTemplates(AUTO_GENERATED_TEMPLATES);
731
+ `;
732
+
733
+ writeFileSync(CODEGEN_REGISTRY_FILE, content, "utf-8");
734
+ console.log(
735
+ `Generated lib/codegen-registry.ts with ${ entries.length } template(s)`,
736
+ );
737
+ }
738
+
739
+ // ============================================================================
740
+ // Step Registry Generation
741
+ // ============================================================================
742
+
743
+ /**
744
+ * Generate the lib/step-registry.ts file with step import functions
745
+ * This enables dynamic imports that are statically analyzable by the bundler
746
+ */
747
+ async function generateStepRegistry(): Promise<void> {
748
+ const { getAllIntegrations, computeActionId } = await import(
749
+ "../plugins/registry"
750
+ );
751
+ const { LEGACY_ACTION_MAPPINGS } = await import("../plugins/legacy-mappings");
752
+ const integrations = getAllIntegrations();
753
+ console.log("Generating step registry for integrations...");
754
+
755
+ // Collect all action -> step mappings
756
+ const stepEntries: Array<{
757
+ actionId: string;
758
+ label: string;
759
+ integration: string;
760
+ stepImportPath: string;
761
+ stepFunction: string;
762
+ }> = [];
763
+
764
+ for (const integration of integrations) {
765
+ for (const action of integration.actions) {
766
+ const fullActionId = computeActionId(integration.type, action.slug);
767
+ stepEntries.push({
768
+ actionId: fullActionId,
769
+ label: action.label,
770
+ integration: integration.type,
771
+ stepImportPath: action.stepImportPath,
772
+ stepFunction: action.stepFunction,
773
+ });
774
+ }
775
+ }
776
+
777
+ // Build reverse mapping from action IDs to legacy labels
778
+ const legacyLabelsForAction: Record<string, string[]> = {};
779
+ for (const [legacyLabel, actionId] of Object.entries(
780
+ LEGACY_ACTION_MAPPINGS,
781
+ )) {
782
+ if (!legacyLabelsForAction[actionId]) {
783
+ legacyLabelsForAction[actionId] = [];
784
+ }
785
+ legacyLabelsForAction[actionId].push(legacyLabel);
786
+ }
787
+
788
+ // Generate the step importer map with static imports
789
+ // Include both namespaced IDs and legacy label-based IDs for backward compatibility
790
+ const importerEntries = stepEntries
791
+ .flatMap(({ actionId, integration, stepImportPath, stepFunction }) => {
792
+ // For npm-installed plugins, use the package specifier; for local plugins, use @/plugins/
793
+ const npmSpec = npmPluginSpecifiers.get(integration);
794
+ const importPath = npmSpec
795
+ ? `${ npmSpec }/steps/${ stepImportPath }`
796
+ : `@/plugins/${ integration }/steps/${ stepImportPath }`;
797
+
798
+ const entries = [
799
+ ` "${ actionId }": {
800
+ importer: () => import("${ importPath }"),
801
+ stepFunction: "${ stepFunction }",
802
+ },`,
803
+ ];
804
+ // Add entries for all legacy labels that map to this action
805
+ const legacyLabels = legacyLabelsForAction[actionId] || [];
806
+ for (const legacyLabel of legacyLabels) {
807
+ entries.push(
808
+ ` "${ legacyLabel }": {
809
+ importer: () => import("${ importPath }"),
810
+ stepFunction: "${ stepFunction }",
811
+ },`,
812
+ );
813
+ }
814
+ return entries;
815
+ })
816
+ .join("\n");
817
+
818
+ // Generate the action labels map for displaying human-readable names
819
+ const labelEntries = stepEntries
820
+ .map(({ actionId, label }) => ` "${ actionId }": "${ label }",`)
821
+ .join("\n");
822
+
823
+ // Also add legacy label mappings to the labels map
824
+ const legacyLabelEntries = Object.entries(legacyLabelsForAction)
825
+ .flatMap(([actionId, legacyLabels]) => {
826
+ const entry = stepEntries.find((e) => e.actionId === actionId);
827
+ if (!entry) {
828
+ return [];
829
+ }
830
+ return legacyLabels.map(
831
+ (legacyLabel) => ` "${ legacyLabel }": "${ entry.label }",`,
832
+ );
833
+ })
834
+ .join("\n");
835
+
836
+ const content = `/**
837
+ * Step Registry (Auto-Generated)
838
+ *
839
+ * This file is automatically generated by scripts/discover-plugins.ts
840
+ * DO NOT EDIT MANUALLY - your changes will be overwritten!
841
+ *
842
+ * This registry enables dynamic step imports that are statically analyzable
843
+ * by the bundler. Each action type maps to its step importer function.
844
+ *
845
+ * Generated entries: ${ stepEntries.length }
846
+ */
847
+
848
+ import "server-only";
849
+
850
+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic step module types - step functions take any input
851
+ export type StepFunction = (input: any) => Promise<any>;
852
+
853
+ // Step modules may contain the step function plus other exports (types, constants, etc.)
854
+ // biome-ignore lint/suspicious/noExplicitAny: Dynamic module with mixed exports
855
+ export type StepModule = Record<string, any>;
856
+
857
+ export type StepImporter = {
858
+ importer: () => Promise<StepModule>;
859
+ stepFunction: string;
860
+ };
861
+
862
+ /**
863
+ * Plugin step importers - maps action types to their step import functions
864
+ * These imports are statically analyzable by the bundler
865
+ */
866
+ export const PLUGIN_STEP_IMPORTERS: Record<string, StepImporter> = {
867
+ ${ importerEntries }
868
+ };
869
+
870
+ /**
871
+ * Action labels - maps action IDs to human-readable labels
872
+ * Used for displaying friendly names in the UI (e.g., Runs tab)
873
+ */
874
+ export const ACTION_LABELS: Record<string, string> = {
875
+ ${ labelEntries }
876
+ ${ legacyLabelEntries }
877
+ };
878
+
879
+ /**
880
+ * Get a step importer for an action type
881
+ */
882
+ export function getStepImporter(actionType: string): StepImporter | undefined {
883
+ return PLUGIN_STEP_IMPORTERS[actionType];
884
+ }
885
+
886
+ /**
887
+ * Get the human-readable label for an action type
888
+ */
889
+ export function getActionLabel(actionType: string): string | undefined {
890
+ return ACTION_LABELS[actionType];
891
+ }
892
+ `;
893
+
894
+ writeFileSync(STEP_REGISTRY_FILE, content, "utf-8");
895
+ console.log(
896
+ `Generated lib/step-registry.ts with ${ stepEntries.length } step(s)`,
897
+ );
898
+ }
899
+
900
+ /**
901
+ * Generate the lib/output-display-configs.ts file (client-safe)
902
+ * This file can be imported in client components
903
+ */
904
+ async function generateOutputDisplayConfigs(): Promise<void> {
905
+ const { getAllIntegrations, computeActionId } = await import(
906
+ "../plugins/registry"
907
+ );
908
+ const integrations = getAllIntegrations();
909
+
910
+ // Collect output configs (only built-in types, not component types)
911
+ const outputConfigs: Array<{
912
+ actionId: string;
913
+ type: string;
914
+ field: string;
915
+ }> = [];
916
+
917
+ for (const integration of integrations) {
918
+ for (const action of integration.actions) {
919
+ // Only include built-in config types (image/video/url), not component types
920
+ if (action.outputConfig && action.outputConfig.type !== "component") {
921
+ outputConfigs.push({
922
+ actionId: computeActionId(integration.type, action.slug),
923
+ type: action.outputConfig.type,
924
+ field: action.outputConfig.field,
925
+ });
926
+ }
927
+ }
928
+ }
929
+
930
+ // Generate output config entries
931
+ const outputConfigEntries = outputConfigs
932
+ .map(
933
+ ({ actionId, type, field }) =>
934
+ ` "${ actionId }": { type: "${ type }", field: "${ field }" },`,
935
+ )
936
+ .join("\n");
937
+
938
+ const content = `/**
939
+ * Output Display Configs (Auto-Generated)
940
+ *
941
+ * This file is automatically generated by scripts/discover-plugins.ts
942
+ * DO NOT EDIT MANUALLY - your changes will be overwritten!
943
+ *
944
+ * This file is CLIENT-SAFE and can be imported in client components.
945
+ * It maps action IDs to their output display configuration.
946
+ *
947
+ * Generated configs: ${ outputConfigs.length }
948
+ */
949
+
950
+ import { registerOutputDisplayConfigs } from "next-workflow-builder/plugins";
951
+
952
+ export type OutputDisplayConfig = {
953
+ type: "image" | "video" | "url";
954
+ field: string;
955
+ };
956
+
957
+ /**
958
+ * Output display configs - maps action IDs to their display configuration
959
+ * Used for rendering outputs in the workflow runs panel
960
+ */
961
+ export const OUTPUT_DISPLAY_CONFIGS: Record<string, OutputDisplayConfig> = {
962
+ ${ outputConfigEntries }
963
+ };
964
+
965
+ // Register configs into the plugin registry so the package can access them
966
+ registerOutputDisplayConfigs(OUTPUT_DISPLAY_CONFIGS);
967
+ `;
968
+
969
+ writeFileSync(OUTPUT_CONFIGS_FILE, content, "utf-8");
970
+ console.log(
971
+ `Generated lib/output-display-configs.ts with ${ outputConfigs.length } config(s)`,
972
+ );
973
+ }
974
+
975
+ // ============================================================================
976
+ // Route Registry Generation
977
+ // ============================================================================
978
+
979
+ /**
980
+ * Generate the lib/route-registry.ts file with plugin route definitions
981
+ * This enables plugin-provided API routes to be merged into the workflow API handler
982
+ */
983
+ async function generateRouteRegistry(): Promise<void> {
984
+ const { getAllIntegrations } = await import("../plugins/registry");
985
+ const integrations = getAllIntegrations();
986
+
987
+ // Collect all route entries from plugins
988
+ const routeEntries: Array<{
989
+ path: string;
990
+ methods: string[];
991
+ handler: string;
992
+ handlerImportPath: string;
993
+ pluginType: string;
994
+ }> = [];
995
+
996
+ for (const integration of integrations) {
997
+ if (!integration.routes) continue;
998
+ for (const route of integration.routes) {
999
+ routeEntries.push({
1000
+ ...route,
1001
+ pluginType: integration.type,
1002
+ });
1003
+ }
1004
+ }
1005
+
1006
+ if (routeEntries.length === 0) {
1007
+ // Write an empty registry
1008
+ const content = `/**
1009
+ * Route Registry (Auto-Generated)
1010
+ *
1011
+ * This file is automatically generated by scripts/discover-plugins.ts
1012
+ * DO NOT EDIT MANUALLY - your changes will be overwritten!
1013
+ *
1014
+ * No plugin routes found.
1015
+ */
1016
+
1017
+ import "server-only";
1018
+ import type { RouteDefinition } from "next-workflow-builder";
1019
+
1020
+ const PLUGIN_ROUTES: RouteDefinition[] = [];
1021
+
1022
+ export default PLUGIN_ROUTES;
1023
+ `;
1024
+ writeFileSync(ROUTE_REGISTRY_FILE, content, "utf-8");
1025
+ console.log("Generated lib/route-registry.ts with 0 route(s)");
1026
+ return;
1027
+ }
1028
+
1029
+ // Generate import + route definition entries
1030
+ const importLines: string[] = [];
1031
+ const routeDefLines: string[] = [];
1032
+
1033
+ for (const entry of routeEntries) {
1034
+ const npmSpec = npmPluginSpecifiers.get(entry.pluginType);
1035
+ const importPath = npmSpec
1036
+ ? `${ npmSpec }/${ entry.handlerImportPath }`
1037
+ : `@/plugins/${ entry.pluginType }/${ entry.handlerImportPath }`;
1038
+ const methodsStr = entry.methods.map((m) => `"${ m }"`).join(", ");
1039
+
1040
+ importLines.push(`import { ${ entry.handler } } from "${ importPath }";`);
1041
+ routeDefLines.push(
1042
+ ` { path: "${ entry.path }", handler: ${ entry.handler }, methods: [${ methodsStr }] },`,
1043
+ );
1044
+ }
1045
+
1046
+ const content = `/**
1047
+ * Route Registry (Auto-Generated)
1048
+ *
1049
+ * This file is automatically generated by scripts/discover-plugins.ts
1050
+ * DO NOT EDIT MANUALLY - your changes will be overwritten!
1051
+ *
1052
+ * This file is SERVER-ONLY. Plugin route handlers are imported statically
1053
+ * so the bundler can tree-shake unused code.
1054
+ *
1055
+ * Generated routes: ${ routeEntries.length }
1056
+ */
1057
+
1058
+ import "server-only";
1059
+ import type { RouteDefinition } from "next-workflow-builder";
1060
+ ${ importLines.join("\n") }
1061
+
1062
+ const PLUGIN_ROUTES: RouteDefinition[] = [
1063
+ ${ routeDefLines.join("\n") }
1064
+ ];
1065
+
1066
+ export default PLUGIN_ROUTES;
1067
+ `;
1068
+
1069
+ writeFileSync(ROUTE_REGISTRY_FILE, content, "utf-8");
1070
+ console.log(
1071
+ `Generated lib/route-registry.ts with ${ routeEntries.length } route(s)`,
1072
+ );
1073
+ }
1074
+
1075
+ /**
1076
+ * Main execution
1077
+ */
1078
+ async function main(): Promise<void> {
1079
+ // Ensure plugins directory exists
1080
+ if (!existsSync(PLUGINS_DIR)) {
1081
+ mkdirSync(PLUGINS_DIR, { recursive: true });
1082
+ }
1083
+
1084
+ // 1. Scaffold plugins/index.ts if it doesn't exist (user-managed, never overwritten)
1085
+ console.log("Checking plugins/index.ts...");
1086
+ scaffoldIndexFile();
1087
+
1088
+ // 2. Import plugins/index.ts to populate the registry (handles both local and npm plugins)
1089
+ await importPluginsFromIndex();
1090
+
1091
+ // 3. Ensure auto-generated files are gitignored
1092
+ ensureGitignore();
1093
+
1094
+ // 4. Generate all other files from the registry
1095
+ console.log("Updating README.md...");
1096
+ await updateReadme();
1097
+
1098
+ console.log("Generating lib/types/integration.ts...");
1099
+ await generateTypesFile();
1100
+
1101
+ console.log("Generating lib/step-registry.ts...");
1102
+ await generateStepRegistry();
1103
+
1104
+ console.log("Generating lib/output-display-configs.ts...");
1105
+ await generateOutputDisplayConfigs();
1106
+
1107
+ console.log("\nProcessing step files for codegen templates...");
1108
+ await processStepFilesForCodegen();
1109
+
1110
+ console.log("Generating lib/codegen-registry.ts...");
1111
+ generateCodegenRegistry();
1112
+
1113
+ console.log("Generating lib/route-registry.ts...");
1114
+ await generateRouteRegistry();
1115
+
1116
+ console.log("Done! Plugin registry updated.\n");
1117
+ }
1118
+
1119
+ main().catch((error) => {
1120
+ console.error("Error:", error);
1121
+ process.exit(1);
1122
+ });