windmill-components 1.623.2 → 1.655.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 (1233) hide show
  1. package/dist/appPolicy/myFunction.es.js +1337 -0
  2. package/dist/sharedUtils/assets/tokens/colorTokensConfig.d.ts +2 -0
  3. package/dist/sharedUtils/base.d.ts +1 -0
  4. package/dist/sharedUtils/cloud.d.ts +1 -0
  5. package/dist/sharedUtils/common.d.ts +108 -0
  6. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +5 -0
  7. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +5 -0
  8. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +5 -0
  9. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +11 -0
  10. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +11 -0
  11. package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +84 -0
  12. package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +6 -0
  13. package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +7 -0
  14. package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +22 -0
  15. package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +10 -0
  16. package/dist/sharedUtils/components/apps/editor/component/components.d.ts +5305 -0
  17. package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +3 -0
  18. package/dist/sharedUtils/components/apps/editor/component/index.d.ts +3 -0
  19. package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +7 -0
  20. package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
  21. package/dist/sharedUtils/components/apps/gridUtils.d.ts +14 -0
  22. package/dist/sharedUtils/components/apps/inputType.d.ts +176 -0
  23. package/dist/sharedUtils/components/apps/rx.d.ts +29 -0
  24. package/dist/sharedUtils/components/apps/sharedTypes.d.ts +19 -0
  25. package/dist/sharedUtils/components/apps/types.d.ts +274 -0
  26. package/dist/sharedUtils/components/common/alert/model.d.ts +2 -0
  27. package/dist/sharedUtils/components/common/badge/model.d.ts +8 -0
  28. package/dist/sharedUtils/components/common/button/model.d.ts +45 -0
  29. package/dist/sharedUtils/components/common/fileInput/model.d.ts +1 -0
  30. package/dist/sharedUtils/components/common/index.d.ts +24 -0
  31. package/dist/sharedUtils/components/common/skeleton/model.d.ts +21 -0
  32. package/dist/sharedUtils/components/dbTypes.d.ts +11 -0
  33. package/dist/sharedUtils/components/diff_drawer.d.ts +26 -0
  34. package/dist/sharedUtils/components/ducklake.d.ts +1 -0
  35. package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +7 -0
  36. package/dist/sharedUtils/components/random_positive_adjetive.d.ts +1 -0
  37. package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +10 -0
  38. package/dist/sharedUtils/components/raw_apps/utils.d.ts +15 -0
  39. package/dist/sharedUtils/components/triggers/email/utils.d.ts +4 -0
  40. package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +2 -0
  41. package/dist/sharedUtils/components/triggers/http/utils.d.ts +11 -0
  42. package/dist/sharedUtils/components/triggers/kafka/utils.d.ts +2 -0
  43. package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +2 -0
  44. package/dist/sharedUtils/components/triggers/nats/utils.d.ts +2 -0
  45. package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +8 -0
  46. package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +2 -0
  47. package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +32 -0
  48. package/dist/sharedUtils/components/triggers/utils.d.ts +81 -0
  49. package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +2 -0
  50. package/dist/sharedUtils/components/triggers.d.ts +20 -0
  51. package/dist/sharedUtils/gen/core/ApiError.d.ts +10 -0
  52. package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +13 -0
  53. package/dist/sharedUtils/gen/core/ApiResult.d.ts +7 -0
  54. package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +26 -0
  55. package/dist/sharedUtils/gen/core/OpenAPI.d.ts +27 -0
  56. package/dist/sharedUtils/gen/core/request.d.ts +29 -0
  57. package/dist/sharedUtils/gen/index.d.ts +6 -0
  58. package/dist/sharedUtils/gen/schemas.gen.d.ts +6192 -0
  59. package/dist/sharedUtils/gen/services.gen.d.ts +5741 -0
  60. package/dist/sharedUtils/gen/types.gen.d.ts +20152 -0
  61. package/dist/sharedUtils/history.svelte.d.ts +9 -0
  62. package/dist/sharedUtils/hub.d.ts +48 -0
  63. package/dist/sharedUtils/jsr.json +6 -0
  64. package/dist/sharedUtils/lib.d.ts +5 -0
  65. package/dist/sharedUtils/lib.es.js +1426 -0
  66. package/dist/sharedUtils/package.json +12 -0
  67. package/dist/sharedUtils/schema.d.ts +3 -0
  68. package/dist/sharedUtils/stores.d.ts +96 -0
  69. package/dist/sharedUtils/svelte5Utils.svelte.d.ts +49 -0
  70. package/dist/sharedUtils/toast.d.ts +8 -0
  71. package/dist/sharedUtils/utils.d.ts +250 -0
  72. package/package/aiStore.d.ts +1 -0
  73. package/package/aiStore.js +3 -0
  74. package/package/assets/app.css +32 -13
  75. package/package/components/AIAgentLogViewer.svelte +2 -2
  76. package/package/components/AIAgentLogViewer.svelte.d.ts +1 -0
  77. package/package/components/AIProviderPicker.svelte +20 -80
  78. package/package/components/AIProviderPicker.svelte.d.ts +2 -7
  79. package/package/components/AddUser.svelte +2 -2
  80. package/package/components/ApiConnectForm.svelte +14 -1
  81. package/package/components/ApiConnectForm.svelte.d.ts +1 -1
  82. package/package/components/AppConnectDrawer.svelte +18 -15
  83. package/package/components/AppConnectDrawer.svelte.d.ts +5 -5
  84. package/package/components/AppConnectInner.svelte +2 -0
  85. package/package/components/AppConnectInner.svelte.d.ts +1 -1
  86. package/package/components/AppConnectLightweightResourcePicker.svelte +3 -3
  87. package/package/components/AppWrapper.svelte +3 -2
  88. package/package/components/ArgInput.svelte +16 -5
  89. package/package/components/ArgInput.svelte.d.ts +3 -4
  90. package/package/components/Auth0Setting.svelte +6 -2
  91. package/package/components/AuthSettings.svelte +68 -39
  92. package/package/components/AuthSettings.svelte.d.ts +3 -1
  93. package/package/components/AutheliaSetting.svelte +12 -8
  94. package/package/components/AutheliaSetting.svelte.d.ts +4 -18
  95. package/package/components/AuthentikSetting.svelte +13 -9
  96. package/package/components/AuthentikSetting.svelte.d.ts +4 -18
  97. package/package/components/AutoscalingConfigEditor.svelte +2 -1
  98. package/package/components/AutoscalingConfigEditor.svelte.d.ts +1 -0
  99. package/package/components/AzureOauthSettings.svelte +23 -23
  100. package/package/components/AzureOauthSettings.svelte.d.ts +4 -18
  101. package/package/components/Badge.svelte +2 -4
  102. package/package/components/Badge.svelte.d.ts +5 -27
  103. package/package/components/CenteredModal.svelte +14 -4
  104. package/package/components/CenteredModal.svelte.d.ts +1 -0
  105. package/package/components/ChangeInstanceUsernameInner.svelte +5 -8
  106. package/package/components/ChangeInstanceUsernameInner.svelte.d.ts +8 -7
  107. package/package/components/ChannelSelector.svelte +19 -15
  108. package/package/components/CompareWorkspaces.svelte +634 -694
  109. package/package/components/ConcurrentJobsChart.svelte +1 -1
  110. package/package/components/ConnectionSection.svelte +69 -73
  111. package/package/components/ContextualVariableEditor.svelte +8 -8
  112. package/package/components/ContextualVariableEditor.svelte.d.ts +3 -6
  113. package/package/components/CustomOauth.svelte +19 -23
  114. package/package/components/CustomOauth.svelte.d.ts +4 -26
  115. package/package/components/CustomPopover.svelte +3 -2
  116. package/package/components/CustomSso.svelte +27 -32
  117. package/package/components/CustomSso.svelte.d.ts +4 -27
  118. package/package/components/DBManager.svelte +15 -4
  119. package/package/components/DBManager.svelte.d.ts +2 -0
  120. package/package/components/DBManagerContent.svelte +5 -0
  121. package/package/components/DBManagerContent.svelte.d.ts +1 -0
  122. package/package/components/DBManagerDrawer.svelte +26 -42
  123. package/package/components/DBManagerDrawer.svelte.d.ts +3 -5
  124. package/package/components/DBSchemaExplorer.svelte +3 -3
  125. package/package/components/DBTableEditor.svelte +6 -6
  126. package/package/components/DatatablePicker.svelte +27 -0
  127. package/package/components/DatatablePicker.svelte.d.ts +13 -0
  128. package/package/components/DateInput.svelte +1 -0
  129. package/package/components/DateTimeInput.svelte +4 -3
  130. package/package/components/DedicatedWorkersSelector.svelte +39 -42
  131. package/package/components/DefaultScripts.svelte +3 -5
  132. package/package/components/DefaultScripts.svelte.d.ts +6 -20
  133. package/package/components/DefaultScriptsInner.svelte +4 -4
  134. package/package/components/DefaultScriptsInner.svelte.d.ts +4 -18
  135. package/package/components/DeployToSetting.svelte +183 -123
  136. package/package/components/DeployToSetting.svelte.d.ts +19 -28
  137. package/package/components/DeployWorkspace.svelte +224 -510
  138. package/package/components/DeployWorkspace.svelte.d.ts +2 -1
  139. package/package/components/DeployWorkspaceDrawer.svelte +10 -8
  140. package/package/components/DeployWorkspaceDrawer.svelte.d.ts +3 -20
  141. package/package/components/Description.svelte +6 -4
  142. package/package/components/Description.svelte.d.ts +6 -28
  143. package/package/components/Dev.svelte +16 -14
  144. package/package/components/DiffEditor.svelte +9 -8
  145. package/package/components/DiffEditor.svelte.d.ts +2 -6
  146. package/package/components/DisplayResult.svelte +2 -2
  147. package/package/components/DisplayResult.svelte.d.ts +1 -1
  148. package/package/components/DropdownMenu.svelte +39 -0
  149. package/package/components/DropdownMenu.svelte.d.ts +14 -0
  150. package/package/components/DropdownSubmenuItem.svelte +69 -0
  151. package/package/components/DropdownSubmenuItem.svelte.d.ts +10 -0
  152. package/package/components/DropdownV2.svelte +4 -4
  153. package/package/components/DropdownV2.svelte.d.ts +2 -2
  154. package/package/components/DropdownV2Inner.svelte +45 -34
  155. package/package/components/DropdownV2Inner.svelte.d.ts +2 -1
  156. package/package/components/DucklakePicker.svelte +0 -5
  157. package/package/components/DurationMs.svelte +1 -3
  158. package/package/components/DurationMs.svelte.d.ts +4 -18
  159. package/package/components/DynamicInput.svelte +2 -2
  160. package/package/components/EEOnly.svelte +4 -14
  161. package/package/components/EEOnly.svelte.d.ts +0 -1
  162. package/package/components/EditableSchemaForm.svelte +4 -4
  163. package/package/components/Editor.svelte +11 -13
  164. package/package/components/Editor.svelte.d.ts +1 -0
  165. package/package/components/EditorBar.svelte +4 -6
  166. package/package/components/EditorBar.svelte.d.ts +1 -1
  167. package/package/components/ErrorOrRecoveryHandler.svelte +62 -53
  168. package/package/components/ErrorOrRecoveryHandler.svelte.d.ts +1 -0
  169. package/package/components/ExecutionDuration.svelte +12 -20
  170. package/package/components/ExecutionDuration.svelte.d.ts +14 -24
  171. package/package/components/ExploreAssetButton.svelte +14 -8
  172. package/package/components/ExploreAssetButton.svelte.d.ts +0 -2
  173. package/package/components/FakeMonacoPlaceHolder.svelte +3 -2
  174. package/package/components/FieldHeader.svelte +6 -16
  175. package/package/components/FieldHeader.svelte.d.ts +5 -20
  176. package/package/components/FileExplorer.svelte +249 -0
  177. package/package/components/FileExplorer.svelte.d.ts +21 -0
  178. package/package/components/FilesetEditor.svelte +126 -0
  179. package/package/components/FilesetEditor.svelte.d.ts +6 -0
  180. package/package/components/FilterSearchbar.svelte +661 -0
  181. package/package/components/FilterSearchbar.svelte.d.ts +87 -0
  182. package/package/components/FlowBuilder.svelte +161 -98
  183. package/package/components/FlowGraphViewer.svelte +1 -10
  184. package/package/components/FlowGraphViewer.svelte.d.ts +17 -16
  185. package/package/components/FlowGraphViewerStep.svelte +52 -38
  186. package/package/components/FlowGraphViewerStep.svelte.d.ts +4 -18
  187. package/package/components/FlowHistoryJobPicker.svelte +6 -3
  188. package/package/components/FlowHistoryJobPicker.svelte.d.ts +1 -0
  189. package/package/components/FlowInputViewer.svelte +1 -1
  190. package/package/components/FlowInputViewer.svelte.d.ts +4 -18
  191. package/package/components/FlowJobResult.svelte +31 -23
  192. package/package/components/FlowJobResult.svelte.d.ts +0 -1
  193. package/package/components/FlowLogRow.svelte +1 -1
  194. package/package/components/FlowLogViewer.svelte +14 -7
  195. package/package/components/FlowLogViewerWrapper.svelte +2 -2
  196. package/package/components/FlowPlugConnect.svelte +1 -3
  197. package/package/components/FlowPlugConnect.svelte.d.ts +7 -6
  198. package/package/components/FlowPreviewContent.svelte +174 -53
  199. package/package/components/FlowPreviewContent.svelte.d.ts +5 -0
  200. package/package/components/FlowRestartButton.svelte +47 -47
  201. package/package/components/FlowRestartButton.svelte.d.ts +2 -0
  202. package/package/components/FlowStatusViewer.svelte +8 -9
  203. package/package/components/FlowStatusViewer.svelte.d.ts +1 -0
  204. package/package/components/FlowStatusViewerInner.svelte +463 -367
  205. package/package/components/FlowStatusViewerInner.svelte.d.ts +2 -2
  206. package/package/components/FlowStatusWaitingForEvents.svelte +11 -10
  207. package/package/components/FlowViewer.svelte +6 -4
  208. package/package/components/FlowWrapper.svelte +5 -4
  209. package/package/components/FolderEditor.svelte +9 -7
  210. package/package/components/FolderPicker.svelte +195 -65
  211. package/package/components/FolderPicker.svelte.d.ts +2 -0
  212. package/package/components/FolderUsageInfo.svelte +7 -6
  213. package/package/components/FolderUsageInfo.svelte.d.ts +5 -19
  214. package/package/components/GraphqlSchemaViewer.svelte +3 -3
  215. package/package/components/GraphqlSchemaViewer.svelte.d.ts +5 -19
  216. package/package/components/GroupEditor.svelte +22 -10
  217. package/package/components/HistoricInputs.svelte +3 -4
  218. package/package/components/IconedResourceType.svelte +8 -2
  219. package/package/components/IconedResourceType.svelte.d.ts +2 -0
  220. package/package/components/IdEditorInput.svelte +3 -2
  221. package/package/components/InputError.svelte +9 -0
  222. package/package/components/InputError.svelte.d.ts +6 -0
  223. package/package/components/InputTransformForm.svelte +48 -39
  224. package/package/components/InputTransformForm.svelte.d.ts +1 -0
  225. package/package/components/InputTransformSchemaForm.svelte +2 -1
  226. package/package/components/InputTransformSchemaForm.svelte.d.ts +2 -1
  227. package/package/components/InputTransformsViewer.svelte +39 -22
  228. package/package/components/InputTransformsViewer.svelte.d.ts +4 -18
  229. package/package/components/InstanceGroupEditor.svelte +28 -23
  230. package/package/components/InstanceGroupEditor.svelte.d.ts +5 -4
  231. package/package/components/InstanceNameEditor.svelte +22 -20
  232. package/package/components/InstanceNameEditor.svelte.d.ts +9 -9
  233. package/package/components/InstanceSetting.svelte +156 -374
  234. package/package/components/InstanceSetting.svelte.d.ts +1 -0
  235. package/package/components/InstanceSettings.svelte +818 -193
  236. package/package/components/InstanceSettings.svelte.d.ts +17 -2
  237. package/package/components/IntegerInput.svelte +58 -0
  238. package/package/components/IntegerInput.svelte.d.ts +14 -0
  239. package/package/components/InviteGlobalUser.svelte +28 -28
  240. package/package/components/InviteGlobalUser.svelte.d.ts +6 -3
  241. package/package/components/JobArgs.svelte +14 -10
  242. package/package/components/JobLoader.svelte +57 -5
  243. package/package/components/JobLoader.svelte.d.ts +2 -2
  244. package/package/components/JobStatus.svelte +29 -26
  245. package/package/components/JobStatus.svelte.d.ts +1 -0
  246. package/package/components/KanidmSetting.svelte +18 -14
  247. package/package/components/KanidmSetting.svelte.d.ts +4 -18
  248. package/package/components/KeycloakSetting.svelte +21 -11
  249. package/package/components/KeycloakSetting.svelte.d.ts +4 -18
  250. package/package/components/LogId.svelte +5 -2
  251. package/package/components/LogId.svelte.d.ts +4 -18
  252. package/package/components/LogSnippetViewer.svelte +5 -5
  253. package/package/components/LogSnippetViewer.svelte.d.ts +5 -20
  254. package/package/components/LogViewer.svelte +2 -2
  255. package/package/components/Login.svelte +9 -3
  256. package/package/components/ManualPopover.svelte +4 -1
  257. package/package/components/MapResult.svelte +33 -33
  258. package/package/components/MapResult.svelte.d.ts +13 -26
  259. package/package/components/MemoryFootprintViewer.svelte +8 -6
  260. package/package/components/MemoryFootprintViewer.svelte.d.ts +4 -18
  261. package/package/components/ModulePreview.svelte.d.ts +1 -1
  262. package/package/components/ModuleStatus.svelte +6 -8
  263. package/package/components/ModuleStatus.svelte.d.ts +5 -19
  264. package/package/components/ModuleTest.svelte +6 -6
  265. package/package/components/ModuleTest.svelte.d.ts +1 -1
  266. package/package/components/MoveDrawer.svelte +47 -76
  267. package/package/components/MoveDrawer.svelte.d.ts +4 -6
  268. package/package/components/NextcloudSetting.svelte +3 -2
  269. package/package/components/NoDirectDeployAlert.svelte +31 -0
  270. package/package/components/NoDirectDeployAlert.svelte.d.ts +6 -0
  271. package/package/components/NumberTypeNarrowing.svelte +65 -67
  272. package/package/components/NumberTypeNarrowing.svelte.d.ts +2 -1
  273. package/package/components/OAuthSetting.svelte +63 -55
  274. package/package/components/OauthExtraParams.svelte +9 -4
  275. package/package/components/OauthExtraParams.svelte.d.ts +4 -18
  276. package/package/components/OauthScopes.svelte +9 -4
  277. package/package/components/OauthScopes.svelte.d.ts +4 -18
  278. package/package/components/ObjectResourceInput.svelte +10 -3
  279. package/package/components/ObjectResourceInput.svelte.d.ts +1 -0
  280. package/package/components/ObjectStoreConfigSettings.svelte +150 -55
  281. package/package/components/ObjectStoreConfigSettings.svelte.d.ts +34 -44
  282. package/package/components/OktaSetting.svelte +3 -2
  283. package/package/components/OnBehalfOfSelector.svelte +191 -0
  284. package/package/components/OnBehalfOfSelector.svelte.d.ts +21 -0
  285. package/package/components/PageHeader.svelte +4 -8
  286. package/package/components/PageHeader.svelte.d.ts +5 -27
  287. package/package/components/ParentWorkspaceProtectionAlert.svelte +48 -0
  288. package/package/components/ParentWorkspaceProtectionAlert.svelte.d.ts +7 -0
  289. package/package/components/ParqetCsvTableRenderer.svelte +12 -12
  290. package/package/components/ParqetCsvTableRenderer.svelte.d.ts +4 -18
  291. package/package/components/Path.svelte +40 -28
  292. package/package/components/Path.svelte.d.ts +3 -0
  293. package/package/components/PermissionHistory.svelte +8 -6
  294. package/package/components/PersistentScriptDrawer.svelte +56 -50
  295. package/package/components/PersistentScriptDrawer.svelte.d.ts +3 -5
  296. package/package/components/PocketIdSetting.svelte +3 -2
  297. package/package/components/Popover.svelte +2 -2
  298. package/package/components/PrefixedInput.svelte +2 -2
  299. package/package/components/QueueMetricsDrawer.svelte +1 -1
  300. package/package/components/QueueMetricsDrawer.svelte.d.ts +3 -20
  301. package/package/components/QueueMetricsDrawerInner.svelte +14 -9
  302. package/package/components/QueueMetricsDrawerInner.svelte.d.ts +2 -17
  303. package/package/components/RadioButton.svelte +3 -8
  304. package/package/components/RadioButton.svelte.d.ts +13 -12
  305. package/package/components/Range.svelte +15 -18
  306. package/package/components/Range.svelte.d.ts +5 -21
  307. package/package/components/RepositorySelector.svelte +3 -2
  308. package/package/components/Required.svelte +4 -4
  309. package/package/components/Required.svelte.d.ts +6 -20
  310. package/package/components/ResourceEditor.svelte +28 -5
  311. package/package/components/ResourceEditor.svelte.d.ts +0 -1
  312. package/package/components/ResourceEditorDrawer.svelte +11 -16
  313. package/package/components/ResourceEditorDrawer.svelte.d.ts +3 -6
  314. package/package/components/ResourcePicker.svelte +34 -19
  315. package/package/components/ResourcePicker.svelte.d.ts +1 -0
  316. package/package/components/RightClickPopover.svelte +37 -0
  317. package/package/components/RightClickPopover.svelte.d.ts +11 -0
  318. package/package/components/RunChart.svelte +2 -21
  319. package/package/components/RunChart.svelte.d.ts +0 -3
  320. package/package/components/RunForm.svelte +2 -2
  321. package/package/components/RunFormAdvancedPopup.svelte +1 -4
  322. package/package/components/RunFormAdvancedPopup.svelte.d.ts +4 -18
  323. package/package/components/RunsPage.svelte +554 -557
  324. package/package/components/S3FilePicker.svelte +2 -1
  325. package/package/components/S3FilePicker.svelte.d.ts +1 -0
  326. package/package/components/S3FilePickerInner.svelte +19 -7
  327. package/package/components/S3FilePickerInner.svelte.d.ts +1 -0
  328. package/package/components/S3ObjectPicker.svelte +4 -5
  329. package/package/components/S3ObjectPicker.svelte.d.ts +6 -6
  330. package/package/components/SaveButton.svelte +80 -0
  331. package/package/components/SaveButton.svelte.d.ts +12 -0
  332. package/package/components/SaveInputsButton.svelte +3 -8
  333. package/package/components/SaveInputsButton.svelte.d.ts +10 -9
  334. package/package/components/SavedInputsPickerViewer.svelte +21 -22
  335. package/package/components/SavedInputsPickerViewer.svelte.d.ts +10 -10
  336. package/package/components/SavedInputsV2.svelte +1 -3
  337. package/package/components/SchemaEditorProperty.svelte +1 -1
  338. package/package/components/SchemaEditorProperty.svelte.d.ts +4 -18
  339. package/package/components/SchemaForm.svelte.d.ts +1 -1
  340. package/package/components/SchemaFormWithArgPicker.svelte +34 -30
  341. package/package/components/SchemaFormWithArgPicker.svelte.d.ts +12 -21
  342. package/package/components/SchemaViewer.svelte +56 -53
  343. package/package/components/ScriptBuilder.svelte +123 -40
  344. package/package/components/ScriptEditor.svelte +97 -39
  345. package/package/components/ScriptEditor.svelte.d.ts +2 -2
  346. package/package/components/ScriptPicker.svelte +1 -1
  347. package/package/components/ScriptWrapper.svelte +3 -2
  348. package/package/components/Scrollable.svelte +10 -10
  349. package/package/components/Scrollable.svelte.d.ts +6 -29
  350. package/package/components/SearchItems.svelte +1 -1
  351. package/package/components/Section.svelte +2 -2
  352. package/package/components/ServiceLogsInner.svelte +36 -91
  353. package/package/components/ShareModal.svelte +15 -8
  354. package/package/components/ShareModal.svelte.d.ts +1 -1
  355. package/package/components/SimpleEditor.svelte +1 -1
  356. package/package/components/Slider.svelte +2 -5
  357. package/package/components/Slider.svelte.d.ts +6 -28
  358. package/package/components/Star.svelte +8 -22
  359. package/package/components/Star.svelte.d.ts +4 -4
  360. package/package/components/StringTypeNarrowing.svelte +4 -2
  361. package/package/components/Subsection.svelte +3 -2
  362. package/package/components/Summary.svelte +1 -2
  363. package/package/components/Summary.svelte.d.ts +4 -18
  364. package/package/components/SummaryPathDisplay.svelte +177 -0
  365. package/package/components/SummaryPathDisplay.svelte.d.ts +10 -0
  366. package/package/components/SupabaseConnect.svelte +20 -17
  367. package/package/components/SupabaseConnect.svelte.d.ts +3 -5
  368. package/package/components/SuperadminSettings.svelte +187 -4
  369. package/package/components/SuperadminSettings.svelte.d.ts +4 -1
  370. package/package/components/SuperadminSettingsInner.svelte +310 -195
  371. package/package/components/SuperadminSettingsInner.svelte.d.ts +12 -1
  372. package/package/components/TableCustom.svelte +6 -8
  373. package/package/components/TableCustom.svelte.d.ts +10 -10
  374. package/package/components/TaggedTextInput.svelte +449 -0
  375. package/package/components/TaggedTextInput.svelte.d.ts +28 -0
  376. package/package/components/TeamSelector.svelte +20 -14
  377. package/package/components/TemplateEditor.svelte +1 -7
  378. package/package/components/TestConnection.svelte +2 -5
  379. package/package/components/TestConnection.svelte.d.ts +4 -18
  380. package/package/components/TimelineBar.svelte +5 -2
  381. package/package/components/Toast.svelte +69 -51
  382. package/package/components/Toast.svelte.d.ts +2 -2
  383. package/package/components/Toggle.svelte +2 -2
  384. package/package/components/Tooltip.svelte +4 -17
  385. package/package/components/Tooltip.svelte.d.ts +6 -1
  386. package/package/components/TooltipInner.svelte +8 -14
  387. package/package/components/TooltipInner.svelte.d.ts +6 -28
  388. package/package/components/Uptodate.svelte +4 -3
  389. package/package/components/Uptodate.svelte.d.ts +2 -17
  390. package/package/components/Urlize.svelte +2 -2
  391. package/package/components/Urlize.svelte.d.ts +4 -18
  392. package/package/components/UserSettings.svelte +2 -2
  393. package/package/components/UserSettings.svelte.d.ts +1 -0
  394. package/package/components/Version.svelte +1 -1
  395. package/package/components/Version.svelte.d.ts +2 -17
  396. package/package/components/WhitelistIp.svelte +1 -1
  397. package/package/components/WhitelistIp.svelte.d.ts +2 -17
  398. package/package/components/WorkerGroup.svelte +321 -197
  399. package/package/components/WorkerGroup.svelte.d.ts +2 -0
  400. package/package/components/WorkerRepl.svelte +1 -2
  401. package/package/components/WorkflowTimeline.svelte +10 -14
  402. package/package/components/WorkflowTimeline.svelte.d.ts +4 -18
  403. package/package/components/WorkspaceDependenciesEditor.svelte +34 -18
  404. package/package/components/WorkspaceDeployLayout.svelte +107 -0
  405. package/package/components/WorkspaceDeployLayout.svelte.d.ts +31 -0
  406. package/package/components/ZitadelSetting.svelte +12 -8
  407. package/package/components/ZitadelSetting.svelte.d.ts +4 -18
  408. package/package/components/aiProviderStorage.d.ts +5 -0
  409. package/package/components/aiProviderStorage.js +50 -0
  410. package/package/components/apps/components/GroupWrapper.svelte +5 -2
  411. package/package/components/apps/components/buttons/AppButton.svelte +6 -5
  412. package/package/components/apps/components/buttons/AppForm.svelte +5 -5
  413. package/package/components/apps/components/buttons/AppFormButton.svelte +5 -5
  414. package/package/components/apps/components/buttons/AppSchemaForm.svelte +5 -4
  415. package/package/components/apps/components/display/AppAccordionList.svelte +4 -4
  416. package/package/components/apps/components/display/AppAlert.svelte +4 -4
  417. package/package/components/apps/components/display/AppBarChart.svelte +4 -4
  418. package/package/components/apps/components/display/AppCarouselList.svelte +5 -5
  419. package/package/components/apps/components/display/AppChartJs.svelte +4 -4
  420. package/package/components/apps/components/display/AppChartJsV2.svelte +4 -4
  421. package/package/components/apps/components/display/AppChat.svelte +5 -5
  422. package/package/components/apps/components/display/AppCustomComponent.svelte +3 -3
  423. package/package/components/apps/components/display/AppDisplayComponent.svelte +5 -5
  424. package/package/components/apps/components/display/AppDisplayComponentByJobId.svelte +3 -3
  425. package/package/components/apps/components/display/AppDownload.svelte +3 -3
  426. package/package/components/apps/components/display/AppHtml.svelte +4 -3
  427. package/package/components/apps/components/display/AppIcon.svelte +4 -4
  428. package/package/components/apps/components/display/AppImage.svelte +4 -4
  429. package/package/components/apps/components/display/AppJobIdFlowStatus.svelte +4 -4
  430. package/package/components/apps/components/display/AppJobIdLogComponent.svelte +3 -3
  431. package/package/components/apps/components/display/AppJobProgressBar.svelte +3 -3
  432. package/package/components/apps/components/display/AppMap.svelte +6 -4
  433. package/package/components/apps/components/display/AppMarkdown.svelte +5 -4
  434. package/package/components/apps/components/display/AppMenu.svelte +4 -3
  435. package/package/components/apps/components/display/AppNavbar.svelte +4 -4
  436. package/package/components/apps/components/display/AppPdf.svelte +3 -3
  437. package/package/components/apps/components/display/AppPieChart.svelte +3 -3
  438. package/package/components/apps/components/display/AppRecomputeAll.svelte +3 -3
  439. package/package/components/apps/components/display/AppScatterChart.svelte +3 -3
  440. package/package/components/apps/components/display/AppStatCard.svelte +3 -3
  441. package/package/components/apps/components/display/AppText.svelte +10 -8
  442. package/package/components/apps/components/display/AppTimeseries.svelte +3 -3
  443. package/package/components/apps/components/display/InsertRowDrawerButton.svelte +1 -1
  444. package/package/components/apps/components/display/PlotlyHtml.svelte +3 -2
  445. package/package/components/apps/components/display/PlotlyHtmlV2.svelte +3 -2
  446. package/package/components/apps/components/display/ResolveNavbarItemPath.svelte +3 -2
  447. package/package/components/apps/components/display/VegaLiteHtml.svelte +3 -2
  448. package/package/components/apps/components/display/charts/AppAgCharts.svelte +3 -3
  449. package/package/components/apps/components/display/dbtable/AppDbExplorer.svelte +26 -15
  450. package/package/components/apps/components/display/dbtable/DbExplorerCount.svelte +3 -3
  451. package/package/components/apps/components/display/dbtable/DeleteRow.svelte +2 -2
  452. package/package/components/apps/components/display/dbtable/InsertRowRunnable.svelte +2 -2
  453. package/package/components/apps/components/display/dbtable/UpdateCell.svelte +2 -2
  454. package/package/components/apps/components/display/dbtable/metadata.d.ts +1 -0
  455. package/package/components/apps/components/display/dbtable/metadata.js +10 -4
  456. package/package/components/apps/components/display/dbtable/queries/count.js +3 -1
  457. package/package/components/apps/components/display/dbtable/queries/delete.js +3 -1
  458. package/package/components/apps/components/display/dbtable/queries/insert.js +3 -1
  459. package/package/components/apps/components/display/dbtable/queries/select.js +15 -1
  460. package/package/components/apps/components/display/dbtable/queries/update.js +3 -1
  461. package/package/components/apps/components/display/dbtable/utils.d.ts +3 -3
  462. package/package/components/apps/components/display/dbtable/utils.js +3 -3
  463. package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte +14 -4
  464. package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte.d.ts +1 -1
  465. package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte +4 -3
  466. package/package/components/apps/components/display/table/AppAggridTable.svelte +11 -3
  467. package/package/components/apps/components/display/table/AppAggridTableActions.svelte +12 -6
  468. package/package/components/apps/components/display/table/AppAggridTableActions.svelte.d.ts +1 -0
  469. package/package/components/apps/components/display/table/AppTable.svelte +4 -4
  470. package/package/components/apps/components/display/table/theme/windmill-theme.css +8 -7
  471. package/package/components/apps/components/helpers/HiddenComponent.svelte +2 -2
  472. package/package/components/apps/components/helpers/InputValue.svelte +3 -3
  473. package/package/components/apps/components/helpers/RunnableComponent.svelte +2 -2
  474. package/package/components/apps/components/helpers/RunnableWrapper.svelte +2 -2
  475. package/package/components/apps/components/helpers/eval.js +5 -2
  476. package/package/components/apps/components/inputs/AppCheckbox.svelte +6 -6
  477. package/package/components/apps/components/inputs/AppCodeInputComponent.svelte +6 -5
  478. package/package/components/apps/components/inputs/AppDateInput.svelte +4 -4
  479. package/package/components/apps/components/inputs/AppDateSelect.svelte +4 -4
  480. package/package/components/apps/components/inputs/AppDateSliderInput.svelte +5 -4
  481. package/package/components/apps/components/inputs/AppDateTimeInput.svelte +4 -4
  482. package/package/components/apps/components/inputs/AppFileInput.svelte +4 -4
  483. package/package/components/apps/components/inputs/AppMultiSelectV2.svelte +5 -4
  484. package/package/components/apps/components/inputs/AppNumberInput.svelte +4 -4
  485. package/package/components/apps/components/inputs/AppQuillEditor.svelte +3 -2
  486. package/package/components/apps/components/inputs/AppRangeInput.svelte +5 -4
  487. package/package/components/apps/components/inputs/AppS3FileInput.svelte +4 -4
  488. package/package/components/apps/components/inputs/AppSelect.svelte +8 -7
  489. package/package/components/apps/components/inputs/AppSelectStep.svelte +5 -4
  490. package/package/components/apps/components/inputs/AppSelectTab.svelte +4 -4
  491. package/package/components/apps/components/inputs/AppSliderInputs.svelte +5 -4
  492. package/package/components/apps/components/inputs/AppTextInput.svelte +4 -4
  493. package/package/components/apps/components/inputs/AppTimeInput.svelte +4 -4
  494. package/package/components/apps/components/inputs/AppUserResource.svelte +4 -4
  495. package/package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +5 -4
  496. package/package/components/apps/components/inputs/currency/CurrencyInput.svelte +3 -1
  497. package/package/components/apps/components/layout/AppConditionalWrapper.svelte +5 -5
  498. package/package/components/apps/components/layout/AppContainer.svelte +3 -3
  499. package/package/components/apps/components/layout/AppDecisionTree.svelte +5 -5
  500. package/package/components/apps/components/layout/AppDivider.svelte +3 -3
  501. package/package/components/apps/components/layout/AppDrawer.svelte +7 -6
  502. package/package/components/apps/components/layout/AppList.svelte +5 -5
  503. package/package/components/apps/components/layout/AppModal.svelte +9 -7
  504. package/package/components/apps/components/layout/AppModal.svelte.d.ts +1 -0
  505. package/package/components/apps/components/layout/AppSplitpanes.svelte +8 -6
  506. package/package/components/apps/components/layout/AppStepper.svelte +6 -6
  507. package/package/components/apps/components/layout/AppTabs.svelte +8 -8
  508. package/package/components/apps/components/layout/ListWrapper.svelte +6 -2
  509. package/package/components/apps/components/layout/RowWrapper.svelte +6 -2
  510. package/package/components/apps/editor/AppEditor.svelte +11 -11
  511. package/package/components/apps/editor/AppEditorHeader.svelte +21 -4
  512. package/package/components/apps/editor/AppEditorHeaderDeploy.svelte +41 -1
  513. package/package/components/apps/editor/AppEditorHeaderDeploy.svelte.d.ts +2 -1
  514. package/package/components/apps/editor/AppExportButton.svelte +4 -4
  515. package/package/components/apps/editor/AppExportButton.svelte.d.ts +3 -20
  516. package/package/components/apps/editor/AppInputs.svelte +1 -1
  517. package/package/components/apps/editor/AppInputs.svelte.d.ts +2 -17
  518. package/package/components/apps/editor/AppJsonEditor.svelte +5 -5
  519. package/package/components/apps/editor/AppJsonEditor.svelte.d.ts +3 -7
  520. package/package/components/apps/editor/AppPreview.svelte +17 -16
  521. package/package/components/apps/editor/ComponentHeader.svelte +1 -1
  522. package/package/components/apps/editor/DecisionTreeDebug.svelte +4 -4
  523. package/package/components/apps/editor/GridEditor.svelte +1 -0
  524. package/package/components/apps/editor/GridViewer.svelte +3 -3
  525. package/package/components/apps/editor/RecomputeAllComponents.svelte +13 -8
  526. package/package/components/apps/editor/RecomputeAllComponents.svelte.d.ts +2 -17
  527. package/package/components/apps/editor/SubGridEditor.svelte +4 -2
  528. package/package/components/apps/editor/appPolicy.js +6 -5
  529. package/package/components/apps/editor/appUtils.d.ts +1 -1
  530. package/package/components/apps/editor/commonAppUtils.d.ts +1 -1
  531. package/package/components/apps/editor/commonAppUtils.js +1 -1
  532. package/package/components/apps/editor/component/Component.svelte +2 -2
  533. package/package/components/apps/editor/component/components.d.ts +19 -2
  534. package/package/components/apps/editor/component/components.js +43 -39
  535. package/package/components/apps/editor/componentsPanel/CssHelperPanel.svelte +10 -7
  536. package/package/components/apps/editor/componentsPanel/CssHelperPanel.svelte.d.ts +1 -1
  537. package/package/components/apps/editor/componentsPanel/CssProperty.svelte +3 -1
  538. package/package/components/apps/editor/componentsPanel/CustomComponentsList.svelte +7 -7
  539. package/package/components/apps/editor/componentsPanel/CustomComponentsList.svelte.d.ts +1 -1
  540. package/package/components/apps/editor/componentsPanel/NameEditor.svelte +2 -2
  541. package/package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +3 -4
  542. package/package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +3 -3
  543. package/package/components/apps/editor/componentsPanel/ThemeList.svelte +5 -5
  544. package/package/components/apps/editor/componentsPanel/ThemeList.svelte.d.ts +1 -1
  545. package/package/components/apps/editor/componentsPanel/ThemeNameEditor.svelte +2 -2
  546. package/package/components/apps/editor/contextPanel/ComponentOutput.svelte +2 -2
  547. package/package/components/apps/editor/contextPanel/DebugPanel.svelte +4 -4
  548. package/package/components/apps/editor/contextPanel/DebugPanel.svelte.d.ts +2 -17
  549. package/package/components/apps/editor/contextPanel/components/Output.svelte +6 -1
  550. package/package/components/apps/editor/contextPanel/components/Output.svelte.d.ts +1 -0
  551. package/package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +14 -2
  552. package/package/components/apps/editor/inlineScriptsPanel/CacheTtlPopup.svelte +1 -1
  553. package/package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +1 -1
  554. package/package/components/apps/editor/settingsPanel/ComponentControl.svelte +3 -2
  555. package/package/components/apps/editor/settingsPanel/ContextVariables.svelte +6 -6
  556. package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +4 -4
  557. package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +0 -1
  558. package/package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -2
  559. package/package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +1 -1
  560. package/package/components/apps/editor/settingsPanel/StylePanel.svelte +66 -29
  561. package/package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +2 -17
  562. package/package/components/apps/editor/settingsPanel/common/PanelSection.svelte +3 -2
  563. package/package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +10 -0
  564. package/package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte +6 -5
  565. package/package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +2 -2
  566. package/package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +3 -2
  567. package/package/components/apps/inputType.d.ts +2 -2
  568. package/package/components/apps/svelte-grid/Grid.svelte +4 -4
  569. package/package/components/apps/svelte-grid/MoveResize.svelte +5 -5
  570. package/package/components/assets/AssetButtons.svelte +33 -33
  571. package/package/components/assets/AssetButtons.svelte.d.ts +1 -4
  572. package/package/components/assets/AssetColumnBadges.svelte +37 -0
  573. package/package/components/assets/AssetColumnBadges.svelte.d.ts +10 -0
  574. package/package/components/assets/AssetsDropdownButton.svelte +16 -16
  575. package/package/components/assets/AssetsUsageDrawer.svelte +23 -19
  576. package/package/components/assets/JobAssetsViewer.svelte +12 -8
  577. package/package/components/assets/VolumeDetailDrawer.svelte +101 -0
  578. package/package/components/assets/VolumeDetailDrawer.svelte.d.ts +9 -0
  579. package/package/components/assets/VolumesDrawer.svelte +191 -0
  580. package/package/components/assets/VolumesDrawer.svelte.d.ts +8 -0
  581. package/package/components/assets/assetsFilter.d.ts +54 -0
  582. package/package/components/assets/assetsFilter.js +47 -0
  583. package/package/components/assets/lib.d.ts +3 -2
  584. package/package/components/assets/lib.js +12 -1
  585. package/package/components/auditLogs/AuditLogsFilters.svelte +28 -2
  586. package/package/components/chartjs-wrappers/Chart.svelte +4 -4
  587. package/package/components/common/FileProgressBar.svelte +9 -7
  588. package/package/components/common/FileProgressBar.svelte.d.ts +5 -27
  589. package/package/components/common/InlineCalendarInput.svelte +584 -0
  590. package/package/components/common/InlineCalendarInput.svelte.d.ts +31 -0
  591. package/package/components/common/alert/Alert.svelte +2 -8
  592. package/package/components/common/alert/Notification.svelte +2 -2
  593. package/package/components/common/alert/Notification.svelte.d.ts +4 -18
  594. package/package/components/common/alert/model.d.ts +1 -0
  595. package/package/components/common/alert/model.js +7 -0
  596. package/package/components/common/badge/Badge.svelte +7 -3
  597. package/package/components/common/badge/Badge.svelte.d.ts +1 -0
  598. package/package/components/common/breadcrumb/Breadcrumb.svelte +10 -14
  599. package/package/components/common/breadcrumb/Breadcrumb.svelte.d.ts +8 -23
  600. package/package/components/common/button/AnimatedButton.svelte +3 -9
  601. package/package/components/common/button/AnimatedButton.svelte.d.ts +5 -27
  602. package/package/components/common/button/AnimatedButtonInner.svelte +6 -12
  603. package/package/components/common/button/AnimatedButtonInner.svelte.d.ts +5 -27
  604. package/package/components/common/button/Button.svelte +5 -5
  605. package/package/components/common/button/PulseButton.svelte +15 -19
  606. package/package/components/common/button/PulseButton.svelte.d.ts +10 -48
  607. package/package/components/common/button/RefreshButton.svelte +3 -2
  608. package/package/components/common/button/RefreshButton.svelte.d.ts +1 -1
  609. package/package/components/common/button/RoundIconButton.svelte +5 -5
  610. package/package/components/common/button/RoundIconButton.svelte.d.ts +6 -28
  611. package/package/components/common/button/UndoRedo.svelte +1 -2
  612. package/package/components/common/button/UndoRedo.svelte.d.ts +6 -5
  613. package/package/components/common/calendarPicker/CalendarPicker.svelte +44 -43
  614. package/package/components/common/calendarPicker/CalendarPicker.svelte.d.ts +11 -11
  615. package/package/components/common/clearableInput/ClearableInput.svelte +28 -27
  616. package/package/components/common/clearableInput/ClearableInput.svelte.d.ts +11 -37
  617. package/package/components/common/confirmationModal/ConfirmationModal.svelte +1 -1
  618. package/package/components/common/confirmationModal/DraftTriggersConfirmationModal.svelte +2 -2
  619. package/package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +3 -3
  620. package/package/components/common/contextmenu/ContextMenu.svelte +14 -4
  621. package/package/components/common/contextmenu/ContextMenu.svelte.d.ts +2 -0
  622. package/package/components/common/contextmenu/contextMenuStyles.d.ts +4 -0
  623. package/package/components/common/contextmenu/contextMenuStyles.js +4 -0
  624. package/package/components/common/drawer/Disposable.svelte +3 -3
  625. package/package/components/common/drawer/DrawerContent.svelte +1 -1
  626. package/package/components/common/fileInput/FileInput.svelte +16 -30
  627. package/package/components/common/fileInput/FileInput.svelte.d.ts +24 -32
  628. package/package/components/common/fileUpload/FileUploadModal.svelte +2 -4
  629. package/package/components/common/fileUpload/FileUploadModal.svelte.d.ts +7 -6
  630. package/package/components/common/kbd/Kbd.svelte +4 -3
  631. package/package/components/common/languageIcons/LanguageIcon.svelte +21 -4
  632. package/package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
  633. package/package/components/common/layout/ListElement.svelte +5 -1
  634. package/package/components/common/layout/ListElement.svelte.d.ts +5 -25
  635. package/package/components/common/menu/MenuItem.svelte +9 -4
  636. package/package/components/common/menu/MenuItem.svelte.d.ts +5 -29
  637. package/package/components/common/menu/ResolveOpen.svelte +6 -3
  638. package/package/components/common/menu/ResolveOpen.svelte.d.ts +8 -4
  639. package/package/components/common/modal/AlwaysMountedModal.svelte +11 -15
  640. package/package/components/common/modal/AlwaysMountedModal.svelte.d.ts +8 -32
  641. package/package/components/common/modal/Modal2.svelte +12 -20
  642. package/package/components/common/modal/Modal2.svelte.d.ts +10 -36
  643. package/package/components/common/popup/PopupV2.svelte +3 -2
  644. package/package/components/common/seconds/SecondsInput.svelte +158 -67
  645. package/package/components/common/seconds/SecondsInput.svelte.d.ts +9 -21
  646. package/package/components/common/sidebar/SidebarNavigation.svelte +50 -0
  647. package/package/components/common/sidebar/SidebarNavigation.svelte.d.ts +25 -0
  648. package/package/components/common/stepper/Stepper.svelte +4 -9
  649. package/package/components/common/stepper/Stepper.svelte.d.ts +10 -9
  650. package/package/components/common/table/AppRow.svelte +25 -20
  651. package/package/components/common/table/AppRow.svelte.d.ts +2 -2
  652. package/package/components/common/table/FlowRow.svelte +25 -20
  653. package/package/components/common/table/FlowRow.svelte.d.ts +2 -2
  654. package/package/components/common/table/RawAppRow.svelte +5 -82
  655. package/package/components/common/table/RawAppRow.svelte.d.ts +2 -23
  656. package/package/components/common/table/Row.svelte +7 -6
  657. package/package/components/common/table/Row.svelte.d.ts +2 -3
  658. package/package/components/common/table/RowIcon.svelte +40 -11
  659. package/package/components/common/table/RowIcon.svelte.d.ts +6 -18
  660. package/package/components/common/table/ScriptRow.svelte +43 -36
  661. package/package/components/common/table/ScriptRow.svelte.d.ts +2 -2
  662. package/package/components/common/table/Table.svelte +5 -1
  663. package/package/components/common/table/Table.svelte.d.ts +5 -25
  664. package/package/components/common/tabs/Tabs.svelte +2 -2
  665. package/package/components/common/tabs/TabsV2.svelte +1 -1
  666. package/package/components/common/toggleButton-v2/ToggleButton.svelte +0 -1
  667. package/package/components/common/toggleButton-v2/ToggleButtonGroup.svelte +1 -1
  668. package/package/components/common/toggleButton-v2/ToggleButtonGroup.svelte.d.ts +1 -1
  669. package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte +10 -5
  670. package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte.d.ts +1 -0
  671. package/package/components/copilot/FlowCopilotInputsModal.svelte +14 -13
  672. package/package/components/copilot/FlowCopilotInputsModal.svelte.d.ts +6 -5
  673. package/package/components/copilot/MetadataGen.svelte +5 -5
  674. package/package/components/copilot/RegexGen.svelte +87 -80
  675. package/package/components/copilot/RegexGen.svelte.d.ts +1 -1
  676. package/package/components/copilot/ResourceGen.svelte +157 -0
  677. package/package/components/copilot/ResourceGen.svelte.d.ts +12 -0
  678. package/package/components/copilot/ScriptFix.svelte +37 -33
  679. package/package/components/copilot/ScriptGen.svelte +1 -1
  680. package/package/components/copilot/TestAIKey.svelte +1 -1
  681. package/package/components/copilot/chat/AIChat.svelte +1 -1
  682. package/package/components/copilot/chat/AIChatDisplay.svelte +52 -48
  683. package/package/components/copilot/chat/AIChatInput.svelte +64 -45
  684. package/package/components/copilot/chat/AIChatManager.svelte.js +19 -19
  685. package/package/components/copilot/chat/AssistantMessage.svelte +1 -1
  686. package/package/components/copilot/chat/AssistantMessage.svelte.d.ts +4 -18
  687. package/package/components/copilot/chat/AvailableContextList.svelte +215 -12
  688. package/package/components/copilot/chat/AvailableContextList.svelte.d.ts +1 -0
  689. package/package/components/copilot/chat/ChatMode.svelte +37 -33
  690. package/package/components/copilot/chat/ContextElementBadge.svelte +6 -8
  691. package/package/components/copilot/chat/ContextTextarea.svelte +15 -2
  692. package/package/components/copilot/chat/__tests__/app/variants/streamlined.js +1 -1
  693. package/package/components/copilot/chat/__tests__/flow/variants/minimal-single-tool.js +4 -2
  694. package/package/components/copilot/chat/app/core.js +7 -86
  695. package/package/components/copilot/chat/context.js +4 -1
  696. package/package/components/copilot/chat/flow/AIChangesWarningModal.svelte +8 -11
  697. package/package/components/copilot/chat/flow/core.js +193 -61
  698. package/package/components/copilot/chat/flow/openFlow.json +1 -1
  699. package/package/components/copilot/chat/flow/openFlowZod.d.ts +2 -2
  700. package/package/components/copilot/chat/flow/openFlowZod.js +6 -8
  701. package/package/components/copilot/chat/navigator/core.d.ts +2 -2
  702. package/package/components/copilot/chat/navigator/core.js +11 -2
  703. package/package/components/copilot/chat/script/core.js +4 -1
  704. package/package/components/copilot/chat/shared.d.ts +53 -1
  705. package/package/components/copilot/chat/shared.js +227 -1
  706. package/package/components/copilot/lib.d.ts +3 -2
  707. package/package/components/copilot/lib.js +67 -29
  708. package/package/components/custom_ui.d.ts +3 -0
  709. package/package/components/dbManagerDrawerModel.svelte.d.ts +13 -0
  710. package/package/components/dbManagerDrawerModel.svelte.js +182 -0
  711. package/package/components/dedicated_worker.d.ts +7 -0
  712. package/package/components/dedicated_worker.js +36 -0
  713. package/package/components/details/ClipboardPanel.svelte +5 -8
  714. package/package/components/details/ClipboardPanel.svelte.d.ts +8 -22
  715. package/package/components/details/DetailPageHeader.svelte +8 -23
  716. package/package/components/details/DetailPageHeader.svelte.d.ts +1 -0
  717. package/package/components/details/DetailPageLayout.svelte +1 -1
  718. package/package/components/details/ErrorHandlerToggleButton.svelte +1 -4
  719. package/package/components/details/ErrorHandlerToggleButton.svelte.d.ts +5 -19
  720. package/package/components/details/ErrorHandlerToggleButtonV2.svelte +2 -6
  721. package/package/components/details/ErrorHandlerToggleButtonV2.svelte.d.ts +6 -20
  722. package/package/components/details/createAppFromScript.d.ts +136 -16
  723. package/package/components/details/createAppFromScript.js +13 -12
  724. package/package/components/diffEditorTypes.d.ts +6 -0
  725. package/package/components/diffEditorTypes.js +1 -0
  726. package/package/components/flows/CreateActionsApp.svelte +70 -96
  727. package/package/components/flows/CreateActionsFlow.svelte +28 -28
  728. package/package/components/flows/DebounceLimit.svelte.d.ts +1 -1
  729. package/package/components/flows/FlowAssetsHandler.svelte +4 -6
  730. package/package/components/flows/FlowModuleIcon.svelte +4 -3
  731. package/package/components/flows/FlowProgressBar.svelte +37 -1
  732. package/package/components/flows/FlowProgressBar.svelte.d.ts +3 -0
  733. package/package/components/flows/agentToolUtils.d.ts +18 -0
  734. package/package/components/flows/agentToolUtils.js +47 -0
  735. package/package/components/flows/common/FlowCardHeader.svelte +11 -11
  736. package/package/components/flows/content/AgentToolWrapper.svelte +1 -1
  737. package/package/components/flows/content/DynamicInputHelpBox.svelte +1 -1
  738. package/package/components/flows/content/DynamicInputHelpBox.svelte.d.ts +2 -17
  739. package/package/components/flows/content/FlowEditorPanel.svelte +14 -1
  740. package/package/components/flows/content/FlowEnvironmentVariables.svelte +131 -34
  741. package/package/components/flows/content/FlowFailureModule.svelte +2 -3
  742. package/package/components/flows/content/FlowFailureModule.svelte.d.ts +4 -18
  743. package/package/components/flows/content/FlowInputs.svelte +20 -2
  744. package/package/components/flows/content/FlowInputsQuick.svelte +21 -0
  745. package/package/components/flows/content/FlowLoop.svelte +5 -6
  746. package/package/components/flows/content/FlowModuleCache.svelte +1 -3
  747. package/package/components/flows/content/FlowModuleComponent.svelte +24 -8
  748. package/package/components/flows/content/FlowModuleMockTransitionMessage.svelte +13 -13
  749. package/package/components/flows/content/FlowModuleMockTransitionMessage.svelte.d.ts +2 -17
  750. package/package/components/flows/content/FlowModuleScript.svelte +1 -1
  751. package/package/components/flows/content/FlowModuleSleep.svelte +1 -1
  752. package/package/components/flows/content/FlowPathViewer.svelte +7 -5
  753. package/package/components/flows/content/FlowPathViewer.svelte.d.ts +4 -18
  754. package/package/components/flows/content/FlowPreprocessorModule.svelte +2 -3
  755. package/package/components/flows/content/FlowPreprocessorModule.svelte.d.ts +4 -18
  756. package/package/components/flows/content/FlowResult.svelte +77 -25
  757. package/package/components/flows/content/FlowRetries.svelte +1 -1
  758. package/package/components/flows/content/FlowSelectionPanel.svelte +34 -10
  759. package/package/components/flows/content/FlowSelectionPanel.svelte.d.ts +5 -0
  760. package/package/components/flows/content/FlowSettings.svelte +70 -25
  761. package/package/components/flows/content/FlowWhileLoop.svelte +2 -1
  762. package/package/components/flows/content/GenAiQuick.svelte +6 -6
  763. package/package/components/flows/content/GenAiQuick.svelte.d.ts +7 -6
  764. package/package/components/flows/content/ScriptEditorDrawer.svelte +5 -4
  765. package/package/components/flows/content/SuspendDrawer.svelte +4 -4
  766. package/package/components/flows/content/SuspendDrawer.svelte.d.ts +4 -18
  767. package/package/components/flows/flowModuleNextId.d.ts +1 -0
  768. package/package/components/flows/flowModuleNextId.js +11 -0
  769. package/package/components/flows/flowState.js +6 -0
  770. package/package/components/flows/flowStateUtils.svelte.d.ts +1 -1
  771. package/package/components/flows/flowStateUtils.svelte.js +4 -1
  772. package/package/components/flows/flowStore.svelte.d.ts +1 -1
  773. package/package/components/flows/flowStore.svelte.js +4 -2
  774. package/package/components/flows/header/FlowPreviewButtons.svelte +12 -1
  775. package/package/components/flows/header/FlowYamlEditor.svelte +6 -2
  776. package/package/components/flows/map/FlowJobsMenu.svelte +4 -0
  777. package/package/components/flows/map/FlowJobsMenu.svelte.d.ts +2 -2
  778. package/package/components/flows/map/FlowModuleSchemaItem.svelte +65 -54
  779. package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +2 -2
  780. package/package/components/flows/map/FlowModuleSchemaItemViewer.svelte +11 -9
  781. package/package/components/flows/map/FlowModuleSchemaItemViewer.svelte.d.ts +1 -0
  782. package/package/components/flows/map/FlowModuleSchemaMap.svelte +163 -23
  783. package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +5 -2
  784. package/package/components/flows/map/InsertModuleInner.svelte +53 -21
  785. package/package/components/flows/map/InsertModuleInner.svelte.d.ts +1 -0
  786. package/package/components/flows/map/MapItem.svelte +22 -9
  787. package/package/components/flows/map/MapItem.svelte.d.ts +4 -3
  788. package/package/components/flows/map/VirtualItem.svelte +5 -2
  789. package/package/components/flows/missingInputWarnings.js +7 -0
  790. package/package/components/flows/multiSelectUtils.d.ts +26 -0
  791. package/package/components/flows/multiSelectUtils.js +122 -0
  792. package/package/components/flows/pickers/FlowScriptPicker.svelte +3 -0
  793. package/package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
  794. package/package/components/flows/pickers/FlowScriptPickerQuick.svelte +5 -6
  795. package/package/components/flows/pickers/FlowScriptPickerQuick.svelte.d.ts +9 -8
  796. package/package/components/flows/pickers/FlowToplevelNode.svelte +2 -3
  797. package/package/components/flows/pickers/FlowToplevelNode.svelte.d.ts +6 -5
  798. package/package/components/flows/pickers/PickHubApp.svelte +21 -2
  799. package/package/components/flows/pickers/PickHubFlow.svelte +21 -2
  800. package/package/components/flows/pickers/PickHubScript.svelte +12 -1
  801. package/package/components/flows/pickers/PickHubScriptQuick.svelte +18 -9
  802. package/package/components/flows/pickers/TopLevelNode.svelte +2 -0
  803. package/package/components/flows/previousResults.d.ts +1 -1
  804. package/package/components/flows/propPicker/JobPickerLight.svelte +1 -1
  805. package/package/components/flows/propPicker/JobPickerLight.svelte.d.ts +4 -18
  806. package/package/components/flows/propPicker/OutputBadge.svelte +2 -2
  807. package/package/components/flows/propPicker/OutputBadge.svelte.d.ts +6 -20
  808. package/package/components/flows/propPicker/OutputPicker.svelte +2 -1
  809. package/package/components/flows/propPicker/PropPickerWrapper.svelte +6 -12
  810. package/package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +3 -3
  811. package/package/components/flows/scheduleUtils.js +2 -2
  812. package/package/components/flows/types.d.ts +3 -6
  813. package/package/components/flows/utils.svelte.js +5 -1
  814. package/package/components/git_sync/GitSyncContext.svelte.js +74 -41
  815. package/package/components/git_sync/GitSyncModalManager.svelte +1 -1
  816. package/package/components/git_sync/GitSyncModalManager.svelte.d.ts +2 -17
  817. package/package/components/git_sync/GitSyncRepositoryCard.svelte +57 -38
  818. package/package/components/git_sync/GitSyncSection.svelte +24 -27
  819. package/package/components/graph/DragCoordinator.svelte +63 -0
  820. package/package/components/graph/DragCoordinator.svelte.d.ts +12 -0
  821. package/package/components/graph/DragGhost.svelte +138 -0
  822. package/package/components/graph/DragGhost.svelte.d.ts +10 -0
  823. package/package/components/graph/FlowGraphV2.svelte +86 -62
  824. package/package/components/graph/FlowGraphV2.svelte.d.ts +9 -3
  825. package/package/components/graph/MiniFlowGraph.svelte +82 -0
  826. package/package/components/graph/MiniFlowGraph.svelte.d.ts +11 -0
  827. package/package/components/graph/MoveHandleButton.svelte +47 -0
  828. package/package/components/graph/MoveHandleButton.svelte.d.ts +13 -0
  829. package/package/components/graph/SelectionBoundingBox.svelte +72 -20
  830. package/package/components/graph/SelectionBoundingBox.svelte.d.ts +7 -0
  831. package/package/components/graph/SelectionTool.svelte +3 -2
  832. package/package/components/graph/compoundLayout.d.ts +28 -0
  833. package/package/components/graph/compoundLayout.js +436 -0
  834. package/package/components/graph/graphBuilder.svelte.d.ts +12 -23
  835. package/package/components/graph/graphBuilder.svelte.js +27 -41
  836. package/package/components/graph/graphContext.d.ts +2 -0
  837. package/package/components/graph/model.d.ts +1 -1
  838. package/package/components/graph/moveManager.svelte.d.ts +74 -0
  839. package/package/components/graph/moveManager.svelte.js +176 -0
  840. package/package/components/graph/noteEditor.svelte.d.ts +0 -1
  841. package/package/components/graph/noteManager.svelte.d.ts +4 -0
  842. package/package/components/graph/noteManager.svelte.js +6 -0
  843. package/package/components/graph/noteUtils.svelte.d.ts +0 -1
  844. package/package/components/graph/noteUtils.svelte.js +0 -2
  845. package/package/components/graph/renderers/edges/BaseEdge.svelte +65 -24
  846. package/package/components/graph/renderers/edges/BaseEdge.svelte.d.ts +0 -1
  847. package/package/components/graph/renderers/edges/HiddenBaseEdge.svelte +1 -1
  848. package/package/components/graph/renderers/edges/HiddenBaseEdge.svelte.d.ts +4 -18
  849. package/package/components/graph/renderers/nodes/AIToolNode.svelte +7 -5
  850. package/package/components/graph/renderers/nodes/AIToolNode.svelte.d.ts +1 -0
  851. package/package/components/graph/renderers/nodes/AssetNode.svelte +51 -36
  852. package/package/components/graph/renderers/nodes/AssetNode.svelte.d.ts +1 -0
  853. package/package/components/graph/renderers/nodes/AssetsOverflowedNode.svelte +18 -14
  854. package/package/components/graph/renderers/nodes/AssetsOverflowedNode.svelte.d.ts +1 -0
  855. package/package/components/graph/renderers/nodes/BranchAllEndNode.svelte +1 -1
  856. package/package/components/graph/renderers/nodes/BranchAllStart.svelte +1 -1
  857. package/package/components/graph/renderers/nodes/BranchOneStart.svelte +1 -1
  858. package/package/components/graph/renderers/nodes/ForLoopEndNode.svelte +1 -1
  859. package/package/components/graph/renderers/nodes/ForLoopStartNode.svelte +1 -1
  860. package/package/components/graph/renderers/nodes/ModuleNode.svelte +50 -9
  861. package/package/components/graph/renderers/nodes/NewAIToolNode.svelte +13 -0
  862. package/package/components/graph/renderers/nodes/NoBranchNode.svelte +2 -2
  863. package/package/components/graph/renderers/nodes/NoBranchNode.svelte.d.ts +1 -0
  864. package/package/components/graph/renderers/nodes/NodeWrapper.svelte +21 -7
  865. package/package/components/graph/renderers/nodes/NodeWrapper.svelte.d.ts +4 -1
  866. package/package/components/graph/renderers/nodes/NoteNode.svelte +2 -2
  867. package/package/components/graph/renderers/nodes/SubflowBound.svelte +1 -1
  868. package/package/components/graph/renderers/nodes/branchOneEndNode.svelte +1 -1
  869. package/package/components/graph/renderers/triggers/TriggerButton.svelte +6 -4
  870. package/package/components/graph/renderers/triggers/TriggerButton.svelte.d.ts +5 -29
  871. package/package/components/graph/renderers/triggers/TriggerCount.svelte +1 -1
  872. package/package/components/graph/renderers/triggers/TriggerCount.svelte.d.ts +4 -18
  873. package/package/components/graph/renderers/triggers/TriggersBadge.svelte +7 -8
  874. package/package/components/graph/selectionUtils.svelte.d.ts +1 -0
  875. package/package/components/graph/selectionUtils.svelte.js +11 -1
  876. package/package/components/graph/util.d.ts +1 -4
  877. package/package/components/graph/util.js +3 -6
  878. package/package/components/graph/wacToFlow.d.ts +4 -0
  879. package/package/components/graph/wacToFlow.js +14 -0
  880. package/package/components/home/FlowIcon.svelte +2 -2
  881. package/package/components/home/FlowIcon.svelte.d.ts +5 -19
  882. package/package/components/home/Item.svelte +9 -15
  883. package/package/components/home/Item.svelte.d.ts +8 -7
  884. package/package/components/home/ItemsList.svelte +7 -13
  885. package/package/components/home/ItemsList.svelte.d.ts +1 -0
  886. package/package/components/home/ListFiltersQuick.svelte +2 -4
  887. package/package/components/home/ListFiltersQuick.svelte.d.ts +10 -9
  888. package/package/components/icons/AssetGenericIcon.svelte +3 -1
  889. package/package/components/icons/ClaudeIcon.svelte +20 -0
  890. package/package/components/icons/ClaudeIcon.svelte.d.ts +7 -0
  891. package/package/components/icons/GoogleCalendarIcon.svelte +41 -0
  892. package/package/components/icons/GoogleCalendarIcon.svelte.d.ts +7 -0
  893. package/package/components/icons/GoogleDriveIcon.svelte +30 -0
  894. package/package/components/icons/GoogleDriveIcon.svelte.d.ts +7 -0
  895. package/package/components/icons/GoogleIcon.svelte +15 -6
  896. package/package/components/icons/GoogleIcon.svelte.d.ts +5 -2
  897. package/package/components/icons/MSSqlServerIcon.svelte +111 -47
  898. package/package/components/icons/RubyIcon.svelte +2 -2
  899. package/package/components/icons/WindmillIcon2.svelte +0 -1
  900. package/package/components/instanceSettings/IndexerJobIndexSettings.svelte +94 -0
  901. package/package/components/instanceSettings/IndexerJobIndexSettings.svelte.d.ts +9 -0
  902. package/package/components/instanceSettings/IndexerLogIndexSettings.svelte +67 -0
  903. package/package/components/instanceSettings/IndexerLogIndexSettings.svelte.d.ts +9 -0
  904. package/package/components/instanceSettings/IndexerMemorySettings.svelte +242 -0
  905. package/package/components/instanceSettings/IndexerMemorySettings.svelte.d.ts +9 -0
  906. package/package/components/instanceSettings/SecretBackendConfig.svelte +15 -16
  907. package/package/components/instanceSettings/SettingCard.svelte +47 -0
  908. package/package/components/instanceSettings/SettingCard.svelte.d.ts +19 -0
  909. package/package/components/instanceSettings/SettingsSearchInput.svelte +66 -0
  910. package/package/components/instanceSettings/SettingsSearchInput.svelte.d.ts +9 -0
  911. package/package/components/instanceSettings.d.ts +52 -0
  912. package/package/components/instanceSettings.js +446 -64
  913. package/package/components/meltComponents/MeltButton.svelte +5 -10
  914. package/package/components/meltComponents/MeltButton.svelte.d.ts +12 -35
  915. package/package/components/meltComponents/Menu.svelte +6 -6
  916. package/package/components/meltComponents/Menu.svelte.d.ts +2 -2
  917. package/package/components/meltComponents/MenuItem.svelte +1 -0
  918. package/package/components/meltComponents/Menubar.svelte +3 -2
  919. package/package/components/meltComponents/Menubar.svelte.d.ts +7 -0
  920. package/package/components/meltComponents/Popover.svelte +50 -65
  921. package/package/components/meltComponents/Popover.svelte.d.ts +40 -42
  922. package/package/components/meltComponents/SideBarTab.svelte +3 -2
  923. package/package/components/meltComponents/Tooltip.svelte +15 -20
  924. package/package/components/meltComponents/Tooltip.svelte.d.ts +16 -38
  925. package/package/components/moveRenameManager.d.ts +21 -0
  926. package/package/components/moveRenameManager.js +61 -0
  927. package/package/components/progressBar/ProgressBar.svelte +69 -27
  928. package/package/components/progressBar/ProgressBar.svelte.d.ts +7 -0
  929. package/package/components/prop_picker.d.ts +0 -3
  930. package/package/components/propertyPicker/ObjectViewer.svelte +253 -165
  931. package/package/components/propertyPicker/ObjectViewerWrapper.svelte +16 -27
  932. package/package/components/propertyPicker/ObjectViewerWrapper.svelte.d.ts +16 -15
  933. package/package/components/propertyPicker/PropPicker.svelte +49 -96
  934. package/package/components/propertyPicker/PropPicker.svelte.d.ts +11 -11
  935. package/package/components/propertyPicker/PropPickerResult.svelte +1 -5
  936. package/package/components/propertyPicker/PropPickerResult.svelte.d.ts +9 -8
  937. package/package/components/raw_apps/DefaultDatabaseSelector.svelte +40 -36
  938. package/package/components/raw_apps/FileTreeNode.svelte +3 -2
  939. package/package/components/raw_apps/RawAppBackgroundRunner.svelte +3 -2
  940. package/package/components/raw_apps/RawAppEditor.svelte +20 -16
  941. package/package/components/raw_apps/RawAppEditor.svelte.d.ts +4 -4
  942. package/package/components/raw_apps/RawAppEditorHeader.svelte +87 -8
  943. package/package/components/raw_apps/RawAppEditorHeader.svelte.d.ts +1 -1
  944. package/package/components/raw_apps/RawAppInlineScriptEditor.svelte.d.ts +1 -2
  945. package/package/components/raw_apps/RawAppInlineScriptPanelList.svelte +41 -1
  946. package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte +0 -1
  947. package/package/components/raw_apps/RawAppInlineScriptsPanel.svelte.d.ts +0 -1
  948. package/package/components/raw_apps/RawAppInputsSpecEditor.svelte +4 -4
  949. package/package/components/raw_apps/RawAppInputsSpecEditor.svelte.d.ts +0 -1
  950. package/package/components/raw_apps/RawAppSidebar.svelte +32 -284
  951. package/package/components/raw_apps/RawAppSidebar.svelte.d.ts +1 -1
  952. package/package/components/raw_apps/RunnableRow.svelte +88 -34
  953. package/package/components/raw_apps/RunnableRow.svelte.d.ts +4 -0
  954. package/package/components/raw_apps/fileTreeUtils.js +2 -3
  955. package/package/components/raw_apps/utils.js +6 -1
  956. package/package/components/recording/FlowRecordingReplay.svelte +210 -0
  957. package/package/components/recording/FlowRecordingReplay.svelte.d.ts +7 -0
  958. package/package/components/recording/ScriptRecordingReplay.svelte +210 -0
  959. package/package/components/recording/ScriptRecordingReplay.svelte.d.ts +7 -0
  960. package/package/components/recording/flowRecording.svelte.d.ts +22 -0
  961. package/package/components/recording/flowRecording.svelte.js +205 -0
  962. package/package/components/recording/scriptRecording.svelte.d.ts +9 -0
  963. package/package/components/recording/scriptRecording.svelte.js +88 -0
  964. package/package/components/recording/types.d.ts +39 -0
  965. package/package/components/recording/types.js +1 -0
  966. package/package/components/resources/resourcesFilter.d.ts +74 -0
  967. package/package/components/resources/resourcesFilter.js +65 -0
  968. package/package/components/runs/BatchReRunOptionsPane.svelte +130 -121
  969. package/package/components/runs/BatchReRunOptionsPane.svelte.d.ts +3 -2
  970. package/package/components/runs/FlowExecutionStatus.svelte +30 -0
  971. package/package/components/runs/FlowExecutionStatus.svelte.d.ts +15 -0
  972. package/package/components/runs/JobDetailFieldConfig.d.ts +47 -0
  973. package/package/components/runs/JobDetailFieldConfig.js +433 -0
  974. package/package/components/runs/JobDetailHeader.svelte +551 -0
  975. package/package/components/runs/JobDetailHeader.svelte.d.ts +17 -0
  976. package/package/components/runs/JobRunsPreview.svelte +182 -219
  977. package/package/components/runs/JobRunsPreview.svelte.d.ts +0 -1
  978. package/package/components/runs/JobStatusIcon.svelte +47 -0
  979. package/package/components/runs/JobStatusIcon.svelte.d.ts +9 -0
  980. package/package/components/runs/MobileFilters.svelte +15 -10
  981. package/package/components/runs/MobileFilters.svelte.d.ts +4 -18
  982. package/package/components/runs/PreprocessedArgsDisplay.svelte +2 -10
  983. package/package/components/runs/PreprocessedArgsDisplay.svelte.d.ts +4 -18
  984. package/package/components/runs/QueuePopover.svelte +2 -2
  985. package/package/components/runs/QueuePopover.svelte.d.ts +4 -18
  986. package/package/components/runs/RunBadges.svelte +40 -35
  987. package/package/components/runs/RunBadges.svelte.d.ts +2 -1
  988. package/package/components/runs/RunRow.svelte +24 -64
  989. package/package/components/runs/RunRow.svelte.d.ts +1 -2
  990. package/package/components/runs/RunsTable.svelte +317 -131
  991. package/package/components/runs/RunsTable.svelte.d.ts +5 -3
  992. package/package/components/runs/TimeframeSelect.svelte +189 -0
  993. package/package/components/runs/TimeframeSelect.svelte.d.ts +44 -0
  994. package/package/components/runs/runsFilter.d.ts +217 -0
  995. package/package/components/runs/runsFilter.js +198 -0
  996. package/package/components/runs/useJobsLoader.svelte.d.ts +13 -8
  997. package/package/components/runs/useJobsLoader.svelte.js +214 -75
  998. package/package/components/schedules/schedulesFilter.d.ts +69 -0
  999. package/package/components/schedules/schedulesFilter.js +64 -0
  1000. package/package/components/schema/AddProperty.svelte +1 -1
  1001. package/package/components/schema/AddProperty.svelte.d.ts +5 -6
  1002. package/package/components/schema/AddPropertyForm.svelte +1 -1
  1003. package/package/components/schema/AddPropertyForm.svelte.d.ts +1 -1
  1004. package/package/components/schema/EditableSchemaSdkWrapper.svelte +3 -2
  1005. package/package/components/schema/EditableSchemaWrapper.svelte +43 -22
  1006. package/package/components/schema/EditableSchemaWrapper.svelte.d.ts +1 -1
  1007. package/package/components/schema/FlowPropertyEditor.svelte +1 -5
  1008. package/package/components/schema/FlowPropertyEditor.svelte.d.ts +1 -1
  1009. package/package/components/schema/PropertyEditor.svelte +1 -0
  1010. package/package/components/schema/RunningJobSchemaPicker.svelte +32 -31
  1011. package/package/components/schema/RunningJobSchemaPicker.svelte.d.ts +8 -7
  1012. package/package/components/schema/SchemaPickerRow.svelte +3 -3
  1013. package/package/components/schema/editable_schema_wrapper.d.ts +1 -0
  1014. package/package/components/scriptEditor/LogPanel.svelte +11 -2
  1015. package/package/components/script_builder.d.ts +1 -1
  1016. package/package/components/scripts/CreateActionsScript.svelte +0 -1
  1017. package/package/components/search/GlobalSearchModal.svelte +1 -8
  1018. package/package/components/search/QuickMenuItem.svelte +2 -2
  1019. package/package/components/search/RunsSearch.svelte +5 -1
  1020. package/package/components/select/GenericDropdown.svelte +116 -0
  1021. package/package/components/select/GenericDropdown.svelte.d.ts +37 -0
  1022. package/package/components/select/MultiSelect.svelte +1 -0
  1023. package/package/components/select/Select.svelte +18 -4
  1024. package/package/components/select/Select.svelte.d.ts +2 -1
  1025. package/package/components/select/SelectDropdown.svelte +77 -156
  1026. package/package/components/select/SelectDropdown.svelte.d.ts +4 -1
  1027. package/package/components/settings/ChangeWorkspaceColor.svelte +7 -8
  1028. package/package/components/settings/ChangeWorkspaceId.svelte +18 -15
  1029. package/package/components/settings/ChangeWorkspaceId.svelte.d.ts +4 -18
  1030. package/package/components/settings/ChangeWorkspaceName.svelte +6 -8
  1031. package/package/components/settings/CreateToken.svelte +8 -20
  1032. package/package/components/settings/PremiumInfo.svelte +302 -158
  1033. package/package/components/settings/PremiumInfo.svelte.d.ts +4 -18
  1034. package/package/components/settings/SettingsPageHeader.svelte +22 -0
  1035. package/package/components/settings/SettingsPageHeader.svelte.d.ts +10 -0
  1036. package/package/components/settings/TokensTable.svelte +74 -14
  1037. package/package/components/settings/WorkspaceUserSettings.svelte +13 -24
  1038. package/package/components/sidebar/CriticalAlertModal.svelte +33 -30
  1039. package/package/components/sidebar/CriticalAlertModal.svelte.d.ts +4 -18
  1040. package/package/components/sidebar/CriticalAlertModalInner.svelte +28 -22
  1041. package/package/components/sidebar/CriticalAlertModalInner.svelte.d.ts +5 -20
  1042. package/package/components/sidebar/CriticalAlertTable.svelte +4 -13
  1043. package/package/components/sidebar/CriticalAlertTable.svelte.d.ts +4 -18
  1044. package/package/components/sidebar/DarkModeToggle.svelte +4 -5
  1045. package/package/components/sidebar/DarkModeToggle.svelte.d.ts +5 -20
  1046. package/package/components/sidebar/FavoriteMenu.svelte +101 -20
  1047. package/package/components/sidebar/FavoriteMenu.svelte.d.ts +29 -1
  1048. package/package/components/sidebar/MenuButton.svelte +12 -9
  1049. package/package/components/sidebar/MenuButton.svelte.d.ts +2 -0
  1050. package/package/components/sidebar/MenuLink.svelte +4 -3
  1051. package/package/components/sidebar/MultiplayerMenu.svelte +12 -7
  1052. package/package/components/sidebar/MultiplayerMenu.svelte.d.ts +2 -17
  1053. package/package/components/sidebar/OperatorMenu.svelte +3 -1
  1054. package/package/components/sidebar/OperatorMenu.svelte.d.ts +6 -1
  1055. package/package/components/sidebar/SideBarNotification.svelte +1 -2
  1056. package/package/components/sidebar/SideBarNotification.svelte.d.ts +4 -18
  1057. package/package/components/sidebar/SidebarContent.svelte +6 -6
  1058. package/package/components/sidebar/WorkspaceMenu.svelte +7 -6
  1059. package/package/components/splitPanes/AnimatedPane.svelte +2 -2
  1060. package/package/components/splitPanes/SplitPanesWrapper.svelte +11 -15
  1061. package/package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +12 -28
  1062. package/package/components/sqlTypeService.d.ts +2 -2
  1063. package/package/components/sqlTypeService.js +4 -8
  1064. package/package/components/table/AutoDataTable.svelte +2 -2
  1065. package/package/components/table/Cell.svelte +2 -2
  1066. package/package/components/table/DataTable.svelte +1 -1
  1067. package/package/components/table/DownloadCsv.svelte +1 -2
  1068. package/package/components/table/DownloadCsv.svelte.d.ts +4 -18
  1069. package/package/components/table/Head.svelte +6 -2
  1070. package/package/components/table/Head.svelte.d.ts +6 -27
  1071. package/package/components/table/Row.svelte +6 -10
  1072. package/package/components/table/Row.svelte.d.ts +11 -18
  1073. package/package/components/toast.js +1 -2
  1074. package/package/components/triggers/AddTriggersButton.svelte +11 -0
  1075. package/package/components/triggers/CaptureIcon.svelte +1 -2
  1076. package/package/components/triggers/CaptureIcon.svelte.d.ts +5 -19
  1077. package/package/components/triggers/TestTriggerConnection.svelte +1 -4
  1078. package/package/components/triggers/TestTriggerConnection.svelte.d.ts +6 -21
  1079. package/package/components/triggers/TriggerAdvancedBadges.svelte +16 -0
  1080. package/package/components/triggers/TriggerAdvancedBadges.svelte.d.ts +12 -0
  1081. package/package/components/triggers/TriggerEditorToolbar.svelte +11 -9
  1082. package/package/components/triggers/TriggerFilters.svelte +71 -0
  1083. package/package/components/triggers/TriggerFilters.svelte.d.ts +10 -0
  1084. package/package/components/triggers/TriggerTokens.svelte +8 -7
  1085. package/package/components/triggers/TriggerTokens.svelte.d.ts +6 -21
  1086. package/package/components/triggers/TriggersEditor.svelte +31 -11
  1087. package/package/components/triggers/TriggersWrapper.svelte +10 -0
  1088. package/package/components/triggers/email/EmailTriggerEditorConfigSection.svelte +1 -1
  1089. package/package/components/triggers/email/EmailTriggerEditorInner.svelte +7 -2
  1090. package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +9 -2
  1091. package/package/components/triggers/http/RouteCapture.svelte +1 -1
  1092. package/package/components/triggers/http/RouteEditorConfigSection.svelte +1 -1
  1093. package/package/components/triggers/http/RouteEditorInner.svelte +11 -2
  1094. package/package/components/triggers/kafka/KafkaTriggerEditorInner.svelte +124 -3
  1095. package/package/components/triggers/kafka/KafkaTriggersConfigSection.svelte +1 -0
  1096. package/package/components/triggers/kafka/utils.js +3 -0
  1097. package/package/components/triggers/mqtt/MqttTriggerEditorInner.svelte +12 -3
  1098. package/package/components/triggers/native/NativeTriggerEditor.svelte +22 -17
  1099. package/package/components/triggers/native/NativeTriggerTable.svelte +16 -0
  1100. package/package/components/triggers/native/services/google/GoogleCalendarPicker.svelte +112 -0
  1101. package/package/components/triggers/native/services/google/GoogleCalendarPicker.svelte.d.ts +8 -0
  1102. package/package/components/triggers/native/services/google/GoogleDrivePicker.svelte +323 -0
  1103. package/package/components/triggers/native/services/google/GoogleDrivePicker.svelte.d.ts +8 -0
  1104. package/package/components/triggers/native/services/google/GoogleTriggerForm.svelte +116 -0
  1105. package/package/components/triggers/native/services/google/GoogleTriggerForm.svelte.d.ts +12 -0
  1106. package/package/components/triggers/native/utils.d.ts +0 -1
  1107. package/package/components/triggers/native/utils.js +15 -1
  1108. package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +7 -2
  1109. package/package/components/triggers/postgres/CheckPostgresRequirement.svelte +2 -4
  1110. package/package/components/triggers/postgres/CheckPostgresRequirement.svelte.d.ts +4 -18
  1111. package/package/components/triggers/postgres/PostgresTriggerEditorInner.svelte +10 -4
  1112. package/package/components/triggers/postgres/PublicationPicker.svelte +9 -12
  1113. package/package/components/triggers/postgres/PublicationPicker.svelte.d.ts +4 -18
  1114. package/package/components/triggers/postgres/SlotPicker.svelte +4 -7
  1115. package/package/components/triggers/postgres/SlotPicker.svelte.d.ts +4 -18
  1116. package/package/components/triggers/schedules/ScheduleEditorInner.svelte +13 -3
  1117. package/package/components/triggers/sqs/SqsTriggerEditorInner.svelte +6 -1
  1118. package/package/components/triggers/testingBadge.svelte +3 -1
  1119. package/package/components/triggers/triggers.svelte.d.ts +1 -1
  1120. package/package/components/triggers/triggers.svelte.js +11 -3
  1121. package/package/components/triggers/utils.js +33 -6
  1122. package/package/components/triggers/webhook/WebhooksConfigSection.svelte +1 -1
  1123. package/package/components/triggers/websocket/WebsocketCapture.svelte +15 -13
  1124. package/package/components/triggers/websocket/WebsocketEditorConfigSection.svelte +1 -1
  1125. package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +12 -84
  1126. package/package/components/triggers.d.ts +1 -1
  1127. package/package/components/tutorials/Tutorial.svelte +2 -6
  1128. package/package/components/tutorials/Tutorial.svelte.d.ts +14 -23
  1129. package/package/components/tutorials/TutorialControls.svelte +1 -2
  1130. package/package/components/tutorials/TutorialControls.svelte.d.ts +6 -5
  1131. package/package/components/tutorials/TutorialWrapper.svelte +3 -2
  1132. package/package/components/tutorials/app/BackgroundRunnablesTutorial.svelte +2 -3
  1133. package/package/components/tutorials/app/BackgroundRunnablesTutorial.svelte.d.ts +6 -6
  1134. package/package/components/tutorials/app/ConnectionTutorial.svelte +2 -3
  1135. package/package/components/tutorials/app/ConnectionTutorial.svelte.d.ts +6 -6
  1136. package/package/components/tutorials/app/ExpressionEvaluationTutorial.svelte +2 -3
  1137. package/package/components/tutorials/app/ExpressionEvaluationTutorial.svelte.d.ts +6 -6
  1138. package/package/components/tutorials/workspace/WorkspaceOnboardingOperatorTutorial.svelte +3 -3
  1139. package/package/components/tutorials/workspace/WorkspaceOnboardingTutorial.svelte +3 -3
  1140. package/package/components/variables/variablesFilter.d.ts +60 -0
  1141. package/package/components/variables/variablesFilter.js +55 -0
  1142. package/package/components/waitJob.d.ts +1 -1
  1143. package/package/components/waitJob.js +3 -2
  1144. package/package/components/wizards/AppPicker.svelte +3 -3
  1145. package/package/components/wizards/AppPicker.svelte.d.ts +4 -18
  1146. package/package/components/wizards/DBExplorerWizard.svelte +1 -0
  1147. package/package/components/worker_group.d.ts +2 -0
  1148. package/package/components/worker_group.js +15 -0
  1149. package/package/components/workspace/WorkspaceCard.svelte +3 -2
  1150. package/package/components/workspaceSettings/AISettings.svelte +36 -42
  1151. package/package/components/workspaceSettings/AISettings.svelte.d.ts +2 -0
  1152. package/package/components/workspaceSettings/CreateWorkspace.svelte +7 -7
  1153. package/package/components/workspaceSettings/CustomInstanceDbSelect.svelte +1 -3
  1154. package/package/components/workspaceSettings/CustomInstanceDbSelect.svelte.d.ts +0 -2
  1155. package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte +3 -3
  1156. package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte.d.ts +0 -2
  1157. package/package/components/workspaceSettings/DataTableSettings.svelte +31 -25
  1158. package/package/components/workspaceSettings/DataTableSettings.svelte.d.ts +1 -0
  1159. package/package/components/workspaceSettings/DucklakeSettings.svelte +140 -170
  1160. package/package/components/workspaceSettings/DucklakeSettings.svelte.d.ts +1 -0
  1161. package/package/components/workspaceSettings/GitSyncFilterSettings.svelte +36 -68
  1162. package/package/components/workspaceSettings/ModelTokenLimits.svelte +6 -10
  1163. package/package/components/workspaceSettings/OAuthClientConfig.svelte +46 -75
  1164. package/package/components/workspaceSettings/OAuthClientConfig.svelte.d.ts +8 -1
  1165. package/package/components/workspaceSettings/RulesetEditor.svelte +292 -0
  1166. package/package/components/workspaceSettings/RulesetEditor.svelte.d.ts +9 -0
  1167. package/package/components/workspaceSettings/SettingsFooter.svelte +35 -0
  1168. package/package/components/workspaceSettings/SettingsFooter.svelte.d.ts +12 -0
  1169. package/package/components/workspaceSettings/StorageSettings.svelte +115 -48
  1170. package/package/components/workspaceSettings/StorageSettings.svelte.d.ts +1 -0
  1171. package/package/components/workspaceSettings/WorkspaceDependenciesSettings.svelte +66 -27
  1172. package/package/components/workspaceSettings/WorkspaceIntegrations.svelte +244 -79
  1173. package/package/components/workspaceSettings/WorkspaceRulesets.svelte +183 -0
  1174. package/package/components/workspaceSettings/WorkspaceRulesets.svelte.d.ts +3 -0
  1175. package/package/editorLangUtils.d.ts +1 -1
  1176. package/package/gen/core/OpenAPI.js +1 -1
  1177. package/package/gen/schemas.gen.d.ts +1253 -79
  1178. package/package/gen/schemas.gen.js +1608 -386
  1179. package/package/gen/services.gen.d.ts +320 -98
  1180. package/package/gen/services.gen.js +597 -147
  1181. package/package/gen/types.gen.d.ts +2706 -476
  1182. package/package/hub.d.ts +1 -1
  1183. package/package/hub.js +7 -0
  1184. package/package/hubPaths.json +26 -23
  1185. package/package/infer.d.ts +2 -0
  1186. package/package/infer.js +64 -14
  1187. package/package/infer.svelte.js +88 -42
  1188. package/package/mcpEndpointTools.d.ts +3 -0
  1189. package/package/mcpEndpointTools.js +574 -147
  1190. package/package/rawAppWmillTs.js +12 -11
  1191. package/package/script_helpers.d.ts +8 -5
  1192. package/package/script_helpers.js +64 -21
  1193. package/package/scripts.d.ts +1 -1
  1194. package/package/scripts.js +1 -1
  1195. package/package/storeUtils.js +8 -0
  1196. package/package/stores.d.ts +3 -1
  1197. package/package/stores.js +3 -2
  1198. package/package/svelte5Utils.svelte.js +164 -0
  1199. package/package/svelte5UtilsKit.svelte.d.ts +13 -3
  1200. package/package/svelte5UtilsKit.svelte.js +97 -20
  1201. package/package/system_prompts/prompts.d.ts +20 -20
  1202. package/package/system_prompts/prompts.js +943 -596
  1203. package/package/templates/claude_sandbox.ts.template +85 -0
  1204. package/package/toast.d.ts +5 -1
  1205. package/package/toast.js +14 -5
  1206. package/package/utils/editInFork.d.ts +3 -0
  1207. package/package/utils/editInFork.js +19 -0
  1208. package/package/utils.js +216 -9
  1209. package/package/utils_deployable.d.ts +258 -34
  1210. package/package/utils_deployable.js +66 -11
  1211. package/package/utils_workspace_deploy.d.ts +31 -0
  1212. package/package/utils_workspace_deploy.js +449 -0
  1213. package/package/validators/workspaceSettings.d.ts +12 -0
  1214. package/package/validators/workspaceSettings.js +72 -0
  1215. package/package/workspaceProtectionRules.svelte.d.ts +73 -0
  1216. package/package/workspaceProtectionRules.svelte.js +176 -0
  1217. package/package/workspace_settings.d.ts +2 -1
  1218. package/package/workspace_settings.js +28 -0
  1219. package/package.json +38 -16
  1220. package/package/components/DropdownSelect.svelte +0 -26
  1221. package/package/components/DropdownSelect.svelte.d.ts +0 -11
  1222. package/package/components/FlowPreviewResult.svelte +0 -84
  1223. package/package/components/FlowPreviewResult.svelte.d.ts +0 -20
  1224. package/package/components/copilot/chat/context.d.ts +0 -119
  1225. package/package/components/flows/propPicker/FlowPropPicker.svelte +0 -72
  1226. package/package/components/flows/propPicker/FlowPropPicker.svelte.d.ts +0 -23
  1227. package/package/components/runs/ManuelDatePicker.svelte +0 -96
  1228. package/package/components/runs/ManuelDatePicker.svelte.d.ts +0 -35
  1229. package/package/components/runs/RunsBatchActionsDropdown.svelte +0 -82
  1230. package/package/components/runs/RunsBatchActionsDropdown.svelte.d.ts +0 -15
  1231. package/package/components/runs/RunsFilter.svelte +0 -966
  1232. package/package/components/runs/RunsFilter.svelte.d.ts +0 -80
  1233. package/package/svelte5Utils.svelte.d.ts +0 -138
@@ -1,26 +1,24 @@
1
- import { z } from "zod/v3";
2
- export const flowModuleValueSchema = z.discriminatedUnion("type", [z.object({ "input_transforms": z.record(z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "content": z.string().describe("The script source code. Should export a 'main' function"), "language": z.enum(["deno", "bun", "python3", "go", "bash", "powershell", "postgresql", "mysql", "bigquery", "snowflake", "mssql", "oracledb", "graphql", "nativets", "php"]).describe("Programming language for this script"), "path": z.string().describe("Optional path for saving this script").optional(), "lock": z.string().describe("Lock file content for dependencies").optional(), "type": z.literal("rawscript"), "tag": z.string().describe("Worker group tag for execution routing").optional(), "concurrent_limit": z.number().describe("Maximum concurrent executions of this script").optional(), "concurrency_time_window_s": z.number().describe("Time window for concurrent_limit").optional(), "custom_concurrency_key": z.string().describe("Custom key for grouping concurrent executions").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional(), "assets": z.array(z.object({ "path": z.string().describe("Path to the asset"), "kind": z.enum(["s3object", "resource", "ducklake", "datatable"]).describe("Type of asset"), "access_type": z.enum(["r", "w", "rw"]).describe("Access level for this asset").optional(), "alt_access_type": z.enum(["r", "w", "rw"]).describe("Alternative access level").optional() })).describe("External resources this script accesses (S3 objects, resources, etc.)").optional() }).describe("Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms"), z.object({ "input_transforms": z.record(z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "path": z.string().describe("Path to the script in the workspace (e.g., 'f/scripts/send_email')"), "hash": z.string().describe("Optional specific version hash of the script to use").optional(), "type": z.literal("script"), "tag_override": z.string().describe("Override the script's default worker group tag").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional() }).describe("Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code"), z.object({ "input_transforms": z.record(z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments"), "path": z.string().describe("Path to the flow in the workspace (e.g., 'f/flows/process_user')"), "type": z.literal("flow") }).describe("Reference to an existing flow by path. Use this to call another flow as a subflow"), z.object({ "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'"), "iterator": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("forloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations"), z.object({ "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute in each iteration. Use stop_after_if to control when the loop ends"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("whileloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (use with caution in while loops)").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules repeatedly while a condition is true. The loop checks the condition after each iteration. Use stop_after_if on modules to control loop termination"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch condition").optional(), "expr": z.string().describe("JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"), "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute if this branch's expr is true") })).describe("Array of branches to evaluate in order. The first branch with expr evaluating to true executes"), "default": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute if no branch expressions match"), "type": z.literal("branchone") }).describe("Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch's purpose").optional(), "skip_failure": z.boolean().describe("If true, failure in this branch doesn't fail the entire flow").optional(), "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute in this branch") })).describe("Array of branches that all execute (either in parallel or sequentially)"), "type": z.literal("branchall"), "parallel": z.boolean().describe("If true, all branches execute concurrently. If false, they execute sequentially").optional() }).describe("Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently"), z.object({ "type": z.literal("identity"), "flow": z.boolean().describe("If true, marks this as a flow identity (special handling)").optional() }).describe("Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder"), z.object({ "input_transforms": z.object({ "provider": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "output_type": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "user_message": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "system_prompt": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "streaming": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "memory": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "output_schema": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "user_images": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "max_completion_tokens": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "temperature": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional() }).describe("Input parameters for the AI agent mapped to their values"), "tools": z.array(z.object({ "id": z.string().describe("Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"), "summary": z.string().describe("Short description of what this tool does (shown to the AI)").optional(), "value": z.any().superRefine((x, ctx) => {
1
+ import { z } from "zod";
2
+ export const flowModuleValueSchema = z.discriminatedUnion("type", [z.object({ "input_transforms": z.record(z.string(), z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "content": z.string().describe("The script source code. Should export a 'main' function"), "language": z.enum(["deno", "bun", "python3", "go", "bash", "powershell", "postgresql", "mysql", "bigquery", "snowflake", "mssql", "oracledb", "graphql", "nativets", "php"]).describe("Programming language for this script"), "path": z.string().describe("Optional path for saving this script").optional(), "lock": z.string().describe("Lock file content for dependencies").optional(), "type": z.literal("rawscript"), "tag": z.string().describe("Worker group tag for execution routing").optional(), "concurrent_limit": z.number().describe("Maximum concurrent executions of this script").optional(), "concurrency_time_window_s": z.number().describe("Time window for concurrent_limit").optional(), "custom_concurrency_key": z.string().describe("Custom key for grouping concurrent executions").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional(), "assets": z.array(z.object({ "path": z.string().describe("Path to the asset"), "kind": z.enum(["s3object", "resource", "ducklake", "datatable"]).describe("Type of asset"), "access_type": z.enum(["r", "w", "rw"]).describe("Access level for this asset").optional(), "alt_access_type": z.enum(["r", "w", "rw"]).describe("Alternative access level").optional() })).describe("External resources this script accesses (S3 objects, resources, etc.)").optional() }).describe("Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms"), z.object({ "input_transforms": z.record(z.string(), z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "path": z.string().describe("Path to the script in the workspace (e.g., 'f/scripts/send_email')"), "hash": z.string().describe("Optional specific version hash of the script to use").optional(), "type": z.literal("script"), "tag_override": z.string().describe("Override the script's default worker group tag").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional() }).describe("Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code"), z.object({ "input_transforms": z.record(z.string(), z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments"), "path": z.string().describe("Path to the flow in the workspace (e.g., 'f/flows/process_user')"), "type": z.literal("flow") }).describe("Reference to an existing flow by path. Use this to call another flow as a subflow"), z.object({ "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.string(), z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'"), "iterator": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("forloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations"), z.object({ "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.string(), z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute in each iteration. Use stop_after_if to control when the loop ends"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("whileloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (use with caution in while loops)").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules repeatedly while a condition is true. The loop checks the condition after each iteration. Use stop_after_if on modules to control loop termination"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch condition").optional(), "expr": z.string().describe("JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"), "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.string(), z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute if this branch's expr is true") })).describe("Array of branches to evaluate in order. The first branch with expr evaluating to true executes"), "default": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.string(), z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute if no branch expressions match"), "type": z.literal("branchone") }).describe("Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch's purpose").optional(), "skip_failure": z.boolean().describe("If true, failure in this branch doesn't fail the entire flow").optional(), "modules": z.array(z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.lazy(() => flowModuleValueSchema), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.string(), z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch")).describe("Steps to execute in this branch") })).describe("Array of branches that all execute (either in parallel or sequentially)"), "type": z.literal("branchall"), "parallel": z.boolean().describe("If true, all branches execute concurrently. If false, they execute sequentially").optional() }).describe("Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently"), z.object({ "type": z.literal("identity"), "flow": z.boolean().describe("If true, marks this as a flow identity (special handling)").optional() }).describe("Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder"), z.object({ "input_transforms": z.object({ "provider": z.discriminatedUnion("type", [z.object({ "value": z.object({ "kind": z.enum(["openai", "azure_openai", "anthropic", "mistral", "deepseek", "googleai", "groq", "openrouter", "togetherai", "customai", "aws_bedrock"]).describe("Supported AI provider types"), "resource": z.string().describe("Resource reference in format '$res:{resource_path}' pointing to provider credentials"), "model": z.string().describe("Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')") }).describe("Complete AI provider configuration with resource reference and model selection"), "type": z.literal("static") }).describe("Static provider configuration passed directly to the AI agent"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Provider configuration - can be static (ProviderConfig), JavaScript expression, or AI-determined"), "output_type": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Output format type.\nValid values: 'text' (default) - plain text response, 'image' - image generation\n"), "user_message": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("The user's prompt/message to the AI agent. Supports variable interpolation with flow.input syntax."), "system_prompt": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("System instructions that guide the AI's behavior, persona, and response style. Optional.").optional(), "streaming": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Boolean. If true, stream the AI response incrementally.\nStreaming events include: token_delta, tool_call, tool_call_arguments, tool_execution, tool_result\n").optional(), "memory": z.discriminatedUnion("type", [z.object({ "value": z.discriminatedUnion("kind", [z.object({ "kind": z.literal("off") }).describe("No conversation memory/context"), z.object({ "kind": z.literal("auto"), "context_length": z.number().int().describe("Maximum number of messages to retain in context").optional(), "memory_id": z.string().describe("Identifier for persistent memory across agent invocations").optional() }).describe("Automatic context management"), z.object({ "kind": z.literal("manual"), "messages": z.array(z.object({ "role": z.enum(["user", "assistant", "system"]), "content": z.string() }).describe("A single message in conversation history")) }).describe("Explicit message history")]).describe("Conversation memory configuration"), "type": z.literal("static") }).describe("Static memory configuration passed directly to the AI agent"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Memory configuration - can be static (MemoryConfig), JavaScript expression, or AI-determined").optional(), "output_schema": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("JSON Schema object defining structured output format. Used when you need the AI to return data in a specific shape.\nSupports standard JSON Schema properties: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, etc.\nExample: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' } }, required: ['name'] }\n").optional(), "user_images": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Array of image references for vision-capable models.\nFormat: Array<{ bucket: string, key: string }> - S3 object references\nExample: [{ bucket: 'my-bucket', key: 'images/photo.jpg' }]\n").optional(), "max_completion_tokens": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Integer. Maximum number of tokens the AI will generate in its response.\nRange: 1 to 4,294,967,295. Typical values: 256-4096 for most use cases.\n").optional(), "temperature": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Float. Controls randomness/creativity of responses.\nRange: 0.0 to 2.0 (provider-dependent)\n- 0.0 = deterministic, focused responses\n- 0.7 = balanced (common default)\n- 1.0+ = more creative/random\n").optional() }).describe("Input parameters for the AI agent mapped to their values"), "tools": z.array(z.object({ "id": z.string().describe("Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"), "summary": z.string().describe("Short description of what this tool does (shown to the AI)").optional(), "value": z.any().superRefine((x, ctx) => {
3
3
  const schemas = [z.intersection(z.object({ "tool_type": z.literal("flowmodule") }), z.lazy(() => flowModuleValueSchema)).describe("A tool implemented as a flow module (script, flow, etc.). The AI can call this like any other flow module"), z.object({ "tool_type": z.literal("mcp"), "resource_path": z.string().describe("Path to the MCP resource/server configuration"), "include_tools": z.array(z.string()).describe("Whitelist of specific tools to include from this MCP server").optional(), "exclude_tools": z.array(z.string()).describe("Blacklist of tools to exclude from this MCP server").optional() }).describe("Reference to an external MCP (Model Context Protocol) tool. The AI can call tools from MCP servers"), z.object({ "tool_type": z.literal("websearch") }).describe("A tool implemented as a websearch tool. The AI can call this like any other websearch tool")];
4
4
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
5
5
  if (schemas.length - errors.length !== 1) {
6
6
  ctx.addIssue({
7
- path: ctx.path,
8
7
  code: "invalid_union",
9
- unionErrors: errors,
8
+ errors: errors.map(e => e.issues),
10
9
  message: "Invalid input: Should pass single schema",
11
10
  });
12
11
  }
13
12
  }).describe("The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference") }).describe("A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool")).describe("Array of tools the agent can use. The agent decides which tools to call based on the task"), "type": z.literal("aiagent"), "parallel": z.boolean().describe("If true, the agent can execute multiple tool calls in parallel").optional() }).describe("AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task")]).describe("The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type");
14
- export const flowModuleSchema = z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.discriminatedUnion("type", [z.object({ "input_transforms": z.record(z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "content": z.string().describe("The script source code. Should export a 'main' function"), "language": z.enum(["deno", "bun", "python3", "go", "bash", "powershell", "postgresql", "mysql", "bigquery", "snowflake", "mssql", "oracledb", "graphql", "nativets", "php"]).describe("Programming language for this script"), "path": z.string().describe("Optional path for saving this script").optional(), "lock": z.string().describe("Lock file content for dependencies").optional(), "type": z.literal("rawscript"), "tag": z.string().describe("Worker group tag for execution routing").optional(), "concurrent_limit": z.number().describe("Maximum concurrent executions of this script").optional(), "concurrency_time_window_s": z.number().describe("Time window for concurrent_limit").optional(), "custom_concurrency_key": z.string().describe("Custom key for grouping concurrent executions").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional(), "assets": z.array(z.object({ "path": z.string().describe("Path to the asset"), "kind": z.enum(["s3object", "resource", "ducklake", "datatable"]).describe("Type of asset"), "access_type": z.enum(["r", "w", "rw"]).describe("Access level for this asset").optional(), "alt_access_type": z.enum(["r", "w", "rw"]).describe("Alternative access level").optional() })).describe("External resources this script accesses (S3 objects, resources, etc.)").optional() }).describe("Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms"), z.object({ "input_transforms": z.record(z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "path": z.string().describe("Path to the script in the workspace (e.g., 'f/scripts/send_email')"), "hash": z.string().describe("Optional specific version hash of the script to use").optional(), "type": z.literal("script"), "tag_override": z.string().describe("Override the script's default worker group tag").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional() }).describe("Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code"), z.object({ "input_transforms": z.record(z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments"), "path": z.string().describe("Path to the flow in the workspace (e.g., 'f/flows/process_user')"), "type": z.literal("flow") }).describe("Reference to an existing flow by path. Use this to call another flow as a subflow"), z.object({ "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'"), "iterator": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("forloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations"), z.object({ "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute in each iteration. Use stop_after_if to control when the loop ends"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("whileloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (use with caution in while loops)").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules repeatedly while a condition is true. The loop checks the condition after each iteration. Use stop_after_if on modules to control loop termination"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch condition").optional(), "expr": z.string().describe("JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"), "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute if this branch's expr is true") })).describe("Array of branches to evaluate in order. The first branch with expr evaluating to true executes"), "default": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute if no branch expressions match"), "type": z.literal("branchone") }).describe("Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch's purpose").optional(), "skip_failure": z.boolean().describe("If true, failure in this branch doesn't fail the entire flow").optional(), "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute in this branch") })).describe("Array of branches that all execute (either in parallel or sequentially)"), "type": z.literal("branchall"), "parallel": z.boolean().describe("If true, all branches execute concurrently. If false, they execute sequentially").optional() }).describe("Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently"), z.object({ "type": z.literal("identity"), "flow": z.boolean().describe("If true, marks this as a flow identity (special handling)").optional() }).describe("Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder"), z.object({ "input_transforms": z.object({ "provider": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "output_type": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "user_message": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "system_prompt": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "streaming": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "memory": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "output_schema": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "user_images": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "max_completion_tokens": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "temperature": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional() }).describe("Input parameters for the AI agent mapped to their values"), "tools": z.array(z.object({ "id": z.string().describe("Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"), "summary": z.string().describe("Short description of what this tool does (shown to the AI)").optional(), "value": z.any().superRefine((x, ctx) => {
13
+ export const flowModuleSchema = z.object({ "id": z.string().describe("Unique identifier for this step. Used to reference results via 'results.step_id'. Must be a valid identifier (alphanumeric, underscore, hyphen)"), "value": z.discriminatedUnion("type", [z.object({ "input_transforms": z.record(z.string(), z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "content": z.string().describe("The script source code. Should export a 'main' function"), "language": z.enum(["deno", "bun", "python3", "go", "bash", "powershell", "postgresql", "mysql", "bigquery", "snowflake", "mssql", "oracledb", "graphql", "nativets", "php"]).describe("Programming language for this script"), "path": z.string().describe("Optional path for saving this script").optional(), "lock": z.string().describe("Lock file content for dependencies").optional(), "type": z.literal("rawscript"), "tag": z.string().describe("Worker group tag for execution routing").optional(), "concurrent_limit": z.number().describe("Maximum concurrent executions of this script").optional(), "concurrency_time_window_s": z.number().describe("Time window for concurrent_limit").optional(), "custom_concurrency_key": z.string().describe("Custom key for grouping concurrent executions").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional(), "assets": z.array(z.object({ "path": z.string().describe("Path to the asset"), "kind": z.enum(["s3object", "resource", "ducklake", "datatable"]).describe("Type of asset"), "access_type": z.enum(["r", "w", "rw"]).describe("Access level for this asset").optional(), "alt_access_type": z.enum(["r", "w", "rw"]).describe("Alternative access level").optional() })).describe("External resources this script accesses (S3 objects, resources, etc.)").optional() }).describe("Inline script with code defined directly in the flow. Use 'bun' as default language if unspecified. The script receives arguments from input_transforms"), z.object({ "input_transforms": z.record(z.string(), z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments"), "path": z.string().describe("Path to the script in the workspace (e.g., 'f/scripts/send_email')"), "hash": z.string().describe("Optional specific version hash of the script to use").optional(), "type": z.literal("script"), "tag_override": z.string().describe("Override the script's default worker group tag").optional(), "is_trigger": z.boolean().describe("If true, this script is a trigger that can start the flow").optional() }).describe("Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code"), z.object({ "input_transforms": z.record(z.string(), z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs")).describe("Map of parameter names to their values (static or JavaScript expressions). These become the subflow's input arguments"), "path": z.string().describe("Path to the flow in the workspace (e.g., 'f/flows/process_user')"), "type": z.literal("flow") }).describe("Reference to an existing flow by path. Use this to call another flow as a subflow"), z.object({ "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute for each iteration. These can reference the iteration value via 'flow_input.iter.value'"), "iterator": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("forloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (faster for I/O-bound operations). Use with parallelism to control concurrency").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules in a loop over an iterator. Inside the loop, use 'flow_input.iter.value' to access the current iteration value, and 'flow_input.iter.index' for the index. Supports parallel execution for better performance on I/O-bound operations"), z.object({ "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute in each iteration. Use stop_after_if to control when the loop ends"), "skip_failures": z.boolean().describe("If true, iteration failures don't stop the loop. Failed iterations return null"), "type": z.literal("whileloopflow"), "parallel": z.boolean().describe("If true, iterations run concurrently (use with caution in while loops)").optional(), "parallelism": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "squash": z.boolean().optional() }).describe("Executes nested modules repeatedly while a condition is true. The loop checks the condition after each iteration. Use stop_after_if on modules to control loop termination"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch condition").optional(), "expr": z.string().describe("JavaScript expression that returns boolean. Can use 'results.step_id' or 'flow_input'. First true expr wins"), "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute if this branch's expr is true") })).describe("Array of branches to evaluate in order. The first branch with expr evaluating to true executes"), "default": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute if no branch expressions match"), "type": z.literal("branchone") }).describe("Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes"), z.object({ "branches": z.array(z.object({ "summary": z.string().describe("Short description of this branch's purpose").optional(), "skip_failure": z.boolean().describe("If true, failure in this branch doesn't fail the entire flow").optional(), "modules": z.array(z.lazy(() => flowModuleSchema)).describe("Steps to execute in this branch") })).describe("Array of branches that all execute (either in parallel or sequentially)"), "type": z.literal("branchall"), "parallel": z.boolean().describe("If true, all branches execute concurrently. If false, they execute sequentially").optional() }).describe("Parallel branching where all branches execute simultaneously. Unlike BranchOne, all branches run regardless of conditions. Useful for executing independent tasks concurrently"), z.object({ "type": z.literal("identity"), "flow": z.boolean().describe("If true, marks this as a flow identity (special handling)").optional() }).describe("Pass-through module that returns its input unchanged. Useful for flow structure or as a placeholder"), z.object({ "input_transforms": z.object({ "provider": z.discriminatedUnion("type", [z.object({ "value": z.object({ "kind": z.enum(["openai", "azure_openai", "anthropic", "mistral", "deepseek", "googleai", "groq", "openrouter", "togetherai", "customai", "aws_bedrock"]).describe("Supported AI provider types"), "resource": z.string().describe("Resource reference in format '$res:{resource_path}' pointing to provider credentials"), "model": z.string().describe("Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')") }).describe("Complete AI provider configuration with resource reference and model selection"), "type": z.literal("static") }).describe("Static provider configuration passed directly to the AI agent"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Provider configuration - can be static (ProviderConfig), JavaScript expression, or AI-determined"), "output_type": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Output format type.\nValid values: 'text' (default) - plain text response, 'image' - image generation\n"), "user_message": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("The user's prompt/message to the AI agent. Supports variable interpolation with flow.input syntax."), "system_prompt": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("System instructions that guide the AI's behavior, persona, and response style. Optional.").optional(), "streaming": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Boolean. If true, stream the AI response incrementally.\nStreaming events include: token_delta, tool_call, tool_call_arguments, tool_execution, tool_result\n").optional(), "memory": z.discriminatedUnion("type", [z.object({ "value": z.discriminatedUnion("kind", [z.object({ "kind": z.literal("off") }).describe("No conversation memory/context"), z.object({ "kind": z.literal("auto"), "context_length": z.number().int().describe("Maximum number of messages to retain in context").optional(), "memory_id": z.string().describe("Identifier for persistent memory across agent invocations").optional() }).describe("Automatic context management"), z.object({ "kind": z.literal("manual"), "messages": z.array(z.object({ "role": z.enum(["user", "assistant", "system"]), "content": z.string() }).describe("A single message in conversation history")) }).describe("Explicit message history")]).describe("Conversation memory configuration"), "type": z.literal("static") }).describe("Static memory configuration passed directly to the AI agent"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Memory configuration - can be static (MemoryConfig), JavaScript expression, or AI-determined").optional(), "output_schema": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("JSON Schema object defining structured output format. Used when you need the AI to return data in a specific shape.\nSupports standard JSON Schema properties: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, etc.\nExample: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' } }, required: ['name'] }\n").optional(), "user_images": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Array of image references for vision-capable models.\nFormat: Array<{ bucket: string, key: string }> - S3 object references\nExample: [{ bucket: 'my-bucket', key: 'images/photo.jpg' }]\n").optional(), "max_completion_tokens": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Integer. Maximum number of tokens the AI will generate in its response.\nRange: 1 to 4,294,967,295. Typical values: 256-4096 for most use cases.\n").optional(), "temperature": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").describe("Float. Controls randomness/creativity of responses.\nRange: 0.0 to 2.0 (provider-dependent)\n- 0.0 = deterministic, focused responses\n- 0.7 = balanced (common default)\n- 1.0+ = more creative/random\n").optional() }).describe("Input parameters for the AI agent mapped to their values"), "tools": z.array(z.object({ "id": z.string().describe("Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')"), "summary": z.string().describe("Short description of what this tool does (shown to the AI)").optional(), "value": z.any().superRefine((x, ctx) => {
15
14
  const schemas = [z.intersection(z.object({ "tool_type": z.literal("flowmodule") }), z.lazy(() => flowModuleValueSchema)).describe("A tool implemented as a flow module (script, flow, etc.). The AI can call this like any other flow module"), z.object({ "tool_type": z.literal("mcp"), "resource_path": z.string().describe("Path to the MCP resource/server configuration"), "include_tools": z.array(z.string()).describe("Whitelist of specific tools to include from this MCP server").optional(), "exclude_tools": z.array(z.string()).describe("Blacklist of tools to exclude from this MCP server").optional() }).describe("Reference to an external MCP (Model Context Protocol) tool. The AI can call tools from MCP servers"), z.object({ "tool_type": z.literal("websearch") }).describe("A tool implemented as a websearch tool. The AI can call this like any other websearch tool")];
16
15
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
17
16
  if (schemas.length - errors.length !== 1) {
18
17
  ctx.addIssue({
19
- path: ctx.path,
20
18
  code: "invalid_union",
21
- unionErrors: errors,
19
+ errors: errors.map(e => e.issues),
22
20
  message: "Invalid input: Should pass single schema",
23
21
  });
24
22
  }
25
- }).describe("The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference") }).describe("A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool")).describe("Array of tools the agent can use. The agent decides which tools to call based on the task"), "type": z.literal("aiagent"), "parallel": z.boolean().describe("If true, the agent can execute multiple tool calls in parallel").optional() }).describe("AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task")]).describe("The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type"), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch");
23
+ }).describe("The implementation of a tool. Can be a flow module (script/flow) or an MCP tool reference") }).describe("A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool")).describe("Array of tools the agent can use. The agent decides which tools to call based on the task"), "type": z.literal("aiagent"), "parallel": z.boolean().describe("If true, the agent can execute multiple tool calls in parallel").optional() }).describe("AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task")]).describe("The actual implementation of a flow step. Can be a script (inline or referenced), subflow, loop, branch, or special module type"), "stop_after_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "stop_after_all_iters_if": z.object({ "skip_if_stopped": z.boolean().describe("If true, following steps are skipped when this condition triggers").optional(), "expr": z.string().describe("JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop"), "error_message": z.string().describe("Custom error message shown when stopping").optional() }).describe("Early termination condition for a module").optional(), "skip_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to skip. Can use 'flow_input' or 'results.<step_id>'") }).describe("Conditionally skip this step based on previous results or flow inputs").optional(), "sleep": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "cache_ttl": z.number().describe("Cache duration in seconds for this step's results").optional(), "cache_ignore_s3_path": z.boolean().optional(), "timeout": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "delete_after_use": z.boolean().describe("If true, this step's result is deleted after use to save memory").optional(), "summary": z.string().describe("Short description of what this step does").optional(), "mock": z.object({ "enabled": z.boolean().describe("If true, return mock value instead of executing").optional(), "return_value": z.any().describe("Value to return when mocked").optional() }).describe("Mock configuration for testing without executing the actual step").optional(), "suspend": z.object({ "required_events": z.number().int().describe("Number of approvals required before continuing").optional(), "timeout": z.number().int().describe("Timeout in seconds before auto-continuing or canceling").optional(), "resume_form": z.object({ "schema": z.record(z.string(), z.any()).describe("JSON Schema for the resume form").optional() }).describe("Form schema for collecting input when resuming").optional(), "user_auth_required": z.boolean().describe("If true, only authenticated users can approve").optional(), "user_groups_required": z.discriminatedUnion("type", [z.object({ "value": z.any().describe("The static value. For resources, use format '$res:path/to/resource'").optional(), "type": z.literal("static") }).describe("Static value passed directly to the step. Use for hardcoded values or resource references like '$res:path/to/resource'"), z.object({ "expr": z.string().describe("JavaScript expression returning the value. Available variables - results (object with all previous step results), flow_input (flow inputs), flow_input.iter (in loops)"), "type": z.literal("javascript") }).describe("JavaScript expression evaluated at runtime. Can reference previous step results via 'results.step_id' or flow inputs via 'flow_input.property'. Inside loops, use 'flow_input.iter.value' for the current iteration value"), z.object({ "type": z.literal("ai") }).describe("Value resolved by the AI runtime for this input. The AI engine decides how to satisfy the parameter.")]).describe("Maps input parameters for a step. Can be a static value or a JavaScript expression that references previous results or flow inputs").optional(), "self_approval_disabled": z.boolean().describe("If true, the user who started the flow cannot approve").optional(), "hide_cancel": z.boolean().describe("If true, hide the cancel button on the approval form").optional(), "continue_on_disapprove_timeout": z.boolean().describe("If true, continue flow on timeout instead of canceling").optional() }).describe("Configuration for approval/resume steps that wait for user input").optional(), "priority": z.number().describe("Execution priority for this step (higher numbers run first)").optional(), "continue_on_error": z.boolean().describe("If true, flow continues even if this step fails").optional(), "retry": z.object({ "constant": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "seconds": z.number().int().describe("Seconds to wait between retries").optional() }).describe("Retry with constant delay between attempts").optional(), "exponential": z.object({ "attempts": z.number().int().describe("Number of retry attempts").optional(), "multiplier": z.number().int().describe("Multiplier for exponential backoff").optional(), "seconds": z.number().int().gte(1).describe("Initial delay in seconds").optional(), "random_factor": z.number().int().gte(0).lte(100).describe("Random jitter percentage (0-100) to avoid thundering herd").optional() }).describe("Retry with exponential backoff (delay doubles each time)").optional(), "retry_if": z.object({ "expr": z.string().describe("JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables") }).describe("Conditional retry based on error or result").optional() }).describe("Retry configuration for failed module executions").optional() }).describe("A single step in a flow. Can be a script, subflow, loop, or branch");
26
24
  export const flowModulesSchema = z.array(flowModuleSchema);
@@ -1,6 +1,6 @@
1
1
  import type { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources/index.mjs';
2
- import type { Tool } from '../shared';
3
- export declare const CHAT_SYSTEM_PROMPT = "\nYou are Windmill's intelligent assistant, designed to help users navigate the application and answer questions about its functionality. It is your only purpose to help the user in the context of the windmill application.\nWindmill is an open-source developer platform for building internal tools, API integrations, background jobs, workflows, and user interfaces. It offers a unified system where scripts are automatically turned into sharable UIs and can be composed into flows or embedded in custom applications.\n\nYou have access to these tools:\n1. View current buttons and inputs on the page (get_triggerable_components)\n2. Execute buttons and inputs (trigger_component) \n3. Get documentation for user requests (get_documentation)\n4. Change the AI mode to the one specified (change_mode)\n\nINSTRUCTIONS:\n- When users ask about application features or concepts, first use get_documentation internally to retrieve accurate information about how to fulfill the user's request.\n- Then immediately use the available tools to guide the user through the application. Do not wait for the user's confirmation before taking action.\n- If you detect a confirmation modal that needs user confirmation, stop the navigation and let the user know that the action is pending confirmation.\n- Use get_triggerable_components to understand available options, and then trigger the components using trigger_component. Then wait a moment before rescanning the current page, and then continue with the next step. Do this 5 times max.\n- Make sure you navigated as far as possible before responding to the user. Always use get_triggerable_components one last time to make sure you didn't miss anything.\n- If you are not able to fulfill the user's request after 5 attempts, redirect the user to the documentation.\n- If you are asked to fill a form or act on an input, input the existing json object and change the fields the user asked you to change. Take into account the prompt_for_ai field of the schema to know what and how to do changes. Then tell the user that you have updated the form, and ask him to review the changes before running the script or flow.\n- For form inputs where format starts with \"resource-\" and is not \"resource-obj\", fetch the available resources using get_available_resources, and then use the resource_path prefixed with \"$res:\" to fill the input.\n- If you are not sure about an input, set the ones you are sure about, and then ask the user for the value of the input you are not sure about.\n- If the user asks you to make an API call, switch to API mode with the change_mode tool before using the new tools you'll have access to to make the API call.\n\nGENERAL PRINCIPLES:\n- Be concise but thorough\n- Focus on taking action and completing the user's goals\n- Maintain a friendly, professional tone\n- If you encounter an error or can't complete a request, explain why and suggest alternatives\n- When asked about a specific script, flow or app, first check components directly related to the mentioned entity, before checking the other components.\n- When you do not find what you are looking for on the current page, go to the home page by looking for the \"Home\" component, then scan the components again.\n\nIMPORTANT CONSIDERATIONS:\n- The user might have changed the page in the middle of the conversation, so make sure you rescan the page on each user request instead of just responding that you cannot find what the user is asking for.\n- If you navigate to a script creation page, consider this:\n - The page opens with the settings drawer open. After doing the changes mentioned by the user, close the settings drawer.\n - Then if the user has described what he wanted the script to do, switch to script mode with the change_mode tool, and use the new tools you'll have access to to edit the script.\n- If you navigate to a flow creation page, consider this:\n - If the user has described what he wanted the flow to do, switch to flow mode with the change_mode tool before using the new tools you'll have access to to edit the flow.\n\nAlways use the provided tools purposefully and appropriately to achieve the user's goals.\nYour actions only allow you to navigate the application through the provided tools.\nWhen you complete the user's request, do not say \"I created...\" or \"I updated...\" or \"I deleted...\", but rather complete your response with precisions about how it works based on the documentation. Also drop a link to the relevant documentation if possible.\n\nExample of good behavior:\n- User: \"How can I set my AI providers?\"\n- You: <call get_documentation and fetch relevant documentation>\n- You: <call get_triggerable_components to find relevant components>\n- You: <trigger the components>\n- You: \"<precisions about the request based on the documentation>\"\n";
2
+ import { type Tool } from '../shared';
3
+ export declare const CHAT_SYSTEM_PROMPT = "\nYou are Windmill's intelligent assistant, designed to help users navigate the application and answer questions about its functionality. It is your only purpose to help the user in the context of the windmill application.\nWindmill is an open-source developer platform for building internal tools, API integrations, background jobs, workflows, and user interfaces. It offers a unified system where scripts are automatically turned into sharable UIs and can be composed into flows or embedded in custom applications.\n\nYou have access to these tools:\n1. View current buttons and inputs on the page (get_triggerable_components)\n2. Execute buttons and inputs (trigger_component)\n3. Get documentation for user requests (get_documentation)\n4. Change the AI mode to the one specified (change_mode)\n5. Search for scripts and flows in the workspace (search_workspace)\n6. Get detailed information about a specific script or flow (get_runnable_details)\n\nINSTRUCTIONS:\n- When users ask about application features or concepts, first use get_documentation internally to retrieve accurate information about how to fulfill the user's request.\n- Then immediately use the available tools to guide the user through the application. Do not wait for the user's confirmation before taking action.\n- If you detect a confirmation modal that needs user confirmation, stop the navigation and let the user know that the action is pending confirmation.\n- Use get_triggerable_components to understand available options, and then trigger the components using trigger_component. Then wait a moment before rescanning the current page, and then continue with the next step. Do this 5 times max.\n- Make sure you navigated as far as possible before responding to the user. Always use get_triggerable_components one last time to make sure you didn't miss anything.\n- If you are not able to fulfill the user's request after 5 attempts, redirect the user to the documentation.\n- If you are asked to fill a form or act on an input, input the existing json object and change the fields the user asked you to change. Take into account the prompt_for_ai field of the schema to know what and how to do changes. Then tell the user that you have updated the form, and ask him to review the changes before running the script or flow.\n- For form inputs where format starts with \"resource-\" and is not \"resource-obj\", fetch the available resources using get_available_resources, and then use the resource_path prefixed with \"$res:\" to fill the input.\n- If you are not sure about an input, set the ones you are sure about, and then ask the user for the value of the input you are not sure about.\n- If the user asks you to make an API call, switch to API mode with the change_mode tool before using the new tools you'll have access to to make the API call.\n\n- When users ask about existing scripts, flows, or building blocks in their workspace, use search_workspace to find them.\n- When users want to understand a specific script or flow (inputs, description, what it does), use get_runnable_details.\n- When users ask you to navigate to a specific script or flow, first search for it, then use the navigation tools to go to it.\n\nGENERAL PRINCIPLES:\n- Be concise but thorough\n- Focus on taking action and completing the user's goals\n- Maintain a friendly, professional tone\n- If you encounter an error or can't complete a request, explain why and suggest alternatives\n- When asked about a specific script, flow or app, first check components directly related to the mentioned entity, before checking the other components.\n- When you do not find what you are looking for on the current page, go to the home page by looking for the \"Home\" component, then scan the components again.\n\nIMPORTANT CONSIDERATIONS:\n- The user might have changed the page in the middle of the conversation, so make sure you rescan the page on each user request instead of just responding that you cannot find what the user is asking for.\n- If you navigate to a script creation page, consider this:\n - The page opens with the settings drawer open. After doing the changes mentioned by the user, close the settings drawer.\n - Then if the user has described what he wanted the script to do, switch to script mode with the change_mode tool, and use the new tools you'll have access to to edit the script.\n- If you navigate to a flow creation page, consider this:\n - If the user has described what he wanted the flow to do, switch to flow mode with the change_mode tool before using the new tools you'll have access to to edit the flow.\n\nAlways use the provided tools purposefully and appropriately to achieve the user's goals.\nYour actions only allow you to navigate the application through the provided tools.\nWhen you complete the user's request, do not say \"I created...\" or \"I updated...\" or \"I deleted...\", but rather complete your response with precisions about how it works based on the documentation. Also drop a link to the relevant documentation if possible.\n\nExample of good behavior:\n- User: \"How can I set my AI providers?\"\n- You: <call get_documentation and fetch relevant documentation>\n- You: <call get_triggerable_components to find relevant components>\n- You: <trigger the components>\n- You: \"<precisions about the request based on the documentation>\"\n";
4
4
  export declare const getDocumentationTool: Tool<{}>;
5
5
  export declare const navigatorTools: Tool<{}>[];
6
6
  export declare function prepareNavigatorSystemMessage(customPrompt?: string): ChatCompletionSystemMessageParam;